From af27465f122e72723fb5b6ed21afe95d74c8f0bd Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 14 Jul 2020 17:42:01 +0200 Subject: [PATCH 001/778] Add electron collection merger --- CommonTools/Egamma/plugins/BuildFile.xml | 9 +++++++++ .../plugins/ElectronCollectionMerger.cc | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 CommonTools/Egamma/plugins/BuildFile.xml create mode 100644 CommonTools/Egamma/plugins/ElectronCollectionMerger.cc diff --git a/CommonTools/Egamma/plugins/BuildFile.xml b/CommonTools/Egamma/plugins/BuildFile.xml new file mode 100644 index 0000000000000..d9ab959482eb9 --- /dev/null +++ b/CommonTools/Egamma/plugins/BuildFile.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/CommonTools/Egamma/plugins/ElectronCollectionMerger.cc b/CommonTools/Egamma/plugins/ElectronCollectionMerger.cc new file mode 100644 index 0000000000000..2a951029f4d8e --- /dev/null +++ b/CommonTools/Egamma/plugins/ElectronCollectionMerger.cc @@ -0,0 +1,19 @@ +/* \class ElectronCollectionMerger + * + * Producer of merged Electron collection + * + * \author: Michal Bluj, NCBJ, Poland + * + */ +#include "FWCore/Framework/interface/MakerMacros.h" +#include "CommonTools/UtilAlgos/interface/Merger.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" +#include "DataFormats/PatCandidates/interface/Electron.h" + +typedef Merger GsfElectronCollMerger; +DEFINE_FWK_MODULE(GsfElectronCollMerger); + +typedef Merger PATElectronCollMerger; +DEFINE_FWK_MODULE(PATElectronCollMerger); + From 18025e933a98a82552e8c37d043d6802361c4a31 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Fri, 29 May 2020 15:05:30 +0200 Subject: [PATCH 002/778] Phase-2 anti-e MVA payloads --- .../loadRecoTauTagMVAsFromPrepDB_cfi.py | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/RecoTauTag/Configuration/python/loadRecoTauTagMVAsFromPrepDB_cfi.py b/RecoTauTag/Configuration/python/loadRecoTauTagMVAsFromPrepDB_cfi.py index 2e0dee1dd6ac2..82bfdaea8e6a4 100644 --- a/RecoTauTag/Configuration/python/loadRecoTauTagMVAsFromPrepDB_cfi.py +++ b/RecoTauTag/Configuration/python/loadRecoTauTagMVAsFromPrepDB_cfi.py @@ -429,7 +429,41 @@ label = cms.untracked.string("RecoTauTag_antiElectronMVA6%s_%s_WP%s" % (antiElectronDiscrMVA6_2017_version, gbrForestName, WP)) ) ) - + +# MVA6 phase2 +antiElectronDiscrMVA_phase2_categories = { + '0' : "gbr_NoEleMatch_woGwoGSF_BL", + '2' : "gbr_NoEleMatch_wGwoGSF_BL", + '5' : "gbr_woGwGSF_BL", + '7' : "gbr_wGwGSF_BL", + '8' : "gbr_NoEleMatch_woGwoGSF_FWEC", + '9' : "gbr_NoEleMatch_woGwoGSF_VFWEC", + '10' : "gbr_NoEleMatch_wGwoGSF_FWEC", + '11' : "gbr_NoEleMatch_wGwoGSF_VFWEC", + '13' : "gbr_woGwGSF_FWEC", + '14' : "gbr_woGwGSF_VFWEC", + '15' : "gbr_wGwGSF_FWEC", + '16' : "gbr_wGwGSF_VFWEC" +} +antiElectronDiscrMVA_phase2_WPs = [ "Eff98", "Eff90", "Eff80", "Eff70", "Eff60" ] +antiElectronDiscrMVA_phase2_version = "v1" +for category, gbrForestName in antiElectronDiscrMVA_phase2_categories.items(): + loadRecoTauTagMVAsFromPrepDB.toGet.append( + cms.PSet( + record = cms.string('GBRWrapperRcd'), + tag = cms.string("RecoTauTag_antiElectronPhase2MVA6%s_%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName)), + label = cms.untracked.string("RecoTauTag_antiElectronPhase2MVA6%s_%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName)) + ) + ) + for WP in antiElectronDiscrMVA_phase2_WPs: + loadRecoTauTagMVAsFromPrepDB.toGet.append( + cms.PSet( + record = cms.string('PhysicsTGraphPayloadRcd'), + tag = cms.string("RecoTauTag_antiElectronPhase2MVA6%s_%s_WP%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName, WP)), + label = cms.untracked.string("RecoTauTag_antiElectronPhase2MVA6%s_%s_WP%s" % (antiElectronDiscrMVA_phase2_version, gbrForestName, WP)) + ) + ) + #### # register anti-muon discriminator MVA antiMuonDiscrMVA_WPs = [ "eff99_5", "eff99_0", "eff98_0" ] From 1c5def051036a274b3e47167ed2febf014046f41 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 14 Jul 2020 19:11:22 +0200 Subject: [PATCH 003/778] Change electron merger name --- .../plugins/ElectronCollectionMerger.cc | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/CommonTools/Egamma/plugins/ElectronCollectionMerger.cc b/CommonTools/Egamma/plugins/ElectronCollectionMerger.cc index 2a951029f4d8e..7329b562f09a4 100644 --- a/CommonTools/Egamma/plugins/ElectronCollectionMerger.cc +++ b/CommonTools/Egamma/plugins/ElectronCollectionMerger.cc @@ -1,19 +1,18 @@ -/* \class ElectronCollectionMerger - * - * Producer of merged Electron collection - * - * \author: Michal Bluj, NCBJ, Poland - * - */ -#include "FWCore/Framework/interface/MakerMacros.h" -#include "CommonTools/UtilAlgos/interface/Merger.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" -#include "DataFormats/PatCandidates/interface/Electron.h" - -typedef Merger GsfElectronCollMerger; -DEFINE_FWK_MODULE(GsfElectronCollMerger); - -typedef Merger PATElectronCollMerger; -DEFINE_FWK_MODULE(PATElectronCollMerger); - +/* \class ElectronCollectionMerger + * + * Producer of merged Electron collection + * + * \author: Michal Bluj, NCBJ, Poland + * + */ +#include "FWCore/Framework/interface/MakerMacros.h" +#include "CommonTools/UtilAlgos/interface/Merger.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" +#include "DataFormats/PatCandidates/interface/Electron.h" + +typedef Merger GsfElectronCollectionMerger; +DEFINE_FWK_MODULE(GsfElectronCollectionMerger); + +typedef Merger PATElectronCollectionMerger; +DEFINE_FWK_MODULE(PATElectronCollectionMerger); From 483badfc4282881ac125738baedded8b5fd5065b Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Thu, 16 Jul 2020 18:36:29 +0200 Subject: [PATCH 004/778] initial versions of cffs for phase2 anti-e --- ...auDiscriminationAgainstElectronMVA6_cff.py | 21 ++++++++++++ ...auDiscriminationAgainstElectronMVA6_cff.py | 34 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py create mode 100644 RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py diff --git a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py new file mode 100644 index 0000000000000..3dea065e61c96 --- /dev/null +++ b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py @@ -0,0 +1,21 @@ +import FWCore.ParameterSet.Config as cms + +# Electron collection merger +mergedSlimmedElectronsForTauId = cms.EDProducer('PATElectronCollectionMerger', + src = cms.VInputTag('slimmedElectrons', 'slimmedElectronsFromMultiClNoEB') +) +# anti-e phase-2 tauID +from RecoTauTag.RecoTau.patTauDiscriminationAgainstElectronMVA6_cfi import * +patTauDiscriminationAgainstElectronMVA6Phase2 = patTauDiscriminationAgainstElectronMVA6.clone( + #FIXME, correct settings for phase2 + srcElectrons = 'mergedSlimmedElectronsForTauId' +) + +patTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( + mergedSlimmedElectronsForTauId, + patTauDiscriminationAgainstElectronMVA6Phase2 +) + +patTauDiscriminationAgainstElectronMVA6Phase2Seq = cms.Sequence( + patTauDiscriminationAgainstElectronMVA6Phase2Task +) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py new file mode 100644 index 0000000000000..2c0c18e5eabb6 --- /dev/null +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py @@ -0,0 +1,34 @@ +import FWCore.ParameterSet.Config as cms + +# HGCal electron stuff +from RecoEgamma.EgammaTools.cleanedEcalDrivenGsfElectronsFromMultiCl_cfi import cleanedEcalDrivenGsfElectronsFromMultiCl +from RecoEgamma.EgammaTools.hgcalElectronIDValueMap_cff import hgcalElectronIDValueMap + +cleanedEcalDrivenGsfElectronsFromMultiClNoEB = cleanedEcalDrivenGsfElectronsFromMultiCl.clone( + cleanBarrel = True +) +hgcElectronIDNoEB = hgcalElectronIDValueMap.clone( + electrons = cms.InputTag("cleanedEcalDrivenGsfElectronsFromMultiClNoEB"), +) + +# Electron collection merger +mergedGsfElectronsForTauId = cms.EDProducer('GsfElectronCollectionMerger', + src = cms.VInputTag('gedGsfElectrons', 'cleanedEcalDrivenGsfElectronsFromMultiClNoEB') +) +# anti-e phase-2 tauID +from RecoTauTag.RecoTau.pfRecoTauDiscriminationAgainstElectronMVA6_cfi import * +pfRecoTauDiscriminationAgainstElectronMVA6Phase2 = pfRecoTauDiscriminationAgainstElectronMVA6.clone( + #FIXME, correct settings for phase2 + srcElectrons = 'mergedGsfElectronsForTauId' +) + +pfRecoTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( + cleanedEcalDrivenGsfElectronsFromMultiClNoEB, + hgcElectronIDNoEB, + mergedGsfElectronsForTauId, + pfRecoTauDiscriminationAgainstElectronMVA6Phase2 +) + +pfRecoTauDiscriminationAgainstElectronMVA6Phase2Seq = cms.Sequence( + pfRecoTauDiscriminationAgainstElectronMVA6Phase2Task +) From be8750d5d89de1913954dc21c112378d12ee0aca Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Wed, 26 Aug 2020 10:43:09 +0200 Subject: [PATCH 005/778] updated cff for anti-e phase2 --- ...auDiscriminationAgainstElectronMVA6_cff.py | 22 ++++++++++-- ...auDiscriminationAgainstElectronMVA6_cff.py | 36 ++++++++++++++----- 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py index 3dea065e61c96..156adc33edf2c 100644 --- a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py +++ b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py @@ -2,13 +2,29 @@ # Electron collection merger mergedSlimmedElectronsForTauId = cms.EDProducer('PATElectronCollectionMerger', - src = cms.VInputTag('slimmedElectrons', 'slimmedElectronsFromMultiClNoEB') + src = cms.VInputTag('slimmedElectrons', 'slimmedElectronsFromMultiCl') ) # anti-e phase-2 tauID +from RecoTauTag.RecoTau.TauDiscriminatorTools import noPrediscriminants from RecoTauTag.RecoTau.patTauDiscriminationAgainstElectronMVA6_cfi import * patTauDiscriminationAgainstElectronMVA6Phase2 = patTauDiscriminationAgainstElectronMVA6.clone( - #FIXME, correct settings for phase2 - srcElectrons = 'mergedSlimmedElectronsForTauId' + #Note: PATTauProducer has to be set in the final cfg + Prediscriminants = noPrediscriminants, + srcElectrons = 'mergedSlimmedElectronsForTauId', + isPhase2 = True, + vetoEcalCracks = False, + mvaName_NoEleMatch_woGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL", + mvaName_NoEleMatch_wGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL", + mvaName_woGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL", + mvaName_wGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL", + mvaName_NoEleMatch_woGwoGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC", + mvaName_NoEleMatch_wGwoGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC", + mvaName_woGwGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC", + mvaName_wGwGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC", + mvaName_NoEleMatch_woGwoGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC", + mvaName_NoEleMatch_wGwoGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC", + mvaName_woGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC", + mvaName_wGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC" ) patTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py index 2c0c18e5eabb6..db6cbbedc0220 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py @@ -3,29 +3,47 @@ # HGCal electron stuff from RecoEgamma.EgammaTools.cleanedEcalDrivenGsfElectronsFromMultiCl_cfi import cleanedEcalDrivenGsfElectronsFromMultiCl from RecoEgamma.EgammaTools.hgcalElectronIDValueMap_cff import hgcalElectronIDValueMap - +# HGCal electrons cleaned against duplicates and electrons in barrel cleanedEcalDrivenGsfElectronsFromMultiClNoEB = cleanedEcalDrivenGsfElectronsFromMultiCl.clone( cleanBarrel = True ) -hgcElectronIDNoEB = hgcalElectronIDValueMap.clone( - electrons = cms.InputTag("cleanedEcalDrivenGsfElectronsFromMultiClNoEB"), -) - # Electron collection merger mergedGsfElectronsForTauId = cms.EDProducer('GsfElectronCollectionMerger', src = cms.VInputTag('gedGsfElectrons', 'cleanedEcalDrivenGsfElectronsFromMultiClNoEB') ) +# HGCal EleID with merged electron collection +hgcElectronIdForTauId = hgcalElectronIDValueMap.clone( + electrons = cms.InputTag("mergedGsfElectronsForTauId"), +) # anti-e phase-2 tauID from RecoTauTag.RecoTau.pfRecoTauDiscriminationAgainstElectronMVA6_cfi import * pfRecoTauDiscriminationAgainstElectronMVA6Phase2 = pfRecoTauDiscriminationAgainstElectronMVA6.clone( - #FIXME, correct settings for phase2 - srcElectrons = 'mergedGsfElectronsForTauId' + #Note: PFTauProducer and Prediscriminants have to be set in the final cfg + srcElectrons = 'mergedGsfElectronsForTauId', + isPhase2 = True, + vetoEcalCracks = False, + mvaName_NoEleMatch_woGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL", + mvaName_NoEleMatch_wGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL", + mvaName_woGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL", + mvaName_wGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL", + mvaName_NoEleMatch_woGwoGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC", + mvaName_NoEleMatch_wGwoGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC", + mvaName_woGwGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC", + mvaName_wGwGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC", + mvaName_NoEleMatch_woGwoGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC", + mvaName_NoEleMatch_wGwoGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC", + mvaName_woGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC", + mvaName_wGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC" ) -pfRecoTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( +electronsForTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( cleanedEcalDrivenGsfElectronsFromMultiClNoEB, - hgcElectronIDNoEB, mergedGsfElectronsForTauId, + hgcElectronIdForTauId +) + +pfRecoTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( + electronsForTauDiscriminationAgainstElectronMVA6Phase2Task, pfRecoTauDiscriminationAgainstElectronMVA6Phase2 ) From 09eab8d424e3db36590d700a43f235d31141adf4 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Wed, 26 Aug 2020 10:47:35 +0200 Subject: [PATCH 006/778] Propagate to HGCal instead of EndcapECal for phase2 --- RecoTauTag/RecoTau/BuildFile.xml | 3 + .../PositionAtECalEntranceComputer.h | 9 +- .../src/PositionAtECalEntranceComputer.cc | 125 +++++++++++++++--- 3 files changed, 120 insertions(+), 17 deletions(-) diff --git a/RecoTauTag/RecoTau/BuildFile.xml b/RecoTauTag/RecoTau/BuildFile.xml index ee15b23a648ed..19e5503d0ab85 100644 --- a/RecoTauTag/RecoTau/BuildFile.xml +++ b/RecoTauTag/RecoTau/BuildFile.xml @@ -1,6 +1,7 @@ + @@ -22,6 +23,8 @@ + + diff --git a/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h b/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h index 0b167c2568549..fcd10a3fb9d88 100644 --- a/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h +++ b/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h @@ -15,6 +15,9 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "DataFormats/Candidate/interface/Candidate.h" +#include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h" + +class MagneticField; class PositionAtECalEntranceComputer { public: @@ -24,10 +27,14 @@ class PositionAtECalEntranceComputer { void beginEvent(const edm::EventSetup&); //To do: it seems to more practical to put this to the ES - reco::Candidate::Point operator()(const reco::Candidate* particle, bool& success) const; + reco::Candidate::Point operator()(const reco::Candidate* particle, bool& success, bool isPhase2 = false) const; private: double bField_z_; + MagneticField const* bField_; + hgcal::RecHitTools recHitTools_; + float hgcalFace_z_; + static constexpr float ecalBarrelEndcapEtaBorder_ = 1.479; }; #endif // RecoTauTag_RecoTau_PositionAtECalEntranceComputer_h diff --git a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc index 391ac598bb414..587736e7a30df 100644 --- a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc +++ b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc @@ -2,37 +2,130 @@ #include "MagneticField/Engine/interface/MagneticField.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "CommonTools/BaseParticlePropagator/interface/BaseParticlePropagator.h" +#include "DataFormats/GeometrySurface/interface/Plane.h" +#include "TrackPropagation/RungeKutta/interface/defaultRKPropagator.h" #include +//HGCal helper classes +//MB: looks be copy of HGCal utils: L1Trigger/L1THGCalUtilities/plugins/ntuples/HGCalTriggerNtupleGen.cc +namespace HGCal_helpers { + class SimpleTrackPropagator { + public: + SimpleTrackPropagator(MagneticField const* f) : field_(f), prod_(field_, alongMomentum, 5.e-5), absz_target_(0) { + ROOT::Math::SMatrixIdentity id; + AlgebraicSymMatrix55 C(id); + C *= 0.001; + err_ = CurvilinearTrajectoryError(C); + } + void setPropagationTargetZ(const float& z); + + bool propagate(const double& px, + const double& py, + const double& pz, + const double& x, + const double& y, + const double& z, + const float& charge, + reco::Candidate::Point& output) const; + + private: + SimpleTrackPropagator() : field_(nullptr), prod_(field_, alongMomentum, 5e-5), absz_target_(0) {} + const RKPropagatorInS& RKProp() const { return prod_.propagator; } + Plane::PlanePointer targetPlaneForward_, targetPlaneBackward_; + MagneticField const* field_; + CurvilinearTrajectoryError err_; + defaultRKPropagator::Product prod_; + float absz_target_; + }; + void SimpleTrackPropagator::setPropagationTargetZ(const float& z) { + targetPlaneForward_ = Plane::build(Plane::PositionType(0, 0, std::abs(z)), Plane::RotationType()); + targetPlaneBackward_ = Plane::build(Plane::PositionType(0, 0, -std::abs(z)), Plane::RotationType()); + absz_target_ = std::abs(z); + } + bool SimpleTrackPropagator::propagate(const double& px, + const double& py, + const double& pz, + const double& x, + const double& y, + const double& z, + const float& charge, + reco::Candidate::Point& output) const { + typedef TrajectoryStateOnSurface TSOS; + GlobalPoint startingPosition(x, y, z); + GlobalVector startingMomentum(px, py, pz); + Plane::PlanePointer startingPlane = Plane::build(Plane::PositionType(x, y, z), Plane::RotationType()); + TSOS startingStateP( + GlobalTrajectoryParameters(startingPosition, startingMomentum, charge, field_), err_, *startingPlane); + TSOS trackStateP; + if (pz > 0) { + trackStateP = RKProp().propagate(startingStateP, *targetPlaneForward_); + } else { + trackStateP = RKProp().propagate(startingStateP, *targetPlaneBackward_); + } + if (trackStateP.isValid()) { + output.SetXYZ( + trackStateP.globalPosition().x(), trackStateP.globalPosition().y(), trackStateP.globalPosition().z()); + return true; + } + output.SetXYZ(0, 0, 0); + return false; + } +} // namespace HGCal_helpers + PositionAtECalEntranceComputer::PositionAtECalEntranceComputer() : bField_z_(-1.) {} PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer() {} void PositionAtECalEntranceComputer::beginEvent(const edm::EventSetup& es) { - edm::ESHandle bField; - es.get().get(bField); - bField_z_ = bField->inTesla(GlobalPoint(0., 0., 0.)).z(); + edm::ESHandle bFieldH; + es.get().get(bFieldH); + bField_z_ = bFieldH->inTesla(GlobalPoint(0., 0., 0.)).z(); + bField_ = &(*bFieldH); + edm::ESHandle caloGeoH; + es.get().get(caloGeoH); + recHitTools_.setGeometry(*caloGeoH); + hgcalFace_z_ = recHitTools_.getPositionLayer(1).z(); // HGCal 1st layer } reco::Candidate::Point PositionAtECalEntranceComputer::operator()(const reco::Candidate* particle, - bool& success) const { + bool& success, + bool isPhase2) const { assert(bField_z_ != -1.); - BaseParticlePropagator propagator = BaseParticlePropagator( - RawParticle(particle->p4(), - math::XYZTLorentzVector(particle->vertex().x(), particle->vertex().y(), particle->vertex().z(), 0.), - particle->charge()), - 0., - 0., - bField_z_); - propagator.propagateToEcalEntrance(false); reco::Candidate::Point position; - if (propagator.getSuccess() != 0) { - position = propagator.particle().vertex().Vect(); - success = true; - } else { + if (!isPhase2 || std::abs(particle->eta()) < ecalBarrelEndcapEtaBorder_) { // ECal + BaseParticlePropagator propagator = BaseParticlePropagator( + RawParticle(particle->p4(), + math::XYZTLorentzVector(particle->vertex().x(), particle->vertex().y(), particle->vertex().z(), 0.), + particle->charge()), + 0., + 0., + bField_z_); + propagator.propagateToEcalEntrance(false); + if (propagator.getSuccess() != 0) { + position = propagator.particle().vertex().Vect(); + success = true; + } else { + success = false; + } + } else { // HGCal success = false; + if (std::abs(particle->vertex().z()) >= hgcalFace_z_) + return position; + + HGCal_helpers::SimpleTrackPropagator propagator(bField_); + propagator.setPropagationTargetZ(hgcalFace_z_); + success = propagator.propagate(particle->px(), + particle->py(), + particle->pz(), + particle->vertex().x(), + particle->vertex().y(), + particle->vertex().z(), + particle->charge(), + position); } return position; } From c88b134f4e4c73e23acfa71a7fe7e7e903c594d0 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 1 Sep 2020 12:59:09 +0200 Subject: [PATCH 007/778] select electrons from multiCl outside barrel and with pt>10GeV --- .../PFRecoTauDiscriminationAgainstElectronMVA6_cff.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py index db6cbbedc0220..45f8e06f0a7ee 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py @@ -3,9 +3,12 @@ # HGCal electron stuff from RecoEgamma.EgammaTools.cleanedEcalDrivenGsfElectronsFromMultiCl_cfi import cleanedEcalDrivenGsfElectronsFromMultiCl from RecoEgamma.EgammaTools.hgcalElectronIDValueMap_cff import hgcalElectronIDValueMap -# HGCal electrons cleaned against duplicates and electrons in barrel -cleanedEcalDrivenGsfElectronsFromMultiClNoEB = cleanedEcalDrivenGsfElectronsFromMultiCl.clone( - cleanBarrel = True +# HGCal electrons cleaned against duplicates and electrons in barrel (pt>10GeV) +# TauValElectronSelector defined Validation/RecoTau/plugins/Selectors.cc; +# is there a more intuitive place where such a selector is defined? +cleanedEcalDrivenGsfElectronsFromMultiClNoEB = cms.EDFilter('TauValElectronSelector', + cut = cms.string('!isEB && pt >= 10.'), + src = cms.InputTag('cleanedEcalDrivenGsfElectronsFromMultiCl') ) # Electron collection merger mergedGsfElectronsForTauId = cms.EDProducer('GsfElectronCollectionMerger', @@ -37,6 +40,7 @@ ) electronsForTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( + cleanedEcalDrivenGsfElectronsFromMultiCl, cleanedEcalDrivenGsfElectronsFromMultiClNoEB, mergedGsfElectronsForTauId, hgcElectronIdForTauId From 1d09b8e56c5eb2259094bfd597e0504a88b9c327 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 8 Sep 2020 15:45:45 +0200 Subject: [PATCH 008/778] Add support for anti-e phase2 MVA6 --- .../RecoTau/interface/AntiElectronIDMVA6.h | 51 +- .../TauDiscriminationAgainstElectronMVA6.cc | 125 +++- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 674 ++++++++++++++++-- 3 files changed, 750 insertions(+), 100 deletions(-) diff --git a/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h b/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h index 16b3cf07d6382..9d4647f763b34 100644 --- a/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h +++ b/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h @@ -84,6 +84,28 @@ namespace antiElecIDMVA6_blocks { float mvaInSigmaEtaEta = 0; float mvaInHadEnergy = 0; float mvaInDeltaEta = 0; + float eSeedClusterOverPout = 0; + float superClusterEtaWidth = 0; + float superClusterPhiWidth = 0; + float sigmaIEtaIEta5x5 = 0; + float sigmaIPhiIPhi5x5 = 0; + float showerCircularity = 0; + float r9 = 0; + float hgcalSigmaUU = 0; + float hgcalSigmaVV = 0; + float hgcalSigmaEE = 0; + float hgcalSigmaPP = 0; + float hgcalNLayers = 0; + float hgcalFirstLayer = 0; + float hgcalLastLayer = 0; + float hgcalLayerEfrac10 = 0; + float hgcalLayerEfrac90 = 0; + float hgcalEcEnergyEE = 0; + float hgcalEcEnergyFH = 0; + float hgcalMeasuredDepth = 0; + float hgcalExpectedDepth = 0; + float hgcalExpectedSigma = 0; + float hgcalDepthCompatibility = 0; }; } // namespace antiElecIDMVA6_blocks @@ -103,6 +125,10 @@ class AntiElectronIDMVA6 { const antiElecIDMVA6_blocks::TauGammaMoms& tauGammaMoms, const antiElecIDMVA6_blocks::ElecVars& elecVars); + double MVAValuePhase2(const antiElecIDMVA6_blocks::TauVars& tauVars, + const antiElecIDMVA6_blocks::TauGammaMoms& tauGammaMoms, + const antiElecIDMVA6_blocks::ElecVars& elecVars); + // this function can be called for all categories double MVAValue(const TauType& theTau, const ElectronType& theEle); // this function can be called for category 1 only !! @@ -114,15 +140,18 @@ class AntiElectronIDMVA6 { antiElecIDMVA6_blocks::TauVars getTauVars(const TauType& theTau); antiElecIDMVA6_blocks::TauGammaVecs getTauGammaVecs(const TauType& theTau); antiElecIDMVA6_blocks::ElecVars getElecVars(const ElectronType& theEle); - - // track extrapolation to ECAL entrance (used to re-calculate variables that might not be available on miniAOD) - bool atECalEntrance(const reco::Candidate* part, math::XYZPoint& pos); + // overloaded method with explicit electron type to avoid partial imlementation of full class + void getElecVarsHGCalTypeSpecific(const reco::GsfElectron& theEle, antiElecIDMVA6_blocks::ElecVars& elecVars); + void getElecVarsHGCalTypeSpecific(const pat::Electron& theEle, antiElecIDMVA6_blocks::ElecVars& elecVars); private: double dCrackEta(double eta); double minimum(double a, double b); double dCrackPhi(double phi, double eta); + static constexpr float ecalBarrelEndcapEtaBorder_ = 1.479; + static constexpr float ecalEndcapVFEndcapEtaBorder_ = 2.4; + bool isInitialized_; bool loadMVAfromDB_; edm::FileInPath inputFileName_; @@ -135,6 +164,10 @@ class AntiElectronIDMVA6 { std::string mvaName_NoEleMatch_wGwoGSF_EC_; std::string mvaName_woGwGSF_EC_; std::string mvaName_wGwGSF_EC_; + std::string mvaName_NoEleMatch_woGwoGSF_VFEC_; + std::string mvaName_NoEleMatch_wGwoGSF_VFEC_; + std::string mvaName_woGwGSF_VFEC_; + std::string mvaName_wGwGSF_VFEC_; bool usePhiAtEcalEntranceExtrapolation_; @@ -146,6 +179,10 @@ class AntiElectronIDMVA6 { float* Var_NoEleMatch_wGwoGSF_Endcap_; float* Var_woGwGSF_Endcap_; float* Var_wGwGSF_Endcap_; + float* Var_NoEleMatch_woGwoGSF_VFEndcap_; + float* Var_NoEleMatch_wGwoGSF_VFEndcap_; + float* Var_woGwGSF_VFEndcap_; + float* Var_wGwGSF_VFEndcap_; const GBRForest* mva_NoEleMatch_woGwoGSF_BL_; const GBRForest* mva_NoEleMatch_wGwoGSF_BL_; @@ -155,12 +192,18 @@ class AntiElectronIDMVA6 { const GBRForest* mva_NoEleMatch_wGwoGSF_EC_; const GBRForest* mva_woGwGSF_EC_; const GBRForest* mva_wGwGSF_EC_; + const GBRForest* mva_NoEleMatch_woGwoGSF_VFEC_; + const GBRForest* mva_NoEleMatch_wGwoGSF_VFEC_; + const GBRForest* mva_woGwGSF_VFEC_; + const GBRForest* mva_wGwGSF_VFEC_; std::vector inputFilesToDelete_; PositionAtECalEntranceComputer positionAtECalEntrance_; - int verbosity_; + const bool isPhase2_; + + const int verbosity_; }; #endif diff --git a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc index b5583fd036b3e..2ad8e2a07c729 100644 --- a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc +++ b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc @@ -27,11 +27,14 @@ class TauDiscriminationAgainstElectronMVA6 : public TauDiscriminationProducerBas reco::SingleTauDiscriminatorContainer, TauDiscriminator>::TauDiscriminationProducerBase(cfg), moduleLabel_(cfg.getParameter("@module_label")), - mva_(std::make_unique >(cfg)), + mva_(std::make_unique>(cfg)), Electron_token(edm::EDConsumerBase::consumes( - cfg.getParameter("srcElectrons"))), //MB: full specification with prefix mandatory + cfg.getParameter("srcElectrons"))), // MB: full specification with prefix mandatory vetoEcalCracks_(cfg.getParameter("vetoEcalCracks")), - verbosity_(cfg.getParameter("verbosity")) {} + isPhase2_(cfg.getParameter("isPhase2")), + verbosity_(cfg.getParameter("verbosity")) { + deltaREleTauMax_ = (isPhase2_ ? 0.2 : 0.3); + } void beginEvent(const edm::Event& evt, const edm::EventSetup& es) override { mva_->beginEvent(evt, es); @@ -55,7 +58,7 @@ class TauDiscriminationAgainstElectronMVA6 : public TauDiscriminationProducerBas std::pair getTauEtaAtECalEntrance(const pat::TauRef& theTauRef) const; std::string moduleLabel_; - std::unique_ptr > mva_; + std::unique_ptr> mva_; edm::EDGetTokenT Electron_token; edm::Handle electrons_; @@ -63,8 +66,14 @@ class TauDiscriminationAgainstElectronMVA6 : public TauDiscriminationProducerBas PositionAtECalEntranceComputer positionAtECalEntrance_; + static constexpr float ecalBarrelEndcapEtaBorder_ = 1.479; + static constexpr float ecalEndcapVFEndcapEtaBorder_ = 2.4; + bool vetoEcalCracks_; + bool isPhase2_; + float deltaREleTauMax_; + int verbosity_; }; @@ -77,9 +86,7 @@ TauDiscriminationAgainstElectronMVA6::d double category = -1.; bool isGsfElectronMatched = false; - float deltaRDummy = 9.9; - - const float ECalBarrelEndcapEtaBorder = 1.479; + double deltaRDummy = 9.9; std::pair tauEtaAtECalEntrance; if (std::is_same::value || std::is_same::value) @@ -102,12 +109,17 @@ TauDiscriminationAgainstElectronMVA6::d bool hasGsfTrack = false; const reco::CandidatePtr& leadChCand = theTauRef->leadChargedHadrCand(); if (leadChCand.isNonnull()) { - const pat::PackedCandidate* packedLeadChCand = dynamic_cast(leadChCand.get()); - if (packedLeadChCand != nullptr) { - hasGsfTrack = (std::abs(packedLeadChCand->pdgId()) == 11); + if (isPhase2_) { + //MB: for phase-2 has gsf-track reads lead charged cand is pf-electron + hasGsfTrack = (std::abs(leadChCand->pdgId()) == 11); } else { - const reco::PFCandidate* pfLeadChCand = dynamic_cast(leadChCand.get()); - hasGsfTrack = (pfLeadChCand != nullptr && pfLeadChCand->gsfTrackRef().isNonnull()); + const pat::PackedCandidate* packedLeadChCand = dynamic_cast(leadChCand.get()); + if (packedLeadChCand != nullptr) { + hasGsfTrack = (std::abs(packedLeadChCand->pdgId()) == 11); + } else { + const reco::PFCandidate* pfLeadChCand = dynamic_cast(leadChCand.get()); + hasGsfTrack = (pfLeadChCand != nullptr && pfLeadChCand->gsfTrackRef().isNonnull()); + } } } @@ -115,8 +127,8 @@ TauDiscriminationAgainstElectronMVA6::d for (const auto& theElectron : *electrons_) { if (theElectron.pt() > 10.) { // CV: only take electrons above some minimal energy/Pt into account... double deltaREleTau = deltaR(theElectron.p4(), theTauRef->p4()); - deltaRDummy = deltaREleTau; - if (deltaREleTau < 0.3) { + deltaRDummy = std::min(deltaREleTau, deltaRDummy); + if (deltaREleTau < deltaREleTauMax_) { double mva_match = mva_->MVAValue(*theTauRef, theElectron); if (!hasGsfTrack) hasGsfTrack = theElectron.gsfTrack().isNonnull(); @@ -132,23 +144,29 @@ TauDiscriminationAgainstElectronMVA6::d } // veto taus that go to ECal crack - if (std::abs(tauEtaAtECalEntrance.first) < ECalBarrelEndcapEtaBorder) { // Barrel + if (std::abs(tauEtaAtECalEntrance.first) < ecalBarrelEndcapEtaBorder_) { // Barrel if (numSignalGammaCandsInSigCone == 0 && hasGsfTrack) { category = 5.; } else if (numSignalGammaCandsInSigCone >= 1 && hasGsfTrack) { category = 7.; } - } else { // Endcap + } else if (!isPhase2_ || (std::abs(tauEtaAtECalEntrance.first) < ecalEndcapVFEndcapEtaBorder_)) { // Endcap if (numSignalGammaCandsInSigCone == 0 && hasGsfTrack) { category = 13.; } else if (numSignalGammaCandsInSigCone >= 1 && hasGsfTrack) { category = 15.; } + } else { // VeryForwardEndcap + if (numSignalGammaCandsInSigCone == 0 && hasGsfTrack) { + category = 14.; + } else if (numSignalGammaCandsInSigCone >= 1 && hasGsfTrack) { + category = 16.; + } } result.rawValues.at(0) = std::min(result.rawValues.at(0), float(mva_match)); isGsfElectronMatched = true; - } // deltaR < 0.3 + } // deltaR < deltaREleTauMax_ } // electron pt > 10 } // end of loop over electrons @@ -166,18 +184,24 @@ TauDiscriminationAgainstElectronMVA6::d } // veto taus that go to ECal crack - if (std::abs(tauEtaAtECalEntrance.first) < ECalBarrelEndcapEtaBorder) { // Barrel + if (std::abs(tauEtaAtECalEntrance.first) < ecalBarrelEndcapEtaBorder_) { // Barrel if (numSignalGammaCandsInSigCone == 0 && !hasGsfTrack) { category = 0.; } else if (numSignalGammaCandsInSigCone >= 1 && !hasGsfTrack) { category = 2.; } - } else { // Endcap + } else if (!isPhase2_ || (std::abs(tauEtaAtECalEntrance.first) < ecalEndcapVFEndcapEtaBorder_)) { // Endcap if (numSignalGammaCandsInSigCone == 0 && !hasGsfTrack) { category = 8.; } else if (numSignalGammaCandsInSigCone >= 1 && !hasGsfTrack) { category = 10.; } + } else { // VeryForwardEndcap + if (numSignalGammaCandsInSigCone == 0 && !hasGsfTrack) { + category = 9.; + } else if (numSignalGammaCandsInSigCone >= 1 && !hasGsfTrack) { + category = 11.; + } } result.rawValues.at(0) = std::min(result.rawValues.at(0), float(mva_nomatch)); @@ -224,7 +248,15 @@ TauDiscriminationAgainstElectronMVA6::g const reco::Track* track = nullptr; const reco::PFCandidate* pfCandidate = dynamic_cast(candidate.get()); if (pfCandidate != nullptr) { - etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta(); + if (!isPhase2_ || std::abs(theTauRef->eta()) < ecalBarrelEndcapEtaBorder_) { // ECal + etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta(); + } else { // HGCal + bool success = false; + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + if (success) { + etaAtECalEntrance = posAtECal.eta(); + } + } if (pfCandidate->trackRef().isNonnull()) track = pfCandidate->trackRef().get(); else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->innerTrack().isNonnull()) @@ -237,7 +269,7 @@ TauDiscriminationAgainstElectronMVA6::g track = pfCandidate->gsfTrackRef().get(); } else { bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); if (success) { etaAtECalEntrance = posAtECal.eta(); } @@ -262,7 +294,37 @@ template std::pair TauDiscriminationAgainstElectronMVA6::getTauEtaAtECalEntrance( const pat::TauRef& theTauRef) const { - return std::pair(theTauRef->etaAtEcalEntrance(), theTauRef->etaAtEcalEntranceLeadChargedCand()); + if (!isPhase2_ || std::abs(theTauRef->eta()) < ecalBarrelEndcapEtaBorder_) { // ECal + return std::pair(theTauRef->etaAtEcalEntrance(), theTauRef->etaAtEcalEntranceLeadChargedCand()); + } else { // HGCal + float tauEtaAtECalEntrance = -99; + float leadChargedCandEtaAtECalEntrance = -99; + float sumEtaTimesEnergy = 0.; + float sumEnergy = 0.; + + bool success = false; + reco::Candidate::Point posAtECal = + positionAtECalEntrance_(theTauRef->leadChargedHadrCand().get(), success, isPhase2_); + if (success) { + leadChargedCandEtaAtECalEntrance = posAtECal.eta(); + } else { + leadChargedCandEtaAtECalEntrance = theTauRef->leadChargedHadrCand()->eta(); + } + for (const auto& candidate : theTauRef->signalCands()) { + float etaAtECalEntrance = candidate->eta(); + success = false; + posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + if (success) { + etaAtECalEntrance = posAtECal.eta(); + } + sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy(); + sumEnergy += candidate->energy(); + } + if (sumEnergy > 0.) { + tauEtaAtECalEntrance = sumEtaTimesEnergy / sumEnergy; + } + return std::pair(tauEtaAtECalEntrance, leadChargedCandEtaAtECalEntrance); + } } template @@ -292,7 +354,26 @@ void TauDiscriminationAgainstElectronMVA6("minMVANoEleMatchWgWOgsfEC", 0.0); desc.add("minMVAWOgWgsfEC", 0.0); desc.add("minMVAWgWgsfEC", 0.0); + + desc.add("isPhase2", false); + // The following used only for Phase2 + desc.add("mvaName_wGwGSF_VFEC", "gbr_wGwGSF_VFEC")->setComment("Relevant only for Phase-2"); + desc.add("mvaName_woGwGSF_VFEC", "gbr_woGwGSF_VFEC")->setComment("Relevant only for Phase-2"); + desc.add("mvaName_NoEleMatch_wGwoGSF_VFEC", "gbr_NoEleMatch_wGwoGSF_VFEC") + ->setComment("Relevant only for Phase-2"); + desc.add("mvaName_NoEleMatch_woGwoGSF_VFEC", "gbr_NoEleMatch_woGwoGSF_VFEC") + ->setComment("Relevant only for Phase-2"); + desc.add("minMVAWOgWgsfVFEC", 0.0)->setComment("Relevant only for Phase-2"); + desc.add("minMVAWgWgsfVFEC", 0.0)->setComment("Relevant only for Phase-2"); + desc.add("minMVANoEleMatchWgWOgsfVFEC", 0.0)->setComment("Relevant only for Phase-2"); + desc.add("minMVANoEleMatchWOgWOgsfVFEC", 0.0)->setComment("Relevant only for Phase-2"); + desc.add("srcElectrons", edm::InputTag("fixme")); + // Relevant only for gsfElectrons for Phase2 + if (std::is_same::value) { + desc.add>("hgcalElectronIDs", std::vector()) + ->setComment("Relevant only for Phase-2"); + } desc.add("vetoEcalCracks", true); desc.add("usePhiAtEcalEntranceExtrapolation", false); desc.add("verbosity", 0); diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index 6aeeaadea68d9..a84c74f80a18b 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -26,7 +26,13 @@ AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::Paramet mva_NoEleMatch_woGwoGSF_EC_(nullptr), mva_NoEleMatch_wGwoGSF_EC_(nullptr), mva_woGwGSF_EC_(nullptr), - mva_wGwGSF_EC_(nullptr) { + mva_wGwGSF_EC_(nullptr), + mva_NoEleMatch_woGwoGSF_VFEC_(nullptr), + mva_NoEleMatch_wGwoGSF_VFEC_(nullptr), + mva_woGwGSF_VFEC_(nullptr), + mva_wGwGSF_VFEC_(nullptr), + isPhase2_(cfg.getParameter("isPhase2")), + verbosity_(cfg.getParameter("verbosity")) { loadMVAfromDB_ = cfg.exists("loadMVAfromDB") ? cfg.getParameter("loadMVAfromDB") : false; if (!loadMVAfromDB_) { if (cfg.exists("inputFileName")) { @@ -44,19 +50,40 @@ AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::Paramet mvaName_NoEleMatch_wGwoGSF_EC_ = cfg.getParameter("mvaName_NoEleMatch_wGwoGSF_EC"); mvaName_woGwGSF_EC_ = cfg.getParameter("mvaName_woGwGSF_EC"); mvaName_wGwGSF_EC_ = cfg.getParameter("mvaName_wGwGSF_EC"); + mvaName_NoEleMatch_woGwoGSF_VFEC_ = cfg.getParameter("mvaName_NoEleMatch_woGwoGSF_VFEC"); + mvaName_NoEleMatch_wGwoGSF_VFEC_ = cfg.getParameter("mvaName_NoEleMatch_wGwoGSF_VFEC"); + mvaName_woGwGSF_VFEC_ = cfg.getParameter("mvaName_woGwGSF_VFEC"); + mvaName_wGwGSF_VFEC_ = cfg.getParameter("mvaName_wGwGSF_VFEC"); usePhiAtEcalEntranceExtrapolation_ = cfg.getParameter("usePhiAtEcalEntranceExtrapolation"); - Var_NoEleMatch_woGwoGSF_Barrel_ = new float[10]; - Var_NoEleMatch_wGwoGSF_Barrel_ = new float[18]; - Var_woGwGSF_Barrel_ = new float[24]; - Var_wGwGSF_Barrel_ = new float[32]; - Var_NoEleMatch_woGwoGSF_Endcap_ = new float[9]; - Var_NoEleMatch_wGwoGSF_Endcap_ = new float[17]; - Var_woGwGSF_Endcap_ = new float[23]; - Var_wGwGSF_Endcap_ = new float[31]; - - verbosity_ = 0; + if (!isPhase2_) { + Var_NoEleMatch_woGwoGSF_Barrel_ = new float[10]; + Var_NoEleMatch_wGwoGSF_Barrel_ = new float[18]; + Var_woGwGSF_Barrel_ = new float[24]; + Var_wGwGSF_Barrel_ = new float[32]; + Var_NoEleMatch_woGwoGSF_Endcap_ = new float[9]; + Var_NoEleMatch_wGwoGSF_Endcap_ = new float[17]; + Var_woGwGSF_Endcap_ = new float[23]; + Var_wGwGSF_Endcap_ = new float[31]; + Var_NoEleMatch_woGwoGSF_VFEndcap_ = nullptr; + Var_NoEleMatch_wGwoGSF_VFEndcap_ = nullptr; + Var_woGwGSF_VFEndcap_ = nullptr; + Var_wGwGSF_VFEndcap_ = nullptr; + } else { + Var_NoEleMatch_woGwoGSF_Barrel_ = new float[9]; + Var_NoEleMatch_wGwoGSF_Barrel_ = new float[17]; + Var_woGwGSF_Barrel_ = new float[27]; + Var_wGwGSF_Barrel_ = new float[36]; + Var_NoEleMatch_woGwoGSF_Endcap_ = new float[6]; + Var_NoEleMatch_wGwoGSF_Endcap_ = new float[14]; + Var_woGwGSF_Endcap_ = new float[31]; + Var_wGwGSF_Endcap_ = new float[38]; + Var_NoEleMatch_woGwoGSF_VFEndcap_ = new float[6]; + Var_NoEleMatch_wGwoGSF_VFEndcap_ = new float[14]; + Var_woGwGSF_VFEndcap_ = new float[32]; + Var_wGwGSF_VFEndcap_ = new float[40]; + } } template @@ -69,6 +96,12 @@ AntiElectronIDMVA6::~AntiElectronIDMVA6() { delete[] Var_NoEleMatch_wGwoGSF_Endcap_; delete[] Var_woGwGSF_Endcap_; delete[] Var_wGwGSF_Endcap_; + if (isPhase2_) { + delete[] Var_NoEleMatch_woGwoGSF_VFEndcap_; + delete[] Var_NoEleMatch_wGwoGSF_VFEndcap_; + delete[] Var_woGwGSF_VFEndcap_; + delete[] Var_wGwGSF_VFEndcap_; + } if (!loadMVAfromDB_) { delete mva_NoEleMatch_woGwoGSF_BL_; @@ -79,6 +112,12 @@ AntiElectronIDMVA6::~AntiElectronIDMVA6() { delete mva_NoEleMatch_wGwoGSF_EC_; delete mva_woGwGSF_EC_; delete mva_wGwGSF_EC_; + if (isPhase2_) { + delete mva_NoEleMatch_woGwoGSF_VFEC_; + delete mva_NoEleMatch_wGwoGSF_VFEC_; + delete mva_woGwGSF_VFEC_; + delete mva_wGwGSF_VFEC_; + } } for (std::vector::iterator it = inputFilesToDelete_.begin(); it != inputFilesToDelete_.end(); ++it) { @@ -89,7 +128,7 @@ AntiElectronIDMVA6::~AntiElectronIDMVA6() { namespace { const GBRForest* loadMVAfromFile(TFile* inputFile, const std::string& mvaName) { const GBRForest* mva = (GBRForest*)inputFile->Get(mvaName.data()); - if (!mva) + if (mva == nullptr) throw cms::Exception("PFRecoTauDiscriminationAgainstElectronMVA6::loadMVA") << " Failed to load MVA = " << mvaName.data() << " from file " << " !!\n"; @@ -116,6 +155,12 @@ void AntiElectronIDMVA6::beginEvent(const edm::Event& evt mva_NoEleMatch_wGwoGSF_EC_ = loadMVAfromDB(es, mvaName_NoEleMatch_wGwoGSF_EC_); mva_woGwGSF_EC_ = loadMVAfromDB(es, mvaName_woGwGSF_EC_); mva_wGwGSF_EC_ = loadMVAfromDB(es, mvaName_wGwGSF_EC_); + if (isPhase2_) { + mva_NoEleMatch_woGwoGSF_VFEC_ = loadMVAfromDB(es, mvaName_NoEleMatch_woGwoGSF_VFEC_); + mva_NoEleMatch_wGwoGSF_VFEC_ = loadMVAfromDB(es, mvaName_NoEleMatch_wGwoGSF_VFEC_); + mva_woGwGSF_VFEC_ = loadMVAfromDB(es, mvaName_woGwGSF_VFEC_); + mva_wGwGSF_VFEC_ = loadMVAfromDB(es, mvaName_wGwGSF_VFEC_); + } } else { if (inputFileName_.location() == edm::FileInPath::Unknown) throw cms::Exception("PFRecoTauDiscriminationAgainstElectronMVA6::loadMVA") @@ -130,6 +175,12 @@ void AntiElectronIDMVA6::beginEvent(const edm::Event& evt mva_NoEleMatch_wGwoGSF_EC_ = loadMVAfromFile(inputFile, mvaName_NoEleMatch_wGwoGSF_EC_); mva_woGwGSF_EC_ = loadMVAfromFile(inputFile, mvaName_woGwGSF_EC_); mva_wGwGSF_EC_ = loadMVAfromFile(inputFile, mvaName_wGwGSF_EC_); + if (isPhase2_) { + mva_NoEleMatch_woGwoGSF_VFEC_ = loadMVAfromFile(inputFile, mvaName_NoEleMatch_woGwoGSF_VFEC_); + mva_NoEleMatch_wGwoGSF_VFEC_ = loadMVAfromFile(inputFile, mvaName_NoEleMatch_wGwoGSF_VFEC_); + mva_woGwGSF_VFEC_ = loadMVAfromFile(inputFile, mvaName_woGwGSF_VFEC_); + mva_wGwGSF_VFEC_ = loadMVAfromFile(inputFile, mvaName_wGwGSF_VFEC_); + } inputFilesToDelete_.push_back(inputFile); } isInitialized_ = true; @@ -198,7 +249,11 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar tauGammaMoms.gammaEtaMomOut = std::sqrt(dEta2 * tauGammaMoms.gammaEnFracOut) * tauVars.pt; tauGammaMoms.gammaPhiMomOut = std::sqrt(dPhi2 * tauGammaMoms.gammaEnFracOut) * tauVars.pt; - return MVAValue(tauVars, tauGammaMoms, elecVars); + if (!isPhase2_) { + return MVAValue(tauVars, tauGammaMoms, elecVars); + } else { + return MVAValuePhase2(tauVars, tauGammaMoms, elecVars); + } } template @@ -211,7 +266,6 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar double mvaValue = -99.; - const float ECALBarrelEndcapEtaBorder = 1.479; float elecDeltaPinPoutOverPin = (elecVars.pIn > 0.0) ? (std::abs(elecVars.pIn - elecVars.pOut) / elecVars.pIn) : 1.0; float elecEecalOverPout = (elecVars.pOut > 0.0) ? (elecVars.eEcal / elecVars.pOut) : 20.0; float elecNumHitsDiffOverSum = @@ -221,7 +275,7 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar if (deltaR(tauVars.etaAtEcalEntrance, tauVars.phi, elecVars.eta, elecVars.phi) > 0.3 && tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf < 0.5) { - if (std::abs(tauVars.etaAtEcalEntrance) < ECALBarrelEndcapEtaBorder) { + if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { Var_NoEleMatch_woGwoGSF_Barrel_[0] = tauVars.etaAtEcalEntrance; Var_NoEleMatch_woGwoGSF_Barrel_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; Var_NoEleMatch_woGwoGSF_Barrel_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); @@ -247,7 +301,7 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar } } else if (deltaR(tauVars.etaAtEcalEntrance, tauVars.phi, elecVars.eta, elecVars.phi) > 0.3 && tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf < 0.5) { - if (std::abs(tauVars.etaAtEcalEntrance) < ECALBarrelEndcapEtaBorder) { + if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { Var_NoEleMatch_wGwoGSF_Barrel_[0] = tauVars.etaAtEcalEntrance; Var_NoEleMatch_wGwoGSF_Barrel_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; Var_NoEleMatch_wGwoGSF_Barrel_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); @@ -288,7 +342,7 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar mvaValue = mva_NoEleMatch_wGwoGSF_EC_->GetClassifier(Var_NoEleMatch_wGwoGSF_Endcap_); } } else if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf > 0.5) { - if (std::abs(tauVars.etaAtEcalEntrance) < ECALBarrelEndcapEtaBorder) { + if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { Var_woGwGSF_Barrel_[0] = std::max(-0.1f, elecVars.eTotOverPin); Var_woGwGSF_Barrel_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); Var_woGwGSF_Barrel_[2] = elecVars.gsfNumHits; @@ -341,7 +395,7 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar mvaValue = mva_woGwGSF_EC_->GetClassifier(Var_woGwGSF_Endcap_); } } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf > 0.5) { - if (std::abs(tauVars.etaAtEcalEntrance) < ECALBarrelEndcapEtaBorder) { + if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { Var_wGwGSF_Barrel_[0] = std::max(-0.1f, elecVars.eTotOverPin); Var_wGwGSF_Barrel_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); Var_wGwGSF_Barrel_[2] = elecVars.gsfNumHits; @@ -412,7 +466,335 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar } return mvaValue; } +//// +template +double AntiElectronIDMVA6::MVAValuePhase2(const TauVars& tauVars, + const TauGammaMoms& tauGammaMoms, + const ElecVars& elecVars) { + if (!isInitialized_) { + throw cms::Exception("ClassNotInitialized") << " AntiElectronMVA6 not properly initialized !!\n"; + } + + double mvaValue = -99.; + + //do not consider tau candidates outside the HGCal border at |eta|=3 + if (std::abs(tauVars.etaAtEcalEntrance) > 3.0) { + return mvaValue; + } + + float elecDeltaPinPoutOverPin = (elecVars.pIn > 0.0) ? (std::abs(elecVars.pIn - elecVars.pOut) / elecVars.pIn) : 1.0; + float elecEecalOverPout = (elecVars.pOut > 0.0) ? (elecVars.eEcal / elecVars.pOut) : 20.0; + float elecNumHitsDiffOverSum = + ((elecVars.gsfNumHits + elecVars.kfNumHits) > 0.0) + ? ((elecVars.gsfNumHits - elecVars.kfNumHits) / (elecVars.gsfNumHits + elecVars.kfNumHits)) + : 1.0; + if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf < 0.5) { + if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { + Var_NoEleMatch_woGwoGSF_Barrel_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_NoEleMatch_woGwoGSF_Barrel_[1] = std::log(std::max(1.f, tauVars.pt)); + Var_NoEleMatch_woGwoGSF_Barrel_[2] = tauVars.emFraction; + Var_NoEleMatch_woGwoGSF_Barrel_[3] = tauVars.leadPFChargedHadrHoP; + Var_NoEleMatch_woGwoGSF_Barrel_[4] = tauVars.leadPFChargedHadrEoP; + Var_NoEleMatch_woGwoGSF_Barrel_[5] = tauVars.visMassIn; + Var_NoEleMatch_woGwoGSF_Barrel_[6] = tauVars.dCrackEta; + Var_NoEleMatch_woGwoGSF_Barrel_[7] = tauVars.etaAtEcalEntrance; + Var_NoEleMatch_woGwoGSF_Barrel_[8] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_woGwoGSF_BL_->GetClassifier(Var_NoEleMatch_woGwoGSF_Barrel_); + } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) { + Var_NoEleMatch_woGwoGSF_Endcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_NoEleMatch_woGwoGSF_Endcap_[1] = std::log(std::max(1.f, tauVars.pt)); + Var_NoEleMatch_woGwoGSF_Endcap_[2] = tauVars.visMassIn; + Var_NoEleMatch_woGwoGSF_Endcap_[3] = tauVars.dCrackEta; + Var_NoEleMatch_woGwoGSF_Endcap_[4] = tauVars.etaAtEcalEntrance; + Var_NoEleMatch_woGwoGSF_Endcap_[5] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_woGwoGSF_EC_->GetClassifier(Var_NoEleMatch_woGwoGSF_Endcap_); + } else { + Var_NoEleMatch_woGwoGSF_VFEndcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_NoEleMatch_woGwoGSF_VFEndcap_[1] = std::log(std::max(1.f, tauVars.pt)); + Var_NoEleMatch_woGwoGSF_VFEndcap_[2] = tauVars.visMassIn; + Var_NoEleMatch_woGwoGSF_VFEndcap_[3] = tauVars.dCrackEta; + Var_NoEleMatch_woGwoGSF_VFEndcap_[4] = tauVars.etaAtEcalEntrance; + Var_NoEleMatch_woGwoGSF_VFEndcap_[5] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_woGwoGSF_VFEC_->GetClassifier(Var_NoEleMatch_woGwoGSF_VFEndcap_); + } + } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf < 0.5) { + if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { + Var_NoEleMatch_wGwoGSF_Barrel_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_NoEleMatch_wGwoGSF_Barrel_[1] = std::log(std::max(1.f, tauVars.pt)); + Var_NoEleMatch_wGwoGSF_Barrel_[2] = tauVars.emFraction; + Var_NoEleMatch_wGwoGSF_Barrel_[3] = tauGammaMoms.signalPFGammaCandsIn; + Var_NoEleMatch_wGwoGSF_Barrel_[4] = tauGammaMoms.signalPFGammaCandsOut; + Var_NoEleMatch_wGwoGSF_Barrel_[5] = tauVars.leadPFChargedHadrHoP; + Var_NoEleMatch_wGwoGSF_Barrel_[6] = tauVars.leadPFChargedHadrEoP; + Var_NoEleMatch_wGwoGSF_Barrel_[7] = tauVars.visMassIn; + Var_NoEleMatch_wGwoGSF_Barrel_[7] = tauGammaMoms.gammaEtaMomIn; + Var_NoEleMatch_wGwoGSF_Barrel_[9] = tauGammaMoms.gammaEtaMomOut; + Var_NoEleMatch_wGwoGSF_Barrel_[10] = tauGammaMoms.gammaPhiMomIn; + Var_NoEleMatch_wGwoGSF_Barrel_[11] = tauGammaMoms.gammaPhiMomOut; + Var_NoEleMatch_wGwoGSF_Barrel_[12] = tauGammaMoms.gammaEnFracIn; + Var_NoEleMatch_wGwoGSF_Barrel_[13] = tauGammaMoms.gammaEnFracOut; + Var_NoEleMatch_wGwoGSF_Barrel_[14] = tauVars.dCrackEta; + Var_NoEleMatch_wGwoGSF_Barrel_[15] = tauVars.etaAtEcalEntrance; + Var_NoEleMatch_wGwoGSF_Barrel_[16] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_wGwoGSF_BL_->GetClassifier(Var_NoEleMatch_wGwoGSF_Barrel_); + } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) { + Var_NoEleMatch_wGwoGSF_Endcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_NoEleMatch_wGwoGSF_Endcap_[1] = std::log(std::max(1.f, tauVars.pt)); + Var_NoEleMatch_wGwoGSF_Endcap_[2] = tauGammaMoms.signalPFGammaCandsIn; + Var_NoEleMatch_wGwoGSF_Endcap_[3] = tauGammaMoms.signalPFGammaCandsOut; + Var_NoEleMatch_wGwoGSF_Endcap_[4] = tauVars.visMassIn; + Var_NoEleMatch_wGwoGSF_Endcap_[5] = tauGammaMoms.gammaEtaMomIn; + Var_NoEleMatch_wGwoGSF_Endcap_[6] = tauGammaMoms.gammaEtaMomOut; + Var_NoEleMatch_wGwoGSF_Endcap_[7] = tauGammaMoms.gammaPhiMomIn; + Var_NoEleMatch_wGwoGSF_Endcap_[8] = tauGammaMoms.gammaPhiMomOut; + Var_NoEleMatch_wGwoGSF_Endcap_[9] = tauGammaMoms.gammaEnFracIn; + Var_NoEleMatch_wGwoGSF_Endcap_[10] = tauGammaMoms.gammaEnFracOut; + Var_NoEleMatch_wGwoGSF_Endcap_[11] = tauVars.dCrackEta; + Var_NoEleMatch_wGwoGSF_Endcap_[12] = tauVars.etaAtEcalEntrance; + Var_NoEleMatch_wGwoGSF_Endcap_[13] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_wGwoGSF_EC_->GetClassifier(Var_NoEleMatch_wGwoGSF_Endcap_); + } else { + Var_NoEleMatch_wGwoGSF_VFEndcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_NoEleMatch_wGwoGSF_VFEndcap_[1] = std::log(std::max(1.f, tauVars.pt)); + Var_NoEleMatch_wGwoGSF_VFEndcap_[2] = tauGammaMoms.signalPFGammaCandsIn; + Var_NoEleMatch_wGwoGSF_VFEndcap_[3] = tauGammaMoms.signalPFGammaCandsOut; + Var_NoEleMatch_wGwoGSF_VFEndcap_[4] = tauVars.visMassIn; + Var_NoEleMatch_wGwoGSF_VFEndcap_[5] = tauGammaMoms.gammaEtaMomIn; + Var_NoEleMatch_wGwoGSF_VFEndcap_[6] = tauGammaMoms.gammaEtaMomOut; + Var_NoEleMatch_wGwoGSF_VFEndcap_[7] = tauGammaMoms.gammaPhiMomIn; + Var_NoEleMatch_wGwoGSF_VFEndcap_[8] = tauGammaMoms.gammaPhiMomOut; + Var_NoEleMatch_wGwoGSF_VFEndcap_[9] = tauGammaMoms.gammaEnFracIn; + Var_NoEleMatch_wGwoGSF_VFEndcap_[10] = tauGammaMoms.gammaEnFracOut; + Var_NoEleMatch_wGwoGSF_VFEndcap_[11] = tauVars.dCrackEta; + Var_NoEleMatch_wGwoGSF_VFEndcap_[12] = tauVars.etaAtEcalEntrance; + Var_NoEleMatch_wGwoGSF_VFEndcap_[13] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_wGwoGSF_VFEC_->GetClassifier(Var_NoEleMatch_wGwoGSF_VFEndcap_); + } + } else if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf > 0.5) { + if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { + Var_woGwGSF_Barrel_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + Var_woGwGSF_Barrel_[1] = elecVars.gsfNumHits; + Var_woGwGSF_Barrel_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + Var_woGwGSF_Barrel_[3] = elecVars.gsfTracklnPt; + Var_woGwGSF_Barrel_[4] = elecNumHitsDiffOverSum; + Var_woGwGSF_Barrel_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + Var_woGwGSF_Barrel_[6] = std::min(elecDeltaPinPoutOverPin, 1.f); + Var_woGwGSF_Barrel_[7] = std::min(elecEecalOverPout, 20.f); + Var_woGwGSF_Barrel_[8] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); + Var_woGwGSF_Barrel_[9] = std::min(elecVars.mvaInHadEnergy, 20.f); + Var_woGwGSF_Barrel_[10] = std::min(elecVars.mvaInDeltaEta, 0.1f); + Var_woGwGSF_Barrel_[11] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_woGwGSF_Barrel_[12] = std::log(std::max(1.f, tauVars.pt)); + Var_woGwGSF_Barrel_[13] = tauVars.emFraction; + Var_woGwGSF_Barrel_[14] = tauVars.leadPFChargedHadrHoP; + Var_woGwGSF_Barrel_[15] = tauVars.leadPFChargedHadrEoP; + Var_woGwGSF_Barrel_[16] = tauVars.visMassIn; + Var_woGwGSF_Barrel_[17] = tauVars.dCrackEta; + Var_woGwGSF_Barrel_[18] = tauVars.etaAtEcalEntrance; + Var_woGwGSF_Barrel_[19] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + Var_woGwGSF_Barrel_[20] = elecVars.deltaEta; + Var_woGwGSF_Barrel_[21] = elecVars.deltaPhi; + Var_woGwGSF_Barrel_[22] = elecVars.sigmaIEtaIEta5x5; + Var_woGwGSF_Barrel_[23] = elecVars.showerCircularity; + Var_woGwGSF_Barrel_[24] = elecVars.r9; + Var_woGwGSF_Barrel_[25] = elecVars.superClusterEtaWidth; + Var_woGwGSF_Barrel_[26] = elecVars.superClusterPhiWidth; + mvaValue = mva_woGwGSF_BL_->GetClassifier(Var_woGwGSF_Barrel_); + } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) { + Var_woGwGSF_Endcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + Var_woGwGSF_Endcap_[1] = elecVars.gsfNumHits; + Var_woGwGSF_Endcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + Var_woGwGSF_Endcap_[3] = elecVars.gsfTracklnPt; + Var_woGwGSF_Endcap_[4] = elecNumHitsDiffOverSum; + Var_woGwGSF_Endcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + Var_woGwGSF_Endcap_[6] = elecVars.eEcal; + Var_woGwGSF_Endcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_woGwGSF_Endcap_[8] = std::log(std::max(1.f, tauVars.pt)); + Var_woGwGSF_Endcap_[9] = tauVars.visMassIn; + Var_woGwGSF_Endcap_[10] = tauVars.dCrackEta; + Var_woGwGSF_Endcap_[11] = tauVars.etaAtEcalEntrance; + Var_woGwGSF_Endcap_[12] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + Var_woGwGSF_Endcap_[13] = elecVars.hgcalSigmaUU; + Var_woGwGSF_Endcap_[14] = elecVars.hgcalSigmaVV; + Var_woGwGSF_Endcap_[15] = elecVars.hgcalSigmaEE; + Var_woGwGSF_Endcap_[16] = elecVars.hgcalSigmaPP; + Var_woGwGSF_Endcap_[17] = elecVars.hgcalNLayers; + Var_woGwGSF_Endcap_[18] = elecVars.hgcalLastLayer; + Var_woGwGSF_Endcap_[19] = elecVars.hgcalLayerEfrac10; + Var_woGwGSF_Endcap_[20] = elecVars.hgcalLayerEfrac90; + Var_woGwGSF_Endcap_[21] = elecVars.hgcalEcEnergyEE; + Var_woGwGSF_Endcap_[22] = elecVars.hgcalEcEnergyFH; + Var_woGwGSF_Endcap_[23] = elecVars.hgcalMeasuredDepth; + Var_woGwGSF_Endcap_[24] = elecVars.hgcalExpectedDepth; + Var_woGwGSF_Endcap_[25] = elecVars.hgcalDepthCompatibility; + Var_woGwGSF_Endcap_[26] = elecVars.deltaEta; + Var_woGwGSF_Endcap_[27] = elecVars.deltaPhi; + Var_woGwGSF_Endcap_[28] = elecVars.eSeedClusterOverPout; + Var_woGwGSF_Endcap_[29] = elecVars.superClusterEtaWidth; + Var_woGwGSF_Endcap_[30] = elecVars.superClusterPhiWidth; + mvaValue = mva_woGwGSF_EC_->GetClassifier(Var_woGwGSF_Endcap_); + } else { + Var_woGwGSF_VFEndcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + Var_woGwGSF_VFEndcap_[1] = elecVars.gsfNumHits; + Var_woGwGSF_VFEndcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + Var_woGwGSF_VFEndcap_[3] = elecVars.gsfTracklnPt; + Var_woGwGSF_VFEndcap_[4] = elecNumHitsDiffOverSum; + Var_woGwGSF_VFEndcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + Var_woGwGSF_VFEndcap_[6] = elecVars.eEcal; + Var_woGwGSF_VFEndcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_woGwGSF_VFEndcap_[8] = std::log(std::max(1.f, tauVars.pt)); + Var_woGwGSF_VFEndcap_[9] = tauVars.visMassIn; + Var_woGwGSF_VFEndcap_[10] = tauVars.dCrackEta; + Var_woGwGSF_VFEndcap_[11] = tauVars.etaAtEcalEntrance; + Var_woGwGSF_VFEndcap_[12] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + Var_woGwGSF_VFEndcap_[13] = elecVars.hgcalSigmaUU; + Var_woGwGSF_VFEndcap_[14] = elecVars.hgcalSigmaVV; + Var_woGwGSF_VFEndcap_[15] = elecVars.hgcalSigmaEE; + Var_woGwGSF_VFEndcap_[16] = elecVars.hgcalSigmaPP; + Var_woGwGSF_VFEndcap_[17] = elecVars.hgcalNLayers; + Var_woGwGSF_VFEndcap_[18] = elecVars.hgcalLastLayer; + Var_woGwGSF_VFEndcap_[19] = elecVars.hgcalLayerEfrac10; + Var_woGwGSF_VFEndcap_[20] = elecVars.hgcalLayerEfrac90; + Var_woGwGSF_VFEndcap_[21] = elecVars.hgcalEcEnergyEE; + Var_woGwGSF_VFEndcap_[22] = elecVars.hgcalEcEnergyFH; + Var_woGwGSF_VFEndcap_[23] = elecVars.hgcalMeasuredDepth; + Var_woGwGSF_VFEndcap_[24] = elecVars.hgcalExpectedDepth; + Var_woGwGSF_VFEndcap_[25] = elecVars.hgcalExpectedSigma; + Var_woGwGSF_VFEndcap_[26] = elecVars.hgcalDepthCompatibility; + Var_woGwGSF_VFEndcap_[27] = elecVars.deltaEta; + Var_woGwGSF_VFEndcap_[28] = elecVars.deltaPhi; + Var_woGwGSF_VFEndcap_[29] = elecVars.eSeedClusterOverPout; + Var_woGwGSF_VFEndcap_[30] = elecVars.superClusterEtaWidth; + Var_woGwGSF_VFEndcap_[31] = elecVars.superClusterPhiWidth; + mvaValue = mva_woGwGSF_VFEC_->GetClassifier(Var_woGwGSF_VFEndcap_); + } + } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf > 0.5) { + if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { + Var_wGwGSF_Barrel_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + Var_wGwGSF_Barrel_[1] = elecVars.gsfNumHits; + Var_wGwGSF_Barrel_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + Var_wGwGSF_Barrel_[3] = elecVars.gsfTracklnPt; + Var_wGwGSF_Barrel_[4] = elecNumHitsDiffOverSum; + Var_wGwGSF_Barrel_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + Var_wGwGSF_Barrel_[6] = std::min(elecDeltaPinPoutOverPin, 1.f); + Var_wGwGSF_Barrel_[7] = std::min(elecEecalOverPout, 20.f); + Var_wGwGSF_Barrel_[8] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); + Var_wGwGSF_Barrel_[9] = std::min(elecVars.mvaInHadEnergy, 20.f); + Var_wGwGSF_Barrel_[10] = std::min(elecVars.mvaInDeltaEta, 0.1f); + Var_wGwGSF_Barrel_[11] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_wGwGSF_Barrel_[12] = std::log(std::max(1.f, tauVars.pt)); + Var_wGwGSF_Barrel_[13] = tauVars.emFraction; + Var_wGwGSF_Barrel_[14] = tauGammaMoms.signalPFGammaCandsIn; + Var_wGwGSF_Barrel_[15] = tauGammaMoms.signalPFGammaCandsOut; + Var_wGwGSF_Barrel_[16] = tauVars.leadPFChargedHadrHoP; + Var_wGwGSF_Barrel_[17] = tauVars.leadPFChargedHadrEoP; + Var_wGwGSF_Barrel_[18] = tauVars.visMassIn; + Var_wGwGSF_Barrel_[19] = tauGammaMoms.gammaEtaMomIn; + Var_wGwGSF_Barrel_[20] = tauGammaMoms.gammaEtaMomOut; + Var_wGwGSF_Barrel_[21] = tauGammaMoms.gammaPhiMomIn; + Var_wGwGSF_Barrel_[22] = tauGammaMoms.gammaPhiMomOut; + Var_wGwGSF_Barrel_[23] = tauGammaMoms.gammaEnFracIn; + Var_wGwGSF_Barrel_[24] = tauGammaMoms.gammaEnFracOut; + Var_wGwGSF_Barrel_[25] = tauVars.dCrackEta; + Var_wGwGSF_Barrel_[26] = tauVars.etaAtEcalEntrance; + Var_wGwGSF_Barrel_[27] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + Var_wGwGSF_Barrel_[28] = elecVars.deltaEta; + Var_wGwGSF_Barrel_[29] = elecVars.deltaPhi; + Var_wGwGSF_Barrel_[30] = elecVars.sigmaIPhiIPhi5x5; + Var_wGwGSF_Barrel_[31] = elecVars.sigmaIEtaIEta5x5; + Var_wGwGSF_Barrel_[32] = elecVars.showerCircularity; + Var_wGwGSF_Barrel_[33] = elecVars.eSeedClusterOverPout; + Var_wGwGSF_Barrel_[34] = elecVars.superClusterEtaWidth; + Var_wGwGSF_Barrel_[35] = elecVars.superClusterPhiWidth; + mvaValue = mva_wGwGSF_BL_->GetClassifier(Var_wGwGSF_Barrel_); + } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) { + Var_wGwGSF_Endcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + Var_wGwGSF_Endcap_[1] = elecVars.gsfNumHits; + Var_wGwGSF_Endcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + Var_wGwGSF_Endcap_[3] = elecVars.gsfTracklnPt; + Var_wGwGSF_Endcap_[4] = elecNumHitsDiffOverSum; + Var_wGwGSF_Endcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + Var_wGwGSF_Endcap_[6] = elecVars.eEcal; + Var_wGwGSF_Endcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_wGwGSF_Endcap_[8] = std::log(std::max(1.f, tauVars.pt)); + Var_wGwGSF_Endcap_[9] = tauGammaMoms.signalPFGammaCandsIn; + Var_wGwGSF_Endcap_[10] = tauGammaMoms.signalPFGammaCandsOut; + Var_wGwGSF_Endcap_[11] = tauVars.visMassIn; + Var_wGwGSF_Endcap_[12] = tauGammaMoms.gammaEtaMomIn; + Var_wGwGSF_Endcap_[13] = tauGammaMoms.gammaEtaMomOut; + Var_wGwGSF_Endcap_[14] = tauGammaMoms.gammaPhiMomIn; + Var_wGwGSF_Endcap_[15] = tauGammaMoms.gammaPhiMomOut; + Var_wGwGSF_Endcap_[16] = tauGammaMoms.gammaEnFracIn; + Var_wGwGSF_Endcap_[17] = tauGammaMoms.gammaEnFracOut; + Var_wGwGSF_Endcap_[18] = tauVars.dCrackEta; + Var_wGwGSF_Endcap_[19] = tauVars.etaAtEcalEntrance; + Var_wGwGSF_Endcap_[20] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + Var_wGwGSF_Endcap_[21] = elecVars.hgcalSigmaVV; + Var_wGwGSF_Endcap_[22] = elecVars.hgcalSigmaEE; + Var_wGwGSF_Endcap_[23] = elecVars.hgcalSigmaPP; + Var_wGwGSF_Endcap_[24] = elecVars.hgcalNLayers; + Var_wGwGSF_Endcap_[25] = elecVars.hgcalFirstLayer; + Var_wGwGSF_Endcap_[26] = elecVars.hgcalLastLayer; + Var_wGwGSF_Endcap_[27] = elecVars.hgcalLayerEfrac10; + Var_wGwGSF_Endcap_[28] = elecVars.hgcalLayerEfrac90; + Var_wGwGSF_Endcap_[29] = elecVars.hgcalEcEnergyEE; + Var_wGwGSF_Endcap_[30] = elecVars.hgcalEcEnergyFH; + Var_wGwGSF_Endcap_[31] = elecVars.hgcalMeasuredDepth; + Var_wGwGSF_Endcap_[32] = elecVars.hgcalExpectedDepth; + Var_wGwGSF_Endcap_[33] = elecVars.deltaEta; + Var_wGwGSF_Endcap_[34] = elecVars.deltaPhi; + Var_wGwGSF_Endcap_[35] = elecVars.eSeedClusterOverPout; + Var_wGwGSF_Endcap_[36] = elecVars.superClusterEtaWidth; + Var_wGwGSF_Endcap_[37] = elecVars.superClusterPhiWidth; + mvaValue = mva_wGwGSF_EC_->GetClassifier(Var_wGwGSF_Endcap_); + } else { + Var_wGwGSF_VFEndcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + Var_wGwGSF_VFEndcap_[1] = elecVars.gsfNumHits; + Var_wGwGSF_VFEndcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + Var_wGwGSF_VFEndcap_[3] = elecVars.gsfTracklnPt; + Var_wGwGSF_VFEndcap_[4] = elecNumHitsDiffOverSum; + Var_wGwGSF_VFEndcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + Var_wGwGSF_VFEndcap_[6] = elecVars.eEcal; + Var_wGwGSF_VFEndcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + Var_wGwGSF_VFEndcap_[8] = std::log(std::max(1.f, tauVars.pt)); + Var_wGwGSF_VFEndcap_[9] = tauGammaMoms.signalPFGammaCandsIn; + Var_wGwGSF_VFEndcap_[10] = tauGammaMoms.signalPFGammaCandsOut; + Var_wGwGSF_VFEndcap_[11] = tauVars.visMassIn; + Var_wGwGSF_VFEndcap_[12] = tauGammaMoms.gammaEtaMomIn; + Var_wGwGSF_VFEndcap_[13] = tauGammaMoms.gammaEtaMomOut; + Var_wGwGSF_VFEndcap_[14] = tauGammaMoms.gammaPhiMomIn; + Var_wGwGSF_VFEndcap_[15] = tauGammaMoms.gammaPhiMomOut; + Var_wGwGSF_VFEndcap_[16] = tauGammaMoms.gammaEnFracIn; + Var_wGwGSF_VFEndcap_[17] = tauGammaMoms.gammaEnFracOut; + Var_wGwGSF_VFEndcap_[18] = tauVars.dCrackEta; + Var_wGwGSF_VFEndcap_[19] = tauVars.etaAtEcalEntrance; + Var_wGwGSF_VFEndcap_[20] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + Var_wGwGSF_VFEndcap_[21] = elecVars.hgcalSigmaUU; + Var_wGwGSF_VFEndcap_[22] = elecVars.hgcalSigmaVV; + Var_wGwGSF_VFEndcap_[23] = elecVars.hgcalSigmaEE; + Var_wGwGSF_VFEndcap_[24] = elecVars.hgcalSigmaPP; + Var_wGwGSF_VFEndcap_[25] = elecVars.hgcalNLayers; + Var_wGwGSF_VFEndcap_[26] = elecVars.hgcalLastLayer; + Var_wGwGSF_VFEndcap_[27] = elecVars.hgcalLayerEfrac10; + Var_wGwGSF_VFEndcap_[28] = elecVars.hgcalLayerEfrac90; + Var_wGwGSF_VFEndcap_[29] = elecVars.hgcalEcEnergyEE; + Var_wGwGSF_VFEndcap_[30] = elecVars.hgcalEcEnergyFH; + Var_wGwGSF_VFEndcap_[31] = elecVars.hgcalMeasuredDepth; + Var_wGwGSF_VFEndcap_[32] = elecVars.hgcalExpectedDepth; + Var_wGwGSF_VFEndcap_[33] = elecVars.hgcalExpectedSigma; + Var_wGwGSF_VFEndcap_[34] = elecVars.hgcalDepthCompatibility; + Var_wGwGSF_VFEndcap_[35] = elecVars.deltaEta; + Var_wGwGSF_VFEndcap_[36] = elecVars.deltaPhi; + Var_wGwGSF_VFEndcap_[37] = elecVars.eSeedClusterOverPout; + Var_wGwGSF_VFEndcap_[38] = elecVars.superClusterEtaWidth; + Var_wGwGSF_VFEndcap_[39] = elecVars.superClusterPhiWidth; + mvaValue = mva_wGwGSF_VFEC_->GetClassifier(Var_wGwGSF_VFEndcap_); + } + } + return mvaValue; +} +//// template double AntiElectronIDMVA6::MVAValue(const TauType& theTau, const ElectronType& theEle) @@ -534,14 +916,26 @@ ElecVars AntiElectronIDMVA6::getElecVars(const ElectronTy else elecEgamma += pfClusterEn; } + elecVars.superClusterEtaWidth = pfSuperCluster->etaWidth(); + elecVars.superClusterPhiWidth = pfSuperCluster->phiWidth(); } + elecVars.eSeedClusterOverPout = theEle.eSeedClusterOverPout(); + elecVars.showerCircularity = 1. - theEle.e1x5() / theEle.e5x5(); + elecVars.r9 = theEle.r9(); + elecVars.sigmaIEtaIEta5x5 = theEle.full5x5_sigmaIetaIeta(); + elecVars.sigmaIPhiIPhi5x5 = theEle.full5x5_sigmaIphiIphi(); elecVars.pIn = std::sqrt(theEle.trackMomentumAtVtx().Mag2()); elecVars.pOut = std::sqrt(theEle.trackMomentumOut().Mag2()); elecVars.eTotOverPin = (elecVars.pIn > 0.0) ? ((elecEe + elecEgamma) / elecVars.pIn) : -0.1; elecVars.eEcal = theEle.ecalEnergy(); - elecVars.deltaEta = theEle.deltaEtaSeedClusterTrackAtCalo(); - elecVars.deltaPhi = theEle.deltaPhiSeedClusterTrackAtCalo(); + if (!isPhase2_) { + elecVars.deltaEta = theEle.deltaEtaSeedClusterTrackAtCalo(); + elecVars.deltaPhi = theEle.deltaPhiSeedClusterTrackAtCalo(); + } else { + elecVars.deltaEta = theEle.deltaEtaEleClusterTrackAtCalo(); + elecVars.deltaPhi = theEle.deltaPhiEleClusterTrackAtCalo(); + } elecVars.mvaInSigmaEtaEta = theEle.mvaInput().sigmaEtaEta; elecVars.mvaInHadEnergy = theEle.mvaInput().hadEnergy; elecVars.mvaInDeltaEta = theEle.mvaInput().deltaEta; @@ -568,6 +962,15 @@ ElecVars AntiElectronIDMVA6::getElecVars(const ElectronTy elecVars.kfNumHits = theEle.closestCtfTrackRef()->numberOfValidHits(); } + // Variables related to HGCal + if (isPhase2_ && !theEle.isEB()) { + if (std::is_same::value || std::is_same::value) + getElecVarsHGCalTypeSpecific(theEle, elecVars); + else + throw cms::Exception("AntiElectronIDMVA6") + << "Unsupported ElectronType used. You must use either reco::GsfElectron or pat::Electron."; + } + return elecVars; } @@ -675,26 +1078,57 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const tauVars.leadChargedPFCandEtaAtEcalEntrance = theTau.etaAtEcalEntranceLeadChargedCand(); tauVars.leadChargedPFCandPt = theTau.ptLeadChargedCand(); tauVars.phi = theTau.phi(); - if (!usePhiAtEcalEntranceExtrapolation_) { - tauVars.phi = theTau.phiAtEcalEntrance(); + if (!isPhase2_) { + if (!usePhiAtEcalEntranceExtrapolation_) { + tauVars.phi = theTau.phiAtEcalEntrance(); + } else { + float sumPhiTimesEnergy = 0.; + float sumEnergy = 0.; + for (const auto& candidate : theTau.signalCands()) { + float phiAtECalEntrance = candidate->phi(); + bool success = false; + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + if (success) { + phiAtECalEntrance = posAtECal.phi(); + } + sumPhiTimesEnergy += phiAtECalEntrance * candidate->energy(); + sumEnergy += candidate->energy(); + } + if (sumEnergy > 0.) { + tauVars.phi = sumPhiTimesEnergy / sumEnergy; + } + } + tauVars.emFraction = std::max(theTau.emFraction_MVA(), 0.f); } else { - float sumPhiTimesEnergy = 0.; - float sumEnergy = 0.; - for (const auto& candidate : theTau.signalCands()) { - float phiAtECalEntrance = candidate->phi(); + if (std::abs(theTau.eta()) >= ecalBarrelEndcapEtaBorder_) { //HGCal + tauVars.etaAtEcalEntrance = -99.; + tauVars.leadChargedPFCandEtaAtEcalEntrance = -99.; bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); + reco::Candidate::Point posAtECal = + positionAtECalEntrance_(theTau.leadChargedHadrCand().get(), success, isPhase2_); if (success) { - phiAtECalEntrance = posAtECal.phi(); + tauVars.leadChargedPFCandEtaAtEcalEntrance = posAtECal.eta(); + } + float sumEtaTimesEnergy = 0.; + float sumEnergy = 0.; + for (const auto& candidate : theTau.signalCands()) { + float etaAtECalEntrance = candidate->eta(); + success = false; + posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + if (success) { + etaAtECalEntrance = posAtECal.eta(); + } + sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy(); + sumEnergy += candidate->energy(); + } + if (sumEnergy > 0.) { + tauVars.etaAtEcalEntrance = sumEtaTimesEnergy / sumEnergy; } - sumPhiTimesEnergy += phiAtECalEntrance * candidate->energy(); - sumEnergy += candidate->energy(); - } - if (sumEnergy > 0.) { - tauVars.phi = sumPhiTimesEnergy / sumEnergy; } + tauVars.emFraction = std::max(theTau.ecalEnergyLeadChargedHadrCand() / + (theTau.ecalEnergyLeadChargedHadrCand() + theTau.hcalEnergyLeadChargedHadrCand()), + 0.f); } - tauVars.emFraction = std::max(theTau.emFraction_MVA(), (float)0.); tauVars.leadPFChargedHadrHoP = 0.; tauVars.leadPFChargedHadrEoP = 0.; if (theTau.leadChargedHadrCand()->p() > 0.) { @@ -719,57 +1153,114 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const // Check type of candidates building tau to avoid dynamic casts further bool isFromPFCands = (theTau.leadCand().isNonnull() && dynamic_cast(theTau.leadCand().get()) != nullptr); - for (const auto& candidate : theTau.signalCands()) { - float etaAtECalEntrance = candidate->eta(); - float phiAtECalEntrance = candidate->phi(); - const reco::Track* track = nullptr; - if (isFromPFCands) { - const reco::PFCandidate* pfCandidate = static_cast(candidate.get()); - etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta(); - if (!usePhiAtEcalEntranceExtrapolation_) { - phiAtECalEntrance = pfCandidate->positionAtECALEntrance().phi(); + if (!isPhase2_) { + for (const auto& candidate : theTau.signalCands()) { + float etaAtECalEntrance = candidate->eta(); + float phiAtECalEntrance = candidate->phi(); + const reco::Track* track = nullptr; + if (isFromPFCands) { + const reco::PFCandidate* pfCandidate = static_cast(candidate.get()); + etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta(); + if (!usePhiAtEcalEntranceExtrapolation_) { + phiAtECalEntrance = pfCandidate->positionAtECALEntrance().phi(); + } else { + bool success = false; + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + if (success) { + phiAtECalEntrance = posAtECal.phi(); + } + } + if (pfCandidate->trackRef().isNonnull()) + track = pfCandidate->trackRef().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->innerTrack().isNonnull()) + track = pfCandidate->muonRef()->innerTrack().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->globalTrack().isNonnull()) + track = pfCandidate->muonRef()->globalTrack().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->outerTrack().isNonnull()) + track = pfCandidate->muonRef()->outerTrack().get(); + else if (pfCandidate->gsfTrackRef().isNonnull()) + track = pfCandidate->gsfTrackRef().get(); } else { bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); if (success) { + etaAtECalEntrance = posAtECal.eta(); phiAtECalEntrance = posAtECal.phi(); } + track = candidate->bestTrack(); } - if (pfCandidate->trackRef().isNonnull()) - track = pfCandidate->trackRef().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->innerTrack().isNonnull()) - track = pfCandidate->muonRef()->innerTrack().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->globalTrack().isNonnull()) - track = pfCandidate->muonRef()->globalTrack().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->outerTrack().isNonnull()) - track = pfCandidate->muonRef()->outerTrack().get(); - else if (pfCandidate->gsfTrackRef().isNonnull()) - track = pfCandidate->gsfTrackRef().get(); - } else { - bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); - if (success) { - etaAtECalEntrance = posAtECal.eta(); - phiAtECalEntrance = posAtECal.phi(); + if (track != nullptr) { + if (track->pt() > tauVars.leadChargedPFCandPt) { + tauVars.leadChargedPFCandEtaAtEcalEntrance = etaAtECalEntrance; + tauVars.leadChargedPFCandPt = track->pt(); + } } - track = candidate->bestTrack(); + sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy(); + sumPhiTimesEnergy += phiAtECalEntrance * candidate->energy(); + sumEnergy += candidate->energy(); } - if (track != nullptr) { - if (track->pt() > tauVars.leadChargedPFCandPt) { - tauVars.leadChargedPFCandEtaAtEcalEntrance = etaAtECalEntrance; - tauVars.leadChargedPFCandPt = track->pt(); + if (sumEnergy > 0.) { + tauVars.etaAtEcalEntrance = sumEtaTimesEnergy / sumEnergy; + tauVars.phi = sumPhiTimesEnergy / sumEnergy; + } + tauVars.emFraction = std::max(theTau.emFraction(), 0.f); + } else { // Phase2 + for (const auto& candidate : theTau.signalCands()) { + float etaAtECalEntrance = candidate->eta(); + const reco::Track* track = nullptr; + if (isFromPFCands) { + const reco::PFCandidate* pfCandidate = static_cast(candidate.get()); + etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta(); + if (std::abs(theTau.eta()) >= ecalBarrelEndcapEtaBorder_) { //HGCal + bool success = false; + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + if (success) { + etaAtECalEntrance = posAtECal.eta(); + } + } + if (pfCandidate->trackRef().isNonnull()) + track = pfCandidate->trackRef().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->innerTrack().isNonnull()) + track = pfCandidate->muonRef()->innerTrack().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->globalTrack().isNonnull()) + track = pfCandidate->muonRef()->globalTrack().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->outerTrack().isNonnull()) + track = pfCandidate->muonRef()->outerTrack().get(); + else if (pfCandidate->gsfTrackRef().isNonnull()) + track = pfCandidate->gsfTrackRef().get(); + } else { + bool success = false; + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + if (success) { + etaAtECalEntrance = posAtECal.eta(); + } + track = candidate->bestTrack(); + } + if (track != nullptr) { + if (track->pt() > tauVars.leadChargedPFCandPt) { + tauVars.leadChargedPFCandEtaAtEcalEntrance = etaAtECalEntrance; + tauVars.leadChargedPFCandPt = track->pt(); + } + } + sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy(); + sumEnergy += candidate->energy(); + } + if (sumEnergy > 0.) { + tauVars.etaAtEcalEntrance = sumEtaTimesEnergy / sumEnergy; + } + if (isFromPFCands) { + const reco::PFCandidate* pfLeadCandidte = + static_cast(theTau.leadChargedHadrCand().get()); + tauVars.emFraction = + std::max(pfLeadCandidte->ecalEnergy() / (pfLeadCandidte->ecalEnergy() + pfLeadCandidte->hcalEnergy()), 0.); + } else { + const pat::PackedCandidate* patLeadCandiate = + dynamic_cast(theTau.leadChargedHadrCand().get()); + if (patLeadCandiate != nullptr) { + tauVars.emFraction = std::max(1. - patLeadCandiate->hcalFraction(), 0.); } } - sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy(); - sumPhiTimesEnergy += phiAtECalEntrance * candidate->energy(); - sumEnergy += candidate->energy(); - } - if (sumEnergy > 0.) { - tauVars.etaAtEcalEntrance = sumEtaTimesEnergy / sumEnergy; - tauVars.phi = sumPhiTimesEnergy / sumEnergy; } - - tauVars.emFraction = std::max(theTau.emFraction(), (float)0.); tauVars.leadPFChargedHadrHoP = 0.; tauVars.leadPFChargedHadrEoP = 0.; if (theTau.leadChargedHadrCand()->p() > 0.) { @@ -793,6 +1284,41 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const return tauVars; } +// reco::GsfElectron +template +void AntiElectronIDMVA6::getElecVarsHGCalTypeSpecific( + const reco::GsfElectron& theEle, antiElecIDMVA6_blocks::ElecVars& elecVars) { + //FIXME: add logic to it + return; +} + +// pat::Electron +template +void AntiElectronIDMVA6::getElecVarsHGCalTypeSpecific( + const pat::Electron& theEle, antiElecIDMVA6_blocks::ElecVars& elecVars) { + //MB: Assumed that presence of one of the HGCal EleID variables guarantee presence of all + if (!theEle.hasUserFloat("hgcElectronID:sigmaUU")) + return; + + elecVars.hgcalSigmaUU = theEle.userFloat("hgcElectronID:sigmaUU"); + elecVars.hgcalSigmaVV = theEle.userFloat("hgcElectronID:sigmaVV"); + elecVars.hgcalSigmaEE = theEle.userFloat("hgcElectronID:sigmaEE"); + elecVars.hgcalSigmaPP = theEle.userFloat("hgcElectronID:sigmaPP"); + elecVars.hgcalNLayers = theEle.userFloat("hgcElectronID:nLayers"); + elecVars.hgcalFirstLayer = theEle.userFloat("hgcElectronID:firstLayer"); + elecVars.hgcalLastLayer = theEle.userFloat("hgcElectronID:lastLayer"); + elecVars.hgcalLayerEfrac10 = theEle.userFloat("hgcElectronID:layerEfrac10"); + elecVars.hgcalLayerEfrac90 = theEle.userFloat("hgcElectronID:layerEfrac90"); + elecVars.hgcalEcEnergyEE = theEle.userFloat("hgcElectronID:ecEnergyEE"); + elecVars.hgcalEcEnergyFH = theEle.userFloat("hgcElectronID:ecEnergyFH"); + elecVars.hgcalMeasuredDepth = theEle.userFloat("hgcElectronID:measuredDepth"); + elecVars.hgcalExpectedDepth = theEle.userFloat("hgcElectronID:expectedDepth"); + elecVars.hgcalExpectedSigma = theEle.userFloat("hgcElectronID:expectedSigma"); + elecVars.hgcalDepthCompatibility = theEle.userFloat("hgcElectronID:depthCompatibility"); + + return; +} + // compile desired types and make available to linker template class AntiElectronIDMVA6; template class AntiElectronIDMVA6; From 7e6c3a463c10bcfa1c8fbce7b20cc3c4102641d7 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Fri, 11 Sep 2020 17:36:36 +0200 Subject: [PATCH 009/778] rename cffs for phase2 anti-e MVA6 tauID --- ...ff.py => PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py} | 0 ...py => PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename RecoTauTag/RecoTau/python/{PATTauDiscriminationAgainstElectronMVA6_cff.py => PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py} (100%) rename RecoTauTag/RecoTau/python/{PFRecoTauDiscriminationAgainstElectronMVA6_cff.py => PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py} (100%) diff --git a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py similarity index 100% rename from RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6_cff.py rename to RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py similarity index 100% rename from RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6_cff.py rename to RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py From 7047f3bf3d87d781557138069046f20be797a54f Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Fri, 11 Sep 2020 17:38:30 +0200 Subject: [PATCH 010/778] Define phase2 electronId sources for anti-e MVA6 discriminant --- .../PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py index 45f8e06f0a7ee..9880149a1131c 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py @@ -25,6 +25,7 @@ srcElectrons = 'mergedGsfElectronsForTauId', isPhase2 = True, vetoEcalCracks = False, + hgcalElectronIDs = [cms.InputTag("hgcElectronIdForTauId", key) for key in hgcElectronIdForTauId.variables], mvaName_NoEleMatch_woGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL", mvaName_NoEleMatch_wGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL", mvaName_woGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL", From bbcfde910ceb78a69efe7358ff46d64050b40a34 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Mon, 14 Sep 2020 17:45:38 +0200 Subject: [PATCH 011/778] Enable use of phase2 electronId sources for anti-e MVA6 discriminant --- .../RecoTau/interface/AntiElectronIDMVA6.h | 17 ++- .../TauDiscriminationAgainstElectronMVA6.cc | 8 +- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 144 +++++++++++------- 3 files changed, 109 insertions(+), 60 deletions(-) diff --git a/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h b/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h index 9d4647f763b34..1b7666dd0785f 100644 --- a/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h +++ b/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h @@ -13,6 +13,7 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/FileInPath.h" #include "DataFormats/TauReco/interface/PFTau.h" @@ -112,7 +113,10 @@ namespace antiElecIDMVA6_blocks { template class AntiElectronIDMVA6 { public: - AntiElectronIDMVA6(const edm::ParameterSet&); + typedef std::vector ElectronCollection; + typedef edm::Ref ElectronRef; + + AntiElectronIDMVA6(const edm::ParameterSet&, edm::ConsumesCollector&&); ~AntiElectronIDMVA6(); void beginEvent(const edm::Event&, const edm::EventSetup&); @@ -130,7 +134,7 @@ class AntiElectronIDMVA6 { const antiElecIDMVA6_blocks::ElecVars& elecVars); // this function can be called for all categories - double MVAValue(const TauType& theTau, const ElectronType& theEle); + double MVAValue(const TauType& theTau, const ElectronRef& theEleRef); // this function can be called for category 1 only !! double MVAValue(const TauType& theTau); @@ -139,10 +143,10 @@ class AntiElectronIDMVA6 { antiElecIDMVA6_blocks::TauVars getTauVarsTypeSpecific(const pat::Tau& theTau); antiElecIDMVA6_blocks::TauVars getTauVars(const TauType& theTau); antiElecIDMVA6_blocks::TauGammaVecs getTauGammaVecs(const TauType& theTau); - antiElecIDMVA6_blocks::ElecVars getElecVars(const ElectronType& theEle); + antiElecIDMVA6_blocks::ElecVars getElecVars(const ElectronRef& theEleRef); // overloaded method with explicit electron type to avoid partial imlementation of full class - void getElecVarsHGCalTypeSpecific(const reco::GsfElectron& theEle, antiElecIDMVA6_blocks::ElecVars& elecVars); - void getElecVarsHGCalTypeSpecific(const pat::Electron& theEle, antiElecIDMVA6_blocks::ElecVars& elecVars); + void getElecVarsHGCalTypeSpecific(const reco::GsfElectronRef& theEleRef, antiElecIDMVA6_blocks::ElecVars& elecVars); + void getElecVarsHGCalTypeSpecific(const pat::ElectronRef& theEleRef, antiElecIDMVA6_blocks::ElecVars& elecVars); private: double dCrackEta(double eta); @@ -201,6 +205,9 @@ class AntiElectronIDMVA6 { PositionAtECalEntranceComputer positionAtECalEntrance_; + std::map>> electronIds_tokens_; + std::map>> electronIds_; + const bool isPhase2_; const int verbosity_; diff --git a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc index 2ad8e2a07c729..5df917d71e729 100644 --- a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc +++ b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc @@ -27,7 +27,8 @@ class TauDiscriminationAgainstElectronMVA6 : public TauDiscriminationProducerBas reco::SingleTauDiscriminatorContainer, TauDiscriminator>::TauDiscriminationProducerBase(cfg), moduleLabel_(cfg.getParameter("@module_label")), - mva_(std::make_unique>(cfg)), + mva_( + std::make_unique>(cfg, edm::EDConsumerBase::consumesCollector())), Electron_token(edm::EDConsumerBase::consumes( cfg.getParameter("srcElectrons"))), // MB: full specification with prefix mandatory vetoEcalCracks_(cfg.getParameter("vetoEcalCracks")), @@ -124,12 +125,15 @@ TauDiscriminationAgainstElectronMVA6::d } // loop over the electrons + size_t iElec = 0; for (const auto& theElectron : *electrons_) { + edm::Ref theElecRef(electrons_, iElec); + iElec++; if (theElectron.pt() > 10.) { // CV: only take electrons above some minimal energy/Pt into account... double deltaREleTau = deltaR(theElectron.p4(), theTauRef->p4()); deltaRDummy = std::min(deltaREleTau, deltaRDummy); if (deltaREleTau < deltaREleTauMax_) { - double mva_match = mva_->MVAValue(*theTauRef, theElectron); + double mva_match = mva_->MVAValue(*theTauRef, theElecRef); if (!hasGsfTrack) hasGsfTrack = theElectron.gsfTrack().isNonnull(); diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index a84c74f80a18b..4a40f781fb82f 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -17,7 +17,7 @@ using namespace antiElecIDMVA6_blocks; template -AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::ParameterSet& cfg) +AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::ParameterSet& cfg, edm::ConsumesCollector&& cc) : isInitialized_(false), mva_NoEleMatch_woGwoGSF_BL_(nullptr), mva_NoEleMatch_wGwoGSF_BL_(nullptr), @@ -83,6 +83,16 @@ AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::Paramet Var_NoEleMatch_wGwoGSF_VFEndcap_ = new float[14]; Var_woGwGSF_VFEndcap_ = new float[32]; Var_wGwGSF_VFEndcap_ = new float[40]; + + //MB: Tokens for additional inputs (HGCal EleID variables) only for Phase2 and reco::GsfElectrons + if (std::is_same::value) { + for (const auto& inputTag : cfg.getParameter>("hgcalElectronIDs")) { + std::string elecIdLabel = "hgcElectronID:" + inputTag.instance(); + electronIds_tokens_[elecIdLabel] = cc.consumes>( + inputTag); //MB: It assumes that instances are not empty and meaningful (as for userData in patElectrons) + electronIds_[elecIdLabel] = edm::Handle>(); + } + } } } @@ -186,6 +196,14 @@ void AntiElectronIDMVA6::beginEvent(const edm::Event& evt isInitialized_ = true; } positionAtECalEntrance_.beginEvent(es); + //MB: Handle additional inputs (HGCal EleID variables) only for Phase2 and reco::GsfElectrons + if (isPhase2_ && std::is_same::value) { + for (const auto& eId_token : electronIds_tokens_) { + edm::Handle> electronId; + evt.getByToken(eId_token.second, electronId); + electronIds_[eId_token.first] = electronId; + } + } } template @@ -796,7 +814,7 @@ double AntiElectronIDMVA6::MVAValuePhase2(const TauVars& } //// template -double AntiElectronIDMVA6::MVAValue(const TauType& theTau, const ElectronType& theEle) +double AntiElectronIDMVA6::MVAValue(const TauType& theTau, const ElectronRef& theEleRef) { // === tau variables === @@ -804,7 +822,7 @@ double AntiElectronIDMVA6::MVAValue(const TauType& theTau TauGammaVecs tauGammaVecs = AntiElectronIDMVA6::getTauGammaVecs(theTau); // === electron variables === - ElecVars elecVars = AntiElectronIDMVA6::getElecVars(theEle); + ElecVars elecVars = AntiElectronIDMVA6::getElecVars(theEleRef); return MVAValue(tauVars, tauGammaVecs, elecVars); } @@ -896,16 +914,16 @@ TauGammaVecs AntiElectronIDMVA6::getTauGammaVecs(const Ta } template -ElecVars AntiElectronIDMVA6::getElecVars(const ElectronType& theEle) { +ElecVars AntiElectronIDMVA6::getElecVars(const ElectronRef& theEleRef) { ElecVars elecVars; - elecVars.eta = theEle.eta(); - elecVars.phi = theEle.phi(); + elecVars.eta = theEleRef->eta(); + elecVars.phi = theEleRef->phi(); // Variables related to the electron Cluster float elecEe = 0.; float elecEgamma = 0.; - reco::SuperClusterRef pfSuperCluster = theEle.superCluster(); + reco::SuperClusterRef pfSuperCluster = theEleRef->superCluster(); if (pfSuperCluster.isNonnull() && pfSuperCluster.isAvailable()) { for (reco::CaloCluster_iterator pfCluster = pfSuperCluster->clustersBegin(); pfCluster != pfSuperCluster->clustersEnd(); @@ -919,53 +937,53 @@ ElecVars AntiElectronIDMVA6::getElecVars(const ElectronTy elecVars.superClusterEtaWidth = pfSuperCluster->etaWidth(); elecVars.superClusterPhiWidth = pfSuperCluster->phiWidth(); } - elecVars.eSeedClusterOverPout = theEle.eSeedClusterOverPout(); - elecVars.showerCircularity = 1. - theEle.e1x5() / theEle.e5x5(); - elecVars.r9 = theEle.r9(); - elecVars.sigmaIEtaIEta5x5 = theEle.full5x5_sigmaIetaIeta(); - elecVars.sigmaIPhiIPhi5x5 = theEle.full5x5_sigmaIphiIphi(); - - elecVars.pIn = std::sqrt(theEle.trackMomentumAtVtx().Mag2()); - elecVars.pOut = std::sqrt(theEle.trackMomentumOut().Mag2()); + elecVars.eSeedClusterOverPout = theEleRef->eSeedClusterOverPout(); + elecVars.showerCircularity = 1. - theEleRef->e1x5() / theEleRef->e5x5(); + elecVars.r9 = theEleRef->r9(); + elecVars.sigmaIEtaIEta5x5 = theEleRef->full5x5_sigmaIetaIeta(); + elecVars.sigmaIPhiIPhi5x5 = theEleRef->full5x5_sigmaIphiIphi(); + + elecVars.pIn = std::sqrt(theEleRef->trackMomentumAtVtx().Mag2()); + elecVars.pOut = std::sqrt(theEleRef->trackMomentumOut().Mag2()); elecVars.eTotOverPin = (elecVars.pIn > 0.0) ? ((elecEe + elecEgamma) / elecVars.pIn) : -0.1; - elecVars.eEcal = theEle.ecalEnergy(); + elecVars.eEcal = theEleRef->ecalEnergy(); if (!isPhase2_) { - elecVars.deltaEta = theEle.deltaEtaSeedClusterTrackAtCalo(); - elecVars.deltaPhi = theEle.deltaPhiSeedClusterTrackAtCalo(); + elecVars.deltaEta = theEleRef->deltaEtaSeedClusterTrackAtCalo(); + elecVars.deltaPhi = theEleRef->deltaPhiSeedClusterTrackAtCalo(); } else { - elecVars.deltaEta = theEle.deltaEtaEleClusterTrackAtCalo(); - elecVars.deltaPhi = theEle.deltaPhiEleClusterTrackAtCalo(); + elecVars.deltaEta = theEleRef->deltaEtaEleClusterTrackAtCalo(); + elecVars.deltaPhi = theEleRef->deltaPhiEleClusterTrackAtCalo(); } - elecVars.mvaInSigmaEtaEta = theEle.mvaInput().sigmaEtaEta; - elecVars.mvaInHadEnergy = theEle.mvaInput().hadEnergy; - elecVars.mvaInDeltaEta = theEle.mvaInput().deltaEta; + elecVars.mvaInSigmaEtaEta = theEleRef->mvaInput().sigmaEtaEta; + elecVars.mvaInHadEnergy = theEleRef->mvaInput().hadEnergy; + elecVars.mvaInDeltaEta = theEleRef->mvaInput().deltaEta; // Variables related to the GsfTrack elecVars.chi2NormGSF = -99.; elecVars.gsfNumHits = -99.; elecVars.gsfTrackResol = -99.; elecVars.gsfTracklnPt = -99.; - if (theEle.gsfTrack().isNonnull()) { - elecVars.chi2NormGSF = theEle.gsfTrack()->normalizedChi2(); - elecVars.gsfNumHits = theEle.gsfTrack()->numberOfValidHits(); - if (theEle.gsfTrack()->pt() > 0.) { - elecVars.gsfTrackResol = theEle.gsfTrack()->ptError() / theEle.gsfTrack()->pt(); - elecVars.gsfTracklnPt = log(theEle.gsfTrack()->pt()) * M_LN10; + if (theEleRef->gsfTrack().isNonnull()) { + elecVars.chi2NormGSF = theEleRef->gsfTrack()->normalizedChi2(); + elecVars.gsfNumHits = theEleRef->gsfTrack()->numberOfValidHits(); + if (theEleRef->gsfTrack()->pt() > 0.) { + elecVars.gsfTrackResol = theEleRef->gsfTrack()->ptError() / theEleRef->gsfTrack()->pt(); + elecVars.gsfTracklnPt = log(theEleRef->gsfTrack()->pt()) * M_LN10; } } // Variables related to the CtfTrack elecVars.chi2NormKF = -99.; elecVars.kfNumHits = -99.; - if (theEle.closestCtfTrackRef().isNonnull()) { - elecVars.chi2NormKF = theEle.closestCtfTrackRef()->normalizedChi2(); - elecVars.kfNumHits = theEle.closestCtfTrackRef()->numberOfValidHits(); + if (theEleRef->closestCtfTrackRef().isNonnull()) { + elecVars.chi2NormKF = theEleRef->closestCtfTrackRef()->normalizedChi2(); + elecVars.kfNumHits = theEleRef->closestCtfTrackRef()->numberOfValidHits(); } // Variables related to HGCal - if (isPhase2_ && !theEle.isEB()) { + if (isPhase2_ && !theEleRef->isEB()) { if (std::is_same::value || std::is_same::value) - getElecVarsHGCalTypeSpecific(theEle, elecVars); + getElecVarsHGCalTypeSpecific(theEleRef, elecVars); else throw cms::Exception("AntiElectronIDMVA6") << "Unsupported ElectronType used. You must use either reco::GsfElectron or pat::Electron."; @@ -1287,34 +1305,54 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const // reco::GsfElectron template void AntiElectronIDMVA6::getElecVarsHGCalTypeSpecific( - const reco::GsfElectron& theEle, antiElecIDMVA6_blocks::ElecVars& elecVars) { - //FIXME: add logic to it + const reco::GsfElectronRef& theEleRef, antiElecIDMVA6_blocks::ElecVars& elecVars) { + //MB: Assumed that presence of one of the HGCal EleID variables guarantee presence of all + if (!(electronIds_.find("hgcElectronID:sigmaUU") != electronIds_.end() && + electronIds_.at("hgcElectronID:sigmaUU").isValid())) + return; + + elecVars.hgcalSigmaUU = (*electronIds_.at("hgcElectronID:sigmaUU"))[theEleRef]; + elecVars.hgcalSigmaVV = (*electronIds_.at("hgcElectronID:sigmaVV"))[theEleRef]; + elecVars.hgcalSigmaEE = (*electronIds_.at("hgcElectronID:sigmaEE"))[theEleRef]; + elecVars.hgcalSigmaPP = (*electronIds_.at("hgcElectronID:sigmaPP"))[theEleRef]; + elecVars.hgcalNLayers = (*electronIds_.at("hgcElectronID:nLayers"))[theEleRef]; + elecVars.hgcalFirstLayer = (*electronIds_.at("hgcElectronID:firstLayer"))[theEleRef]; + elecVars.hgcalLastLayer = (*electronIds_.at("hgcElectronID:lastLayer"))[theEleRef]; + elecVars.hgcalLayerEfrac10 = (*electronIds_.at("hgcElectronID:layerEfrac10"))[theEleRef]; + elecVars.hgcalLayerEfrac90 = (*electronIds_.at("hgcElectronID:layerEfrac90"))[theEleRef]; + elecVars.hgcalEcEnergyEE = (*electronIds_.at("hgcElectronID:ecEnergyEE"))[theEleRef]; + elecVars.hgcalEcEnergyFH = (*electronIds_.at("hgcElectronID:ecEnergyFH"))[theEleRef]; + elecVars.hgcalMeasuredDepth = (*electronIds_.at("hgcElectronID:measuredDepth"))[theEleRef]; + elecVars.hgcalExpectedDepth = (*electronIds_.at("hgcElectronID:expectedDepth"))[theEleRef]; + elecVars.hgcalExpectedSigma = (*electronIds_.at("hgcElectronID:expectedSigma"))[theEleRef]; + elecVars.hgcalDepthCompatibility = (*electronIds_.at("hgcElectronID:depthCompatibility"))[theEleRef]; + return; } // pat::Electron template void AntiElectronIDMVA6::getElecVarsHGCalTypeSpecific( - const pat::Electron& theEle, antiElecIDMVA6_blocks::ElecVars& elecVars) { + const pat::ElectronRef& theEleRef, antiElecIDMVA6_blocks::ElecVars& elecVars) { //MB: Assumed that presence of one of the HGCal EleID variables guarantee presence of all - if (!theEle.hasUserFloat("hgcElectronID:sigmaUU")) + if (!theEleRef->hasUserFloat("hgcElectronID:sigmaUU")) return; - elecVars.hgcalSigmaUU = theEle.userFloat("hgcElectronID:sigmaUU"); - elecVars.hgcalSigmaVV = theEle.userFloat("hgcElectronID:sigmaVV"); - elecVars.hgcalSigmaEE = theEle.userFloat("hgcElectronID:sigmaEE"); - elecVars.hgcalSigmaPP = theEle.userFloat("hgcElectronID:sigmaPP"); - elecVars.hgcalNLayers = theEle.userFloat("hgcElectronID:nLayers"); - elecVars.hgcalFirstLayer = theEle.userFloat("hgcElectronID:firstLayer"); - elecVars.hgcalLastLayer = theEle.userFloat("hgcElectronID:lastLayer"); - elecVars.hgcalLayerEfrac10 = theEle.userFloat("hgcElectronID:layerEfrac10"); - elecVars.hgcalLayerEfrac90 = theEle.userFloat("hgcElectronID:layerEfrac90"); - elecVars.hgcalEcEnergyEE = theEle.userFloat("hgcElectronID:ecEnergyEE"); - elecVars.hgcalEcEnergyFH = theEle.userFloat("hgcElectronID:ecEnergyFH"); - elecVars.hgcalMeasuredDepth = theEle.userFloat("hgcElectronID:measuredDepth"); - elecVars.hgcalExpectedDepth = theEle.userFloat("hgcElectronID:expectedDepth"); - elecVars.hgcalExpectedSigma = theEle.userFloat("hgcElectronID:expectedSigma"); - elecVars.hgcalDepthCompatibility = theEle.userFloat("hgcElectronID:depthCompatibility"); + elecVars.hgcalSigmaUU = theEleRef->userFloat("hgcElectronID:sigmaUU"); + elecVars.hgcalSigmaVV = theEleRef->userFloat("hgcElectronID:sigmaVV"); + elecVars.hgcalSigmaEE = theEleRef->userFloat("hgcElectronID:sigmaEE"); + elecVars.hgcalSigmaPP = theEleRef->userFloat("hgcElectronID:sigmaPP"); + elecVars.hgcalNLayers = theEleRef->userFloat("hgcElectronID:nLayers"); + elecVars.hgcalFirstLayer = theEleRef->userFloat("hgcElectronID:firstLayer"); + elecVars.hgcalLastLayer = theEleRef->userFloat("hgcElectronID:lastLayer"); + elecVars.hgcalLayerEfrac10 = theEleRef->userFloat("hgcElectronID:layerEfrac10"); + elecVars.hgcalLayerEfrac90 = theEleRef->userFloat("hgcElectronID:layerEfrac90"); + elecVars.hgcalEcEnergyEE = theEleRef->userFloat("hgcElectronID:ecEnergyEE"); + elecVars.hgcalEcEnergyFH = theEleRef->userFloat("hgcElectronID:ecEnergyFH"); + elecVars.hgcalMeasuredDepth = theEleRef->userFloat("hgcElectronID:measuredDepth"); + elecVars.hgcalExpectedDepth = theEleRef->userFloat("hgcElectronID:expectedDepth"); + elecVars.hgcalExpectedSigma = theEleRef->userFloat("hgcElectronID:expectedSigma"); + elecVars.hgcalDepthCompatibility = theEleRef->userFloat("hgcElectronID:depthCompatibility"); return; } From 99de1af45d8f3f33baeef7f178af0e3ac6a1e54a Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 15 Sep 2020 13:34:20 +0200 Subject: [PATCH 012/778] Add WPs of phase2 anti-e MVA6 tauID --- ...riminationAgainstElectronMVA6Phase2_cff.py | 83 +++++++++++++++++- ...riminationAgainstElectronMVA6Phase2_cff.py | 85 ++++++++++++++++++- 2 files changed, 161 insertions(+), 7 deletions(-) diff --git a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py index 156adc33edf2c..b3e09646c0acb 100644 --- a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py +++ b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py @@ -4,13 +4,13 @@ mergedSlimmedElectronsForTauId = cms.EDProducer('PATElectronCollectionMerger', src = cms.VInputTag('slimmedElectrons', 'slimmedElectronsFromMultiCl') ) -# anti-e phase-2 tauID +# anti-e phase-2 tauID (Raw) from RecoTauTag.RecoTau.TauDiscriminatorTools import noPrediscriminants from RecoTauTag.RecoTau.patTauDiscriminationAgainstElectronMVA6_cfi import * -patTauDiscriminationAgainstElectronMVA6Phase2 = patTauDiscriminationAgainstElectronMVA6.clone( +patTauDiscriminationAgainstElectronMVA6Phase2Raw = patTauDiscriminationAgainstElectronMVA6.clone( #Note: PATTauProducer has to be set in the final cfg Prediscriminants = noPrediscriminants, - srcElectrons = 'mergedSlimmedElectronsForTauId', + srcElectrons = "mergedSlimmedElectronsForTauId", isPhase2 = True, vetoEcalCracks = False, mvaName_NoEleMatch_woGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL", @@ -26,9 +26,86 @@ mvaName_woGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC", mvaName_wGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC" ) +# anti-e phase-2 tauID (WPs) +from RecoTauTag.RecoTau.patTauDiscriminantCutMultiplexerDefault_cfi import patTauDiscriminantCutMultiplexerDefault +patTauDiscriminationAgainstElectronMVA6Phase2 = patTauDiscriminantCutMultiplexerDefault.clone( + #Note: PFTauProducer and Prediscriminants have to be set in the final cfg + toMultiplex = 'patTauDiscriminationAgainstElectronMVA6Phase2Raw', + mapping = [ + cms.PSet( + category = cms.uint32(0), # minMVANoEleMatchWOgWOgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(2), # minMVANoEleMatchWgWOgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(5), # minMVAWOgWgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(7), # minMVAWgWgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(8), # minMVANoEleMatchWOgWOgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(9), # minMVANoEleMatchWOgWOgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(10), # minMVANoEleMatchWgWOgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(11), # minMVANoEleMatchWgWOgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(13), # minMVAWOgWgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(14), # minMVAWOgWgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(15), # minMVAWgWgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(16), # minMVAWgWgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC"), + variable = cms.string("pt") + ) + ], + rawValues = ["discriminator", "category"], + workingPoints = cms.vstring( + "_WPEff98", + "_WPEff90", + "_WPEff80", + "_WPEff70", + "_WPEff60" + ) +) patTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( mergedSlimmedElectronsForTauId, + patTauDiscriminationAgainstElectronMVA6Phase2Raw, patTauDiscriminationAgainstElectronMVA6Phase2 ) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py index 9880149a1131c..8c0746c2a0bca 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py @@ -16,13 +16,13 @@ ) # HGCal EleID with merged electron collection hgcElectronIdForTauId = hgcalElectronIDValueMap.clone( - electrons = cms.InputTag("mergedGsfElectronsForTauId"), + electrons = "mergedGsfElectronsForTauId" ) -# anti-e phase-2 tauID +# anti-e phase-2 tauID (raw) from RecoTauTag.RecoTau.pfRecoTauDiscriminationAgainstElectronMVA6_cfi import * -pfRecoTauDiscriminationAgainstElectronMVA6Phase2 = pfRecoTauDiscriminationAgainstElectronMVA6.clone( +pfRecoTauDiscriminationAgainstElectronMVA6Phase2Raw = pfRecoTauDiscriminationAgainstElectronMVA6.clone( #Note: PFTauProducer and Prediscriminants have to be set in the final cfg - srcElectrons = 'mergedGsfElectronsForTauId', + srcElectrons = "mergedGsfElectronsForTauId", isPhase2 = True, vetoEcalCracks = False, hgcalElectronIDs = [cms.InputTag("hgcElectronIdForTauId", key) for key in hgcElectronIdForTauId.variables], @@ -39,6 +39,82 @@ mvaName_woGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC", mvaName_wGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC" ) +# anti-e phase-2 tauID (WPs) +from RecoTauTag.RecoTau.recoTauDiscriminantCutMultiplexerDefault_cfi import recoTauDiscriminantCutMultiplexerDefault +pfRecoTauDiscriminationAgainstElectronMVA6Phase2 = recoTauDiscriminantCutMultiplexerDefault.clone( + #Note: PFTauProducer and Prediscriminants have to be set in the final cfg + toMultiplex = "pfRecoTauDiscriminationAgainstElectronMVA6Phase2Raw", + mapping = [ + cms.PSet( + category = cms.uint32(0), # minMVANoEleMatchWOgWOgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(2), # minMVANoEleMatchWgWOgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(5), # minMVAWOgWgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(7), # minMVAWgWgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(8), # minMVANoEleMatchWOgWOgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(9), # minMVANoEleMatchWOgWOgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(10), # minMVANoEleMatchWgWOgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(11), # minMVANoEleMatchWgWOgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(13), # minMVAWOgWgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(14), # minMVAWOgWgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(15), # minMVAWgWgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(16), # minMVAWgWgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC"), + variable = cms.string("pt") + ) + ], + rawValues = ["discriminator", "category"], + workingPoints = cms.vstring( + "_WPEff98", + "_WPEff90", + "_WPEff80", + "_WPEff70", + "_WPEff60" + ) +) electronsForTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( cleanedEcalDrivenGsfElectronsFromMultiCl, @@ -49,6 +125,7 @@ pfRecoTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( electronsForTauDiscriminationAgainstElectronMVA6Phase2Task, + pfRecoTauDiscriminationAgainstElectronMVA6Phase2Raw, pfRecoTauDiscriminationAgainstElectronMVA6Phase2 ) From 6f9cb828c357c77cccb91021d535617bb9c26445 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 15 Sep 2020 15:36:12 +0200 Subject: [PATCH 013/778] Skip computation of unused variables --- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index 4a40f781fb82f..e4afafa405235 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -925,14 +925,16 @@ ElecVars AntiElectronIDMVA6::getElecVars(const ElectronRe float elecEgamma = 0.; reco::SuperClusterRef pfSuperCluster = theEleRef->superCluster(); if (pfSuperCluster.isNonnull() && pfSuperCluster.isAvailable()) { - for (reco::CaloCluster_iterator pfCluster = pfSuperCluster->clustersBegin(); - pfCluster != pfSuperCluster->clustersEnd(); - ++pfCluster) { - double pfClusterEn = (*pfCluster)->energy(); - if (pfCluster == pfSuperCluster->clustersBegin()) - elecEe += pfClusterEn; - else - elecEgamma += pfClusterEn; + if (!isPhase2_) { + for (reco::CaloCluster_iterator pfCluster = pfSuperCluster->clustersBegin(); + pfCluster != pfSuperCluster->clustersEnd(); + ++pfCluster) { + double pfClusterEn = (*pfCluster)->energy(); + if (pfCluster == pfSuperCluster->clustersBegin()) + elecEe += pfClusterEn; + else + elecEgamma += pfClusterEn; + } } elecVars.superClusterEtaWidth = pfSuperCluster->etaWidth(); elecVars.superClusterPhiWidth = pfSuperCluster->phiWidth(); From a444e6623983d82660ac79b6f68262da975e035d Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 15 Sep 2020 15:37:45 +0200 Subject: [PATCH 014/778] Add phase2 anti-e MVA6 tauID to tauID python configuration tool --- .../RecoTau/python/tools/runTauIdMVA.py | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py index 8cea4ad6b132f..7167a9eab12e4 100644 --- a/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py +++ b/RecoTauTag/RecoTau/python/tools/runTauIdMVA.py @@ -13,7 +13,8 @@ class TauIDEmbedder(object): "deepTau2017v1", "deepTau2017v2", "deepTau2017v2p1", "DPFTau_2016_v0", "DPFTau_2016_v1", "againstEle2018", - "newDMPhase2v1" + "newDMPhase2v1", + "againstElePhase2v1" ] def __init__(self, process, debug = False, @@ -917,6 +918,47 @@ def tauIDMVAinputs(module, wp): tauIDSources.byTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff60") tauIDSources.byVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff50") tauIDSources.byVVTightIsolationMVADBnewDMwLTPhase2 = tauIDMVAinputs("rerunDiscriminationByIsolationMVADBnewDMwLTPhase2", "_WPEff40") + + if "againstElePhase2v1" in self.toKeep: + if self.debug: print ("Adding anti-e Phase2v1 ID") + ### Define new anti-e discriminants for Phase2 + ## Raw + from RecoTauTag.RecoTau.PATTauDiscriminationAgainstElectronMVA6Phase2_cff import patTauDiscriminationAgainstElectronMVA6Phase2Raw, patTauDiscriminationAgainstElectronMVA6Phase2, mergedSlimmedElectronsForTauId + self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Raw = patTauDiscriminationAgainstElectronMVA6Phase2Raw.clone( + PATTauProducer = 'slimmedTaus', + Prediscriminants = noPrediscriminants #already selected for MiniAOD + ) + ## WPs + self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1 = patTauDiscriminationAgainstElectronMVA6Phase2.clone( + PATTauProducer = self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Raw.PATTauProducer, + Prediscriminants = self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Raw.Prediscriminants, + toMultiplex = 'patTauDiscriminationByElectronRejectionMVA6Phase2v1Raw' + ) + ### Put all new phase2 anti-e discrminats to a sequence + self.process.mergedSlimmedElectronsForTauId = mergedSlimmedElectronsForTauId + self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Task = cms.Task( + self.process.mergedSlimmedElectronsForTauId, + self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Raw, + self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1 + ) + self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Seq = cms.Sequence(self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Task) + self.process.rerunMvaIsolationTask.add(self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Task) + self.process.rerunMvaIsolationSequence += self.process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Seq + + _againstElectronTauIDPhase2v1Sources = cms.PSet( + againstElectronMVA6RawPhase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "raw"), + againstElectronMVA6categoryPhase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "category"), + againstElectronVLooseMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff98"), + againstElectronLooseMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff90"), + againstElectronMediumMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff80"), + againstElectronTightMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff70"), + againstElectronVTightMVA6Phase2v1 = self.tauIDMVAinputs("patTauDiscriminationByElectronRejectionMVA6Phase2v1", "_WPEff60") + ) + _tauIDSourcesWithAgainistElePhase2v1 = cms.PSet( + tauIDSources.clone(), + _againstElectronTauIDPhase2v1Sources + ) + tauIDSources =_tauIDSourcesWithAgainistElePhase2v1.clone() ## if self.debug: print('Embedding new TauIDs into \"'+self.updatedTauName+'\"') if not hasattr(self.process, self.updatedTauName): From 03739f89e47ba2deb273dd2e26c58f2fd1442e49 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 15 Sep 2020 16:02:31 +0200 Subject: [PATCH 015/778] Enable phase2 anti-e tauID in miniAOD sequences --- PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 8571d42bfc8c4..d5d75585e7050 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -360,7 +360,8 @@ def miniAOD_customizeCommon(process): toKeep = ['deepTau2017v2p1'] ) from Configuration.Eras.Modifier_phase2_common_cff import phase2_common #Phase2 Tau MVA - phase2_common.toModify(tauIdEmbedder.toKeep, func=lambda t:t.append('newDMPhase2v1')) #Phase2 Tau MVA + phase2_common.toModify(tauIdEmbedder.toKeep, func=lambda t:t.append('newDMPhase2v1')) #Phase2 Tau isolation MVA + phase2_common.toModify(tauIdEmbedder.toKeep, func=lambda t:t.append('againstElePhase2v1')) #Phase2 Tau anti-e MVA tauIdEmbedder.runTauID() addToProcessAndTask(_noUpdatedTauName, process.slimmedTaus.clone(),process,task) delattr(process, 'slimmedTaus') @@ -374,6 +375,10 @@ def miniAOD_customizeCommon(process): process.rerunDiscriminationByIsolationMVADBnewDMwLTPhase2raw.PATTauProducer=_noUpdatedTauName process.rerunDiscriminationByIsolationMVADBnewDMwLTPhase2.PATTauProducer=_noUpdatedTauName task.add(process.rerunIsolationMVADBnewDMwLTPhase2Task) + if 'againstElePhase2v1' in tauIdEmbedder.toKeep: + process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Raw.PATTauProducer=_noUpdatedTauName + process.patTauDiscriminationByElectronRejectionMVA6Phase2v1.PATTauProducer=_noUpdatedTauName + task.add(process.patTauDiscriminationByElectronRejectionMVA6Phase2v1Task) #-- Rerun tauID against dead ECal towers to taus for the various re-MiniAOD eras # to enable default behoviour with leading track extrapolation to ECAL From f8ba5b3b6cf32d0de220521a33d64054bceb767b Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Wed, 16 Sep 2020 11:11:46 +0200 Subject: [PATCH 016/778] PositionAtECalEntranceComputer: set phase2 flag in C-tor --- .../interface/PositionAtECalEntranceComputer.h | 5 +++-- .../TauDiscriminationAgainstElectronMVA6.cc | 10 +++++----- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 16 ++++++++-------- .../src/PositionAtECalEntranceComputer.cc | 17 +++++++++-------- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h b/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h index fcd10a3fb9d88..17f7dbafb26ae 100644 --- a/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h +++ b/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h @@ -21,16 +21,17 @@ class MagneticField; class PositionAtECalEntranceComputer { public: - PositionAtECalEntranceComputer(); + PositionAtECalEntranceComputer(bool isPhase2 = false); ~PositionAtECalEntranceComputer(); void beginEvent(const edm::EventSetup&); //To do: it seems to more practical to put this to the ES - reco::Candidate::Point operator()(const reco::Candidate* particle, bool& success, bool isPhase2 = false) const; + reco::Candidate::Point operator()(const reco::Candidate* particle, bool& success) const; private: double bField_z_; + bool isPhase2_; MagneticField const* bField_; hgcal::RecHitTools recHitTools_; float hgcalFace_z_; diff --git a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc index 5df917d71e729..c98be0b9e4bd8 100644 --- a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc +++ b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc @@ -31,6 +31,7 @@ class TauDiscriminationAgainstElectronMVA6 : public TauDiscriminationProducerBas std::make_unique>(cfg, edm::EDConsumerBase::consumesCollector())), Electron_token(edm::EDConsumerBase::consumes( cfg.getParameter("srcElectrons"))), // MB: full specification with prefix mandatory + positionAtECalEntrance_(PositionAtECalEntranceComputer(cfg.getParameter("isPhase2"))), vetoEcalCracks_(cfg.getParameter("vetoEcalCracks")), isPhase2_(cfg.getParameter("isPhase2")), verbosity_(cfg.getParameter("verbosity")) { @@ -256,7 +257,7 @@ TauDiscriminationAgainstElectronMVA6::g etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta(); } else { // HGCal bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { etaAtECalEntrance = posAtECal.eta(); } @@ -273,7 +274,7 @@ TauDiscriminationAgainstElectronMVA6::g track = pfCandidate->gsfTrackRef().get(); } else { bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { etaAtECalEntrance = posAtECal.eta(); } @@ -307,8 +308,7 @@ TauDiscriminationAgainstElectronMVA6::g float sumEnergy = 0.; bool success = false; - reco::Candidate::Point posAtECal = - positionAtECalEntrance_(theTauRef->leadChargedHadrCand().get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(theTauRef->leadChargedHadrCand().get(), success); if (success) { leadChargedCandEtaAtECalEntrance = posAtECal.eta(); } else { @@ -317,7 +317,7 @@ TauDiscriminationAgainstElectronMVA6::g for (const auto& candidate : theTauRef->signalCands()) { float etaAtECalEntrance = candidate->eta(); success = false; - posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { etaAtECalEntrance = posAtECal.eta(); } diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index e4afafa405235..10fe13ea94637 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -31,6 +31,7 @@ AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::Paramet mva_NoEleMatch_wGwoGSF_VFEC_(nullptr), mva_woGwGSF_VFEC_(nullptr), mva_wGwGSF_VFEC_(nullptr), + positionAtECalEntrance_(PositionAtECalEntranceComputer(cfg.getParameter("isPhase2"))), isPhase2_(cfg.getParameter("isPhase2")), verbosity_(cfg.getParameter("verbosity")) { loadMVAfromDB_ = cfg.exists("loadMVAfromDB") ? cfg.getParameter("loadMVAfromDB") : false; @@ -1107,7 +1108,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const for (const auto& candidate : theTau.signalCands()) { float phiAtECalEntrance = candidate->phi(); bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { phiAtECalEntrance = posAtECal.phi(); } @@ -1124,8 +1125,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const tauVars.etaAtEcalEntrance = -99.; tauVars.leadChargedPFCandEtaAtEcalEntrance = -99.; bool success = false; - reco::Candidate::Point posAtECal = - positionAtECalEntrance_(theTau.leadChargedHadrCand().get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(theTau.leadChargedHadrCand().get(), success); if (success) { tauVars.leadChargedPFCandEtaAtEcalEntrance = posAtECal.eta(); } @@ -1134,7 +1134,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const for (const auto& candidate : theTau.signalCands()) { float etaAtECalEntrance = candidate->eta(); success = false; - posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { etaAtECalEntrance = posAtECal.eta(); } @@ -1185,7 +1185,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const phiAtECalEntrance = pfCandidate->positionAtECALEntrance().phi(); } else { bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { phiAtECalEntrance = posAtECal.phi(); } @@ -1202,7 +1202,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const track = pfCandidate->gsfTrackRef().get(); } else { bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { etaAtECalEntrance = posAtECal.eta(); phiAtECalEntrance = posAtECal.phi(); @@ -1233,7 +1233,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const etaAtECalEntrance = pfCandidate->positionAtECALEntrance().eta(); if (std::abs(theTau.eta()) >= ecalBarrelEndcapEtaBorder_) { //HGCal bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { etaAtECalEntrance = posAtECal.eta(); } @@ -1250,7 +1250,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const track = pfCandidate->gsfTrackRef().get(); } else { bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success, isPhase2_); + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { etaAtECalEntrance = posAtECal.eta(); } diff --git a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc index 587736e7a30df..c0125b91ea450 100644 --- a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc +++ b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc @@ -76,7 +76,7 @@ namespace HGCal_helpers { } } // namespace HGCal_helpers -PositionAtECalEntranceComputer::PositionAtECalEntranceComputer() : bField_z_(-1.) {} +PositionAtECalEntranceComputer::PositionAtECalEntranceComputer(bool isPhase2) : bField_z_(-1.), isPhase2_(isPhase2) {} PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer() {} @@ -85,18 +85,19 @@ void PositionAtECalEntranceComputer::beginEvent(const edm::EventSetup& es) { es.get().get(bFieldH); bField_z_ = bFieldH->inTesla(GlobalPoint(0., 0., 0.)).z(); bField_ = &(*bFieldH); - edm::ESHandle caloGeoH; - es.get().get(caloGeoH); - recHitTools_.setGeometry(*caloGeoH); - hgcalFace_z_ = recHitTools_.getPositionLayer(1).z(); // HGCal 1st layer + if (isPhase2_) { + edm::ESHandle caloGeoH; + es.get().get(caloGeoH); + recHitTools_.setGeometry(*caloGeoH); + hgcalFace_z_ = recHitTools_.getPositionLayer(1).z(); // HGCal 1st layer + } } reco::Candidate::Point PositionAtECalEntranceComputer::operator()(const reco::Candidate* particle, - bool& success, - bool isPhase2) const { + bool& success) const { assert(bField_z_ != -1.); reco::Candidate::Point position; - if (!isPhase2 || std::abs(particle->eta()) < ecalBarrelEndcapEtaBorder_) { // ECal + if (!isPhase2_ || std::abs(particle->eta()) < ecalBarrelEndcapEtaBorder_) { // ECal BaseParticlePropagator propagator = BaseParticlePropagator( RawParticle(particle->p4(), math::XYZTLorentzVector(particle->vertex().x(), particle->vertex().y(), particle->vertex().z(), 0.), From ea9174e99d1eeabeeebb08423a747d8a538c3254 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 22 Sep 2020 17:39:10 +0200 Subject: [PATCH 017/778] Fix XML file: example with PhaseI/trackerStructureTopology.xml. TO DO: Need to do it on all other geometries topology files + Find a way which is compatible with old DD. --- .../data/PhaseI/trackerStructureTopology.xml | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml b/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml index 04a031a7ef02e..c3b016562cbf3 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml @@ -52,12 +52,12 @@ - + - + @@ -319,15 +319,15 @@ - + - + - + @@ -349,15 +349,15 @@ - + - + - + @@ -380,15 +380,15 @@ - + - + - + @@ -410,18 +410,17 @@ - + - + - + - From fe5ed69a48be3019b1f7cc9ca6a4145dd081047a Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 22 Sep 2020 17:52:42 +0200 Subject: [PATCH 018/778] VERY IMPORTANT: Fix navigation in Tracker. This allows to have a 1:1 navigation between old DD and DD4hep. The key idea is that one should not use while (fv.firstChild()) in the CmsTrackerLevelBuilder, as these calls are already intricated in a stack of calls along the volume hierarchy. This would make the volume processing advance too much, while the volumes of interest have actually not been processed yet. The solution is to TAKE ADVANTAGE OF THE STACK CALLS TO NAVIGATE DOWN THE VOLUME HIERARCHY, SWITCH TO THE NEXT VOLUME IN CmsDetConstruction ONLY (to which all calls converged to!), AND THEN WISELY USE THE CALL STACK TO GO BACK UP. In practice, it is a bit more complicated, as in addition, one need to be able to dig a bit further done in the volume hierarchy, within CmsDetConstruction, when the module has 2 sensors. This solution is elegant, simple, and fully works. All other errors are due to independent issues. For example, Phase 1 disk builer segfaults when used with DD4hep, because of hardcoded radius (this segfault did not appear before, because navigation was not ok, hence Phase 1 disk builer was never called (!!!). NB: Calls to firstChild() require an anormalous amount of time before navigation fix, and obviously still do after navigation fix, this is an independent issue. --- .../plugins/CmsDetConstruction.cc | 89 ++++++++++++++++--- .../plugins/CmsTrackerLevelBuilder.cc | 66 ++++++++++---- 2 files changed, 127 insertions(+), 28 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index 1ce32c7a0cf63..2c8063806097f 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -46,21 +46,21 @@ void CmsDetConstruction::buildSmallDetsforStack(FilteredView& fv, mother->addComponent(det); } -template -void CmsDetConstruction::buildComponent(FilteredView& fv, - GeometricDet* mother, - const std::string& attribute) { +template <> +void CmsDetConstruction::buildComponent(DDFilteredView& fv, + GeometricDet* mother, + const std::string& attribute) { // // at this level I check whether it is a merged detector or not // GeometricDet* det = new GeometricDet(&fv, - CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv))); + CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( + ExtractStringFromDDD::getString(attribute, &fv))); //Phase1 mergedDet: searching for sensors - if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::mergedDet) { + if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( + ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::mergedDet) { // I have to go one step lower ... bool dodets = fv.firstChild(); // descend to the first Layer while (dodets) { @@ -75,8 +75,8 @@ void CmsDetConstruction::buildComponent(FilteredView& fv, } //Phase2 stackDet: same procedure, different nomenclature - else if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::OTPhase2Stack) { + else if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( + ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::OTPhase2Stack) { bool dodets = fv.firstChild(); while (dodets) { buildSmallDetsforStack(fv, det, attribute); @@ -88,5 +88,70 @@ void CmsDetConstruction::buildComponent(FilteredView& fv, mother->addComponent(det); } -template class CmsDetConstruction; -template class CmsDetConstruction; +template <> +void CmsDetConstruction::buildComponent(cms::DDFilteredView& fv, + GeometricDet* mother, + const std::string& attribute) { + // + // at this level I check whether it is a merged detector or not + // + + GeometricDet* det = new GeometricDet(&fv, + CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( + ExtractStringFromDDD::getString(attribute, &fv))); + + // PHASE 1 (MERGEDDET) + if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( + ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::mergedDet) { + + // Go down in hierarchy: from module to sensor + if (!fv.firstChild()) { + std::cout << "CmsDetConstruction::buildComponent !fv.firstChild()" << std::endl; + return; + } + + // This is the sensor hierarchy level + const int sensorHierarchyLevel = fv.level(); + + // Loop on all siblings (ie, on all sensors) + while (fv.level() == sensorHierarchyLevel) { + buildSmallDetsforGlued(fv, det, attribute); + + // Go to the next volume in FilteredView. + // NB: If this volume is another sensor of the same module, let's stay in the loop. + // Otherwise, loop is exited. + fv.firstChild(); + } + } + + // PHASE 2 (STACKDET) + else if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( + ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::OTPhase2Stack) { + + // Go down in hierarchy: from module to sensor + if (!fv.firstChild()) { + std::cout << "CmsDetConstruction::buildComponent !fv.firstChild()" << std::endl; + return; + } + + // This is the sensor hierarchy level + const int sensorHierarchyLevel = fv.level(); + + // Loop on all siblings (ie, on all sensors) + while (fv.level() == sensorHierarchyLevel) { + buildSmallDetsforStack(fv, det, attribute); + + // Go to the next volume in FilteredView. + // NB: If this volume is another sensor of the same module, let's stay in the loop. + // Otherwise, loop is exited. + fv.firstChild(); + } + } + + else { + // Go to the next volume in FilteredView. + fv.firstChild(); + } + + mother->addComponent(det); +} diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index c440fb587dac2..94a216a30914b 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -137,31 +137,65 @@ bool CmsTrackerLevelBuilderHelper::isLessRModule(const GeometricDet* a, const Ge bool CmsTrackerLevelBuilderHelper::isLessR(const GeometricDet* a, const GeometricDet* b) { return a->rho() < b->rho(); } -template -void CmsTrackerLevelBuilder::build(FilteredView& fv, - GeometricDet* tracker, - const std::string& attribute) { - edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelBuilder::build " - << " Building: " << fv.geoHistory(); - edm::LogVerbatim("TrackerGeometryBuilder") << ExtractStringFromDDD::getString(attribute, &fv) << " " - << tracker->type() << " " << tracker->name() << std::endl; +template <> +void CmsTrackerLevelBuilder::build(DDFilteredView& fv, + GeometricDet* tracker, + const std::string& attribute) { + std::cout << "CmsTrackerLevelBuilder::build " << "tracker->name() = " << tracker->name() + << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type() << std::endl; bool doLayers = fv.firstChild(); // descend to the first Layer + std::cout << "called first child " << std::endl; + std::cout << "OUTSIDE while" << std::endl; while (doLayers) { + std::cout << "CmsTrackerLevelBuilder::build INSIDE while " << std::endl; buildComponent(fv, tracker, attribute); - if constexpr (std::is_same_v) { - edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelbuilder::build" << fv.geoHistory(); - doLayers = fv.nextSibling(); - } else if constexpr (std::is_same_v) { - edm::LogVerbatim("TrackerGeometryBuilder") - << "CmsTrackerLevelbuilder::build" << fv.geoHistory(); - doLayers = fv.firstChild(); - } + + doLayers = fv.nextSibling(); + std::cout << "called next sibling" << std::endl; } fv.parent(); + std::cout << "called parent" << std::endl; + + sortNS(fv, tracker); + + std::cout << "CmsTrackerLevelBuilder::build QUITTED loop." << std::endl; + std::cout << "CmsTrackerLevelBuilder::build END finished calls on all buildComponents" << std::endl; +} + + +template <> +void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, + GeometricDet* tracker, + const std::string& attribute) { + + std::cout << "CmsTrackerLevelBuilder::build START " << "tracker->name() = " << tracker->name() + << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type() << std::endl; + + fv.firstChild(); + std::cout << "CmsTrackerLevelBuilder::build called first child " << std::endl; + + const int level = fv.level(); + const std::string type = ExtractStringFromDDD::getString(attribute, &fv); + std::cout << "OUTSIDE while, level = " << level << " type = " << type << std::endl; + + while (fv.level() == level) { + + std::cout << "INSIDE while, before builCompo, level = " << level << " fv.level() = " << fv.level()<< " type = " << type << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv) << std::endl; + + buildComponent(fv, tracker, attribute); + + std::cout << "INSIDE while, after builCompo, level = " << level << " fv.level() = " << fv.level()<< " type = " << type << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv) << std::endl; + + } + + std::cout << "CmsTrackerLevelBuilder::build QUITTED loop. level = " << level << " fv.level() = " << fv.level()<< " type = " << type << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv) << std::endl; + std::cout << "CmsTrackerLevelBuilder::build END finished calls on all buildComponents" << std::endl; sortNS(fv, tracker); } From cc8a9ea3f6406266192b3724ce7f6e2c306e1954 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 22 Sep 2020 17:54:58 +0200 Subject: [PATCH 019/778] DetId building was not called until now for DD4hep workflow (!!!) --- .../plugins/DDDCmsTrackerContruction.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc index a4408851b8005..ba3a6ba4a2289 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc @@ -65,9 +65,14 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const cms::DDC } } + std::cout << "DDDCmsTrackerContruction starts" << std::endl; + auto tracker = std::make_unique(&fv, GeometricDet::Tracker); CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); + CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); + theCmsTrackerDetIdBuilder.buildId(*tracker); + return tracker; } From 368d5aac2bb36cd173c2ec7fab7efb43a8a9168a Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 22 Sep 2020 18:01:55 +0200 Subject: [PATCH 020/778] Elegant fix of aweful custom-made go down / look at child / go back up in CmsTrackerRingBuilder. This does the same as before for old DD, but allows to be compatible with DDDhep navigation!! --- .../plugins/CmsTrackerRingBuilder.cc | 14 +++++--------- .../plugins/CmsTrackerRingBuilder.h | 2 ++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.cc index 847e8b6bf61e0..0963695083320 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.cc @@ -13,6 +13,8 @@ template void CmsTrackerRingBuilder::buildComponent(FilteredView& fv, GeometricDet* g, const std::string& s) { + moduleName_ = ExtractStringFromDDD::getString("TkDDDStructure", &fv); + CmsDetConstruction theCmsDetConstruction; theCmsDetConstruction.buildComponent(fv, g, s); } @@ -20,7 +22,6 @@ void CmsTrackerRingBuilder::buildComponent(FilteredView& fv, Geome template void CmsTrackerRingBuilder::sortNS(FilteredView& fv, GeometricDet* det) { GeometricDet::ConstGeometricDetContainer& comp = det->components(); - fv.firstChild(); GeometricDet::GeometricDetContainer compfw; GeometricDet::GeometricDetContainer compbw; @@ -36,21 +37,18 @@ void CmsTrackerRingBuilder::sortNS(FilteredView& fv, GeometricDet* << "ERROR - wrong SubDet to sort..... " << det->components().front()->type(); } - static std::string const part("TkDDDStructure"); static std::string const TECGluedDet("TECGluedDet"); static std::string const TECDet("TECDet"); - std::string const pname = ExtractStringFromDDD::getString(part, &fv); - // TEC // Module Number: 3 bits [1,...,5 at most] - if (pname == TECGluedDet || pname == TECDet) { + if (moduleName_ == TECGluedDet || moduleName_ == TECDet) { // TEC- - if (det->translation().z() < 0 && pname == TECDet) { + if (det->translation().z() < 0 && moduleName_ == TECDet) { trackerStablePhiSort(comp.begin(), comp.end(), CmsTrackerLevelBuilderHelper::getPhiMirror); } - if (det->translation().z() < 0 && pname == TECGluedDet) { + if (det->translation().z() < 0 && moduleName_ == TECGluedDet) { trackerStablePhiSort(comp.begin(), comp.end(), CmsTrackerLevelBuilderHelper::getPhiGluedModuleMirror); } @@ -86,8 +84,6 @@ void CmsTrackerRingBuilder::sortNS(FilteredView& fv, GeometricDet* det->addComponents(compfw); det->addComponents(compbw); } - - fv.parent(); } template class CmsTrackerRingBuilder; diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.h b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.h index 28ff4ce236b7c..01f00362d3884 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.h +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerRingBuilder.h @@ -13,6 +13,8 @@ class CmsTrackerRingBuilder : public CmsTrackerLevelBuilder { private: void sortNS(FilteredView&, GeometricDet*) override; void buildComponent(FilteredView&, GeometricDet*, const std::string&) override; + + std::string moduleName_; }; #endif From 96837e1ed5de41aa77c31cfa88728a7286be4d6a Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 22 Sep 2020 18:18:42 +0200 Subject: [PATCH 021/778] Fix issue in CmsTrackerPhase1DiskBuilder.cc leading to segfualts: no safety checks before calling std::rotate. Though, bigger underlying issue is that there is a hardcoded 100 mm in here (!!!!!!!). --- .../plugins/CmsTrackerPhase1DiskBuilder.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc index 82372dbf9a36d..7a169f4e71739 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc @@ -58,9 +58,17 @@ void CmsTrackerPhase1DiskBuilder::PhiPosNegSplit_innerOuter( // std::cout << "num of inner = " << num_inner << " with radius less than " << radius_split << std::endl; // now shift outer by one - std::rotate(theCompsInnerOuter.begin() + num_inner, theCompsInnerOuter.end() - 1, theCompsInnerOuter.end()); - std::rotate( - theCompsInnerOuter.begin(), theCompsInnerOuter.begin() + num_inner - 1, theCompsInnerOuter.begin() + num_inner); + if (num_inner < theCompsInnerOuter.size()) { + std::rotate(theCompsInnerOuter.begin() + num_inner, theCompsInnerOuter.end() - 1, theCompsInnerOuter.end()); + } + if (num_inner > 0) { + std::rotate( + theCompsInnerOuter.begin(), theCompsInnerOuter.begin() + num_inner - 1, theCompsInnerOuter.begin() + num_inner); + } + + if (num_inner == 0) { std::cout << "num_inner == 0. CmsTrackerPhase1DiskBuilder is probably not doing what you expect." << std::endl; } + if (num_inner == theCompsInnerOuter.size()) { std::cout << "num_inner == theCompsInnerOuter.size(). CmsTrackerPhase1DiskBuilder is probably not doing what you expect." << std::endl; } + std::copy(theCompsInnerOuter.begin(), theCompsInnerOuter.end(), begin); } From 255c6f17fa52e3e45f49ce1458c66248913032fe Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 22 Sep 2020 18:19:54 +0200 Subject: [PATCH 022/778] Printouts in DetIds --- .../plugins/CmsTrackerDetIdBuilder.cc | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc index 73fa37730c3aa..7d1dbf703aa94 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc @@ -9,6 +9,7 @@ #include #include #include +#include CmsTrackerDetIdBuilder::CmsTrackerDetIdBuilder(const std::vector& detidShifts) : m_detidshifts() { if (detidShifts.size() != nSubDet * maxLevels) @@ -27,6 +28,44 @@ void CmsTrackerDetIdBuilder::buildId(GeometricDet& tracker) { DetId t(DetId::Tracker, 0); tracker.setGeographicalID(t); iterate(tracker, 0, tracker.geographicalID().rawId()); + + + //std::ofstream outfile("DetIdOLD.log", std::ios::out); + std::ofstream outfile("DetIdDD4hep.log", std::ios::out); + + std::deque queue; + queue.emplace_back(&tracker); + + while (!queue.empty()) { + const GeometricDet* myDet = queue.front(); + queue.pop_front(); + for (auto& child : myDet->components()) { + queue.emplace_back(child); + } + + outfile << "myDet->geographicalID() = " << myDet->geographicalID() << std::endl; + const auto& found = myDet->name().find(":"); + outfile << "myDet->name() = " << (found != std::string::npos ? myDet->name().substr(found + 1) : myDet->name()) << std::endl; + + /* + // old DD + outfile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() << std::endl; + outfile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() << std::endl;*/ + + + // DD4hep + outfile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() * 10. << std::endl; + outfile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() * 10 << std::endl; + + + if (fabs(myDet->rho()) > 0.00001) { + outfile << "myDet->module->phi() = " << std::fixed << std::setprecision(7) << myDet->phi() << std::endl; + } + + + } + + } void CmsTrackerDetIdBuilder::iterate(GeometricDet& in, int level, unsigned int ID) { From 03ff45e5bd14faf9379546c8cafde95d509d382f Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 22 Sep 2020 18:20:11 +0200 Subject: [PATCH 023/778] Test module numbering files --- .../test/trackerModuleNumberingDD4hep_cfg.py | 58 ++++--------------- .../test/trackerModuleNumbering_cfg.py | 39 ++----------- 2 files changed, 14 insertions(+), 83 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py index 08c4806b75c88..df0110b307c3d 100644 --- a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py +++ b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py @@ -1,64 +1,26 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process("NumberingTest") +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep +process = cms.Process('NumberingTest',Run3_dd4hep) process.load("FWCore.MessageLogger.MessageLogger_cfi") -process.load("Configuration.StandardSequences.DD4hep_GeometrySim_cff") -process.load("Geometry.TrackerNumberingBuilder.DD4hep_trackerNumberingGeometry_cfi") - -#this is always needed if users want access to the vector -process.load("Geometry.TrackerNumberingBuilder.DD4hep_trackerNumberingExtraGeometry_cfi") - -process.load("Geometry.TrackerGeometryBuilder.DD4hep_trackerParameters_cfi") -process.load("Geometry.TrackerNumberingBuilder.trackerTopology_cfi") -process.load("Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff") -process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") +process.load('Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff') +if 'MessageLogger' in process.__dict__: + process.MessageLogger.categories.append('TrackerGeometryBuilder') + process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) -process.MessageLogger = cms.Service( - "MessageLogger", - statistics = cms.untracked.vstring('cout', 'tkmodulenumbering'), - categories = cms.untracked.vstring('Geometry', 'ModuleNumbering'), - cout = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noLineBreaks = cms.untracked.bool(True) - ), - tkmodulenumbering = cms.untracked.PSet( - INFO = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - noLineBreaks = cms.untracked.bool(True), - DEBUG = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - WARNING = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - ERROR = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - threshold = cms.untracked.string('INFO'), - Geometry = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), - ModuleNumbering = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ) - ), - destinations = cms.untracked.vstring('cout', - 'tkmodulenumbering') - ) - process.prod = cms.EDAnalyzer("ModuleNumbering") -process.test = cms.EDAnalyzer("DDTestVectors", - DDDetector = cms.ESInputTag('','') -) + +process.Timing = cms.Service("Timing") +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") + process.p1 = cms.Path(process.prod) diff --git a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py index 6b3a5dd061f24..8c320aae5c5ff 100644 --- a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py +++ b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py @@ -4,7 +4,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") -process.load("Configuration.Geometry.GeometryReco_cff") +process.load("Configuration.Geometry.GeometryExtended2021Reco_cff") process.load("Geometry.CMSCommonData.cmsExtendedGeometryXML_cfi") process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") @@ -18,42 +18,11 @@ input = cms.untracked.int32(1) ) -process.MessageLogger = cms.Service( - "MessageLogger", - statistics = cms.untracked.vstring('cout', 'tkModuleNumbering'), - categories = cms.untracked.vstring('Geometry', 'ModuleNumbering'), - cout = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noLineBreaks = cms.untracked.bool(True) - ), - tkModuleNumbering = cms.untracked.PSet( - INFO = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - noLineBreaks = cms.untracked.bool(True), - DEBUG = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - WARNING = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - ERROR = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - threshold = cms.untracked.string('INFO'), - Geometry = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), - ModuleNumbering = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ) - ), - destinations = cms.untracked.vstring('cout', - 'tkModuleNumbering') - ) - process.prod = cms.EDAnalyzer("ModuleNumbering") +process.Timing = cms.Service("Timing") +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") + process.p1 = cms.Path(process.prod) From 513dfbed79d54e3131a530b07746c6aa8c36cdf6 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 22 Sep 2020 18:52:39 +0200 Subject: [PATCH 024/778] Fix regression in DetIds with DD4hep due to sensor type (isStereo, isLower, etc) not properly recognized in cmsTrackerDetCosntruction. This is because the view is already filtered with TkDDDStructure string in DDDCmsTrackerConstruction. Hence all calles of type ExtractStringFromDDD::getString, with an attribute different from TkDDDStructure, do not work with DD4hep!!! --- .../interface/GeometricDet.h | 9 ++++ .../plugins/CmsDetConstruction.cc | 10 ++-- .../src/GeometricDet.cc | 52 +++++++++++-------- 3 files changed, 42 insertions(+), 29 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index 7f0a15d7bdb58..30e50a3792eb4 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -118,14 +118,19 @@ class GeometricDet { double phi() const { return _phi; } double rho() const { return _rho; } + // old DD LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, _shape); } + // DD4hep cms::DDSolidShape shape_dd4hep() const { return _shape; } + GeometricEnumType type() const { return _type; } std::string const& name() const { return _ddname; } // internal representaion + // old DD nav_type const& navType() const { return _ddd; } NavRange navpos() const { return NavRange(&_ddd.front(), _ddd.size()); } + std::vector const& params() const { return _params; } ~GeometricDet(); @@ -180,6 +185,8 @@ class GeometricDet { * The following two are only meaningful for the silicon tracker. */ bool stereo() const { return _stereo; } + bool isLowerSensor() const { return _isLowerSensor; } + bool isUpperSensor() const { return _isUpperSensor; } double siliconAPVNum() const { return _siliconAPVNum; } private: @@ -202,6 +209,8 @@ class GeometricDet { double _pixROCx; double _pixROCy; bool _stereo; + bool _isLowerSensor; + bool _isUpperSensor; double _siliconAPVNum; }; diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index 2c8063806097f..80d9d42e1de94 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -11,9 +11,7 @@ void CmsDetConstruction::buildSmallDetsforGlued(FilteredView& fv, GeometricDet* det = new GeometricDet(&fv, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString(attribute, &fv))); - static const std::string stereo = "TrackerStereoDetectors"; - - if (ExtractStringFromDDD::getString(stereo, &fv) == "true") { + if (det->stereo()) { uint32_t temp = 1; det->setGeographicalID(DetId(temp)); } else { @@ -31,13 +29,11 @@ void CmsDetConstruction::buildSmallDetsforStack(FilteredView& fv, GeometricDet* det = new GeometricDet(&fv, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString(attribute, &fv))); - static const std::string isLower = "TrackerLowerDetectors"; - static const std::string isUpper = "TrackerUpperDetectors"; - if (ExtractStringFromDDD::getString(isLower, &fv) == "true") { + if (det->isLowerSensor()) { uint32_t temp = 1; det->setGeographicalID(DetId(temp)); - } else if (ExtractStringFromDDD::getString(isUpper, &fv) == "true") { + } else if (det->isUpperSensor()) { uint32_t temp = 2; det->setGeographicalID(DetId(temp)); } else { diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 0c0c337d397af..9c016f2fe7c56 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -7,7 +7,6 @@ #include "CLHEP/Units/GlobalSystemOfUnits.h" #include -#include #include namespace { @@ -65,11 +64,11 @@ namespace { */ GeometricDet::~GeometricDet() { deleteComponents(); } +/* + Constructor from old DD Filtered view. + */ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) - : // - // Set by hand the _ddd - // - _trans(fv->translation()), + : _trans(fv->translation()), _phi(_trans.Phi()), _rho(_trans.Rho()), _rot(fv->rotation()), @@ -84,30 +83,39 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) _pixROCx(getDouble("PixelROC_X", *fv)), _pixROCy(getDouble("PixelROC_Y", *fv)), _stereo(getString("TrackerStereoDetectors", *fv) == strue), + _isLowerSensor(getString("TrackerLowerDetectors", *fv) == strue), + _isUpperSensor(getString("TrackerUpperDetectors", *fv) == strue), _siliconAPVNum(getDouble("SiliconAPVNumber", *fv)) { // workaround instead of this at initialization _ddd(fv->navPos().begin(),fv->navPos().end()), const DDFilteredView::nav_type& nt = fv->navPos(); _ddd = nav_type(nt.begin(), nt.end()); } +/* + Constructor from DD4HEP Filtered view. + */ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) - : _trans(fv->translation()), - _phi(_trans.Phi()), - _rho(_trans.Rho()), - _rot(fv->rotation()), - _shape(fv->shape()), - _ddd(fv->navPos()), - _ddname(fv->name()), - _type(type), - _params(fv->parameters()), - _radLength(fv->get("TrackerRadLength")), - _xi(fv->get("TrackerXi")), - _pixROCRows(fv->get("PixelROCRows")), - _pixROCCols(fv->get("PixelROCCols")), - _pixROCx(fv->get("PixelROC_X")), - _pixROCy(fv->get("PixelROC_Y")), - _stereo(fv->get("TrackerStereoDetectors") == strue), - _siliconAPVNum(fv->get("SiliconAPVNumber")) {} + : //_trans(geant_units::operators::convertCmToMm(fv->translation())), + _trans(fv->translation()), + _phi(_trans.Phi()), + _rho(_trans.Rho()), + _rot(fv->rotation()), + _shape(fv->shape()), + _ddd(fv->navPos()), + _ddname(fv->name()), + _type(type), + _params(fv->parameters()), + _radLength(fv->get("TrackerRadLength")), + _xi(fv->get("TrackerXi")), + _pixROCRows(fv->get("PixelROCRows")), + _pixROCCols(fv->get("PixelROCCols")), + _pixROCx(fv->get("PixelROC_X")), + _pixROCy(fv->get("PixelROC_Y")), + _stereo(fv->get("TrackerStereoDetectors") == strue), + _isLowerSensor(fv->get("TrackerLowerDetectors") == strue), + _isUpperSensor(fv->get("TrackerUpperDetectors") == strue), + _siliconAPVNum(fv->get("SiliconAPVNumber")) +{} // PGeometricDet is persistent version... make it... then come back here and make the // constructor. From 4c2c2975b04e0c848e2b6aeda61293160d97400f Mon Sep 17 00:00:00 2001 From: Sunanda Date: Tue, 22 Sep 2020 19:14:36 +0200 Subject: [PATCH 025/778] Add a scenario where ME0 is replaced by GE0 --- Configuration/Geometry/README.md | 2 + .../python/GeometryExtended2026D67Reco_cff.py | 60 ++++++++ .../python/GeometryExtended2026D67_cff.py | 13 ++ .../Geometry/python/dict2026Geometry.py | 47 +++++++ .../PyReleaseValidation/python/relval_2026.py | 1 + .../python/upgradeWorkflowComponents.py | 9 ++ .../StandardSequences/python/GeometryConf.py | 1 + .../dd4hep/cmsExtendedGeometry2026D67.xml | 125 +++++++++++++++++ .../cmsExtendedGeometry2026D67XML_cfi.py | 129 ++++++++++++++++++ 9 files changed, 387 insertions(+) create mode 100644 Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D67_cff.py create mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D67.xml create mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D67XML_cfi.py diff --git a/Configuration/Geometry/README.md b/Configuration/Geometry/README.md index 924fb94f298b4..b56045838cabb 100644 --- a/Configuration/Geometry/README.md +++ b/Configuration/Geometry/README.md @@ -55,6 +55,7 @@ Muon system: * M6: same as M5 but with adjustment of ME0 in view of updated boundaries * M7: same as M6 with further ajustment of ME0 for boundaries * M8: same as M7 with changed number of strips for GE21 +* M9: same as M8 with GE0 replacing ME0 Fast Timing system: * I10: Fast Timing detector (LYSO barrel (bars along phi flat), silicon endcap), w/ passive materials, ETL in position defined in O4, material adjustments @@ -89,5 +90,6 @@ Several detector combinations have been generated: * D64 = T22+C11+M4+I11+O5+F4 * D65 = T23+C11+M4+I11+O5+F4 * D66 = T21+C11+M8+I11+O5+F4 +* D67 = T21+C11+M9+I11+O5+F4 D49 is the HLT TDR baseline. diff --git a/Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py new file mode 100644 index 0000000000000..e8340d20f8e4d --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py @@ -0,0 +1,60 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Configuration.Geometry.GeometryExtended2026D67_cff import * + +# tracker +from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * +from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * +from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * +from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * +trackerGeometry.applyAlignment = cms.bool(False) + +# calo +from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "TOWER", + "HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive" + ) +) +from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * +from Geometry.EcalMapping.EcalMapping_cfi import * +from Geometry.EcalMapping.EcalMappingRecord_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# timing +from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * +from Geometry.MTDGeometryBuilder.mtdParameters_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * +from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * +from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * +from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * +mtdGeometry.applyAlignment = cms.bool(False) + diff --git a/Configuration/Geometry/python/GeometryExtended2026D67_cff.py b/Configuration/Geometry/python/GeometryExtended2026D67_cff.py new file mode 100644 index 0000000000000..c39099e160330 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D67_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Geometry.CMSCommonData.cmsExtendedGeometry2026D67XML_cfi import * +from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.EcalCommonData.ecalSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * +from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index edc711f6fff36..157ac042e02ce 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -1066,6 +1066,52 @@ ], "era" : "phase2_muon, phase2_GEM", }, + "M9" : { + 1 : [ + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v7/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml', + 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml', + ], + 2 : [ + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v3/muonNumbering.xml', + ], + 3 : [ + 'Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecs.xml', + ], + 4 : [ + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + ], + "sim" : [ + 'from Geometry.MuonNumbering.muonGeometryConstants_cff import *', + ], + "reco" : [ + 'from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *', + 'from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *', + 'from Geometry.GEMGeometryBuilder.gemGeometry_cfi import *', + 'from Geometry.GEMGeometryBuilder.me0Geometry_cfi import *', + 'from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *', + 'from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *', + ], + "era" : "phase2_muon, phase2_GEM", + }, } forwardDict = { @@ -1312,6 +1358,7 @@ ("O5","T22","C11","M4","F4","I11") : "D64", ("O5","T23","C11","M4","F4","I11") : "D65", ("O5","T21","C11","M8","F4","I11") : "D66", + ("O5","T21","C11","M9","F4","I11") : "D67", } deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D52", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D55" ]) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index b17d27aaefd5b..60c8042e44598 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -32,6 +32,7 @@ numWFIB.extend([29834.0]) #2026D64 numWFIB.extend([30234.0]) #2026D65 numWFIB.extend([30634.0]) #2026D66 +numWFIB.extend([31034.0]) #2026D67 for numWF in numWFIB: workflows[numWF] = _upgrade_workflows[numWF] diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 416152297f093..aafd446532936 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -58,6 +58,8 @@ '2026D65PU', '2026D66', '2026D66PU', + '2026D67', + '2026D67PU', ] # pre-generation of WF numbers @@ -1039,6 +1041,13 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C11', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, + '2026D67' : { + 'Geom' : 'Extended2026D67', + 'HLTmenu': '@fake2', + 'GT' : 'auto:phase2_realistic_T21', + 'Era' : 'Phase2C11', + 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], + }, } # standard PU sequences diff --git a/Configuration/StandardSequences/python/GeometryConf.py b/Configuration/StandardSequences/python/GeometryConf.py index 57e5234f9aa8a..a6df62840627b 100644 --- a/Configuration/StandardSequences/python/GeometryConf.py +++ b/Configuration/StandardSequences/python/GeometryConf.py @@ -47,4 +47,5 @@ 'Extended2026D64' : 'Extended2026D64,Extended2026D64Reco', 'Extended2026D65' : 'Extended2026D65,Extended2026D65Reco', 'Extended2026D66' : 'Extended2026D66,Extended2026D66Reco', + 'Extended2026D67' : 'Extended2026D67,Extended2026D67Reco', } diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D67.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D67.xml new file mode 100644 index 0000000000000..208b1d526a760 --- /dev/null +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D67.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D67XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D67XML_cfi.py new file mode 100644 index 0000000000000..153f0514f4284 --- /dev/null +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D67XML_cfi.py @@ -0,0 +1,129 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v4/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v7/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml', + 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v3/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v3/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v1/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) From 425df560c76f26d0d344cb6014d4ae06860cf89f Mon Sep 17 00:00:00 2001 From: Sunanda Date: Tue, 22 Sep 2020 21:07:01 +0200 Subject: [PATCH 026/778] Changed in view of Sven's PR --- Configuration/Geometry/python/dict2026Geometry.py | 2 +- .../PyReleaseValidation/python/upgradeWorkflowComponents.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index 157ac042e02ce..9da9df0407f88 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -1110,7 +1110,7 @@ 'from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *', 'from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *', ], - "era" : "phase2_muon, phase2_GEM", + "era" : "phase2_muon, phase2_GEM, phase2_GE0", }, } diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index aafd446532936..3fdb8770becaa 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -1045,7 +1045,7 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Geom' : 'Extended2026D67', 'HLTmenu': '@fake2', 'GT' : 'auto:phase2_realistic_T21', - 'Era' : 'Phase2C11', + 'Era' : 'Phase2C11M9', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, } From 7fbc3a2c293fda795d29d2ff8c0cdf25650bd32a Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 23 Sep 2020 04:05:32 +0200 Subject: [PATCH 027/778] Remove reference of ME0 in RECO geometry --- Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py | 1 - Configuration/Geometry/python/dict2026Geometry.py | 1 - 2 files changed, 2 deletions(-) diff --git a/Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py index e8340d20f8e4d..b6f6681175ed7 100644 --- a/Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2026D67Reco_cff.py @@ -42,7 +42,6 @@ from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index 9da9df0407f88..9ec1c45ce6809 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -1106,7 +1106,6 @@ 'from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *', 'from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *', 'from Geometry.GEMGeometryBuilder.gemGeometry_cfi import *', - 'from Geometry.GEMGeometryBuilder.me0Geometry_cfi import *', 'from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *', 'from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *', ], From fa722f2cc1ad60067ecb1fe34821d338c4e41c84 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 22 Sep 2020 13:16:33 -0500 Subject: [PATCH 028/778] GE0 era for trigger and digitizer --- Configuration/Eras/python/Modifier_phase2_GE0_cff.py | 3 +++ L1Trigger/L1TGEM/python/me0TriggerDigis_cff.py | 4 ++++ SimMuon/GEMDigitizer/python/muonME0Digi_cff.py | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 Configuration/Eras/python/Modifier_phase2_GE0_cff.py diff --git a/Configuration/Eras/python/Modifier_phase2_GE0_cff.py b/Configuration/Eras/python/Modifier_phase2_GE0_cff.py new file mode 100644 index 0000000000000..5ee4deaf6fc27 --- /dev/null +++ b/Configuration/Eras/python/Modifier_phase2_GE0_cff.py @@ -0,0 +1,3 @@ +import FWCore.ParameterSet.Config as cms + +phase2_GE0 = cms.Modifier() diff --git a/L1Trigger/L1TGEM/python/me0TriggerDigis_cff.py b/L1Trigger/L1TGEM/python/me0TriggerDigis_cff.py index df9056dd1fa01..053cae23ea24c 100644 --- a/L1Trigger/L1TGEM/python/me0TriggerDigis_cff.py +++ b/L1Trigger/L1TGEM/python/me0TriggerDigis_cff.py @@ -1,4 +1,5 @@ import FWCore.ParameterSet.Config as cms +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 from L1Trigger.L1TGEM.simMuonME0PadDigis_cfi import * from L1Trigger.L1TGEM.me0TriggerDigis_cfi import * @@ -6,3 +7,6 @@ me0TriggerRealDigiTask = cms.Task(simMuonME0PadDigis, me0TriggerDigis) me0TriggerAllDigiTask = cms.Task(me0TriggerRealDigiTask, me0TriggerPseudoDigiTask) + +## in scenarios with GE0, remove the pseudo digis +phase2_GE0.toReplaceWith(me0TriggerAllDigiTask, me0TriggerAllDigiTask.copyAndExclude([me0TriggerPseudoDigiTask])) diff --git a/SimMuon/GEMDigitizer/python/muonME0Digi_cff.py b/SimMuon/GEMDigitizer/python/muonME0Digi_cff.py index e981f0fe787b5..a17bad2313bce 100644 --- a/SimMuon/GEMDigitizer/python/muonME0Digi_cff.py +++ b/SimMuon/GEMDigitizer/python/muonME0Digi_cff.py @@ -1,4 +1,5 @@ import FWCore.ParameterSet.Config as cms +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 from SimMuon.GEMDigitizer.muonME0Digis_cfi import * from SimMuon.GEMDigitizer.muonME0PseudoDigis_cfi import * @@ -9,4 +10,8 @@ muonME0PseudoDigi = cms.Task(simMuonME0PseudoDigis, simMuonME0PseudoReDigis) muonME0DigiTask = cms.Task(muonME0RealDigi, muonME0PseudoDigi) + +## in scenarios with GE0, remove the pseudo digis +phase2_GE0.toReplaceWith(muonME0DigiTask, muonME0DigiTask.copyAndExclude([muonME0PseudoDigi])) + muonME0Digi = cms.Sequence(muonME0DigiTask) From f7b89b63e15b32f71d71b6db8eacdabc91eb2315 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 22 Sep 2020 14:00:50 -0500 Subject: [PATCH 029/778] GE0 era --- Configuration/Eras/python/Era_Phase2C11M9_cff.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Configuration/Eras/python/Era_Phase2C11M9_cff.py diff --git a/Configuration/Eras/python/Era_Phase2C11M9_cff.py b/Configuration/Eras/python/Era_Phase2C11M9_cff.py new file mode 100644 index 0000000000000..ba982bf639203 --- /dev/null +++ b/Configuration/Eras/python/Era_Phase2C11M9_cff.py @@ -0,0 +1,6 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 + +Phase2C11M9 = cms.ModifierChain(Phase2C11, phase2_GE0) From 7b43f63afb8c22e48141f2bbc069d184ec926847 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Tue, 22 Sep 2020 19:14:57 -0500 Subject: [PATCH 030/778] Add GE0 era --- Configuration/StandardSequences/python/Eras.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index 2b5390964fafa..5f5524eb6176a 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -43,6 +43,7 @@ def __init__(self): 'Phase2C10_dd4hep', 'Phase2C11_dd4hep', 'Phase2C12_dd4hep', + 'Phase2C11M9', ] internalUseMods = ['run2_common', 'run2_25ns_specific', @@ -55,7 +56,8 @@ def __init__(self): 'phase1Pixel', 'run3_GEM', 'run2_GEM_2017', 'run2_CSC_2018', 'phase2_common', 'phase2_tracker', - 'phase2_hgcal', 'phase2_muon', 'phase2_timing', 'phase2_hfnose', 'phase2_hgcalV10', 'phase2_hgcalV11', 'phase2_hgcalV12', + 'phase2_muon', 'phase2_GEM', 'phase2_GE0', + 'phase2_hgcal', 'phase2_timing', 'phase2_hfnose', 'phase2_hgcalV10', 'phase2_hgcalV11', 'phase2_hgcalV12', 'phase2_timing_layer', 'phase2_hcal', 'phase2_ecal', 'phase2_trigger', 'trackingLowPU', 'trackingPhase1', 'ctpps_2016', 'ctpps_2017', 'ctpps_2018', 'ctpps_2021', 'trackingPhase2PU140','highBetaStar_2018', From 0e46945204f75ac2f9bf2b0e7e65bea47f6c4656 Mon Sep 17 00:00:00 2001 From: "Ian J. Watson" Date: Wed, 23 Sep 2020 14:21:44 +0900 Subject: [PATCH 031/778] Make coherent merger of #31542 and #31309 in view of #31541 --- L1Trigger/L1TMuon/python/simDigis_cff.py | 4 ++++ SimGeneral/MixingModule/python/mixObjects_cfi.py | 15 +++++++++++++++ .../python/trackingTruthProducer_cfi.py | 5 +++++ SimMuon/Configuration/python/SimMuon_cff.py | 5 +++++ 4 files changed, 29 insertions(+) diff --git a/L1Trigger/L1TMuon/python/simDigis_cff.py b/L1Trigger/L1TMuon/python/simDigis_cff.py index 2aaae7634b403..01cdd93f6a615 100644 --- a/L1Trigger/L1TMuon/python/simDigis_cff.py +++ b/L1Trigger/L1TMuon/python/simDigis_cff.py @@ -104,6 +104,10 @@ from L1Trigger.L1TGEM.me0TriggerDigis_cff import * _phase2_SimL1TMuonTask = SimL1TMuonTask.copy() _phase2_SimL1TMuonTask.add(me0TriggerAllDigiTask) +_phase2_GE0_SimL1TMuonTask = SimL1TMuonTask.copyAndExclude([me0TriggerAllDigiTask]) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon (stage2L1Trigger & phase2_muon).toReplaceWith( SimL1TMuonTask, _phase2_SimL1TMuonTask ) + +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +(stage2L1Trigger & phase2_GE0).toReplaceWith( SimL1TMuonTask, _phase2_GE0_SimL1TMuonTask ) diff --git a/SimGeneral/MixingModule/python/mixObjects_cfi.py b/SimGeneral/MixingModule/python/mixObjects_cfi.py index edaefc012f4f9..7e178d4ea3acf 100644 --- a/SimGeneral/MixingModule/python/mixObjects_cfi.py +++ b/SimGeneral/MixingModule/python/mixObjects_cfi.py @@ -262,6 +262,21 @@ pcrossingFrames = theMixObjects.mixSH.pcrossingFrames + [ 'MuonME0Hits' ] ) ) + +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toModify( theMixObjects, + mixSH = dict( + input = list(filter(lambda x: type(x) == type(cms.InputTag("","")) and x != cms.InputTag("g4SimHits","MuonME0Hits"), theMixObjects.mixSH.input)), + subdets = list(filter(lambda x: x != 'MuonME0Hits', theMixObjects.mixSH.subdets)), + crossingFrames = list(filter(lambda x: x != 'MuonME0Hits', theMixObjects.mixSH.crossingFrames)) + ) +) +(premix_stage1 & phase2_GE0).toModify(theMixObjects, + mixSH = dict( + pcrossingFrames = list(filter(lambda x: x != 'MuonME0Hits', theMixObjects.mixSH.pcrossingFrames)) + ) +) + from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal phase2_hgcal.toModify( theMixObjects, mixCH = dict( diff --git a/SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py b/SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py index 13ad66287c7dd..de2df4181ed18 100644 --- a/SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py +++ b/SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py @@ -64,5 +64,10 @@ phase2_muon.toModify( trackingParticles, simHitCollections = dict( muon = trackingParticles.simHitCollections.muon+[cms.InputTag("g4SimHits","MuonME0Hits")])) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toModify( trackingParticles, simHitCollections = dict( + muon = list(filter(lambda x: x != cms.InputTag("g4SimHits","MuonME0Hits"), + trackingParticles.simHitCollections.muon)))) + from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker phase2_tracker.toModify( trackingParticles, simHitCollections = dict( tracker = []) ) diff --git a/SimMuon/Configuration/python/SimMuon_cff.py b/SimMuon/Configuration/python/SimMuon_cff.py index 523a85d668c8c..a39f7f8f103ab 100644 --- a/SimMuon/Configuration/python/SimMuon_cff.py +++ b/SimMuon/Configuration/python/SimMuon_cff.py @@ -24,10 +24,15 @@ _phase2_muonDigiTask = _run3_muonDigiTask.copy() _phase2_muonDigiTask.add(muonME0DigiTask) +# while GE0 is in development, just turn off ME0 tasks +_phase2_ge0 = _phase2_muonDigiTask.copyAndExclude([muonME0DigiTask]) + from Configuration.Eras.Modifier_run2_GEM_2017_cff import run2_GEM_2017 run2_GEM_2017.toReplaceWith( muonDigiTask, _run3_muonDigiTask ) from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM run3_GEM.toReplaceWith( muonDigiTask, _run3_muonDigiTask ) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toReplaceWith( muonDigiTask, _phase2_muonDigiTask ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toReplaceWith( muonDigiTask, _phase2_ge0 ) From 78d8c14b0f4d6960f973f74e9aaa93956c8eb00a Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Wed, 23 Sep 2020 14:29:04 +0200 Subject: [PATCH 032/778] Fix regressionsin DetIds due to DD4hep having different units than old DD + due to different order of shape parameters. There are indeed calls in CmsTrackerPhase1DiskBuilder and Phase1TrackerLayerBuilder, which rely on this. It could be addressed in these builders, but anyway, to avoid massive number of regressions downstream (all the way till tracking), much better approach is to just convert units and shape parameters order to legacy, in GeometricDet DD4hep constructor. Thsi is done in this commit. --- .../interface/GeometricDet.h | 18 ++- .../src/GeometricDet.cc | 108 ++++++++++++++++-- 2 files changed, 117 insertions(+), 9 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index 30e50a3792eb4..cfa28205fcc55 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -15,6 +15,10 @@ #include +//#include +#include +//#include + class DDFilteredView; namespace cms { @@ -131,7 +135,14 @@ class GeometricDet { nav_type const& navType() const { return _ddd; } NavRange navpos() const { return NavRange(&_ddd.front(), _ddd.size()); } - std::vector const& params() const { return _params; } + std::vector const& params() const { + if (_shape != cms::DDSolidShape::ddbox + && _shape != cms::DDSolidShape::ddtrap + && _shape != cms::DDSolidShape::ddtubs) { + std::cout << "error!!! GeometricDet::params() is called on ashape which is neither a box, a trap, nor a tub. This is not supported!" << std::endl; + } + return _params; + } ~GeometricDet(); @@ -190,6 +201,9 @@ class GeometricDet { double siliconAPVNum() const { return _siliconAPVNum; } private: + std::vector computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, + const dd4hep::Solid& mySolid) const; + ConstGeometricDetContainer _container; Translation _trans; double _phi; @@ -212,6 +226,8 @@ class GeometricDet { bool _isLowerSensor; bool _isUpperSensor; double _siliconAPVNum; + + bool _isFromDD4hep; }; #undef PoolAlloc diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 9c016f2fe7c56..2a5d05c07d9ca 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -5,6 +5,7 @@ #include "CondFormats/GeometryObjects/interface/PGeometricDet.h" #include "CLHEP/Units/GlobalSystemOfUnits.h" +#include "DataFormats/Math/interface/GeantUnits.h" #include #include @@ -85,7 +86,9 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) _stereo(getString("TrackerStereoDetectors", *fv) == strue), _isLowerSensor(getString("TrackerLowerDetectors", *fv) == strue), _isUpperSensor(getString("TrackerUpperDetectors", *fv) == strue), - _siliconAPVNum(getDouble("SiliconAPVNumber", *fv)) { + _siliconAPVNum(getDouble("SiliconAPVNumber", *fv)), + _isFromDD4hep(false) +{ // workaround instead of this at initialization _ddd(fv->navPos().begin(),fv->navPos().end()), const DDFilteredView::nav_type& nt = fv->navPos(); _ddd = nav_type(nt.begin(), nt.end()); @@ -95,16 +98,16 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) Constructor from DD4HEP Filtered view. */ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) - : //_trans(geant_units::operators::convertCmToMm(fv->translation())), - _trans(fv->translation()), + : + _trans(geant_units::operators::convertCmToMm(fv->translation())), _phi(_trans.Phi()), _rho(_trans.Rho()), _rot(fv->rotation()), - _shape(fv->shape()), - _ddd(fv->navPos()), - _ddname(fv->name()), + _shape(fv->shape()), /// ??? + _ddd(fv->navPos()), /// ??? + _ddname(fv->name()), /// ??? _type(type), - _params(fv->parameters()), + _params(computeLegacyShapeParameters(_shape, fv->solid())), /// ??? _radLength(fv->get("TrackerRadLength")), _xi(fv->get("TrackerXi")), _pixROCRows(fv->get("PixelROCRows")), @@ -114,7 +117,8 @@ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) _stereo(fv->get("TrackerStereoDetectors") == strue), _isLowerSensor(fv->get("TrackerLowerDetectors") == strue), _isUpperSensor(fv->get("TrackerUpperDetectors") == strue), - _siliconAPVNum(fv->get("SiliconAPVNumber")) + _siliconAPVNum(fv->get("SiliconAPVNumber")), + _isFromDD4hep(true) {} // PGeometricDet is persistent version... make it... then come back here and make the @@ -253,3 +257,91 @@ std::unique_ptr GeometricDet::bounds() const { TrackerShapeToBounds shapeToBounds; return std::unique_ptr(shapeToBounds.buildBounds(_shape, par)); } + + + + +std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, + const dd4hep::Solid& mySolid) const { + std::vector myOldDDShapeParameters; + //const cms::DDSolidShape& mySolidShape = cms::dd::getCurrentShape(fv); + if (mySolidShape == cms::DDSolidShape::ddbox) { + const dd4hep::Box& myBox = dd4hep::Box(mySolid); + myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myBox.x() ), + geant_units::operators::convertCmToMm(myBox.y() ), + geant_units::operators::convertCmToMm(myBox.z() ) + }; + } + /* + else if (mySolidShape == cms::DDSolidShape::ddcons) { + const dd4hep::Cone myCone = dd4hep::Cone(mySolid); + myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myCone.dZ() ), + geant_units::operators::convertCmToMm(myCone.rMin1() ), + geant_units::operators::convertCmToMm(myCone.rMax1() ), + geant_units::operators::convertCmToMm(myCone.rMin2() ), + geant_units::operators::convertCmToMm(myCone.rMax2() ), + myCone.phiFrom(), + myCone.deltaPhi() + }; + }*/ + else if (mySolidShape == cms::DDSolidShape::ddtrap) { + const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid); + myOldDDShapeParameters = { //geant_units::operators::convertCmToMm(myTrap.halfZ() ), + geant_units::operators::convertCmToMm(myTrap->GetDZ() ), + myTrap->GetTheta(), // ????? deg or rad? + myTrap->GetPhi(), // ????? deg or rad? + geant_units::operators::convertCmToMm(myTrap->GetH1() ), + geant_units::operators::convertCmToMm(myTrap->GetBl1() ), + geant_units::operators::convertCmToMm(myTrap->GetTl1() ), + myTrap->GetAlpha1(), // ????? deg or rad? + geant_units::operators::convertCmToMm(myTrap->GetH2() ), + geant_units::operators::convertCmToMm(myTrap->GetBl2() ), + geant_units::operators::convertCmToMm(myTrap->GetTl2() ), + myTrap->GetAlpha2() // ????? deg or rad? + }; + } + else if (mySolidShape == cms::DDSolidShape::ddtubs) { + const dd4hep::Tube& myTube = dd4hep::Tube(mySolid); + myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myTube->GetDz() ), + geant_units::operators::convertCmToMm(myTube->GetRmin() ), + geant_units::operators::convertCmToMm(myTube->GetRmax() ), + myTube->GetPhi1(), // ????? deg or rad? is that ok? + myTube->GetPhi2() - myTube->GetPhi1() // ??????? deg or rad?? is that ok? + }; + } + /* + else if (mySolidShape == cms::DDSolidShape::ddtrunctubs) { + const cms::dd::DDTruncTubs& myShape = cms::dd::DDTruncTubs(fv); + myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myShape.zHalf() ), + geant_units::operators::convertCmToMm(myShape.rIn() ), + geant_units::operators::convertCmToMm(myShape.rOut() ), + myShape.startPhi(), + myShape.deltaPhi(), + geant_units::operators::convertCmToMm(myShape.cutAtStart() ), + geant_units::operators::convertCmToMm(myShape.cutAtDelta() ), + static_cast(myShape.cutInside()) + }; + }*/ + + /* + else if (mySolidShape == cms::DDSolidShape::dd_not_init) { + auto myShape = fv.solid(); + const std::vector& params = myShape.dimensions(); + if (fv.isA()) { + myOldDDShapeParameters = { geant_units::operators::convertCmToMm(params[3] ), // z + 0., + 0., + geant_units::operators::convertCmToMm(params[2] ), // y + geant_units::operators::convertCmToMm(params[0] ), // x1 + geant_units::operators::convertCmToMm(params[0] ), // x1 + 0., + geant_units::operators::convertCmToMm(params[2] ), // y + geant_units::operators::convertCmToMm(params[1] ), // x2 + geant_units::operators::convertCmToMm(params[1] ), // x2 + 0. + }; + } + }*/ + + return myOldDDShapeParameters; +} From a46038960a74acbb62d4298697ce8a5bdbd8a109 Mon Sep 17 00:00:00 2001 From: "Ian J. Watson" Date: Thu, 24 Sep 2020 17:18:52 +0900 Subject: [PATCH 033/778] Flip enough switches so step3 runs --- DQMOffline/Muon/interface/GEMOfflineDQMBase.h | 4 +++- RecoLocalMuon/Configuration/python/RecoLocalMuon_cff.py | 4 ++++ RecoMuon/MuonIdentification/python/muons1stStep_cfi.py | 2 ++ RecoMuon/MuonSeedGenerator/python/ancientMuonSeed_cfi.py | 3 +++ .../StandAloneMuonProducer/python/standAloneMuons_cfi.py | 6 ++++++ RecoMuon/TrackingTools/python/MuonServiceProxy_cff.py | 4 ++++ .../TrackAssociator/python/DetIdAssociatorESProducer_cff.py | 2 ++ Validation/Configuration/python/globalValidation_cff.py | 5 +++++ Validation/Configuration/python/postValidation_cff.py | 6 ++++++ Validation/RecoMuon/python/MuonTrackValidator_cfi.py | 2 ++ Validation/RecoMuon/python/muonValidation_cff.py | 6 ++++++ 11 files changed, 43 insertions(+), 1 deletion(-) diff --git a/DQMOffline/Muon/interface/GEMOfflineDQMBase.h b/DQMOffline/Muon/interface/GEMOfflineDQMBase.h index dbd7a29252243..2ad922b532493 100644 --- a/DQMOffline/Muon/interface/GEMOfflineDQMBase.h +++ b/DQMOffline/Muon/interface/GEMOfflineDQMBase.h @@ -97,7 +97,9 @@ class GEMOfflineDQMBase : public DQMEDAnalyzer { }; inline int GEMOfflineDQMBase::getMaxVFAT(const int station) { - if (station == 1) + if (station == 0) + return GEMeMap::maxVFatGE0_; + else if (station == 1) return GEMeMap::maxVFatGE11_; else if (station == 2) return GEMeMap::maxVFatGE21_; diff --git a/RecoLocalMuon/Configuration/python/RecoLocalMuon_cff.py b/RecoLocalMuon/Configuration/python/RecoLocalMuon_cff.py index f4c836a7564be..e53e004d10b85 100644 --- a/RecoLocalMuon/Configuration/python/RecoLocalMuon_cff.py +++ b/RecoLocalMuon/Configuration/python/RecoLocalMuon_cff.py @@ -54,9 +54,13 @@ _phase2_muonlocalrecoTask = _run3_muonlocalrecoTask.copy() _phase2_muonlocalrecoTask.add(me0LocalRecoTask) +_phase2_ge0_muonlocalrecoTask = _phase2_muonlocalrecoTask.copyAndExclude([me0LocalRecoTask]) + from Configuration.Eras.Modifier_run2_GEM_2017_cff import run2_GEM_2017 run2_GEM_2017.toReplaceWith( muonlocalrecoTask , _run2_GEM_2017_muonlocalrecoTask ) from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM run3_GEM.toReplaceWith( muonlocalrecoTask , _run3_muonlocalrecoTask ) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toReplaceWith( muonlocalrecoTask , _phase2_muonlocalrecoTask ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toReplaceWith( muonlocalrecoTask , _phase2_ge0_muonlocalrecoTask ) diff --git a/RecoMuon/MuonIdentification/python/muons1stStep_cfi.py b/RecoMuon/MuonIdentification/python/muons1stStep_cfi.py index 14479613c8e93..4f407a1f3b36a 100644 --- a/RecoMuon/MuonIdentification/python/muons1stStep_cfi.py +++ b/RecoMuon/MuonIdentification/python/muons1stStep_cfi.py @@ -92,6 +92,8 @@ run3_GEM.toModify( muons1stStep, TrackAssociatorParameters = dict(useGEM = True ) ) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toModify( muons1stStep, TrackAssociatorParameters = dict(useME0 = True ) ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toModify( muons1stStep, TrackAssociatorParameters = dict(useME0 = False ) ) muonEcalDetIds = cms.EDProducer("InterestingEcalDetIdProducer", inputCollection = cms.InputTag("muons1stStep") diff --git a/RecoMuon/MuonSeedGenerator/python/ancientMuonSeed_cfi.py b/RecoMuon/MuonSeedGenerator/python/ancientMuonSeed_cfi.py index 7e9144a2b1fb9..c6fc60c850e48 100644 --- a/RecoMuon/MuonSeedGenerator/python/ancientMuonSeed_cfi.py +++ b/RecoMuon/MuonSeedGenerator/python/ancientMuonSeed_cfi.py @@ -26,3 +26,6 @@ # phase2 ME0 from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toModify(ancientMuonSeed, EnableME0Measurement = True) +# phase2 GE0 +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toModify(ancientMuonSeed, EnableME0Measurement = False) diff --git a/RecoMuon/StandAloneMuonProducer/python/standAloneMuons_cfi.py b/RecoMuon/StandAloneMuonProducer/python/standAloneMuons_cfi.py index 4e7d399f361d3..cf043477c2281 100644 --- a/RecoMuon/StandAloneMuonProducer/python/standAloneMuons_cfi.py +++ b/RecoMuon/StandAloneMuonProducer/python/standAloneMuons_cfi.py @@ -119,3 +119,9 @@ phase2_muon.toModify( standAloneMuons, STATrajBuilderParameters = dict( FilterParameters = _enableME0Measurement, BWFilterParameters = _enableME0Measurement ) ) + +_disableME0Measurement = dict( EnableME0Measurement = False ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toModify( standAloneMuons, STATrajBuilderParameters = dict( + FilterParameters = _disableME0Measurement, + BWFilterParameters = _disableME0Measurement ) ) diff --git a/RecoMuon/TrackingTools/python/MuonServiceProxy_cff.py b/RecoMuon/TrackingTools/python/MuonServiceProxy_cff.py index 842b3d479cdc0..ad7592d8d9d9b 100644 --- a/RecoMuon/TrackingTools/python/MuonServiceProxy_cff.py +++ b/RecoMuon/TrackingTools/python/MuonServiceProxy_cff.py @@ -55,3 +55,7 @@ phase2_muon.toModify(MuonServiceProxy, ServiceParameters = dict(ME0Layers = True) ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toModify(MuonServiceProxy, + ServiceParameters = dict(ME0Layers = False) +) diff --git a/TrackingTools/TrackAssociator/python/DetIdAssociatorESProducer_cff.py b/TrackingTools/TrackAssociator/python/DetIdAssociatorESProducer_cff.py index c0e41a2b56e81..5126a5833e2ae 100644 --- a/TrackingTools/TrackAssociator/python/DetIdAssociatorESProducer_cff.py +++ b/TrackingTools/TrackAssociator/python/DetIdAssociatorESProducer_cff.py @@ -51,6 +51,8 @@ from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toModify( muonDetIdAssociator, includeME0 = True ) phase2_muon.toModify( hcalDetIdAssociator, hcalRegion = 1 ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toModify( muonDetIdAssociator, includeME0 = False ) preshowerDetIdAssociator = cms.ESProducer("DetIdAssociatorESProducer", ComponentName = cms.string('PreshowerDetIdAssociator'), diff --git a/Validation/Configuration/python/globalValidation_cff.py b/Validation/Configuration/python/globalValidation_cff.py index 61df1eb4d440c..3928a748b104b 100644 --- a/Validation/Configuration/python/globalValidation_cff.py +++ b/Validation/Configuration/python/globalValidation_cff.py @@ -229,6 +229,8 @@ _phase2_globalValidation += trackerphase2ValidationSource _phase2_globalValidation += me0SimValid +_phase2_ge0_globalValidation = _run3_globalValidation.copy() +_phase2_ge0_globalValidation += trackerphase2ValidationSource from Configuration.Eras.Modifier_run2_GEM_2017_cff import run2_GEM_2017 run2_GEM_2017.toReplaceWith( globalValidation, _run3_globalValidation ) @@ -236,6 +238,9 @@ run3_GEM.toReplaceWith( globalValidation, _run3_globalValidation ) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toReplaceWith( globalValidation, _phase2_globalValidation ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toReplaceWith( globalValidation, _phase2_ge0_globalValidation ) +phase2_GE0.toReplaceWith( globalPrevalidationMuons, globalPrevalidationMuons.copyAndExclude([me0SimValid]) ) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 pp_on_AA_2018.toReplaceWith(globalValidation, globalValidation.copyAndExclude([pfTauRunDQMValidation])) from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer diff --git a/Validation/Configuration/python/postValidation_cff.py b/Validation/Configuration/python/postValidation_cff.py index 2fdf0d60ca389..c6f52828821d1 100644 --- a/Validation/Configuration/python/postValidation_cff.py +++ b/Validation/Configuration/python/postValidation_cff.py @@ -129,9 +129,15 @@ _phase2_postValidation += MuonME0SegPostProcessors _phase2_postValidation += trackerphase2ValidationHarvesting +_phase2_ge0_postValidation = _run3_postValidation.copy() +_phase2_ge0_postValidation += hgcalPostProcessor +_phase2_ge0_postValidation += trackerphase2ValidationHarvesting + from Configuration.Eras.Modifier_run2_GEM_2017_cff import run2_GEM_2017 run2_GEM_2017.toReplaceWith( postValidation, _run3_postValidation ) from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM run3_GEM.toReplaceWith( postValidation, _run3_postValidation ) from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal phase2_hgcal.toReplaceWith( postValidation, _phase2_postValidation ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +(phase2_GE0 & phase2_hgcal).toReplaceWith( postValidation, _phase2_ge0_postValidation ) diff --git a/Validation/RecoMuon/python/MuonTrackValidator_cfi.py b/Validation/RecoMuon/python/MuonTrackValidator_cfi.py index a92189bdee0c6..5f7f879c169fb 100644 --- a/Validation/RecoMuon/python/MuonTrackValidator_cfi.py +++ b/Validation/RecoMuon/python/MuonTrackValidator_cfi.py @@ -54,6 +54,8 @@ run3_GEM.toModify( muonTrackValidator, useGEMs = cms.bool(True) ) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toModify( muonTrackValidator, useME0 = cms.bool(True) ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toModify( muonTrackValidator, useME0 = cms.bool(False) ) from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2 premix_stage2.toModify(muonTrackValidator, diff --git a/Validation/RecoMuon/python/muonValidation_cff.py b/Validation/RecoMuon/python/muonValidation_cff.py index 7659d00832195..d070ff52e240d 100644 --- a/Validation/RecoMuon/python/muonValidation_cff.py +++ b/Validation/RecoMuon/python/muonValidation_cff.py @@ -257,7 +257,13 @@ _phase2_muonValidation += gemMuonValidation _phase2_muonValidation += me0MuonValidation +#_phase2_ge0_muonValidation = recoMuonValidation.copy() #For full validation +_phase2_ge0_muonValidation = recoMuonValidation_reduced_seq.copy() +_phase2_ge0_muonValidation += gemMuonValidation + from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM run3_GEM.toReplaceWith( recoMuonValidation, _run3_muonValidation ) from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toReplaceWith( recoMuonValidation, _phase2_muonValidation ) +from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 +phase2_GE0.toReplaceWith( recoMuonValidation, _phase2_ge0_muonValidation ) From 60799fdf6634c43ed9d11495ea21d7ba54f5cc81 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Thu, 24 Sep 2020 10:51:53 +0200 Subject: [PATCH 034/778] Move electron collection mergers to CommonTools/RecoAlgos --- CommonTools/Egamma/plugins/BuildFile.xml | 9 --------- .../plugins/ElectronCollectionMerger.cc | 0 2 files changed, 9 deletions(-) delete mode 100644 CommonTools/Egamma/plugins/BuildFile.xml rename CommonTools/{Egamma => RecoAlgos}/plugins/ElectronCollectionMerger.cc (100%) diff --git a/CommonTools/Egamma/plugins/BuildFile.xml b/CommonTools/Egamma/plugins/BuildFile.xml deleted file mode 100644 index d9ab959482eb9..0000000000000 --- a/CommonTools/Egamma/plugins/BuildFile.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/CommonTools/Egamma/plugins/ElectronCollectionMerger.cc b/CommonTools/RecoAlgos/plugins/ElectronCollectionMerger.cc similarity index 100% rename from CommonTools/Egamma/plugins/ElectronCollectionMerger.cc rename to CommonTools/RecoAlgos/plugins/ElectronCollectionMerger.cc From c8733a3fa11ca844563f27e2450db25ea32935f4 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Thu, 24 Sep 2020 13:09:32 +0200 Subject: [PATCH 035/778] 1st bunch of review comments: mostly code style --- .../RecoTau/interface/AntiElectronIDMVA6.h | 34 +- .../TauDiscriminationAgainstElectronMVA6.cc | 8 +- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 989 +++++++++--------- .../src/PositionAtECalEntranceComputer.cc | 6 +- 4 files changed, 507 insertions(+), 530 deletions(-) diff --git a/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h b/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h index 1b7666dd0785f..02efa7d7019af 100644 --- a/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h +++ b/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h @@ -121,22 +121,22 @@ class AntiElectronIDMVA6 { void beginEvent(const edm::Event&, const edm::EventSetup&); - double MVAValue(const antiElecIDMVA6_blocks::TauVars& tauVars, + double mvaValue(const antiElecIDMVA6_blocks::TauVars& tauVars, const antiElecIDMVA6_blocks::TauGammaVecs& tauGammaVecs, const antiElecIDMVA6_blocks::ElecVars& elecVars); - double MVAValue(const antiElecIDMVA6_blocks::TauVars& tauVars, + double mvaValue(const antiElecIDMVA6_blocks::TauVars& tauVars, const antiElecIDMVA6_blocks::TauGammaMoms& tauGammaMoms, const antiElecIDMVA6_blocks::ElecVars& elecVars); - double MVAValuePhase2(const antiElecIDMVA6_blocks::TauVars& tauVars, + double mvaValuePhase2(const antiElecIDMVA6_blocks::TauVars& tauVars, const antiElecIDMVA6_blocks::TauGammaMoms& tauGammaMoms, const antiElecIDMVA6_blocks::ElecVars& elecVars); // this function can be called for all categories - double MVAValue(const TauType& theTau, const ElectronRef& theEleRef); + double mvaValue(const TauType& theTau, const ElectronRef& theEleRef); // this function can be called for category 1 only !! - double MVAValue(const TauType& theTau); + double mvaValue(const TauType& theTau); // overloaded method with explicit tau type to avoid partial imlementation of full class antiElecIDMVA6_blocks::TauVars getTauVarsTypeSpecific(const reco::PFTau& theTau); @@ -175,18 +175,18 @@ class AntiElectronIDMVA6 { bool usePhiAtEcalEntranceExtrapolation_; - float* Var_NoEleMatch_woGwoGSF_Barrel_; - float* Var_NoEleMatch_wGwoGSF_Barrel_; - float* Var_woGwGSF_Barrel_; - float* Var_wGwGSF_Barrel_; - float* Var_NoEleMatch_woGwoGSF_Endcap_; - float* Var_NoEleMatch_wGwoGSF_Endcap_; - float* Var_woGwGSF_Endcap_; - float* Var_wGwGSF_Endcap_; - float* Var_NoEleMatch_woGwoGSF_VFEndcap_; - float* Var_NoEleMatch_wGwoGSF_VFEndcap_; - float* Var_woGwGSF_VFEndcap_; - float* Var_wGwGSF_VFEndcap_; + std::vector var_NoEleMatch_woGwoGSF_Barrel_; + std::vector var_NoEleMatch_wGwoGSF_Barrel_; + std::vector var_woGwGSF_Barrel_; + std::vector var_wGwGSF_Barrel_; + std::vector var_NoEleMatch_woGwoGSF_Endcap_; + std::vector var_NoEleMatch_wGwoGSF_Endcap_; + std::vector var_woGwGSF_Endcap_; + std::vector var_wGwGSF_Endcap_; + std::vector var_NoEleMatch_woGwoGSF_VFEndcap_; + std::vector var_NoEleMatch_wGwoGSF_VFEndcap_; + std::vector var_woGwGSF_VFEndcap_; + std::vector var_wGwGSF_VFEndcap_; const GBRForest* mva_NoEleMatch_woGwoGSF_BL_; const GBRForest* mva_NoEleMatch_wGwoGSF_BL_; diff --git a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc index c98be0b9e4bd8..bb3c68c91fafb 100644 --- a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc +++ b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc @@ -134,7 +134,7 @@ TauDiscriminationAgainstElectronMVA6::d double deltaREleTau = deltaR(theElectron.p4(), theTauRef->p4()); deltaRDummy = std::min(deltaREleTau, deltaRDummy); if (deltaREleTau < deltaREleTauMax_) { - double mva_match = mva_->MVAValue(*theTauRef, theElecRef); + double mva_match = mva_->mvaValue(*theTauRef, theElecRef); if (!hasGsfTrack) hasGsfTrack = theElectron.gsfTrack().isNonnull(); @@ -155,7 +155,7 @@ TauDiscriminationAgainstElectronMVA6::d } else if (numSignalGammaCandsInSigCone >= 1 && hasGsfTrack) { category = 7.; } - } else if (!isPhase2_ || (std::abs(tauEtaAtECalEntrance.first) < ecalEndcapVFEndcapEtaBorder_)) { // Endcap + } else if (!isPhase2_ || std::abs(tauEtaAtECalEntrance.first) < ecalEndcapVFEndcapEtaBorder_) { // Endcap if (numSignalGammaCandsInSigCone == 0 && hasGsfTrack) { category = 13.; } else if (numSignalGammaCandsInSigCone >= 1 && hasGsfTrack) { @@ -176,7 +176,7 @@ TauDiscriminationAgainstElectronMVA6::d } // end of loop over electrons if (!isGsfElectronMatched) { - double mva_nomatch = mva_->MVAValue(*theTauRef); + double mva_nomatch = mva_->mvaValue(*theTauRef); // veto taus that go to ECal crack if (vetoEcalCracks_ && @@ -195,7 +195,7 @@ TauDiscriminationAgainstElectronMVA6::d } else if (numSignalGammaCandsInSigCone >= 1 && !hasGsfTrack) { category = 2.; } - } else if (!isPhase2_ || (std::abs(tauEtaAtECalEntrance.first) < ecalEndcapVFEndcapEtaBorder_)) { // Endcap + } else if (!isPhase2_ || std::abs(tauEtaAtECalEntrance.first) < ecalEndcapVFEndcapEtaBorder_) { // Endcap if (numSignalGammaCandsInSigCone == 0 && !hasGsfTrack) { category = 8.; } else if (numSignalGammaCandsInSigCone >= 1 && !hasGsfTrack) { diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index 10fe13ea94637..8c79543f01e60 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -59,31 +59,27 @@ AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::Paramet usePhiAtEcalEntranceExtrapolation_ = cfg.getParameter("usePhiAtEcalEntranceExtrapolation"); if (!isPhase2_) { - Var_NoEleMatch_woGwoGSF_Barrel_ = new float[10]; - Var_NoEleMatch_wGwoGSF_Barrel_ = new float[18]; - Var_woGwGSF_Barrel_ = new float[24]; - Var_wGwGSF_Barrel_ = new float[32]; - Var_NoEleMatch_woGwoGSF_Endcap_ = new float[9]; - Var_NoEleMatch_wGwoGSF_Endcap_ = new float[17]; - Var_woGwGSF_Endcap_ = new float[23]; - Var_wGwGSF_Endcap_ = new float[31]; - Var_NoEleMatch_woGwoGSF_VFEndcap_ = nullptr; - Var_NoEleMatch_wGwoGSF_VFEndcap_ = nullptr; - Var_woGwGSF_VFEndcap_ = nullptr; - Var_wGwGSF_VFEndcap_ = nullptr; + var_NoEleMatch_woGwoGSF_Barrel_ = std::vector(10); + var_NoEleMatch_wGwoGSF_Barrel_ = std::vector(18); + var_woGwGSF_Barrel_ = std::vector(24); + var_wGwGSF_Barrel_ = std::vector(32); + var_NoEleMatch_woGwoGSF_Endcap_ = std::vector(9); + var_NoEleMatch_wGwoGSF_Endcap_ = std::vector(17); + var_woGwGSF_Endcap_ = std::vector(23); + var_wGwGSF_Endcap_ = std::vector(31); } else { - Var_NoEleMatch_woGwoGSF_Barrel_ = new float[9]; - Var_NoEleMatch_wGwoGSF_Barrel_ = new float[17]; - Var_woGwGSF_Barrel_ = new float[27]; - Var_wGwGSF_Barrel_ = new float[36]; - Var_NoEleMatch_woGwoGSF_Endcap_ = new float[6]; - Var_NoEleMatch_wGwoGSF_Endcap_ = new float[14]; - Var_woGwGSF_Endcap_ = new float[31]; - Var_wGwGSF_Endcap_ = new float[38]; - Var_NoEleMatch_woGwoGSF_VFEndcap_ = new float[6]; - Var_NoEleMatch_wGwoGSF_VFEndcap_ = new float[14]; - Var_woGwGSF_VFEndcap_ = new float[32]; - Var_wGwGSF_VFEndcap_ = new float[40]; + var_NoEleMatch_woGwoGSF_Barrel_ = std::vector(9); + var_NoEleMatch_wGwoGSF_Barrel_ = std::vector(17); + var_woGwGSF_Barrel_ = std::vector(27); + var_wGwGSF_Barrel_ = std::vector(36); + var_NoEleMatch_woGwoGSF_Endcap_ = std::vector(6); + var_NoEleMatch_wGwoGSF_Endcap_ = std::vector(14); + var_woGwGSF_Endcap_ = std::vector(31); + var_wGwGSF_Endcap_ = std::vector(38); + var_NoEleMatch_woGwoGSF_VFEndcap_ = std::vector(6); + var_NoEleMatch_wGwoGSF_VFEndcap_ = std::vector(14); + var_woGwGSF_VFEndcap_ = std::vector(32); + var_wGwGSF_VFEndcap_ = std::vector(40); //MB: Tokens for additional inputs (HGCal EleID variables) only for Phase2 and reco::GsfElectrons if (std::is_same::value) { @@ -99,21 +95,6 @@ AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::Paramet template AntiElectronIDMVA6::~AntiElectronIDMVA6() { - delete[] Var_NoEleMatch_woGwoGSF_Barrel_; - delete[] Var_NoEleMatch_wGwoGSF_Barrel_; - delete[] Var_woGwGSF_Barrel_; - delete[] Var_wGwGSF_Barrel_; - delete[] Var_NoEleMatch_woGwoGSF_Endcap_; - delete[] Var_NoEleMatch_wGwoGSF_Endcap_; - delete[] Var_woGwGSF_Endcap_; - delete[] Var_wGwGSF_Endcap_; - if (isPhase2_) { - delete[] Var_NoEleMatch_woGwoGSF_VFEndcap_; - delete[] Var_NoEleMatch_wGwoGSF_VFEndcap_; - delete[] Var_woGwGSF_VFEndcap_; - delete[] Var_wGwGSF_VFEndcap_; - } - if (!loadMVAfromDB_) { delete mva_NoEleMatch_woGwoGSF_BL_; delete mva_NoEleMatch_wGwoGSF_BL_; @@ -208,7 +189,7 @@ void AntiElectronIDMVA6::beginEvent(const edm::Event& evt } template -double AntiElectronIDMVA6::MVAValue(const TauVars& tauVars, +double AntiElectronIDMVA6::mvaValue(const TauVars& tauVars, const TauGammaVecs& tauGammaVecs, const ElecVars& elecVars) { TauGammaMoms tauGammaMoms; @@ -269,14 +250,14 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar tauGammaMoms.gammaPhiMomOut = std::sqrt(dPhi2 * tauGammaMoms.gammaEnFracOut) * tauVars.pt; if (!isPhase2_) { - return MVAValue(tauVars, tauGammaMoms, elecVars); + return mvaValue(tauVars, tauGammaMoms, elecVars); } else { - return MVAValuePhase2(tauVars, tauGammaMoms, elecVars); + return mvaValuePhase2(tauVars, tauGammaMoms, elecVars); } } template -double AntiElectronIDMVA6::MVAValue(const TauVars& tauVars, +double AntiElectronIDMVA6::mvaValue(const TauVars& tauVars, const TauGammaMoms& tauGammaMoms, const ElecVars& elecVars) { if (!isInitialized_) { @@ -295,199 +276,199 @@ double AntiElectronIDMVA6::MVAValue(const TauVars& tauVar if (deltaR(tauVars.etaAtEcalEntrance, tauVars.phi, elecVars.eta, elecVars.phi) > 0.3 && tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf < 0.5) { if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { - Var_NoEleMatch_woGwoGSF_Barrel_[0] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_woGwoGSF_Barrel_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_NoEleMatch_woGwoGSF_Barrel_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_Barrel_[3] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_Barrel_[4] = tauVars.emFraction; - Var_NoEleMatch_woGwoGSF_Barrel_[5] = tauVars.leadPFChargedHadrHoP; - Var_NoEleMatch_woGwoGSF_Barrel_[6] = tauVars.leadPFChargedHadrEoP; - Var_NoEleMatch_woGwoGSF_Barrel_[7] = tauVars.visMassIn; - Var_NoEleMatch_woGwoGSF_Barrel_[8] = tauVars.dCrackEta; - Var_NoEleMatch_woGwoGSF_Barrel_[9] = tauVars.dCrackPhi; - mvaValue = mva_NoEleMatch_woGwoGSF_BL_->GetClassifier(Var_NoEleMatch_woGwoGSF_Barrel_); + var_NoEleMatch_woGwoGSF_Barrel_[0] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_woGwoGSF_Barrel_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_NoEleMatch_woGwoGSF_Barrel_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_Barrel_[3] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_Barrel_[4] = tauVars.emFraction; + var_NoEleMatch_woGwoGSF_Barrel_[5] = tauVars.leadPFChargedHadrHoP; + var_NoEleMatch_woGwoGSF_Barrel_[6] = tauVars.leadPFChargedHadrEoP; + var_NoEleMatch_woGwoGSF_Barrel_[7] = tauVars.visMassIn; + var_NoEleMatch_woGwoGSF_Barrel_[8] = tauVars.dCrackEta; + var_NoEleMatch_woGwoGSF_Barrel_[9] = tauVars.dCrackPhi; + mvaValue = mva_NoEleMatch_woGwoGSF_BL_->GetClassifier(var_NoEleMatch_woGwoGSF_Barrel_.data()); } else { - Var_NoEleMatch_woGwoGSF_Endcap_[0] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_woGwoGSF_Endcap_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_NoEleMatch_woGwoGSF_Endcap_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_Endcap_[3] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_Endcap_[4] = tauVars.emFraction; - Var_NoEleMatch_woGwoGSF_Endcap_[5] = tauVars.leadPFChargedHadrHoP; - Var_NoEleMatch_woGwoGSF_Endcap_[6] = tauVars.leadPFChargedHadrEoP; - Var_NoEleMatch_woGwoGSF_Endcap_[7] = tauVars.visMassIn; - Var_NoEleMatch_woGwoGSF_Endcap_[8] = tauVars.dCrackEta; - mvaValue = mva_NoEleMatch_woGwoGSF_EC_->GetClassifier(Var_NoEleMatch_woGwoGSF_Endcap_); + var_NoEleMatch_woGwoGSF_Endcap_[0] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_woGwoGSF_Endcap_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_NoEleMatch_woGwoGSF_Endcap_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_Endcap_[3] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_Endcap_[4] = tauVars.emFraction; + var_NoEleMatch_woGwoGSF_Endcap_[5] = tauVars.leadPFChargedHadrHoP; + var_NoEleMatch_woGwoGSF_Endcap_[6] = tauVars.leadPFChargedHadrEoP; + var_NoEleMatch_woGwoGSF_Endcap_[7] = tauVars.visMassIn; + var_NoEleMatch_woGwoGSF_Endcap_[8] = tauVars.dCrackEta; + mvaValue = mva_NoEleMatch_woGwoGSF_EC_->GetClassifier(var_NoEleMatch_woGwoGSF_Endcap_.data()); } } else if (deltaR(tauVars.etaAtEcalEntrance, tauVars.phi, elecVars.eta, elecVars.phi) > 0.3 && tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf < 0.5) { if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { - Var_NoEleMatch_wGwoGSF_Barrel_[0] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_wGwoGSF_Barrel_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_NoEleMatch_wGwoGSF_Barrel_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_Barrel_[3] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_Barrel_[4] = tauVars.emFraction; - Var_NoEleMatch_wGwoGSF_Barrel_[5] = tauGammaMoms.signalPFGammaCandsIn; - Var_NoEleMatch_wGwoGSF_Barrel_[6] = tauGammaMoms.signalPFGammaCandsOut; - Var_NoEleMatch_wGwoGSF_Barrel_[7] = tauVars.leadPFChargedHadrHoP; - Var_NoEleMatch_wGwoGSF_Barrel_[8] = tauVars.leadPFChargedHadrEoP; - Var_NoEleMatch_wGwoGSF_Barrel_[9] = tauVars.visMassIn; - Var_NoEleMatch_wGwoGSF_Barrel_[10] = tauGammaMoms.gammaEtaMomIn; - Var_NoEleMatch_wGwoGSF_Barrel_[11] = tauGammaMoms.gammaEtaMomOut; - Var_NoEleMatch_wGwoGSF_Barrel_[12] = tauGammaMoms.gammaPhiMomIn; - Var_NoEleMatch_wGwoGSF_Barrel_[13] = tauGammaMoms.gammaPhiMomOut; - Var_NoEleMatch_wGwoGSF_Barrel_[14] = tauGammaMoms.gammaEnFracIn; - Var_NoEleMatch_wGwoGSF_Barrel_[15] = tauGammaMoms.gammaEnFracOut; - Var_NoEleMatch_wGwoGSF_Barrel_[16] = tauVars.dCrackEta; - Var_NoEleMatch_wGwoGSF_Barrel_[17] = tauVars.dCrackPhi; - mvaValue = mva_NoEleMatch_wGwoGSF_BL_->GetClassifier(Var_NoEleMatch_wGwoGSF_Barrel_); + var_NoEleMatch_wGwoGSF_Barrel_[0] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_wGwoGSF_Barrel_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_NoEleMatch_wGwoGSF_Barrel_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_Barrel_[3] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_Barrel_[4] = tauVars.emFraction; + var_NoEleMatch_wGwoGSF_Barrel_[5] = tauGammaMoms.signalPFGammaCandsIn; + var_NoEleMatch_wGwoGSF_Barrel_[6] = tauGammaMoms.signalPFGammaCandsOut; + var_NoEleMatch_wGwoGSF_Barrel_[7] = tauVars.leadPFChargedHadrHoP; + var_NoEleMatch_wGwoGSF_Barrel_[8] = tauVars.leadPFChargedHadrEoP; + var_NoEleMatch_wGwoGSF_Barrel_[9] = tauVars.visMassIn; + var_NoEleMatch_wGwoGSF_Barrel_[10] = tauGammaMoms.gammaEtaMomIn; + var_NoEleMatch_wGwoGSF_Barrel_[11] = tauGammaMoms.gammaEtaMomOut; + var_NoEleMatch_wGwoGSF_Barrel_[12] = tauGammaMoms.gammaPhiMomIn; + var_NoEleMatch_wGwoGSF_Barrel_[13] = tauGammaMoms.gammaPhiMomOut; + var_NoEleMatch_wGwoGSF_Barrel_[14] = tauGammaMoms.gammaEnFracIn; + var_NoEleMatch_wGwoGSF_Barrel_[15] = tauGammaMoms.gammaEnFracOut; + var_NoEleMatch_wGwoGSF_Barrel_[16] = tauVars.dCrackEta; + var_NoEleMatch_wGwoGSF_Barrel_[17] = tauVars.dCrackPhi; + mvaValue = mva_NoEleMatch_wGwoGSF_BL_->GetClassifier(var_NoEleMatch_wGwoGSF_Barrel_.data()); } else { - Var_NoEleMatch_wGwoGSF_Endcap_[0] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_wGwoGSF_Endcap_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_NoEleMatch_wGwoGSF_Endcap_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_Endcap_[3] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_Endcap_[4] = tauVars.emFraction; - Var_NoEleMatch_wGwoGSF_Endcap_[5] = tauGammaMoms.signalPFGammaCandsIn; - Var_NoEleMatch_wGwoGSF_Endcap_[6] = tauGammaMoms.signalPFGammaCandsOut; - Var_NoEleMatch_wGwoGSF_Endcap_[7] = tauVars.leadPFChargedHadrHoP; - Var_NoEleMatch_wGwoGSF_Endcap_[8] = tauVars.leadPFChargedHadrEoP; - Var_NoEleMatch_wGwoGSF_Endcap_[9] = tauVars.visMassIn; - Var_NoEleMatch_wGwoGSF_Endcap_[10] = tauGammaMoms.gammaEtaMomIn; - Var_NoEleMatch_wGwoGSF_Endcap_[11] = tauGammaMoms.gammaEtaMomOut; - Var_NoEleMatch_wGwoGSF_Endcap_[12] = tauGammaMoms.gammaPhiMomIn; - Var_NoEleMatch_wGwoGSF_Endcap_[13] = tauGammaMoms.gammaPhiMomOut; - Var_NoEleMatch_wGwoGSF_Endcap_[14] = tauGammaMoms.gammaEnFracIn; - Var_NoEleMatch_wGwoGSF_Endcap_[15] = tauGammaMoms.gammaEnFracOut; - Var_NoEleMatch_wGwoGSF_Endcap_[16] = tauVars.dCrackEta; - mvaValue = mva_NoEleMatch_wGwoGSF_EC_->GetClassifier(Var_NoEleMatch_wGwoGSF_Endcap_); + var_NoEleMatch_wGwoGSF_Endcap_[0] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_wGwoGSF_Endcap_[1] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_NoEleMatch_wGwoGSF_Endcap_[2] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_Endcap_[3] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_Endcap_[4] = tauVars.emFraction; + var_NoEleMatch_wGwoGSF_Endcap_[5] = tauGammaMoms.signalPFGammaCandsIn; + var_NoEleMatch_wGwoGSF_Endcap_[6] = tauGammaMoms.signalPFGammaCandsOut; + var_NoEleMatch_wGwoGSF_Endcap_[7] = tauVars.leadPFChargedHadrHoP; + var_NoEleMatch_wGwoGSF_Endcap_[8] = tauVars.leadPFChargedHadrEoP; + var_NoEleMatch_wGwoGSF_Endcap_[9] = tauVars.visMassIn; + var_NoEleMatch_wGwoGSF_Endcap_[10] = tauGammaMoms.gammaEtaMomIn; + var_NoEleMatch_wGwoGSF_Endcap_[11] = tauGammaMoms.gammaEtaMomOut; + var_NoEleMatch_wGwoGSF_Endcap_[12] = tauGammaMoms.gammaPhiMomIn; + var_NoEleMatch_wGwoGSF_Endcap_[13] = tauGammaMoms.gammaPhiMomOut; + var_NoEleMatch_wGwoGSF_Endcap_[14] = tauGammaMoms.gammaEnFracIn; + var_NoEleMatch_wGwoGSF_Endcap_[15] = tauGammaMoms.gammaEnFracOut; + var_NoEleMatch_wGwoGSF_Endcap_[16] = tauVars.dCrackEta; + mvaValue = mva_NoEleMatch_wGwoGSF_EC_->GetClassifier(var_NoEleMatch_wGwoGSF_Endcap_.data()); } } else if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf > 0.5) { if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { - Var_woGwGSF_Barrel_[0] = std::max(-0.1f, elecVars.eTotOverPin); - Var_woGwGSF_Barrel_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); - Var_woGwGSF_Barrel_[2] = elecVars.gsfNumHits; - Var_woGwGSF_Barrel_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol)); - Var_woGwGSF_Barrel_[4] = elecVars.gsfTracklnPt; - Var_woGwGSF_Barrel_[5] = elecNumHitsDiffOverSum; - Var_woGwGSF_Barrel_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF)); - Var_woGwGSF_Barrel_[7] = std::min(elecDeltaPinPoutOverPin, 1.f); - Var_woGwGSF_Barrel_[8] = std::min(elecEecalOverPout, 20.f); - Var_woGwGSF_Barrel_[9] = elecVars.deltaEta; - Var_woGwGSF_Barrel_[10] = elecVars.deltaPhi; - Var_woGwGSF_Barrel_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); - Var_woGwGSF_Barrel_[12] = std::min(elecVars.mvaInHadEnergy, 20.f); - Var_woGwGSF_Barrel_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f); - Var_woGwGSF_Barrel_[14] = tauVars.etaAtEcalEntrance; - Var_woGwGSF_Barrel_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_woGwGSF_Barrel_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_woGwGSF_Barrel_[17] = std::log(std::max(1.f, tauVars.pt)); - Var_woGwGSF_Barrel_[18] = tauVars.emFraction; - Var_woGwGSF_Barrel_[19] = tauVars.leadPFChargedHadrHoP; - Var_woGwGSF_Barrel_[20] = tauVars.leadPFChargedHadrEoP; - Var_woGwGSF_Barrel_[21] = tauVars.visMassIn; - Var_woGwGSF_Barrel_[22] = tauVars.dCrackEta; - Var_woGwGSF_Barrel_[23] = tauVars.dCrackPhi; - mvaValue = mva_woGwGSF_BL_->GetClassifier(Var_woGwGSF_Barrel_); + var_woGwGSF_Barrel_[0] = std::max(-0.1f, elecVars.eTotOverPin); + var_woGwGSF_Barrel_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); + var_woGwGSF_Barrel_[2] = elecVars.gsfNumHits; + var_woGwGSF_Barrel_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol)); + var_woGwGSF_Barrel_[4] = elecVars.gsfTracklnPt; + var_woGwGSF_Barrel_[5] = elecNumHitsDiffOverSum; + var_woGwGSF_Barrel_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF)); + var_woGwGSF_Barrel_[7] = std::min(elecDeltaPinPoutOverPin, 1.f); + var_woGwGSF_Barrel_[8] = std::min(elecEecalOverPout, 20.f); + var_woGwGSF_Barrel_[9] = elecVars.deltaEta; + var_woGwGSF_Barrel_[10] = elecVars.deltaPhi; + var_woGwGSF_Barrel_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); + var_woGwGSF_Barrel_[12] = std::min(elecVars.mvaInHadEnergy, 20.f); + var_woGwGSF_Barrel_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f); + var_woGwGSF_Barrel_[14] = tauVars.etaAtEcalEntrance; + var_woGwGSF_Barrel_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_woGwGSF_Barrel_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_woGwGSF_Barrel_[17] = std::log(std::max(1.f, tauVars.pt)); + var_woGwGSF_Barrel_[18] = tauVars.emFraction; + var_woGwGSF_Barrel_[19] = tauVars.leadPFChargedHadrHoP; + var_woGwGSF_Barrel_[20] = tauVars.leadPFChargedHadrEoP; + var_woGwGSF_Barrel_[21] = tauVars.visMassIn; + var_woGwGSF_Barrel_[22] = tauVars.dCrackEta; + var_woGwGSF_Barrel_[23] = tauVars.dCrackPhi; + mvaValue = mva_woGwGSF_BL_->GetClassifier(var_woGwGSF_Barrel_.data()); } else { - Var_woGwGSF_Endcap_[0] = std::max(-0.1f, elecVars.eTotOverPin); - Var_woGwGSF_Endcap_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); - Var_woGwGSF_Endcap_[2] = elecVars.gsfNumHits; - Var_woGwGSF_Endcap_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol)); - Var_woGwGSF_Endcap_[4] = elecVars.gsfTracklnPt; - Var_woGwGSF_Endcap_[5] = elecNumHitsDiffOverSum; - Var_woGwGSF_Endcap_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF)); - Var_woGwGSF_Endcap_[7] = std::min(elecDeltaPinPoutOverPin, 1.f); - Var_woGwGSF_Endcap_[8] = std::min(elecEecalOverPout, 20.f); - Var_woGwGSF_Endcap_[9] = elecVars.deltaEta; - Var_woGwGSF_Endcap_[10] = elecVars.deltaPhi; - Var_woGwGSF_Endcap_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); - Var_woGwGSF_Endcap_[12] = std::min(elecVars.mvaInHadEnergy, 20.f); - Var_woGwGSF_Endcap_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f); - Var_woGwGSF_Endcap_[14] = tauVars.etaAtEcalEntrance; - Var_woGwGSF_Endcap_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_woGwGSF_Endcap_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_woGwGSF_Endcap_[17] = std::log(std::max(1.f, tauVars.pt)); - Var_woGwGSF_Endcap_[18] = tauVars.emFraction; - Var_woGwGSF_Endcap_[19] = tauVars.leadPFChargedHadrHoP; - Var_woGwGSF_Endcap_[20] = tauVars.leadPFChargedHadrEoP; - Var_woGwGSF_Endcap_[21] = tauVars.visMassIn; - Var_woGwGSF_Endcap_[22] = tauVars.dCrackEta; - mvaValue = mva_woGwGSF_EC_->GetClassifier(Var_woGwGSF_Endcap_); + var_woGwGSF_Endcap_[0] = std::max(-0.1f, elecVars.eTotOverPin); + var_woGwGSF_Endcap_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); + var_woGwGSF_Endcap_[2] = elecVars.gsfNumHits; + var_woGwGSF_Endcap_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol)); + var_woGwGSF_Endcap_[4] = elecVars.gsfTracklnPt; + var_woGwGSF_Endcap_[5] = elecNumHitsDiffOverSum; + var_woGwGSF_Endcap_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF)); + var_woGwGSF_Endcap_[7] = std::min(elecDeltaPinPoutOverPin, 1.f); + var_woGwGSF_Endcap_[8] = std::min(elecEecalOverPout, 20.f); + var_woGwGSF_Endcap_[9] = elecVars.deltaEta; + var_woGwGSF_Endcap_[10] = elecVars.deltaPhi; + var_woGwGSF_Endcap_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); + var_woGwGSF_Endcap_[12] = std::min(elecVars.mvaInHadEnergy, 20.f); + var_woGwGSF_Endcap_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f); + var_woGwGSF_Endcap_[14] = tauVars.etaAtEcalEntrance; + var_woGwGSF_Endcap_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_woGwGSF_Endcap_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_woGwGSF_Endcap_[17] = std::log(std::max(1.f, tauVars.pt)); + var_woGwGSF_Endcap_[18] = tauVars.emFraction; + var_woGwGSF_Endcap_[19] = tauVars.leadPFChargedHadrHoP; + var_woGwGSF_Endcap_[20] = tauVars.leadPFChargedHadrEoP; + var_woGwGSF_Endcap_[21] = tauVars.visMassIn; + var_woGwGSF_Endcap_[22] = tauVars.dCrackEta; + mvaValue = mva_woGwGSF_EC_->GetClassifier(var_woGwGSF_Endcap_.data()); } } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf > 0.5) { if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { - Var_wGwGSF_Barrel_[0] = std::max(-0.1f, elecVars.eTotOverPin); - Var_wGwGSF_Barrel_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); - Var_wGwGSF_Barrel_[2] = elecVars.gsfNumHits; - Var_wGwGSF_Barrel_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol)); - Var_wGwGSF_Barrel_[4] = elecVars.gsfTracklnPt; - Var_wGwGSF_Barrel_[5] = elecNumHitsDiffOverSum; - Var_wGwGSF_Barrel_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF)); - Var_wGwGSF_Barrel_[7] = std::min(elecDeltaPinPoutOverPin, 1.f); - Var_wGwGSF_Barrel_[8] = std::min(elecEecalOverPout, 20.f); - Var_wGwGSF_Barrel_[9] = elecVars.deltaEta; - Var_wGwGSF_Barrel_[10] = elecVars.deltaPhi; - Var_wGwGSF_Barrel_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); - Var_wGwGSF_Barrel_[12] = std::min(elecVars.mvaInHadEnergy, 20.f); - Var_wGwGSF_Barrel_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f); - Var_wGwGSF_Barrel_[14] = tauVars.etaAtEcalEntrance; - Var_wGwGSF_Barrel_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_wGwGSF_Barrel_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_wGwGSF_Barrel_[17] = std::log(std::max(1.f, tauVars.pt)); - Var_wGwGSF_Barrel_[18] = tauVars.emFraction; - Var_wGwGSF_Barrel_[19] = tauGammaMoms.signalPFGammaCandsIn; - Var_wGwGSF_Barrel_[20] = tauGammaMoms.signalPFGammaCandsOut; - Var_wGwGSF_Barrel_[21] = tauVars.leadPFChargedHadrHoP; - Var_wGwGSF_Barrel_[22] = tauVars.leadPFChargedHadrEoP; - Var_wGwGSF_Barrel_[23] = tauVars.visMassIn; - Var_wGwGSF_Barrel_[24] = tauGammaMoms.gammaEtaMomIn; - Var_wGwGSF_Barrel_[25] = tauGammaMoms.gammaEtaMomOut; - Var_wGwGSF_Barrel_[26] = tauGammaMoms.gammaPhiMomIn; - Var_wGwGSF_Barrel_[27] = tauGammaMoms.gammaPhiMomOut; - Var_wGwGSF_Barrel_[28] = tauGammaMoms.gammaEnFracIn; - Var_wGwGSF_Barrel_[29] = tauGammaMoms.gammaEnFracOut; - Var_wGwGSF_Barrel_[30] = tauVars.dCrackEta; - Var_wGwGSF_Barrel_[31] = tauVars.dCrackPhi; - mvaValue = mva_wGwGSF_BL_->GetClassifier(Var_wGwGSF_Barrel_); + var_wGwGSF_Barrel_[0] = std::max(-0.1f, elecVars.eTotOverPin); + var_wGwGSF_Barrel_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); + var_wGwGSF_Barrel_[2] = elecVars.gsfNumHits; + var_wGwGSF_Barrel_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol)); + var_wGwGSF_Barrel_[4] = elecVars.gsfTracklnPt; + var_wGwGSF_Barrel_[5] = elecNumHitsDiffOverSum; + var_wGwGSF_Barrel_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF)); + var_wGwGSF_Barrel_[7] = std::min(elecDeltaPinPoutOverPin, 1.f); + var_wGwGSF_Barrel_[8] = std::min(elecEecalOverPout, 20.f); + var_wGwGSF_Barrel_[9] = elecVars.deltaEta; + var_wGwGSF_Barrel_[10] = elecVars.deltaPhi; + var_wGwGSF_Barrel_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); + var_wGwGSF_Barrel_[12] = std::min(elecVars.mvaInHadEnergy, 20.f); + var_wGwGSF_Barrel_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f); + var_wGwGSF_Barrel_[14] = tauVars.etaAtEcalEntrance; + var_wGwGSF_Barrel_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_wGwGSF_Barrel_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_wGwGSF_Barrel_[17] = std::log(std::max(1.f, tauVars.pt)); + var_wGwGSF_Barrel_[18] = tauVars.emFraction; + var_wGwGSF_Barrel_[19] = tauGammaMoms.signalPFGammaCandsIn; + var_wGwGSF_Barrel_[20] = tauGammaMoms.signalPFGammaCandsOut; + var_wGwGSF_Barrel_[21] = tauVars.leadPFChargedHadrHoP; + var_wGwGSF_Barrel_[22] = tauVars.leadPFChargedHadrEoP; + var_wGwGSF_Barrel_[23] = tauVars.visMassIn; + var_wGwGSF_Barrel_[24] = tauGammaMoms.gammaEtaMomIn; + var_wGwGSF_Barrel_[25] = tauGammaMoms.gammaEtaMomOut; + var_wGwGSF_Barrel_[26] = tauGammaMoms.gammaPhiMomIn; + var_wGwGSF_Barrel_[27] = tauGammaMoms.gammaPhiMomOut; + var_wGwGSF_Barrel_[28] = tauGammaMoms.gammaEnFracIn; + var_wGwGSF_Barrel_[29] = tauGammaMoms.gammaEnFracOut; + var_wGwGSF_Barrel_[30] = tauVars.dCrackEta; + var_wGwGSF_Barrel_[31] = tauVars.dCrackPhi; + mvaValue = mva_wGwGSF_BL_->GetClassifier(var_wGwGSF_Barrel_.data()); } else { - Var_wGwGSF_Endcap_[0] = std::max(-0.1f, elecVars.eTotOverPin); - Var_wGwGSF_Endcap_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); - Var_wGwGSF_Endcap_[2] = elecVars.gsfNumHits; - Var_wGwGSF_Endcap_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol)); - Var_wGwGSF_Endcap_[4] = elecVars.gsfTracklnPt; - Var_wGwGSF_Endcap_[5] = elecNumHitsDiffOverSum; - Var_wGwGSF_Endcap_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF)); - Var_wGwGSF_Endcap_[7] = std::min(elecDeltaPinPoutOverPin, 1.f); - Var_wGwGSF_Endcap_[8] = std::min(elecEecalOverPout, 20.f); - Var_wGwGSF_Endcap_[9] = elecVars.deltaEta; - Var_wGwGSF_Endcap_[10] = elecVars.deltaPhi; - Var_wGwGSF_Endcap_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); - Var_wGwGSF_Endcap_[12] = std::min(elecVars.mvaInHadEnergy, 20.f); - Var_wGwGSF_Endcap_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f); - Var_wGwGSF_Endcap_[14] = tauVars.etaAtEcalEntrance; - Var_wGwGSF_Endcap_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_wGwGSF_Endcap_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_wGwGSF_Endcap_[17] = std::log(std::max(1.f, tauVars.pt)); - Var_wGwGSF_Endcap_[18] = tauVars.emFraction; - Var_wGwGSF_Endcap_[19] = tauGammaMoms.signalPFGammaCandsIn; - Var_wGwGSF_Endcap_[20] = tauGammaMoms.signalPFGammaCandsOut; - Var_wGwGSF_Endcap_[21] = tauVars.leadPFChargedHadrHoP; - Var_wGwGSF_Endcap_[22] = tauVars.leadPFChargedHadrEoP; - Var_wGwGSF_Endcap_[23] = tauVars.visMassIn; - Var_wGwGSF_Endcap_[24] = tauGammaMoms.gammaEtaMomIn; - Var_wGwGSF_Endcap_[25] = tauGammaMoms.gammaEtaMomOut; - Var_wGwGSF_Endcap_[26] = tauGammaMoms.gammaPhiMomIn; - Var_wGwGSF_Endcap_[27] = tauGammaMoms.gammaPhiMomOut; - Var_wGwGSF_Endcap_[28] = tauGammaMoms.gammaEnFracIn; - Var_wGwGSF_Endcap_[29] = tauGammaMoms.gammaEnFracOut; - Var_wGwGSF_Endcap_[30] = tauVars.dCrackEta; - mvaValue = mva_wGwGSF_EC_->GetClassifier(Var_wGwGSF_Endcap_); + var_wGwGSF_Endcap_[0] = std::max(-0.1f, elecVars.eTotOverPin); + var_wGwGSF_Endcap_[1] = std::log(std::max(0.01f, elecVars.chi2NormGSF)); + var_wGwGSF_Endcap_[2] = elecVars.gsfNumHits; + var_wGwGSF_Endcap_[3] = std::log(std::max(0.01f, elecVars.gsfTrackResol)); + var_wGwGSF_Endcap_[4] = elecVars.gsfTracklnPt; + var_wGwGSF_Endcap_[5] = elecNumHitsDiffOverSum; + var_wGwGSF_Endcap_[6] = std::log(std::max(0.01f, elecVars.chi2NormKF)); + var_wGwGSF_Endcap_[7] = std::min(elecDeltaPinPoutOverPin, 1.f); + var_wGwGSF_Endcap_[8] = std::min(elecEecalOverPout, 20.f); + var_wGwGSF_Endcap_[9] = elecVars.deltaEta; + var_wGwGSF_Endcap_[10] = elecVars.deltaPhi; + var_wGwGSF_Endcap_[11] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); + var_wGwGSF_Endcap_[12] = std::min(elecVars.mvaInHadEnergy, 20.f); + var_wGwGSF_Endcap_[13] = std::min(elecVars.mvaInDeltaEta, 0.1f); + var_wGwGSF_Endcap_[14] = tauVars.etaAtEcalEntrance; + var_wGwGSF_Endcap_[15] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_wGwGSF_Endcap_[16] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_wGwGSF_Endcap_[17] = std::log(std::max(1.f, tauVars.pt)); + var_wGwGSF_Endcap_[18] = tauVars.emFraction; + var_wGwGSF_Endcap_[19] = tauGammaMoms.signalPFGammaCandsIn; + var_wGwGSF_Endcap_[20] = tauGammaMoms.signalPFGammaCandsOut; + var_wGwGSF_Endcap_[21] = tauVars.leadPFChargedHadrHoP; + var_wGwGSF_Endcap_[22] = tauVars.leadPFChargedHadrEoP; + var_wGwGSF_Endcap_[23] = tauVars.visMassIn; + var_wGwGSF_Endcap_[24] = tauGammaMoms.gammaEtaMomIn; + var_wGwGSF_Endcap_[25] = tauGammaMoms.gammaEtaMomOut; + var_wGwGSF_Endcap_[26] = tauGammaMoms.gammaPhiMomIn; + var_wGwGSF_Endcap_[27] = tauGammaMoms.gammaPhiMomOut; + var_wGwGSF_Endcap_[28] = tauGammaMoms.gammaEnFracIn; + var_wGwGSF_Endcap_[29] = tauGammaMoms.gammaEnFracOut; + var_wGwGSF_Endcap_[30] = tauVars.dCrackEta; + mvaValue = mva_wGwGSF_EC_->GetClassifier(var_wGwGSF_Endcap_.data()); } } return mvaValue; } //// template -double AntiElectronIDMVA6::MVAValuePhase2(const TauVars& tauVars, +double AntiElectronIDMVA6::mvaValuePhase2(const TauVars& tauVars, const TauGammaMoms& tauGammaMoms, const ElecVars& elecVars) { if (!isInitialized_) { @@ -510,312 +491,312 @@ double AntiElectronIDMVA6::MVAValuePhase2(const TauVars& if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf < 0.5) { if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { - Var_NoEleMatch_woGwoGSF_Barrel_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_Barrel_[1] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_Barrel_[2] = tauVars.emFraction; - Var_NoEleMatch_woGwoGSF_Barrel_[3] = tauVars.leadPFChargedHadrHoP; - Var_NoEleMatch_woGwoGSF_Barrel_[4] = tauVars.leadPFChargedHadrEoP; - Var_NoEleMatch_woGwoGSF_Barrel_[5] = tauVars.visMassIn; - Var_NoEleMatch_woGwoGSF_Barrel_[6] = tauVars.dCrackEta; - Var_NoEleMatch_woGwoGSF_Barrel_[7] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_woGwoGSF_Barrel_[8] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - mvaValue = mva_NoEleMatch_woGwoGSF_BL_->GetClassifier(Var_NoEleMatch_woGwoGSF_Barrel_); + var_NoEleMatch_woGwoGSF_Barrel_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_Barrel_[1] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_Barrel_[2] = tauVars.emFraction; + var_NoEleMatch_woGwoGSF_Barrel_[3] = tauVars.leadPFChargedHadrHoP; + var_NoEleMatch_woGwoGSF_Barrel_[4] = tauVars.leadPFChargedHadrEoP; + var_NoEleMatch_woGwoGSF_Barrel_[5] = tauVars.visMassIn; + var_NoEleMatch_woGwoGSF_Barrel_[6] = tauVars.dCrackEta; + var_NoEleMatch_woGwoGSF_Barrel_[7] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_woGwoGSF_Barrel_[8] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_woGwoGSF_BL_->GetClassifier(var_NoEleMatch_woGwoGSF_Barrel_.data()); } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) { - Var_NoEleMatch_woGwoGSF_Endcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_Endcap_[1] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_Endcap_[2] = tauVars.visMassIn; - Var_NoEleMatch_woGwoGSF_Endcap_[3] = tauVars.dCrackEta; - Var_NoEleMatch_woGwoGSF_Endcap_[4] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_woGwoGSF_Endcap_[5] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - mvaValue = mva_NoEleMatch_woGwoGSF_EC_->GetClassifier(Var_NoEleMatch_woGwoGSF_Endcap_); + var_NoEleMatch_woGwoGSF_Endcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_Endcap_[1] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_Endcap_[2] = tauVars.visMassIn; + var_NoEleMatch_woGwoGSF_Endcap_[3] = tauVars.dCrackEta; + var_NoEleMatch_woGwoGSF_Endcap_[4] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_woGwoGSF_Endcap_[5] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_woGwoGSF_EC_->GetClassifier(var_NoEleMatch_woGwoGSF_Endcap_.data()); } else { - Var_NoEleMatch_woGwoGSF_VFEndcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_VFEndcap_[1] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_woGwoGSF_VFEndcap_[2] = tauVars.visMassIn; - Var_NoEleMatch_woGwoGSF_VFEndcap_[3] = tauVars.dCrackEta; - Var_NoEleMatch_woGwoGSF_VFEndcap_[4] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_woGwoGSF_VFEndcap_[5] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - mvaValue = mva_NoEleMatch_woGwoGSF_VFEC_->GetClassifier(Var_NoEleMatch_woGwoGSF_VFEndcap_); + var_NoEleMatch_woGwoGSF_VFEndcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_VFEndcap_[1] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_woGwoGSF_VFEndcap_[2] = tauVars.visMassIn; + var_NoEleMatch_woGwoGSF_VFEndcap_[3] = tauVars.dCrackEta; + var_NoEleMatch_woGwoGSF_VFEndcap_[4] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_woGwoGSF_VFEndcap_[5] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_woGwoGSF_VFEC_->GetClassifier(var_NoEleMatch_woGwoGSF_VFEndcap_.data()); } } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf < 0.5) { if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { - Var_NoEleMatch_wGwoGSF_Barrel_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_Barrel_[1] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_Barrel_[2] = tauVars.emFraction; - Var_NoEleMatch_wGwoGSF_Barrel_[3] = tauGammaMoms.signalPFGammaCandsIn; - Var_NoEleMatch_wGwoGSF_Barrel_[4] = tauGammaMoms.signalPFGammaCandsOut; - Var_NoEleMatch_wGwoGSF_Barrel_[5] = tauVars.leadPFChargedHadrHoP; - Var_NoEleMatch_wGwoGSF_Barrel_[6] = tauVars.leadPFChargedHadrEoP; - Var_NoEleMatch_wGwoGSF_Barrel_[7] = tauVars.visMassIn; - Var_NoEleMatch_wGwoGSF_Barrel_[7] = tauGammaMoms.gammaEtaMomIn; - Var_NoEleMatch_wGwoGSF_Barrel_[9] = tauGammaMoms.gammaEtaMomOut; - Var_NoEleMatch_wGwoGSF_Barrel_[10] = tauGammaMoms.gammaPhiMomIn; - Var_NoEleMatch_wGwoGSF_Barrel_[11] = tauGammaMoms.gammaPhiMomOut; - Var_NoEleMatch_wGwoGSF_Barrel_[12] = tauGammaMoms.gammaEnFracIn; - Var_NoEleMatch_wGwoGSF_Barrel_[13] = tauGammaMoms.gammaEnFracOut; - Var_NoEleMatch_wGwoGSF_Barrel_[14] = tauVars.dCrackEta; - Var_NoEleMatch_wGwoGSF_Barrel_[15] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_wGwoGSF_Barrel_[16] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - mvaValue = mva_NoEleMatch_wGwoGSF_BL_->GetClassifier(Var_NoEleMatch_wGwoGSF_Barrel_); + var_NoEleMatch_wGwoGSF_Barrel_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_Barrel_[1] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_Barrel_[2] = tauVars.emFraction; + var_NoEleMatch_wGwoGSF_Barrel_[3] = tauGammaMoms.signalPFGammaCandsIn; + var_NoEleMatch_wGwoGSF_Barrel_[4] = tauGammaMoms.signalPFGammaCandsOut; + var_NoEleMatch_wGwoGSF_Barrel_[5] = tauVars.leadPFChargedHadrHoP; + var_NoEleMatch_wGwoGSF_Barrel_[6] = tauVars.leadPFChargedHadrEoP; + var_NoEleMatch_wGwoGSF_Barrel_[7] = tauVars.visMassIn; + var_NoEleMatch_wGwoGSF_Barrel_[7] = tauGammaMoms.gammaEtaMomIn; + var_NoEleMatch_wGwoGSF_Barrel_[9] = tauGammaMoms.gammaEtaMomOut; + var_NoEleMatch_wGwoGSF_Barrel_[10] = tauGammaMoms.gammaPhiMomIn; + var_NoEleMatch_wGwoGSF_Barrel_[11] = tauGammaMoms.gammaPhiMomOut; + var_NoEleMatch_wGwoGSF_Barrel_[12] = tauGammaMoms.gammaEnFracIn; + var_NoEleMatch_wGwoGSF_Barrel_[13] = tauGammaMoms.gammaEnFracOut; + var_NoEleMatch_wGwoGSF_Barrel_[14] = tauVars.dCrackEta; + var_NoEleMatch_wGwoGSF_Barrel_[15] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_wGwoGSF_Barrel_[16] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_wGwoGSF_BL_->GetClassifier(var_NoEleMatch_wGwoGSF_Barrel_.data()); } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) { - Var_NoEleMatch_wGwoGSF_Endcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_Endcap_[1] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_Endcap_[2] = tauGammaMoms.signalPFGammaCandsIn; - Var_NoEleMatch_wGwoGSF_Endcap_[3] = tauGammaMoms.signalPFGammaCandsOut; - Var_NoEleMatch_wGwoGSF_Endcap_[4] = tauVars.visMassIn; - Var_NoEleMatch_wGwoGSF_Endcap_[5] = tauGammaMoms.gammaEtaMomIn; - Var_NoEleMatch_wGwoGSF_Endcap_[6] = tauGammaMoms.gammaEtaMomOut; - Var_NoEleMatch_wGwoGSF_Endcap_[7] = tauGammaMoms.gammaPhiMomIn; - Var_NoEleMatch_wGwoGSF_Endcap_[8] = tauGammaMoms.gammaPhiMomOut; - Var_NoEleMatch_wGwoGSF_Endcap_[9] = tauGammaMoms.gammaEnFracIn; - Var_NoEleMatch_wGwoGSF_Endcap_[10] = tauGammaMoms.gammaEnFracOut; - Var_NoEleMatch_wGwoGSF_Endcap_[11] = tauVars.dCrackEta; - Var_NoEleMatch_wGwoGSF_Endcap_[12] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_wGwoGSF_Endcap_[13] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - mvaValue = mva_NoEleMatch_wGwoGSF_EC_->GetClassifier(Var_NoEleMatch_wGwoGSF_Endcap_); + var_NoEleMatch_wGwoGSF_Endcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_Endcap_[1] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_Endcap_[2] = tauGammaMoms.signalPFGammaCandsIn; + var_NoEleMatch_wGwoGSF_Endcap_[3] = tauGammaMoms.signalPFGammaCandsOut; + var_NoEleMatch_wGwoGSF_Endcap_[4] = tauVars.visMassIn; + var_NoEleMatch_wGwoGSF_Endcap_[5] = tauGammaMoms.gammaEtaMomIn; + var_NoEleMatch_wGwoGSF_Endcap_[6] = tauGammaMoms.gammaEtaMomOut; + var_NoEleMatch_wGwoGSF_Endcap_[7] = tauGammaMoms.gammaPhiMomIn; + var_NoEleMatch_wGwoGSF_Endcap_[8] = tauGammaMoms.gammaPhiMomOut; + var_NoEleMatch_wGwoGSF_Endcap_[9] = tauGammaMoms.gammaEnFracIn; + var_NoEleMatch_wGwoGSF_Endcap_[10] = tauGammaMoms.gammaEnFracOut; + var_NoEleMatch_wGwoGSF_Endcap_[11] = tauVars.dCrackEta; + var_NoEleMatch_wGwoGSF_Endcap_[12] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_wGwoGSF_Endcap_[13] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_wGwoGSF_EC_->GetClassifier(var_NoEleMatch_wGwoGSF_Endcap_.data()); } else { - Var_NoEleMatch_wGwoGSF_VFEndcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_VFEndcap_[1] = std::log(std::max(1.f, tauVars.pt)); - Var_NoEleMatch_wGwoGSF_VFEndcap_[2] = tauGammaMoms.signalPFGammaCandsIn; - Var_NoEleMatch_wGwoGSF_VFEndcap_[3] = tauGammaMoms.signalPFGammaCandsOut; - Var_NoEleMatch_wGwoGSF_VFEndcap_[4] = tauVars.visMassIn; - Var_NoEleMatch_wGwoGSF_VFEndcap_[5] = tauGammaMoms.gammaEtaMomIn; - Var_NoEleMatch_wGwoGSF_VFEndcap_[6] = tauGammaMoms.gammaEtaMomOut; - Var_NoEleMatch_wGwoGSF_VFEndcap_[7] = tauGammaMoms.gammaPhiMomIn; - Var_NoEleMatch_wGwoGSF_VFEndcap_[8] = tauGammaMoms.gammaPhiMomOut; - Var_NoEleMatch_wGwoGSF_VFEndcap_[9] = tauGammaMoms.gammaEnFracIn; - Var_NoEleMatch_wGwoGSF_VFEndcap_[10] = tauGammaMoms.gammaEnFracOut; - Var_NoEleMatch_wGwoGSF_VFEndcap_[11] = tauVars.dCrackEta; - Var_NoEleMatch_wGwoGSF_VFEndcap_[12] = tauVars.etaAtEcalEntrance; - Var_NoEleMatch_wGwoGSF_VFEndcap_[13] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - mvaValue = mva_NoEleMatch_wGwoGSF_VFEC_->GetClassifier(Var_NoEleMatch_wGwoGSF_VFEndcap_); + var_NoEleMatch_wGwoGSF_VFEndcap_[0] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_VFEndcap_[1] = std::log(std::max(1.f, tauVars.pt)); + var_NoEleMatch_wGwoGSF_VFEndcap_[2] = tauGammaMoms.signalPFGammaCandsIn; + var_NoEleMatch_wGwoGSF_VFEndcap_[3] = tauGammaMoms.signalPFGammaCandsOut; + var_NoEleMatch_wGwoGSF_VFEndcap_[4] = tauVars.visMassIn; + var_NoEleMatch_wGwoGSF_VFEndcap_[5] = tauGammaMoms.gammaEtaMomIn; + var_NoEleMatch_wGwoGSF_VFEndcap_[6] = tauGammaMoms.gammaEtaMomOut; + var_NoEleMatch_wGwoGSF_VFEndcap_[7] = tauGammaMoms.gammaPhiMomIn; + var_NoEleMatch_wGwoGSF_VFEndcap_[8] = tauGammaMoms.gammaPhiMomOut; + var_NoEleMatch_wGwoGSF_VFEndcap_[9] = tauGammaMoms.gammaEnFracIn; + var_NoEleMatch_wGwoGSF_VFEndcap_[10] = tauGammaMoms.gammaEnFracOut; + var_NoEleMatch_wGwoGSF_VFEndcap_[11] = tauVars.dCrackEta; + var_NoEleMatch_wGwoGSF_VFEndcap_[12] = tauVars.etaAtEcalEntrance; + var_NoEleMatch_wGwoGSF_VFEndcap_[13] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + mvaValue = mva_NoEleMatch_wGwoGSF_VFEC_->GetClassifier(var_NoEleMatch_wGwoGSF_VFEndcap_.data()); } } else if (tauGammaMoms.signalPFGammaCandsIn == 0 && tauVars.hasGsf > 0.5) { if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { - Var_woGwGSF_Barrel_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); - Var_woGwGSF_Barrel_[1] = elecVars.gsfNumHits; - Var_woGwGSF_Barrel_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); - Var_woGwGSF_Barrel_[3] = elecVars.gsfTracklnPt; - Var_woGwGSF_Barrel_[4] = elecNumHitsDiffOverSum; - Var_woGwGSF_Barrel_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); - Var_woGwGSF_Barrel_[6] = std::min(elecDeltaPinPoutOverPin, 1.f); - Var_woGwGSF_Barrel_[7] = std::min(elecEecalOverPout, 20.f); - Var_woGwGSF_Barrel_[8] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); - Var_woGwGSF_Barrel_[9] = std::min(elecVars.mvaInHadEnergy, 20.f); - Var_woGwGSF_Barrel_[10] = std::min(elecVars.mvaInDeltaEta, 0.1f); - Var_woGwGSF_Barrel_[11] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_woGwGSF_Barrel_[12] = std::log(std::max(1.f, tauVars.pt)); - Var_woGwGSF_Barrel_[13] = tauVars.emFraction; - Var_woGwGSF_Barrel_[14] = tauVars.leadPFChargedHadrHoP; - Var_woGwGSF_Barrel_[15] = tauVars.leadPFChargedHadrEoP; - Var_woGwGSF_Barrel_[16] = tauVars.visMassIn; - Var_woGwGSF_Barrel_[17] = tauVars.dCrackEta; - Var_woGwGSF_Barrel_[18] = tauVars.etaAtEcalEntrance; - Var_woGwGSF_Barrel_[19] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_woGwGSF_Barrel_[20] = elecVars.deltaEta; - Var_woGwGSF_Barrel_[21] = elecVars.deltaPhi; - Var_woGwGSF_Barrel_[22] = elecVars.sigmaIEtaIEta5x5; - Var_woGwGSF_Barrel_[23] = elecVars.showerCircularity; - Var_woGwGSF_Barrel_[24] = elecVars.r9; - Var_woGwGSF_Barrel_[25] = elecVars.superClusterEtaWidth; - Var_woGwGSF_Barrel_[26] = elecVars.superClusterPhiWidth; - mvaValue = mva_woGwGSF_BL_->GetClassifier(Var_woGwGSF_Barrel_); + var_woGwGSF_Barrel_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + var_woGwGSF_Barrel_[1] = elecVars.gsfNumHits; + var_woGwGSF_Barrel_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + var_woGwGSF_Barrel_[3] = elecVars.gsfTracklnPt; + var_woGwGSF_Barrel_[4] = elecNumHitsDiffOverSum; + var_woGwGSF_Barrel_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + var_woGwGSF_Barrel_[6] = std::min(elecDeltaPinPoutOverPin, 1.f); + var_woGwGSF_Barrel_[7] = std::min(elecEecalOverPout, 20.f); + var_woGwGSF_Barrel_[8] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); + var_woGwGSF_Barrel_[9] = std::min(elecVars.mvaInHadEnergy, 20.f); + var_woGwGSF_Barrel_[10] = std::min(elecVars.mvaInDeltaEta, 0.1f); + var_woGwGSF_Barrel_[11] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_woGwGSF_Barrel_[12] = std::log(std::max(1.f, tauVars.pt)); + var_woGwGSF_Barrel_[13] = tauVars.emFraction; + var_woGwGSF_Barrel_[14] = tauVars.leadPFChargedHadrHoP; + var_woGwGSF_Barrel_[15] = tauVars.leadPFChargedHadrEoP; + var_woGwGSF_Barrel_[16] = tauVars.visMassIn; + var_woGwGSF_Barrel_[17] = tauVars.dCrackEta; + var_woGwGSF_Barrel_[18] = tauVars.etaAtEcalEntrance; + var_woGwGSF_Barrel_[19] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_woGwGSF_Barrel_[20] = elecVars.deltaEta; + var_woGwGSF_Barrel_[21] = elecVars.deltaPhi; + var_woGwGSF_Barrel_[22] = elecVars.sigmaIEtaIEta5x5; + var_woGwGSF_Barrel_[23] = elecVars.showerCircularity; + var_woGwGSF_Barrel_[24] = elecVars.r9; + var_woGwGSF_Barrel_[25] = elecVars.superClusterEtaWidth; + var_woGwGSF_Barrel_[26] = elecVars.superClusterPhiWidth; + mvaValue = mva_woGwGSF_BL_->GetClassifier(var_woGwGSF_Barrel_.data()); } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) { - Var_woGwGSF_Endcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); - Var_woGwGSF_Endcap_[1] = elecVars.gsfNumHits; - Var_woGwGSF_Endcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); - Var_woGwGSF_Endcap_[3] = elecVars.gsfTracklnPt; - Var_woGwGSF_Endcap_[4] = elecNumHitsDiffOverSum; - Var_woGwGSF_Endcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); - Var_woGwGSF_Endcap_[6] = elecVars.eEcal; - Var_woGwGSF_Endcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_woGwGSF_Endcap_[8] = std::log(std::max(1.f, tauVars.pt)); - Var_woGwGSF_Endcap_[9] = tauVars.visMassIn; - Var_woGwGSF_Endcap_[10] = tauVars.dCrackEta; - Var_woGwGSF_Endcap_[11] = tauVars.etaAtEcalEntrance; - Var_woGwGSF_Endcap_[12] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_woGwGSF_Endcap_[13] = elecVars.hgcalSigmaUU; - Var_woGwGSF_Endcap_[14] = elecVars.hgcalSigmaVV; - Var_woGwGSF_Endcap_[15] = elecVars.hgcalSigmaEE; - Var_woGwGSF_Endcap_[16] = elecVars.hgcalSigmaPP; - Var_woGwGSF_Endcap_[17] = elecVars.hgcalNLayers; - Var_woGwGSF_Endcap_[18] = elecVars.hgcalLastLayer; - Var_woGwGSF_Endcap_[19] = elecVars.hgcalLayerEfrac10; - Var_woGwGSF_Endcap_[20] = elecVars.hgcalLayerEfrac90; - Var_woGwGSF_Endcap_[21] = elecVars.hgcalEcEnergyEE; - Var_woGwGSF_Endcap_[22] = elecVars.hgcalEcEnergyFH; - Var_woGwGSF_Endcap_[23] = elecVars.hgcalMeasuredDepth; - Var_woGwGSF_Endcap_[24] = elecVars.hgcalExpectedDepth; - Var_woGwGSF_Endcap_[25] = elecVars.hgcalDepthCompatibility; - Var_woGwGSF_Endcap_[26] = elecVars.deltaEta; - Var_woGwGSF_Endcap_[27] = elecVars.deltaPhi; - Var_woGwGSF_Endcap_[28] = elecVars.eSeedClusterOverPout; - Var_woGwGSF_Endcap_[29] = elecVars.superClusterEtaWidth; - Var_woGwGSF_Endcap_[30] = elecVars.superClusterPhiWidth; - mvaValue = mva_woGwGSF_EC_->GetClassifier(Var_woGwGSF_Endcap_); + var_woGwGSF_Endcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + var_woGwGSF_Endcap_[1] = elecVars.gsfNumHits; + var_woGwGSF_Endcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + var_woGwGSF_Endcap_[3] = elecVars.gsfTracklnPt; + var_woGwGSF_Endcap_[4] = elecNumHitsDiffOverSum; + var_woGwGSF_Endcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + var_woGwGSF_Endcap_[6] = elecVars.eEcal; + var_woGwGSF_Endcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_woGwGSF_Endcap_[8] = std::log(std::max(1.f, tauVars.pt)); + var_woGwGSF_Endcap_[9] = tauVars.visMassIn; + var_woGwGSF_Endcap_[10] = tauVars.dCrackEta; + var_woGwGSF_Endcap_[11] = tauVars.etaAtEcalEntrance; + var_woGwGSF_Endcap_[12] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_woGwGSF_Endcap_[13] = elecVars.hgcalSigmaUU; + var_woGwGSF_Endcap_[14] = elecVars.hgcalSigmaVV; + var_woGwGSF_Endcap_[15] = elecVars.hgcalSigmaEE; + var_woGwGSF_Endcap_[16] = elecVars.hgcalSigmaPP; + var_woGwGSF_Endcap_[17] = elecVars.hgcalNLayers; + var_woGwGSF_Endcap_[18] = elecVars.hgcalLastLayer; + var_woGwGSF_Endcap_[19] = elecVars.hgcalLayerEfrac10; + var_woGwGSF_Endcap_[20] = elecVars.hgcalLayerEfrac90; + var_woGwGSF_Endcap_[21] = elecVars.hgcalEcEnergyEE; + var_woGwGSF_Endcap_[22] = elecVars.hgcalEcEnergyFH; + var_woGwGSF_Endcap_[23] = elecVars.hgcalMeasuredDepth; + var_woGwGSF_Endcap_[24] = elecVars.hgcalExpectedDepth; + var_woGwGSF_Endcap_[25] = elecVars.hgcalDepthCompatibility; + var_woGwGSF_Endcap_[26] = elecVars.deltaEta; + var_woGwGSF_Endcap_[27] = elecVars.deltaPhi; + var_woGwGSF_Endcap_[28] = elecVars.eSeedClusterOverPout; + var_woGwGSF_Endcap_[29] = elecVars.superClusterEtaWidth; + var_woGwGSF_Endcap_[30] = elecVars.superClusterPhiWidth; + mvaValue = mva_woGwGSF_EC_->GetClassifier(var_woGwGSF_Endcap_.data()); } else { - Var_woGwGSF_VFEndcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); - Var_woGwGSF_VFEndcap_[1] = elecVars.gsfNumHits; - Var_woGwGSF_VFEndcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); - Var_woGwGSF_VFEndcap_[3] = elecVars.gsfTracklnPt; - Var_woGwGSF_VFEndcap_[4] = elecNumHitsDiffOverSum; - Var_woGwGSF_VFEndcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); - Var_woGwGSF_VFEndcap_[6] = elecVars.eEcal; - Var_woGwGSF_VFEndcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_woGwGSF_VFEndcap_[8] = std::log(std::max(1.f, tauVars.pt)); - Var_woGwGSF_VFEndcap_[9] = tauVars.visMassIn; - Var_woGwGSF_VFEndcap_[10] = tauVars.dCrackEta; - Var_woGwGSF_VFEndcap_[11] = tauVars.etaAtEcalEntrance; - Var_woGwGSF_VFEndcap_[12] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_woGwGSF_VFEndcap_[13] = elecVars.hgcalSigmaUU; - Var_woGwGSF_VFEndcap_[14] = elecVars.hgcalSigmaVV; - Var_woGwGSF_VFEndcap_[15] = elecVars.hgcalSigmaEE; - Var_woGwGSF_VFEndcap_[16] = elecVars.hgcalSigmaPP; - Var_woGwGSF_VFEndcap_[17] = elecVars.hgcalNLayers; - Var_woGwGSF_VFEndcap_[18] = elecVars.hgcalLastLayer; - Var_woGwGSF_VFEndcap_[19] = elecVars.hgcalLayerEfrac10; - Var_woGwGSF_VFEndcap_[20] = elecVars.hgcalLayerEfrac90; - Var_woGwGSF_VFEndcap_[21] = elecVars.hgcalEcEnergyEE; - Var_woGwGSF_VFEndcap_[22] = elecVars.hgcalEcEnergyFH; - Var_woGwGSF_VFEndcap_[23] = elecVars.hgcalMeasuredDepth; - Var_woGwGSF_VFEndcap_[24] = elecVars.hgcalExpectedDepth; - Var_woGwGSF_VFEndcap_[25] = elecVars.hgcalExpectedSigma; - Var_woGwGSF_VFEndcap_[26] = elecVars.hgcalDepthCompatibility; - Var_woGwGSF_VFEndcap_[27] = elecVars.deltaEta; - Var_woGwGSF_VFEndcap_[28] = elecVars.deltaPhi; - Var_woGwGSF_VFEndcap_[29] = elecVars.eSeedClusterOverPout; - Var_woGwGSF_VFEndcap_[30] = elecVars.superClusterEtaWidth; - Var_woGwGSF_VFEndcap_[31] = elecVars.superClusterPhiWidth; - mvaValue = mva_woGwGSF_VFEC_->GetClassifier(Var_woGwGSF_VFEndcap_); + var_woGwGSF_VFEndcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + var_woGwGSF_VFEndcap_[1] = elecVars.gsfNumHits; + var_woGwGSF_VFEndcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + var_woGwGSF_VFEndcap_[3] = elecVars.gsfTracklnPt; + var_woGwGSF_VFEndcap_[4] = elecNumHitsDiffOverSum; + var_woGwGSF_VFEndcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + var_woGwGSF_VFEndcap_[6] = elecVars.eEcal; + var_woGwGSF_VFEndcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_woGwGSF_VFEndcap_[8] = std::log(std::max(1.f, tauVars.pt)); + var_woGwGSF_VFEndcap_[9] = tauVars.visMassIn; + var_woGwGSF_VFEndcap_[10] = tauVars.dCrackEta; + var_woGwGSF_VFEndcap_[11] = tauVars.etaAtEcalEntrance; + var_woGwGSF_VFEndcap_[12] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_woGwGSF_VFEndcap_[13] = elecVars.hgcalSigmaUU; + var_woGwGSF_VFEndcap_[14] = elecVars.hgcalSigmaVV; + var_woGwGSF_VFEndcap_[15] = elecVars.hgcalSigmaEE; + var_woGwGSF_VFEndcap_[16] = elecVars.hgcalSigmaPP; + var_woGwGSF_VFEndcap_[17] = elecVars.hgcalNLayers; + var_woGwGSF_VFEndcap_[18] = elecVars.hgcalLastLayer; + var_woGwGSF_VFEndcap_[19] = elecVars.hgcalLayerEfrac10; + var_woGwGSF_VFEndcap_[20] = elecVars.hgcalLayerEfrac90; + var_woGwGSF_VFEndcap_[21] = elecVars.hgcalEcEnergyEE; + var_woGwGSF_VFEndcap_[22] = elecVars.hgcalEcEnergyFH; + var_woGwGSF_VFEndcap_[23] = elecVars.hgcalMeasuredDepth; + var_woGwGSF_VFEndcap_[24] = elecVars.hgcalExpectedDepth; + var_woGwGSF_VFEndcap_[25] = elecVars.hgcalExpectedSigma; + var_woGwGSF_VFEndcap_[26] = elecVars.hgcalDepthCompatibility; + var_woGwGSF_VFEndcap_[27] = elecVars.deltaEta; + var_woGwGSF_VFEndcap_[28] = elecVars.deltaPhi; + var_woGwGSF_VFEndcap_[29] = elecVars.eSeedClusterOverPout; + var_woGwGSF_VFEndcap_[30] = elecVars.superClusterEtaWidth; + var_woGwGSF_VFEndcap_[31] = elecVars.superClusterPhiWidth; + mvaValue = mva_woGwGSF_VFEC_->GetClassifier(var_woGwGSF_VFEndcap_.data()); } } else if (tauGammaMoms.signalPFGammaCandsIn > 0 && tauVars.hasGsf > 0.5) { if (std::abs(tauVars.etaAtEcalEntrance) < ecalBarrelEndcapEtaBorder_) { - Var_wGwGSF_Barrel_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); - Var_wGwGSF_Barrel_[1] = elecVars.gsfNumHits; - Var_wGwGSF_Barrel_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); - Var_wGwGSF_Barrel_[3] = elecVars.gsfTracklnPt; - Var_wGwGSF_Barrel_[4] = elecNumHitsDiffOverSum; - Var_wGwGSF_Barrel_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); - Var_wGwGSF_Barrel_[6] = std::min(elecDeltaPinPoutOverPin, 1.f); - Var_wGwGSF_Barrel_[7] = std::min(elecEecalOverPout, 20.f); - Var_wGwGSF_Barrel_[8] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); - Var_wGwGSF_Barrel_[9] = std::min(elecVars.mvaInHadEnergy, 20.f); - Var_wGwGSF_Barrel_[10] = std::min(elecVars.mvaInDeltaEta, 0.1f); - Var_wGwGSF_Barrel_[11] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_wGwGSF_Barrel_[12] = std::log(std::max(1.f, tauVars.pt)); - Var_wGwGSF_Barrel_[13] = tauVars.emFraction; - Var_wGwGSF_Barrel_[14] = tauGammaMoms.signalPFGammaCandsIn; - Var_wGwGSF_Barrel_[15] = tauGammaMoms.signalPFGammaCandsOut; - Var_wGwGSF_Barrel_[16] = tauVars.leadPFChargedHadrHoP; - Var_wGwGSF_Barrel_[17] = tauVars.leadPFChargedHadrEoP; - Var_wGwGSF_Barrel_[18] = tauVars.visMassIn; - Var_wGwGSF_Barrel_[19] = tauGammaMoms.gammaEtaMomIn; - Var_wGwGSF_Barrel_[20] = tauGammaMoms.gammaEtaMomOut; - Var_wGwGSF_Barrel_[21] = tauGammaMoms.gammaPhiMomIn; - Var_wGwGSF_Barrel_[22] = tauGammaMoms.gammaPhiMomOut; - Var_wGwGSF_Barrel_[23] = tauGammaMoms.gammaEnFracIn; - Var_wGwGSF_Barrel_[24] = tauGammaMoms.gammaEnFracOut; - Var_wGwGSF_Barrel_[25] = tauVars.dCrackEta; - Var_wGwGSF_Barrel_[26] = tauVars.etaAtEcalEntrance; - Var_wGwGSF_Barrel_[27] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_wGwGSF_Barrel_[28] = elecVars.deltaEta; - Var_wGwGSF_Barrel_[29] = elecVars.deltaPhi; - Var_wGwGSF_Barrel_[30] = elecVars.sigmaIPhiIPhi5x5; - Var_wGwGSF_Barrel_[31] = elecVars.sigmaIEtaIEta5x5; - Var_wGwGSF_Barrel_[32] = elecVars.showerCircularity; - Var_wGwGSF_Barrel_[33] = elecVars.eSeedClusterOverPout; - Var_wGwGSF_Barrel_[34] = elecVars.superClusterEtaWidth; - Var_wGwGSF_Barrel_[35] = elecVars.superClusterPhiWidth; - mvaValue = mva_wGwGSF_BL_->GetClassifier(Var_wGwGSF_Barrel_); + var_wGwGSF_Barrel_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + var_wGwGSF_Barrel_[1] = elecVars.gsfNumHits; + var_wGwGSF_Barrel_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + var_wGwGSF_Barrel_[3] = elecVars.gsfTracklnPt; + var_wGwGSF_Barrel_[4] = elecNumHitsDiffOverSum; + var_wGwGSF_Barrel_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + var_wGwGSF_Barrel_[6] = std::min(elecDeltaPinPoutOverPin, 1.f); + var_wGwGSF_Barrel_[7] = std::min(elecEecalOverPout, 20.f); + var_wGwGSF_Barrel_[8] = std::min(elecVars.mvaInSigmaEtaEta, 0.01f); + var_wGwGSF_Barrel_[9] = std::min(elecVars.mvaInHadEnergy, 20.f); + var_wGwGSF_Barrel_[10] = std::min(elecVars.mvaInDeltaEta, 0.1f); + var_wGwGSF_Barrel_[11] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_wGwGSF_Barrel_[12] = std::log(std::max(1.f, tauVars.pt)); + var_wGwGSF_Barrel_[13] = tauVars.emFraction; + var_wGwGSF_Barrel_[14] = tauGammaMoms.signalPFGammaCandsIn; + var_wGwGSF_Barrel_[15] = tauGammaMoms.signalPFGammaCandsOut; + var_wGwGSF_Barrel_[16] = tauVars.leadPFChargedHadrHoP; + var_wGwGSF_Barrel_[17] = tauVars.leadPFChargedHadrEoP; + var_wGwGSF_Barrel_[18] = tauVars.visMassIn; + var_wGwGSF_Barrel_[19] = tauGammaMoms.gammaEtaMomIn; + var_wGwGSF_Barrel_[20] = tauGammaMoms.gammaEtaMomOut; + var_wGwGSF_Barrel_[21] = tauGammaMoms.gammaPhiMomIn; + var_wGwGSF_Barrel_[22] = tauGammaMoms.gammaPhiMomOut; + var_wGwGSF_Barrel_[23] = tauGammaMoms.gammaEnFracIn; + var_wGwGSF_Barrel_[24] = tauGammaMoms.gammaEnFracOut; + var_wGwGSF_Barrel_[25] = tauVars.dCrackEta; + var_wGwGSF_Barrel_[26] = tauVars.etaAtEcalEntrance; + var_wGwGSF_Barrel_[27] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_wGwGSF_Barrel_[28] = elecVars.deltaEta; + var_wGwGSF_Barrel_[29] = elecVars.deltaPhi; + var_wGwGSF_Barrel_[30] = elecVars.sigmaIPhiIPhi5x5; + var_wGwGSF_Barrel_[31] = elecVars.sigmaIEtaIEta5x5; + var_wGwGSF_Barrel_[32] = elecVars.showerCircularity; + var_wGwGSF_Barrel_[33] = elecVars.eSeedClusterOverPout; + var_wGwGSF_Barrel_[34] = elecVars.superClusterEtaWidth; + var_wGwGSF_Barrel_[35] = elecVars.superClusterPhiWidth; + mvaValue = mva_wGwGSF_BL_->GetClassifier(var_wGwGSF_Barrel_.data()); } else if (std::abs(tauVars.etaAtEcalEntrance) < ecalEndcapVFEndcapEtaBorder_) { - Var_wGwGSF_Endcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); - Var_wGwGSF_Endcap_[1] = elecVars.gsfNumHits; - Var_wGwGSF_Endcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); - Var_wGwGSF_Endcap_[3] = elecVars.gsfTracklnPt; - Var_wGwGSF_Endcap_[4] = elecNumHitsDiffOverSum; - Var_wGwGSF_Endcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); - Var_wGwGSF_Endcap_[6] = elecVars.eEcal; - Var_wGwGSF_Endcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_wGwGSF_Endcap_[8] = std::log(std::max(1.f, tauVars.pt)); - Var_wGwGSF_Endcap_[9] = tauGammaMoms.signalPFGammaCandsIn; - Var_wGwGSF_Endcap_[10] = tauGammaMoms.signalPFGammaCandsOut; - Var_wGwGSF_Endcap_[11] = tauVars.visMassIn; - Var_wGwGSF_Endcap_[12] = tauGammaMoms.gammaEtaMomIn; - Var_wGwGSF_Endcap_[13] = tauGammaMoms.gammaEtaMomOut; - Var_wGwGSF_Endcap_[14] = tauGammaMoms.gammaPhiMomIn; - Var_wGwGSF_Endcap_[15] = tauGammaMoms.gammaPhiMomOut; - Var_wGwGSF_Endcap_[16] = tauGammaMoms.gammaEnFracIn; - Var_wGwGSF_Endcap_[17] = tauGammaMoms.gammaEnFracOut; - Var_wGwGSF_Endcap_[18] = tauVars.dCrackEta; - Var_wGwGSF_Endcap_[19] = tauVars.etaAtEcalEntrance; - Var_wGwGSF_Endcap_[20] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_wGwGSF_Endcap_[21] = elecVars.hgcalSigmaVV; - Var_wGwGSF_Endcap_[22] = elecVars.hgcalSigmaEE; - Var_wGwGSF_Endcap_[23] = elecVars.hgcalSigmaPP; - Var_wGwGSF_Endcap_[24] = elecVars.hgcalNLayers; - Var_wGwGSF_Endcap_[25] = elecVars.hgcalFirstLayer; - Var_wGwGSF_Endcap_[26] = elecVars.hgcalLastLayer; - Var_wGwGSF_Endcap_[27] = elecVars.hgcalLayerEfrac10; - Var_wGwGSF_Endcap_[28] = elecVars.hgcalLayerEfrac90; - Var_wGwGSF_Endcap_[29] = elecVars.hgcalEcEnergyEE; - Var_wGwGSF_Endcap_[30] = elecVars.hgcalEcEnergyFH; - Var_wGwGSF_Endcap_[31] = elecVars.hgcalMeasuredDepth; - Var_wGwGSF_Endcap_[32] = elecVars.hgcalExpectedDepth; - Var_wGwGSF_Endcap_[33] = elecVars.deltaEta; - Var_wGwGSF_Endcap_[34] = elecVars.deltaPhi; - Var_wGwGSF_Endcap_[35] = elecVars.eSeedClusterOverPout; - Var_wGwGSF_Endcap_[36] = elecVars.superClusterEtaWidth; - Var_wGwGSF_Endcap_[37] = elecVars.superClusterPhiWidth; - mvaValue = mva_wGwGSF_EC_->GetClassifier(Var_wGwGSF_Endcap_); + var_wGwGSF_Endcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + var_wGwGSF_Endcap_[1] = elecVars.gsfNumHits; + var_wGwGSF_Endcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + var_wGwGSF_Endcap_[3] = elecVars.gsfTracklnPt; + var_wGwGSF_Endcap_[4] = elecNumHitsDiffOverSum; + var_wGwGSF_Endcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + var_wGwGSF_Endcap_[6] = elecVars.eEcal; + var_wGwGSF_Endcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_wGwGSF_Endcap_[8] = std::log(std::max(1.f, tauVars.pt)); + var_wGwGSF_Endcap_[9] = tauGammaMoms.signalPFGammaCandsIn; + var_wGwGSF_Endcap_[10] = tauGammaMoms.signalPFGammaCandsOut; + var_wGwGSF_Endcap_[11] = tauVars.visMassIn; + var_wGwGSF_Endcap_[12] = tauGammaMoms.gammaEtaMomIn; + var_wGwGSF_Endcap_[13] = tauGammaMoms.gammaEtaMomOut; + var_wGwGSF_Endcap_[14] = tauGammaMoms.gammaPhiMomIn; + var_wGwGSF_Endcap_[15] = tauGammaMoms.gammaPhiMomOut; + var_wGwGSF_Endcap_[16] = tauGammaMoms.gammaEnFracIn; + var_wGwGSF_Endcap_[17] = tauGammaMoms.gammaEnFracOut; + var_wGwGSF_Endcap_[18] = tauVars.dCrackEta; + var_wGwGSF_Endcap_[19] = tauVars.etaAtEcalEntrance; + var_wGwGSF_Endcap_[20] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_wGwGSF_Endcap_[21] = elecVars.hgcalSigmaVV; + var_wGwGSF_Endcap_[22] = elecVars.hgcalSigmaEE; + var_wGwGSF_Endcap_[23] = elecVars.hgcalSigmaPP; + var_wGwGSF_Endcap_[24] = elecVars.hgcalNLayers; + var_wGwGSF_Endcap_[25] = elecVars.hgcalFirstLayer; + var_wGwGSF_Endcap_[26] = elecVars.hgcalLastLayer; + var_wGwGSF_Endcap_[27] = elecVars.hgcalLayerEfrac10; + var_wGwGSF_Endcap_[28] = elecVars.hgcalLayerEfrac90; + var_wGwGSF_Endcap_[29] = elecVars.hgcalEcEnergyEE; + var_wGwGSF_Endcap_[30] = elecVars.hgcalEcEnergyFH; + var_wGwGSF_Endcap_[31] = elecVars.hgcalMeasuredDepth; + var_wGwGSF_Endcap_[32] = elecVars.hgcalExpectedDepth; + var_wGwGSF_Endcap_[33] = elecVars.deltaEta; + var_wGwGSF_Endcap_[34] = elecVars.deltaPhi; + var_wGwGSF_Endcap_[35] = elecVars.eSeedClusterOverPout; + var_wGwGSF_Endcap_[36] = elecVars.superClusterEtaWidth; + var_wGwGSF_Endcap_[37] = elecVars.superClusterPhiWidth; + mvaValue = mva_wGwGSF_EC_->GetClassifier(var_wGwGSF_Endcap_.data()); } else { - Var_wGwGSF_VFEndcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); - Var_wGwGSF_VFEndcap_[1] = elecVars.gsfNumHits; - Var_wGwGSF_VFEndcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); - Var_wGwGSF_VFEndcap_[3] = elecVars.gsfTracklnPt; - Var_wGwGSF_VFEndcap_[4] = elecNumHitsDiffOverSum; - Var_wGwGSF_VFEndcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); - Var_wGwGSF_VFEndcap_[6] = elecVars.eEcal; - Var_wGwGSF_VFEndcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); - Var_wGwGSF_VFEndcap_[8] = std::log(std::max(1.f, tauVars.pt)); - Var_wGwGSF_VFEndcap_[9] = tauGammaMoms.signalPFGammaCandsIn; - Var_wGwGSF_VFEndcap_[10] = tauGammaMoms.signalPFGammaCandsOut; - Var_wGwGSF_VFEndcap_[11] = tauVars.visMassIn; - Var_wGwGSF_VFEndcap_[12] = tauGammaMoms.gammaEtaMomIn; - Var_wGwGSF_VFEndcap_[13] = tauGammaMoms.gammaEtaMomOut; - Var_wGwGSF_VFEndcap_[14] = tauGammaMoms.gammaPhiMomIn; - Var_wGwGSF_VFEndcap_[15] = tauGammaMoms.gammaPhiMomOut; - Var_wGwGSF_VFEndcap_[16] = tauGammaMoms.gammaEnFracIn; - Var_wGwGSF_VFEndcap_[17] = tauGammaMoms.gammaEnFracOut; - Var_wGwGSF_VFEndcap_[18] = tauVars.dCrackEta; - Var_wGwGSF_VFEndcap_[19] = tauVars.etaAtEcalEntrance; - Var_wGwGSF_VFEndcap_[20] = tauVars.leadChargedPFCandEtaAtEcalEntrance; - Var_wGwGSF_VFEndcap_[21] = elecVars.hgcalSigmaUU; - Var_wGwGSF_VFEndcap_[22] = elecVars.hgcalSigmaVV; - Var_wGwGSF_VFEndcap_[23] = elecVars.hgcalSigmaEE; - Var_wGwGSF_VFEndcap_[24] = elecVars.hgcalSigmaPP; - Var_wGwGSF_VFEndcap_[25] = elecVars.hgcalNLayers; - Var_wGwGSF_VFEndcap_[26] = elecVars.hgcalLastLayer; - Var_wGwGSF_VFEndcap_[27] = elecVars.hgcalLayerEfrac10; - Var_wGwGSF_VFEndcap_[28] = elecVars.hgcalLayerEfrac90; - Var_wGwGSF_VFEndcap_[29] = elecVars.hgcalEcEnergyEE; - Var_wGwGSF_VFEndcap_[30] = elecVars.hgcalEcEnergyFH; - Var_wGwGSF_VFEndcap_[31] = elecVars.hgcalMeasuredDepth; - Var_wGwGSF_VFEndcap_[32] = elecVars.hgcalExpectedDepth; - Var_wGwGSF_VFEndcap_[33] = elecVars.hgcalExpectedSigma; - Var_wGwGSF_VFEndcap_[34] = elecVars.hgcalDepthCompatibility; - Var_wGwGSF_VFEndcap_[35] = elecVars.deltaEta; - Var_wGwGSF_VFEndcap_[36] = elecVars.deltaPhi; - Var_wGwGSF_VFEndcap_[37] = elecVars.eSeedClusterOverPout; - Var_wGwGSF_VFEndcap_[38] = elecVars.superClusterEtaWidth; - Var_wGwGSF_VFEndcap_[39] = elecVars.superClusterPhiWidth; - mvaValue = mva_wGwGSF_VFEC_->GetClassifier(Var_wGwGSF_VFEndcap_); + var_wGwGSF_VFEndcap_[0] = std::log(std::max(0.1f, elecVars.chi2NormGSF)); + var_wGwGSF_VFEndcap_[1] = elecVars.gsfNumHits; + var_wGwGSF_VFEndcap_[2] = std::log(std::max(0.1f, elecVars.gsfTrackResol)); + var_wGwGSF_VFEndcap_[3] = elecVars.gsfTracklnPt; + var_wGwGSF_VFEndcap_[4] = elecNumHitsDiffOverSum; + var_wGwGSF_VFEndcap_[5] = std::log(std::max(0.1f, elecVars.chi2NormKF)); + var_wGwGSF_VFEndcap_[6] = elecVars.eEcal; + var_wGwGSF_VFEndcap_[7] = std::min(2.f, tauVars.leadChargedPFCandPt / std::max(1.f, tauVars.pt)); + var_wGwGSF_VFEndcap_[8] = std::log(std::max(1.f, tauVars.pt)); + var_wGwGSF_VFEndcap_[9] = tauGammaMoms.signalPFGammaCandsIn; + var_wGwGSF_VFEndcap_[10] = tauGammaMoms.signalPFGammaCandsOut; + var_wGwGSF_VFEndcap_[11] = tauVars.visMassIn; + var_wGwGSF_VFEndcap_[12] = tauGammaMoms.gammaEtaMomIn; + var_wGwGSF_VFEndcap_[13] = tauGammaMoms.gammaEtaMomOut; + var_wGwGSF_VFEndcap_[14] = tauGammaMoms.gammaPhiMomIn; + var_wGwGSF_VFEndcap_[15] = tauGammaMoms.gammaPhiMomOut; + var_wGwGSF_VFEndcap_[16] = tauGammaMoms.gammaEnFracIn; + var_wGwGSF_VFEndcap_[17] = tauGammaMoms.gammaEnFracOut; + var_wGwGSF_VFEndcap_[18] = tauVars.dCrackEta; + var_wGwGSF_VFEndcap_[19] = tauVars.etaAtEcalEntrance; + var_wGwGSF_VFEndcap_[20] = tauVars.leadChargedPFCandEtaAtEcalEntrance; + var_wGwGSF_VFEndcap_[21] = elecVars.hgcalSigmaUU; + var_wGwGSF_VFEndcap_[22] = elecVars.hgcalSigmaVV; + var_wGwGSF_VFEndcap_[23] = elecVars.hgcalSigmaEE; + var_wGwGSF_VFEndcap_[24] = elecVars.hgcalSigmaPP; + var_wGwGSF_VFEndcap_[25] = elecVars.hgcalNLayers; + var_wGwGSF_VFEndcap_[26] = elecVars.hgcalLastLayer; + var_wGwGSF_VFEndcap_[27] = elecVars.hgcalLayerEfrac10; + var_wGwGSF_VFEndcap_[28] = elecVars.hgcalLayerEfrac90; + var_wGwGSF_VFEndcap_[29] = elecVars.hgcalEcEnergyEE; + var_wGwGSF_VFEndcap_[30] = elecVars.hgcalEcEnergyFH; + var_wGwGSF_VFEndcap_[31] = elecVars.hgcalMeasuredDepth; + var_wGwGSF_VFEndcap_[32] = elecVars.hgcalExpectedDepth; + var_wGwGSF_VFEndcap_[33] = elecVars.hgcalExpectedSigma; + var_wGwGSF_VFEndcap_[34] = elecVars.hgcalDepthCompatibility; + var_wGwGSF_VFEndcap_[35] = elecVars.deltaEta; + var_wGwGSF_VFEndcap_[36] = elecVars.deltaPhi; + var_wGwGSF_VFEndcap_[37] = elecVars.eSeedClusterOverPout; + var_wGwGSF_VFEndcap_[38] = elecVars.superClusterEtaWidth; + var_wGwGSF_VFEndcap_[39] = elecVars.superClusterPhiWidth; + mvaValue = mva_wGwGSF_VFEC_->GetClassifier(var_wGwGSF_VFEndcap_.data()); } } return mvaValue; } //// template -double AntiElectronIDMVA6::MVAValue(const TauType& theTau, const ElectronRef& theEleRef) +double AntiElectronIDMVA6::mvaValue(const TauType& theTau, const ElectronRef& theEleRef) { // === tau variables === @@ -825,11 +806,11 @@ double AntiElectronIDMVA6::MVAValue(const TauType& theTau // === electron variables === ElecVars elecVars = AntiElectronIDMVA6::getElecVars(theEleRef); - return MVAValue(tauVars, tauGammaVecs, elecVars); + return mvaValue(tauVars, tauGammaVecs, elecVars); } template -double AntiElectronIDMVA6::MVAValue(const TauType& theTau) { +double AntiElectronIDMVA6::mvaValue(const TauType& theTau) { // === tau variables === TauVars tauVars = AntiElectronIDMVA6::getTauVars(theTau); TauGammaVecs tauGammaVecs = AntiElectronIDMVA6::getTauGammaVecs(theTau); @@ -838,7 +819,7 @@ double AntiElectronIDMVA6::MVAValue(const TauType& theTau ElecVars elecVars; elecVars.eta = 9.9; // Dummy value used in MVA training - return MVAValue(tauVars, tauGammaVecs, elecVars); + return mvaValue(tauVars, tauGammaVecs, elecVars); } template @@ -1328,8 +1309,6 @@ void AntiElectronIDMVA6::getElecVarsHGCalTypeSpecific( elecVars.hgcalExpectedDepth = (*electronIds_.at("hgcElectronID:expectedDepth"))[theEleRef]; elecVars.hgcalExpectedSigma = (*electronIds_.at("hgcElectronID:expectedSigma"))[theEleRef]; elecVars.hgcalDepthCompatibility = (*electronIds_.at("hgcElectronID:depthCompatibility"))[theEleRef]; - - return; } // pat::Electron @@ -1355,8 +1334,6 @@ void AntiElectronIDMVA6::getElecVarsHGCalTypeSpecific( elecVars.hgcalExpectedDepth = theEleRef->userFloat("hgcElectronID:expectedDepth"); elecVars.hgcalExpectedSigma = theEleRef->userFloat("hgcElectronID:expectedSigma"); elecVars.hgcalDepthCompatibility = theEleRef->userFloat("hgcElectronID:depthCompatibility"); - - return; } // compile desired types and make available to linker diff --git a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc index c0125b91ea450..a124b3adb0534 100644 --- a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc +++ b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc @@ -12,7 +12,7 @@ //HGCal helper classes //MB: looks be copy of HGCal utils: L1Trigger/L1THGCalUtilities/plugins/ntuples/HGCalTriggerNtupleGen.cc -namespace HGCal_helpers { +namespace hgcal_helpers { class SimpleTrackPropagator { public: SimpleTrackPropagator(MagneticField const* f) : field_(f), prod_(field_, alongMomentum, 5.e-5), absz_target_(0) { @@ -74,7 +74,7 @@ namespace HGCal_helpers { output.SetXYZ(0, 0, 0); return false; } -} // namespace HGCal_helpers +} // namespace hgcal_helpers PositionAtECalEntranceComputer::PositionAtECalEntranceComputer(bool isPhase2) : bField_z_(-1.), isPhase2_(isPhase2) {} @@ -117,7 +117,7 @@ reco::Candidate::Point PositionAtECalEntranceComputer::operator()(const reco::Ca if (std::abs(particle->vertex().z()) >= hgcalFace_z_) return position; - HGCal_helpers::SimpleTrackPropagator propagator(bField_); + hgcal_helpers::SimpleTrackPropagator propagator(bField_); propagator.setPropagationTargetZ(hgcalFace_z_); success = propagator.propagate(particle->px(), particle->py(), From 32b6a3ef070fa09357372f363d2496a6d6e12547 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Thu, 24 Sep 2020 16:42:50 +0200 Subject: [PATCH 036/778] Define common setings for anti-e phase2 in one cff --- ...riminationAgainstElectronMVA6Phase2_cff.py | 96 +++---------------- ...riminationAgainstElectronMVA6Phase2_cff.py | 96 +++---------------- ...onAgainstElectronMVA6Phase2_mvaDefs_cff.py | 88 +++++++++++++++++ 3 files changed, 118 insertions(+), 162 deletions(-) create mode 100644 RecoTauTag/RecoTau/python/tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff.py diff --git a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py index b3e09646c0acb..715bd82cf6f45 100644 --- a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py +++ b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py @@ -5,6 +5,7 @@ src = cms.VInputTag('slimmedElectrons', 'slimmedElectronsFromMultiCl') ) # anti-e phase-2 tauID (Raw) +from RecoTauTag.RecoTau.tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff import mvaNames_phase2, mapping_phase2, workingPoints_phase2 from RecoTauTag.RecoTau.TauDiscriminatorTools import noPrediscriminants from RecoTauTag.RecoTau.patTauDiscriminationAgainstElectronMVA6_cfi import * patTauDiscriminationAgainstElectronMVA6Phase2Raw = patTauDiscriminationAgainstElectronMVA6.clone( @@ -13,94 +14,27 @@ srcElectrons = "mergedSlimmedElectronsForTauId", isPhase2 = True, vetoEcalCracks = False, - mvaName_NoEleMatch_woGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL", - mvaName_NoEleMatch_wGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL", - mvaName_woGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL", - mvaName_wGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL", - mvaName_NoEleMatch_woGwoGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC", - mvaName_NoEleMatch_wGwoGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC", - mvaName_woGwGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC", - mvaName_wGwGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC", - mvaName_NoEleMatch_woGwoGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC", - mvaName_NoEleMatch_wGwoGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC", - mvaName_woGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC", - mvaName_wGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC" + mvaName_NoEleMatch_woGwoGSF_BL = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_BL, + mvaName_NoEleMatch_wGwoGSF_BL = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_BL, + mvaName_woGwGSF_BL = mvaNames_phase2.mvaName_woGwGSF_BL, + mvaName_wGwGSF_BL = mvaNames_phase2.mvaName_wGwGSF_BL, + mvaName_NoEleMatch_woGwoGSF_EC = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_EC, + mvaName_NoEleMatch_wGwoGSF_EC = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_EC, + mvaName_woGwGSF_EC = mvaNames_phase2.mvaName_woGwGSF_EC, + mvaName_wGwGSF_EC = mvaNames_phase2.mvaName_wGwGSF_EC, + mvaName_NoEleMatch_woGwoGSF_VFEC = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_VFEC, + mvaName_NoEleMatch_wGwoGSF_VFEC = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_VFEC, + mvaName_woGwGSF_VFEC = mvaNames_phase2.mvaName_woGwGSF_VFEC, + mvaName_wGwGSF_VFEC = mvaNames_phase2.mvaName_wGwGSF_VFEC ) # anti-e phase-2 tauID (WPs) from RecoTauTag.RecoTau.patTauDiscriminantCutMultiplexerDefault_cfi import patTauDiscriminantCutMultiplexerDefault patTauDiscriminationAgainstElectronMVA6Phase2 = patTauDiscriminantCutMultiplexerDefault.clone( #Note: PFTauProducer and Prediscriminants have to be set in the final cfg toMultiplex = 'patTauDiscriminationAgainstElectronMVA6Phase2Raw', - mapping = [ - cms.PSet( - category = cms.uint32(0), # minMVANoEleMatchWOgWOgsfBL - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(2), # minMVANoEleMatchWgWOgsfBL - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(5), # minMVAWOgWgsfBL - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(7), # minMVAWgWgsfBL - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(8), # minMVANoEleMatchWOgWOgsfEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(9), # minMVANoEleMatchWOgWOgsfVFEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(10), # minMVANoEleMatchWgWOgsfEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(11), # minMVANoEleMatchWgWOgsfVFEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(13), # minMVAWOgWgsfEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(14), # minMVAWOgWgsfVFEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(15), # minMVAWgWgsfEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(16), # minMVAWgWgsfVFEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC"), - variable = cms.string("pt") - ) - ], + mapping = mapping_phase2, rawValues = ["discriminator", "category"], - workingPoints = cms.vstring( - "_WPEff98", - "_WPEff90", - "_WPEff80", - "_WPEff70", - "_WPEff60" - ) + workingPoints = workingPoints_phase2 ) patTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py index 8c0746c2a0bca..ee93406fd5846 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py @@ -19,6 +19,7 @@ electrons = "mergedGsfElectronsForTauId" ) # anti-e phase-2 tauID (raw) +from RecoTauTag.RecoTau.tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff import mvaNames_phase2, mapping_phase2, workingPoints_phase2 from RecoTauTag.RecoTau.pfRecoTauDiscriminationAgainstElectronMVA6_cfi import * pfRecoTauDiscriminationAgainstElectronMVA6Phase2Raw = pfRecoTauDiscriminationAgainstElectronMVA6.clone( #Note: PFTauProducer and Prediscriminants have to be set in the final cfg @@ -26,94 +27,27 @@ isPhase2 = True, vetoEcalCracks = False, hgcalElectronIDs = [cms.InputTag("hgcElectronIdForTauId", key) for key in hgcElectronIdForTauId.variables], - mvaName_NoEleMatch_woGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL", - mvaName_NoEleMatch_wGwoGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL", - mvaName_woGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL", - mvaName_wGwGSF_BL = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL", - mvaName_NoEleMatch_woGwoGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC", - mvaName_NoEleMatch_wGwoGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC", - mvaName_woGwGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC", - mvaName_wGwGSF_EC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC", - mvaName_NoEleMatch_woGwoGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC", - mvaName_NoEleMatch_wGwoGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC", - mvaName_woGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC", - mvaName_wGwGSF_VFEC = "RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC" + mvaName_NoEleMatch_woGwoGSF_BL = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_BL, + mvaName_NoEleMatch_wGwoGSF_BL = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_BL, + mvaName_woGwGSF_BL = mvaNames_phase2.mvaName_woGwGSF_BL, + mvaName_wGwGSF_BL = mvaNames_phase2.mvaName_wGwGSF_BL, + mvaName_NoEleMatch_woGwoGSF_EC = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_EC, + mvaName_NoEleMatch_wGwoGSF_EC = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_EC, + mvaName_woGwGSF_EC = mvaNames_phase2.mvaName_woGwGSF_EC, + mvaName_wGwGSF_EC = mvaNames_phase2.mvaName_wGwGSF_EC, + mvaName_NoEleMatch_woGwoGSF_VFEC = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_VFEC, + mvaName_NoEleMatch_wGwoGSF_VFEC = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_VFEC, + mvaName_woGwGSF_VFEC = mvaNames_phase2.mvaName_woGwGSF_VFEC, + mvaName_wGwGSF_VFEC = mvaNames_phase2.mvaName_wGwGSF_VFEC ) # anti-e phase-2 tauID (WPs) from RecoTauTag.RecoTau.recoTauDiscriminantCutMultiplexerDefault_cfi import recoTauDiscriminantCutMultiplexerDefault pfRecoTauDiscriminationAgainstElectronMVA6Phase2 = recoTauDiscriminantCutMultiplexerDefault.clone( #Note: PFTauProducer and Prediscriminants have to be set in the final cfg toMultiplex = "pfRecoTauDiscriminationAgainstElectronMVA6Phase2Raw", - mapping = [ - cms.PSet( - category = cms.uint32(0), # minMVANoEleMatchWOgWOgsfBL - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(2), # minMVANoEleMatchWgWOgsfBL - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(5), # minMVAWOgWgsfBL - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(7), # minMVAWgWgsfBL - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(8), # minMVANoEleMatchWOgWOgsfEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(9), # minMVANoEleMatchWOgWOgsfVFEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(10), # minMVANoEleMatchWgWOgsfEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(11), # minMVANoEleMatchWgWOgsfVFEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(13), # minMVAWOgWgsfEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(14), # minMVAWOgWgsfVFEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(15), # minMVAWgWgsfEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC"), - variable = cms.string("pt") - ), - cms.PSet( - category = cms.uint32(16), # minMVAWgWgsfVFEC - cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC"), - variable = cms.string("pt") - ) - ], + mapping = mapping_phase2, rawValues = ["discriminator", "category"], - workingPoints = cms.vstring( - "_WPEff98", - "_WPEff90", - "_WPEff80", - "_WPEff70", - "_WPEff60" - ) + workingPoints = workingPoints_phase2 ) electronsForTauDiscriminationAgainstElectronMVA6Phase2Task = cms.Task( diff --git a/RecoTauTag/RecoTau/python/tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff.py b/RecoTauTag/RecoTau/python/tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff.py new file mode 100644 index 0000000000000..2418cc9f74752 --- /dev/null +++ b/RecoTauTag/RecoTau/python/tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff.py @@ -0,0 +1,88 @@ +import FWCore.ParameterSet.Config as cms + +# anti-e phase-2 tauID mva names +mvaNames_phase2 = cms.PSet( + mvaName_NoEleMatch_woGwoGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"), + mvaName_NoEleMatch_wGwoGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"), + mvaName_woGwGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"), + mvaName_wGwGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL"), + mvaName_NoEleMatch_woGwoGSF_EC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC"), + mvaName_NoEleMatch_wGwoGSF_EC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC"), + mvaName_woGwGSF_EC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC"), + mvaName_wGwGSF_EC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC"), + mvaName_NoEleMatch_woGwoGSF_VFEC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC"), + mvaName_NoEleMatch_wGwoGSF_VFEC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC"), + mvaName_woGwGSF_VFEC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC"), + mvaName_wGwGSF_VFEC = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC") +) +# anti-e phase-2 tauID (WPs) +mapping_phase2 = cms.VPSet( + cms.PSet( + category = cms.uint32(0), # minMVANoEleMatchWOgWOgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(2), # minMVANoEleMatchWgWOgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(5), # minMVAWOgWgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(7), # minMVAWgWgsfBL + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_BL"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(8), # minMVANoEleMatchWOgWOgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(9), # minMVANoEleMatchWOgWOgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(10), # minMVANoEleMatchWgWOgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(11), # minMVANoEleMatchWgWOgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(13), # minMVAWOgWgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(14), # minMVAWOgWgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_VFWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(15), # minMVAWgWgsfEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_FWEC"), + variable = cms.string("pt") + ), + cms.PSet( + category = cms.uint32(16), # minMVAWgWgsfVFEC + cut = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_wGwGSF_VFWEC"), + variable = cms.string("pt") + ) +) + +workingPoints_phase2 = cms.vstring( + "_WPEff98", + "_WPEff90", + "_WPEff80", + "_WPEff70", + "_WPEff60" +) From a1c97707a599017f724cb441f5904938e1a83d82 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Thu, 24 Sep 2020 17:42:46 +0200 Subject: [PATCH 037/778] Helper function to get track from PFCand --- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 39 ++++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index 8c79543f01e60..9c01ec9b8a02e 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -16,6 +16,23 @@ using namespace antiElecIDMVA6_blocks; +namespace { + const reco::Track* getTrackFromPFCand(const reco::PFCandidate* pfCandidate) { + const reco::Track* track = nullptr; + if (pfCandidate->trackRef().isNonnull()) + track = pfCandidate->trackRef().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->innerTrack().isNonnull()) + track = pfCandidate->muonRef()->innerTrack().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->globalTrack().isNonnull()) + track = pfCandidate->muonRef()->globalTrack().get(); + else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->outerTrack().isNonnull()) + track = pfCandidate->muonRef()->outerTrack().get(); + else if (pfCandidate->gsfTrackRef().isNonnull()) + track = pfCandidate->gsfTrackRef().get(); + return track; + } +} // namespace + template AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::ParameterSet& cfg, edm::ConsumesCollector&& cc) : isInitialized_(false), @@ -1171,16 +1188,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const phiAtECalEntrance = posAtECal.phi(); } } - if (pfCandidate->trackRef().isNonnull()) - track = pfCandidate->trackRef().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->innerTrack().isNonnull()) - track = pfCandidate->muonRef()->innerTrack().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->globalTrack().isNonnull()) - track = pfCandidate->muonRef()->globalTrack().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->outerTrack().isNonnull()) - track = pfCandidate->muonRef()->outerTrack().get(); - else if (pfCandidate->gsfTrackRef().isNonnull()) - track = pfCandidate->gsfTrackRef().get(); + track = getTrackFromPFCand(pfCandidate); } else { bool success = false; reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); @@ -1219,16 +1227,7 @@ TauVars AntiElectronIDMVA6::getTauVarsTypeSpecific(const etaAtECalEntrance = posAtECal.eta(); } } - if (pfCandidate->trackRef().isNonnull()) - track = pfCandidate->trackRef().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->innerTrack().isNonnull()) - track = pfCandidate->muonRef()->innerTrack().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->globalTrack().isNonnull()) - track = pfCandidate->muonRef()->globalTrack().get(); - else if (pfCandidate->muonRef().isNonnull() && pfCandidate->muonRef()->outerTrack().isNonnull()) - track = pfCandidate->muonRef()->outerTrack().get(); - else if (pfCandidate->gsfTrackRef().isNonnull()) - track = pfCandidate->gsfTrackRef().get(); + track = getTrackFromPFCand(pfCandidate); } else { bool success = false; reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); From ee483420116e19f804abdcb2a6cce87355da56ec Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 24 Sep 2020 18:00:29 +0200 Subject: [PATCH 038/778] Nonamespace in GeometricDet name + Angle units should be in radians to be 1:1 comparable with DD4hep. --- .../src/GeometricDet.cc | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 2a5d05c07d9ca..350d909904084 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -105,7 +105,7 @@ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) _rot(fv->rotation()), _shape(fv->shape()), /// ??? _ddd(fv->navPos()), /// ??? - _ddname(fv->name()), /// ??? + _ddname(computeNameWithNoNamespace(fv->name())), /// ??? _type(type), _params(computeLegacyShapeParameters(_shape, fv->solid())), /// ??? _radLength(fv->get("TrackerRadLength")), @@ -260,6 +260,13 @@ std::unique_ptr GeometricDet::bounds() const { +std::string GeometricDet::computeNameWithNoNamespace(std::string_view nameFromView) const { + const auto& semiColonPos = nameFromView.find(":"); + const std::string name{(semiColonPos != std::string::npos ? nameFromView.substr(semiColonPos + 1) : nameFromView)}; + return name; +} + + std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, const dd4hep::Solid& mySolid) const { @@ -286,18 +293,19 @@ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSoli }*/ else if (mySolidShape == cms::DDSolidShape::ddtrap) { const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid); - myOldDDShapeParameters = { //geant_units::operators::convertCmToMm(myTrap.halfZ() ), + myOldDDShapeParameters = { + //geant_units::operators::convertCmToMm(myTrap.halfZ() ), geant_units::operators::convertCmToMm(myTrap->GetDZ() ), - myTrap->GetTheta(), // ????? deg or rad? - myTrap->GetPhi(), // ????? deg or rad? + (double)angle_units::operators::convertDegToRad(myTrap->GetTheta()), + (double)angle_units::operators::convertDegToRad(myTrap->GetPhi()), geant_units::operators::convertCmToMm(myTrap->GetH1() ), geant_units::operators::convertCmToMm(myTrap->GetBl1() ), geant_units::operators::convertCmToMm(myTrap->GetTl1() ), - myTrap->GetAlpha1(), // ????? deg or rad? + (double)angle_units::operators::convertDegToRad(myTrap->GetAlpha1()), geant_units::operators::convertCmToMm(myTrap->GetH2() ), geant_units::operators::convertCmToMm(myTrap->GetBl2() ), geant_units::operators::convertCmToMm(myTrap->GetTl2() ), - myTrap->GetAlpha2() // ????? deg or rad? + (double)angle_units::operators::convertDegToRad(myTrap->GetAlpha2()) }; } else if (mySolidShape == cms::DDSolidShape::ddtubs) { @@ -305,8 +313,8 @@ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSoli myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myTube->GetDz() ), geant_units::operators::convertCmToMm(myTube->GetRmin() ), geant_units::operators::convertCmToMm(myTube->GetRmax() ), - myTube->GetPhi1(), // ????? deg or rad? is that ok? - myTube->GetPhi2() - myTube->GetPhi1() // ??????? deg or rad?? is that ok? + fmod((double)angle_units::operators::convertDegToRad(myTube->GetPhi1())-2.*M_PI, 2.*M_PI), + (double)angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1()) }; } /* From 868eb331d688fc4e6cef9f8d824939b33de73456 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 24 Sep 2020 18:00:51 +0200 Subject: [PATCH 039/778] Add check for non-empty node in DDFilteredView. --- DetectorDescription/DDCMS/src/DDFilteredView.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index d04f533e4af29..7dade5254e6d9 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -463,6 +463,7 @@ const std::vector DDFilteredView::parameters() const { } const cms::DDSolidShape DDFilteredView::shape() const { + assert(node_); return cms::dd::value(cms::DDSolidShapeMap, std::string(node_->GetVolume()->GetShape()->GetTitle())); } From 681578e0c1efde2c1ffa482d5eb32f38a9833c43 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 24 Sep 2020 19:12:27 +0200 Subject: [PATCH 040/778] cleaning --- .../interface/GeometricDet.h | 18 ++-- .../plugins/CmsDetConstruction.cc | 10 +-- .../plugins/CmsTrackerDetIdBuilder.cc | 39 -------- .../plugins/CmsTrackerLevelBuilder.cc | 69 +++++++++----- .../plugins/CmsTrackerPhase1DiskBuilder.cc | 8 +- .../plugins/DDDCmsTrackerContruction.cc | 10 ++- .../src/GeometricDet.cc | 90 ++++++------------- 7 files changed, 97 insertions(+), 147 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index cfa28205fcc55..e38fa378dcaaa 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -6,18 +6,16 @@ #include "DataFormats/GeometrySurface/interface/Surface.h" #include "DataFormats/GeometrySurface/interface/Bounds.h" #include "DataFormats/DetId/interface/DetId.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include #include +#include #include #include #include "FWCore/ParameterSet/interface/types.h" - #include -//#include -#include -//#include class DDFilteredView; @@ -136,12 +134,12 @@ class GeometricDet { NavRange navpos() const { return NavRange(&_ddd.front(), _ddd.size()); } std::vector const& params() const { - if (_shape != cms::DDSolidShape::ddbox - && _shape != cms::DDSolidShape::ddtrap - && _shape != cms::DDSolidShape::ddtubs) { - std::cout << "error!!! GeometricDet::params() is called on ashape which is neither a box, a trap, nor a tub. This is not supported!" << std::endl; - } - return _params; +if (_shape != cms::DDSolidShape::ddbox + && _shape != cms::DDSolidShape::ddtrap + && _shape != cms::DDSolidShape::ddtubs) { +edm::LogError("GeometricDet::params()") << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; +} +return _params; } ~GeometricDet(); diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index 80d9d42e1de94..a502df35544e1 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -102,7 +102,7 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView // Go down in hierarchy: from module to sensor if (!fv.firstChild()) { - std::cout << "CmsDetConstruction::buildComponent !fv.firstChild()" << std::endl; + edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume."); return; } @@ -114,8 +114,7 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView buildSmallDetsforGlued(fv, det, attribute); // Go to the next volume in FilteredView. - // NB: If this volume is another sensor of the same module, let's stay in the loop. - // Otherwise, loop is exited. + // NB: If this volume is another sensor of the same module, will stay in the loop. fv.firstChild(); } } @@ -126,7 +125,7 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView // Go down in hierarchy: from module to sensor if (!fv.firstChild()) { - std::cout << "CmsDetConstruction::buildComponent !fv.firstChild()" << std::endl; + edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume."); return; } @@ -138,8 +137,7 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView buildSmallDetsforStack(fv, det, attribute); // Go to the next volume in FilteredView. - // NB: If this volume is another sensor of the same module, let's stay in the loop. - // Otherwise, loop is exited. + // NB: If this volume is another sensor of the same module, will stay in the loop. fv.firstChild(); } } diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc index 7d1dbf703aa94..73fa37730c3aa 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc @@ -9,7 +9,6 @@ #include #include #include -#include CmsTrackerDetIdBuilder::CmsTrackerDetIdBuilder(const std::vector& detidShifts) : m_detidshifts() { if (detidShifts.size() != nSubDet * maxLevels) @@ -28,44 +27,6 @@ void CmsTrackerDetIdBuilder::buildId(GeometricDet& tracker) { DetId t(DetId::Tracker, 0); tracker.setGeographicalID(t); iterate(tracker, 0, tracker.geographicalID().rawId()); - - - //std::ofstream outfile("DetIdOLD.log", std::ios::out); - std::ofstream outfile("DetIdDD4hep.log", std::ios::out); - - std::deque queue; - queue.emplace_back(&tracker); - - while (!queue.empty()) { - const GeometricDet* myDet = queue.front(); - queue.pop_front(); - for (auto& child : myDet->components()) { - queue.emplace_back(child); - } - - outfile << "myDet->geographicalID() = " << myDet->geographicalID() << std::endl; - const auto& found = myDet->name().find(":"); - outfile << "myDet->name() = " << (found != std::string::npos ? myDet->name().substr(found + 1) : myDet->name()) << std::endl; - - /* - // old DD - outfile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() << std::endl; - outfile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() << std::endl;*/ - - - // DD4hep - outfile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() * 10. << std::endl; - outfile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() * 10 << std::endl; - - - if (fabs(myDet->rho()) > 0.00001) { - outfile << "myDet->module->phi() = " << std::fixed << std::setprecision(7) << myDet->phi() << std::endl; - } - - - } - - } void CmsTrackerDetIdBuilder::iterate(GeometricDet& in, int level, unsigned int ID) { diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index 94a216a30914b..8261a5ad0614c 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -138,66 +138,87 @@ bool CmsTrackerLevelBuilderHelper::isLessRModule(const GeometricDet* a, const Ge bool CmsTrackerLevelBuilderHelper::isLessR(const GeometricDet* a, const GeometricDet* b) { return a->rho() < b->rho(); } +/* + * Old DD navigation. + */ template <> void CmsTrackerLevelBuilder::build(DDFilteredView& fv, GeometricDet* tracker, const std::string& attribute) { - std::cout << "CmsTrackerLevelBuilder::build " << "tracker->name() = " << tracker->name() - << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type() << std::endl; - bool doLayers = fv.firstChild(); // descend to the first Layer - std::cout << "called first child " << std::endl; + edm::LogVerbatim("CmsTrackerLevelBuilder::build called on volume") + << " tracker->name() = " << tracker->name() + << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); - std::cout << "OUTSIDE while" << std::endl; + // Go down one level in hierarchy + bool doLayers = fv.firstChild(); + while (doLayers) { - std::cout << "CmsTrackerLevelBuilder::build INSIDE while " << std::endl; + edm::LogVerbatim("Calling buildComponent, before"); + + // Call build on sibling buildComponent(fv, tracker, attribute); + + edm::LogVerbatim("Calling buildComponent, after"); + // Go to next sibling doLayers = fv.nextSibling(); - std::cout << "called next sibling" << std::endl; } + // Come back up fv.parent(); - std::cout << "called parent" << std::endl; + // Now that all GeometricDets of a given hierarchy level are built, sort them! sortNS(fv, tracker); - std::cout << "CmsTrackerLevelBuilder::build QUITTED loop." << std::endl; - std::cout << "CmsTrackerLevelBuilder::build END finished calls on all buildComponents" << std::endl; + edm::LogVerbatim("CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."); } +/* + * DD4hep navigation. + */ template <> void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, GeometricDet* tracker, const std::string& attribute) { - std::cout << "CmsTrackerLevelBuilder::build START " << "tracker->name() = " << tracker->name() - << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type() << std::endl; + edm::LogVerbatim("CmsTrackerLevelBuilder::build called on volume") + << " tracker->name() = " << tracker->name() + << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); + // Go down one level in hierarchy fv.firstChild(); - std::cout << "CmsTrackerLevelBuilder::build called first child " << std::endl; + // This is the siblings hierarchy level const int level = fv.level(); - const std::string type = ExtractStringFromDDD::getString(attribute, &fv); - std::cout << "OUTSIDE while, level = " << level << " type = " << type << std::endl; + const std::string& type = ExtractStringFromDDD::getString(attribute, &fv); + // Treat all siblings of a given hierarchy level while (fv.level() == level) { - std::cout << "INSIDE while, before builCompo, level = " << level << " fv.level() = " << fv.level()<< " type = " << type << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv) << std::endl; + edm::LogVerbatim("Calling buildComponent, before.") + << " level = " << level + << " type = " << type + << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + // Call build on sibling buildComponent(fv, tracker, attribute); - - std::cout << "INSIDE while, after builCompo, level = " << level << " fv.level() = " << fv.level()<< " type = " << type << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv) << std::endl; - + + edm::LogVerbatim("Calling buildComponent, after.") + << " level = " << level + << " type = " << type + << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); } - std::cout << "CmsTrackerLevelBuilder::build QUITTED loop. level = " << level << " fv.level() = " << fv.level()<< " type = " << type << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv) << std::endl; - std::cout << "CmsTrackerLevelBuilder::build END finished calls on all buildComponents" << std::endl; - + // Now that all GeometricDets of a given hierarchy level are built, sort them! sortNS(fv, tracker); + + edm::LogVerbatim("CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."); } template class CmsTrackerLevelBuilder; diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc index 7a169f4e71739..cf07f0ea7ea6d 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc @@ -66,8 +66,12 @@ void CmsTrackerPhase1DiskBuilder::PhiPosNegSplit_innerOuter( theCompsInnerOuter.begin(), theCompsInnerOuter.begin() + num_inner - 1, theCompsInnerOuter.begin() + num_inner); } - if (num_inner == 0) { std::cout << "num_inner == 0. CmsTrackerPhase1DiskBuilder is probably not doing what you expect." << std::endl; } - if (num_inner == theCompsInnerOuter.size()) { std::cout << "num_inner == theCompsInnerOuter.size(). CmsTrackerPhase1DiskBuilder is probably not doing what you expect." << std::endl; } + if (num_inner == 0) { + edm::LogError("CmsTrackerPhase1DiskBuilder. num_inner == 0. The split of modules by radius is probably not doing what you expect: inner-radius group is empty."); + } + if (num_inner == theCompsInnerOuter.size()) { + edm::LogError("CmsTrackerPhase1DiskBuilder. num_inner == theCompsInnerOuter.size(). The split of modules by radius is probably not doing what you expect: outer-radius group is empty."); + } std::copy(theCompsInnerOuter.begin(), theCompsInnerOuter.end(), begin); } diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc index ba3a6ba4a2289..d571de51cc9eb 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc @@ -30,12 +30,15 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const DDCompac } auto tracker = std::make_unique(&fv, GeometricDet::Tracker); + + edm::LogVerbatim("DDDCmsTrackerContruction::construct: Call Tracker builder."); CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); + edm::LogVerbatim("Assign DetIds"); CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); - theCmsTrackerDetIdBuilder.buildId(*tracker); + fv.parent(); // // set the Tracker @@ -65,12 +68,13 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const cms::DDC } } - std::cout << "DDDCmsTrackerContruction starts" << std::endl; - auto tracker = std::make_unique(&fv, GeometricDet::Tracker); + + edm::LogVerbatim("DDDCmsTrackerContruction::construct: Call Tracker builder."); CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); + edm::LogVerbatim("Assign DetIds"); CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); theCmsTrackerDetIdBuilder.buildId(*tracker); diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 350d909904084..1e6fea9bf6959 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -103,13 +103,13 @@ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) _phi(_trans.Phi()), _rho(_trans.Rho()), _rot(fv->rotation()), - _shape(fv->shape()), /// ??? - _ddd(fv->navPos()), /// ??? - _ddname(computeNameWithNoNamespace(fv->name())), /// ??? + _shape(fv->shape()), + _ddd(fv->navPos()), // To be studied + _ddname(dd4hep::dd::noNamespace(fv->name())), _type(type), - _params(computeLegacyShapeParameters(_shape, fv->solid())), /// ??? - _radLength(fv->get("TrackerRadLength")), - _xi(fv->get("TrackerXi")), + _params(computeLegacyShapeParameters(_shape, fv->solid())), + _radLength(fv->get("TrackerRadLength")), // To be studied + _xi(fv->get("TrackerXi")), // To be studied _pixROCRows(fv->get("PixelROCRows")), _pixROCCols(fv->get("PixelROCCols")), _pixROCx(fv->get("PixelROC_X")), @@ -258,20 +258,26 @@ std::unique_ptr GeometricDet::bounds() const { return std::unique_ptr(shapeToBounds.buildBounds(_shape, par)); } - +/* std::string GeometricDet::computeNameWithNoNamespace(std::string_view nameFromView) const { const auto& semiColonPos = nameFromView.find(":"); const std::string name{(semiColonPos != std::string::npos ? nameFromView.substr(semiColonPos + 1) : nameFromView)}; return name; -} - + }*/ +/* + * DD4hep. + * Keep order and units of parameters as old DD to avoid numerous rgeressions. + * Shape parameters to be stored in DB and of interest are only for boxes, trapezoids, and tubs. + * params() will complain if parameters of any other shape are accessed. + */ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, const dd4hep::Solid& mySolid) const { std::vector myOldDDShapeParameters; - //const cms::DDSolidShape& mySolidShape = cms::dd::getCurrentShape(fv); + + // Box if (mySolidShape == cms::DDSolidShape::ddbox) { const dd4hep::Box& myBox = dd4hep::Box(mySolid); myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myBox.x() ), @@ -279,77 +285,35 @@ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSoli geant_units::operators::convertCmToMm(myBox.z() ) }; } - /* - else if (mySolidShape == cms::DDSolidShape::ddcons) { - const dd4hep::Cone myCone = dd4hep::Cone(mySolid); - myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myCone.dZ() ), - geant_units::operators::convertCmToMm(myCone.rMin1() ), - geant_units::operators::convertCmToMm(myCone.rMax1() ), - geant_units::operators::convertCmToMm(myCone.rMin2() ), - geant_units::operators::convertCmToMm(myCone.rMax2() ), - myCone.phiFrom(), - myCone.deltaPhi() - }; - }*/ + + // Trapezoid else if (mySolidShape == cms::DDSolidShape::ddtrap) { const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid); - myOldDDShapeParameters = { - //geant_units::operators::convertCmToMm(myTrap.halfZ() ), + myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myTrap->GetDZ() ), - (double)angle_units::operators::convertDegToRad(myTrap->GetTheta()), - (double)angle_units::operators::convertDegToRad(myTrap->GetPhi()), + static_cast(angle_units::operators::convertDegToRad(myTrap->GetTheta())), + static_cast(angle_units::operators::convertDegToRad(myTrap->GetPhi())), geant_units::operators::convertCmToMm(myTrap->GetH1() ), geant_units::operators::convertCmToMm(myTrap->GetBl1() ), geant_units::operators::convertCmToMm(myTrap->GetTl1() ), - (double)angle_units::operators::convertDegToRad(myTrap->GetAlpha1()), + static_cast(angle_units::operators::convertDegToRad(myTrap->GetAlpha1())), geant_units::operators::convertCmToMm(myTrap->GetH2() ), geant_units::operators::convertCmToMm(myTrap->GetBl2() ), geant_units::operators::convertCmToMm(myTrap->GetTl2() ), - (double)angle_units::operators::convertDegToRad(myTrap->GetAlpha2()) + static_cast(angle_units::operators::convertDegToRad(myTrap->GetAlpha2())) }; } + + // Tub else if (mySolidShape == cms::DDSolidShape::ddtubs) { const dd4hep::Tube& myTube = dd4hep::Tube(mySolid); myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myTube->GetDz() ), geant_units::operators::convertCmToMm(myTube->GetRmin() ), geant_units::operators::convertCmToMm(myTube->GetRmax() ), - fmod((double)angle_units::operators::convertDegToRad(myTube->GetPhi1())-2.*M_PI, 2.*M_PI), - (double)angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1()) + static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi1())), + static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1())) }; } - /* - else if (mySolidShape == cms::DDSolidShape::ddtrunctubs) { - const cms::dd::DDTruncTubs& myShape = cms::dd::DDTruncTubs(fv); - myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myShape.zHalf() ), - geant_units::operators::convertCmToMm(myShape.rIn() ), - geant_units::operators::convertCmToMm(myShape.rOut() ), - myShape.startPhi(), - myShape.deltaPhi(), - geant_units::operators::convertCmToMm(myShape.cutAtStart() ), - geant_units::operators::convertCmToMm(myShape.cutAtDelta() ), - static_cast(myShape.cutInside()) - }; - }*/ - - /* - else if (mySolidShape == cms::DDSolidShape::dd_not_init) { - auto myShape = fv.solid(); - const std::vector& params = myShape.dimensions(); - if (fv.isA()) { - myOldDDShapeParameters = { geant_units::operators::convertCmToMm(params[3] ), // z - 0., - 0., - geant_units::operators::convertCmToMm(params[2] ), // y - geant_units::operators::convertCmToMm(params[0] ), // x1 - geant_units::operators::convertCmToMm(params[0] ), // x1 - 0., - geant_units::operators::convertCmToMm(params[2] ), // y - geant_units::operators::convertCmToMm(params[1] ), // x2 - geant_units::operators::convertCmToMm(params[1] ), // x2 - 0. - }; - } - }*/ return myOldDDShapeParameters; } From 91b1066caae0482db30958f89db042cc891939dc Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 24 Sep 2020 19:37:41 +0200 Subject: [PATCH 041/778] scram b code-format --- .../interface/GeometricDet.h | 15 ++- .../plugins/CmsDetConstruction.cc | 6 +- .../plugins/CmsTrackerLevelBuilder.cc | 45 ++++----- .../plugins/CmsTrackerPhase1DiskBuilder.cc | 12 ++- .../src/GeometricDet.cc | 95 +++++++++---------- 5 files changed, 78 insertions(+), 95 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index e38fa378dcaaa..c8ee3b64548f0 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -16,7 +16,6 @@ #include "FWCore/ParameterSet/interface/types.h" #include - class DDFilteredView; namespace cms { @@ -134,12 +133,12 @@ class GeometricDet { NavRange navpos() const { return NavRange(&_ddd.front(), _ddd.size()); } std::vector const& params() const { -if (_shape != cms::DDSolidShape::ddbox - && _shape != cms::DDSolidShape::ddtrap - && _shape != cms::DDSolidShape::ddtubs) { -edm::LogError("GeometricDet::params()") << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; -} -return _params; + if (_shape != cms::DDSolidShape::ddbox && _shape != cms::DDSolidShape::ddtrap && + _shape != cms::DDSolidShape::ddtubs) { + edm::LogError("GeometricDet::params()") + << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; + } + return _params; } ~GeometricDet(); @@ -200,7 +199,7 @@ return _params; private: std::vector computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, - const dd4hep::Solid& mySolid) const; + const dd4hep::Solid& mySolid) const; ConstGeometricDetContainer _container; Translation _trans; diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index a502df35544e1..291e3c0cdbc38 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -99,7 +99,6 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView // PHASE 1 (MERGEDDET) if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::mergedDet) { - // Go down in hierarchy: from module to sensor if (!fv.firstChild()) { edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume."); @@ -107,7 +106,7 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView } // This is the sensor hierarchy level - const int sensorHierarchyLevel = fv.level(); + const int sensorHierarchyLevel = fv.level(); // Loop on all siblings (ie, on all sensors) while (fv.level() == sensorHierarchyLevel) { @@ -122,7 +121,6 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView // PHASE 2 (STACKDET) else if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::OTPhase2Stack) { - // Go down in hierarchy: from module to sensor if (!fv.firstChild()) { edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume."); @@ -130,7 +128,7 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView } // This is the sensor hierarchy level - const int sensorHierarchyLevel = fv.level(); + const int sensorHierarchyLevel = fv.level(); // Loop on all siblings (ie, on all sensors) while (fv.level() == sensorHierarchyLevel) { diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index 8261a5ad0614c..18ed5df28a926 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -137,23 +137,20 @@ bool CmsTrackerLevelBuilderHelper::isLessRModule(const GeometricDet* a, const Ge bool CmsTrackerLevelBuilderHelper::isLessR(const GeometricDet* a, const GeometricDet* b) { return a->rho() < b->rho(); } - /* * Old DD navigation. */ template <> void CmsTrackerLevelBuilder::build(DDFilteredView& fv, - GeometricDet* tracker, - const std::string& attribute) { - + GeometricDet* tracker, + const std::string& attribute) { edm::LogVerbatim("CmsTrackerLevelBuilder::build called on volume") - << " tracker->name() = " << tracker->name() - << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type(); + << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); // Go down one level in hierarchy bool doLayers = fv.firstChild(); - + while (doLayers) { edm::LogVerbatim("Calling buildComponent, before"); @@ -161,7 +158,7 @@ void CmsTrackerLevelBuilder::build(DDFilteredView& fv, buildComponent(fv, tracker, attribute); edm::LogVerbatim("Calling buildComponent, after"); - + // Go to next sibling doLayers = fv.nextSibling(); } @@ -175,44 +172,36 @@ void CmsTrackerLevelBuilder::build(DDFilteredView& fv, edm::LogVerbatim("CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."); } - /* * DD4hep navigation. */ template <> void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, - GeometricDet* tracker, - const std::string& attribute) { - + GeometricDet* tracker, + const std::string& attribute) { edm::LogVerbatim("CmsTrackerLevelBuilder::build called on volume") - << " tracker->name() = " << tracker->name() - << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type(); + << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); // Go down one level in hierarchy fv.firstChild(); // This is the siblings hierarchy level - const int level = fv.level(); + const int level = fv.level(); const std::string& type = ExtractStringFromDDD::getString(attribute, &fv); // Treat all siblings of a given hierarchy level while (fv.level() == level) { - - edm::LogVerbatim("Calling buildComponent, before.") - << " level = " << level - << " type = " << type - << " fv.level() = " << fv.level() - << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + edm::LogVerbatim("Calling buildComponent, before.") + << " level = " << level << " type = " << type << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); // Call build on sibling buildComponent(fv, tracker, attribute); - + edm::LogVerbatim("Calling buildComponent, after.") - << " level = " << level - << " type = " << type - << " fv.level() = " << fv.level() - << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + << " level = " << level << " type = " << type << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); } // Now that all GeometricDets of a given hierarchy level are built, sort them! diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc index cf07f0ea7ea6d..bd47db3bee25c 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerPhase1DiskBuilder.cc @@ -63,14 +63,18 @@ void CmsTrackerPhase1DiskBuilder::PhiPosNegSplit_innerOuter( } if (num_inner > 0) { std::rotate( - theCompsInnerOuter.begin(), theCompsInnerOuter.begin() + num_inner - 1, theCompsInnerOuter.begin() + num_inner); + theCompsInnerOuter.begin(), theCompsInnerOuter.begin() + num_inner - 1, theCompsInnerOuter.begin() + num_inner); } - if (num_inner == 0) { - edm::LogError("CmsTrackerPhase1DiskBuilder. num_inner == 0. The split of modules by radius is probably not doing what you expect: inner-radius group is empty."); + if (num_inner == 0) { + edm::LogError( + "CmsTrackerPhase1DiskBuilder. num_inner == 0. The split of modules by radius is probably not doing what you " + "expect: inner-radius group is empty."); } if (num_inner == theCompsInnerOuter.size()) { - edm::LogError("CmsTrackerPhase1DiskBuilder. num_inner == theCompsInnerOuter.size(). The split of modules by radius is probably not doing what you expect: outer-radius group is empty."); + edm::LogError( + "CmsTrackerPhase1DiskBuilder. num_inner == theCompsInnerOuter.size(). The split of modules by radius is " + "probably not doing what you expect: outer-radius group is empty."); } std::copy(theCompsInnerOuter.begin(), theCompsInnerOuter.end(), begin); diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 1e6fea9bf6959..62eaf6a59d51d 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -87,8 +87,7 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) _isLowerSensor(getString("TrackerLowerDetectors", *fv) == strue), _isUpperSensor(getString("TrackerUpperDetectors", *fv) == strue), _siliconAPVNum(getDouble("SiliconAPVNumber", *fv)), - _isFromDD4hep(false) -{ + _isFromDD4hep(false) { // workaround instead of this at initialization _ddd(fv->navPos().begin(),fv->navPos().end()), const DDFilteredView::nav_type& nt = fv->navPos(); _ddd = nav_type(nt.begin(), nt.end()); @@ -98,28 +97,26 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) Constructor from DD4HEP Filtered view. */ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) - : - _trans(geant_units::operators::convertCmToMm(fv->translation())), - _phi(_trans.Phi()), - _rho(_trans.Rho()), - _rot(fv->rotation()), - _shape(fv->shape()), - _ddd(fv->navPos()), // To be studied - _ddname(dd4hep::dd::noNamespace(fv->name())), - _type(type), - _params(computeLegacyShapeParameters(_shape, fv->solid())), - _radLength(fv->get("TrackerRadLength")), // To be studied - _xi(fv->get("TrackerXi")), // To be studied - _pixROCRows(fv->get("PixelROCRows")), - _pixROCCols(fv->get("PixelROCCols")), - _pixROCx(fv->get("PixelROC_X")), - _pixROCy(fv->get("PixelROC_Y")), - _stereo(fv->get("TrackerStereoDetectors") == strue), - _isLowerSensor(fv->get("TrackerLowerDetectors") == strue), - _isUpperSensor(fv->get("TrackerUpperDetectors") == strue), - _siliconAPVNum(fv->get("SiliconAPVNumber")), - _isFromDD4hep(true) -{} + : _trans(geant_units::operators::convertCmToMm(fv->translation())), + _phi(_trans.Phi()), + _rho(_trans.Rho()), + _rot(fv->rotation()), + _shape(fv->shape()), + _ddd(fv->navPos()), // To be studied + _ddname(dd4hep::dd::noNamespace(fv->name())), + _type(type), + _params(computeLegacyShapeParameters(_shape, fv->solid())), + _radLength(fv->get("TrackerRadLength")), // To be studied + _xi(fv->get("TrackerXi")), // To be studied + _pixROCRows(fv->get("PixelROCRows")), + _pixROCCols(fv->get("PixelROCCols")), + _pixROCx(fv->get("PixelROC_X")), + _pixROCy(fv->get("PixelROC_Y")), + _stereo(fv->get("TrackerStereoDetectors") == strue), + _isLowerSensor(fv->get("TrackerLowerDetectors") == strue), + _isUpperSensor(fv->get("TrackerUpperDetectors") == strue), + _siliconAPVNum(fv->get("SiliconAPVNumber")), + _isFromDD4hep(true) {} // PGeometricDet is persistent version... make it... then come back here and make the // constructor. @@ -266,7 +263,6 @@ std::string GeometricDet::computeNameWithNoNamespace(std::string_view nameFromVi return name; }*/ - /* * DD4hep. * Keep order and units of parameters as old DD to avoid numerous rgeressions. @@ -274,45 +270,42 @@ std::string GeometricDet::computeNameWithNoNamespace(std::string_view nameFromVi * params() will complain if parameters of any other shape are accessed. */ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, - const dd4hep::Solid& mySolid) const { + const dd4hep::Solid& mySolid) const { std::vector myOldDDShapeParameters; - + // Box if (mySolidShape == cms::DDSolidShape::ddbox) { const dd4hep::Box& myBox = dd4hep::Box(mySolid); - myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myBox.x() ), - geant_units::operators::convertCmToMm(myBox.y() ), - geant_units::operators::convertCmToMm(myBox.z() ) - }; + myOldDDShapeParameters = {geant_units::operators::convertCmToMm(myBox.x()), + geant_units::operators::convertCmToMm(myBox.y()), + geant_units::operators::convertCmToMm(myBox.z())}; } - + // Trapezoid else if (mySolidShape == cms::DDSolidShape::ddtrap) { const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid); - myOldDDShapeParameters = { - geant_units::operators::convertCmToMm(myTrap->GetDZ() ), - static_cast(angle_units::operators::convertDegToRad(myTrap->GetTheta())), - static_cast(angle_units::operators::convertDegToRad(myTrap->GetPhi())), - geant_units::operators::convertCmToMm(myTrap->GetH1() ), - geant_units::operators::convertCmToMm(myTrap->GetBl1() ), - geant_units::operators::convertCmToMm(myTrap->GetTl1() ), - static_cast(angle_units::operators::convertDegToRad(myTrap->GetAlpha1())), - geant_units::operators::convertCmToMm(myTrap->GetH2() ), - geant_units::operators::convertCmToMm(myTrap->GetBl2() ), - geant_units::operators::convertCmToMm(myTrap->GetTl2() ), - static_cast(angle_units::operators::convertDegToRad(myTrap->GetAlpha2())) - }; + myOldDDShapeParameters = {geant_units::operators::convertCmToMm(myTrap->GetDZ()), + static_cast(angle_units::operators::convertDegToRad(myTrap->GetTheta())), + static_cast(angle_units::operators::convertDegToRad(myTrap->GetPhi())), + geant_units::operators::convertCmToMm(myTrap->GetH1()), + geant_units::operators::convertCmToMm(myTrap->GetBl1()), + geant_units::operators::convertCmToMm(myTrap->GetTl1()), + static_cast(angle_units::operators::convertDegToRad(myTrap->GetAlpha1())), + geant_units::operators::convertCmToMm(myTrap->GetH2()), + geant_units::operators::convertCmToMm(myTrap->GetBl2()), + geant_units::operators::convertCmToMm(myTrap->GetTl2()), + static_cast(angle_units::operators::convertDegToRad(myTrap->GetAlpha2()))}; } // Tub else if (mySolidShape == cms::DDSolidShape::ddtubs) { const dd4hep::Tube& myTube = dd4hep::Tube(mySolid); - myOldDDShapeParameters = { geant_units::operators::convertCmToMm(myTube->GetDz() ), - geant_units::operators::convertCmToMm(myTube->GetRmin() ), - geant_units::operators::convertCmToMm(myTube->GetRmax() ), - static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi1())), - static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1())) - }; + myOldDDShapeParameters = { + geant_units::operators::convertCmToMm(myTube->GetDz()), + geant_units::operators::convertCmToMm(myTube->GetRmin()), + geant_units::operators::convertCmToMm(myTube->GetRmax()), + static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi1())), + static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1()))}; } return myOldDDShapeParameters; From ec3ece542d51a349d6fb89e34eeb0b54c6ba49ad Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 24 Sep 2020 20:39:42 +0200 Subject: [PATCH 042/778] fixes include --- Geometry/TrackerNumberingBuilder/BuildFile.xml | 1 + Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/Geometry/TrackerNumberingBuilder/BuildFile.xml b/Geometry/TrackerNumberingBuilder/BuildFile.xml index 586b8010e81a0..1b35681161077 100644 --- a/Geometry/TrackerNumberingBuilder/BuildFile.xml +++ b/Geometry/TrackerNumberingBuilder/BuildFile.xml @@ -7,6 +7,7 @@ + diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index 291e3c0cdbc38..b2300045d8d70 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -3,6 +3,7 @@ #include "Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h" #include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h" #include "DataFormats/DetId/interface/DetId.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" template void CmsDetConstruction::buildSmallDetsforGlued(FilteredView& fv, From 9d74c59ed1f5d1aa51f1d5cc09b9e6b0fa3b1f5e Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 24 Sep 2020 21:01:20 +0200 Subject: [PATCH 043/778] fixes shape include --- Geometry/TrackerNumberingBuilder/interface/GeometricDet.h | 2 +- Geometry/TrackerNumberingBuilder/plugins/BuildFile.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index c8ee3b64548f0..abc0b1927ad96 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -3,13 +3,13 @@ #include "CondFormats/GeometryObjects/interface/PGeometricDet.h" #include "DetectorDescription/DDCMS/interface/DDSolidShapes.h" +#include "DetectorDescription/DDCMS/interface/DDShapes.h" #include "DataFormats/GeometrySurface/interface/Surface.h" #include "DataFormats/GeometrySurface/interface/Bounds.h" #include "DataFormats/DetId/interface/DetId.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include #include -#include #include #include diff --git a/Geometry/TrackerNumberingBuilder/plugins/BuildFile.xml b/Geometry/TrackerNumberingBuilder/plugins/BuildFile.xml index ce5cbbcade846..37b1c6842558a 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/BuildFile.xml +++ b/Geometry/TrackerNumberingBuilder/plugins/BuildFile.xml @@ -5,6 +5,7 @@ + From e512702eef525f87b4cbe63a8b3088b4626e890f Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 24 Sep 2020 21:28:23 +0200 Subject: [PATCH 044/778] remove commented code --- Geometry/TrackerNumberingBuilder/src/GeometricDet.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 62eaf6a59d51d..6f8555f9a32cf 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -255,14 +255,6 @@ std::unique_ptr GeometricDet::bounds() const { return std::unique_ptr(shapeToBounds.buildBounds(_shape, par)); } -/* - -std::string GeometricDet::computeNameWithNoNamespace(std::string_view nameFromView) const { - const auto& semiColonPos = nameFromView.find(":"); - const std::string name{(semiColonPos != std::string::npos ? nameFromView.substr(semiColonPos + 1) : nameFromView)}; - return name; - }*/ - /* * DD4hep. * Keep order and units of parameters as old DD to avoid numerous rgeressions. From c845c8c45439d05d26f827be61c18ab694270a83 Mon Sep 17 00:00:00 2001 From: "Ian J. Watson" Date: Fri, 25 Sep 2020 13:19:58 +0900 Subject: [PATCH 045/778] postValidation_muons in GE0 --- Validation/Configuration/python/postValidation_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Validation/Configuration/python/postValidation_cff.py b/Validation/Configuration/python/postValidation_cff.py index c6f52828821d1..8f310eacfce2e 100644 --- a/Validation/Configuration/python/postValidation_cff.py +++ b/Validation/Configuration/python/postValidation_cff.py @@ -141,3 +141,4 @@ phase2_hgcal.toReplaceWith( postValidation, _phase2_postValidation ) from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 (phase2_GE0 & phase2_hgcal).toReplaceWith( postValidation, _phase2_ge0_postValidation ) +phase2_GE0.toReplaceWith( postValidation_muons, postValidation_muons.copyAndExclude([MuonME0DigisPostProcessors, MuonME0SegPostProcessors]) ) From 27a648f7e65ef18658989c85faa51c59ff73a494 Mon Sep 17 00:00:00 2001 From: "Ian J. Watson" Date: Fri, 25 Sep 2020 13:25:06 +0900 Subject: [PATCH 046/778] Use GEMSubDetId station enum in GEMOfflineDQM --- DQMOffline/Muon/interface/GEMOfflineDQMBase.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DQMOffline/Muon/interface/GEMOfflineDQMBase.h b/DQMOffline/Muon/interface/GEMOfflineDQMBase.h index 2ad922b532493..e5dd71fb2599e 100644 --- a/DQMOffline/Muon/interface/GEMOfflineDQMBase.h +++ b/DQMOffline/Muon/interface/GEMOfflineDQMBase.h @@ -97,11 +97,11 @@ class GEMOfflineDQMBase : public DQMEDAnalyzer { }; inline int GEMOfflineDQMBase::getMaxVFAT(const int station) { - if (station == 0) + if (GEMSubDetId::station(station) == GEMSubDetId::Station::GE0) return GEMeMap::maxVFatGE0_; - else if (station == 1) + else if (GEMSubDetId::station(station) == GEMSubDetId::Station::GE11) return GEMeMap::maxVFatGE11_; - else if (station == 2) + else if (GEMSubDetId::station(station) == GEMSubDetId::Station::GE21) return GEMeMap::maxVFatGE21_; else return -1; From 5d04490af1e8d2c62e6b6448a1f22fb7da5142c8 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 09:04:31 +0200 Subject: [PATCH 047/778] comments --- .../plugins/CmsDetConstruction.cc | 10 ---------- Geometry/TrackerNumberingBuilder/src/GeometricDet.cc | 7 ++++--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index b2300045d8d70..b78b85bdc9ac7 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -47,9 +47,6 @@ template <> void CmsDetConstruction::buildComponent(DDFilteredView& fv, GeometricDet* mother, const std::string& attribute) { - // - // at this level I check whether it is a merged detector or not - // GeometricDet* det = new GeometricDet(&fv, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( @@ -63,9 +60,6 @@ void CmsDetConstruction::buildComponent(DDFilteredView& fv, while (dodets) { buildSmallDetsforGlued(fv, det, attribute); dodets = setNext(fv); - /* - Add algo to sort the merged DET - */ } fv.parent(); @@ -89,10 +83,6 @@ template <> void CmsDetConstruction::buildComponent(cms::DDFilteredView& fv, GeometricDet* mother, const std::string& attribute) { - // - // at this level I check whether it is a merged detector or not - // - GeometricDet* det = new GeometricDet(&fv, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString(attribute, &fv))); diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 6f8555f9a32cf..7e228608e1a8e 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -257,9 +257,10 @@ std::unique_ptr GeometricDet::bounds() const { /* * DD4hep. - * Keep order and units of parameters as old DD to avoid numerous rgeressions. - * Shape parameters to be stored in DB and of interest are only for boxes, trapezoids, and tubs. - * params() will complain if parameters of any other shape are accessed. + * Keep order and units of parameters same as old DD, to avoid numerous regressions. + * Shape parameters of interest, and those to be stored in DB, are only from boxes, trapezoids, and tubs. + * Hence, they are the only shapes treated here. + * params() will complain, if the parameters of any other shape are accessed. */ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, const dd4hep::Solid& mySolid) const { From 994539c12be470acc530337eaecf5fd407469dab Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 25 Sep 2020 09:50:51 +0200 Subject: [PATCH 048/778] fix MultiRunAndPlotPVValidation.C in the case of passing the luminosities by file --- .../macros/MultiRunAndPlotPVValidation.C | 51 +++++++++++++++---- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C index 2875bac038226..810d7eb1c4cd9 100644 --- a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C +++ b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C @@ -43,7 +43,7 @@ /*! * \def number of workers */ -const size_t nWorkers = 10; +const size_t nWorkers = 20; /*! * \def basically the y-values of a TGraph @@ -669,6 +669,8 @@ void MultiRunPVValidation( lumiByRun.push_back(lumiSoFar + lumi); lumiMapByRun[run] = (lumiSoFar + lumi); lumiSoFar += lumi; + } else { + std::cout << "run: " << run << " is not found in the intersection" << std::endl; } std::cout << run << " ====> lumi so far: " << lumiSoFar << std::endl; } @@ -745,7 +747,9 @@ void MultiRunPVValidation( // re-assemble everything together for (auto extractedTrend : extracts) { - std::cout << "lumiSoFar: " << lumiSoFar << "/fb" << std::endl; + if (!useLumiByFile) { + std::cout << "lumiSoFar: " << lumiSoFar << "/fb" << std::endl; + } runs.insert(std::end(runs), std::begin(extractedTrend.m_runs), std::end(extractedTrend.m_runs)); @@ -859,8 +863,8 @@ void MultiRunPVValidation( dxyEtaHiErr_[label].push_back(std::abs(dxyEtaHi_[label][it] - dxyEtaMeans_[label][it])); dxyEtaLoErr_[label].push_back(std::abs(dxyEtaLo_[label][it] - dxyEtaMeans_[label][it])); - std::cout << "label: " << label << " means:" << dxyEtaMeans_[label][it] << " low: " << dxyEtaLo_[label][it] - << " loErr: " << dxyEtaLoErr_[label][it] << std::endl; + //std::cout << "label: " << label << " means:" << dxyEtaMeans_[label][it] << " low: " << dxyEtaLo_[label][it] + //<< " loErr: " << dxyEtaLoErr_[label][it] << std::endl; dzPhiHiErr_[label].push_back(std::abs(dzPhiHi_[label][it] - dzPhiMeans_[label][it])); dzPhiLoErr_[label].push_back(std::abs(dzPhiLo_[label][it] - dzPhiMeans_[label][it])); @@ -966,7 +970,31 @@ void MultiRunPVValidation( if (lumi_axis_format) { theType = "luminosity"; theTypeLabel = "Processed luminosity [1/fb]"; - x_ticks = lumiByRun; + if (!useLumiByFile) { + x_ticks = lumiByRun; + } else { + // in case we are passing the luminosity per run by file, need to re-check the map + // in order to fill the x ticks of the graph only for the run which actually pass the selection + /* + double myLumi(0.); + for(const auto [iRun, iLumi] : lumiMapByRun){ + myLumi+=iLumi; + if(std::find(runs.begin(), runs.end(), iRun) != runs.end()){ + x_ticks.push_back(myLumi); + std::cout << " recompute run" << iRun << "lumi" << myLumi << std::endl; + } + } + */ + double lastLumi(0.); + for (const auto &iRun : runs) { + if (lumiMapByRun.find(iRun) != lumiMapByRun.end()) { + x_ticks.push_back(lumiMapByRun[iRun]); + lastLumi = x_ticks.back(); + } else { + x_ticks.push_back(lastLumi); + } + } + } } else { if (!time_axis_format) { theType = "run number"; @@ -1048,6 +1076,8 @@ void MultiRunPVValidation( std::cout << "x_ticks.size()= " << x_ticks.size() << " dxyPhiMeans_[LegLabels[" << j << "]].size()=" << dxyPhiMeans_[LegLabels[j]].size() << std::endl; + assert(x_ticks.size() == dxyPhiMeans_[LegLabels[j]].size()); + // ************************************* // dxy vs phi // ************************************* @@ -2984,7 +3014,7 @@ outTrends processData(size_t iter, //if(intersection.at(n)!=283946) // continue; - std::cout << "iter: " << iter << " " << n << " " << intersection.at(n) << std::endl; + // std::cout << "iter: " << iter << " " << n << " " << intersection.at(n) << std::endl; TFile *fins[nDirs_]; @@ -3040,8 +3070,8 @@ outTrends processData(size_t iter, break; } - std::cout << Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n]) - << " has size: " << fins[j]->GetSize() << " b "; + //std::cout << Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n]) + //<< " has size: " << fins[j]->GetSize() << " b "; // sanity check TH1F *h_tracks = (TH1F *)fins[j]->Get("PVValidation/EventFeatures/h_nTracks"); @@ -3057,6 +3087,7 @@ outTrends processData(size_t iter, } Double_t numEvents = h_tracks->GetEntries(); + if (numEvents < 2500) { std::cout << "excluding " << intersection[n] << " because it has less than 2.5k events" << std::endl; areAllFilesOK = false; @@ -3205,7 +3236,7 @@ outTrends processData(size_t iter, ret.m_lumiMapByRun[intersection.at(n)] = ret.m_lumiSoFar / 1000.; } - std::cout << "I am still here - runs.size(): " << ret.m_runs.size() << std::endl; + //std::cout << "I am still here - runs.size(): " << ret.m_runs.size() << std::endl; // Bias plots @@ -3331,7 +3362,7 @@ outTrends processData(size_t iter, delete PullsCanvas; delete ResolutionsVsPt; - std::cout << std::endl; + //std::cout << std::endl; } return ret; From 620c46ae30b33dfa54d3f59375df75d8fb4a677c Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 10:21:37 +0200 Subject: [PATCH 049/778] Attemp to fix includes for use of dd4hep:Solid --- Geometry/TrackerNumberingBuilder/interface/GeometricDet.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index abc0b1927ad96..32e606d11bc98 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -3,17 +3,18 @@ #include "CondFormats/GeometryObjects/interface/PGeometricDet.h" #include "DetectorDescription/DDCMS/interface/DDSolidShapes.h" -#include "DetectorDescription/DDCMS/interface/DDShapes.h" #include "DataFormats/GeometrySurface/interface/Surface.h" #include "DataFormats/GeometrySurface/interface/Bounds.h" #include "DataFormats/DetId/interface/DetId.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/types.h" + +#include #include #include #include #include -#include "FWCore/ParameterSet/interface/types.h" #include class DDFilteredView; From aded05193bbcfda9dd7acda3f33ae138bb7cb405 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 11:01:22 +0200 Subject: [PATCH 050/778] Remove aweful style of having starting underscore for GeometricDet data members by trailing underscores. --- .../interface/GeometricDet.h | 110 +++++----- .../src/GeometricDet.cc | 202 +++++++++--------- .../src/TrackerShapeToBounds.cc | 10 +- 3 files changed, 161 insertions(+), 161 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index 32e606d11bc98..42304f02f3831 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -93,14 +93,14 @@ class GeometricDet { /** * set or add or clear components */ - void setGeographicalID(DetId id) { _geographicalID = id; } + void setGeographicalID(DetId id) { geographicalID_ = id; } void addComponents(GeometricDetContainer const& cont); void addComponents(ConstGeometricDetContainer const& cont); void addComponent(GeometricDet*); /** * clearComponents() only empties the container, the components are not deleted! */ - void clearComponents() { _container.clear(); } + void clearComponents() { container_.clear(); } /** * deleteComponents() explicitly deletes the daughters @@ -108,38 +108,38 @@ class GeometricDet { */ void deleteComponents(); - bool isLeaf() const { return _container.empty(); } + bool isLeaf() const { return container_.empty(); } - GeometricDet* component(size_t index) { return const_cast(_container[index]); } + GeometricDet* component(size_t index) { return const_cast(container_[index]); } /** * Access methods */ - RotationMatrix const& rotation() const { return _rot; } - Translation const& translation() const { return _trans; } - double phi() const { return _phi; } - double rho() const { return _rho; } + RotationMatrix const& rotation() const { return rot_; } + Translation const& translation() const { return trans_; } + double phi() const { return phi_; } + double rho() const { return rho_; } // old DD - LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, _shape); } + LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } // DD4hep - cms::DDSolidShape shape_dd4hep() const { return _shape; } + cms::DDSolidShape shape_dd4hep() const { return shape_; } - GeometricEnumType type() const { return _type; } - std::string const& name() const { return _ddname; } + GeometricEnumType type() const { return type_; } + std::string const& name() const { return ddname_; } // internal representaion // old DD - nav_type const& navType() const { return _ddd; } - NavRange navpos() const { return NavRange(&_ddd.front(), _ddd.size()); } + nav_type const& navType() const { return ddd_; } + NavRange navpos() const { return NavRange(&ddd_.front(), ddd_.size()); } std::vector const& params() const { - if (_shape != cms::DDSolidShape::ddbox && _shape != cms::DDSolidShape::ddtrap && - _shape != cms::DDSolidShape::ddtubs) { + if (shape_ != cms::DDSolidShape::ddbox && shape_ != cms::DDSolidShape::ddtrap && + shape_ != cms::DDSolidShape::ddtubs) { edm::LogError("GeometricDet::params()") << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; } - return _params; + return params_; } ~GeometricDet(); @@ -148,8 +148,8 @@ class GeometricDet { * components() returns explicit components; please note that in case of a leaf * GeometricDet it returns nothing (an empty vector) */ - ConstGeometricDetContainer& components() { return _container; } - ConstGeometricDetContainer const& components() const { return _container; } + ConstGeometricDetContainer& components() { return container_; } + ConstGeometricDetContainer const& components() const { return container_; } /** * deepComponents() returns all the components below; please note that @@ -162,8 +162,8 @@ class GeometricDet { /** *geometricalID() returns the ID associated to the GeometricDet. */ - DetId geographicalID() const { return _geographicalID; } - DetId geographicalId() const { return _geographicalID; } + DetId geographicalID() const { return geographicalID_; } + DetId geographicalId() const { return geographicalID_; } /** *positionBounds() returns the position in cm. @@ -180,52 +180,52 @@ class GeometricDet { */ std::unique_ptr bounds() const; - double radLength() const { return _radLength; } - double xi() const { return _xi; } + double radLength() const { return radLength_; } + double xi() const { return xi_; } /** * The following four pix* methods only return meaningful results for pixels. */ - double pixROCRows() const { return _pixROCRows; } - double pixROCCols() const { return _pixROCCols; } - double pixROCx() const { return _pixROCx; } - double pixROCy() const { return _pixROCy; } + double pixROCRows() const { return pixROCRows_; } + double pixROCCols() const { return pixROCCols_; } + double pixROCx() const { return pixROCx_; } + double pixROCy() const { return pixROCy_; } /** * The following two are only meaningful for the silicon tracker. */ - bool stereo() const { return _stereo; } - bool isLowerSensor() const { return _isLowerSensor; } - bool isUpperSensor() const { return _isUpperSensor; } - double siliconAPVNum() const { return _siliconAPVNum; } + bool stereo() const { return stereo_; } + bool isLowerSensor() const { return isLowerSensor_; } + bool isUpperSensor() const { return isUpperSensor_; } + double siliconAPVNum() const { return siliconAPVNum_; } private: std::vector computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, const dd4hep::Solid& mySolid) const; - ConstGeometricDetContainer _container; - Translation _trans; - double _phi; - double _rho; - RotationMatrix _rot; - cms::DDSolidShape _shape; - nav_type _ddd; - std::string _ddname; - GeometricEnumType _type; - std::vector _params; - - DetId _geographicalID; - double _radLength; - double _xi; - double _pixROCRows; - double _pixROCCols; - double _pixROCx; - double _pixROCy; - bool _stereo; - bool _isLowerSensor; - bool _isUpperSensor; - double _siliconAPVNum; - - bool _isFromDD4hep; + ConstGeometricDetContainer container_; + Translation trans_; + double phi_; + double rho_; + RotationMatrix rot_; + cms::DDSolidShape shape_; + nav_type ddd_; + std::string ddname_; + GeometricEnumType type_; + std::vector params_; + + DetId geographicalID_; + double radLength_; + double xi_; + double pixROCRows_; + double pixROCCols_; + double pixROCx_; + double pixROCy_; + bool stereo_; + bool isLowerSensor_; + bool isUpperSensor_; + double siliconAPVNum_; + + bool isFromDD4hep_; }; #undef PoolAlloc diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 7e228608e1a8e..af1d1b379f691 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -69,62 +69,62 @@ GeometricDet::~GeometricDet() { deleteComponents(); } Constructor from old DD Filtered view. */ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) - : _trans(fv->translation()), - _phi(_trans.Phi()), - _rho(_trans.Rho()), - _rot(fv->rotation()), - _shape(cms::dd::name_from_value(cms::LegacySolidShapeMap, fv->shape())), - _ddname(fv->name()), - _type(type), - _params(fv->parameters()), - _radLength(getDouble("TrackerRadLength", *fv)), - _xi(getDouble("TrackerXi", *fv)), - _pixROCRows(getDouble("PixelROCRows", *fv)), - _pixROCCols(getDouble("PixelROCCols", *fv)), - _pixROCx(getDouble("PixelROC_X", *fv)), - _pixROCy(getDouble("PixelROC_Y", *fv)), - _stereo(getString("TrackerStereoDetectors", *fv) == strue), - _isLowerSensor(getString("TrackerLowerDetectors", *fv) == strue), - _isUpperSensor(getString("TrackerUpperDetectors", *fv) == strue), - _siliconAPVNum(getDouble("SiliconAPVNumber", *fv)), - _isFromDD4hep(false) { - // workaround instead of this at initialization _ddd(fv->navPos().begin(),fv->navPos().end()), + : trans_(fv->translation()), + phi_(trans_.Phi()), + rho_(trans_.Rho()), + rot_(fv->rotation()), + shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, fv->shape())), + ddname_(fv->name()), + type_(type), + params_(fv->parameters()), + radLength_(getDouble("TrackerRadLength", *fv)), + xi_(getDouble("TrackerXi", *fv)), + pixROCRows_(getDouble("PixelROCRows", *fv)), + pixROCCols_(getDouble("PixelROCCols", *fv)), + pixROCx_(getDouble("PixelROCX_", *fv)), + pixROCy_(getDouble("PixelROCY_", *fv)), + stereo_(getString("TrackerStereoDetectors", *fv) == strue), + isLowerSensor_(getString("TrackerLowerDetectors", *fv) == strue), + isUpperSensor_(getString("TrackerUpperDetectors", *fv) == strue), + siliconAPVNum_(getDouble("SiliconAPVNumber", *fv)), + isFromDD4hep_(false) { + // workaround instead of this at initialization ddd_(fv->navPos().begin(),fv->navPos().end()), const DDFilteredView::nav_type& nt = fv->navPos(); - _ddd = nav_type(nt.begin(), nt.end()); + ddd_ = nav_type(nt.begin(), nt.end()); } /* Constructor from DD4HEP Filtered view. */ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) - : _trans(geant_units::operators::convertCmToMm(fv->translation())), - _phi(_trans.Phi()), - _rho(_trans.Rho()), - _rot(fv->rotation()), - _shape(fv->shape()), - _ddd(fv->navPos()), // To be studied - _ddname(dd4hep::dd::noNamespace(fv->name())), - _type(type), - _params(computeLegacyShapeParameters(_shape, fv->solid())), - _radLength(fv->get("TrackerRadLength")), // To be studied - _xi(fv->get("TrackerXi")), // To be studied - _pixROCRows(fv->get("PixelROCRows")), - _pixROCCols(fv->get("PixelROCCols")), - _pixROCx(fv->get("PixelROC_X")), - _pixROCy(fv->get("PixelROC_Y")), - _stereo(fv->get("TrackerStereoDetectors") == strue), - _isLowerSensor(fv->get("TrackerLowerDetectors") == strue), - _isUpperSensor(fv->get("TrackerUpperDetectors") == strue), - _siliconAPVNum(fv->get("SiliconAPVNumber")), - _isFromDD4hep(true) {} + : trans_(geant_units::operators::convertCmToMm(fv->translation())), + phi_(trans_.Phi()), + rho_(trans_.Rho()), + rot_(fv->rotation()), + shape_(fv->shape()), + ddd_(fv->navPos()), // To be studied + ddname_(dd4hep::dd::noNamespace(fv->name())), + type_(type), + params_(computeLegacyShapeParameters(shape_, fv->solid())), + radLength_(fv->get("TrackerRadLength")), // To be studied + xi_(fv->get("TrackerXi")), // To be studied + pixROCRows_(fv->get("PixelROCRows")), + pixROCCols_(fv->get("PixelROCCols")), + pixROCx_(fv->get("PixelROCX_")), + pixROCy_(fv->get("PixelROCY_")), + stereo_(fv->get("TrackerStereoDetectors") == strue), + isLowerSensor_(fv->get("TrackerLowerDetectors") == strue), + isUpperSensor_(fv->get("TrackerUpperDetectors") == strue), + siliconAPVNum_(fv->get("SiliconAPVNumber")), + isFromDD4hep_(true) {} // PGeometricDet is persistent version... make it... then come back here and make the // constructor. GeometricDet::GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType type) - : _trans(onePGD._x, onePGD._y, onePGD._z), - _phi(onePGD._phi), //_trans.Phi()), - _rho(onePGD._rho), //_trans.Rho()), - _rot(onePGD._a11, + : trans_(onePGD._x, onePGD._y, onePGD._z), + phi_(onePGD._phi), //trans_.Phi()), + rho_(onePGD._rho), //trans_.Rho()), + rot_(onePGD._a11, onePGD._a12, onePGD._a13, onePGD._a21, @@ -133,54 +133,54 @@ GeometricDet::GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType onePGD._a31, onePGD._a32, onePGD._a33), - _shape(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast(onePGD._shape))), - _ddd(), - _ddname(onePGD._name), - _type(type), - _params(), - _geographicalID(onePGD._geographicalID), - _radLength(onePGD._radLength), - _xi(onePGD._xi), - _pixROCRows(onePGD._pixROCRows), - _pixROCCols(onePGD._pixROCCols), - _pixROCx(onePGD._pixROCx), - _pixROCy(onePGD._pixROCy), - _stereo(onePGD._stereo), - _siliconAPVNum(onePGD._siliconAPVNum) { + shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast(onePGD._shape))), + ddd_(), + ddname_(onePGD._name), + type_(type), + params_(), + geographicalID_(onePGD._geographicalID), + radLength_(onePGD._radLength), + xi_(onePGD._xi), + pixROCRows_(onePGD._pixROCRows), + pixROCCols_(onePGD._pixROCCols), + pixROCx_(onePGD._pixROCx), + pixROCy_(onePGD._pixROCy), + stereo_(onePGD._stereo), + siliconAPVNum_(onePGD._siliconAPVNum) { if (onePGD._shape == 1 || onePGD._shape == 3) { //The parms vector is neede only in the case of box or trap shape - _params.reserve(11); - _params.emplace_back(onePGD._params0); - _params.emplace_back(onePGD._params1); - _params.emplace_back(onePGD._params2); - _params.emplace_back(onePGD._params3); - _params.emplace_back(onePGD._params4); - _params.emplace_back(onePGD._params5); - _params.emplace_back(onePGD._params6); - _params.emplace_back(onePGD._params7); - _params.emplace_back(onePGD._params8); - _params.emplace_back(onePGD._params9); - _params.emplace_back(onePGD._params10); + params_.reserve(11); + params_.emplace_back(onePGD._params0); + params_.emplace_back(onePGD._params1); + params_.emplace_back(onePGD._params2); + params_.emplace_back(onePGD._params3); + params_.emplace_back(onePGD._params4); + params_.emplace_back(onePGD._params5); + params_.emplace_back(onePGD._params6); + params_.emplace_back(onePGD._params7); + params_.emplace_back(onePGD._params8); + params_.emplace_back(onePGD._params9); + params_.emplace_back(onePGD._params10); } - _ddd.reserve(onePGD._numnt); - _ddd.emplace_back(onePGD._nt0); - _ddd.emplace_back(onePGD._nt1); - _ddd.emplace_back(onePGD._nt2); - _ddd.emplace_back(onePGD._nt3); + ddd_.reserve(onePGD._numnt); + ddd_.emplace_back(onePGD._nt0); + ddd_.emplace_back(onePGD._nt1); + ddd_.emplace_back(onePGD._nt2); + ddd_.emplace_back(onePGD._nt3); if (onePGD._numnt > 4) { - _ddd.emplace_back(onePGD._nt4); + ddd_.emplace_back(onePGD._nt4); if (onePGD._numnt > 5) { - _ddd.emplace_back(onePGD._nt5); + ddd_.emplace_back(onePGD._nt5); if (onePGD._numnt > 6) { - _ddd.emplace_back(onePGD._nt6); + ddd_.emplace_back(onePGD._nt6); if (onePGD._numnt > 7) { - _ddd.emplace_back(onePGD._nt7); + ddd_.emplace_back(onePGD._nt7); if (onePGD._numnt > 8) { - _ddd.emplace_back(onePGD._nt8); + ddd_.emplace_back(onePGD._nt8); if (onePGD._numnt > 9) { - _ddd.emplace_back(onePGD._nt9); + ddd_.emplace_back(onePGD._nt9); if (onePGD._numnt > 10) { - _ddd.emplace_back(onePGD._nt10); + ddd_.emplace_back(onePGD._nt10); } } } @@ -194,29 +194,29 @@ GeometricDet::ConstGeometricDetContainer GeometricDet::deepComponents() const { // // iterate on all the components ;) // - ConstGeometricDetContainer _temp; - deepComponents(_temp); - return _temp; + ConstGeometricDetContainer temp_; + deepComponents(temp_); + return temp_; } void GeometricDet::deepComponents(ConstGeometricDetContainer& cont) const { if (isLeaf()) cont.emplace_back(this); else - std::for_each(_container.begin(), _container.end(), [&](const GeometricDet* iDet) { iDet->deepComponents(cont); }); + std::for_each(container_.begin(), container_.end(), [&](const GeometricDet* iDet) { iDet->deepComponents(cont); }); } void GeometricDet::addComponents(GeometricDetContainer const& cont) { - _container.reserve(_container.size() + cont.size()); - std::copy(cont.begin(), cont.end(), back_inserter(_container)); + container_.reserve(container_.size() + cont.size()); + std::copy(cont.begin(), cont.end(), back_inserter(container_)); } void GeometricDet::addComponents(ConstGeometricDetContainer const& cont) { - _container.reserve(_container.size() + cont.size()); - std::copy(cont.begin(), cont.end(), back_inserter(_container)); + container_.reserve(container_.size() + cont.size()); + std::copy(cont.begin(), cont.end(), back_inserter(container_)); } -void GeometricDet::addComponent(GeometricDet* det) { _container.emplace_back(det); } +void GeometricDet::addComponent(GeometricDet* det) { container_.emplace_back(det); } namespace { struct Deleter { @@ -225,19 +225,19 @@ namespace { } // namespace void GeometricDet::deleteComponents() { - std::for_each(_container.begin(), _container.end(), Deleter()); - _container.clear(); + std::for_each(container_.begin(), container_.end(), Deleter()); + container_.clear(); } GeometricDet::Position GeometricDet::positionBounds() const { - Position _pos(float(_trans.x() / cm), float(_trans.y() / cm), float(_trans.z() / cm)); - return _pos; + Position pos_(float(trans_.x() / cm), float(trans_.y() / cm), float(trans_.z() / cm)); + return pos_; } GeometricDet::Rotation GeometricDet::rotationBounds() const { Translation x, y, z; - _rot.GetComponents(x, y, z); - Rotation _rotation(float(x.X()), + rot_.GetComponents(x, y, z); + Rotation rotation_(float(x.X()), float(x.Y()), float(x.Z()), float(y.X()), @@ -246,13 +246,13 @@ GeometricDet::Rotation GeometricDet::rotationBounds() const { float(z.X()), float(z.Y()), float(z.Z())); - return _rotation; + return rotation_; } std::unique_ptr GeometricDet::bounds() const { - const std::vector& par = _params; + const std::vector& par = params_; TrackerShapeToBounds shapeToBounds; - return std::unique_ptr(shapeToBounds.buildBounds(_shape, par)); + return std::unique_ptr(shapeToBounds.buildBounds(shape_, par)); } /* diff --git a/Geometry/TrackerNumberingBuilder/src/TrackerShapeToBounds.cc b/Geometry/TrackerNumberingBuilder/src/TrackerShapeToBounds.cc index 94dfd4fd38c53..cc04455cd3f5d 100644 --- a/Geometry/TrackerNumberingBuilder/src/TrackerShapeToBounds.cc +++ b/Geometry/TrackerNumberingBuilder/src/TrackerShapeToBounds.cc @@ -29,13 +29,13 @@ 3. combine the global rotation from DDD with the rotation defined in 2. */ -Bounds* TrackerShapeToBounds::buildBounds(const cms::DDSolidShape& _shape, const std::vector& _par) const { - switch (_shape) { +Bounds* TrackerShapeToBounds::buildBounds(const cms::DDSolidShape& shape, const std::vector& par) const { + switch (shape) { case cms::DDSolidShape::ddbox: - return buildBox(_par); + return buildBox(par); break; case cms::DDSolidShape::ddtrap: - return buildTrap(_par); + return buildTrap(par); break; case cms::DDSolidShape::ddtubs: case cms::DDSolidShape::ddpolycone: @@ -43,7 +43,7 @@ Bounds* TrackerShapeToBounds::buildBounds(const cms::DDSolidShape& _shape, const return buildOpen(); break; default: - std::cout << "Wrong DDshape to build...." << cms::dd::name(cms::DDSolidShapeMap, _shape) << std::endl; + std::cout << "Wrong DDshape to build...." << cms::dd::name(cms::DDSolidShapeMap, shape) << std::endl; Bounds* bounds = nullptr; return bounds; } From ba9261116e83a37014a741a6ffc8af23e750671f Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 13:11:35 +0200 Subject: [PATCH 051/778] Make CmsDetConstruction understandable. --- .../plugins/CmsDetConstruction.cc | 113 ++++++++++-------- .../plugins/CmsDetConstruction.h | 2 - 2 files changed, 65 insertions(+), 50 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index b78b85bdc9ac7..2a7743e1b700d 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -43,77 +43,82 @@ void CmsDetConstruction::buildSmallDetsforStack(FilteredView& fv, mother->addComponent(det); } +/* + * OLD DD. + * Module with 2 sensors: calculate the sensor local ID, and add the sensor to its mother volume (module). + * Module with 1 sensor: just add the sensor to to its mother volume (ladder). + */ template <> void CmsDetConstruction::buildComponent(DDFilteredView& fv, GeometricDet* mother, const std::string& attribute) { - GeometricDet* det = new GeometricDet(&fv, - CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv))); - - //Phase1 mergedDet: searching for sensors - if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::mergedDet) { - // I have to go one step lower ... - bool dodets = fv.firstChild(); // descend to the first Layer - while (dodets) { - buildSmallDetsforGlued(fv, det, attribute); - dodets = setNext(fv); - } - fv.parent(); + // Mother volume + // Module with 2 sensors: the mother volume is the module volume. + // Module with 1 sensor: the mother volume is the ladder volume. + const std::string& myTopologicalNameInXMLs = ExtractStringFromDDD::getString(attribute, &fv); + const GeometricDet::GDEnumType& myTopologicalType = CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type(myTopologicalNameInXMLs); - } + GeometricDet* det = new GeometricDet(&fv, myTopologicalType); + + const bool isPhase1ModuleWith2Sensors = (myTopologicalType == GeometricDet::mergedDet); + const bool isPhase2ModuleWith2Sensors = (myTopologicalType == GeometricDet::OTPhase2Stack); - //Phase2 stackDet: same procedure, different nomenclature - else if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::OTPhase2Stack) { - bool dodets = fv.firstChild(); + // CASE A: MODULE HAS 2 SENSORS + if (isPhase1ModuleWith2Sensors || isPhase2ModuleWith2Sensors) { + + // Go down in hierarchy: from module to sensor + bool dodets = fv.firstChild(); // very important while (dodets) { - buildSmallDetsforStack(fv, det, attribute); - dodets = setNext(fv); + + // PHASE 1 (MERGEDDET) + if (isPhase1ModuleWith2Sensors) { + buildSmallDetsforGlued(fv, det, attribute); + } + // PHASE 2 (STACKDET) + else if (isPhase2ModuleWith2Sensors) { + buildSmallDetsforStack(fv, det, attribute); + } + + dodets = fv.nextSibling(); } + fv.parent(); } + // CASE B: MODULE HAS 1 SENSOR: NOTHING SPECIFIC TO DO + // Indeed, we are not going to sort sensors within module, if there is only 1 sensor! + + // ALL CASES: add sensor to its mother volume (module or ladder). mother->addComponent(det); } + +/* + * DD4hep. + * Module with 2 sensors: calculate the sensor local ID, and add the sensor to its mother volume (module). + * Module with 1 sensor: just add the sensor to its mother volume (ladder). + */ template <> void CmsDetConstruction::buildComponent(cms::DDFilteredView& fv, GeometricDet* mother, const std::string& attribute) { - GeometricDet* det = new GeometricDet(&fv, - CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv))); - - // PHASE 1 (MERGEDDET) - if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::mergedDet) { - // Go down in hierarchy: from module to sensor - if (!fv.firstChild()) { - edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume."); - return; - } - // This is the sensor hierarchy level - const int sensorHierarchyLevel = fv.level(); + // Mother volume + // Module with 2 sensors: the mother volume is the module volume. + // Module with 1 sensor: the mother volume is the ladder volume. + const std::string& myTopologicalNameInXMLs = ExtractStringFromDDD::getString(attribute, &fv); + const GeometricDet::GDEnumType& myTopologicalType = CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type(myTopologicalNameInXMLs); + GeometricDet* det = new GeometricDet(&fv, myTopologicalType); - // Loop on all siblings (ie, on all sensors) - while (fv.level() == sensorHierarchyLevel) { - buildSmallDetsforGlued(fv, det, attribute); + const bool isPhase1ModuleWith2Sensors = (myTopologicalType == GeometricDet::mergedDet); + const bool isPhase2ModuleWith2Sensors = (myTopologicalType == GeometricDet::OTPhase2Stack); - // Go to the next volume in FilteredView. - // NB: If this volume is another sensor of the same module, will stay in the loop. - fv.firstChild(); - } - } + // CASE A: MODULE HAS 2 SENSORS + if (isPhase1ModuleWith2Sensors || isPhase2ModuleWith2Sensors) { - // PHASE 2 (STACKDET) - else if (CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type( - ExtractStringFromDDD::getString(attribute, &fv)) == GeometricDet::OTPhase2Stack) { // Go down in hierarchy: from module to sensor - if (!fv.firstChild()) { + if (!fv.firstChild()) { // very important edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume."); return; } @@ -123,18 +128,30 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView // Loop on all siblings (ie, on all sensors) while (fv.level() == sensorHierarchyLevel) { - buildSmallDetsforStack(fv, det, attribute); + + // PHASE 1 (MERGEDDET) + if (isPhase1ModuleWith2Sensors) { + buildSmallDetsforGlued(fv, det, attribute); + } + // PHASE 2 (STACKDET) + else if (isPhase2ModuleWith2Sensors) { + buildSmallDetsforStack(fv, det, attribute); + } // Go to the next volume in FilteredView. // NB: If this volume is another sensor of the same module, will stay in the loop. + // Otherwise, it is very important to access the next volume to be treated anyway. fv.firstChild(); } } + // CASE B: MODULE HAS 1 SENSOR: NOTHING SPECIFIC TO DO + // Indeed, we are not going to sort sensors within module, if there is only 1 sensor! else { // Go to the next volume in FilteredView. fv.firstChild(); } + // ALL CASES: add sensor to its mother volume (module or ladder). mother->addComponent(det); } diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h index 1149c0525e547..2e61ed508faca 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h @@ -17,8 +17,6 @@ class CmsDetConstruction : public CmsTrackerLevelBuilder { void buildDets(const FilteredView&, GeometricDet*, const std::string&); void buildSmallDetsforGlued(FilteredView&, GeometricDet*, const std::string&); void buildSmallDetsforStack(FilteredView&, GeometricDet*, const std::string&); - bool setNext(cms::DDFilteredView& fv) { return fv.firstChild(); } - bool setNext(DDFilteredView& fv) { return fv.nextSibling(); } }; #endif // Geometry_TrackerNumberingBuilder_CmsDetConstruction_H From 212f09206905dedec2e332feb110b52af079156d Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 25 Sep 2020 12:35:55 +0200 Subject: [PATCH 052/778] add verbose flag, few improved comments --- .../macros/MultiRunAndPlotPVValidation.C | 44 ++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C index 810d7eb1c4cd9..335318742f929 100644 --- a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C +++ b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C @@ -38,7 +38,7 @@ /*! * \def boolean to decide if it is in debug mode */ -#define DEBUG true +#define VERBOSE false /*! * \def number of workers @@ -531,7 +531,6 @@ void MultiRunPVValidation( << std::endl; std::cout << "msg-i: MultiRunPVValidation(): you're requesting both summary vs lumi and vs time, " << std::endl; std::cout << " this combination is inconsistent --> exiting!" << std::endl; - //return; exit(EXIT_FAILURE); } @@ -543,7 +542,7 @@ void MultiRunPVValidation( if (!infile) { std::cout << "Required time axis options, but missing input times file :(" << std::endl; std::cout << " -- exiting" << std::endl; - return; + exit(EXIT_FAILURE); } std::string line; @@ -650,7 +649,7 @@ void MultiRunPVValidation( if (!lumifile) { std::cout << "Required luminosity from file, but missing input file :(" << std::endl; std::cout << " -- exiting" << std::endl; - return; + exit(EXIT_FAILURE); } std::string line; @@ -670,7 +669,7 @@ void MultiRunPVValidation( lumiMapByRun[run] = (lumiSoFar + lumi); lumiSoFar += lumi; } else { - std::cout << "run: " << run << " is not found in the intersection" << std::endl; + std::cout << "WARNING! Run: " << run << " is not found in the intersection" << std::endl; } std::cout << run << " ====> lumi so far: " << lumiSoFar << std::endl; } @@ -863,8 +862,10 @@ void MultiRunPVValidation( dxyEtaHiErr_[label].push_back(std::abs(dxyEtaHi_[label][it] - dxyEtaMeans_[label][it])); dxyEtaLoErr_[label].push_back(std::abs(dxyEtaLo_[label][it] - dxyEtaMeans_[label][it])); - //std::cout << "label: " << label << " means:" << dxyEtaMeans_[label][it] << " low: " << dxyEtaLo_[label][it] - //<< " loErr: " << dxyEtaLoErr_[label][it] << std::endl; + if (VERBOSE) { + std::cout << "label: " << label << " means:" << dxyEtaMeans_[label][it] << " low: " << dxyEtaLo_[label][it] + << " loErr: " << dxyEtaLoErr_[label][it] << std::endl; + } dzPhiHiErr_[label].push_back(std::abs(dzPhiHi_[label][it] - dzPhiMeans_[label][it])); dzPhiLoErr_[label].push_back(std::abs(dzPhiLo_[label][it] - dzPhiMeans_[label][it])); @@ -973,8 +974,6 @@ void MultiRunPVValidation( if (!useLumiByFile) { x_ticks = lumiByRun; } else { - // in case we are passing the luminosity per run by file, need to re-check the map - // in order to fill the x ticks of the graph only for the run which actually pass the selection /* double myLumi(0.); for(const auto [iRun, iLumi] : lumiMapByRun){ @@ -985,12 +984,16 @@ void MultiRunPVValidation( } } */ + // in case we are passing the luminosity per run by file, need to re-check the map + // in order to fill the x ticks of the graph only for the run which actually pass the selection double lastLumi(0.); for (const auto &iRun : runs) { if (lumiMapByRun.find(iRun) != lumiMapByRun.end()) { x_ticks.push_back(lumiMapByRun[iRun]); lastLumi = x_ticks.back(); } else { + // if the run is not find in the lumiMapByRun we just use the lumi of + // the last run analyzed (so we assume that run has lumi=0) x_ticks.push_back(lastLumi); } } @@ -1076,6 +1079,7 @@ void MultiRunPVValidation( std::cout << "x_ticks.size()= " << x_ticks.size() << " dxyPhiMeans_[LegLabels[" << j << "]].size()=" << dxyPhiMeans_[LegLabels[j]].size() << std::endl; + // otherwise something very bad has happened assert(x_ticks.size() == dxyPhiMeans_[LegLabels[j]].size()); // ************************************* @@ -1764,7 +1768,7 @@ void outputGraphs(const pv::wrappedTrends &allInputs, g_mean->SetMarkerStyle(pv::markers[index]); g_mean->SetMarkerColor(pv::colors[index]); g_mean->SetLineColor(pv::colors[index]); - g_mean->SetMarkerSize(1.5); + g_mean->SetMarkerSize(1.); g_high->SetLineColor(pv::colors[index]); g_low->SetLineColor(pv::colors[index]); beautify(g_mean); @@ -1915,7 +1919,7 @@ void outputGraphs(const pv::wrappedTrends &allInputs, h_RMS[index]->SetLineColor(pv::colors[index]); h_RMS[index]->SetLineWidth(2); - h_RMS[index]->SetMarkerSize(1.5); + h_RMS[index]->SetMarkerSize(1.); h_RMS[index]->SetMarkerStyle(pv::markers[index]); h_RMS[index]->SetMarkerColor(pv::colors[index]); adjustmargins(rms_canv); @@ -3014,7 +3018,9 @@ outTrends processData(size_t iter, //if(intersection.at(n)!=283946) // continue; - // std::cout << "iter: " << iter << " " << n << " " << intersection.at(n) << std::endl; + if (VERBOSE) { + std::cout << "iter: " << iter << " " << n << " " << intersection.at(n) << std::endl; + } TFile *fins[nDirs_]; @@ -3070,8 +3076,10 @@ outTrends processData(size_t iter, break; } - //std::cout << Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n]) - //<< " has size: " << fins[j]->GetSize() << " b "; + if (VERBOSE) { + std::cout << Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n]) + << " has size: " << fins[j]->GetSize() << " b "; + } // sanity check TH1F *h_tracks = (TH1F *)fins[j]->Get("PVValidation/EventFeatures/h_nTracks"); @@ -3236,7 +3244,9 @@ outTrends processData(size_t iter, ret.m_lumiMapByRun[intersection.at(n)] = ret.m_lumiSoFar / 1000.; } - //std::cout << "I am still here - runs.size(): " << ret.m_runs.size() << std::endl; + if (VERBOSE) { + std::cout << "I am still here - runs.size(): " << ret.m_runs.size() << std::endl; + } // Bias plots @@ -3362,7 +3372,9 @@ outTrends processData(size_t iter, delete PullsCanvas; delete ResolutionsVsPt; - //std::cout << std::endl; + if (VERBOSE) { + std::cout << std::endl; + } } return ret; From f2759219a5279cf654a04a93ad3e51294320796f Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Fri, 25 Sep 2020 16:04:42 +0200 Subject: [PATCH 053/778] remove wrapper shape classes --- .../DDCMS/interface/DDShapes.h | 221 ------------------ DetectorDescription/DDCMS/src/DDShapes.cc | 169 -------------- 2 files changed, 390 deletions(-) delete mode 100644 DetectorDescription/DDCMS/interface/DDShapes.h delete mode 100644 DetectorDescription/DDCMS/src/DDShapes.cc diff --git a/DetectorDescription/DDCMS/interface/DDShapes.h b/DetectorDescription/DDCMS/interface/DDShapes.h deleted file mode 100644 index a96b802995119..0000000000000 --- a/DetectorDescription/DDCMS/interface/DDShapes.h +++ /dev/null @@ -1,221 +0,0 @@ -#ifndef Detector_Description_DDCMS_DDShapes_h -#define Detector_Description_DDCMS_DDShapes_h - -#include "DetectorDescription/DDCMS/interface/DDFilteredView.h" - -namespace cms { - - enum class DDSolidShape; - - namespace dd { - - DDSolidShape getCurrentShape(const cms::DDFilteredView &fview); - - class DDBox { - public: - DDBox(const cms::DDFilteredView &fview); - DDBox(void) = delete; - - double halfX() const { return (dx_); } - double halfY() const { return (dy_); } - double halfZ() const { return (dz_); } - - const bool valid; // Tells if DDBox contains valid values - - private: - double dx_, dy_, dz_; - }; - - // A tube section - class DDTubs { - public: - DDTubs(const cms::DDFilteredView &fview); - DDTubs(void) = delete; - - double zhalf(void) const { return (zHalf_); } - double rIn(void) const { return (rIn_); } - double rOut(void) const { return (rOut_); } - double startPhi(void) const { return (startPhi_); } - double deltaPhi(void) const { return (deltaPhi_); } - - const bool valid; - - private: - double zHalf_; - double rIn_; - double rOut_; - double startPhi_; - double deltaPhi_; - }; - - // A cone section - class DDCons { - public: - DDCons(const cms::DDFilteredView &fview); - DDCons(void) = delete; - - double zhalf(void) const { return (dz_); } - double rInMinusZ(void) const { return (rmin1_); } - double rOutMinusZ(void) const { return (rmax1_); } - double rInPlusZ(void) const { return (rmin2_); } - double rOutPlusZ(void) const { return (rmax2_); } - double phiFrom(void) const { return (phi1_); } - double deltaPhi(void) const { return (phi2_); } - - const bool valid; // Tells if DDCons contains valid values - - private: - double dz_; - double rmin1_; - double rmax1_; - double rmin2_; - double rmax2_; - double phi1_; - double phi2_; - }; - - // A simple trapezoid - class DDTrap { - public: - DDTrap(const cms::DDFilteredView &fview); - DDTrap(void) = delete; - - //! half of the z-Axis - double halfZ(void) const { return (halfZ_); } - - //! Polar angle of the line joining the centres of the faces at -/+pDz - double theta(void) const { return (theta_); } - - //! Azimuthal angle of the line joining the centres of the faces at -/+pDz - double phi(void) const { return (phi_); } - - //! Half-length along y of the face at -pDz - double y1(void) const { return (y1_); } - - //! Half-length along x of the side at y=-pDy1 of the face at -pDz - double x1(void) const { return (x1_); } - - //! Half-length along x of the side at y=+pDy1 of the face at -pDz - double x2(void) const { return (x2_); } - - //! Half-length along y of the face at +pDz - double y2(void) const { return (y2_); } - - //! Half-length along x of the side at y=-pDy2 of the face at +pDz - double x3(void) const { return (x3_); } - - //! Half-length along x of the side at y=+pDy2 of the face at +pDz - double x4(void) const { return (x4_); } - - //! Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of the face at -pDz - double alpha1(void) const { return (alpha1_); } - - //! Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of the face at +pDz - double alpha2(void) const { return (alpha2_); } - - const bool valid; - - private: - double halfZ_; - double theta_; - double phi_; - double x1_; - double x2_; - double y1_; - double y2_; - double x3_; - double x4_; - double alpha1_; - double alpha2_; - }; - - // A pseudo-trapezoid, that is, a trapezoid with a cylinder. - // This shape is obsolete. This commented-out code can be removed after we are sure - // it won't be needed with DD4hep. - // The code does not work correctly. - /* - class DDPseudoTrap { - public: - DDPseudoTrap(const cms::DDFilteredView &fview); - DDPseudoTrap(void) = delete; - - //! half of the z-Axis - double halfZ(void) const { return (dz_); } - // - //! half length along x on -z - double x1(void) const { return (minusX_); } - - //! half length along x on +z - double x2(void) const { return (plusX_); } - - //! half length along y on -z - double y1(void) const { return (minusY_); } - - //! half length along y on +z - double y2(void) const { return (plusY_); } - - //! radius of the cut-out (neg.) or rounding (pos.) - double radius(void) const { return (rmax_); } - - //! true, if cut-out or rounding is on the -z side - bool atMinusZ(void) const { return (minusZSide_); } - - const bool valid; // Tells if shape contains valid values - - private: - double dz_; - double minusX_; - double plusX_; - double minusY_; - double plusY_; - double rmax_; - bool minusZSide_; - }; - */ - - /// A truncated tube section - class DDTruncTubs { - public: - DDTruncTubs(const cms::DDFilteredView &fview); - DDTruncTubs(void) = delete; - - //! half of the z-Axis - double zHalf(void) const { return (zHalf_); } - - //! inner radius - double rIn(void) const { return (rIn_); } - - //! outer radius - double rOut(void) const { return (rOut_); } - - //! angular start of the tube-section - double startPhi(void) const { return (startPhi_); } - - //! angular span of the tube-section - double deltaPhi(void) const { return (deltaPhi_); } - - //! truncation at begin of the tube-section - double cutAtStart(void) const { return (cutAtStart_); } - - //! truncation at end of the tube-section - double cutAtDelta(void) const { return (cutAtDelta_); } - - //! true, if truncation is on the inner side of the tube-section - bool cutInside(void) const { return (cutInside_); } - - const bool valid; - - private: - double zHalf_; - double rIn_; - double rOut_; - double startPhi_; - double deltaPhi_; - double cutAtStart_; - double cutAtDelta_; - bool cutInside_; - }; - } // namespace dd -} // namespace cms - -#endif diff --git a/DetectorDescription/DDCMS/src/DDShapes.cc b/DetectorDescription/DDCMS/src/DDShapes.cc deleted file mode 100644 index 1694ccdd6d292..0000000000000 --- a/DetectorDescription/DDCMS/src/DDShapes.cc +++ /dev/null @@ -1,169 +0,0 @@ -#include "DetectorDescription/DDCMS/interface/DDAlgoArguments.h" -#include "DetectorDescription/DDCMS/interface/DDShapes.h" -#include "DetectorDescription/DDCMS/interface/DDSolidShapes.h" -#include "DataFormats/GeometryVector/interface/Phi.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "DD4hep/Shapes.h" -#include - -using namespace cms; -using namespace cms::dd; -using namespace angle_units::operators; - -template -bool convFpToBool(T val) { - return (static_cast(val + 0.5) != 0); -} - -cms::DDSolidShape cms::dd::getCurrentShape(const DDFilteredView &fview) { - if (fview.isABox()) - return (DDSolidShape::ddbox); - - if (fview.isAConeSeg()) - return (DDSolidShape::ddcons); - - if (fview.isATrapezoid()) - return (DDSolidShape::ddtrap); - - if (fview.isATubeSeg()) - return (DDSolidShape::ddtubs); - - if (fview.isATruncTube()) - return (DDSolidShape::ddtrunctubs); - - if (fview.isAPseudoTrap()) // Rarely used -- put it last - return (DDSolidShape::ddpseudotrap); - - return (DDSolidShape::dd_not_init); -} - -// ** DDBox -DDBox::DDBox(const DDFilteredView &fv) : valid{fv.isABox()} { - if (valid) { - const TGeoBBox *box = fv.getShapePtr(); - dx_ = box->GetDX(); - dy_ = box->GetDY(); - dz_ = box->GetDZ(); - } -} - -// ** end DDBox - -// ** DDCons - -DDCons::DDCons(const DDFilteredView &fv) : valid{fv.isAConeSeg()} { - if (valid) { - const TGeoConeSeg *coneSeg = fv.getShapePtr(); - dz_ = coneSeg->GetDZ(); - phi1_ = convertDegToRad(coneSeg->GetPhi1()); - phi2_ = convertDegToRad(coneSeg->GetPhi2()) - phi1_; - - // Limit to range -pi to pi - Geom::NormalizeWrapper::normalize(phi1_); - rmin1_ = coneSeg->GetRmin1(); - rmin2_ = coneSeg->GetRmin2(); - rmax1_ = coneSeg->GetRmax1(); - rmax2_ = coneSeg->GetRmax2(); - } -} - -// ** end of DDCons - -// ** DDPseudoTrap -// No longer used -- this code does not work right -/* -DDPseudoTrap::DDPseudoTrap(const DDFilteredView &fv) : valid{fv.isAPseudoTrap()} { - if (valid) { - auto trap = fv.solid(); - std::vector params = trap.dimensions(); - minusX_ = params[0]; - plusX_ = params[1]; - minusY_ = params[2]; - plusY_ = params[3]; - dz_ = params[4]; - rmax_ = params[5]; - minusZSide_ = convFpToBool(params[6]); - } -} -*/ -// ** end of DDPseudoTrap - -// *** DDTrap - -DDTrap::DDTrap(const DDFilteredView &fv) : valid{fv.isATrapezoid()} { - if (valid) { - const TGeoTrap *trap = fv.getShapePtr(); - halfZ_ = trap->GetDz(); - theta_ = convertDegToRad(trap->GetTheta()); - phi_ = convertDegToRad(trap->GetPhi()); - x1_ = trap->GetBl1(); // Along x, low y, low z - x2_ = trap->GetTl1(); // Along x, high y, low z - y1_ = trap->GetH1(); // Along y, low z - y2_ = trap->GetH2(); // Along y, high z - x3_ = trap->GetBl2(); // Along x, low y, high z - x4_ = trap->GetTl2(); // Along x, high y, high z - alpha1_ = convertDegToRad(trap->GetAlpha1()); - alpha2_ = convertDegToRad(trap->GetAlpha2()); - } -} - -// *** end of DDTrap - -// ** DDTubs - -DDTubs::DDTubs(const DDFilteredView &fv) : valid{fv.isATubeSeg()} { - if (valid) { - const TGeoTubeSeg *tube = fv.getShapePtr(); - zHalf_ = tube->GetDz(); - rIn_ = tube->GetRmin(); - rOut_ = tube->GetRmax(); - startPhi_ = convertDegToRad(tube->GetPhi1()); - deltaPhi_ = convertDegToRad(tube->GetPhi2()) - startPhi_; - - // Limit to range -pi to pi - Geom::NormalizeWrapper::normalize(startPhi_); - } -} - -// *** end of DDTubs - -// ** DDTruncTubs - -DDTruncTubs::DDTruncTubs(const DDFilteredView &fv) : valid{fv.isATruncTube()} { - if (valid) { - auto tube = fv.solid(); - std::vector params = tube.dimensions(); - if (params.size() < 8) { - edm::LogError("DDShapes DDTruncTubs") << "Truncated tube parameters list too small: " << params.size(); - return; - } - LogTrace("DDShapes DDTruncTubs") << "DDTruncTubs zHalf = " << params[0]; - LogTrace("DDShapes DDTruncTubs") << "DDTruncTubs rIn = " << params[1]; - LogTrace("DDShapes DDTruncTubs") << "DDTruncTubs rOut = " << params[2]; - LogTrace("DDShapes DDTruncTubs") << "DDTruncTubs startPhi = " << params[3]; - LogTrace("DDShapes DDTruncTubs") << "DDTruncTubs deltaPhi = " << params[4]; - LogTrace("DDShapes DDTruncTubs") << "DDTruncTubs cutAtStart = " << params[5]; - LogTrace("DDShapes DDTruncTubs") << "DDTruncTubs cutAtDelta = " << params[6]; - LogTrace("DDShapes DDTruncTubs") << "DDTruncTubs cutInside = " << params[7]; - - zHalf_ = params[0]; // This order determined by reading DD4hep source code - rIn_ = params[1]; - rOut_ = params[2]; - startPhi_ = params[3]; - deltaPhi_ = params[4]; - cutAtStart_ = params[5]; - cutAtDelta_ = params[6]; - cutInside_ = (params[7] != 0); - - /* Previous versions of DD4hep output parameters that required more complex conversion - * to produce the values CMS needs. Now the desired values are returned directly by the - * "dimensions" function. If the more complex conversion is ever needed again, the git history - * of this file from before 2019-11-25 has code for converting from the internal DD4hep parameters - * for a TruncatedTube to the eight parameters used by CMS. - * There is also example code for checking the parameters of the TGeoCompositeShape. - */ - } -} - -// *** end of DDTruncTubs From d6df76b921476150ed8a26f64c148676473ec92f Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Fri, 25 Sep 2020 17:02:40 +0200 Subject: [PATCH 054/778] Protect against ill-defined track momenta and reffited tau vertices (tauReco@miniAOD) --- .../RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc | 3 +++ RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/RecoTauTag/RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc b/RecoTauTag/RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc index 31dd96daa31b3..ed2e8104ba55c 100644 --- a/RecoTauTag/RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc +++ b/RecoTauTag/RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc @@ -72,6 +72,9 @@ void PFTauMiniAODPrimaryVertexProducer::nonTauTracksInPVFromPackedCands( const reco::Track *track = cand.bestTrack(); if (track == nullptr) continue; + //MB: Skip tracks with ill-defined momentum (why it happens?) + if (!std::isfinite(track->pt()) || !std::isfinite(track->eta()) || !std::isfinite(track->phi())) + continue; //Remove signal (tau) tracks //MB: Only deltaR deltaPt overlap removal possible (?) //MB: It should be fine as pat objects stores same track info with same presision diff --git a/RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc b/RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc index 60a26365b90bc..66eeca4b94f81 100644 --- a/RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc +++ b/RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc @@ -204,6 +204,14 @@ void PFTauPrimaryVertexProducerBase::produce(edm::Event& iEvent, const edm::Even } else { transVtx = avf.vertex(transTracks, *beamSpot); } + if (!transVtx.isValid()) { + fitOK = false; + } else { + //MB: protect against rare cases when transVtx is valid but its position is ill-defined + reco::Vertex::Point pvPos(transVtx.position()); + if (!std::isfinite(pvPos.z())) //MB: it is enough to check one coordinate (?) + fitOK = false; + } } else fitOK = false; if (fitOK) From 540987b604e54c425d81d4c28be59b82c12bfbdb Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 18:01:11 +0200 Subject: [PATCH 055/778] dd4hep::Solid is a typedef of Solid_type, defined in DD4hep/Shapes.h and not Volumes, so at least let s be clean --- Geometry/TrackerNumberingBuilder/interface/GeometricDet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index 42304f02f3831..f96676decc7ba 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -9,7 +9,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/types.h" -#include +#include #include #include From c05b9fe78350d12efe4b584f78c10aba9a4bf66f Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 18:03:31 +0200 Subject: [PATCH 056/778] Fix regression in PixelROC_X and PixelROC_Y appearing after member data underscore style cleaning --- Geometry/TrackerNumberingBuilder/src/GeometricDet.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index af1d1b379f691..725c56ad43c09 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -81,8 +81,8 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) xi_(getDouble("TrackerXi", *fv)), pixROCRows_(getDouble("PixelROCRows", *fv)), pixROCCols_(getDouble("PixelROCCols", *fv)), - pixROCx_(getDouble("PixelROCX_", *fv)), - pixROCy_(getDouble("PixelROCY_", *fv)), + pixROCx_(getDouble("PixelROC_X", *fv)), + pixROCy_(getDouble("PixelROC_Y", *fv)), stereo_(getString("TrackerStereoDetectors", *fv) == strue), isLowerSensor_(getString("TrackerLowerDetectors", *fv) == strue), isUpperSensor_(getString("TrackerUpperDetectors", *fv) == strue), @@ -110,13 +110,13 @@ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) xi_(fv->get("TrackerXi")), // To be studied pixROCRows_(fv->get("PixelROCRows")), pixROCCols_(fv->get("PixelROCCols")), - pixROCx_(fv->get("PixelROCX_")), - pixROCy_(fv->get("PixelROCY_")), + pixROCx_(fv->get("PixelROC_X")), + pixROCy_(fv->get("PixelROC_Y")), stereo_(fv->get("TrackerStereoDetectors") == strue), isLowerSensor_(fv->get("TrackerLowerDetectors") == strue), isUpperSensor_(fv->get("TrackerUpperDetectors") == strue), siliconAPVNum_(fv->get("SiliconAPVNumber")), - isFromDD4hep_(true) {} + isFromDD4hep_(true) {} // PGeometricDet is persistent version... make it... then come back here and make the // constructor. From 0e9b8ac1c57d4bce166e2aac2bac810001d3dbf3 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 18:09:34 +0200 Subject: [PATCH 057/778] scram b code-format --- .../plugins/CmsDetConstruction.cc | 25 ++++++++----------- .../src/GeometricDet.cc | 2 +- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index 2a7743e1b700d..449b1344c0ac7 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -52,12 +52,12 @@ template <> void CmsDetConstruction::buildComponent(DDFilteredView& fv, GeometricDet* mother, const std::string& attribute) { - // Mother volume // Module with 2 sensors: the mother volume is the module volume. // Module with 1 sensor: the mother volume is the ladder volume. const std::string& myTopologicalNameInXMLs = ExtractStringFromDDD::getString(attribute, &fv); - const GeometricDet::GDEnumType& myTopologicalType = CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type(myTopologicalNameInXMLs); + const GeometricDet::GDEnumType& myTopologicalType = + CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type(myTopologicalNameInXMLs); GeometricDet* det = new GeometricDet(&fv, myTopologicalType); @@ -66,18 +66,16 @@ void CmsDetConstruction::buildComponent(DDFilteredView& fv, // CASE A: MODULE HAS 2 SENSORS if (isPhase1ModuleWith2Sensors || isPhase2ModuleWith2Sensors) { - // Go down in hierarchy: from module to sensor - bool dodets = fv.firstChild(); // very important + bool dodets = fv.firstChild(); // very important while (dodets) { - // PHASE 1 (MERGEDDET) if (isPhase1ModuleWith2Sensors) { - buildSmallDetsforGlued(fv, det, attribute); + buildSmallDetsforGlued(fv, det, attribute); } // PHASE 2 (STACKDET) else if (isPhase2ModuleWith2Sensors) { - buildSmallDetsforStack(fv, det, attribute); + buildSmallDetsforStack(fv, det, attribute); } dodets = fv.nextSibling(); @@ -93,7 +91,6 @@ void CmsDetConstruction::buildComponent(DDFilteredView& fv, mother->addComponent(det); } - /* * DD4hep. * Module with 2 sensors: calculate the sensor local ID, and add the sensor to its mother volume (module). @@ -103,12 +100,12 @@ template <> void CmsDetConstruction::buildComponent(cms::DDFilteredView& fv, GeometricDet* mother, const std::string& attribute) { - // Mother volume // Module with 2 sensors: the mother volume is the module volume. // Module with 1 sensor: the mother volume is the ladder volume. const std::string& myTopologicalNameInXMLs = ExtractStringFromDDD::getString(attribute, &fv); - const GeometricDet::GDEnumType& myTopologicalType = CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type(myTopologicalNameInXMLs); + const GeometricDet::GDEnumType& myTopologicalType = + CmsTrackerLevelBuilder::theCmsTrackerStringToEnum.type(myTopologicalNameInXMLs); GeometricDet* det = new GeometricDet(&fv, myTopologicalType); const bool isPhase1ModuleWith2Sensors = (myTopologicalType == GeometricDet::mergedDet); @@ -116,9 +113,8 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView // CASE A: MODULE HAS 2 SENSORS if (isPhase1ModuleWith2Sensors || isPhase2ModuleWith2Sensors) { - // Go down in hierarchy: from module to sensor - if (!fv.firstChild()) { // very important + if (!fv.firstChild()) { // very important edm::LogError("CmsDetConstruction::buildComponent. Cannot go down to sensor volume."); return; } @@ -128,14 +124,13 @@ void CmsDetConstruction::buildComponent(cms::DDFilteredView // Loop on all siblings (ie, on all sensors) while (fv.level() == sensorHierarchyLevel) { - // PHASE 1 (MERGEDDET) if (isPhase1ModuleWith2Sensors) { - buildSmallDetsforGlued(fv, det, attribute); + buildSmallDetsforGlued(fv, det, attribute); } // PHASE 2 (STACKDET) else if (isPhase2ModuleWith2Sensors) { - buildSmallDetsforStack(fv, det, attribute); + buildSmallDetsforStack(fv, det, attribute); } // Go to the next volume in FilteredView. diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 725c56ad43c09..a59b094947aba 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -116,7 +116,7 @@ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) isLowerSensor_(fv->get("TrackerLowerDetectors") == strue), isUpperSensor_(fv->get("TrackerUpperDetectors") == strue), siliconAPVNum_(fv->get("SiliconAPVNumber")), - isFromDD4hep_(true) {} + isFromDD4hep_(true) {} // PGeometricDet is persistent version... make it... then come back here and make the // constructor. From 369a08c8dce0d6f32111f539720caa0cf01451a8 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 25 Sep 2020 18:55:02 +0200 Subject: [PATCH 058/778] def some convenient I/O convention and use it --- .../macros/MultiRunAndPlotPVValidation.C | 164 +++++++++--------- 1 file changed, 86 insertions(+), 78 deletions(-) diff --git a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C index 335318742f929..ee2163063ccca 100644 --- a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C +++ b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C @@ -35,6 +35,13 @@ #include #include +/*! + * \def some convenient I/O + */ +#define logInfo std::cout << "INFO: " +#define logWarning std::cout << "WARNING: " +#define logError std::cout << "ERROR!!! " + /*! * \def boolean to decide if it is in debug mode */ @@ -172,7 +179,7 @@ namespace pv { alignmentTrend higherr, alignmentTrend chi2, alignmentTrend KS) { - std::cout << "pv::wrappedTrends c'tor" << std::endl; + logInfo << "pv::wrappedTrends c'tor" << std::endl; m_mean = mean; m_low = low; @@ -230,7 +237,7 @@ namespace pv { m_times = times; m_useRMS = useRMS; - std::cout << "pv::bundle c'tor: " << dataTypeLabel << " member: " << m_datatypelabel << std::endl; + logInfo << "pv::bundle c'tor: " << dataTypeLabel << " member: " << m_datatypelabel << std::endl; // make sure you don't use them at the same time if (lumiaxisformat || timeaxisformat) { @@ -238,16 +245,16 @@ namespace pv { } if (lumiaxisformat) { - std::cout << "is lumiaxis format" << std::endl; + logInfo << "is lumiaxis format" << std::endl; m_axis_types.set(0); } else if (timeaxisformat) { - std::cout << "is timeaxis format" << std::endl; + logInfo << "is timeaxis format" << std::endl; m_axis_types.set(1); } else { - std::cout << "is runaxis format" << std::endl; + logInfo << "is runaxis format" << std::endl; } - std::cout << m_axis_types << std::endl; + logInfo << m_axis_types << std::endl; m_totalLumi = lumiMapByRun.rbegin()->second; } @@ -262,12 +269,12 @@ namespace pv { bool isTimeAxis() const { return m_axis_types.test(1); } bool isUsingRMS() const { return m_useRMS; } void printAll() { - std::cout << "dataType " << m_datatype << std::endl; - std::cout << "dataTypeLabel " << m_datatypelabel << std::endl; + logInfo << "dataType " << m_datatype << std::endl; + logInfo << "dataTypeLabel " << m_datatypelabel << std::endl; if (this->isLumiAxis()) - std::cout << "is lumi axis" << std::endl; + logInfo << "is lumi axis" << std::endl; if (this->isTimeAxis()) - std::cout << "is time axis" << std::endl; + logInfo << "is time axis" << std::endl; } private: @@ -527,10 +534,10 @@ void MultiRunPVValidation( // consistency check, we cannot do plot vs lumi if time_axis if (lumi_axis_format && time_axis_format) { - std::cout << "##########################################################################################" - << std::endl; - std::cout << "msg-i: MultiRunPVValidation(): you're requesting both summary vs lumi and vs time, " << std::endl; - std::cout << " this combination is inconsistent --> exiting!" << std::endl; + logError << "##########################################################################################" + << std::endl; + logError << "msg-i: MultiRunPVValidation(): you're requesting both summary vs lumi and vs time, " << std::endl; + logError << " this combination is inconsistent --> exiting!" << std::endl; exit(EXIT_FAILURE); } @@ -540,8 +547,8 @@ void MultiRunPVValidation( std::ifstream infile("times.txt"); if (!infile) { - std::cout << "Required time axis options, but missing input times file :(" << std::endl; - std::cout << " -- exiting" << std::endl; + logError << "Required time axis options, but missing input times file :(" << std::endl; + logError << " -- exiting" << std::endl; exit(EXIT_FAILURE); } @@ -553,7 +560,7 @@ void MultiRunPVValidation( break; } // error - //std::cout<Add(aFileLegPair->At(0)); LabelList->Add(aFileLegPair->At(1)); } else { - std::cout << "Please give file name and legend entry in the following form:\n" - << " filename1=legendentry1,filename2=legendentry2\n"; + logError << "Please give file name and legend entry in the following form:\n" + << " filename1=legendentry1,filename2=legendentry2\n"; } } @@ -617,7 +624,7 @@ void MultiRunPVValidation( TObjString *dir = (TObjString *)DirList->At(j); LegLabels[j] = legend->String(); dirs[j] = (dir->String()).Data(); - cout << "MultiRunPVValidation(): label[" << j << "]" << LegLabels[j] << endl; + logInfo << "MultiRunPVValidation(): label[" << j << "]" << LegLabels[j] << endl; std::vector currentList = list_files(dirs[j]); std::vector tempSwap; @@ -647,8 +654,8 @@ void MultiRunPVValidation( if (lumi_axis_format && useLumiByFile) { std::ifstream lumifile(lumiInputFile.Data()); if (!lumifile) { - std::cout << "Required luminosity from file, but missing input file :(" << std::endl; - std::cout << " -- exiting" << std::endl; + logError << "Required luminosity from file, but missing input file :(" << std::endl; + logError << " -- exiting" << std::endl; exit(EXIT_FAILURE); } @@ -669,15 +676,15 @@ void MultiRunPVValidation( lumiMapByRun[run] = (lumiSoFar + lumi); lumiSoFar += lumi; } else { - std::cout << "WARNING! Run: " << run << " is not found in the intersection" << std::endl; + logWarning << " Run: " << run << " is not found in the intersection" << std::endl; } - std::cout << run << " ====> lumi so far: " << lumiSoFar << std::endl; + logInfo << run << " ====> lumi so far: " << lumiSoFar << std::endl; } } // debug only for (UInt_t index = 0; index < intersection.size(); index++) { - std::cout << index << " " << intersection[index] << std::endl; + logInfo << index << " " << intersection[index] << std::endl; } // book the vectors of values @@ -725,13 +732,13 @@ void MultiRunPVValidation( //std::function f_processData = std::bind(processData,1,intersection,nDirs_,dirs,LegLabels,lumiSoFar,runs,lumiByRun,lumiMapByRun,useRMS,dxyPhiMeans_,dxyPhiHi_,dxyPhiLo_,dxyEtaMeans_,dxyEtaHi_,dxyEtaLo_,dzPhiMeans_,dzPhiHi_,dzPhiLo_,dzEtaMeans_,dzEtaHi_,dzEtaLo_,dxyVect,dzVect); - std::cout << " pre do-stuff: " << runs.size() << std::endl; + logInfo << " pre do-stuff: " << runs.size() << std::endl; //we should use std::bind to create a functor and then pass it to the procPool auto f_processData = std::bind(processData, _1, intersection, nDirs_, dirs, LegLabels, useRMS); //f_processData(0); - //std::cout<<" post do-stuff: " << runs.size() << std::endl; + //logInfo<<" post do-stuff: " << runs.size() << std::endl; TProcPool procPool(std::min(nWorkers, intersection.size())); std::vector range(std::min(nWorkers, intersection.size())); @@ -747,7 +754,7 @@ void MultiRunPVValidation( // re-assemble everything together for (auto extractedTrend : extracts) { if (!useLumiByFile) { - std::cout << "lumiSoFar: " << lumiSoFar << "/fb" << std::endl; + logInfo << "lumiSoFar: " << lumiSoFar << "/fb" << std::endl; } runs.insert(std::end(runs), std::begin(extractedTrend.m_runs), std::end(extractedTrend.m_runs)); @@ -757,7 +764,7 @@ void MultiRunPVValidation( for (const auto &run : extractedTrend.m_runs) { if (!useLumiByFile) { - std::cout << run << " ====> lumi so far: " << lumiSoFar + extractedTrend.m_lumiMapByRun[run] << std::endl; + logInfo << run << " ====> lumi so far: " << lumiSoFar + extractedTrend.m_lumiMapByRun[run] << std::endl; lumiByRun.push_back(lumiSoFar + extractedTrend.m_lumiMapByRun[run]); lumiMapByRun[run] = (lumiSoFar + extractedTrend.m_lumiMapByRun[run]); } @@ -863,8 +870,8 @@ void MultiRunPVValidation( dxyEtaLoErr_[label].push_back(std::abs(dxyEtaLo_[label][it] - dxyEtaMeans_[label][it])); if (VERBOSE) { - std::cout << "label: " << label << " means:" << dxyEtaMeans_[label][it] << " low: " << dxyEtaLo_[label][it] - << " loErr: " << dxyEtaLoErr_[label][it] << std::endl; + logInfo << "label: " << label << " means:" << dxyEtaMeans_[label][it] << " low: " << dxyEtaLo_[label][it] + << " loErr: " << dxyEtaLoErr_[label][it] << std::endl; } dzPhiHiErr_[label].push_back(std::abs(dzPhiHi_[label][it] - dzPhiMeans_[label][it])); @@ -876,7 +883,7 @@ void MultiRunPVValidation( // just check runs are ordered //for(const auto &run : runs){ - // std::cout<<" "<< run ; + // logInfo<<" "<< run ; // } // main function call @@ -974,13 +981,14 @@ void MultiRunPVValidation( if (!useLumiByFile) { x_ticks = lumiByRun; } else { + //x_ticks = lumiByRun; /* double myLumi(0.); for(const auto [iRun, iLumi] : lumiMapByRun){ myLumi+=iLumi; if(std::find(runs.begin(), runs.end(), iRun) != runs.end()){ x_ticks.push_back(myLumi); - std::cout << " recompute run" << iRun << "lumi" << myLumi << std::endl; + logInfo << " recompute run" << iRun << "lumi" << myLumi << std::endl; } } */ @@ -1076,11 +1084,11 @@ void MultiRunPVValidation( for (Int_t j = 0; j < nDirs_; j++) { // check on the sanity - std::cout << "x_ticks.size()= " << x_ticks.size() << " dxyPhiMeans_[LegLabels[" << j - << "]].size()=" << dxyPhiMeans_[LegLabels[j]].size() << std::endl; + logInfo << "x_ticks.size()= " << x_ticks.size() << " dxyPhiMeans_[LegLabels[" << j + << "]].size()=" << dxyPhiMeans_[LegLabels[j]].size() << std::endl; // otherwise something very bad has happened - assert(x_ticks.size() == dxyPhiMeans_[LegLabels[j]].size()); + //assert(x_ticks.size() == dxyPhiMeans_[LegLabels[j]].size()); // ************************************* // dxy vs phi @@ -1691,28 +1699,28 @@ void MultiRunPVValidation( gSystem->mkdir("Biases"); TString processline = ".! mv Bias*.p* ./Biases/"; - std::cout << "Executing: \n" << processline << "\n" << std::endl; + logInfo << "Executing: \n" << processline << "\n" << std::endl; gROOT->ProcessLine(processline.Data()); gSystem->Sleep(100); processline.Clear(); gSystem->mkdir("ResolutionsVsPt"); processline = ".! mv ResolutionsVsPt*.p* ./ResolutionsVsPt/"; - std::cout << "Executing: \n" << processline << "\n" << std::endl; + logInfo << "Executing: \n" << processline << "\n" << std::endl; gROOT->ProcessLine(processline.Data()); gSystem->Sleep(100); processline.Clear(); gSystem->mkdir("Resolutions"); processline = ".! mv Resolutions*.p* ./Resolutions/"; - std::cout << "Executing: \n" << processline << "\n" << std::endl; + logInfo << "Executing: \n" << processline << "\n" << std::endl; gROOT->ProcessLine(processline.Data()); gSystem->Sleep(100); processline.Clear(); gSystem->mkdir("Pulls"); processline = ".! mv Pulls*.p* ./Pulls/"; - std::cout << "Executing: \n" << processline << "\n" << std::endl; + logInfo << "Executing: \n" << processline << "\n" << std::endl; gROOT->ProcessLine(processline.Data()); gSystem->Sleep(100); processline.Clear(); @@ -1815,11 +1823,11 @@ void outputGraphs(const pv::wrappedTrends &allInputs, g_mean->GetYaxis()->SetTitle(Form("#LT d_{%s}(#%s) #GT [#mum]", coord, kin)); g_mean->GetYaxis()->SetRangeUser(-ampl, ampl); - std::cout << "====================================================================================================" - << std::endl; - std::cout << mybundle.getTotalLumi() << std::endl; - std::cout << "====================================================================================================" - << std::endl; + logInfo << "====================================================================================================" + << std::endl; + logInfo << "Total Luminosity: " << mybundle.getTotalLumi() << std::endl; + logInfo << "====================================================================================================" + << std::endl; g_asym->SetName(Form("gerr_bias_d%s_%s_%s", coord, kin, label.Data())); g_asym->SetTitle(Form("Bias of d_{%s}(#%s) vs %s", coord, kin, mybundle.getDataType())); @@ -1935,7 +1943,7 @@ void outputGraphs(const pv::wrappedTrends &allInputs, // at the last file re-loop if (index == (mybundle.getNObjects() - 1)) { auto theMax = getMaximumFromArray(array); - std::cout << "the max for d" << coord << "(" << kin << ") RMS is " << theMax << std::endl; + logInfo << "the max for d" << coord << "(" << kin << ") RMS is " << theMax << std::endl; for (Int_t k = 0; k < mybundle.getNObjects(); k++) { //h_RMS[k]->GetYaxis()->SetRangeUser(-theMax*0.45,theMax*1.40); @@ -1977,12 +1985,12 @@ std::vector list_files(const char *dirname, const char *ext) while ((file = (TSystemFile *)next())) { fname = file->GetName(); if (!file->IsDirectory() && fname.EndsWith(ext) && fname.BeginsWith("PVValidation")) { - //std::cout << fname.Data() << std::endl; + //logInfo << fname.Data() << std::endl; TObjArray *bits = fname.Tokenize("_"); TString theRun = bits->At(2)->GetName(); - //std::cout << theRun << std::endl; + //logInfo << theRun << std::endl; TString formatRun = (theRun.ReplaceAll(".root", "")).ReplaceAll("_", ""); - //std::cout << dirname << " "<< formatRun.Atoi() << std::endl; + //logInfo << dirname << " "<< formatRun.Atoi() << std::endl; theRunNumbers.push_back(formatRun.Atoi()); } } @@ -2083,7 +2091,7 @@ void arrangeOutCanvas(TCanvas *canv, // } auto my_view = checkTheView(theTitle); - //std::cout<<" ----------------------------------> " << theTitle << " view: " << my_view << std::endl; + //logInfo<<" ----------------------------------> " << theTitle << " view: " << my_view << std::endl; switch (my_view) { case pv::dxyphi: @@ -2212,7 +2220,7 @@ void makeNewXAxis(TH1 *h) axmax = 8; ndiv = 510; } else { - std::cout << "unrecognized variable" << std::endl; + logError << "unrecognized variable" << std::endl; } // Remove the current axis @@ -2371,7 +2379,7 @@ void cmsPrel(TPad *pad, size_t ipads) { UInt_t h; latex->GetTextExtent(w, h, "Internal (13 TeV)"); float size = w / (W / ipads); - //std::cout<SetTextAlign(33); @@ -2450,7 +2458,7 @@ TH1F *DrawConstantGraph(TGraph *graph, Int_t iter, Double_t theConst) Double_t xmin = graph->GetXaxis()->GetXmin(); //TMath::MinElement(graph->GetN(),graph->GetX()); Double_t xmax = graph->GetXaxis()->GetXmax(); //TMath::MaxElement(graph->GetN(),graph->GetX()); - //std::cout<GetName(), iter), Form("hconst_%s_%i", graph->GetName(), iter), @@ -2721,7 +2729,7 @@ Double_t getMaximumFromArray(TObjArray *array) TMath::Quantiles(maxima.size(), nq, &(maxima[0]), yq, xq); //for(int q=0;q theMaximum) theMaximum = theMaxForThisHist; @@ -2742,7 +2750,7 @@ Double_t getMaximumFromArray(TObjArray *array) /* if( (static_cast(array->At(i)))->GetMaximum() > theMaximum){ theMaximum = (static_cast(array->At(i)))->GetMaximum(); - //cout<<"i= "< truns; for (auto const &imap : timeMap) { - std::cout << " run:" << imap.first << " time: " << imap.second.Convert() << std::endl; + logInfo << " run:" << imap.first << " time: " << imap.second.Convert() << std::endl; } /* Run-2 Ultra-Legacy ReReco IOVs (from tag SiPixelTemplateDBObject_38T_v16_offline) @@ -2868,7 +2876,7 @@ void superImposeIOVBoundaries(TCanvas *c, if (lumi_axis_format) { if (closestrun < 0) continue; - //std::cout<< "natural boundary: " << IOVboundaries[IOV] << " closest:" << closestrun << std::endl; + //logInfo<< "natural boundary: " << IOVboundaries[IOV] << " closest:" << closestrun << std::endl; a_lines[IOV] = new TArrow( lumiMapByRun.at(closestrun), (c->GetUymin()), lumiMapByRun.at(closestrun), c->GetUymax(), 0.5, "|>"); @@ -2885,7 +2893,7 @@ void superImposeIOVBoundaries(TCanvas *c, } else if (time_axis_format) { if (closestrun < 0) continue; - std::cout << "natural boundary: " << IOVboundaries[IOV] << " closest:" << closestrun << std::endl; + logInfo << "natural boundary: " << IOVboundaries[IOV] << " closest:" << closestrun << std::endl; a_lines[IOV] = new TArrow( timeMap.at(closestrun).Convert(), (c->GetUymin()), timeMap.at(closestrun).Convert(), c->GetUymax(), 0.5, "|>"); @@ -2958,7 +2966,7 @@ void superImposeIOVBoundaries(TCanvas *c, } else { _sx = rx * (IOVboundaries[IOV] - rx1) + x1ndc; //-0.05 } - Double_t _dx = _sx + 0.05; + Double_t _dx = _sx + 0.03; Int_t index = IOV % 5; // if(IOV<5) @@ -3007,7 +3015,7 @@ outTrends processData(size_t iter, unsigned int first = iter * pitch; unsigned int last = (iter == (effSize - 1)) ? intersection.size() : ((iter + 1) * pitch); - std::cout << "iter:" << iter << "| pitch: " << pitch << " [" << first << "-" << last << ")" << std::endl; + logInfo << "iter:" << iter << "| pitch: " << pitch << " [" << first << "-" << last << ")" << std::endl; ret.m_index = iter; @@ -3019,7 +3027,7 @@ outTrends processData(size_t iter, // continue; if (VERBOSE) { - std::cout << "iter: " << iter << " " << n << " " << intersection.at(n) << std::endl; + logInfo << "iter: " << iter << " " << n << " " << intersection.at(n) << std::endl; } TFile *fins[nDirs_]; @@ -3069,16 +3077,16 @@ outTrends processData(size_t iter, fins[j] = new TFile(Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n])); if (fins[j]->IsZombie()) { - std::cout << Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n]) - << " is a Zombie! cannot combine" << std::endl; + logError << Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n]) + << " is a Zombie! cannot combine" << std::endl; areAllFilesOK = false; lastOpen = j; break; } if (VERBOSE) { - std::cout << Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n]) - << " has size: " << fins[j]->GetSize() << " b "; + logInfo << Form("%s/PVValidation_%s_%i.root", dirs[j], stem.c_str(), intersection[n]) + << " has size: " << fins[j]->GetSize() << " b "; } // sanity check @@ -3087,7 +3095,7 @@ outTrends processData(size_t iter, TH1F *h_lumi = (TH1F *)fins[j]->Get("PVValidation/EventFeatures/h_lumiFromConfig"); double lumi = h_lumi->GetBinContent(1); ret.m_lumiSoFar += lumi; - //std::cout<<"lumi: "<GetEntries(); if (numEvents < 2500) { - std::cout << "excluding " << intersection[n] << " because it has less than 2.5k events" << std::endl; + logWarning << "excluding run " << intersection[n] << " because it has less than 2.5k events" << std::endl; areAllFilesOK = false; lastOpen = j; break; @@ -3141,7 +3149,7 @@ outTrends processData(size_t iter, auto dxyPhiBiases = getBiases(dxyPhiMeanTrend[j]); - //std::cout<<"\n" < not all files are OK" << std::endl; + logWarning << "====> not all files are OK" << std::endl; for (int i = 0; i < lastOpen; i++) { fins[i]->Close(); @@ -3245,7 +3253,7 @@ outTrends processData(size_t iter, } if (VERBOSE) { - std::cout << "I am still here - runs.size(): " << ret.m_runs.size() << std::endl; + logInfo << "I am still here - runs.size(): " << ret.m_runs.size() << std::endl; } // Bias plots @@ -3373,7 +3381,7 @@ outTrends processData(size_t iter, delete ResolutionsVsPt; if (VERBOSE) { - std::cout << std::endl; + logInfo << std::endl; } } From 388fa286f7a4fdea145748c08ef79a53238d5197 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 25 Sep 2020 19:02:13 +0200 Subject: [PATCH 059/778] final clean-up --- .../macros/MultiRunAndPlotPVValidation.C | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C index ee2163063ccca..d2132c777278f 100644 --- a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C +++ b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C @@ -981,17 +981,7 @@ void MultiRunPVValidation( if (!useLumiByFile) { x_ticks = lumiByRun; } else { - //x_ticks = lumiByRun; - /* - double myLumi(0.); - for(const auto [iRun, iLumi] : lumiMapByRun){ - myLumi+=iLumi; - if(std::find(runs.begin(), runs.end(), iRun) != runs.end()){ - x_ticks.push_back(myLumi); - logInfo << " recompute run" << iRun << "lumi" << myLumi << std::endl; - } - } - */ + // x_ticks = lumiByRun; (generally it's wrong) // in case we are passing the luminosity per run by file, need to re-check the map // in order to fill the x ticks of the graph only for the run which actually pass the selection double lastLumi(0.); @@ -1088,7 +1078,7 @@ void MultiRunPVValidation( << "]].size()=" << dxyPhiMeans_[LegLabels[j]].size() << std::endl; // otherwise something very bad has happened - //assert(x_ticks.size() == dxyPhiMeans_[LegLabels[j]].size()); + assert(x_ticks.size() == dxyPhiMeans_[LegLabels[j]].size()); // ************************************* // dxy vs phi From 84083a73a9d6e32551e8389ae3353c0eb8c55347 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 19:36:58 +0200 Subject: [PATCH 060/778] Fix printouts --- .../plugins/CmsTrackerLevelBuilder.cc | 36 ++++++++++-------- .../plugins/DDDCmsTrackerContruction.cc | 8 ++-- .../test/trackerModuleNumberingDD4hep_cfg.py | 37 ++++++++++++++++++- .../test/trackerModuleNumbering_cfg.py | 36 +++++++++++++++++- 4 files changed, 94 insertions(+), 23 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index 18ed5df28a926..f6942b0c6c577 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -144,20 +144,21 @@ template <> void CmsTrackerLevelBuilder::build(DDFilteredView& fv, GeometricDet* tracker, const std::string& attribute) { - edm::LogVerbatim("CmsTrackerLevelBuilder::build called on volume") - << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type(); + edm::LogVerbatim("CmsTrackerLevelBuilder") + << "CmsTrackerLevelBuilder::build called on volume" + << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); // Go down one level in hierarchy bool doLayers = fv.firstChild(); while (doLayers) { - edm::LogVerbatim("Calling buildComponent, before"); + edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, before"; // Call build on sibling buildComponent(fv, tracker, attribute); - edm::LogVerbatim("Calling buildComponent, after"); + edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, after"; // Go to next sibling doLayers = fv.nextSibling(); @@ -169,7 +170,7 @@ void CmsTrackerLevelBuilder::build(DDFilteredView& fv, // Now that all GeometricDets of a given hierarchy level are built, sort them! sortNS(fv, tracker); - edm::LogVerbatim("CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."); + edm::LogVerbatim("CmsTrackerLevelBuilder") << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; } /* @@ -179,9 +180,10 @@ template <> void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, GeometricDet* tracker, const std::string& attribute) { - edm::LogVerbatim("CmsTrackerLevelBuilder::build called on volume") - << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type(); + edm::LogVerbatim("CmsTrackerLevelBuilder") + << "CmsTrackerLevelBuilder::build called on volume" + << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); // Go down one level in hierarchy fv.firstChild(); @@ -192,22 +194,24 @@ void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, // Treat all siblings of a given hierarchy level while (fv.level() == level) { - edm::LogVerbatim("Calling buildComponent, before.") - << " level = " << level << " type = " << type << " fv.level() = " << fv.level() - << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + edm::LogVerbatim("CmsTrackerLevelBuilder") + << "Calling buildComponent, before." + << " level = " << level << " type = " << type << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); // Call build on sibling buildComponent(fv, tracker, attribute); - edm::LogVerbatim("Calling buildComponent, after.") - << " level = " << level << " type = " << type << " fv.level() = " << fv.level() - << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + edm::LogVerbatim("CmsTrackerLevelBuilder") + << "Calling buildComponent, after." + << " level = " << level << " type = " << type << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); } // Now that all GeometricDets of a given hierarchy level are built, sort them! sortNS(fv, tracker); - edm::LogVerbatim("CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."); + edm::LogVerbatim("CmsTrackerLevelBuilder") << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; } template class CmsTrackerLevelBuilder; diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc index d571de51cc9eb..f15e032c93148 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc @@ -31,11 +31,11 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const DDCompac auto tracker = std::make_unique(&fv, GeometricDet::Tracker); - edm::LogVerbatim("DDDCmsTrackerContruction::construct: Call Tracker builder."); + edm::LogVerbatim("DDDCmsTrackerContruction") << "DDDCmsTrackerContruction::construct: Call Tracker builder."; CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); - edm::LogVerbatim("Assign DetIds"); + edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); theCmsTrackerDetIdBuilder.buildId(*tracker); @@ -70,11 +70,11 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const cms::DDC auto tracker = std::make_unique(&fv, GeometricDet::Tracker); - edm::LogVerbatim("DDDCmsTrackerContruction::construct: Call Tracker builder."); + edm::LogVerbatim("DDDCmsTrackerContruction") << "DDDCmsTrackerContruction::construct: Call Tracker builder."; CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); - edm::LogVerbatim("Assign DetIds"); + edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); theCmsTrackerDetIdBuilder.buildId(*tracker); diff --git a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py index df0110b307c3d..5c66cd1cd4ad2 100644 --- a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py +++ b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py @@ -16,7 +16,42 @@ input = cms.untracked.int32(1) ) -process.prod = cms.EDAnalyzer("ModuleNumbering") + +process.MessageLogger = cms.Service( + "MessageLogger", + statistics = cms.untracked.vstring('cout', 'tkmodulenumbering'), + categories = cms.untracked.vstring('Geometry', 'ModuleNumbering'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noLineBreaks = cms.untracked.bool(True) + ), + tkmodulenumbering = cms.untracked.PSet( + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + noLineBreaks = cms.untracked.bool(True), + DEBUG = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + WARNING = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + ERROR = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + threshold = cms.untracked.string('INFO'), + Geometry = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + ModuleNumbering = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ) + ), + destinations = cms.untracked.vstring('cout', + 'tkmodulenumbering') + ) + +process.prod = cms.EDAnalyzer("ModuleNumbering") process.Timing = cms.Service("Timing") process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") diff --git a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py index 8c320aae5c5ff..2f3060cfb1d60 100644 --- a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py +++ b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py @@ -5,8 +5,6 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.load("Configuration.Geometry.GeometryExtended2021Reco_cff") -process.load("Geometry.CMSCommonData.cmsExtendedGeometryXML_cfi") -process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") #this is always needed if users want access to the vector process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", @@ -18,6 +16,40 @@ input = cms.untracked.int32(1) ) +process.MessageLogger = cms.Service( + "MessageLogger", + statistics = cms.untracked.vstring('cout', 'tkmodulenumbering'), + categories = cms.untracked.vstring('Geometry', 'ModuleNumbering'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noLineBreaks = cms.untracked.bool(True) + ), + tkmodulenumbering = cms.untracked.PSet( + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + noLineBreaks = cms.untracked.bool(True), + DEBUG = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + WARNING = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + ERROR = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + threshold = cms.untracked.string('INFO'), + Geometry = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + ModuleNumbering = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ) + ), + destinations = cms.untracked.vstring('cout', + 'tkmodulenumbering') + ) + process.prod = cms.EDAnalyzer("ModuleNumbering") process.Timing = cms.Service("Timing") From c15b49ddc1d75fcefc053bc99a06e792f46aa5ce Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 19:40:44 +0200 Subject: [PATCH 061/778] Restore Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml for old DD. --- .../data/PhaseI/trackerStructureTopology.xml | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml b/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml index c3b016562cbf3..04a031a7ef02e 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml @@ -52,12 +52,12 @@ - + - + @@ -319,15 +319,15 @@ - + - + - + @@ -349,15 +349,15 @@ - + - + - + @@ -380,15 +380,15 @@ - + - + - + @@ -410,17 +410,18 @@ - + - + - + + From 759f2175e66b99006a6de531c2f9ff6560f632ea Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 19:42:06 +0200 Subject: [PATCH 062/778] Fix build without adding undesired dependency to RecoRomanPot/RecoFP420 --- RecoRomanPot/RecoFP420/plugins/ClusterizerFP420.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/RecoRomanPot/RecoFP420/plugins/ClusterizerFP420.cc b/RecoRomanPot/RecoFP420/plugins/ClusterizerFP420.cc index f600fe2a545d0..4ad160f6181f9 100644 --- a/RecoRomanPot/RecoFP420/plugins/ClusterizerFP420.cc +++ b/RecoRomanPot/RecoFP420/plugins/ClusterizerFP420.cc @@ -18,7 +18,6 @@ #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/CommonDetUnit/interface/GeomDetType.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" #include "DataFormats/Common/interface/DetSetVector.h" //#include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" From 1280d979cd57c9461dfc96f9ca2e73caf53115f8 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 19:56:10 +0200 Subject: [PATCH 063/778] Add trackerStructureTopology.xml as a dd4hep file in Geometry/TrackerCommonData/data/PhaseI/dd4hep/. THIS IS JUST FOR TEMPORARY TESTS, TO ALLOW EVERYONE TO STUDY STEPS DOWNSTREAM WITH A TRACKER AND DD4HEP. The undelying issue is that the CMS DD4hep Filtered view interface should be fixed to allow namespace comparison, as reported. --- .../data/dd4hep/cmsExtendedGeometry2021.xml | 2 +- .../dd4hep/trackerStructureTopology.xml | 426 ++++++++++++++++++ .../test/trackerModuleNumbering_cfg.py | 1 + 3 files changed, 428 insertions(+), 1 deletion(-) create mode 100644 Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml index b5658c9484b23..9faf7ed4a2b15 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -206,7 +206,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml b/Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml new file mode 100644 index 0000000000000..c3b016562cbf3 --- /dev/null +++ b/Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml @@ -0,0 +1,426 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py index 2f3060cfb1d60..5d52a1a940aab 100644 --- a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py +++ b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py @@ -16,6 +16,7 @@ input = cms.untracked.int32(1) ) + process.MessageLogger = cms.Service( "MessageLogger", statistics = cms.untracked.vstring('cout', 'tkmodulenumbering'), From 41af5ee687a795892450dfdc1dc5072f99123eae Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Fri, 25 Sep 2020 19:57:49 +0200 Subject: [PATCH 064/778] scram b code-format --- .../plugins/CmsTrackerLevelBuilder.cc | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index f6942b0c6c577..8ef4c08d6d371 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -145,9 +145,9 @@ void CmsTrackerLevelBuilder::build(DDFilteredView& fv, GeometricDet* tracker, const std::string& attribute) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "CmsTrackerLevelBuilder::build called on volume" - << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type(); + << "CmsTrackerLevelBuilder::build called on volume" + << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); // Go down one level in hierarchy bool doLayers = fv.firstChild(); @@ -170,7 +170,8 @@ void CmsTrackerLevelBuilder::build(DDFilteredView& fv, // Now that all GeometricDets of a given hierarchy level are built, sort them! sortNS(fv, tracker); - edm::LogVerbatim("CmsTrackerLevelBuilder") << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; + edm::LogVerbatim("CmsTrackerLevelBuilder") + << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; } /* @@ -181,9 +182,9 @@ void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, GeometricDet* tracker, const std::string& attribute) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "CmsTrackerLevelBuilder::build called on volume" - << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type(); + << "CmsTrackerLevelBuilder::build called on volume" + << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); // Go down one level in hierarchy fv.firstChild(); @@ -195,23 +196,24 @@ void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, // Treat all siblings of a given hierarchy level while (fv.level() == level) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "Calling buildComponent, before." - << " level = " << level << " type = " << type << " fv.level() = " << fv.level() - << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + << "Calling buildComponent, before." + << " level = " << level << " type = " << type << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); // Call build on sibling buildComponent(fv, tracker, attribute); edm::LogVerbatim("CmsTrackerLevelBuilder") - << "Calling buildComponent, after." - << " level = " << level << " type = " << type << " fv.level() = " << fv.level() - << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + << "Calling buildComponent, after." + << " level = " << level << " type = " << type << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); } // Now that all GeometricDets of a given hierarchy level are built, sort them! sortNS(fv, tracker); - edm::LogVerbatim("CmsTrackerLevelBuilder") << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; + edm::LogVerbatim("CmsTrackerLevelBuilder") + << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; } template class CmsTrackerLevelBuilder; From f1df985194e746b51dc53c6bc1390de1f42cf12b Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 25 Sep 2020 20:37:41 +0200 Subject: [PATCH 065/778] add the cumulative luminosity irrespective if the run is in the intersection; will set correctly the global scale --- .../OfflineValidation/macros/MultiRunAndPlotPVValidation.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C index d2132c777278f..e9916d4fe373a 100644 --- a/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C +++ b/Alignment/OfflineValidation/macros/MultiRunAndPlotPVValidation.C @@ -674,10 +674,13 @@ void MultiRunPVValidation( if (std::find(intersection.begin(), intersection.end(), run) != intersection.end()) { lumiByRun.push_back(lumiSoFar + lumi); lumiMapByRun[run] = (lumiSoFar + lumi); - lumiSoFar += lumi; } else { logWarning << " Run: " << run << " is not found in the intersection" << std::endl; } + // fill the lumi so far irrespective if the run is in the intersection or not + // this corrects the global scale + lumiSoFar += lumi; + logInfo << run << " ====> lumi so far: " << lumiSoFar << std::endl; } } From ea8d272daa2106b31bee5b2994412ddf017b3124 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 25 Sep 2020 20:55:43 +0200 Subject: [PATCH 066/778] add the lumiPerRun input file for whole Run 2 --- .../data/lumiPerRun_Run2.txt | 1955 +++++++++++++++++ 1 file changed, 1955 insertions(+) create mode 100644 Alignment/OfflineValidation/data/lumiPerRun_Run2.txt diff --git a/Alignment/OfflineValidation/data/lumiPerRun_Run2.txt b/Alignment/OfflineValidation/data/lumiPerRun_Run2.txt new file mode 100644 index 0000000000000..fa8df3ec9f915 --- /dev/null +++ b/Alignment/OfflineValidation/data/lumiPerRun_Run2.txt @@ -0,0 +1,1955 @@ +266150 0 +271866 0 +272761 0 +272828 0 +273150 0.385172701 +273158 50.220210840 +273301 0 +273302 16.319201797 +273402 6.584577453 +273403 1.820958598 +273404 0.610802647 +273405 0.832936187 +273406 3.773872424 +273408 0.180194854 +273409 9.442193251 +273410 2.729404628 +273411 0.734874842 +273425 26.757842509 +273426 2.037135656 +273446 2.140645567 +273447 25.976359758 +273448 22.661434184 +273449 11.394741853 +273450 32.389699552 +273492 12.223410645 +273493 10.359205060 +273494 8.433104783 +273502 46.946977259 +273503 25.345338369 +273554 26.672370697 +273555 12.154365843 +273725 154.730218347 +273728 4.846951183 +273730 108.100334799 +274094 9.734585999 +274146 5.119510777 +274157 38.994492830 +274159 3.561326269 +274160 17.146093482 +274161 42.175324937 +274172 5.248556692 +274198 10.904618977 +274199 64.926031458 +274200 60.141469278 +274240 9.952956454 +274241 124.740373414 +274244 56.348324119 +274250 94.620734798 +274251 65.222033062 +274283 0.349871530 +274284 29.982866003 +274286 21.667949028 +274314 9.513722735 +274315 66.474721586 +274316 130.421463599 +274317 0.301283908 +274319 27.302058183 +274335 142.702397511 +274336 1.741816214 +274337 1.781505151 +274338 88.970991467 +274339 9.958588419 +274344 69.946654840 +274345 17.733284738 +274382 7.428113198 +274387 58.230925462 +274388 254.143127693 +274420 28.085763446 +274421 53.901679022 +274422 277.137366480 +274440 63.546059058 +274441 63.938476500 +274442 99.071429357 +274443 6.157281322 +274954 0.964180375 +274955 4.770955418 +274968 193.775922766 +274969 126.581145674 +274970 4.298671972 +274971 97.616535644 +274998 113.023737263 +274999 162.759022647 +275000 15.808373810 +275001 197.994303608 +275059 10.701513009 +275064 5.877173780 +275066 18.301980901 +275067 71.046000095 +275068 142.426185427 +275073 68.166579916 +275074 75.957762662 +275124 56.104012184 +275125 149.289554910 +275282 14.753424131 +275283 22.215007942 +275284 17.862642395 +275285 0.125163124 +275286 13.946769227 +275289 1.072843816 +275290 7.953067812 +275291 51.239142971 +275292 15.533065282 +275293 24.911715338 +275309 81.968831496 +275310 221.971321072 +275311 107.143490495 +275319 24.399048687 +275337 68.318280018 +275338 75.039556334 +275344 50.206595426 +275345 59.317080928 +275370 51.557454428 +275371 94.041599977 +275375 205.471795052 +275376 323.163897270 +275635 0 +275657 18.283723984 +275658 59.034025043 +275659 3.171269936 +275757 3.296875204 +275758 0.802889379 +275759 1.204144620 +275761 1.667386031 +275767 0.714021988 +275772 10.203603061 +275773 1.181464554 +275774 55.058509354 +275776 23.256087180 +275777 47.914974828 +275778 45.726821976 +275781 4.156221873 +275782 99.673166606 +275832 72.628755583 +275833 46.889395184 +275834 51.935909979 +275835 2.069230944 +275836 186.759678284 +275837 83.442435566 +275841 5.340389783 +275846 0.600261434 +275847 198.947361542 +275886 8.959741717 +275887 9.198721095 +275890 235.220049782 +275911 73.582913607 +275912 51.914262609 +275913 76.634940140 +275918 53.905285585 +275920 61.253099614 +275921 2.689974793 +275922 0.274320622 +275923 15.909136938 +275931 10.912847070 +275963 19.774145187 +276054 0 +276064 0.108243447 +276092 14.768384698 +276095 0.216107413 +276097 99.405227777 +276237 0 +276242 272.679185351 +276243 78.092837794 +276244 132.488998823 +276282 206.020156368 +276283 166.967551934 +276315 34.450825785 +276317 26.316937148 +276318 98.364174007 +276327 9.782407768 +276352 7.687984132 +276355 6.205236896 +276357 15.013520147 +276361 149.824091526 +276363 206.848227184 +276384 121.517288766 +276437 356.334756325 +276454 63.924279409 +276458 33.169134087 +276495 38.062164066 +276501 401.733502568 +276502 85.357449333 +276525 405.302921266 +276527 22.408004818 +276528 38.349578306 +276542 148.442843148 +276543 148.143518872 +276544 21.993585092 +276545 27.423889470 +276581 74.062946538 +276582 150.007109117 +276583 7.839875549 +276584 0.172727362 +276585 34.895920918 +276586 96.896976507 +276587 107.617825336 +276653 86.119512846 +276655 160.926116868 +276659 30.037585816 +276775 207.359208622 +276776 236.342423452 +276794 87.205680821 +276807 30.442600532 +276808 157.858192010 +276810 44.735085823 +276811 301.674117304 +276831 400.297676299 +276832 7.473453523 +276834 72.599726830 +276870 527.079042973 +276935 170.798551827 +276940 28.700846840 +276946 4.252741743 +276947 24.605931488 +276948 85.951571648 +276950 323.178752535 +276952 0 +277069 75.526287052 +277070 206.495004545 +277071 26.353950733 +277072 69.470744336 +277073 12.749016636 +277076 126.205887241 +277087 86.356665370 +277094 131.582224751 +277096 320.667915284 +277112 17.339321164 +277126 1.967387079 +277127 184.213275630 +277148 128.191762293 +277166 70.666493871 +277168 318.998343761 +277180 31.250413067 +277194 367.175186737 +277305 154.261732814 +277420 60.844211738 +277935 0 +277981 4.641662441 +277991 4.753756131 +277992 16.993111781 +278017 125.532225843 +278018 214.245099834 +278167 314.656584897 +278175 9.044695185 +278193 34.581050612 +278239 133.159929732 +278240 197.912778140 +278271 0 +278273 5.851969403 +278274 18.018314563 +278288 2.873670757 +278289 9.658789401 +278290 2.421569359 +278308 319.902058883 +278309 1.330173110 +278310 88.422333085 +278315 137.851833325 +278345 150.524403041 +278346 21.125789319 +278349 97.144421365 +278366 59.422848201 +278406 297.186917416 +278509 273.441766226 +278769 7.207544992 +278770 163.785042964 +278801 7.802784220 +278802 1.706479830 +278803 71.465332105 +278804 0.747048856 +278805 56.081362139 +278808 269.976873842 +278820 286.511292999 +278821 4.625087254 +278822 191.158369489 +278873 2.011529344 +278874 81.773427401 +278875 114.871994480 +278923 98.543102629 +278957 36.164158585 +278962 75.976997966 +278963 37.267386549 +278969 282.850864839 +278975 120.000479166 +278976 2.555233406 +278986 31.547718910 +279024 49.595681552 +279029 38.088365375 +279071 22.581050882 +279080 12.772790221 +279115 84.298417622 +279116 90.639285447 +279479 5.926778960 +279588 228.517079959 +279653 43.391596572 +279654 240.614674254 +279656 5.683778790 +279658 93.394296273 +279667 208.731642042 +279681 6.669545475 +279682 7.775812962 +279683 6.362365395 +279684 5.302872309 +279685 48.653208633 +279691 9.655603763 +279694 406.418024415 +279715 137.395611879 +279716 258.223424955 +279760 154.923780048 +279766 268.330897382 +279767 89.813165616 +279794 223.093491877 +279823 81.827884397 +279841 380.358689709 +279844 56.587892499 +279881 0 +279887 73.315951298 +279931 475.875123052 +279966 93.010881560 +279975 245.459046311 +279976 0 +279993 18.075211084 +279994 12.379774533 +279995 1.249145196 +280002 27.025284120 +280006 16.052867245 +280007 8.348038508 +280013 5.635925249 +280015 116.788295816 +280016 26.575518877 +280017 97.988265529 +280018 159.034296216 +280020 4.613516645 +280024 41.841049370 +280187 13.218188892 +280188 61.560219414 +280191 179.131014898 +280194 36.665471251 +280242 147.690347519 +280249 239.160039031 +280251 47.175675798 +280327 8.719126011 +280330 185.776359950 +280349 104.819741964 +280363 50.013336182 +280364 155.384550698 +280365 0 +280383 0.248003534 +280384 7.808693195 +280385 365.543681060 +280928 0 +281613 9.764089840 +281639 18.977254960 +281641 39.267577318 +281663 0 +281686 5.237282778 +281691 3.582514519 +281693 376.118399160 +281707 217.755250075 +281726 49.352584326 +281727 202.020172099 +281797 397.836480149 +281975 53.956630692 +281976 340.010061446 +282033 8.255815013 +282034 8.631466196 +282035 9.405334187 +282037 331.596106027 +282092 390.979918022 +282649 0 +282708 2.118367301 +282710 0.346457796 +282712 16.682537124 +282730 20.382034630 +282731 47.479404889 +282732 18.071781853 +282733 43.147575481 +282734 70.460004019 +282735 269.529473990 +282800 93.579664969 +282807 70.562619168 +282814 276.224384230 +282842 23.509443955 +282917 17.965019093 +282918 12.877857317 +282919 57.230808676 +282922 25.520575381 +282923 41.060582307 +282924 0.168569666 +283042 1.419220327 +283043 116.699469199 +283049 3.132359689 +283050 57.939220087 +283052 28.777008251 +283059 98.777845156 +283270 381.443761708 +283283 197.444168983 +283305 1.390518853 +283306 76.859026835 +283307 100.279861203 +283308 163.957732593 +283353 191.087631224 +283358 172.478157893 +283359 60.804580885 +283407 9.814026311 +283408 457.018851149 +283416 21.713876877 +283453 123.278367350 +283469 0.031237036 +283478 215.661546160 +283548 26.451260162 +283680 18.937475938 +283681 3.813224243 +283682 80.063189918 +283685 20.432302602 +283820 259.057765452 +283830 102.254914808 +283834 9.009585103 +283835 11.312988905 +283865 264.403139129 +283876 163.762579885 +283877 245.684055834 +283884 101.925204006 +283885 290.452170240 +283933 40.330644227 +283934 275.345000218 +283946 300.188316800 +283964 58.697972977 +284006 57.690296605 +284014 47.826032787 +284025 12.192594717 +284029 29.940882682 +284035 87.614551580 +284036 71.719298502 +284037 62.387614249 +284038 9.103983831 +284039 4.797111668 +284040 5.446855482 +284041 6.812087799 +284042 19.699817440 +284043 31.711872933 +284044 4.286644745 +290543 0 +294927 0.008 +294928 0.012 +294929 0.01 +294931 0.011 +294932 0.01 +294933 0.01 +294934 0.009 +294935 0.011 +294936 0.01 +294937 0.009 +294939 0.008 +294940 0.008 +294947 0.008 +294949 0.006 +294950 0.004 +294951 0.004 +294952 0.004 +294953 0.004 +294954 0.004 +294955 0.004 +294956 0.004 +294957 0.003 +294960 0.003 +294986 0.008 +294987 0.006 +294988 0.004 +294990 0.009 +294992 0 +294993 0.007 +294995 0.007 +294997 0.007 +294999 0.006 +295001 0.009 +295122 0.019 +295123 0.017 +295124 0.016 +295125 0.017 +295126 0.015 +295127 0.017 +295128 0.212 +295129 0.004 +295130 0.01 +295131 0.143 +295132 0.003 +295133 0.008 +295134 0.004 +295135 0.028 +295192 0.006 +295193 0.002 +295194 0.018 +295197 0.015 +295198 0.001 +295199 0.009 +295200 0.016 +295201 0.014 +295202 0.013 +295203 0.015 +295204 0.019 +295208 0 +295209 0.157 +295210 0.063 +295315 0.133 +295318 0.208 +295319 0.003 +295320 0 +295321 0 +295322 0.037 +295323 0.082 +295324 0.11 +295325 0.041 +295326 0.032 +295327 0.043 +295328 0.167 +295329 0.023 +295330 0.18 +295331 0.045 +295332 0.131 +295334 0.068 +295335 0.05 +295336 0.004 +295337 0.019 +295339 0.116 +295340 0.619 +295341 0.062 +295342 0.055 +295343 0.039 +295344 0.056 +295345 0.051 +295346 0.016 +295347 0.066 +295348 0.087 +295349 0.005 +295371 0.105 +295376 0.906 +295377 0.091 +295378 0.092 +295379 0.087 +295380 0.093 +295381 1.261 +295390 1.363 +295391 0.676 +295392 0.119 +295393 0.178 +295394 0 +295395 0.773 +295436 1.29 +295437 0.542 +295438 0.519 +295439 0.474 +295440 0.497 +295441 0.001 +295442 0 +295443 0.001 +295444 0.336 +295445 0.64 +295446 0.545 +295447 0.49 +295448 0.47 +295449 0.462 +295450 0.464 +295451 0.159 +295452 0.057 +295453 0.494 +295454 0.484 +295455 0.456 +295456 0.456 +295457 0.448 +295458 0.49 +295459 0.475 +295460 0.316 +295463 25.302 +295600 0.822 +295602 0.411 +295603 2.223 +295604 0.129 +295605 7.942 +295606 2.416 +295607 0.226 +295608 1.897 +295610 1.36 +295613 7.338 +295628 0.787 +295632 0.421 +295634 0.093 +295635 0.098 +295636 0.143 +295637 0.159 +295638 0.321 +295639 0.344 +295640 0.338 +295641 0.336 +295642 0.338 +295644 0.511 +295645 0.328 +295646 0.363 +295647 0.302 +295648 0.309 +295649 0.326 +295650 0.328 +295651 0.105 +295652 0.068 +295655 8.232 +295953 4.216 +295969 0.032 +295976 0.006 +295977 0.318 +296070 1.214 +296071 0.005 +296073 0.029 +296074 0.759 +296076 0.651 +296077 0.723 +296078 0.64 +296079 0.716 +296081 0.537 +296082 0.083 +296083 0.698 +296084 0.683 +296085 0.645 +296086 0.026 +296087 0.598 +296088 0.668 +296089 0.654 +296090 0.477 +296091 0.746 +296092 0.735 +296093 0.64 +296094 0.011 +296095 0.695 +296096 0.643 +296097 0.611 +296098 0.683 +296099 0.538 +296100 0.58 +296101 0.586 +296102 0.028 +296103 0.683 +296104 0.816 +296107 0.54 +296108 0.578 +296109 0.578 +296110 0.556 +296111 0.574 +296112 0.556 +296113 0.567 +296114 1.134 +296115 0.885 +296116 5.767 +296168 1.274 +296172 1.862 +296173 43.167 +296174 1.84 +296641 0.001 +296642 0.018 +296643 0.008 +296644 0.007 +296646 0.008 +296647 0.007 +296663 2.061 +296664 1.863 +296665 1.375 +296666 1.004 +296668 0.939 +296669 1.117 +296671 0 +296674 1.37 +296675 0.955 +296676 1.351 +296677 2.217 +296678 1.12 +296679 0.958 +296680 1.115 +296702 12.152 +296786 77.551 +296787 7.424 +296788 4.713 +296789 1.232 +296790 1.077 +296791 0.307 +296795 1.491 +296796 5.846 +296797 1.279 +296799 0.252 +296800 1.126 +296801 0.438 +296802 1.22 +296866 3.785 +296867 15.121 +296868 1.844 +296869 1.622 +296870 1.61 +296871 1.633 +296872 1.496 +296873 1.487 +296874 1.556 +296875 1.343 +296876 1.484 +296877 1.513 +296878 1.373 +296879 1.584 +296880 4.109 +296881 0.791 +296887 46.81 +296888 20.177 +296895 0.588 +296897 5.519 +296898 2.985 +296899 1.319 +296900 2.672 +296901 1.454 +296902 1.284 +296966 18.559 +296967 3.178 +296968 2.053 +296969 9.912 +296970 23.046 +296971 2.584 +296972 20.646 +296976 18.109 +296977 51.17 +296978 13.078 +296979 1.074 +296980 12.322 +297003 9.149 +297004 2.559 +297006 2.156 +297007 2.153 +297009 1.874 +297010 2.301 +297011 2.155 +297012 2.143 +297015 2.174 +297016 2.101 +297017 1.943 +297018 2.209 +297019 2.314 +297047 4.239 +297048 2.194 +297049 2.231 +297050 103.287 +297056 28.463 +297057 116.596 +297099 7.258 +297100 71.52 +297101 162.004 +297113 50.809 +297114 32.427 +297168 3.591 +297169 2.064 +297170 1.279 +297171 14.297 +297175 15.606 +297176 42.254 +297177 30.027 +297178 200.45 +297179 9.737 +297180 13.682 +297181 6.618 +297211 11.007 +297215 12.017 +297218 3.629 +297219 427.13 +297224 13.007 +297225 2.256 +297227 22.868 +297281 12.215 +297282 4.326 +297283 4.184 +297284 4.292 +297285 3.937 +297286 5.335 +297287 4.005 +297288 3.869 +297289 3.82 +297290 3.722 +297291 4.224 +297292 171.087 +297293 27.926 +297296 85.852 +297308 9.603 +297359 40.936 +297411 202.088 +297424 31.217 +297425 41.21 +297426 26.522 +297429 17.174 +297430 45.888 +297431 39.065 +297432 25.555 +297433 29.723 +297434 28.822 +297435 16.903 +297467 32.177 +297468 22.624 +297469 18.964 +297474 6.301 +297483 48.97 +297484 57.036 +297485 98.144 +297486 123.975 +297487 97.387 +297488 56.849 +297494 5.615 +297495 4.939 +297496 6.84 +297497 4.57 +297498 4.538 +297499 4.547 +297501 4.728 +297502 4.607 +297503 186.983 +297504 10.96 +297505 74.619 +297557 109.55 +297558 67.211 +297562 72.541 +297563 46.549 +297598 1.622 +297599 106.449 +297603 98.936 +297604 82.157 +297605 71.813 +297606 36.83 +297620 82.18 +297656 115.925 +297657 0.868 +297658 0.018 +297659 3.272 +297660 51.159 +297661 21.801 +297662 3.508 +297663 3.634 +297664 7.139 +297665 58.59 +297666 23.377 +297670 8.107 +297671 12.316 +297672 4.484 +297673 4.249 +297674 52.881 +297675 121.338 +297678 0.044 +297722 92.869 +297723 62.076 +298653 0.001 +298678 0.004 +298996 23.753 +298997 5.425 +298998 0.218 +299000 8.544 +299042 2.419 +299061 67.1 +299062 60.61 +299064 16.685 +299065 60.938 +299067 70.948 +299096 25.083 +299149 111.906 +299178 16.895 +299180 17.228 +299183 0.021 +299184 126.94 +299185 24.172 +299316 11.508 +299317 8.984 +299318 11.713 +299324 4.686 +299325 45.922 +299326 5.095 +299327 15.596 +299329 38.663 +299368 33.96 +299369 80.807 +299370 156.517 +299380 56.408 +299381 12.426 +299394 6.195 +299395 40.232 +299396 17.804 +299420 13.825 +299443 36.517 +299450 13.221 +299477 12.124 +299478 46.532 +299479 30.7 +299480 169.715 +299481 200.45 +299592 27.149 +299593 209.696 +299594 62.037 +299595 25.696 +299597 87.687 +299614 61.366 +299616 75.109 +299617 8.778 +299649 91.96 +299996 0.054 +300018 0.018 +300027 0.007 +300043 0.021 +300079 1.713 +300087 13.598 +300088 0.377 +300105 1.265 +300106 20.138 +300107 14.149 +300117 7.067 +300122 302.734 +300123 103.368 +300124 78.307 +300155 288.121 +300156 12.014 +300157 172.245 +300226 119.494 +300233 32.557 +300234 14.933 +300235 50.549 +300236 49.894 +300237 166.194 +300238 56.428 +300239 31.735 +300240 48.886 +300280 158.246 +300281 1.608 +300282 43.362 +300283 5.862 +300284 149.167 +300364 4.47 +300365 3.645 +300366 2.976 +300367 3.103 +300368 3.066 +300369 3.316 +300370 3.263 +300371 3.042 +300372 2.041 +300373 3.194 +300374 3.211 +300375 25.391 +300389 32.939 +300390 3.493 +300391 3.342 +300392 3.448 +300393 3.507 +300394 3.365 +300395 3.412 +300396 3.324 +300397 3.527 +300398 3.624 +300399 4.285 +300400 162.809 +300401 120.559 +300459 83.07 +300461 23.965 +300462 23.548 +300463 30.979 +300464 59.54 +300466 121.62 +300467 80.407 +300497 41.242 +300498 0.018 +300499 0.003 +300500 0.007 +300514 30.005 +300515 263.831 +300516 19.408 +300517 152.714 +300538 10.382 +300539 60.775 +300545 25.888 +300548 3.259 +300551 23.509 +300552 13.394 +300558 118.955 +300560 138.758 +300574 24.28 +300575 12.365 +300576 274.098 +300631 47.336 +300632 4.123 +300633 122.455 +300635 42.953 +300636 275.562 +300673 8.29 +300674 7.954 +300675 2.935 +300676 7.686 +300742 89.558 +300777 132.465 +300780 80.813 +300785 219.585 +300806 55.423 +300811 148.055 +300812 15.036 +300816 36.65 +300817 108.228 +301046 4.405 +301086 19.941 +301141 1.287 +301142 97.836 +301161 99.822 +301165 15.833 +301179 2.375 +301180 15.075 +301183 46.445 +301281 19.248 +301283 122.07 +301298 158.456 +301323 168.528 +301330 66.196 +301359 58.718 +301383 0.47 +301384 95.893 +301391 35.555 +301392 111.762 +301393 2.806 +301394 0.016 +301395 0.023 +301396 3.781 +301397 95.503 +301398 0.565 +301399 13.135 +301417 70.44 +301447 81.522 +301448 48.686 +301449 49.891 +301450 20.446 +301461 99.769 +301472 140.531 +301473 0.006 +301474 0.026 +301475 1.568 +301476 108.771 +301480 18.359 +301519 34.172 +301524 42.824 +301525 8.266 +301528 2.16 +301529 6.66 +301530 14.509 +301531 48.917 +301532 63.676 +301567 64.474 +301627 133.518 +301664 71.724 +301665 72.371 +301694 18.602 +301912 45.227 +301913 6.036 +301914 36.061 +301941 75.901 +301959 279.448 +301960 15.326 +301969 6.769 +301970 23.879 +301984 56.817 +301985 60.906 +301986 55.046 +301987 124.204 +301997 66.23 +301998 221.828 +302019 9.734 +302026 5.245 +302027 0 +302029 15.525 +302030 0 +302031 130.848 +302033 5.23 +302034 0.489 +302036 4.152 +302037 0.908 +302038 0.581 +302040 21.172 +302041 7.814 +302042 55.478 +302043 22.045 +302131 117.987 +302159 16.589 +302163 148.603 +302165 6.928 +302166 2.037 +302225 117.852 +302228 39.543 +302229 68.349 +302239 0.003 +302240 140.805 +302262 77.401 +302263 167.241 +302277 55.33 +302279 5.955 +302280 13.077 +302322 99.769 +302328 97.878 +302337 21.149 +302342 9.609 +302343 15.644 +302344 70.461 +302349 0.005 +302350 17.992 +302388 131.17 +302392 77.275 +302393 160.822 +302448 315.761 +302472 158.522 +302473 61.522 +302474 44.088 +302475 0.101 +302476 34.178 +302479 70.763 +302484 38.163 +302485 176.631 +302486 0.006 +302487 0.008 +302488 0.408 +302489 0.043 +302490 0.004 +302491 0.005 +302492 8.517 +302493 0.144 +302494 87.877 +302509 13.949 +302513 12.88 +302522 0.997 +302523 10.987 +302525 147.326 +302526 89.629 +302548 16.283 +302550 0.797 +302551 0.115 +302553 37.757 +302554 0.093 +302555 2.071 +302563 0.652 +302564 0.005 +302565 0.153 +302566 14.045 +302567 7.455 +302569 0.042 +302570 8.084 +302571 7.438 +302572 55.837 +302573 196.123 +302596 179.171 +302597 148.879 +302634 123.737 +302635 193.516 +302646 0.214 +302651 30.713 +302654 65.319 +302660 0.434 +302661 9.746 +302663 137.094 +303790 0 +303818 0.034 +303819 0.88 +303824 102.249 +303825 24.108 +303832 334.821 +303838 402.09 +303885 415.988 +303948 386.02 +303989 12.366 +303998 76.523 +303999 179.14 +304000 11.033 +304062 386.349 +304119 21.934 +304120 72.611 +304125 342.197 +304144 540.104 +304158 377.191 +304169 341.853 +304170 77.44 +304196 4.138 +304197 2.284 +304198 5.563 +304199 0.618 +304200 88.753 +304204 154.25 +304209 123.533 +304291 3.489 +304292 359.515 +304333 370.332 +304354 68.97 +304366 424.19 +304446 19.422 +304447 371.877 +304448 1.229 +304449 0.265 +304451 7.492 +304452 2.272 +304505 8.024 +304506 119.703 +304507 50.757 +304508 250.911 +304562 223.99 +304616 257.048 +304625 136.778 +304626 2.606 +304654 174.361 +304655 232.686 +304661 55.642 +304662 43.532 +304663 177.925 +304671 309.677 +304672 13.451 +304737 24.6 +304738 410.97 +304739 1.872 +304740 40.992 +304776 9.743 +304777 158.495 +304778 269.721 +304797 565.699 +304911 0 +305040 32.259 +305043 17.652 +305044 99.781 +305045 203.411 +305046 112.571 +305059 158.567 +305062 1.305 +305063 9.589 +305064 383.454 +305081 315.699 +305112 401.878 +305113 12.603 +305114 87.379 +305178 17.131 +305179 3.958 +305180 0.588 +305181 0.582 +305182 1.007 +305183 77.312 +305184 0.102 +305185 0.359 +305186 122.53 +305188 200.223 +305202 208.533 +305204 256.702 +305207 318.551 +305208 83.641 +305234 13.245 +305236 6.486 +305237 338.407 +305247 122.804 +305248 258.32 +305249 9.47 +305250 2.438 +305252 96.572 +305282 46.289 +305310 129.589 +305311 47.358 +305312 68.317 +305313 170.874 +305314 76.471 +305336 66.635 +305338 33.083 +305341 151.794 +305349 3.899 +305350 3.916 +305351 181.03 +305358 50.26 +305364 30.795 +305365 250.672 +305366 236.849 +305376 33.626 +305377 400.511 +305405 160.26 +305406 321.667 +305440 83.376 +305441 36.888 +305516 180.437 +305517 33.976 +305518 235.522 +305586 186.703 +305588 33.842 +305589 163.428 +305590 156.352 +305636 529.294 +305766 266.181 +305809 46.645 +305814 449.3 +305821 240.696 +305832 58.679 +305840 252.297 +305841 0.02 +305842 116.491 +305862 202.42 +305898 230.591 +305902 154.848 +305967 10.514 +306029 9.661 +306030 34.817 +306036 0.372 +306037 12.217 +306038 43.987 +306041 99.914 +306042 100.158 +306048 32.17 +306049 75.553 +306051 73.142 +306091 205.228 +306092 221.438 +306093 0.029 +306095 76.325 +306121 28.879 +306122 40.472 +306125 567.75 +306126 31.65 +306134 7.31 +306135 345.123 +306137 1.093 +306138 212.679 +306139 102.931 +306153 26.753 +306154 339.244 +306155 221.028 +306169 67.046 +306170 1.149 +306171 36.212 +306416 0.018 +306417 26.004 +306418 21.266 +306419 18.366 +306420 34.099 +306422 36.771 +306423 85.789 +306425 43.121 +306432 33.79 +306454 27.08 +306455 1.63 +306456 236.925 +306457 6.713 +306458 61.464 +306459 310.102 +306460 4.048 +306461 0.514 +306462 0.893 +306546 0.006 +306548 0.001 +306549 0.004 +306550 0.075 +306553 4.007 +306563 2.497 +306572 22.086 +306580 28.881 +306584 1.696 +306595 1.501 +306598 6.231 +306604 16.97 +306629 15.531 +306630 2.139 +306631 17.432 +306636 0.099 +306645 0.251 +306646 0.176 +306647 0.04 +306651 0.292 +306652 0.142 +306653 1.808 +306654 2.199 +306656 2.557 +306657 13.422 +306705 25.841 +306709 28.12 +306772 20.615 +306773 10.523 +306776 0.161 +306777 8.137 +306793 38.425 +306794 7.24 +306801 24.496 +306826 7.987 +306896 0.018 +306897 0.003 +306926 1.905 +306929 4.56 +306936 43.566 +307014 24.117 +307015 7.054 +307016 5.631 +307017 13.81 +307042 10.995 +307044 1.417 +307045 0.823 +307046 1.38 +307047 9.371 +307048 3.394 +307049 0.443 +307050 5.616 +307051 9.127 +307052 0.365 +307053 0.88 +307054 1.023 +307055 15.762 +307062 14.355 +307063 4.125 +307073 16.141 +307075 2.009 +307076 30.169 +307082 23.845 +314881 0 +315257 7.979 +315258 0.017 +315259 14.366 +315264 39.224 +315265 6.684 +315267 36.402 +315270 78.249 +315322 177.319 +315339 92.546 +315357 151.55 +315361 116.836 +315363 18.48 +315365 4.018 +315366 100.834 +315420 254.524 +315488 232.752 +315489 102.182 +315490 4.357 +315506 27.973 +315509 16.619 +315510 100.746 +315512 228.931 +315543 36.618 +315555 21.9 +315556 8.215 +315557 82.335 +315640 10.443 +315641 1.206 +315642 30.611 +315644 61.476 +315645 158.932 +315646 183.546 +315647 7.609 +315648 15.787 +315689 330.131 +315690 115.631 +315702 22.597 +315703 152.389 +315704 14.132 +315705 127.295 +315713 352.095 +315721 207.02 +315741 24.216 +315764 111.716 +315770 119.13 +315784 67.446 +315785 102.831 +315786 21.21 +315790 167.864 +315800 208.649 +315801 95.328 +315840 343.999 +315973 275.276 +315974 19.316 +316058 133.08 +316059 163.282 +316060 187.857 +316061 9.953 +316062 3.441 +316082 137.53 +316109 0.552 +316110 79.017 +316111 14.573 +316112 0 +316113 19.663 +316114 351.729 +316151 0.75 +316153 245.686 +316186 14.893 +316187 509.898 +316199 388.575 +316200 2.148 +316201 106.02 +316202 73.318 +316216 171.744 +316217 85.089 +316218 236.9 +316219 48.576 +316239 202.781 +316240 273.3 +316241 51.816 +316271 29.294 +316361 26.87 +316362 54.941 +316363 5.064 +316377 2.112 +316378 3.271 +316379 8.038 +316380 171.911 +316455 9.616 +316456 0.555 +316457 316.79 +316469 202.407 +316470 112.705 +316472 66.96 +316505 389.045 +316559 0 +316569 478.488 +316590 183.429 +316613 31.188 +316615 48.728 +316664 0.005 +316665 94.986 +316666 269.016 +316667 40.735 +316700 124.498 +316701 138.597 +316702 92.044 +316715 5.681 +316716 59.58 +316717 61.15 +316718 95.539 +316719 31.79 +316720 40.114 +316721 3.777 +316722 129.484 +316723 11.09 +316758 440.119 +316766 540.971 +316876 209.502 +316877 108.483 +316879 37.391 +316928 43.315 +316944 477.148 +316985 167.286 +316993 72.331 +316994 4.587 +316995 179.421 +317080 8.123 +317087 259.554 +317088 0.008 +317089 205.613 +317182 391.718 +317212 49.769 +317213 120.98 +317279 64.932 +317291 267.785 +317292 81.932 +317295 4.155 +317296 21.482 +317297 125.799 +317319 52.026 +317320 445.563 +317338 13.521 +317339 67.871 +317340 135.492 +317382 23.644 +317383 22.036 +317391 3.201 +317392 480.456 +317434 76.125 +317435 347.199 +317438 52.744 +317475 30.501 +317478 7.632 +317479 3.955 +317480 4.569 +317481 6.947 +317482 6.049 +317484 159.279 +317488 174.899 +317509 116.085 +317510 3.638 +317511 117 +317512 104.356 +317527 434.963 +317591 107.981 +317626 509.817 +317640 251.58 +317641 257.744 +317648 33.224 +317649 185.578 +317650 246.268 +317661 377.607 +317663 147.601 +317664 0 +317683 114.086 +317696 223.282 +318227 0 +318228 0 +318712 0 +318733 2.69 +318816 28.774 +318819 4.894 +318820 10.196 +318828 13.317 +318872 88.558 +318874 94.917 +318876 44.263 +318877 153.063 +318944 0.001 +319077 16.405 +319310 0.004 +319337 224.593 +319347 205.418 +319348 4.855 +319349 39.728 +319449 243.493 +319450 201.193 +319456 85.04 +319459 16.604 +319460 0 +319486 19.919 +319503 88.691 +319524 444.821 +319526 67.425 +319528 57.858 +319579 771.257 +319625 68.219 +319639 392.208 +319656 85.233 +319657 49.621 +319658 59.878 +319659 20.962 +319678 92.073 +319687 16.414 +319697 60.05 +319698 35.741 +319756 470.238 +319840 48.945 +319841 20.616 +319847 1.494 +319848 18.293 +319849 166.303 +319851 1.079 +319852 0.06 +319853 69.835 +319854 52.974 +319908 18.294 +319909 1.088 +319910 291.925 +319912 12.855 +319913 11.999 +319914 6.576 +319915 83.175 +319941 91.184 +319942 17.034 +319950 64.012 +319991 270.744 +319992 62.668 +319993 175.454 +320002 48.851 +320006 109.549 +320007 43.194 +320008 21.598 +320009 29.401 +320010 71.342 +320011 58.384 +320012 17.441 +320023 95.188 +320024 120.883 +320025 28.769 +320026 48.008 +320038 210.015 +320039 7.856 +320040 169.72 +320058 6.772 +320059 39.241 +320060 15.071 +320061 17.52 +320062 6.672 +320063 21.2 +320064 62.044 +320065 218.132 +320377 0 +320500 0.033 +320569 0.059 +320570 0.084 +320571 0.013 +320673 62.703 +320674 33.949 +320688 151.226 +320712 67.332 +320757 112.969 +320804 305.407 +320807 0.322 +320809 104.81 +320821 58.352 +320822 142.985 +320823 76.341 +320824 157.749 +320838 88.699 +320840 134.611 +320841 48.355 +320853 113.509 +320854 37.854 +320855 139.939 +320856 31.978 +320857 50.441 +320858 35.817 +320859 4.998 +320887 100.694 +320888 40.999 +320916 6.408 +320917 456.336 +320920 23.568 +320933 50.139 +320934 200.871 +320936 74.726 +320941 15.816 +320980 37.865 +320995 25.382 +320996 47.345 +321004 45.439 +321005 18.327 +321006 49.413 +321007 193.462 +321009 14.042 +321010 54.622 +321011 27.616 +321012 18.893 +321051 317.887 +321055 133.874 +321067 178.353 +321068 150.153 +321069 50.809 +321119 60.087 +321121 16.138 +321122 122.55 +321123 0.008 +321124 189.134 +321126 81.369 +321134 8.787 +321138 145.742 +321140 120.524 +321149 445.236 +321162 12.012 +321164 26.711 +321165 0.384 +321166 3.431 +321167 280.825 +321177 175.656 +321178 24.857 +321218 288.169 +321219 185.067 +321221 6.144 +321230 23.581 +321231 14.749 +321232 6.223 +321233 236.103 +321261 4.929 +321262 2.101 +321282 0 +321283 122.297 +321294 20.945 +321295 209.065 +321296 14.737 +321305 614.146 +321310 16.883 +321311 0.493 +321312 61.743 +321313 27.805 +321393 52.713 +321396 371.482 +321397 54.046 +321414 387.821 +321415 162.276 +321431 57.803 +321432 17.025 +321433 43.422 +321434 183.96 +321436 141.274 +321457 491.855 +321461 22.062 +321475 483.601 +321709 0.027 +321710 17.456 +321712 91.687 +321730 104.71 +321732 360.769 +321735 24.291 +321755 218.614 +321758 45.974 +321759 2.138 +321760 157.24 +321773 28.281 +321774 49.459 +321775 17.223 +321776 14.747 +321777 87.765 +321778 38.719 +321780 128.051 +321781 115.23 +321794 66.906 +321796 0.529 +321813 145.648 +321815 5.198 +321817 150.842 +321818 140.525 +321820 33.35 +321831 252.008 +321832 118.434 +321833 75.564 +321834 51.549 +321879 108.133 +321880 42.605 +321887 281.571 +321908 147.707 +321909 346.853 +321917 268.144 +321919 1.778 +321933 103.457 +321960 7.932 +321961 134.145 +321973 364.865 +321975 149.073 +321988 416.575 +321990 83.153 +322013 1.995 +322014 7.142 +322022 466.979 +322040 14.843 +322057 9.474 +322068 236.965 +322079 154.185 +322088 176.924 +322106 286.044 +322113 41.67 +322118 275.685 +322179 477.364 +322201 86.1 +322204 317.516 +322222 94.911 +322252 426.757 +322317 20.18 +322319 56.178 +322322 328.109 +322324 71.449 +322332 318.745 +322348 419.67 +322355 34.663 +322356 237.438 +322381 181.585 +322407 174.54 +322430 238.417 +322431 234.431 +322480 110.92 +322483 0 +322487 0 +322492 294.315 +322510 3.162 +322599 95.947 +322602 24.342 +322603 2.761 +322605 90.614 +322616 18.079 +322617 138.687 +322625 341.969 +322633 52.231 +323232 0 +323413 0 +323414 6.606 +323416 14.198 +323417 5.998 +323418 9.058 +323419 10.317 +323420 2.828 +323421 2.754 +323422 0.074 +323423 22.385 +323470 83.847 +323471 76.015 +323472 19.45 +323473 55.094 +323474 78.721 +323475 15.38 +323487 157.905 +323488 197.78 +323492 5.95 +323493 27.663 +323495 34.141 +323524 182.26 +323525 246.388 +323526 67.832 +323693 41.09 +323696 89.73 +323702 148.513 +323725 119.823 +323726 14.728 +323727 253.007 +323755 302.018 +323775 48.452 +323778 273.365 +323790 279.544 +323794 16.429 +323841 156.807 +323857 97.588 +323940 433.407 +323954 15.48 +323976 15.171 +323978 22.087 +323980 68.171 +323983 57.194 +323997 130.011 +324021 254.578 +324022 132.29 +324077 244.9 +324201 366.809 +324202 39.72 +324205 23.278 +324206 17.783 +324207 4.108 +324209 17.711 +324237 76.231 +324245 421.399 +324293 518.939 +324315 70.782 +324318 101.426 +324420 202.661 +324564 0.016 +324570 0 +324571 0.013 +324729 15.935 +324747 310.581 +324764 30.333 +324765 88.664 +324769 47.322 +324772 19.602 +324785 187.095 +324791 247.724 +324835 111.572 +324840 27.864 +324841 303.483 +324846 70.251 +324878 409.002 +324897 51.027 +324970 486.994 +324980 527.983 +324997 42.308 +324998 114.778 +324999 3.91 +325000 95.258 +325001 121.488 +325022 436.917 +325057 121.483 +325097 18.725 +325098 2.005 +325099 139.74 +325100 74.857 +325101 119.275 +325110 3.279 +325111 3.834 +325113 21.895 +325114 1.396 +325117 87.506 +325159 62.202 +325168 4.341 +325169 5.634 +325170 265.367 +325172 69.03 +325175 1.504 From e2b3faba69733235d9ee5e79d1596a8a6c6de0da Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Fri, 25 Sep 2020 21:03:32 +0200 Subject: [PATCH 067/778] Run NanoGen from runTheMatrix.py --- .../PyReleaseValidation/python/relval_generator.py | 1 + Configuration/PyReleaseValidation/python/relval_steps.py | 7 ++++++- PhysicsTools/NanoAOD/python/nanogen_cff.py | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Configuration/PyReleaseValidation/python/relval_generator.py b/Configuration/PyReleaseValidation/python/relval_generator.py index 2ff02c90f5e43..4a129b652bcbc 100644 --- a/Configuration/PyReleaseValidation/python/relval_generator.py +++ b/Configuration/PyReleaseValidation/python/relval_generator.py @@ -40,3 +40,4 @@ workflows[545]=['',['BsToMuMu_forSTEAM_13TeV','HARVESTGEN']] # Miscellaneous +workflows[595]=['',['DYToLL_M-50_13TeV_pythia8','NANOGENFromGen']] diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 177a00c628ab7..7d91f6f22792c 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -3059,11 +3059,16 @@ def gen2021HiMix(fragment,howMuch): steps['MINIAODMCUP18ml'] =merge([concurrentLumis,steps['MINIAODMCUP18']]) stepNanoAODDefaults = { '-s': 'NANO,DQM:@nanoAODDQM', '-n': 1000 } +stepNanoGenDefaults = { '-s': 'NANOGEN', '-n': 1000 } stepNanoAODData = merge([{ '--data':'', '--eventcontent' : 'NANOAOD,DQM' ,'--datatier': 'NANOAOD,DQMIO' }, stepNanoAODDefaults ]) stepNanoAODMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoAODDefaults ]) stepNanoEDMData = merge([{ '--data':'', '--eventcontent' : 'NANOEDMAOD,DQM' ,'--datatier': 'NANOAOD,DQMIO' }, stepNanoAODDefaults ]) stepNanoEDMMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOEDMAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoAODDefaults ]) stepNanoEDMMCProd = merge([{ '--mc':'', '-s': 'NANO', '--eventcontent' : 'NANOEDMAODSIM','--datatier': 'NANOAODSIM' }, stepNanoAODDefaults ]) +stepNanoGen = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoGenDefaults ]) + +steps['NANOGENFromGen'] = merge([{'--conditions': 'auto:run2_mc', '--customise' : 'PhysicsTools/NanoAOD/nanogen_cff.customizeNanoGEN'}, stepNanoGen ]) +steps['NANOGENFromMini'] = merge([{'--conditions': 'auto:run2_mc'}, stepNanoGen ]) steps['NANOAOD2016'] = merge([{'--conditions': 'auto:run2_data_relval', '--era': 'Run2_2016'}, stepNanoAODData ]) steps['NANOAOD2017'] = merge([{'--conditions': 'auto:run2_data_relval', '--era': 'Run2_2017'}, stepNanoAODData ]) @@ -3087,7 +3092,7 @@ def gen2021HiMix(fragment,howMuch): steps['NANOUP15'] = merge([{ '--conditions':'auto:run2_mc', '--era':'Run2_2016','-n':'10', '--filein':'file:step3_inMINIAODSIM.root','--nThreads':'2'}, stepNanoEDMMCProd ]) steps['NANOUP15_PU25']=steps['NANOUP15'] steps['NANOUP17'] = merge([{'--conditions':'auto:phase1_2017_realistic','--era': 'Run2_2017','-n':'10' ,'--filein':'file:step3_inMINIAODSIM.root', '--geometry':'DB:Extended', '--nThreads':'2'}, stepNanoEDMMCProd]) -steps['NANOUP15Had']=merge([{'--filein':'file:step4_inMINIAODSIM.root'},steps['NANOUP15']]) +steps['NANOUP15Had']=merge([{'--filein':'file:step4_inSIM.root'},steps['NANOUP15']]) steps['NANOUP15MC_PU25_JME']=merge([{'--customise':'PhysicsTools/NanoAOD/custom_jme_cff.PrepJMECustomNanoAOD_MC'},steps['NANOUP15']]) steps['NANOUP15Data_PU25_JME']=merge([{'--customise':'PhysicsTools/NanoAOD/custom_jme_cff.PrepJMECustomNanoAOD_Data','--data':''},steps['NANOUP15']]) steps['NANOUP17Had']=merge([{'--filein':'file:step4_inMINIAODSIM.root'},steps['NANOUP17']]) diff --git a/PhysicsTools/NanoAOD/python/nanogen_cff.py b/PhysicsTools/NanoAOD/python/nanogen_cff.py index 6c13502ea8f2d..33d88ce081c5a 100644 --- a/PhysicsTools/NanoAOD/python/nanogen_cff.py +++ b/PhysicsTools/NanoAOD/python/nanogen_cff.py @@ -105,6 +105,11 @@ def customizeNanoGEN(process): process.genJetAK8Table.src = "ak8GenJets" process.tauGenJets.GenParticles = "genParticles" process.genVisTaus.srcGenParticles = "genParticles" + + # In case customizeNanoGENFromMini has already been called + process.nanoAOD_step.remove(process.genParticles2HepMCHiggsVtx) + process.nanoAOD_step.remove(process.genParticles2HepMC) + process.nanoAOD_step.remove(process.mergedGenParticles) nanoGenCommonCustomize(process) return process From f30af258b922e1d69f5aca08edb8fce3a6154d1e Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 25 Sep 2020 15:07:34 -0500 Subject: [PATCH 068/778] simplify and fix tests --- HeterogeneousCore/SonicTriton/test/README.md | 11 ++++----- .../SonicTriton/test/fetch_model.sh | 23 +++++++------------ 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/test/README.md b/HeterogeneousCore/SonicTriton/test/README.md index d6a37a130d93e..92236a36b6696 100644 --- a/HeterogeneousCore/SonicTriton/test/README.md +++ b/HeterogeneousCore/SonicTriton/test/README.md @@ -1,7 +1,7 @@ # SONIC TritonClient tests -A test producer `TritonImageProducer` is available. -It generates an arbitrary image for ResNet50 inference and prints the resulting classifications. +Test producers `TritonImageProducer` and `TritonGraphProducer` are available. +They generate arbitrary inputs for inference (with ResNet50 or Graph Attention Network, respectively) and print the resulting output. To run the tests, a local Triton server can be started using Docker. (This may require superuser permission.) @@ -13,14 +13,11 @@ First, the relevant data should be downloaded from Nvidia: Execute this Docker command to launch the local server: ```bash -docker run -d --rm --name tritonserver \ +docker run -d --name tritonserver \ --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 \ -p8000:8000 -p8001:8001 -p8002:8002 \ -v${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/models:/models \ - -v${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/lib:/inputlib \ - -e LD_LIBRARY_PATH="/opt/tritonserver/lib/pytorch:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64" \ - -e LD_PRELOAD="/inputlib/libtorchscatter.so /inputlib/libtorchsparse.so" \ - nvcr.io/nvidia/tritonserver:20.06-v1-py3 tritonserver --model-repository=/models + fastml/triton-torchgeo:20.06-v1-py3-geometric tritonserver --model-repository=/models ``` If the machine has Nvidia GPUs, the flag `--gpus all` can be added to the command. diff --git a/HeterogeneousCore/SonicTriton/test/fetch_model.sh b/HeterogeneousCore/SonicTriton/test/fetch_model.sh index 0d3bfa1e9a9a5..f2f8a2410a685 100755 --- a/HeterogeneousCore/SonicTriton/test/fetch_model.sh +++ b/HeterogeneousCore/SonicTriton/test/fetch_model.sh @@ -1,8 +1,9 @@ #!/bin/bash -# borrowed from https://github.com/NVIDIA/triton-inference-server/tree/master/docs/examples +# borrowed from https://github.com/triton-inference-server/server/tree/master/docs/examples -TRITON_VERSION=$(scram tool info triton-inference-server | grep "Version : " | cut -d' ' -f3) +TRITON_REPO="https://github.com/triton-inference-server/server" +TRITON_VERSION=$(scram tool info triton-inference-server | grep "Version : " | cut -d' ' -f3 | cut -d'-' -f1) TEST_DIR=`pwd` @@ -11,28 +12,20 @@ cd $TEST_DIR mkdir -p $MODEL_DIR cd $MODEL_DIR -curl -O -L https://github.com/NVIDIA/triton-inference-server/raw/v${TRITON_VERSION}/docs/examples/model_repository/resnet50_netdef/config.pbtxt -curl -O -L https://github.com/NVIDIA/triton-inference-server/raw/v${TRITON_VERSION}/docs/examples/model_repository/resnet50_netdef/resnet50_labels.txt +curl -O -L ${TRITON_REPO}/raw/v${TRITON_VERSION}/docs/examples/model_repository/resnet50_netdef/config.pbtxt +curl -O -L ${TRITON_REPO}/raw/v${TRITON_VERSION}/docs/examples/model_repository/resnet50_netdef/resnet50_labels.txt mkdir -p 1 curl -o 1/model.netdef http://download.caffe2.ai.s3.amazonaws.com/models/resnet50/predict_net.pb curl -o 1/init_model.netdef http://download.caffe2.ai.s3.amazonaws.com/models/resnet50/init_net.pb +GAT_REPO="https://github.com/lgray/triton-torchgeo-gat-example/raw/cmssw_20.06-v1-py3" GAT_DIR=${TEST_DIR}/../data/models/gat_test cd $TEST_DIR mkdir -p $GAT_DIR cd $GAT_DIR -curl -O -L https://github.com/lgray/triton-torchgeo-gat-example/raw/cmssw_20.06-v1-py3/artifacts/models/gat_test/config.pbtxt +curl -O -L ${GAT_REPO}/artifacts/models/gat_test/config.pbtxt mkdir -p 1 -curl -o 1/model.pt -L https://github.com/lgray/triton-torchgeo-gat-example/raw/cmssw_20.06-v1-py3/artifacts/models/gat_test/1/model.pt - -TORCH_DIR=${TEST_DIR}/../data/lib/ -cd $TEST_DIR -mkdir -p $TORCH_DIR -cd $TORCH_DIR - -for lib in libtorchcluster.so libtorchscatter.so libtorchsparse.so libtorchsplineconv.so; do - curl -O -L https://github.com/lgray/triton-torchgeo-gat-example/raw/cmssw_20.06-v1-py3/artifacts/lib/$lib -done +curl -o 1/model.pt -L ${GAT_REPO}/artifacts/models/gat_test/1/model.pt From a76fbe62d9a1e4413e7a9df42d3cc990269943ce Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 25 Sep 2020 18:36:20 -0500 Subject: [PATCH 069/778] add singularity instructions --- HeterogeneousCore/SonicTriton/test/README.md | 33 ++++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/test/README.md b/HeterogeneousCore/SonicTriton/test/README.md index 92236a36b6696..50a3a71755b01 100644 --- a/HeterogeneousCore/SonicTriton/test/README.md +++ b/HeterogeneousCore/SonicTriton/test/README.md @@ -3,14 +3,38 @@ Test producers `TritonImageProducer` and `TritonGraphProducer` are available. They generate arbitrary inputs for inference (with ResNet50 or Graph Attention Network, respectively) and print the resulting output. -To run the tests, a local Triton server can be started using Docker. -(This may require superuser permission.) +To run the tests, a local Triton server can be started using Singularity or Docker. +The default local server address is `0.0.0.0`. +(In either case, to get more debugging information from the server, the flags `--log-verbose=1 --log-error=1 --log-info=1` +can be added to the end of the command that includes `tritonserver`.) First, the relevant data should be downloaded from Nvidia: ``` ./fetch_model.sh ``` +## Singularity instructions + +Using Singularity should not require superuser permissions. + +Execute these Singularity commands to start the instance in the background and then activate the server: +```bash +singularity instance start \ + -B /dev/shm:/run/shm -B ${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/models:/models \ + /cvmfs/unpacked.cern.ch/registry.hub.docker.com/fastml/triton-torchgeo:20.06-v1-py3-geometric/ triton_server_instance +singularity run instance://triton_server_instance \ + tritonserver --model-repository=/models +``` + +(Some operating systems may have `/run/shm` rather than `/dev/shm`.) + +If the machine has Nvidia GPUs, the flag `--nv` can be added to the command. +Otherwise, the server will perform inference using the CPU (slower). + +## Docker instructions + +Using Docker may require superuser permissions. + Execute this Docker command to launch the local server: ```bash docker run -d --name tritonserver \ @@ -23,10 +47,7 @@ docker run -d --name tritonserver \ If the machine has Nvidia GPUs, the flag `--gpus all` can be added to the command. Otherwise, the server will perform inference using the CPU (slower). -To get more debugging information from the server, the flags `--log-verbose=1 --log-error=1 --log-info=1` -can be added to the end of the command. - -The default local server address is `0.0.0.0`. +## Test commands Run the image test: ``` From 230a45533cfb259aec2900c35333757a48a31547 Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Sat, 26 Sep 2020 14:23:36 +0200 Subject: [PATCH 070/778] Add DQM support, improve nanogen configs --- .../python/relval_steps.py | 2 +- .../Configuration/python/DQMOffline_cff.py | 2 ++ DQMOffline/Configuration/python/autoDQM.py | 4 +++ PhysicsTools/NanoAOD/python/nanogen_cff.py | 28 +++++++++---------- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 7d91f6f22792c..7bfb85d5bdf88 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -3059,7 +3059,7 @@ def gen2021HiMix(fragment,howMuch): steps['MINIAODMCUP18ml'] =merge([concurrentLumis,steps['MINIAODMCUP18']]) stepNanoAODDefaults = { '-s': 'NANO,DQM:@nanoAODDQM', '-n': 1000 } -stepNanoGenDefaults = { '-s': 'NANOGEN', '-n': 1000 } +stepNanoGenDefaults = { '-s': 'NANOGEN,DQM:@nanogenDQM', '-n': 1000 } stepNanoAODData = merge([{ '--data':'', '--eventcontent' : 'NANOAOD,DQM' ,'--datatier': 'NANOAOD,DQMIO' }, stepNanoAODDefaults ]) stepNanoAODMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoAODDefaults ]) stepNanoEDMData = merge([{ '--data':'', '--eventcontent' : 'NANOEDMAOD,DQM' ,'--datatier': 'NANOAOD,DQMIO' }, stepNanoAODDefaults ]) diff --git a/DQMOffline/Configuration/python/DQMOffline_cff.py b/DQMOffline/Configuration/python/DQMOffline_cff.py index b00a5b93181b7..f91223247653a 100644 --- a/DQMOffline/Configuration/python/DQMOffline_cff.py +++ b/DQMOffline/Configuration/python/DQMOffline_cff.py @@ -244,3 +244,5 @@ from PhysicsTools.NanoAOD.nanoDQM_cff import nanoDQM DQMOfflineNanoAOD = cms.Sequence(nanoDQM) #PostDQMOfflineNanoAOD = cms.Sequence(nanoDQM) +from PhysicsTools.NanoAOD.nanogenDQM_cff import nanogenDQM +DQMOfflineNanoGen = cms.Sequence(nanogenDQM) diff --git a/DQMOffline/Configuration/python/autoDQM.py b/DQMOffline/Configuration/python/autoDQM.py index 600e825af3493..85387999b37a6 100644 --- a/DQMOffline/Configuration/python/autoDQM.py +++ b/DQMOffline/Configuration/python/autoDQM.py @@ -181,6 +181,10 @@ 'PostDQMOffline', 'DQMHarvestNanoAOD'], + 'nanogenDQM': ['DQMOfflineNanoGen', + 'PostDQMOffline', + 'DQMHarvestNanoAOD'], + 'pfDQM': ['DQMOfflinePF+DQMOfflinePFExtended', 'PostDQMOffline', 'DQMHarvestPF'], diff --git a/PhysicsTools/NanoAOD/python/nanogen_cff.py b/PhysicsTools/NanoAOD/python/nanogen_cff.py index 33d88ce081c5a..ec6806d5270bb 100644 --- a/PhysicsTools/NanoAOD/python/nanogen_cff.py +++ b/PhysicsTools/NanoAOD/python/nanogen_cff.py @@ -1,6 +1,7 @@ from PhysicsTools.NanoAOD.taus_cff import * from PhysicsTools.NanoAOD.jets_cff import * from PhysicsTools.NanoAOD.globals_cff import * +from PhysicsTools.NanoAOD.met_cff import metMCTable from PhysicsTools.NanoAOD.genparticles_cff import * from PhysicsTools.NanoAOD.particlelevel_cff import * from PhysicsTools.NanoAOD.lheInfoTable_cfi import * @@ -12,18 +13,6 @@ ) ) -metGenTable = cms.EDProducer("SimpleCandidateFlatTableProducer", - src = cms.InputTag("genMetTrue"), - name = cms.string("GenMET"), - doc = cms.string("Gen MET"), - singleton = cms.bool(True), - extension = cms.bool(False), - variables = cms.PSet( - pt = Var("pt", float, doc="pt", precision=10), - phi = Var("phi", float, doc="phi", precision=10), - ), -) - nanogenSequence = cms.Sequence( nanoMetadata+ particleLevel+ @@ -43,7 +32,7 @@ tautagger+ rivetProducerHTXS+ particleLevelTables+ - metGenTable+ + metMCTable+ genWeightsTable+ lheInfoTable ) @@ -66,6 +55,7 @@ ) def nanoGenCommonCustomize(process): + process.rivetMetTable.extension = False process.lheInfoTable.storeLHEParticles = True process.lheInfoTable.precision = 14 process.genJetFlavourAssociation.jets = process.genJetTable.src @@ -82,6 +72,10 @@ def customizeNanoGENFromMini(process): process.nanoAOD_step.insert(0, process.genParticles2HepMC) process.nanoAOD_step.insert(0, process.mergedGenParticles) + process.metMCTable.src = "slimmedMETs" + process.metMCTable.variables.pt = Var("genMET.pt", float, doc="pt", precision=10) + process.metMCTable.variables.phi = Var("genMET.phi", float, doc="phi", precision=10) + process.rivetProducerHTXS.HepMCCollection = "genParticles2HepMCHiggsVtx:unsmeared" process.genParticleTable.src = "prunedGenParticles" process.patJetPartons.particles = "prunedGenParticles" @@ -96,6 +90,10 @@ def customizeNanoGENFromMini(process): return process def customizeNanoGEN(process): + process.metMCTable.src = "genMetTrue" + process.metMCTable.variables.pt = Var("pt", float, doc="pt", precision=10) + process.metMCTable.variables.phi = Var("phi", float, doc="phi", precision=10) + process.rivetProducerHTXS.HepMCCollection = "generatorSmeared" process.genParticleTable.src = "genParticles" process.patJetPartons.particles = "genParticles" @@ -140,8 +138,8 @@ def setGenFullPrecision(process): process.genJetTable.variables.pt.precision = 23 process.genJetTable.variables.eta.precision = 23 process.genJetTable.variables.phi.precision = 23 - process.metGenTable.variables.pt.precision = 23 - process.metGenTable.variables.phi.precision = 23 + process.metMCTable.variables.pt.precision = 23 + process.metMCTable.variables.phi.precision = 23 return process def setLHEFullPrecision(process): From 7718b883e26e314d4f7940b78e65b3adc8ab410f Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Sat, 26 Sep 2020 15:28:57 +0200 Subject: [PATCH 071/778] Clean up output, remove trigger branches --- .../python/relval_steps.py | 2 +- .../python/NanoAODEDMEventContent_cff.py | 7 ++++++- PhysicsTools/NanoAOD/python/nanogen_cff.py | 19 +------------------ 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 7bfb85d5bdf88..c7eab8de47a6a 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -3065,7 +3065,7 @@ def gen2021HiMix(fragment,howMuch): stepNanoEDMData = merge([{ '--data':'', '--eventcontent' : 'NANOEDMAOD,DQM' ,'--datatier': 'NANOAOD,DQMIO' }, stepNanoAODDefaults ]) stepNanoEDMMC = merge([{ '--mc':'' , '--eventcontent' : 'NANOEDMAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoAODDefaults ]) stepNanoEDMMCProd = merge([{ '--mc':'', '-s': 'NANO', '--eventcontent' : 'NANOEDMAODSIM','--datatier': 'NANOAODSIM' }, stepNanoAODDefaults ]) -stepNanoGen = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODSIM,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoGenDefaults ]) +stepNanoGen = merge([{ '--mc':'' , '--eventcontent' : 'NANOAODGEN,DQM','--datatier': 'NANOAODSIM,DQMIO' }, stepNanoGenDefaults ]) steps['NANOGENFromGen'] = merge([{'--conditions': 'auto:run2_mc', '--customise' : 'PhysicsTools/NanoAOD/nanogen_cff.customizeNanoGEN'}, stepNanoGen ]) steps['NANOGENFromMini'] = merge([{'--conditions': 'auto:run2_mc'}, stepNanoGen ]) diff --git a/PhysicsTools/NanoAOD/python/NanoAODEDMEventContent_cff.py b/PhysicsTools/NanoAOD/python/NanoAODEDMEventContent_cff.py index fa1144ac41330..d2e1f939d795e 100644 --- a/PhysicsTools/NanoAOD/python/NanoAODEDMEventContent_cff.py +++ b/PhysicsTools/NanoAOD/python/NanoAODEDMEventContent_cff.py @@ -19,7 +19,12 @@ compressionLevel = cms.untracked.int32(9), compressionAlgorithm = cms.untracked.string("LZMA"), ) -NANOAODGENEventContent = NanoAODEDMEventContent.clone( + +NanoGenOutput = NanoAODEDMEventContent.outputCommands[:] +NanoGenOutput.remove("keep edmTriggerResults_*_*_*") + +NANOAODGENEventContent = cms.PSet( compressionLevel = cms.untracked.int32(9), compressionAlgorithm = cms.untracked.string("LZMA"), + outputCommands = cms.untracked.vstring(NanoGenOutput) ) diff --git a/PhysicsTools/NanoAOD/python/nanogen_cff.py b/PhysicsTools/NanoAOD/python/nanogen_cff.py index ec6806d5270bb..0eeddd06b1bcb 100644 --- a/PhysicsTools/NanoAOD/python/nanogen_cff.py +++ b/PhysicsTools/NanoAOD/python/nanogen_cff.py @@ -1,6 +1,6 @@ from PhysicsTools.NanoAOD.taus_cff import * from PhysicsTools.NanoAOD.jets_cff import * -from PhysicsTools.NanoAOD.globals_cff import * +from PhysicsTools.NanoAOD.globals_cff import genTable from PhysicsTools.NanoAOD.met_cff import metMCTable from PhysicsTools.NanoAOD.genparticles_cff import * from PhysicsTools.NanoAOD.particlelevel_cff import * @@ -37,23 +37,6 @@ lheInfoTable ) -NANOAODGENoutput = cms.OutputModule("NanoAODOutputModule", - compressionAlgorithm = cms.untracked.string('LZMA'), - compressionLevel = cms.untracked.int32(9), - dataset = cms.untracked.PSet( - dataTier = cms.untracked.string('NANOAODSIM'), - filterName = cms.untracked.string('') - ), - fileName = cms.untracked.string('nanogen.root'), - outputCommands = cms.untracked.vstring( - 'drop *', - "keep nanoaodFlatTable_*Table_*_*", # event data - "keep String_*_genModel_*", # generator model data - "keep nanoaodMergeableCounterTable_*Table_*_*", # accumulated per/run or per/lumi data - "keep nanoaodUniqueString_nanoMetadata_*_*", # basic metadata - ) -) - def nanoGenCommonCustomize(process): process.rivetMetTable.extension = False process.lheInfoTable.storeLHEParticles = True From ee6a465490cf240f248484aa80aaab61cc4c874f Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Sat, 26 Sep 2020 15:56:41 +0200 Subject: [PATCH 072/778] Revert accidental change --- Configuration/PyReleaseValidation/python/relval_steps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index c7eab8de47a6a..90f316fbb5b69 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -3092,7 +3092,7 @@ def gen2021HiMix(fragment,howMuch): steps['NANOUP15'] = merge([{ '--conditions':'auto:run2_mc', '--era':'Run2_2016','-n':'10', '--filein':'file:step3_inMINIAODSIM.root','--nThreads':'2'}, stepNanoEDMMCProd ]) steps['NANOUP15_PU25']=steps['NANOUP15'] steps['NANOUP17'] = merge([{'--conditions':'auto:phase1_2017_realistic','--era': 'Run2_2017','-n':'10' ,'--filein':'file:step3_inMINIAODSIM.root', '--geometry':'DB:Extended', '--nThreads':'2'}, stepNanoEDMMCProd]) -steps['NANOUP15Had']=merge([{'--filein':'file:step4_inSIM.root'},steps['NANOUP15']]) +steps['NANOUP15Had']=merge([{'--filein':'file:step4_inMINIAODSIM.root'},steps['NANOUP15']]) steps['NANOUP15MC_PU25_JME']=merge([{'--customise':'PhysicsTools/NanoAOD/custom_jme_cff.PrepJMECustomNanoAOD_MC'},steps['NANOUP15']]) steps['NANOUP15Data_PU25_JME']=merge([{'--customise':'PhysicsTools/NanoAOD/custom_jme_cff.PrepJMECustomNanoAOD_Data','--data':''},steps['NANOUP15']]) steps['NANOUP17Had']=merge([{'--filein':'file:step4_inMINIAODSIM.root'},steps['NANOUP17']]) From 5ddf006519e6185b4c4ffc0f1f6f223ff837dd43 Mon Sep 17 00:00:00 2001 From: Kenneth Long Date: Sat, 26 Sep 2020 17:29:42 +0200 Subject: [PATCH 073/778] Add nanogenDQM file --- PhysicsTools/NanoAOD/python/nanogenDQM_cff.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 PhysicsTools/NanoAOD/python/nanogenDQM_cff.py diff --git a/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py b/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py new file mode 100644 index 0000000000000..45cc01da8950e --- /dev/null +++ b/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py @@ -0,0 +1,28 @@ +import FWCore.ParameterSet.Config as cms +import copy + +from PhysicsTools.NanoAOD.nanoDQM_cfi import nanoDQM +from PhysicsTools.NanoAOD.nanoDQM_tools_cff import * + + +nanogenDQM = nanoDQM.clone() + +nanogenDQM.vplots = [nanoDQM.vplots.GenDressedLepton, + nanoDQM.vplots.GenIsolatedPhoton, + nanoDQM.vplots.GenJet, + nanoDQM.vplots.GenJetAK8, + nanoDQM.vplots.GenMET, + nanoDQM.vplots.GenPart, + nanoDQM.vplots.GenVisTau, + ] + +from DQMServices.Core.DQMQualityTester import DQMQualityTester +nanoDQMQTester = DQMQualityTester( + qtList = cms.untracked.FileInPath('PhysicsTools/NanoAOD/test/dqmQualityTests.xml'), + prescaleFactor = cms.untracked.int32(1), + testInEventloop = cms.untracked.bool(False), + qtestOnEndLumi = cms.untracked.bool(False), + verboseQT = cms.untracked.bool(True) +) + +nanogenHarvest = cms.Sequence( nanoDQMQTester ) From 058dbef31d64f4f4e8359f1cecb1c2890b4103ba Mon Sep 17 00:00:00 2001 From: ddesouza Date: Mon, 28 Sep 2020 00:35:42 +0200 Subject: [PATCH 074/778] Include the HF filters for heavy ions in the MiniAOD content --- .../HeavyIonEvent/interface/HFFilterStruct.h | 13 +++ .../HeavyIonEvent/src/HFFilterStruct.cc | 1 + DataFormats/HeavyIonEvent/src/classes.h | 1 + DataFormats/HeavyIonEvent/src/classes_def.xml | 4 + .../python/slimming/MicroEventContent_cff.py | 1 + .../PatAlgos/python/slimming/slimming_cff.py | 3 +- .../plugins/HiHFFilterProducer.cc | 103 ++++++++++++++++++ .../python/HiHFFilterProducer_cfi.py | 5 + 8 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 DataFormats/HeavyIonEvent/interface/HFFilterStruct.h create mode 100644 DataFormats/HeavyIonEvent/src/HFFilterStruct.cc create mode 100644 RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc create mode 100644 RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py diff --git a/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h b/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h new file mode 100644 index 0000000000000..6765087a3c408 --- /dev/null +++ b/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h @@ -0,0 +1,13 @@ +#ifndef HEAVYIONEVENT_HFFILTERSTRUCT_H +#define HEAVYIONEVENT_HFFILTERSTRUCT_H + +namespace pat { + struct HFFilterStruct { + int numMinHFTowers2; + int numMinHFTowers3; + int numMinHFTowers4; + int numMinHFTowers5; + }; +} // namespace pat + +#endif diff --git a/DataFormats/HeavyIonEvent/src/HFFilterStruct.cc b/DataFormats/HeavyIonEvent/src/HFFilterStruct.cc new file mode 100644 index 0000000000000..6f6c236dfc20b --- /dev/null +++ b/DataFormats/HeavyIonEvent/src/HFFilterStruct.cc @@ -0,0 +1 @@ +#include "DataFormats/HeavyIonEvent/interface/HFFilterStruct.h" diff --git a/DataFormats/HeavyIonEvent/src/classes.h b/DataFormats/HeavyIonEvent/src/classes.h index 915bbc04c152e..877390763d304 100644 --- a/DataFormats/HeavyIonEvent/src/classes.h +++ b/DataFormats/HeavyIonEvent/src/classes.h @@ -3,6 +3,7 @@ #include "DataFormats/HeavyIonEvent/interface/ClusterCompatibility.h" #include "DataFormats/HeavyIonEvent/interface/EvtPlane.h" #include "DataFormats/HeavyIonEvent/interface/HeavyIon.h" +#include "DataFormats/HeavyIonEvent/interface/HFFilterStruct.h" #include "DataFormats/HeavyIonEvent/interface/VoronoiBackground.h" #include "DataFormats/Common/interface/Wrapper.h" diff --git a/DataFormats/HeavyIonEvent/src/classes_def.xml b/DataFormats/HeavyIonEvent/src/classes_def.xml index adab47f24cf59..0607d586a67e2 100644 --- a/DataFormats/HeavyIonEvent/src/classes_def.xml +++ b/DataFormats/HeavyIonEvent/src/classes_def.xml @@ -16,6 +16,10 @@ + + + + diff --git a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py index 7ee533a446680..23031a40ea46d 100644 --- a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py @@ -145,6 +145,7 @@ 'keep floatedmValueMap_lostTrackChi2_*_*', 'keep recoCentrality_hiCentrality_*_*', 'keep int_centralityBin_*_*', + 'keep patHFFilterStruct_hiHFfilters_*_*', ] from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 diff --git a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py index bffdf744d48f8..25fb05ee284b7 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py @@ -73,10 +73,11 @@ from PhysicsTools.PatAlgos.packedCandidateMuonID_cfi import packedCandidateMuonID from PhysicsTools.PatAlgos.packedPFCandidateTrackChi2_cfi import packedPFCandidateTrackChi2 from RecoHI.HiCentralityAlgos.CentralityBin_cfi import centralityBin +from RecoHI.HiCentralityAlgos.HiHFFilterProducer_cfi import hiHFfilters lostTrackChi2 = packedPFCandidateTrackChi2.clone(candidates = "lostTracks", doLostTracks = True) (pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith( slimmingTask, - cms.Task(slimmingTask.copy(), packedCandidateMuonID, packedPFCandidateTrackChi2, lostTrackChi2, centralityBin)) + cms.Task(slimmingTask.copy(), packedCandidateMuonID, packedPFCandidateTrackChi2, lostTrackChi2, centralityBin, hiHFfilters)) from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing _phase2_timing_slimmingTask = cms.Task(slimmingTask.copy(), diff --git a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc new file mode 100644 index 0000000000000..ae34acb59bf0f --- /dev/null +++ b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc @@ -0,0 +1,103 @@ + +#include + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/StreamID.h" + +#include "RecoLocalCalo/CaloTowersCreator/src/CaloTowerCandidateCreator.h" +#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" +#include "DataFormats/CaloTowers/interface/CaloTower.h" +#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" +#include "DataFormats/HeavyIonEvent/interface/HFFilterStruct.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescriptionFiller.h" + +#include "DataFormats/Common/interface/Wrapper.h" + +#include + +class HiHFFilterProducer : public edm::stream::EDProducer<> { +public: + explicit HiHFFilterProducer(const edm::ParameterSet&); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void produce(edm::Event&, const edm::EventSetup&) override; + edm::EDGetTokenT srcTowers_; +}; + +HiHFFilterProducer::HiHFFilterProducer(const edm::ParameterSet& iConfig) + : srcTowers_(consumes(iConfig.getParameter("srcTowers"))) { + produces("hiHFfilters"); +} + +void HiHFFilterProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + using namespace std; + using namespace edm; + + auto const& towers = iEvent.getHandle(srcTowers_); + + int nTowersTh2HFplus = 0; + int nTowersTh2HFminus = 0; + int nTowersTh3HFplus = 0; + int nTowersTh3HFminus = 0; + int nTowersTh4HFplus = 0; + int nTowersTh4HFminus = 0; + int nTowersTh5HFplus = 0; + int nTowersTh5HFminus = 0; + + auto HFFilterResults = std::make_unique(); + for (unsigned int towerIndx = 0; towerIndx < towers->size(); ++towerIndx) { + const CaloTower& tower = (*towers)[towerIndx]; + const auto et = tower.et(); + const auto energy = tower.energy(); + const auto eta = tower.eta(); + const bool eta_plus = (eta > 3.0) && (eta < 6.0); + const bool eta_minus = (eta < -3.0) && (eta > -6.0); + if (et < 0.0) + continue; + if (eta_plus) { + if (energy >= 2.0) + nTowersTh2HFplus += 1; + if (energy >= 3.0) + nTowersTh3HFplus += 1; + if (energy >= 4.0) + nTowersTh4HFplus += 1; + if (energy >= 5.0) + nTowersTh5HFplus += 1; + } else if (eta_minus) { + if (energy >= 2.0) + nTowersTh2HFminus += 1; + if (energy >= 3.0) + nTowersTh3HFminus += 1; + if (energy >= 4.0) + nTowersTh4HFminus += 1; + if (energy >= 5.0) + nTowersTh5HFminus += 1; + } + } + + HFFilterResults->numMinHFTowers2 = std::min(nTowersTh2HFplus, nTowersTh2HFminus); + HFFilterResults->numMinHFTowers3 = std::min(nTowersTh3HFplus, nTowersTh3HFminus); + HFFilterResults->numMinHFTowers4 = std::min(nTowersTh4HFplus, nTowersTh4HFminus); + HFFilterResults->numMinHFTowers5 = std::min(nTowersTh5HFplus, nTowersTh5HFminus); + + iEvent.put(std::move(HFFilterResults), "hiHFfilters"); +} + +void HiHFFilterProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("srcTowers", {"towerMaker"}); + descriptions.addWithDefaultLabel(desc); +} + +DEFINE_FWK_MODULE(HiHFFilterProducer); diff --git a/RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py b/RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py new file mode 100644 index 0000000000000..9ff35c32efb0f --- /dev/null +++ b/RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py @@ -0,0 +1,5 @@ +import FWCore.ParameterSet.Config as cms + +hiHFfilters = cms.EDProducer("HiHFFilterProducer", +srcTowers = cms.InputTag("towerMaker") +) From 6af4aef6eec1e719017b735641be033a51711cac Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama Date: Sun, 27 Sep 2020 22:43:32 -0500 Subject: [PATCH 075/778] dataset updates --- .../RecoParticleFlow/test/crab/multicrab.py | 17 +++++++++-------- .../test/crab/multicrab_phase2.py | 15 ++++++++------- Validation/RecoParticleFlow/test/datasets.py | 10 ++++++---- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Validation/RecoParticleFlow/test/crab/multicrab.py b/Validation/RecoParticleFlow/test/crab/multicrab.py index a29938864f6c6..f217045e279e7 100644 --- a/Validation/RecoParticleFlow/test/crab/multicrab.py +++ b/Validation/RecoParticleFlow/test/crab/multicrab.py @@ -1,5 +1,4 @@ from CRABAPI.RawCommand import crabCommand -from CRABClient.UserUtilities import getUsernameFromSiteDB from CRABClient.UserUtilities import config from copy import deepcopy import os @@ -11,10 +10,12 @@ def submit(config): fi.write(config.pythonise_()) samples = [ - ("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_0_0_patch1-110X_mcRun3_2021_realistic_v6-v1/GEN-SIM-DIGI-RAW", "QCD_noPU"), - ("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_0_0_patch1-PU_110X_mcRun3_2021_realistic_v6-v1/GEN-SIM-DIGI-RAW", "QCD_PU"), - #("/RelValZMM_14/CMSSW_11_0_0_patch1-PU_110X_mcRun3_2021_realistic_v6-v1/GEN-SIM-DIGI-RAW", "ZMM_PU"), - ("/RelValNuGun/CMSSW_11_0_0_patch1-PU_110X_mcRun3_2021_realistic_v6-v1/GEN-SIM-DIGI-RAW", "NuGun_PU"), + ("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_2_0_pre6-112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "QCD_noPU"), + ("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "QCD_PU"), + ("/RelValZEE_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "ZEE_PU"), + ("/RelValZMM_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "ZMM_PU"), + ("/RelValTenTau_15_500/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "TenTau_PU"), + ("/RelValNuGun/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "NuGun_PU"), ] if __name__ == "__main__": @@ -30,7 +31,7 @@ def submit(config): conf.General.workArea = 'crab_projects' conf.JobType.pluginName = 'Analysis' conf.JobType.psetName = 'step3_dump.py' - conf.JobType.maxJobRuntimeMin = 4*60 + conf.JobType.maxJobRuntimeMin = 8*60 conf.JobType.allowUndistributedCMSSW = True conf.JobType.outputFiles = ["step3_inMINIAODSIM.root"] conf.JobType.maxMemoryMB = 5000 @@ -45,8 +46,8 @@ def submit(config): #conf.Data.ignoreLocality = True # Where the output files will be transmitted to - #conf.Site.storageSite = 'T3_US_Baylor' - conf.Site.storageSite = 'T2_US_Caltech' + conf.Site.storageSite = 'T3_US_Baylor' + #conf.Site.storageSite = 'T2_US_Caltech' #conf.Site.whitelist = ["T2_US_Caltech", "T2_CH_CERN"] submit(conf) diff --git a/Validation/RecoParticleFlow/test/crab/multicrab_phase2.py b/Validation/RecoParticleFlow/test/crab/multicrab_phase2.py index f662327e02c85..0bc754b27078d 100644 --- a/Validation/RecoParticleFlow/test/crab/multicrab_phase2.py +++ b/Validation/RecoParticleFlow/test/crab/multicrab_phase2.py @@ -1,5 +1,4 @@ from CRABAPI.RawCommand import crabCommand -from CRABClient.UserUtilities import getUsernameFromSiteDB from CRABClient.UserUtilities import config from copy import deepcopy import os @@ -11,9 +10,11 @@ def submit(config): fi.write(config.pythonise_()) samples = [ - ("/RelValQCD_Pt15To7000_Flat_14TeV/CMSSW_11_0_0-110X_mcRun4_realistic_v2_2026D49noPU-v1/GEN-SIM-DIGI-RAW", "QCD_noPU_phase2"), - ("/RelValQCD_Pt15To7000_Flat_14TeV/CMSSW_11_0_0-PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/GEN-SIM-DIGI-RAW", "QCD_PU_phase2"), - #("/RelValZMM_14/CMSSW_11_0_0-PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/GEN-SIM-DIGI-RAW", "ZMM_PU_phase2"), + ("/RelValQCD_Pt15To7000_Flat_14/CMSSW_11_2_0_pre6-112X_mcRun4_realistic_v2_2026D49noPU-v1/GEN-SIM-DIGI-RAW", "QCD_noPU_phase2"), + ("/RelValQCD_Pt15To7000_Flat_14/CMSSW_11_2_0_pre6-PU25ns_112X_mcRun4_realistic_v2_2026D49PU200-v1/GEN-SIM-DIGI-RAW", "QCD_PU_phase2"), + ("/RelValZEE_14/CMSSW_11_2_0_pre6-PU25ns_112X_mcRun4_realistic_v2_2026D49PU200-v1/GEN-SIM-DIGI-RAW", "ZEE_PU_phase2"), + ("/RelValZMM_14/CMSSW_11_2_0_pre6-PU25ns_112X_mcRun4_realistic_v2_2026D49PU200-v1/GEN-SIM-DIGI-RAW", "ZMM_PU_phase2"), + ("/RelValTenTau_15_500_Eta3p1/CMSSW_11_2_0_pre6-PU25ns_112X_mcRun4_realistic_v2_2026D49PU200-v1/GEN-SIM-DIGI-RAW", "TenTau_PU_phase2"), ("/RelValNuGun/CMSSW_11_0_0-PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/GEN-SIM-DIGI-RAW", "NuGun_PU_phase2"), ] @@ -30,7 +31,7 @@ def submit(config): conf.General.workArea = 'crab_projects' conf.JobType.pluginName = 'Analysis' conf.JobType.psetName = 'step3_dump.py' - conf.JobType.maxJobRuntimeMin = 4*60 + conf.JobType.maxJobRuntimeMin = 8*60 conf.JobType.allowUndistributedCMSSW = True conf.JobType.outputFiles = ["step3_inMINIAODSIM.root"] conf.JobType.maxMemoryMB = 5000 @@ -45,8 +46,8 @@ def submit(config): #conf.Data.ignoreLocality = True # Where the output files will be transmitted to - #conf.Site.storageSite = 'T3_US_Baylor' - conf.Site.storageSite = 'T2_US_Caltech' + conf.Site.storageSite = 'T3_US_Baylor' + #conf.Site.storageSite = 'T2_US_Caltech' #conf.Site.whitelist = ["T2_US_Caltech", "T2_CH_CERN"] submit(conf) diff --git a/Validation/RecoParticleFlow/test/datasets.py b/Validation/RecoParticleFlow/test/datasets.py index 503ec11dced55..5bcd349ebbe8b 100644 --- a/Validation/RecoParticleFlow/test/datasets.py +++ b/Validation/RecoParticleFlow/test/datasets.py @@ -129,9 +129,11 @@ def cache_das_filenames(self): #prefix = "root://xrootd-cms.infn.it//" tmpdir = "tmp" datasets = [ - Dataset("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_1_0_pre5-111X_mcRun3_2021_realistic_v2-v1/GEN-SIM-DIGI-RAW", "QCD_noPU", prefix, None, False, tmpdir), - Dataset("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_1_0_pre5-PU_111X_mcRun3_2021_realistic_v2_rsb-v1/GEN-SIM-DIGI-RAW", "QCD_PU", prefix, None, False, tmpdir), - Dataset("/RelValZMM_14/CMSSW_11_1_0_pre5-PU_111X_mcRun3_2021_realistic_v2_rsb-v1/GEN-SIM-DIGI-RAW", "ZMM_PU", prefix, None, False, tmpdir), - Dataset("/RelValNuGun/CMSSW_11_1_0_pre5-PU_111X_mcRun3_2021_realistic_v2_rsb-v1/GEN-SIM-DIGI-RAW", "NuGun_PU", prefix, None, False, tmpdir)] + Dataset("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_2_0_pre6-112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "QCD_noPU", prefix, None, False, tmpdir), + Dataset("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "QCD_PU", prefix, None, False, tmpdir), + Dataset("/RelValZEE_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "ZEE_PU", prefix, None, False, tmpdir), + Dataset("/RelValZMM_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "ZMM_PU", prefix, None, False, tmpdir), + Dataset("/RelValTenTau_15_500/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", prefix, None, False, tmpdir), + Dataset("/RelValNuGun/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "NuGun_PU", prefix, None, False, tmpdir)] for ds in datasets: ds.cache_das_filenames() From 9e25e5530441513cd8df101f114d39b9f936dc21 Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama Date: Sun, 27 Sep 2020 23:11:30 -0500 Subject: [PATCH 076/778] Update run_relval.sh script and expand the list of samples to run over. --- Validation/RecoParticleFlow/test/run_relval.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Validation/RecoParticleFlow/test/run_relval.sh b/Validation/RecoParticleFlow/test/run_relval.sh index b54b35cbbf7a2..6669cdbfba4ff 100755 --- a/Validation/RecoParticleFlow/test/run_relval.sh +++ b/Validation/RecoParticleFlow/test/run_relval.sh @@ -33,7 +33,7 @@ NTHREADS=2 #Argument parsing if [ "$#" -ne 3 ]; then - echo "Must pass exactly 3 arguments: run_relval.sh [QCD|QCDPU|ZMMPU|NuGunPU] [reco|dqm] [njob]" + echo "Must pass exactly 3 arguments: run_relval.sh [QCD|QCDPU|ZEEPU|ZMMPU|TENTAUPU|NuGunPU] [reco|dqm] [njob]" exit 0 fi @@ -62,9 +62,15 @@ if [ "$1" == "QCD" ]; then elif [ "$1" == "QCDPU" ]; then INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/QCD_PU.txt NAME=QCDPU +elif [ "$1" == "ZEEPU" ]; then + INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/ZEE_PU.txt + NAME=ZEE elif [ "$1" == "ZMMPU" ]; then INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/ZMM_PU.txt NAME=ZMM +elif [ "$1" == "TENTAUPU" ]; then + INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/TENTAU_PU.txt + NAME=TENTAU elif [ "$1" == "NuGunPU" ]; then INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/NuGun_PU.txt NAME=NuGunPU @@ -72,7 +78,7 @@ elif [ "$1" == "conf" ]; then # special switch for creating conf file, INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/NuGun_PU.txt # dummy NAME=conf else - echo "Argument 1 must be [QCD|QCDPU|ZMMPU|NuGunPU|conf] but was $1" + echo "Argument 1 must be [QCD|QCDPU|ZEEPU|ZMMPU|TENTAUPU|NuGunPU|conf] but was $1" exit 1 fi From 2ed5522665d463db12c7616b57f91c24ab781a21 Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama Date: Sun, 27 Sep 2020 23:14:58 -0500 Subject: [PATCH 077/778] Update run_relval.sh script and expand the list of samples to run over. --- Validation/RecoParticleFlow/test/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/RecoParticleFlow/test/datasets.py b/Validation/RecoParticleFlow/test/datasets.py index 5bcd349ebbe8b..d2530dbbe4e76 100644 --- a/Validation/RecoParticleFlow/test/datasets.py +++ b/Validation/RecoParticleFlow/test/datasets.py @@ -133,7 +133,7 @@ def cache_das_filenames(self): Dataset("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "QCD_PU", prefix, None, False, tmpdir), Dataset("/RelValZEE_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "ZEE_PU", prefix, None, False, tmpdir), Dataset("/RelValZMM_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "ZMM_PU", prefix, None, False, tmpdir), - Dataset("/RelValTenTau_15_500/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", prefix, None, False, tmpdir), + Dataset("/RelValTenTau_15_500/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "TENTAU_PU", prefix, None, False, tmpdir), Dataset("/RelValNuGun/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "NuGun_PU", prefix, None, False, tmpdir)] for ds in datasets: ds.cache_das_filenames() From f6e6d565a0b2453472c0bf35e538a2756ef0ba0d Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama Date: Mon, 28 Sep 2020 05:57:06 -0500 Subject: [PATCH 078/778] Update phase2 conditions --- Validation/RecoParticleFlow/test/run_relval.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/RecoParticleFlow/test/run_relval.sh b/Validation/RecoParticleFlow/test/run_relval.sh index 6669cdbfba4ff..0b11ebab93be5 100755 --- a/Validation/RecoParticleFlow/test/run_relval.sh +++ b/Validation/RecoParticleFlow/test/run_relval.sh @@ -26,7 +26,7 @@ CONDITIONS=auto:phase1_2021_realistic ERA=Run3 GEOM=DB.Extended #CONDITIONS=auto:phase1_2018_realistic ERA=Run2_2018 GEOM=DB.Extended # #conditions - phase2 -#CONDITIONS=auto:phase2_realistic ERA=Phase2C9 GEOM=Extended2026D49 +#CONDITIONS=auto:phase2_realistic_T15 ERA=Phase2C9 GEOM=Extended2026D49 #Running with 2 threads allows to use more memory on grid NTHREADS=2 From 111f0da702dd3c72b8c8b414dedd8fe63a56bcde Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Mon, 28 Sep 2020 14:27:02 +0200 Subject: [PATCH 079/778] Small cleaning regorganization in GeometricDet. --- .../Geometry/plugins/PGeometricDetBuilder.cc | 2 +- .../src/TrackerGeomBuilderFromGeometricDet.cc | 12 +- .../TrackerGeometryBuilder/test/ModuleInfo.cc | 6 +- .../interface/GeometricDet.h | 160 ++++++--------- .../TrackerGeometricDetExtraESModule.cc | 14 +- .../src/GeometricDet.cc | 192 +++++++++--------- .../test/ModuleNumbering.cc | 10 +- 7 files changed, 185 insertions(+), 211 deletions(-) diff --git a/CondTools/Geometry/plugins/PGeometricDetBuilder.cc b/CondTools/Geometry/plugins/PGeometricDetBuilder.cc index fe69f91a369be..57b8f4adad759 100644 --- a/CondTools/Geometry/plugins/PGeometricDetBuilder.cc +++ b/CondTools/Geometry/plugins/PGeometricDetBuilder.cc @@ -189,7 +189,7 @@ void PGeometricDetBuilder::putOne(const GeometricDet* gd, PGeometricDet* pgd, in item._params9 = 0; item._params10 = 0; } - item._geographicalID = gd->geographicalID(); + item._geographicalID = gd->geographicalId(); item._radLength = gd->radLength(); item._xi = gd->xi(); item._pixROCRows = gd->pixROCRows(); diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc index cc32b9c65aff8..8b75397ba05b3 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc @@ -86,7 +86,7 @@ TrackerGeometry* TrackerGeomBuilderFromGeometricDet::build(const GeometricDet* g tec.reserve(comp.size()); for (auto& i : comp) - dets[i->geographicalID().subdetId() - 1].emplace_back(i); + dets[i->geographicalId().subdetId() - 1].emplace_back(i); //loop on all the six elements of dets and firstly check if they are from pixel-like detector and call buildPixel, then loop again and check if they are strip and call buildSilicon. "unknown" can be filled either way but the vector of GeometricDet must be empty !! // this order is VERY IMPORTANT!!!!! For the moment I (AndreaV) understand that some pieces of code rely on pixel-like being before strip-like @@ -178,10 +178,10 @@ void TrackerGeomBuilderFromGeometricDet::buildPixel( } PlaneBuilderFromGeometricDet::ResultType plane = buildPlaneWithMaterial(i); - GeomDetUnit* temp = new PixelGeomDetUnit(&(*plane), thePixelDetTypeMap[detName], i->geographicalID()); + GeomDetUnit* temp = new PixelGeomDetUnit(&(*plane), thePixelDetTypeMap[detName], i->geographicalId()); tracker->addDetUnit(temp); - tracker->addDetUnitId(i->geographicalID()); + tracker->addDetUnitId(i->geographicalId()); } tracker->setEndsetDU(GeomDetEnumerators::subDetGeom[det]); } @@ -206,13 +206,13 @@ void TrackerGeomBuilderFromGeometricDet::buildSilicon(std::vectoraddType(theStripDetTypeMap[detName]); } - double scale = (theTopo->partnerDetId(i->geographicalID())) ? 0.5 : 1.0; + double scale = (theTopo->partnerDetId(i->geographicalId())) ? 0.5 : 1.0; PlaneBuilderFromGeometricDet::ResultType plane = buildPlaneWithMaterial(i, scale); - GeomDetUnit* temp = new StripGeomDetUnit(&(*plane), theStripDetTypeMap[detName], i->geographicalID()); + GeomDetUnit* temp = new StripGeomDetUnit(&(*plane), theStripDetTypeMap[detName], i->geographicalId()); tracker->addDetUnit(temp); - tracker->addDetUnitId(i->geographicalID()); + tracker->addDetUnitId(i->geographicalId()); } tracker->setEndsetDU(GeomDetEnumerators::subDetGeom[det]); } diff --git a/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc b/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc index 6daf42b831f39..7980a5e5c6536 100644 --- a/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc +++ b/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc @@ -182,7 +182,7 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup // MEC: 2010-04-13: need to find corresponding GeometricDetExtra. std::vector::const_iterator gdei(rDDE->begin()), gdeEnd(rDDE->end()); for (auto& module : modules) { - unsigned int rawid = module->geographicalID().rawId(); + unsigned int rawid = module->geographicalId().rawId(); DetId id(rawid); gdei = rDDE->begin(); for (; gdei != gdeEnd; ++gdei) { @@ -201,7 +201,7 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << "\t nav type = " << detPos; } Output << std::endl; - int subdetid = module->geographicalID().subdetId(); + int subdetid = module->geographicalId().subdetId(); double volume = gdei->volume() / 1000; // mm3->cm3 double density = gdei->density() / density_units; double weight = gdei->weight() / density_units / 1000.; // [kg], hence the factor 1000; @@ -493,7 +493,7 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup } // Local axes from Reco - const GeomDet* geomdet = pDD->idToDet(module->geographicalID()); + const GeomDet* geomdet = pDD->idToDet(module->geographicalId()); // Global Coordinates (i,j,k) LocalVector xLocal(1, 0, 0); LocalVector yLocal(0, 1, 0); diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index f96676decc7ba..ffca1cdc97f44 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -45,9 +45,6 @@ class GeometricDet { using Position = Surface::PositionType; using Rotation = Surface::RotationType; - // - // more can be added; please add at the end! - // typedef enum GDEnumType { unknown = 100, Tracker = 0, @@ -83,137 +80,104 @@ class GeometricDet { PixelPhase2TDRDisk = 237 } GeometricEnumType; - /** - * Constructors to be used when looping over DDD - */ + // Constructors from Filtered View (called while looping over DD). GeometricDet(DDFilteredView* fv, GeometricEnumType dd); GeometricDet(cms::DDFilteredView* fv, GeometricEnumType dd); + // Constructors from persistent data (from DB) GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType dd); - /** - * set or add or clear components - */ + // ACCESS GENERAL INFO + const std::string& name() const { return ddname_; } + const GeometricEnumType& type() const { return type_; } + + // NAVIGATION related info + const nav_type& navType() const { return ddd_; } + NavRange navpos() const { return NavRange(&ddd_.front(), ddd_.size()); } + const DetId& geographicalId() const { return geographicalID_; } void setGeographicalID(DetId id) { geographicalID_ = id; } - void addComponents(GeometricDetContainer const& cont); - void addComponents(ConstGeometricDetContainer const& cont); - void addComponent(GeometricDet*); - /** - * clearComponents() only empties the container, the components are not deleted! - */ - void clearComponents() { container_.clear(); } - - /** - * deleteComponents() explicitly deletes the daughters - * - */ - void deleteComponents(); - - bool isLeaf() const { return container_.empty(); } - - GeometricDet* component(size_t index) { return const_cast(container_[index]); } - - /** - * Access methods - */ - RotationMatrix const& rotation() const { return rot_; } - Translation const& translation() const { return trans_; } - double phi() const { return phi_; } + + // VOLUME POSITION in CMS frame of reference + const Translation& translation() const { return trans_; } double rho() const { return rho_; } + double phi() const { return phi_; } + const RotationMatrix& rotation() const { return rot_; } + + // BOUNDS + std::unique_ptr bounds() const; + Position positionBounds() const; // in cm + Rotation rotationBounds() const; + // SOLID SHAPE // old DD LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } // DD4hep - cms::DDSolidShape shape_dd4hep() const { return shape_; } - - GeometricEnumType type() const { return type_; } - std::string const& name() const { return ddname_; } - - // internal representaion - // old DD - nav_type const& navType() const { return ddd_; } - NavRange navpos() const { return NavRange(&ddd_.front(), ddd_.size()); } - - std::vector const& params() const { + const cms::DDSolidShape& shape_dd4hep() const { return shape_; } + // solid shape parameters + const std::vector& params() const { if (shape_ != cms::DDSolidShape::ddbox && shape_ != cms::DDSolidShape::ddtrap && shape_ != cms::DDSolidShape::ddtubs) { edm::LogError("GeometricDet::params()") - << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; + << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; } return params_; } - ~GeometricDet(); - - /** - * components() returns explicit components; please note that in case of a leaf - * GeometricDet it returns nothing (an empty vector) - */ - ConstGeometricDetContainer& components() { return container_; } - ConstGeometricDetContainer const& components() const { return container_; } - - /** - * deepComponents() returns all the components below; please note that - * if the current GeometricDet is a leaf, it returns it! - */ - - ConstGeometricDetContainer deepComponents() const; - void deepComponents(ConstGeometricDetContainer& cont) const; - - /** - *geometricalID() returns the ID associated to the GeometricDet. - */ - DetId geographicalID() const { return geographicalID_; } - DetId geographicalId() const { return geographicalID_; } - - /** - *positionBounds() returns the position in cm. - */ - Position positionBounds() const; - - /** - *rotationBounds() returns the rotation matrix. - */ - Rotation rotationBounds() const; - - /** - *bounds() returns the Bounds. - */ - std::unique_ptr bounds() const; - + // RADIATION LENGTH AND ENERGY LOSS double radLength() const { return radLength_; } double xi() const { return xi_; } - /** - * The following four pix* methods only return meaningful results for pixels. - */ + + // SENSOR INFO + // Only return meaningful results for pixels. double pixROCRows() const { return pixROCRows_; } double pixROCCols() const { return pixROCCols_; } double pixROCx() const { return pixROCx_; } double pixROCy() const { return pixROCy_; } - - /** - * The following two are only meaningful for the silicon tracker. - */ + // Only return meaningful results for Outer Trackers. bool stereo() const { return stereo_; } bool isLowerSensor() const { return isLowerSensor_; } bool isUpperSensor() const { return isUpperSensor_; } double siliconAPVNum() const { return siliconAPVNum_; } + + // CHILDREN INFO + GeometricDet* component(size_t index) { return const_cast(container_[index]); } + bool isLeaf() const { return container_.empty(); } + // direct children only + // if the current GeometricDet is a leaf, it returns nothing. + ConstGeometricDetContainer& components() { return container_; } + const ConstGeometricDetContainer& components() const { return container_; } + // all descendants + // if the current GeometricDet is a leaf, it returns itself! + ConstGeometricDetContainer deepComponents() const; + void deepComponents(ConstGeometricDetContainer& cont) const; + + // PUBLIC SETTERS (they should obviously be as few as possible!!) + void addComponents(GeometricDetContainer const& cont); + void addComponents(ConstGeometricDetContainer const& cont); + void addComponent(GeometricDet*); + void clearComponents() { container_.clear(); } // only empties the container, THE CHILDREN ARE NOT DELETED! + void deleteComponents(); // EXPLICITLY DELETES THE CHILDREN + + // CUSTOM DESTRUCTOR + ~GeometricDet(); private: std::vector computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, const dd4hep::Solid& mySolid) const; + + std::string ddname_; + GeometricEnumType type_; - ConstGeometricDetContainer container_; + nav_type ddd_; + DetId geographicalID_; + Translation trans_; - double phi_; double rho_; + double phi_; RotationMatrix rot_; + cms::DDSolidShape shape_; - nav_type ddd_; - std::string ddname_; - GeometricEnumType type_; std::vector params_; - - DetId geographicalID_; + double radLength_; double xi_; double pixROCRows_; @@ -226,6 +190,8 @@ class GeometricDet { double siliconAPVNum_; bool isFromDD4hep_; + + ConstGeometricDetContainer container_; }; #undef PoolAlloc diff --git a/Geometry/TrackerNumberingBuilder/plugins/TrackerGeometricDetExtraESModule.cc b/Geometry/TrackerNumberingBuilder/plugins/TrackerGeometricDetExtraESModule.cc index 097589b0f85cd..fd66ec38807bc 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/TrackerGeometricDetExtraESModule.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/TrackerGeometricDetExtraESModule.cc @@ -183,37 +183,37 @@ std::unique_ptr > TrackerGeometricDetExtraESModul PGeometricDetExtra const& pgde = iRecord.getRecord().get(pgToken_); std::map helperMap; const GeometricDet* tracker = &gd; - helperMap[gd.geographicalID()] = tracker; + helperMap[gd.geographicalId()] = tracker; std::vector tc = tracker->components(); std::vector::const_iterator git = tc.begin(); std::vector::const_iterator egit = tc.end(); for (; git != egit; ++git) { // one level below "tracker" - helperMap[(*git)->geographicalID()] = (*git); + helperMap[(*git)->geographicalId()] = (*git); std::vector inone = (*git)->components(); std::vector::const_iterator git2 = inone.begin(); std::vector::const_iterator egit2 = inone.end(); for (; git2 != egit2; ++git2) { // level 2 - helperMap[(*git2)->geographicalID()] = (*git2); + helperMap[(*git2)->geographicalId()] = (*git2); std::vector intwo = (*git2)->components(); std::vector::const_iterator git3 = intwo.begin(); std::vector::const_iterator egit3 = intwo.end(); for (; git3 != egit3; ++git3) { // level 3 - helperMap[(*git3)->geographicalID()] = (*git3); + helperMap[(*git3)->geographicalId()] = (*git3); std::vector inthree = (*git3)->components(); std::vector::const_iterator git4 = inthree.begin(); std::vector::const_iterator egit4 = inthree.end(); for (; git4 != egit4; ++git4) { //level 4 - helperMap[(*git4)->geographicalID()] = (*git4); + helperMap[(*git4)->geographicalId()] = (*git4); std::vector infour = (*git4)->components(); std::vector::const_iterator git5 = infour.begin(); std::vector::const_iterator egit5 = infour.end(); for (; git5 != egit5; ++git5) { // level 5 - helperMap[(*git5)->geographicalID()] = (*git5); + helperMap[(*git5)->geographicalId()] = (*git5); std::vector infive = (*git5)->components(); std::vector::const_iterator git6 = infive.begin(); std::vector::const_iterator egit6 = infive.end(); for (; git6 != egit6; ++git6) { //level 6 - helperMap[(*git6)->geographicalID()] = (*git6); + helperMap[(*git6)->geographicalId()] = (*git6); if (!(*git6)->components().empty()) { edm::LogError("GeometricDetExtra") << "Hierarchy has exceeded hard-coded level of 6 for Tracker "; } diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index a59b094947aba..4dfaf8ca810e4 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -67,78 +67,80 @@ GeometricDet::~GeometricDet() { deleteComponents(); } /* Constructor from old DD Filtered view. - */ +*/ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) - : trans_(fv->translation()), - phi_(trans_.Phi()), - rho_(trans_.Rho()), - rot_(fv->rotation()), - shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, fv->shape())), - ddname_(fv->name()), - type_(type), - params_(fv->parameters()), - radLength_(getDouble("TrackerRadLength", *fv)), - xi_(getDouble("TrackerXi", *fv)), - pixROCRows_(getDouble("PixelROCRows", *fv)), - pixROCCols_(getDouble("PixelROCCols", *fv)), - pixROCx_(getDouble("PixelROC_X", *fv)), - pixROCy_(getDouble("PixelROC_Y", *fv)), - stereo_(getString("TrackerStereoDetectors", *fv) == strue), - isLowerSensor_(getString("TrackerLowerDetectors", *fv) == strue), - isUpperSensor_(getString("TrackerUpperDetectors", *fv) == strue), - siliconAPVNum_(getDouble("SiliconAPVNumber", *fv)), - isFromDD4hep_(false) { - // workaround instead of this at initialization ddd_(fv->navPos().begin(),fv->navPos().end()), + : ddname_(fv->name()), + type_(type), + ddd_(), + trans_(fv->translation()), + rho_(trans_.Rho()), + phi_(trans_.Phi()), + rot_(fv->rotation()), + shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, fv->shape())), + params_(fv->parameters()), + radLength_(getDouble("TrackerRadLength", *fv)), + xi_(getDouble("TrackerXi", *fv)), + pixROCRows_(getDouble("PixelROCRows", *fv)), + pixROCCols_(getDouble("PixelROCCols", *fv)), + pixROCx_(getDouble("PixelROC_X", *fv)), + pixROCy_(getDouble("PixelROC_Y", *fv)), + stereo_(getString("TrackerStereoDetectors", *fv) == strue), + isLowerSensor_(getString("TrackerLowerDetectors", *fv) == strue), + isUpperSensor_(getString("TrackerUpperDetectors", *fv) == strue), + siliconAPVNum_(getDouble("SiliconAPVNumber", *fv)), + isFromDD4hep_(false) { + // workaround instead of this at initialization const DDFilteredView::nav_type& nt = fv->navPos(); ddd_ = nav_type(nt.begin(), nt.end()); } /* Constructor from DD4HEP Filtered view. - */ +*/ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) - : trans_(geant_units::operators::convertCmToMm(fv->translation())), - phi_(trans_.Phi()), - rho_(trans_.Rho()), - rot_(fv->rotation()), - shape_(fv->shape()), - ddd_(fv->navPos()), // To be studied - ddname_(dd4hep::dd::noNamespace(fv->name())), - type_(type), - params_(computeLegacyShapeParameters(shape_, fv->solid())), - radLength_(fv->get("TrackerRadLength")), // To be studied - xi_(fv->get("TrackerXi")), // To be studied - pixROCRows_(fv->get("PixelROCRows")), - pixROCCols_(fv->get("PixelROCCols")), - pixROCx_(fv->get("PixelROC_X")), - pixROCy_(fv->get("PixelROC_Y")), - stereo_(fv->get("TrackerStereoDetectors") == strue), - isLowerSensor_(fv->get("TrackerLowerDetectors") == strue), - isUpperSensor_(fv->get("TrackerUpperDetectors") == strue), - siliconAPVNum_(fv->get("SiliconAPVNumber")), - isFromDD4hep_(true) {} + : ddname_(dd4hep::dd::noNamespace(fv->name())), + type_(type), + ddd_(fv->navPos()), // To be studied + trans_(geant_units::operators::convertCmToMm(fv->translation())), + rho_(trans_.Rho()), + phi_(trans_.Phi()), + rot_(fv->rotation()), + shape_(fv->shape()), + params_(computeLegacyShapeParameters(shape_, fv->solid())), + radLength_(fv->get("TrackerRadLength")), // To be studied + xi_(fv->get("TrackerXi")), // To be studied + pixROCRows_(fv->get("PixelROCRows")), + pixROCCols_(fv->get("PixelROCCols")), + pixROCx_(fv->get("PixelROC_X")), + pixROCy_(fv->get("PixelROC_Y")), + stereo_(fv->get("TrackerStereoDetectors") == strue), + isLowerSensor_(fv->get("TrackerLowerDetectors") == strue), + isUpperSensor_(fv->get("TrackerUpperDetectors") == strue), + siliconAPVNum_(fv->get("SiliconAPVNumber")), + isFromDD4hep_(true) {} -// PGeometricDet is persistent version... make it... then come back here and make the -// constructor. +/* + Constructor from persistent version (DB). +*/ GeometricDet::GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType type) - : trans_(onePGD._x, onePGD._y, onePGD._z), - phi_(onePGD._phi), //trans_.Phi()), - rho_(onePGD._rho), //trans_.Rho()), - rot_(onePGD._a11, - onePGD._a12, - onePGD._a13, - onePGD._a21, - onePGD._a22, - onePGD._a23, - onePGD._a31, - onePGD._a32, - onePGD._a33), - shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast(onePGD._shape))), - ddd_(), - ddname_(onePGD._name), - type_(type), - params_(), - geographicalID_(onePGD._geographicalID), + : ddname_(onePGD._name), + type_(type), + ddd_(), + geographicalID_(onePGD._geographicalID), + trans_(onePGD._x, onePGD._y, onePGD._z), + rho_(onePGD._rho), + phi_(onePGD._phi), + rot_(onePGD._a11, + onePGD._a12, + onePGD._a13, + onePGD._a21, + onePGD._a22, + onePGD._a23, + onePGD._a31, + onePGD._a32, + onePGD._a33), + shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast(onePGD._shape))), + params_(), radLength_(onePGD._radLength), xi_(onePGD._xi), pixROCRows_(onePGD._pixROCRows), @@ -146,8 +148,12 @@ GeometricDet::GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType pixROCx_(onePGD._pixROCx), pixROCy_(onePGD._pixROCy), stereo_(onePGD._stereo), - siliconAPVNum_(onePGD._siliconAPVNum) { - if (onePGD._shape == 1 || onePGD._shape == 3) { //The parms vector is neede only in the case of box or trap shape + siliconAPVNum_(onePGD._siliconAPVNum) + // NB: what about new data members isLowerSensor_, isUpperSensor_, isFromDD4hep_? + // They are presently not added to PGeometricDet (no change in info stored into DB). +{ + // Solid shape parameters: only for box (1) and trapezoid (3) + if (onePGD._shape == 1 || onePGD._shape == 3) { params_.reserve(11); params_.emplace_back(onePGD._params0); params_.emplace_back(onePGD._params1); @@ -190,10 +196,33 @@ GeometricDet::GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType } } +std::unique_ptr GeometricDet::bounds() const { + TrackerShapeToBounds shapeToBounds; + return std::unique_ptr(shapeToBounds.buildBounds(shape_, params_)); +} + +GeometricDet::Position GeometricDet::positionBounds() const { + Position pos_(float(trans_.x() / cm), float(trans_.y() / cm), float(trans_.z() / cm)); + return pos_; +} + +GeometricDet::Rotation GeometricDet::rotationBounds() const { + Translation x, y, z; + rot_.GetComponents(x, y, z); + Rotation rotation_(float(x.X()), + float(x.Y()), + float(x.Z()), + float(y.X()), + float(y.Y()), + float(y.Z()), + float(z.X()), + float(z.Y()), + float(z.Z())); + return rotation_; +} + GeometricDet::ConstGeometricDetContainer GeometricDet::deepComponents() const { - // - // iterate on all the components ;) - // + // iterate on all the DESCENDANTS!! ConstGeometricDetContainer temp_; deepComponents(temp_); return temp_; @@ -222,38 +251,17 @@ namespace { struct Deleter { void operator()(GeometricDet const* det) const { delete const_cast(det); } }; -} // namespace +} void GeometricDet::deleteComponents() { std::for_each(container_.begin(), container_.end(), Deleter()); container_.clear(); } -GeometricDet::Position GeometricDet::positionBounds() const { - Position pos_(float(trans_.x() / cm), float(trans_.y() / cm), float(trans_.z() / cm)); - return pos_; -} - -GeometricDet::Rotation GeometricDet::rotationBounds() const { - Translation x, y, z; - rot_.GetComponents(x, y, z); - Rotation rotation_(float(x.X()), - float(x.Y()), - float(x.Z()), - float(y.X()), - float(y.Y()), - float(y.Z()), - float(z.X()), - float(z.Y()), - float(z.Z())); - return rotation_; -} -std::unique_ptr GeometricDet::bounds() const { - const std::vector& par = params_; - TrackerShapeToBounds shapeToBounds; - return std::unique_ptr(shapeToBounds.buildBounds(shape_, par)); -} +/* + * PRIVATE + */ /* * DD4hep. diff --git a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc index b2e458ae0e2c4..485c83f69519c 100644 --- a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc +++ b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc @@ -220,7 +220,7 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i std::map mapDetIdToGeometricDet; for (auto& module : modules) { - mapDetIdToGeometricDet[module->geographicalID().rawId()] = module; + mapDetIdToGeometricDet[module->geographicalId().rawId()] = module; } // Debug variables @@ -313,7 +313,7 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i Output << std::endl << std::endl; Output << " ******** myDet Id = " << myDetId << " (" << binary_myDetId << ")" << std::endl; // - unsigned int rawid = mapDetIdToGeometricDet[myDetId]->geographicalID().rawId(); + unsigned int rawid = mapDetIdToGeometricDet[myDetId]->geographicalId().rawId(); std::bitset<32> binary_detid(rawid); GeometricDet::nav_type detNavType = mapDetIdToGeometricDet[myDetId]->navType(); // @@ -509,7 +509,7 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i Output << std::endl << std::endl; Output << " ******** myDet Id = " << myDetId << " (" << binary_myDetId << ")" << std::endl; // - unsigned int rawid = mapDetIdToGeometricDet[myDetId]->geographicalID().rawId(); + unsigned int rawid = mapDetIdToGeometricDet[myDetId]->geographicalId().rawId(); std::bitset<32> binary_detid(rawid); GeometricDet::nav_type detNavType = mapDetIdToGeometricDet[myDetId]->navType(); // @@ -696,7 +696,7 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i Output << std::endl << std::endl; Output << " ******** myDet Id = " << myDetId << " (" << binary_myDetId << ")" << std::endl; // - unsigned int rawid = mapDetIdToGeometricDet[myDetId]->geographicalID().rawId(); + unsigned int rawid = mapDetIdToGeometricDet[myDetId]->geographicalId().rawId(); std::bitset<32> binary_detid(rawid); GeometricDet::nav_type detNavType = mapDetIdToGeometricDet[myDetId]->navType(); // @@ -916,7 +916,7 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i Output << std::endl << std::endl; Output << " ******** myDet Id = " << myDetId << " (" << binary_myDetId << ")" << std::endl; // - unsigned int rawid = mapDetIdToGeometricDet[myDetId]->geographicalID().rawId(); + unsigned int rawid = mapDetIdToGeometricDet[myDetId]->geographicalId().rawId(); std::bitset<32> binary_detid(rawid); GeometricDet::nav_type detNavType = mapDetIdToGeometricDet[myDetId]->navType(); // From da529a18fe5fbf364eb3b3a48774ef859e624496 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Mon, 28 Sep 2020 14:48:32 +0200 Subject: [PATCH 080/778] Switch in description allowing phase-2 configs only in phase-2 era --- .../TauDiscriminationAgainstElectronMVA6.cc | 31 ++++++++++--------- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 11 ++++--- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc index bb3c68c91fafb..16f09a8ad3e7d 100644 --- a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc +++ b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc @@ -359,20 +359,23 @@ void TauDiscriminationAgainstElectronMVA6("minMVAWOgWgsfEC", 0.0); desc.add("minMVAWgWgsfEC", 0.0); - desc.add("isPhase2", false); - // The following used only for Phase2 - desc.add("mvaName_wGwGSF_VFEC", "gbr_wGwGSF_VFEC")->setComment("Relevant only for Phase-2"); - desc.add("mvaName_woGwGSF_VFEC", "gbr_woGwGSF_VFEC")->setComment("Relevant only for Phase-2"); - desc.add("mvaName_NoEleMatch_wGwoGSF_VFEC", "gbr_NoEleMatch_wGwoGSF_VFEC") - ->setComment("Relevant only for Phase-2"); - desc.add("mvaName_NoEleMatch_woGwoGSF_VFEC", "gbr_NoEleMatch_woGwoGSF_VFEC") - ->setComment("Relevant only for Phase-2"); - desc.add("minMVAWOgWgsfVFEC", 0.0)->setComment("Relevant only for Phase-2"); - desc.add("minMVAWgWgsfVFEC", 0.0)->setComment("Relevant only for Phase-2"); - desc.add("minMVANoEleMatchWgWOgsfVFEC", 0.0)->setComment("Relevant only for Phase-2"); - desc.add("minMVANoEleMatchWOgWOgsfVFEC", 0.0)->setComment("Relevant only for Phase-2"); - - desc.add("srcElectrons", edm::InputTag("fixme")); + desc.ifValue( + edm::ParameterDescription("isPhase2", false, true), + // MB: "srcElectrons" present for both phase-2 and non-phase2 to have a non-empy case for default, i.e. isPhase2=false + false >> (edm::ParameterDescription("srcElectrons", edm::InputTag("fixme"), true)) or + // The following used only for Phase2 + true >> (edm::ParameterDescription("srcElectrons", edm::InputTag("fixme"), true) and + edm::ParameterDescription("mvaName_wGwGSF_VFEC", "gbr_wGwGSF_VFEC", true) and + edm::ParameterDescription("mvaName_woGwGSF_VFEC", "gbr_woGwGSF_VFEC", true) and + edm::ParameterDescription( + "mvaName_NoEleMatch_wGwoGSF_VFEC", "gbr_NoEleMatch_wGwoGSF_VFEC", true) and + edm::ParameterDescription( + "mvaName_NoEleMatch_woGwoGSF_VFEC", "gbr_NoEleMatch_woGwoGSF_VFEC", true) and + edm::ParameterDescription("minMVAWOgWgsfVFEC", 0.0, true) and + edm::ParameterDescription("minMVAWgWgsfVFEC", 0.0, true) and + edm::ParameterDescription("minMVANoEleMatchWgWOgsfVFEC", 0.0, true) and + edm::ParameterDescription("minMVANoEleMatchWOgWOgsfVFEC", 0.0, true))); + // Relevant only for gsfElectrons for Phase2 if (std::is_same::value) { desc.add>("hgcalElectronIDs", std::vector()) diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index 9c01ec9b8a02e..9ff1cd042ac68 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -68,11 +68,12 @@ AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::Paramet mvaName_NoEleMatch_wGwoGSF_EC_ = cfg.getParameter("mvaName_NoEleMatch_wGwoGSF_EC"); mvaName_woGwGSF_EC_ = cfg.getParameter("mvaName_woGwGSF_EC"); mvaName_wGwGSF_EC_ = cfg.getParameter("mvaName_wGwGSF_EC"); - mvaName_NoEleMatch_woGwoGSF_VFEC_ = cfg.getParameter("mvaName_NoEleMatch_woGwoGSF_VFEC"); - mvaName_NoEleMatch_wGwoGSF_VFEC_ = cfg.getParameter("mvaName_NoEleMatch_wGwoGSF_VFEC"); - mvaName_woGwGSF_VFEC_ = cfg.getParameter("mvaName_woGwGSF_VFEC"); - mvaName_wGwGSF_VFEC_ = cfg.getParameter("mvaName_wGwGSF_VFEC"); - + if (isPhase2_) { + mvaName_NoEleMatch_woGwoGSF_VFEC_ = cfg.getParameter("mvaName_NoEleMatch_woGwoGSF_VFEC"); + mvaName_NoEleMatch_wGwoGSF_VFEC_ = cfg.getParameter("mvaName_NoEleMatch_wGwoGSF_VFEC"); + mvaName_woGwGSF_VFEC_ = cfg.getParameter("mvaName_woGwGSF_VFEC"); + mvaName_wGwGSF_VFEC_ = cfg.getParameter("mvaName_wGwGSF_VFEC"); + } usePhiAtEcalEntranceExtrapolation_ = cfg.getParameter("usePhiAtEcalEntranceExtrapolation"); if (!isPhase2_) { From 8e6f72aba5c4b318bc976553d506cc57d329b867 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Sat, 26 Sep 2020 16:02:41 -0500 Subject: [PATCH 081/778] fix usage of cvmfs image and put commands in unified script --- HeterogeneousCore/SonicTriton/test/README.md | 45 +++----- HeterogeneousCore/SonicTriton/test/triton | 105 +++++++++++++++++++ 2 files changed, 117 insertions(+), 33 deletions(-) create mode 100755 HeterogeneousCore/SonicTriton/test/triton diff --git a/HeterogeneousCore/SonicTriton/test/README.md b/HeterogeneousCore/SonicTriton/test/README.md index 50a3a71755b01..f7cac66112a9b 100644 --- a/HeterogeneousCore/SonicTriton/test/README.md +++ b/HeterogeneousCore/SonicTriton/test/README.md @@ -3,49 +3,28 @@ Test producers `TritonImageProducer` and `TritonGraphProducer` are available. They generate arbitrary inputs for inference (with ResNet50 or Graph Attention Network, respectively) and print the resulting output. -To run the tests, a local Triton server can be started using Singularity or Docker. +To run the tests, a local Triton server can be started using Singularity (default, should not require superuser permission) +or Docker (may require superuser permission). +The server can utilize the local CPU (support for AVX instructions required) or a local Nvidia GPU, if one is available. The default local server address is `0.0.0.0`. -(In either case, to get more debugging information from the server, the flags `--log-verbose=1 --log-error=1 --log-info=1` -can be added to the end of the command that includes `tritonserver`.) First, the relevant data should be downloaded from Nvidia: ``` ./fetch_model.sh ``` -## Singularity instructions - -Using Singularity should not require superuser permissions. - -Execute these Singularity commands to start the instance in the background and then activate the server: -```bash -singularity instance start \ - -B /dev/shm:/run/shm -B ${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/models:/models \ - /cvmfs/unpacked.cern.ch/registry.hub.docker.com/fastml/triton-torchgeo:20.06-v1-py3-geometric/ triton_server_instance -singularity run instance://triton_server_instance \ - tritonserver --model-repository=/models +The server can be managed with the `triton` script (using Singularity with CPU by default): ``` - -(Some operating systems may have `/run/shm` rather than `/dev/shm`.) - -If the machine has Nvidia GPUs, the flag `--nv` can be added to the command. -Otherwise, the server will perform inference using the CPU (slower). - -## Docker instructions - -Using Docker may require superuser permissions. - -Execute this Docker command to launch the local server: -```bash -docker run -d --name tritonserver \ - --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 \ - -p8000:8000 -p8001:8001 -p8002:8002 \ - -v${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/models:/models \ - fastml/triton-torchgeo:20.06-v1-py3-geometric tritonserver --model-repository=/models +./triton start +[run test commands] +./triton stop ``` -If the machine has Nvidia GPUs, the flag `--gpus all` can be added to the command. -Otherwise, the server will perform inference using the CPU (slower). +The script has the following options: +* `-d`: use Docker instead of Singularity +* `-g`: use GPU instead of CPU +* `-v`: (verbose) start: activate server debugging info; stop: keep server logs +* `-h`: print help message and exit ## Test commands diff --git a/HeterogeneousCore/SonicTriton/test/triton b/HeterogeneousCore/SonicTriton/test/triton new file mode 100755 index 0000000000000..58ef192c17fa2 --- /dev/null +++ b/HeterogeneousCore/SonicTriton/test/triton @@ -0,0 +1,105 @@ +#!/bin/bash + +usage() { + ECHO="echo -e" + $ECHO "triton [options] [start|stop]" + $ECHO + $ECHO "Options:" + $ECHO "-d \t use Docker instead of Singularity" + $ECHO "-g \t use GPU instead of CPU" + $ECHO "-v \t (verbose) start: activate server debugging info; stop: keep server logs" + $ECHO "-h \t print this message and exit" + $ECHO + $ECHO "Operations:" + $ECHO "start \t start server" + $ECHO "stop \t stop server" + exit $1 +} + +# defaults +USEDOCKER="" +GPU="" +VERBOSE="" + +# check shm locations +SHM=/dev/shm +if [ -e /run/shm ]; then + SHM=/run/shm +fi + +while getopts "dgvh" opt; do + case "$opt" in + d) USEDOCKER=true + ;; + g) GPU=true + ;; + v) VERBOSE="--log-verbose=1 --log-error=1 --log-info=1" + ;; + h) usage 0 + ;; + esac +done + +shift $(($OPTIND - 1)) +OP=$1 + +if [ "$OP" != start ] && [ "$OP" != stop ]; then + usage 1 +fi + +DOCKER="sudo docker" +IMAGE=fastml/triton-torchgeo:20.06-v1-py3-geometric +MODELS=${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/models +SERVER=triton_server_instance +LOG=log_triton_server.log +LIB=lib + +if [ -n "$USEDOCKER" ]; then + EXTRA="" + if [ -n "$GPU" ]; then + EXTRA="--gpus all" + fi + + if [ "$OP" == start ]; then + $DOCKER run -d --name ${SERVER} \ + --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 \ + -p8000:8000 -p8001:8001 -p8002:8002 $EXTRA \ + -v${MODELS}:/models \ + ${IMAGE} tritonserver --model-repository=/models $VERBOSE + else + # keep log + if [ -n "$VERBOSE" ]; then docker logs ${SERVER} >& ${LOG}; fi + + $DOCKER stop ${SERVER} + $DOCKER rm ${SERVER} + fi +else + EXTRA="" + if [ -n "$GPU" ]; then + EXTRA="--nv" + fi + + if [ "$OP" == start ]; then + # triton server image may need to modify contents of opt/tritonserver/lib/ + # but cvmfs is read-only + # -> make a writable local directory with the same contents + mkdir ${LIB} + ln -s /cvmfs/unpacked.cern.ch/registry.hub.docker.com/${IMAGE}/opt/tritonserver/lib/* ${LIB}/ + + # start instance + # need to bind /cvmfs for above symlinks to work inside container + singularity instance start \ + -B ${SHM}:/run/shm -B ${MODELS}:/models -B ${LIB}:/opt/tritonserver/lib -B /cvmfs $EXTRA \ + /cvmfs/unpacked.cern.ch/registry.hub.docker.com/${IMAGE} ${SERVER} + + # run the actual server + singularity run instance://${SERVER} \ + tritonserver --model-repository=/models $VERBOSE >& ${LOG} & + else + singularity instance stop ${SERVER} + + # cleanup + rm -rf ${LIB} + if [ -z "$VERBOSE" ]; then rm ${LOG}; fi + fi +fi From 721302154188e4d29d4034a5d6996432519c88a0 Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama Date: Mon, 28 Sep 2020 10:40:14 -0500 Subject: [PATCH 082/778] Clean unused scripts and macros. --- Validation/RecoParticleFlow/test/DeltaEt.C | 45 ---- .../RecoParticleFlow/test/QCDForPFFast_cfg.py | 69 ------ .../RecoParticleFlow/test/ZTTFastSim_cfg.py | 67 ------ .../RecoParticleFlow/test/castorMerge.py | 133 ----------- .../test/castorSyncOutputs.py | 218 ------------------ .../test/copy_aod_QCDForPF_1.sh | 69 ------ .../test/copy_aod_QCDForPF_2.sh | 68 ------ .../test/copy_aod_QCDForPF_3.sh | 69 ------ .../test/copy_aod_QCDForPF_4.sh | 68 ------ .../test/copy_aod_QCDForPF_5.sh | 68 ------ Validation/RecoParticleFlow/test/copy_cfg.py | 34 --- .../test/copy_display_QCDForPF_1.sh | 68 ------ .../test/copy_display_QCDForPF_2.sh | 69 ------ .../test/copy_display_QCDForPF_3.sh | 68 ------ .../test/copy_display_QCDForPF_4.sh | 68 ------ .../test/copy_display_QCDForPF_5.sh | 68 ------ .../test/copy_reco_QCDForPF_1.sh | 70 ------ .../test/copy_reco_QCDForPF_2.sh | 69 ------ .../test/copy_reco_QCDForPF_3.sh | 69 ------ Validation/RecoParticleFlow/test/drop.sh | 11 - .../test/drop_aod_QCDForPF_1.sh | 31 --- .../test/drop_aod_QCDForPF_2.sh | 31 --- .../test/drop_aod_QCDForPF_3.sh | 31 --- .../test/drop_display_QCDForPF_1.sh | 31 --- .../test/drop_display_QCDForPF_2.sh | 31 --- .../test/drop_display_QCDForPF_3.sh | 31 --- .../test/drop_reco_QCDForPF_1.sh | 31 --- .../test/drop_reco_QCDForPF_2.sh | 31 --- .../test/drop_reco_QCDForPF_3.sh | 31 --- .../RecoParticleFlow/test/filelist_QCD.txt | 50 ---- Validation/RecoParticleFlow/test/getHists.py | 10 - .../test/launch_QCDFastSim.sh | 87 ------- .../test/launch_QCDForPF_FastSim.sh | 46 ---- .../test/launch_QCDForPF_FullSim.sh | 47 ---- .../test/launch_QCDFullSim.sh | 93 -------- .../test/launch_ZTTFastSim.sh | 47 ---- .../test/launch_ZTTFullSim.sh | 47 ---- .../RecoParticleFlow/test/launch_copy.sh | 81 ------- .../test/launch_ttbarFastSim.sh | 46 ---- .../test/launch_ttbarFullSim.sh | 46 ---- .../RecoParticleFlow/test/setup_cmssw.sh | 11 - .../test/singleTauPt50FastSim.py | 123 ---------- .../RecoParticleFlow/test/testTH2Analyzer.C | 15 -- .../RecoParticleFlow/test/ttbarFastSim_cfg.py | 69 ------ .../test/ttbar_copy_Fast_cfg.py | 34 --- .../test/ttbar_copy_Full_cfg.py | 74 ------ 46 files changed, 2673 deletions(-) delete mode 100644 Validation/RecoParticleFlow/test/DeltaEt.C delete mode 100644 Validation/RecoParticleFlow/test/QCDForPFFast_cfg.py delete mode 100644 Validation/RecoParticleFlow/test/ZTTFastSim_cfg.py delete mode 100755 Validation/RecoParticleFlow/test/castorMerge.py delete mode 100755 Validation/RecoParticleFlow/test/castorSyncOutputs.py delete mode 100755 Validation/RecoParticleFlow/test/copy_aod_QCDForPF_1.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_aod_QCDForPF_2.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_aod_QCDForPF_3.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_aod_QCDForPF_4.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_aod_QCDForPF_5.sh delete mode 100644 Validation/RecoParticleFlow/test/copy_cfg.py delete mode 100755 Validation/RecoParticleFlow/test/copy_display_QCDForPF_1.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_display_QCDForPF_2.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_display_QCDForPF_3.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_display_QCDForPF_4.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_display_QCDForPF_5.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_reco_QCDForPF_1.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_reco_QCDForPF_2.sh delete mode 100755 Validation/RecoParticleFlow/test/copy_reco_QCDForPF_3.sh delete mode 100644 Validation/RecoParticleFlow/test/drop.sh delete mode 100755 Validation/RecoParticleFlow/test/drop_aod_QCDForPF_1.sh delete mode 100755 Validation/RecoParticleFlow/test/drop_aod_QCDForPF_2.sh delete mode 100644 Validation/RecoParticleFlow/test/drop_aod_QCDForPF_3.sh delete mode 100755 Validation/RecoParticleFlow/test/drop_display_QCDForPF_1.sh delete mode 100755 Validation/RecoParticleFlow/test/drop_display_QCDForPF_2.sh delete mode 100644 Validation/RecoParticleFlow/test/drop_display_QCDForPF_3.sh delete mode 100755 Validation/RecoParticleFlow/test/drop_reco_QCDForPF_1.sh delete mode 100755 Validation/RecoParticleFlow/test/drop_reco_QCDForPF_2.sh delete mode 100755 Validation/RecoParticleFlow/test/drop_reco_QCDForPF_3.sh delete mode 100644 Validation/RecoParticleFlow/test/filelist_QCD.txt delete mode 100644 Validation/RecoParticleFlow/test/getHists.py delete mode 100755 Validation/RecoParticleFlow/test/launch_QCDFastSim.sh delete mode 100755 Validation/RecoParticleFlow/test/launch_QCDForPF_FastSim.sh delete mode 100755 Validation/RecoParticleFlow/test/launch_QCDForPF_FullSim.sh delete mode 100755 Validation/RecoParticleFlow/test/launch_QCDFullSim.sh delete mode 100755 Validation/RecoParticleFlow/test/launch_ZTTFastSim.sh delete mode 100755 Validation/RecoParticleFlow/test/launch_ZTTFullSim.sh delete mode 100755 Validation/RecoParticleFlow/test/launch_copy.sh delete mode 100755 Validation/RecoParticleFlow/test/launch_ttbarFastSim.sh delete mode 100755 Validation/RecoParticleFlow/test/launch_ttbarFullSim.sh delete mode 100644 Validation/RecoParticleFlow/test/setup_cmssw.sh delete mode 100644 Validation/RecoParticleFlow/test/singleTauPt50FastSim.py delete mode 100644 Validation/RecoParticleFlow/test/testTH2Analyzer.C delete mode 100644 Validation/RecoParticleFlow/test/ttbarFastSim_cfg.py delete mode 100644 Validation/RecoParticleFlow/test/ttbar_copy_Fast_cfg.py delete mode 100644 Validation/RecoParticleFlow/test/ttbar_copy_Full_cfg.py diff --git a/Validation/RecoParticleFlow/test/DeltaEt.C b/Validation/RecoParticleFlow/test/DeltaEt.C deleted file mode 100644 index 3f1a78a849fdb..0000000000000 --- a/Validation/RecoParticleFlow/test/DeltaEt.C +++ /dev/null @@ -1,45 +0,0 @@ -{ - //#include -//author J.Weng -//This macro can be used to reproduce the tau benchmark plot -//for tau jet reconstruction studies from the validation file -//created with PFBenchmarkAnalyzer - -gROOT->Reset(); -TFile *fCalo = new TFile("TauBenchmark.root","READ"); -TFile *fPF = new TFile("TauBenchmark.root","READ"); -//setTDRStyle(); - -TH1F* h_deltaETvisible_MCPF = fPF->Get("DQMData/PFTask/Benchmarks/ParticleFlow/Gen/DeltaEt"); -TH1F* h_deltaETvisible_MCEHT = fCalo->Get("DQMData/PFTask/Benchmarks/Calo/Gen/DeltaEt"); -h_deltaETvisible_MCPF->SetStats(00000000); -h_deltaETvisible_MCPF->GetYaxis()->SetTitle("#"); -h_deltaETvisible_MCPF->SetTitle("#"); -// h_deltaETvisible_MCPF->GetXaxis()->SetTitleOffset(1.3); -// h_deltaETvisible_MCPF->GetXaxis()->SetTitleOffset(0.5); -// h_deltaETvisible_MCPF->GetYaxis()->SetTitleOffset(1.3); -// h_deltaETvisible_MCPF->GetYaxis()->SetTitleOffset(0.5); -h_deltaETvisible_MCPF->SetTitle(""); -h_deltaETvisible_MCPF->SetLineColor(2); -h_deltaETvisible_MCPF->Draw(); -h_deltaETvisible_MCEHT->Draw("same"); - -Double_t x_1=0.152; Double_t y_1 = 0.51; -Double_t x_2=0.483; Double_t y_2 = 0.646; - -TLegend *leg = new TLegend(x_1,y_1,x_2,y_2,NULL,"brNDC"); -leg->SetTextSize(0.031); -leg->SetFillStyle(0); -leg->SetFillColor(0); -leg->SetTextFont(52); -leg->SetTextAlign(32); - -leg->AddEntry(h_deltaETvisible_MCPF,"Particle Flow Jets","l"); -leg->AddEntry(h_deltaETvisible_MCEHT,"caloTower Jets","l"); -leg->Draw(); - -c1->Print("DeltaEt.eps"); -c1->Print("DeltaEt.gif"); -c1->Print("DeltaEt.root"); -gApplication->Terminate(); -} diff --git a/Validation/RecoParticleFlow/test/QCDForPFFast_cfg.py b/Validation/RecoParticleFlow/test/QCDForPFFast_cfg.py deleted file mode 100644 index 35960b8327a26..0000000000000 --- a/Validation/RecoParticleFlow/test/QCDForPFFast_cfg.py +++ /dev/null @@ -1,69 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("PROD") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(2500) -) - -#generation -process.source = cms.Source("EmptySource") -process.load("Configuration.Generator.QCDForPF_cfi") -process.generator.comEnergy = 14000. - -#fastsim -process.load("FastSimulation.Configuration.RandomServiceInitialization_cff") -process.load('FastSimulation.Configuration.Geometries_cff') - -process.RandomNumberGeneratorService.generator.initialSeed= ==SEED== -process.fastSimProducer.SimulateCalorimetry = True -for layer in process.fastSimProducer.detectorDefinition.BarrelLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -for layer in process.fastSimProducer.detectorDefinition.ForwardLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -process.famosPileUp.PileUpSimulator.averageNumber = 0.0 - -# Get frontier conditions -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -from Configuration.PyReleaseValidation.autoCond import autoCond -process.GlobalTag.globaltag = autoCond['mc'] - -# Parametrized magnetic field (new mapping, 4.0 and 3.8T) -process.load("Configuration.StandardSequences.MagneticField_38T_cff") -#process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.VolumeBasedMagneticFieldESProducer.useParametrizedTrackerField = True - -process.load("RecoParticleFlow.PFProducer.particleFlowSimParticle_cff") - - -process.p1 = cms.Path( - process.generator + - process.famosWithEverything + - process.caloJetMetGen + - process.particleFlowSimParticle -) - - -process.load("FastSimulation.Configuration.EventContent_cff") -process.aod = cms.OutputModule("PoolOutputModule", - process.AODSIMEventContent, - fileName = cms.untracked.string('aod.root') -) - -process.reco = cms.OutputModule("PoolOutputModule", - process.RECOSIMEventContent, - fileName = cms.untracked.string('reco.root') -) - -process.load("RecoParticleFlow.Configuration.Display_EventContent_cff") -process.display = cms.OutputModule("PoolOutputModule", - process.DisplayEventContent, - fileName = cms.untracked.string('display.root') -) - -#process.outpath = cms.EndPath(process.aod + process.reco + process.display) -process.outpath = cms.EndPath(process.aod+process.display) - -# diff --git a/Validation/RecoParticleFlow/test/ZTTFastSim_cfg.py b/Validation/RecoParticleFlow/test/ZTTFastSim_cfg.py deleted file mode 100644 index e62893ce5a9bf..0000000000000 --- a/Validation/RecoParticleFlow/test/ZTTFastSim_cfg.py +++ /dev/null @@ -1,67 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("PROD") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(2000) -) - -#generation -process.source = cms.Source("EmptySource") -process.load("Configuration/Generator/ZTT_Tauola_All_hadronic_cfi") - -#fastsim -process.load("FastSimulation.Configuration.RandomServiceInitialization_cff") -process.load("FastSimulation.Configuration.CommonInputs_cff") - -process.RandomNumberGeneratorService.generator.initialSeed= ==SEED== -process.fastSimProducer.SimulateCalorimetry = True -for layer in process.fastSimProducer.detectorDefinition.BarrelLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -for layer in process.fastSimProducer.detectorDefinition.ForwardLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -process.famosPileUp.PileUpSimulator.averageNumber = 0.0 - -# Get frontier conditions - not applied in the HCAL, see below -# Values for globaltag are "STARTUP_V5::All", "1PB::All", "10PB::All", "IDEAL_V5::All" -process.GlobalTag.globaltag = "MC_31X_V9::All" - -# Parametrized magnetic field (new mapping, 4.0 and 3.8T) -#process.load("Configuration.StandardSequences.MagneticField_40T_cff") -process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.VolumeBasedMagneticFieldESProducer.useParametrizedTrackerField = True - -process.load("RecoParticleFlow.PFProducer.particleFlowSimParticle_cff") - - -process.p1 = cms.Path( - process.generator + - process.famosWithEverything + - process.caloJetMetGen + - process.particleFlowSimParticle -) - - -process.load("FastSimulation.Configuration.EventContent_cff") -process.aod = cms.OutputModule("PoolOutputModule", - process.AODSIMEventContent, - fileName = cms.untracked.string('aod.root') -) - -process.reco = cms.OutputModule("PoolOutputModule", - process.RECOSIMEventContent, - fileName = cms.untracked.string('reco.root') -) - -process.load("RecoParticleFlow.Configuration.Display_EventContent_cff") -process.display = cms.OutputModule("PoolOutputModule", - process.DisplayEventContent, - fileName = cms.untracked.string('display.root') -) - -#process.outpath = cms.EndPath(process.aod + process.reco + process.display) -process.outpath = cms.EndPath(process.aod+process.display) - -# diff --git a/Validation/RecoParticleFlow/test/castorMerge.py b/Validation/RecoParticleFlow/test/castorMerge.py deleted file mode 100755 index 4bb450b8e8a01..0000000000000 --- a/Validation/RecoParticleFlow/test/castorMerge.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function -from optparse import OptionParser -import sys,os, re, pprint -import FWCore.ParameterSet.Config as cms - -chunkNumber = 0 - - -def createDir( dir ): - absName = '%s/%s' % (castorDir, dir) - out = os.system( 'rfdir %s' % absName ) - print(out) - if out!=0: - # dir does not exist - os.system( 'rfmkdir %s' % absName ) - return absName - - -def processFiles( files ): - - global chunkNumber - - print('Processing files:') - pprint.pprint( files ) - - process = cms.Process("COPY") - - process.source = cms.Source( - "PoolSource", - fileNames = cms.untracked.vstring( files ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - ) - - # build output file name - - - tmpRootFile = '/tmp/aod_QCDForPF_Full_chunk%d.root' % chunkNumber - - print(' destination: ', tmpRootFile) - process.aod = cms.OutputModule( - "PoolOutputModule", - fileName = cms.untracked.string( tmpRootFile ), - outputCommands = cms.untracked.vstring( 'keep *' ) - ) - - - process.outpath = cms.EndPath(process.aod) - - outFile = open("tmpConfig.py","w") - outFile.write("import FWCore.ParameterSet.Config as cms\n") - outFile.write(process.dumpPython()) - outFile.close() - - chunkNumber = chunkNumber+1 - - if options.negate == True: - return - - chunkDir = createDir( 'Chunks' ) - - os.system("cmsRun tmpConfig.py") - print('done. transferring file to: ', chunkDir) - os.system("rfcp %s %s" % (tmpRootFile, chunkDir) ) - print('done') - os.system("rm %s" % tmpRootFile) - print('temporary files removed.') - - -parser = OptionParser() -parser.usage = "%prog : merge a set of CMSSW root files on castor." -parser.add_option("-n", "--negate", action="store_true", - dest="negate", - help="do not produce the merged files", - default=False) - - - -(options,args) = parser.parse_args() - -if len(args)!=3: - parser.print_help() - sys.exit(1) - -castorDir = args[0] -regexp = args[1] -chunkSize = int(args[2]) - -print('Merging files in: ', castorDir) - -try: - pattern = re.compile( regexp ) -except: - print('please enter a valid regular expression ') - sys.exit(1) - -allFiles = os.popen("rfdir %s | awk '{print $9}'" % (castorDir)) - -matchingFiles = [] - - -print('matching files:') -for file in allFiles.readlines(): - file = file.rstrip() - - m = pattern.match( file ) - if m: - print(file) - fullCastorFile = 'rfio:%s/%s' % (castorDir, file) - matchingFiles.append( fullCastorFile ) - - - -# grouping files -count = 0 -chunk = [] -for file in matchingFiles: - count += 1 - chunk.append( file ) - if count == chunkSize: - count = 0 - processFiles( chunk ) - chunk = [] - -# remaining files: -if len(chunk)>0: - processFiles( chunk ) - - - - diff --git a/Validation/RecoParticleFlow/test/castorSyncOutputs.py b/Validation/RecoParticleFlow/test/castorSyncOutputs.py deleted file mode 100755 index 2e19ccd807a46..0000000000000 --- a/Validation/RecoParticleFlow/test/castorSyncOutputs.py +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function -from optparse import OptionParser -import sys,os, re, pprint - -# this set of function should be put in a separate module. - -def allCastorFiles( castorDir, regexp ): - - try: - pattern = re.compile( regexp ) - except: - print('please enter a valid regular expression ') - sys.exit(1) - - allFiles = os.popen("rfdir %s | awk '{print $9}'" % (castorDir)) - - matchingFiles = [] - for file in allFiles.readlines(): - file = file.rstrip() - - m = pattern.match( file ) - if m: - fullCastorFile = 'rfio:%s/%s' % (castorDir, file) - matchingFiles.append( fullCastorFile ) - - allFiles.close() - - return matchingFiles - - -def cleanFiles( castorDir, regexp, tolerance): - - try: - pattern = re.compile( regexp ) - except: - print('please enter a valid regular expression ') - sys.exit(1) - - allFiles = os.popen("rfdir %s | awk '{print $9}'" % (castorDir)) - sizes = os.popen("rfdir %s | awk '{print $5}'" % (castorDir)) - - averageSize = 0 - count = 0. - - matchingFiles = [] - print('Matching files: ') - for file,size in zip( allFiles.readlines(), sizes.readlines()): - file = file.rstrip() - size = float(size.rstrip()) - - m = pattern.match( file ) - if m: - print(file) - fullCastorFile = '%s/%s' % (castorDir, file) - matchingFiles.append( (fullCastorFile, size) ) - averageSize += size - count += 1 - - averageSize /= count - print('average file size = ',averageSize) - - cleanFiles = [] - dirtyFiles = [] - - for file, size in matchingFiles: - relDiff = (averageSize - size) / averageSize - if relDiff < tolerance: - # ok - # print file, size, relDiff - cleanFiles.append( file ) - else: - print('skipping', file, ': size too small: ', size, relDiff) - dirtyFiles.append( file ) - - return (cleanFiles, dirtyFiles) - - - -# returns an integer -def fileIndex( regexp, file ): - - try: - numPattern = re.compile( regexp ) - except: - print('fileIndex: please enter a valid regular expression ') - sys.exit(1) - - m = numPattern.search( file ) - if m: - return int(m.group(1)) - else: - print(file, ': cannot find number.') - return -1 - - -def extractNumberAndSort( regexp, files ): - numAndFile = [] - for file in files: - num = fileIndex( regexp, file ) - if num>-1: - numAndFile.append( (num, file) ) - - numAndFile.sort() - - return numAndFile - - -def sync( files1, files2): - - regexp = '_(\d+)\.root' - - numAndFile1 = extractNumberAndSort( regexp, files1 ) - numAndFile2 = extractNumberAndSort( regexp, files2 ) - -# pprint.pprint(numAndFile1) -# pprint.pprint(numAndFile2) - - i1 = 0 - i2 = 0 - - single = [] - while i1 TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_0.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_1.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_2.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_3.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_4.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_5.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_6.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_7.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_8.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_9.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_10.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_11.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_12.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_13.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_14.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_15.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_16.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_17.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_18.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_19.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_20.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_21.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_22.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_23.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_24.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_25.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_26.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_27.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_28.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_29.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.aod = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/aod_QCDForPF_Full_001.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.aod) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/aod_QCDForPF_Full_001.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_001.root - diff --git a/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_2.sh b/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_2.sh deleted file mode 100755 index 12e06226f0c85..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_2.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_30.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_31.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_32.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_33.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_34.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_35.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_36.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_37.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_38.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_39.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_40.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_41.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_42.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_43.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_44.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_45.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_46.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_47.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_48.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_49.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_50.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_51.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_52.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_53.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_54.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_55.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_56.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_57.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_58.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_59.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.aod = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/aod_QCDForPF_Full_002.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.aod) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/aod_QCDForPF_Full_002.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_002.root - diff --git a/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_3.sh b/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_3.sh deleted file mode 100755 index 19aa923ef4b57..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_3.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_60.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_61.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_62.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_63.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_64.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_65.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_66.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_67.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_68.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_69.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_70.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_71.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_72.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_73.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_74.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_75.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_76.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_77.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_78.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_79.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_80.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_81.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_82.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_83.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_84.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_85.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_86.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_87.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_88.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_89.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.aod = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/aod_QCDForPF_Full_003.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.aod) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/aod_QCDForPF_Full_003.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_003.root - - diff --git a/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_4.sh b/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_4.sh deleted file mode 100755 index 8cc494dd73e5c..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_4.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_90.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_91.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_92.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_93.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_94.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_95.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_96.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_97.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_98.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_99.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_100.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_101.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_102.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_103.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_104.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_105.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_106.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_107.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_108.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_109.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_110.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_111.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_112.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_113.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_114.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_115.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_116.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_117.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_118.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_119.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.aod = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/aod_QCDForPF_Full_004.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.aod) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/aod_QCDForPF_Full_004.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_004.root - diff --git a/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_5.sh b/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_5.sh deleted file mode 100755 index e528b642fc6ef..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_aod_QCDForPF_5.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_120.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_121.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_122.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_123.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_124.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_125.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_126.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_127.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_128.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_129.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_130.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_131.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_132.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_133.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_134.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_135.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_136.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_137.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_138.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_139.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_140.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_141.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_142.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_143.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_144.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_145.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_146.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_147.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_148.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_149.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.aod = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/aod_QCDForPF_Full_005.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.aod) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/aod_QCDForPF_Full_005.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/aod_QCDForPF_Full_005.root - diff --git a/Validation/RecoParticleFlow/test/copy_cfg.py b/Validation/RecoParticleFlow/test/copy_cfg.py deleted file mode 100644 index f8d03f9b5ace5..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_cfg.py +++ /dev/null @@ -1,34 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==0.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==1.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==2.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==3.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==4.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==5.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==6.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==7.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==8.root', - 'rfio:==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==9.root' - ) -) - -process.display = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('==TYPE==_==NAME==_==SIMU==_00==JOB==.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.display) - diff --git a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_1.sh b/Validation/RecoParticleFlow/test/copy_display_QCDForPF_1.sh deleted file mode 100755 index cfa31d5cf9645..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_1.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_0.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_1.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_2.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_3.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_4.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_5.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_6.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_7.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_8.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_9.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_10.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_11.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_12.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_13.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_14.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_15.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_16.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_17.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_18.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_19.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_20.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_21.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_22.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_23.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_24.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_25.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_26.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_27.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_28.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_29.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.display = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/display_QCDForPF_Full_001.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.display) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/display_QCDForPF_Full_001.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_001.root - diff --git a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_2.sh b/Validation/RecoParticleFlow/test/copy_display_QCDForPF_2.sh deleted file mode 100755 index 1641cc7363e34..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_2.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_30.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_31.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_32.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_33.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_34.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_35.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_36.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_37.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_38.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_39.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_40.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_41.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_42.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_43.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_44.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_45.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_46.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_47.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_48.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_49.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_50.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_51.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_52.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_53.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_54.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_55.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_56.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_57.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_58.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_59.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.display = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/display_QCDForPF_Full_002.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.display) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/display_QCDForPF_Full_002.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_002.root - - diff --git a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_3.sh b/Validation/RecoParticleFlow/test/copy_display_QCDForPF_3.sh deleted file mode 100755 index b559c5e9084f5..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_3.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_60.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_61.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_62.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_63.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_64.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_65.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_66.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_67.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_68.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_69.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_70.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_71.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_72.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_73.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_74.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_75.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_76.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_77.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_78.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_79.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_80.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_81.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_82.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_83.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_84.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_85.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_86.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_87.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_88.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_89.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.display = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/display_QCDForPF_Full_003.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.display) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/display_QCDForPF_Full_003.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_003.root - diff --git a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_4.sh b/Validation/RecoParticleFlow/test/copy_display_QCDForPF_4.sh deleted file mode 100755 index 994ebfa56c8e2..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_4.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_90.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_91.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_92.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_93.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_94.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_95.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_96.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_97.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_98.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_99.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_100.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_101.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_102.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_103.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_104.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_105.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_106.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_107.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_108.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_109.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_110.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_111.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_112.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_113.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_114.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_115.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_116.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_117.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_118.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_119.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.display = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/display_QCDForPF_Full_004.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.display) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/display_QCDForPF_Full_004.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_004.root - diff --git a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_5.sh b/Validation/RecoParticleFlow/test/copy_display_QCDForPF_5.sh deleted file mode 100755 index 7e8172f146dbd..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_display_QCDForPF_5.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_10_0_pre6/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_120.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_121.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_122.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_123.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_124.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_125.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_126.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_127.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_128.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_129.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_130.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_131.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_132.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_133.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_134.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_135.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_136.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_137.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_138.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_139.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_140.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_141.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_142.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_143.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_144.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_145.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_146.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_147.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_148.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_149.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.display = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/display_QCDForPF_Full_005.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.display) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/display_QCDForPF_Full_005.root /castor/cern.ch/user/p/pjanot/CMSSW3100pre6/display_QCDForPF_Full_005.root - diff --git a/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_1.sh b/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_1.sh deleted file mode 100755 index 556bfc5cd6fe8..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_1.sh +++ /dev/null @@ -1,70 +0,0 @@ - -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_4_1/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_0.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_1.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_2.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_3.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_4.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_5.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_6.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_7.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_8.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_9.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_10.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_11.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_12.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_13.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_14.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_15.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_16.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_17.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_18.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_19.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_20.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_21.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_22.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_23.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_24.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_25.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_26.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_27.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_28.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_29.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.reco = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/reco_QCDForPF_Full_001.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.reco) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/reco_QCDForPF_Full_001.root /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_001.root -#rm display_QCDForPF_Full_001.root - diff --git a/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_2.sh b/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_2.sh deleted file mode 100755 index 925ced2851814..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_2.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_4_1/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_30.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_31.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_32.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_33.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_34.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_35.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_36.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_37.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_38.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_39.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_40.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_41.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_42.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_43.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_44.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_45.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_46.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_47.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_48.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_49.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_50.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_51.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_52.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_53.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_54.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_55.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_56.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_57.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_58.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_59.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.reco = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/reco_QCDForPF_Full_002.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.reco) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/reco_QCDForPF_Full_002.root /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_002.root -#rm reco_QCDForPF_Full_002.root - diff --git a/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_3.sh b/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_3.sh deleted file mode 100755 index fde8aa4e5cb0b..0000000000000 --- a/Validation/RecoParticleFlow/test/copy_reco_QCDForPF_3.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -cd /afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_4_1/src -eval `scramv1 runtime -sh` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_60.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_61.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_62.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_63.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_64.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_65.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_66.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_67.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_68.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_69.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_70.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_71.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_72.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_73.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_74.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_75.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_76.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_77.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_78.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_79.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_80.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_81.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_82.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_83.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_84.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_85.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_86.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_87.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_88.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_89.root' - ), - noEventSort = cms.untracked.bool(True), - duplicateCheckMode = cms.untracked.string('noDuplicateCheck') - -) - -process.reco = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('/tmp/pjanot/reco_QCDForPF_Full_003.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.reco) - -EOF -cmsRun TEST_cfg.py - -rfcp /tmp/pjanot/reco_QCDForPF_Full_003.root /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_003.root -#rm reco_QCDForPF_Full_003.root - diff --git a/Validation/RecoParticleFlow/test/drop.sh b/Validation/RecoParticleFlow/test/drop.sh deleted file mode 100644 index 2a36be73501cd..0000000000000 --- a/Validation/RecoParticleFlow/test/drop.sh +++ /dev/null @@ -1,11 +0,0 @@ -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==0.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==1.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==2.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==3.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==4.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==5.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==6.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==7.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==8.root -rfrm ==CASTOR==/==TYPE==_==NAME==_==SIMU==_==JOBIN==9.root - diff --git a/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_1.sh b/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_1.sh deleted file mode 100755 index 46f42794754bf..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_1.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_0.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_1.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_2.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_3.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_4.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_5.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_6.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_7.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_8.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_9.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_10.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_11.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_12.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_13.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_14.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_15.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_16.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_17.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_18.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_19.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_20.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_21.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_22.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_23.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_24.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_25.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_26.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_27.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_28.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_29.root - diff --git a/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_2.sh b/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_2.sh deleted file mode 100755 index 50821d63beeda..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_2.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_30.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_31.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_32.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_33.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_34.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_35.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_36.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_37.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_38.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_39.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_40.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_41.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_42.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_43.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_44.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_45.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_46.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_47.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_48.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_49.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_50.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_51.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_52.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_53.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_54.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_55.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_56.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_57.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_58.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_59.root - diff --git a/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_3.sh b/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_3.sh deleted file mode 100644 index 226fd188a29b1..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_aod_QCDForPF_3.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_60.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_61.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_62.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_63.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_64.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_65.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_66.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_67.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_68.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_69.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_70.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_71.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_72.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_73.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_74.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_75.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_76.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_77.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_78.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_79.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_80.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_81.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_82.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_83.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_84.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_85.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_86.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_87.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_88.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/aod_QCDForPF_Full_89.root - diff --git a/Validation/RecoParticleFlow/test/drop_display_QCDForPF_1.sh b/Validation/RecoParticleFlow/test/drop_display_QCDForPF_1.sh deleted file mode 100755 index 65707c0f45583..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_display_QCDForPF_1.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_0.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_1.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_2.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_3.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_4.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_5.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_6.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_7.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_8.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_9.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_10.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_11.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_12.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_13.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_14.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_15.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_16.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_17.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_18.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_19.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_20.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_21.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_22.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_23.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_24.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_25.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_26.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_27.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_28.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_29.root - diff --git a/Validation/RecoParticleFlow/test/drop_display_QCDForPF_2.sh b/Validation/RecoParticleFlow/test/drop_display_QCDForPF_2.sh deleted file mode 100755 index 58643bce15307..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_display_QCDForPF_2.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_30.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_31.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_32.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_33.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_34.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_35.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_36.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_37.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_38.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_39.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_40.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_41.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_42.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_43.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_44.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_45.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_46.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_47.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_48.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_49.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_50.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_51.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_52.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_53.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_54.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_55.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_56.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_57.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_58.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_59.root - diff --git a/Validation/RecoParticleFlow/test/drop_display_QCDForPF_3.sh b/Validation/RecoParticleFlow/test/drop_display_QCDForPF_3.sh deleted file mode 100644 index 3df22ac18ef54..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_display_QCDForPF_3.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_60.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_61.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_62.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_63.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_64.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_65.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_66.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_67.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_68.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_69.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_70.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_71.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_72.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_73.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_74.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_75.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_76.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_77.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_78.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_79.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_80.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_81.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_82.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_83.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_84.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_85.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_86.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_87.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_88.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW350pre3/display_QCDForPF_Full_89.root - diff --git a/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_1.sh b/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_1.sh deleted file mode 100755 index 64015cbac1246..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_1.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_0.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_1.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_2.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_3.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_4.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_5.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_6.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_7.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_8.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_9.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_10.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_11.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_12.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_13.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_14.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_15.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_16.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_17.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_18.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_19.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_20.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_21.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_22.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_23.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_24.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_25.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_26.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_27.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_28.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_29.root - diff --git a/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_2.sh b/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_2.sh deleted file mode 100755 index 30cdff27de022..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_2.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_30.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_31.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_32.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_33.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_34.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_35.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_36.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_37.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_38.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_39.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_40.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_41.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_42.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_43.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_44.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_45.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_46.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_47.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_48.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_49.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_50.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_51.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_52.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_53.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_54.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_55.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_56.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_57.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_58.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_59.root - diff --git a/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_3.sh b/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_3.sh deleted file mode 100755 index e4d7d9cc3f9b8..0000000000000 --- a/Validation/RecoParticleFlow/test/drop_reco_QCDForPF_3.sh +++ /dev/null @@ -1,31 +0,0 @@ -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_60.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_61.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_62.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_63.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_64.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_65.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_66.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_67.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_68.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_69.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_70.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_71.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_72.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_73.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_74.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_75.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_76.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_77.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_78.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_79.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_80.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_81.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_82.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_83.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_84.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_85.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_86.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_87.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_88.root -rfrm /castor/cern.ch/user/p/pjanot/CMSSW341/reco_QCDForPF_Full_89.root - diff --git a/Validation/RecoParticleFlow/test/filelist_QCD.txt b/Validation/RecoParticleFlow/test/filelist_QCD.txt deleted file mode 100644 index 025e35d8a5755..0000000000000 --- a/Validation/RecoParticleFlow/test/filelist_QCD.txt +++ /dev/null @@ -1,50 +0,0 @@ -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/FE88E06A-C5EB-E811-8771-0025905B8594.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/FC445D34-C5EB-E811-A7FB-0CC47A4C8E1E.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/F27D5521-C5EB-E811-B8C1-0CC47A4C8E3C.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/F261DFB1-C1EB-E811-BF86-0CC47A4C8E2E.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/EE838E31-C5EB-E811-A294-0CC47A4D76CC.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/E4119FEC-C0EB-E811-BB17-0CC47A78A440.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/E2418A0B-C5EB-E811-9443-0CC47A4C8EB0.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/DEE29E6D-C5EB-E811-BCE2-0025905A60FE.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/DCA2B7D3-C4EB-E811-88C7-0CC47A4D767E.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/C4AA542D-C5EB-E811-B560-0CC47A4D7698.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/C4139925-C5EB-E811-B58E-0CC47A4D76A2.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/C0C1CE09-C5EB-E811-8546-0CC47A74527A.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/B4F3DC43-C5EB-E811-84B6-0025905A611C.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/B4ECC8FA-C4EB-E811-9AB7-0CC47A745284.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/AE107BD3-C1EB-E811-BFF6-0025905B85CC.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/AC92C532-C5EB-E811-9EA4-0CC47A4D7690.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/A80DE03C-C5EB-E811-9C7F-0CC47A4D762A.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/A6F4B617-C5EB-E811-A0BA-0CC47A4D765A.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/A2CEF3FA-C4EB-E811-95F1-0CC47A4C8E20.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/A2BDDF0B-C5EB-E811-B3B7-0CC47A78A340.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/9EF9182C-C5EB-E811-9377-0CC47A4D7666.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/9A709802-C5EB-E811-B8BF-0CC47A7C345E.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/9A2C211D-C5EB-E811-955C-0CC47A74527A.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/96260327-C5EB-E811-B0FA-0CC47A4D7678.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/92FAD51A-C5EB-E811-A89E-0CC47A78A340.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/9278A409-C1EB-E811-A070-0025905A608A.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/88F16D08-16EC-E811-BB05-002618FDA21D.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/84C9DBE9-C0EB-E811-82D2-0025905B8598.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/7EF050D6-C0EB-E811-B219-0CC47A745294.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/6E998D24-C5EB-E811-A8E9-0025905A610C.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/6834DD30-C5EB-E811-A1F9-0025905B858C.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/5E3D3DFA-C4EB-E811-9C68-0CC47A4C8ECA.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/54BB4A28-C5EB-E811-BF25-0CC47A78A418.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/4ABCE23D-C1EB-E811-AF0F-0025905A6080.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/4AB78CA7-C1EB-E811-9F97-0CC47A78A30E.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/48EB7D20-C1EB-E811-894F-0025905B8568.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/4863731D-C5EB-E811-98D9-0CC47A4D7614.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/40C7EE08-C1EB-E811-8165-0CC47A74527A.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/3C4D7F0A-C1EB-E811-8BE0-0CC47A7C35A8.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/36A31818-C5EB-E811-B8FF-0CC47A4C8F06.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/36907C30-C5EB-E811-8CF6-0CC47A4D764A.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/2CFD661F-C5EB-E811-B106-0CC47A7C34E6.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/228BFD27-C5EB-E811-813A-0CC47A7C351E.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/204B2CF5-C4EB-E811-AB1C-0CC47A4C8ECE.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/1A1FDCF9-C4EB-E811-A8BE-0CC47A7AB7A0.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/1803A607-C5EB-E811-96A2-0CC47A4C8E82.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/10217305-C1EB-E811-93A4-0CC47A4C8E86.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/027B5429-C5EB-E811-941B-0CC47A7C3404.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/020EE041-C5EB-E811-95F2-0025905A609E.root -root://cms-xrd-global.cern.ch///store/relval/CMSSW_9_4_9/RelValQCD_FlatPt_15_3000HS_13/GEN-SIM-DIGI-RAW/PU25ns_94X_mc2017_realistic_v14_rsb-v1/10000/00350CA4-C1EB-E811-AC1D-0CC47A78A418.root diff --git a/Validation/RecoParticleFlow/test/getHists.py b/Validation/RecoParticleFlow/test/getHists.py deleted file mode 100644 index eac25fb29e96d..0000000000000 --- a/Validation/RecoParticleFlow/test/getHists.py +++ /dev/null @@ -1,10 +0,0 @@ -import ROOT -import sys - -tf = ROOT.TFile(sys.argv[1]) -tt = tf.Get("TH1Fs") -for ev in tt: - print ev.FullName, ev.Value, ev.Value.GetMean() -tt = tf.Get("TH1Ds") -for ev in tt: - print ev.FullName, ev.Value, ev.Value.GetMean() diff --git a/Validation/RecoParticleFlow/test/launch_QCDFastSim.sh b/Validation/RecoParticleFlow/test/launch_QCDFastSim.sh deleted file mode 100755 index 006a6869c49cc..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_QCDFastSim.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -castorDir=/castor/cern.ch/user/p/pjanot/CMSSW300pre6/ -cmsswDir=/afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_0_0_pre6/src - -for ((energy=0; energy<=8; energy++)); - do - case $energy in - 0) - ptmin=20 - ptmax=30 - ;; - 1) - ptmin=30 - ptmax=50 - ;; - 2) - ptmin=50 - ptmax=80 - ;; - 3) - ptmin=80 - ptmax=120 - ;; - 4) - ptmin=120 - ptmax=160 - ;; - 5) - ptmin=160 - ptmax=250 - ;; - 6) - ptmin=250 - ptmax=350 - ;; - 7) - ptmin=350 - ptmax=500 - ;; - 8) - ptmin=500 - ptmax=700 - ;; - esac - - name="QCDDiJet_"$ptmin"_"$ptmax"_Fast" - displayfilename="display_"${name}".root" - aodfilename="aod_"${name}".root" - recofilename="reco_"${name}".root" - echo $name - - seed1=$(( ($job+1) + 143123*($energy+1) )) - sed -e "s/==BINLOW==/${ptmin}/" -e "s/==BINHIGH==/${ptmax}/" QCDFastSim_cfg.py > tmp_cfg - -#Start to write the script - cat > job_${name}.sh << EOF - -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> job_${name}.sh - -# On poursuit le script -echo "EOF" >> job_${name}.sh -cat >> job_${name}.sh << EOF -cmsRun TEST_cfg.py >& log - - -rfcp display.root $castorDir$displayfilename -rfcp aod.root $castorDir$aodfilename -rfcp reco.root $castorDir$recofilename - -EOF -echo "Save files : "$castorDir$displayfilename", "$castorDir$aodfilename", "$castorDir$recofilename -chmod 755 job_${name}.sh -bsub -q cmst3 -J $name $PWD/job_${name}.sh - - -done - diff --git a/Validation/RecoParticleFlow/test/launch_QCDForPF_FastSim.sh b/Validation/RecoParticleFlow/test/launch_QCDForPF_FastSim.sh deleted file mode 100755 index fe0376797c980..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_QCDForPF_FastSim.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -castorDir=/castor/cern.ch/user/p/pjanot/CMSSW3110pre3/ -cmsswDir=/afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_11_0_pre3/src - -for ((job=0;job<=15;job++)); - do - echo "JOB "$job - name="QCDForPF_Fast_"${job} - displayfilename="display_"${name}".root" - aodfilename="aod_"${name}".root" - recofilename="reco_"${name}".root" - echo $name - - seed1=$(( ($job+1)*143123 )) - sed -e "s/==SEED==/${seed1}/" QCDForPFFast_cfg.py > tmp_cfg - -#Start to write the script -cat > job_${name}.sh << EOF -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> job_${name}.sh - -# On poursuit le script -echo "EOF" >> job_${name}.sh -cat >> job_${name}.sh << EOF -cmsRun TEST_cfg.py >& log - -rfcp display.root $castorDir$displayfilename -rfcp aod.root $castorDir$aodfilename -#rfcp reco.root $castorDir$recofilename - -EOF -chmod 755 job_${name}.sh -bsub -q 8nh80 -R "mem>2000" -J $name $PWD/job_${name}.sh - - -done - diff --git a/Validation/RecoParticleFlow/test/launch_QCDForPF_FullSim.sh b/Validation/RecoParticleFlow/test/launch_QCDForPF_FullSim.sh deleted file mode 100755 index ea2ccc3c48db4..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_QCDForPF_FullSim.sh +++ /dev/null @@ -1,47 +0,0 @@ - -#!/bin/sh - -castorDir=/castor/cern.ch/user/p/pjanot/CMSSW3110pre3/ -cmsswDir=$CMSSW_BASE/src - -for ((job=0;job<150;job++)); - do - echo "JOB "$job - name="QCDForPF_Full_"${job} - displayfilename="display_"${name}".root" - aodfilename="aod_"${name}".root" - recofilename="reco_"${name}".root" - echo $name - - seed1=$(( ($job+1)*14312 )) - sed -e "s/==SEED==/${seed1}/" QCDForPFFull_cfg.py > tmp_cfg - -#Start to write the script -cat > job_${name}.sh << EOF -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> job_${name}.sh - -# On poursuit le script -echo "EOF" >> job_${name}.sh -cat >> job_${name}.sh << EOF -cmsRun TEST_cfg.py >& log - -rfcp display.root $castorDir$displayfilename -rfcp aod.root $castorDir$aodfilename -rfcp reco.root $castorDir$recofilename - -EOF -chmod 755 job_${name}.sh -bsub -q 1nw80 -J $name -R "mem>2000" $PWD/job_${name}.sh - - -done - diff --git a/Validation/RecoParticleFlow/test/launch_QCDFullSim.sh b/Validation/RecoParticleFlow/test/launch_QCDFullSim.sh deleted file mode 100755 index ea2238577d8fa..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_QCDFullSim.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh - -castorDir=/castor/cern.ch/user/p/pjanot/CMSSW220/ -cmsswDir=/afs/cern.ch/user/p/pjanot/scratch0/CMSSW_2_2_0/src - -for ((energy=0; energy<=8; energy++)); -# 0 -> 3 : 1nd -# 4 -> 8 : 1nw or cmst3 - do - case $energy in - 0) - ptmin=20 - ptmax=30 - ;; - 1) - ptmin=30 - ptmax=50 - ;; - 2) - ptmin=50 - ptmax=80 - ;; - 3) - ptmin=80 - ptmax=120 - ;; - 4) - ptmin=120 - ptmax=160 - ;; - 5) - ptmin=160 - ptmax=250 - ;; - 6) - ptmin=250 - ptmax=350 - ;; - 7) - ptmin=350 - ptmax=500 - ;; - 8) - ptmin=500 - ptmax=700 - ;; - esac - - for ((job=0;job<=10;job++)); - do - echo "JOB "$job - name="QCDDiJet_"$ptmin"_"$ptmax"_Full_"${job} - displayfilename="display_"${name}".root" - aodfilename="aod_"${name}".root" - recofilename="reco_"${name}".root" - echo $name - - seed1=$(( ($job+1) + 143223*($energy+1) )) - sed -e "s/==SEED==/${seed1}/" -e "s/==BINLOW==/${ptmin}/" -e "s/==BINHIGH==/${ptmax}/" QCDFullSim_cfg.py > tmp_cfg - -#Start to write the script - cat > job_${name}.sh << EOF - -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> job_${name}.sh - -# On poursuit le script -echo "EOF" >> job_${name}.sh -cat >> job_${name}.sh << EOF -cmsRun TEST_cfg.py >& log - - -rfcp display.root $castorDir$displayfilename -rfcp aod.root $castorDir$aodfilename -rfcp reco.root $castorDir$recofilename - -EOF -echo "Save files : "$castorDir$displayfilename", "$castorDir$aodfilename", "$castorDir$recofilename -chmod 755 job_${name}.sh -bsub -q cmst3 -J $name $PWD/job_${name}.sh - - - done -done - diff --git a/Validation/RecoParticleFlow/test/launch_ZTTFastSim.sh b/Validation/RecoParticleFlow/test/launch_ZTTFastSim.sh deleted file mode 100755 index 6c217496b4e5c..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_ZTTFastSim.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -castorDir=/castor/cern.ch/user/g/gennai/CMSSW_310pre8/ - -cmsswDir=/afs/cern.ch/user/g/gennai/scratch0/CMSSW_3_1_0_pre8/src/ - -for ((job=1;job<=10;job++)); - do - echo "JOB "$job - name="ZTT_Fast_"${job} - displayfilename="display_"${name}".root" - aodfilename="aod_"${name}".root" - recofilename="reco_"${name}".root" - echo $name - - seed1=$(( ($job+1)*143123 )) - sed -e "s/==SEED==/${seed1}/" ZTTFastSim_cfg.py > tmp_cfg - -#Start to write the script -cat > job_${name}.sh << EOF -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> job_${name}.sh - -# On poursuit le script -echo "EOF" >> job_${name}.sh -cat >> job_${name}.sh << EOF -cmsRun TEST_cfg.py >& log - -#rfcp display.root $castorDir$displayfilename -rfcp aod.root $castorDir$aodfilename -#rfcp reco.root $castorDir$recofilename - -EOF -chmod 755 job_${name}.sh -bsub -q 1nd -J $name $PWD/job_${name}.sh - - -done - diff --git a/Validation/RecoParticleFlow/test/launch_ZTTFullSim.sh b/Validation/RecoParticleFlow/test/launch_ZTTFullSim.sh deleted file mode 100755 index b76d6c6a854e5..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_ZTTFullSim.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -castorDir=/castor/cern.ch/user/g/gennai/CMSSW_310pre11/ - -cmsswDir=/afs/cern.ch/user/g/gennai/scratch.0/Validation/CMSSW_3_1_0_pre11/src/ - -for ((job=1;job<=30;job++)); - do - echo "JOB "$job - name="ZTT_Full_"${job} - displayfilename="display_"${name}".root" - aodfilename="aod_"${name}".root" - recofilename="reco_"${name}".root" - echo $name - - seed1=$(( ($job+1)*143123 )) - sed -e "s/==SEED==/${seed1}/" ZTTFullSim_cfg.py > tmp_cfg - -#Start to write the script -cat > job_${name}.sh << EOF -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> job_${name}.sh - -# On poursuit le script -echo "EOF" >> job_${name}.sh -cat >> job_${name}.sh << EOF -cmsRun TEST_cfg.py >& log - -#rfcp display.root $castorDir$displayfilename -#rfcp aod.root $castorDir$aodfilename -rfcp reco.root $castorDir$recofilename - -EOF -chmod 755 job_${name}.sh -bsub -q 1nd -J $name $PWD/job_${name}.sh - - -done - diff --git a/Validation/RecoParticleFlow/test/launch_copy.sh b/Validation/RecoParticleFlow/test/launch_copy.sh deleted file mode 100755 index fa6599417dca0..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_copy.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -cmsswDir=/afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_1_0_pre2/src -castorDir=/castor/cern.ch/user/p/pjanot/CMSSW310pre2 -castor="\/castor\/cern.ch\/user\/p\/pjanot\/CMSSW310pre2" - -name=QCDForPF -simu=Full - -for ((job=1; job<3; job++)); - do - -jobin=${job} - case $job in - 0) - jobin="" - ;; - esac - - - for ((out=1; out<=2; out++)); - do - case $out in - 0) - type=reco - ;; - 1) - type=aod - ;; - 2) - type=display - ;; - esac - - filename=${type}"_"${name}"_"${simu}"_00"${job}".root" - castorname=${castorDir}"/"${type}"_"${name}"_"${simu}"_00"${job}".root" - echo $filename" -> "$castorname - - sed -e "s/==CASTOR==/${castor}/" -e "s/==TYPE==/${type}/" -e "s/==NAME==/${name}/" -e "s/==SIMU==/${simu}/" -e "s/==JOBIN==/${jobin}/" -e "s/==JOB==/${job}/" copy_cfg.py > tmp_cfg - - sed -e "s/==CASTOR==/${castor}/" -e "s/==TYPE==/${type}/" -e "s/==NAME==/${name}/" -e "s/==SIMU==/${simu}/" -e "s/==JOBIN==/${jobin}/" drop.sh > drop_${type}_${name}_${job}.sh - -#Start to write the script - cat > copy_${type}_${name}_${job}.sh << EOF - -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> copy_${type}_${name}_${job}.sh - -# On poursuit le script -echo "EOF" >> copy_${type}_${name}_${job}.sh -cat >> copy_${type}_${name}_${job}.sh << EOF -cmsRun TEST_cfg.py - -rfcp $filename $castorname -rm $filename - -EOF -chmod 755 copy_${type}_${name}_${job}.sh -chmod 755 drop_${type}_${name}_${job}.sh - -# uncomment if you wish to copy -#copy_${type}_${name}_${job}.sh -#rm copy_${type}_${name}_${job}.sh - -# uncomment if you wish to drop -# It's unwise to automatically drop before checking the outcome of the copy stage ! -#drop_${type}_${name}_${job}.sh -#rm drop_${type}_${name}_${job}.sh - - - done -done - diff --git a/Validation/RecoParticleFlow/test/launch_ttbarFastSim.sh b/Validation/RecoParticleFlow/test/launch_ttbarFastSim.sh deleted file mode 100755 index 5e052d79796f7..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_ttbarFastSim.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -castorDir=/castor/cern.ch/user/p/pjanot/CMSSW220pre1/ -cmsswDir=/afs/cern.ch/user/p/pjanot/scratch0/CMSSW_2_2_0_pre1/src - -for ((job=1;job<=10;job++)); - do - echo "JOB "$job - name="ttbar_Fast_"${job} - displayfilename="display_"${name}".root" - aodfilename="aod_"${name}".root" - recofilename="reco_"${name}".root" - echo $name - - seed1=$(( ($job+1)*143123 )) - sed -e "s/==SEED==/${seed1}/" ttbarFastSim_cfg.py > tmp_cfg - -#Start to write the script -cat > job_${name}.sh << EOF -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> job_${name}.sh - -# On poursuit le script -echo "EOF" >> job_${name}.sh -cat >> job_${name}.sh << EOF -cmsRun TEST_cfg.py >& log - -#rfcp display.root $castorDir$displayfilename -rfcp aod.root $castorDir$aodfilename -#rfcp reco.root $castorDir$recofilename - -EOF -chmod 755 job_${name}.sh -bsub -q cmst3 -J $name $PWD/job_${name}.sh - - -done - diff --git a/Validation/RecoParticleFlow/test/launch_ttbarFullSim.sh b/Validation/RecoParticleFlow/test/launch_ttbarFullSim.sh deleted file mode 100755 index 8b905ee241b67..0000000000000 --- a/Validation/RecoParticleFlow/test/launch_ttbarFullSim.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -castorDir=/castor/cern.ch/user/p/pjanot/CMSSW220pre1/ -cmsswDir=/afs/cern.ch/user/p/pjanot/scratch0/CMSSW_2_2_0_pre1/src - -for ((job=1;job<=50;job++)); - do - echo "JOB "$job - name="ttbar_Full_"${job} - displayfilename="display_"${name}".root" - aodfilename="aod_"${name}".root" - recofilename="reco_"${name}".root" - echo $name - - seed1=$(( ($job+1)*143123 )) - sed -e "s/==SEED==/${seed1}/" ttbarFullSim_cfg.py > tmp_cfg - -#Start to write the script -cat > job_${name}.sh << EOF -#!/bin/sh -cd $cmsswDir -eval \`scramv1 runtime -sh\` -cd - -#commande pour decoder le .cfg -cat > TEST_cfg.py << "EOF" -EOF - -#Ajoute le .cfg au script -cat tmp_cfg>> job_${name}.sh - -# On poursuit le script -echo "EOF" >> job_${name}.sh -cat >> job_${name}.sh << EOF -cmsRun TEST_cfg.py >& log - -#rfcp display.root $castorDir$displayfilename -rfcp aod.root $castorDir$aodfilename -#rfcp reco.root $castorDir$recofilename - -EOF -chmod 755 job_${name}.sh -bsub -q cmst3 -J $name $PWD/job_${name}.sh - - -done - diff --git a/Validation/RecoParticleFlow/test/setup_cmssw.sh b/Validation/RecoParticleFlow/test/setup_cmssw.sh deleted file mode 100644 index e19ff96e730c7..0000000000000 --- a/Validation/RecoParticleFlow/test/setup_cmssw.sh +++ /dev/null @@ -1,11 +0,0 @@ -export SCRAM_ARCH=slc6_amd64_gcc630 -cmsrel CMSSW_9_4_11 -cd CMSSW_9_4_11 -eval `scramv1 runtime -sh` -git cms-addpkg DQMOffline/PFTau -git cms-addpkg DQMOffline/Configuration -git cms-addpkg PhysicsTools/NanoAOD -git cms-addpkg Validation/Configuration -git cms-addpkg Validation/RecoParticleFlow -git cms-addpkg Validation/RecoTrack -git cms-addpkg Configuration/PyReleaseValidation diff --git a/Validation/RecoParticleFlow/test/singleTauPt50FastSim.py b/Validation/RecoParticleFlow/test/singleTauPt50FastSim.py deleted file mode 100644 index 81cc6b3a24f6f..0000000000000 --- a/Validation/RecoParticleFlow/test/singleTauPt50FastSim.py +++ /dev/null @@ -1,123 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("PROD1") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(5000) -) - -#generation -process.load("RecoParticleFlow.Configuration.source_singleTau_cfi") -process.generator.PGunParameters.MinEta = -3.0 -process.generator.PGunParameters.MaxEta = 3.0 -process.generator.PGunParameters.MinPt = 50.0 -process.generator.PGunParameters.MinPt = 51.0 - - - -# process.load("FastSimulation.Configuration.SimpleJet_cfi") - -# Input source -#process.source = cms.Source("EmptySource") - - -""" -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( -#'/store/relval/CMSSW_3_1_0_pre10/RelValSingleTauPt50Pythia/GEN-SIM-RECO/IDEAL_31X_v1/0008/4C7D1339-5857-DE11-A513-0019B9F70607.root', -# '/store/relval/CMSSW_3_1_0_pre10/RelValSingleTauPt50Pythia/GEN-SIM-RECO/IDEAL_31X_v1/0008/3E1EE9AA-0458-DE11-BD9D-001D09F2960F.root' - '/store/relval/CMSSW_3_1_0_pre10/RelValZTT/GEN-SIM-RECO/STARTUP_31X_v1/0009/0EC0E0FE-0558-DE11-986D-001D09F29146.root', - '/store/relval/CMSSW_3_1_0_pre10/RelValZTT/GEN-SIM-RECO/STARTUP_31X_v1/0008/969D21C1-E857-DE11-A00D-001D09F23D04.root', - '/store/relval/CMSSW_3_1_0_pre10/RelValZTT/GEN-SIM-RECO/STARTUP_31X_v1/0008/840866A4-EA57-DE11-8A75-001D09F28EC1.root', - '/store/relval/CMSSW_3_1_0_pre10/RelValZTT/GEN-SIM-RECO/STARTUP_31X_v1/0008/70EDDE9C-E957-DE11-A16D-000423D98868.root', - '/store/relval/CMSSW_3_1_0_pre10/RelValZTT/GEN-SIM-RECO/STARTUP_31X_v1/0001/CCE6F244-1458-DE11-A5E5-001A92971B5E.root', - '/store/relval/CMSSW_3_1_0_pre10/RelValZTT/GEN-SIM-RECO/STARTUP_31X_v1/0001/C4E56D8D-075A-DE11-B5E7-001A92971B54.root', - '/store/relval/CMSSW_3_1_0_pre10/RelValZTT/GEN-SIM-RECO/STARTUP_31X_v1/0001/16E3E391-7059-DE11-9887-001A928116F4.root' - - - ) - -) -""" - -#fastsim -process.load("FastSimulation.Configuration.RandomServiceInitialization_cff") -process.load("FastSimulation.Configuration.CommonInputs_cff") -process.GlobalTag.globaltag = "MC_31X_V1::All" - - -process.fastSimProducer.SimulateCalorimetry = True -for layer in process.fastSimProducer.detectorDefinition.BarrelLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -for layer in process.fastSimProducer.detectorDefinition.ForwardLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -process.famosPileUp.PileUpSimulator.averageNumber = 0.0 - -process.fastSimProducer.VertexGenerator.BetaStar = 0.00001 -process.fastSimProducer.VertexGenerator.SigmaZ = 0.00001 - -# Parametrized magnetic field (new mapping, 4.0 and 3.8T) -process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.VolumeBasedMagneticFieldESProducer.useParametrizedTrackerField = True - -process.load("RecoParticleFlow.PFProducer.particleFlowSimParticle_cff") -process.load("Validation.RecoParticleFlow.tauBenchmarkGeneric_cff") - -process.p1 = cms.Path( -# process.famosWithCaloTowersAndParticleFlow + - process.generator + - process.famosWithEverything + - process.caloJetMetGen + - process.particleFlowSimParticle - ) - - -process.load("FastSimulation.Configuration.EventContent_cff") -process.aod = cms.OutputModule("PoolOutputModule", - process.AODSIMEventContent, -# fileName = cms.untracked.string('/storage/users/gennai/aodFastSim310pre10FromRelVal.root') - fileName = cms.untracked.string('/storage/users/gennai/aodSingleTauPt50_310pre11.root') -) - -process.load("FastSimulation.Configuration.EventContent_cff") -process.reco = cms.OutputModule("PoolOutputModule", - process.RECOSIMEventContent, - fileName = cms.untracked.string('/storage/users/gennai/recoFastSimSingleTauPt50_310pre11.root') -) - -process.load("RecoParticleFlow.Configuration.Display_EventContent_cff") -process.display = cms.OutputModule("PoolOutputModule", - process.DisplayEventContent, - fileName = cms.untracked.string('display.root') -) - -#process.outpath = cms.EndPath(process.aod + process.display) -process.outpath = cms.EndPath(process.reco) - -process.load("FWCore.MessageLogger.MessageLogger_cfi") -process.options = cms.untracked.PSet( - makeTriggerResults = cms.untracked.bool(False), - wantSummary = cms.untracked.bool(False), - Rethrow = cms.untracked.vstring('Unknown', - 'ProductNotFound', - 'DictionaryNotFound', - 'InsertFailure', - 'Configuration', - 'LogicError', - 'UnimplementedFeature', - 'InvalidReference', - 'NullPointerError', - 'NoProductSpecified', - 'EventTimeout', - 'EventCorruption', - 'ModuleFailure', - 'ScheduleExecutionFailure', - 'EventProcessorFailure', - 'FileInPathError', - 'FatalRootError', - 'NotFound') -) -process.MessageLogger.cerr.FwkReport.reportEvery = 100 - diff --git a/Validation/RecoParticleFlow/test/testTH2Analyzer.C b/Validation/RecoParticleFlow/test/testTH2Analyzer.C deleted file mode 100644 index 88bbbff49ce48..0000000000000 --- a/Validation/RecoParticleFlow/test/testTH2Analyzer.C +++ /dev/null @@ -1,15 +0,0 @@ -{ -gSystem->Load("libFWCoreFWLite.so"); -gSystem->Load("libValidationRecoParticleFlow.so"); - -TF2 gaus2("gaus2", "[0]*exp(-0.5*((x-[1])/[2])**2)*exp(-0.5*((y-[3])/[4])**2)",0,10,0,10); -gaus2.SetParameters( 100, 5, 5, 2, 2); -gaus2.Draw("colz"); - -TH2D h("h", "", 10,0,10,100,0,10); -h.FillRandom("gaus2"); -h.Draw("col"); - -TH2Analyzer hana(&h); - -} diff --git a/Validation/RecoParticleFlow/test/ttbarFastSim_cfg.py b/Validation/RecoParticleFlow/test/ttbarFastSim_cfg.py deleted file mode 100644 index 0b667075bd268..0000000000000 --- a/Validation/RecoParticleFlow/test/ttbarFastSim_cfg.py +++ /dev/null @@ -1,69 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("PROD") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(2500) -) - -#generation -process.source = cms.Source("EmptySource") -process.load("FastSimulation.Configuration.ttbar_cfi") -process.generator.comEnergy = 14000. - -#fastsim -process.load("FastSimulation.Configuration.RandomServiceInitialization_cff") -process.load("FastSimulation.Configuration.CommonInputs_cff") -process.load("FastSimulation.Configuration.FamosSequences_cff") - -process.RandomNumberGeneratorService.generator.initialSeed= ==SEED== -process.fastSimProducer.SimulateCalorimetry = True -for layer in process.fastSimProducer.detectorDefinition.BarrelLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -for layer in process.fastSimProducer.detectorDefinition.ForwardLayers: - layer.interactionModels = cms.untracked.vstring("pairProduction", "nuclearInteraction", "bremsstrahlung", "energyLoss", "multipleScattering", "trackerSimHits") -process.famosPileUp.PileUpSimulator.averageNumber = 0.0 - -# Get frontier conditions - not applied in the HCAL, see below -# Values for globaltag are "STARTUP_V5::All", "1PB::All", "10PB::All", "IDEAL_V5::All" -process.GlobalTag.globaltag = "MC_31X_V9::All" - -# Parametrized magnetic field (new mapping, 4.0 and 3.8T) -process.load("Configuration.StandardSequences.MagneticField_40T_cff") -#process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.VolumeBasedMagneticFieldESProducer.useParametrizedTrackerField = True - -process.load("RecoParticleFlow.PFProducer.particleFlowSimParticle_cff") - - -process.p1 = cms.Path( - process.generator + - process.famosWithEverything + - process.caloJetMetGen + - process.particleFlowSimParticle -) - - -process.load("FastSimulation.Configuration.EventContent_cff") -process.aod = cms.OutputModule("PoolOutputModule", - process.AODSIMEventContent, - fileName = cms.untracked.string('aod.root') -) - -process.reco = cms.OutputModule("PoolOutputModule", - process.RECOSIMEventContent, - fileName = cms.untracked.string('reco.root') -) - -process.load("RecoParticleFlow.Configuration.Display_EventContent_cff") -process.display = cms.OutputModule("PoolOutputModule", - process.DisplayEventContent, - fileName = cms.untracked.string('display.root') -) - -#process.outpath = cms.EndPath(process.aod + process.reco + process.display) -process.outpath = cms.EndPath(process.aod+process.display) - -# diff --git a/Validation/RecoParticleFlow/test/ttbar_copy_Fast_cfg.py b/Validation/RecoParticleFlow/test/ttbar_copy_Fast_cfg.py deleted file mode 100644 index cb15f912a83e4..0000000000000 --- a/Validation/RecoParticleFlow/test/ttbar_copy_Fast_cfg.py +++ /dev/null @@ -1,34 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_1.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_2.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_3.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_4.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_5.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_6.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_7.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_8.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_9.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Fast_10.root' - ) -) - -process.display = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('aod_ttbar_Fast.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.display) - diff --git a/Validation/RecoParticleFlow/test/ttbar_copy_Full_cfg.py b/Validation/RecoParticleFlow/test/ttbar_copy_Full_cfg.py deleted file mode 100644 index beea5a5775221..0000000000000 --- a/Validation/RecoParticleFlow/test/ttbar_copy_Full_cfg.py +++ /dev/null @@ -1,74 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -process = cms.Process("COPY") - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) - -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_1.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_2.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_3.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_4.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_5.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_6.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_7.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_8.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_9.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_10.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_11.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_12.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_13.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_14.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_15.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_16.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_17.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_18.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_19.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_20.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_21.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_22.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_23.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_24.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_25.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_26.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_27.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_28.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_29.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_30.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_31.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_32.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_33.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_34.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_35.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_36.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_37.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_38.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_39.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_40.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_41.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_42.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_43.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_44.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_45.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_46.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_47.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_48.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_49.root', - 'rfio:/castor/cern.ch/user/p/pjanot/CMSSW220pre1/aod_ttbar_Full_50.root' - ) -) - -process.display = cms.OutputModule("PoolOutputModule", - fileName = cms.untracked.string('aod_ttbar_Full.root'), - outputCommands = cms.untracked.vstring( - 'keep *' - ) -) - -process.outpath = cms.EndPath(process.display) - From e3a98b49dc837c24d76f65839e147611daf219e6 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 28 Sep 2020 13:03:27 -0500 Subject: [PATCH 083/778] update artifacts --- .../SonicTriton/test/fetch_model.sh | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/test/fetch_model.sh b/HeterogeneousCore/SonicTriton/test/fetch_model.sh index f2f8a2410a685..a9533be37823a 100755 --- a/HeterogeneousCore/SonicTriton/test/fetch_model.sh +++ b/HeterogeneousCore/SonicTriton/test/fetch_model.sh @@ -20,12 +20,35 @@ mkdir -p 1 curl -o 1/model.netdef http://download.caffe2.ai.s3.amazonaws.com/models/resnet50/predict_net.pb curl -o 1/init_model.netdef http://download.caffe2.ai.s3.amazonaws.com/models/resnet50/init_net.pb -GAT_REPO="https://github.com/lgray/triton-torchgeo-gat-example/raw/cmssw_20.06-v1-py3" GAT_DIR=${TEST_DIR}/../data/models/gat_test cd $TEST_DIR mkdir -p $GAT_DIR cd $GAT_DIR -curl -O -L ${GAT_REPO}/artifacts/models/gat_test/config.pbtxt +cat << EOF > config.pbtxt +name: "gat_test" +platform: "pytorch_libtorch" +max_batch_size: 0 +input [ + { + name: "x__0" + data_type: TYPE_FP32 + dims: [ -1, 1433 ] + }, + { + name: "edgeindex__1" + data_type: TYPE_INT64 + dims: [ 2, -1 ] + } +] +output [ + { + name: "logits__0" + data_type: TYPE_FP32 + dims: [ -1, 7 ] + } +] +EOF + mkdir -p 1 -curl -o 1/model.pt -L ${GAT_REPO}/artifacts/models/gat_test/1/model.pt +cp /cvmfs/unpacked.cern.ch/registry.hub.docker.com/fastml/triton-torchgeo:20.06-v1-py3-geometric/torch_geometric/examples/model.pt 1/model.pt From 6f0a0b8cf8de5afbd5ff990c5971c35eadc05db7 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Fri, 24 May 2019 16:47:34 +0200 Subject: [PATCH 084/778] uGMT adapted for KBMTF muons The BMTF with the Kalman filter sends inverted track addresses, the uGMT cancel-out unit has been adapted for this. In this commit it has also been configured to use the new mode and pick barrel muons from the KBMTF collection. --- .../L1TMuon/interface/MicroGMTCancelOutUnit.h | 13 +- L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc | 26 +- .../L1TMuon/python/simGmtStage2Digis_cfi.py | 5 +- .../L1TMuon/src/MicroGMTCancelOutUnit.cc | 248 ++++++++++++------ 4 files changed, 205 insertions(+), 87 deletions(-) diff --git a/L1Trigger/L1TMuon/interface/MicroGMTCancelOutUnit.h b/L1Trigger/L1TMuon/interface/MicroGMTCancelOutUnit.h index c13747b9bdf16..5e722ea920ae7 100644 --- a/L1Trigger/L1TMuon/interface/MicroGMTCancelOutUnit.h +++ b/L1Trigger/L1TMuon/interface/MicroGMTCancelOutUnit.h @@ -8,7 +8,7 @@ #include "L1Trigger/L1TMuon/interface/MicroGMTLUTFactories.h" namespace l1t { - enum cancelmode { tracks, coordinate }; + enum cancelmode { tracks, kftracks, coordinate }; class MicroGMTCancelOutUnit { public: @@ -29,9 +29,18 @@ namespace l1t { void getCoordinateCancelBits(std::vector>&, std::vector>&); /// Compares all muons from coll1 with all muons from coll2 and sets the cancel-bits based on track addresses - void getTrackAddrCancelBits(std::vector>&, + void getTrackAddrCancelBits(cancelmode, + std::vector>&, std::vector>&); + /// Do the track address-based cancel-out for the original BMTF algorithm + void getTrackAddrCancelBitsOrigBMTF(std::vector>&, + std::vector>&); + + /// Do the track address-based cancel-out for the BMTF algorithm using the Kalman Filter + void getTrackAddrCancelBitsKfBMTF(std::vector>&, + std::vector>&); + std::shared_ptr m_boPosMatchQualLUT; std::shared_ptr m_boNegMatchQualLUT; std::shared_ptr m_foPosMatchQualLUT; diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc index 93b17dac71517..8ad5c409a06bd 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc @@ -119,6 +119,7 @@ class L1TMuonProducer : public edm::stream::EDProducer<> { MicroGMTIsolationUnit m_isolationUnit; MicroGMTCancelOutUnit m_cancelOutUnit; std::ofstream m_debugOut; + l1t::cancelmode m_bmtfCancelMode; l1t::cancelmode m_emtfCancelMode; edm::EDGetTokenT m_barrelTfInputToken; @@ -141,7 +142,9 @@ class L1TMuonProducer : public edm::stream::EDProducer<> { // constructors and destructor // L1TMuonProducer::L1TMuonProducer(const edm::ParameterSet& iConfig) - : m_debugOut("test/debug/iso_debug.dat"), m_emtfCancelMode(cancelmode::coordinate) { + : m_debugOut("test/debug/iso_debug.dat"), + m_bmtfCancelMode(cancelmode::tracks), + m_emtfCancelMode(cancelmode::coordinate) { // edm::InputTag barrelTfInputTag = iConfig.getParameter("barrelTFInput"); // edm::InputTag overlapTfInputTag = iConfig.getParameter("overlapTFInput"); // edm::InputTag forwardTfInputTag = iConfig.getParameter("forwardTFInput"); @@ -156,8 +159,13 @@ L1TMuonProducer::L1TMuonProducer(const edm::ParameterSet& iConfig) m_bxMax = iConfig.getParameter("bxMax"); m_autoCancelMode = iConfig.getParameter("autoCancelMode"); - if (!m_autoCancelMode && iConfig.getParameter("emtfCancelMode").find("tracks") == 0) { - m_emtfCancelMode = cancelmode::tracks; + if (!m_autoCancelMode) { + if (iConfig.getParameter("bmtfCancelMode").find("kftracks") == 0) { + m_bmtfCancelMode = cancelmode::kftracks; + } + if (iConfig.getParameter("emtfCancelMode").find("tracks") == 0) { + m_emtfCancelMode = cancelmode::tracks; + } } m_barrelTfInputToken = consumes(m_barrelTfInputTag); @@ -271,7 +279,7 @@ void L1TMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) splitAndConvertMuons(omtfMuons, internMuonsOmtfPos, internMuonsOmtfNeg, omtfPosWedges, omtfNegWedges, bx); // cancel out within the track finders: - m_cancelOutUnit.setCancelOutBits(bmtfWedges, tftype::bmtf, cancelmode::tracks); + m_cancelOutUnit.setCancelOutBits(bmtfWedges, tftype::bmtf, m_bmtfCancelMode); m_cancelOutUnit.setCancelOutBits(omtfPosWedges, tftype::omtf_pos, cancelmode::coordinate); m_cancelOutUnit.setCancelOutBits(omtfNegWedges, tftype::omtf_neg, cancelmode::coordinate); m_cancelOutUnit.setCancelOutBits(emtfPosWedges, tftype::emtf_pos, m_emtfCancelMode); @@ -562,8 +570,14 @@ void L1TMuonProducer::beginRun(edm::Run const& run, edm::EventSetup const& iSetu m_isolationUnit.initialise(microGMTParamsHelper.get()); m_cancelOutUnit.initialise(microGMTParamsHelper.get()); - if (m_autoCancelMode && microGMTParamsHelper->fwVersion() > 0x5000000) { - m_emtfCancelMode = cancelmode::tracks; + if (m_autoCancelMode) { + if (microGMTParamsHelper->fwVersion() >= 0x5010000) { + m_bmtfCancelMode = cancelmode::kftracks; + } + // TODO: No decision yet on when to use EMTF track addresses for cancel-out. + // if (microGMTParamsHelper->fwVersion() > 0x5000000) { + // m_emtfCancelMode = cancelmode::tracks; + // } } } diff --git a/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py b/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py index 8437714485899..c3cd68641eea8 100644 --- a/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py +++ b/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py @@ -7,7 +7,7 @@ ) simGmtStage2Digis = cms.EDProducer('L1TMuonProducer', - barrelTFInput = cms.InputTag("simBmtfDigis", "BMTF"), + barrelTFInput = cms.InputTag("simKBmtfDigis", "BMTF"), overlapTFInput = cms.InputTag("simOmtfDigis", "OMTF"), forwardTFInput = cms.InputTag("simEmtfDigis", "EMTF"), #triggerTowerInput = cms.InputTag("simGmtCaloSumDigis", "TriggerTower2x2s"), @@ -15,7 +15,8 @@ autoBxRange = cms.bool(True), # if True the output BX range is calculated from the inputs and 'bxMin' and 'bxMax' are ignored bxMin = cms.int32(-2), bxMax = cms.int32(2), - autoCancelMode = cms.bool(False), # if True the cancel out methods are configured depending on the FW version number and 'emtfCancelMode' is ignored + autoCancelMode = cms.bool(False), # if True the cancel out methods are configured depending on the FW version number and 'bmtfCancelMode'&'emtfCancelMode' are ignored + bmtfCancelMode = cms.string("kftracks"), # 'tracks' or 'kftracks' (when using the Run-3 BMTF) emtfCancelMode = cms.string("coordinate") # 'tracks' or 'coordinate' ) diff --git a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc index 0a852a76d4da1..58bf1f6d194e9 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc @@ -57,7 +57,7 @@ namespace l1t { if (mode == cancelmode::coordinate) { getCoordinateCancelBits(coll2, coll1); // in case of a tie coll1 muon wins } else { - getTrackAddrCancelBits(coll1, coll2); + getTrackAddrCancelBits(mode, coll1, coll2); } coll1.clear(); @@ -92,7 +92,7 @@ namespace l1t { if (mode == cancelmode::coordinate) { getCoordinateCancelBits(coll1, coll2); } else { - getTrackAddrCancelBits(coll1, coll2); + getTrackAddrCancelBits(mode, coll1, coll2); } coll1.clear(); coll2.clear(); @@ -127,7 +127,7 @@ namespace l1t { if (mode == cancelmode::coordinate) { getCoordinateCancelBits(coll1, coll2); } else { - getTrackAddrCancelBits(coll1, coll2); + getTrackAddrCancelBits(mode, coll1, coll2); } coll1.clear(); coll2.clear(); @@ -194,86 +194,18 @@ namespace l1t { } } - void MicroGMTCancelOutUnit::getTrackAddrCancelBits(std::vector>& coll1, + void MicroGMTCancelOutUnit::getTrackAddrCancelBits(cancelmode mode, + std::vector>& coll1, std::vector>& coll2) { if (coll1.empty() || coll2.empty()) { return; } // Address based cancel out for BMTF if ((*coll1.begin())->trackFinderType() == tftype::bmtf && (*coll2.begin())->trackFinderType() == tftype::bmtf) { - for (auto mu_w1 = coll1.begin(); mu_w1 != coll1.end(); ++mu_w1) { - std::map trkAddr_w1 = (*mu_w1)->origin().trackAddress(); - int wheelNum_w1 = trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kWheelNum]; - int wheelSide_w1 = trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kWheelSide]; - std::vector stations_w1; - stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat1]); - stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat2]); - stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat3]); - stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat4]); - //std::cout << "Track address 1: wheelSide (1 == negative side): " << wheelSide_w1 << ", wheelNum: " << wheelNum_w1 << ", stations1234: 0x" << hex << stations_w1[0] << stations_w1[1] << stations_w1[2] << stations_w1[3] << dec << std::endl; - - for (auto mu_w2 = coll2.begin(); mu_w2 != coll2.end(); ++mu_w2) { - std::map trkAddr_w2 = (*mu_w2)->origin().trackAddress(); - int wheelNum_w2 = trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kWheelNum]; - int wheelSide_w2 = trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kWheelSide]; - std::vector stations_w2; - stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat1]); - stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat2]); - stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat3]); - stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat4]); - //std::cout << "Track address 2: wheelSide (1 == negative side): " << wheelSide_w2 << ", wheelNum: " << wheelNum_w2 << ", stations1234: 0x" << hex << stations_w2[0] << stations_w2[1] << stations_w2[2] << stations_w2[3] << dec << std::endl; - - int nMatchedStations = 0; - // search for duplicates in stations 2-4 - for (int i = 1; i < 4; ++i) { - if (wheelSide_w1 == wheelSide_w2) { // both tracks are on the same detector side - if (wheelNum_w1 == wheelNum_w2) { // both tracks have the same reference wheel - if ((stations_w1[i] == 0x0 && stations_w2[i] == 0x2) || - (stations_w1[i] == 0x1 && stations_w2[i] == 0x3) || - (stations_w1[i] == 0x4 && stations_w2[i] == 0x0) || - (stations_w1[i] == 0x5 && stations_w2[i] == 0x1) || - (stations_w1[i] == 0x8 && stations_w2[i] == 0xA) || - (stations_w1[i] == 0x9 && stations_w2[i] == 0xB) || - (stations_w1[i] == 0xC && stations_w2[i] == 0x8) || - (stations_w1[i] == 0xD && stations_w2[i] == 0x9)) { - ++nMatchedStations; - } - } else if (wheelNum_w1 == wheelNum_w2 - 1) { // track 2 is one wheel higher than track 1 - if ((stations_w1[i] == 0x0 && stations_w2[i] == 0xA) || - (stations_w1[i] == 0x1 && stations_w2[i] == 0xB) || - (stations_w1[i] == 0x4 && stations_w2[i] == 0x8) || - (stations_w1[i] == 0x5 && stations_w2[i] == 0x9)) { - ++nMatchedStations; - } - } else if (wheelNum_w1 == wheelNum_w2 + 1) { // track 2 is one wheel lower than track 1 - if ((stations_w1[i] == 0x8 && stations_w2[i] == 0x2) || - (stations_w1[i] == 0x9 && stations_w2[i] == 0x3) || - (stations_w1[i] == 0xC && stations_w2[i] == 0x0) || - (stations_w1[i] == 0xD && stations_w2[i] == 0x1)) { - ++nMatchedStations; - } - } - } else { - if (wheelNum_w1 == 0 && - wheelNum_w2 == 0) { // both tracks are on either side of the central wheel (+0 and -0) - if ((stations_w1[i] == 0x8 && stations_w2[i] == 0xA) || - (stations_w1[i] == 0x9 && stations_w2[i] == 0xB) || - (stations_w1[i] == 0xC && stations_w2[i] == 0x8) || - (stations_w1[i] == 0xD && stations_w2[i] == 0x9)) { - ++nMatchedStations; - } - } - } - } - //std::cout << "Shared hits found: " << nMatchedStations << std::endl; - if (nMatchedStations > 0) { - if ((*mu_w1)->origin().hwQual() >= (*mu_w2)->origin().hwQual()) { - (*mu_w2)->setHwCancelBit(1); - } else { - (*mu_w1)->setHwCancelBit(1); - } - } - } + if (mode == cancelmode::tracks) { + getTrackAddrCancelBitsOrigBMTF(coll1, coll2); + } else if (mode == cancelmode::kftracks) { + getTrackAddrCancelBitsKfBMTF(coll1, coll2); } // Address based cancel out for EMTF } else if (((*coll1.begin())->trackFinderType() == tftype::emtf_pos && @@ -337,4 +269,166 @@ namespace l1t { } } + void MicroGMTCancelOutUnit::getTrackAddrCancelBitsOrigBMTF(std::vector>& coll1, + std::vector>& coll2) { + for (auto mu_w1 = coll1.begin(); mu_w1 != coll1.end(); ++mu_w1) { + std::map trkAddr_w1 = (*mu_w1)->origin().trackAddress(); + int wheelNum_w1 = trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kWheelNum]; + int wheelSide_w1 = trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kWheelSide]; + std::vector stations_w1; + stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat1]); + stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat2]); + stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat3]); + stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat4]); + //std::cout << "Track address 1: wheelSide (1 == negative side): " << wheelSide_w1 << ", wheelNum: " << wheelNum_w1 << ", stations1234: 0x" << hex << stations_w1[0] << stations_w1[1] << stations_w1[2] << stations_w1[3] << dec << std::endl; + + for (auto mu_w2 = coll2.begin(); mu_w2 != coll2.end(); ++mu_w2) { + std::map trkAddr_w2 = (*mu_w2)->origin().trackAddress(); + int wheelNum_w2 = trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kWheelNum]; + int wheelSide_w2 = trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kWheelSide]; + std::vector stations_w2; + stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat1]); + stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat2]); + stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat3]); + stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat4]); + //std::cout << "Track address 2: wheelSide (1 == negative side): " << wheelSide_w2 << ", wheelNum: " << wheelNum_w2 << ", stations1234: 0x" << hex << stations_w2[0] << stations_w2[1] << stations_w2[2] << stations_w2[3] << dec << std::endl; + + int nMatchedStations = 0; + // search for duplicates in stations 2-4 + for (int i = 1; i < 4; ++i) { + if (wheelSide_w1 == wheelSide_w2) { // both tracks are on the same detector side + if (wheelNum_w1 == wheelNum_w2) { // both tracks have the same reference wheel + if ((stations_w1[i] == 0x0 && stations_w2[i] == 0x2) || + (stations_w1[i] == 0x1 && stations_w2[i] == 0x3) || + (stations_w1[i] == 0x4 && stations_w2[i] == 0x0) || + (stations_w1[i] == 0x5 && stations_w2[i] == 0x1) || + (stations_w1[i] == 0x8 && stations_w2[i] == 0xA) || + (stations_w1[i] == 0x9 && stations_w2[i] == 0xB) || + (stations_w1[i] == 0xC && stations_w2[i] == 0x8) || + (stations_w1[i] == 0xD && stations_w2[i] == 0x9)) { + ++nMatchedStations; + } + } else if (wheelNum_w1 == wheelNum_w2 - 1) { // track 2 is one wheel higher than track 1 + if ((stations_w1[i] == 0x0 && stations_w2[i] == 0xA) || + (stations_w1[i] == 0x1 && stations_w2[i] == 0xB) || + (stations_w1[i] == 0x4 && stations_w2[i] == 0x8) || + (stations_w1[i] == 0x5 && stations_w2[i] == 0x9)) { + ++nMatchedStations; + } + } else if (wheelNum_w1 == wheelNum_w2 + 1) { // track 2 is one wheel lower than track 1 + if ((stations_w1[i] == 0x8 && stations_w2[i] == 0x2) || + (stations_w1[i] == 0x9 && stations_w2[i] == 0x3) || + (stations_w1[i] == 0xC && stations_w2[i] == 0x0) || + (stations_w1[i] == 0xD && stations_w2[i] == 0x1)) { + ++nMatchedStations; + } + } + } else { + if (wheelNum_w1 == 0 && + wheelNum_w2 == 0) { // both tracks are on either side of the central wheel (+0 and -0) + if ((stations_w1[i] == 0x8 && stations_w2[i] == 0xA) || + (stations_w1[i] == 0x9 && stations_w2[i] == 0xB) || + (stations_w1[i] == 0xC && stations_w2[i] == 0x8) || + (stations_w1[i] == 0xD && stations_w2[i] == 0x9)) { + ++nMatchedStations; + } + } + } + } + //std::cout << "Shared hits found: " << nMatchedStations << std::endl; + if (nMatchedStations > 0) { + if ((*mu_w1)->origin().hwQual() >= (*mu_w2)->origin().hwQual()) { + (*mu_w2)->setHwCancelBit(1); + } else { + (*mu_w1)->setHwCancelBit(1); + } + } + } + } + } + + void MicroGMTCancelOutUnit::getTrackAddrCancelBitsKfBMTF(std::vector>& coll1, + std::vector>& coll2) { + for (auto mu_w1 = coll1.begin(); mu_w1 != coll1.end(); ++mu_w1) { + std::map trkAddr_w1 = (*mu_w1)->origin().trackAddress(); + int wheelNum_w1 = trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kWheelNum]; + int wheelSide_w1 = trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kWheelSide]; + std::vector stations_w1; + stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat1]); + stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat2]); + stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat3]); + stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat4]); + //std::cout << "Track address 1: wheelSide (1 == negative side): " << wheelSide_w1 << ", wheelNum: " << wheelNum_w1 << ", stations1234: 0x" << hex << stations_w1[0] << stations_w1[1] << stations_w1[2] << stations_w1[3] << dec << std::endl; + + for (auto mu_w2 = coll2.begin(); mu_w2 != coll2.end(); ++mu_w2) { + std::map trkAddr_w2 = (*mu_w2)->origin().trackAddress(); + int wheelNum_w2 = trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kWheelNum]; + int wheelSide_w2 = trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kWheelSide]; + std::vector stations_w2; + stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat1]); + stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat2]); + stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat3]); + stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat4]); + //std::cout << "Track address 2: wheelSide (1 == negative side): " << wheelSide_w2 << ", wheelNum: " << wheelNum_w2 << ", stations1234: 0x" << hex << stations_w2[0] << stations_w2[1] << stations_w2[2] << stations_w2[3] << dec << std::endl; + + int nMatchedStations = 0; + // search for duplicates in stations 2-4 + for (int i = 1; i < 4; ++i) { + if (wheelSide_w1 == wheelSide_w2) { // both tracks are on the same detector side + if (wheelNum_w1 == wheelNum_w2) { // both tracks have the same reference wheel + if ((stations_w1[i] == 0x2 && stations_w2[i] == 0x0) || + (stations_w1[i] == 0x3 && stations_w2[i] == 0x1) || + (stations_w1[i] == 0x0 && stations_w2[i] == 0x4) || + (stations_w1[i] == 0x1 && stations_w2[i] == 0x5) || + (stations_w1[i] == 0xA && stations_w2[i] == 0x8) || + (stations_w1[i] == 0xB && stations_w2[i] == 0x9) || + (stations_w1[i] == 0x8 && stations_w2[i] == 0xC) || + (stations_w1[i] == 0x9 && stations_w2[i] == 0xD)) { + ++nMatchedStations; + } + } else if (wheelNum_w1 == wheelNum_w2 - 1) { // track 2 is one wheel higher than track 1 + if ((stations_w1[i] == 0xA && stations_w2[i] == 0x0) || + (stations_w1[i] == 0xB && stations_w2[i] == 0x1) || + (stations_w1[i] == 0x8 && stations_w2[i] == 0x4) || + (stations_w1[i] == 0x9 && stations_w2[i] == 0x5)) { + ++nMatchedStations; + } + } else if (wheelNum_w1 == wheelNum_w2 + 1) { // track 2 is one wheel lower than track 1 + if ((stations_w1[i] == 0x2 && stations_w2[i] == 0x8) || + (stations_w1[i] == 0x3 && stations_w2[i] == 0x9) || + (stations_w1[i] == 0x0 && stations_w2[i] == 0xC) || + (stations_w1[i] == 0x1 && stations_w2[i] == 0xD)) { + ++nMatchedStations; + } + } + } else { // If one muon in 0+ and one muon in 0- (0+ and 0- are physically the same wheel), however wheel 0 is not split in kalman algorithm + if (wheelNum_w1 == 0 && wheelNum_w2 == 1) { + if ((stations_w1[i] == 0xA && stations_w2[1] == 0x0) || + (stations_w1[i] == 0xB && stations_w2[1] == 0x1) || + (stations_w1[i] == 0x8 && stations_w2[1] == 0x4) || + (stations_w1[i] == 0x9 && stations_w2[1] == 0x5)) { + ++nMatchedStations; + } + } else if (wheelNum_w1 == 1 && wheelNum_w2 == 0) { + if ((stations_w1[i] == 0x2 && stations_w2[1] == 0x8) || + (stations_w1[i] == 0x3 && stations_w2[1] == 0x9) || + (stations_w1[i] == 0x0 && stations_w2[1] == 0xC) || + (stations_w1[i] == 0x1 && stations_w2[1] == 0xD)) { + ++nMatchedStations; + } + } + } + } + //std::cout << "Shared hits found: " << nMatchedStations << std::endl; + if (nMatchedStations > 0) { + if ((*mu_w1)->origin().hwQual() >= (*mu_w2)->origin().hwQual()) { + (*mu_w2)->setHwCancelBit(1); + } else { + (*mu_w1)->setHwCancelBit(1); + } + } + } + } + } + } // namespace l1t From ef8d21da20cf7c0e45649a27fd152328081d4ed5 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Tue, 25 Feb 2020 11:13:51 +0100 Subject: [PATCH 085/778] Exposing displaced quantities in internal GMT muon --- L1Trigger/L1TMuon/interface/GMTInternalMuon.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/L1Trigger/L1TMuon/interface/GMTInternalMuon.h b/L1Trigger/L1TMuon/interface/GMTInternalMuon.h index a3bad4f600573..f56139232570f 100644 --- a/L1Trigger/L1TMuon/interface/GMTInternalMuon.h +++ b/L1Trigger/L1TMuon/interface/GMTInternalMuon.h @@ -43,6 +43,8 @@ namespace l1t { const RegionalMuonCand& origin() const { return m_regional; }; inline const int hwPt() const { return m_regional.hwPt(); }; + inline const int hwPtUnconstrained() const { return m_regional.hwPt2(); }; + inline const int hwDXY() const { return m_regional.hwDXY(); }; inline const int hwLocalPhi() const { return m_regional.hwPhi(); }; inline const int hwEta() const { return m_regional.hwEta(); }; inline const int hwSign() const { return m_regional.hwSign(); }; From 119a2afff71c0679b6d5d8938d461bae4991cc82 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Tue, 25 Feb 2020 11:37:12 +0100 Subject: [PATCH 086/778] Fixed equality operator for regional muon cand --- DataFormats/L1TMuon/src/RegionalMuonCand.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DataFormats/L1TMuon/src/RegionalMuonCand.cc b/DataFormats/L1TMuon/src/RegionalMuonCand.cc index 51e85c3a9613a..856fadc8d18fb 100644 --- a/DataFormats/L1TMuon/src/RegionalMuonCand.cc +++ b/DataFormats/L1TMuon/src/RegionalMuonCand.cc @@ -25,9 +25,10 @@ namespace l1t { } bool RegionalMuonCand::operator==(const RegionalMuonCand& rhs) const { - return m_hwPt == rhs.hwPt() && m_hwPhi == rhs.hwPhi() && m_hwEta == rhs.hwEta() && m_hwHF == (bool)rhs.hwHF() && - m_hwSign == rhs.hwSign() && m_hwSignValid == rhs.hwSignValid() && m_hwQuality == rhs.hwQual() && - m_link == rhs.link() && m_processor == rhs.processor() && m_trackFinder == rhs.trackFinderType() && + return m_hwPt == rhs.hwPt() && m_hwPt2 == rhs.hwPt2() && m_hwDXY == rhs.hwDXY() && m_hwPhi == rhs.hwPhi() && + m_hwEta == rhs.hwEta() && m_hwHF == (bool)rhs.hwHF() && m_hwSign == rhs.hwSign() && + m_hwSignValid == rhs.hwSignValid() && m_hwQuality == rhs.hwQual() && m_link == rhs.link() && + m_processor == rhs.processor() && m_trackFinder == rhs.trackFinderType() && m_trackAddress == rhs.trackAddress(); } From fd70b04c884029c4ec01a9adba2475105abc4296 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Tue, 25 Feb 2020 12:03:08 +0100 Subject: [PATCH 087/778] Including displacement in muon data format --- DataFormats/L1Trigger/interface/Muon.h | 20 +++++++++++++++++--- DataFormats/L1Trigger/src/Muon.cc | 23 +++++++++++++++++------ DataFormats/L1Trigger/src/classes_def.xml | 3 ++- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/DataFormats/L1Trigger/interface/Muon.h b/DataFormats/L1Trigger/interface/Muon.h index d5a5227539202..715835cf109d8 100644 --- a/DataFormats/L1Trigger/interface/Muon.h +++ b/DataFormats/L1Trigger/interface/Muon.h @@ -40,7 +40,9 @@ namespace l1t { int hwEtaAtVtx = 0, int hwPhiAtVtx = 0, double etaAtVtx = 0., - double phiAtVtx = 0.); + double phiAtVtx = 0., + int ptUnconstrained = 0, + int dXY = 0); Muon(const PolarLorentzVector& p4, int pt = 0, @@ -60,9 +62,11 @@ namespace l1t { int hwEtaAtVtx = 0, int hwPhiAtVtx = 0, double etaAtVtx = 0., - double phiAtVtx = 0.); + double phiAtVtx = 0., + int ptUnconstrained = 0, + int dXY = 0); - ~Muon() override; + ~Muon(); // set values inline void setHwCharge(int charge) { hwCharge_ = charge; }; @@ -80,6 +84,9 @@ namespace l1t { inline void setHwDEtaExtra(int dEta) { hwDEtaExtra_ = dEta; }; inline void setHwRank(int rank) { hwRank_ = rank; }; + inline void setHwPtUnconstrained(int hwPtUnconstrained) { hwPtUnconstrained_ = hwPtUnconstrained; }; + inline void setHwDXY(int hwDXY) { hwDXY_ = hwDXY; }; + inline void setDebug(bool debug) { debug_ = debug; }; // methods to retrieve values @@ -98,6 +105,9 @@ namespace l1t { inline int hwDEtaExtra() const { return hwDEtaExtra_; }; inline int hwRank() const { return hwRank_; }; + inline int hwPtUnconstrained() const { return hwPtUnconstrained_; }; + inline int hwDXY() const { return hwDXY_; }; + inline bool debug() const { return debug_; }; virtual bool operator==(const l1t::Muon& rhs) const; @@ -122,6 +132,10 @@ namespace l1t { int hwPhiAtVtx_; double etaAtVtx_; double phiAtVtx_; + + // displacement information + int hwPtUnconstrained_; + int hwDXY_; }; } // namespace l1t diff --git a/DataFormats/L1Trigger/src/Muon.cc b/DataFormats/L1Trigger/src/Muon.cc index b7d946aa46495..6a4471807ce21 100644 --- a/DataFormats/L1Trigger/src/Muon.cc +++ b/DataFormats/L1Trigger/src/Muon.cc @@ -14,7 +14,9 @@ l1t::Muon::Muon() hwEtaAtVtx_(0), hwPhiAtVtx_(0), etaAtVtx_(0.), - phiAtVtx_(0.) {} + phiAtVtx_(0.), + hwPtUnconstrained_(0), + hwDXY_(0) {} l1t::Muon::Muon(const LorentzVector& p4, int pt, @@ -34,7 +36,9 @@ l1t::Muon::Muon(const LorentzVector& p4, int hwEtaAtVtx, int hwPhiAtVtx, double etaAtVtx, - double phiAtVtx) + double phiAtVtx, + int ptUnconstrained, + int dXY) : L1Candidate(p4, pt, eta, phi, qual, iso), hwCharge_(charge), hwChargeValid_(chargeValid), @@ -48,7 +52,9 @@ l1t::Muon::Muon(const LorentzVector& p4, hwEtaAtVtx_(hwEtaAtVtx), hwPhiAtVtx_(hwPhiAtVtx), etaAtVtx_(etaAtVtx), - phiAtVtx_(phiAtVtx) {} + phiAtVtx_(phiAtVtx), + hwPtUnconstrained_(ptUnconstrained), + hwDXY_(dXY) {} l1t::Muon::Muon(const PolarLorentzVector& p4, int pt, @@ -68,7 +74,9 @@ l1t::Muon::Muon(const PolarLorentzVector& p4, int hwEtaAtVtx, int hwPhiAtVtx, double etaAtVtx, - double phiAtVtx) + double phiAtVtx, + int ptUnconstrained, + int dXY) : L1Candidate(p4, pt, eta, phi, qual, iso), hwCharge_(charge), hwChargeValid_(chargeValid), @@ -82,12 +90,15 @@ l1t::Muon::Muon(const PolarLorentzVector& p4, hwEtaAtVtx_(hwEtaAtVtx), hwPhiAtVtx_(hwPhiAtVtx), etaAtVtx_(etaAtVtx), - phiAtVtx_(phiAtVtx) {} + phiAtVtx_(phiAtVtx), + hwPtUnconstrained_(ptUnconstrained), + hwDXY_(dXY) {} l1t::Muon::~Muon() {} bool l1t::Muon::operator==(const l1t::Muon& rhs) const { return l1t::L1Candidate::operator==(static_cast(rhs)) && hwCharge_ == rhs.hwCharge() && hwChargeValid_ == rhs.hwChargeValid() && tfMuonIndex_ == rhs.tfMuonIndex() && - hwEtaAtVtx_ == rhs.hwEtaAtVtx() && hwPhiAtVtx_ == rhs.hwPhiAtVtx(); + hwEtaAtVtx_ == rhs.hwEtaAtVtx() && hwPhiAtVtx_ == rhs.hwPhiAtVtx() && + hwPtUnconstrained_ == rhs.hwPtUnconstrained() && hwDXY_ == rhs.hwDXY(); } diff --git a/DataFormats/L1Trigger/src/classes_def.xml b/DataFormats/L1Trigger/src/classes_def.xml index 176410f97ba06..d91e87bba66d1 100644 --- a/DataFormats/L1Trigger/src/classes_def.xml +++ b/DataFormats/L1Trigger/src/classes_def.xml @@ -80,7 +80,8 @@ - + + From a82ca0f34964c1d7d3733229a225189fb4b53112 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Tue, 25 Feb 2020 15:04:18 +0100 Subject: [PATCH 088/778] Forwarding muon displacement to Global Trigger --- L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc index 8ad5c409a06bd..70eccc916656e 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc @@ -345,17 +345,18 @@ void L1TMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) mu->hwIsoSum(), mu->hwDPhi(), mu->hwDEta(), - mu->hwRank()}; + mu->hwRank(), + MicroGMTConfiguration::calcMuonHwEtaExtra(outMu), + MicroGMTConfiguration::calcMuonHwPhiExtra(outMu), // set the coordinates at the vertex + MicroGMTConfiguration::calcMuonEtaExtra(outMu), + MicroGMTConfiguration::calcMuonPhiExtra(outMu), // set the coordinates at the vertex + mu->hwPtUnconstrained(), + mu->hwDXY()}; if (mu->hwSignValid()) { outMu.setCharge(1 - 2 * mu->hwSign()); } else { outMu.setCharge(0); } - // set the coordinates at the vertex - outMu.setHwEtaAtVtx(MicroGMTConfiguration::calcMuonHwEtaExtra(outMu)); - outMu.setHwPhiAtVtx(MicroGMTConfiguration::calcMuonHwPhiExtra(outMu)); - outMu.setEtaAtVtx(MicroGMTConfiguration::calcMuonEtaExtra(outMu)); - outMu.setPhiAtVtx(MicroGMTConfiguration::calcMuonPhiExtra(outMu)); m_debugOut << mu->hwCaloPhi() << " " << mu->hwCaloEta() << std::endl; outMuons->push_back(bx, outMu); } @@ -571,7 +572,7 @@ void L1TMuonProducer::beginRun(edm::Run const& run, edm::EventSetup const& iSetu m_cancelOutUnit.initialise(microGMTParamsHelper.get()); if (m_autoCancelMode) { - if (microGMTParamsHelper->fwVersion() >= 0x5010000) { + if (microGMTParamsHelper->fwVersion() >= 0x6000000) { m_bmtfCancelMode = cancelmode::kftracks; } // TODO: No decision yet on when to use EMTF track addresses for cancel-out. From 5197b0b962c9f40f3892d7e074420d918fdf5457 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 16 May 2019 15:53:36 +0200 Subject: [PATCH 089/778] Added raw track addresses to L1UpgradeTfMuon branch of L1TNtuples The original field with track addresses was filled with incorrect or incomplete values for most TFs. Using static function from RegionalMuonRawDigiTranslator that I factored out in order to generate the raw track address. --- .../interface/RegionalMuonRawDigiTranslator.h | 1 + .../src/RegionalMuonRawDigiTranslator.cc | 26 ++++++++++++------- .../L1AnalysisL1UpgradeTfMuonDataFormat.h | 2 ++ .../src/L1AnalysisL1UpgradeTfMuon.cc | 24 +++++++++++------ 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h index bf59aa4a15083..fb5a240f9829c 100644 --- a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h @@ -10,6 +10,7 @@ namespace l1t { static void fillRegionalMuonCand(RegionalMuonCand&, uint64_t, int, tftype); static void generatePackedDataWords(const RegionalMuonCand&, uint32_t&, uint32_t&); static uint64_t generate64bitDataWord(const RegionalMuonCand&); + static int generateRawTrkAddress(const RegionalMuonCand&); static const unsigned ptMask_ = 0x1FF; static const unsigned ptShift_ = 0; diff --git a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc index e3681954067d5..f9b27a6ba5798 100644 --- a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc @@ -102,6 +102,21 @@ void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalM (mu.hwPhi() < 0) << phiSignShift_; // generate the raw track address from the subaddresses + int rawTrkAddr = generateRawTrkAddress(mu); + + raw_data_32_63 = mu.hwSign() << signShift_ | mu.hwSignValid() << signValidShift_ | + (rawTrkAddr & trackAddressMask_) << trackAddressShift_; +} + +uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord(const RegionalMuonCand& mu) { + uint32_t lsw; + uint32_t msw; + + generatePackedDataWords(mu, lsw, msw); + return (((uint64_t)msw) << 32) + lsw; +} + +int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(const RegionalMuonCand& mu) { int tf = mu.trackFinderType(); int rawTrkAddr = 0; if (tf == bmtf) { @@ -168,14 +183,5 @@ void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalM rawTrkAddr = mu.trackAddress().at(0); } - raw_data_32_63 = mu.hwSign() << signShift_ | mu.hwSignValid() << signValidShift_ | - (rawTrkAddr & trackAddressMask_) << trackAddressShift_; -} - -uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord(const RegionalMuonCand& mu) { - uint32_t lsw; - uint32_t msw; - - generatePackedDataWords(mu, lsw, msw); - return (((uint64_t)msw) << 32) + lsw; + return rawTrkAddr; } diff --git a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h index a17065400a8aa..4e2f5e4c5c783 100644 --- a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h +++ b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h @@ -1,6 +1,7 @@ #ifndef __L1Analysis_L1AnalysisL1UpgradeTfMuonDataFormat_H__ #define __L1Analysis_L1AnalysisL1UpgradeTfMuonDataFormat_H__ +#include "L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h" #include namespace L1Analysis { @@ -41,6 +42,7 @@ namespace L1Analysis { std::vector tfMuonBx; std::vector tfMuonWh; std::vector tfMuonTrAdd; + std::vector tfMuonRawTrAdd; }; } // namespace L1Analysis #endif diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc index db7d9e6805143..3e088991ffc35 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc @@ -24,14 +24,22 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrackFinderType.push_back(it->trackFinderType()); l1upgradetfmuon_.tfMuonHwHF.push_back(it->hwHF()); l1upgradetfmuon_.tfMuonBx.push_back(ibx); - std::map trAdd; - trAdd = it->trackAddress(); - int wheel = pow(-1, trAdd[0]) * trAdd[1]; - l1upgradetfmuon_.tfMuonWh.push_back(wheel); - l1upgradetfmuon_.tfMuonTrAdd.push_back(trAdd[2]); - l1upgradetfmuon_.tfMuonTrAdd.push_back(trAdd[3]); - l1upgradetfmuon_.tfMuonTrAdd.push_back(trAdd[4]); - l1upgradetfmuon_.tfMuonTrAdd.push_back(trAdd[5]); + if (it->trackFinderType() == l1t::tftype::bmtf) { + int detSide = it->trackSubAddress(l1t::RegionalMuonCand::kWheelSide); + int wheelNum = it->trackSubAddress(l1t::RegionalMuonCand::kWheelNum); + int stat1 = it->trackSubAddress(l1t::RegionalMuonCand::kStat1); + int stat2 = it->trackSubAddress(l1t::RegionalMuonCand::kStat2); + int stat3 = it->trackSubAddress(l1t::RegionalMuonCand::kStat3); + int stat4 = it->trackSubAddress(l1t::RegionalMuonCand::kStat4); + + int wheel = pow(-1, detSide) * wheelNum; + l1upgradetfmuon_.tfMuonWh.push_back(wheel); + l1upgradetfmuon_.tfMuonTrAdd.push_back(stat1); + l1upgradetfmuon_.tfMuonTrAdd.push_back(stat2); + l1upgradetfmuon_.tfMuonTrAdd.push_back(stat3); + l1upgradetfmuon_.tfMuonTrAdd.push_back(stat4); + } + l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it)); l1upgradetfmuon_.nTfMuons++; } From 767973a47148c1839bc446cc74db361c1b924599 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 16 May 2019 15:53:36 +0200 Subject: [PATCH 090/778] Put L1 TF track addresses into map in L1TNtuple May make the interface to get them more clear. --- .../L1AnalysisL1UpgradeTfMuonDataFormat.h | 6 ++++- .../src/L1AnalysisL1UpgradeTfMuon.cc | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h index 4e2f5e4c5c783..cd31418cd46ca 100644 --- a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h +++ b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h @@ -3,6 +3,7 @@ #include "L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h" #include +#include namespace L1Analysis { struct L1AnalysisL1UpgradeTfMuonDataFormat { @@ -25,6 +26,8 @@ namespace L1Analysis { tfMuonBx.clear(); tfMuonWh.clear(); tfMuonTrAdd.clear(); + tfMuonDecodedTrAdd.clear(); + tfMuonRawTrAdd.clear(); } unsigned short int nTfMuons; @@ -42,7 +45,8 @@ namespace L1Analysis { std::vector tfMuonBx; std::vector tfMuonWh; std::vector tfMuonTrAdd; - std::vector tfMuonRawTrAdd; + std::vector> tfMuonDecodedTrAdd; + std::vector tfMuonRawTrAdd; }; } // namespace L1Analysis #endif diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc index 3e088991ffc35..f4db52b64ee19 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc @@ -24,6 +24,7 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrackFinderType.push_back(it->trackFinderType()); l1upgradetfmuon_.tfMuonHwHF.push_back(it->hwHF()); l1upgradetfmuon_.tfMuonBx.push_back(ibx); + std::map decoded_track_address; if (it->trackFinderType() == l1t::tftype::bmtf) { int detSide = it->trackSubAddress(l1t::RegionalMuonCand::kWheelSide); int wheelNum = it->trackSubAddress(l1t::RegionalMuonCand::kWheelNum); @@ -38,7 +39,28 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrAdd.push_back(stat2); l1upgradetfmuon_.tfMuonTrAdd.push_back(stat3); l1upgradetfmuon_.tfMuonTrAdd.push_back(stat4); + + decoded_track_address["wheel"] = wheel; + decoded_track_address["station1"] = stat1; + decoded_track_address["station2"] = stat2; + decoded_track_address["station3"] = stat3; + decoded_track_address["station4"] = stat4; + } else if (it->trackFinderType() == l1t::omtf_neg || it->trackFinderType() == l1t::omtf_pos) { + decoded_track_address["kLayers"] = it->trackSubAddress(l1t::RegionalMuonCand::kLayers); + decoded_track_address["kWeight"] = it->trackSubAddress(l1t::RegionalMuonCand::kWeight); + } else if (it->trackFinderType() == l1t::emtf_neg || it->trackFinderType() == l1t::emtf_pos) { + decoded_track_address["kME1Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME1Seg); + decoded_track_address["kME1Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME1Ch); + decoded_track_address["kME2Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME2Seg); + decoded_track_address["kME2Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME2Ch); + decoded_track_address["kME3Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME3Seg); + decoded_track_address["kME3Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME3Ch); + decoded_track_address["kME4Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME4Seg); + decoded_track_address["kME4Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME4Ch); + decoded_track_address["kTrkNum"] = it->trackSubAddress(l1t::RegionalMuonCand::kTrkNum); + decoded_track_address["kBX"] = it->trackSubAddress(l1t::RegionalMuonCand::kBX); } + l1upgradetfmuon_.tfMuonDecodedTrAdd.push_back(decoded_track_address); l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it)); l1upgradetfmuon_.nTfMuons++; From e99817402727e9969c6b86708c330d94e035a5f6 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 23 May 2019 19:41:26 +0200 Subject: [PATCH 091/778] Renamed tfMuonRawTrAdd to tfMuonHwTrAdd This makes us a bit more consistent with the other fields. --- .../interface/L1AnalysisL1UpgradeTfMuonDataFormat.h | 4 ++-- L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h index cd31418cd46ca..68966443187ae 100644 --- a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h +++ b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h @@ -27,7 +27,7 @@ namespace L1Analysis { tfMuonWh.clear(); tfMuonTrAdd.clear(); tfMuonDecodedTrAdd.clear(); - tfMuonRawTrAdd.clear(); + tfMuonHwTrAdd.clear(); } unsigned short int nTfMuons; @@ -46,7 +46,7 @@ namespace L1Analysis { std::vector tfMuonWh; std::vector tfMuonTrAdd; std::vector> tfMuonDecodedTrAdd; - std::vector tfMuonRawTrAdd; + std::vector tfMuonHwTrAdd; }; } // namespace L1Analysis #endif diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc index f4db52b64ee19..4bb09bebb66d1 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc @@ -61,7 +61,7 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan decoded_track_address["kBX"] = it->trackSubAddress(l1t::RegionalMuonCand::kBX); } l1upgradetfmuon_.tfMuonDecodedTrAdd.push_back(decoded_track_address); - l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it)); + l1upgradetfmuon_.tfMuonHwTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it)); l1upgradetfmuon_.nTfMuons++; } From ed93678bf58c532dc40526ae650c30fc6d7281ee Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 23 May 2019 19:48:30 +0200 Subject: [PATCH 092/778] Raw track address in L1TNtuple fits into short --- .../L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h index 68966443187ae..eb1105d2ff8b3 100644 --- a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h +++ b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h @@ -46,7 +46,7 @@ namespace L1Analysis { std::vector tfMuonWh; std::vector tfMuonTrAdd; std::vector> tfMuonDecodedTrAdd; - std::vector tfMuonHwTrAdd; + std::vector tfMuonHwTrAdd; }; } // namespace L1Analysis #endif From af2e1e013cc25aab731a56879777ec4d4ba7bf4e Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 5 Mar 2020 15:37:05 +0100 Subject: [PATCH 093/778] Unpackers for BMTF, uGMT, and uGT adapted for Kalman muons --- .../BMTFUnpackerOutput.cc | 9 +- .../implementations_stage2/GMTSetup.cc | 12 +- .../IntermediateMuonUnpacker.cc | 3 +- .../implementations_stage2/MuonUnpacker.cc | 13 +- .../RegionalMuonGMTUnpacker.cc | 4 +- .../RegionalMuonGMTUnpacker.h | 3 + .../L1TMuon/interface/MuonRawDigiTranslator.h | 54 ++++--- .../interface/RegionalMuonRawDigiTranslator.h | 107 ++++++------- .../L1TMuon/src/MuonRawDigiTranslator.cc | 144 ++++++++++++++---- .../src/RegionalMuonRawDigiTranslator.cc | 32 ++-- 10 files changed, 255 insertions(+), 126 deletions(-) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc index 8f6126fd14d46..8440806d63123 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc @@ -65,19 +65,18 @@ namespace l1t { } RegionalMuonCand muCand; - RegionalMuonRawDigiTranslator::fillRegionalMuonCand(muCand, raw_first, raw_secnd, processor, tftype::bmtf); + RegionalMuonRawDigiTranslator::fillRegionalMuonCand( + muCand, raw_first, raw_secnd, processor, tftype::bmtf, isKalman); if (muCand.hwQual() == 0) continue; - muCand.setLink(48 + processor); //the link corresponds to the uGMT input if (isKalman) { - muCand.setHwPt2((raw_secnd >> 23) & 0xFF); - muCand.setHwDXY((raw_secnd >> 2) & 0x3); LogDebug("L1T") << "Pt = " << muCand.hwPt() << " eta: " << muCand.hwEta() << " phi: " << muCand.hwPhi() << " diplacedPt = " << muCand.hwPt2(); - } else + } else { LogDebug("L1T") << "Pt = " << muCand.hwPt() << " eta: " << muCand.hwEta() << " phi: " << muCand.hwPhi(); + } res->push_back(ibx, muCand); diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc index 7a747cb8a0aec..56ef3d0cdcab7 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc @@ -1,9 +1,11 @@ +#include "FWCore/Framework/interface/stream/EDProducerBase.h" #include "FWCore/Utilities/interface/InputTag.h" #include "EventFilter/L1TRawToDigi/plugins/PackerFactory.h" #include "EventFilter/L1TRawToDigi/plugins/PackingSetupFactory.h" #include "EventFilter/L1TRawToDigi/plugins/UnpackerFactory.h" +#include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.h" @@ -71,9 +73,15 @@ namespace l1t { // MP7 input link numbers are represented by even numbers starting from 0 (iLink=link*2) // input muons on links 36-71 - auto gmt_in_unp = UnpackerFactory::get()->make("stage2::RegionalMuonGMTUnpacker"); - for (int iLink = 72; iLink < 144; iLink += 2) + auto gmt_in_unp = static_pointer_cast( + UnpackerFactory::get()->make("stage2::RegionalMuonGMTUnpacker")); + if (fw >= 0x6000000) { + gmt_in_unp->setKalmanAlgoTrue(); + } + + for (int iLink = 72; iLink < 144; iLink += 2) { res[iLink] = gmt_in_unp; + } // MP7 output link numbers are represented by odd numbers (oLink=link*2+1) // internal muons on links 24-31 diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.cc index c93c01ed3a809..949ccfea8378a 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.cc @@ -120,7 +120,8 @@ namespace l1t { // The intermediate muons of the uGMT (FED number 1402) do not // have coordinates estimated at the vertex in the RAW data. // The corresponding bits are set to zero. - MuonRawDigiTranslator::fillMuon(mu, raw_data_00_31, raw_data_32_63, 1402, getAlgoVersion()); + MuonRawDigiTranslator::fillMuon( + mu, 0, raw_data_00_31, raw_data_32_63, 1402, getAlgoVersion(), nWord / 2, true); LogDebug("L1T") << "Mu" << nWord / 2 << ": eta " << mu.hwEta() << " phi " << mu.hwPhi() << " pT " << mu.hwPt() << " iso " << mu.hwIso() << " qual " << mu.hwQual() << " charge " << mu.hwCharge() diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.cc index dacd7194f6680..885126b8b343a 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.cc @@ -54,13 +54,15 @@ namespace l1t { } void MuonUnpacker::unpackBx(int bx, const std::vector& payload, unsigned int startIdx) { - unsigned int i = startIdx; + unsigned int i = startIdx + 2; // Only words 2-5 are "standard" muon words. // Check if there are enough words left in the payload - if (i + nWords_ <= payload.size()) { - for (unsigned nWord = 0; nWord < nWords_; nWord += 2) { + if (startIdx + nWords_ <= payload.size()) { + for (unsigned nWord = 2; nWord < nWords_; nWord += 2) { // Only words 2-5 are "standard" muon words. + uint32_t raw_data_spare = payload[startIdx + 1]; uint32_t raw_data_00_31 = payload[i++]; uint32_t raw_data_32_63 = payload[i++]; - LogDebug("L1T") << "raw_data_00_31 = 0x" << hex << raw_data_00_31 << " raw_data_32_63 = 0x" << raw_data_32_63; + LogDebug("L1T") << "raw_data_spare = 0x" << hex << raw_data_spare << "raw_data_00_31 = 0x" << raw_data_00_31 + << " raw_data_32_63 = 0x" << raw_data_32_63; // skip empty muons (hwPt == 0) if (((raw_data_00_31 >> l1t::MuonRawDigiTranslator::ptShift_) & l1t::MuonRawDigiTranslator::ptMask_) == 0) { LogDebug("L1T") << "Muon hwPt zero. Skip."; @@ -69,7 +71,8 @@ namespace l1t { Muon mu; - MuonRawDigiTranslator::fillMuon(mu, raw_data_00_31, raw_data_32_63, fed_, getAlgoVersion()); + MuonRawDigiTranslator::fillMuon( + mu, raw_data_spare, raw_data_00_31, raw_data_32_63, fed_, getAlgoVersion(), nWord / 2); LogDebug("L1T") << "Mu" << nWord / 2 << ": eta " << mu.hwEta() << " phi " << mu.hwPhi() << " pT " << mu.hwPt() << " iso " << mu.hwIso() << " qual " << mu.hwQual() << " charge " << mu.hwCharge() diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc index 224b32a4cc744..c513ad52fb3c5 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc @@ -102,11 +102,11 @@ namespace l1t { RegionalMuonCand mu; RegionalMuonRawDigiTranslator::fillRegionalMuonCand( - mu, raw_data_00_31, raw_data_32_63, processor, trackFinder); + mu, raw_data_00_31, raw_data_32_63, processor, trackFinder, isKalman_); LogDebug("L1T") << "Mu" << nWord / 2 << ": eta " << mu.hwEta() << " phi " << mu.hwPhi() << " pT " << mu.hwPt() << " qual " << mu.hwQual() << " sign " << mu.hwSign() << " sign valid " - << mu.hwSignValid(); + << mu.hwSignValid() << " unconstrained pT " << mu.hwPt2(); res->push_back(bx, mu); } diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h index 97374feef25f6..97e7683109526 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h @@ -10,10 +10,13 @@ namespace l1t { class RegionalMuonGMTUnpacker : public Unpacker { public: bool unpack(const Block& block, UnpackerCollections* coll) override; + void setKalmanAlgoTrue() { isKalman_ = true; } private: static constexpr unsigned nWords_ = 6; // every link transmits 6 words (3 muons) per bx static constexpr unsigned bxzs_enable_shift_ = 1; + + bool isKalman_{false}; }; } // namespace stage2 } // namespace l1t diff --git a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h index d9fb39fb1e3b5..eb4e60101695e 100644 --- a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h @@ -6,30 +6,44 @@ namespace l1t { class MuonRawDigiTranslator { public: - static void fillMuon(Muon&, uint32_t, uint32_t, int, unsigned int); - static void fillMuon(Muon&, uint64_t, int, unsigned int); + static void fillMuon(Muon&, uint32_t, uint32_t, uint32_t, int, unsigned int, int, bool); + static void fillMuon(Muon&, uint32_t, uint64_t, int, unsigned int, int, bool); + static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuonCoordinatesRun3( + Muon& mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx); + static void fillIntermediateMuonCoordinatesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); static void generatePackedDataWords(const Muon&, uint32_t&, uint32_t&); static uint64_t generate64bitDataWord(const Muon&); static int calcHwEta(const uint32_t&, const unsigned, const unsigned); - static const unsigned ptMask_ = 0x1FF; - static const unsigned ptShift_ = 10; - static const unsigned qualMask_ = 0xF; - static const unsigned qualShift_ = 19; - static const unsigned absEtaMask_ = 0xFF; - static const unsigned absEtaShift_ = 21; - static const unsigned absEtaAtVtxShift_ = 23; - static const unsigned etaSignShift_ = 29; - static const unsigned etaAtVtxSignShift_ = 31; - static const unsigned phiMask_ = 0x3FF; - static const unsigned phiShift_ = 11; - static const unsigned phiAtVtxShift_ = 0; - static const unsigned chargeShift_ = 2; - static const unsigned chargeValidShift_ = 3; - static const unsigned tfMuonIndexMask_ = 0x7F; - static const unsigned tfMuonIndexShift_ = 4; - static const unsigned isoMask_ = 0x3; - static const unsigned isoShift_ = 0; + static constexpr unsigned ptMask_ = 0x1FF; + static constexpr unsigned ptShift_ = 10; + static constexpr unsigned qualMask_ = 0xF; + static constexpr unsigned qualShift_ = 19; + static constexpr unsigned absEtaMask_ = 0xFF; + static constexpr unsigned absEtaShift_ = 21; + static constexpr unsigned absEtaAtVtxShift_ = 23; + static constexpr unsigned etaSignShift_ = 29; + static constexpr unsigned etaAtVtxSignShift_ = 31; + static constexpr unsigned phiMask_ = 0x3FF; + static constexpr unsigned phiShift_ = 11; + static constexpr unsigned phiAtVtxShift_ = 0; + static constexpr unsigned chargeShift_ = 2; + static constexpr unsigned chargeValidShift_ = 3; + static constexpr unsigned tfMuonIndexMask_ = 0x7F; + static constexpr unsigned tfMuonIndexShift_ = 4; + static constexpr unsigned isoMask_ = 0x3; + static constexpr unsigned isoShift_ = 0; + static constexpr unsigned dxyMask_ = 0x3; + static constexpr unsigned dxyShift_ = 30; + static constexpr unsigned ptUnconstrainedMask_ = 0xFF; + static constexpr unsigned ptUnconstrainedShift_ = 21; + static constexpr unsigned ptUnconstrainedIntermedidateShift_ = 0; + static constexpr unsigned absEtaMu1Shift_ = 12; // For Run-3 + static constexpr unsigned etaMu1SignShift_ = 20; // For Run-3 + static constexpr unsigned absEtaMu2Shift_ = 21; // For Run-3 + static constexpr unsigned etaMu2SignShift_ = 29; // For Run-3 }; } // namespace l1t diff --git a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h index fb5a240f9829c..f09c2905411d0 100644 --- a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h @@ -6,64 +6,69 @@ namespace l1t { class RegionalMuonRawDigiTranslator { public: - static void fillRegionalMuonCand(RegionalMuonCand&, uint32_t, uint32_t, int, tftype); - static void fillRegionalMuonCand(RegionalMuonCand&, uint64_t, int, tftype); + static void fillRegionalMuonCand( + RegionalMuonCand& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKalman); + static void fillRegionalMuonCand(RegionalMuonCand& mu, uint64_t dataword, int proc, tftype tf, bool isKalman); static void generatePackedDataWords(const RegionalMuonCand&, uint32_t&, uint32_t&); static uint64_t generate64bitDataWord(const RegionalMuonCand&); static int generateRawTrkAddress(const RegionalMuonCand&); - static const unsigned ptMask_ = 0x1FF; - static const unsigned ptShift_ = 0; - static const unsigned qualMask_ = 0xF; - static const unsigned qualShift_ = 9; - static const unsigned absEtaMask_ = 0xFF; - static const unsigned absEtaShift_ = 13; - static const unsigned etaSignShift_ = 21; - static const unsigned hfMask_ = 0x1; - static const unsigned hfShift_ = 22; - static const unsigned absPhiMask_ = 0x7F; - static const unsigned absPhiShift_ = 23; - static const unsigned phiSignShift_ = 30; - static const unsigned signShift_ = 0; - static const unsigned signValidShift_ = 1; - static const unsigned trackAddressMask_ = 0x1FFFFFFF; - static const unsigned trackAddressShift_ = 2; + static constexpr unsigned ptMask_ = 0x1FF; + static constexpr unsigned ptShift_ = 0; + static constexpr unsigned qualMask_ = 0xF; + static constexpr unsigned qualShift_ = 9; + static constexpr unsigned absEtaMask_ = 0xFF; + static constexpr unsigned absEtaShift_ = 13; + static constexpr unsigned etaSignShift_ = 21; + static constexpr unsigned hfMask_ = 0x1; + static constexpr unsigned hfShift_ = 22; + static constexpr unsigned absPhiMask_ = 0x7F; + static constexpr unsigned absPhiShift_ = 23; + static constexpr unsigned phiSignShift_ = 30; + static constexpr unsigned signShift_ = 0; + static constexpr unsigned signValidShift_ = 1; + static constexpr unsigned dxyMask_ = 0x3; + static constexpr unsigned dxyShift_ = 18; + static constexpr unsigned ptUnconstrainedMask_ = 0xFF; + static constexpr unsigned ptUnconstrainedShift_ = 23; + static constexpr unsigned trackAddressMask_ = 0x1FFFFFFF; + static constexpr unsigned trackAddressShift_ = 2; // relative shifts within track address - static const unsigned bmtfTrAddrSegSelMask_ = 0xF; - static const unsigned bmtfTrAddrSegSelShift_ = 21; - static const unsigned bmtfTrAddrDetSideShift_ = 20; - static const unsigned bmtfTrAddrWheelMask_ = 0x3; - static const unsigned bmtfTrAddrWheelShift_ = 18; - static const unsigned bmtfTrAddrStat1Mask_ = 0x3; - static const unsigned bmtfTrAddrStat1Shift_ = 14; - static const unsigned bmtfTrAddrStat2Mask_ = 0xF; - static const unsigned bmtfTrAddrStat2Shift_ = 10; - static const unsigned bmtfTrAddrStat3Mask_ = 0xF; - static const unsigned bmtfTrAddrStat3Shift_ = 6; - static const unsigned bmtfTrAddrStat4Mask_ = 0xF; - static const unsigned bmtfTrAddrStat4Shift_ = 2; + static constexpr unsigned bmtfTrAddrSegSelMask_ = 0xF; + static constexpr unsigned bmtfTrAddrSegSelShift_ = 21; + static constexpr unsigned bmtfTrAddrDetSideShift_ = 20; + static constexpr unsigned bmtfTrAddrWheelMask_ = 0x3; + static constexpr unsigned bmtfTrAddrWheelShift_ = 18; + static constexpr unsigned bmtfTrAddrStat1Mask_ = 0x3; + static constexpr unsigned bmtfTrAddrStat1Shift_ = 14; + static constexpr unsigned bmtfTrAddrStat2Mask_ = 0xF; + static constexpr unsigned bmtfTrAddrStat2Shift_ = 10; + static constexpr unsigned bmtfTrAddrStat3Mask_ = 0xF; + static constexpr unsigned bmtfTrAddrStat3Shift_ = 6; + static constexpr unsigned bmtfTrAddrStat4Mask_ = 0xF; + static constexpr unsigned bmtfTrAddrStat4Shift_ = 2; - static const unsigned emtfTrAddrMe1SegShift_ = 0; - static const unsigned emtfTrAddrMe1ChShift_ = 1; - static const unsigned emtfTrAddrMe1ChMask_ = 0x7; - static const unsigned emtfTrAddrMe2SegShift_ = 4; - static const unsigned emtfTrAddrMe2ChShift_ = 5; - static const unsigned emtfTrAddrMe2ChMask_ = 0x7; - static const unsigned emtfTrAddrMe3SegShift_ = 8; - static const unsigned emtfTrAddrMe3ChShift_ = 9; - static const unsigned emtfTrAddrMe3ChMask_ = 0x7; - static const unsigned emtfTrAddrMe4SegShift_ = 12; - static const unsigned emtfTrAddrMe4ChShift_ = 13; - static const unsigned emtfTrAddrMe4ChMask_ = 0x7; - static const unsigned emtfTrAddrTrkNumShift_ = 16; - static const unsigned emtfTrAddrTrkNumMask_ = 0x3; - static const unsigned emtfTrAddrBxShift_ = 18; - static const unsigned emtfTrAddrBxMask_ = 0x7FF; + static constexpr unsigned emtfTrAddrMe1SegShift_ = 0; + static constexpr unsigned emtfTrAddrMe1ChShift_ = 1; + static constexpr unsigned emtfTrAddrMe1ChMask_ = 0x7; + static constexpr unsigned emtfTrAddrMe2SegShift_ = 4; + static constexpr unsigned emtfTrAddrMe2ChShift_ = 5; + static constexpr unsigned emtfTrAddrMe2ChMask_ = 0x7; + static constexpr unsigned emtfTrAddrMe3SegShift_ = 8; + static constexpr unsigned emtfTrAddrMe3ChShift_ = 9; + static constexpr unsigned emtfTrAddrMe3ChMask_ = 0x7; + static constexpr unsigned emtfTrAddrMe4SegShift_ = 12; + static constexpr unsigned emtfTrAddrMe4ChShift_ = 13; + static constexpr unsigned emtfTrAddrMe4ChMask_ = 0x7; + static constexpr unsigned emtfTrAddrTrkNumShift_ = 16; + static constexpr unsigned emtfTrAddrTrkNumMask_ = 0x3; + static constexpr unsigned emtfTrAddrBxShift_ = 18; + static constexpr unsigned emtfTrAddrBxMask_ = 0x7FF; - static const unsigned omtfTrAddrLayersShift_ = 0; - static const unsigned omtfTrAddrLayersMask_ = 0x3FFFF; - static const unsigned omtfTrAddrWeightShift_ = 18; - static const unsigned omtfTrAddrWeightMask_ = 0x1F; + static constexpr unsigned omtfTrAddrLayersShift_ = 0; + static constexpr unsigned omtfTrAddrLayersMask_ = 0x3FFFF; + static constexpr unsigned omtfTrAddrWeightShift_ = 18; + static constexpr unsigned omtfTrAddrWeightMask_ = 0x1F; }; } // namespace l1t diff --git a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc index 631ab338c1cb8..c1e594bb8e5a5 100644 --- a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc @@ -1,8 +1,14 @@ #include "TMath.h" #include "L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h" -void l1t::MuonRawDigiTranslator::fillMuon( - Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int fed, unsigned int fw) { +void l1t::MuonRawDigiTranslator::fillMuon(Muon& mu, + uint32_t raw_data_spare, + uint32_t raw_data_00_31, + uint32_t raw_data_32_63, + int fed, + unsigned int fw, + int muInBx, + bool intermediateMuon = false) { int hwPt = (raw_data_00_31 >> ptShift_) & ptMask_; if (hwPt > 0) { mu.setHwPt(hwPt); @@ -16,35 +22,25 @@ void l1t::MuonRawDigiTranslator::fillMuon( // The position of the eta and phi coordinates in the RAW data changed between the 2016 run and the 2017 run. // Eta and phi at the muon system are replaced by eta and phi at the vertex // Eta and phi at the muon system are moved to spare bits + // In Run-3 we have displacement information. + // To make room for these data the raw eta value was moved to the second "spare" word which we will have to treat separately // The uGMT (FED 1402) or uGT (FED 1404) FW versions are used to determine the era. - if ((fed == 1402 && fw < 0x4010000) || (fed == 1404 && fw < 0x10A6)) { - // coordinates at the muon system are in 2016 where in 2017 eta and phi at the vertex are - mu.setHwEta(calcHwEta(raw_data_00_31, absEtaAtVtxShift_, etaAtVtxSignShift_)); - mu.setHwPhi((raw_data_00_31 >> phiAtVtxShift_) & phiMask_); - - // set the coordiantes at vertex to be the same as the coordinates at the muon system - mu.setHwEtaAtVtx(mu.hwEta()); - mu.setHwPhiAtVtx(mu.hwPhi()); - // deltas are 0 - mu.setHwDEtaExtra(0); - mu.setHwDPhiExtra(0); + if (fed == 1402 && intermediateMuon) { + if (fw < 0x4010000) { + fillMuonCoordinates2016(mu, raw_data_00_31, raw_data_32_63); + } else if (fw < 0x6000000) { + fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); + } else { + fillIntermediateMuonCoordinatesRun3(mu, raw_data_00_31, raw_data_32_63); + } } else { - // coordinates at the muon system - mu.setHwEta(calcHwEta(raw_data_32_63, absEtaShift_, etaSignShift_)); - mu.setHwPhi((raw_data_32_63 >> phiShift_) & phiMask_); - - // coordinates at the vertex - mu.setHwEtaAtVtx(calcHwEta(raw_data_00_31, absEtaAtVtxShift_, etaAtVtxSignShift_)); - mu.setHwPhiAtVtx((raw_data_00_31 >> phiAtVtxShift_) & phiMask_); - // deltas - mu.setHwDEtaExtra(mu.hwEtaAtVtx() - mu.hwEta()); - int dPhi = mu.hwPhiAtVtx() - mu.hwPhi(); - if (mu.hwCharge() == 1 && dPhi > 0) { - dPhi -= 576; - } else if (mu.hwCharge() == 0 && dPhi < 0) { - dPhi += 576; + if ((fed == 1402 && fw < 0x4010000) || (fed == 1404 && fw < 0x10A6)) { + fillMuonCoordinates2016(mu, raw_data_00_31, raw_data_32_63); + } else if ((fed == 1402 && fw < 0x6000000) || (fed == 1404 && fw < 0x1120)) { + fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); + } else { + fillMuonCoordinatesRun3(mu, raw_data_spare, raw_data_00_31, raw_data_32_63, muInBx); } - mu.setHwDPhiExtra(dPhi); } math::PtEtaPhiMLorentzVector vec{(mu.hwPt() - 1) * 0.5, mu.hwEta() * 0.010875, mu.hwPhi() * 0.010908, 0.0}; @@ -64,8 +60,96 @@ void l1t::MuonRawDigiTranslator::fillMuon( } } -void l1t::MuonRawDigiTranslator::fillMuon(Muon& mu, uint64_t dataword, int fed, unsigned int fw) { - fillMuon(mu, (uint32_t)(dataword & 0xFFFFFFFF), (uint32_t)((dataword >> 32) & 0xFFFFFFFF), fed, fw); +void l1t::MuonRawDigiTranslator::fillMuon(Muon& mu, + uint32_t raw_data_spare, + uint64_t dataword, + int fed, + unsigned int fw, + int muInBx, + bool intermediateMuon = false) { + fillMuon(mu, + raw_data_spare, + (uint32_t)(dataword & 0xFFFFFFFF), + (uint32_t)((dataword >> 32) & 0xFFFFFFFF), + fed, + fw, + muInBx, + intermediateMuon); +} + +void l1t::MuonRawDigiTranslator::fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63) { + // coordinates at the muon system are in 2016 where in 2017 eta and phi at the vertex are + mu.setHwEta(calcHwEta(raw_data_00_31, absEtaAtVtxShift_, etaAtVtxSignShift_)); + mu.setHwPhi((raw_data_00_31 >> phiAtVtxShift_) & phiMask_); + + // set the coordiantes at vertex to be the same as the coordinates at the muon system + mu.setHwEtaAtVtx(mu.hwEta()); + mu.setHwPhiAtVtx(mu.hwPhi()); + // deltas are 0 + mu.setHwDEtaExtra(0); + mu.setHwDPhiExtra(0); +} + +void l1t::MuonRawDigiTranslator::fillMuonCoordinatesFrom2017(Muon& mu, + uint32_t raw_data_00_31, + uint32_t raw_data_32_63) { + // coordinates at the muon system + mu.setHwEta(calcHwEta(raw_data_32_63, absEtaShift_, etaSignShift_)); + mu.setHwPhi((raw_data_32_63 >> phiShift_) & phiMask_); + + // coordinates at the vertex + mu.setHwEtaAtVtx(calcHwEta(raw_data_00_31, absEtaAtVtxShift_, etaAtVtxSignShift_)); + mu.setHwPhiAtVtx((raw_data_00_31 >> phiAtVtxShift_) & phiMask_); + // deltas + mu.setHwDEtaExtra(mu.hwEtaAtVtx() - mu.hwEta()); + int dPhi = mu.hwPhiAtVtx() - mu.hwPhi(); + if (mu.hwCharge() == 1 && dPhi > 0) { + dPhi -= 576; + } else if (mu.hwCharge() == 0 && dPhi < 0) { + dPhi += 576; + } + mu.setHwDPhiExtra(dPhi); +} + +void l1t::MuonRawDigiTranslator::fillMuonCoordinatesRun3( + Muon& mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx) { + // coordinates at the muon system + // Where to find the raw eta depends on which muon we're looking at + if (muInBx == 1) { + mu.setHwEta(calcHwEta(raw_data_spare, absEtaMu1Shift_, etaMu1SignShift_)); + } else if (muInBx == 2) { + mu.setHwEta(calcHwEta(raw_data_spare, absEtaMu2Shift_, etaMu2SignShift_)); + } else { + // TODO: Log an error? + } + mu.setHwPhi((raw_data_32_63 >> phiShift_) & phiMask_); + + // coordinates at the vertex + mu.setHwEtaAtVtx(calcHwEta(raw_data_00_31, absEtaAtVtxShift_, etaAtVtxSignShift_)); + mu.setHwPhiAtVtx((raw_data_00_31 >> phiAtVtxShift_) & phiMask_); + // deltas + mu.setHwDEtaExtra(mu.hwEtaAtVtx() - mu.hwEta()); + int dPhi = mu.hwPhiAtVtx() - mu.hwPhi(); + if (mu.hwCharge() == 1 && dPhi > 0) { + dPhi -= 576; + } else if (mu.hwCharge() == 0 && dPhi < 0) { + dPhi += 576; + } + mu.setHwDPhiExtra(dPhi); + + // displacement information + mu.setHwDXY((raw_data_32_63 >> dxyShift_) & dxyMask_); + mu.setHwPtUnconstrained((raw_data_32_63 >> ptUnconstrainedShift_) & ptUnconstrainedMask_); +} + +void l1t::MuonRawDigiTranslator::fillIntermediateMuonCoordinatesRun3(Muon& mu, + uint32_t raw_data_00_31, + uint32_t raw_data_32_63) { + fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); + + // displacement information + mu.setHwDXY((raw_data_32_63 >> dxyShift_) & dxyMask_); + mu.setHwPtUnconstrained((raw_data_00_31 >> ptUnconstrainedIntermedidateShift_) & ptUnconstrainedMask_); } void l1t::MuonRawDigiTranslator::generatePackedDataWords(const Muon& mu, diff --git a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc index f9b27a6ba5798..40a17e3aca2f3 100644 --- a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc @@ -2,7 +2,7 @@ #include "L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h" void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( - RegionalMuonCand& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf) { + RegionalMuonCand& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKalman) { // translations as defined in DN-15-017 mu.setHwPt((raw_data_00_31 >> ptShift_) & ptMask_); mu.setHwQual((raw_data_00_31 >> qualShift_) & qualMask_); @@ -41,10 +41,23 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( mu.setTrackSubAddress(RegionalMuonCand::kWheelSide, detSide); mu.setTrackSubAddress(RegionalMuonCand::kWheelNum, wheelNum); - mu.setTrackSubAddress(RegionalMuonCand::kStat1, statAddr1); - mu.setTrackSubAddress(RegionalMuonCand::kStat2, statAddr2); - mu.setTrackSubAddress(RegionalMuonCand::kStat3, statAddr3); - mu.setTrackSubAddress(RegionalMuonCand::kStat4, statAddr4); + if (!isKalman) { // The Run-2 standard configuration + mu.setTrackSubAddress(RegionalMuonCand::kStat1, statAddr1); + mu.setTrackSubAddress(RegionalMuonCand::kStat2, statAddr2); + mu.setTrackSubAddress(RegionalMuonCand::kStat3, statAddr3); + mu.setTrackSubAddress(RegionalMuonCand::kStat4, statAddr4); + } else { + // For Run-3 track address encoding has changed as the Kalman Filter tracks from outside in. + // As a result station assignment is inverted + // (i.e. the field that contained the station 1 information for Run-2 now contains station 4 information and so on.) + mu.setTrackSubAddress(RegionalMuonCand::kStat1, statAddr4); + mu.setTrackSubAddress(RegionalMuonCand::kStat2, statAddr3); + mu.setTrackSubAddress(RegionalMuonCand::kStat3, statAddr2); + mu.setTrackSubAddress(RegionalMuonCand::kStat4, statAddr1); + // Additionally we now have displacement information from the BMTF + mu.setHwPt2((raw_data_32_63 >> ptUnconstrainedShift_) & ptUnconstrainedMask_); + mu.setHwDXY((raw_data_32_63 >> dxyShift_) & dxyMask_); + } mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat1, 0); mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat2, 0); mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat3, 0); @@ -78,11 +91,10 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( mu.setDataword(raw_data_32_63, raw_data_00_31); } -void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand(RegionalMuonCand& mu, - uint64_t dataword, - int proc, - tftype tf) { - fillRegionalMuonCand(mu, (uint32_t)(dataword & 0xFFFFFFFF), (uint32_t)((dataword >> 32) & 0xFFFFFFFF), proc, tf); +void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( + RegionalMuonCand& mu, uint64_t dataword, int proc, tftype tf, bool isKalman) { + fillRegionalMuonCand( + mu, (uint32_t)(dataword & 0xFFFFFFFF), (uint32_t)((dataword >> 32) & 0xFFFFFFFF), proc, tf, isKalman); } void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalMuonCand& mu, From a2c4d61e550732e1edfc03ad331ced09424e01ef Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 5 Mar 2020 17:14:54 +0100 Subject: [PATCH 094/778] Enabled switching of cancel-out algo based on FW version --- L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py b/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py index c3cd68641eea8..78cef4c3ca141 100644 --- a/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py +++ b/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py @@ -15,7 +15,7 @@ autoBxRange = cms.bool(True), # if True the output BX range is calculated from the inputs and 'bxMin' and 'bxMax' are ignored bxMin = cms.int32(-2), bxMax = cms.int32(2), - autoCancelMode = cms.bool(False), # if True the cancel out methods are configured depending on the FW version number and 'bmtfCancelMode'&'emtfCancelMode' are ignored + autoCancelMode = cms.bool(True), # if True the cancel out methods are configured depending on the FW version number and 'bmtfCancelMode'&'emtfCancelMode' are ignored bmtfCancelMode = cms.string("kftracks"), # 'tracks' or 'kftracks' (when using the Run-3 BMTF) emtfCancelMode = cms.string("coordinate") # 'tracks' or 'coordinate' ) From 1cbb97510d535dd9bc77f274b82ab38752a290ad Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 23 Mar 2020 11:41:25 +0100 Subject: [PATCH 095/778] Zero pT indicates empty muon. Co-Authored-By: panoskatsoulis --- .../plugins/implementations_stage2/BMTFUnpackerOutput.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc index 8440806d63123..178d3d63e8878 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc @@ -68,7 +68,7 @@ namespace l1t { RegionalMuonRawDigiTranslator::fillRegionalMuonCand( muCand, raw_first, raw_secnd, processor, tftype::bmtf, isKalman); - if (muCand.hwQual() == 0) + if (muCand.hwPt() == 0) continue; if (isKalman) { From d16fab21a48dd6cb15ea2cdd5c74fba18b9a3fd7 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Fri, 27 Mar 2020 15:45:14 +0100 Subject: [PATCH 096/778] Added physical unconstrained pT to muon data format. --- DataFormats/L1Trigger/interface/Muon.h | 9 +++++++-- DataFormats/L1Trigger/src/Muon.cc | 16 +++++++++++----- DataFormats/L1Trigger/src/classes_def.xml | 2 +- L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc | 1 + L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc | 1 + 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/DataFormats/L1Trigger/interface/Muon.h b/DataFormats/L1Trigger/interface/Muon.h index 715835cf109d8..2b5e421046261 100644 --- a/DataFormats/L1Trigger/interface/Muon.h +++ b/DataFormats/L1Trigger/interface/Muon.h @@ -41,7 +41,8 @@ namespace l1t { int hwPhiAtVtx = 0, double etaAtVtx = 0., double phiAtVtx = 0., - int ptUnconstrained = 0, + int hwPtUnconstrained = 0, + double ptUnconstrained = 0., int dXY = 0); Muon(const PolarLorentzVector& p4, @@ -63,7 +64,8 @@ namespace l1t { int hwPhiAtVtx = 0, double etaAtVtx = 0., double phiAtVtx = 0., - int ptUnconstrained = 0, + int hwPtUnconstrained = 0, + double ptUnconstrained = 0., int dXY = 0); ~Muon(); @@ -85,6 +87,7 @@ namespace l1t { inline void setHwRank(int rank) { hwRank_ = rank; }; inline void setHwPtUnconstrained(int hwPtUnconstrained) { hwPtUnconstrained_ = hwPtUnconstrained; }; + inline void setPtUnconstrained(double ptUnconstrained) { ptUnconstrained_ = ptUnconstrained; }; inline void setHwDXY(int hwDXY) { hwDXY_ = hwDXY; }; inline void setDebug(bool debug) { debug_ = debug; }; @@ -106,6 +109,7 @@ namespace l1t { inline int hwRank() const { return hwRank_; }; inline int hwPtUnconstrained() const { return hwPtUnconstrained_; }; + inline double ptUnconstrained() const { return ptUnconstrained_; }; inline int hwDXY() const { return hwDXY_; }; inline bool debug() const { return debug_; }; @@ -135,6 +139,7 @@ namespace l1t { // displacement information int hwPtUnconstrained_; + double ptUnconstrained_; int hwDXY_; }; diff --git a/DataFormats/L1Trigger/src/Muon.cc b/DataFormats/L1Trigger/src/Muon.cc index 6a4471807ce21..bdb1905885b2a 100644 --- a/DataFormats/L1Trigger/src/Muon.cc +++ b/DataFormats/L1Trigger/src/Muon.cc @@ -16,6 +16,7 @@ l1t::Muon::Muon() etaAtVtx_(0.), phiAtVtx_(0.), hwPtUnconstrained_(0), + ptUnconstrained_(0.), hwDXY_(0) {} l1t::Muon::Muon(const LorentzVector& p4, @@ -37,7 +38,8 @@ l1t::Muon::Muon(const LorentzVector& p4, int hwPhiAtVtx, double etaAtVtx, double phiAtVtx, - int ptUnconstrained, + int hwPtUnconstrained, + double ptUnconstrained, int dXY) : L1Candidate(p4, pt, eta, phi, qual, iso), hwCharge_(charge), @@ -53,7 +55,8 @@ l1t::Muon::Muon(const LorentzVector& p4, hwPhiAtVtx_(hwPhiAtVtx), etaAtVtx_(etaAtVtx), phiAtVtx_(phiAtVtx), - hwPtUnconstrained_(ptUnconstrained), + hwPtUnconstrained_(hwPtUnconstrained), + ptUnconstrained_(ptUnconstrained), hwDXY_(dXY) {} l1t::Muon::Muon(const PolarLorentzVector& p4, @@ -75,7 +78,8 @@ l1t::Muon::Muon(const PolarLorentzVector& p4, int hwPhiAtVtx, double etaAtVtx, double phiAtVtx, - int ptUnconstrained, + int hwPtUnconstrained, + double ptUnconstrained, int dXY) : L1Candidate(p4, pt, eta, phi, qual, iso), hwCharge_(charge), @@ -91,7 +95,8 @@ l1t::Muon::Muon(const PolarLorentzVector& p4, hwPhiAtVtx_(hwPhiAtVtx), etaAtVtx_(etaAtVtx), phiAtVtx_(phiAtVtx), - hwPtUnconstrained_(ptUnconstrained), + hwPtUnconstrained_(hwPtUnconstrained), + ptUnconstrained_(ptUnconstrained), hwDXY_(dXY) {} l1t::Muon::~Muon() {} @@ -100,5 +105,6 @@ bool l1t::Muon::operator==(const l1t::Muon& rhs) const { return l1t::L1Candidate::operator==(static_cast(rhs)) && hwCharge_ == rhs.hwCharge() && hwChargeValid_ == rhs.hwChargeValid() && tfMuonIndex_ == rhs.tfMuonIndex() && hwEtaAtVtx_ == rhs.hwEtaAtVtx() && hwPhiAtVtx_ == rhs.hwPhiAtVtx() && - hwPtUnconstrained_ == rhs.hwPtUnconstrained() && hwDXY_ == rhs.hwDXY(); + hwPtUnconstrained_ == rhs.hwPtUnconstrained() && ptUnconstrained_ == rhs.ptUnconstrained() && + hwDXY_ == rhs.hwDXY(); } diff --git a/DataFormats/L1Trigger/src/classes_def.xml b/DataFormats/L1Trigger/src/classes_def.xml index d91e87bba66d1..8fc148869af6f 100644 --- a/DataFormats/L1Trigger/src/classes_def.xml +++ b/DataFormats/L1Trigger/src/classes_def.xml @@ -81,7 +81,7 @@ - + diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc index 70eccc916656e..6eee222d64fec 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc @@ -351,6 +351,7 @@ void L1TMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) MicroGMTConfiguration::calcMuonEtaExtra(outMu), MicroGMTConfiguration::calcMuonPhiExtra(outMu), // set the coordinates at the vertex mu->hwPtUnconstrained(), + (mu->hwPtUnconstrained() - 1) * 0.5, mu->hwDXY()}; if (mu->hwSignValid()) { outMu.setCharge(1 - 2 * mu->hwSign()); diff --git a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc index c1e594bb8e5a5..dcab1a96a6865 100644 --- a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc @@ -140,6 +140,7 @@ void l1t::MuonRawDigiTranslator::fillMuonCoordinatesRun3( // displacement information mu.setHwDXY((raw_data_32_63 >> dxyShift_) & dxyMask_); mu.setHwPtUnconstrained((raw_data_32_63 >> ptUnconstrainedShift_) & ptUnconstrainedMask_); + mu.setPtUnconstrained((mu.hwPtUnconstrained() - 1) * 0.5); } void l1t::MuonRawDigiTranslator::fillIntermediateMuonCoordinatesRun3(Muon& mu, From c7a51798c515acf3f5182d75ab5c8ccd829f098c Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Fri, 27 Mar 2020 15:46:36 +0100 Subject: [PATCH 097/778] Fixed indentation --- .../plugins/implementations_stage2/BMTFUnpackerOutput.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc index 178d3d63e8878..a0d7ae6bc7c7d 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc @@ -68,8 +68,9 @@ namespace l1t { RegionalMuonRawDigiTranslator::fillRegionalMuonCand( muCand, raw_first, raw_secnd, processor, tftype::bmtf, isKalman); - if (muCand.hwPt() == 0) + if (muCand.hwPt() == 0) { continue; + } if (isKalman) { LogDebug("L1T") << "Pt = " << muCand.hwPt() << " eta: " << muCand.hwEta() << " phi: " << muCand.hwPhi() From f32d18cd0bb97bc9195d1552bd8720c779096b73 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Fri, 27 Mar 2020 16:17:48 +0100 Subject: [PATCH 098/778] Added displacement quantities at GMT output to L1TNtuples --- .../L1TNtuples/interface/L1AnalysisL1UpgradeDataFormat.h | 6 ++++++ L1Trigger/L1TNtuples/src/L1AnalysisL1Upgrade.cc | 3 +++ 2 files changed, 9 insertions(+) diff --git a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeDataFormat.h b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeDataFormat.h index e5978d6e2853b..82168330c0e31 100644 --- a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeDataFormat.h +++ b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeDataFormat.h @@ -105,11 +105,13 @@ namespace L1Analysis { nMuons = 0; muonEt.clear(); + muonEtUnconstrained.clear(); muonEta.clear(); muonPhi.clear(); muonEtaAtVtx.clear(); muonPhiAtVtx.clear(); muonIEt.clear(); + muonIEtUnconstrained.clear(); muonIEta.clear(); muonIPhi.clear(); muonIEtaAtVtx.clear(); @@ -119,6 +121,7 @@ namespace L1Analysis { muonChg.clear(); muonIso.clear(); muonQual.clear(); + muonDxy.clear(); muonTfMuonIdx.clear(); muonBx.clear(); @@ -188,11 +191,13 @@ namespace L1Analysis { unsigned short int nMuons; std::vector muonEt; + std::vector muonEtUnconstrained; std::vector muonEta; std::vector muonPhi; std::vector muonEtaAtVtx; std::vector muonPhiAtVtx; std::vector muonIEt; + std::vector muonIEtUnconstrained; std::vector muonIEta; std::vector muonIPhi; std::vector muonIEtaAtVtx; @@ -202,6 +207,7 @@ namespace L1Analysis { std::vector muonChg; std::vector muonIso; std::vector muonQual; + std::vector muonDxy; std::vector muonTfMuonIdx; std::vector muonBx; diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisL1Upgrade.cc b/L1Trigger/L1TNtuples/src/L1AnalysisL1Upgrade.cc index 6a8c3d1540601..e037ce0e76339 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisL1Upgrade.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisL1Upgrade.cc @@ -96,11 +96,13 @@ void L1Analysis::L1AnalysisL1Upgrade::SetMuon(const edm::Handlept() > 0) { l1upgrade_.muonEt.push_back(it->et()); + l1upgrade_.muonEtUnconstrained.push_back(it->ptUnconstrained()); l1upgrade_.muonEta.push_back(it->eta()); l1upgrade_.muonPhi.push_back(it->phi()); l1upgrade_.muonEtaAtVtx.push_back(it->etaAtVtx()); l1upgrade_.muonPhiAtVtx.push_back(it->phiAtVtx()); l1upgrade_.muonIEt.push_back(it->hwPt()); + l1upgrade_.muonIEtUnconstrained.push_back(it->hwPtUnconstrained()); l1upgrade_.muonIEta.push_back(it->hwEta()); l1upgrade_.muonIPhi.push_back(it->hwPhi()); l1upgrade_.muonIEtaAtVtx.push_back(it->hwEtaAtVtx()); @@ -110,6 +112,7 @@ void L1Analysis::L1AnalysisL1Upgrade::SetMuon(const edm::Handlecharge()); l1upgrade_.muonIso.push_back(it->hwIso()); l1upgrade_.muonQual.push_back(it->hwQual()); + l1upgrade_.muonDxy.push_back(it->hwDXY()); l1upgrade_.muonTfMuonIdx.push_back(it->tfMuonIndex()); l1upgrade_.muonBx.push_back(ibx); l1upgrade_.nMuons++; From 9b5ea3f5341793c8975a95932dcdcbcbbcc4c543 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 2 Apr 2020 12:01:22 +0200 Subject: [PATCH 099/778] Reverting change of barrel input collection for uGMT This should be configured based on eras in the future. --- L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py b/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py index 78cef4c3ca141..26e5562aa1397 100644 --- a/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py +++ b/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py @@ -7,7 +7,7 @@ ) simGmtStage2Digis = cms.EDProducer('L1TMuonProducer', - barrelTFInput = cms.InputTag("simKBmtfDigis", "BMTF"), + barrelTFInput = cms.InputTag("simBmtfDigis", "BMTF"), overlapTFInput = cms.InputTag("simOmtfDigis", "OMTF"), forwardTFInput = cms.InputTag("simEmtfDigis", "EMTF"), #triggerTowerInput = cms.InputTag("simGmtCaloSumDigis", "TriggerTower2x2s"), @@ -15,7 +15,7 @@ autoBxRange = cms.bool(True), # if True the output BX range is calculated from the inputs and 'bxMin' and 'bxMax' are ignored bxMin = cms.int32(-2), bxMax = cms.int32(2), - autoCancelMode = cms.bool(True), # if True the cancel out methods are configured depending on the FW version number and 'bmtfCancelMode'&'emtfCancelMode' are ignored + autoCancelMode = cms.bool(True), # if True the cancel out methods are configured depending on the FW version number and 'bmtfCancelMode' + 'emtfCancelMode' are ignored bmtfCancelMode = cms.string("kftracks"), # 'tracks' or 'kftracks' (when using the Run-3 BMTF) emtfCancelMode = cms.string("coordinate") # 'tracks' or 'coordinate' ) From f05d47b8310738f8d372042f30b0fe096e71028d Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Wed, 8 Apr 2020 17:57:30 +0200 Subject: [PATCH 100/778] Make unpacker code more readable (and fix a bug) In the MuonUnpacker the wrong overloaded function was being called, this is fixed now. In the process I also rewrote my earlier attempt, it should be more readable now. --- .../IntermediateMuonUnpacker.cc | 3 +- .../implementations_stage2/MuonUnpacker.cc | 2 +- .../L1TMuon/interface/MuonRawDigiTranslator.h | 26 ++-- .../L1TMuon/src/MuonRawDigiTranslator.cc | 131 +++++++++--------- 4 files changed, 86 insertions(+), 76 deletions(-) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.cc index 949ccfea8378a..f72ea5205db2c 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.cc @@ -120,8 +120,7 @@ namespace l1t { // The intermediate muons of the uGMT (FED number 1402) do not // have coordinates estimated at the vertex in the RAW data. // The corresponding bits are set to zero. - MuonRawDigiTranslator::fillMuon( - mu, 0, raw_data_00_31, raw_data_32_63, 1402, getAlgoVersion(), nWord / 2, true); + MuonRawDigiTranslator::fillIntermediateMuon(mu, raw_data_00_31, raw_data_32_63, getAlgoVersion()); LogDebug("L1T") << "Mu" << nWord / 2 << ": eta " << mu.hwEta() << " phi " << mu.hwPhi() << " pT " << mu.hwPt() << " iso " << mu.hwIso() << " qual " << mu.hwQual() << " charge " << mu.hwCharge() diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.cc index 885126b8b343a..1c1b12021aa07 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.cc @@ -61,7 +61,7 @@ namespace l1t { uint32_t raw_data_spare = payload[startIdx + 1]; uint32_t raw_data_00_31 = payload[i++]; uint32_t raw_data_32_63 = payload[i++]; - LogDebug("L1T") << "raw_data_spare = 0x" << hex << raw_data_spare << "raw_data_00_31 = 0x" << raw_data_00_31 + LogDebug("L1T") << "raw_data_spare = 0x" << hex << raw_data_spare << " raw_data_00_31 = 0x" << raw_data_00_31 << " raw_data_32_63 = 0x" << raw_data_32_63; // skip empty muons (hwPt == 0) if (((raw_data_00_31 >> l1t::MuonRawDigiTranslator::ptShift_) & l1t::MuonRawDigiTranslator::ptMask_) == 0) { diff --git a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h index eb4e60101695e..28e907c0dfc36 100644 --- a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h @@ -6,16 +6,18 @@ namespace l1t { class MuonRawDigiTranslator { public: - static void fillMuon(Muon&, uint32_t, uint32_t, uint32_t, int, unsigned int, int, bool); - static void fillMuon(Muon&, uint32_t, uint64_t, int, unsigned int, int, bool); - static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); - static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); - static void fillMuonCoordinatesRun3( - Muon& mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx); - static void fillIntermediateMuonCoordinatesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuon(Muon& mu, + uint32_t raw_data_spare, + uint32_t raw_data_00_31, + uint32_t raw_data_32_63, + int fed, + unsigned int fw, + int muInBx); + static void fillMuon(Muon& mu, uint32_t raw_data_spare, uint64_t dataword, int fed, unsigned int fw, int muInBx); + static void fillIntermediateMuon(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, unsigned int fw); static void generatePackedDataWords(const Muon&, uint32_t&, uint32_t&); static uint64_t generate64bitDataWord(const Muon&); - static int calcHwEta(const uint32_t&, const unsigned, const unsigned); + static int calcHwEta(const uint32_t& raw, const unsigned absEtaShift, const unsigned etaSignShift); static constexpr unsigned ptMask_ = 0x1FF; static constexpr unsigned ptShift_ = 10; @@ -44,6 +46,14 @@ namespace l1t { static constexpr unsigned etaMu1SignShift_ = 20; // For Run-3 static constexpr unsigned absEtaMu2Shift_ = 21; // For Run-3 static constexpr unsigned etaMu2SignShift_ = 29; // For Run-3 + + private: + static void fillMuonStableQuantities(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuonCoordinatesRun3( + Muon& mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx); + static void fillIntermediateMuonCoordinatesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); }; } // namespace l1t diff --git a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc index dcab1a96a6865..fb18c76011f5c 100644 --- a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc @@ -7,74 +7,75 @@ void l1t::MuonRawDigiTranslator::fillMuon(Muon& mu, uint32_t raw_data_32_63, int fed, unsigned int fw, - int muInBx, - bool intermediateMuon = false) { - int hwPt = (raw_data_00_31 >> ptShift_) & ptMask_; - if (hwPt > 0) { - mu.setHwPt(hwPt); - mu.setHwQual((raw_data_00_31 >> qualShift_) & qualMask_); - mu.setHwIso((raw_data_32_63 >> isoShift_) & isoMask_); - // charge is coded as -1^chargeBit - mu.setHwCharge((raw_data_32_63 >> chargeShift_) & 0x1); - mu.setHwChargeValid((raw_data_32_63 >> chargeValidShift_) & 0x1); - mu.setTfMuonIndex((raw_data_32_63 >> tfMuonIndexShift_) & tfMuonIndexMask_); - - // The position of the eta and phi coordinates in the RAW data changed between the 2016 run and the 2017 run. - // Eta and phi at the muon system are replaced by eta and phi at the vertex - // Eta and phi at the muon system are moved to spare bits - // In Run-3 we have displacement information. - // To make room for these data the raw eta value was moved to the second "spare" word which we will have to treat separately - // The uGMT (FED 1402) or uGT (FED 1404) FW versions are used to determine the era. - if (fed == 1402 && intermediateMuon) { - if (fw < 0x4010000) { - fillMuonCoordinates2016(mu, raw_data_00_31, raw_data_32_63); - } else if (fw < 0x6000000) { - fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); - } else { - fillIntermediateMuonCoordinatesRun3(mu, raw_data_00_31, raw_data_32_63); - } - } else { - if ((fed == 1402 && fw < 0x4010000) || (fed == 1404 && fw < 0x10A6)) { - fillMuonCoordinates2016(mu, raw_data_00_31, raw_data_32_63); - } else if ((fed == 1402 && fw < 0x6000000) || (fed == 1404 && fw < 0x1120)) { - fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); - } else { - fillMuonCoordinatesRun3(mu, raw_data_spare, raw_data_00_31, raw_data_32_63, muInBx); - } - } - - math::PtEtaPhiMLorentzVector vec{(mu.hwPt() - 1) * 0.5, mu.hwEta() * 0.010875, mu.hwPhi() * 0.010908, 0.0}; - mu.setP4(vec); - // generate a muon at the vertex to extract the physical eta and phi coordinates - math::PtEtaPhiMLorentzVector vecAtVtx{ - (mu.hwPt() - 1) * 0.5, mu.hwEtaAtVtx() * 0.010875, mu.hwPhiAtVtx() * 0.010908, 0.0}; - Muon muAtVtx; - muAtVtx.setP4(vecAtVtx); - mu.setEtaAtVtx(muAtVtx.eta()); - mu.setPhiAtVtx(muAtVtx.phi()); - if (mu.hwChargeValid()) { - mu.setCharge(1 - 2 * mu.hwCharge()); - } else { - mu.setCharge(0); - } + int muInBx) { + // Need the hw charge to properly compute dPhi + mu.setHwCharge((raw_data_32_63 >> chargeShift_) & 0x1); + + // The position of the eta and phi coordinates in the RAW data changed between the 2016 run and the 2017 run. + // Eta and phi at the muon system are replaced by eta and phi at the vertex + // Eta and phi at the muon system are moved to spare bits + // In Run-3 we have displacement information. + // To make room for these data the raw eta value was moved to the second "spare" word which we will have to treat separately + // The uGMT (FED 1402) or uGT (FED 1404) FW versions are used to determine the era. + if ((fed == 1402 && fw < 0x4010000) || (fed == 1404 && fw < 0x10A6)) { + fillMuonCoordinates2016(mu, raw_data_00_31, raw_data_32_63); + } else if ((fed == 1402 && fw < 0x6000000) || (fed == 1404 && fw < 0x1120)) { + fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); + } else { + fillMuonCoordinatesRun3(mu, raw_data_spare, raw_data_00_31, raw_data_32_63, muInBx); } + + // Fill pT, qual, iso, charge, index bits, coordinates at vtx + fillMuonStableQuantities(mu, raw_data_00_31, raw_data_32_63); } -void l1t::MuonRawDigiTranslator::fillMuon(Muon& mu, - uint32_t raw_data_spare, - uint64_t dataword, - int fed, - unsigned int fw, - int muInBx, - bool intermediateMuon = false) { - fillMuon(mu, - raw_data_spare, - (uint32_t)(dataword & 0xFFFFFFFF), - (uint32_t)((dataword >> 32) & 0xFFFFFFFF), - fed, - fw, - muInBx, - intermediateMuon); +void l1t::MuonRawDigiTranslator::fillIntermediateMuon(Muon& mu, + uint32_t raw_data_00_31, + uint32_t raw_data_32_63, + unsigned int fw) { + // Need the hw charge to properly compute dPhi + mu.setHwCharge((raw_data_32_63 >> chargeShift_) & 0x1); + + if (fw < 0x4010000) { + fillMuonCoordinates2016(mu, raw_data_00_31, raw_data_32_63); + } else if (fw < 0x6000000) { + fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); + } else { + fillIntermediateMuonCoordinatesRun3(mu, raw_data_00_31, raw_data_32_63); + } + + // Fill pT, qual, iso, charge, index bits, coordinates at vtx + fillMuonStableQuantities(mu, raw_data_00_31, raw_data_32_63); +} + +void l1t::MuonRawDigiTranslator::fillMuonStableQuantities(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63) { + mu.setHwPt((raw_data_00_31 >> ptShift_) & ptMask_); + mu.setHwQual((raw_data_00_31 >> qualShift_) & qualMask_); + mu.setHwIso((raw_data_32_63 >> isoShift_) & isoMask_); + // charge is coded as -1^chargeBit + mu.setHwChargeValid((raw_data_32_63 >> chargeValidShift_) & 0x1); + mu.setTfMuonIndex((raw_data_32_63 >> tfMuonIndexShift_) & tfMuonIndexMask_); + if (mu.hwChargeValid()) { + mu.setCharge(1 - 2 * mu.hwCharge()); + } else { + mu.setCharge(0); + } + + math::PtEtaPhiMLorentzVector vec{(mu.hwPt() - 1) * 0.5, mu.hwEta() * 0.010875, mu.hwPhi() * 0.010908, 0.0}; + mu.setP4(vec); + // generate a muon at the vertex to extract the physical eta and phi coordinates + math::PtEtaPhiMLorentzVector vecAtVtx{ + (mu.hwPt() - 1) * 0.5, mu.hwEtaAtVtx() * 0.010875, mu.hwPhiAtVtx() * 0.010908, 0.0}; + Muon muAtVtx; + muAtVtx.setP4(vecAtVtx); + mu.setEtaAtVtx(muAtVtx.eta()); + mu.setPhiAtVtx(muAtVtx.phi()); +} + +void l1t::MuonRawDigiTranslator::fillMuon( + Muon& mu, uint32_t raw_data_spare, uint64_t dataword, int fed, unsigned int fw, int muInBx) { + fillMuon( + mu, raw_data_spare, (uint32_t)(dataword & 0xFFFFFFFF), (uint32_t)((dataword >> 32) & 0xFFFFFFFF), fed, fw, muInBx); } void l1t::MuonRawDigiTranslator::fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63) { From 6639621d1aa501dc6d64affb40516e5c51b72476 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 16 Apr 2020 12:33:43 +0200 Subject: [PATCH 101/778] Guarding against negative unconstrained pT Also add displacement information to uGMT intermediate muons and light refactoring for clarity. --- .../L1TMuon/interface/MuonRawDigiTranslator.h | 4 +-- L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc | 29 ++++++++++++++----- .../L1TMuon/src/MuonRawDigiTranslator.cc | 18 +++++++----- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h index 28e907c0dfc36..55f91d8508961 100644 --- a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h @@ -51,9 +51,9 @@ namespace l1t { static void fillMuonStableQuantities(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); - static void fillMuonCoordinatesRun3( + static void fillMuonQuantitiesRun3( Muon& mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx); - static void fillIntermediateMuonCoordinatesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillIntermediateMuonQuantitiesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); }; } // namespace l1t diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc index 6eee222d64fec..62c1370864c24 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc @@ -345,14 +345,21 @@ void L1TMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) mu->hwIsoSum(), mu->hwDPhi(), mu->hwDEta(), - mu->hwRank(), - MicroGMTConfiguration::calcMuonHwEtaExtra(outMu), - MicroGMTConfiguration::calcMuonHwPhiExtra(outMu), // set the coordinates at the vertex - MicroGMTConfiguration::calcMuonEtaExtra(outMu), - MicroGMTConfiguration::calcMuonPhiExtra(outMu), // set the coordinates at the vertex - mu->hwPtUnconstrained(), - (mu->hwPtUnconstrained() - 1) * 0.5, - mu->hwDXY()}; + mu->hwRank()}; + + // Set coordinates at the vertex + outMu.setHwEtaAtVtx(MicroGMTConfiguration::calcMuonHwEtaExtra(outMu)); + outMu.setHwPhiAtVtx(MicroGMTConfiguration::calcMuonHwPhiExtra(outMu)); + outMu.setEtaAtVtx(MicroGMTConfiguration::calcMuonEtaExtra(outMu)); + outMu.setPhiAtVtx(MicroGMTConfiguration::calcMuonPhiExtra(outMu)); + + // Set displacement information + int hwPtUnconstrained{mu->hwPtUnconstrained()}; + outMu.setPtUnconstrained(hwPtUnconstrained == 0 ? 0 + : (hwPtUnconstrained - 1) * 0.5); // Don't want negative pT. + outMu.setHwPtUnconstrained(hwPtUnconstrained); + outMu.setHwDXY(mu->hwDXY()); + if (mu->hwSignValid()) { outMu.setCharge(1 - 2 * mu->hwSign()); } else { @@ -445,6 +452,12 @@ void L1TMuonProducer::addMuonsToCollections(MicroGMTConfiguration::InterMuonList mu->hwDPhi(), mu->hwDEta(), mu->hwRank()}; + + int hwPtUnconstrained{mu->hwPtUnconstrained()}; + outMu.setPtUnconstrained(hwPtUnconstrained == 0 ? 0 : (hwPtUnconstrained - 1) * 0.5); // Don't want negative pT. + outMu.setHwPtUnconstrained(hwPtUnconstrained); + outMu.setHwDXY(mu->hwDXY()); + if (mu->hwSignValid()) { outMu.setCharge(1 - 2 * mu->hwSign()); } else { diff --git a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc index fb18c76011f5c..44ca904a2a615 100644 --- a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc @@ -22,7 +22,7 @@ void l1t::MuonRawDigiTranslator::fillMuon(Muon& mu, } else if ((fed == 1402 && fw < 0x6000000) || (fed == 1404 && fw < 0x1120)) { fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); } else { - fillMuonCoordinatesRun3(mu, raw_data_spare, raw_data_00_31, raw_data_32_63, muInBx); + fillMuonQuantitiesRun3(mu, raw_data_spare, raw_data_00_31, raw_data_32_63, muInBx); } // Fill pT, qual, iso, charge, index bits, coordinates at vtx @@ -41,10 +41,10 @@ void l1t::MuonRawDigiTranslator::fillIntermediateMuon(Muon& mu, } else if (fw < 0x6000000) { fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); } else { - fillIntermediateMuonCoordinatesRun3(mu, raw_data_00_31, raw_data_32_63); + fillIntermediateMuonQuantitiesRun3(mu, raw_data_00_31, raw_data_32_63); } - // Fill pT, qual, iso, charge, index bits, coordinates at vtx + // Fill pT, qual, iso, charge, index bits, phys. coordinates at vtx & unconstrained pT fillMuonStableQuantities(mu, raw_data_00_31, raw_data_32_63); } @@ -70,6 +70,9 @@ void l1t::MuonRawDigiTranslator::fillMuonStableQuantities(Muon& mu, uint32_t raw muAtVtx.setP4(vecAtVtx); mu.setEtaAtVtx(muAtVtx.eta()); mu.setPhiAtVtx(muAtVtx.phi()); + + int hwPtUnconstrained{mu.hwPtUnconstrained()}; + mu.setPtUnconstrained(hwPtUnconstrained == 0 ? 0 : (hwPtUnconstrained - 1) * 0.5); // Don't want negative pT. } void l1t::MuonRawDigiTranslator::fillMuon( @@ -112,7 +115,7 @@ void l1t::MuonRawDigiTranslator::fillMuonCoordinatesFrom2017(Muon& mu, mu.setHwDPhiExtra(dPhi); } -void l1t::MuonRawDigiTranslator::fillMuonCoordinatesRun3( +void l1t::MuonRawDigiTranslator::fillMuonQuantitiesRun3( Muon& mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx) { // coordinates at the muon system // Where to find the raw eta depends on which muon we're looking at @@ -141,12 +144,11 @@ void l1t::MuonRawDigiTranslator::fillMuonCoordinatesRun3( // displacement information mu.setHwDXY((raw_data_32_63 >> dxyShift_) & dxyMask_); mu.setHwPtUnconstrained((raw_data_32_63 >> ptUnconstrainedShift_) & ptUnconstrainedMask_); - mu.setPtUnconstrained((mu.hwPtUnconstrained() - 1) * 0.5); } -void l1t::MuonRawDigiTranslator::fillIntermediateMuonCoordinatesRun3(Muon& mu, - uint32_t raw_data_00_31, - uint32_t raw_data_32_63) { +void l1t::MuonRawDigiTranslator::fillIntermediateMuonQuantitiesRun3(Muon& mu, + uint32_t raw_data_00_31, + uint32_t raw_data_32_63) { fillMuonCoordinatesFrom2017(mu, raw_data_00_31, raw_data_32_63); // displacement information From f87af4e1652a49fb3e31eaf105b3b91ee145a810 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Wed, 22 Apr 2020 18:32:23 +0200 Subject: [PATCH 102/778] Renamed pt2 member of regional muon DF to ptUnconstrained --- DQM/L1TMonitor/interface/L1TStage2BMTF.h | 6 +- .../interface/L1TStage2RegionalMuonCandComp.h | 6 +- DQM/L1TMonitor/src/L1TStage2BMTF.cc | 5 +- .../src/L1TStage2RegionalMuonCandComp.cc | 32 ++-- .../L1TMuon/interface/RegionalMuonCand.h | 12 +- DataFormats/L1TMuon/src/RegionalMuonCand.cc | 4 +- DataFormats/L1TMuon/src/classes_def.xml | 3 +- .../BMTFUnpackerOutput.cc | 2 +- .../RegionalMuonGMTUnpacker.cc | 2 +- L1Trigger/L1TMuon/interface/GMTInternalMuon.h | 2 +- .../src/RegionalMuonRawDigiTranslator.cc | 2 +- .../src/L1TMuonBarrelKalmanAlgo.cc | 2 +- .../src/L1TMuonBarrelKalmanSectorProcessor.cc | 6 +- .../test/kalmanTools/kmtfAnalysis.py | 140 +++++++++--------- .../test/kalmanTools/validation.py | 32 ++-- 15 files changed, 126 insertions(+), 130 deletions(-) diff --git a/DQM/L1TMonitor/interface/L1TStage2BMTF.h b/DQM/L1TMonitor/interface/L1TStage2BMTF.h index 61abcbcc01a0f..a77c03b05cb55 100644 --- a/DQM/L1TMonitor/interface/L1TStage2BMTF.h +++ b/DQM/L1TMonitor/interface/L1TStage2BMTF.h @@ -4,7 +4,7 @@ /* * \file L1TStage2BMTF.h * \Author Esmaeel Eskandari Tadavani - * \December 2015 + * \December 2015 */ // system requirements @@ -33,7 +33,7 @@ #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" // dqm requirements -#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Frameworkfwd.h" @@ -95,7 +95,7 @@ class L1TStage2BMTF : public DQMEDAnalyzer { MonitorElement* bmtf_hwQual_bx; MonitorElement* bmtf_hwDXY; - MonitorElement* bmtf_hwPt2; + MonitorElement* bmtf_hwPtUnconstrained; /* MonitorElement* bmtf_twinmuxInput_PhiBX; */ /* MonitorElement* bmtf_twinmuxInput_PhiPhi; */ diff --git a/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h b/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h index ffbb09b4f10fc..d312f8b640ecf 100644 --- a/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h +++ b/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h @@ -4,7 +4,7 @@ #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -95,7 +95,7 @@ class L1TStage2RegionalMuonCandComp : public DQMEDAnalyzer { MonitorElement* muColl1TrkAddrSize; MonitorElement* muColl1TrkAddr; MonitorElement* muColl1hwDXY; - MonitorElement* muColl1hwPt2; + MonitorElement* muColl1hwPtUnconstrained; MonitorElement* muColl2BxRange; MonitorElement* muColl2nMu; @@ -112,7 +112,7 @@ class L1TStage2RegionalMuonCandComp : public DQMEDAnalyzer { MonitorElement* muColl2TrkAddrSize; MonitorElement* muColl2TrkAddr; MonitorElement* muColl2hwDXY; - MonitorElement* muColl2hwPt2; + MonitorElement* muColl2hwPtUnconstrained; }; #endif diff --git a/DQM/L1TMonitor/src/L1TStage2BMTF.cc b/DQM/L1TMonitor/src/L1TStage2BMTF.cc index 1c14e4031c1ec..8af2d0730a9f0 100644 --- a/DQM/L1TMonitor/src/L1TStage2BMTF.cc +++ b/DQM/L1TMonitor/src/L1TStage2BMTF.cc @@ -80,7 +80,8 @@ void L1TStage2BMTF::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& i bmtf_hwQual_bx->setTitle("; HW Quality; BX"); bmtf_hwDXY = ibooker.book1D(histoPrefix + "_hwDXY", "HW DXY", 4, 0, 4); - bmtf_hwPt2 = ibooker.book1D(histoPrefix + "_hwPt2", "HW p_{T}2", 512, -0.5, 511.5); + bmtf_hwPtUnconstrained = + ibooker.book1D(histoPrefix + "_hwPtUnconstrained", "HW p_{T} unconstrained", 512, -0.5, 511.5); // bmtf_twinmuxInput_PhiBX = ibooker.book1D(histoPrefix+"_twinmuxInput_PhiBX" , "TwinMux Input Phi BX" , 5, -2.5, 2.5); // bmtf_twinmuxInput_PhiPhi = ibooker.book1D(histoPrefix+"_twinmuxInput_PhiPhi" , "TwinMux Input Phi HW Phi" , 201, -100.5, 100.5); @@ -136,7 +137,7 @@ void L1TStage2BMTF::analyze(const edm::Event& eve, const edm::EventSetup& eveSet bmtf_proc->Fill(itMuon->processor()); bmtf_hwDXY->Fill(itMuon->hwDXY()); - bmtf_hwPt2->Fill(itMuon->hwPt2()); + bmtf_hwPtUnconstrained->Fill(itMuon->hwPtUnconstrained()); if (fabs(bmtfMuon->getLastBX() - bmtfMuon->getFirstBX()) > 3) { bmtf_wedge_bx->Fill(itMuon->processor(), itBX); diff --git a/DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc b/DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc index 9fa3271af4b5e..95f05d94d2734 100644 --- a/DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc +++ b/DQM/L1TMonitor/src/L1TStage2RegionalMuonCandComp.cc @@ -82,7 +82,7 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, summary->setBinLabel(TRACKADDRBAD, "track address mismatch", 1); if (isBmtf) { summary->setBinLabel(DXYBAD, "DXY mismatch", 1); - summary->setBinLabel(PT2BAD, "P_{T}2 mismatch", 1); + summary->setBinLabel(PT2BAD, "P_{T} unconstrained mismatch", 1); } int nbinsNum = 14; @@ -111,7 +111,7 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, errorSummaryNum->setBinLabel(RTRACKADDR, "track address mismatch", 1); if (isBmtf) { errorSummaryNum->setBinLabel(RDXY, "DXY mismatch", 1); - errorSummaryNum->setBinLabel(RPT2, "P_{T}2 mismatch", 1); + errorSummaryNum->setBinLabel(RPT2, "P_{T} unconstrained mismatch", 1); } // Change the label for those bins that will be ignored @@ -198,9 +198,12 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, if (isBmtf) { muColl1hwDXY = ibooker.book1D("muhwDXYColl1", (muonColl1Title + " HW DXY" + trkAddrIgnoreText).c_str(), 4, 0, 4); muColl1hwDXY->setAxisTitle("Hardware DXY", 1); - muColl1hwPt2 = - ibooker.book1D("muhwPt2Coll1", (muonColl1Title + "HW p_{T}2" + trkAddrIgnoreText).c_str(), 512, -0.5, 511.5); - muColl1hwPt2->setAxisTitle("Hardware P_{T}2", 1); + muColl1hwPtUnconstrained = ibooker.book1D("muhwPtUnconstrainedColl1", + (muonColl1Title + "HW p_{T} unconstrained" + trkAddrIgnoreText).c_str(), + 512, + -0.5, + 511.5); + muColl1hwPtUnconstrained->setAxisTitle("Hardware P_{T} unconstrained", 1); } muColl2BxRange = ibooker.book1D("muBxRangeColl2", (muonColl2Title + " mismatching BX range").c_str(), 11, -5.5, 5.5); @@ -266,9 +269,12 @@ void L1TStage2RegionalMuonCandComp::bookHistograms(DQMStore::IBooker& ibooker, if (isBmtf) { muColl2hwDXY = ibooker.book1D("muhwDXYColl2", (muonColl2Title + " HW DXY" + trkAddrIgnoreText).c_str(), 4, 0, 4); muColl2hwDXY->setAxisTitle("Hardware DXY", 1); - muColl2hwPt2 = - ibooker.book1D("muhwPt2Coll2", (muonColl2Title + "HW p_{T}2" + trkAddrIgnoreText).c_str(), 512, -0.5, 511.5); - muColl2hwPt2->setAxisTitle("Hardware P_{T}2", 1); + muColl2hwPtUnconstrained = ibooker.book1D("muhwPtUnconstrainedColl2", + (muonColl2Title + "HW p_{T} unconstrained" + trkAddrIgnoreText).c_str(), + 512, + -0.5, + 511.5); + muColl2hwPtUnconstrained->setAxisTitle("Hardware P_{T} unconstrained", 1); } } @@ -333,7 +339,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muColl1TrkAddrSize->Fill(muon1TrackAddr.size()); if (isBmtf) { muColl1hwDXY->Fill(muonIt1->hwDXY()); - muColl1hwPt2->Fill(muonIt1->hwPt2()); + muColl1hwPtUnconstrained->Fill(muonIt1->hwPtUnconstrained()); } for (std::map::const_iterator trIt1 = muon1TrackAddr.begin(); trIt1 != muon1TrackAddr.end(); ++trIt1) { @@ -357,7 +363,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muColl2TrkAddrSize->Fill(muon2TrackAddr.size()); if (isBmtf) { muColl2hwDXY->Fill(muonIt2->hwDXY()); - muColl2hwPt2->Fill(muonIt2->hwPt2()); + muColl2hwPtUnconstrained->Fill(muonIt2->hwPtUnconstrained()); } for (std::map::const_iterator trIt2 = muon2TrackAddr.begin(); trIt2 != muon2TrackAddr.end(); ++trIt2) { @@ -506,7 +512,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even errorSummaryNum->Fill(RDXY); } } - if (muonIt1->hwPt2() != muonIt2->hwPt2()) { + if (muonIt1->hwPtUnconstrained() != muonIt2->hwPtUnconstrained()) { muonMismatch = true; summary->Fill(PT2BAD); if (incBin[RPT2]) { @@ -534,7 +540,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muColl1TrkAddrSize->Fill(muon1TrackAddr.size()); if (isBmtf) { muColl1hwDXY->Fill(muonIt1->hwDXY()); - muColl1hwPt2->Fill(muonIt1->hwPt2()); + muColl1hwPtUnconstrained->Fill(muonIt1->hwPtUnconstrained()); } for (std::map::const_iterator trIt1 = muon1TrackAddr.begin(); trIt1 != muon1TrackAddr.end(); ++trIt1) { @@ -554,7 +560,7 @@ void L1TStage2RegionalMuonCandComp::analyze(const edm::Event& e, const edm::Even muColl2TrkAddrSize->Fill(muon2TrackAddr.size()); if (isBmtf) { muColl2hwDXY->Fill(muonIt2->hwDXY()); - muColl2hwPt2->Fill(muonIt2->hwPt2()); + muColl2hwPtUnconstrained->Fill(muonIt2->hwPtUnconstrained()); } for (std::map::const_iterator trIt2 = muon2TrackAddr.begin(); trIt2 != muon2TrackAddr.end(); ++trIt2) { diff --git a/DataFormats/L1TMuon/interface/RegionalMuonCand.h b/DataFormats/L1TMuon/interface/RegionalMuonCand.h index b9e9831de3693..92c0290dabb40 100644 --- a/DataFormats/L1TMuon/interface/RegionalMuonCand.h +++ b/DataFormats/L1TMuon/interface/RegionalMuonCand.h @@ -45,7 +45,7 @@ namespace l1t { RegionalMuonCand() : m_hwPt(0), - m_hwPt2(0), + m_hwPtUnconstrained(0), m_hwDXY(0), m_hwPhi(0), m_hwEta(0), @@ -59,7 +59,7 @@ namespace l1t { RegionalMuonCand(int pt, int phi, int eta, int sign, int signvalid, int quality, int processor, tftype trackFinder) : m_hwPt(pt), - m_hwPt2(0), + m_hwPtUnconstrained(0), m_hwDXY(0), m_hwPhi(phi), m_hwEta(eta), @@ -107,7 +107,7 @@ namespace l1t { tftype trackFinder, std::map trackAddress) : m_hwPt(pt), - m_hwPt2(0), + m_hwPtUnconstrained(0), m_hwDXY(0), m_hwPhi(phi), m_hwEta(eta), @@ -125,7 +125,7 @@ namespace l1t { /// Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits) void setHwPt(int bits) { m_hwPt = bits; }; /// Set compressed second displaced pT as transmitted by hardware LSB = 1.0 (8 bits) - void setHwPt2(int bits) { m_hwPt2 = bits; }; + void setHwPtUnconstrained(int bits) { m_hwPtUnconstrained = bits; }; /// Set compressed impact parameter with respect to beamspot (4 bits) void setHwDXY(int bits) { m_hwDXY = bits; }; /// Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits) @@ -160,7 +160,7 @@ namespace l1t { /// Get compressed pT (returned int * 0.5 = pT (GeV)) const int hwPt() const { return m_hwPt; }; /// Get second compressed pT (returned int * 1.0 = pT (GeV)) - const int hwPt2() const { return m_hwPt2; }; + const int hwPtUnconstrained() const { return m_hwPtUnconstrained; }; /// Get compressed impact parameter (4 bits) const int hwDXY() const { return m_hwDXY; }; /// Get compressed local phi (returned int * 2*pi/576 = local phi in rad) @@ -201,7 +201,7 @@ namespace l1t { private: int m_hwPt; - int m_hwPt2; + int m_hwPtUnconstrained; int m_hwDXY; int m_hwPhi; int m_hwEta; diff --git a/DataFormats/L1TMuon/src/RegionalMuonCand.cc b/DataFormats/L1TMuon/src/RegionalMuonCand.cc index 856fadc8d18fb..861dee51c8725 100644 --- a/DataFormats/L1TMuon/src/RegionalMuonCand.cc +++ b/DataFormats/L1TMuon/src/RegionalMuonCand.cc @@ -25,8 +25,8 @@ namespace l1t { } bool RegionalMuonCand::operator==(const RegionalMuonCand& rhs) const { - return m_hwPt == rhs.hwPt() && m_hwPt2 == rhs.hwPt2() && m_hwDXY == rhs.hwDXY() && m_hwPhi == rhs.hwPhi() && - m_hwEta == rhs.hwEta() && m_hwHF == (bool)rhs.hwHF() && m_hwSign == rhs.hwSign() && + return m_hwPt == rhs.hwPt() && m_hwPtUnconstrained == rhs.hwPtUnconstrained() && m_hwDXY == rhs.hwDXY() && + m_hwPhi == rhs.hwPhi() && m_hwEta == rhs.hwEta() && m_hwHF == (bool)rhs.hwHF() && m_hwSign == rhs.hwSign() && m_hwSignValid == rhs.hwSignValid() && m_hwQuality == rhs.hwQual() && m_link == rhs.link() && m_processor == rhs.processor() && m_trackFinder == rhs.trackFinderType() && m_trackAddress == rhs.trackAddress(); diff --git a/DataFormats/L1TMuon/src/classes_def.xml b/DataFormats/L1TMuon/src/classes_def.xml index d704ce42b1283..9b5fbe5ad5ea5 100644 --- a/DataFormats/L1TMuon/src/classes_def.xml +++ b/DataFormats/L1TMuon/src/classes_def.xml @@ -65,7 +65,8 @@ - + + diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc index a0d7ae6bc7c7d..ad68ab75a0ffd 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFUnpackerOutput.cc @@ -74,7 +74,7 @@ namespace l1t { if (isKalman) { LogDebug("L1T") << "Pt = " << muCand.hwPt() << " eta: " << muCand.hwEta() << " phi: " << muCand.hwPhi() - << " diplacedPt = " << muCand.hwPt2(); + << " diplacedPt = " << muCand.hwPtUnconstrained(); } else { LogDebug("L1T") << "Pt = " << muCand.hwPt() << " eta: " << muCand.hwEta() << " phi: " << muCand.hwPhi(); } diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc index c513ad52fb3c5..2a8d556dc0eba 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.cc @@ -106,7 +106,7 @@ namespace l1t { LogDebug("L1T") << "Mu" << nWord / 2 << ": eta " << mu.hwEta() << " phi " << mu.hwPhi() << " pT " << mu.hwPt() << " qual " << mu.hwQual() << " sign " << mu.hwSign() << " sign valid " - << mu.hwSignValid() << " unconstrained pT " << mu.hwPt2(); + << mu.hwSignValid() << " unconstrained pT " << mu.hwPtUnconstrained(); res->push_back(bx, mu); } diff --git a/L1Trigger/L1TMuon/interface/GMTInternalMuon.h b/L1Trigger/L1TMuon/interface/GMTInternalMuon.h index f56139232570f..0b8b142a9f196 100644 --- a/L1Trigger/L1TMuon/interface/GMTInternalMuon.h +++ b/L1Trigger/L1TMuon/interface/GMTInternalMuon.h @@ -43,7 +43,7 @@ namespace l1t { const RegionalMuonCand& origin() const { return m_regional; }; inline const int hwPt() const { return m_regional.hwPt(); }; - inline const int hwPtUnconstrained() const { return m_regional.hwPt2(); }; + inline const int hwPtUnconstrained() const { return m_regional.hwPtUnconstrained(); }; inline const int hwDXY() const { return m_regional.hwDXY(); }; inline const int hwLocalPhi() const { return m_regional.hwPhi(); }; inline const int hwEta() const { return m_regional.hwEta(); }; diff --git a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc index 40a17e3aca2f3..81e8ba965b678 100644 --- a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc @@ -55,7 +55,7 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( mu.setTrackSubAddress(RegionalMuonCand::kStat3, statAddr2); mu.setTrackSubAddress(RegionalMuonCand::kStat4, statAddr1); // Additionally we now have displacement information from the BMTF - mu.setHwPt2((raw_data_32_63 >> ptUnconstrainedShift_) & ptUnconstrainedMask_); + mu.setHwPtUnconstrained((raw_data_32_63 >> ptUnconstrainedShift_) & ptUnconstrainedMask_); mu.setHwDXY((raw_data_32_63 >> dxyShift_) & dxyMask_); } mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat1, 0); diff --git a/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanAlgo.cc b/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanAlgo.cc index 7380382040bd8..c8b1adacf4aef 100644 --- a/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanAlgo.cc +++ b/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanAlgo.cc @@ -105,7 +105,7 @@ l1t::RegionalMuonCand L1TMuonBarrelKalmanAlgo::convertToBMTF(const L1MuKBMTrack& l1t::RegionalMuonCand muon(pt, phi, eta, sign, signValid, quality, processor, l1t::bmtf, addr); muon.setHwHF(HF); - muon.setHwPt2(pt2); + muon.setHwPtUnconstrained(pt2); muon.setHwDXY(dxy); //nw the words! diff --git a/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanSectorProcessor.cc b/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanSectorProcessor.cc index bdb84df864f3d..9c28428153de5 100644 --- a/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanSectorProcessor.cc +++ b/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanSectorProcessor.cc @@ -114,7 +114,7 @@ L1TMuonBarrelKalmanSectorProcessor::bmtf_out L1TMuonBarrelKalmanSectorProcessor: out.addr4_1 = mu.trackSubAddress(l1t::RegionalMuonCand::kStat4); out.wheel_1 = mu.trackSubAddress(l1t::RegionalMuonCand::kWheelSide) * (1 << 2) + mu.trackSubAddress(l1t::RegionalMuonCand::kWheelNum); - out.ptSTA_1 = mu.hwPt2(); + out.ptSTA_1 = mu.hwPtUnconstrained(); } if (tracks.size() > 1) { @@ -135,7 +135,7 @@ L1TMuonBarrelKalmanSectorProcessor::bmtf_out L1TMuonBarrelKalmanSectorProcessor: out.wheel_2 = mu.trackSubAddress(l1t::RegionalMuonCand::kWheelSide) * (1 << 2) + mu.trackSubAddress(l1t::RegionalMuonCand::kWheelNum); - out.ptSTA_2 = mu.hwPt2(); + out.ptSTA_2 = mu.hwPtUnconstrained(); } if (tracks.size() > 2) { @@ -155,7 +155,7 @@ L1TMuonBarrelKalmanSectorProcessor::bmtf_out L1TMuonBarrelKalmanSectorProcessor: out.addr4_3 = mu.trackSubAddress(l1t::RegionalMuonCand::kStat4); out.wheel_3 = mu.trackSubAddress(l1t::RegionalMuonCand::kWheelSide) * (1 << 2) + mu.trackSubAddress(l1t::RegionalMuonCand::kWheelNum); - out.ptSTA_3 = mu.hwPt2(); + out.ptSTA_3 = mu.hwPtUnconstrained(); } return out; } diff --git a/L1Trigger/L1TMuonBarrel/test/kalmanTools/kmtfAnalysis.py b/L1Trigger/L1TMuonBarrel/test/kalmanTools/kmtfAnalysis.py index f489bd1defca0..a29b918519d17 100644 --- a/L1Trigger/L1TMuonBarrel/test/kalmanTools/kmtfAnalysis.py +++ b/L1Trigger/L1TMuonBarrel/test/kalmanTools/kmtfAnalysis.py @@ -1,9 +1,9 @@ from __future__ import print_function import ROOT,itertools,math # -from array import array # +from array import array # from DataFormats.FWLite import Events, Handle ROOT.FWLiteEnabler.enable() -# +# @@ -24,7 +24,7 @@ class BMTFMuon: def __init__(self,mu,pt,eta,phi): self.muon=mu self.p4 = ROOT.reco.Candidate.PolarLorentzVector(pt,eta,phi,0.105) - + def quality(self): return self.muon.hwQual() @@ -38,7 +38,7 @@ def hasFineEta(self): return self.muon.hwHF() def ptUnconstrained(self): - return self.muon.hwPt2() + return self.muon.hwPtUnconstrained() def dxy(self): return self.muon.hwDXY() @@ -47,7 +47,7 @@ def charge(self): if self.muon.hwSign()>0: return -1 else: - return +1 + return +1 def __getattr__(self, name): return getattr(self.p4,name) @@ -59,7 +59,7 @@ def getQual(track): q=0 for stub in track.stubs(): q+=stub.quality() - return q; + return q; def fetchTP(event,etaMax=0.83): @@ -76,7 +76,7 @@ def fetchTP(event,etaMax=0.83): trigger=tH.product() # for f in range(0,trigger.sizeFilters()): # print(f,trigger.filterLabel(f)) -# import pdb;pdb.set_trace() +# import pdb;pdb.set_trace() obj = trigger.getObjects() index = trigger.filterIndex(ROOT.edm.InputTag("hltL3fL1sMu22Or25L1f0L2f10QL3Filtered27Q::HLT")) if index==trigger.sizeFilters(): @@ -108,7 +108,7 @@ def fetchTP(event,etaMax=0.83): break if isProbe: probes.append(mu) - + return probes @@ -204,10 +204,10 @@ def fetchBMTF(event,isData,etaMax=1.2): K=1.0/pt K=1.181*K/(1+0.4867*K) pt=1.0/K - #### + #### phi=globalBMTFPhi(mu,'BMTF') rawP = rawPhi(mu) - eta = mu.hwEta()*0.010875 + eta = mu.hwEta()*0.010875 if abs(eta)<=etaMax: b = BMTFMuon(mu,pt,eta,phi) b.rawPhi=rawP @@ -231,7 +231,7 @@ def fetchKMTFNew(event,etaMax=1.2,saturate=True): pt=140.0 phi=globalBMTFPhi(mu,'KMTF') rawP = rawPhi(mu) - eta = mu.hwEta()*0.010875 + eta = mu.hwEta()*0.010875 if abs(eta)<=etaMax: b = BMTFMuon(mu,pt,eta,phi) b.rawPhi=rawP @@ -265,7 +265,7 @@ def fetchKMTF(event,etaMax=0.83,patterns=[],comps=[],chis=[],pts=[]): if mu.hitPattern()==p and mu.pt()>pt and (mu.trackCompatibility()>comp or mu.approxChi2()>chi): veto=True break; - if not veto: + if not veto: out.append(mu) return sorted(out,key=lambda x: x.pt(),reverse=True) @@ -299,7 +299,7 @@ def deltaR2( e1, p1, e2, p2): return de*de + dp*dp -def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): +def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): print("--------EVENT"+str(counter)+"------------") print("-----------------------------") print("-----------------------------") @@ -506,7 +506,7 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): # log(counter,stubs,gen,kmtfFull,kmtf,bmtf) - + for track in kmtfFull: chiAll[track.hitPattern()].Fill(abs(track.curvatureAtVertex()),track.approxChi2()) trackCompAll[track.hitPattern()].Fill(abs(track.curvatureAtVertex()),min(track.trackCompatibility(),99.5)); @@ -519,19 +519,19 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): etaKMTF.Fill(track.eta()) fineEtaKMTF.Fill(track.hasFineEta()) - if len(kmtf)>0: - PT=kmtf[0].pt() + if len(kmtf)>0: + PT=kmtf[0].pt() if kmtf[0].pt()>49.99: PT=49.99 - + if abs(kmtf[0].eta())<0.7: rateKMTFp7.Fill(PT) rateKMTF.Fill(PT) - - if len(kmtfFull)>0: - - PT=kmtfFull[0].pt() + + if len(kmtfFull)>0: + + PT=kmtfFull[0].pt() if kmtfFull[0].pt()>49.99: PT=49.99 ratePerTrack[kmtfFull[0].hitPattern()].Fill(PT) @@ -542,17 +542,17 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): etaBMTF.Fill(track.eta()) fineEtaBMTF.Fill(track.hasFineEta()) - if (len(bmtf)>0): - PT=bmtf[0].pt() + if (len(bmtf)>0): + PT=bmtf[0].pt() if bmtf[0].pt()>49.99: - PT=49.99 + PT=49.99 if abs(bmtf[0].eta())<0.7: rateBMTFp7.Fill(PT) rateBMTF.Fill(PT) # if ( len(kmtfFull)>0) and (kmtfFull[0].pt()>50): # log(counter,stubs,gen,kmtfFull,kmtf,bmtf) - + # if (len(kmtf)>0 and kmtf[0].pt()>20) and (len(bmtf)==0 or (len(bmtf)>0 and bmtf[0].pt()<10)): # log(counter,stubs,gen,kmtfFull,kmtf,bmtf) @@ -574,18 +574,18 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): genPhi.Fill(g.phi()) #match *(loosely because we still use coarse eta) - matchedBMTF = filter(lambda x: deltaR(g.eta(),g.phi(),x.eta(),x.phi())<0.3,bmtf) - matchedKMTF = filter(lambda x: deltaR(g.eta(),g.phi(),x.eta(),x.phi())<0.3,kmtf) - matchedKMTFFull = filter(lambda x: deltaR(g.eta(),g.phi(),x.eta(),x.phi())<0.3,kmtfFull) + matchedBMTF = filter(lambda x: deltaR(g.eta(),g.phi(),x.eta(),x.phi())<0.3,bmtf) + matchedKMTF = filter(lambda x: deltaR(g.eta(),g.phi(),x.eta(),x.phi())<0.3,kmtf) + matchedKMTFFull = filter(lambda x: deltaR(g.eta(),g.phi(),x.eta(),x.phi())<0.3,kmtfFull) -# matchedBMTF = filter(lambda x: abs(deltaPhi(g.phi(),x.phi()))<2.5,bmtf) -# matchedKMTF = filter(lambda x: abs(deltaPhi(g.phi(),x.phi()))<2.5,kmtf) -# matchedKMTFFull = filter(lambda x: abs(deltaPhi(g.phi(),x.phi()))<2.5,kmtfFull) +# matchedBMTF = filter(lambda x: abs(deltaPhi(g.phi(),x.phi()))<2.5,bmtf) +# matchedKMTF = filter(lambda x: abs(deltaPhi(g.phi(),x.phi()))<2.5,kmtf) +# matchedKMTFFull = filter(lambda x: abs(deltaPhi(g.phi(),x.phi()))<2.5,kmtfFull) - bestBMTF=None + bestBMTF=None if len(matchedBMTF)>0: bestBMTF = max(matchedBMTF,key = lambda x: x.quality()*1000+x.pt()) resBMTF.Fill(g.pt(),curvResidual(bestBMTF,g)) @@ -598,17 +598,17 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): phiCalibBMTF.Fill(g.charge()/g.pt(),bestBMTF.rawPhi-g.phi()) resRBMTF.Fill(deltaR(g.eta(),g.phi(),bestBMTF.eta(),bestBMTF.phi())) bmtfCalib.Fill(bestBMTF.pt(),bestBMTF.pt()/g.pt()) - - # for the turn on , first cut on pt and then match + + # for the turn on , first cut on pt and then match for threshold in PTThresholds: filteredBMTF = filter(lambda x: x.pt()>=float(threshold),matchedBMTF) if len(filteredBMTF)>0: genPtBMTF[threshold].Fill(g.pt()) if g.pt()>40: genEtaBMTF[threshold].Fill(g.eta()) - - bestKMTF=None + + bestKMTF=None if len(matchedKMTF)>0: bestKMTF = max(matchedKMTF,key = lambda x: 1000*x.quality()+x.pt()) @@ -619,7 +619,7 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): resPTKMTF.Fill(g.pt(),ptResidual(bestKMTF,g)) - + resEtaKMTF.Fill(g.eta(),bestKMTF.eta()-g.eta()) resPhiKMTF.Fill(g.pt(),bestKMTF.rawPhi-genPhiAt2) if g.pt()<140: @@ -629,7 +629,7 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): K = bestKMTF.charge()/bestKMTF.pt() if K==0: K=1; - + # if len(matchedKMTF)>0 and len(matchedBMTF)>0: # if bestBMTF.hasFineEta() and (not bestKMTF.hasFineEta()): @@ -640,18 +640,18 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): # print(s.bxNum(),s.scNum(), s.whNum(), s.stNum(),d ) - + # if abs(curvResidual(bestKMTF,g))>2.: - + for threshold in PTThresholds: filteredKMTF = filter(lambda x: x.pt()>=float(threshold),matchedKMTF) if len(filteredKMTF)>0: genPtKMTF[threshold].Fill(g.pt()) if len(filteredKMTF)>0 and g.pt()>40: genEtaKMTF[threshold].Fill(g.eta()) - + # if (bestKMTF==None or (bestKMTF!=None and bestKMTF.pt()<15)) and bestBMTF!=None and g.pt()>30 and abs(g.eta())>0.15 and abs(g.eta())<0.32: # log(counter,stubs,gen,kmtfFull,kmtf,bmtf) @@ -680,11 +680,11 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): # import pdb;pdb.set_trace() if len(matchedKMTFFull)>0: - bestKMTFFull = max(matchedKMTFFull,key = lambda x: x.rank()*1000+x.pt()) + bestKMTFFull = max(matchedKMTFFull,key = lambda x: x.rank()*1000+x.pt()) chiMatched[bestKMTFFull.hitPattern()].Fill(abs(bestKMTFFull.curvatureAtVertex()),bestKMTFFull.approxChi2()); trackComp[bestKMTFFull.hitPattern()].Fill(abs(bestKMTFFull.curvatureAtVertex()),min(bestKMTFFull.trackCompatibility(),99.5)); - + resKMTFTrack[bestKMTFFull.hitPattern()].Fill(g.pt(),curvResidual(bestKMTFFull,g)) resKMTFTrack[0].Fill(g.pt(),curvResidual(bestKMTFFull,g)) if bestKMTFFull.charge()>0: @@ -697,15 +697,15 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): - - - - + + + + f=ROOT.TFile("results_"+tag+".root","RECREATE") @@ -715,27 +715,27 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): quality.Write() -resKMTF.Write() +resKMTF.Write() for n,t in resKMTFTrack.iteritems(): t.Write() - -resKMTFEta.Write() -resSTAKMTF.Write() -resPTKMTF.Write() + +resKMTFEta.Write() +resSTAKMTF.Write() +resPTKMTF.Write() resBMTF.Write() resBMTFEta.Write() resPTBMTF.Write() -resEtaKMTF.Write() -resEtaBMTF.Write() -resPhiKMTF.Write() -resRKMTF.Write() -resPhiBMTF.Write() +resEtaKMTF.Write() +resEtaBMTF.Write() +resPhiKMTF.Write() +resRKMTF.Write() +resPhiBMTF.Write() phiCalibBMTF.Write() phiCalibKMTF.Write() -resRBMTF.Write() +resRBMTF.Write() #bmtfCalib.Write() #kfCalib.Write() genPt.Write() @@ -761,7 +761,7 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): genPtKMTF[p].Add(genPtBMTF[p],-1) genPtKMTF[p].Divide(genPt) genPtKMTF[p].Write("efficiencyDiffVsPt"+str(p)) - + genEtaKMTF[p].Add(genEtaBMTF[p],-1) genEtaKMTF[p].Divide(genEta) genEtaKMTF[p].Write("efficiencyDiffVsEta"+str(p)) @@ -780,11 +780,11 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): -rateBMTF.Write() +rateBMTF.Write() c = rateBMTF.GetCumulative(False) c.SetLineWidth(3) c.SetLineColor(ROOT.kBlack) -c.Write("normRateBMTF") +c.Write("normRateBMTF") for track in kfCalibPlus.keys(): kfCalibPlus[track].Write() @@ -799,9 +799,9 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): bmtfCalib.Write() -rateKMTF.Write() +rateKMTF.Write() c = rateKMTF.GetCumulative(False) -c.Write("normRateKMTF") +c.Write("normRateKMTF") d = rateBMTF.GetCumulative(False) @@ -809,13 +809,13 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): d.Write("rateRatioBMTFoverKMTF") -rateBMTFp7.Write() +rateBMTFp7.Write() c = rateBMTFp7.GetCumulative(False) -c.Write("normRateBMTFEtaP7") +c.Write("normRateBMTFEtaP7") -rateKMTFp7.Write() +rateKMTFp7.Write() c = rateKMTFp7.GetCumulative(False) -c.Write("normRateKMTFEtaP7") +c.Write("normRateKMTFEtaP7") @@ -823,9 +823,3 @@ def log(counter,mystubs,gen,kmtfFull,kmtf,bmtf): fineEtaBMTF.Write() f.Close() - - - - - - diff --git a/L1Trigger/L1TMuonBarrel/test/kalmanTools/validation.py b/L1Trigger/L1TMuonBarrel/test/kalmanTools/validation.py index 1a58552cd2fb0..a7a515194f274 100644 --- a/L1Trigger/L1TMuonBarrel/test/kalmanTools/validation.py +++ b/L1Trigger/L1TMuonBarrel/test/kalmanTools/validation.py @@ -1,9 +1,9 @@ from __future__ import print_function import ROOT,itertools,math # -from array import array # +from array import array # from DataFormats.FWLite import Events, Handle ROOT.FWLiteEnabler.enable() -# +# @@ -64,7 +64,7 @@ def fetchKMTF(event,etaMax,collection): mu = kbmtf.at(bx,j) kbmtfMuons[bx].append(mu) # kbmtfMuons[bx]=sorted(kbmtfMuons[bx],key=lambda x: x.hwPt(),reverse=True) - return kbmtfMuons + return kbmtfMuons def curvResidual(a,b): return (a.charge()/a.pt()-b.charge()/b.pt())*b.pt()/b.charge() @@ -96,7 +96,7 @@ def deltaR2( e1, p1, e2, p2): return de*de + dp*dp -def log(event,counter,mystubs,kmtf,bmtf): +def log(event,counter,mystubs,kmtf,bmtf): print("--------EVENT"+str(counter)+"------------") print('RUN={run} LUMI={lumi} EVENT={event}'.format(run=event.eventAuxiliary().id().run(),lumi=event.eventAuxiliary().id().luminosityBlock(),event=event.eventAuxiliary().id().event())) print("-----------------------------") @@ -106,10 +106,10 @@ def log(event,counter,mystubs,kmtf,bmtf): print('wheel={w} sector={sc} station={st} high/low={ts} phi={phi} phiB={phiB} qual={qual} BX={BX}'.format(w=stub.whNum(),sc=stub.scNum(),st=stub.stNum(),ts=stub.Ts2Tag(),phi=stub.phi(),phiB=stub.phiB(),qual=stub.code(),BX=stub.bxNum())) print('EMU:') for g in bmtf : - print("EMU sector={sector} pt={pt} eta={eta} phi={phi} qual={qual} dxy={dxy} pt2={pt2} hasFineEta={HF}".format(sector=g.processor(), pt=g.hwPt(),eta=g.hwEta(),phi=g.hwPhi(),qual=g.hwQual(),dxy=g.hwDXY(),pt2=g.hwPt2(),HF=g.hwHF())) + print("EMU sector={sector} pt={pt} eta={eta} phi={phi} qual={qual} dxy={dxy} pt2={pt2} hasFineEta={HF}".format(sector=g.processor(), pt=g.hwPt(),eta=g.hwEta(),phi=g.hwPhi(),qual=g.hwQual(),dxy=g.hwDXY(),pt2=g.hwPtUnconstrained(),HF=g.hwHF())) print('DATA:') for g in kmtf : - print("DATA sector={sector} pt={pt} eta={eta} phi={phi} qual={qual} dxy={dxy} pt2={pt2} hasFineEta={HF}".format(sector=g.processor(),pt=g.hwPt(),eta=g.hwEta(),phi=g.hwPhi(),qual=g.hwQual(),dxy=g.hwDXY(),pt2=g.hwPt2(),HF=g.hwHF())) + print("DATA sector={sector} pt={pt} eta={eta} phi={phi} qual={qual} dxy={dxy} pt2={pt2} hasFineEta={HF}".format(sector=g.processor(),pt=g.hwPt(),eta=g.hwEta(),phi=g.hwPhi(),qual=g.hwQual(),dxy=g.hwDXY(),pt2=g.hwPtUnconstrained(),HF=g.hwHF())) print("-----------------------------") print("-----------------------------") print("c + enter to continue") @@ -185,7 +185,7 @@ def fill(info,mu): info['HF1'].Fill(mu[0].hwHF()) info['qual1'].Fill(mu[0].hwQual()) info['dxy1'].Fill(mu[0].hwDXY()) - info['ptSTA1'].Fill(mu[0].hwPt2()) + info['ptSTA1'].Fill(mu[0].hwPtUnconstrained()) else: info['pt1'].Fill(0) info['eta1'].Fill(0) @@ -202,7 +202,7 @@ def fill(info,mu): info['HF2'].Fill(mu[1].hwHF()) info['qual2'].Fill(mu[1].hwQual()) info['dxy2'].Fill(mu[1].hwDXY()) - info['ptSTA2'].Fill(mu[1].hwPt2()) + info['ptSTA2'].Fill(mu[1].hwPtUnconstrained()) else: info['pt2'].Fill(0) info['eta2'].Fill(0) @@ -219,7 +219,7 @@ def fill(info,mu): info['HF3'].Fill(mu[2].hwHF()) info['qual3'].Fill(mu[2].hwQual()) info['dxy3'].Fill(mu[2].hwDXY()) - info['ptSTA3'].Fill(mu[2].hwPt2()) + info['ptSTA3'].Fill(mu[2].hwPtUnconstrained()) else: info['pt3'].Fill(0) info['eta3'].Fill(0) @@ -248,14 +248,14 @@ def fill(info,mu): stubs=fetchStubsOLD(event,True) unpacker=fetchKMTF(event,100.0,'bmtfDigis:kBMTF') emulator=fetchKMTF(event,100.0,'simKBmtfDigis:BMTF') - - + + for processor in range(0,12): for bx in BUNCHES: emu=filter(lambda x: x.processor()==processor,emulator[bx]) data=filter(lambda x: x.processor()==processor,unpacker[bx]) if (len(emu)+len(data))>0: - + fill(histos['emu'],emu) fill(histos['fw'],data) # if len(emu)!=0 and len(data)==0: @@ -287,16 +287,10 @@ def fill(info,mu): l.AddEntry(histos['fw'][h],"data","p") l.Draw() c.Write("plot_"+h) - - - - - - -f.Close() +f.Close() From 3bf3bffd9a34813eb4b5c0ffe6fa54390f224767 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 23 Apr 2020 19:01:54 +0200 Subject: [PATCH 103/778] Configuring GMT inputs by era --- .../L1TMuon/python/simGmtStage2Digis_cfi.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py b/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py index 26e5562aa1397..25385e675f480 100644 --- a/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py +++ b/L1Trigger/L1TMuon/python/simGmtStage2Digis_cfi.py @@ -7,7 +7,7 @@ ) simGmtStage2Digis = cms.EDProducer('L1TMuonProducer', - barrelTFInput = cms.InputTag("simBmtfDigis", "BMTF"), + barrelTFInput = cms.InputTag("simKBmtfDigis", "BMTF"), overlapTFInput = cms.InputTag("simOmtfDigis", "OMTF"), forwardTFInput = cms.InputTag("simEmtfDigis", "EMTF"), #triggerTowerInput = cms.InputTag("simGmtCaloSumDigis", "TriggerTower2x2s"), @@ -31,3 +31,19 @@ ) ) ) + +## Era: Run2_2016 +from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger +stage2L1Trigger.toModify(simGmtStage2Digis, barrelTFInput = cms.InputTag("simBmtfDigis", "BMTF")) + +## Era: Run2_2017 +from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017 +stage2L1Trigger_2017.toModify(simGmtStage2Digis, barrelTFInput = cms.InputTag("simBmtfDigis", "BMTF")) + +### Era: Run2_2018 +from Configuration.Eras.Modifier_stage2L1Trigger_2018_cff import stage2L1Trigger_2018 +stage2L1Trigger_2018.toModify(simGmtStage2Digis, barrelTFInput = cms.InputTag("simBmtfDigis", "BMTF")) + +### Era: Run3_2021 +from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 +stage2L1Trigger_2021.toModify(simGmtStage2Digis, barrelTFInput = cms.InputTag("simKBmtfDigis", "BMTF")) From 4281b6b96ee121089863828ad01a05f990441161 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 23 Apr 2020 19:02:15 +0200 Subject: [PATCH 104/778] Running KBMTF in parallel to BMTF --- .../Configuration/python/customiseReEmul.py | 22 +++++++++++++++---- L1Trigger/L1TMuon/python/simDigis_cff.py | 4 +++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/L1Trigger/Configuration/python/customiseReEmul.py b/L1Trigger/Configuration/python/customiseReEmul.py index eb3eca67a4970..082ee58efd537 100644 --- a/L1Trigger/Configuration/python/customiseReEmul.py +++ b/L1Trigger/Configuration/python/customiseReEmul.py @@ -75,8 +75,12 @@ def L1TReEmulFromRAW2015(process): srcCSC = "csctfDigis" ) stage2L1Trigger.toModify(process.simBmtfDigis, - DTDigi_Source = "simTwinMuxDigis", - DTDigi_Theta_Source = "dttfDigis" + DTDigi_Source = "simTwinMuxDigis", + DTDigi_Theta_Source = "dttfDigis" + ) + stage2L1Trigger.toModify(process.simKBmtfStubs, + srcPhi = "simTwinMuxDigis", + srcTheta = "dttfDigis" ) stage2L1Trigger.toModify(process.simEmtfDigis, CSCInput = "csctfDigis", @@ -141,8 +145,13 @@ def L1TReEmulFromRAW2016(process): ) # BMTF stage2L1Trigger.toModify(process.simBmtfDigis, - DTDigi_Source = 'simTwinMuxDigis', - DTDigi_Theta_Source = 'bmtfDigis' + DTDigi_Source = "simTwinMuxDigis", + DTDigi_Theta_Source = "bmtfDigis" + ) + # KBMTF + stage2L1Trigger.toModify(process.simKBmtfStubs, + srcPhi = 'simTwinMuxDigis', + srcTheta = 'bmtfDigis' ) # OMTF stage2L1Trigger.toModify(process.simOmtfDigis, @@ -291,6 +300,11 @@ def L1TReEmulFromRAWsimTP(process): DTDigi_Source = 'simTwinMuxDigis', DTDigi_Theta_Source = 'simDtTriggerPrimitiveDigis' ) + # KBMTF + stage2L1Trigger.toModify(process.simKBmtfStubs, + srcPhi = "simTwinMuxDigis", + srcTheta = "simDtTriggerPrimitiveDigis" + ) # OMTF stage2L1Trigger.toModify(process.simOmtfDigis, srcRPC = 'muonRPCDigis', diff --git a/L1Trigger/L1TMuon/python/simDigis_cff.py b/L1Trigger/L1TMuon/python/simDigis_cff.py index 2aaae7634b403..4263ff9b6ea92 100644 --- a/L1Trigger/L1TMuon/python/simDigis_cff.py +++ b/L1Trigger/L1TMuon/python/simDigis_cff.py @@ -75,6 +75,8 @@ # from L1Trigger.L1TTwinMux.simTwinMuxDigis_cfi import * from L1Trigger.L1TMuonBarrel.simBmtfDigis_cfi import * +from L1Trigger.L1TMuonBarrel.simKBmtfStubs_cfi import * +from L1Trigger.L1TMuonBarrel.simKBmtfDigis_cfi import * from L1Trigger.L1TMuonEndCap.simEmtfDigis_cfi import * from L1Trigger.L1TMuonOverlap.simOmtfDigis_cfi import * from L1Trigger.L1TMuon.simGmtCaloSumDigis_cfi import * @@ -82,7 +84,7 @@ from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger # # -stage2L1Trigger.toReplaceWith(SimL1TMuonTask, cms.Task(SimL1TMuonCommonTask, simTwinMuxDigis, simBmtfDigis, simEmtfDigis, simOmtfDigis, simGmtCaloSumDigis, simGmtStage2Digis)) +stage2L1Trigger.toReplaceWith(SimL1TMuonTask, cms.Task(SimL1TMuonCommonTask, simTwinMuxDigis, simBmtfDigis, simKBmtfStubs, simKBmtfDigis, simEmtfDigis, simOmtfDigis, simGmtCaloSumDigis, simGmtStage2Digis)) # # Phase-2 Trigger From 7273926ef760e6694605a6ce8b8780735e95f3cd Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Wed, 29 Apr 2020 16:19:38 +0200 Subject: [PATCH 105/778] Refactor muon packer in preparation for Run-3 data format --- .../implementations_stage2/MuonPacker.cc | 82 ++++++++++++------- .../implementations_stage2/MuonPacker.h | 9 +- .../L1TRawToDigi/python/gmtStage2Raw_cfi.py | 17 ++++ .../L1TRawToDigi/python/gtStage2Raw_cfi.py | 20 ++++- .../L1TMuon/interface/MuonRawDigiTranslator.h | 18 ++-- .../L1TMuon/src/MuonRawDigiTranslator.cc | 18 +++- 6 files changed, 115 insertions(+), 49 deletions(-) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc index 6118fdf7c332d..36139bcaca905 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc @@ -13,36 +13,8 @@ namespace l1t { PayloadMap payloadMap; - for (int i = muons->getFirstBX(); i <= muons->getLastBX(); ++i) { - // the first muon in every BX and every block id is 0 - for (unsigned int blkId = b1_; blkId < b1_ + 7; blkId += 2) { - payloadMap[blkId].push_back(0); - payloadMap[blkId].push_back(0); - } - - unsigned int blkId = b1_; - int muCtr = 1; - for (auto mu = muons->begin(i); mu != muons->end(i) && muCtr <= 8; ++mu, ++muCtr) { - uint32_t msw = 0; - uint32_t lsw = 0; - - MuonRawDigiTranslator::generatePackedDataWords(*mu, lsw, msw); - - payloadMap[blkId].push_back(lsw); - payloadMap[blkId].push_back(msw); - - // go to next block id after two muons - if (muCtr % 2 == 0) { - blkId += 2; - } - } - - // padding empty muons to reach 3 muons per block id per BX - for (auto& kv : payloadMap) { - while (kv.second.size() % 6 != 0) { - kv.second.push_back(0); - } - } + for (int bx = muons->getFirstBX(); bx <= muons->getLastBX(); ++bx) { + packBx(payloadMap, muons, bx); } Blocks blocks; @@ -53,8 +25,58 @@ namespace l1t { } return blocks; } + + void MuonPacker::packBx(PayloadMap& payloadMap, const edm::Handle& muons, int bx) { + // the first word in every BX and every block id is 0 + for (unsigned int blkId = b1_; blkId < b1_ + 7; blkId += 2) { + payloadMap[blkId].push_back(0); + } + + unsigned int blkId = b1_; + auto mu { muons->begin(bx) }; + uint32_t shared_word { 0 }; + uint32_t mu1_msw { 0 }; + uint32_t mu2_msw { 0 }; + uint32_t mu1_lsw { 0 }; + uint32_t mu2_lsw { 0 }; + // Slightly convoluted logic to account for the Run-3 muon readout record: + // To make space for displacement information we moved the raw (i.e. non-extrapolated) eta value to the second "spare" word + // in the block which we call "shared word". So the logic below needs to be aware if it is operating on the first or second + // muon in the block in order tp place the eta value in the right place in the shared word. Additionally the logic needs to + // wait for the second muon in the block before filling the payload map because the shared word goes in first. + for (int muCtr = 1; muCtr <= 8; ++muCtr) { + + if (mu != muons->end(bx)) { + MuonRawDigiTranslator::generatePackedDataWords(*mu, shared_word, mu2_lsw, mu2_msw, fedId_, fwId_, 2-(muCtr%2)); + ++mu; + } + + // If we're remaining in the current block the muon we just packed is the first one in the block. + // If not we add both muons to the payload map and go to the next block. + // TODO: Handle case when there's only one muon in the block. + if (muCtr % 2 == 1) { + mu1_lsw = mu2_lsw; + mu1_msw = mu2_msw; + } else { + payloadMap[blkId].push_back(shared_word); + payloadMap[blkId].push_back(mu1_lsw); + payloadMap[blkId].push_back(mu1_msw); + payloadMap[blkId].push_back(mu2_lsw); + payloadMap[blkId].push_back(mu2_msw); + + blkId += 2; + + shared_word = 0; + mu1_lsw = 0; + mu1_msw = 0; + } + mu2_lsw = 0; + mu2_msw = 0; + } + } } // namespace stage2 } // namespace l1t DEFINE_L1T_PACKER(l1t::stage2::GTMuonPacker); DEFINE_L1T_PACKER(l1t::stage2::GMTMuonPacker); + diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h index 11bd4b96c7457..e0a3c710ffb6a 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h @@ -8,12 +8,19 @@ namespace l1t { namespace stage2 { class MuonPacker : public Packer { public: - MuonPacker(unsigned b1) : b1_(b1) {} + MuonPacker(unsigned b1) : b1_(b1), fwId_(0) {} Blocks pack(const edm::Event&, const PackerTokens*) override; unsigned b1_; + inline void setFwVersion(unsigned fwId) { fwId_ = fwId; }; + inline void setFed(unsigned fedId) { fedId_ = fedId; }; private: typedef std::map> PayloadMap; + + void packBx(PayloadMap& payloadMap, const edm::Handle& muons, int bx); // TODO: Muons probably can't be const because I'm using an iterator on them. + + unsigned fwId_; + unsigned fedId_; }; class GTMuonPacker : public MuonPacker { diff --git a/EventFilter/L1TRawToDigi/python/gmtStage2Raw_cfi.py b/EventFilter/L1TRawToDigi/python/gmtStage2Raw_cfi.py index a949a2394519e..9d322767feb09 100644 --- a/EventFilter/L1TRawToDigi/python/gmtStage2Raw_cfi.py +++ b/EventFilter/L1TRawToDigi/python/gmtStage2Raw_cfi.py @@ -17,3 +17,20 @@ lenSlinkHeader = cms.untracked.int32(8), lenSlinkTrailer = cms.untracked.int32(8) ) + +## Era: Run2_2016 +from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger +stage2L1Trigger.toModify(gmtStage2Raw, BMTFInputLabel = cms.InputTag("simBmtfDigis", "BMTF"), FWId = cms.uint32(0x3000000)) + +## Era: Run2_2017 +from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017 +stage2L1Trigger_2017.toModify(gmtStage2Raw, BMTFInputLabel = cms.InputTag("simBmtfDigis", "BMTF"), FWId = cms.uint32(0x4010000)) + +### Era: Run2_2018 +from Configuration.Eras.Modifier_stage2L1Trigger_2018_cff import stage2L1Trigger_2018 +stage2L1Trigger_2018.toModify(gmtStage2Raw, BMTFInputLabel = cms.InputTag("simBmtfDigis", "BMTF"), FWId = cms.uint32(0x4010000)) + +### Era: Run3_2021 +from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 +stage2L1Trigger_2021.toModify(gmtStage2Raw, BMTFInputLabel = cms.InputTag("simKBmtfDigis", "BMTF"), FWId = cms.uint32(0x6000000)) + diff --git a/EventFilter/L1TRawToDigi/python/gtStage2Raw_cfi.py b/EventFilter/L1TRawToDigi/python/gtStage2Raw_cfi.py index 7941872c0c3d8..8bfb66b9f7629 100644 --- a/EventFilter/L1TRawToDigi/python/gtStage2Raw_cfi.py +++ b/EventFilter/L1TRawToDigi/python/gtStage2Raw_cfi.py @@ -12,8 +12,24 @@ JetInputTag = cms.InputTag("simCaloStage2Digis"), EtSumInputTag = cms.InputTag("simCaloStage2Digis"), FedId = cms.int32(1404), - ## FWId = cms.uint32(0x10A6), # FW version in GMT with vtx-etrapolation - FWId = cms.uint32(0x10F2), # FW version for packing new HI centrality variables + FWId = cms.uint32(0x1120), # FW w/ displaced muon info. lenSlinkHeader = cms.untracked.int32(8), lenSlinkTrailer = cms.untracked.int32(8) ) + +## Era: Run2_2016 +from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger +stage2L1Trigger.toModify(gtStage2Raw, FWId = cms.uint32(0x1000)) # FW w/o coordinates at vtx. + +## Era: Run2_2017 +from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017 +stage2L1Trigger_2017.toModify(gtStage2Raw, FWId = cms.uint32(0x10A6)) # FW w/ vtx extrapolation. + +### Era: Run2_2018 +from Configuration.Eras.Modifier_stage2L1Trigger_2018_cff import stage2L1Trigger_2018 +stage2L1Trigger_2018.toModify(gtStage2Raw, FWId = cms.uint32(0x10F2)) # FW w/ new HI centrality variables & vtx extrapolation. + +### Era: Run3_2021 +from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 +stage2L1Trigger_2021.toModify(gtStage2Raw, FWId = cms.uint32(0x1120)) # FW w/ displaced muon info. + diff --git a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h index 55f91d8508961..31341fc03ae29 100644 --- a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h @@ -6,18 +6,11 @@ namespace l1t { class MuonRawDigiTranslator { public: - static void fillMuon(Muon& mu, - uint32_t raw_data_spare, - uint32_t raw_data_00_31, - uint32_t raw_data_32_63, - int fed, - unsigned int fw, - int muInBx); - static void fillMuon(Muon& mu, uint32_t raw_data_spare, uint64_t dataword, int fed, unsigned int fw, int muInBx); - static void fillIntermediateMuon(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, unsigned int fw); - static void generatePackedDataWords(const Muon&, uint32_t&, uint32_t&); - static uint64_t generate64bitDataWord(const Muon&); - static int calcHwEta(const uint32_t& raw, const unsigned absEtaShift, const unsigned etaSignShift); + static void fillMuon(Muon&, uint32_t, uint32_t, int, unsigned int); + static void fillMuon(Muon&, uint64_t, int, unsigned int); + static void generatePackedDataWords(const Muon& mu, uint32_t& raw_data_spare, uint32_t& raw_data_00_31, uint32_t& raw_data_32_63, int fedId, int fwId, int muInBx); + static void generate64bitDataWord(const Muon& mu, uint32_t& raw_data_spare, uint64_t& dataword, int fedId, int fwId, int muInBx); + static int calcHwEta(const uint32_t&, const unsigned, const unsigned); static constexpr unsigned ptMask_ = 0x1FF; static constexpr unsigned ptShift_ = 10; @@ -58,3 +51,4 @@ namespace l1t { } // namespace l1t #endif + diff --git a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc index 44ca904a2a615..ddaa20a08c231 100644 --- a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc @@ -157,8 +157,12 @@ void l1t::MuonRawDigiTranslator::fillIntermediateMuonQuantitiesRun3(Muon& mu, } void l1t::MuonRawDigiTranslator::generatePackedDataWords(const Muon& mu, + uint32_t& raw_data_spare, uint32_t& raw_data_00_31, - uint32_t& raw_data_32_63) { + uint32_t& raw_data_32_63, + int fedID, + int fwID, + int muInBx) { int abs_eta = mu.hwEta(); if (abs_eta < 0) { abs_eta += (1 << (etaSignShift_ - absEtaShift_)); @@ -177,12 +181,17 @@ void l1t::MuonRawDigiTranslator::generatePackedDataWords(const Muon& mu, (mu.hwPhi() & phiMask_) << phiShift_; } -uint64_t l1t::MuonRawDigiTranslator::generate64bitDataWord(const Muon& mu) { +void l1t::MuonRawDigiTranslator::generate64bitDataWord(const Muon& mu, + uint32_t& raw_data_spare, + uint64_t& dataword, + int fedId, + int fwId, + int muInBx) { uint32_t lsw; uint32_t msw; - generatePackedDataWords(mu, lsw, msw); - return (((uint64_t)msw) << 32) + lsw; + generatePackedDataWords(mu, raw_data_spare, lsw, msw, fedId, fwId, muInBx); + dataword = (((uint64_t)msw) << 32) + lsw; } int l1t::MuonRawDigiTranslator::calcHwEta(const uint32_t& raw, @@ -196,3 +205,4 @@ int l1t::MuonRawDigiTranslator::calcHwEta(const uint32_t& raw, return abs_eta; } } + From 14e8bbc8fcfc4e6377199918368f3bea78014de2 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Sun, 3 May 2020 19:10:16 +0200 Subject: [PATCH 106/778] MuonPacker packs according to era Packs correctly for Run-2 2016, Run-2 from 2017 (w/ extrapolated coordiantes), and Run-3 --- .../implementations_stage2/GMTSetup.cc | 7 ++- .../plugins/implementations_stage2/GTSetup.cc | 21 ++++---- .../implementations_stage2/MuonPacker.cc | 42 ++++++++------- .../implementations_stage2/MuonPacker.h | 11 ++-- .../L1TMuon/interface/MuonRawDigiTranslator.h | 20 ++++--- .../L1TMuon/src/MuonRawDigiTranslator.cc | 54 +++++++++++++------ 6 files changed, 95 insertions(+), 60 deletions(-) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc index 56ef3d0cdcab7..dc45a6e5f2438 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc @@ -6,6 +6,7 @@ #include "EventFilter/L1TRawToDigi/plugins/UnpackerFactory.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h" +#include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.h" @@ -40,9 +41,13 @@ namespace l1t { PackerMap res; if (fed == 1402) { // Use amc_no and board id 1 for packing + auto gmt_out_packer = + static_pointer_cast(PackerFactory::get()->make("stage2::GMTMuonPacker")); + gmt_out_packer->setFed(fed); + gmt_out_packer->setFwVersion(fw); res[{1, 1}] = { PackerFactory::get()->make("stage2::RegionalMuonGMTPacker"), - PackerFactory::get()->make("stage2::GMTMuonPacker"), + gmt_out_packer, PackerFactory::get()->make("stage2::IntermediateMuonPacker"), }; } diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GTSetup.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GTSetup.cc index 7ef5bdadc5d93..11b6aec6befd5 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GTSetup.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GTSetup.cc @@ -2,6 +2,7 @@ #include "EventFilter/L1TRawToDigi/plugins/PackingSetupFactory.h" #include "EventFilter/L1TRawToDigi/plugins/UnpackerFactory.h" +#include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/EGammaUnpacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/EtSumUnpacker.h" @@ -31,15 +32,17 @@ namespace l1t { if (fed == 1404) { // Use board id 1 for packing - res[{1, 1}] = { - - PackerFactory::get()->make("stage2::GTMuonPacker"), - PackerFactory::get()->make("stage2::GTEGammaPacker"), - PackerFactory::get()->make("stage2::GTEtSumPacker"), - PackerFactory::get()->make("stage2::GTJetPacker"), - PackerFactory::get()->make("stage2::GTTauPacker"), - PackerFactory::get()->make("stage2::GlobalAlgBlkPacker"), - PackerFactory::get()->make("stage2::GlobalExtBlkPacker")}; + auto gt_muon_packer = + static_pointer_cast(PackerFactory::get()->make("stage2::GTMuonPacker")); + gt_muon_packer->setFed(fed); + gt_muon_packer->setFwVersion(fw); + res[{1, 1}] = {gt_muon_packer, + PackerFactory::get()->make("stage2::GTEGammaPacker"), + PackerFactory::get()->make("stage2::GTEtSumPacker"), + PackerFactory::get()->make("stage2::GTJetPacker"), + PackerFactory::get()->make("stage2::GTTauPacker"), + PackerFactory::get()->make("stage2::GlobalAlgBlkPacker"), + PackerFactory::get()->make("stage2::GlobalExtBlkPacker")}; } return res; diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc index 36139bcaca905..f2d62ae8f8470 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.cc @@ -1,7 +1,5 @@ -#include "FWCore/Framework/interface/Event.h" #include "EventFilter/L1TRawToDigi/plugins/PackerFactory.h" -#include "L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h" #include "GMTTokens.h" #include "MuonPacker.h" @@ -14,13 +12,12 @@ namespace l1t { PayloadMap payloadMap; for (int bx = muons->getFirstBX(); bx <= muons->getLastBX(); ++bx) { - packBx(payloadMap, muons, bx); + packBx(payloadMap, muons, bx); } Blocks blocks; // push everything in the blocks vector for (auto& kv : payloadMap) { - //cout << kv.first << ": " << kv.second.size() << kv.second[0] << "\n"; blocks.push_back(Block(kv.first, kv.second)); } return blocks; @@ -33,32 +30,37 @@ namespace l1t { } unsigned int blkId = b1_; - auto mu { muons->begin(bx) }; - uint32_t shared_word { 0 }; - uint32_t mu1_msw { 0 }; - uint32_t mu2_msw { 0 }; - uint32_t mu1_lsw { 0 }; - uint32_t mu2_lsw { 0 }; + auto mu{muons->begin(bx)}; + uint32_t mu1_shared_word{0}; + uint32_t mu2_shared_word{0}; + uint32_t mu1_msw{0}; + uint32_t mu2_msw{0}; + uint32_t mu1_lsw{0}; + uint32_t mu2_lsw{0}; // Slightly convoluted logic to account for the Run-3 muon readout record: - // To make space for displacement information we moved the raw (i.e. non-extrapolated) eta value to the second "spare" word - // in the block which we call "shared word". So the logic below needs to be aware if it is operating on the first or second - // muon in the block in order tp place the eta value in the right place in the shared word. Additionally the logic needs to - // wait for the second muon in the block before filling the payload map because the shared word goes in first. + // To make space for displacement information we moved the raw + // (i.e. non-extrapolated) eta value to the second "spare" word + // in the block which we call "shared word". So the logic below + // needs to be aware if it is operating on the first or second + // muon in the block in order to place the eta value in the right + // place in the shared word. Additionally the logic needs to + // wait for the second muon in the block before filling the + // payload map because the shared word goes in first. for (int muCtr = 1; muCtr <= 8; ++muCtr) { - if (mu != muons->end(bx)) { - MuonRawDigiTranslator::generatePackedDataWords(*mu, shared_word, mu2_lsw, mu2_msw, fedId_, fwId_, 2-(muCtr%2)); + MuonRawDigiTranslator::generatePackedDataWords( + *mu, mu2_shared_word, mu2_lsw, mu2_msw, fedId_, fwId_, 2 - (muCtr % 2)); ++mu; } // If we're remaining in the current block the muon we just packed is the first one in the block. // If not we add both muons to the payload map and go to the next block. - // TODO: Handle case when there's only one muon in the block. if (muCtr % 2 == 1) { + mu1_shared_word = mu2_shared_word; mu1_lsw = mu2_lsw; mu1_msw = mu2_msw; } else { - payloadMap[blkId].push_back(shared_word); + payloadMap[blkId].push_back(mu1_shared_word | mu2_shared_word); payloadMap[blkId].push_back(mu1_lsw); payloadMap[blkId].push_back(mu1_msw); payloadMap[blkId].push_back(mu2_lsw); @@ -66,10 +68,11 @@ namespace l1t { blkId += 2; - shared_word = 0; + mu1_shared_word = 0; mu1_lsw = 0; mu1_msw = 0; } + mu2_shared_word = 0; mu2_lsw = 0; mu2_msw = 0; } @@ -79,4 +82,3 @@ namespace l1t { DEFINE_L1T_PACKER(l1t::stage2::GTMuonPacker); DEFINE_L1T_PACKER(l1t::stage2::GMTMuonPacker); - diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h index e0a3c710ffb6a..7cb46c12845bb 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h @@ -2,13 +2,16 @@ #define L1T_PACKER_STAGE2_MUONPACKER_H #include +#include "FWCore/Framework/interface/Event.h" #include "EventFilter/L1TRawToDigi/interface/Packer.h" +#include "L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h" + namespace l1t { namespace stage2 { class MuonPacker : public Packer { public: - MuonPacker(unsigned b1) : b1_(b1), fwId_(0) {} + MuonPacker(unsigned b1) : b1_(b1) {} Blocks pack(const edm::Event&, const PackerTokens*) override; unsigned b1_; inline void setFwVersion(unsigned fwId) { fwId_ = fwId; }; @@ -17,10 +20,10 @@ namespace l1t { private: typedef std::map> PayloadMap; - void packBx(PayloadMap& payloadMap, const edm::Handle& muons, int bx); // TODO: Muons probably can't be const because I'm using an iterator on them. + void packBx(PayloadMap& payloadMap, const edm::Handle& muons, int bx); - unsigned fwId_; - unsigned fedId_; + unsigned fwId_{0}; + unsigned fedId_{0}; }; class GTMuonPacker : public MuonPacker { diff --git a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h index 31341fc03ae29..6708a6b512463 100644 --- a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h @@ -8,8 +8,15 @@ namespace l1t { public: static void fillMuon(Muon&, uint32_t, uint32_t, int, unsigned int); static void fillMuon(Muon&, uint64_t, int, unsigned int); - static void generatePackedDataWords(const Muon& mu, uint32_t& raw_data_spare, uint32_t& raw_data_00_31, uint32_t& raw_data_32_63, int fedId, int fwId, int muInBx); - static void generate64bitDataWord(const Muon& mu, uint32_t& raw_data_spare, uint64_t& dataword, int fedId, int fwId, int muInBx); + static void generatePackedDataWords(const Muon& mu, + uint32_t& raw_data_spare, + uint32_t& raw_data_00_31, + uint32_t& raw_data_32_63, + int fedId, + int fwId, + int muInBx); + static void generate64bitDataWord( + const Muon& mu, uint32_t& raw_data_spare, uint64_t& dataword, int fedId, int fwId, int muInBx); static int calcHwEta(const uint32_t&, const unsigned, const unsigned); static constexpr unsigned ptMask_ = 0x1FF; @@ -39,16 +46,7 @@ namespace l1t { static constexpr unsigned etaMu1SignShift_ = 20; // For Run-3 static constexpr unsigned absEtaMu2Shift_ = 21; // For Run-3 static constexpr unsigned etaMu2SignShift_ = 29; // For Run-3 - - private: - static void fillMuonStableQuantities(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); - static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); - static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); - static void fillMuonQuantitiesRun3( - Muon& mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx); - static void fillIntermediateMuonQuantitiesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); }; } // namespace l1t #endif - diff --git a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc index ddaa20a08c231..cbe5ab0ace5e9 100644 --- a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc @@ -171,22 +171,47 @@ void l1t::MuonRawDigiTranslator::generatePackedDataWords(const Muon& mu, if (abs_eta_at_vtx < 0) { abs_eta_at_vtx += (1 << (etaAtVtxSignShift_ - absEtaAtVtxShift_)); } - raw_data_00_31 = (mu.hwPt() & ptMask_) << ptShift_ | (mu.hwQual() & qualMask_) << qualShift_ | - (abs_eta_at_vtx & absEtaMask_) << absEtaAtVtxShift_ | (mu.hwEtaAtVtx() < 0) << etaAtVtxSignShift_ | - (mu.hwPhiAtVtx() & phiMask_) << phiAtVtxShift_; - - raw_data_32_63 = mu.hwCharge() << chargeShift_ | mu.hwChargeValid() << chargeValidShift_ | - (mu.tfMuonIndex() & tfMuonIndexMask_) << tfMuonIndexShift_ | (mu.hwIso() & isoMask_) << isoShift_ | - (abs_eta & absEtaMask_) << absEtaShift_ | (mu.hwEta() < 0) << etaSignShift_ | - (mu.hwPhi() & phiMask_) << phiShift_; + if ((fedID == 1402 && fwID < 0x4010000) || (fedID == 1404 && fwID < 0x10A6)) { + // For 2016 the non-extrapolated coordiantes were in the place that are now occupied by the extrapolated quantities. + raw_data_spare = 0; + raw_data_00_31 = (mu.hwPt() & ptMask_) << ptShift_ | (mu.hwQual() & qualMask_) << qualShift_ | + (abs_eta & absEtaMask_) << absEtaAtVtxShift_ | (mu.hwEta() < 0) << etaAtVtxSignShift_ | + (mu.hwPhi() & phiMask_) << phiAtVtxShift_; + raw_data_32_63 = mu.hwCharge() << chargeShift_ | mu.hwChargeValid() << chargeValidShift_ | + (mu.tfMuonIndex() & tfMuonIndexMask_) << tfMuonIndexShift_ | (mu.hwIso() & isoMask_) << isoShift_; + } else if ((fedID == 1402 && fwID < 0x6000000) || (fedID == 1404 && fwID < 0x1120)) { + raw_data_spare = 0; + raw_data_00_31 = (mu.hwPt() & ptMask_) << ptShift_ | (mu.hwQual() & qualMask_) << qualShift_ | + (abs_eta_at_vtx & absEtaMask_) << absEtaAtVtxShift_ | (mu.hwEtaAtVtx() < 0) << etaAtVtxSignShift_ | + (mu.hwPhiAtVtx() & phiMask_) << phiAtVtxShift_; + + raw_data_32_63 = mu.hwCharge() << chargeShift_ | mu.hwChargeValid() << chargeValidShift_ | + (mu.tfMuonIndex() & tfMuonIndexMask_) << tfMuonIndexShift_ | (mu.hwIso() & isoMask_) << isoShift_ | + (abs_eta & absEtaMask_) << absEtaShift_ | (mu.hwEta() < 0) << etaSignShift_ | + (mu.hwPhi() & phiMask_) << phiShift_; + } else { + int absEtaShiftRun3{0}, etaSignShiftRun3{0}; + if (muInBx == 1) { + absEtaShiftRun3 = absEtaMu1Shift_; + etaSignShiftRun3 = etaMu1SignShift_; + } else if (muInBx == 2) { + absEtaShiftRun3 = absEtaMu2Shift_; + etaSignShiftRun3 = etaMu2SignShift_; + } + raw_data_spare = (abs_eta & absEtaMask_) << absEtaShiftRun3 | (mu.hwEta() < 0) << etaSignShiftRun3; + raw_data_00_31 = (mu.hwPt() & ptMask_) << ptShift_ | (mu.hwQual() & qualMask_) << qualShift_ | + (abs_eta_at_vtx & absEtaMask_) << absEtaAtVtxShift_ | (mu.hwEtaAtVtx() < 0) << etaAtVtxSignShift_ | + (mu.hwPhiAtVtx() & phiMask_) << phiAtVtxShift_; + raw_data_32_63 = mu.hwCharge() << chargeShift_ | mu.hwChargeValid() << chargeValidShift_ | + (mu.tfMuonIndex() & tfMuonIndexMask_) << tfMuonIndexShift_ | (mu.hwIso() & isoMask_) << isoShift_ | + (mu.hwPhi() & phiMask_) << phiShift_ | + (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << ptUnconstrainedShift_ | + (mu.hwDXY() & dxyMask_) << dxyShift_; + } } -void l1t::MuonRawDigiTranslator::generate64bitDataWord(const Muon& mu, - uint32_t& raw_data_spare, - uint64_t& dataword, - int fedId, - int fwId, - int muInBx) { +void l1t::MuonRawDigiTranslator::generate64bitDataWord( + const Muon& mu, uint32_t& raw_data_spare, uint64_t& dataword, int fedId, int fwId, int muInBx) { uint32_t lsw; uint32_t msw; @@ -205,4 +230,3 @@ int l1t::MuonRawDigiTranslator::calcHwEta(const uint32_t& raw, return abs_eta; } } - From e7b732f45848bc3a8fcbf052e9fec27503bbbbdc Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Thu, 16 May 2019 15:53:36 +0200 Subject: [PATCH 107/778] Added raw track addresses to L1UpgradeTfMuon branch of L1TNtuples The original field with track addresses was filled with incorrect or incomplete values for most TFs. Using static function from RegionalMuonRawDigiTranslator that I factored out in order to generate the raw track address. --- .../L1AnalysisL1UpgradeTfMuonDataFormat.h | 3 +-- .../src/L1AnalysisL1UpgradeTfMuon.cc | 24 +------------------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h index eb1105d2ff8b3..a6bb8995ec5e6 100644 --- a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h +++ b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h @@ -45,8 +45,7 @@ namespace L1Analysis { std::vector tfMuonBx; std::vector tfMuonWh; std::vector tfMuonTrAdd; - std::vector> tfMuonDecodedTrAdd; - std::vector tfMuonHwTrAdd; + std::vector tfMuonRawTrAdd; }; } // namespace L1Analysis #endif diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc index 4bb09bebb66d1..3e088991ffc35 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc @@ -24,7 +24,6 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrackFinderType.push_back(it->trackFinderType()); l1upgradetfmuon_.tfMuonHwHF.push_back(it->hwHF()); l1upgradetfmuon_.tfMuonBx.push_back(ibx); - std::map decoded_track_address; if (it->trackFinderType() == l1t::tftype::bmtf) { int detSide = it->trackSubAddress(l1t::RegionalMuonCand::kWheelSide); int wheelNum = it->trackSubAddress(l1t::RegionalMuonCand::kWheelNum); @@ -39,29 +38,8 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrAdd.push_back(stat2); l1upgradetfmuon_.tfMuonTrAdd.push_back(stat3); l1upgradetfmuon_.tfMuonTrAdd.push_back(stat4); - - decoded_track_address["wheel"] = wheel; - decoded_track_address["station1"] = stat1; - decoded_track_address["station2"] = stat2; - decoded_track_address["station3"] = stat3; - decoded_track_address["station4"] = stat4; - } else if (it->trackFinderType() == l1t::omtf_neg || it->trackFinderType() == l1t::omtf_pos) { - decoded_track_address["kLayers"] = it->trackSubAddress(l1t::RegionalMuonCand::kLayers); - decoded_track_address["kWeight"] = it->trackSubAddress(l1t::RegionalMuonCand::kWeight); - } else if (it->trackFinderType() == l1t::emtf_neg || it->trackFinderType() == l1t::emtf_pos) { - decoded_track_address["kME1Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME1Seg); - decoded_track_address["kME1Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME1Ch); - decoded_track_address["kME2Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME2Seg); - decoded_track_address["kME2Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME2Ch); - decoded_track_address["kME3Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME3Seg); - decoded_track_address["kME3Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME3Ch); - decoded_track_address["kME4Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME4Seg); - decoded_track_address["kME4Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME4Ch); - decoded_track_address["kTrkNum"] = it->trackSubAddress(l1t::RegionalMuonCand::kTrkNum); - decoded_track_address["kBX"] = it->trackSubAddress(l1t::RegionalMuonCand::kBX); } - l1upgradetfmuon_.tfMuonDecodedTrAdd.push_back(decoded_track_address); - l1upgradetfmuon_.tfMuonHwTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it)); + l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it)); l1upgradetfmuon_.nTfMuons++; } From 56719dfc56e03d7497962fe22b1cfb863f6401ba Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 18 May 2020 12:16:57 +0200 Subject: [PATCH 108/778] Regional muon packer adapted for Kalman muons from BMTF Includes configuration of packer by Era. Modifications still needed for the BMTF setup to make use of this. --- .../BMTFPackerOutput.cc | 18 +++++------ .../implementations_stage2/BMTFPackerOutput.h | 3 ++ .../implementations_stage2/GMTSetup.cc | 12 +++++-- .../RegionalMuonGMTPacker.cc | 2 +- .../RegionalMuonGMTPacker.h | 3 ++ .../L1TRawToDigi/python/bmtfStage2Raw_cfi.py | 16 ++++++++++ .../interface/RegionalMuonRawDigiTranslator.h | 16 +++++----- .../src/RegionalMuonRawDigiTranslator.cc | 32 +++++++++++-------- 8 files changed, 67 insertions(+), 35 deletions(-) diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.cc index 4379ce88bcbbf..57a180018b244 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.cc @@ -21,7 +21,7 @@ namespace l1t { for (auto imu = muons->begin(); imu != muons->end(); imu++) { if (imu->processor() + 1 == board_id) { uint32_t firstWord(0), lastWord(0); - RegionalMuonRawDigiTranslator::generatePackedDataWords(*imu, firstWord, lastWord); + RegionalMuonRawDigiTranslator::generatePackedDataWords(*imu, firstWord, lastWord, isKalman_); payloadMap_[bmtfBlockID].push_back(firstWord); //imu->link()*2+1 payloadMap_[bmtfBlockID].push_back(lastWord); //imu->link()*2+1 } @@ -51,14 +51,14 @@ namespace l1t { blocks.push_back(block); /* - //debug from here - std::cout << "block id : " << block.header().getID() << std::endl; - - std::cout << "payload created : " << std::endl; - for (auto &word : block.payload()) - std::cout << std::bitset<32>(word).to_string() << std::endl; - //debug up to here - */ + //debug from here + std::cout << "block id : " << block.header().getID() << std::endl; + + std::cout << "payload created : " << std::endl; + for (auto &word : block.payload()) + std::cout << std::bitset<32>(word).to_string() << std::endl; + //debug up to here + */ return blocks; } diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.h index b80c6a944ba18..12396a2616595 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/BMTFPackerOutput.h @@ -11,9 +11,12 @@ namespace l1t { class BMTFPackerOutput : public Packer { public: Blocks pack(const edm::Event&, const PackerTokens*) override; + void setKalmanAlgoTrue() { isKalman_ = true; }; private: std::map > payloadMap_; + + bool isKalman_{false}; }; } // namespace stage2 } // namespace l1t diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc index dc45a6e5f2438..86430eee00ec3 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/GMTSetup.cc @@ -6,9 +6,10 @@ #include "EventFilter/L1TRawToDigi/plugins/UnpackerFactory.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTUnpacker.h" +#include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonPacker.h" -#include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.h" #include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/IntermediateMuonUnpacker.h" +#include "EventFilter/L1TRawToDigi/plugins/implementations_stage2/MuonUnpacker.h" #include "GMTSetup.h" @@ -40,13 +41,18 @@ namespace l1t { PackerMap GMTSetup::getPackers(int fed, unsigned int fw) { PackerMap res; if (fed == 1402) { - // Use amc_no and board id 1 for packing + auto gmt_in_packer = static_pointer_cast( + PackerFactory::get()->make("stage2::RegionalMuonGMTPacker")); + if (fw >= 0x6000000) { + gmt_in_packer->setKalmanAlgoTrue(); + } auto gmt_out_packer = static_pointer_cast(PackerFactory::get()->make("stage2::GMTMuonPacker")); gmt_out_packer->setFed(fed); gmt_out_packer->setFwVersion(fw); + // Use amc_no and board id 1 for packing res[{1, 1}] = { - PackerFactory::get()->make("stage2::RegionalMuonGMTPacker"), + gmt_in_packer, gmt_out_packer, PackerFactory::get()->make("stage2::IntermediateMuonPacker"), }; diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc index cc6136ed0bd4c..4ba50c5c03ee7 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.cc @@ -54,7 +54,7 @@ namespace l1t { uint32_t msw = 0; uint32_t lsw = 0; - RegionalMuonRawDigiTranslator::generatePackedDataWords(*mu, lsw, msw); + RegionalMuonRawDigiTranslator::generatePackedDataWords(*mu, lsw, msw, isKalman_); payloadMap[linkTimes2].push_back(lsw); payloadMap[linkTimes2].push_back(msw); diff --git a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h index 06a7b7f177367..879a1dd1f5bab 100644 --- a/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h +++ b/EventFilter/L1TRawToDigi/plugins/implementations_stage2/RegionalMuonGMTPacker.h @@ -13,10 +13,13 @@ namespace l1t { class RegionalMuonGMTPacker : public Packer { public: Blocks pack(const edm::Event&, const PackerTokens*) override; + void setKalmanAlgoTrue() { isKalman_ = true; }; private: typedef std::map> PayloadMap; void packTF(const edm::Event&, const edm::EDGetTokenT&, Blocks&); + + bool isKalman_{false}; }; } // namespace stage2 } // namespace l1t diff --git a/EventFilter/L1TRawToDigi/python/bmtfStage2Raw_cfi.py b/EventFilter/L1TRawToDigi/python/bmtfStage2Raw_cfi.py index 56ccb6cce87df..57cf90df06908 100644 --- a/EventFilter/L1TRawToDigi/python/bmtfStage2Raw_cfi.py +++ b/EventFilter/L1TRawToDigi/python/bmtfStage2Raw_cfi.py @@ -10,3 +10,19 @@ FedId = cms.int32(1376), FWId = cms.uint32(1), ) + +## Era: Run2_2016 +from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger +stage2L1Trigger.toModify(bmtfStage2Raw, InputLabel = cms.InputTag("simBmtfDigis", "BMTF"), FWId = cms.uint32(1)) + +## Era: Run2_2017 +from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017 +stage2L1Trigger_2017.toModify(bmtfStage2Raw, InputLabel = cms.InputTag("simBmtfDigis", "BMTF"), FWId = cms.uint32(1)) + +### Era: Run2_2018 +from Configuration.Eras.Modifier_stage2L1Trigger_2018_cff import stage2L1Trigger_2018 +stage2L1Trigger_2018.toModify(bmtfStage2Raw, InputLabel = cms.InputTag("simBmtfDigis", "BMTF"), FWId = cms.uint32(1)) + +### Era: Run3_2021 +from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 +stage2L1Trigger_2021.toModify(bmtfStage2Raw, InputLabel = cms.InputTag("simKBmtfDigis", "BMTF"), FWId = cms.uint32(2499805536)) diff --git a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h index f09c2905411d0..20f5f755740b3 100644 --- a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h @@ -6,12 +6,14 @@ namespace l1t { class RegionalMuonRawDigiTranslator { public: - static void fillRegionalMuonCand( - RegionalMuonCand& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKalman); - static void fillRegionalMuonCand(RegionalMuonCand& mu, uint64_t dataword, int proc, tftype tf, bool isKalman); - static void generatePackedDataWords(const RegionalMuonCand&, uint32_t&, uint32_t&); - static uint64_t generate64bitDataWord(const RegionalMuonCand&); - static int generateRawTrkAddress(const RegionalMuonCand&); + static void fillRegionalMuonCand(RegionalMuonCand&, uint32_t, uint32_t, int, tftype); + static void fillRegionalMuonCand(RegionalMuonCand&, uint64_t, int, tftype); + static void generatePackedDataWords(const RegionalMuonCand& mu, + uint32_t& raw_data_00_31, + uint32_t& raw_data_32_63, + bool isKalman); + static uint64_t generate64bitDataWord(const RegionalMuonCand& mu, bool isKalman); + static int generateRawTrkAddress(const RegionalMuonCand&, bool isKalman); static constexpr unsigned ptMask_ = 0x1FF; static constexpr unsigned ptShift_ = 0; @@ -34,8 +36,6 @@ namespace l1t { static constexpr unsigned trackAddressMask_ = 0x1FFFFFFF; static constexpr unsigned trackAddressShift_ = 2; // relative shifts within track address - static constexpr unsigned bmtfTrAddrSegSelMask_ = 0xF; - static constexpr unsigned bmtfTrAddrSegSelShift_ = 21; static constexpr unsigned bmtfTrAddrDetSideShift_ = 20; static constexpr unsigned bmtfTrAddrWheelMask_ = 0x3; static constexpr unsigned bmtfTrAddrWheelShift_ = 18; diff --git a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc index 81e8ba965b678..dae2fd06445f4 100644 --- a/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc @@ -31,7 +31,6 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( // set track address with subaddresses int rawTrackAddress = (raw_data_32_63 >> trackAddressShift_) & trackAddressMask_; if (tf == bmtf) { - //int segSel = (rawTrackAddress >> bmtfTrAddrSegSelShift_) & bmtfTrAddrSegSelMask_; int detSide = (rawTrackAddress >> bmtfTrAddrDetSideShift_) & 0x1; int wheelNum = (rawTrackAddress >> bmtfTrAddrWheelShift_) & bmtfTrAddrWheelMask_; int statAddr1 = ((rawTrackAddress >> bmtfTrAddrStat1Shift_) & bmtfTrAddrStat1Mask_); @@ -99,7 +98,8 @@ void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand( void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalMuonCand& mu, uint32_t& raw_data_00_31, - uint32_t& raw_data_32_63) { + uint32_t& raw_data_32_63, + const bool isKalman) { int abs_eta = mu.hwEta(); if (abs_eta < 0) { abs_eta += (1 << (etaSignShift_ - absEtaShift_)); @@ -114,21 +114,25 @@ void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalM (mu.hwPhi() < 0) << phiSignShift_; // generate the raw track address from the subaddresses - int rawTrkAddr = generateRawTrkAddress(mu); + int rawTrkAddr = generateRawTrkAddress(mu, isKalman); raw_data_32_63 = mu.hwSign() << signShift_ | mu.hwSignValid() << signValidShift_ | (rawTrkAddr & trackAddressMask_) << trackAddressShift_; + if (isKalman) { + raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << ptUnconstrainedShift_ | (mu.hwDXY() & dxyMask_) + << dxyShift_; + } } -uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord(const RegionalMuonCand& mu) { +uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord(const RegionalMuonCand& mu, const bool isKalman) { uint32_t lsw; uint32_t msw; - generatePackedDataWords(mu, lsw, msw); + generatePackedDataWords(mu, lsw, msw, isKalman); return (((uint64_t)msw) << 32) + lsw; } -int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(const RegionalMuonCand& mu) { +int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(const RegionalMuonCand& mu, const bool isKalman) { int tf = mu.trackFinderType(); int rawTrkAddr = 0; if (tf == bmtf) { @@ -140,14 +144,14 @@ int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(const RegionalMuon int stat2 = mu.trackSubAddress(RegionalMuonCand::kStat2); int stat3 = mu.trackSubAddress(RegionalMuonCand::kStat3); int stat4 = mu.trackSubAddress(RegionalMuonCand::kStat4); - - int segSel = mu.trackSubAddress(RegionalMuonCand::kSegSelStat1) | - (mu.trackSubAddress(RegionalMuonCand::kSegSelStat2)) >> 1 | - (mu.trackSubAddress(RegionalMuonCand::kSegSelStat3)) >> 2 | - (mu.trackSubAddress(RegionalMuonCand::kSegSelStat4)) >> 3; - - rawTrkAddr = (segSel & bmtfTrAddrSegSelMask_) << bmtfTrAddrSegSelShift_ | - (detSide & 0x1) << bmtfTrAddrDetSideShift_ | + if (isKalman) { + stat1 = mu.trackSubAddress(RegionalMuonCand::kStat4); + stat2 = mu.trackSubAddress(RegionalMuonCand::kStat3); + stat3 = mu.trackSubAddress(RegionalMuonCand::kStat2); + stat4 = mu.trackSubAddress(RegionalMuonCand::kStat1); + } + + rawTrkAddr = (detSide & 0x1) << bmtfTrAddrDetSideShift_ | (wheelNum & bmtfTrAddrWheelMask_) << bmtfTrAddrWheelShift_ | (stat1 & bmtfTrAddrStat1Mask_) << bmtfTrAddrStat1Shift_ | (stat2 & bmtfTrAddrStat2Mask_) << bmtfTrAddrStat2Shift_ | From f2058791e5adde0a9382f55a6e180d2d3a3def8a Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 18 May 2020 13:34:25 +0200 Subject: [PATCH 109/778] Made L1TNtuples work with changed raw2digi translator Not done nicely, should be cleaned up. --- L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc index 3e088991ffc35..189109fdba94b 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc @@ -39,7 +39,7 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrAdd.push_back(stat3); l1upgradetfmuon_.tfMuonTrAdd.push_back(stat4); } - l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it)); + l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it, true)); // TODO: We're assuming that we're dealing with Kalman muons here. l1upgradetfmuon_.nTfMuons++; } From 486673d96b4a174c921eead647d73d6104e8572a Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 29 Jun 2020 17:11:35 +0200 Subject: [PATCH 110/778] Fixed a rare bug in the ghost busting for KBMTF --- .../L1TMuon/src/MicroGMTCancelOutUnit.cc | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc index 58bf1f6d194e9..1fc7e442e25d0 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc @@ -359,6 +359,7 @@ namespace l1t { stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat3]); stations_w1.push_back(trkAddr_w1[l1t::RegionalMuonCand::bmtfAddress::kStat4]); //std::cout << "Track address 1: wheelSide (1 == negative side): " << wheelSide_w1 << ", wheelNum: " << wheelNum_w1 << ", stations1234: 0x" << hex << stations_w1[0] << stations_w1[1] << stations_w1[2] << stations_w1[3] << dec << std::endl; + //std::cout << "Muon1 eta: " << (*mu_w1)->hwEta() << " phi: " << (*mu_w1)->hwGlobalPhi() << " pT: " << (*mu_w1)->hwPt() << " qual: " << (*mu_w1)->origin().hwQual() << std::endl; for (auto mu_w2 = coll2.begin(); mu_w2 != coll2.end(); ++mu_w2) { std::map trkAddr_w2 = (*mu_w2)->origin().trackAddress(); @@ -369,7 +370,8 @@ namespace l1t { stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat2]); stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat3]); stations_w2.push_back(trkAddr_w2[l1t::RegionalMuonCand::bmtfAddress::kStat4]); - //std::cout << "Track address 2: wheelSide (1 == negative side): " << wheelSide_w2 << ", wheelNum: " << wheelNum_w2 << ", stations1234: 0x" << hex << stations_w2[0] << stations_w2[1] << stations_w2[2] << stations_w2[3] << dec << std::endl; + // std::cout << "Track address 2: wheelSide (1 == negative side): " << wheelSide_w2 << ", wheelNum: " << wheelNum_w2 << ", stations1234: 0x" << hex << stations_w2[0] << stations_w2[1] << stations_w2[2] << stations_w2[3] << dec << std::endl; + // std::cout << "Muon2 eta: " << (*mu_w2)->hwEta() << " phi: " << (*mu_w2)->hwGlobalPhi() << " pT: " << (*mu_w2)->hwPt() << " qual: " << (*mu_w2)->origin().hwQual() << std::endl; int nMatchedStations = 0; // search for duplicates in stations 2-4 @@ -403,17 +405,17 @@ namespace l1t { } } else { // If one muon in 0+ and one muon in 0- (0+ and 0- are physically the same wheel), however wheel 0 is not split in kalman algorithm if (wheelNum_w1 == 0 && wheelNum_w2 == 1) { - if ((stations_w1[i] == 0xA && stations_w2[1] == 0x0) || - (stations_w1[i] == 0xB && stations_w2[1] == 0x1) || - (stations_w1[i] == 0x8 && stations_w2[1] == 0x4) || - (stations_w1[i] == 0x9 && stations_w2[1] == 0x5)) { + if ((stations_w1[i] == 0xA && stations_w2[i] == 0x0) || + (stations_w1[i] == 0xB && stations_w2[i] == 0x1) || + (stations_w1[i] == 0x8 && stations_w2[i] == 0x4) || + (stations_w1[i] == 0x9 && stations_w2[i] == 0x5)) { ++nMatchedStations; } } else if (wheelNum_w1 == 1 && wheelNum_w2 == 0) { - if ((stations_w1[i] == 0x2 && stations_w2[1] == 0x8) || - (stations_w1[i] == 0x3 && stations_w2[1] == 0x9) || - (stations_w1[i] == 0x0 && stations_w2[1] == 0xC) || - (stations_w1[i] == 0x1 && stations_w2[1] == 0xD)) { + if ((stations_w1[i] == 0x2 && stations_w2[i] == 0x8) || + (stations_w1[i] == 0x3 && stations_w2[i] == 0x9) || + (stations_w1[i] == 0x0 && stations_w2[i] == 0xC) || + (stations_w1[i] == 0x1 && stations_w2[i] == 0xD)) { ++nMatchedStations; } } From ac4cd2c837b84891174d5f39b055023333c0272f Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Mon, 29 Jun 2020 17:12:57 +0200 Subject: [PATCH 111/778] Added simKBmtfDigis to FEVTDEBUG event content --- L1Trigger/Configuration/python/L1Trigger_EventContent_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/L1Trigger/Configuration/python/L1Trigger_EventContent_cff.py b/L1Trigger/Configuration/python/L1Trigger_EventContent_cff.py index 71fe0bdb8c54c..436822e8ab8e9 100644 --- a/L1Trigger/Configuration/python/L1Trigger_EventContent_cff.py +++ b/L1Trigger/Configuration/python/L1Trigger_EventContent_cff.py @@ -73,6 +73,7 @@ 'keep *_simCaloStage2Digis_*_*', 'keep *_simGmtDigis_*_*', "keep *_simBmtfDigis_*_*", + "keep *_simKBmtfDigis_*_*", "keep *_simOmtfDigis_*_*", "keep *_simEmtfDigis_*_*", "keep *_simGmtStage2Digis_*_*", From 91fd89c21552d3bbf591548caac558aaa84fa8d1 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Wed, 1 Jul 2020 16:06:15 +0200 Subject: [PATCH 112/778] Correct flipped BMTF track addresses --- .../L1TMuon/src/MicroGMTCancelOutUnit.cc | 4 ++-- .../src/L1TMuonBarrelKalmanAlgo.cc | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc index 1fc7e442e25d0..4d97ce7dc32b4 100644 --- a/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc +++ b/L1Trigger/L1TMuon/src/MicroGMTCancelOutUnit.cc @@ -374,8 +374,8 @@ namespace l1t { // std::cout << "Muon2 eta: " << (*mu_w2)->hwEta() << " phi: " << (*mu_w2)->hwGlobalPhi() << " pT: " << (*mu_w2)->hwPt() << " qual: " << (*mu_w2)->origin().hwQual() << std::endl; int nMatchedStations = 0; - // search for duplicates in stations 2-4 - for (int i = 1; i < 4; ++i) { + // search for duplicates in stations 1-3 + for (int i = 0; i < 3; ++i) { if (wheelSide_w1 == wheelSide_w2) { // both tracks are on the same detector side if (wheelNum_w1 == wheelNum_w2) { // both tracks have the same reference wheel if ((stations_w1[i] == 0x2 && stations_w2[i] == 0x0) || diff --git a/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanAlgo.cc b/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanAlgo.cc index c8b1adacf4aef..0909710653d4d 100644 --- a/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanAlgo.cc +++ b/L1Trigger/L1TMuonBarrel/src/L1TMuonBarrelKalmanAlgo.cc @@ -1068,10 +1068,10 @@ std::map L1TMuonBarrelKalmanAlgo::trackAddress(const L1MuKBMTrack& tra out[l1t::RegionalMuonCand::kWheelNum] = 2; else out[l1t::RegionalMuonCand::kWheelNum] = 0; - out[l1t::RegionalMuonCand::kStat1] = 3; + out[l1t::RegionalMuonCand::kStat1] = 15; out[l1t::RegionalMuonCand::kStat2] = 15; out[l1t::RegionalMuonCand::kStat3] = 15; - out[l1t::RegionalMuonCand::kStat4] = 15; + out[l1t::RegionalMuonCand::kStat4] = 3; out[l1t::RegionalMuonCand::kSegSelStat1] = 0; out[l1t::RegionalMuonCand::kSegSelStat2] = 0; out[l1t::RegionalMuonCand::kSegSelStat3] = 0; @@ -1092,24 +1092,24 @@ std::map L1TMuonBarrelKalmanAlgo::trackAddress(const L1MuKBMTrack& tra addr = 1; else addr = 2; - out[l1t::RegionalMuonCand::kStat1] = addr; + out[l1t::RegionalMuonCand::kStat4] = addr; } if (stub->stNum() == 3) { - out[l1t::RegionalMuonCand::kStat2] = addr; + out[l1t::RegionalMuonCand::kStat3] = addr; } if (stub->stNum() == 2) { - out[l1t::RegionalMuonCand::kStat3] = addr; + out[l1t::RegionalMuonCand::kStat2] = addr; } if (stub->stNum() == 1) { - out[l1t::RegionalMuonCand::kStat4] = addr; + out[l1t::RegionalMuonCand::kStat1] = addr; } } word = 0; - word = word | out[l1t::RegionalMuonCand::kStat1] << 12; - word = word | out[l1t::RegionalMuonCand::kStat2] << 8; - word = word | out[l1t::RegionalMuonCand::kStat3] << 4; - word = word | out[l1t::RegionalMuonCand::kStat4]; + word = word | out[l1t::RegionalMuonCand::kStat4] << 12; + word = word | out[l1t::RegionalMuonCand::kStat3] << 8; + word = word | out[l1t::RegionalMuonCand::kStat2] << 4; + word = word | out[l1t::RegionalMuonCand::kStat1]; return out; } From 35f2bc063c10a966a6875af58abe2bcabec6970c Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 28 Sep 2020 23:49:27 +0200 Subject: [PATCH 113/778] Post rebase-fix. --- L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h | 4 ++-- L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h index 6708a6b512463..212a5e1282acc 100644 --- a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h @@ -6,8 +6,8 @@ namespace l1t { class MuonRawDigiTranslator { public: - static void fillMuon(Muon&, uint32_t, uint32_t, int, unsigned int); - static void fillMuon(Muon&, uint64_t, int, unsigned int); + static void fillMuon(Muon&, uint32_t, uint32_t, uint32_t, int, unsigned int, int); + static void fillMuon(Muon&, uint32_t, uint64_t, int, unsigned int, int); static void generatePackedDataWords(const Muon& mu, uint32_t& raw_data_spare, uint32_t& raw_data_00_31, diff --git a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h index 20f5f755740b3..5bbbf9dfa5a43 100644 --- a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h @@ -6,8 +6,8 @@ namespace l1t { class RegionalMuonRawDigiTranslator { public: - static void fillRegionalMuonCand(RegionalMuonCand&, uint32_t, uint32_t, int, tftype); - static void fillRegionalMuonCand(RegionalMuonCand&, uint64_t, int, tftype); + static void fillRegionalMuonCand(RegionalMuonCand&, uint32_t, uint32_t, int, tftype, bool); + static void fillRegionalMuonCand(RegionalMuonCand&, uint64_t, int, tftype, bool); static void generatePackedDataWords(const RegionalMuonCand& mu, uint32_t& raw_data_00_31, uint32_t& raw_data_32_63, From 1905f586f6217dfcd4db6cceca30351c369e8b9c Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 29 Sep 2020 00:06:05 +0200 Subject: [PATCH 114/778] code-format --- L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc index 189109fdba94b..7bf21b6c6c0c7 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc @@ -39,7 +39,8 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrAdd.push_back(stat3); l1upgradetfmuon_.tfMuonTrAdd.push_back(stat4); } - l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress(*it, true)); // TODO: We're assuming that we're dealing with Kalman muons here. + l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress( + *it, true)); // TODO: We're assuming that we're dealing with Kalman muons here. l1upgradetfmuon_.nTfMuons++; } From 3d169627366fa975a8885e14450768cf79fb7772 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 28 Sep 2020 17:01:33 -0500 Subject: [PATCH 115/778] wait for server to actually start, handle errors, refactor --- HeterogeneousCore/SonicTriton/test/README.md | 1 + HeterogeneousCore/SonicTriton/test/triton | 141 ++++++++++++++----- 2 files changed, 104 insertions(+), 38 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/test/README.md b/HeterogeneousCore/SonicTriton/test/README.md index f7cac66112a9b..aa2938f69c1f8 100644 --- a/HeterogeneousCore/SonicTriton/test/README.md +++ b/HeterogeneousCore/SonicTriton/test/README.md @@ -24,6 +24,7 @@ The script has the following options: * `-d`: use Docker instead of Singularity * `-g`: use GPU instead of CPU * `-v`: (verbose) start: activate server debugging info; stop: keep server logs +* `-w`: maximum time to wait for server to start (default: 30 seconds) * `-h`: print help message and exit ## Test commands diff --git a/HeterogeneousCore/SonicTriton/test/triton b/HeterogeneousCore/SonicTriton/test/triton index 58ef192c17fa2..d72143d387875 100755 --- a/HeterogeneousCore/SonicTriton/test/triton +++ b/HeterogeneousCore/SonicTriton/test/triton @@ -1,5 +1,6 @@ #!/bin/bash +WTIME=30 usage() { ECHO="echo -e" $ECHO "triton [options] [start|stop]" @@ -8,6 +9,7 @@ usage() { $ECHO "-d \t use Docker instead of Singularity" $ECHO "-g \t use GPU instead of CPU" $ECHO "-v \t (verbose) start: activate server debugging info; stop: keep server logs" + $ECHO "-w \t maximum time to wait for server to start (default: ${WTIME} seconds)" $ECHO "-h \t print this message and exit" $ECHO $ECHO "Operations:" @@ -27,7 +29,7 @@ if [ -e /run/shm ]; then SHM=/run/shm fi -while getopts "dgvh" opt; do +while getopts "dgvhw:" opt; do case "$opt" in d) USEDOCKER=true ;; @@ -37,6 +39,8 @@ while getopts "dgvh" opt; do ;; h) usage 0 ;; + w) WTIME="$OPTARG" + ;; esac done @@ -53,53 +57,114 @@ MODELS=${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/models SERVER=triton_server_instance LOG=log_triton_server.log LIB=lib +STARTED_INDICATOR="Started GRPCService" +EXTRA="" -if [ -n "$USEDOCKER" ]; then - EXTRA="" - if [ -n "$GPU" ]; then - EXTRA="--gpus all" +start_docker(){ + $DOCKER run -d --name ${SERVER} \ + --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 \ + -p8000:8000 -p8001:8001 -p8002:8002 $EXTRA \ + -v${MODELS}:/models \ + ${IMAGE} tritonserver --model-repository=/models $VERBOSE +} + +start_singularity(){ + # triton server image may need to modify contents of opt/tritonserver/lib/ + # but cvmfs is read-only + # -> make a writable local directory with the same contents + mkdir ${LIB} + ln -s /cvmfs/unpacked.cern.ch/registry.hub.docker.com/${IMAGE}/opt/tritonserver/lib/* ${LIB}/ + + # start instance + # need to bind /cvmfs for above symlinks to work inside container + singularity instance start \ + -B ${SHM}:/run/shm -B ${MODELS}:/models -B ${LIB}:/opt/tritonserver/lib -B /cvmfs $EXTRA \ + /cvmfs/unpacked.cern.ch/registry.hub.docker.com/${IMAGE} ${SERVER} + + START_EXIT=$? + if [ "$START_EXIT" -ne 0 ]; then + return "$START_EXIT" fi - if [ "$OP" == start ]; then - $DOCKER run -d --name ${SERVER} \ - --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 \ - -p8000:8000 -p8001:8001 -p8002:8002 $EXTRA \ - -v${MODELS}:/models \ - ${IMAGE} tritonserver --model-repository=/models $VERBOSE + # run the actual server + singularity run instance://${SERVER} \ + tritonserver --model-repository=/models $VERBOSE >& ${LOG} & +} + +stop_docker(){ + # keep log + if [ -n "$VERBOSE" ]; then $DOCKER logs ${SERVER} >& ${LOG}; fi + + $DOCKER stop ${SERVER} + $DOCKER rm ${SERVER} +} + +stop_singularity(){ + singularity instance stop ${SERVER} + + # cleanup + rm -rf ${LIB} + if [ -z "$VERBOSE" ]; then rm ${LOG}; fi +} + +test_docker(){ + # docker logs print to stderr + ${DOCKER} logs ${SERVER} |& grep "$STARTED_INDICATOR" +} + +test_singularity(){ + grep "$STARTED_INDICATOR" $LOG +} + +wait_server(){ + if [ -n "$USEDOCKER" ]; then + WAIT_COND=test_docker + STOP_FN=stop_docker else - # keep log - if [ -n "$VERBOSE" ]; then docker logs ${SERVER} >& ${LOG}; fi + WAIT_COND=test_singularity + STOP_FN=stop_singularity + fi + + COUNT=0 + while ! $WAIT_COND >& /dev/null; do + if [ "$COUNT" -gt "$WTIME" ]; then + echo "timed out waiting for server to start" + $STOP_FN + exit 1 + else + COUNT=$(($COUNT + 1)) + sleep 1 + fi + done + + echo "server is ready!" + exit 0 +} - $DOCKER stop ${SERVER} - $DOCKER rm ${SERVER} +if [ -n "$USEDOCKER" ]; then + if [ -n "$GPU" ]; then + EXTRA="--gpus all" fi + START_FN=start_docker + STOP_FN=stop_docker + PROG_NAME=Docker else - EXTRA="" if [ -n "$GPU" ]; then EXTRA="--nv" fi + START_FN=start_singularity + STOP_FN=stop_singularity + PROG_NAME=Singularity +fi - if [ "$OP" == start ]; then - # triton server image may need to modify contents of opt/tritonserver/lib/ - # but cvmfs is read-only - # -> make a writable local directory with the same contents - mkdir ${LIB} - ln -s /cvmfs/unpacked.cern.ch/registry.hub.docker.com/${IMAGE}/opt/tritonserver/lib/* ${LIB}/ - - # start instance - # need to bind /cvmfs for above symlinks to work inside container - singularity instance start \ - -B ${SHM}:/run/shm -B ${MODELS}:/models -B ${LIB}:/opt/tritonserver/lib -B /cvmfs $EXTRA \ - /cvmfs/unpacked.cern.ch/registry.hub.docker.com/${IMAGE} ${SERVER} - - # run the actual server - singularity run instance://${SERVER} \ - tritonserver --model-repository=/models $VERBOSE >& ${LOG} & - else - singularity instance stop ${SERVER} - - # cleanup - rm -rf ${LIB} - if [ -z "$VERBOSE" ]; then rm ${LOG}; fi +if [ "$OP" == start ]; then + $START_FN + START_EXIT=$? + if [ "$START_EXIT" -ne 0 ]; then + echo "Error from $PROG_NAME" + exit "$START_EXIT" fi + wait_server +else + $STOP_FN fi From 54e7f51ff9c5593b65ffc1b785a8fa51ca35aa45 Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 29 Sep 2020 10:11:26 +0200 Subject: [PATCH 116/778] migrate dqmEnvSiPixelQuality from DQMEventInfo to DQMHarvestingMetadata --- .../python/DQMEventInfoSiPixelQuality_cff.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CalibTracker/SiPixelQuality/python/DQMEventInfoSiPixelQuality_cff.py b/CalibTracker/SiPixelQuality/python/DQMEventInfoSiPixelQuality_cff.py index 17404a3cd7b48..75ddbb0953058 100644 --- a/CalibTracker/SiPixelQuality/python/DQMEventInfoSiPixelQuality_cff.py +++ b/CalibTracker/SiPixelQuality/python/DQMEventInfoSiPixelQuality_cff.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer -dqmEnvSiPixelQuality = DQMEDAnalyzer('DQMEventInfo', - subSystemFolder = cms.untracked.string('PixelPhase1') - ) +from DQMServices.Core.DQMEDHarvester import DQMEDHarvester +dqmEnvSiPixelQuality = DQMEDHarvester('DQMHarvestingMetadata', + subSystemFolder = cms.untracked.string('PixelPhase1') + ) From fee3d40117c1826f843c8d2bcd12d0fbdf7c274b Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 29 Sep 2020 11:38:29 +0200 Subject: [PATCH 117/778] DetIds printouts + fix nameing of GeometricDet::geographicalId() instead of ID() --- .../plugins/CmsTrackerDetIdBuilder.cc | 66 +++++++++++++++++-- .../Geometry/test/ModuleInfo_Phase2.cc | 10 +-- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc index 73fa37730c3aa..f8b463b939b20 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc @@ -9,6 +9,7 @@ #include #include #include +#include CmsTrackerDetIdBuilder::CmsTrackerDetIdBuilder(const std::vector& detidShifts) : m_detidshifts() { if (detidShifts.size() != nSubDet * maxLevels) @@ -26,7 +27,62 @@ void CmsTrackerDetIdBuilder::buildId(GeometricDet& tracker) { DetId t(DetId::Tracker, 0); tracker.setGeographicalID(t); - iterate(tracker, 0, tracker.geographicalID().rawId()); + iterate(tracker, 0, tracker.geographicalId().rawId()); + +//std::ofstream outfile("DetIdOLD.log", std::ios::out); + std::ofstream outfile("DetIdDD4hep.log", std::ios::out); + + std::deque queue; + queue.emplace_back(&tracker); + + while (!queue.empty()) { + const GeometricDet* myDet = queue.front(); + queue.pop_front(); + for (auto& child : myDet->components()) { + queue.emplace_back(child); + } + + outfile << " " << std::endl; + outfile << " " << std::endl; + outfile << "............................." << std::endl; + outfile << "myDet->geographicalId() = " << myDet->geographicalId() << std::endl; + + //const auto& found = myDet->name().find(":"); + //outfile << "myDet->name() = " << (found != std::string::npos ? myDet->name().substr(found + 1) : myDet->name()) << std::endl; + outfile << "myDet->name() = " << myDet->name() << std::endl; + outfile << "myDet->module->type() = " << std::fixed << std::setprecision(7) << myDet->type() << std::endl; + + outfile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() + << std::endl; + outfile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() << std::endl; + + if (fabs(myDet->rho()) > 0.00001) { + outfile << "myDet->module->phi() = " << std::fixed << std::setprecision(7) << myDet->phi() << std::endl; + } + + outfile << "myDet->module->rotation() = " << std::fixed << std::setprecision(7) << myDet->rotation() << std::endl; + outfile << "myDet->module->shape() = " << std::fixed << std::setprecision(7) << myDet->shape() << std::endl; + + if (myDet->shape_dd4hep() == cms::DDSolidShape::ddbox || myDet->shape_dd4hep() == cms::DDSolidShape::ddtrap || + myDet->shape_dd4hep() == cms::DDSolidShape::ddtubs) { + outfile << "myDet->params() = " << std::fixed << std::setprecision(7); + for (const auto& para : myDet->params()) { + outfile << para << " "; + } + outfile << " " << std::endl; + } + + //outfile << "myDet->radLength() = " << myDet->radLength() << std::endl; + //outfile << "myDet->xi() = " << myDet->xi() << std::endl; + outfile << "myDet->pixROCRows() = " << myDet->pixROCRows() << std::endl; + outfile << "myDet->pixROCCols() = " << myDet->pixROCCols() << std::endl; + outfile << "myDet->pixROCx() = " << myDet->pixROCx() << std::endl; + outfile << "myDet->pixROCy() = " << myDet->pixROCy() << std::endl; + outfile << "myDet->stereo() = " << myDet->stereo() << std::endl; + outfile << "myDet->isLowerSensor() = " << myDet->isLowerSensor() << std::endl; + outfile << "myDet->isUpperSensor() = " << myDet->isUpperSensor() << std::endl; + outfile << "myDet->siliconAPVNum() = " << myDet->siliconAPVNum() << std::endl; + } } void CmsTrackerDetIdBuilder::iterate(GeometricDet& in, int level, unsigned int ID) { @@ -45,7 +101,7 @@ void CmsTrackerDetIdBuilder::iterate(GeometricDet& in, int level, unsigned int I case 0: { for (uint32_t i = 0; i < in.components().size(); i++) { GeometricDet* component = in.component(i); - uint32_t iSubDet = component->geographicalID().rawId(); + uint32_t iSubDet = component->geographicalId().rawId(); uint32_t temp = ID; temp |= (iSubDet << 25); component->setGeographicalID(temp); @@ -69,7 +125,7 @@ void CmsTrackerDetIdBuilder::iterate(GeometricDet& in, int level, unsigned int I component->setGeographicalID(DetId(temp)); // next level - iterate(*component, level + 1, (in.components())[i]->geographicalID().rawId()); + iterate(*component, level + 1, (in.components())[i]->geographicalId().rawId()); } break; } @@ -81,11 +137,11 @@ void CmsTrackerDetIdBuilder::iterate(GeometricDet& in, int level, unsigned int I if (level < maxLevels) { if (iSubDet > 0 && iSubDet <= nSubDet && m_detidshifts[level * nSubDet + iSubDet - 1] >= 0) { - temp |= (component->geographicalID().rawId() << m_detidshifts[level * nSubDet + iSubDet - 1]); + temp |= (component->geographicalId().rawId() << m_detidshifts[level * nSubDet + iSubDet - 1]); } component->setGeographicalID(temp); // next level - iterate(*component, level + 1, (in.components())[i]->geographicalID().rawId()); + iterate(*component, level + 1, (in.components())[i]->geographicalId().rawId()); } } diff --git a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc index fc9ac3b4ceddf..aa06d7ed3f35f 100644 --- a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc +++ b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc @@ -301,7 +301,7 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& // MEC: 2010-04-13: need to find corresponding GeometricDetExtra. std::vector::const_iterator gdei(rDDE->begin()), gdeEnd(rDDE->end()); for (unsigned int i = 0; i < modules.size(); i++) { - unsigned int rawid = modules[i]->geographicalID().rawId(); + unsigned int rawid = modules[i]->geographicalId().rawId(); gdei = rDDE->begin(); for (; gdei != gdeEnd; ++gdei) { if (gdei->geographicalId() == modules[i]->geographicalId()) @@ -322,7 +322,7 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& //nav_type typedef changed in 3_6_2; comment out for now. idr 10/6/10 Output << std::endl; - int subdetid = modules[i]->geographicalID().subdetId(); + int subdetid = modules[i]->geographicalId().subdetId(); double volume = gdei->volume() / 1000; // mm3->cm3 double density = gdei->density() / density_units; double weight = gdei->weight() / density_units / 1000.; // [kg], hence the factor 1000; @@ -367,7 +367,7 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& thepixROCRowsB[theLayer - 1] = modules[i]->pixROCRows(); thepixROCColsB[theLayer - 1] = modules[i]->pixROCCols(); { - const DetId& detid = modules[i]->geographicalID(); + const DetId& detid = modules[i]->geographicalId(); DetId detIdObject(detid); const GeomDetUnit* genericDet = pDD->idToDetUnit(detIdObject); const PixelGeomDetUnit* pixDet = dynamic_cast(genericDet); @@ -465,7 +465,7 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& thepixROCRowsD[theDisk - 1] = modules[i]->pixROCRows(); thepixROCColsD[theDisk - 1] = modules[i]->pixROCCols(); { - const DetId& detid = modules[i]->geographicalID(); + const DetId& detid = modules[i]->geographicalId(); DetId detIdObject(detid); const GeomDetUnit* genericDet = pDD->idToDetUnit(detIdObject); const PixelGeomDetUnit* pixDet = dynamic_cast(genericDet); @@ -846,7 +846,7 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& } // Local axes from Reco - const GeomDet* geomdet = pDD->idToDet(modules[i]->geographicalID()); + const GeomDet* geomdet = pDD->idToDet(modules[i]->geographicalId()); // Global Coordinates (i,j,k) LocalVector xLocal(1, 0, 0); LocalVector yLocal(0, 1, 0); From 05274adc156318b3ad164d9e1bed47b4da6a4788 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 29 Sep 2020 12:03:02 +0200 Subject: [PATCH 118/778] Finished fix of naming GeometricDet::geographicalID() -> GeometricDet::geographicalId() in dependencies (there were 2 functions named differently in GeometricDet and doing the same thing). --- RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc | 6 +++--- RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc | 8 ++++---- RecoTracker/TkDetLayers/src/PixelBladeBuilder.h | 4 ++-- RecoTracker/TkDetLayers/src/PixelRodBuilder.cc | 2 +- RecoTracker/TkDetLayers/src/TECWedgeBuilder.cc | 4 ++-- RecoTracker/TkDetLayers/src/TIBRingBuilder.cc | 2 +- RecoTracker/TkDetLayers/src/TIDRingBuilder.cc | 2 +- RecoTracker/TkDetLayers/src/TOBRodBuilder.cc | 2 +- SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc index 0d95cdd46625a..2df7298f9ad94 100644 --- a/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc @@ -31,7 +31,7 @@ Phase2EndcapRing* Phase2EndcapRingBuilder::build(const GeometricDet* aPhase2Endc for (vector::const_iterator compGeometricDets = allGeometricDets.begin(); compGeometricDets != allGeometricDets.end(); compGeometricDets++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*compGeometricDets)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*compGeometricDets)->geographicalId()); if (fabs((*compGeometricDets)->positionBounds().z()) < fabs(meanZ)) frontGeomDets.push_back(theGeomDet); @@ -78,7 +78,7 @@ Phase2EndcapRing* Phase2EndcapRingBuilder::build(const GeometricDet* aPhase2Endc for (vector::const_iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) { compGeometricDets = (*it)->components(); - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalId()); if (fabs(compGeometricDets[0]->positionBounds().z()) < fabs(meanZ)) frontGeomDets.push_back(theGeomDet); @@ -86,7 +86,7 @@ Phase2EndcapRing* Phase2EndcapRingBuilder::build(const GeometricDet* aPhase2Endc if (fabs(compGeometricDets[0]->positionBounds().z()) > fabs(meanZ)) backGeomDets.push_back(theGeomDet); - const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalID()); + const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalId()); if (fabs(compGeometricDets[1]->positionBounds().z()) < fabs(meanZBrothers)) frontGeomDetBrothers.push_back(theGeomDetBrother); diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc index a880420e0a5f2..786ffc5cd67a7 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc @@ -35,8 +35,8 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 for (vector::iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) { compGeometricDets = (*it)->components(); - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalID()); - LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalID().rawId() << std::endl; + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalId()); + LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalId().rawId() << std::endl; if (compGeometricDets[0]->positionBounds().perp() < meanR) innerGeomDets.push_back(theGeomDet); @@ -44,8 +44,8 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 if (compGeometricDets[0]->positionBounds().perp() > meanR) outerGeomDets.push_back(theGeomDet); - const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalID()); - LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalID().rawId() << std::endl; + const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalId()); + LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalId().rawId() << std::endl; if (compGeometricDets[1]->positionBounds().perp() < meanRBrothers) innerGeomDetBrothers.push_back(theGeomDetBrother); diff --git a/RecoTracker/TkDetLayers/src/PixelBladeBuilder.h b/RecoTracker/TkDetLayers/src/PixelBladeBuilder.h index cab76527e7b8c..ed69ee841b017 100644 --- a/RecoTracker/TkDetLayers/src/PixelBladeBuilder.h +++ b/RecoTracker/TkDetLayers/src/PixelBladeBuilder.h @@ -39,12 +39,12 @@ T* PixelBladeBuilder::build(const GeometricDet* geometricDetFrontPanel, for (std::vector::iterator it = frontGeometricDets.begin(); it != frontGeometricDets.end(); it++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId()); theFrontGeomDets.push_back(theGeomDet); } for (std::vector::iterator it = backGeometricDets.begin(); it != backGeometricDets.end(); it++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId()); theBackGeomDets.push_back(theGeomDet); } diff --git a/RecoTracker/TkDetLayers/src/PixelRodBuilder.cc b/RecoTracker/TkDetLayers/src/PixelRodBuilder.cc index cd7b20602b41f..d001e81c714e8 100644 --- a/RecoTracker/TkDetLayers/src/PixelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/PixelRodBuilder.cc @@ -8,7 +8,7 @@ PixelRod* PixelRodBuilder::build(const GeometricDet* aRod, const TrackerGeometry vector theGeomDets; for (vector::iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId()); theGeomDets.push_back(theGeomDet); } diff --git a/RecoTracker/TkDetLayers/src/TECWedgeBuilder.cc b/RecoTracker/TkDetLayers/src/TECWedgeBuilder.cc index e9a6a624df564..5f504f038307c 100644 --- a/RecoTracker/TkDetLayers/src/TECWedgeBuilder.cc +++ b/RecoTracker/TkDetLayers/src/TECWedgeBuilder.cc @@ -10,7 +10,7 @@ TECWedge* TECWedgeBuilder::build(const GeometricDet* aTECWedge, const TrackerGeo //edm::LogInfo(TkDetLayers) << "theGeometricDets.size(): " << theGeometricDets.size() ; if (theGeometricDets.size() == 1) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(theGeometricDets.front()->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(theGeometricDets.front()->geographicalId()); return new SimpleTECWedge(theGeomDet); } @@ -29,7 +29,7 @@ TECWedge* TECWedgeBuilder::build(const GeometricDet* aTECWedge, const TrackerGeo for (vector::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) { //double theGeometricDetRposition = (*it)->positionBounds().perp(); - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId()); //double theGeomDetRposition = theGeomDet->surface().position().perp(); if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ)) diff --git a/RecoTracker/TkDetLayers/src/TIBRingBuilder.cc b/RecoTracker/TkDetLayers/src/TIBRingBuilder.cc index cab3c87a447d1..fd8eeeb27a34c 100644 --- a/RecoTracker/TkDetLayers/src/TIBRingBuilder.cc +++ b/RecoTracker/TkDetLayers/src/TIBRingBuilder.cc @@ -7,7 +7,7 @@ TIBRing* TIBRingBuilder::build(const vector& detsInRing, const TrackerGeometry* theGeomDetGeometry) { vector theGeomDets; for (vector::const_iterator it = detsInRing.begin(); it != detsInRing.end(); it++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId()); theGeomDets.push_back(theGeomDet); } diff --git a/RecoTracker/TkDetLayers/src/TIDRingBuilder.cc b/RecoTracker/TkDetLayers/src/TIDRingBuilder.cc index 63cea8efd800b..6b62bb1382b98 100644 --- a/RecoTracker/TkDetLayers/src/TIDRingBuilder.cc +++ b/RecoTracker/TkDetLayers/src/TIDRingBuilder.cc @@ -19,7 +19,7 @@ TIDRing* TIDRingBuilder::build(const GeometricDet* aTIDRing, const TrackerGeomet //---- for (vector::const_iterator it = theGeometricDets.begin(); it != theGeometricDets.end(); it++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId()); if (std::abs((*it)->positionBounds().z()) < std::abs(meanZ)) innerGeomDets.push_back(theGeomDet); diff --git a/RecoTracker/TkDetLayers/src/TOBRodBuilder.cc b/RecoTracker/TkDetLayers/src/TOBRodBuilder.cc index 35d3b7bdbcc93..ebe8d27ddc06b 100644 --- a/RecoTracker/TkDetLayers/src/TOBRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/TOBRodBuilder.cc @@ -22,7 +22,7 @@ TOBRod* TOBRodBuilder::build(const GeometricDet* negTOBRod, double meanR = (allGeometricDets[0]->positionBounds().perp() + allGeometricDets[1]->positionBounds().perp()) / 2; for (vector::iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*it)->geographicalId()); if ((*it)->positionBounds().perp() < meanR) innerGeomDets.push_back(theGeomDet); diff --git a/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc b/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc index c8ba6a229d08c..54c59ad64a368 100644 --- a/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc +++ b/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc @@ -30,7 +30,7 @@ void TrackerG4SimHitNumberingScheme::buildAll() { for (auto& theSD : allSensitiveDets) { auto const& t = theSD->translation(); - edm::LogVerbatim("TrackerSimInfoNumbering") << "::buildAll" << theSD->geographicalID().rawId() << "\t" << t; + edm::LogVerbatim("TrackerSimInfoNumbering") << "::buildAll" << theSD->geographicalId().rawId() << "\t" << t; theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(t.x(), t.y(), t.z())); G4TouchableHistory* hist = theNavigator.CreateTouchableHistory(); assert(!!hist); @@ -40,7 +40,7 @@ void TrackerG4SimHitNumberingScheme::buildAll() { for (const std::pair& p : st) edm::LogVerbatim("TrackerSimInfoNumbering") << "Nav_Story\t" << p.first << "\t" << p.second; - directMap_[st] = theSD->geographicalID(); + directMap_[st] = theSD->geographicalId(); LogDebug("TrackerSimDebugNumbering") << " INSERTING LV " << hist->GetVolume()->GetLogicalVolume()->GetName() << " SD: " From 2f82f5873f33b8a189a6d377361384894458e5a1 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Tue, 29 Sep 2020 13:56:24 +0200 Subject: [PATCH 119/778] revert changes of namespace, does not work --- .../DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc | 3 --- DetectorDescription/DDCMS/src/DDFilteredView.cc | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 9dd068c1dcd4f..4302ed869b256 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -947,9 +947,6 @@ void Converter::operator()(xml_h element) const { "+++ PartSelector for %s path: %s", specParName.c_str(), path.c_str()); - if (path.substr(0, 3) == std::string(".*:")) { - path = path.substr(3); - } registry.specpars[specParName].paths.emplace_back(path); } diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index fc229728bf9b4..7dade5254e6d9 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -479,7 +479,7 @@ std::string_view DDFilteredView::get(const string& key) const { int level = it_.back().GetLevel(); for_each(begin(refs), end(refs), [&](auto const& i) { auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { - auto const& names = split(j, "/"); + auto const& names = split(realTopName(j), "/"); int count = names.size(); bool flag = false; for (int nit = level; count > 0 and nit > 0; --nit) { @@ -618,7 +618,8 @@ const ExpandedNodes& DDFilteredView::history() { for (int nit = level; nit > 0; --nit) { for_each(begin(registry_->specpars), end(registry_->specpars), [&](auto const& i) { auto k = find_if(begin(i.second.paths), end(i.second.paths), [&](auto const& j) { - return (isMatch(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), *begin(split(j, "/"))) and + return (isMatch(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), + *begin(split(realTopName(j), "/"))) and (i.second.hasValue("CopyNoTag") or i.second.hasValue("CopyNoOffset"))); }); if (k != end(i.second.paths)) { From eadcf0f7abbe971cda38034200495b8c6fb01be2 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Tue, 29 Sep 2020 15:36:18 +0200 Subject: [PATCH 120/778] Migrate PositionAtECalEntranceComputer to use esConsumes --- .../PatAlgos/plugins/PATTauProducer.cc | 3 ++- .../RecoTau/interface/AntiElectronDeadECAL.h | 2 +- .../PositionAtECalEntranceComputer.h | 8 ++++++- ...auDiscriminationAgainstElectronDeadECAL.cc | 2 +- .../TauDiscriminationAgainstElectronMVA6.cc | 3 ++- .../RecoTau/src/AntiElectronDeadECAL.cc | 3 ++- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 2 +- .../src/PositionAtECalEntranceComputer.cc | 22 ++++++++++++------- 8 files changed, 30 insertions(+), 15 deletions(-) diff --git a/PhysicsTools/PatAlgos/plugins/PATTauProducer.cc b/PhysicsTools/PatAlgos/plugins/PATTauProducer.cc index d9d6ec1562b99..120d8815f28f9 100644 --- a/PhysicsTools/PatAlgos/plugins/PATTauProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATTauProducer.cc @@ -32,7 +32,8 @@ PATTauProducer::PATTauProducer(const edm::ParameterSet& iConfig) : edm::ParameterSet(), consumesCollector(), false), - useUserData_(iConfig.exists("userData")) { + useUserData_(iConfig.exists("userData")), + posAtECalEntranceComputer_(consumesCollector()) { firstOccurence_ = true; // initialize the configurables baseTauToken_ = consumes>(iConfig.getParameter("tauSource")); diff --git a/RecoTauTag/RecoTau/interface/AntiElectronDeadECAL.h b/RecoTauTag/RecoTau/interface/AntiElectronDeadECAL.h index d37bb1b73b5bd..c2119537beaf9 100644 --- a/RecoTauTag/RecoTau/interface/AntiElectronDeadECAL.h +++ b/RecoTauTag/RecoTau/interface/AntiElectronDeadECAL.h @@ -34,7 +34,7 @@ class IdealGeometryRecord; class AntiElectronDeadECAL { public: - explicit AntiElectronDeadECAL(const edm::ParameterSet&); + explicit AntiElectronDeadECAL(const edm::ParameterSet&, edm::ConsumesCollector&&); ~AntiElectronDeadECAL(); void beginEvent(const edm::EventSetup&); diff --git a/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h b/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h index 17f7dbafb26ae..d4b4a5cb31353 100644 --- a/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h +++ b/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h @@ -14,14 +14,18 @@ */ #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Utilities/interface/ESGetToken.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "DataFormats/Candidate/interface/Candidate.h" #include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h" class MagneticField; +class IdealMagneticFieldRecord; class PositionAtECalEntranceComputer { public: - PositionAtECalEntranceComputer(bool isPhase2 = false); + PositionAtECalEntranceComputer(edm::ConsumesCollector&&, bool isPhase2 = false); + PositionAtECalEntranceComputer(edm::ConsumesCollector&, bool isPhase2 = false); ~PositionAtECalEntranceComputer(); void beginEvent(const edm::EventSetup&); @@ -30,6 +34,8 @@ class PositionAtECalEntranceComputer { reco::Candidate::Point operator()(const reco::Candidate* particle, bool& success) const; private: + edm::ESGetToken bField_esToken_; + edm::ESGetToken caloGeo_esToken_; double bField_z_; bool isPhase2_; MagneticField const* bField_; diff --git a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronDeadECAL.cc b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronDeadECAL.cc index 578a232bb1d67..637b58557934b 100644 --- a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronDeadECAL.cc +++ b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronDeadECAL.cc @@ -29,7 +29,7 @@ class TauDiscriminationAgainstElectronDeadECAL : public TauDiscriminationProduce : TauDiscriminationProducerBase::TauDiscriminationProducerBase(cfg), moduleLabel_(cfg.getParameter("@module_label")), verbosity_(cfg.getParameter("verbosity")), - antiElectronDeadECAL_(cfg) {} + antiElectronDeadECAL_(cfg, edm::EDConsumerBase::consumesCollector()) {} ~TauDiscriminationAgainstElectronDeadECAL() override {} void beginEvent(const edm::Event& evt, const edm::EventSetup& es) override { antiElectronDeadECAL_.beginEvent(es); } diff --git a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc index 16f09a8ad3e7d..200bd56dcd423 100644 --- a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc +++ b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc @@ -31,7 +31,8 @@ class TauDiscriminationAgainstElectronMVA6 : public TauDiscriminationProducerBas std::make_unique>(cfg, edm::EDConsumerBase::consumesCollector())), Electron_token(edm::EDConsumerBase::consumes( cfg.getParameter("srcElectrons"))), // MB: full specification with prefix mandatory - positionAtECalEntrance_(PositionAtECalEntranceComputer(cfg.getParameter("isPhase2"))), + positionAtECalEntrance_(PositionAtECalEntranceComputer(edm::EDConsumerBase::consumesCollector(), + cfg.getParameter("isPhase2"))), vetoEcalCracks_(cfg.getParameter("vetoEcalCracks")), isPhase2_(cfg.getParameter("isPhase2")), verbosity_(cfg.getParameter("verbosity")) { diff --git a/RecoTauTag/RecoTau/src/AntiElectronDeadECAL.cc b/RecoTauTag/RecoTau/src/AntiElectronDeadECAL.cc index 080c333fcf01b..782e4e2b87c34 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronDeadECAL.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronDeadECAL.cc @@ -15,11 +15,12 @@ #include "DataFormats/Math/interface/deltaR.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -AntiElectronDeadECAL::AntiElectronDeadECAL(const edm::ParameterSet& cfg) +AntiElectronDeadECAL::AntiElectronDeadECAL(const edm::ParameterSet& cfg, edm::ConsumesCollector&& cc) : minStatus_(cfg.getParameter("minStatus")), dR2_(std::pow(cfg.getParameter("dR"), 2)), extrapolateToECalEntrance_(cfg.getParameter("extrapolateToECalEntrance")), verbosity_(cfg.getParameter("verbosity")), + positionAtECalEntrance_(PositionAtECalEntranceComputer(cc)), isFirstEvent_(true) {} AntiElectronDeadECAL::~AntiElectronDeadECAL() {} diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index 9ff1cd042ac68..674db0b0a4f4f 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -48,7 +48,7 @@ AntiElectronIDMVA6::AntiElectronIDMVA6(const edm::Paramet mva_NoEleMatch_wGwoGSF_VFEC_(nullptr), mva_woGwGSF_VFEC_(nullptr), mva_wGwGSF_VFEC_(nullptr), - positionAtECalEntrance_(PositionAtECalEntranceComputer(cfg.getParameter("isPhase2"))), + positionAtECalEntrance_(PositionAtECalEntranceComputer(cc, cfg.getParameter("isPhase2"))), isPhase2_(cfg.getParameter("isPhase2")), verbosity_(cfg.getParameter("verbosity")) { loadMVAfromDB_ = cfg.exists("loadMVAfromDB") ? cfg.getParameter("loadMVAfromDB") : false; diff --git a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc index a124b3adb0534..ccd085ac9762e 100644 --- a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc +++ b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc @@ -76,19 +76,25 @@ namespace hgcal_helpers { } } // namespace hgcal_helpers -PositionAtECalEntranceComputer::PositionAtECalEntranceComputer(bool isPhase2) : bField_z_(-1.), isPhase2_(isPhase2) {} +PositionAtECalEntranceComputer::PositionAtECalEntranceComputer(edm::ConsumesCollector&& cc, bool isPhase2) + : bField_esToken_(cc.esConsumes()), + caloGeo_esToken_(cc.esConsumes()), + bField_z_(-1.), + isPhase2_(isPhase2) {} + +PositionAtECalEntranceComputer::PositionAtECalEntranceComputer(edm::ConsumesCollector& cc, bool isPhase2) + : bField_esToken_(cc.esConsumes()), + caloGeo_esToken_(cc.esConsumes()), + bField_z_(-1.), + isPhase2_(isPhase2) {} PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer() {} void PositionAtECalEntranceComputer::beginEvent(const edm::EventSetup& es) { - edm::ESHandle bFieldH; - es.get().get(bFieldH); - bField_z_ = bFieldH->inTesla(GlobalPoint(0., 0., 0.)).z(); - bField_ = &(*bFieldH); + bField_ = &es.getData(bField_esToken_); + bField_z_ = bField_->inTesla(GlobalPoint(0., 0., 0.)).z(); if (isPhase2_) { - edm::ESHandle caloGeoH; - es.get().get(caloGeoH); - recHitTools_.setGeometry(*caloGeoH); + recHitTools_.setGeometry(es.getData(caloGeo_esToken_)); hgcalFace_z_ = recHitTools_.getPositionLayer(1).z(); // HGCal 1st layer } } From 306cff954537970e85c2997ac5dda7f7369d05b4 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Tue, 29 Sep 2020 11:09:01 -0500 Subject: [PATCH 121/778] consolidate a bit --- HeterogeneousCore/SonicTriton/test/triton | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/test/triton b/HeterogeneousCore/SonicTriton/test/triton index d72143d387875..788b5044aa971 100755 --- a/HeterogeneousCore/SonicTriton/test/triton +++ b/HeterogeneousCore/SonicTriton/test/triton @@ -117,14 +117,6 @@ test_singularity(){ } wait_server(){ - if [ -n "$USEDOCKER" ]; then - WAIT_COND=test_docker - STOP_FN=stop_docker - else - WAIT_COND=test_singularity - STOP_FN=stop_singularity - fi - COUNT=0 while ! $WAIT_COND >& /dev/null; do if [ "$COUNT" -gt "$WTIME" ]; then @@ -146,6 +138,7 @@ if [ -n "$USEDOCKER" ]; then EXTRA="--gpus all" fi START_FN=start_docker + WAIT_COND=test_docker STOP_FN=stop_docker PROG_NAME=Docker else @@ -153,6 +146,7 @@ else EXTRA="--nv" fi START_FN=start_singularity + WAIT_COND=test_singularity STOP_FN=stop_singularity PROG_NAME=Singularity fi From f5397ec4d90e6b54c5f6b056650ebb6cb334036c Mon Sep 17 00:00:00 2001 From: ddesouza Date: Tue, 29 Sep 2020 18:10:32 +0200 Subject: [PATCH 122/778] Include the suggested changes --- DataFormats/HeavyIonEvent/interface/HFFilterStruct.h | 6 +++--- RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h b/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h index 6765087a3c408..5c30fd8bb950c 100644 --- a/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h +++ b/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h @@ -1,5 +1,5 @@ -#ifndef HEAVYIONEVENT_HFFILTERSTRUCT_H -#define HEAVYIONEVENT_HFFILTERSTRUCT_H +#ifndef DataFormats_HeavyIonEvent_HFFilterStruct_H +#define DataFormats_HeavyIonEvent_HFFilterStruct_H namespace pat { struct HFFilterStruct { @@ -8,6 +8,6 @@ namespace pat { int numMinHFTowers4; int numMinHFTowers5; }; -} // namespace pat +} #endif diff --git a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc index ae34acb59bf0f..38d6e28ca1768 100644 --- a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc +++ b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc @@ -10,8 +10,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/StreamID.h" -#include "RecoLocalCalo/CaloTowersCreator/src/CaloTowerCandidateCreator.h" -#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h" #include "DataFormats/CaloTowers/interface/CaloTower.h" #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" #include "DataFormats/HeavyIonEvent/interface/HFFilterStruct.h" @@ -44,7 +42,7 @@ void HiHFFilterProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet using namespace std; using namespace edm; - auto const& towers = iEvent.getHandle(srcTowers_); + auto const& towers = iEvent.get(srcTowers_); int nTowersTh2HFplus = 0; int nTowersTh2HFminus = 0; @@ -56,8 +54,7 @@ void HiHFFilterProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet int nTowersTh5HFminus = 0; auto HFFilterResults = std::make_unique(); - for (unsigned int towerIndx = 0; towerIndx < towers->size(); ++towerIndx) { - const CaloTower& tower = (*towers)[towerIndx]; + for (const auto& tower : towers) { const auto et = tower.et(); const auto energy = tower.energy(); const auto eta = tower.eta(); From 576f4d7df89923bc13af548f0223f61aef38bd62 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Tue, 29 Sep 2020 12:56:07 -0500 Subject: [PATCH 123/778] minor improvements --- HeterogeneousCore/SonicTriton/test/README.md | 8 ++++++- HeterogeneousCore/SonicTriton/test/triton | 22 ++++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/test/README.md b/HeterogeneousCore/SonicTriton/test/README.md index aa2938f69c1f8..6d0d75960078a 100644 --- a/HeterogeneousCore/SonicTriton/test/README.md +++ b/HeterogeneousCore/SonicTriton/test/README.md @@ -23,8 +23,9 @@ The server can be managed with the `triton` script (using Singularity with CPU b The script has the following options: * `-d`: use Docker instead of Singularity * `-g`: use GPU instead of CPU +* `-n`: name of container instance (default: triton_server_instance) * `-v`: (verbose) start: activate server debugging info; stop: keep server logs -* `-w`: maximum time to wait for server to start (default: 30 seconds) +* `-w`: maximum time to wait for server to start (default: 60 seconds) * `-h`: print help message and exit ## Test commands @@ -38,3 +39,8 @@ Run the graph test: ``` cmsRun tritonTest_cfg.py maxEvents=1 producer=TritonGraphProducer ``` + +## Caveats + +* Local CPU server requires support for AVX instructions. +* Multiple users cannot run servers on the same GPU (e.g. on a shared node). diff --git a/HeterogeneousCore/SonicTriton/test/triton b/HeterogeneousCore/SonicTriton/test/triton index 788b5044aa971..7dd6ec7bd440f 100755 --- a/HeterogeneousCore/SonicTriton/test/triton +++ b/HeterogeneousCore/SonicTriton/test/triton @@ -1,6 +1,12 @@ #!/bin/bash -WTIME=30 +# defaults +USEDOCKER="" +GPU="" +VERBOSE="" +WTIME=60 +SERVER=triton_server_instance + usage() { ECHO="echo -e" $ECHO "triton [options] [start|stop]" @@ -8,6 +14,7 @@ usage() { $ECHO "Options:" $ECHO "-d \t use Docker instead of Singularity" $ECHO "-g \t use GPU instead of CPU" + $ECHO "-n \t name of container instance (default: ${SERVER})" $ECHO "-v \t (verbose) start: activate server debugging info; stop: keep server logs" $ECHO "-w \t maximum time to wait for server to start (default: ${WTIME} seconds)" $ECHO "-h \t print this message and exit" @@ -18,18 +25,13 @@ usage() { exit $1 } -# defaults -USEDOCKER="" -GPU="" -VERBOSE="" - # check shm locations SHM=/dev/shm if [ -e /run/shm ]; then SHM=/run/shm fi -while getopts "dgvhw:" opt; do +while getopts "dgvhw:n:" opt; do case "$opt" in d) USEDOCKER=true ;; @@ -41,6 +43,8 @@ while getopts "dgvhw:" opt; do ;; w) WTIME="$OPTARG" ;; + n) SERVER="$OPTARG" + ;; esac done @@ -54,7 +58,6 @@ fi DOCKER="sudo docker" IMAGE=fastml/triton-torchgeo:20.06-v1-py3-geometric MODELS=${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/models -SERVER=triton_server_instance LOG=log_triton_server.log LIB=lib STARTED_INDICATOR="Started GRPCService" @@ -83,6 +86,7 @@ start_singularity(){ START_EXIT=$? if [ "$START_EXIT" -ne 0 ]; then + rm -rf ${LIB} return "$START_EXIT" fi @@ -121,7 +125,7 @@ wait_server(){ while ! $WAIT_COND >& /dev/null; do if [ "$COUNT" -gt "$WTIME" ]; then echo "timed out waiting for server to start" - $STOP_FN + VERBOSE=true $STOP_FN exit 1 else COUNT=$(($COUNT + 1)) From f8134e664f844c958950f8b60e2f9eec40cc0a9b Mon Sep 17 00:00:00 2001 From: ddesouza Date: Tue, 29 Sep 2020 20:12:15 +0200 Subject: [PATCH 124/778] Code-Checks --- DataFormats/HeavyIonEvent/interface/HFFilterStruct.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h b/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h index 5c30fd8bb950c..7c400aa7e5742 100644 --- a/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h +++ b/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h @@ -8,6 +8,6 @@ namespace pat { int numMinHFTowers4; int numMinHFTowers5; }; -} +} // namespace pat #endif From 5b874f57b75f9ae5311234f1d926668d229bd7f9 Mon Sep 17 00:00:00 2001 From: Jan Kaspar Date: Wed, 30 Sep 2020 09:41:38 +0200 Subject: [PATCH 125/778] Removed obsolete RP alignment data. --- .../CTPPS/data/RPixGeometryCorrections.xml | 18 --- .../2015_10_18_fill4511/version2/sr/45.xml | 115 ----------------- .../2015_10_18_fill4511/version2/sr/56.xml | 116 ------------------ .../RPData/alignment_tb_run9509_45_no20.xml | 103 ---------------- Alignment/RPData/alignment_tb_run9509_56.xml | 116 ------------------ 5 files changed, 468 deletions(-) delete mode 100644 Alignment/CTPPS/data/RPixGeometryCorrections.xml delete mode 100644 Alignment/RPData/LHC/2015_10_18_fill4511/version2/sr/45.xml delete mode 100644 Alignment/RPData/LHC/2015_10_18_fill4511/version2/sr/56.xml delete mode 100644 Alignment/RPData/alignment_tb_run9509_45_no20.xml delete mode 100644 Alignment/RPData/alignment_tb_run9509_56.xml diff --git a/Alignment/CTPPS/data/RPixGeometryCorrections.xml b/Alignment/CTPPS/data/RPixGeometryCorrections.xml deleted file mode 100644 index 05bd5035822da..0000000000000 --- a/Alignment/CTPPS/data/RPixGeometryCorrections.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/Alignment/RPData/LHC/2015_10_18_fill4511/version2/sr/45.xml b/Alignment/RPData/LHC/2015_10_18_fill4511/version2/sr/45.xml deleted file mode 100644 index c4799950f8c83..0000000000000 --- a/Alignment/RPData/LHC/2015_10_18_fill4511/version2/sr/45.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Alignment/RPData/LHC/2015_10_18_fill4511/version2/sr/56.xml b/Alignment/RPData/LHC/2015_10_18_fill4511/version2/sr/56.xml deleted file mode 100644 index 4d5334624830d..0000000000000 --- a/Alignment/RPData/LHC/2015_10_18_fill4511/version2/sr/56.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Alignment/RPData/alignment_tb_run9509_45_no20.xml b/Alignment/RPData/alignment_tb_run9509_45_no20.xml deleted file mode 100644 index ee037fe10496e..0000000000000 --- a/Alignment/RPData/alignment_tb_run9509_45_no20.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Alignment/RPData/alignment_tb_run9509_56.xml b/Alignment/RPData/alignment_tb_run9509_56.xml deleted file mode 100644 index 3da3e073b64fd..0000000000000 --- a/Alignment/RPData/alignment_tb_run9509_56.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 4ad5e4bebc03febe123a9bd00853746dc1bb1440 Mon Sep 17 00:00:00 2001 From: Caroline Date: Wed, 30 Sep 2020 10:11:43 +0200 Subject: [PATCH 126/778] Decoupling Charge Reweighting from SiPixelDigitizerAlgorithm and Fixing typo --- .../SiPixelChargeReweightingAlgorithm.cc | 598 ++++++++++++++++++ .../SiPixelChargeReweightingAlgorithm.h | 88 +++ .../plugins/SiPixelDigitizerAlgorithm.cc | 516 +-------------- .../plugins/SiPixelDigitizerAlgorithm.h | 73 +-- 4 files changed, 722 insertions(+), 553 deletions(-) create mode 100644 SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc create mode 100644 SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc new file mode 100644 index 0000000000000..e0040d4fbc245 --- /dev/null +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc @@ -0,0 +1,598 @@ +//class SiPixelChargeReweightingAlgorithm SimTracker/SiPixelDigitizer/src/SiPixelChargeReweightingAlgorithm.cc + +// Original Author Caroline Collard +// September 2020 : Extraction of the code for cluster charge reweighting from SiPixelDigitizerAlgoithm to a new class +// +#include +#include + +#include "SimGeneral/NoiseGenerators/interface/GaussianTailNoiseGenerator.h" + +#include "DataFormats/SiPixelDigi/interface/PixelDigi.h" +#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" +#include "SimTracker/Common/interface/SiG4UniversalFluctuation.h" +#include "SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h" + +#include +#include "FWCore/Utilities/interface/RandomNumberGenerator.h" +#include "CLHEP/Random/RandGaussQ.h" +#include "CLHEP/Random/RandFlat.h" +#include "CLHEP/Random/RandGeneral.h" + +//#include "PixelIndices.h" +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/Exception.h" +#include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationOfflineSimService.h" + +// Accessing dead pixel modules from the DB: +#include "DataFormats/DetId/interface/DetId.h" + +#include "CondFormats/SiPixelObjects/interface/GlobalPixel.h" + +#include "CondFormats/DataRecord/interface/SiPixelQualityRcd.h" +#include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h" +#include "CondFormats/DataRecord/interface/SiPixelLorentzAngleSimRcd.h" +#include "CondFormats/DataRecord/interface/SiPixelDynamicInefficiencyRcd.h" +#include "CondFormats/DataRecord/interface/SiPixelStatusScenarioProbabilityRcd.h" +#include "CondFormats/DataRecord/interface/SiPixelStatusScenariosRcd.h" +#include "CondFormats/DataRecord/interface/SiPixel2DTemplateDBObjectRcd.h" + +#include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingTree.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelFedCabling.h" +#include "CondFormats/SiPixelObjects/interface/PixelIndices.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelLorentzAngle.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelQuality.h" +#include "CondFormats/SiPixelObjects/interface/PixelROC.h" +#include "CondFormats/SiPixelObjects/interface/LocalPixel.h" +#include "CondFormats/SiPixelObjects/interface/CablingPathToDetUnit.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelDynamicInefficiency.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelFEDChannelContainer.h" +#include "CondFormats/SiPixelObjects/interface/SiPixelQualityProbabilities.h" +#include "CondFormats/SiPixelObjects/interface/SiPixel2DTemplateDBObject.h" + +#include "CondFormats/SiPixelObjects/interface/SiPixelFrameReverter.h" +#include "CondFormats/SiPixelObjects/interface/PixelFEDCabling.h" +#include "CondFormats/SiPixelObjects/interface/PixelFEDLink.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" +#include "SimDataFormats/PileupSummaryInfo/interface/PileupMixingContent.h" +#include "SimDataFormats/Track/interface/SimTrack.h" + +// Geometry +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" + +#include "CondFormats/SiPixelObjects/interface/PixelROC.h" + +using namespace edm; +using namespace sipixelobjects; + +void SiPixelChargeReweightingAlgorithm::init(const edm::EventSetup& es) { + // Read template files for charge reweighting + if (UseReweighting) { + edm::ESHandle SiPixel2DTemp_den; + es.get().get("denominator", SiPixel2DTemp_den); + dbobject_den = SiPixel2DTemp_den.product(); + + edm::ESHandle SiPixel2DTemp_num; + es.get().get("numerator", SiPixel2DTemp_num); + dbobject_num = SiPixel2DTemp_num.product(); + + int numOfTemplates = dbobject_den->numOfTempl() + dbobject_num->numOfTempl(); + templateStores_.reserve(numOfTemplates); + SiPixelTemplate2D::pushfile(*dbobject_den, templateStores_); + SiPixelTemplate2D::pushfile(*dbobject_num, templateStores_); + + track.resize(6); + } +} + +//========================================================================= + +SiPixelChargeReweightingAlgorithm::SiPixelChargeReweightingAlgorithm(const edm::ParameterSet& conf) + : + + templ2D(templateStores_), + xdouble(TXSIZE), + ydouble(TYSIZE), + IDnum(conf.exists("TemplateIDnumerator") ? conf.getParameter("TemplateIDnumerator") : 0), + IDden(conf.exists("TemplateIDdenominator") ? conf.getParameter("TemplateIDdenominator") : 0), + + UseReweighting(conf.getParameter("UseReweighting")), + PrintClusters(conf.getParameter("PrintClusters")), + PrintTemplates(conf.getParameter("PrintTemplates")) { + LogInfo("PixelDigitizer ") << "SiPixelChargeReweightingAlgorithm constructed" + << "UseReweighting = " << UseReweighting; +} + +//========================================================================= +SiPixelChargeReweightingAlgorithm::~SiPixelChargeReweightingAlgorithm() { + LogDebug("PixelDigitizer") << "SiPixelChargeReweightingAlgorithm deleted"; +} + +//============================================================================ + +bool SiPixelChargeReweightingAlgorithm::hitSignalReweight(const PSimHit& hit, + std::map >& hit_signal, + const size_t hitIndex, + const unsigned int tofBin, + const PixelTopology* topol, + uint32_t detID, + signal_map_type& theSignal, + unsigned short int processType, + const bool& boolmakeDigiSimLinks) { + int irow_min = topol->nrows(); + int irow_max = 0; + int icol_min = topol->ncolumns(); + int icol_max = 0; + + float chargeBefore = 0; + float chargeAfter = 0; + signal_map_type hitSignal; + LocalVector direction = hit.exitPoint() - hit.entryPoint(); + + for (std::map >::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) { + int chan = (*im).first; + std::pair pixelWithCharge = PixelDigi::channelToPixel(chan); + + hitSignal[chan] += + (boolmakeDigiSimLinks ? SiPixelDigitizerAlgorithm::Amplitude((*im).second, &hit, hitIndex, tofBin, (*im).second) + : SiPixelDigitizerAlgorithm::Amplitude((*im).second, (*im).second)); + chargeBefore += (*im).second; + + if (pixelWithCharge.first < irow_min) + irow_min = pixelWithCharge.first; + if (pixelWithCharge.first > irow_max) + irow_max = pixelWithCharge.first; + if (pixelWithCharge.second < icol_min) + icol_min = pixelWithCharge.second; + if (pixelWithCharge.second > icol_max) + icol_max = pixelWithCharge.second; + } + + LocalPoint hitEntryPoint = hit.entryPoint(); + + float trajectoryScaleToPosition = hitEntryPoint.z() / direction.z(); + + if ((hitEntryPoint.z() > 0 && direction.z() < 0) || (hitEntryPoint.z() < 0 && direction.z() > 0)) { + trajectoryScaleToPosition *= -1; + } + + LocalPoint hitPosition = hitEntryPoint + trajectoryScaleToPosition * direction; + + MeasurementPoint hitPositionPixel = topol->measurementPosition(hit.localPosition()); + std::pair hitPixel = + std::pair(int(floor(hitPositionPixel.x())), int(floor(hitPositionPixel.y()))); + + MeasurementPoint originPixel = MeasurementPoint(hitPixel.first - THX + 0.5, hitPixel.second - THY + 0.5); + LocalPoint origin = topol->localPosition(originPixel); + + MeasurementPoint hitEntryPointPixel = topol->measurementPosition(hit.entryPoint()); + MeasurementPoint hitExitPointPixel = topol->measurementPosition(hit.exitPoint()); + std::pair entryPixel = + std::pair(int(floor(hitEntryPointPixel.x())), int(floor(hitEntryPointPixel.y()))); + std::pair exitPixel = + std::pair(int(floor(hitExitPointPixel.x())), int(floor(hitExitPointPixel.y()))); + + int hitcol_min, hitcol_max, hitrow_min, hitrow_max; + if (entryPixel.first > exitPixel.first) { + hitrow_min = exitPixel.first; + hitrow_max = entryPixel.first; + } else { + hitrow_min = entryPixel.first; + hitrow_max = exitPixel.first; + } + + if (entryPixel.second > exitPixel.second) { + hitcol_min = exitPixel.second; + hitcol_max = entryPixel.second; + } else { + hitcol_min = entryPixel.second; + hitcol_max = exitPixel.second; + } + +#ifdef TP_DEBUG + LocalPoint CMSSWhitPosition = hit.localPosition(); + + LogDebug("Pixel Digitizer") << "\n" + << "Particle ID is: " << hit.particleType() << "\n" + << "Process type: " << hit.processType() << "\n" + << "HitPosition:" + << "\n" + << "Hit entry x/y/z: " << hit.entryPoint().x() << " " << hit.entryPoint().y() << " " + << hit.entryPoint().z() << " " + << "Hit exit x/y/z: " << hit.exitPoint().x() << " " << hit.exitPoint().y() << " " + << hit.exitPoint().z() << " " + + << "Pixel Pos - X: " << hitPositionPixel.x() << " Y: " << hitPositionPixel.y() << "\n" + << "Cart.Cor. - X: " << CMSSWhitPosition.x() << " Y: " << CMSSWhitPosition.y() << "\n" + << "Z=0 Pos - X: " << hitPosition.x() << " Y: " << hitPosition.y() << "\n" + + << "Origin of the template:" + << "\n" + << "Pixel Pos - X: " << originPixel.x() << " Y: " << originPixel.y() << "\n" + << "Cart.Cor. - X: " << origin.x() << " Y: " << origin.y() << "\n" + << "\n" + << "Entry/Exit:" + << "\n" + << "Entry - X: " << hit.entryPoint().x() << " Y: " << hit.entryPoint().y() + << " Z: " << hit.entryPoint().z() << "\n" + << "Exit - X: " << hit.exitPoint().x() << " Y: " << hit.exitPoint().y() + << " Z: " << hit.exitPoint().z() << "\n" + + << "Entry - X Pixel: " << hitEntryPointPixel.x() << " Y Pixel: " << hitEntryPointPixel.y() + << "\n" + << "Exit - X Pixel: " << hitExitPointPixel.x() << " Y Pixel: " << hitExitPointPixel.y() + << "\n" + + << "row min: " << irow_min << " col min: " << icol_min << "\n"; +#endif + + if (!(irow_min <= hitrow_max && irow_max >= hitrow_min && icol_min <= hitcol_max && icol_max >= hitcol_min)) { + // The clusters do not have an overlap, hence the hit is NOT reweighted + return false; + } + + float cmToMicrons = 10000.f; + + track[0] = (hitPosition.x() - origin.x()) * cmToMicrons; + track[1] = (hitPosition.y() - origin.y()) * cmToMicrons; + track[2] = 0.0f; //Middle of sensor is origin for Z-axis + track[3] = direction.x(); + track[4] = direction.y(); + track[5] = direction.z(); + + array_2d pixrewgt(boost::extents[TXSIZE][TYSIZE]); + + for (int row = 0; row < TXSIZE; ++row) { + for (int col = 0; col < TYSIZE; ++col) { + pixrewgt[row][col] = 0; + } + } + + for (int row = 0; row < TXSIZE; ++row) { + xdouble[row] = topol->isItBigPixelInX(hitPixel.first + row - THX); + } + + for (int col = 0; col < TYSIZE; ++col) { + ydouble[col] = topol->isItBigPixelInY(hitPixel.second + col - THY); + } + + for (int row = 0; row < TXSIZE; ++row) { + for (int col = 0; col < TYSIZE; ++col) { + //Fill charges into 21x13 Pixel Array with hitPixel in centre + pixrewgt[row][col] = + hitSignal[PixelDigi::pixelToChannel(hitPixel.first + row - THX, hitPixel.second + col - THY)]; + } + } + + if (PrintClusters) { + std::cout << "Cluster before reweighting: " << std::endl; + printCluster(pixrewgt); + } + + int ierr; + // for unirradiated: 2nd argument is IDden + // for irradiated: 2nd argument is IDnum + if (UseReweighting == true) { + int ID1 = dbobject_num->getTemplateID(detID); + int ID0 = dbobject_den->getTemplateID(detID); + + if (ID0 == ID1) { + return false; + } + ierr = PixelTempRewgt2D(ID0, ID1, pixrewgt); + } else { + ierr = PixelTempRewgt2D(IDden, IDden, pixrewgt); + } + if (ierr != 0) { +#ifdef TP_DEBUG + LogDebug("PixelDigitizer ") << "Cluster Charge Reweighting did not work properly."; +#endif + return false; + } + + if (PrintClusters) { + std::cout << "Cluster after reweighting: " << std::endl; + printCluster(pixrewgt); + } + + for (int row = 0; row < TXSIZE; ++row) { + for (int col = 0; col < TYSIZE; ++col) { + float charge = 0; + charge = pixrewgt[row][col]; + if ((hitPixel.first + row - THX) >= 0 && (hitPixel.first + row - THX) < topol->nrows() && + (hitPixel.second + col - THY) >= 0 && (hitPixel.second + col - THY) < topol->ncolumns() && charge > 0) { + chargeAfter += charge; + theSignal[PixelDigi::pixelToChannel(hitPixel.first + row - THX, hitPixel.second + col - THY)] += + (boolmakeDigiSimLinks ? SiPixelDigitizerAlgorithm::Amplitude(charge, &hit, hitIndex, tofBin, charge) + : SiPixelDigitizerAlgorithm::Amplitude(charge, charge)); + } + } + } + + if (chargeBefore != 0. && chargeAfter == 0.) { + return false; + } + + if (PrintClusters) { + std::cout << std::endl; + std::cout << "Charges (before->after): " << chargeBefore << " -> " << chargeAfter << std::endl; + std::cout << "Charge loss: " << (1 - chargeAfter / chargeBefore) * 100 << " %" << std::endl << std::endl; + } + + return true; +} + +// ******************************************************************************************************* +//! Reweight CMSSW clusters to look like clusters corresponding to Pixelav Templates. +//! \param id_in - (input) identifier of the template corresponding to the input events +//! \param id_rewgt - (input) identifier of the template corresponding to the output events +//! \param cluster - (input/output) boost multi_array container of 7x21 array of pixel signals, +//! origin of local coords (0,0) at center of pixel cluster[3][10]. +//! returns 0 if everything is OK, 1 if angles are outside template coverage (cluster is probably still +//! usable, > 1 if something is wrong (no reweight done). +// ******************************************************************************************************* +int SiPixelChargeReweightingAlgorithm::PixelTempRewgt2D(int id_in, int id_rewgt, array_2d& cluster) { + // Local variables + int i, j, k, l, kclose; + int nclusx, nclusy, success; + float xsize, ysize, q50i, q100i, q50r, q10r, q100r, xhit2D, yhit2D, qclust, dist2, dmin2; + float xy_in[BXM2][BYM2], xy_rewgt[BXM2][BYM2], xy_clust[TXSIZE][TYSIZE]; + int denx_clust[TXSIZE][TYSIZE], deny_clust[TXSIZE][TYSIZE]; + int goodWeightsUsed, nearbyWeightsUsed, noWeightsUsed; + float cotalpha, cotbeta; + // success = 0 is returned if everthing is OK + success = 0; + + // Copy the array to remember original charges + array_2d clust(cluster); + + // Take the pixel dimensions from the 2D template + templ2D.getid(id_in); + xsize = templ2D.xsize(); + ysize = templ2D.ysize(); + + // Calculate the track angles + + if (std::abs(track[5]) > 0.f) { + cotalpha = track[3] / track[5]; //if track[5] (direction in z) is 0 the hit is not processed by re-weighting + cotbeta = track[4] / track[5]; + } else { + LogDebug("Pixel Digitizer") << "Reweighting angle is not good!" << std::endl; + return 9; //returned value here indicates that no reweighting was done in this case + } + + // The 2-D templates are defined on a shifted coordinate system wrt the 1D templates + if (ydouble[0]) { + yhit2D = track[1] - cotbeta * track[2] + ysize; + } else { + yhit2D = track[1] - cotbeta * track[2] + 0.5f * ysize; + } + if (xdouble[0]) { + xhit2D = track[0] - cotalpha * track[2] + xsize; + } else { + xhit2D = track[0] - cotalpha * track[2] + 0.5f * xsize; + } + + // Zero the input and output templates + for (i = 0; i < BYM2; ++i) { + for (j = 0; j < BXM2; ++j) { + xy_in[j][i] = 0.f; + xy_rewgt[j][i] = 0.f; + } + } + + // Next, interpolate the CMSSW template needed to analyze this cluster + + if (!templ2D.xytemp(id_in, cotalpha, cotbeta, xhit2D, yhit2D, ydouble, xdouble, xy_in)) { + success = 1; + } + if (success != 0) { +#ifdef TP_DEBUG + LogDebug("Pixel Digitizer") << "No matching template found" << std::endl; +#endif + return 2; + } + + if (PrintTemplates) { + std::cout << "Template unirrad: " << std::endl; + printCluster(xy_in); + } + + q50i = templ2D.s50(); + //q50i = 0; + q100i = 2.f * q50i; + + // Check that the cluster container is a 13x21 matrix + + if (cluster.num_dimensions() != 2) { + LogWarning("Pixel Digitizer") << "Cluster is not 2-dimensional. Return." << std::endl; + return 3; + } + nclusx = (int)cluster.shape()[0]; + nclusy = (int)cluster.shape()[1]; + if (nclusx != TXSIZE || xdouble.size() != TXSIZE) { + LogWarning("Pixel Digitizer") << "Sizes in x do not match: nclusx=" << nclusx << " xdoubleSize=" << xdouble.size() + << " TXSIZE=" << TXSIZE << ". Return." << std::endl; + return 4; + } + if (nclusy != TYSIZE || ydouble.size() != TYSIZE) { + LogWarning("Pixel Digitizer") << "Sizes in y do not match. Return." << std::endl; + return 5; + } + + // Sum initial charge in the cluster + + qclust = 0.f; + for (i = 0; i < TYSIZE; ++i) { + for (j = 0; j < TXSIZE; ++j) { + xy_clust[j][i] = 0.f; + denx_clust[j][i] = 0; + deny_clust[j][i] = 0; + if (cluster[j][i] > q100i) { + qclust += cluster[j][i]; + } + } + } + + // Next, interpolate the physical output template needed to reweight + + if (!templ2D.xytemp(id_rewgt, cotalpha, cotbeta, xhit2D, yhit2D, ydouble, xdouble, xy_rewgt)) { + success = 1; + } + + if (PrintTemplates) { + std::cout << "Template irrad: " << std::endl; + printCluster(xy_rewgt); + } + + q50r = templ2D.s50(); + q100r = 2.f * q50r; + q10r = 0.2f * q50r; + + // Find all non-zero denominator pixels in the input template and generate "inside" weights + + int ntpix = 0; + int ncpix = 0; + std::vector ytclust; + std::vector xtclust; + std::vector ycclust; + std::vector xcclust; + qclust = 0.f; + for (i = 0; i < TYSIZE; ++i) { + for (j = 0; j < TXSIZE; ++j) { + if (xy_in[j + 1][i + 1] > q100i) { + ++ntpix; + ytclust.push_back(i); + xtclust.push_back(j); + xy_clust[j][i] = xy_rewgt[j + 1][i + 1] / xy_in[j + 1][i + 1]; + denx_clust[j][i] = j; + deny_clust[j][i] = i; + } + } + } + + // Find all non-zero numerator pixels not matched to denominator in the output template and generate "inside" weights + + for (i = 0; i < TYSIZE; ++i) { + for (j = 0; j < TXSIZE; ++j) { + if (xy_rewgt[j + 1][i + 1] > q10r && xy_clust[j][i] == 0.f && ntpix > 0) { + // Search for nearest denominator pixel + dmin2 = 10000.f; + kclose = 0; + for (k = 0; k < ntpix; ++k) { + dist2 = (i - ytclust[k]) * (i - ytclust[k]) + 0.44444f * (j - xtclust[k]) * (j - xtclust[k]); + if (dist2 < dmin2) { + dmin2 = dist2; + kclose = k; + } + } + xy_clust[j][i] = xy_rewgt[j + 1][i + 1] / xy_in[xtclust[kclose] + 1][ytclust[kclose] + 1]; + denx_clust[j][i] = xtclust[kclose]; + deny_clust[j][i] = ytclust[kclose]; + } + } + } + + if (PrintTemplates) { + std::cout << "Weights:" << std::endl; + printCluster(xy_clust); + } + + // Do the reweighting + goodWeightsUsed = 0; + nearbyWeightsUsed = 0; + noWeightsUsed = 0; + + for (i = 0; i < TYSIZE; ++i) { + for (j = 0; j < TXSIZE; ++j) { + if (xy_clust[j][i] > 0.f) { + cluster[j][i] = xy_clust[j][i] * clust[denx_clust[j][i]][deny_clust[j][i]]; + if (cluster[j][i] > q100r) { + qclust += cluster[j][i]; + } + if (cluster[j][i] > 0) { + goodWeightsUsed++; + } + } else { + if (clust[j][i] > 0.f) { + ++ncpix; + ycclust.push_back(i); + xcclust.push_back(j); + } + } + } + } + + // Now reweight pixels outside of template footprint using closest weights + + if (ncpix > 0) { + for (l = 0; l < ncpix; ++l) { + i = ycclust[l]; + j = xcclust[l]; + dmin2 = 10000.f; + kclose = 0; + for (k = 0; k < ntpix; ++k) { + dist2 = (i - ytclust[k]) * (i - ytclust[k]) + 0.44444f * (j - xtclust[k]) * (j - xtclust[k]); + if (dist2 < dmin2) { + dmin2 = dist2; + kclose = k; + } + } + if (dmin2 < 5.f) { + nearbyWeightsUsed++; + cluster[j][i] *= xy_clust[xtclust[kclose]][ytclust[kclose]]; + if (cluster[j][i] > q100r) { + qclust += cluster[j][i]; + } + } else { + noWeightsUsed++; + cluster[j][i] = 0.f; + } + } + } + + return success; +} // PixelTempRewgt2D + +void SiPixelChargeReweightingAlgorithm::printCluster(array_2d& cluster) { + for (int col = 0; col < TYSIZE; ++col) { + for (int row = 0; row < TXSIZE; ++row) { + std::cout << std::setw(10) << std::setprecision(0) << std::fixed; + std::cout << cluster[row][col]; + } + std::cout << std::endl; + } + std::cout.copyfmt(std::ios(nullptr)); +} + +void SiPixelChargeReweightingAlgorithm::printCluster(float arr[BXM2][BYM2]) { + for (int col = 0; col < BYM2; ++col) { + for (int row = 0; row < BXM2; ++row) { + std::cout << std::setw(10) << std::setprecision(0) << std::fixed; + std::cout << arr[row][col]; + } + std::cout << std::endl; + } + std::cout.copyfmt(std::ios(nullptr)); +} + +void SiPixelChargeReweightingAlgorithm::printCluster(float arr[TXSIZE][TYSIZE]) { + for (int col = 0; col < TYSIZE; ++col) { + for (int row = 0; row < TXSIZE; ++row) { + std::cout << std::setw(10) << std::fixed; + std::cout << arr[row][col]; + } + std::cout << std::endl; + } + std::cout.copyfmt(std::ios(nullptr)); +} diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h new file mode 100644 index 0000000000000..4d280aef6ce28 --- /dev/null +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h @@ -0,0 +1,88 @@ +#ifndef SimTracker_SiPixelDigitizer_SiPixelChargeReweightingAlgorithm_h +#define SimTracker_SiPixelDigitizer_SiPixelChargeReweightingAlgorithm_h + +#include "SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h" + +typedef boost::multi_array array_2d; + +// forward declarations + +// For the random numbers +namespace CLHEP { + class HepRandomEngine; +} + +namespace edm { + class EventSetup; + class ParameterSet; +} // namespace edm + +class DetId; +class GaussianTailNoiseGenerator; +class PixelDigi; +class PixelDigiSimLink; +class PixelGeomDetUnit; +class SiG4UniversalFluctuation; +class SiPixelFedCablingMap; +class SiPixelGainCalibrationOfflineSimService; +class SiPixelLorentzAngle; +class SiPixelQuality; +class SiPixelDynamicInefficiency; +class TrackerGeometry; +class TrackerTopology; +class SiPixelFEDChannelContainer; +class SiPixelQualityProbabilities; + +class SiPixelChargeReweightingAlgorithm { +public: + SiPixelChargeReweightingAlgorithm(const edm::ParameterSet& conf); + ~SiPixelChargeReweightingAlgorithm(); + + // initialization that cannot be done in the constructor + void init(const edm::EventSetup& es); + + typedef std::map > signal_map_type; // from Digi.Skel. + typedef signal_map_type::iterator signal_map_iterator; // from Digi.Skel. + typedef signal_map_type::const_iterator signal_map_const_iterator; // from Digi.Skel. + + bool hitSignalReweight(const PSimHit& hit, + std::map >& hit_signal, + const size_t hitIndex, + const unsigned int tofBin, + const PixelTopology* topol, + uint32_t detID, + signal_map_type& theSignal, + unsigned short int processType, + const bool& boolmakeDigiSimLinks); + +private: + // Internal typedef + typedef std::map signalMaps; + typedef GloballyPositioned Frame; + typedef std::vector Parameters; + typedef boost::multi_array array_2d; + + // Variables and objects for the charge reweighting using 2D templates + SiPixelTemplate2D templ2D; + std::vector xdouble; + std::vector ydouble; + std::vector track; + int IDnum, IDden; + + const bool UseReweighting; + const bool PrintClusters; + const bool PrintTemplates; + + std::vector templateStores_; + + const SiPixel2DTemplateDBObject* dbobject_den; + const SiPixel2DTemplateDBObject* dbobject_num; + + // methods for charge reweighting in irradiated sensors + int PixelTempRewgt2D(int id_gen, int id_rewgt, array_2d& cluster); + void printCluster(array_2d& cluster); + void printCluster(float arr[BXM2][BYM2]); + void printCluster(float arr[TXSIZE][TYSIZE]); +}; + +#endif diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc index 3fcaaa154a2a7..6bd6ef9419d1c 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc @@ -49,7 +49,8 @@ #include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" #include "SimTracker/Common/interface/SiG4UniversalFluctuation.h" -#include "SiPixelDigitizerAlgorithm.h" +#include "SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h" +#include "SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h" #include #include "FWCore/Utilities/interface/RandomNumberGenerator.h" @@ -174,23 +175,7 @@ void SiPixelDigitizerAlgorithm::init(const edm::EventSetup& es) { } } - // Read template files for charge reweighting - if (UseReweighting) { - edm::ESHandle SiPixel2DTemp_den; - es.get().get("denominator", SiPixel2DTemp_den); - dbobject_den = SiPixel2DTemp_den.product(); - - edm::ESHandle SiPixel2DTemp_num; - es.get().get("numerator", SiPixel2DTemp_num); - dbobject_num = SiPixel2DTemp_num.product(); - - int numOfTemplates = dbobject_den->numOfTempl() + dbobject_num->numOfTempl(); - templateStores_.reserve(numOfTemplates); - SiPixelTemplate2D::pushfile(*dbobject_den, templateStores_); - SiPixelTemplate2D::pushfile(*dbobject_num, templateStores_); - - track.resize(6); - } + TheNewSiPixelChargeReweightingAlgorithmClass->init(es); } //========================================================================= @@ -210,11 +195,7 @@ SiPixelDigitizerAlgorithm::SiPixelDigitizerAlgorithm(const edm::ParameterSet& co DeadModules(use_deadmodule_DB_ ? Parameters() : conf.getParameter("DeadModules")), // get dead module from cfg file - templ2D(templateStores_), - xdouble(TXSIZE), - ydouble(TYSIZE), - IDnum(conf.exists("TemplateIDnumerator") ? conf.getParameter("TemplateIDnumerator") : 0), - IDden(conf.exists("TemplateIDdenominator") ? conf.getParameter("TemplateIDdenominator") : 0), + TheNewSiPixelChargeReweightingAlgorithmClass(), // Common pixel parameters // These are parameters which are not likely to be changed @@ -330,8 +311,6 @@ SiPixelDigitizerAlgorithm::SiPixelDigitizerAlgorithm(const edm::ParameterSet& co // Add pixel radiation damage for upgrade studies AddPixelAging(conf.getParameter("DoPixelAging")), UseReweighting(conf.getParameter("UseReweighting")), - PrintClusters(conf.getParameter("PrintClusters")), - PrintTemplates(conf.getParameter("PrintTemplates")), // delta cutoff in MeV, has to be same as in OSCAR(0.030/cmsim=1.0 MeV //tMax(0.030), // In MeV. @@ -354,6 +333,8 @@ SiPixelDigitizerAlgorithm::SiPixelDigitizerAlgorithm(const edm::ParameterSet& co << "threshold in electron BPix Layer2 = " << theThresholdInE_BPix_L2 << " " << theElectronPerADC << " " << theAdcFullScale << " The delta cut-off is set to " << tMax << " pix-inefficiency " << AddPixelInefficiency; + + TheNewSiPixelChargeReweightingAlgorithmClass = std::make_unique(conf); } std::map > SiPixelDigitizerAlgorithm::initCal() const { @@ -481,7 +462,7 @@ SiPixelDigitizerAlgorithm::PixelEfficiencies::PixelEfficiencies(const edm::Param FromConfig = FromConfig && conf.exists("thePixelColEfficiency_BPix4") && conf.exists("thePixelEfficiency_BPix4") && conf.exists("thePixelChipEfficiency_BPix4"); if (NumberOfEndcapDisks >= 3) - FromConfig = FromConfig && conf.exists("thePixelColEfficiency_FPix4") && + FromConfig = FromConfig && conf.exists("thePixelColEfficiency_FPix3") && conf.exists("thePixelEfficiency_FPix3") && conf.exists("thePixelChipEfficiency_FPix3"); if (FromConfig) { LogInfo("PixelDigitizer ") << "The PixelDigitizer inefficiency configuration is read from the config file.\n"; @@ -1532,11 +1513,12 @@ void SiPixelDigitizerAlgorithm::induce_signal(std::vector::const_iterat bool reweighted = false; if (UseReweighting) { if (hit.processType() == 0) { - reweighted = hitSignalReweight(hit, hit_signal, hitIndex, tofBin, topol, detID, theSignal, hit.processType()); + reweighted = TheNewSiPixelChargeReweightingAlgorithmClass->hitSignalReweight( + hit, hit_signal, hitIndex, tofBin, topol, detID, theSignal, hit.processType(), makeDigiSimLinks_); } else { // If it's not the primary particle, use the first hit in the collection as SimHit, which should be the corresponding primary. - reweighted = - hitSignalReweight((*inputBegin), hit_signal, hitIndex, tofBin, topol, detID, theSignal, hit.processType()); + reweighted = TheNewSiPixelChargeReweightingAlgorithmClass->hitSignalReweight( + (*inputBegin), hit_signal, hitIndex, tofBin, topol, detID, theSignal, hit.processType(), makeDigiSimLinks_); } } if (!reweighted) { @@ -2329,479 +2311,3 @@ void SiPixelDigitizerAlgorithm::module_killing_DB(uint32_t detID) { } } } - -bool SiPixelDigitizerAlgorithm::hitSignalReweight(const PSimHit& hit, - std::map >& hit_signal, - const size_t hitIndex, - const unsigned int tofBin, - const PixelTopology* topol, - uint32_t detID, - signal_map_type& theSignal, - unsigned short int processType) { - int irow_min = topol->nrows(); - int irow_max = 0; - int icol_min = topol->ncolumns(); - int icol_max = 0; - - float chargeBefore = 0; - float chargeAfter = 0; - signal_map_type hitSignal; - LocalVector direction = hit.exitPoint() - hit.entryPoint(); - - for (std::map >::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) { - int chan = (*im).first; - std::pair pixelWithCharge = PixelDigi::channelToPixel(chan); - //std::cout << "PixelHit - x: " << pixelWithCharge.first << " y: " << pixelWithCharge.second << " With Charge: " << (*im).second << std::endl; - - hitSignal[chan] += (makeDigiSimLinks_ ? Amplitude((*im).second, &hit, hitIndex, tofBin, (*im).second) - : Amplitude((*im).second, (*im).second)); - chargeBefore += (*im).second; - - if (pixelWithCharge.first < irow_min) - irow_min = pixelWithCharge.first; - if (pixelWithCharge.first > irow_max) - irow_max = pixelWithCharge.first; - if (pixelWithCharge.second < icol_min) - icol_min = pixelWithCharge.second; - if (pixelWithCharge.second > icol_max) - icol_max = pixelWithCharge.second; - } - - LocalPoint hitEntryPoint = hit.entryPoint(); - - float trajectoryScaleToPosition = hitEntryPoint.z() / direction.z(); - - if ((hitEntryPoint.z() > 0 && direction.z() < 0) || (hitEntryPoint.z() < 0 && direction.z() > 0)) { - trajectoryScaleToPosition *= -1; - } - - LocalPoint hitPosition = hitEntryPoint + trajectoryScaleToPosition * direction; - - MeasurementPoint hitPositionPixel = topol->measurementPosition(hit.localPosition()); - std::pair hitPixel = - std::pair(int(floor(hitPositionPixel.x())), int(floor(hitPositionPixel.y()))); - - MeasurementPoint originPixel = MeasurementPoint(hitPixel.first - THX + 0.5, hitPixel.second - THY + 0.5); - LocalPoint origin = topol->localPosition(originPixel); - - MeasurementPoint hitEntryPointPixel = topol->measurementPosition(hit.entryPoint()); - MeasurementPoint hitExitPointPixel = topol->measurementPosition(hit.exitPoint()); - std::pair entryPixel = - std::pair(int(floor(hitEntryPointPixel.x())), int(floor(hitEntryPointPixel.y()))); - std::pair exitPixel = - std::pair(int(floor(hitExitPointPixel.x())), int(floor(hitExitPointPixel.y()))); - - int hitcol_min, hitcol_max, hitrow_min, hitrow_max; - if (entryPixel.first > exitPixel.first) { - hitrow_min = exitPixel.first; - hitrow_max = entryPixel.first; - } else { - hitrow_min = entryPixel.first; - hitrow_max = exitPixel.first; - } - - if (entryPixel.second > exitPixel.second) { - hitcol_min = exitPixel.second; - hitcol_max = entryPixel.second; - } else { - hitcol_min = entryPixel.second; - hitcol_max = exitPixel.second; - } - -#ifdef TP_DEBUG - LocalPoint CMSSWhitPosition = hit.localPosition(); - - LogDebug("Pixel Digitizer") << "\n" - << "Particle ID is: " << hit.particleType() << "\n" - << "Process type: " << hit.processType() << "\n" - << "HitPosition:" - << "\n" - << "Hit entry x/y/z: " << hit.entryPoint().x() << " " << hit.entryPoint().y() << " " - << hit.entryPoint().z() << " " - << "Hit exit x/y/z: " << hit.exitPoint().x() << " " << hit.exitPoint().y() << " " - << hit.exitPoint().z() << " " - - << "Pixel Pos - X: " << hitPositionPixel.x() << " Y: " << hitPositionPixel.y() << "\n" - << "Cart.Cor. - X: " << CMSSWhitPosition.x() << " Y: " << CMSSWhitPosition.y() << "\n" - << "Z=0 Pos - X: " << hitPosition.x() << " Y: " << hitPosition.y() << "\n" - - << "Origin of the template:" - << "\n" - << "Pixel Pos - X: " << originPixel.x() << " Y: " << originPixel.y() << "\n" - << "Cart.Cor. - X: " << origin.x() << " Y: " << origin.y() << "\n" - << "\n" - << "Entry/Exit:" - << "\n" - << "Entry - X: " << hit.entryPoint().x() << " Y: " << hit.entryPoint().y() - << " Z: " << hit.entryPoint().z() << "\n" - << "Exit - X: " << hit.exitPoint().x() << " Y: " << hit.exitPoint().y() - << " Z: " << hit.exitPoint().z() << "\n" - - << "Entry - X Pixel: " << hitEntryPointPixel.x() << " Y Pixel: " << hitEntryPointPixel.y() - << "\n" - << "Exit - X Pixel: " << hitExitPointPixel.x() << " Y Pixel: " << hitExitPointPixel.y() - << "\n" - - << "row min: " << irow_min << " col min: " << icol_min << "\n"; -#endif - - if (!(irow_min <= hitrow_max && irow_max >= hitrow_min && icol_min <= hitcol_max && icol_max >= hitcol_min)) { - // The clusters do not have an overlap, hence the hit is NOT reweighted - return false; - } - - float cmToMicrons = 10000.f; - - track[0] = (hitPosition.x() - origin.x()) * cmToMicrons; - track[1] = (hitPosition.y() - origin.y()) * cmToMicrons; - track[2] = 0.0f; //Middle of sensor is origin for Z-axis - track[3] = direction.x(); - track[4] = direction.y(); - track[5] = direction.z(); - - array_2d pixrewgt(boost::extents[TXSIZE][TYSIZE]); - - for (int row = 0; row < TXSIZE; ++row) { - for (int col = 0; col < TYSIZE; ++col) { - pixrewgt[row][col] = 0; - } - } - - for (int row = 0; row < TXSIZE; ++row) { - xdouble[row] = topol->isItBigPixelInX(hitPixel.first + row - THX); - } - - for (int col = 0; col < TYSIZE; ++col) { - ydouble[col] = topol->isItBigPixelInY(hitPixel.second + col - THY); - } - - for (int row = 0; row < TXSIZE; ++row) { - for (int col = 0; col < TYSIZE; ++col) { - //Fill charges into 21x13 Pixel Array with hitPixel in centre - pixrewgt[row][col] = - hitSignal[PixelDigi::pixelToChannel(hitPixel.first + row - THX, hitPixel.second + col - THY)]; - //std::cout << "Signal in " << hitPixel.first + row - THX << "/" << hitPixel.second + col - THY << " is " << hitSignal[PixelDigi::pixelToChannel(hitPixel.first + row - THX, hitPixel.second + col - THY)] << std::endl; - } - } - - if (PrintClusters) { - std::cout << "Cluster before reweighting: " << std::endl; - printCluster(pixrewgt); - } - - int ierr; - // for unirradiated: 2nd argument is IDden - // for irradiated: 2nd argument is IDnum - if (UseReweighting == true) { - int ID1 = dbobject_num->getTemplateID(detID); - int ID0 = dbobject_den->getTemplateID(detID); - - if (ID0 == ID1) { - return false; - } - ierr = PixelTempRewgt2D(ID0, ID1, pixrewgt); - } else { - ierr = PixelTempRewgt2D(IDden, IDden, pixrewgt); - } - if (ierr != 0) { -#ifdef TP_DEBUG - LogDebug("PixelDigitizer ") << "Cluster Charge Reweighting did not work properly."; -#endif - return false; - } - - if (PrintClusters) { - std::cout << "Cluster after reweighting: " << std::endl; - printCluster(pixrewgt); - } - - for (int row = 0; row < TXSIZE; ++row) { - for (int col = 0; col < TYSIZE; ++col) { - float charge = 0; - charge = pixrewgt[row][col]; - if ((hitPixel.first + row - THX) >= 0 && (hitPixel.first + row - THX) < topol->nrows() && - (hitPixel.second + col - THY) >= 0 && (hitPixel.second + col - THY) < topol->ncolumns() && charge > 0) { - chargeAfter += charge; - theSignal[PixelDigi::pixelToChannel(hitPixel.first + row - THX, hitPixel.second + col - THY)] += - (makeDigiSimLinks_ ? Amplitude(charge, &hit, hitIndex, tofBin, charge) : Amplitude(charge, charge)); - } - } - } - - if (chargeBefore != 0. && chargeAfter == 0.) { - return false; - } - - if (PrintClusters) { - std::cout << std::endl; - std::cout << "Charges (before->after): " << chargeBefore << " -> " << chargeAfter << std::endl; - std::cout << "Charge loss: " << (1 - chargeAfter / chargeBefore) * 100 << " %" << std::endl << std::endl; - } - - return true; -} - -// ******************************************************************************************************* -//! Reweight CMSSW clusters to look like clusters corresponding to Pixelav Templates. -//! \param id_in - (input) identifier of the template corresponding to the input events -//! \param id_rewgt - (input) identifier of the template corresponding to the output events -//! \param cluster - (input/output) boost multi_array container of 7x21 array of pixel signals, -//! origin of local coords (0,0) at center of pixel cluster[3][10]. -//! returns 0 if everything is OK, 1 if angles are outside template coverage (cluster is probably still -//! usable, > 1 if something is wrong (no reweight done). -// ******************************************************************************************************* -int SiPixelDigitizerAlgorithm::PixelTempRewgt2D(int id_in, int id_rewgt, array_2d& cluster) { - // Local variables - int i, j, k, l, kclose; - int nclusx, nclusy, success; - float xsize, ysize, q50i, q100i, q50r, q10r, q100r, xhit2D, yhit2D, qclust, dist2, dmin2; - float xy_in[BXM2][BYM2], xy_rewgt[BXM2][BYM2], xy_clust[TXSIZE][TYSIZE]; - int denx_clust[TXSIZE][TYSIZE], deny_clust[TXSIZE][TYSIZE]; - int goodWeightsUsed, nearbyWeightsUsed, noWeightsUsed; - float cotalpha, cotbeta; - // success = 0 is returned if everthing is OK - success = 0; - - // Copy the array to remember original charges - array_2d clust(cluster); - - // Take the pixel dimensions from the 2D template - templ2D.getid(id_in); - xsize = templ2D.xsize(); - ysize = templ2D.ysize(); - - // Calculate the track angles - - if (std::abs(track[5]) > 0.f) { - cotalpha = track[3] / track[5]; //if track[5] (direction in z) is 0 the hit is not processed by re-weighting - cotbeta = track[4] / track[5]; - } else { - LogDebug("Pixel Digitizer") << "Reweighting angle is not good!" << std::endl; - return 9; //returned value here indicates that no reweighting was done in this case - } - - // The 2-D templates are defined on a shifted coordinate system wrt the 1D templates - if (ydouble[0]) { - yhit2D = track[1] - cotbeta * track[2] + ysize; - } else { - yhit2D = track[1] - cotbeta * track[2] + 0.5f * ysize; - } - if (xdouble[0]) { - xhit2D = track[0] - cotalpha * track[2] + xsize; - } else { - xhit2D = track[0] - cotalpha * track[2] + 0.5f * xsize; - } - - // Zero the input and output templates - for (i = 0; i < BYM2; ++i) { - for (j = 0; j < BXM2; ++j) { - xy_in[j][i] = 0.f; - xy_rewgt[j][i] = 0.f; - } - } - - // Next, interpolate the CMSSW template needed to analyze this cluster - - if (!templ2D.xytemp(id_in, cotalpha, cotbeta, xhit2D, yhit2D, ydouble, xdouble, xy_in)) { - success = 1; - } - if (success != 0) { -#ifdef TP_DEBUG - LogDebug("Pixel Digitizer") << "No matching template found" << std::endl; -#endif - return 2; - } - - if (PrintTemplates) { - std::cout << "Template unirrad: " << std::endl; - printCluster(xy_in); - } - - q50i = templ2D.s50(); - //q50i = 0; - q100i = 2.f * q50i; - - // Check that the cluster container is a 13x21 matrix - - if (cluster.num_dimensions() != 2) { - LogWarning("Pixel Digitizer") << "Cluster is not 2-dimensional. Return." << std::endl; - return 3; - } - nclusx = (int)cluster.shape()[0]; - nclusy = (int)cluster.shape()[1]; - if (nclusx != TXSIZE || xdouble.size() != TXSIZE) { - LogWarning("Pixel Digitizer") << "Sizes in x do not match: nclusx=" << nclusx << " xdoubleSize=" << xdouble.size() - << " TXSIZE=" << TXSIZE << ". Return." << std::endl; - return 4; - } - if (nclusy != TYSIZE || ydouble.size() != TYSIZE) { - LogWarning("Pixel Digitizer") << "Sizes in y do not match. Return." << std::endl; - return 5; - } - - // Sum initial charge in the cluster - - qclust = 0.f; - for (i = 0; i < TYSIZE; ++i) { - for (j = 0; j < TXSIZE; ++j) { - xy_clust[j][i] = 0.f; - denx_clust[j][i] = 0; - deny_clust[j][i] = 0; - if (cluster[j][i] > q100i) { - qclust += cluster[j][i]; - } - } - } - - // Next, interpolate the physical output template needed to reweight - - if (!templ2D.xytemp(id_rewgt, cotalpha, cotbeta, xhit2D, yhit2D, ydouble, xdouble, xy_rewgt)) { - success = 1; - } - - if (PrintTemplates) { - std::cout << "Template irrad: " << std::endl; - printCluster(xy_rewgt); - } - - q50r = templ2D.s50(); - q100r = 2.f * q50r; - q10r = 0.2f * q50r; - - // Find all non-zero denominator pixels in the input template and generate "inside" weights - - int ntpix = 0; - int ncpix = 0; - std::vector ytclust; - std::vector xtclust; - std::vector ycclust; - std::vector xcclust; - qclust = 0.f; - for (i = 0; i < TYSIZE; ++i) { - for (j = 0; j < TXSIZE; ++j) { - if (xy_in[j + 1][i + 1] > q100i) { - ++ntpix; - ytclust.push_back(i); - xtclust.push_back(j); - xy_clust[j][i] = xy_rewgt[j + 1][i + 1] / xy_in[j + 1][i + 1]; - denx_clust[j][i] = j; - deny_clust[j][i] = i; - } - } - } - - // Find all non-zero numerator pixels not matched to denominator in the output template and generate "inside" weights - - for (i = 0; i < TYSIZE; ++i) { - for (j = 0; j < TXSIZE; ++j) { - if (xy_rewgt[j + 1][i + 1] > q10r && xy_clust[j][i] == 0.f && ntpix > 0) { - // Search for nearest denominator pixel - dmin2 = 10000.f; - kclose = 0; - for (k = 0; k < ntpix; ++k) { - dist2 = (i - ytclust[k]) * (i - ytclust[k]) + 0.44444f * (j - xtclust[k]) * (j - xtclust[k]); - if (dist2 < dmin2) { - dmin2 = dist2; - kclose = k; - } - } - xy_clust[j][i] = xy_rewgt[j + 1][i + 1] / xy_in[xtclust[kclose] + 1][ytclust[kclose] + 1]; - denx_clust[j][i] = xtclust[kclose]; - deny_clust[j][i] = ytclust[kclose]; - } - } - } - - if (PrintTemplates) { - std::cout << "Weights:" << std::endl; - printCluster(xy_clust); - } - - // Do the reweighting - goodWeightsUsed = 0; - nearbyWeightsUsed = 0; - noWeightsUsed = 0; - - for (i = 0; i < TYSIZE; ++i) { - for (j = 0; j < TXSIZE; ++j) { - if (xy_clust[j][i] > 0.f) { - cluster[j][i] = xy_clust[j][i] * clust[denx_clust[j][i]][deny_clust[j][i]]; - if (cluster[j][i] > q100r) { - qclust += cluster[j][i]; - } - if (cluster[j][i] > 0) { - goodWeightsUsed++; - } - } else { - if (clust[j][i] > 0.f) { - ++ncpix; - ycclust.push_back(i); - xcclust.push_back(j); - } - } - } - } - - // Now reweight pixels outside of template footprint using closest weights - - if (ncpix > 0) { - for (l = 0; l < ncpix; ++l) { - i = ycclust[l]; - j = xcclust[l]; - dmin2 = 10000.f; - kclose = 0; - for (k = 0; k < ntpix; ++k) { - dist2 = (i - ytclust[k]) * (i - ytclust[k]) + 0.44444f * (j - xtclust[k]) * (j - xtclust[k]); - if (dist2 < dmin2) { - dmin2 = dist2; - kclose = k; - } - } - if (dmin2 < 5.f) { - nearbyWeightsUsed++; - cluster[j][i] *= xy_clust[xtclust[kclose]][ytclust[kclose]]; - if (cluster[j][i] > q100r) { - qclust += cluster[j][i]; - } - } else { - noWeightsUsed++; - cluster[j][i] = 0.f; - } - } - } - - return success; -} // PixelTempRewgt2D - -void SiPixelDigitizerAlgorithm::printCluster(array_2d& cluster) { - for (int col = 0; col < TYSIZE; ++col) { - for (int row = 0; row < TXSIZE; ++row) { - std::cout << std::setw(10) << std::setprecision(0) << std::fixed; - std::cout << cluster[row][col]; - } - std::cout << std::endl; - } - std::cout.copyfmt(std::ios(nullptr)); -} - -void SiPixelDigitizerAlgorithm::printCluster(float arr[BXM2][BYM2]) { - for (int col = 0; col < BYM2; ++col) { - for (int row = 0; row < BXM2; ++row) { - std::cout << std::setw(10) << std::setprecision(0) << std::fixed; - std::cout << arr[row][col]; - } - std::cout << std::endl; - } - std::cout.copyfmt(std::ios(nullptr)); -} - -void SiPixelDigitizerAlgorithm::printCluster(float arr[TXSIZE][TYSIZE]) { - for (int col = 0; col < TYSIZE; ++col) { - for (int row = 0; row < TXSIZE; ++row) { - std::cout << std::setw(10) << std::fixed; - std::cout << arr[row][col]; - } - std::cout << std::endl; - } - std::cout.copyfmt(std::ios(nullptr)); -} diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h index f7b83e526cf49..429507628c4bb 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h @@ -50,6 +50,7 @@ class TrackerGeometry; class TrackerTopology; class SiPixelFEDChannelContainer; class SiPixelQualityProbabilities; +class SiPixelChargeReweightingAlgorithm; class SiPixelDigitizerAlgorithm { public: @@ -90,28 +91,6 @@ class SiPixelDigitizerAlgorithm { typedef std::unordered_map PixelFEDChannelCollectionMap; const PixelFEDChannelCollectionMap* quality_map; -private: - //Accessing Lorentz angle from DB: - edm::ESHandle SiPixelLorentzAngle_; - - //Accessing Dead pixel modules from DB: - std::string siPixelQualityLabel; - edm::ESHandle SiPixelBadModule_; - - //Accessing Map and Geom: - edm::ESHandle map_; - edm::ESHandle geom_; - - // Get Dynamic Inefficiency scale factors from DB - edm::ESHandle SiPixelDynamicInefficiency_; - - // For BadFEDChannel simulation - edm::ESHandle scenarioProbabilityHandle; - edm::ESHandle PixelFEDChannelCollectionMapHandle; - // Define internal classes - - // definition class - // class Amplitude { public: Amplitude() : _amp(0.0) {} @@ -165,6 +144,29 @@ class SiPixelDigitizerAlgorithm { std::vector _hitInfos; }; // end class Amplitude +private: + //Accessing Lorentz angle from DB: + edm::ESHandle SiPixelLorentzAngle_; + + //Accessing Dead pixel modules from DB: + std::string siPixelQualityLabel; + edm::ESHandle SiPixelBadModule_; + + //Accessing Map and Geom: + edm::ESHandle map_; + edm::ESHandle geom_; + + // Get Dynamic Inefficiency scale factors from DB + edm::ESHandle SiPixelDynamicInefficiency_; + + // For BadFEDChannel simulation + edm::ESHandle scenarioProbabilityHandle; + edm::ESHandle PixelFEDChannelCollectionMapHandle; + // Define internal classes + + // definition class + // + // Define a class to hold the calibration parameters per pixel // Internal class CalParameters { @@ -311,17 +313,8 @@ class SiPixelDigitizerAlgorithm { const Parameters DeadModules; - // Variables and objects for the charge reweighting using 2D templates - SiPixelTemplate2D templ2D; - std::vector xdouble; - std::vector ydouble; - std::vector track; - int IDnum, IDden; + std::unique_ptr TheNewSiPixelChargeReweightingAlgorithmClass; - std::vector templateStores_; - - const SiPixel2DTemplateDBObject* dbobject_den; - const SiPixel2DTemplateDBObject* dbobject_num; private: // Variables @@ -395,8 +388,6 @@ class SiPixelDigitizerAlgorithm { // pixel aging const bool AddPixelAging; const bool UseReweighting; - const bool PrintClusters; - const bool PrintTemplates; // The PDTable //HepPDTable *particleTable; @@ -465,20 +456,6 @@ class SiPixelDigitizerAlgorithm { uint32_t detID); // remove dead modules using the list in the configuration file PixelDigi_cfi.py void module_killing_DB(uint32_t detID); // remove dead modules uisng the list in the DB - // methods for charge reweighting in irradiated sensors - int PixelTempRewgt2D(int id_gen, int id_rewgt, array_2d& cluster); - bool hitSignalReweight(const PSimHit& hit, - std::map >& hit_signal, - const size_t hitIndex, - const unsigned int tofBin, - const PixelTopology* topol, - uint32_t detID, - signal_map_type& theSignal, - unsigned short int processType); - void printCluster(array_2d& cluster); - void printCluster(float arr[BXM2][BYM2]); - void printCluster(float arr[TXSIZE][TYSIZE]); - PixelEfficiencies pixelEfficiencies_; const PixelAging pixelAging_; From 0e4e03511fe4105be887f83573f92311aaeeaecd Mon Sep 17 00:00:00 2001 From: Caroline Date: Wed, 30 Sep 2020 10:13:23 +0200 Subject: [PATCH 127/778] code-checks & code-format --- SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h index 429507628c4bb..98bd449983491 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h @@ -315,7 +315,6 @@ class SiPixelDigitizerAlgorithm { std::unique_ptr TheNewSiPixelChargeReweightingAlgorithmClass; - private: // Variables //external parameters From b1b9c30383c63ffa18d564786815e1f84666907c Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Mon, 7 Sep 2020 11:28:05 +0200 Subject: [PATCH 128/778] move plugins/BaseMVAValueMapProducer.h to interface/ --- PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionMVA.cc | 2 +- PhysicsTools/PatAlgos/BuildFile.xml | 3 ++- .../PatAlgos/{plugins => interface}/BaseMVAValueMapProducer.h | 0 PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.cc | 2 +- PhysicsTools/PatAlgos/plugins/BuildFile.xml | 1 - 5 files changed, 4 insertions(+), 4 deletions(-) rename PhysicsTools/PatAlgos/{plugins => interface}/BaseMVAValueMapProducer.h (100%) diff --git a/PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionMVA.cc b/PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionMVA.cc index 42eb16e1f57b2..e3ec32166c1bb 100644 --- a/PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionMVA.cc +++ b/PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionMVA.cc @@ -24,7 +24,7 @@ #include "RecoVertex/VertexPrimitives/interface/ConvertToFromReco.h" #include "RecoVertex/VertexPrimitives/interface/VertexState.h" -#include "PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.h" +#include "PhysicsTools/PatAlgos/interface/BaseMVAValueMapProducer.h" #include class BJetEnergyRegressionMVA : public BaseMVAValueMapProducer { diff --git a/PhysicsTools/PatAlgos/BuildFile.xml b/PhysicsTools/PatAlgos/BuildFile.xml index 83ba8f5125ca5..3f6e7ace353ba 100644 --- a/PhysicsTools/PatAlgos/BuildFile.xml +++ b/PhysicsTools/PatAlgos/BuildFile.xml @@ -12,8 +12,9 @@ - + + diff --git a/PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.h b/PhysicsTools/PatAlgos/interface/BaseMVAValueMapProducer.h similarity index 100% rename from PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.h rename to PhysicsTools/PatAlgos/interface/BaseMVAValueMapProducer.h diff --git a/PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.cc b/PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.cc index 3b78243170207..bcb00b910bc6d 100644 --- a/PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.cc @@ -16,7 +16,7 @@ // // -#include "PhysicsTools/PatAlgos/plugins/BaseMVAValueMapProducer.h" +#include "PhysicsTools/PatAlgos/interface/BaseMVAValueMapProducer.h" typedef BaseMVAValueMapProducer JetBaseMVAValueMapProducer; typedef BaseMVAValueMapProducer MuonBaseMVAValueMapProducer; diff --git a/PhysicsTools/PatAlgos/plugins/BuildFile.xml b/PhysicsTools/PatAlgos/plugins/BuildFile.xml index 8c0694553321f..2ebb62a9fb26f 100644 --- a/PhysicsTools/PatAlgos/plugins/BuildFile.xml +++ b/PhysicsTools/PatAlgos/plugins/BuildFile.xml @@ -2,7 +2,6 @@ - From b75b18537d15c4ac3e5d577a5a9b5611b9c2ec4e Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Mon, 7 Sep 2020 14:39:25 +0200 Subject: [PATCH 129/778] clean BuildFiles in Reco* and PhysicsTools --- PhysicsTools/NanoAOD/plugins/BuildFile.xml | 1 - PhysicsTools/PatAlgos/plugins/BuildFile.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/PhysicsTools/NanoAOD/plugins/BuildFile.xml b/PhysicsTools/NanoAOD/plugins/BuildFile.xml index 8d4e3269834b9..cb5d60c779e54 100644 --- a/PhysicsTools/NanoAOD/plugins/BuildFile.xml +++ b/PhysicsTools/NanoAOD/plugins/BuildFile.xml @@ -1,4 +1,3 @@ - diff --git a/PhysicsTools/PatAlgos/plugins/BuildFile.xml b/PhysicsTools/PatAlgos/plugins/BuildFile.xml index 2ebb62a9fb26f..957b468c99b10 100644 --- a/PhysicsTools/PatAlgos/plugins/BuildFile.xml +++ b/PhysicsTools/PatAlgos/plugins/BuildFile.xml @@ -20,7 +20,6 @@ - From ec36bc779be4357d7495ec12c65e94cecc0f2df4 Mon Sep 17 00:00:00 2001 From: Caroline Date: Wed, 30 Sep 2020 12:34:04 +0200 Subject: [PATCH 130/778] correcting typo and removing duplicated definition --- .../plugins/SiPixelChargeReweightingAlgorithm.cc | 2 +- .../plugins/SiPixelChargeReweightingAlgorithm.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc index e0040d4fbc245..f3f5e3e1dd5f1 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc @@ -1,7 +1,7 @@ //class SiPixelChargeReweightingAlgorithm SimTracker/SiPixelDigitizer/src/SiPixelChargeReweightingAlgorithm.cc // Original Author Caroline Collard -// September 2020 : Extraction of the code for cluster charge reweighting from SiPixelDigitizerAlgoithm to a new class +// September 2020 : Extraction of the code for cluster charge reweighting from SiPixelDigitizerAlgorithm to a new class // #include #include diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h index 4d280aef6ce28..240a364ef402e 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.h @@ -3,8 +3,6 @@ #include "SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h" -typedef boost::multi_array array_2d; - // forward declarations // For the random numbers From 307bd1dd7c5d4f7f9e51ef955eda173d9a556df4 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 30 Sep 2020 14:53:51 +0200 Subject: [PATCH 131/778] move std dictionaries to DataFormats/StdDictionaries --- CondFormats/Common/src/classes_def.xml | 6 ------ DataFormats/StdDictionaries/src/classes_def_map.xml | 5 +++++ DataFormats/StdDictionaries/src/classes_def_pair.xml | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CondFormats/Common/src/classes_def.xml b/CondFormats/Common/src/classes_def.xml index 4335ff4b1fcdb..d44ed9eed0b37 100644 --- a/CondFormats/Common/src/classes_def.xml +++ b/CondFormats/Common/src/classes_def.xml @@ -9,9 +9,6 @@ - - - @@ -29,9 +26,6 @@ - - - diff --git a/DataFormats/StdDictionaries/src/classes_def_map.xml b/DataFormats/StdDictionaries/src/classes_def_map.xml index 29cb619b05568..4bb23a88dd59b 100644 --- a/DataFormats/StdDictionaries/src/classes_def_map.xml +++ b/DataFormats/StdDictionaries/src/classes_def_map.xml @@ -38,4 +38,9 @@ + + + + + diff --git a/DataFormats/StdDictionaries/src/classes_def_pair.xml b/DataFormats/StdDictionaries/src/classes_def_pair.xml index 687c61b66b0e9..d49e991534f21 100644 --- a/DataFormats/StdDictionaries/src/classes_def_pair.xml +++ b/DataFormats/StdDictionaries/src/classes_def_pair.xml @@ -68,4 +68,5 @@ + From db7a0e5ac69add9bd718057dd73b2605df32e661 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Wed, 30 Sep 2020 16:37:38 +0200 Subject: [PATCH 132/778] make it 10x faster on GeometricDet --- .../DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc | 8 ++++++-- DetectorDescription/DDCMS/src/DDFilteredView.cc | 15 +++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 9dd068c1dcd4f..7c84086c853d5 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -947,8 +947,12 @@ void Converter::operator()(xml_h element) const { "+++ PartSelector for %s path: %s", specParName.c_str(), path.c_str()); - if (path.substr(0, 3) == std::string(".*:")) { - path = path.substr(3); + auto npos = path.find(':'); + if (npos != path.npos) { + std::string anyns{"//.*"}; + if (path.substr(0, npos) == anyns) { + path = string("//").append(path.substr(npos + 1)); + } } registry.specpars[specParName].paths.emplace_back(path); } diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index b6023a4c786b2..51bc0f53b05d2 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -463,6 +463,7 @@ const std::vector DDFilteredView::parameters() const { } const cms::DDSolidShape DDFilteredView::shape() const { + assert(node_); return cms::dd::value(cms::DDSolidShapeMap, std::string(node_->GetVolume()->GetShape()->GetTitle())); } @@ -478,12 +479,12 @@ std::string_view DDFilteredView::get(const string& key) const { int level = it_.back().GetLevel(); for (auto const& i : refs) { auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { - auto const& names = split(j, "/"); - int count = names.size(); + auto frompos = j.find_last_of('/'); + auto topos = j.size(); bool flag = false; - for (int nit = level; count > 0 and nit > 0; --nit) { + for (int nit = level; frompos > topos and nit > 0; --nit) { std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); - auto refname = names[--count]; + std::string_view refname(j.substr(frompos + 1, topos)); auto rpos = refname.find(":"); if (rpos == refname.npos) { name = noNamespace(name); @@ -492,9 +493,9 @@ std::string_view DDFilteredView::get(const string& key) const { refname.remove_prefix(rpos + 1); } } - auto cpos = refname.find("["); + auto cpos = refname.rfind("["); if (cpos != refname.npos) { - if (std::stoi(std::string(refname.substr(cpos + 1, refname.find("]")))) == copyNum()) { + if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind("]")))) == copyNum()) { refname.remove_suffix(refname.size() - cpos); flag = true; continue; @@ -520,6 +521,8 @@ std::string_view DDFilteredView::get(const string& key) const { continue; } } + topos = frompos - 1; + frompos = j.substr(0, frompos).find_last_of('/'); } return flag; }); From 4bffb5a8ee863c1683ecccf5cbd615b471f5f16a Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Wed, 30 Sep 2020 16:39:30 +0200 Subject: [PATCH 133/778] code format --- DetectorDescription/DDCMS/src/DDFilteredView.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 51bc0f53b05d2..1aa546eb0d5a4 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -484,7 +484,7 @@ std::string_view DDFilteredView::get(const string& key) const { bool flag = false; for (int nit = level; frompos > topos and nit > 0; --nit) { std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); - std::string_view refname(j.substr(frompos + 1, topos)); + std::string_view refname(j.substr(frompos + 1, topos)); auto rpos = refname.find(":"); if (rpos == refname.npos) { name = noNamespace(name); @@ -521,8 +521,8 @@ std::string_view DDFilteredView::get(const string& key) const { continue; } } - topos = frompos - 1; - frompos = j.substr(0, frompos).find_last_of('/'); + topos = frompos - 1; + frompos = j.substr(0, frompos).find_last_of('/'); } return flag; }); From 9883de970838770b50638418b0019faa6bdd7ec4 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Wed, 30 Sep 2020 17:27:32 +0200 Subject: [PATCH 134/778] Fix conflicts --- .../DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc | 7 +++++++ DetectorDescription/DDCMS/src/DDFilteredView.cc | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 4302ed869b256..7c84086c853d5 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -947,6 +947,13 @@ void Converter::operator()(xml_h element) const { "+++ PartSelector for %s path: %s", specParName.c_str(), path.c_str()); + auto npos = path.find(':'); + if (npos != path.npos) { + std::string anyns{"//.*"}; + if (path.substr(0, npos) == anyns) { + path = string("//").append(path.substr(npos + 1)); + } + } registry.specpars[specParName].paths.emplace_back(path); } diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index ab88e083629ef..056a77c51bdb6 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -479,7 +479,7 @@ std::string_view DDFilteredView::get(const string& key) const { int level = it_.back().GetLevel(); for (auto const& i : refs) { auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { - auto const& names = split(realTopName(j), "/"); + auto const& names = split(j, "/"); int count = names.size(); bool flag = false; for (int nit = level; count > 0 and nit > 0; --nit) { @@ -650,8 +650,7 @@ const ExpandedNodes& DDFilteredView::history() { for (int nit = level; nit > 0; --nit) { for_each(begin(registry_->specpars), end(registry_->specpars), [&](auto const& i) { auto k = find_if(begin(i.second.paths), end(i.second.paths), [&](auto const& j) { - return (isMatch(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), - *begin(split(realTopName(j), "/"))) and + return (isMatch(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), *begin(split(j, "/"))) and (i.second.hasValue("CopyNoTag") or i.second.hasValue("CopyNoOffset"))); }); if (k != end(i.second.paths)) { From 09b6c01fee2f42e57fb3feaa25b626cab9de37fe Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Wed, 30 Sep 2020 17:28:48 +0200 Subject: [PATCH 135/778] Fix naming in CmsTrackerDetIdBuilder for debug printouts --- .../TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc index f8b463b939b20..34498930758ac 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc @@ -45,7 +45,7 @@ void CmsTrackerDetIdBuilder::buildId(GeometricDet& tracker) { outfile << " " << std::endl; outfile << " " << std::endl; outfile << "............................." << std::endl; - outfile << "myDet->geographicalId() = " << myDet->geographicalId() << std::endl; + outfile << "myDet->geographicalID() = " << myDet->geographicalId() << std::endl; //const auto& found = myDet->name().find(":"); //outfile << "myDet->name() = " << (found != std::string::npos ? myDet->name().substr(found + 1) : myDet->name()) << std::endl; From 0e0c004ae758ce0cad0d89ff898b7c9560a95974 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 24 Jul 2020 16:22:32 +0200 Subject: [PATCH 136/778] Switch to HI jets in PAT --- .../producersHeavyIons/heavyIonJetSetup.py | 315 ++++++++++++++++++ .../producersHeavyIons/heavyIonJets_cff.py | 42 ++- .../producersLayer1/patCandidates_cff.py | 10 +- .../python/slimming/MicroEventContent_cff.py | 1 + .../PatAlgos/python/slimming/miniAOD_tools.py | 53 +++ .../HiTracking/python/highPurityTracks_cfi.py | 7 + 6 files changed, 414 insertions(+), 14 deletions(-) create mode 100644 PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py create mode 100644 RecoHI/HiTracking/python/highPurityTracks_cfi.py diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py new file mode 100644 index 0000000000000..38073c972a863 --- /dev/null +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -0,0 +1,315 @@ +from __future__ import division + +import six + +from RecoBTag.Configuration.RecoBTag_cff import * +from RecoBTag.SecondaryVertex.negativeCombinedSecondaryVertexV2BJetTags_cfi import * +from RecoBTag.SecondaryVertex.negativeCombinedSecondaryVertexV2Computer_cfi import * +from RecoBTag.SecondaryVertex.negativeSimpleSecondaryVertexHighEffBJetTags_cfi import * +from RecoBTag.SecondaryVertex.negativeSimpleSecondaryVertexHighPurBJetTags_cfi import * +from RecoBTag.SecondaryVertex.positiveCombinedSecondaryVertexV2BJetTags_cfi import * +from RecoBTag.SecondaryVertex.positiveCombinedSecondaryVertexV2Computer_cfi import * +from RecoBTag.SecondaryVertex.secondaryVertexNegativeTagInfos_cfi import * + +from RecoHI.HiJetAlgos.HiRecoPFJets_cff import akCs4PFJets +from RecoHI.HiJetAlgos.HiGenJets_cff import ak5HiGenJets +from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets + +from RecoJets.JetAssociationProducers.ak5JTA_cff import * + +from PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff import * +from PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi import * +from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJets_cff import * +from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cfi import * +from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import * +from PhysicsTools.PatAlgos.tools.helpers import * + +def setupHeavyIonJets(process, tag, radius, task): + addToProcessAndTask( + tag + 'Jets', + akCs4PFJets.clone(rParam = radius / 10), + process, + task) + + genjetcollection = 'ak' + str(radius) + 'HiGenJets' + + addToProcessAndTask( + genjetcollection, + ak5HiGenJets.clone(rParam = radius / 10), + process, + task) + + addToProcessAndTask( + 'ak' + str(radius) + 'HiCleanedGenJets', + heavyIonCleanedGenJets.clone(src = genjetcollection), + process, + task) + + modules = { + 'JetTracksAssociatorAtVertex': + ak5JetTracksAssociatorAtVertex.clone( + jets = tag + "Jets", + tracks = "highPurityTracks", + ), + + 'ImpactParameterTagInfos': + impactParameterTagInfos.clone( + jetTracks = "JetTracksAssociatorAtVertex" + tag, + ), + + 'TrackCountingHighEffBJetTags': + trackCountingHighEffBJetTags.clone( + tagInfos = ["ImpactParameterTagInfos" + tag], + ), + + 'TrackCountingHighPurBJetTags': + trackCountingHighPurBJetTags.clone( + tagInfos = ["ImpactParameterTagInfos" + tag], + ), + + 'JetProbabilityBJetTags': + jetProbabilityBJetTags.clone( + tagInfos = ["ImpactParameterTagInfos" + tag], + ), + + 'JetBProbabilityBJetTags': + jetBProbabilityBJetTags.clone( + tagInfos = ["ImpactParameterTagInfos" + tag], + ), + + 'SecondaryVertexTagInfos': + secondaryVertexTagInfos.clone( + trackIPTagInfos = "ImpactParameterTagInfos" + tag, + ), + + 'CombinedSecondaryVertexBJetTags': + combinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'CombinedSecondaryVertexV2BJetTags': + combinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'SecondaryVertexTagInfos': + secondaryVertexTagInfos.clone( + trackIPTagInfos = "ImpactParameterTagInfos" + tag, + ), + + 'SimpleSecondaryVertexHighEffBJetTags': + simpleSecondaryVertexHighEffBJetTags.clone( + tagInfos = ["SecondaryVertexTagInfos" + tag], + ), + + 'SimpleSecondaryVertexHighPurBJetTags': + simpleSecondaryVertexHighPurBJetTags.clone( + tagInfos = ["SecondaryVertexTagInfos" + tag], + ), + + 'CombinedSecondaryVertexBJetTags': + combinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'CombinedSecondaryVertexV2BJetTags': + combinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'SecondaryVertexNegativeTagInfos': + secondaryVertexNegativeTagInfos.clone( + trackIPTagInfos = "ImpactParameterTagInfos" + tag, + ), + + 'NegativeSimpleSecondaryVertexHighEffBJetTags': + negativeSimpleSecondaryVertexHighEffBJetTags.clone( + tagInfos = ["SecondaryVertexNegativeTagInfos" + tag], + ), + + 'NegativeSimpleSecondaryVertexHighPurBJetTags': + negativeSimpleSecondaryVertexHighPurBJetTags.clone( + tagInfos = ["SecondaryVertexNegativeTagInfos" + tag], + ), + + 'NegativeCombinedSecondaryVertexBJetTags': + negativeCombinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexNegativeTagInfos" + tag, + ], + ), + + 'PositiveCombinedSecondaryVertexBJetTags': + positiveCombinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'NegativeCombinedSecondaryVertexV2BJetTags': + negativeCombinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexNegativeTagInfos" + tag, + ], + ), + + 'PositiveCombinedSecondaryVertexV2BJetTags': + positiveCombinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'SoftPFMuonsTagInfos': + softPFMuonsTagInfos.clone( + jets = tag + "Jets", + ), + + 'SoftPFMuonBJetTags': + softPFMuonBJetTags.clone( + tagInfos = ["SoftPFMuonsTagInfos" + tag], + ), + + 'SoftPFMuonByIP3dBJetTags': + softPFMuonByIP3dBJetTags.clone( + tagInfos = ["SoftPFMuonsTagInfos" + tag], + ), + + 'SoftPFMuonByPtBJetTags': + softPFMuonByPtBJetTags.clone( + tagInfos = ["SoftPFMuonsTagInfos" + tag], + ), + + 'PositiveSoftPFMuonByPtBJetTags': + positiveSoftPFMuonByPtBJetTags.clone( + tagInfos = ["SoftPFMuonsTagInfos" + tag], + ), + + 'NegativeSoftPFMuonByPtBJetTags': + negativeSoftPFMuonByPtBJetTags.clone( + tagInfos = ["SoftPFMuonsTagInfos" + tag], + ), + + 'patJetCorrFactors': + patJetCorrFactors.clone( + useNPV = False, + useRho = False, + levels = ['L2Relative'], + payload = "AK" + str(radius) + "PF", + src = tag + "Jets", + ), + + 'patJetGenJetMatch': + patJetGenJetMatch.clone( + matched = 'ak' + str(radius) + "HiCleanedGenJets", + maxDeltaR = radius / 10, + resolveByMatchQuality = True, + src = tag + "Jets", + ), + + 'patJetPartonMatch': + patJetPartonMatch.clone( + matched = "cleanedPartons", + src = tag + "Jets", + ), + + 'patJetPartons': + patJetPartons.clone( + particles = "hiSignalGenParticles", + ), + + 'patJetFlavourAssociation': + patJetFlavourAssociation.clone( + jets = tag + "Jets", + rParam = radius / 10, + bHadrons = "patJetPartons" + tag + ":bHadrons", + cHadrons = "patJetPartons" + tag + ":cHadrons", + leptons = "patJetPartons" + tag + ":leptons", + partons = "patJetPartons" + tag + ":physicsPartons", + ), + + 'patJetPartonAssociationLegacy': + patJetPartonAssociationLegacy.clone( + jets = tag + "Jets", + partons = "allPartons", + ), + + 'patJetFlavourAssociationLegacy': + patJetFlavourAssociationLegacy.clone( + srcByReference = "patJetPartonAssociationLegacy" + tag, + ), + + 'patJets': + patJets.clone( + jetSource = tag + "Jets", + genJetMatch = "patJetGenJetMatch" + tag, + genPartonMatch = "patJetPartonMatch" + tag, + JetFlavourInfoSource = "patJetFlavourAssociation" + tag, + JetPartonMapSource = "patJetFlavourAssociationLegacy" + tag, + jetCorrFactorsSource = ["patJetCorrFactors" + tag], + trackAssociationSource = "JetTracksAssociatorAtVertex" + tag, + useLegacyJetMCFlavour = True, + discriminatorSources = [ + "SimpleSecondaryVertexHighEffBJetTags" + tag, + "SimpleSecondaryVertexHighPurBJetTags" + tag, + "CombinedSecondaryVertexBJetTags" + tag, + "CombinedSecondaryVertexV2BJetTags" + tag, + "JetBProbabilityBJetTags" + tag, + "JetProbabilityBJetTags" + tag, + "TrackCountingHighEffBJetTags" + tag, + "TrackCountingHighPurBJetTags" + tag, + ], + tagInfoSources = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + addJetCharge = False, + addTagInfos = False, + ), + } + + for label, module in six.iteritems(modules): + addToProcessAndTask(label + tag, module, process, task) + +def aliasCsJets(process, tag): + delattr(process, 'patJets') + + source = cms.VPSet(cms.PSet(type = cms.string('patJets'))) + process.patJets = cms.EDAlias(**{ 'patJets' + tag: source }) + +def removeL1FastJetJECs(process): + for label in process.producerNames().split(): + module = getattr(process, label) + if module.type_() == "PATPFJetMETcorrInputProducer": + module.offsetCorrLabel = '' + +def removeJECsForMC(process): + for label in process.producerNames().split(): + module = getattr(process, label) + if module.type_() == "PATPFJetMETcorrInputProducer": + module.jetCorrLabel = 'Uncorrected' + + process.basicJetsForMet.jetCorrLabel = 'Uncorrected' + process.basicJetsForMetPuppi.jetCorrLabelRes = 'Uncorrected' + +def addJECsForData(process): + for label in process.producerNames().split(): + module = getattr(process, label) + if module.type_() == "JetCorrFactorsProducer": + module.levels.append('L2L3Residual') diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index 205d557bfa905..00e391c831003 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -1,19 +1,37 @@ import FWCore.ParameterSet.Config as cms -from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cff import * -from RecoHI.HiJetAlgos.HiGenCleaner_cff import * -heavyIonCleaned = cms.Sequence(genPartons*hiPartons+heavyIonCleanedGenJets) +from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets +from RecoHI.HiJetAlgos.HiGenCleaner_cff import hiPartons -makeHeavyIonJets = cms.Sequence( - patJetCorrections * - - # pat and HI specifics - heavyIonCleaned * - patJetGenJetMatch * - patJetPartonMatch * +allPartons = cms.EDProducer( + "PartonSelector", + src = cms.InputTag('genParticles'), + withLeptons = cms.bool(False), + ) - # object production - patJets +cleanedPartons = hiPartons.clone( + src = 'allPartons', ) +cleanedGenJetsTask = cms.Task( + genParticlesForJets, + cleanedPartons, +) + +from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfNoPileUpJMEHI, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation +from RecoHI.HiTracking.highPurityTracks_cfi import highPurityTracks +recoPFJetsHIpostAODTask = cms.Task( + PFTowers, + pfNoPileUpJMEHI, + ak4PFJetsForFlow, + hiFJRhoFlowModulation, + hiPuRho, + highPurityTracks, + ) + +recoJetsHIpostAODTask = cms.Task( + recoPFJetsHIpostAODTask, + allPartons, + cleanedGenJetsTask, + ) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py b/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py index 436e4504b1c58..8768104ad5584 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py @@ -36,6 +36,12 @@ ) patCandidates = cms.Sequence(patCandidateSummary, patCandidatesTask) +from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJets_cff import * +_patCandidatesTask = patCandidatesTask.copy() +_patCandidatesTask.add(recoJetsHIpostAODTask) +_patCandidatesTask.remove(makePatOOTPhotonsTask) + from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toReplaceWith(patCandidatesTask, patCandidatesTask.copyAndExclude([makePatOOTPhotonsTask])) -pp_on_AA_2018.toModify(patCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("patOOTPhotons")) ) +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(patCandidatesTask, _patCandidatesTask) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("patOOTPhotons")) ) diff --git a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py index 7ee533a446680..886eef57ff9d8 100644 --- a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py @@ -141,6 +141,7 @@ _pp_on_AA_extraCommands = [ 'keep patPackedCandidates_hiPixelTracks_*_*', 'keep *_packedCandidateMuonID_*_*', + 'keep *_slimmedJets_pfCandidates_*' 'keep floatedmValueMap_packedPFCandidateTrackChi2_*_*', 'keep floatedmValueMap_lostTrackChi2_*_*', 'keep recoCentrality_hiCentrality_*_*', diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 50ad5cca7fbc3..914381a1366c2 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -157,6 +157,12 @@ def miniAOD_customizeCommon(process): task = getPatAlgosToolsTask(process) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import setupHeavyIonJets + from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: + setupHeavyIonJets(proc, 'akCs4PF', 4, task)) + process.noHFCands = cms.EDFilter("GenericPFCandidateSelector", src=cms.InputTag("particleFlow"), cut=cms.string("abs(pdgId)!=1 && abs(pdgId)!=2 && abs(eta)<3.0") @@ -586,14 +592,61 @@ def miniAOD_customizeData(process): ctpps_2016.toModify(task, func=lambda t: t.add(process.ctppsLocalTrackLiteProducer)) ctpps_2016.toModify(task, func=lambda t: t.add(process.ctppsProtons)) +def miniAOD_customizeHeavyIon(process, data): + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, removeL1FastJetJECs, removeJECsForMC, addJECsForData + from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedCaloJets, src = 'akPu4CaloJets') + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak8PFJetsPuppi, src = 'pfNoPileUpJMEHI') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJetsAK8Puppi, jetSource = 'ak8PFJetsPuppi') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8, src = 'patJetsAK8Puppi') + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak4PFJetsPuppi, src = 'pfNoPileUpJMEHI') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJetsPuppi, jetSource = 'ak4PFJetsPuppi') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsPuppi, src = 'patJetsPuppi') + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8PFPuppiSoftDropPacked, jetSrc = 'patJetsAK8Puppi', subjetSrc = 'patJetsAK8Puppi') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak4PFJetsPuppi, jetPtMin = 9999.) + + if data is False: + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8SoftDropSubJets, cut = 'pt>9999', nLoose = 0) + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: + aliasCsJets(proc, 'akCs4PF')) + + modifyJECs = addJECsForData if data is True else removeJECsForMC + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: modifyJECs(proc)) + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.pfMetPuppi, src = 'pfNoPileUpJMEHI') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patMETsPuppi, computeMETSignificance = False, metSource = 'pfMetPuppi') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedMETsPuppi, + chsMET = 'patMETsPuppi', + rawVariation = 'patMETsPuppi', + t01Variation = 'patMETsPuppi', + t1SmearedVarsAndUncs = 'patMETsPuppi', + t1Uncertainties = 'patMETsPuppi', + tXYUncForRaw = 'patMETsPuppi', + tXYUncForT01 = 'patMETsPuppi', + tXYUncForT01Smear = 'patMETsPuppi', + tXYUncForT1 = 'patMETsPuppi', + tXYUncForT1Smear = 'patMETsPuppi', + trkMET = 'patMETsPuppi') + + def miniAOD_customizeAllData(process): miniAOD_customizeCommon(process) miniAOD_customizeData(process) + miniAOD_customizeHeavyIon(process, True) return process def miniAOD_customizeAllMC(process): miniAOD_customizeCommon(process) miniAOD_customizeMC(process) + miniAOD_customizeHeavyIon(process, False) return process def miniAOD_customizeAllMCFastSim(process): diff --git a/RecoHI/HiTracking/python/highPurityTracks_cfi.py b/RecoHI/HiTracking/python/highPurityTracks_cfi.py new file mode 100644 index 0000000000000..c225a0518f7fb --- /dev/null +++ b/RecoHI/HiTracking/python/highPurityTracks_cfi.py @@ -0,0 +1,7 @@ +import FWCore.ParameterSet.Config as cms + +highPurityTracks = cms.EDFilter( + 'TrackSelector', + src = cms.InputTag('generalTracks'), + cut = cms.string('quality("highPurity")'), + ) From 3705ccaefb6a36fc03782b1c7eb520405bd5e387 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 24 Aug 2020 21:06:55 +0200 Subject: [PATCH 137/778] Use addJetCollection --- .../producersHeavyIons/heavyIonJetSetup.py | 281 ++---------------- .../producersHeavyIons/heavyIonJets_cff.py | 4 +- .../python/slimming/MicroEventContent_cff.py | 2 +- .../PatAlgos/python/slimming/miniAOD_tools.py | 3 +- ..._cfi.py => highPurityGeneralTracks_cfi.py} | 2 +- 5 files changed, 29 insertions(+), 263 deletions(-) rename RecoHI/HiTracking/python/{highPurityTracks_cfi.py => highPurityGeneralTracks_cfi.py} (79%) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index 38073c972a863..21328ddd46a19 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -1,27 +1,9 @@ from __future__ import division -import six - -from RecoBTag.Configuration.RecoBTag_cff import * -from RecoBTag.SecondaryVertex.negativeCombinedSecondaryVertexV2BJetTags_cfi import * -from RecoBTag.SecondaryVertex.negativeCombinedSecondaryVertexV2Computer_cfi import * -from RecoBTag.SecondaryVertex.negativeSimpleSecondaryVertexHighEffBJetTags_cfi import * -from RecoBTag.SecondaryVertex.negativeSimpleSecondaryVertexHighPurBJetTags_cfi import * -from RecoBTag.SecondaryVertex.positiveCombinedSecondaryVertexV2BJetTags_cfi import * -from RecoBTag.SecondaryVertex.positiveCombinedSecondaryVertexV2Computer_cfi import * -from RecoBTag.SecondaryVertex.secondaryVertexNegativeTagInfos_cfi import * - from RecoHI.HiJetAlgos.HiRecoPFJets_cff import akCs4PFJets from RecoHI.HiJetAlgos.HiGenJets_cff import ak5HiGenJets from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets - -from RecoJets.JetAssociationProducers.ak5JTA_cff import * - -from PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff import * -from PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi import * from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJets_cff import * -from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cfi import * -from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import * from PhysicsTools.PatAlgos.tools.helpers import * def setupHeavyIonJets(process, tag, radius, task): @@ -45,247 +27,32 @@ def setupHeavyIonJets(process, tag, radius, task): process, task) - modules = { - 'JetTracksAssociatorAtVertex': - ak5JetTracksAssociatorAtVertex.clone( - jets = tag + "Jets", - tracks = "highPurityTracks", - ), - - 'ImpactParameterTagInfos': - impactParameterTagInfos.clone( - jetTracks = "JetTracksAssociatorAtVertex" + tag, - ), - - 'TrackCountingHighEffBJetTags': - trackCountingHighEffBJetTags.clone( - tagInfos = ["ImpactParameterTagInfos" + tag], - ), - - 'TrackCountingHighPurBJetTags': - trackCountingHighPurBJetTags.clone( - tagInfos = ["ImpactParameterTagInfos" + tag], - ), - - 'JetProbabilityBJetTags': - jetProbabilityBJetTags.clone( - tagInfos = ["ImpactParameterTagInfos" + tag], - ), - - 'JetBProbabilityBJetTags': - jetBProbabilityBJetTags.clone( - tagInfos = ["ImpactParameterTagInfos" + tag], - ), - - 'SecondaryVertexTagInfos': - secondaryVertexTagInfos.clone( - trackIPTagInfos = "ImpactParameterTagInfos" + tag, - ), - - 'CombinedSecondaryVertexBJetTags': - combinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, - ], - ), - - 'CombinedSecondaryVertexV2BJetTags': - combinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, - ], - ), - - 'SecondaryVertexTagInfos': - secondaryVertexTagInfos.clone( - trackIPTagInfos = "ImpactParameterTagInfos" + tag, - ), - - 'SimpleSecondaryVertexHighEffBJetTags': - simpleSecondaryVertexHighEffBJetTags.clone( - tagInfos = ["SecondaryVertexTagInfos" + tag], - ), - - 'SimpleSecondaryVertexHighPurBJetTags': - simpleSecondaryVertexHighPurBJetTags.clone( - tagInfos = ["SecondaryVertexTagInfos" + tag], - ), - - 'CombinedSecondaryVertexBJetTags': - combinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, - ], - ), - - 'CombinedSecondaryVertexV2BJetTags': - combinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, - ], - ), - - 'SecondaryVertexNegativeTagInfos': - secondaryVertexNegativeTagInfos.clone( - trackIPTagInfos = "ImpactParameterTagInfos" + tag, - ), - - 'NegativeSimpleSecondaryVertexHighEffBJetTags': - negativeSimpleSecondaryVertexHighEffBJetTags.clone( - tagInfos = ["SecondaryVertexNegativeTagInfos" + tag], - ), + from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection - 'NegativeSimpleSecondaryVertexHighPurBJetTags': - negativeSimpleSecondaryVertexHighPurBJetTags.clone( - tagInfos = ["SecondaryVertexNegativeTagInfos" + tag], - ), - - 'NegativeCombinedSecondaryVertexBJetTags': - negativeCombinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexNegativeTagInfos" + tag, - ], - ), - - 'PositiveCombinedSecondaryVertexBJetTags': - positiveCombinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, - ], - ), - - 'NegativeCombinedSecondaryVertexV2BJetTags': - negativeCombinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexNegativeTagInfos" + tag, - ], - ), - - 'PositiveCombinedSecondaryVertexV2BJetTags': - positiveCombinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, - ], - ), - - 'SoftPFMuonsTagInfos': - softPFMuonsTagInfos.clone( - jets = tag + "Jets", - ), - - 'SoftPFMuonBJetTags': - softPFMuonBJetTags.clone( - tagInfos = ["SoftPFMuonsTagInfos" + tag], - ), - - 'SoftPFMuonByIP3dBJetTags': - softPFMuonByIP3dBJetTags.clone( - tagInfos = ["SoftPFMuonsTagInfos" + tag], - ), - - 'SoftPFMuonByPtBJetTags': - softPFMuonByPtBJetTags.clone( - tagInfos = ["SoftPFMuonsTagInfos" + tag], - ), - - 'PositiveSoftPFMuonByPtBJetTags': - positiveSoftPFMuonByPtBJetTags.clone( - tagInfos = ["SoftPFMuonsTagInfos" + tag], - ), - - 'NegativeSoftPFMuonByPtBJetTags': - negativeSoftPFMuonByPtBJetTags.clone( - tagInfos = ["SoftPFMuonsTagInfos" + tag], - ), - - 'patJetCorrFactors': - patJetCorrFactors.clone( - useNPV = False, - useRho = False, - levels = ['L2Relative'], - payload = "AK" + str(radius) + "PF", - src = tag + "Jets", - ), - - 'patJetGenJetMatch': - patJetGenJetMatch.clone( - matched = 'ak' + str(radius) + "HiCleanedGenJets", - maxDeltaR = radius / 10, - resolveByMatchQuality = True, - src = tag + "Jets", - ), - - 'patJetPartonMatch': - patJetPartonMatch.clone( - matched = "cleanedPartons", - src = tag + "Jets", - ), - - 'patJetPartons': - patJetPartons.clone( - particles = "hiSignalGenParticles", - ), - - 'patJetFlavourAssociation': - patJetFlavourAssociation.clone( - jets = tag + "Jets", - rParam = radius / 10, - bHadrons = "patJetPartons" + tag + ":bHadrons", - cHadrons = "patJetPartons" + tag + ":cHadrons", - leptons = "patJetPartons" + tag + ":leptons", - partons = "patJetPartons" + tag + ":physicsPartons", - ), - - 'patJetPartonAssociationLegacy': - patJetPartonAssociationLegacy.clone( - jets = tag + "Jets", - partons = "allPartons", - ), - - 'patJetFlavourAssociationLegacy': - patJetFlavourAssociationLegacy.clone( - srcByReference = "patJetPartonAssociationLegacy" + tag, - ), - - 'patJets': - patJets.clone( - jetSource = tag + "Jets", - genJetMatch = "patJetGenJetMatch" + tag, - genPartonMatch = "patJetPartonMatch" + tag, - JetFlavourInfoSource = "patJetFlavourAssociation" + tag, - JetPartonMapSource = "patJetFlavourAssociationLegacy" + tag, - jetCorrFactorsSource = ["patJetCorrFactors" + tag], - trackAssociationSource = "JetTracksAssociatorAtVertex" + tag, - useLegacyJetMCFlavour = True, - discriminatorSources = [ - "SimpleSecondaryVertexHighEffBJetTags" + tag, - "SimpleSecondaryVertexHighPurBJetTags" + tag, - "CombinedSecondaryVertexBJetTags" + tag, - "CombinedSecondaryVertexV2BJetTags" + tag, - "JetBProbabilityBJetTags" + tag, - "JetProbabilityBJetTags" + tag, - "TrackCountingHighEffBJetTags" + tag, - "TrackCountingHighPurBJetTags" + tag, - ], - tagInfoSources = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, - ], - addJetCharge = False, - addTagInfos = False, - ), - } + addJetCollection( + process, + labelName = 'AKCs4PF', + jetSource = cms.InputTag('akCs4PFJets'), + btagDiscriminators = [ + 'simpleSecondaryVertexHighEffBJetTags', + 'simpleSecondaryVertexHighPurBJetTags', + 'combinedSecondaryVertexV2BJetTags', + 'jetBProbabilityBJetTags', + 'trackCountingHighEffBJetTags', + 'trackCountingHighPurBJetTags' + ], + genJetCollection = cms.InputTag('ak4HiCleanedGenJets'), + jetCorrections = ('AK4PF', ['L2Relative'], 'None'), + getJetMCFlavour = False, # jet flavor disabled + ) + + getattr(process,'patJetsAKCs4PF').addAssociatedTracks = True + getattr(process,'patJetsAKCs4PF').addBTagInfo = True + getattr(process,'patJetsAKCs4PF').useLegacyJetMCFlavour = True + getattr(process,'patJetCorrFactorsAKCs4PF').useNPV = False + getattr(process,'patJetCorrFactorsAKCs4PF').useRho = False + getattr(process,'patJetPartonMatchAKCs4PF').matched = "cleanedPartons" - for label, module in six.iteritems(modules): - addToProcessAndTask(label + tag, module, process, task) def aliasCsJets(process, tag): delattr(process, 'patJets') diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index 00e391c831003..884fb78636528 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -19,7 +19,7 @@ ) from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfNoPileUpJMEHI, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation -from RecoHI.HiTracking.highPurityTracks_cfi import highPurityTracks +from RecoHI.HiTracking.highPurityGeneralTracks_cfi import highPurityGeneralTracks recoPFJetsHIpostAODTask = cms.Task( PFTowers, @@ -27,7 +27,7 @@ ak4PFJetsForFlow, hiFJRhoFlowModulation, hiPuRho, - highPurityTracks, + highPurityGeneralTracks, ) recoJetsHIpostAODTask = cms.Task( diff --git a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py index 886eef57ff9d8..5f8c23c47be59 100644 --- a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py @@ -141,7 +141,7 @@ _pp_on_AA_extraCommands = [ 'keep patPackedCandidates_hiPixelTracks_*_*', 'keep *_packedCandidateMuonID_*_*', - 'keep *_slimmedJets_pfCandidates_*' + 'keep *_slimmedJets_pfCandidates_*', 'keep floatedmValueMap_packedPFCandidateTrackChi2_*_*', 'keep floatedmValueMap_lostTrackChi2_*_*', 'keep recoCentrality_hiCentrality_*_*', diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 914381a1366c2..ee2fa59b9edf3 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -615,8 +615,7 @@ def miniAOD_customizeHeavyIon(process, data): (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8SoftDropSubJets, cut = 'pt>9999', nLoose = 0) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: - aliasCsJets(proc, 'akCs4PF')) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: aliasCsJets(proc, 'AKCs4PF')) modifyJECs = addJECsForData if data is True else removeJECsForMC (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: modifyJECs(proc)) diff --git a/RecoHI/HiTracking/python/highPurityTracks_cfi.py b/RecoHI/HiTracking/python/highPurityGeneralTracks_cfi.py similarity index 79% rename from RecoHI/HiTracking/python/highPurityTracks_cfi.py rename to RecoHI/HiTracking/python/highPurityGeneralTracks_cfi.py index c225a0518f7fb..2ed339f8773a4 100644 --- a/RecoHI/HiTracking/python/highPurityTracks_cfi.py +++ b/RecoHI/HiTracking/python/highPurityGeneralTracks_cfi.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms -highPurityTracks = cms.EDFilter( +highPurityGeneralTracks = cms.EDFilter( 'TrackSelector', src = cms.InputTag('generalTracks'), cut = cms.string('quality("highPurity")'), From 9ee8b6cba6c045259c2d8dc19e202af45f9aa97d Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 27 Aug 2020 16:07:53 +0200 Subject: [PATCH 138/778] Remove getattr and customizeHeavyIon function --- .../producersHeavyIons/heavyIonJetSetup.py | 12 +-- .../PatAlgos/python/slimming/miniAOD_tools.py | 86 ++++++++++--------- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index 21328ddd46a19..ac86ac9880d7a 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -46,12 +46,12 @@ def setupHeavyIonJets(process, tag, radius, task): getJetMCFlavour = False, # jet flavor disabled ) - getattr(process,'patJetsAKCs4PF').addAssociatedTracks = True - getattr(process,'patJetsAKCs4PF').addBTagInfo = True - getattr(process,'patJetsAKCs4PF').useLegacyJetMCFlavour = True - getattr(process,'patJetCorrFactorsAKCs4PF').useNPV = False - getattr(process,'patJetCorrFactorsAKCs4PF').useRho = False - getattr(process,'patJetPartonMatchAKCs4PF').matched = "cleanedPartons" + process.patJetsAKCs4PF.addAssociatedTracks = True + process.patJetsAKCs4PF.addBTagInfo = True + process.patJetsAKCs4PF.useLegacyJetMCFlavour = True + process.patJetCorrFactorsAKCs4PF.useNPV = False + process.patJetCorrFactorsAKCs4PF.useRho = False + process.patJetPartonMatchAKCs4PF.matched = "cleanedPartons" def aliasCsJets(process, tag): diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index ee2fa59b9edf3..a055e09d18ac7 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -528,6 +528,40 @@ def miniAOD_customizeCommon(process): stage2L1Trigger_2017.toModify(process.prefiringweight, DataEra = "2017BtoF") run2_L1prefiring.toModify(task, func=lambda t: t.add(process.prefiringweight)) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeL1FastJetJECs + from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedCaloJets, src = 'akPu4CaloJets') + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak8PFJetsPuppi, src = 'pfNoPileUpJMEHI') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJetsAK8Puppi, jetSource = 'ak8PFJetsPuppi') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8, src = 'patJetsAK8Puppi') + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak4PFJetsPuppi, src = 'pfNoPileUpJMEHI') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJetsPuppi, jetSource = 'ak4PFJetsPuppi') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsPuppi, src = 'patJetsPuppi') + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8PFPuppiSoftDropPacked, jetSrc = 'patJetsAK8Puppi', subjetSrc = 'patJetsAK8Puppi') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak4PFJetsPuppi, jetPtMin = 9999.) + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) + + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.pfMetPuppi, src = 'pfNoPileUpJMEHI') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patMETsPuppi, computeMETSignificance = False, metSource = 'pfMetPuppi') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedMETsPuppi, + chsMET = 'patMETsPuppi', + rawVariation = 'patMETsPuppi', + t01Variation = 'patMETsPuppi', + t1SmearedVarsAndUncs = 'patMETsPuppi', + t1Uncertainties = 'patMETsPuppi', + tXYUncForRaw = 'patMETsPuppi', + tXYUncForT01 = 'patMETsPuppi', + tXYUncForT01Smear = 'patMETsPuppi', + tXYUncForT1 = 'patMETsPuppi', + tXYUncForT1Smear = 'patMETsPuppi', + trkMET = 'patMETsPuppi') + def miniAOD_customizeMC(process): task = getPatAlgosToolsTask(process) #GenJetFlavourInfos @@ -571,6 +605,14 @@ def miniAOD_customizeMC(process): process.patJets.embedGenPartonMatch = False #also jet flavour must be switched process.patJetFlavourAssociation.rParam = 0.4 + + from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8SoftDropSubJets, cut = 'pt>9999', nLoose = 0) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, removeJECsForMC + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: aliasCsJets(proc, 'AKCs4PF')) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeJECsForMC(proc)) def miniAOD_customizeOutput(out): from PhysicsTools.PatAlgos.slimming.MicroEventContent_cff import MiniAODOverrideBranchesSplitLevel @@ -592,60 +634,20 @@ def miniAOD_customizeData(process): ctpps_2016.toModify(task, func=lambda t: t.add(process.ctppsLocalTrackLiteProducer)) ctpps_2016.toModify(task, func=lambda t: t.add(process.ctppsProtons)) -def miniAOD_customizeHeavyIon(process, data): - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, removeL1FastJetJECs, removeJECsForMC, addJECsForData from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedCaloJets, src = 'akPu4CaloJets') - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak8PFJetsPuppi, src = 'pfNoPileUpJMEHI') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJetsAK8Puppi, jetSource = 'ak8PFJetsPuppi') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8, src = 'patJetsAK8Puppi') - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak4PFJetsPuppi, src = 'pfNoPileUpJMEHI') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJetsPuppi, jetSource = 'ak4PFJetsPuppi') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsPuppi, src = 'patJetsPuppi') - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8PFPuppiSoftDropPacked, jetSrc = 'patJetsAK8Puppi', subjetSrc = 'patJetsAK8Puppi') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak4PFJetsPuppi, jetPtMin = 9999.) - - if data is False: - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8SoftDropSubJets, cut = 'pt>9999', nLoose = 0) - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, addJECsForData (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: aliasCsJets(proc, 'AKCs4PF')) - - modifyJECs = addJECsForData if data is True else removeJECsForMC - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: modifyJECs(proc)) - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.pfMetPuppi, src = 'pfNoPileUpJMEHI') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patMETsPuppi, computeMETSignificance = False, metSource = 'pfMetPuppi') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedMETsPuppi, - chsMET = 'patMETsPuppi', - rawVariation = 'patMETsPuppi', - t01Variation = 'patMETsPuppi', - t1SmearedVarsAndUncs = 'patMETsPuppi', - t1Uncertainties = 'patMETsPuppi', - tXYUncForRaw = 'patMETsPuppi', - tXYUncForT01 = 'patMETsPuppi', - tXYUncForT01Smear = 'patMETsPuppi', - tXYUncForT1 = 'patMETsPuppi', - tXYUncForT1Smear = 'patMETsPuppi', - trkMET = 'patMETsPuppi') - + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: addJECsForData(proc)) def miniAOD_customizeAllData(process): miniAOD_customizeCommon(process) miniAOD_customizeData(process) - miniAOD_customizeHeavyIon(process, True) return process def miniAOD_customizeAllMC(process): miniAOD_customizeCommon(process) miniAOD_customizeMC(process) - miniAOD_customizeHeavyIon(process, False) return process def miniAOD_customizeAllMCFastSim(process): From 2c61949efc4ff0a98b44fa548d4d9c8a6c9068c5 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 28 Aug 2020 09:30:50 +0200 Subject: [PATCH 139/778] moved customization to source configs, changed pfNoPileUpJMEHI to pfEmtpyCollection --- .../producersHeavyIons/heavyIonJets_cff.py | 4 +- .../python/slimming/applySubstructure_cff.py | 10 +++-- .../PatAlgos/python/slimming/miniAOD_tools.py | 41 +++---------------- .../modifyPrimaryPhysicsObjects_cff.py | 5 +++ .../python/slimming/slimmedCaloJets_cfi.py | 3 ++ .../python/slimming/slimmedGenJets_cfi.py | 5 +++ .../PatAlgos/python/tools/jetTools.py | 6 +++ RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | 8 ++-- .../Configuration/python/RecoPFJets_cff.py | 4 +- RecoJets/JetProducers/python/ak4PFJets_cfi.py | 6 ++- RecoJets/JetProducers/python/ak8PFJets_cfi.py | 4 +- 11 files changed, 46 insertions(+), 50 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index 884fb78636528..b74c4b0617005 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -18,12 +18,12 @@ cleanedPartons, ) -from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfNoPileUpJMEHI, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation +from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfEmptyCollection, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation from RecoHI.HiTracking.highPurityGeneralTracks_cfi import highPurityGeneralTracks recoPFJetsHIpostAODTask = cms.Task( PFTowers, - pfNoPileUpJMEHI, + pfEmptyCollection, ak4PFJetsForFlow, hiFJRhoFlowModulation, hiPuRho, diff --git a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py index 5a7541ece63cf..bf6cb85c03741 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py @@ -25,6 +25,7 @@ def applySubstructure( process, postfix="" ) : _run2_miniAOD_ANY = (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17 | run2_miniAOD_UL) from Configuration.Eras.Modifier_pA_2016_cff import pA_2016 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 if postfix=='': # Avoid recomputing the PUPPI collections that are present in AOD _rerun_puppijets_task = task.copy() @@ -32,7 +33,7 @@ def applySubstructure( process, postfix="" ) : getattr(process,'ak8PFJetsPuppiConstituents'), getattr(process,'ak8PFJetsPuppiSoftDrop'), getattr(process,'ak8PFJetsPuppiSoftDropMass')) - (_run2_miniAOD_ANY | pA_2016 | pp_on_AA_2018).toReplaceWith(task, _rerun_puppijets_task) + (_run2_miniAOD_ANY | pA_2016 | pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(task, _rerun_puppijets_task) else: task.add(getattr(process,'ak8PFJetsPuppi'+postfix), getattr(process,'ak8PFJetsPuppiConstituents'+postfix), @@ -53,6 +54,8 @@ def applySubstructure( process, postfix="" ) : dropSpecific = cms.bool(True), # Save space ), process, task ) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify( getattr(process,'slimmedGenJetsAK8SoftDropSubJets'), cut = 'pt>9999', nLoose = 0) + ## PATify puppi soft drop fat jets addJetCollection( process, @@ -88,10 +91,11 @@ def applySubstructure( process, postfix="" ) : addToProcessAndTask('nb2AK8PuppiSoftDrop'+postfix, process.ecfNbeta2.clone(src = cms.InputTag("ak8PFJetsPuppiSoftDrop"+postfix), cuts = cms.vstring('', '', 'pt > 250')), process, task) #too slow now ==> disable + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 from Configuration.Eras.Modifier_phase2_common_cff import phase2_common - for e in [pp_on_XeXe_2017, pp_on_AA_2018, phase2_common]: + for e in [pp_on_XeXe_2017, pp_on_AA_2018, pp_on_PbPb_run3, phase2_common]: e.toModify(getattr(process,'nb1AK8PuppiSoftDrop'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) e.toModify(getattr(process,'nb2AK8PuppiSoftDrop'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) @@ -106,7 +110,7 @@ def applySubstructure( process, postfix="" ) : getattr(process,"patJetsAK8PFPuppiSoftDropSubjets"+postfix).userData.userFloats.src += ['nb2AK8PuppiSoftDropSubjets'+postfix+':ecfN2','nb2AK8PuppiSoftDropSubjets'+postfix+':ecfN3'] getattr(process,"patJetsAK8PFPuppiSoftDropSubjets"+postfix).userData.userFloats.src += ['NjettinessAK8Subjets'+postfix+':tau1','NjettinessAK8Subjets'+postfix+':tau2','NjettinessAK8Subjets'+postfix+':tau3','NjettinessAK8Subjets'+postfix+':tau4'] - for e in [pp_on_XeXe_2017, pp_on_AA_2018, phase2_common]: + for e in [pp_on_XeXe_2017, pp_on_AA_2018, pp_on_PbPb_run3, phase2_common]: e.toModify(getattr(process,'nb1AK8PuppiSoftDropSubjets'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) e.toModify(getattr(process,'nb2AK8PuppiSoftDropSubjets'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] ) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index a055e09d18ac7..e63bb4e0ccec8 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -528,40 +528,6 @@ def miniAOD_customizeCommon(process): stage2L1Trigger_2017.toModify(process.prefiringweight, DataEra = "2017BtoF") run2_L1prefiring.toModify(task, func=lambda t: t.add(process.prefiringweight)) - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeL1FastJetJECs - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedCaloJets, src = 'akPu4CaloJets') - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak8PFJetsPuppi, src = 'pfNoPileUpJMEHI') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJetsAK8Puppi, jetSource = 'ak8PFJetsPuppi') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8, src = 'patJetsAK8Puppi') - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak4PFJetsPuppi, src = 'pfNoPileUpJMEHI') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJetsPuppi, jetSource = 'ak4PFJetsPuppi') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsPuppi, src = 'patJetsPuppi') - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8PFPuppiSoftDropPacked, jetSrc = 'patJetsAK8Puppi', subjetSrc = 'patJetsAK8Puppi') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.ak4PFJetsPuppi, jetPtMin = 9999.) - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) - - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.pfMetPuppi, src = 'pfNoPileUpJMEHI') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patMETsPuppi, computeMETSignificance = False, metSource = 'pfMetPuppi') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedMETsPuppi, - chsMET = 'patMETsPuppi', - rawVariation = 'patMETsPuppi', - t01Variation = 'patMETsPuppi', - t1SmearedVarsAndUncs = 'patMETsPuppi', - t1Uncertainties = 'patMETsPuppi', - tXYUncForRaw = 'patMETsPuppi', - tXYUncForT01 = 'patMETsPuppi', - tXYUncForT01Smear = 'patMETsPuppi', - tXYUncForT1 = 'patMETsPuppi', - tXYUncForT1Smear = 'patMETsPuppi', - trkMET = 'patMETsPuppi') - def miniAOD_customizeMC(process): task = getPatAlgosToolsTask(process) #GenJetFlavourInfos @@ -610,9 +576,11 @@ def miniAOD_customizeMC(process): from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8SoftDropSubJets, cut = 'pt>9999', nLoose = 0) - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, removeJECsForMC + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, removeJECsForMC, removeL1FastJetJECs (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: aliasCsJets(proc, 'AKCs4PF')) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeJECsForMC(proc)) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) + def miniAOD_customizeOutput(out): from PhysicsTools.PatAlgos.slimming.MicroEventContent_cff import MiniAODOverrideBranchesSplitLevel @@ -636,9 +604,10 @@ def miniAOD_customizeData(process): from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, addJECsForData + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, addJECsForData, removeL1FastJetJECs (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: aliasCsJets(proc, 'AKCs4PF')) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: addJECsForData(proc)) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) def miniAOD_customizeAllData(process): miniAOD_customizeCommon(process) diff --git a/PhysicsTools/PatAlgos/python/slimming/modifyPrimaryPhysicsObjects_cff.py b/PhysicsTools/PatAlgos/python/slimming/modifyPrimaryPhysicsObjects_cff.py index 672993885c1f7..e7711712bde18 100644 --- a/PhysicsTools/PatAlgos/python/slimming/modifyPrimaryPhysicsObjects_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/modifyPrimaryPhysicsObjects_cff.py @@ -29,3 +29,8 @@ slimmedJets * slimmedJetsAK8 * slimmedJetsPuppi ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8, src = 'patJetsAK8Puppi') diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedCaloJets_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedCaloJets_cfi.py index d41d0fcc42b8f..f92987c92a3c5 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedCaloJets_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedCaloJets_cfi.py @@ -5,3 +5,6 @@ cut = cms.string("pt>20") ) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(slimmedCaloJets, src = 'akPu4CaloJets') diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py index beecfd0d794f1..d60521a70f91a 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py @@ -13,9 +13,14 @@ slimmedGenJetsAK8 = cms.EDProducer("PATGenJetSlimmer", src = cms.InputTag("ak8GenJetsNoNu"), packedGenParticles = cms.InputTag("packedGenParticles"), + cut = cms.string("pt > 80"), cutLoose = cms.string("pt > 10."), nLoose = cms.uint32(3), clearDaughters = cms.bool(False), #False means rekeying dropSpecific = cms.bool(False), ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) diff --git a/PhysicsTools/PatAlgos/python/tools/jetTools.py b/PhysicsTools/PatAlgos/python/tools/jetTools.py index 25def6d8d1bc3..df09b5def7bde 100644 --- a/PhysicsTools/PatAlgos/python/tools/jetTools.py +++ b/PhysicsTools/PatAlgos/python/tools/jetTools.py @@ -1807,6 +1807,12 @@ def toolCode(self, process): ## switch jetCorrFactors off _newPatJets.addJetCorrFactors=False + #undo updating of selected pat jets for heavy ionss + from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8, src = 'selectedPatJets') + updateJetCollection=UpdateJetCollection() diff --git a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py index 26ac7fd1adbd5..8495637c76bb2 100644 --- a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py +++ b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py @@ -9,10 +9,10 @@ PFTowers = _mod.particleTowerProducer.clone(useHF = True) #dummy sequence to speed-up reconstruction in pp_on_AA era -pfNoPileUpJMEHI = cms.EDFilter('GenericPFCandidateSelector', - src = cms.InputTag('particleFlow'), - cut = cms.string("pt>9999") - ) +pfEmptyCollection = cms.EDFilter('GenericPFCandidateSelector', + src = cms.InputTag('particleFlow'), + cut = cms.string("pt>9999") + ) ak5PFJets = cms.EDProducer( "FastjetJetProducer", diff --git a/RecoJets/Configuration/python/RecoPFJets_cff.py b/RecoJets/Configuration/python/RecoPFJets_cff.py index a44f4e5ae2e8b..955ef43688f67 100644 --- a/RecoJets/Configuration/python/RecoPFJets_cff.py +++ b/RecoJets/Configuration/python/RecoPFJets_cff.py @@ -84,7 +84,7 @@ ) recoPFJetsWithSubstructure=cms.Sequence(recoPFJetsWithSubstructureTask) -from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, akPu3PFJets, akPu4PFJets, kt4PFJetsForRho, ak4PFJetsForFlow, akCs4PFJets, pfNoPileUpJMEHI, hiFJRhoFlowModulation, hiPuRho, hiPFCandCleanerforJets +from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, akPu3PFJets, akPu4PFJets, kt4PFJetsForRho, ak4PFJetsForFlow, akCs4PFJets, pfEmptyCollection, hiFJRhoFlowModulation, hiPuRho, hiPFCandCleanerforJets from RecoHI.HiJetAlgos.hiFJRhoProducer import hiFJRhoProducer @@ -93,7 +93,7 @@ fixedGridRhoFastjetCentral, fixedGridRhoFastjetCentralChargedPileUp, fixedGridRhoFastjetCentralNeutral, - pfNoPileUpJMEHI, + pfEmptyCollection, ak4PFJets, ak4PFJetsCHS, PFTowers, diff --git a/RecoJets/JetProducers/python/ak4PFJets_cfi.py b/RecoJets/JetProducers/python/ak4PFJets_cfi.py index fdbeafce74131..f71e5c5923134 100644 --- a/RecoJets/JetProducers/python/ak4PFJets_cfi.py +++ b/RecoJets/JetProducers/python/ak4PFJets_cfi.py @@ -36,5 +36,7 @@ jetPtMin = 100.0 ) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(ak4PFJets,src = "pfNoPileUpJMEHI", inputEtMin = 9999) -pp_on_AA_2018.toModify(ak4PFJetsCHS,src = "pfNoPileUpJMEHI", inputEtMin = 9999) +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJets, src = "pfEmptyCollection", inputEtMin = 9999) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJetsCHS, src = "pfEmptyCollection", inputEtMin = 9999) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJetsPuppi, src = "pfEmptyCollection", jetPtMin = 9999.) diff --git a/RecoJets/JetProducers/python/ak8PFJets_cfi.py b/RecoJets/JetProducers/python/ak8PFJets_cfi.py index db0c4b45b543c..8e7deedaa6d33 100644 --- a/RecoJets/JetProducers/python/ak8PFJets_cfi.py +++ b/RecoJets/JetProducers/python/ak8PFJets_cfi.py @@ -26,7 +26,9 @@ ) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(ak8PFJetsCHS,src = "pfNoPileUpJMEHI", inputEtMin = 9999) +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak8PFJetsCHS, src = "pfEmptyCollection", inputEtMin = 9999) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak8PFJetsPuppi, src = "pfEmptyCollection", inputEtMin = 9999) ak8PFJetsCS = ak8PFJets.clone( useConstituentSubtraction = cms.bool(True), From 66c8f065b5b03ff6e0a47a413310a72b295e6e2a Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 28 Aug 2020 18:36:31 +0200 Subject: [PATCH 140/778] protect against missing slimmedJets collection --- .../python/slimming/modifyPrimaryPhysicsObjects_cff.py | 5 ----- PhysicsTools/PatAlgos/python/tools/jetTools.py | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/modifyPrimaryPhysicsObjects_cff.py b/PhysicsTools/PatAlgos/python/slimming/modifyPrimaryPhysicsObjects_cff.py index e7711712bde18..672993885c1f7 100644 --- a/PhysicsTools/PatAlgos/python/slimming/modifyPrimaryPhysicsObjects_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/modifyPrimaryPhysicsObjects_cff.py @@ -29,8 +29,3 @@ slimmedJets * slimmedJetsAK8 * slimmedJetsPuppi ) - -from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 -(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') -(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8, src = 'patJetsAK8Puppi') diff --git a/PhysicsTools/PatAlgos/python/tools/jetTools.py b/PhysicsTools/PatAlgos/python/tools/jetTools.py index df09b5def7bde..4ff3f236c5589 100644 --- a/PhysicsTools/PatAlgos/python/tools/jetTools.py +++ b/PhysicsTools/PatAlgos/python/tools/jetTools.py @@ -1810,8 +1810,7 @@ def toolCode(self, process): #undo updating of selected pat jets for heavy ionss from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJetsAK8, src = 'selectedPatJets') + if hasattr(process,'slimmedJets'): (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') updateJetCollection=UpdateJetCollection() From c0b32823b238eb65cccd1a6169141fcff8e8522f Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 1 Sep 2020 21:41:34 +0200 Subject: [PATCH 141/778] Overwrite patjets instead of alias, various cleanups --- .../producersHeavyIons/heavyIonJetSetup.py | 40 +++++++++---------- .../python/slimming/applySubstructure_cff.py | 2 - .../PatAlgos/python/slimming/miniAOD_tools.py | 10 ++--- RecoJets/JetProducers/python/ak4PFJets_cfi.py | 6 +-- RecoJets/JetProducers/python/ak8PFJets_cfi.py | 4 +- 5 files changed, 28 insertions(+), 34 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index ac86ac9880d7a..3e70b848cc357 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -13,20 +13,6 @@ def setupHeavyIonJets(process, tag, radius, task): process, task) - genjetcollection = 'ak' + str(radius) + 'HiGenJets' - - addToProcessAndTask( - genjetcollection, - ak5HiGenJets.clone(rParam = radius / 10), - process, - task) - - addToProcessAndTask( - 'ak' + str(radius) + 'HiCleanedGenJets', - heavyIonCleanedGenJets.clone(src = genjetcollection), - process, - task) - from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection addJetCollection( @@ -45,20 +31,30 @@ def setupHeavyIonJets(process, tag, radius, task): jetCorrections = ('AK4PF', ['L2Relative'], 'None'), getJetMCFlavour = False, # jet flavor disabled ) - - process.patJetsAKCs4PF.addAssociatedTracks = True - process.patJetsAKCs4PF.addBTagInfo = True process.patJetsAKCs4PF.useLegacyJetMCFlavour = True process.patJetCorrFactorsAKCs4PF.useNPV = False process.patJetCorrFactorsAKCs4PF.useRho = False - process.patJetPartonMatchAKCs4PF.matched = "cleanedPartons" +def setupHeavyIonGenJets(process, tag, radius, task): + genjetcollection = 'ak' + str(radius) + 'HiGenJets' + + addToProcessAndTask( + genjetcollection, + ak5HiGenJets.clone(rParam = radius / 10), + process, + task) + + addToProcessAndTask( + 'ak' + str(radius) + 'HiCleanedGenJets', + heavyIonCleanedGenJets.clone(src = genjetcollection), + process, + task) + + process.patJetPartonMatchAKCs4PF.matched = "cleanedPartons" -def aliasCsJets(process, tag): - delattr(process, 'patJets') - source = cms.VPSet(cms.PSet(type = cms.string('patJets'))) - process.patJets = cms.EDAlias(**{ 'patJets' + tag: source }) +def useCsJetsForPat(process): + process.patJets = process.patJetsAKCs4PF.clone() def removeL1FastJetJECs(process): for label in process.producerNames().split(): diff --git a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py index bf6cb85c03741..cb41474a04ed8 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py @@ -91,8 +91,6 @@ def applySubstructure( process, postfix="" ) : addToProcessAndTask('nb2AK8PuppiSoftDrop'+postfix, process.ecfNbeta2.clone(src = cms.InputTag("ak8PFJetsPuppiSoftDrop"+postfix), cuts = cms.vstring('', '', 'pt > 250')), process, task) #too slow now ==> disable - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 from Configuration.Eras.Modifier_phase2_common_cff import phase2_common for e in [pp_on_XeXe_2017, pp_on_AA_2018, pp_on_PbPb_run3, phase2_common]: diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index e63bb4e0ccec8..47d9ecf5eb100 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -575,11 +575,11 @@ def miniAOD_customizeMC(process): from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8SoftDropSubJets, cut = 'pt>9999', nLoose = 0) - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, removeJECsForMC, removeL1FastJetJECs - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: aliasCsJets(proc, 'AKCs4PF')) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import useCsJetsForPat, removeJECsForMC, removeL1FastJetJECs, setupHeavyIonGenJets + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: useCsJetsForPat(proc)) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeJECsForMC(proc)) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: setupHeavyIonGenJets(proc, 'akCs4PF', 4, task)) def miniAOD_customizeOutput(out): @@ -604,8 +604,8 @@ def miniAOD_customizeData(process): from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import aliasCsJets, addJECsForData, removeL1FastJetJECs - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: aliasCsJets(proc, 'AKCs4PF')) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import useCsJetsForPat, addJECsForData, removeL1FastJetJECs + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: useCsJetsForPat(proc)) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: addJECsForData(proc)) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) diff --git a/RecoJets/JetProducers/python/ak4PFJets_cfi.py b/RecoJets/JetProducers/python/ak4PFJets_cfi.py index f71e5c5923134..60954a960a4bf 100644 --- a/RecoJets/JetProducers/python/ak4PFJets_cfi.py +++ b/RecoJets/JetProducers/python/ak4PFJets_cfi.py @@ -37,6 +37,6 @@ ) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 -(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJets, src = "pfEmptyCollection", inputEtMin = 9999) -(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJetsCHS, src = "pfEmptyCollection", inputEtMin = 9999) -(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJetsPuppi, src = "pfEmptyCollection", jetPtMin = 9999.) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJets, src = "pfEmptyCollection") +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJetsCHS, src = "pfEmptyCollection") +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak4PFJetsPuppi, src = "pfEmptyCollection") diff --git a/RecoJets/JetProducers/python/ak8PFJets_cfi.py b/RecoJets/JetProducers/python/ak8PFJets_cfi.py index 8e7deedaa6d33..ea7e09882989f 100644 --- a/RecoJets/JetProducers/python/ak8PFJets_cfi.py +++ b/RecoJets/JetProducers/python/ak8PFJets_cfi.py @@ -27,8 +27,8 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 -(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak8PFJetsCHS, src = "pfEmptyCollection", inputEtMin = 9999) -(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak8PFJetsPuppi, src = "pfEmptyCollection", inputEtMin = 9999) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak8PFJetsCHS, src = "pfEmptyCollection") +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak8PFJetsPuppi, src = "pfEmptyCollection") ak8PFJetsCS = ak8PFJets.clone( useConstituentSubtraction = cms.bool(True), From 80e6f4ccc95ac8cb090e388717416664bf490cdc Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Sep 2020 08:50:32 +0200 Subject: [PATCH 142/778] more cleanup/reorganization --- .../python/producersLayer1/jetProducer_cff.py | 11 +++++++++++ .../python/producersLayer1/patCandidates_cff.py | 7 +++---- .../PatAlgos/python/slimming/miniAOD_tools.py | 15 ++++++++------- .../python/slimming/slimmedGenJets_cfi.py | 1 - 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cff.py b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cff.py index 45d2e3791fbc7..cfdc3762f12a9 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cff.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cff.py @@ -17,6 +17,17 @@ patJetFlavourIdTask, patJets ) + +from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJets_cff import * +_makePatJetsTaskHI = cms.Task( + recoJetsHIpostAODTask, + makePatJetsTask.copy() +) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(makePatJetsTask, _makePatJetsTaskHI) + makePatJets = cms.Sequence(makePatJetsTask) from RecoBTag.ImpactParameter.pfImpactParameterTagInfos_cfi import * #pfImpactParameterTagInfos diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py b/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py index 8768104ad5584..d940d972c3e30 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py @@ -34,14 +34,13 @@ makePatJetsTask, makePatMETsTask ) -patCandidates = cms.Sequence(patCandidateSummary, patCandidatesTask) -from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJets_cff import * _patCandidatesTask = patCandidatesTask.copy() -_patCandidatesTask.add(recoJetsHIpostAODTask) _patCandidatesTask.remove(makePatOOTPhotonsTask) - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(patCandidatesTask, _patCandidatesTask) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("patOOTPhotons")) ) + +patCandidates = cms.Sequence(patCandidateSummary, patCandidatesTask) + diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 47d9ecf5eb100..7aee4278e2f33 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -528,6 +528,12 @@ def miniAOD_customizeCommon(process): stage2L1Trigger_2017.toModify(process.prefiringweight, DataEra = "2017BtoF") run2_L1prefiring.toModify(task, func=lambda t: t.add(process.prefiringweight)) + from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import useCsJetsForPat, removeL1FastJetJECs + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: useCsJetsForPat(proc)) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) + def miniAOD_customizeMC(process): task = getPatAlgosToolsTask(process) #GenJetFlavourInfos @@ -574,11 +580,8 @@ def miniAOD_customizeMC(process): from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import useCsJetsForPat, removeJECsForMC, removeL1FastJetJECs, setupHeavyIonGenJets - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: useCsJetsForPat(proc)) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeJECsForMC, setupHeavyIonGenJets (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeJECsForMC(proc)) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: setupHeavyIonGenJets(proc, 'akCs4PF', 4, task)) @@ -604,10 +607,8 @@ def miniAOD_customizeData(process): from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import useCsJetsForPat, addJECsForData, removeL1FastJetJECs - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: useCsJetsForPat(proc)) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import addJECsForData (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: addJECsForData(proc)) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) def miniAOD_customizeAllData(process): miniAOD_customizeCommon(process) diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py index d60521a70f91a..83709c6d51c9b 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py @@ -13,7 +13,6 @@ slimmedGenJetsAK8 = cms.EDProducer("PATGenJetSlimmer", src = cms.InputTag("ak8GenJetsNoNu"), packedGenParticles = cms.InputTag("packedGenParticles"), - cut = cms.string("pt > 80"), cutLoose = cms.string("pt > 10."), nLoose = cms.uint32(3), From 587017987a8dad2a805bda1507bbfbe53c71f705 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 3 Sep 2020 15:43:25 +0200 Subject: [PATCH 143/778] modify patJets directly, rather than using addJetCollection --- .../producersHeavyIons/heavyIonJetSetup.py | 197 ++++++++++++++++-- .../PatAlgos/python/slimming/miniAOD_tools.py | 2 +- 2 files changed, 175 insertions(+), 24 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index 3e70b848cc357..79b4317500df1 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -1,11 +1,20 @@ from __future__ import division +import six + from RecoHI.HiJetAlgos.HiRecoPFJets_cff import akCs4PFJets from RecoHI.HiJetAlgos.HiGenJets_cff import ak5HiGenJets from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJets_cff import * +from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cfi import * +from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import * +from PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff import * +from PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi import * from PhysicsTools.PatAlgos.tools.helpers import * +from RecoBTag.Configuration.RecoBTag_cff import * +from RecoJets.JetAssociationProducers.ak5JTA_cff import * + def setupHeavyIonJets(process, tag, radius, task): addToProcessAndTask( tag + 'Jets', @@ -13,27 +22,104 @@ def setupHeavyIonJets(process, tag, radius, task): process, task) - from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection + modules = { + 'JetTracksAssociatorAtVertex': + ak5JetTracksAssociatorAtVertex.clone( + jets = tag + "Jets", + tracks = "highPurityGeneralTracks", + ), - addJetCollection( - process, - labelName = 'AKCs4PF', - jetSource = cms.InputTag('akCs4PFJets'), - btagDiscriminators = [ - 'simpleSecondaryVertexHighEffBJetTags', - 'simpleSecondaryVertexHighPurBJetTags', - 'combinedSecondaryVertexV2BJetTags', - 'jetBProbabilityBJetTags', - 'trackCountingHighEffBJetTags', - 'trackCountingHighPurBJetTags' - ], - genJetCollection = cms.InputTag('ak4HiCleanedGenJets'), - jetCorrections = ('AK4PF', ['L2Relative'], 'None'), - getJetMCFlavour = False, # jet flavor disabled - ) - process.patJetsAKCs4PF.useLegacyJetMCFlavour = True - process.patJetCorrFactorsAKCs4PF.useNPV = False - process.patJetCorrFactorsAKCs4PF.useRho = False + 'ImpactParameterTagInfos': + impactParameterTagInfos.clone( + jetTracks = "JetTracksAssociatorAtVertex" + tag, + ), + + 'TrackCountingHighEffBJetTags': + trackCountingHighEffBJetTags.clone( + tagInfos = ["ImpactParameterTagInfos" + tag], + ), + + 'TrackCountingHighPurBJetTags': + trackCountingHighPurBJetTags.clone( + tagInfos = ["ImpactParameterTagInfos" + tag], + ), + + 'JetProbabilityBJetTags': + jetProbabilityBJetTags.clone( + tagInfos = ["ImpactParameterTagInfos" + tag], + ), + + 'JetBProbabilityBJetTags': + jetBProbabilityBJetTags.clone( + tagInfos = ["ImpactParameterTagInfos" + tag], + ), + + 'SecondaryVertexTagInfos': + secondaryVertexTagInfos.clone( + trackIPTagInfos = "ImpactParameterTagInfos" + tag, + ), + + 'CombinedSecondaryVertexBJetTags': + combinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'CombinedSecondaryVertexV2BJetTags': + combinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'SecondaryVertexTagInfos': + secondaryVertexTagInfos.clone( + trackIPTagInfos = "ImpactParameterTagInfos" + tag, + ), + + 'SimpleSecondaryVertexHighEffBJetTags': + simpleSecondaryVertexHighEffBJetTags.clone( + tagInfos = ["SecondaryVertexTagInfos" + tag], + ), + + 'SimpleSecondaryVertexHighPurBJetTags': + simpleSecondaryVertexHighPurBJetTags.clone( + tagInfos = ["SecondaryVertexTagInfos" + tag], + ), + + 'CombinedSecondaryVertexBJetTags': + combinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'CombinedSecondaryVertexV2BJetTags': + combinedSecondaryVertexV2BJetTags.clone( + tagInfos = [ + "ImpactParameterTagInfos" + tag, + "SecondaryVertexTagInfos" + tag, + ], + ), + + 'patJetCorrFactors': + patJetCorrFactors.clone( + useNPV = False, + useRho = False, + levels = ['L2Relative'], + payload = "AK" + str(radius) + "PF", + src = tag + "Jets", + ), + + + } + + for label, module in six.iteritems(modules): + addToProcessAndTask(label + tag, module, process, task) def setupHeavyIonGenJets(process, tag, radius, task): genjetcollection = 'ak' + str(radius) + 'HiGenJets' @@ -50,11 +136,76 @@ def setupHeavyIonGenJets(process, tag, radius, task): process, task) - process.patJetPartonMatchAKCs4PF.matched = "cleanedPartons" + modules = { + 'patJetGenJetMatch': + patJetGenJetMatch.clone( + matched = 'ak' + str(radius) + 'HiCleanedGenJets', + maxDeltaR = radius / 10, + resolveByMatchQuality = True, + src = tag + "Jets", + ), + + 'patJetPartonMatch': + patJetPartonMatch.clone( + matched = "cleanedPartons", + src = tag + "Jets", + ), + + 'patJetPartons': + patJetPartons.clone( + particles = "hiSignalGenParticles", + ), + + 'patJetFlavourAssociation': + patJetFlavourAssociation.clone( + jets = tag + "Jets", + rParam = radius / 10, + bHadrons = "patJetPartons" + tag + ":bHadrons", + cHadrons = "patJetPartons" + tag + ":cHadrons", + leptons = "patJetPartons" + tag + ":leptons", + partons = "patJetPartons" + tag + ":physicsPartons", + ), + + 'patJetPartonAssociationLegacy': + patJetPartonAssociationLegacy.clone( + jets = tag + "Jets", + partons = "allPartons", + ), + + 'patJetFlavourAssociationLegacy': + patJetFlavourAssociationLegacy.clone( + srcByReference = "patJetPartonAssociationLegacy" + tag, + ), + } + for label, module in six.iteritems(modules): + addToProcessAndTask(label + tag, module, process, task) -def useCsJetsForPat(process): - process.patJets = process.patJetsAKCs4PF.clone() +def useCsJetsForPat(process, tag): + process.patJets.useLegacyJetMCFlavour = True + process.patJets.userData.userFloats.src = [] + process.patJets.userData.userInts.src = [] + process.patJets.jetSource = tag + "Jets" + process.patJets.genJetMatch = "patJetGenJetMatch" + tag + process.patJets.genPartonMatch = "patJetPartonMatch" + tag + process.patJets.JetFlavourInfoSource = "patJetFlavourAssociation" + tag + process.patJets.JetPartonMapSource = "patJetFlavourAssociationLegacy" + tag + process.patJets.jetCorrFactorsSource = ["patJetCorrFactors" + tag] + process.patJets.trackAssociationSource = "JetTracksAssociatorAtVertex" + tag + process.patJets.useLegacyJetMCFlavour = True + process.patJets.discriminatorSources = [ + "SimpleSecondaryVertexHighEffBJetTags" + tag, + "SimpleSecondaryVertexHighPurBJetTags" + tag, + "CombinedSecondaryVertexBJetTags" + tag, + "CombinedSecondaryVertexV2BJetTags" + tag, + "JetBProbabilityBJetTags" + tag, + "JetProbabilityBJetTags" + tag, + "TrackCountingHighEffBJetTags" + tag, + "TrackCountingHighPurBJetTags" + tag, + ] + process.patJets.tagInfoSources = cms.VInputTag(["ImpactParameterTagInfos" + tag,"SecondaryVertexTagInfos"+tag]) + process.patJets.addJetCharge = False + process.patJets.addTagInfos = True def removeL1FastJetJECs(process): for label in process.producerNames().split(): diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 7aee4278e2f33..2ce204b6298c0 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -531,7 +531,7 @@ def miniAOD_customizeCommon(process): from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import useCsJetsForPat, removeL1FastJetJECs - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: useCsJetsForPat(proc)) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: useCsJetsForPat(proc,"akCs4PF")) (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) def miniAOD_customizeMC(process): From 0900429dfd0b67d4ba4dda4198a186b988b8c4e8 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 13 Sep 2020 13:03:21 +0200 Subject: [PATCH 144/778] use lowercase for names, use < 0 rather than > 9999 --- .../producersHeavyIons/heavyIonJetSetup.py | 82 +++++++++---------- RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | 2 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index 79b4317500df1..1b165e3a07778 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -23,86 +23,86 @@ def setupHeavyIonJets(process, tag, radius, task): task) modules = { - 'JetTracksAssociatorAtVertex': + 'jetTracksAssociatorAtVertex': ak5JetTracksAssociatorAtVertex.clone( jets = tag + "Jets", tracks = "highPurityGeneralTracks", ), - 'ImpactParameterTagInfos': + 'impactParameterTagInfos': impactParameterTagInfos.clone( - jetTracks = "JetTracksAssociatorAtVertex" + tag, + jetTracks = "jetTracksAssociatorAtVertex" + tag, ), - 'TrackCountingHighEffBJetTags': + 'trackCountingHighEffBJetTags': trackCountingHighEffBJetTags.clone( - tagInfos = ["ImpactParameterTagInfos" + tag], + tagInfos = ["impactParameterTagInfos" + tag], ), - 'TrackCountingHighPurBJetTags': + 'trackCountingHighPurBJetTags': trackCountingHighPurBJetTags.clone( - tagInfos = ["ImpactParameterTagInfos" + tag], + tagInfos = ["impactParameterTagInfos" + tag], ), - 'JetProbabilityBJetTags': + 'jetProbabilityBJetTags': jetProbabilityBJetTags.clone( - tagInfos = ["ImpactParameterTagInfos" + tag], + tagInfos = ["impactParameterTagInfos" + tag], ), - 'JetBProbabilityBJetTags': + 'jetBProbabilityBJetTags': jetBProbabilityBJetTags.clone( - tagInfos = ["ImpactParameterTagInfos" + tag], + tagInfos = ["impactParameterTagInfos" + tag], ), - 'SecondaryVertexTagInfos': + 'secondaryVertexTagInfos': secondaryVertexTagInfos.clone( - trackIPTagInfos = "ImpactParameterTagInfos" + tag, + trackIPTagInfos = "impactParameterTagInfos" + tag, ), - 'CombinedSecondaryVertexBJetTags': + 'combinedSecondaryVertexBJetTags': combinedSecondaryVertexV2BJetTags.clone( tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, + "impactParameterTagInfos" + tag, + "secondaryVertexTagInfos" + tag, ], ), - 'CombinedSecondaryVertexV2BJetTags': + 'combinedSecondaryVertexV2BJetTags': combinedSecondaryVertexV2BJetTags.clone( tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, + "impactParameterTagInfos" + tag, + "secondaryVertexTagInfos" + tag, ], ), - 'SecondaryVertexTagInfos': + 'secondaryVertexTagInfos': secondaryVertexTagInfos.clone( - trackIPTagInfos = "ImpactParameterTagInfos" + tag, + trackIPTagInfos = "impactParameterTagInfos" + tag, ), - 'SimpleSecondaryVertexHighEffBJetTags': + 'simpleSecondaryVertexHighEffBJetTags': simpleSecondaryVertexHighEffBJetTags.clone( - tagInfos = ["SecondaryVertexTagInfos" + tag], + tagInfos = ["secondaryVertexTagInfos" + tag], ), - 'SimpleSecondaryVertexHighPurBJetTags': + 'simpleSecondaryVertexHighPurBJetTags': simpleSecondaryVertexHighPurBJetTags.clone( - tagInfos = ["SecondaryVertexTagInfos" + tag], + tagInfos = ["secondaryVertexTagInfos" + tag], ), - 'CombinedSecondaryVertexBJetTags': + 'combinedSecondaryVertexBJetTags': combinedSecondaryVertexV2BJetTags.clone( tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, + "impactParameterTagInfos" + tag, + "secondaryVertexTagInfos" + tag, ], ), - 'CombinedSecondaryVertexV2BJetTags': + 'combinedSecondaryVertexV2BJetTags': combinedSecondaryVertexV2BJetTags.clone( tagInfos = [ - "ImpactParameterTagInfos" + tag, - "SecondaryVertexTagInfos" + tag, + "impactParameterTagInfos" + tag, + "secondaryVertexTagInfos" + tag, ], ), @@ -191,19 +191,19 @@ def useCsJetsForPat(process, tag): process.patJets.JetFlavourInfoSource = "patJetFlavourAssociation" + tag process.patJets.JetPartonMapSource = "patJetFlavourAssociationLegacy" + tag process.patJets.jetCorrFactorsSource = ["patJetCorrFactors" + tag] - process.patJets.trackAssociationSource = "JetTracksAssociatorAtVertex" + tag + process.patJets.trackAssociationSource = "jetTracksAssociatorAtVertex" + tag process.patJets.useLegacyJetMCFlavour = True process.patJets.discriminatorSources = [ - "SimpleSecondaryVertexHighEffBJetTags" + tag, - "SimpleSecondaryVertexHighPurBJetTags" + tag, - "CombinedSecondaryVertexBJetTags" + tag, - "CombinedSecondaryVertexV2BJetTags" + tag, - "JetBProbabilityBJetTags" + tag, - "JetProbabilityBJetTags" + tag, - "TrackCountingHighEffBJetTags" + tag, - "TrackCountingHighPurBJetTags" + tag, + "simpleSecondaryVertexHighEffBJetTags" + tag, + "simpleSecondaryVertexHighPurBJetTags" + tag, + "combinedSecondaryVertexBJetTags" + tag, + "combinedSecondaryVertexV2BJetTags" + tag, + "jetBProbabilityBJetTags" + tag, + "jetProbabilityBJetTags" + tag, + "trackCountingHighEffBJetTags" + tag, + "trackCountingHighPurBJetTags" + tag, ] - process.patJets.tagInfoSources = cms.VInputTag(["ImpactParameterTagInfos" + tag,"SecondaryVertexTagInfos"+tag]) + process.patJets.tagInfoSources = cms.VInputTag(["impactParameterTagInfos" + tag,"secondaryVertexTagInfos"+tag]) process.patJets.addJetCharge = False process.patJets.addTagInfos = True diff --git a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py index 8495637c76bb2..1bc7d1c680ba4 100644 --- a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py +++ b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py @@ -11,7 +11,7 @@ #dummy sequence to speed-up reconstruction in pp_on_AA era pfEmptyCollection = cms.EDFilter('GenericPFCandidateSelector', src = cms.InputTag('particleFlow'), - cut = cms.string("pt>9999") + cut = cms.string("pt<0") ) ak5PFJets = cms.EDProducer( From 3ae3fddb007fabf8841722c1aa2dce61bf603454 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 14 Sep 2020 14:59:39 +0200 Subject: [PATCH 145/778] Move patJet setup to producersLayer1 and deal with consequences in miniAOD_tools --- .../producersHeavyIons/heavyIonJetSetup.py | 26 ------------------- .../python/producersLayer1/jetProducer_cfi.py | 24 +++++++++++++++++ .../PatAlgos/python/slimming/miniAOD_tools.py | 23 ++++++++++------ 3 files changed, 39 insertions(+), 34 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index 1b165e3a07778..6946e26b06055 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -181,32 +181,6 @@ def setupHeavyIonGenJets(process, tag, radius, task): for label, module in six.iteritems(modules): addToProcessAndTask(label + tag, module, process, task) -def useCsJetsForPat(process, tag): - process.patJets.useLegacyJetMCFlavour = True - process.patJets.userData.userFloats.src = [] - process.patJets.userData.userInts.src = [] - process.patJets.jetSource = tag + "Jets" - process.patJets.genJetMatch = "patJetGenJetMatch" + tag - process.patJets.genPartonMatch = "patJetPartonMatch" + tag - process.patJets.JetFlavourInfoSource = "patJetFlavourAssociation" + tag - process.patJets.JetPartonMapSource = "patJetFlavourAssociationLegacy" + tag - process.patJets.jetCorrFactorsSource = ["patJetCorrFactors" + tag] - process.patJets.trackAssociationSource = "jetTracksAssociatorAtVertex" + tag - process.patJets.useLegacyJetMCFlavour = True - process.patJets.discriminatorSources = [ - "simpleSecondaryVertexHighEffBJetTags" + tag, - "simpleSecondaryVertexHighPurBJetTags" + tag, - "combinedSecondaryVertexBJetTags" + tag, - "combinedSecondaryVertexV2BJetTags" + tag, - "jetBProbabilityBJetTags" + tag, - "jetProbabilityBJetTags" + tag, - "trackCountingHighEffBJetTags" + tag, - "trackCountingHighPurBJetTags" + tag, - ] - process.patJets.tagInfoSources = cms.VInputTag(["impactParameterTagInfos" + tag,"secondaryVertexTagInfos"+tag]) - process.patJets.addJetCharge = False - process.patJets.addTagInfos = True - def removeL1FastJetJECs(process): for label in process.producerNames().split(): module = getattr(process, label) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py index bca8636a6b011..f8f7fec8b2583 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py @@ -99,4 +99,28 @@ resolutions = cms.PSet() ) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(_patJets, + jetSource = "akCs4PFJets", + genJetMatch = "patJetGenJetMatchakCs4PF", + genPartonMatch = "patJetPartonMatchakCs4PF", + JetFlavourInfoSource = "patJetFlavourAssociationakCs4PF", + JetPartonMapSource = "patJetFlavourAssociationLegacyakCs4PF", + jetCorrFactorsSource = ["patJetCorrFactorsakCs4PF"], + trackAssociationSource = "jetTracksAssociatorAtVertexakCs4PF", + useLegacyJetMCFlavour = True, + discriminatorSources = cms.VInputTag( + cms.InputTag("simpleSecondaryVertexHighEffBJetTagsakCs4PF"), + cms.InputTag("simpleSecondaryVertexHighPurBJetTagsakCs4PF"), + cms.InputTag("combinedSecondaryVertexBJetTagsakCs4PF"), + cms.InputTag("combinedSecondaryVertexV2BJetTagsakCs4PF"), + cms.InputTag("jetBProbabilityBJetTagsakCs4PF"), + cms.InputTag("jetProbabilityBJetTagsakCs4PF"), + cms.InputTag("trackCountingHighEffBJetTagsakCs4PF"), + cms.InputTag("trackCountingHighPurBJetTagsakCs4PF"), + ), + addJetCharge = False, +) + patJets = _patJets.clone() diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 2ce204b6298c0..8dc543a34830e 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -257,11 +257,12 @@ def miniAOD_customizeCommon(process): ## DeepCSV meta discriminators (simple arithmethic on output probabilities) process.load('RecoBTag.Combined.deepFlavour_cff') task.add(process.pfDeepCSVDiscriminatorsJetTags) - process.patJets.discriminatorSources.extend([ + if not process.patJets.jetSource.value() == "akCs4PFJets": + process.patJets.discriminatorSources.extend([ cms.InputTag('pfDeepCSVDiscriminatorsJetTags:BvsAll' ), cms.InputTag('pfDeepCSVDiscriminatorsJetTags:CvsB' ), cms.InputTag('pfDeepCSVDiscriminatorsJetTags:CvsL' ), - ]) + ]) ## CaloJets process.caloJetMap = cms.EDProducer("RecoJetDeltaRValueMapProducer", @@ -274,6 +275,9 @@ def miniAOD_customizeCommon(process): task.add(process.caloJetMap) process.patJets.userData.userFloats.src += [ 'caloJetMap:pt', 'caloJetMap:emEnergyFraction' ] + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJets.userData.userInts, src = [] ) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJets.userData.userFloats, src = [] ) + #Muon object modifications from PhysicsTools.PatAlgos.slimming.muonIsolationsPUPPI_cfi import makeInputForPUPPIIsolationMuon makeInputForPUPPIIsolationMuon(process) @@ -428,25 +432,26 @@ def miniAOD_customizeCommon(process): task.add(process.patJetPuppiCharge) noDeepFlavourDiscriminators = [x.value() for x in process.patJets.discriminatorSources if not "DeepFlavour" in x.value()] + if process.patJets.jetSource.value() == "akCs4PFJets": noDeepFlavourDiscriminators = ['pfChargeBJetTags'] #dummy entry addJetCollection(process, postfix = "", labelName = 'Puppi', jetSource = cms.InputTag('ak4PFJetsPuppi'), jetCorrections = ('AK4PFPuppi', ['L2Relative', 'L3Absolute'], ''), pfCandidates = cms.InputTag("particleFlow"), algo= 'AK', rParam = 0.4, btagDiscriminators = noDeepFlavourDiscriminators ) - + process.patJetGenJetMatchPuppi.matched = 'slimmedGenJets' process.patJetsPuppi.jetChargeSource = cms.InputTag("patJetPuppiCharge") - + process.selectedPatJetsPuppi.cut = cms.string("pt > 15") - + from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff import applyDeepBtagging applyDeepBtagging( process ) addToProcessAndTask('slimmedJetsPuppi', process.slimmedJetsNoDeepFlavour.clone( src = "selectedPatJetsPuppi", packedPFCandidates = "packedPFCandidates"), process, task) - + task.add(process.slimmedJetsPuppi) # Embed pixelClusterTagInfos in slimmedJets @@ -459,6 +464,9 @@ def miniAOD_customizeCommon(process): _run2_miniAOD_ANY.toModify(process.patJets, addTagInfos = False ) _run2_miniAOD_ANY.toModify(process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour, addTagInfos = False ) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJets, addTagInfos = True ) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJets, tagInfoSources = cms.VInputTag(["impactParameterTagInfosakCs4PF","secondaryVertexTagInfosakCs4PF"]) ) + ## puppi met process.load('RecoMET.METProducers.pfMetPuppi_cfi') _rerun_puppimet_task = task.copy() @@ -530,8 +538,7 @@ def miniAOD_customizeCommon(process): from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import useCsJetsForPat, removeL1FastJetJECs - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: useCsJetsForPat(proc,"akCs4PF")) + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeL1FastJetJECs (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) def miniAOD_customizeMC(process): From ba9ab3a01fed5d91753c66b51073f6945c2559bd Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Wed, 23 Sep 2020 18:38:20 +0200 Subject: [PATCH 146/778] add ES for self-consistency; remove updates of basicJetsForMetPuppi assuming/considering it is not present in HI miniAOD --- .../PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index 6946e26b06055..511e576e4bd18 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -118,6 +118,8 @@ def setupHeavyIonJets(process, tag, radius, task): } + process.load("RecoBTag.ImpactParameter.impactParameter_EventSetup_cff") + process.load("RecoBTag.SecondaryVertex.secondaryVertex_EventSetup_cff") for label, module in six.iteritems(modules): addToProcessAndTask(label + tag, module, process, task) @@ -194,7 +196,6 @@ def removeJECsForMC(process): module.jetCorrLabel = 'Uncorrected' process.basicJetsForMet.jetCorrLabel = 'Uncorrected' - process.basicJetsForMetPuppi.jetCorrLabelRes = 'Uncorrected' def addJECsForData(process): for label in process.producerNames().split(): From 819db916c105e19b2250ea9a20be4d3c5e6429c5 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Wed, 23 Sep 2020 18:41:19 +0200 Subject: [PATCH 147/778] drop type specs --- .../python/producersLayer1/jetProducer_cfi.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py index f8f7fec8b2583..17dc75bef4a45 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py @@ -110,16 +110,16 @@ jetCorrFactorsSource = ["patJetCorrFactorsakCs4PF"], trackAssociationSource = "jetTracksAssociatorAtVertexakCs4PF", useLegacyJetMCFlavour = True, - discriminatorSources = cms.VInputTag( - cms.InputTag("simpleSecondaryVertexHighEffBJetTagsakCs4PF"), - cms.InputTag("simpleSecondaryVertexHighPurBJetTagsakCs4PF"), - cms.InputTag("combinedSecondaryVertexBJetTagsakCs4PF"), - cms.InputTag("combinedSecondaryVertexV2BJetTagsakCs4PF"), - cms.InputTag("jetBProbabilityBJetTagsakCs4PF"), - cms.InputTag("jetProbabilityBJetTagsakCs4PF"), - cms.InputTag("trackCountingHighEffBJetTagsakCs4PF"), - cms.InputTag("trackCountingHighPurBJetTagsakCs4PF"), - ), + discriminatorSources = [ + "simpleSecondaryVertexHighEffBJetTagsakCs4PF", + "simpleSecondaryVertexHighPurBJetTagsakCs4PF", + "combinedSecondaryVertexBJetTagsakCs4PF", + "combinedSecondaryVertexV2BJetTagsakCs4PF", + "jetBProbabilityBJetTagsakCs4PF", + "jetProbabilityBJetTagsakCs4PF", + "trackCountingHighEffBJetTagsakCs4PF", + "trackCountingHighPurBJetTagsakCs4PF", + ], addJetCharge = False, ) From d30926075f19e8b39583246f13107a18573add10 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 23 Sep 2020 20:52:39 +0200 Subject: [PATCH 148/778] fixed tabs --- PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 8dc543a34830e..87d9d48318021 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -438,20 +438,20 @@ def miniAOD_customizeCommon(process): pfCandidates = cms.InputTag("particleFlow"), algo= 'AK', rParam = 0.4, btagDiscriminators = noDeepFlavourDiscriminators ) - + process.patJetGenJetMatchPuppi.matched = 'slimmedGenJets' process.patJetsPuppi.jetChargeSource = cms.InputTag("patJetPuppiCharge") - + process.selectedPatJetsPuppi.cut = cms.string("pt > 15") - + from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff import applyDeepBtagging applyDeepBtagging( process ) addToProcessAndTask('slimmedJetsPuppi', process.slimmedJetsNoDeepFlavour.clone( src = "selectedPatJetsPuppi", packedPFCandidates = "packedPFCandidates"), process, task) - + task.add(process.slimmedJetsPuppi) # Embed pixelClusterTagInfos in slimmedJets From d225fa1b4ec3033f88c0d8574fc07a6d8541c393 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Wed, 23 Sep 2020 18:57:25 +0200 Subject: [PATCH 149/778] define _hiGeneral = pp_on_AA_2018 | pp_on_PbPb_run3 for HI miniAOD; wrap default miniAOD parts not used in HI mini into separate inlined functions and call them only with ~_hiGeneral --- .../PatAlgos/python/slimming/miniAOD_tools.py | 242 +++++++++--------- 1 file changed, 128 insertions(+), 114 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 87d9d48318021..8ff1b4e12de73 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -4,6 +4,10 @@ from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +_hiGeneral = pp_on_AA_2018 | pp_on_PbPb_run3 + def miniAOD_customizeCommon(process): process.patMuons.isoDeposits = cms.PSet() process.patElectrons.isoDeposits = cms.PSet() @@ -120,20 +124,25 @@ def miniAOD_customizeCommon(process): from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon phase2_muon.toModify(process.selectedPatMuons, cut = "pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose') || muonID('ME0MuonArbitrated') || muonID('GEMMuonArbitrated')) )") - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.selectedPatMuons, cut = "pt > 5 || isPFMuon || (pt > 1.2 && (isGlobalMuon || isStandAloneMuon) )") + _hiGeneral.toModify(process.selectedPatMuons, cut = "pt > 5 || isPFMuon || (pt > 1.2 && (isGlobalMuon || isStandAloneMuon) )") process.selectedPatElectrons.cut = cms.string("") process.selectedPatTaus.cut = cms.string("pt > 18. && tauID('decayModeFindingNewDMs')> 0.5") process.selectedPatPhotons.cut = cms.string("") - from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection - - from PhysicsTools.PatAlgos.slimming.applySubstructure_cff import applySubstructure - applySubstructure( process ) + _dummyPatJets = process.selectedPatJets.clone(cut = "pt < 0") + task = getPatAlgosToolsTask(process) + def _applySubstructure(process): + from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection + from PhysicsTools.PatAlgos.slimming.applySubstructure_cff import applySubstructure + applySubstructure( process ) + (~_hiGeneral).toModify(process, _applySubstructure) + + _hiGeneral.toModify(process, func = lambda p: addToProcessAndTask('slimmedJets', p.selectedPatJets.clone(), p, task)) + _hiGeneral.toModify(process, func = lambda p: addToProcessAndTask('slimmedJetsAK8', _dummyPatJets.clone(), p, task)) + # from PhysicsTools.PatAlgos.tools.trigTools import switchOnTriggerStandAlone switchOnTriggerStandAlone( process, outputModule = '' ) @@ -155,13 +164,8 @@ def miniAOD_customizeCommon(process): #noHF pfMET ========= - task = getPatAlgosToolsTask(process) - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import setupHeavyIonJets - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: - setupHeavyIonJets(proc, 'akCs4PF', 4, task)) + _hiGeneral.toModify(process, func = lambda p: setupHeavyIonJets(p, 'akCs4PF', 4, task)) process.noHFCands = cms.EDFilter("GenericPFCandidateSelector", src=cms.InputTag("particleFlow"), @@ -178,20 +182,22 @@ def miniAOD_customizeCommon(process): process.load('PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi') task.add(process.slimmedMETs) - process.slimmedMETs.addDeepMETs = True - - addToProcessAndTask('slimmedMETsNoHF', process.slimmedMETs.clone(), process, task) - process.slimmedMETsNoHF.src = cms.InputTag("patMETsNoHF") - process.slimmedMETsNoHF.rawVariation = cms.InputTag("patPFMetNoHF") - process.slimmedMETsNoHF.t1Uncertainties = cms.InputTag("patPFMetT1%sNoHF") - process.slimmedMETsNoHF.t01Variation = cms.InputTag("patPFMetT0pcT1NoHF") - process.slimmedMETsNoHF.t1SmearedVarsAndUncs = cms.InputTag("patPFMetT1Smear%sNoHF") - process.slimmedMETsNoHF.tXYUncForRaw = cms.InputTag("patPFMetTxyNoHF") - process.slimmedMETsNoHF.tXYUncForT1 = cms.InputTag("patPFMetT1TxyNoHF") - process.slimmedMETsNoHF.tXYUncForT01 = cms.InputTag("patPFMetT0pcT1TxyNoHF") - process.slimmedMETsNoHF.tXYUncForT1Smear = cms.InputTag("patPFMetT1SmearTxyNoHF") - process.slimmedMETsNoHF.tXYUncForT01Smear = cms.InputTag("patPFMetT0pcT1SmearTxyNoHF") - del process.slimmedMETsNoHF.caloMET + (~_hiGeneral).toModify(process.slimmedMETs, addDeepMETs = True) + + def _add_slimmedMETsNoHF(process): + addToProcessAndTask('slimmedMETsNoHF', process.slimmedMETs.clone(), process, task) + process.slimmedMETsNoHF.src = cms.InputTag("patMETsNoHF") + process.slimmedMETsNoHF.rawVariation = cms.InputTag("patPFMetNoHF") + process.slimmedMETsNoHF.t1Uncertainties = cms.InputTag("patPFMetT1%sNoHF") + process.slimmedMETsNoHF.t01Variation = cms.InputTag("patPFMetT0pcT1NoHF") + process.slimmedMETsNoHF.t1SmearedVarsAndUncs = cms.InputTag("patPFMetT1Smear%sNoHF") + process.slimmedMETsNoHF.tXYUncForRaw = cms.InputTag("patPFMetTxyNoHF") + process.slimmedMETsNoHF.tXYUncForT1 = cms.InputTag("patPFMetT1TxyNoHF") + process.slimmedMETsNoHF.tXYUncForT01 = cms.InputTag("patPFMetT0pcT1TxyNoHF") + process.slimmedMETsNoHF.tXYUncForT1Smear = cms.InputTag("patPFMetT1SmearTxyNoHF") + process.slimmedMETsNoHF.tXYUncForT01Smear = cms.InputTag("patPFMetT0pcT1SmearTxyNoHF") + del process.slimmedMETsNoHF.caloMET + (~_hiGeneral).toModify(process, _add_slimmedMETsNoHF) # ================== NoHF pfMET # ================== CHSMET @@ -255,14 +261,15 @@ def miniAOD_customizeCommon(process): process.patJets.userData.userInts.src += [ 'hfJetShowerShape:centralEtaStripSize', 'hfJetShowerShape:adjacentEtaStripsSize'] ## DeepCSV meta discriminators (simple arithmethic on output probabilities) - process.load('RecoBTag.Combined.deepFlavour_cff') - task.add(process.pfDeepCSVDiscriminatorsJetTags) - if not process.patJets.jetSource.value() == "akCs4PFJets": + def _add_deepFlavour(process): + process.load('RecoBTag.Combined.deepFlavour_cff') + task.add(process.pfDeepCSVDiscriminatorsJetTags) process.patJets.discriminatorSources.extend([ - cms.InputTag('pfDeepCSVDiscriminatorsJetTags:BvsAll' ), - cms.InputTag('pfDeepCSVDiscriminatorsJetTags:CvsB' ), - cms.InputTag('pfDeepCSVDiscriminatorsJetTags:CvsL' ), + 'pfDeepCSVDiscriminatorsJetTags:BvsAll', + 'pfDeepCSVDiscriminatorsJetTags:CvsB', + 'pfDeepCSVDiscriminatorsJetTags:CvsL', ]) + (~_hiGeneral).toModify(process, _add_deepFlavour) ## CaloJets process.caloJetMap = cms.EDProducer("RecoJetDeltaRValueMapProducer", @@ -275,8 +282,8 @@ def miniAOD_customizeCommon(process): task.add(process.caloJetMap) process.patJets.userData.userFloats.src += [ 'caloJetMap:pt', 'caloJetMap:emEnergyFraction' ] - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJets.userData.userInts, src = [] ) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJets.userData.userFloats, src = [] ) + _hiGeneral.toModify(process.patJets.userData.userInts, src = [] ) + _hiGeneral.toModify(process.patJets.userData.userFloats, src = [] ) #Muon object modifications from PhysicsTools.PatAlgos.slimming.muonIsolationsPUPPI_cfi import makeInputForPUPPIIsolationMuon @@ -431,93 +438,106 @@ def miniAOD_customizeCommon(process): ) task.add(process.patJetPuppiCharge) - noDeepFlavourDiscriminators = [x.value() for x in process.patJets.discriminatorSources if not "DeepFlavour" in x.value()] - if process.patJets.jetSource.value() == "akCs4PFJets": noDeepFlavourDiscriminators = ['pfChargeBJetTags'] #dummy entry - addJetCollection(process, postfix = "", labelName = 'Puppi', jetSource = cms.InputTag('ak4PFJetsPuppi'), - jetCorrections = ('AK4PFPuppi', ['L2Relative', 'L3Absolute'], ''), - pfCandidates = cms.InputTag("particleFlow"), - algo= 'AK', rParam = 0.4, btagDiscriminators = noDeepFlavourDiscriminators - ) + def _add_jetsPuppi(process): + noDeepFlavourDiscriminators = [x.value() if isinstance(x, cms.InputTag) else x for x in process.patJets.discriminatorSources + if not "DeepFlavour" in str(x)] + addJetCollection(process, postfix = "", labelName = 'Puppi', jetSource = cms.InputTag('ak4PFJetsPuppi'), + jetCorrections = ('AK4PFPuppi', ['L2Relative', 'L3Absolute'], ''), + pfCandidates = cms.InputTag("particleFlow"), + algo= 'AK', rParam = 0.4, btagDiscriminators = noDeepFlavourDiscriminators + ) + + process.patJetGenJetMatchPuppi.matched = 'slimmedGenJets' - process.patJetGenJetMatchPuppi.matched = 'slimmedGenJets' + process.patJetsPuppi.jetChargeSource = cms.InputTag("patJetPuppiCharge") - process.patJetsPuppi.jetChargeSource = cms.InputTag("patJetPuppiCharge") - - process.selectedPatJetsPuppi.cut = cms.string("pt > 15") + process.selectedPatJetsPuppi.cut = cms.string("pt > 15") + + from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff import applyDeepBtagging + applyDeepBtagging( process ) - from PhysicsTools.PatAlgos.slimming.applyDeepBtagging_cff import applyDeepBtagging - applyDeepBtagging( process ) + addToProcessAndTask('slimmedJetsPuppi', process.slimmedJetsNoDeepFlavour.clone( + src = "selectedPatJetsPuppi", packedPFCandidates = "packedPFCandidates"), + process, task) + + task.add(process.slimmedJetsPuppi) - addToProcessAndTask('slimmedJetsPuppi', process.slimmedJetsNoDeepFlavour.clone( - src = "selectedPatJetsPuppi", packedPFCandidates = "packedPFCandidates"), - process, task) + process.slimmedJetsNoDeepFlavour.dropTagInfos = '0' + process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.addTagInfos = True + process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.tagInfoSources = ["pixelClusterTagInfos"] + _run2_miniAOD_ANY.toModify(process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour, addTagInfos = False ) + (~_hiGeneral).toModify(process, _add_jetsPuppi) - task.add(process.slimmedJetsPuppi) + _hiGeneral.toModify(process, func = lambda p: addToProcessAndTask('slimmedJetsPuppi', _dummyPatJets.clone(), p, task)) # Embed pixelClusterTagInfos in slimmedJets process.patJets.addTagInfos = True process.patJets.tagInfoSources = ["pixelClusterTagInfos"] - process.slimmedJetsNoDeepFlavour.dropTagInfos = '0' - process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.addTagInfos = True - process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour.tagInfoSources = ["pixelClusterTagInfos"] _run2_miniAOD_ANY.toModify(process.patJets, addTagInfos = False ) - _run2_miniAOD_ANY.toModify(process.updatedPatJetsTransientCorrectedSlimmedDeepFlavour, addTagInfos = False ) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJets, addTagInfos = True ) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.patJets, tagInfoSources = cms.VInputTag(["impactParameterTagInfosakCs4PF","secondaryVertexTagInfosakCs4PF"]) ) + _hiGeneral.toModify(process.patJets, addTagInfos = True ) + _hiGeneral.toModify(process.patJets, tagInfoSources = cms.VInputTag(["impactParameterTagInfosakCs4PF","secondaryVertexTagInfosakCs4PF"]) ) ## puppi met - process.load('RecoMET.METProducers.pfMetPuppi_cfi') - _rerun_puppimet_task = task.copy() - _rerun_puppimet_task.add(process.puppiNoLep, process.pfMetPuppi) - (_run2_miniAOD_ANY | pA_2016 | pp_on_AA_2018).toReplaceWith(task, _rerun_puppimet_task) + def _add_metPuppi(process): + process.load('RecoMET.METProducers.pfMetPuppi_cfi') + _rerun_puppimet_task = task.copy() + _rerun_puppimet_task.add(process.puppiNoLep, process.pfMetPuppi) + (_run2_miniAOD_ANY | pA_2016 | pp_on_AA_2018).toReplaceWith(task, _rerun_puppimet_task) - runMetCorAndUncForMiniAODProduction(process, metType="Puppi", - jetCollUnskimmed="slimmedJetsPuppi", - recoMetFromPFCs=True, - jetFlavor="AK4PFPuppi", - postfix="Puppi" + runMetCorAndUncForMiniAODProduction(process, metType="Puppi", + jetCollUnskimmed="slimmedJetsPuppi", + recoMetFromPFCs=True, + jetFlavor="AK4PFPuppi", + postfix="Puppi" ) - + (~_hiGeneral).toModify(process, _add_metPuppi) + process.load('PhysicsTools.PatAlgos.slimming.slimmedMETs_cfi') task.add(process.slimmedMETs) - addToProcessAndTask('slimmedMETsPuppi', process.slimmedMETs.clone(), process, task) - process.slimmedMETsPuppi.src = cms.InputTag("patMETsPuppi") - process.slimmedMETsPuppi.rawVariation = cms.InputTag("patPFMetPuppi") - process.slimmedMETsPuppi.t1Uncertainties = cms.InputTag("patPFMetT1%sPuppi") - process.slimmedMETsPuppi.t01Variation = cms.InputTag("patPFMetT0pcT1Puppi") - process.slimmedMETsPuppi.t1SmearedVarsAndUncs = cms.InputTag("patPFMetT1Smear%sPuppi") - process.slimmedMETsPuppi.tXYUncForRaw = cms.InputTag("patPFMetTxyPuppi") - process.slimmedMETsPuppi.tXYUncForT1 = cms.InputTag("patPFMetT1TxyPuppi") - process.slimmedMETsPuppi.tXYUncForT01 = cms.InputTag("patPFMetT0pcT1TxyPuppi") - process.slimmedMETsPuppi.tXYUncForT1Smear = cms.InputTag("patPFMetT1SmearTxyPuppi") - process.slimmedMETsPuppi.tXYUncForT01Smear = cms.InputTag("patPFMetT0pcT1SmearTxyPuppi") - del process.slimmedMETsPuppi.caloMET - - process.load('RecoMET.METPUSubtraction.deepMETProducer_cfi') - - addToProcessAndTask('deepMETsResolutionTune', process.deepMETProducer.clone(), process, task) - addToProcessAndTask('deepMETsResponseTune', process.deepMETProducer.clone(), process, task) - process.deepMETsResponseTune.graph_path = 'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb' - - from Configuration.Eras.Modifier_phase2_common_cff import phase2_common - phase2_common.toModify( - process.deepMETsResolutionTune, - max_n_pf=12500, - graph_path="RecoMET/METPUSubtraction/data/deepmet/deepmet_v1_phase2.pb" - ) - phase2_common.toModify( - process.deepMETsResponseTune, - max_n_pf=12500, - graph_path="RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_phase2.pb" - ) - from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016 - run2_jme_2016.toModify( - process.deepMETsResponseTune, - graph_path="RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2016.pb" - ) + def _add_slimmedMETsPuppi(process): + addToProcessAndTask('slimmedMETsPuppi', process.slimmedMETs.clone(), process, task) + process.slimmedMETsPuppi.src = cms.InputTag("patMETsPuppi") + process.slimmedMETsPuppi.rawVariation = cms.InputTag("patPFMetPuppi") + process.slimmedMETsPuppi.t1Uncertainties = cms.InputTag("patPFMetT1%sPuppi") + process.slimmedMETsPuppi.t01Variation = cms.InputTag("patPFMetT0pcT1Puppi") + process.slimmedMETsPuppi.t1SmearedVarsAndUncs = cms.InputTag("patPFMetT1Smear%sPuppi") + process.slimmedMETsPuppi.tXYUncForRaw = cms.InputTag("patPFMetTxyPuppi") + process.slimmedMETsPuppi.tXYUncForT1 = cms.InputTag("patPFMetT1TxyPuppi") + process.slimmedMETsPuppi.tXYUncForT01 = cms.InputTag("patPFMetT0pcT1TxyPuppi") + process.slimmedMETsPuppi.tXYUncForT1Smear = cms.InputTag("patPFMetT1SmearTxyPuppi") + process.slimmedMETsPuppi.tXYUncForT01Smear = cms.InputTag("patPFMetT0pcT1SmearTxyPuppi") + del process.slimmedMETsPuppi.caloMET + (~_hiGeneral).toModify(process, _add_slimmedMETsPuppi) + + def _add_deepMET(process): + process.load('RecoMET.METPUSubtraction.deepMETProducer_cfi') + + addToProcessAndTask('deepMETsResolutionTune', process.deepMETProducer.clone(), process, task) + addToProcessAndTask('deepMETsResponseTune', process.deepMETProducer.clone(), process, task) + process.deepMETsResponseTune.graph_path = 'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb' + + from Configuration.Eras.Modifier_phase2_common_cff import phase2_common + phase2_common.toModify( + process.deepMETsResolutionTune, + max_n_pf=12500, + graph_path="RecoMET/METPUSubtraction/data/deepmet/deepmet_v1_phase2.pb" + ) + phase2_common.toModify( + process.deepMETsResponseTune, + max_n_pf=12500, + graph_path="RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_phase2.pb" + ) + + from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016 + run2_jme_2016.toModify( + process.deepMETsResponseTune, + graph_path="RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2016.pb" + ) + (~_hiGeneral).toModify(process, _add_deepMET) + # add DetIdAssociatorRecords to EventSetup (for isolatedTracks) process.load("TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff") @@ -536,10 +556,8 @@ def miniAOD_customizeCommon(process): stage2L1Trigger_2017.toModify(process.prefiringweight, DataEra = "2017BtoF") run2_L1prefiring.toModify(task, func=lambda t: t.add(process.prefiringweight)) - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeL1FastJetJECs - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeL1FastJetJECs(proc)) + _hiGeneral.toModify(process, removeL1FastJetJECs) def miniAOD_customizeMC(process): task = getPatAlgosToolsTask(process) @@ -574,7 +592,7 @@ def miniAOD_customizeMC(process): process.patJetPartonMatch.matched = "prunedGenParticles" process.patJetPartonMatch.mcStatus = [ 3, 23 ] process.patJetGenJetMatch.matched = "slimmedGenJets" - process.patJetGenJetMatchAK8Puppi.matched = "slimmedGenJetsAK8" + (~_hiGeneral).toModify(process, patJetGenJetMatchAK8Puppi = dict(matched = "slimmedGenJetsAK8")) process.patMuons.embedGenMatch = False process.patElectrons.embedGenMatch = False process.patPhotons.embedGenMatch = False @@ -585,11 +603,9 @@ def miniAOD_customizeMC(process): #also jet flavour must be switched process.patJetFlavourAssociation.rParam = 0.4 - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeJECsForMC, setupHeavyIonGenJets - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: removeJECsForMC(proc)) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: setupHeavyIonGenJets(proc, 'akCs4PF', 4, task)) + _hiGeneral.toModify(process, removeJECsForMC) + _hiGeneral.toModify(process, func = lambda proc: setupHeavyIonGenJets(proc, 'akCs4PF', 4, task)) def miniAOD_customizeOutput(out): @@ -612,10 +628,8 @@ def miniAOD_customizeData(process): ctpps_2016.toModify(task, func=lambda t: t.add(process.ctppsLocalTrackLiteProducer)) ctpps_2016.toModify(task, func=lambda t: t.add(process.ctppsProtons)) - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import addJECsForData - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process, func = lambda proc: addJECsForData(proc)) + _hiGeneral.toModify(process, addJECsForData) def miniAOD_customizeAllData(process): miniAOD_customizeCommon(process) From 9f402854dd2e01946ff1380516b7cbf2cb11fdb2 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Wed, 23 Sep 2020 18:58:05 +0200 Subject: [PATCH 150/778] disable puppi for packed cands in HI miniAOD --- .../PatAlgos/python/slimming/packedPFCandidates_cfi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py index d94780c03c7d5..933250f78239c 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py @@ -49,3 +49,6 @@ from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing phase2_timing.toModify(packedPFCandidates, storeTiming = cms.bool(True)) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(packedPFCandidates, PuppiSrc = "", PuppiNoLepSrc = "") From 99105598108ae6d5b80c32c606991bfcc2fdafff Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Wed, 23 Sep 2020 19:01:14 +0200 Subject: [PATCH 151/778] fix missing addJetCollection --- PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 8ff1b4e12de73..31360825bf158 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -439,6 +439,7 @@ def _add_deepFlavour(process): task.add(process.patJetPuppiCharge) def _add_jetsPuppi(process): + from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection noDeepFlavourDiscriminators = [x.value() if isinstance(x, cms.InputTag) else x for x in process.patJets.discriminatorSources if not "DeepFlavour" in str(x)] addJetCollection(process, postfix = "", labelName = 'Puppi', jetSource = cms.InputTag('ak4PFJetsPuppi'), From 7dda511fe23a4b0e9bf0ee3176dbb876552bbdbb Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 24 Sep 2020 11:51:59 +0200 Subject: [PATCH 152/778] Cherry pick Slava's commits + address style comments --- .../producersHeavyIons/heavyIonJetSetup.py | 38 +++++++++---------- .../python/producersLayer1/jetProducer_cfi.py | 28 +++++++------- .../python/slimming/applyDeepBtagging_cff.py | 5 ++- .../python/slimming/applySubstructure_cff.py | 2 +- .../PatAlgos/python/slimming/miniAOD_tools.py | 2 +- .../PatAlgos/python/tools/jetTools.py | 5 --- 6 files changed, 39 insertions(+), 41 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index 511e576e4bd18..5d2bd72167e5f 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -31,78 +31,78 @@ def setupHeavyIonJets(process, tag, radius, task): 'impactParameterTagInfos': impactParameterTagInfos.clone( - jetTracks = "jetTracksAssociatorAtVertex" + tag, + jetTracks = "jetTracksAssociatorAtVertex", ), 'trackCountingHighEffBJetTags': trackCountingHighEffBJetTags.clone( - tagInfos = ["impactParameterTagInfos" + tag], + tagInfos = ["impactParameterTagInfos"], ), 'trackCountingHighPurBJetTags': trackCountingHighPurBJetTags.clone( - tagInfos = ["impactParameterTagInfos" + tag], + tagInfos = ["impactParameterTagInfos"], ), 'jetProbabilityBJetTags': jetProbabilityBJetTags.clone( - tagInfos = ["impactParameterTagInfos" + tag], + tagInfos = ["impactParameterTagInfos"], ), 'jetBProbabilityBJetTags': jetBProbabilityBJetTags.clone( - tagInfos = ["impactParameterTagInfos" + tag], + tagInfos = ["impactParameterTagInfos" ], ), 'secondaryVertexTagInfos': secondaryVertexTagInfos.clone( - trackIPTagInfos = "impactParameterTagInfos" + tag, + trackIPTagInfos = "impactParameterTagInfos", ), 'combinedSecondaryVertexBJetTags': combinedSecondaryVertexV2BJetTags.clone( tagInfos = [ - "impactParameterTagInfos" + tag, - "secondaryVertexTagInfos" + tag, + "impactParameterTagInfos", + "secondaryVertexTagInfos", ], ), 'combinedSecondaryVertexV2BJetTags': combinedSecondaryVertexV2BJetTags.clone( tagInfos = [ - "impactParameterTagInfos" + tag, - "secondaryVertexTagInfos" + tag, + "impactParameterTagInfos", + "secondaryVertexTagInfos", ], ), 'secondaryVertexTagInfos': secondaryVertexTagInfos.clone( - trackIPTagInfos = "impactParameterTagInfos" + tag, + trackIPTagInfos = "impactParameterTagInfos", ), 'simpleSecondaryVertexHighEffBJetTags': simpleSecondaryVertexHighEffBJetTags.clone( - tagInfos = ["secondaryVertexTagInfos" + tag], + tagInfos = ["secondaryVertexTagInfos"], ), 'simpleSecondaryVertexHighPurBJetTags': simpleSecondaryVertexHighPurBJetTags.clone( - tagInfos = ["secondaryVertexTagInfos" + tag], + tagInfos = ["secondaryVertexTagInfos"], ), 'combinedSecondaryVertexBJetTags': combinedSecondaryVertexV2BJetTags.clone( tagInfos = [ - "impactParameterTagInfos" + tag, - "secondaryVertexTagInfos" + tag, + "impactParameterTagInfos", + "secondaryVertexTagInfos", ], ), 'combinedSecondaryVertexV2BJetTags': combinedSecondaryVertexV2BJetTags.clone( tagInfos = [ - "impactParameterTagInfos" + tag, - "secondaryVertexTagInfos" + tag, + "impactParameterTagInfos", + "secondaryVertexTagInfos", ], ), @@ -121,8 +121,8 @@ def setupHeavyIonJets(process, tag, radius, task): process.load("RecoBTag.ImpactParameter.impactParameter_EventSetup_cff") process.load("RecoBTag.SecondaryVertex.secondaryVertex_EventSetup_cff") for label, module in six.iteritems(modules): - addToProcessAndTask(label + tag, module, process, task) - + addToProcessAndTask(label, module, process, task) + def setupHeavyIonGenJets(process, tag, radius, task): genjetcollection = 'ak' + str(radius) + 'HiGenJets' diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py index 17dc75bef4a45..ba17d343c9664 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py @@ -103,22 +103,22 @@ from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(_patJets, jetSource = "akCs4PFJets", - genJetMatch = "patJetGenJetMatchakCs4PF", - genPartonMatch = "patJetPartonMatchakCs4PF", - JetFlavourInfoSource = "patJetFlavourAssociationakCs4PF", - JetPartonMapSource = "patJetFlavourAssociationLegacyakCs4PF", - jetCorrFactorsSource = ["patJetCorrFactorsakCs4PF"], - trackAssociationSource = "jetTracksAssociatorAtVertexakCs4PF", + genJetMatch = "patJetGenJetMatch", + genPartonMatch = "patJetPartonMatch", + JetFlavourInfoSource = "patJetFlavourAssociation", + JetPartonMapSource = "patJetFlavourAssociationLegacy", + jetCorrFactorsSource = ["patJetCorrFactors"], + trackAssociationSource = "jetTracksAssociatorAtVertex", useLegacyJetMCFlavour = True, discriminatorSources = [ - "simpleSecondaryVertexHighEffBJetTagsakCs4PF", - "simpleSecondaryVertexHighPurBJetTagsakCs4PF", - "combinedSecondaryVertexBJetTagsakCs4PF", - "combinedSecondaryVertexV2BJetTagsakCs4PF", - "jetBProbabilityBJetTagsakCs4PF", - "jetProbabilityBJetTagsakCs4PF", - "trackCountingHighEffBJetTagsakCs4PF", - "trackCountingHighPurBJetTagsakCs4PF", + "simpleSecondaryVertexHighEffBJetTags", + "simpleSecondaryVertexHighPurBJetTags", + "combinedSecondaryVertexBJetTags", + "combinedSecondaryVertexV2BJetTags", + "jetBProbabilityBJetTags", + "jetProbabilityBJetTags", + "trackCountingHighEffBJetTags", + "trackCountingHighPurBJetTags", ], addJetCharge = False, ) diff --git a/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py b/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py index a67434ea8ad23..46d5755d62bfd 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py @@ -88,4 +88,7 @@ def applyDeepBtagging( process, postfix="" ) : # delete module not used anymore (slimmedJetsAK8 substitutes) delattr(process, 'selectedUpdatedPatJetsSlimmedAK8DeepTags'+postfix) - + #undo updating of selected pat jets for heavy ions + from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 + from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 + if hasattr(process,'slimmedJets'): (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') diff --git a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py index cb41474a04ed8..99b238370d6a8 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py @@ -54,7 +54,7 @@ def applySubstructure( process, postfix="" ) : dropSpecific = cms.bool(True), # Save space ), process, task ) - (pp_on_AA_2018 | pp_on_PbPb_run3).toModify( getattr(process,'slimmedGenJetsAK8SoftDropSubJets'), cut = 'pt>9999', nLoose = 0) + (pp_on_AA_2018 | pp_on_PbPb_run3).toModify( getattr(process,'slimmedGenJetsAK8SoftDropSubJets'), cut = 'pt<0', nLoose = 0) ## PATify puppi soft drop fat jets addJetCollection( diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 31360825bf158..755d099149752 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -478,7 +478,7 @@ def _add_jetsPuppi(process): _run2_miniAOD_ANY.toModify(process.patJets, addTagInfos = False ) _hiGeneral.toModify(process.patJets, addTagInfos = True ) - _hiGeneral.toModify(process.patJets, tagInfoSources = cms.VInputTag(["impactParameterTagInfosakCs4PF","secondaryVertexTagInfosakCs4PF"]) ) + _hiGeneral.toModify(process.patJets, tagInfoSources = cms.VInputTag(["impactParameterTagInfos","secondaryVertexTagInfos"]) ) ## puppi met def _add_metPuppi(process): diff --git a/PhysicsTools/PatAlgos/python/tools/jetTools.py b/PhysicsTools/PatAlgos/python/tools/jetTools.py index 4ff3f236c5589..25def6d8d1bc3 100644 --- a/PhysicsTools/PatAlgos/python/tools/jetTools.py +++ b/PhysicsTools/PatAlgos/python/tools/jetTools.py @@ -1807,11 +1807,6 @@ def toolCode(self, process): ## switch jetCorrFactors off _newPatJets.addJetCorrFactors=False - #undo updating of selected pat jets for heavy ionss - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - if hasattr(process,'slimmedJets'): (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') - updateJetCollection=UpdateJetCollection() From 81364a359333a676e854af7f9c53222231c33956 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 24 Sep 2020 16:14:16 +0200 Subject: [PATCH 153/778] remove jet algo/radius for gen collections --- .../python/producersHeavyIons/heavyIonJetSetup.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index 5d2bd72167e5f..ad8cb3ff2d929 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -162,10 +162,10 @@ def setupHeavyIonGenJets(process, tag, radius, task): patJetFlavourAssociation.clone( jets = tag + "Jets", rParam = radius / 10, - bHadrons = "patJetPartons" + tag + ":bHadrons", - cHadrons = "patJetPartons" + tag + ":cHadrons", - leptons = "patJetPartons" + tag + ":leptons", - partons = "patJetPartons" + tag + ":physicsPartons", + bHadrons = "patJetPartons:bHadrons", + cHadrons = "patJetPartons:cHadrons", + leptons = "patJetPartons:leptons", + partons = "patJetPartons:physicsPartons", ), 'patJetPartonAssociationLegacy': @@ -176,12 +176,12 @@ def setupHeavyIonGenJets(process, tag, radius, task): 'patJetFlavourAssociationLegacy': patJetFlavourAssociationLegacy.clone( - srcByReference = "patJetPartonAssociationLegacy" + tag, + srcByReference = "patJetPartonAssociationLegacy", ), } for label, module in six.iteritems(modules): - addToProcessAndTask(label + tag, module, process, task) + addToProcessAndTask(label, module, process, task) def removeL1FastJetJECs(process): for label in process.producerNames().split(): From 78b0a76436417538aefafc8a492dd0314831b794 Mon Sep 17 00:00:00 2001 From: ddesouza Date: Wed, 30 Sep 2020 19:10:07 +0200 Subject: [PATCH 154/778] Move HFFilterStruct to HFFilterInfo --- .../HeavyIonEvent/interface/HFFilterInfo.h | 13 +++++++++++ .../HeavyIonEvent/interface/HFFilterStruct.h | 13 ----------- .../HeavyIonEvent/src/HFFilterStruct.cc | 1 - DataFormats/HeavyIonEvent/src/classes.h | 2 +- DataFormats/HeavyIonEvent/src/classes_def.xml | 6 ++--- .../python/slimming/MicroEventContent_cff.py | 2 +- .../plugins/HiHFFilterProducer.cc | 22 +++++++++---------- 7 files changed, 29 insertions(+), 30 deletions(-) create mode 100644 DataFormats/HeavyIonEvent/interface/HFFilterInfo.h delete mode 100644 DataFormats/HeavyIonEvent/interface/HFFilterStruct.h delete mode 100644 DataFormats/HeavyIonEvent/src/HFFilterStruct.cc diff --git a/DataFormats/HeavyIonEvent/interface/HFFilterInfo.h b/DataFormats/HeavyIonEvent/interface/HFFilterInfo.h new file mode 100644 index 0000000000000..8ceecda5175b5 --- /dev/null +++ b/DataFormats/HeavyIonEvent/interface/HFFilterInfo.h @@ -0,0 +1,13 @@ +#ifndef DataFormats_HeavyIonEvent_HFFilterInfo_H +#define DataFormats_HeavyIonEvent_HFFilterInfo_H + +namespace reco { + struct HFFilterInfo { + unsigned short int numMinHFTowers2; + unsigned short int numMinHFTowers3; + unsigned short int numMinHFTowers4; + unsigned short int numMinHFTowers5; + }; +} // namespace reco + +#endif diff --git a/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h b/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h deleted file mode 100644 index 7c400aa7e5742..0000000000000 --- a/DataFormats/HeavyIonEvent/interface/HFFilterStruct.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef DataFormats_HeavyIonEvent_HFFilterStruct_H -#define DataFormats_HeavyIonEvent_HFFilterStruct_H - -namespace pat { - struct HFFilterStruct { - int numMinHFTowers2; - int numMinHFTowers3; - int numMinHFTowers4; - int numMinHFTowers5; - }; -} // namespace pat - -#endif diff --git a/DataFormats/HeavyIonEvent/src/HFFilterStruct.cc b/DataFormats/HeavyIonEvent/src/HFFilterStruct.cc deleted file mode 100644 index 6f6c236dfc20b..0000000000000 --- a/DataFormats/HeavyIonEvent/src/HFFilterStruct.cc +++ /dev/null @@ -1 +0,0 @@ -#include "DataFormats/HeavyIonEvent/interface/HFFilterStruct.h" diff --git a/DataFormats/HeavyIonEvent/src/classes.h b/DataFormats/HeavyIonEvent/src/classes.h index 877390763d304..2a3421f4bba0f 100644 --- a/DataFormats/HeavyIonEvent/src/classes.h +++ b/DataFormats/HeavyIonEvent/src/classes.h @@ -3,7 +3,7 @@ #include "DataFormats/HeavyIonEvent/interface/ClusterCompatibility.h" #include "DataFormats/HeavyIonEvent/interface/EvtPlane.h" #include "DataFormats/HeavyIonEvent/interface/HeavyIon.h" -#include "DataFormats/HeavyIonEvent/interface/HFFilterStruct.h" +#include "DataFormats/HeavyIonEvent/interface/HFFilterInfo.h" #include "DataFormats/HeavyIonEvent/interface/VoronoiBackground.h" #include "DataFormats/Common/interface/Wrapper.h" diff --git a/DataFormats/HeavyIonEvent/src/classes_def.xml b/DataFormats/HeavyIonEvent/src/classes_def.xml index 0607d586a67e2..1ed47600b0800 100644 --- a/DataFormats/HeavyIonEvent/src/classes_def.xml +++ b/DataFormats/HeavyIonEvent/src/classes_def.xml @@ -16,10 +16,10 @@ - - + + - + diff --git a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py index 23031a40ea46d..efba4886bcf28 100644 --- a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py @@ -145,7 +145,7 @@ 'keep floatedmValueMap_lostTrackChi2_*_*', 'keep recoCentrality_hiCentrality_*_*', 'keep int_centralityBin_*_*', - 'keep patHFFilterStruct_hiHFfilters_*_*', + 'keep recoHFFilterInfo_hiHFfilters_*_*', ] from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 diff --git a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc index 38d6e28ca1768..0e368c7df3505 100644 --- a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc +++ b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc @@ -12,7 +12,7 @@ #include "DataFormats/CaloTowers/interface/CaloTower.h" #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" -#include "DataFormats/HeavyIonEvent/interface/HFFilterStruct.h" +#include "DataFormats/HeavyIonEvent/interface/HFFilterInfo.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -35,7 +35,7 @@ class HiHFFilterProducer : public edm::stream::EDProducer<> { HiHFFilterProducer::HiHFFilterProducer(const edm::ParameterSet& iConfig) : srcTowers_(consumes(iConfig.getParameter("srcTowers"))) { - produces("hiHFfilters"); + produces("hiHFfilters"); } void HiHFFilterProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { @@ -44,16 +44,16 @@ void HiHFFilterProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet auto const& towers = iEvent.get(srcTowers_); - int nTowersTh2HFplus = 0; - int nTowersTh2HFminus = 0; - int nTowersTh3HFplus = 0; - int nTowersTh3HFminus = 0; - int nTowersTh4HFplus = 0; - int nTowersTh4HFminus = 0; - int nTowersTh5HFplus = 0; - int nTowersTh5HFminus = 0; + unsigned short int nTowersTh2HFplus = 0; + unsigned short int nTowersTh2HFminus = 0; + unsigned short int nTowersTh3HFplus = 0; + unsigned short int nTowersTh3HFminus = 0; + unsigned short int nTowersTh4HFplus = 0; + unsigned short int nTowersTh4HFminus = 0; + unsigned short int nTowersTh5HFplus = 0; + unsigned short int nTowersTh5HFminus = 0; - auto HFFilterResults = std::make_unique(); + auto HFFilterResults = std::make_unique(); for (const auto& tower : towers) { const auto et = tower.et(); const auto energy = tower.energy(); From bdc469317c30b1f6e5188b1ba16ef2ee179fefa5 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Wed, 30 Sep 2020 19:40:02 +0200 Subject: [PATCH 155/778] Now that use of namespace //.*: is fixed in core FilteredView, can remove duplicated XML with no namespace (which was a temporary path we definitely did not want to go to anyway, as in general the implications were to modify/duplicate many XMLs). --- .../data/dd4hep/cmsExtendedGeometry2021.xml | 2 +- .../dd4hep/trackerStructureTopology.xml | 426 ------------------ 2 files changed, 1 insertion(+), 427 deletions(-) delete mode 100644 Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml index 92ca1793acf09..6ce3f568fec6d 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -206,7 +206,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml b/Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml deleted file mode 100644 index c3b016562cbf3..0000000000000 --- a/Geometry/TrackerCommonData/data/PhaseI/dd4hep/trackerStructureTopology.xml +++ /dev/null @@ -1,426 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From f16713ab88fa74068c639df7c9a0d3b96c9f0e92 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Wed, 30 Sep 2020 19:40:45 +0200 Subject: [PATCH 156/778] temporary, just to have easier comparisons with old DD --- .../plugins/CmsTrackerDetIdBuilder.cc | 8 ++++---- Geometry/TrackerNumberingBuilder/src/GeometricDet.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc index 34498930758ac..1ac08ab8b29dd 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc @@ -29,8 +29,8 @@ void CmsTrackerDetIdBuilder::buildId(GeometricDet& tracker) { tracker.setGeographicalID(t); iterate(tracker, 0, tracker.geographicalId().rawId()); -//std::ofstream outfile("DetIdOLD.log", std::ios::out); - std::ofstream outfile("DetIdDD4hep.log", std::ios::out); + std::ofstream outfile("DetIdOLD.log", std::ios::out); +//std::ofstream outfile("DetIdDD4hep.log", std::ios::out); std::deque queue; queue.emplace_back(&tracker); @@ -72,8 +72,8 @@ void CmsTrackerDetIdBuilder::buildId(GeometricDet& tracker) { outfile << " " << std::endl; } - //outfile << "myDet->radLength() = " << myDet->radLength() << std::endl; - //outfile << "myDet->xi() = " << myDet->xi() << std::endl; + outfile << "myDet->radLength() = " << myDet->radLength() << std::endl; + outfile << "myDet->xi() = " << myDet->xi() << std::endl; outfile << "myDet->pixROCRows() = " << myDet->pixROCRows() << std::endl; outfile << "myDet->pixROCCols() = " << myDet->pixROCCols() << std::endl; outfile << "myDet->pixROCx() = " << myDet->pixROCx() << std::endl; diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 4dfaf8ca810e4..3898f121227c6 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -305,7 +305,7 @@ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSoli geant_units::operators::convertCmToMm(myTube->GetDz()), geant_units::operators::convertCmToMm(myTube->GetRmin()), geant_units::operators::convertCmToMm(myTube->GetRmax()), - static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi1())), + static_cast(fmod(angle_units::operators::convertDegToRad(myTube->GetPhi1()), 2.*M_PI) - 2.*M_PI), static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1()))}; } From caafebe12b7b2161461ad101f5e52d7490bfa835 Mon Sep 17 00:00:00 2001 From: ddesouza Date: Wed, 30 Sep 2020 21:26:45 +0200 Subject: [PATCH 157/778] Move hiHFFilterProducer_cfi to hiHFfilters_cfi --- PhysicsTools/PatAlgos/python/slimming/slimming_cff.py | 2 +- RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py | 5 ----- RecoHI/HiCentralityAlgos/python/hiHFfilters_cfi.py | 5 +++++ 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py create mode 100644 RecoHI/HiCentralityAlgos/python/hiHFfilters_cfi.py diff --git a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py index 25fb05ee284b7..ca2b48f515bf1 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py @@ -73,7 +73,7 @@ from PhysicsTools.PatAlgos.packedCandidateMuonID_cfi import packedCandidateMuonID from PhysicsTools.PatAlgos.packedPFCandidateTrackChi2_cfi import packedPFCandidateTrackChi2 from RecoHI.HiCentralityAlgos.CentralityBin_cfi import centralityBin -from RecoHI.HiCentralityAlgos.HiHFFilterProducer_cfi import hiHFfilters +from RecoHI.HiCentralityAlgos.hiHFfilters_cfi import hiHFfilters lostTrackChi2 = packedPFCandidateTrackChi2.clone(candidates = "lostTracks", doLostTracks = True) (pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith( slimmingTask, diff --git a/RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py b/RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py deleted file mode 100644 index 9ff35c32efb0f..0000000000000 --- a/RecoHI/HiCentralityAlgos/python/HiHFFilterProducer_cfi.py +++ /dev/null @@ -1,5 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -hiHFfilters = cms.EDProducer("HiHFFilterProducer", -srcTowers = cms.InputTag("towerMaker") -) diff --git a/RecoHI/HiCentralityAlgos/python/hiHFfilters_cfi.py b/RecoHI/HiCentralityAlgos/python/hiHFfilters_cfi.py new file mode 100644 index 0000000000000..22e8427f84bd6 --- /dev/null +++ b/RecoHI/HiCentralityAlgos/python/hiHFfilters_cfi.py @@ -0,0 +1,5 @@ +import FWCore.ParameterSet.Config as cms + +from RecoHI.HiCentralityAlgos.hiHFFilterProducer_cfi import hiHFFilterProducer + +hiHFfilters = hiHFFilterProducer.clone() From 10ed6c85a49c132f9d923d0178f68da22690240a Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 30 Sep 2020 22:19:37 +0200 Subject: [PATCH 158/778] Undo cloning of b-tagging sequences and other cleaning --- .../python/mcMatchLayer0/jetFlavourId_cff.py | 12 ++ .../python/mcMatchLayer0/jetMatch_cfi.py | 12 ++ .../producersHeavyIons/heavyIonJetSetup.py | 191 ------------------ .../producersHeavyIons/heavyIonJets_cff.py | 38 +++- .../python/producersLayer1/jetProducer_cfi.py | 3 +- .../python/recoLayer0/jetCorrFactors_cfi.py | 10 + .../python/slimming/applyDeepBtagging_cff.py | 4 - .../PatAlgos/python/slimming/miniAOD_tools.py | 9 +- 8 files changed, 72 insertions(+), 207 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetFlavourId_cff.py b/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetFlavourId_cff.py index c8dc176f678b3..87a3077f68894 100644 --- a/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetFlavourId_cff.py +++ b/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetFlavourId_cff.py @@ -41,3 +41,15 @@ patJetFlavourIdTask = cms.Task(patJetPartons, patJetFlavourAssociation) patJetFlavourId = cms.Sequence(patJetFlavourIdTask) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetPartons, particles = "hiSignalGenParticles") +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetFlavourAssociation, + jets = 'akCs4PFJets', + rParam = 0.4, + ) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetPartonAssociationLegacy, + jets = "akCs4PFJets", + partons = "allPartons", +) diff --git a/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py b/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py index 8141442b5bd71..5b2c208f48e84 100644 --- a/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py +++ b/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py @@ -27,4 +27,16 @@ resolveByMatchQuality = cms.bool(False), # False = just match input in order; True = pick lowest deltaR pair first ) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetGenJetMatch, + matched = 'ak4HiCleanedGenJets', + maxDeltaR = 0.4, + resolveByMatchQuality = True, + src = "akCs4PFJets", + ) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetPartonMatch, + matched = "cleanedPartons", + src = "akCs4PFJets", + ) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py index ad8cb3ff2d929..ca42d0bc7066a 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJetSetup.py @@ -1,188 +1,3 @@ -from __future__ import division - -import six - -from RecoHI.HiJetAlgos.HiRecoPFJets_cff import akCs4PFJets -from RecoHI.HiJetAlgos.HiGenJets_cff import ak5HiGenJets -from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets -from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJets_cff import * -from PhysicsTools.PatAlgos.producersLayer1.jetProducer_cfi import * -from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import * -from PhysicsTools.PatAlgos.mcMatchLayer0.jetFlavourId_cff import * -from PhysicsTools.PatAlgos.mcMatchLayer0.jetMatch_cfi import * -from PhysicsTools.PatAlgos.tools.helpers import * - -from RecoBTag.Configuration.RecoBTag_cff import * -from RecoJets.JetAssociationProducers.ak5JTA_cff import * - -def setupHeavyIonJets(process, tag, radius, task): - addToProcessAndTask( - tag + 'Jets', - akCs4PFJets.clone(rParam = radius / 10), - process, - task) - - modules = { - 'jetTracksAssociatorAtVertex': - ak5JetTracksAssociatorAtVertex.clone( - jets = tag + "Jets", - tracks = "highPurityGeneralTracks", - ), - - 'impactParameterTagInfos': - impactParameterTagInfos.clone( - jetTracks = "jetTracksAssociatorAtVertex", - ), - - 'trackCountingHighEffBJetTags': - trackCountingHighEffBJetTags.clone( - tagInfos = ["impactParameterTagInfos"], - ), - - 'trackCountingHighPurBJetTags': - trackCountingHighPurBJetTags.clone( - tagInfos = ["impactParameterTagInfos"], - ), - - 'jetProbabilityBJetTags': - jetProbabilityBJetTags.clone( - tagInfos = ["impactParameterTagInfos"], - ), - - 'jetBProbabilityBJetTags': - jetBProbabilityBJetTags.clone( - tagInfos = ["impactParameterTagInfos" ], - ), - - 'secondaryVertexTagInfos': - secondaryVertexTagInfos.clone( - trackIPTagInfos = "impactParameterTagInfos", - ), - - 'combinedSecondaryVertexBJetTags': - combinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "impactParameterTagInfos", - "secondaryVertexTagInfos", - ], - ), - - 'combinedSecondaryVertexV2BJetTags': - combinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "impactParameterTagInfos", - "secondaryVertexTagInfos", - ], - ), - - 'secondaryVertexTagInfos': - secondaryVertexTagInfos.clone( - trackIPTagInfos = "impactParameterTagInfos", - ), - - 'simpleSecondaryVertexHighEffBJetTags': - simpleSecondaryVertexHighEffBJetTags.clone( - tagInfos = ["secondaryVertexTagInfos"], - ), - - 'simpleSecondaryVertexHighPurBJetTags': - simpleSecondaryVertexHighPurBJetTags.clone( - tagInfos = ["secondaryVertexTagInfos"], - ), - - 'combinedSecondaryVertexBJetTags': - combinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "impactParameterTagInfos", - "secondaryVertexTagInfos", - ], - ), - - 'combinedSecondaryVertexV2BJetTags': - combinedSecondaryVertexV2BJetTags.clone( - tagInfos = [ - "impactParameterTagInfos", - "secondaryVertexTagInfos", - ], - ), - - 'patJetCorrFactors': - patJetCorrFactors.clone( - useNPV = False, - useRho = False, - levels = ['L2Relative'], - payload = "AK" + str(radius) + "PF", - src = tag + "Jets", - ), - - - } - - process.load("RecoBTag.ImpactParameter.impactParameter_EventSetup_cff") - process.load("RecoBTag.SecondaryVertex.secondaryVertex_EventSetup_cff") - for label, module in six.iteritems(modules): - addToProcessAndTask(label, module, process, task) - -def setupHeavyIonGenJets(process, tag, radius, task): - genjetcollection = 'ak' + str(radius) + 'HiGenJets' - - addToProcessAndTask( - genjetcollection, - ak5HiGenJets.clone(rParam = radius / 10), - process, - task) - - addToProcessAndTask( - 'ak' + str(radius) + 'HiCleanedGenJets', - heavyIonCleanedGenJets.clone(src = genjetcollection), - process, - task) - - modules = { - 'patJetGenJetMatch': - patJetGenJetMatch.clone( - matched = 'ak' + str(radius) + 'HiCleanedGenJets', - maxDeltaR = radius / 10, - resolveByMatchQuality = True, - src = tag + "Jets", - ), - - 'patJetPartonMatch': - patJetPartonMatch.clone( - matched = "cleanedPartons", - src = tag + "Jets", - ), - - 'patJetPartons': - patJetPartons.clone( - particles = "hiSignalGenParticles", - ), - - 'patJetFlavourAssociation': - patJetFlavourAssociation.clone( - jets = tag + "Jets", - rParam = radius / 10, - bHadrons = "patJetPartons:bHadrons", - cHadrons = "patJetPartons:cHadrons", - leptons = "patJetPartons:leptons", - partons = "patJetPartons:physicsPartons", - ), - - 'patJetPartonAssociationLegacy': - patJetPartonAssociationLegacy.clone( - jets = tag + "Jets", - partons = "allPartons", - ), - - 'patJetFlavourAssociationLegacy': - patJetFlavourAssociationLegacy.clone( - srcByReference = "patJetPartonAssociationLegacy", - ), - } - - for label, module in six.iteritems(modules): - addToProcessAndTask(label, module, process, task) - def removeL1FastJetJECs(process): for label in process.producerNames().split(): module = getattr(process, label) @@ -196,9 +11,3 @@ def removeJECsForMC(process): module.jetCorrLabel = 'Uncorrected' process.basicJetsForMet.jetCorrLabel = 'Uncorrected' - -def addJECsForData(process): - for label in process.producerNames().split(): - module = getattr(process, label) - if module.type_() == "JetCorrFactorsProducer": - module.levels.append('L2L3Residual') diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index b74c4b0617005..a2b5fc30305d0 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -2,6 +2,8 @@ from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets from RecoHI.HiJetAlgos.HiGenCleaner_cff import hiPartons +from RecoHI.HiJetAlgos.HiGenJets_cff import ak4HiGenJets +from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets allPartons = cms.EDProducer( "PartonSelector", @@ -13,13 +15,33 @@ src = 'allPartons', ) +ak4HiCleanedGenJets = heavyIonCleanedGenJets.clone(src = "ak4HiGenJets") + cleanedGenJetsTask = cms.Task( genParticlesForJets, cleanedPartons, + ak4HiGenJets, + ak4HiCleanedGenJets ) -from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfEmptyCollection, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation +from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfEmptyCollection, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation, akCs4PFJets from RecoHI.HiTracking.highPurityGeneralTracks_cfi import highPurityGeneralTracks +from RecoJets.JetAssociationProducers.ak5JTA_cff import * +from RecoBTag.Configuration.RecoBTag_cff import impactParameterTagInfos, trackCountingHighEffBJetTags, trackCountingHighPurBJetTags, jetProbabilityBJetTags, jetBProbabilityBJetTags, secondaryVertexTagInfos, combinedSecondaryVertexV2BJetTags, simpleSecondaryVertexHighEffBJetTags, simpleSecondaryVertexHighPurBJetTags +ak5JetTracksAssociatorAtVertex +from RecoBTag.SecondaryVertex.simpleSecondaryVertex2TrkComputer_cfi import * +from RecoBTag.SecondaryVertex.simpleSecondaryVertex3TrkComputer_cfi import * +from RecoBTag.SecondaryVertex.combinedSecondaryVertexV2Computer_cfi import * +from RecoBTag.ImpactParameter.jetBProbabilityComputer_cfi import * +from RecoBTag.ImpactParameter.jetProbabilityComputer_cfi import * +from RecoBTag.ImpactParameter.trackCounting3D2ndComputer_cfi import * +from RecoBTag.ImpactParameter.trackCounting3D3rdComputer_cfi import * +from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import * + +ak5JetTracksAssociatorAtVertex.jets = "akCs4PFJets" +ak5JetTracksAssociatorAtVertex.tracks = "highPurityGeneralTracks" + +impactParameterTagInfos.jetTracks = "ak5JetTracksAssociatorAtVertex" recoPFJetsHIpostAODTask = cms.Task( PFTowers, @@ -28,7 +50,19 @@ hiFJRhoFlowModulation, hiPuRho, highPurityGeneralTracks, - ) + akCs4PFJets, + ak5JetTracksAssociatorAtVertex, + impactParameterTagInfos, + trackCountingHighEffBJetTags, + trackCountingHighPurBJetTags, + jetProbabilityBJetTags, + jetBProbabilityBJetTags, + secondaryVertexTagInfos, + combinedSecondaryVertexV2BJetTags, + simpleSecondaryVertexHighEffBJetTags, + simpleSecondaryVertexHighPurBJetTags, + patJetCorrFactors +) recoJetsHIpostAODTask = cms.Task( recoPFJetsHIpostAODTask, diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py index ba17d343c9664..6b191dba32a74 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py @@ -108,12 +108,11 @@ JetFlavourInfoSource = "patJetFlavourAssociation", JetPartonMapSource = "patJetFlavourAssociationLegacy", jetCorrFactorsSource = ["patJetCorrFactors"], - trackAssociationSource = "jetTracksAssociatorAtVertex", + trackAssociationSource = "ak5JetTracksAssociatorAtVertex", useLegacyJetMCFlavour = True, discriminatorSources = [ "simpleSecondaryVertexHighEffBJetTags", "simpleSecondaryVertexHighPurBJetTags", - "combinedSecondaryVertexBJetTags", "combinedSecondaryVertexV2BJetTags", "jetBProbabilityBJetTags", "jetProbabilityBJetTags", diff --git a/PhysicsTools/PatAlgos/python/recoLayer0/jetCorrFactors_cfi.py b/PhysicsTools/PatAlgos/python/recoLayer0/jetCorrFactors_cfi.py index 26d449c178af6..05822b077a224 100644 --- a/PhysicsTools/PatAlgos/python/recoLayer0/jetCorrFactors_cfi.py +++ b/PhysicsTools/PatAlgos/python/recoLayer0/jetCorrFactors_cfi.py @@ -40,3 +40,13 @@ useRho = cms.bool(True), rho = cms.InputTag('fixedGridRhoFastjetAll'), ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetCorrFactors, + useNPV = False, + useRho = False, + levels = ['L2Relative','L3Absolute'], + payload = "AK4PF", + src = "akCs4PFJets", + ) diff --git a/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py b/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py index 46d5755d62bfd..7b0084c85d296 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py @@ -88,7 +88,3 @@ def applyDeepBtagging( process, postfix="" ) : # delete module not used anymore (slimmedJetsAK8 substitutes) delattr(process, 'selectedUpdatedPatJetsSlimmedAK8DeepTags'+postfix) - #undo updating of selected pat jets for heavy ions - from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 - from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 - if hasattr(process,'slimmedJets'): (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(process.slimmedJets, src = 'selectedPatJets') diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 755d099149752..b6981349253b1 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -164,9 +164,6 @@ def _applySubstructure(process): #noHF pfMET ========= - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import setupHeavyIonJets - _hiGeneral.toModify(process, func = lambda p: setupHeavyIonJets(p, 'akCs4PF', 4, task)) - process.noHFCands = cms.EDFilter("GenericPFCandidateSelector", src=cms.InputTag("particleFlow"), cut=cms.string("abs(pdgId)!=1 && abs(pdgId)!=2 && abs(eta)<3.0") @@ -604,9 +601,8 @@ def miniAOD_customizeMC(process): #also jet flavour must be switched process.patJetFlavourAssociation.rParam = 0.4 - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeJECsForMC, setupHeavyIonGenJets + from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeJECsForMC _hiGeneral.toModify(process, removeJECsForMC) - _hiGeneral.toModify(process, func = lambda proc: setupHeavyIonGenJets(proc, 'akCs4PF', 4, task)) def miniAOD_customizeOutput(out): @@ -629,9 +625,6 @@ def miniAOD_customizeData(process): ctpps_2016.toModify(task, func=lambda t: t.add(process.ctppsLocalTrackLiteProducer)) ctpps_2016.toModify(task, func=lambda t: t.add(process.ctppsProtons)) - from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import addJECsForData - _hiGeneral.toModify(process, addJECsForData) - def miniAOD_customizeAllData(process): miniAOD_customizeCommon(process) miniAOD_customizeData(process) From 64c468abb83c498561cfc9791ff02228609525ab Mon Sep 17 00:00:00 2001 From: Andrzej Date: Wed, 30 Sep 2020 00:15:44 +0200 Subject: [PATCH 159/778] feat: switch to DDXv2 as baseline, BTV fixes for NanoAOD --- PhysicsTools/NanoAOD/python/jets_cff.py | 35 +++++++++++++------ PhysicsTools/NanoAOD/python/nano_cff.py | 17 +++++++-- .../python/slimming/applyDeepBtagging_cff.py | 18 ++++------ 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/jets_cff.py b/PhysicsTools/NanoAOD/python/jets_cff.py index e9637ff3ce917..fcd53d9769290 100644 --- a/PhysicsTools/NanoAOD/python/jets_cff.py +++ b/PhysicsTools/NanoAOD/python/jets_cff.py @@ -227,12 +227,14 @@ electronIdx1 = Var("?overlaps('electrons').size()>0?overlaps('electrons')[0].key():-1", int, doc="index of first matching electron"), electronIdx2 = Var("?overlaps('electrons').size()>1?overlaps('electrons')[1].key():-1", int, doc="index of second matching electron"), nElectrons = Var("?hasOverlaps('electrons')?overlaps('electrons').size():0", int, doc="number of electrons in the jet"), - btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10), btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10), - btagDeepFlavB = Var("bDiscriminator('pfDeepFlavourJetTags:probb')+bDiscriminator('pfDeepFlavourJetTags:probbb')+bDiscriminator('pfDeepFlavourJetTags:problepb')",float,doc="DeepFlavour b+bb+lepb tag discriminator",precision=10), + btagDeepFlavB = Var("bDiscriminator('pfDeepFlavourJetTags:probb')+bDiscriminator('pfDeepFlavourJetTags:probbb')+bDiscriminator('pfDeepFlavourJetTags:problepb')",float,doc="DeepJet b+bb+lepb tag discriminator",precision=10), btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10), - btagDeepC = Var("bDiscriminator('pfDeepCSVJetTags:probc')",float,doc="DeepCSV charm btag discriminator",precision=10), - btagDeepFlavC = Var("bDiscriminator('pfDeepFlavourJetTags:probc')",float,doc="DeepFlavour charm tag discriminator",precision=10), + btagDeepCvL = Var("?bDiscriminator('pfDeepCSVJetTags:probc')>=0?bDiscriminator('pfDeepCSVJetTags:probc')/(bDiscriminator('pfDeepCSVJetTags:probc')+bDiscriminator('pfDeepCSVJetTags:probudsg')):-1", float,doc="DeepCSV c vs udsg discriminator",precision=10), + btagDeepCvB = Var("?bDiscriminator('pfDeepCSVJetTags:probc')>=0?bDiscriminator('pfDeepCSVJetTags:probc')/(bDiscriminator('pfDeepCSVJetTags:probc')+bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')):-1",float,doc="DeepCSV c vs b+bb discriminator",precision=10), + btagDeepFlavCvL = Var("?(bDiscriminator('pfDeepFlavourJetTags:probc')+bDiscriminator('pfDeepFlavourJetTags:probuds')+bDiscriminator('pfDeepFlavourJetTags:probg'))>0?bDiscriminator('pfDeepFlavourJetTags:probc')/(bDiscriminator('pfDeepFlavourJetTags:probc')+bDiscriminator('pfDeepFlavourJetTags:probuds')+bDiscriminator('pfDeepFlavourJetTags:probg')):-1",float,doc="DeepJet c vs uds+g discriminator",precision=10), + btagDeepFlavCvB = Var("?(bDiscriminator('pfDeepFlavourJetTags:probc')+bDiscriminator('pfDeepFlavourJetTags:probb')+bDiscriminator('pfDeepFlavourJetTags:probbb')+bDiscriminator('pfDeepFlavourJetTags:problepb'))>0?bDiscriminator('pfDeepFlavourJetTags:probc')/(bDiscriminator('pfDeepFlavourJetTags:probc')+bDiscriminator('pfDeepFlavourJetTags:probb')+bDiscriminator('pfDeepFlavourJetTags:probbb')+bDiscriminator('pfDeepFlavourJetTags:problepb')):-1",float,doc="DeepJet c vs b+bb+lepb discriminator",precision=10), + btagDeepFlavQG = Var("?(bDiscriminator('pfDeepFlavourJetTags:probg')+bDiscriminator('pfDeepFlavourJetTags:probuds'))>0?bDiscriminator('pfDeepFlavourJetTags:probg')/(bDiscriminator('pfDeepFlavourJetTags:probg')+bDiscriminator('pfDeepFlavourJetTags:probuds')):-1",float,doc="DeepJet g vs uds discriminator",precision=10), puIdDisc = Var("userFloat('puId102XDisc')",float,doc="Pilup ID discriminant with 102X (2018) training",precision=10), puId = Var("userInt('pileupJetId:fullId')",int,doc="Pilup ID flags with 80X (2016) training"), jetId = Var("userInt('tightId')*2+4*userInt('tightIdLepVeto')",int,doc="Jet ID flags bit1 is loose (always false in 2017 since it does not exist), bit2 is tight, bit3 is tightLepVeto"), @@ -259,6 +261,13 @@ jetTable.variables.pt.precision=10 ### Era dependent customization +for modifier in run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1: + # Deprecated after 106X + modifier.toModify(jetTable.variables, + btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10), + btagDeepC = Var("bDiscriminator('pfDeepCSVJetTags:probc')",float,doc="DeepCSV charm btag discriminator",precision=10), + btagDeepFlavC = Var("bDiscriminator('pfDeepFlavourJetTags:probc')",float,doc="DeepFlavour charm tag discriminator",precision=10), + ) for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016: modifier.toModify( jetTable.variables, jetId = Var("userInt('tightIdLepVeto')*4+userInt('tightId')*2+userInt('looseId')",int,doc="Jet ID flags bit1 is loose, bit2 is tight, bit3 is tightLepVeto")) run2_jme_2016.toModify( jetTable.variables, puIdDisc = Var("userFloat('pileupJetId:fullDiscriminant')",float,doc="Pilup ID discriminant with 80X (2016) training",precision=10)) @@ -426,12 +435,9 @@ btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10), btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10), btagHbb = Var("bDiscriminator('pfBoostedDoubleSecondaryVertexAK8BJetTags')",float,doc="Higgs to BB tagger discriminator",precision=10), - btagDDBvL_noMD = Var("bDiscriminator('pfDeepDoubleBvLJetTags:probHbb')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->bb vs QCD",precision=10), - btagDDCvL_noMD = Var("bDiscriminator('pfDeepDoubleCvLJetTags:probHcc')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs QCD",precision=10), - btagDDCvB_noMD = Var("bDiscriminator('pfDeepDoubleCvBJetTags:probHcc')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs H(Z)->bb",precision=10), - btagDDBvL = Var("bDiscriminator('pfMassIndependentDeepDoubleBvLJetTags:probHbb')",float,doc="DeepDoubleX (mass-decorrelated) discriminator for H(Z)->bb vs QCD",precision=10), - btagDDCvL = Var("bDiscriminator('pfMassIndependentDeepDoubleCvLJetTags:probHcc')",float,doc="DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs QCD",precision=10), - btagDDCvB = Var("bDiscriminator('pfMassIndependentDeepDoubleCvBJetTags:probHcc')",float,doc="DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs H(Z)->bb",precision=10), + btagDDBvLV2 = Var("bDiscriminator('pfMassIndependentDeepDoubleBvLV2JetTags:probHbb')",float,doc="DeepDoubleX V2(mass-decorrelated) discriminator for H(Z)->bb vs QCD",precision=10), + btagDDCvLV2 = Var("bDiscriminator('pfMassIndependentDeepDoubleCvLV2JetTags:probHcc')",float,doc="DeepDoubleX V2 (mass-decorrelated) discriminator for H(Z)->cc vs QCD",precision=10), + btagDDCvBV2 = Var("bDiscriminator('pfMassIndependentDeepDoubleCvBV2JetTags:probHcc')",float,doc="DeepDoubleX V2 (mass-decorrelated) discriminator for H(Z)->cc vs H(Z)->bb",precision=10), deepTag_TvsQCD = Var("bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:TvsQCD')",float,doc="DeepBoostedJet tagger top vs QCD discriminator",precision=10), deepTag_WvsQCD = Var("bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:WvsQCD')",float,doc="DeepBoostedJet tagger W vs QCD discriminator",precision=10), deepTag_ZvsQCD = Var("bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:ZvsQCD')",float,doc="DeepBoostedJet tagger Z vs QCD discriminator",precision=10), @@ -479,6 +485,15 @@ for modifier in run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1: modifier.toModify( fatJetTable.variables.n2b1, expr = cms.string("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2')"),) modifier.toModify( fatJetTable.variables.n3b1, expr = cms.string("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3')"),) + # Deprecated after 106X + modifier.toModify( fatJetTable.variables, + btagDDBvL_noMD = Var("bDiscriminator('pfDeepDoubleBvLJetTags:probHbb')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->bb vs QCD",precision=10), + btagDDCvL_noMD = Var("bDiscriminator('pfDeepDoubleCvLJetTags:probHcc')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs QCD",precision=10), + btagDDCvB_noMD = Var("bDiscriminator('pfDeepDoubleCvBJetTags:probHcc')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs H(Z)->bb",precision=10), + btagDDBvL = Var("bDiscriminator('pfMassIndependentDeepDoubleBvLJetTags:probHbb')",float,doc="DeepDoubleX (mass-decorrelated) discriminator for H(Z)->bb vs QCD",precision=10), + btagDDCvL = Var("bDiscriminator('pfMassIndependentDeepDoubleCvLJetTags:probHcc')",float,doc="DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs QCD",precision=10), + btagDDCvB = Var("bDiscriminator('pfMassIndependentDeepDoubleCvBJetTags:probHcc')",float,doc="DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs H(Z)->bb",precision=10), + ) run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, msoftdrop_chs = Var("userFloat('ak8PFJetsCHSSoftDropMass')",float, doc="Legacy uncorrected soft drop mass with CHS",precision=10)) run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau1, expr = cms.string("userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau1\')"),) run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau2, expr = cms.string("userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau2\')"),) diff --git a/PhysicsTools/NanoAOD/python/nano_cff.py b/PhysicsTools/NanoAOD/python/nano_cff.py index 94a3eb282791e..f2e0db0baf4b5 100644 --- a/PhysicsTools/NanoAOD/python/nano_cff.py +++ b/PhysicsTools/NanoAOD/python/nano_cff.py @@ -236,7 +236,7 @@ def nanoAOD_activateVID(process): modifier.toModify(process.egmPhotonIDs, physicsObjectSrc = "slimmedPhotonsTo106X") return process -def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addParticleNet, jecPayload): +def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, jecPayload): _btagDiscriminators=[] if addDeepBTag: print("Updating process to run DeepCSV btag to AK8 jets") @@ -249,12 +249,19 @@ def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubl print("Updating process to run ParticleNet before it's included in MiniAOD") from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetJetTagsAll as pfParticleNetJetTagsAll _btagDiscriminators += pfParticleNetJetTagsAll - if addDeepDoubleX: + if addDeepDoubleX: print("Updating process to run DeepDoubleX on datasets before 104X") _btagDiscriminators += ['pfDeepDoubleBvLJetTags:probHbb', \ 'pfDeepDoubleCvLJetTags:probHcc', \ 'pfDeepDoubleCvBJetTags:probHcc', \ 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', 'pfMassIndependentDeepDoubleCvLJetTags:probHcc', 'pfMassIndependentDeepDoubleCvBJetTags:probHcc'] + if addDeepDoubleXV2: + print("Updating process to run DeepDoubleXv2 on datasets before 11X") + _btagDiscriminators += [ + 'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb', + 'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc', + 'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc' + ] if len(_btagDiscriminators)==0: return process print("Will recalculate the following discriminators on AK8 jets: "+", ".join(_btagDiscriminators)) updateJetCollection( @@ -301,6 +308,7 @@ def nanoAOD_customizeCommon(process): nanoAOD_addDeepBTag_switch = cms.untracked.bool(False), nanoAOD_addDeepBoostedJet_switch = cms.untracked.bool(False), nanoAOD_addDeepDoubleX_switch = cms.untracked.bool(False), + nanoAOD_addDeepDoubleXV2_switch = cms.untracked.bool(False), nanoAOD_addParticleNet_switch = cms.untracked.bool(False), jecPayload = cms.untracked.string('AK8PFPuppi') ) @@ -313,17 +321,20 @@ def nanoAOD_customizeCommon(process): nanoAOD_addDeepInfoAK8_switch, nanoAOD_addDeepBoostedJet_switch = True, nanoAOD_addDeepDoubleX_switch = True, + nanoAOD_addDeepDoubleXV2_switch = True, nanoAOD_addParticleNet_switch = True, ) - # for 106Xv1: only needs to run ParticleNet; DeepAK8, DeepDoubleX are already in MiniAOD + # for 106Xv1: only needs to run ParticleNet and DDXV2; DeepAK8, DeepDoubleX are already in MiniAOD run2_nanoAOD_106Xv1.toModify( nanoAOD_addDeepInfoAK8_switch, + nanoAOD_addDeepDoubleXV2_switch = True, nanoAOD_addParticleNet_switch = True, ) process = nanoAOD_addDeepInfoAK8(process, addDeepBTag=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBTag_switch, addDeepBoostedJet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBoostedJet_switch, addDeepDoubleX=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleX_switch, + addDeepDoubleXV2=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleXV2_switch, addParticleNet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNet_switch, jecPayload=nanoAOD_addDeepInfoAK8_switch.jecPayload) (run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toModify(process, lambda p : nanoAOD_addTauIds(p)) diff --git a/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py b/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py index 2b915b933642e..32ed4462d5780 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applyDeepBtagging_cff.py @@ -50,18 +50,12 @@ def applyDeepBtagging( process, postfix="" ) : # make clone for DeepTags-less slimmed AK8 jets, so output name is preserved addToProcessAndTask('slimmedJetsAK8NoDeepTags', process.slimmedJetsAK8.clone(), process, task) _btagDiscriminators = cms.PSet( names = cms.vstring( - 'pfDeepDoubleBvLJetTags:probQCD', - 'pfDeepDoubleBvLJetTags:probHbb', - 'pfDeepDoubleCvLJetTags:probQCD', - 'pfDeepDoubleCvLJetTags:probHcc', - 'pfDeepDoubleCvBJetTags:probHbb', - 'pfDeepDoubleCvBJetTags:probHcc', - 'pfMassIndependentDeepDoubleBvLJetTags:probQCD', - 'pfMassIndependentDeepDoubleBvLJetTags:probHbb', - 'pfMassIndependentDeepDoubleCvLJetTags:probQCD', - 'pfMassIndependentDeepDoubleCvLJetTags:probHcc', - 'pfMassIndependentDeepDoubleCvBJetTags:probHbb', - 'pfMassIndependentDeepDoubleCvBJetTags:probHcc', + 'pfMassIndependentDeepDoubleBvLV2JetTags:probQCD', + 'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb', + 'pfMassIndependentDeepDoubleCvLV2JetTags:probQCD', + 'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc', + 'pfMassIndependentDeepDoubleCvBV2JetTags:probHbb', + 'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc', ) + pfDeepBoostedJetTagsAll + pfParticleNetJetTagsAll + pfHiggsInteractionNetTagsProbs ) updateJetCollection( From 61df60f895814facc634bc83e8b3d7bcb97788d2 Mon Sep 17 00:00:00 2001 From: ddesouza Date: Wed, 30 Sep 2020 23:35:43 +0200 Subject: [PATCH 160/778] Move HFFilterResults to hiHFFilterResults --- .../HiCentralityAlgos/plugins/HiHFFilterProducer.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc index 0e368c7df3505..714fb3dfbc618 100644 --- a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc +++ b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc @@ -53,7 +53,7 @@ void HiHFFilterProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet unsigned short int nTowersTh5HFplus = 0; unsigned short int nTowersTh5HFminus = 0; - auto HFFilterResults = std::make_unique(); + auto hiHFFilterResults = std::make_unique(); for (const auto& tower : towers) { const auto et = tower.et(); const auto energy = tower.energy(); @@ -83,12 +83,12 @@ void HiHFFilterProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet } } - HFFilterResults->numMinHFTowers2 = std::min(nTowersTh2HFplus, nTowersTh2HFminus); - HFFilterResults->numMinHFTowers3 = std::min(nTowersTh3HFplus, nTowersTh3HFminus); - HFFilterResults->numMinHFTowers4 = std::min(nTowersTh4HFplus, nTowersTh4HFminus); - HFFilterResults->numMinHFTowers5 = std::min(nTowersTh5HFplus, nTowersTh5HFminus); + hiHFFilterResults->numMinHFTowers2 = std::min(nTowersTh2HFplus, nTowersTh2HFminus); + hiHFFilterResults->numMinHFTowers3 = std::min(nTowersTh3HFplus, nTowersTh3HFminus); + hiHFFilterResults->numMinHFTowers4 = std::min(nTowersTh4HFplus, nTowersTh4HFminus); + hiHFFilterResults->numMinHFTowers5 = std::min(nTowersTh5HFplus, nTowersTh5HFminus); - iEvent.put(std::move(HFFilterResults), "hiHFfilters"); + iEvent.put(std::move(hiHFFilterResults), "hiHFfilters"); } void HiHFFilterProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { From 2037e05d590a623f1024c5228ca9fbcff0de7ab9 Mon Sep 17 00:00:00 2001 From: Chris West Date: Thu, 1 Oct 2020 00:49:17 +0200 Subject: [PATCH 161/778] Update PPS tags in Run 2 offline GTs --- Configuration/AlCa/python/autoCond.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Configuration/AlCa/python/autoCond.py b/Configuration/AlCa/python/autoCond.py index bb3c08b7c0b96..7d71cc080d8f5 100644 --- a/Configuration/AlCa/python/autoCond.py +++ b/Configuration/AlCa/python/autoCond.py @@ -26,13 +26,13 @@ # GlobalTag for MC production (p-Pb collisions) with realistic alignment and calibrations for Run2 'run2_mc_pa' : '110X_mcRun2_pA_v3', # GlobalTag for Run1 data reprocessing - 'run1_data' : '112X_dataRun2_v3', + 'run1_data' : '112X_dataRun2_v4', # GlobalTag for Run2 data reprocessing - 'run2_data' : '112X_dataRun2_v3', + 'run2_data' : '112X_dataRun2_v4', # GlobalTag for Run2 data 2018B relvals only: HEM-15-16 fail - 'run2_data_HEfail' : '112X_dataRun2_HEfail_v3', + 'run2_data_HEfail' : '112X_dataRun2_HEfail_v4', # GlobalTag for Run2 data relvals: allows customization to run with fixed L1 menu - 'run2_data_relval' : '112X_dataRun2_relval_v3', + 'run2_data_relval' : '112X_dataRun2_relval_v4', # GlobalTag for Run2 HI data 'run2_data_promptlike_hi' : '110X_dataRun2_PromptLike_HI_v10', # GlobalTag for Run1 HLT: it points to the online GT From 1139a609b53223fbd9398ba98f865f2dabd30f5c Mon Sep 17 00:00:00 2001 From: Jan Kaspar Date: Wed, 23 Sep 2020 12:31:07 +0200 Subject: [PATCH 162/778] Added 2D histogram beta* vs xangle and fillDescriptions. --- .../CTPPS/plugins/CTPPSLHCInfoPlotter.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc b/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc index 977b47235c240..79b015451081c 100644 --- a/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc +++ b/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc @@ -16,6 +16,7 @@ #include "TFile.h" #include "TH1D.h" +#include "TH2D.h" //---------------------------------------------------------------------------------------------------- @@ -23,6 +24,8 @@ class CTPPSLHCInfoPlotter : public edm::one::EDAnalyzer<> { public: explicit CTPPSLHCInfoPlotter(const edm::ParameterSet &); + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + private: void analyze(const edm::Event &, const edm::EventSetup &) override; void endJob() override; @@ -34,6 +37,7 @@ class CTPPSLHCInfoPlotter : public edm::one::EDAnalyzer<> { TH1D *h_beamEnergy_; TH1D *h_xangle_; TH1D *h_betaStar_; + TH2D *h2_betaStar_vs_xangle_; TH1D *h_fill_; TH1D *h_run_; @@ -53,12 +57,24 @@ CTPPSLHCInfoPlotter::CTPPSLHCInfoPlotter(const edm::ParameterSet &iConfig) h_beamEnergy_(new TH1D("h_beamEnergy", ";beam energy (GeV)", 81, -50., 8050.)), h_xangle_(new TH1D("h_xangle", ";(half) crossing angle (#murad)", 201, -0.5, 200.5)), h_betaStar_(new TH1D("h_betaStar", ";#beta^{*} (m)", 101, -0.005, 1.005)), + h2_betaStar_vs_xangle_(new TH2D("h2_betaStar_vs_xangle", ";(half) crossing angle (#murad);#beta^{*} (m)", 201, -0.5, 200.5, 101, -0.005, 1.005)), h_fill_(new TH1D("h_fill", ";fill", 4001, 3999.5, 8000.5)), h_run_(new TH1D("h_run", ";run", 6000, 270E3, 330E3)) {} //---------------------------------------------------------------------------------------------------- +void CTPPSLHCInfoPlotter::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + + desc.add("lhcInfoLabel", "")->setComment("label of the LHCInfo record"); + desc.add("outputFile", "")->setComment("output file"); + + descriptions.add("ctppsLHCInfoPlotter", desc); +} + +//---------------------------------------------------------------------------------------------------- + void CTPPSLHCInfoPlotter::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) { edm::ESHandle hLHCInfo; iSetup.get().get(lhcInfoLabel_, hLHCInfo); @@ -66,6 +82,7 @@ void CTPPSLHCInfoPlotter::analyze(const edm::Event &iEvent, const edm::EventSetu h_beamEnergy_->Fill(hLHCInfo->energy()); h_xangle_->Fill(hLHCInfo->crossingAngle()); h_betaStar_->Fill(hLHCInfo->betaStar()); + h2_betaStar_vs_xangle_->Fill(hLHCInfo->crossingAngle(), hLHCInfo->betaStar()); h_fill_->Fill(hLHCInfo->fillNumber()); h_run_->Fill(iEvent.id().run()); @@ -79,6 +96,7 @@ void CTPPSLHCInfoPlotter::endJob() { h_beamEnergy_->Write(); h_xangle_->Write(); h_betaStar_->Write(); + h2_betaStar_vs_xangle_->Write(); h_fill_->Write(); h_run_->Write(); From 372df7419cabb13385087c27602c81c9f40fc415 Mon Sep 17 00:00:00 2001 From: Christopher Date: Fri, 25 Sep 2020 13:37:02 +0200 Subject: [PATCH 163/778] xangle/beta* distribution update --- .../CTPPSLHCInfoRandomXangleESSource.cc | 69 ++++++++++--------- .../CTPPS/python/simu_config/base_cff.py | 7 +- .../simu_config/year_2016_postTS2_cff.py | 6 +- .../simu_config/year_2016_preTS2_cff.py | 6 +- .../simu_config/year_2017_postTS2_cff.py | 6 +- .../simu_config/year_2017_preTS2_cff.py | 6 +- .../simu_config/year_2018_TS1_TS2_cff.py | 6 +- .../simu_config/year_2018_postTS2_cff.py | 6 +- .../simu_config/year_2018_preTS1_cff.py | 6 +- Validation/CTPPS/test/simu/template_cfg.py | 2 +- 10 files changed, 62 insertions(+), 58 deletions(-) diff --git a/CalibPPS/ESProducers/plugins/CTPPSLHCInfoRandomXangleESSource.cc b/CalibPPS/ESProducers/plugins/CTPPSLHCInfoRandomXangleESSource.cc index 59c9cb4c8cc43..b6c26c50370e0 100644 --- a/CalibPPS/ESProducers/plugins/CTPPSLHCInfoRandomXangleESSource.cc +++ b/CalibPPS/ESProducers/plugins/CTPPSLHCInfoRandomXangleESSource.cc @@ -16,7 +16,7 @@ #include "CLHEP/Random/JamesRandom.h" #include "TFile.h" -#include "TH1D.h" +#include "TH2D.h" //---------------------------------------------------------------------------------------------------- @@ -43,11 +43,13 @@ class CTPPSLHCInfoRandomXangleESSource : public edm::ESProducer, public edm::Eve std::unique_ptr m_engine; + template struct BinData { - double min, max, xangle; + double min, max; + T profile; }; - std::vector binData; + std::vector>> xangleBetaStarBins; }; //---------------------------------------------------------------------------------------------------- @@ -59,35 +61,38 @@ CTPPSLHCInfoRandomXangleESSource::CTPPSLHCInfoRandomXangleESSource(const edm::Pa m_generateEveryNEvents(conf.getParameter("generateEveryNEvents")), m_beamEnergy(conf.getParameter("beamEnergy")), - m_betaStar(conf.getParameter("betaStar")), m_engine(new CLHEP::HepJamesRandom(conf.getParameter("seed"))) { - const auto &xangleHistogramFile = conf.getParameter("xangleHistogramFile"); - const auto &xangleHistogramObject = conf.getParameter("xangleHistogramObject"); + const auto &xangleBetaStarHistogramFile = conf.getParameter("xangleBetaStarHistogramFile"); + const auto &xangleBetaStarHistogramObject = conf.getParameter("xangleBetaStarHistogramObject"); - TFile *f_in = TFile::Open(xangleHistogramFile.c_str()); + TFile *f_in = TFile::Open(xangleBetaStarHistogramFile.c_str()); if (!f_in) - throw cms::Exception("PPS") << "Cannot open input file '" << xangleHistogramFile << "'."; + throw cms::Exception("PPS") << "Cannot open input file '" << xangleBetaStarHistogramFile << "'."; - TH1D *h_xangle = (TH1D *)f_in->Get(xangleHistogramObject.c_str()); - if (!h_xangle) - throw cms::Exception("PPS") << "Cannot load input object '" << xangleHistogramObject << "'."; - - double s = 0.; - for (int bi = 1; bi <= h_xangle->GetNbinsX(); ++bi) - s += h_xangle->GetBinContent(bi); - - double cw = 0.; - for (int bi = 1; bi <= h_xangle->GetNbinsX(); ++bi) { - double xangle = h_xangle->GetBinCenter(bi); - double w = h_xangle->GetBinContent(bi) / s; - - binData.push_back({cw, cw + w, xangle}); + TH2D *h_xangle_beta_star = (TH2D *)f_in->Get(xangleBetaStarHistogramObject.c_str()); + if (!h_xangle_beta_star) + throw cms::Exception("PPS") << "Cannot load input object '" << xangleBetaStarHistogramObject << "'."; + h_xangle_beta_star->SetDirectory(0); + delete f_in; - cw += w; + double sum = 0.; + for (int bi = 1; bi <= h_xangle_beta_star->GetNcells(); ++bi){ + double val=h_xangle_beta_star->GetBinContent(bi); + sum+=val; } - delete f_in; + double cw=0; + for (int x = 1; x <= h_xangle_beta_star->GetNbinsX(); ++x) + for (int y = 1; y <= h_xangle_beta_star->GetNbinsY(); ++y) { + double sample=h_xangle_beta_star->GetBinContent(h_xangle_beta_star->GetBin(x,y)); + if(sample>=1){ + sample/=sum; + xangleBetaStarBins.push_back({cw,cw+sample,std::pair(h_xangle_beta_star->GetXaxis()->GetBinCenter(x),h_xangle_beta_star->GetYaxis()->GetBinCenter(y))}); + cw+=sample; + } + } + delete h_xangle_beta_star; setWhatProduced(this, m_label); findingRecord(); @@ -104,11 +109,10 @@ void CTPPSLHCInfoRandomXangleESSource::fillDescriptions(edm::ConfigurationDescri desc.add("generateEveryNEvents", 1)->setComment("how often to generate new xangle"); - desc.add("xangleHistogramFile", "")->setComment("ROOT file with xangle distribution"); - desc.add("xangleHistogramObject", "")->setComment("xangle distribution object in the ROOT file"); + desc.add("xangleBetaStarHistogramFile", "")->setComment("ROOT file with xangle distribution"); + desc.add("xangleBetaStarHistogramObject", "")->setComment("xangle distribution object in the ROOT file"); desc.add("beamEnergy", 0.)->setComment("beam energy"); - desc.add("betaStar", 0.)->setComment("beta*"); descriptions.add("ctppsLHCInfoRandomXangleESSource", desc); } @@ -128,19 +132,20 @@ void CTPPSLHCInfoRandomXangleESSource::setIntervalFor(const edm::eventsetup::Eve edm::ESProducts> CTPPSLHCInfoRandomXangleESSource::produce(const LHCInfoRcd &) { auto output = std::make_unique(); + double xangle=0, beta = 0.; const double u = CLHEP::RandFlat::shoot(m_engine.get(), 0., 1.); - - double xangle = 0.; - for (const auto &d : binData) { + for (const auto &d : xangleBetaStarBins) { if (d.min <= u && u <= d.max) { - xangle = d.xangle; + xangle = d.profile.first; + beta=d.profile.second; break; } } output->setEnergy(m_beamEnergy); output->setCrossingAngle(xangle); - output->setBetaStar(m_betaStar); + output->setBetaStar(beta); + return edm::es::products(std::move(output)); } diff --git a/Validation/CTPPS/python/simu_config/base_cff.py b/Validation/CTPPS/python/simu_config/base_cff.py index d20b1844c1006..ab4dc4af6b955 100644 --- a/Validation/CTPPS/python/simu_config/base_cff.py +++ b/Validation/CTPPS/python/simu_config/base_cff.py @@ -173,13 +173,12 @@ def UseCrossingAngle(xangle, process): process.ctppsBeamParametersESSource.halfXangleX45 = xangle * 1E-6 process.ctppsBeamParametersESSource.halfXangleX56 = xangle * 1E-6 -def UseCrossingAngleHistgoram(process, f, obj): +def UseXangleBetaStarHistogram(process, f, obj): process.load("CalibPPS.ESProducers.ctppsLHCInfoRandomXangleESSource_cfi") process.ctppsLHCInfoRandomXangleESSource.generateEveryNEvents = 1 - process.ctppsLHCInfoRandomXangleESSource.xangleHistogramFile = f - process.ctppsLHCInfoRandomXangleESSource.xangleHistogramObject = obj + process.ctppsLHCInfoRandomXangleESSource.xangleBetaStarHistogramFile = f + process.ctppsLHCInfoRandomXangleESSource.xangleBetaStarHistogramObject = obj process.ctppsLHCInfoRandomXangleESSource.beamEnergy = ctppsLHCInfoESSource.beamEnergy - process.ctppsLHCInfoRandomXangleESSource.betaStar = ctppsLHCInfoESSource.betaStar del process.ctppsLHCInfoESSource diff --git a/Validation/CTPPS/python/simu_config/year_2016_postTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2016_postTS2_cff.py index daae884a8f203..209fa62da9321 100644 --- a/Validation/CTPPS/python/simu_config/year_2016_postTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2016_postTS2_cff.py @@ -43,6 +43,6 @@ def SetDefaults(process): UseCrossingAngle(140, process) -# xangle distribution -def UseCrossingAngleDistribution(process, f): - UseCrossingAngleHistgoram(process, f, "h_xangle_2016_postTS2") +# xangle/beta* distribution +def UseXangleBetaStarDistribution(process, f): + UseXangleBetaStarHistogram(process, f, "/2016_postTS2/h2_betaStar_vs_xangle") diff --git a/Validation/CTPPS/python/simu_config/year_2016_preTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2016_preTS2_cff.py index 4fb4a033c10d7..e05d8f78cff18 100644 --- a/Validation/CTPPS/python/simu_config/year_2016_preTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2016_preTS2_cff.py @@ -43,6 +43,6 @@ def SetDefaults(process): UseCrossingAngle(185, process) -# xangle distribution -def UseCrossingAngleDistribution(process, f): - UseCrossingAngleHistgoram(process, f, "h_xangle_2016_preTS2") +# xangle/beta* distribution +def UseXangleBetaStarDistribution(process, f): + UseXangleBetaStarHistogram(process, f, "/2016_preTS2/h2_betaStar_vs_xangle") diff --git a/Validation/CTPPS/python/simu_config/year_2017_postTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2017_postTS2_cff.py index 86a3016a90583..c16548640bc56 100644 --- a/Validation/CTPPS/python/simu_config/year_2017_postTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2017_postTS2_cff.py @@ -18,6 +18,6 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "2 * 0.130" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "2 * 0.130" -# xangle distribution -def UseCrossingAngleDistribution(process, f): - UseCrossingAngleHistgoram(process, f, "h_xangle_2017_postTS2") +# xangle/beta* distribution +def UseXangleBetaStarDistribution(process, f): + UseXangleBetaStarHistogram(process, f, "/2017_postTS2/h2_betaStar_vs_xangle") diff --git a/Validation/CTPPS/python/simu_config/year_2017_preTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2017_preTS2_cff.py index 9d52fb2e133b1..1195aa9c6b216 100644 --- a/Validation/CTPPS/python/simu_config/year_2017_preTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2017_preTS2_cff.py @@ -18,6 +18,6 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "2 * (0.0025*(x-3) + 0.080)" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "2 * (0.0050*(x-3) + 0.060)" -# xangle distribution -def UseCrossingAngleDistribution(process, f): - UseCrossingAngleHistgoram(process, f, "h_xangle_2017_preTS2") +# xangle/beta* distribution +def UseXangleBetaStarDistribution(process, f): + UseXangleBetaStarHistogram(process, f, "/2017_preTS2/h2_betaStar_vs_xangle") diff --git a/Validation/CTPPS/python/simu_config/year_2018_TS1_TS2_cff.py b/Validation/CTPPS/python/simu_config/year_2018_TS1_TS2_cff.py index 667559121112b..10f421da6d62b 100644 --- a/Validation/CTPPS/python/simu_config/year_2018_TS1_TS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2018_TS1_TS2_cff.py @@ -12,6 +12,6 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "2 * ( (x<10)*(-0.0086*(x-10) + 0.100) + (x>=10)*(0.100) )" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "2 * ( (x<8) *(-0.0100*(x-8) + 0.100) + (x>=8) *(-0.0027*(x-8) + 0.100) )" -# xangle distribution -def UseCrossingAngleDistribution(process, f): - UseCrossingAngleHistgoram(process, f, "h_xangle_2018_TS1_TS2") +# xangle/beta* distribution +def UseXangleBetaStarDistribution(process, f): + UseXangleBetaStarHistogram(process, f, "/2018_TS1_TS2/h2_betaStar_vs_xangle") diff --git a/Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py index 1c3efea36189c..764aa5f7a76f0 100644 --- a/Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py @@ -12,6 +12,6 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "2 * (-0.0031 * (x - 3) + 0.16)" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "2 * ( (x<10)*(-0.0057*(x-10) + 0.110) + (x>=10)*(-0.0022*(x-10) + 0.110) )" -# xangle distribution -def UseCrossingAngleDistribution(process, f): - UseCrossingAngleHistgoram(process, f, "h_xangle_2018_postTS2") +# xangle/beta* distribution +def UseXangleBetaStarDistribution(process, f): + UseXangleBetaStarHistogram(process, f, "/2018_postTS2/h2_betaStar_vs_xangle") diff --git a/Validation/CTPPS/python/simu_config/year_2018_preTS1_cff.py b/Validation/CTPPS/python/simu_config/year_2018_preTS1_cff.py index 43fe1f51a7979..06e40f36ca8dd 100644 --- a/Validation/CTPPS/python/simu_config/year_2018_preTS1_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2018_preTS1_cff.py @@ -13,6 +13,6 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "999" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "999" -# xangle distribution -def UseCrossingAngleDistribution(process, f): - UseCrossingAngleHistgoram(process, f, "h_xangle_2018_preTS1") +# xangle/beta* distribution +def UseXangleBetaStarDistribution(process, f): + UseXangleBetaStarHistogram(process, f, "/2018_preTS1/h2_betaStar_vs_xangle") diff --git a/Validation/CTPPS/test/simu/template_cfg.py b/Validation/CTPPS/test/simu/template_cfg.py index 4f23d3bbf486e..cdac30623928d 100644 --- a/Validation/CTPPS/test/simu/template_cfg.py +++ b/Validation/CTPPS/test/simu/template_cfg.py @@ -6,7 +6,7 @@ # load config import Validation.CTPPS.simu_config.year_$CONFIG_cff as config process.load("Validation.CTPPS.simu_config.year_$CONFIG_cff") -config.SetDefaults(process) +config.UseXangleBetaStarDistribution(process,"../../../../CalibPPS/ESProducers/data/xangle_beta_distributions/version1.root") # minimal logger settings process.MessageLogger = cms.Service("MessageLogger", From 5de66efa59dc6077e9be3a84d9ce3c662a326557 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 1 Oct 2020 10:49:14 +0200 Subject: [PATCH 164/778] Ianna s comment on conversions --- Geometry/TrackerNumberingBuilder/src/GeometricDet.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 3898f121227c6..dbb11668dca31 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -1,12 +1,10 @@ +#include "DataFormats/Math/interface/GeantUnits.h" #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" #include "Geometry/TrackerNumberingBuilder/interface/TrackerShapeToBounds.h" #include "DetectorDescription/Core/interface/DDFilteredView.h" #include "DetectorDescription/DDCMS/interface/DDFilteredView.h" #include "CondFormats/GeometryObjects/interface/PGeometricDet.h" -#include "CLHEP/Units/GlobalSystemOfUnits.h" -#include "DataFormats/Math/interface/GeantUnits.h" - #include #include @@ -202,7 +200,10 @@ std::unique_ptr GeometricDet::bounds() const { } GeometricDet::Position GeometricDet::positionBounds() const { - Position pos_(float(trans_.x() / cm), float(trans_.y() / cm), float(trans_.z() / cm)); + Position pos_(static_cast(geant_units::operators::convertMmToCm(trans_.x())), + static_cast(geant_units::operators::convertMmToCm(trans_.y())), + static_cast(geant_units::operators::convertMmToCm(trans_.z())) + ); return pos_; } From e142aea52ddfe4f240008385341a5e96198e5f55 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 1 Oct 2020 11:28:10 +0200 Subject: [PATCH 165/778] Keep debug printouts for debug==true only. --- .../plugins/CmsTrackerLevelBuilder.cc | 34 ++++++++++++++----- .../src/GeometricDet.cc | 4 +-- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index 8ef4c08d6d371..25768698ab098 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -7,6 +7,8 @@ #include +#define DEBUG false + bool CmsTrackerLevelBuilderHelper::subDetByType(const GeometricDet* a, const GeometricDet* b) { // it relies on the fact that the GeometricDet::GDEnumType enumerators used // to identify the subdetectors in the upgrade geometries are equal to the @@ -144,21 +146,27 @@ template <> void CmsTrackerLevelBuilder::build(DDFilteredView& fv, GeometricDet* tracker, const std::string& attribute) { - edm::LogVerbatim("CmsTrackerLevelBuilder") + if (DEBUG) { + edm::LogVerbatim("CmsTrackerLevelBuilder") << "CmsTrackerLevelBuilder::build called on volume" << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() << " tracker->type() = " << tracker->type(); + } // Go down one level in hierarchy bool doLayers = fv.firstChild(); while (doLayers) { - edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, before"; + if (DEBUG) { + edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, before"; + } // Call build on sibling buildComponent(fv, tracker, attribute); - edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, after"; + if (DEBUG) { + edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, after"; + } // Go to next sibling doLayers = fv.nextSibling(); @@ -170,8 +178,10 @@ void CmsTrackerLevelBuilder::build(DDFilteredView& fv, // Now that all GeometricDets of a given hierarchy level are built, sort them! sortNS(fv, tracker); - edm::LogVerbatim("CmsTrackerLevelBuilder") + if (DEBUG) { + edm::LogVerbatim("CmsTrackerLevelBuilder") << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; + } } /* @@ -181,10 +191,12 @@ template <> void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, GeometricDet* tracker, const std::string& attribute) { - edm::LogVerbatim("CmsTrackerLevelBuilder") + if (DEBUG) { + edm::LogVerbatim("CmsTrackerLevelBuilder") << "CmsTrackerLevelBuilder::build called on volume" << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() << " tracker->type() = " << tracker->type(); + } // Go down one level in hierarchy fv.firstChild(); @@ -195,25 +207,31 @@ void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, // Treat all siblings of a given hierarchy level while (fv.level() == level) { - edm::LogVerbatim("CmsTrackerLevelBuilder") + if (DEBUG) { + edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, before." << " level = " << level << " type = " << type << " fv.level() = " << fv.level() << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + } // Call build on sibling buildComponent(fv, tracker, attribute); - edm::LogVerbatim("CmsTrackerLevelBuilder") + if (DEBUG) { + edm::LogVerbatim("CmsTrackerLevelBuilder") << "Calling buildComponent, after." << " level = " << level << " type = " << type << " fv.level() = " << fv.level() << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + } } // Now that all GeometricDets of a given hierarchy level are built, sort them! sortNS(fv, tracker); - edm::LogVerbatim("CmsTrackerLevelBuilder") + if (DEBUG) { + edm::LogVerbatim("CmsTrackerLevelBuilder") << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; + } } template class CmsTrackerLevelBuilder; diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index dbb11668dca31..05c1df39478b7 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -105,8 +105,8 @@ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) rot_(fv->rotation()), shape_(fv->shape()), params_(computeLegacyShapeParameters(shape_, fv->solid())), - radLength_(fv->get("TrackerRadLength")), // To be studied - xi_(fv->get("TrackerXi")), // To be studied + radLength_(fv->get("TrackerRadLength")), // NOT OK: XMLs SpecPar handling by DD4hep FilteredView needs modification + xi_(fv->get("TrackerXi")), // NOT OK: XMLs SpecPar handling by DD4hep FilteredView needs modification pixROCRows_(fv->get("PixelROCRows")), pixROCCols_(fv->get("PixelROCCols")), pixROCx_(fv->get("PixelROC_X")), From 260e0316b64a0749481056ca90791065115a6ace Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 1 Oct 2020 11:30:36 +0200 Subject: [PATCH 166/778] scram b code-format --- .../interface/GeometricDet.h | 30 ++-- .../plugins/CmsTrackerDetIdBuilder.cc | 2 +- .../plugins/CmsTrackerLevelBuilder.cc | 28 ++-- .../src/GeometricDet.cc | 135 +++++++++--------- 4 files changed, 97 insertions(+), 98 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index ffca1cdc97f44..2a1630332ccd4 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -88,26 +88,26 @@ class GeometricDet { // ACCESS GENERAL INFO const std::string& name() const { return ddname_; } - const GeometricEnumType& type() const { return type_; } - + const GeometricEnumType& type() const { return type_; } + // NAVIGATION related info const nav_type& navType() const { return ddd_; } NavRange navpos() const { return NavRange(&ddd_.front(), ddd_.size()); } const DetId& geographicalId() const { return geographicalID_; } void setGeographicalID(DetId id) { geographicalID_ = id; } - + // VOLUME POSITION in CMS frame of reference const Translation& translation() const { return trans_; } double rho() const { return rho_; } double phi() const { return phi_; } const RotationMatrix& rotation() const { return rot_; } - + // BOUNDS std::unique_ptr bounds() const; - Position positionBounds() const; // in cm + Position positionBounds() const; // in cm Rotation rotationBounds() const; - // SOLID SHAPE + // SOLID SHAPE // old DD LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } // DD4hep @@ -117,7 +117,7 @@ class GeometricDet { if (shape_ != cms::DDSolidShape::ddbox && shape_ != cms::DDSolidShape::ddtrap && shape_ != cms::DDSolidShape::ddtubs) { edm::LogError("GeometricDet::params()") - << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; + << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; } return params_; } @@ -125,7 +125,7 @@ class GeometricDet { // RADIATION LENGTH AND ENERGY LOSS double radLength() const { return radLength_; } double xi() const { return xi_; } - + // SENSOR INFO // Only return meaningful results for pixels. double pixROCRows() const { return pixROCRows_; } @@ -137,7 +137,7 @@ class GeometricDet { bool isLowerSensor() const { return isLowerSensor_; } bool isUpperSensor() const { return isUpperSensor_; } double siliconAPVNum() const { return siliconAPVNum_; } - + // CHILDREN INFO GeometricDet* component(size_t index) { return const_cast(container_[index]); } bool isLeaf() const { return container_.empty(); } @@ -145,7 +145,7 @@ class GeometricDet { // if the current GeometricDet is a leaf, it returns nothing. ConstGeometricDetContainer& components() { return container_; } const ConstGeometricDetContainer& components() const { return container_; } - // all descendants + // all descendants // if the current GeometricDet is a leaf, it returns itself! ConstGeometricDetContainer deepComponents() const; void deepComponents(ConstGeometricDetContainer& cont) const; @@ -154,8 +154,8 @@ class GeometricDet { void addComponents(GeometricDetContainer const& cont); void addComponents(ConstGeometricDetContainer const& cont); void addComponent(GeometricDet*); - void clearComponents() { container_.clear(); } // only empties the container, THE CHILDREN ARE NOT DELETED! - void deleteComponents(); // EXPLICITLY DELETES THE CHILDREN + void clearComponents() { container_.clear(); } // only empties the container, THE CHILDREN ARE NOT DELETED! + void deleteComponents(); // EXPLICITLY DELETES THE CHILDREN // CUSTOM DESTRUCTOR ~GeometricDet(); @@ -163,13 +163,13 @@ class GeometricDet { private: std::vector computeLegacyShapeParameters(const cms::DDSolidShape& mySolidShape, const dd4hep::Solid& mySolid) const; - + std::string ddname_; GeometricEnumType type_; nav_type ddd_; DetId geographicalID_; - + Translation trans_; double rho_; double phi_; @@ -177,7 +177,7 @@ class GeometricDet { cms::DDSolidShape shape_; std::vector params_; - + double radLength_; double xi_; double pixROCRows_; diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc index 1ac08ab8b29dd..be068496bc8ce 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc @@ -30,7 +30,7 @@ void CmsTrackerDetIdBuilder::buildId(GeometricDet& tracker) { iterate(tracker, 0, tracker.geographicalId().rawId()); std::ofstream outfile("DetIdOLD.log", std::ios::out); -//std::ofstream outfile("DetIdDD4hep.log", std::ios::out); + //std::ofstream outfile("DetIdDD4hep.log", std::ios::out); std::deque queue; queue.emplace_back(&tracker); diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index 25768698ab098..609eb69b24d50 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -148,9 +148,9 @@ void CmsTrackerLevelBuilder::build(DDFilteredView& fv, const std::string& attribute) { if (DEBUG) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "CmsTrackerLevelBuilder::build called on volume" - << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type(); + << "CmsTrackerLevelBuilder::build called on volume" + << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); } // Go down one level in hierarchy @@ -180,7 +180,7 @@ void CmsTrackerLevelBuilder::build(DDFilteredView& fv, if (DEBUG) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; + << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; } } @@ -193,9 +193,9 @@ void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, const std::string& attribute) { if (DEBUG) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "CmsTrackerLevelBuilder::build called on volume" - << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() - << " tracker->type() = " << tracker->type(); + << "CmsTrackerLevelBuilder::build called on volume" + << " tracker->name() = " << tracker->name() << " tracker->path() = " << fv.geoHistory() + << " tracker->type() = " << tracker->type(); } // Go down one level in hierarchy @@ -209,9 +209,9 @@ void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, while (fv.level() == level) { if (DEBUG) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "Calling buildComponent, before." - << " level = " << level << " type = " << type << " fv.level() = " << fv.level() - << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + << "Calling buildComponent, before." + << " level = " << level << " type = " << type << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); } // Call build on sibling @@ -219,9 +219,9 @@ void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, if (DEBUG) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "Calling buildComponent, after." - << " level = " << level << " type = " << type << " fv.level() = " << fv.level() - << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); + << "Calling buildComponent, after." + << " level = " << level << " type = " << type << " fv.level() = " << fv.level() + << " fv.type() = " << ExtractStringFromDDD::getString(attribute, &fv); } } @@ -230,7 +230,7 @@ void CmsTrackerLevelBuilder::build(cms::DDFilteredView& fv, if (DEBUG) { edm::LogVerbatim("CmsTrackerLevelBuilder") - << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; + << "CmsTrackerLevelBuilder::build: Exit, finished all buildComponents calls."; } } diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 05c1df39478b7..122e9beea7fca 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -67,27 +67,27 @@ GeometricDet::~GeometricDet() { deleteComponents(); } Constructor from old DD Filtered view. */ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) - : ddname_(fv->name()), - type_(type), - ddd_(), - trans_(fv->translation()), - rho_(trans_.Rho()), - phi_(trans_.Phi()), - rot_(fv->rotation()), - shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, fv->shape())), - params_(fv->parameters()), - radLength_(getDouble("TrackerRadLength", *fv)), - xi_(getDouble("TrackerXi", *fv)), - pixROCRows_(getDouble("PixelROCRows", *fv)), - pixROCCols_(getDouble("PixelROCCols", *fv)), - pixROCx_(getDouble("PixelROC_X", *fv)), - pixROCy_(getDouble("PixelROC_Y", *fv)), - stereo_(getString("TrackerStereoDetectors", *fv) == strue), - isLowerSensor_(getString("TrackerLowerDetectors", *fv) == strue), - isUpperSensor_(getString("TrackerUpperDetectors", *fv) == strue), - siliconAPVNum_(getDouble("SiliconAPVNumber", *fv)), - isFromDD4hep_(false) { - // workaround instead of this at initialization + : ddname_(fv->name()), + type_(type), + ddd_(), + trans_(fv->translation()), + rho_(trans_.Rho()), + phi_(trans_.Phi()), + rot_(fv->rotation()), + shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, fv->shape())), + params_(fv->parameters()), + radLength_(getDouble("TrackerRadLength", *fv)), + xi_(getDouble("TrackerXi", *fv)), + pixROCRows_(getDouble("PixelROCRows", *fv)), + pixROCCols_(getDouble("PixelROCCols", *fv)), + pixROCx_(getDouble("PixelROC_X", *fv)), + pixROCy_(getDouble("PixelROC_Y", *fv)), + stereo_(getString("TrackerStereoDetectors", *fv) == strue), + isLowerSensor_(getString("TrackerLowerDetectors", *fv) == strue), + isUpperSensor_(getString("TrackerUpperDetectors", *fv) == strue), + siliconAPVNum_(getDouble("SiliconAPVNumber", *fv)), + isFromDD4hep_(false) { + // workaround instead of this at initialization const DDFilteredView::nav_type& nt = fv->navPos(); ddd_ = nav_type(nt.begin(), nt.end()); } @@ -96,49 +96,50 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) Constructor from DD4HEP Filtered view. */ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) - : ddname_(dd4hep::dd::noNamespace(fv->name())), - type_(type), - ddd_(fv->navPos()), // To be studied - trans_(geant_units::operators::convertCmToMm(fv->translation())), - rho_(trans_.Rho()), - phi_(trans_.Phi()), - rot_(fv->rotation()), - shape_(fv->shape()), - params_(computeLegacyShapeParameters(shape_, fv->solid())), - radLength_(fv->get("TrackerRadLength")), // NOT OK: XMLs SpecPar handling by DD4hep FilteredView needs modification - xi_(fv->get("TrackerXi")), // NOT OK: XMLs SpecPar handling by DD4hep FilteredView needs modification - pixROCRows_(fv->get("PixelROCRows")), - pixROCCols_(fv->get("PixelROCCols")), - pixROCx_(fv->get("PixelROC_X")), - pixROCy_(fv->get("PixelROC_Y")), - stereo_(fv->get("TrackerStereoDetectors") == strue), - isLowerSensor_(fv->get("TrackerLowerDetectors") == strue), - isUpperSensor_(fv->get("TrackerUpperDetectors") == strue), - siliconAPVNum_(fv->get("SiliconAPVNumber")), - isFromDD4hep_(true) {} + : ddname_(dd4hep::dd::noNamespace(fv->name())), + type_(type), + ddd_(fv->navPos()), // To be studied + trans_(geant_units::operators::convertCmToMm(fv->translation())), + rho_(trans_.Rho()), + phi_(trans_.Phi()), + rot_(fv->rotation()), + shape_(fv->shape()), + params_(computeLegacyShapeParameters(shape_, fv->solid())), + radLength_(fv->get( + "TrackerRadLength")), // NOT OK: XMLs SpecPar handling by DD4hep FilteredView needs modification + xi_(fv->get("TrackerXi")), // NOT OK: XMLs SpecPar handling by DD4hep FilteredView needs modification + pixROCRows_(fv->get("PixelROCRows")), + pixROCCols_(fv->get("PixelROCCols")), + pixROCx_(fv->get("PixelROC_X")), + pixROCy_(fv->get("PixelROC_Y")), + stereo_(fv->get("TrackerStereoDetectors") == strue), + isLowerSensor_(fv->get("TrackerLowerDetectors") == strue), + isUpperSensor_(fv->get("TrackerUpperDetectors") == strue), + siliconAPVNum_(fv->get("SiliconAPVNumber")), + isFromDD4hep_(true) {} /* Constructor from persistent version (DB). */ GeometricDet::GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType type) - : ddname_(onePGD._name), - type_(type), - ddd_(), - geographicalID_(onePGD._geographicalID), - trans_(onePGD._x, onePGD._y, onePGD._z), - rho_(onePGD._rho), - phi_(onePGD._phi), - rot_(onePGD._a11, - onePGD._a12, - onePGD._a13, - onePGD._a21, - onePGD._a22, - onePGD._a23, - onePGD._a31, - onePGD._a32, - onePGD._a33), - shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast(onePGD._shape))), - params_(), + : ddname_(onePGD._name), + type_(type), + ddd_(), + geographicalID_(onePGD._geographicalID), + trans_(onePGD._x, onePGD._y, onePGD._z), + rho_(onePGD._rho), + phi_(onePGD._phi), + rot_(onePGD._a11, + onePGD._a12, + onePGD._a13, + onePGD._a21, + onePGD._a22, + onePGD._a23, + onePGD._a31, + onePGD._a32, + onePGD._a33), + shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, static_cast(onePGD._shape))), + params_(), radLength_(onePGD._radLength), xi_(onePGD._xi), pixROCRows_(onePGD._pixROCRows), @@ -147,8 +148,8 @@ GeometricDet::GeometricDet(const PGeometricDet::Item& onePGD, GeometricEnumType pixROCy_(onePGD._pixROCy), stereo_(onePGD._stereo), siliconAPVNum_(onePGD._siliconAPVNum) - // NB: what about new data members isLowerSensor_, isUpperSensor_, isFromDD4hep_? - // They are presently not added to PGeometricDet (no change in info stored into DB). +// NB: what about new data members isLowerSensor_, isUpperSensor_, isFromDD4hep_? +// They are presently not added to PGeometricDet (no change in info stored into DB). { // Solid shape parameters: only for box (1) and trapezoid (3) if (onePGD._shape == 1 || onePGD._shape == 3) { @@ -200,10 +201,9 @@ std::unique_ptr GeometricDet::bounds() const { } GeometricDet::Position GeometricDet::positionBounds() const { - Position pos_(static_cast(geant_units::operators::convertMmToCm(trans_.x())), - static_cast(geant_units::operators::convertMmToCm(trans_.y())), - static_cast(geant_units::operators::convertMmToCm(trans_.z())) - ); + Position pos_(static_cast(geant_units::operators::convertMmToCm(trans_.x())), + static_cast(geant_units::operators::convertMmToCm(trans_.y())), + static_cast(geant_units::operators::convertMmToCm(trans_.z()))); return pos_; } @@ -252,14 +252,13 @@ namespace { struct Deleter { void operator()(GeometricDet const* det) const { delete const_cast(det); } }; -} +} // namespace void GeometricDet::deleteComponents() { std::for_each(container_.begin(), container_.end(), Deleter()); container_.clear(); } - /* * PRIVATE */ @@ -306,7 +305,7 @@ std::vector GeometricDet::computeLegacyShapeParameters(const cms::DDSoli geant_units::operators::convertCmToMm(myTube->GetDz()), geant_units::operators::convertCmToMm(myTube->GetRmin()), geant_units::operators::convertCmToMm(myTube->GetRmax()), - static_cast(fmod(angle_units::operators::convertDegToRad(myTube->GetPhi1()), 2.*M_PI) - 2.*M_PI), + static_cast(fmod(angle_units::operators::convertDegToRad(myTube->GetPhi1()), 2. * M_PI) - 2. * M_PI), static_cast(angle_units::operators::convertDegToRad(myTube->GetPhi2() - myTube->GetPhi1()))}; } From 21b3b22ad1c812c1764dbccf6ee1699439e99f77 Mon Sep 17 00:00:00 2001 From: Jan Kaspar Date: Thu, 1 Oct 2020 11:49:03 +0200 Subject: [PATCH 167/778] Use FileInPath, clean up. --- .../CTPPSLHCInfoRandomXangleESSource.cc | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/CalibPPS/ESProducers/plugins/CTPPSLHCInfoRandomXangleESSource.cc b/CalibPPS/ESProducers/plugins/CTPPSLHCInfoRandomXangleESSource.cc index b6c26c50370e0..885a8499cdda7 100644 --- a/CalibPPS/ESProducers/plugins/CTPPSLHCInfoRandomXangleESSource.cc +++ b/CalibPPS/ESProducers/plugins/CTPPSLHCInfoRandomXangleESSource.cc @@ -39,17 +39,15 @@ class CTPPSLHCInfoRandomXangleESSource : public edm::ESProducer, public edm::Eve unsigned int m_generateEveryNEvents; double m_beamEnergy; - double m_betaStar; std::unique_ptr m_engine; - template struct BinData { double min, max; - T profile; + double xangle, betaStar; }; - std::vector>> xangleBetaStarBins; + std::vector xangleBetaStarBins; }; //---------------------------------------------------------------------------------------------------- @@ -63,36 +61,40 @@ CTPPSLHCInfoRandomXangleESSource::CTPPSLHCInfoRandomXangleESSource(const edm::Pa m_beamEnergy(conf.getParameter("beamEnergy")), m_engine(new CLHEP::HepJamesRandom(conf.getParameter("seed"))) { + // get input beta* vs. xangle histogram const auto &xangleBetaStarHistogramFile = conf.getParameter("xangleBetaStarHistogramFile"); const auto &xangleBetaStarHistogramObject = conf.getParameter("xangleBetaStarHistogramObject"); - TFile *f_in = TFile::Open(xangleBetaStarHistogramFile.c_str()); + edm::FileInPath fip(xangleBetaStarHistogramFile); + std::unique_ptr f_in(TFile::Open(fip.fullPath().c_str())); if (!f_in) throw cms::Exception("PPS") << "Cannot open input file '" << xangleBetaStarHistogramFile << "'."; TH2D *h_xangle_beta_star = (TH2D *)f_in->Get(xangleBetaStarHistogramObject.c_str()); if (!h_xangle_beta_star) throw cms::Exception("PPS") << "Cannot load input object '" << xangleBetaStarHistogramObject << "'."; - h_xangle_beta_star->SetDirectory(0); - delete f_in; + // parse histogram double sum = 0.; - for (int bi = 1; bi <= h_xangle_beta_star->GetNcells(); ++bi){ - double val=h_xangle_beta_star->GetBinContent(bi); - sum+=val; + for (int x = 1; x <= h_xangle_beta_star->GetNbinsX(); ++x) { + for (int y = 1; y <= h_xangle_beta_star->GetNbinsY(); ++y) + sum += h_xangle_beta_star->GetBinContent(x, y); } - double cw=0; - for (int x = 1; x <= h_xangle_beta_star->GetNbinsX(); ++x) + double cw = 0; + for (int x = 1; x <= h_xangle_beta_star->GetNbinsX(); ++x) { for (int y = 1; y <= h_xangle_beta_star->GetNbinsY(); ++y) { - double sample=h_xangle_beta_star->GetBinContent(h_xangle_beta_star->GetBin(x,y)); - if(sample>=1){ - sample/=sum; - xangleBetaStarBins.push_back({cw,cw+sample,std::pair(h_xangle_beta_star->GetXaxis()->GetBinCenter(x),h_xangle_beta_star->GetYaxis()->GetBinCenter(y))}); - cw+=sample; + const double c = h_xangle_beta_star->GetBinContent(x, y); + const double xangle = h_xangle_beta_star->GetXaxis()->GetBinCenter(x); + const double betaStar = h_xangle_beta_star->GetYaxis()->GetBinCenter(y); + + if (c > 0.) { + const double rc = c / sum; + xangleBetaStarBins.push_back({cw, cw + rc, xangle, betaStar}); + cw += rc; } } - delete h_xangle_beta_star; + } setWhatProduced(this, m_label); findingRecord(); @@ -132,24 +134,23 @@ void CTPPSLHCInfoRandomXangleESSource::setIntervalFor(const edm::eventsetup::Eve edm::ESProducts> CTPPSLHCInfoRandomXangleESSource::produce(const LHCInfoRcd &) { auto output = std::make_unique(); - double xangle=0, beta = 0.; + double xangle = 0., betaStar = 0.; const double u = CLHEP::RandFlat::shoot(m_engine.get(), 0., 1.); for (const auto &d : xangleBetaStarBins) { if (d.min <= u && u <= d.max) { - xangle = d.profile.first; - beta=d.profile.second; + xangle = d.xangle; + betaStar = d.betaStar; break; } } output->setEnergy(m_beamEnergy); output->setCrossingAngle(xangle); - output->setBetaStar(beta); - + output->setBetaStar(betaStar); return edm::es::products(std::move(output)); } //---------------------------------------------------------------------------------------------------- -DEFINE_FWK_EVENTSETUP_SOURCE(CTPPSLHCInfoRandomXangleESSource); +DEFINE_FWK_EVENTSETUP_SOURCE(CTPPSLHCInfoRandomXangleESSource); \ No newline at end of file From cfaecf66a82fec616a56f9bfc68acf6a99a9c824 Mon Sep 17 00:00:00 2001 From: Jan Kaspar Date: Thu, 1 Oct 2020 11:50:39 +0200 Subject: [PATCH 168/778] Added UseDefaultXangleBetaStar and UseDefaultXangleBetaStarDistribution functions. --- Validation/CTPPS/python/simu_config/base_cff.py | 4 +++- .../python/simu_config/year_2016_postTS2_cff.py | 12 +++++++----- .../python/simu_config/year_2016_preTS2_cff.py | 12 +++++++----- .../CTPPS/python/simu_config/year_2017_cff.py | 4 ---- .../python/simu_config/year_2017_postTS2_cff.py | 13 ++++++++++--- .../python/simu_config/year_2017_preTS2_cff.py | 13 ++++++++++--- .../python/simu_config/year_2018_TS1_TS2_cff.py | 13 ++++++++++--- .../CTPPS/python/simu_config/year_2018_cff.py | 4 ---- .../python/simu_config/year_2018_postTS2_cff.py | 13 ++++++++++--- .../python/simu_config/year_2018_preTS1_cff.py | 13 ++++++++++--- 10 files changed, 67 insertions(+), 34 deletions(-) diff --git a/Validation/CTPPS/python/simu_config/base_cff.py b/Validation/CTPPS/python/simu_config/base_cff.py index ab4dc4af6b955..c926fb12b07e2 100644 --- a/Validation/CTPPS/python/simu_config/base_cff.py +++ b/Validation/CTPPS/python/simu_config/base_cff.py @@ -173,9 +173,11 @@ def UseCrossingAngle(xangle, process): process.ctppsBeamParametersESSource.halfXangleX45 = xangle * 1E-6 process.ctppsBeamParametersESSource.halfXangleX56 = xangle * 1E-6 +default_xangle_beta_star_file = "CalibPPS/ESProducers/data/xangle_beta_distributions/version1.root" + def UseXangleBetaStarHistogram(process, f, obj): process.load("CalibPPS.ESProducers.ctppsLHCInfoRandomXangleESSource_cfi") - process.ctppsLHCInfoRandomXangleESSource.generateEveryNEvents = 1 + process.ctppsLHCInfoRandomXangleESSource.generateEveryNEvents = 10 # this is to be synchronised with source.numberEventsInLuminosityBlock process.ctppsLHCInfoRandomXangleESSource.xangleBetaStarHistogramFile = f process.ctppsLHCInfoRandomXangleESSource.xangleBetaStarHistogramObject = obj process.ctppsLHCInfoRandomXangleESSource.beamEnergy = ctppsLHCInfoESSource.beamEnergy diff --git a/Validation/CTPPS/python/simu_config/year_2016_postTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2016_postTS2_cff.py index 209fa62da9321..0f8c90a1ab196 100644 --- a/Validation/CTPPS/python/simu_config/year_2016_postTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2016_postTS2_cff.py @@ -38,11 +38,13 @@ ctppsDirectProtonSimulation.empiricalAperture45="6.10374E-05+(([xi]<0.113491)*0.00795942+([xi]>=0.113491)*0.01935)*([xi]-0.113491)" ctppsDirectProtonSimulation.empiricalAperture56="([xi]-0.110)/130.0" +# xangle/beta* options +def UseDefaultXangleBetaStar(process): + UseCrossingAngle(140, process) + +def UseDefaultXangleBetaStarDistribution(process): + UseXangleBetaStarHistogram(process, default_xangle_beta_star_file, "2016_postTS2/h2_betaStar_vs_xangle") # defaults def SetDefaults(process): - UseCrossingAngle(140, process) - -# xangle/beta* distribution -def UseXangleBetaStarDistribution(process, f): - UseXangleBetaStarHistogram(process, f, "/2016_postTS2/h2_betaStar_vs_xangle") + UseDefaultXangleBetaStarDistribution(process) diff --git a/Validation/CTPPS/python/simu_config/year_2016_preTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2016_preTS2_cff.py index e05d8f78cff18..e98d522c21abe 100644 --- a/Validation/CTPPS/python/simu_config/year_2016_preTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2016_preTS2_cff.py @@ -38,11 +38,13 @@ ctppsDirectProtonSimulation.empiricalAperture45="3.76296E-05+(([xi]<0.117122)*0.00712775+([xi]>=0.117122)*0.0148651)*([xi]-0.117122)" ctppsDirectProtonSimulation.empiricalAperture56="1.85954E-05+(([xi]<0.14324)*0.00475349+([xi]>=0.14324)*0.00629514)*([xi]-0.14324)" +# xangle/beta* options +def UseDefaultXangleBetaStar(process): + UseCrossingAngle(185, process) + +def UseDefaultXangleBetaStarDistribution(process): + UseXangleBetaStarHistogram(process, default_xangle_beta_star_file, "2016_preTS2/h2_betaStar_vs_xangle") # defaults def SetDefaults(process): - UseCrossingAngle(185, process) - -# xangle/beta* distribution -def UseXangleBetaStarDistribution(process, f): - UseXangleBetaStarHistogram(process, f, "/2016_preTS2/h2_betaStar_vs_xangle") + UseDefaultXangleBetaStarDistribution(process) diff --git a/Validation/CTPPS/python/simu_config/year_2017_cff.py b/Validation/CTPPS/python/simu_config/year_2017_cff.py index fa7c47a021be0..6234db0b8ce00 100644 --- a/Validation/CTPPS/python/simu_config/year_2017_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2017_cff.py @@ -54,7 +54,3 @@ rp_56_N = cms.uint32(103), rp_56_F = cms.uint32(123) ) - -# defaults -def SetDefaults(process): - UseCrossingAngle(140, process) diff --git a/Validation/CTPPS/python/simu_config/year_2017_postTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2017_postTS2_cff.py index c16548640bc56..3fe93a3313a68 100644 --- a/Validation/CTPPS/python/simu_config/year_2017_postTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2017_postTS2_cff.py @@ -18,6 +18,13 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "2 * 0.130" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "2 * 0.130" -# xangle/beta* distribution -def UseXangleBetaStarDistribution(process, f): - UseXangleBetaStarHistogram(process, f, "/2017_postTS2/h2_betaStar_vs_xangle") +# xangle/beta* options +def UseDefaultXangleBetaStar(process): + UseCrossingAngle(140, process) + +def UseDefaultXangleBetaStarDistribution(process): + UseXangleBetaStarHistogram(process, default_xangle_beta_star_file, "2017_postTS2/h2_betaStar_vs_xangle") + +# defaults +def SetDefaults(process): + UseDefaultXangleBetaStarDistribution(process) diff --git a/Validation/CTPPS/python/simu_config/year_2017_preTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2017_preTS2_cff.py index 1195aa9c6b216..c5f4966270e9d 100644 --- a/Validation/CTPPS/python/simu_config/year_2017_preTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2017_preTS2_cff.py @@ -18,6 +18,13 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "2 * (0.0025*(x-3) + 0.080)" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "2 * (0.0050*(x-3) + 0.060)" -# xangle/beta* distribution -def UseXangleBetaStarDistribution(process, f): - UseXangleBetaStarHistogram(process, f, "/2017_preTS2/h2_betaStar_vs_xangle") +# xangle/beta* options +def UseDefaultXangleBetaStar(process): + UseCrossingAngle(140, process) + +def UseDefaultXangleBetaStarDistribution(process): + UseXangleBetaStarHistogram(process, default_xangle_beta_star_file, "2017_preTS2/h2_betaStar_vs_xangle") + +# defaults +def SetDefaults(process): + UseDefaultXangleBetaStarDistribution(process) diff --git a/Validation/CTPPS/python/simu_config/year_2018_TS1_TS2_cff.py b/Validation/CTPPS/python/simu_config/year_2018_TS1_TS2_cff.py index 10f421da6d62b..c3f5da58d53af 100644 --- a/Validation/CTPPS/python/simu_config/year_2018_TS1_TS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2018_TS1_TS2_cff.py @@ -12,6 +12,13 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "2 * ( (x<10)*(-0.0086*(x-10) + 0.100) + (x>=10)*(0.100) )" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "2 * ( (x<8) *(-0.0100*(x-8) + 0.100) + (x>=8) *(-0.0027*(x-8) + 0.100) )" -# xangle/beta* distribution -def UseXangleBetaStarDistribution(process, f): - UseXangleBetaStarHistogram(process, f, "/2018_TS1_TS2/h2_betaStar_vs_xangle") +# xangle/beta* options +def UseDefaultXangleBetaStar(process): + UseCrossingAngle(140, process) + +def UseDefaultXangleBetaStarDistribution(process): + UseXangleBetaStarHistogram(process, default_xangle_beta_star_file, "2018_TS1_TS2/h2_betaStar_vs_xangle") + +# defaults +def SetDefaults(process): + UseDefaultXangleBetaStarDistribution(process) diff --git a/Validation/CTPPS/python/simu_config/year_2018_cff.py b/Validation/CTPPS/python/simu_config/year_2018_cff.py index 6caee845e4bd6..c76d144a4d511 100644 --- a/Validation/CTPPS/python/simu_config/year_2018_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2018_cff.py @@ -66,7 +66,3 @@ rp_56_N = cms.uint32(103), rp_56_F = cms.uint32(123) ) - -# defaults -def SetDefaults(process): - UseCrossingAngle(140, process) diff --git a/Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py b/Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py index 764aa5f7a76f0..48898bb91244b 100644 --- a/Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py @@ -12,6 +12,13 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "2 * (-0.0031 * (x - 3) + 0.16)" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "2 * ( (x<10)*(-0.0057*(x-10) + 0.110) + (x>=10)*(-0.0022*(x-10) + 0.110) )" -# xangle/beta* distribution -def UseXangleBetaStarDistribution(process, f): - UseXangleBetaStarHistogram(process, f, "/2018_postTS2/h2_betaStar_vs_xangle") +# xangle/beta* options +def UseDefaultXangleBetaStar(process): + UseCrossingAngle(140, process) + +def UseDefaultXangleBetaStarDistribution(process): + UseXangleBetaStarHistogram(process, default_xangle_beta_star_file, "2018_postTS2/h2_betaStar_vs_xangle") + +# defaults +def SetDefaults(process): + UseDefaultXangleBetaStarDistribution(process) diff --git a/Validation/CTPPS/python/simu_config/year_2018_preTS1_cff.py b/Validation/CTPPS/python/simu_config/year_2018_preTS1_cff.py index 06e40f36ca8dd..497025f2c1d0c 100644 --- a/Validation/CTPPS/python/simu_config/year_2018_preTS1_cff.py +++ b/Validation/CTPPS/python/simu_config/year_2018_preTS1_cff.py @@ -13,6 +13,13 @@ ctppsDirectProtonSimulation.timeResolutionDiamonds45 = "999" ctppsDirectProtonSimulation.timeResolutionDiamonds56 = "999" -# xangle/beta* distribution -def UseXangleBetaStarDistribution(process, f): - UseXangleBetaStarHistogram(process, f, "/2018_preTS1/h2_betaStar_vs_xangle") +# xangle/beta* options +def UseDefaultXangleBetaStar(process): + UseCrossingAngle(140, process) + +def UseDefaultXangleBetaStarDistribution(process): + UseXangleBetaStarHistogram(process, default_xangle_beta_star_file, "2018_preTS1/h2_betaStar_vs_xangle") + +# defaults +def SetDefaults(process): + UseDefaultXangleBetaStarDistribution(process) From 8ae31ec250918012bfbfb137c8105a2f183e7890 Mon Sep 17 00:00:00 2001 From: Michal Bluj Date: Thu, 1 Oct 2020 11:59:42 +0200 Subject: [PATCH 169/778] Simplify checks against ill-defined track momenta and reffited tau vertices (tauReco@miniAOD) --- .../RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc | 6 +++--- RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc b/RecoTauTag/RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc index ed2e8104ba55c..d00b32c7b9b2a 100644 --- a/RecoTauTag/RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc +++ b/RecoTauTag/RecoTau/plugins/PFTauMiniAODPrimaryVertexProducer.cc @@ -63,6 +63,9 @@ void PFTauMiniAODPrimaryVertexProducer::nonTauTracksInPVFromPackedCands( std::vector &nonTauTracks) { //Find candidates/tracks associated to thePV for (const auto &cand : cands) { + //MB: Skip candidates with ill-defined momentum as they return ill-defined tracks (why it happens?) + if (!std::isfinite(cand.pt())) //MB: it is enough to check just pt (?) + continue; if (cand.vertexRef().isNull()) continue; int quality = cand.pvAssociationQuality(); @@ -72,9 +75,6 @@ void PFTauMiniAODPrimaryVertexProducer::nonTauTracksInPVFromPackedCands( const reco::Track *track = cand.bestTrack(); if (track == nullptr) continue; - //MB: Skip tracks with ill-defined momentum (why it happens?) - if (!std::isfinite(track->pt()) || !std::isfinite(track->eta()) || !std::isfinite(track->phi())) - continue; //Remove signal (tau) tracks //MB: Only deltaR deltaPt overlap removal possible (?) //MB: It should be fine as pat objects stores same track info with same presision diff --git a/RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc b/RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc index 66eeca4b94f81..692ee0c6fd661 100644 --- a/RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc +++ b/RecoTauTag/RecoTau/src/PFTauPrimaryVertexProducerBase.cc @@ -208,8 +208,7 @@ void PFTauPrimaryVertexProducerBase::produce(edm::Event& iEvent, const edm::Even fitOK = false; } else { //MB: protect against rare cases when transVtx is valid but its position is ill-defined - reco::Vertex::Point pvPos(transVtx.position()); - if (!std::isfinite(pvPos.z())) //MB: it is enough to check one coordinate (?) + if (!std::isfinite(transVtx.position().z())) //MB: it is enough to check one coordinate (?) fitOK = false; } } else From df19623468d4096b9e424961ec59837239543673 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 1 Oct 2020 12:05:51 +0200 Subject: [PATCH 170/778] adress comments --- .../plugins/dd4hep/DDDefinitions2Objects.cc | 12 +++++------- .../DDCMS/src/DDFilteredView.cc | 19 ++++++++++--------- .../DDCMS/test/DDFilteredView.goto.cppunit.cc | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 7c84086c853d5..d98aabc055417 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -947,14 +947,12 @@ void Converter::operator()(xml_h element) const { "+++ PartSelector for %s path: %s", specParName.c_str(), path.c_str()); - auto npos = path.find(':'); - if (npos != path.npos) { - std::string anyns{"//.*"}; - if (path.substr(0, npos) == anyns) { - path = string("//").append(path.substr(npos + 1)); - } + + size_t pos = std::string::npos; + if ((pos = path.find("//.*:")) != std::string::npos) { + path.erase(pos + 2, 3); } - registry.specpars[specParName].paths.emplace_back(path); + registry.specpars[specParName].paths.emplace_back(std::move(path)); } /// Converter for tags diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 1aa546eb0d5a4..cf3adcfb08a9f 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -479,23 +479,26 @@ std::string_view DDFilteredView::get(const string& key) const { int level = it_.back().GetLevel(); for (auto const& i : refs) { auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { - auto frompos = j.find_last_of('/'); auto topos = j.size(); + auto frompos = j.rfind('/'); bool flag = false; - for (int nit = level; frompos > topos and nit > 0; --nit) { + for (int nit = level; frompos - 1 <= topos and nit > 0; --nit) { std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); - std::string_view refname(j.substr(frompos + 1, topos)); - auto rpos = refname.find(":"); + std::string_view refname{&j[frompos + 1], topos - frompos - 1}; + topos = frompos; + frompos = j.substr(0, topos).rfind('/'); + + auto rpos = refname.find(':'); if (rpos == refname.npos) { name = noNamespace(name); } else { - if (name.find(":") == name.npos) { + if (name.find(':') == name.npos) { refname.remove_prefix(rpos + 1); } } - auto cpos = refname.rfind("["); + auto cpos = refname.rfind('['); if (cpos != refname.npos) { - if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind("]")))) == copyNum()) { + if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum()) { refname.remove_suffix(refname.size() - cpos); flag = true; continue; @@ -521,8 +524,6 @@ std::string_view DDFilteredView::get(const string& key) const { continue; } } - topos = frompos - 1; - frompos = j.substr(0, frompos).find_last_of('/'); } return flag; }); diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc index 40831457435e7..da508c19c00f6 100644 --- a/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc +++ b/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc @@ -49,7 +49,7 @@ void testDDFilteredViewGoTo::checkFilteredView() { if (count == 45) { testPos = fview.navPos(); } - if (count == 1000) { + if (count == 50) { break; } count++; From 0d72507c605c5ed872342ebdd5c0bb68fd2f1452 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 1 Oct 2020 12:29:12 +0200 Subject: [PATCH 171/778] Move GeometricDets printout file to DDDCmsTrackerContruction --- .../plugins/CmsTrackerDetIdBuilder.cc | 56 --------------- .../plugins/DDDCmsTrackerContruction.cc | 70 +++++++++++++++++++ .../plugins/DDDCmsTrackerContruction.h | 3 +- 3 files changed, 72 insertions(+), 57 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc index be068496bc8ce..31c48b7996dbb 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.cc @@ -9,7 +9,6 @@ #include #include #include -#include CmsTrackerDetIdBuilder::CmsTrackerDetIdBuilder(const std::vector& detidShifts) : m_detidshifts() { if (detidShifts.size() != nSubDet * maxLevels) @@ -28,61 +27,6 @@ void CmsTrackerDetIdBuilder::buildId(GeometricDet& tracker) { DetId t(DetId::Tracker, 0); tracker.setGeographicalID(t); iterate(tracker, 0, tracker.geographicalId().rawId()); - - std::ofstream outfile("DetIdOLD.log", std::ios::out); - //std::ofstream outfile("DetIdDD4hep.log", std::ios::out); - - std::deque queue; - queue.emplace_back(&tracker); - - while (!queue.empty()) { - const GeometricDet* myDet = queue.front(); - queue.pop_front(); - for (auto& child : myDet->components()) { - queue.emplace_back(child); - } - - outfile << " " << std::endl; - outfile << " " << std::endl; - outfile << "............................." << std::endl; - outfile << "myDet->geographicalID() = " << myDet->geographicalId() << std::endl; - - //const auto& found = myDet->name().find(":"); - //outfile << "myDet->name() = " << (found != std::string::npos ? myDet->name().substr(found + 1) : myDet->name()) << std::endl; - outfile << "myDet->name() = " << myDet->name() << std::endl; - outfile << "myDet->module->type() = " << std::fixed << std::setprecision(7) << myDet->type() << std::endl; - - outfile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() - << std::endl; - outfile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() << std::endl; - - if (fabs(myDet->rho()) > 0.00001) { - outfile << "myDet->module->phi() = " << std::fixed << std::setprecision(7) << myDet->phi() << std::endl; - } - - outfile << "myDet->module->rotation() = " << std::fixed << std::setprecision(7) << myDet->rotation() << std::endl; - outfile << "myDet->module->shape() = " << std::fixed << std::setprecision(7) << myDet->shape() << std::endl; - - if (myDet->shape_dd4hep() == cms::DDSolidShape::ddbox || myDet->shape_dd4hep() == cms::DDSolidShape::ddtrap || - myDet->shape_dd4hep() == cms::DDSolidShape::ddtubs) { - outfile << "myDet->params() = " << std::fixed << std::setprecision(7); - for (const auto& para : myDet->params()) { - outfile << para << " "; - } - outfile << " " << std::endl; - } - - outfile << "myDet->radLength() = " << myDet->radLength() << std::endl; - outfile << "myDet->xi() = " << myDet->xi() << std::endl; - outfile << "myDet->pixROCRows() = " << myDet->pixROCRows() << std::endl; - outfile << "myDet->pixROCCols() = " << myDet->pixROCCols() << std::endl; - outfile << "myDet->pixROCx() = " << myDet->pixROCx() << std::endl; - outfile << "myDet->pixROCy() = " << myDet->pixROCy() << std::endl; - outfile << "myDet->stereo() = " << myDet->stereo() << std::endl; - outfile << "myDet->isLowerSensor() = " << myDet->isLowerSensor() << std::endl; - outfile << "myDet->isUpperSensor() = " << myDet->isUpperSensor() << std::endl; - outfile << "myDet->siliconAPVNum() = " << myDet->siliconAPVNum() << std::endl; - } } void CmsTrackerDetIdBuilder::iterate(GeometricDet& in, int level, unsigned int ID) { diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc index f15e032c93148..2e7375d4d6b2e 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc @@ -1,5 +1,7 @@ #include "Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h" +#include +#include #include #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DetectorDescription/Core/interface/DDFilteredView.h" @@ -11,6 +13,8 @@ #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerBuilder.h" #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.h" +#define DEBUG false + std::unique_ptr DDDCmsTrackerContruction::construct(const DDCompactView& cpv, std::vector const& detidShifts) { std::string attribute = "TkDDDStructure"; @@ -35,6 +39,10 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const DDCompac CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); +if (DEBUG) { +printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); +} + edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); theCmsTrackerDetIdBuilder.buildId(*tracker); @@ -74,9 +82,71 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const cms::DDC CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); + if (DEBUG) { + printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); + } + edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); theCmsTrackerDetIdBuilder.buildId(*tracker); return tracker; } + + +/* + * Print all Tracker GeoemtricDets before DetIds building. + * The tree is lareday fully constructed from XMLs, + * and all GeometricDets are sorted according to their geometric position. + * This allows a convenient debugging, as the DetIds are assigned according to this information. + */ +void DDDCmsTrackerContruction::printAllTrackerGeometricDetsBeforeDetIDBuilding(const GeometricDet* tracker) { + + std::ofstream outputFile("All_Tracker_GeometricDets_before_DetId_building.log", std::ios::out); + + // Tree navigation: queue for BFS (we want to see same hierarchy level together). + // (for DFS, would just use a stack instead). + std::deque queue; + queue.emplace_back(tracker); + + while (!queue.empty()) { + const GeometricDet* myDet = queue.front(); + queue.pop_front(); + + for (auto& child : myDet->components()) { + queue.emplace_back(child); + } + + outputFile << " " << std::endl; + outputFile << " " << std::endl; + outputFile << "............................." << std::endl; + outputFile << "myDet->geographicalID() = " << myDet->geographicalId() << std::endl; + outputFile << "myDet->name() = " << myDet->name() << std::endl; + outputFile << "myDet->module->type() = " << std::fixed << std::setprecision(7) << myDet->type() << std::endl; + outputFile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() << std::endl; + outputFile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() << std::endl; + if (fabs(myDet->rho()) > 0.00001) { + outputFile << "myDet->module->phi() = " << std::fixed << std::setprecision(7) << myDet->phi() << std::endl; + } + outputFile << "myDet->module->rotation() = " << std::fixed << std::setprecision(7) << myDet->rotation() << std::endl; + outputFile << "myDet->module->shape() = " << std::fixed << std::setprecision(7) << myDet->shape() << std::endl; + if (myDet->shape_dd4hep() == cms::DDSolidShape::ddbox || myDet->shape_dd4hep() == cms::DDSolidShape::ddtrap || + myDet->shape_dd4hep() == cms::DDSolidShape::ddtubs) { + outputFile << "myDet->params() = " << std::fixed << std::setprecision(7); + for (const auto& para : myDet->params()) { + outputFile << para << " "; + } + outputFile << " " << std::endl; + } + outputFile << "myDet->radLength() = " << myDet->radLength() << std::endl; + outputFile << "myDet->xi() = " << myDet->xi() << std::endl; + outputFile << "myDet->pixROCRows() = " << myDet->pixROCRows() << std::endl; + outputFile << "myDet->pixROCCols() = " << myDet->pixROCCols() << std::endl; + outputFile << "myDet->pixROCx() = " << myDet->pixROCx() << std::endl; + outputFile << "myDet->pixROCy() = " << myDet->pixROCy() << std::endl; + outputFile << "myDet->stereo() = " << myDet->stereo() << std::endl; + outputFile << "myDet->isLowerSensor() = " << myDet->isLowerSensor() << std::endl; + outputFile << "myDet->isUpperSensor() = " << myDet->isUpperSensor() << std::endl; + outputFile << "myDet->siliconAPVNum() = " << myDet->siliconAPVNum() << std::endl; + } +} diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h index e956bd4d0fd1e..fa05d0777c87a 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h @@ -25,6 +25,7 @@ class DDDCmsTrackerContruction { ///takes ownership of detidShifts static std::unique_ptr construct(DDCompactView const& cpv, std::vector const& detidShifts); static std::unique_ptr construct(cms::DDCompactView const& cpv, std::vector const& detidShifts); -}; + static void printAllTrackerGeometricDetsBeforeDetIDBuilding(const GeometricDet* tracker); +}; // NB: no point having a class in which evth is static, should just use namespace... #endif From 92dc3bd02853b78e0663c6deafe5de2cede0ce37 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Thu, 1 Oct 2020 12:29:40 +0200 Subject: [PATCH 172/778] scram b code-format --- .../plugins/DDDCmsTrackerContruction.cc | 14 +++++++------- .../plugins/DDDCmsTrackerContruction.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc index 2e7375d4d6b2e..59bdaa09ed0c0 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc @@ -39,9 +39,9 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const DDCompac CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); -if (DEBUG) { -printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); -} + if (DEBUG) { + printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); + } edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); @@ -93,7 +93,6 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const cms::DDC return tracker; } - /* * Print all Tracker GeoemtricDets before DetIds building. * The tree is lareday fully constructed from XMLs, @@ -101,7 +100,6 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const cms::DDC * This allows a convenient debugging, as the DetIds are assigned according to this information. */ void DDDCmsTrackerContruction::printAllTrackerGeometricDetsBeforeDetIDBuilding(const GeometricDet* tracker) { - std::ofstream outputFile("All_Tracker_GeometricDets_before_DetId_building.log", std::ios::out); // Tree navigation: queue for BFS (we want to see same hierarchy level together). @@ -123,12 +121,14 @@ void DDDCmsTrackerContruction::printAllTrackerGeometricDetsBeforeDetIDBuilding(c outputFile << "myDet->geographicalID() = " << myDet->geographicalId() << std::endl; outputFile << "myDet->name() = " << myDet->name() << std::endl; outputFile << "myDet->module->type() = " << std::fixed << std::setprecision(7) << myDet->type() << std::endl; - outputFile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() << std::endl; + outputFile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() + << std::endl; outputFile << "myDet->module->rho() = " << std::fixed << std::setprecision(7) << myDet->rho() << std::endl; if (fabs(myDet->rho()) > 0.00001) { outputFile << "myDet->module->phi() = " << std::fixed << std::setprecision(7) << myDet->phi() << std::endl; } - outputFile << "myDet->module->rotation() = " << std::fixed << std::setprecision(7) << myDet->rotation() << std::endl; + outputFile << "myDet->module->rotation() = " << std::fixed << std::setprecision(7) << myDet->rotation() + << std::endl; outputFile << "myDet->module->shape() = " << std::fixed << std::setprecision(7) << myDet->shape() << std::endl; if (myDet->shape_dd4hep() == cms::DDSolidShape::ddbox || myDet->shape_dd4hep() == cms::DDSolidShape::ddtrap || myDet->shape_dd4hep() == cms::DDSolidShape::ddtubs) { diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h index fa05d0777c87a..4081e7e1040ba 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h @@ -26,6 +26,6 @@ class DDDCmsTrackerContruction { static std::unique_ptr construct(DDCompactView const& cpv, std::vector const& detidShifts); static std::unique_ptr construct(cms::DDCompactView const& cpv, std::vector const& detidShifts); static void printAllTrackerGeometricDetsBeforeDetIDBuilding(const GeometricDet* tracker); -}; // NB: no point having a class in which evth is static, should just use namespace... +}; // NB: no point having a class in which evth is static, should just use namespace... #endif From 4b2ea25351f7b98f6c08f546f6d169be17d43568 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 1 Oct 2020 13:20:07 +0200 Subject: [PATCH 173/778] code format --- .../DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index d98aabc055417..855c8116f0e3e 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -947,7 +947,7 @@ void Converter::operator()(xml_h element) const { "+++ PartSelector for %s path: %s", specParName.c_str(), path.c_str()); - + size_t pos = std::string::npos; if ((pos = path.find("//.*:")) != std::string::npos) { path.erase(pos + 2, 3); From 5071af05ec74dfb6adb191fea9d38d66ee9289d2 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Wed, 30 Sep 2020 11:31:48 +0200 Subject: [PATCH 174/778] Further post-rebase cleanup --- .../L1TMuon/interface/MuonRawDigiTranslator.h | 21 +++++- .../interface/RegionalMuonRawDigiTranslator.h | 7 +- L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc | 64 ++++++++++--------- .../L1AnalysisL1UpgradeTfMuonDataFormat.h | 3 +- .../src/L1AnalysisL1UpgradeTfMuon.cc | 24 ++++++- 5 files changed, 82 insertions(+), 37 deletions(-) diff --git a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h index 212a5e1282acc..c980dcd65fed1 100644 --- a/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h @@ -6,8 +6,15 @@ namespace l1t { class MuonRawDigiTranslator { public: - static void fillMuon(Muon&, uint32_t, uint32_t, uint32_t, int, unsigned int, int); - static void fillMuon(Muon&, uint32_t, uint64_t, int, unsigned int, int); + static void fillMuon(Muon& mu, + uint32_t raw_data_spare, + uint32_t raw_data_00_31, + uint32_t raw_data_32_63, + int fed, + unsigned int fw, + int muInBx); + static void fillMuon(Muon& mu, uint32_t raw_data_spare, uint64_t dataword, int fed, unsigned int fw, int muInBx); + static void fillIntermediateMuon(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, unsigned int fw); static void generatePackedDataWords(const Muon& mu, uint32_t& raw_data_spare, uint32_t& raw_data_00_31, @@ -17,7 +24,7 @@ namespace l1t { int muInBx); static void generate64bitDataWord( const Muon& mu, uint32_t& raw_data_spare, uint64_t& dataword, int fedId, int fwId, int muInBx); - static int calcHwEta(const uint32_t&, const unsigned, const unsigned); + static int calcHwEta(const uint32_t& raw, const unsigned absEtaShift, const unsigned etaSignShift); static constexpr unsigned ptMask_ = 0x1FF; static constexpr unsigned ptShift_ = 10; @@ -46,6 +53,14 @@ namespace l1t { static constexpr unsigned etaMu1SignShift_ = 20; // For Run-3 static constexpr unsigned absEtaMu2Shift_ = 21; // For Run-3 static constexpr unsigned etaMu2SignShift_ = 29; // For Run-3 + + private: + static void fillMuonStableQuantities(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); + static void fillMuonQuantitiesRun3( + Muon& mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx); + static void fillIntermediateMuonQuantitiesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63); }; } // namespace l1t diff --git a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h index 5bbbf9dfa5a43..0ee774b831864 100644 --- a/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h +++ b/L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h @@ -6,8 +6,9 @@ namespace l1t { class RegionalMuonRawDigiTranslator { public: - static void fillRegionalMuonCand(RegionalMuonCand&, uint32_t, uint32_t, int, tftype, bool); - static void fillRegionalMuonCand(RegionalMuonCand&, uint64_t, int, tftype, bool); + static void fillRegionalMuonCand( + RegionalMuonCand& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKalman); + static void fillRegionalMuonCand(RegionalMuonCand& mu, uint64_t dataword, int proc, tftype tf, bool isKalman); static void generatePackedDataWords(const RegionalMuonCand& mu, uint32_t& raw_data_00_31, uint32_t& raw_data_32_63, @@ -36,6 +37,8 @@ namespace l1t { static constexpr unsigned trackAddressMask_ = 0x1FFFFFFF; static constexpr unsigned trackAddressShift_ = 2; // relative shifts within track address + static constexpr unsigned bmtfTrAddrSegSelMask_ = 0xF; + static constexpr unsigned bmtfTrAddrSegSelShift_ = 21; static constexpr unsigned bmtfTrAddrDetSideShift_ = 20; static constexpr unsigned bmtfTrAddrWheelMask_ = 0x3; static constexpr unsigned bmtfTrAddrWheelShift_ = 18; diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc index 62c1370864c24..041629377682e 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc @@ -486,23 +486,26 @@ void L1TMuonProducer::splitAndConvertMuons(const edm::Handlesize(bx); ++i, ++muIdx) { - int link = in->at(bx, i).link(); - if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) - continue; // only process if input link is enabled and not masked - if (currentLink != link) { - muIdx = 0; - currentLink = link; - } - int gPhi = MicroGMTConfiguration::calcGlobalPhi( - in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor()); - int tfMuonIdx = 3 * (currentLink - 36) + muIdx; - std::shared_ptr out = std::make_shared(in->at(bx, i), gPhi, tfMuonIdx); - if (in->at(bx, i).hwEta() > 0) { - out_pos.push_back(out); - wedges_pos[in->at(bx, i).processor()].push_back(out); - } else { - out_neg.emplace_back(out); - wedges_neg[in->at(bx, i).processor()].push_back(out); + if (in->at(bx, i).hwPt() > 0) { + int link = in->at(bx, i).link(); + if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) { + continue; // only process if input link is enabled and not masked + } + if (currentLink != link) { + muIdx = 0; + currentLink = link; + } + int gPhi = MicroGMTConfiguration::calcGlobalPhi( + in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor()); + int tfMuonIdx = 3 * (currentLink - 36) + muIdx; + std::shared_ptr out = std::make_shared(in->at(bx, i), gPhi, tfMuonIdx); + if (in->at(bx, i).hwEta() > 0) { + out_pos.push_back(out); + wedges_pos[in->at(bx, i).processor()].push_back(out); + } else { + out_neg.emplace_back(out); + wedges_neg[in->at(bx, i).processor()].push_back(out); + } } } for (int i = 0; i < 6; ++i) { @@ -529,19 +532,22 @@ void L1TMuonProducer::convertMuons(const edm::Handlesize(bx); ++i, ++muIdx) { - int link = in->at(bx, i).link(); - if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) - continue; // only process if input link is enabled and not masked - if (currentLink != link) { - muIdx = 0; - currentLink = link; + if (in->at(bx, i).hwPt() > 0) { + int link = in->at(bx, i).link(); + if (m_inputsToDisable.test(link) || m_maskedInputs.test(link)) { + continue; // only process if input link is enabled and not masked + } + if (currentLink != link) { + muIdx = 0; + currentLink = link; + } + int gPhi = MicroGMTConfiguration::calcGlobalPhi( + in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor()); + int tfMuonIdx = 3 * (currentLink - 36) + muIdx; + std::shared_ptr outMu = std::make_shared(in->at(bx, i), gPhi, tfMuonIdx); + out.emplace_back(outMu); + wedges[in->at(bx, i).processor()].push_back(outMu); } - int gPhi = MicroGMTConfiguration::calcGlobalPhi( - in->at(bx, i).hwPhi(), in->at(bx, i).trackFinderType(), in->at(bx, i).processor()); - int tfMuonIdx = 3 * (currentLink - 36) + muIdx; - std::shared_ptr outMu = std::make_shared(in->at(bx, i), gPhi, tfMuonIdx); - out.emplace_back(outMu); - wedges[in->at(bx, i).processor()].push_back(outMu); } for (int i = 0; i < 12; ++i) { if (wedges[i].size() > 3) diff --git a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h index a6bb8995ec5e6..eb1105d2ff8b3 100644 --- a/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h +++ b/L1Trigger/L1TNtuples/interface/L1AnalysisL1UpgradeTfMuonDataFormat.h @@ -45,7 +45,8 @@ namespace L1Analysis { std::vector tfMuonBx; std::vector tfMuonWh; std::vector tfMuonTrAdd; - std::vector tfMuonRawTrAdd; + std::vector> tfMuonDecodedTrAdd; + std::vector tfMuonHwTrAdd; }; } // namespace L1Analysis #endif diff --git a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc index 7bf21b6c6c0c7..622b4ad3e42f0 100644 --- a/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc +++ b/L1Trigger/L1TNtuples/src/L1AnalysisL1UpgradeTfMuon.cc @@ -24,6 +24,7 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrackFinderType.push_back(it->trackFinderType()); l1upgradetfmuon_.tfMuonHwHF.push_back(it->hwHF()); l1upgradetfmuon_.tfMuonBx.push_back(ibx); + std::map decoded_track_address; if (it->trackFinderType() == l1t::tftype::bmtf) { int detSide = it->trackSubAddress(l1t::RegionalMuonCand::kWheelSide); int wheelNum = it->trackSubAddress(l1t::RegionalMuonCand::kWheelNum); @@ -38,10 +39,29 @@ void L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon(const l1t::RegionalMuonCan l1upgradetfmuon_.tfMuonTrAdd.push_back(stat2); l1upgradetfmuon_.tfMuonTrAdd.push_back(stat3); l1upgradetfmuon_.tfMuonTrAdd.push_back(stat4); + decoded_track_address["wheel"] = wheel; + decoded_track_address["station1"] = stat1; + decoded_track_address["station2"] = stat2; + decoded_track_address["station3"] = stat3; + decoded_track_address["station4"] = stat4; + } else if (it->trackFinderType() == l1t::omtf_neg || it->trackFinderType() == l1t::omtf_pos) { + decoded_track_address["kLayers"] = it->trackSubAddress(l1t::RegionalMuonCand::kLayers); + decoded_track_address["kWeight"] = it->trackSubAddress(l1t::RegionalMuonCand::kWeight); + } else if (it->trackFinderType() == l1t::emtf_neg || it->trackFinderType() == l1t::emtf_pos) { + decoded_track_address["kME1Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME1Seg); + decoded_track_address["kME1Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME1Ch); + decoded_track_address["kME2Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME2Seg); + decoded_track_address["kME2Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME2Ch); + decoded_track_address["kME3Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME3Seg); + decoded_track_address["kME3Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME3Ch); + decoded_track_address["kME4Seg"] = it->trackSubAddress(l1t::RegionalMuonCand::kME4Seg); + decoded_track_address["kME4Ch"] = it->trackSubAddress(l1t::RegionalMuonCand::kME4Ch); + decoded_track_address["kTrkNum"] = it->trackSubAddress(l1t::RegionalMuonCand::kTrkNum); + decoded_track_address["kBX"] = it->trackSubAddress(l1t::RegionalMuonCand::kBX); } - l1upgradetfmuon_.tfMuonRawTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress( + l1upgradetfmuon_.tfMuonDecodedTrAdd.push_back(decoded_track_address); + l1upgradetfmuon_.tfMuonHwTrAdd.push_back(l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress( *it, true)); // TODO: We're assuming that we're dealing with Kalman muons here. - l1upgradetfmuon_.nTfMuons++; } } From bbe05117e7bc7f5d2323d4164e6737c41ddf015b Mon Sep 17 00:00:00 2001 From: Dinyar Rabady Date: Wed, 30 Sep 2020 16:18:58 +0200 Subject: [PATCH 175/778] Applied changes from code-checks --- DataFormats/L1Trigger/interface/Muon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFormats/L1Trigger/interface/Muon.h b/DataFormats/L1Trigger/interface/Muon.h index 2b5e421046261..3b30133cf8c0e 100644 --- a/DataFormats/L1Trigger/interface/Muon.h +++ b/DataFormats/L1Trigger/interface/Muon.h @@ -68,7 +68,7 @@ namespace l1t { double ptUnconstrained = 0., int dXY = 0); - ~Muon(); + ~Muon() override; // set values inline void setHwCharge(int charge) { hwCharge_ = charge; }; From 7f83ffc4fe1f094946fbc72e7cc0642243a94b83 Mon Sep 17 00:00:00 2001 From: mmusich Date: Thu, 1 Oct 2020 13:57:52 +0200 Subject: [PATCH 176/778] put back SimDataFormats/TrackingAnalysis into the plugins BuildFile as requested in https://github.com/cms-sw/cmssw/pull/31002#discussion_r495831968 --- CalibTracker/SiStripCommon/BuildFile.xml | 1 - CalibTracker/SiStripCommon/plugins/BuildFile.xml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CalibTracker/SiStripCommon/BuildFile.xml b/CalibTracker/SiStripCommon/BuildFile.xml index ec4c9f03edce5..266c1e24fd3ad 100644 --- a/CalibTracker/SiStripCommon/BuildFile.xml +++ b/CalibTracker/SiStripCommon/BuildFile.xml @@ -4,7 +4,6 @@ - diff --git a/CalibTracker/SiStripCommon/plugins/BuildFile.xml b/CalibTracker/SiStripCommon/plugins/BuildFile.xml index 84c5757059d76..fb87f9db10dea 100644 --- a/CalibTracker/SiStripCommon/plugins/BuildFile.xml +++ b/CalibTracker/SiStripCommon/plugins/BuildFile.xml @@ -7,6 +7,7 @@ + From b4d88a48c27ae3750563219f1019103e1fcd642f Mon Sep 17 00:00:00 2001 From: Jan Kaspar Date: Thu, 1 Oct 2020 14:13:38 +0200 Subject: [PATCH 177/778] Code format fixed. --- Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc b/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc index 79b015451081c..30ea8d7eaf7a1 100644 --- a/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc +++ b/Validation/CTPPS/plugins/CTPPSLHCInfoPlotter.cc @@ -57,7 +57,14 @@ CTPPSLHCInfoPlotter::CTPPSLHCInfoPlotter(const edm::ParameterSet &iConfig) h_beamEnergy_(new TH1D("h_beamEnergy", ";beam energy (GeV)", 81, -50., 8050.)), h_xangle_(new TH1D("h_xangle", ";(half) crossing angle (#murad)", 201, -0.5, 200.5)), h_betaStar_(new TH1D("h_betaStar", ";#beta^{*} (m)", 101, -0.005, 1.005)), - h2_betaStar_vs_xangle_(new TH2D("h2_betaStar_vs_xangle", ";(half) crossing angle (#murad);#beta^{*} (m)", 201, -0.5, 200.5, 101, -0.005, 1.005)), + h2_betaStar_vs_xangle_(new TH2D("h2_betaStar_vs_xangle", + ";(half) crossing angle (#murad);#beta^{*} (m)", + 201, + -0.5, + 200.5, + 101, + -0.005, + 1.005)), h_fill_(new TH1D("h_fill", ";fill", 4001, 3999.5, 8000.5)), h_run_(new TH1D("h_run", ";run", 6000, 270E3, 330E3)) {} From e8999b2bf148d8a4af01f57b9263b9892c28cdbe Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 1 Oct 2020 17:05:28 +0200 Subject: [PATCH 178/778] allow chaching a SpecPar for a subsequent query --- .../DDCMS/interface/DDFilteredView.h | 16 +- .../DDCMS/src/DDFilteredView.cc | 141 ++++++++++-------- .../DDCMS/test/DDFilteredView.goto.cppunit.cc | 8 +- 3 files changed, 103 insertions(+), 62 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index b5b4163be4f81..50b73e48508a9 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -24,6 +24,7 @@ #include #include #include +#include #include namespace cms { @@ -190,7 +191,11 @@ namespace cms { //! extract attribute value template - T get(const std::string&) const; + T get(const std::string&); + + //! extract another value from the same SpecPar + // call get first to find a relevant one + double getNextValue(const std::string&) const; //! extract attribute value in SpecPar template @@ -202,7 +207,7 @@ namespace cms { std::vector get(const std::string&, const std::string&) const; std::string_view getString(const std::string&) const; - + //! return the stack of sibling numbers which indicates // the current position in the DDFilteredView nav_type navPos() const; @@ -226,6 +231,12 @@ namespace cms { //! set the current node to the first sibling bool firstSibling(); + //! find a SpecPar in the registry by key + // doesn't really belong here, but allows + // speeding up avoiding the same search over + // the registry + const DDSpecPar* find(const std::string&) const; + ExpandedNodes nodes_; std::vector it_; std::vector> filters_; @@ -233,6 +244,7 @@ namespace cms { Node* node_ = nullptr; const DDSpecParRegistry* registry_; DDSpecParRefs refs_; + const DDSpecPar* currentSpecPar_ = nullptr; int startLevel_; }; } // namespace cms diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index cf3adcfb08a9f..c86cd53059440 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -472,72 +472,18 @@ LegacySolidShape DDFilteredView::legacyShape(const cms::DDSolidShape shape) cons } template <> -std::string_view DDFilteredView::get(const string& key) const { +std::string_view DDFilteredView::get(const string& key) { std::string_view result; - DDSpecParRefs refs; - registry_->filter(refs, key, ""); - int level = it_.back().GetLevel(); - for (auto const& i : refs) { - auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { - auto topos = j.size(); - auto frompos = j.rfind('/'); - bool flag = false; - for (int nit = level; frompos - 1 <= topos and nit > 0; --nit) { - std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); - std::string_view refname{&j[frompos + 1], topos - frompos - 1}; - topos = frompos; - frompos = j.substr(0, topos).rfind('/'); - auto rpos = refname.find(':'); - if (rpos == refname.npos) { - name = noNamespace(name); - } else { - if (name.find(':') == name.npos) { - refname.remove_prefix(rpos + 1); - } - } - auto cpos = refname.rfind('['); - if (cpos != refname.npos) { - if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum()) { - refname.remove_suffix(refname.size() - cpos); - flag = true; - continue; - } else { - flag = false; - break; - } - } - if (!dd4hep::dd::isRegex(refname)) { - if (!dd4hep::dd::compareEqual(name, refname)) { - flag = false; - break; - } else { - flag = true; - continue; - } - } else { - if (!regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))) { - flag = false; - break; - } else { - flag = true; - continue; - } - } - } - return flag; - }); - if (k != end(i->paths)) { - result = i->strValue(key); - return result; - } + currentSpecPar_ = find(key); + if (currentSpecPar_ != nullptr) { + result = currentSpecPar_->strValue(key); } - return result; } template <> -double DDFilteredView::get(const string& key) const { +double DDFilteredView::get(const string& key) { double result(0.0); std::string_view tmpStrV = get(key); if (!tmpStrV.empty()) @@ -668,6 +614,83 @@ const ExpandedNodes& DDFilteredView::history() { return nodes_; } +const DDSpecPar* DDFilteredView::find(const std::string& key) const { + DDSpecParRefs refs; + registry_->filter(refs, key, ""); + int level = it_.back().GetLevel(); + for (auto const& i : refs) { + auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { + auto topos = j.size(); + auto frompos = j.rfind('/'); + bool flag = false; + for (int nit = level; frompos - 1 <= topos and nit > 0; --nit) { + std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); + std::string_view refname{&j[frompos + 1], topos - frompos - 1}; + topos = frompos; + frompos = j.substr(0, topos).rfind('/'); + + auto rpos = refname.find(':'); + if (rpos == refname.npos) { + name = noNamespace(name); + } else { + if (name.find(':') == name.npos) { + refname.remove_prefix(rpos + 1); + } + } + auto cpos = refname.rfind('['); + if (cpos != refname.npos) { + if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum()) { + refname.remove_suffix(refname.size() - cpos); + flag = true; + continue; + } else { + flag = false; + break; + } + } + if (!dd4hep::dd::isRegex(refname)) { + if (!dd4hep::dd::compareEqual(name, refname)) { + flag = false; + break; + } else { + flag = true; + continue; + } + } else { + if (!regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))) { + flag = false; + break; + } else { + flag = true; + continue; + } + } + } + return flag; + }); + if (k != end(i->paths)) { + return i; + } + } + + return nullptr; +} + +double DDFilteredView::getNextValue(const std::string& key) const { + double result(0.0); + std::string_view tmpresult; + + if (currentSpecPar_ != nullptr) { + tmpresult = currentSpecPar_->strValue(key); + } + if (!tmpresult.empty()) { + result = dd4hep::_toDouble({tmpresult.data(), tmpresult.size()}); + } + + return result; +} + + std::string_view DDFilteredView::name() const { return (volume().volume().name()); } dd4hep::Solid DDFilteredView::solid() const { return (volume().volume().solid()); } diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc index da508c19c00f6..b4d7f317af5b1 100644 --- a/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc +++ b/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc @@ -26,6 +26,8 @@ class testDDFilteredViewGoTo : public CppUnit::TestFixture { private: void printMe(const cms::DDFilteredView&); + double refRadLength_ = 0.03142; + double refXi_ = 6.24526e-05; std::string fileName_; std::vector refPos_{0, 0, 6, 2, 2}; }; @@ -60,8 +62,12 @@ void testDDFilteredViewGoTo::checkFilteredView() { std::vector activeVol{0, 0, 6, 2, 93, 12, 1, 7, 1, 0}; fview.goTo(activeVol); printMe(fview); + double radLength = fview.get("TrackerRadLength"); - double xi = fview.get("TrackerXi"); + double xi = fview.getNextValue("TrackerXi"); + CPPUNIT_ASSERT(radLength == refRadLength_); + CPPUNIT_ASSERT(xi == refXi_); + std::cout << "TrackerRadLength = " << radLength << "\nTrackerXi = " << xi << "\n"; std::cout << "\n==== Let's go to #45\n"; From cc4ef4cdb5b1eaddea35b05db30171a8ad7df71e Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 1 Oct 2020 17:07:51 +0200 Subject: [PATCH 179/778] code format --- DetectorDescription/DDCMS/interface/DDFilteredView.h | 4 ++-- DetectorDescription/DDCMS/src/DDFilteredView.cc | 3 +-- DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 50b73e48508a9..19c89e79607ba 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -192,7 +192,7 @@ namespace cms { //! extract attribute value template T get(const std::string&); - + //! extract another value from the same SpecPar // call get first to find a relevant one double getNextValue(const std::string&) const; @@ -207,7 +207,7 @@ namespace cms { std::vector get(const std::string&, const std::string&) const; std::string_view getString(const std::string&) const; - + //! return the stack of sibling numbers which indicates // the current position in the DDFilteredView nav_type navPos() const; diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index c86cd53059440..fb20cff1e59d1 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -672,7 +672,7 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { return i; } } - + return nullptr; } @@ -690,7 +690,6 @@ double DDFilteredView::getNextValue(const std::string& key) const { return result; } - std::string_view DDFilteredView::name() const { return (volume().volume().name()); } dd4hep::Solid DDFilteredView::solid() const { return (volume().volume().solid()); } diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc index b4d7f317af5b1..f1462b353e411 100644 --- a/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc +++ b/DetectorDescription/DDCMS/test/DDFilteredView.goto.cppunit.cc @@ -67,7 +67,7 @@ void testDDFilteredViewGoTo::checkFilteredView() { double xi = fview.getNextValue("TrackerXi"); CPPUNIT_ASSERT(radLength == refRadLength_); CPPUNIT_ASSERT(xi == refXi_); - + std::cout << "TrackerRadLength = " << radLength << "\nTrackerXi = " << xi << "\n"; std::cout << "\n==== Let's go to #45\n"; From 494fc6fe9bacd8dead6fc22aa8d7d0afb20e3fc8 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Thu, 1 Oct 2020 17:51:32 +0200 Subject: [PATCH 180/778] Avoid dangling reference --- FWCore/Framework/interface/ConsumesCollector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FWCore/Framework/interface/ConsumesCollector.h b/FWCore/Framework/interface/ConsumesCollector.h index a97e78d355306..c8467a512de62 100644 --- a/FWCore/Framework/interface/ConsumesCollector.h +++ b/FWCore/Framework/interface/ConsumesCollector.h @@ -161,7 +161,7 @@ namespace edm { : m_consumer(std::move(iBase)), m_tag(std::move(iTag)) {} ConsumesCollector m_consumer; - ESInputTag const& m_tag; + ESInputTag const m_tag; }; template From 3da83167357696557af72b206c728f41dd012c29 Mon Sep 17 00:00:00 2001 From: mmusich Date: Thu, 1 Oct 2020 13:58:37 +0200 Subject: [PATCH 181/778] improve calibtree production unit test, set compression settings, multi-threaded production, remove errors from missing triggers --- .../test/testProduceCalibrationTree_cfg.py | 71 ++++++++++++++++--- CalibTracker/SiStripCommon/test/test_all.sh | 2 +- 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/CalibTracker/SiStripCommon/test/testProduceCalibrationTree_cfg.py b/CalibTracker/SiStripCommon/test/testProduceCalibrationTree_cfg.py index 3c1f0699eddaf..328d3c4c97ec6 100644 --- a/CalibTracker/SiStripCommon/test/testProduceCalibrationTree_cfg.py +++ b/CalibTracker/SiStripCommon/test/testProduceCalibrationTree_cfg.py @@ -4,6 +4,20 @@ import FWCore.ParameterSet.VarParsing as VarParsing from CalibTracker.SiStripCommon.shallowTree_test_template import * +################################################################### +def alterTriggersForUnitTest(process): +################################################################### + ''' + These modification as necessary only in order to run on a + RelVal MC in which the physics menu is not simulated! + ''' + if(hasattr(process,'AAGFilter')): + process.AAGFilter.triggerConditions = ["HLT_Random_v*"] + if(hasattr(process,'IsolatedMuonFilter')): + process.IsolatedMuonFilter.triggerConditions = ["MC_IsoMu_v*"] + + return process + ################################################################### # Setup 'standard' options ################################################################### @@ -45,6 +59,12 @@ VarParsing.VarParsing.varType.int, "number of events to process (\"-1\" for all)") +options.register('unitTest', + False, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + "is for unit test?") + options.parseArguments() print("conditionGT : ", options.conditionGT) @@ -68,6 +88,12 @@ process.GlobalTag = GlobalTag(process.GlobalTag, options.conditionGT, options.conditionOverwrite) process.load('FWCore.MessageService.MessageLogger_cfi') +process.MessageLogger.destinations = ['cout', 'cerr'] +if(options.unitTest): + process.MessageLogger.cerr.FwkReport.reportEvery = 1 +else: + process.MessageLogger.cerr.FwkReport.reportEvery = 100 + process.load('Configuration.StandardSequences.Services_cff') process.add_( cms.Service( "TFileService", fileName = cms.string( options.outputFile ), @@ -81,9 +107,6 @@ fileNames = cms.untracked.vstring(options.inputFiles[0]) ) -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) -process.MessageLogger.cerr.FwkReport.reportEvery = 10000 - #definition of input collection process.CalibrationTracks.src = cms.InputTag( options.inputCollection ) process.shallowTracks.Tracks = cms.InputTag( options.inputCollection ) @@ -98,22 +121,29 @@ ## process.L1T1.L1TechTriggerSeeding = cms.bool(True) ## process.L1T1.L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)') -#compressionSettings = 201 +compressionSettings = 201 process.EventInfo = cms.EDAnalyzer("ShallowTree", CompressionSettings = process.gainCalibrationTreeStdBunch.CompressionSettings, outputCommands = cms.untracked.vstring('drop *', 'keep *_shallowEventRun_*_*', ) ) -#process.gainCalibrationTreeStdBunch.CompressionSettings = cms.untracked.int32(compressionSettings) -#process.gainCalibrationTreeStdBunch0T.CompressionSettings = cms.untracked.int32(compressionSettings) -#process.gainCalibrationTreeIsoMuon.CompressionSettings = cms.untracked.int32(compressionSettings) -#process.gainCalibrationTreeIsoMuon0T.CompressionSettings = cms.untracked.int32(compressionSettings) -#process.gainCalibrationTreeAagBunch.CompressionSettings = cms.untracked.int32(compressionSettings) -#process.gainCalibrationTreeAagBunch0T.CompressionSettings = cms.untracked.int32(compressionSettings) + +process.gainCalibrationTreeStdBunch.CompressionSettings = cms.untracked.int32(compressionSettings) +process.gainCalibrationTreeStdBunch0T.CompressionSettings = cms.untracked.int32(compressionSettings) +process.gainCalibrationTreeIsoMuon.CompressionSettings = cms.untracked.int32(compressionSettings) +process.gainCalibrationTreeIsoMuon0T.CompressionSettings = cms.untracked.int32(compressionSettings) +process.gainCalibrationTreeAagBunch.CompressionSettings = cms.untracked.int32(compressionSettings) +process.gainCalibrationTreeAagBunch0T.CompressionSettings = cms.untracked.int32(compressionSettings) #process.TkCalPath = cms.Path(process.L1T1*process.TkCalFullSequence) +### if it is a unit test run, do not look for not existing triggers +### e.g. no AAG in MC + +if(options.unitTest): + alterTriggersForUnitTest(process) + process.TkCalPath_StdBunch = cms.Path(process.TkCalSeq_StdBunch*process.shallowEventRun*process.EventInfo) process.TkCalPath_StdBunch0T = cms.Path(process.TkCalSeq_StdBunch0T*process.shallowEventRun*process.EventInfo) process.TkCalPath_IsoMuon = cms.Path(process.TkCalSeq_IsoMuon*process.shallowEventRun*process.EventInfo) @@ -123,13 +153,14 @@ process.schedule = cms.Schedule( process.TkCalPath_StdBunch, process.TkCalPath_StdBunch0T, - process.TkCalPath_IsoMuon, # no After Abort Gap in MC + process.TkCalPath_IsoMuon, process.TkCalPath_IsoMuon0T, process.TkCalPath_AagBunch, process.TkCalPath_AagBunch0T, ) process.options = cms.untracked.PSet( + #wantSummary = cms.untracked.bool(True), Rethrow = cms.untracked.vstring('OtherCMS', 'StdException', 'Unknown', @@ -157,3 +188,21 @@ 'ProductDoesNotSupportPtr', 'NotFound') ) + +process.Timing = cms.Service("Timing", + summaryOnly = cms.untracked.bool(True), + useJobReport = cms.untracked.bool(True) + ) + +''' +if(options.unitTest): + process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck", + ignoreTotal = cms.untracked.int32(1), + moduleMemorySummary = cms.untracked.bool(True) + ) +''' + +#Setup FWK for multithreaded +process.options.numberOfThreads=cms.untracked.uint32(4) +process.options.numberOfStreams=cms.untracked.uint32(0) +#process.options.numberOfConcurrentLuminosityBlocks=cms.untracked.uint32(2) ## not yet diff --git a/CalibTracker/SiStripCommon/test/test_all.sh b/CalibTracker/SiStripCommon/test/test_all.sh index 628430420f8bc..92fefbc66d358 100755 --- a/CalibTracker/SiStripCommon/test/test_all.sh +++ b/CalibTracker/SiStripCommon/test/test_all.sh @@ -4,4 +4,4 @@ function die { echo $1: status $2 ; exit $2; } echo "TESTING CalibTracker/SiStripCommon ..." cmsRun ${LOCAL_TEST_DIR}/test_all_cfg.py || die "Failure running test_CalibTrackerSiStripCommon_cfg.py" $? -cmsRun ${LOCAL_TEST_DIR}/testProduceCalibrationTree_cfg.py maxEvents=1 || die "Failure running produceCalibrationTree_template_cfg.py" $? +cmsRun ${LOCAL_TEST_DIR}/testProduceCalibrationTree_cfg.py maxEvents=10 unitTest=True || die "Failure running produceCalibrationTree_template_cfg.py" $? From 2c77c10c608b844450bd3f015c81304fac785ab9 Mon Sep 17 00:00:00 2001 From: mmusich Date: Thu, 1 Oct 2020 18:15:25 +0200 Subject: [PATCH 182/778] revert change of ShallowGainCalibration from stream to global module --- .../plugins/ShallowGainCalibration.cc | 45 +++++++++---------- .../plugins/ShallowGainCalibration.h | 42 ++++++----------- 2 files changed, 34 insertions(+), 53 deletions(-) diff --git a/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc b/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc index 38ff4c175ca81..6d27667bd096b 100644 --- a/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc +++ b/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc @@ -1,4 +1,3 @@ -#include #include "ShallowGainCalibration.h" using namespace edm; @@ -8,8 +7,9 @@ using namespace std; ShallowGainCalibration::ShallowGainCalibration(const edm::ParameterSet& iConfig) : tracks_token_(consumes>(iConfig.getParameter("Tracks"))), association_token_(consumes(iConfig.getParameter("Tracks"))), - geomToken_(esConsumes()), - gainToken_(esConsumes()), + trackerGeometry_token_(esConsumes()), + gain_token_(esConsumes()), + tkGeom_token_(esConsumes()), Suffix(iConfig.getParameter("Suffix")), Prefix(iConfig.getParameter("Prefix")) { produces>(Prefix + "trackindex" + Suffix); @@ -32,7 +32,7 @@ ShallowGainCalibration::ShallowGainCalibration(const edm::ParameterSet& iConfig) produces>(Prefix + "gainusedTick" + Suffix); } -void ShallowGainCalibration::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { +void ShallowGainCalibration::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { auto trackindex = std::make_unique>(); auto rawid = std::make_unique>(); auto localdirx = std::make_unique>(); @@ -52,14 +52,13 @@ void ShallowGainCalibration::produce(edm::StreamID, edm::Event& iEvent, const ed auto gainused = std::make_unique>(); auto gainusedTick = std::make_unique>(); - edm::ESHandle gainHandle = iSetup.getHandle(gainToken_); + m_tracker = &iSetup.getData(trackerGeometry_token_); + edm::ESHandle gainHandle = iSetup.getHandle(gain_token_); edm::Handle> tracks; iEvent.getByToken(tracks_token_, tracks); edm::Handle associations; iEvent.getByToken(association_token_, associations); - auto bundle = *runCache(iEvent.getRun().index()); - for (TrajTrackAssociationCollection::const_iterator association = associations->begin(); association != associations->end(); association++) { @@ -112,8 +111,7 @@ void ShallowGainCalibration::produce(edm::StreamID, edm::Event& iEvent, const ed bool Saturation = false; bool Overlapping = false; unsigned int Charge = 0; - auto thicknessMap = bundle.getThicknessMap(); - double Path = (10.0 * thicknessMap[DetId]) / fabs(cosine); + double Path = (10.0 * thickness(DetId)) / fabs(cosine); double PrevGain = -1; double PrevGainTick = -1; int FirstStrip = 0; @@ -201,7 +199,7 @@ void ShallowGainCalibration::produce(edm::StreamID, edm::Event& iEvent, const ed nstrips->push_back(NStrips); saturation->push_back(Saturation); overlapping->push_back(Overlapping); - farfromedge->push_back(StripCluster ? isFarFromBorder(&trajState, DetId, bundle.getTrackerGeometry()) : true); + farfromedge->push_back(StripCluster ? isFarFromBorder(&trajState, DetId, &iSetup) : true); charge->push_back(Charge); path->push_back(Path); #ifdef ExtendedCALIBTree @@ -235,7 +233,9 @@ void ShallowGainCalibration::produce(edm::StreamID, edm::Event& iEvent, const ed bool ShallowGainCalibration::isFarFromBorder(TrajectoryStateOnSurface* trajState, const uint32_t detid, - const TrackerGeometry* tkGeom) const { + const edm::EventSetup* iSetup) { + edm::ESHandle tkGeom = iSetup->getHandle(tkGeom_token_); + LocalPoint HitLocalPos = trajState->localPosition(); LocalError HitLocalError = trajState->localError().positionError(); @@ -266,26 +266,23 @@ bool ShallowGainCalibration::isFarFromBorder(TrajectoryStateOnSurface* trajState return true; } -std::shared_ptr ShallowGainCalibration::globalBeginRun( - edm::Run const& iRun, edm::EventSetup const& iSetup) const { - edm::ESHandle theTrackerGeometry = iSetup.getHandle(geomToken_); - auto bundle = std::make_shared(theTrackerGeometry.product()); - - for (const auto& it : theTrackerGeometry->detUnits()) { +double ShallowGainCalibration::thickness(DetId id) { + map::iterator th = m_thicknessMap.find(id); + if (th != m_thicknessMap.end()) + return (*th).second; + else { double detThickness = 1.; - auto id = (it->geographicalId()).rawId(); - + //compute thickness normalization + const GeomDetUnit* it = m_tracker->idToDetUnit(DetId(id)); bool isPixel = dynamic_cast(it) != nullptr; bool isStrip = dynamic_cast(it) != nullptr; - if (!isPixel && !isStrip) { throw cms::Exception("Logic Error") << "\t\t this detID doesn't seem to belong to the Tracker"; } else { detThickness = it->surface().bounds().thickness(); } - bundle.get()->updateMap(id, detThickness); + + m_thicknessMap[id] = detThickness; //computed value + return detThickness; } - return bundle; } - -void ShallowGainCalibration::globalEndRun(edm::Run const&, edm::EventSetup const&) const {} diff --git a/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.h b/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.h index 5760085c4f056..0010d6a44994e 100644 --- a/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.h +++ b/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.h @@ -1,7 +1,7 @@ #ifndef SHALLOW_GAINCALIBRATION_PRODUCER #define SHALLOW_GAINCALIBRATION_PRODUCER -#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "CalibTracker/SiStripCommon/interface/ShallowTools.h" @@ -16,8 +16,6 @@ #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "CondFormats/SiStripObjects/interface/SiStripLorentzAngle.h" #include "CondFormats/DataRecord/interface/SiStripLorentzAngleRcd.h" -#include "CalibFormats/SiStripObjects/interface/SiStripGain.h" -#include "CalibTracker/Records/interface/SiStripGainRcd.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" @@ -50,41 +48,27 @@ #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" -#include "FWCore/Utilities/interface/ESGetToken.h" - -using DetIdMap = std::map; - -namespace shallowGainCalibration { - struct bundle { - bundle(const TrackerGeometry* trackerG) : tkGeo_(trackerG), value_({{0, 0.}}) {} - void updateMap(uint32_t id, double thickness) { value_.insert(std::make_pair(id, thickness)); } - DetIdMap getThicknessMap() { return value_; } - const TrackerGeometry* getTrackerGeometry() { return tkGeo_; } - private: - const TrackerGeometry* tkGeo_; - DetIdMap value_; - }; -} // namespace shallowGainCalibration - -class ShallowGainCalibration : public edm::global::EDProducer > { +class ShallowGainCalibration : public edm::stream::EDProducer<> { public: explicit ShallowGainCalibration(const edm::ParameterSet&); - std::shared_ptr globalBeginRun(edm::Run const&, - edm::EventSetup const&) const override; - void globalEndRun(edm::Run const&, edm::EventSetup const&) const override; private: const edm::EDGetTokenT > tracks_token_; const edm::EDGetTokenT association_token_; - const edm::ESGetToken geomToken_; - const edm::ESGetToken gainToken_; + + const edm::ESGetToken trackerGeometry_token_; + const edm::ESGetToken gain_token_; + const edm::ESGetToken tkGeom_token_; + std::string Suffix; std::string Prefix; - void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; - bool isFarFromBorder(TrajectoryStateOnSurface* trajState, - const uint32_t detid, - const TrackerGeometry* trackerG) const; + void produce(edm::Event&, const edm::EventSetup&) override; + bool isFarFromBorder(TrajectoryStateOnSurface* trajState, const uint32_t detid, const edm::EventSetup* iSetup); + double thickness(DetId id); + + const TrackerGeometry* m_tracker; + std::map m_thicknessMap; }; #endif From 0fcdc066428c30c212ef2d9b750b60c3c1e59bbc Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 1 Oct 2020 21:16:25 +0200 Subject: [PATCH 183/778] use era for a few more parameters --- .../PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py | 5 ----- .../ImpactParameter/python/impactParameterTagInfos_cfi.py | 4 ++++ RecoJets/JetAssociationProducers/python/ak5JTA_cff.py | 7 +++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index a2b5fc30305d0..05680c7e97ef5 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -38,11 +38,6 @@ from RecoBTag.ImpactParameter.trackCounting3D3rdComputer_cfi import * from PhysicsTools.PatAlgos.recoLayer0.jetCorrFactors_cfi import * -ak5JetTracksAssociatorAtVertex.jets = "akCs4PFJets" -ak5JetTracksAssociatorAtVertex.tracks = "highPurityGeneralTracks" - -impactParameterTagInfos.jetTracks = "ak5JetTracksAssociatorAtVertex" - recoPFJetsHIpostAODTask = cms.Task( PFTowers, pfEmptyCollection, diff --git a/RecoBTag/ImpactParameter/python/impactParameterTagInfos_cfi.py b/RecoBTag/ImpactParameter/python/impactParameterTagInfos_cfi.py index 597725bad1b6d..9e9a1f8c90151 100644 --- a/RecoBTag/ImpactParameter/python/impactParameterTagInfos_cfi.py +++ b/RecoBTag/ImpactParameter/python/impactParameterTagInfos_cfi.py @@ -16,3 +16,7 @@ jetDirectionUsingGhostTrack = cms.bool(False), useTrackQuality = cms.bool(False) ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(impactParameterTagInfos, jetTracks = "ak5JetTracksAssociatorAtVertex") diff --git a/RecoJets/JetAssociationProducers/python/ak5JTA_cff.py b/RecoJets/JetAssociationProducers/python/ak5JTA_cff.py index 75d19cbb364b2..29228c9866218 100644 --- a/RecoJets/JetAssociationProducers/python/ak5JTA_cff.py +++ b/RecoJets/JetAssociationProducers/python/ak5JTA_cff.py @@ -40,3 +40,10 @@ ak5JTAExplicitTask = cms.Task(ak5JetTracksAssociatorExplicit) ak5JTAExplicit = cms.Sequence(ak5JTAExplicitTask) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(ak5JetTracksAssociatorAtVertex, + jets = "akCs4PFJets", + tracks = "highPurityGeneralTracks" + ) From 60b38627ccbd64d52fa77d056bd3661a0488ee78 Mon Sep 17 00:00:00 2001 From: Chris West Date: Thu, 1 Oct 2020 23:28:02 +0200 Subject: [PATCH 184/778] Update 2018 HI data and MC GTs for re-miniAOD --- Configuration/AlCa/python/autoCond.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Configuration/AlCa/python/autoCond.py b/Configuration/AlCa/python/autoCond.py index bb3c08b7c0b96..b745f1eb7e2ca 100644 --- a/Configuration/AlCa/python/autoCond.py +++ b/Configuration/AlCa/python/autoCond.py @@ -34,7 +34,7 @@ # GlobalTag for Run2 data relvals: allows customization to run with fixed L1 menu 'run2_data_relval' : '112X_dataRun2_relval_v3', # GlobalTag for Run2 HI data - 'run2_data_promptlike_hi' : '110X_dataRun2_PromptLike_HI_v10', + 'run2_data_promptlike_hi' : '112X_dataRun2_PromptLike_HI_v1', # GlobalTag for Run1 HLT: it points to the online GT 'run1_hlt' : '101X_dataRun2_HLT_frozen_v9', # GlobalTag for Run2 HLT: it points to the online GT @@ -61,7 +61,7 @@ # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector 'phase1_2018_realistic' : '112X_upgrade2018_realistic_v3', # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector for Heavy Ion - 'phase1_2018_realistic_hi' : '112X_upgrade2018_realistic_HI_v3', + 'phase1_2018_realistic_hi' : '112X_upgrade2018_realistic_HI_v4', # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector: HEM-15-16 fail 'phase1_2018_realistic_HEfail' : '112X_upgrade2018_realistic_HEfail_v3', # GlobalTag for MC production (cosmics) with realistic conditions for full Phase1 2018 detector, Strip tracker in DECO mode From ff16830544e699cf74d6ea2eb3ac64ad25a5bac1 Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Fri, 2 Oct 2020 01:15:48 +0200 Subject: [PATCH 185/778] Bug fix for PackedCandidateMuonSelectorProducer regarding refence comparison --- .../PatAlgos/plugins/PackedCandidateMuonSelectorProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysicsTools/PatAlgos/plugins/PackedCandidateMuonSelectorProducer.cc b/PhysicsTools/PatAlgos/plugins/PackedCandidateMuonSelectorProducer.cc index 606da96cc6f21..dbe28cb63fccd 100644 --- a/PhysicsTools/PatAlgos/plugins/PackedCandidateMuonSelectorProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PackedCandidateMuonSelectorProducer.cc @@ -94,7 +94,7 @@ void pat::PackedCandidateMuonSelectorProducer::produce(edm::Event& iEvent, const const auto& cand = pat::PackedCandidateRef(candidates, i); const auto& candTrack = candidate2PF[cand]->trackRef(); // check if candidate and muon are compatible - if (candTrack.isNonnull() && muonTrack.id() == candTrack.id()) { + if (candTrack.isNonnull() && muonTrack == candTrack) { for (const auto& sel : muonSelectors_) { if (muon::isGoodMuon(muon, muon::selectionTypeFromString(sel))) candMap[sel]->push_back(cand); From f7f4a6f3a8a3113239dfb1dbf4be31c194ec8a48 Mon Sep 17 00:00:00 2001 From: Caroline Date: Fri, 2 Oct 2020 09:45:02 +0200 Subject: [PATCH 186/778] changing LogInfo by LogVerbatim --- .../plugins/SiPixelChargeReweightingAlgorithm.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc index f3f5e3e1dd5f1..d5be85c24fa93 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc @@ -109,8 +109,8 @@ SiPixelChargeReweightingAlgorithm::SiPixelChargeReweightingAlgorithm(const edm:: UseReweighting(conf.getParameter("UseReweighting")), PrintClusters(conf.getParameter("PrintClusters")), PrintTemplates(conf.getParameter("PrintTemplates")) { - LogInfo("PixelDigitizer ") << "SiPixelChargeReweightingAlgorithm constructed" - << "UseReweighting = " << UseReweighting; + edm::LogVerbatim("PixelDigitizer ") << "SiPixelChargeReweightingAlgorithm constructed" + << " with UseReweighting = " << UseReweighting; } //========================================================================= From 74cf76964f096439a455f05eb9ef34e47ae8a74e Mon Sep 17 00:00:00 2001 From: Caroline Date: Fri, 2 Oct 2020 09:56:29 +0200 Subject: [PATCH 187/778] code-checks & code-format --- .../plugins/SiPixelChargeReweightingAlgorithm.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc index d5be85c24fa93..1d1f601f222c3 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelChargeReweightingAlgorithm.cc @@ -109,8 +109,8 @@ SiPixelChargeReweightingAlgorithm::SiPixelChargeReweightingAlgorithm(const edm:: UseReweighting(conf.getParameter("UseReweighting")), PrintClusters(conf.getParameter("PrintClusters")), PrintTemplates(conf.getParameter("PrintTemplates")) { - edm::LogVerbatim("PixelDigitizer ") << "SiPixelChargeReweightingAlgorithm constructed" - << " with UseReweighting = " << UseReweighting; + edm::LogVerbatim("PixelDigitizer ") << "SiPixelChargeReweightingAlgorithm constructed" + << " with UseReweighting = " << UseReweighting; } //========================================================================= From 4671911874364aaf28cba8d487c851dd7e8c1029 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 2 Oct 2020 11:08:25 +0200 Subject: [PATCH 188/778] make ShallowTree an edm::one::EDAnalyzer --- CalibTracker/SiStripCommon/plugins/ShallowTree.cc | 4 ++-- CalibTracker/SiStripCommon/plugins/ShallowTree.h | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CalibTracker/SiStripCommon/plugins/ShallowTree.cc b/CalibTracker/SiStripCommon/plugins/ShallowTree.cc index 05a160baf8c4d..986e81fc83717 100644 --- a/CalibTracker/SiStripCommon/plugins/ShallowTree.cc +++ b/CalibTracker/SiStripCommon/plugins/ShallowTree.cc @@ -8,6 +8,8 @@ #include ShallowTree::ShallowTree(const edm::ParameterSet& iConfig) { + usesResource(TFileService::kSharedResource); + //int compSettings= iConfig.getParameter("CompressionSettings",-1); int compSettings = iConfig.getUntrackedParameter("CompressionSettings", -1); if (compSettings > 0) @@ -194,5 +196,3 @@ ShallowTree::TypedBranchConnector::TypedBranchConnector(edm::BranchDescriptio tree->Branch(pin.c_str(), &object_ptr_); } //vector } - -void ShallowTree::beginJob() {} diff --git a/CalibTracker/SiStripCommon/plugins/ShallowTree.h b/CalibTracker/SiStripCommon/plugins/ShallowTree.h index 2c5c7bd3c9cb3..26f2b11dc740f 100644 --- a/CalibTracker/SiStripCommon/plugins/ShallowTree.h +++ b/CalibTracker/SiStripCommon/plugins/ShallowTree.h @@ -19,7 +19,7 @@ */ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" @@ -30,11 +30,9 @@ #include #include -class ShallowTree : public edm::EDAnalyzer { +class ShallowTree : public edm::one::EDAnalyzer { private: - void beginJob() override; void analyze(const edm::Event&, const edm::EventSetup&) override; - void endJob() override {} template void eat(edm::BranchDescription const* desc) { From dbf582d6beb3731693b7b3e0466f175455ae9104 Mon Sep 17 00:00:00 2001 From: mmusich Date: Wed, 25 Mar 2020 18:06:45 +0100 Subject: [PATCH 189/778] first push --- .../test/PVValidationHTCondorSubmitter.py | 1035 +++++++++++++++++ .../test/PVValidation_T_standardRefit_cfg.py | 302 +++++ .../OfflineValidation/test/submitAllJobs.py | 8 +- .../test/testPVValidation.ini | 11 +- .../test/testPVValidation_Relvals_DATA.ini | 2 +- 5 files changed, 1350 insertions(+), 8 deletions(-) create mode 100644 Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py create mode 100644 Alignment/OfflineValidation/test/PVValidation_T_standardRefit_cfg.py diff --git a/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py b/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py new file mode 100644 index 0000000000000..06b5934d03c0c --- /dev/null +++ b/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py @@ -0,0 +1,1035 @@ +#!/usr/bin/env python + +'''Script that submits CMS Tracker Alignment Primary Vertex Validation workflows +''' + +from __future__ import print_function +from builtins import range + +__author__ = 'Marco Musich' +__copyright__ = 'Copyright 2015, CERN CMS' +__credits__ = ['Ernesto Migliore', 'Salvatore Di Guida'] +__license__ = 'Unknown' +__maintainer__ = 'Marco Musich' +__email__ = 'marco.musich@cern.ch' +__version__ = 1 + +import datetime,time +import os,sys +import copy +import pickle +import string, re +import configparser as ConfigParser +import json +#import ConfigParser, json +import subprocess +from optparse import OptionParser +from subprocess import Popen, PIPE +import collections +import multiprocessing + +############################################## +def write_HTCondor_submit_file(path, name, nruns, proxy_path=None): +############################################## + """Writes 'job.submit' file in `path`. + Arguments: + - `path`: job directory + - `script`: script to be executed + - `proxy_path`: path to proxy (only used in case of requested proxy forward) + """ + + job_submit_template="""\ +universe = vanilla +requirements = (OpSysAndVer =?= "SLCern6") +executable = {script:s} +output = {jobm:s}/{out:s}.out +error = {jobm:s}/{out:s}.err +log = {jobm:s}/{out:s}.log +transfer_output_files = "" ++JobFlavour = "{flavour:s}" +queue {njobs:s} +""" + if proxy_path is not None: + job_submit_template += """\ ++x509userproxy = "{proxy:s}" +""" + + job_submit_file = os.path.join(path, "job_"+name+".submit") + with open(job_submit_file, "w") as f: + f.write(job_submit_template.format(script = os.path.join(path,name+"_$(ProcId).sh"), + out = name+"_$(ProcId)", + jobm = os.path.abspath(path), + flavour = "tomorrow", + njobs = str(nruns), + proxy = proxy_path)) + + return job_submit_file + +############################################## +def getCommandOutput(command): +############################################## + """This function executes `command` and returns it output. + Arguments: + - `command`: Shell command to be invoked by this function. + """ + child = os.popen(command) + data = child.read() + err = child.close() + if err: + print('%s failed w/ exit code %d' % (command, err)) + return data + +############################################## +def getFilesForRun(blob): +############################################## + cmd2 = ' dasgoclient -limit=0 -query \'file run='+blob[0]+' dataset='+blob[1]+'\'' + #cmd2 = 'dasgoclient -query \'file run='+blob[0]+' dataset='+blob[1]+'\'' + q = Popen(cmd2 , shell=True, stdout=PIPE, stderr=PIPE) + out, err = q.communicate() + #print(cmd2,'\n',out.rstrip('\n')) + outputList = out.decode().split('\n') + outputList.pop() + return outputList #,err + +############################################## +def getNEvents(run, dataset): +############################################## + nEvents = subprocess.check_output(["das_client", "--limit", "0", "--query", "summary run={} dataset={} | grep summary.nevents".format(run, dataset)]) + return 0 if nEvents == "[]\n" else int(nEvents) + +############################################## +def getLuminosity(minRun,maxRun,isRunBased): +############################################## + """Expects something like + +-------+------+--------+--------+-------------------+------------------+ + | nfill | nrun | nls | ncms | totdelivered(/fb) | totrecorded(/fb) | + +-------+------+--------+--------+-------------------+------------------+ + | 73 | 327 | 142418 | 138935 | 19.562 | 18.036 | + +-------+------+--------+--------+-------------------+------------------+ + And extracts the total recorded luminosity (/b). + """ + myCachedLumi={} + if(not isRunBased): + return myCachedLumi + + #output = subprocess.check_output(["/afs/cern.ch/user/m/musich/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS", "--normtag=/afs/cern.ch/user/l/lumipro/public/normtag_file/normtag_BRIL.json", "-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) + output = subprocess.check_output(["/afs/cern.ch/user/m/musich/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS","-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv","-c","web"]) + + print("INSIDE GET LUMINOSITY") + print(output) + + for line in output.decode().split("\n"): + if ("#" not in line): + runToCache = line.split(",")[0].split(":")[0] + lumiToCache = line.split(",")[-1].replace("\r", "") + #print "run",runToCache + #print "lumi",lumiToCache + myCachedLumi[runToCache] = lumiToCache + + print(myCachedLumi) + return myCachedLumi + +############################################## +def isInJSON(run,jsonfile): +############################################## + with open(jsonfile, 'rb') as myJSON: + jsonDATA = json.load(myJSON) + return (run in jsonDATA) + +############################################## +def to_bool(value): +############################################## + """ + Converts 'something' to boolean. Raises exception for invalid formats + Possible True values: 1, True, "1", "TRue", "yes", "y", "t" + Possible False values: 0, False, None, [], {}, "", "0", "faLse", "no", "n", "f", 0.0, ... + """ + if str(value).lower() in ("yes", "y", "true", "t", "1"): return True + if str(value).lower() in ("no", "n", "false", "f", "0", "0.0", "", "none", "[]", "{}"): return False + raise Exception('Invalid value for boolean conversion: ' + str(value)) + +############################################## +def updateDB2(): +############################################## + dbName = "runInfo.pkl" + infos = {} + if os.path.exists(dbName): + with open(dbName,'rb') as f: + infos = pickle.load(f) + + for f in glob.glob("root-files/Run*.root"): + run = runFromFilename(f) + if run not in infos: + infos[run] = {} + infos[run]["start_time"] = getRunStartTime(run) + infos["isValid"] = isValid(f) + + with open(dbName, "wb") as f: + pickle.dump(infos, f) + +############################################## +def updateDB(run,runInfo): +############################################## + dbName = "runInfo.pkl" + infos = {} + if os.path.exists(dbName): + with open(dbName,'rb') as f: + infos = pickle.load(f) + + if run not in infos: + infos[run] = runInfo + + with open(dbName, "wb") as f: + pickle.dump(infos, f) + +####################--- Classes ---############################ +class BetterConfigParser(ConfigParser.ConfigParser): + + ############################################## + def optionxform(self, optionstr): + return optionstr + + ############################################## + def exists( self, section, option): + try: + items = self.items(section) + except ConfigParser.NoSectionError: + return False + for item in items: + if item[0] == option: + return True + return False + + ############################################## + def __updateDict( self, dictionary, section ): + result = dictionary + try: + for option in self.options( section ): + result[option] = self.get( section, option ) + if "local"+section.title() in self.sections(): + for option in self.options( "local"+section.title() ): + result[option] = self.get( "local"+section.title(),option ) + except ConfigParser.NoSectionError as section: + msg = ("%s in configuration files. This section is mandatory." + %(str(section).replace(":", "", 1))) + #raise AllInOneError(msg) + return result + + ############################################## + def getResultingSection( self, section, defaultDict = {}, demandPars = [] ): + result = copy.deepcopy(defaultDict) + for option in demandPars: + try: + result[option] = self.get( section, option ) + except ConfigParser.NoOptionError as globalSectionError: + globalSection = str( globalSectionError ).split( "'" )[-2] + splittedSectionName = section.split( ":" ) + if len( splittedSectionName ) > 1: + localSection = ("local"+section.split( ":" )[0].title()+":" + +section.split(":")[1]) + else: + localSection = ("local"+section.split( ":" )[0].title()) + if self.has_section( localSection ): + try: + result[option] = self.get( localSection, option ) + except ConfigParser.NoOptionError as option: + msg = ("%s. This option is mandatory." + %(str(option).replace(":", "", 1).replace( + "section", + "section '"+globalSection+"' or", 1))) + #raise AllInOneError(msg) + else: + msg = ("%s. This option is mandatory." + %(str(globalSectionError).replace(":", "", 1))) + #raise AllInOneError(msg) + result = self.__updateDict( result, section ) + #print(result) + return result + +##### method to parse the input file ################################ +def ConfigSectionMap(config, section): + the_dict = {} + options = config.options(section) + for option in options: + try: + the_dict[option] = config.get(section, option) + if the_dict[option] == -1: + DebugPrint("skip: %s" % option) + except: + print("exception on %s!" % option) + the_dict[option] = None + return the_dict + +###### method to create recursively directories on EOS ############# +def mkdir_eos(out_path): + print("creating",out_path) + newpath='/' + for dir in out_path.split('/'): + newpath=os.path.join(newpath,dir) + # do not issue mkdir from very top of the tree + if newpath.find('test_out') > 0: + #getCommandOutput("eos mkdir"+newpath) + command="/afs/cern.ch/project/eos/installation/cms/bin/eos.select mkdir "+newpath + p = subprocess.Popen(command,shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (out, err) = p.communicate() + #print(out,err) + p.wait() + + # now check that the directory exists + command2="/afs/cern.ch/project/eos/installation/cms/bin/eos.select ls "+out_path + p = subprocess.Popen(command2,shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (out, err) = p.communicate() + p.wait() + if p.returncode !=0: + print(out) + +def split(sequence, size): +########################## +# aux generator function to split lists +# based on http://sandrotosi.blogspot.com/2011/04/python-group-list-in-sub-lists-of-n.html +# about generators see also http://stackoverflow.com/questions/231767/the-python-yield-keyword-explained +########################## + for i in xrange(0, len(sequence), size): + yield sequence[i:i+size] + +############# +class Job: +############# + + def __init__(self,dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, applyruncontrol, ptcut, CMSSW_dir ,the_dir): +############################### + + theDataSet = dataset.split("/")[1]+"_"+(dataset.split("/")[2]).split("-")[0] + + self.data = theDataSet + self.job_number = job_number + self.job_id = job_id + self.batch_job_id = None + self.job_name = job_name + + self.isDA = isDA + self.isMC = isMC + self.applyBOWS = applyBOWS + self.applyEXTRACOND = applyEXTRACOND + self.extraCondVect = extraconditions + self.runboundary = runboundary + self.lumilist = lumilist + self.intlumi = intlumi + self.maxevents = maxevents + self.gt = gt + self.allFromGT = allFromGT + self.alignmentDB = alignmentDB + self.alignmentTAG = alignmentTAG + self.apeDB = apeDB + self.apeTAG = apeTAG + self.bowDB = bowDB + self.bowTAG = bowTAG + self.vertextype = vertextype + self.tracktype = tracktype + self.applyruncontrol = applyruncontrol + self.ptcut = ptcut + + self.the_dir=the_dir + self.CMSSW_dir=CMSSW_dir + + self.output_full_name=self.getOutputBaseName()+"_"+str(self.job_id) + self.output_number_name=self.getOutputBaseNameWithData()+"_"+str(self.job_number) + + self.cfg_dir=None + self.outputCfgName=None + + # LSF variables + self.LSF_dir=None + self.BASH_dir=None + self.output_LSF_name=None + self.output_BASH_name=None + + self.lfn_list=list() + + #self.OUTDIR = "/eos/cern.ch/user/m/musich/ZbbAnalysis/test01Sept" # TODO: write a setter method + #self.OUTDIR = self.createEOSout() + + def __del__(self): +############################### + del self.lfn_list + + def setEOSout(self,theEOSdir): +############################### + self.OUTDIR = theEOSdir + + def getOutputBaseName(self): +######################## + return "PVValidation_"+self.job_name + + def getOutputBaseNameWithData(self): +######################## + return "PVValidation_"+self.job_name+"_"+self.data + + def createTheCfgFile(self,lfn): +############################### + + # write the cfg file + self.cfg_dir = os.path.join(self.the_dir,"cfg") + if not os.path.exists(self.cfg_dir): + os.makedirs(self.cfg_dir) + + self.outputCfgName=self.output_full_name+"_cfg.py" + fout=open(os.path.join(self.cfg_dir,self.outputCfgName),'w+b') + + # decide which template according to data/mc + if self.isMC: + #template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_DropBPix1_cfg.py") + template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_standardRefit_cfg.py") + #template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_standardRefit_GenericCPE_cfg.py") + else: + #template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_DropBPix1_cfg.py") + template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_standardRefit_cfg.py") + #template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_standardRefit_GenericCPE_cfg.py") + + fin = open(template_cfg_file) + + for line in fin.readlines(): + if(to_bool(self.applyEXTRACOND)): + if 'END OF EXTRA CONDITIONS' in line: + for element in self.extraCondVect : + if("Rcd" in element): + params = self.extraCondVect[element].split(',') + + fout.write(" \n") + fout.write(" process.conditionsIn"+element+"= CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone( \n") + fout.write(" connect = cms.string('"+params[0]+"'), \n") + fout.write(" toGet = cms.VPSet(cms.PSet(record = cms.string('"+element+"'), \n") + fout.write(" tag = cms.string('"+params[1]+"'), \n") + if (len(params)>2): + fout.write(" label = cms.string('"+params[2]+"') \n") + fout.write(" ) \n") + fout.write(" ) \n") + fout.write(" ) \n") + fout.write(" process.prefer_conditionsIn"+element+" = cms.ESPrefer(\"PoolDBESSource\", \"conditionsIn"+element+"\") \n \n") + + if self.isMC: + if line.find("ISDATEMPLATE")!=-1: + line=line.replace("ISDATEMPLATE",self.isDA) + if line.find("ISMCTEMPLATE")!=-1: + line=line.replace("ISMCTEMPLATE",self.isMC) + if line.find("APPLYBOWSTEMPLATE")!=-1: + line=line.replace("APPLYBOWSTEMPLATE",self.applyBOWS) + if line.find("EXTRACONDTEMPLATE")!=-1: + line=line.replace("EXTRACONDTEMPLATE",self.applyEXTRACOND) + if line.find("RUNBOUNDARYTEMPLATE")!=-1: + line=line.replace("RUNBOUNDARYTEMPLATE",self.runboundary) + if line.find("LUMILISTTEMPLATE")!=-1: + line=line.replace("LUMILISTTEMPLATE",self.lumilist) + if line.find("INTLUMITEMPLATE")!=-1: + line=line.replace("INTLUMITEMPLATE",self.intlumi) + if line.find("MAXEVENTSTEMPLATE")!=-1: + line=line.replace("MAXEVENTSTEMPLATE",self.maxevents) + if line.find("GLOBALTAGTEMPLATE")!=-1: + line=line.replace("GLOBALTAGTEMPLATE",self.gt) + if line.find("ALLFROMGTTEMPLATE")!=-1: + line=line.replace("ALLFROMGTTEMPLATE",self.allFromGT) + if line.find("ALIGNOBJTEMPLATE")!=-1: + line=line.replace("ALIGNOBJTEMPLATE",self.alignmentDB) + if line.find("GEOMTAGTEMPLATE")!=-1: + line=line.replace("GEOMTAGTEMPLATE",self.alignmentTAG) + if line.find("APEOBJTEMPLATE")!=-1: + line=line.replace("APEOBJTEMPLATE",self.apeDB) + if line.find("ERRORTAGTEMPLATE")!=-1: + line=line.replace("ERRORTAGTEMPLATE",self.apeTAG) + if line.find("BOWSOBJECTTEMPLATE")!=-1: + line=line.replace("BOWSOBJECTTEMPLATE",self.bowDB) + if line.find("BOWSTAGTEMPLATE")!=-1: + line=line.replace("BOWSTAGTEMPLATE",self.bowTAG) + if line.find("VERTEXTYPETEMPLATE")!=-1: + line=line.replace("VERTEXTYPETEMPLATE",self.vertextype) + if line.find("TRACKTYPETEMPLATE")!=-1: + line=line.replace("TRACKTYPETEMPLATE",self.tracktype) + if line.find("PTCUTTEMPLATE")!=-1: + line=line.replace("PTCUTTEMPLATE",self.ptcut) + if line.find("RUNCONTROLTEMPLATE")!=-1: + line=line.replace("RUNCONTROLTEMPLATE",self.applyruncontrol) + else: + if line.find("ISDATTEMPLATE")!=-1: + line=line.replace("ISDATEMPLATE",self.isDA) + if line.find("ISMCTEMPLATE")!=-1: + line=line.replace("ISMCTEMPLATE",self.isMC) + if line.find("APPLYBOWSTEMPLATE")!=-1: + line=line.replace("APPLYBOWSTEMPLATE",self.applyBOWS) + if line.find("EXTRACONDTEMPLATE")!=-1: + line=line.replace("EXTRACONDTEMPLATE",self.applyEXTRACOND) + if line.find("RUNBOUNDARYTEMPLATE")!=-1: + line=line.replace("RUNBOUNDARYTEMPLATE",self.runboundary) + if line.find("LUMILISTTEMPLATE")!=-1: + line=line.replace("LUMILISTTEMPLATE",self.lumilist) + if line.find("INTLUMITEMPLATE")!=-1: + line=line.replace("INTLUMITEMPLATE",self.intlumi) + if line.find("MAXEVENTSTEMPLATE")!=-1: + line=line.replace("MAXEVENTSTEMPLATE",self.maxevents) + if line.find("GLOBALTAGTEMPLATE")!=-1: + line=line.replace("GLOBALTAGTEMPLATE",self.gt) + if line.find("ALLFROMGTTEMPLATE")!=-1: + line=line.replace("ALLFROMGTTEMPLATE",self.allFromGT) + if line.find("ALIGNOBJTEMPLATE")!=-1: + line=line.replace("ALIGNOBJTEMPLATE",self.alignmentDB) + if line.find("GEOMTAGTEMPLATE")!=-1: + line=line.replace("GEOMTAGTEMPLATE",self.alignmentTAG) + if line.find("APEOBJTEMPLATE")!=-1: + line=line.replace("APEOBJTEMPLATE",self.apeDB) + if line.find("ERRORTAGTEMPLATE")!=-1: + line=line.replace("ERRORTAGTEMPLATE",self.apeTAG) + if line.find("BOWSOBJECTTEMPLATE")!=-1: + line=line.replace("BOWSOBJECTTEMPLATE",self.bowDB) + if line.find("BOWSTAGTEMPLATE")!=-1: + line=line.replace("BOWSTAGTEMPLATE",self.bowTAG) + if line.find("VERTEXTYPETEMPLATE")!=-1: + line=line.replace("VERTEXTYPETEMPLATE",self.vertextype) + if line.find("TRACKTYPETEMPLATE")!=-1: + line=line.replace("TRACKTYPETEMPLATE",self.tracktype) + if line.find("PTCUTTEMPLATE")!=-1: + line=line.replace("PTCUTTEMPLATE",self.ptcut) + if line.find("RUNCONTROLTEMPLATE")!=-1: + line=line.replace("RUNCONTROLTEMPLATE",self.applyruncontrol) + + if line.find("FILESOURCETEMPLATE")!=-1: + lfn_with_quotes = map(lambda x: "\'"+x+"\'",lfn) + #print "["+",".join(lfn_with_quotes)+"]" + line=line.replace("FILESOURCETEMPLATE","["+",".join(lfn_with_quotes)+"]") + if line.find("OUTFILETEMPLATE")!=-1: + line=line.replace("OUTFILETEMPLATE",self.output_full_name+".root") + fout.write(line.encode(encoding='UTF-8')) + + fout.close() + + def createTheLSFFile(self): +############################### + + # directory to store the LSF to be submitted + self.LSF_dir = os.path.join(self.the_dir,"LSF") + if not os.path.exists(self.LSF_dir): + os.makedirs(self.LSF_dir) + + self.output_LSF_name=self.output_full_name+".lsf" + fout=open(os.path.join(self.LSF_dir,self.output_LSF_name),'w') + + job_name = self.output_full_name + + log_dir = os.path.join(self.the_dir,"log") + if not os.path.exists(log_dir): + os.makedirs(log_dir) + + fout.write("#!/bin/sh \n") + fout.write("#BSUB -L /bin/sh\n") + fout.write("#BSUB -J "+job_name+"\n") + fout.write("#BSUB -o "+os.path.join(log_dir,job_name+".log")+"\n") + fout.write("#BSUB -q cmscaf1nd \n") + fout.write("JobName="+job_name+" \n") + fout.write("OUT_DIR="+self.OUTDIR+" \n") + fout.write("LXBATCH_DIR=`pwd` \n") + fout.write("cd "+os.path.join(self.CMSSW_dir,"src")+" \n") + fout.write("eval `scram runtime -sh` \n") + fout.write("cd $LXBATCH_DIR \n") + fout.write("cmsRun "+os.path.join(self.cfg_dir,self.outputCfgName)+" \n") + fout.write("ls -lh . \n") + fout.write("for RootOutputFile in $(ls *root ); do xrdcp -f ${RootOutputFile} root://eoscms//eos/cms${OUT_DIR}/${RootOutputFile} ; done \n") + fout.write("for TxtOutputFile in $(ls *txt ); do xrdcp -f ${TxtOutputFile} root://eoscms//eos/cms${OUT_DIR}/${TxtOutputFile} ; done \n") + + fout.close() + + + def createTheBashFile(self): +############################### + + # directory to store the BASH to be submitted + self.BASH_dir = os.path.join(self.the_dir,"BASH") + if not os.path.exists(self.BASH_dir): + os.makedirs(self.BASH_dir) + + self.output_BASH_name=self.output_number_name+".sh" + fout=open(os.path.join(self.BASH_dir,self.output_BASH_name),'w') + + job_name = self.output_full_name + + log_dir = os.path.join(self.the_dir,"log") + if not os.path.exists(log_dir): + os.makedirs(log_dir) + + fout.write("#!/bin/bash \n") + #fout.write("export EOS_MGM_URL=root://eoscms.cern.ch \n") + fout.write("JobName="+job_name+" \n") + fout.write("echo \"Job started at \" `date` \n") + fout.write("CMSSW_DIR="+os.path.join(self.CMSSW_dir,"src")+" \n") + fout.write("OUT_DIR="+self.OUTDIR+" \n") + fout.write("LXBATCH_DIR=$PWD \n") + #fout.write("cd "+os.path.join(self.CMSSW_dir,"src")+" \n") + fout.write("cd ${CMSSW_DIR} \n") + fout.write("eval `scramv1 runtime -sh` \n") + fout.write("echo \"batch dir: $LXBATCH_DIR release: $CMSSW_DIR release base: $CMSSW_RELEASE_BASE\" \n") + fout.write("cd $LXBATCH_DIR \n") + fout.write("cp "+os.path.join(self.cfg_dir,self.outputCfgName)+" . \n") + fout.write("echo \"cmsRun "+self.outputCfgName+"\" \n") + fout.write("cmsRun "+self.outputCfgName+" \n") + fout.write("echo \"Content of working dir is \"`ls -lh` \n") + #fout.write("less condor_exec.exe \n") + fout.write("for RootOutputFile in $(ls *root ); do xrdcp -f ${RootOutputFile} root://eoscms//eos/cms${OUT_DIR}/${RootOutputFile} ; done \n") + #fout.write("mv ${JobName}.out ${CMSSW_DIR}/BASH \n") + fout.write("echo \"Job ended at \" `date` \n") + fout.write("exit 0 \n") + + fout.close() + + def getOutputFileName(self): +############################################ + return os.path.join(self.OUTDIR,self.output_full_name+".root") + + def submit(self): +############################### + print("submit job", self.job_id) + job_name = self.output_full_name + submitcommand1 = "chmod u+x " + os.path.join(self.LSF_dir,self.output_LSF_name) + child1 = os.system(submitcommand1) + #submitcommand2 = "bsub < "+os.path.join(self.LSF_dir,self.output_LSF_name) + #child2 = os.system(submitcommand2) + self.batch_job_id = getCommandOutput("bsub < "+os.path.join(self.LSF_dir,self.output_LSF_name)) + + def getBatchjobId(self): +############################################ + return self.batch_job_id.split("<")[1].split(">")[0] + +############################################## +def main(): +############################################## + + # CMSSW section + input_CMSSW_BASE = os.environ.get('CMSSW_BASE') + AnalysisStep_dir = os.path.join(input_CMSSW_BASE,"src/Alignment/OfflineValidation/test") + lib_path = os.path.abspath(AnalysisStep_dir) + sys.path.append(lib_path) + + ## N.B.: this is dediced here once and for all + srcFiles = [] + + desc="""This is a description of %prog.""" + parser = OptionParser(description=desc,version='%prog version 0.1') + parser.add_option('-s','--submit', help='job submitted', dest='submit', action='store_true', default=False) + parser.add_option('-j','--jobname', help='task name', dest='taskname', action='store', default='myTask') + parser.add_option('-D','--dataset', help='selected dataset', dest='data', action='store' , default='') + parser.add_option('-r','--doRunBased',help='selected dataset', dest='doRunBased', action='store_true' , default=False) + parser.add_option('-i','--input', help='set input configuration (overrides default)', dest='inputconfig',action='store',default=None) + parser.add_option('-b','--begin', help='starting point', dest='start', action='store' ,default='1') + parser.add_option('-e','--end', help='ending point', dest='end', action='store' ,default='999999') + + (opts, args) = parser.parse_args() + + now = datetime.datetime.now() + #t = now.strftime("test_%Y_%m_%d_%H_%M_%S_DATA_PixQualityFlag") + #t = "2017UltraLegacy" + t = "2018UltraLegacy" + #t = "2016UltraLegacy" + t+=opts.taskname + + USER = os.environ.get('USER') + eosdir=os.path.join("/store/group/alca_trackeralign",USER,"test_out",t) + + if opts.submit: + mkdir_eos(eosdir) + else: + print("Not going to create EOS folder. -s option has not been chosen") + + #### Initialize all the variables + + jobName = [] + isMC = [] + isDA = [] + doRunBased = [] + maxevents = [] + + gt = [] + allFromGT = [] + applyEXTRACOND = [] + extraCondVect = [] + alignmentDB = [] + alignmentTAG = [] + apeDB = [] + apeTAG = [] + applyBOWS = [] + bowDB = [] + bowTAG = [] + conditions = [] + + vertextype = [] + tracktype = [] + + applyruncontrol = [] + ptcut = [] + runboundary = [] + lumilist = [] + + ConfigFile = opts.inputconfig + + if ConfigFile is not None: + + print("********************************************************") + print("* Parsing from input file:", ConfigFile," ") + + #config = ConfigParser.ConfigParser() + #config.read(ConfigFile) + + config = BetterConfigParser() + config.read(ConfigFile) + + #print config.sections() + + # please notice: since in principle one wants to run on several different samples simultaneously, + # all these inputs are vectors + + doRunBased = opts.doRunBased + + listOfValidations = config.getResultingSection("validations") + + for item in listOfValidations: + if (bool(listOfValidations[item]) == True): + + jobName.append(ConfigSectionMap(config,"Conditions:"+item)['jobname']) + isDA.append(ConfigSectionMap(config,"Job")['isda']) + isMC.append(ConfigSectionMap(config,"Job")['ismc']) + maxevents.append(ConfigSectionMap(config,"Job")['maxevents']) + + gt.append(ConfigSectionMap(config,"Conditions:"+item)['gt']) + allFromGT.append(ConfigSectionMap(config,"Conditions:"+item)['allFromGT']) + applyEXTRACOND.append(ConfigSectionMap(config,"Conditions:"+item)['applyextracond']) + conditions.append(config.getResultingSection("ExtraConditions")) + + alignmentDB.append(ConfigSectionMap(config,"Conditions:"+item)['alignmentdb']) + alignmentTAG.append(ConfigSectionMap(config,"Conditions:"+item)['alignmenttag']) + apeDB.append(ConfigSectionMap(config,"Conditions:"+item)['apedb']) + apeTAG.append(ConfigSectionMap(config,"Conditions:"+item)['apetag']) + applyBOWS.append(ConfigSectionMap(config,"Conditions:"+item)['applybows']) + bowDB.append(ConfigSectionMap(config,"Conditions:"+item)['bowdb']) + bowTAG.append(ConfigSectionMap(config,"Conditions:"+item)['bowtag']) + + vertextype.append(ConfigSectionMap(config,"Type")['vertextype']) + tracktype.append(ConfigSectionMap(config,"Type")['tracktype']) + + applyruncontrol.append(ConfigSectionMap(config,"Selection")['applyruncontrol']) + ptcut.append(ConfigSectionMap(config,"Selection")['ptcut']) + runboundary.append(ConfigSectionMap(config,"Selection")['runboundary']) + lumilist.append(ConfigSectionMap(config,"Selection")['lumilist']) + + else : + + print("********************************************************") + print("* Parsing from command line *") + print("********************************************************") + + jobName = ['testing'] + isDA = ['True'] + isMC = ['True'] + doRunBased = opts.doRunBased + maxevents = ['10000'] + + gt = ['74X_dataRun2_Prompt_v4'] + allFromGT = ['False'] + applyEXTRACOND = ['False'] + conditions = [[('SiPixelTemplateDBObjectRcd','frontier://FrontierProd/CMS_CONDITIONS','SiPixelTemplateDBObject_38T_2015_v3_hltvalidation')]] + alignmentDB = ['frontier://FrontierProd/CMS_CONDITIONS'] + alignmentTAG = ['TrackerAlignment_Prompt'] + apeDB = ['frontier://FrontierProd/CMS_CONDITIONS'] + apeTAG = ['TrackerAlignmentExtendedErr_2009_v2_express_IOVs'] + applyBOWS = ['True'] + bowDB = ['frontier://FrontierProd/CMS_CONDITIONS'] + bowTAG = ['TrackerSurafceDeformations_v1_express'] + + vertextype = ['offlinePrimaryVertices'] + tracktype = ['ALCARECOTkAlMinBias'] + + applyruncontrol = ['False'] + ptcut = ['3'] + runboundary = ['1'] + lumilist = [''] + + # print some of the configuration + + print("********************************************************") + print("* Configuration info *") + print("********************************************************") + print("- submitted : ",opts.submit) + print("- taskname : ",opts.taskname) + print("- Jobname : ",jobName) + print("- use DA : ",isDA) + print("- is MC : ",isMC) + print("- is run-based: ",doRunBased) + print("- evts/job : ",maxevents) + print("- GlobatTag : ",gt) + print("- allFromGT? : ",allFromGT) + print("- extraCond? : ",applyEXTRACOND) + print("- extraCond : ",conditions) + print("- Align db : ",alignmentDB) + print("- Align tag : ",alignmentTAG) + print("- APE db : ",apeDB) + print("- APE tag : ",apeTAG) + print("- use bows? : ",applyBOWS) + print("- K&B db : ",bowDB) + print("- K&B tag : ",bowTAG) + print("- VertexColl : ",vertextype) + print("- TrackColl : ",tracktype) + print("- RunControl? : ",applyruncontrol) + print("- Pt> ",ptcut) + print("- run= ",runboundary) + print("- JSON : ",lumilist) + print("- Out Dir : ",eosdir) + + print("********************************************************") + print("Will run on",len(jobName),"workflows") + + myRuns = [] + mylist = {} + + if(doRunBased): + print(">>>> This is Data!") + print(">>>> Doing run based selection") + cmd = 'dasgoclient -limit=0 -query \'run dataset='+opts.data+'\'' + #cmd = 'dasgoclient -query \'run dataset='+opts.data+'\'' + p = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) + out, err = p.communicate() + print(out) + listOfRuns=out.decode().split("\n") + listOfRuns.pop() + listOfRuns.sort() + #myRuns = listOfRuns + print("Will run on ",len(listOfRuns),"runs") + print(listOfRuns) + + mytuple=[] + + print("first run:",opts.start,"last run:",opts.end) + + for run in listOfRuns: + if (int(run)int(opts.end)): + print("excluding",run) + continue + + if not isInJSON(run,lumilist[0]): + continue + + else: + print("'======> taking",run) + #print "preparing run",run + #if(int(run)%100==0): + mytuple.append((run,opts.data)) + + #print mytuple + + pool = multiprocessing.Pool(processes=20) # start 10 worker processes + + count = pool.map(getFilesForRun,mytuple) + file_info = dict(zip(listOfRuns, count)) + + #print file_info + + for run in listOfRuns: + if (int(run)int(opts.end)): + print('rejecting run',run,' becasue outside of boundaries') + continue + + if not isInJSON(run,lumilist[0]): + print('rejecting run',run,' becasue outside not in JSON') + continue + + #if(int(run)%100==0): + # print "preparing run",run + myRuns.append(run) + #cmd2 = ' das_client --limit=0 --query \'file run='+run+' dataset='+opts.data+'\'' + #q = Popen(cmd2 , shell=True, stdout=PIPE, stderr=PIPE) + #out2, err2 = q.communicate() + + #out2=getFilesForRun((run,opts.data)) + #print out2 + #pool.map(getFilesForRun,run,opts.data) + + + #if run in file_info: + #mylist[run] = file_info[run] + #print run,mylist[run] + #mylist[run] = out2.split('\n') + #print mylist + #mylist[run].pop() + #print mylist + + od = collections.OrderedDict(sorted(file_info.items())) + # print od + + # get from the DB the int luminosities + if(len(myRuns)==0): + raise Exception('Will not run on any run.... please check again the configuration') + + myLumiDB = getLuminosity(myRuns[0],myRuns[-1],doRunBased) + + print(myLumiDB) + + # start loop on samples + for iConf in range(len(jobName)): + print("This is Task n.",iConf+1,"of",len(jobName)) + + ## print "==========>",conditions + + # for hadd script + scripts_dir = os.path.join(AnalysisStep_dir,"scripts") + if not os.path.exists(scripts_dir): + os.makedirs(scripts_dir) + hadd_script_file = os.path.join(scripts_dir,jobName[iConf]+"_"+opts.taskname+".sh") + fout = open(hadd_script_file,'w') + + output_file_list1=list() + output_file_list2=list() + output_file_list2.append("hadd ") + + inputFiles = [] + + if (to_bool(isMC[iConf])): + print(">>>> This is MC!") + cmd = 'dasgoclient -limit=0 -query \'file dataset='+opts.data+'\'' + #cmd = 'dasgoclient -query \'file dataset='+opts.data+'\'' + s = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) + out,err = s.communicate() + mylist2 = out.decode().split('\n') + mylist2.pop() + #print mylist + + splitList = split(mylist2,10) + for files in splitList: + inputFiles.append(files) + myRuns.append(str(1)) + + else: + #pass + for element in od: + #print mylist[element] + inputFiles.append(od[element]) + #print element,od[element] + #print mylist + + #print inputFiles + + ## declare here the list of jobs that should be waited for + batchJobIds = [] + mergedFile = None + + print("myRuns =====>",myRuns) + + totalJobs=0 + theBashDir=None + theBaseName=None + + for jobN,theSrcFiles in enumerate(inputFiles): + print("JOB:",jobN,"run",myRuns[jobN],theSrcFiles) + thejobIndex=None + theLumi='1' + + #if(to_bool(isMC[iConf]) and (not to_bool(doRunBased))): + if(to_bool(isMC[iConf])): + thejobIndex=jobN + else: + thejobIndex=myRuns[jobN] + if (myRuns[jobN]) in myLumiDB: + theLumi = myLumiDB[myRuns[jobN]] + else: + print("=====> COULD NOT FIND LUMI, setting default = 1/pb") + theLumi='1' + print("int. lumi:",theLumi,"/pb") + + #print 'the configuration is:',iConf,' theJobIndex is:',thejobIndex + #print applyBOWS[iConf],applyEXTRACOND[iConf],conditions[iConf] + + runInfo = {} + runInfo["run"] = myRuns[jobN] + #runInfo["runevents"] = getNEvents(myRuns[jobN],opts.data) + runInfo["conf"] = jobName[iConf] + runInfo["gt"] = gt[iConf] + runInfo["allFromGT"] = allFromGT[iConf] + runInfo["alignmentDB"] = alignmentDB[iConf] + runInfo["alignmentTag"] = alignmentTAG[iConf] + runInfo["apeDB"] = apeDB[iConf] + runInfo["apeTag"] = apeTAG[iConf] + runInfo["applyBows"] = applyBOWS[iConf] + runInfo["bowDB"] = bowDB[iConf] + runInfo["bowTag"] = bowTAG[iConf] + runInfo["ptCut"] = ptcut[iConf] + runInfo["lumilist"] = lumilist[iConf] + runInfo["applyEXTRACOND"] = applyEXTRACOND[iConf] + runInfo["conditions"] = conditions[iConf] + runInfo["nfiles"] = len(theSrcFiles) + runInfo["srcFiles"] = theSrcFiles + runInfo["intLumi"] = theLumi + + updateDB(((iConf+1)*10)+(jobN+1),runInfo) + + totalJobs=totalJobs+1 + + aJob = Job(opts.data, + jobN, + thejobIndex, + jobName[iConf],isDA[iConf],isMC[iConf], + applyBOWS[iConf],applyEXTRACOND[iConf],conditions[iConf], + myRuns[jobN], lumilist[iConf], theLumi, maxevents[iConf], + gt[iConf],allFromGT[iConf], + alignmentDB[iConf], alignmentTAG[iConf], + apeDB[iConf], apeTAG[iConf], + bowDB[iConf], bowTAG[iConf], + vertextype[iConf], tracktype[iConf], + applyruncontrol[iConf], + ptcut[iConf],input_CMSSW_BASE,AnalysisStep_dir) + + aJob.setEOSout(eosdir) + aJob.createTheCfgFile(theSrcFiles) + aJob.createTheBashFile() + + output_file_list1.append("xrdcp root://eoscms//eos/cms"+aJob.getOutputFileName()+" /tmp/$USER/"+opts.taskname+" \n") + if jobN == 0: + theBashDir=aJob.BASH_dir + theBaseName=aJob.getOutputBaseNameWithData() + mergedFile = "/tmp/$USER/"+opts.taskname+"/"+aJob.getOutputBaseName()+" "+opts.taskname+".root" + output_file_list2.append("/tmp/$USER/"+opts.taskname+"/"+aJob.getOutputBaseName()+opts.taskname+".root ") + output_file_list2.append("/tmp/$USER/"+opts.taskname+"/"+os.path.split(aJob.getOutputFileName())[1]+" ") + del aJob + + job_submit_file = write_HTCondor_submit_file(theBashDir,theBaseName,totalJobs,None) + + if opts.submit: + os.system("chmod u+x "+theBashDir+"/*.sh") + submissionCommand = "condor_submit "+job_submit_file + submissionOutput = getCommandOutput(submissionCommand) + print(submissionOutput) + + fout.write("#!/bin/bash \n") + fout.write("MAIL=$USER@mail.cern.ch \n") + fout.write("OUT_DIR="+eosdir+"\n") + fout.write("FILE="+str(mergedFile)+"\n") + fout.write("echo $HOST | mail -s \"Harvesting job started\" $USER@mail.cern.ch \n") + fout.write("cd "+os.path.join(input_CMSSW_BASE,"src")+"\n") + fout.write("eval `scram r -sh` \n") + fout.write("mkdir -p /tmp/$USER/"+opts.taskname+" \n") + fout.writelines(output_file_list1) + fout.writelines(output_file_list2) + fout.write("\n") + fout.write("echo \"xrdcp -f $FILE root://eoscms//eos/cms$OUT_DIR\" \n") + fout.write("xrdcp -f $FILE root://eoscms//eos/cms$OUT_DIR \n") + fout.write("echo \"Harvesting for "+opts.taskname+" task is complete; please find output at $OUT_DIR \" | mail -s \"Harvesting for " +opts.taskname +" completed\" $MAIL \n") + + os.system("chmod u+x "+hadd_script_file) + + harvest_conditions = '"' + " && ".join(["ended(" + jobId + ")" for jobId in batchJobIds]) + '"' + print(harvest_conditions) + lastJobCommand = "bsub -o harvester"+opts.taskname+".tmp -q 1nh -w "+harvest_conditions+" "+hadd_script_file + print(lastJobCommand) + if opts.submit: + lastJobOutput = getCommandOutput(lastJobCommand) + print(lastJobOutput) + + fout.close() + del output_file_list1 + +if __name__ == "__main__": + main() + + + diff --git a/Alignment/OfflineValidation/test/PVValidation_T_standardRefit_cfg.py b/Alignment/OfflineValidation/test/PVValidation_T_standardRefit_cfg.py new file mode 100644 index 0000000000000..4c8f31dc7a683 --- /dev/null +++ b/Alignment/OfflineValidation/test/PVValidation_T_standardRefit_cfg.py @@ -0,0 +1,302 @@ +import FWCore.ParameterSet.Config as cms +import sys + +isDA = ISDATEMPLATE +isMC = ISMCTEMPLATE +allFromGT = ALLFROMGTTEMPLATE +applyBows = APPLYBOWSTEMPLATE +applyExtraConditions = EXTRACONDTEMPLATE + +process = cms.Process("PrimaryVertexValidation") + +################################################################### +def customiseAlignmentAndAPE(process): +################################################################### + if not hasattr(process.GlobalTag,'toGet'): + process.GlobalTag.toGet=cms.VPSet() + process.GlobalTag.toGet.extend( cms.VPSet(cms.PSet(record = cms.string("TrackerAlignmentRcd"), + tag = cms.string("GEOMTAGTEMPLATE"), + connect = cms.string("ALIGNOBJTEMPLATE") + ), + cms.PSet(record = cms.string("TrackerAlignmentErrorExtendedRcd"), + tag = cms.string("ERRORTAGTEMPLATE"), + connect = cms.string("APEOBJTEMPLATE") + ) + ) + ) + return process + +################################################################### +def customiseKinksAndBows(process): +################################################################### + if not hasattr(process.GlobalTag,'toGet'): + process.GlobalTag.toGet=cms.VPSet() + process.GlobalTag.toGet.extend(cms.VPSet(cms.PSet(record = cms.string("TrackerSurfaceDeformationRcd"), + tag = cms.string("BOWSTAGTEMPLATE"), + connect = cms.string("BOWSOBJECTTEMPLATE") + ), + ) + ) + return process + +################################################################### +# Event source and run selection +################################################################### +readFiles = cms.untracked.vstring() +readFiles.extend(FILESOURCETEMPLATE) +process.source = cms.Source("PoolSource", + fileNames = readFiles , + duplicateCheckMode = cms.untracked.string('checkAllFilesOpened') + ) + +#process.load("Alignment.OfflineValidation.DATASETTEMPLATE"); +process.load("FWCore.MessageService.MessageLogger_cfi") +process.MessageLogger.destinations = ['cout', 'cerr'] +process.MessageLogger.cerr.FwkReport.reportEvery = 1000 + +runboundary = RUNBOUNDARYTEMPLATE +process.source.firstRun = cms.untracked.uint32(int(runboundary)) +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(MAXEVENTSTEMPLATE) ) + +################################################################### +# JSON Filtering +################################################################### +if isMC: + print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is Simulation!" + runboundary = 1 +else: + print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is DATA!" + import FWCore.PythonUtilities.LumiList as LumiList + process.source.lumisToProcess = LumiList.LumiList(filename ='LUMILISTTEMPLATE').getVLuminosityBlockRange() + +################################################################### +# Messages +################################################################### +process.load("FWCore.MessageService.MessageLogger_cfi") +process.MessageLogger.destinations = ['cout', 'cerr'] +process.MessageLogger.cerr.FwkReport.reportEvery = 1000 + +#################################################################### +# Produce the Transient Track Record in the event +#################################################################### +process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi") + +#################################################################### +# Get the Magnetic Field +#################################################################### +process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') + +################################################################### +# Standard loads +################################################################### +process.load("Configuration.Geometry.GeometryRecoDB_cff") + +#################################################################### +# Get the BeamSpot +#################################################################### +process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff") + +#################################################################### +# Get the GlogalTag +#################################################################### +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'GLOBALTAGTEMPLATE', '') + +if allFromGT: + print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: All is taken from GT" +else: + #################################################################### + # Get Alignment constants and APE + #################################################################### + process=customiseAlignmentAndAPE(process) + + #################################################################### + # Kinks and Bows (optional) + #################################################################### + if applyBows: + print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Applying TrackerSurfaceDeformations!" + process=customiseKinksAndBows(process) + else: + print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!" + + #################################################################### + # Extra corrections not included in the GT + #################################################################### + if applyExtraConditions: + + import CalibTracker.Configuration.Common.PoolDBESSource_cfi + ##### END OF EXTRA CONDITIONS + + else: + print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!" + +#################################################################### +# Load and Configure event selection +#################################################################### +process.primaryVertexFilter = cms.EDFilter("VertexSelector", + src = cms.InputTag("VERTEXTYPETEMPLATE"), + cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), + filter = cms.bool(True) + ) + +process.noscraping = cms.EDFilter("FilterOutScraping", + applyfilter = cms.untracked.bool(True), + src = cms.untracked.InputTag("TRACKTYPETEMPLATE"), + debugOn = cms.untracked.bool(False), + numtrack = cms.untracked.uint32(10), + thresh = cms.untracked.double(0.25) + ) + +process.load("Alignment.CommonAlignment.filterOutLowPt_cfi") +process.filterOutLowPt.applyfilter = True +process.filterOutLowPt.src = "TRACKTYPETEMPLATE" +process.filterOutLowPt.numtrack = 0 +process.filterOutLowPt.thresh = 1 +process.filterOutLowPt.ptmin = PTCUTTEMPLATE +process.filterOutLowPt.runControl = RUNCONTROLTEMPLATE +process.filterOutLowPt.runControlNumber = [runboundary] + +if isMC: + process.goodvertexSkim = cms.Sequence(process.noscraping+process.filterOutLowPt) +else: + process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.filterOutLowPt) + +#################################################################### +# Load and Configure Measurement Tracker Event +# (this would be needed in case NavigationSchool is set != from '' +#################################################################### +# process.load("RecoTracker.MeasurementDet.MeasurementTrackerEventProducer_cfi") +# process.MeasurementTrackerEvent.pixelClusterProducer = 'TRACKTYPETEMPLATE' +# process.MeasurementTrackerEvent.stripClusterProducer = 'TRACKTYPETEMPLATE' +# process.MeasurementTrackerEvent.inactivePixelDetectorLabels = cms.VInputTag() +# process.MeasurementTrackerEvent.inactiveStripDetectorLabels = cms.VInputTag() + +#################################################################### +# Load and Configure TrackRefitter +#################################################################### +process.load("RecoTracker.TrackProducer.TrackRefitters_cff") +import RecoTracker.TrackProducer.TrackRefitters_cff +process.FinalTrackRefitter = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone() +process.FinalTrackRefitter.src = "TRACKTYPETEMPLATE" +process.FinalTrackRefitter.TrajectoryInEvent = True +process.FinalTrackRefitter.NavigationSchool = '' +process.FinalTrackRefitter.TTRHBuilder = "WithAngleAndTemplate" + +#################################################################### +# Load and Configure common selection sequence +#################################################################### +# import Alignment.CommonAlignment.tools.trackselectionRefitting as trackselRefit +# process.seqTrackselRefit = trackselRefit.getSequence(process,'TRACKTYPETEMPLATE') +# process.HighPurityTrackSelector.trackQualities = cms.vstring() +# process.HighPurityTrackSelector.pMin = cms.double(0.) +# process.TrackerTrackHitFilter.usePixelQualityFlag = cms.bool(False) +# #process.TrackerTrackHitFilter.commands = cms.vstring("drop PXB 1") +# process.AlignmentTrackSelector.pMin = cms.double(0.) +# process.AlignmentTrackSelector.ptMin = cms.double(0.) +# process.AlignmentTrackSelector.nHitMin2D = cms.uint32(0) +# process.AlignmentTrackSelector.nHitMin = cms.double(0.) +# process.AlignmentTrackSelector.d0Min = cms.double(-999999.0) +# process.AlignmentTrackSelector.d0Max = cms.double(+999999.0) +# process.AlignmentTrackSelector.dzMin = cms.double(-999999.0) +# process.AlignmentTrackSelector.dzMax = cms.double(+999999.0) + +#################################################################### +# Output file +#################################################################### +process.TFileService = cms.Service("TFileService", + fileName=cms.string("OUTFILETEMPLATE") + ) + +#################################################################### +# Deterministic annealing clustering +#################################################################### +if isDA: + print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running DA Algorithm!" + process.PVValidation = cms.EDAnalyzer("PrimaryVertexValidation", + TrackCollectionTag = cms.InputTag("FinalTrackRefitter"), + VertexCollectionTag = cms.InputTag("VERTEXTYPETEMPLATE"), + Debug = cms.bool(False), + storeNtuple = cms.bool(False), + useTracksFromRecoVtx = cms.bool(False), + isLightNtuple = cms.bool(True), + askFirstLayerHit = cms.bool(False), + numberOfBins = cms.untracked.int32(48), + probePt = cms.untracked.double(PTCUTTEMPLATE), + probeEta = cms.untracked.double(2.7), + runControl = cms.untracked.bool(RUNCONTROLTEMPLATE), + intLumi = cms.untracked.double(INTLUMITEMPLATE), + runControlNumber = cms.untracked.vuint32(int(runboundary)), + + TkFilterParameters = cms.PSet(algorithm=cms.string('filter'), + maxNormalizedChi2 = cms.double(5.0), # chi2ndof < 5 + minPixelLayersWithHits = cms.int32(2), # PX hits > 2 + minSiliconLayersWithHits = cms.int32(5), # TK hits > 5 + maxD0Significance = cms.double(5.0), # fake cut (requiring 1 PXB hit) + minPt = cms.double(0.0), # better for softish events + maxEta = cms.double(5.0), # as per recommendation in PR #18330 + trackQuality = cms.string("any") + ), + + ## MM 04.05.2017 (use settings as in: https://github.com/cms-sw/cmssw/pull/18330) + TkClusParameters=cms.PSet(algorithm=cms.string('DA_vect'), + TkDAClusParameters = cms.PSet(coolingFactor = cms.double(0.6), # moderate annealing speed + Tmin = cms.double(2.0), # end of vertex splitting + Tpurge = cms.double(2.0), # cleaning + Tstop = cms.double(0.5), # end of annealing + vertexSize = cms.double(0.006), # added in quadrature to track-z resolutions + d0CutOff = cms.double(3.), # downweight high IP tracks + dzCutOff = cms.double(3.), # outlier rejection after freeze-out (T>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!" + process.PVValidation = cms.EDAnalyzer("PrimaryVertexValidation", + TrackCollectionTag = cms.InputTag("FinalTrackRefitter"), + VertexCollectionTag = cms.InputTag("VERTEXTYPETEMPLATE"), + Debug = cms.bool(False), + isLightNtuple = cms.bool(True), + storeNtuple = cms.bool(False), + useTracksFromRecoVtx = cms.bool(False), + askFirstLayerHit = cms.bool(False), + numberOfBins = cms.untracked.int32(48), + probePt = cms.untracked.double(PTCUTTEMPLATE), + probeEta = cms.untracked.double(2.7), + runControl = cms.untracked.bool(RUNCONTROLTEMPLATE), + runControlNumber = cms.untracked.vuint32(int(runboundary)), + + TkFilterParameters = cms.PSet(algorithm=cms.string('filter'), + maxNormalizedChi2 = cms.double(5.0), # chi2ndof < 20 + minPixelLayersWithHits=cms.int32(2), # PX hits > 2 + minSiliconLayersWithHits = cms.int32(5), # TK hits > 5 + maxD0Significance = cms.double(5.0), # fake cut (requiring 1 PXB hit) + minPt = cms.double(0.0), # better for softish events + maxEta = cms.double(5.0), # as per recommendation in PR #18330 + trackQuality = cms.string("any") + ), + + TkClusParameters = cms.PSet(algorithm = cms.string('gap'), + TkGapClusParameters = cms.PSet(zSeparation = cms.double(0.2) # 0.2 cm max separation betw. clusters + ) + ) + ) + +#################################################################### +# Path +#################################################################### +process.p = cms.Path(process.goodvertexSkim* + # in case the common refitting sequence is removed + process.offlineBeamSpot* + #process.seqTrackselRefit* + # in case the navigation shool is removed + #process.MeasurementTrackerEvent* + # in case the common refitting sequence is removed + process.FinalTrackRefitter* + process.PVValidation) diff --git a/Alignment/OfflineValidation/test/submitAllJobs.py b/Alignment/OfflineValidation/test/submitAllJobs.py index 4e8f7236f1891..830922c1f3153 100644 --- a/Alignment/OfflineValidation/test/submitAllJobs.py +++ b/Alignment/OfflineValidation/test/submitAllJobs.py @@ -587,7 +587,7 @@ def main(): if (to_bool(isMC[iConf]) or (not to_bool(doRunBased))): if(to_bool(isMC[iConf])): print("this is MC") - cmd = 'das_client.py --limit=0 --query \'file dataset='+opts.data+'\'' + cmd = 'dasgoclient -query \'file dataset='+opts.data+'\'' s = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) out,err = s.communicate() mylist = out.split('\n') @@ -600,7 +600,7 @@ def main(): myRuns.append(str(1)) else: print("this is DATA (not doing full run-based selection)") - cmd = 'das_client.py --limit=0 --query \'file dataset='+opts.data+' run='+runboundary[iConf]+'\'' + cmd = 'dasgoclient -query \'file dataset='+opts.data+' run='+runboundary[iConf]+'\'' #print cmd s = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) out,err = s.communicate() @@ -614,7 +614,7 @@ def main(): else: print("this is Data") print("doing run based selection") - cmd = 'das_client.py --limit=0 --query \'run dataset='+opts.data+'\'' + cmd = 'dasgoclient -query \'run dataset='+opts.data+'\'' p = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) out, err = p.communicate() listOfRuns=out.split('\n') @@ -628,7 +628,7 @@ def main(): for run in listOfRuns: #print "preparing run",run - cmd2 = ' das_client.py --limit=0 --query \'file run='+run+' dataset='+opts.data+'\'' + cmd2 = ' dasgoclient -query \'file run='+run+' dataset='+opts.data+'\'' q = Popen(cmd2 , shell=True, stdout=PIPE, stderr=PIPE) procs.append(q) #out2, err2 = q.communicate() diff --git a/Alignment/OfflineValidation/test/testPVValidation.ini b/Alignment/OfflineValidation/test/testPVValidation.ini index ef8afdbb50e68..5799de3c6eaa6 100644 --- a/Alignment/OfflineValidation/test/testPVValidation.ini +++ b/Alignment/OfflineValidation/test/testPVValidation.ini @@ -1,4 +1,9 @@ +########################### +# test command: +# python PVValidationHTCondorSubmitter.py -r -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation.ini + [Job] +jobname: test isda: True ismc: False maxevents: 50000 @@ -7,7 +12,7 @@ maxevents: 50000 applyruncontrol: True ptcut: 3. runboundary: None -lumilist: /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions15/13TeV/DCSOnly/json_DCSONLY.txt +lumilist: /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV/DCSOnly/json_DCSONLY.txt [Type] vertextype: offlinePrimaryVertices @@ -15,7 +20,7 @@ tracktype: ALCARECOTkAlMinBias [Conditions:PromptGT] jobname: testingPromptGT -gt: 74X_dataRun2_Prompt_v4 +gt: auto:run3_data_promptlike allFromGT: True applyextracond: False alignmentdb: frontier://FrontierProd/CMS_CONDITIONS @@ -28,7 +33,7 @@ bowtag: TrackerSurafceDeformations_v1_express [Conditions:OfflineGT] jobname: testingOfflineGT -gt: 74X_dataRun2_v4 +gt: auto:run2_data allFromGT: True applyextracond: False alignmentdb: frontier://FrontierProd/CMS_CONDITIONS diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini index 87d8fdef5ae81..bc54d3aedfc4a 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini @@ -1,6 +1,6 @@ ########################### # test command: -# python submitAllJobs.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-PromptReco-v2/ALCARECO -i testPVValidation_Relvals_DATA.ini +# python submitAllJobs.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini [Job] jobname: test From 12d47fd95ac006473e1613f98b2432504d043e11 Mon Sep 17 00:00:00 2001 From: mmusich Date: Mon, 30 Mar 2020 14:54:11 +0200 Subject: [PATCH 190/778] more changes to validation submitter --- .../test/PVValidationHTCondorSubmitter.py | 136 +++++++++++++++--- 1 file changed, 114 insertions(+), 22 deletions(-) diff --git a/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py b/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py index 06b5934d03c0c..745cc7e500561 100644 --- a/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py +++ b/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py @@ -28,6 +28,12 @@ import collections import multiprocessing +CopyRights = '##################################\n' +CopyRights += '# submitAllJobs Script #\n' +CopyRights += '# marco.musich@cern.ch #\n' +CopyRights += '# December 2015 #\n' +CopyRights += '##################################\n' + ############################################## def write_HTCondor_submit_file(path, name, nruns, proxy_path=None): ############################################## @@ -367,6 +373,77 @@ def getOutputBaseNameWithData(self): def createTheCfgFile(self,lfn): ############################### + + global CopyRights + # write the cfg file + + self.cfg_dir = os.path.join(self.the_dir,"cfg") + if not os.path.exists(self.cfg_dir): + os.makedirs(self.cfg_dir) + + self.outputCfgName=self.output_full_name+"_cfg.py" + fout=open(os.path.join(self.cfg_dir,self.outputCfgName),'w+b') + + # decide which template according to data/mc + if self.isMC: + template_cfg_file = os.path.join(self.the_dir,"PVValidation_TEMPL_cfg.py") + else: + template_cfg_file = os.path.join(self.the_dir,"PVValidation_TEMPL_cfg.py") + + fin = open(template_cfg_file) + + config_txt = '\n\n' + CopyRights + '\n\n' + config_txt += fin.read() + + config_txt=config_txt.replace("ISDATEMPLATE",self.isDA) + config_txt=config_txt.replace("ISMCTEMPLATE",self.isMC) + config_txt=config_txt.replace("APPLYBOWSTEMPLATE",self.applyBOWS) + config_txt=config_txt.replace("EXTRACONDTEMPLATE",self.applyEXTRACOND) + config_txt=config_txt.replace("USEFILELISTTEMPLATE","True") + config_txt=config_txt.replace("RUNBOUNDARYTEMPLATE",self.runboundary) + config_txt=config_txt.replace("LUMILISTTEMPLATE",self.lumilist) + config_txt=config_txt.replace("MAXEVENTSTEMPLATE",self.maxevents) + config_txt=config_txt.replace("GLOBALTAGTEMPLATE",self.gt) + config_txt=config_txt.replace("ALLFROMGTTEMPLATE",self.allFromGT) + config_txt=config_txt.replace("ALIGNOBJTEMPLATE",self.alignmentDB) + config_txt=config_txt.replace("GEOMTAGTEMPLATE",self.alignmentTAG) + config_txt=config_txt.replace("APEOBJTEMPLATE",self.apeDB) + config_txt=config_txt.replace("ERRORTAGTEMPLATE",self.apeTAG) + config_txt=config_txt.replace("BOWSOBJECTTEMPLATE",self.bowDB) + config_txt=config_txt.replace("BOWSTAGTEMPLATE",self.bowTAG) + config_txt=config_txt.replace("VERTEXTYPETEMPLATE",self.vertextype) + config_txt=config_txt.replace("TRACKTYPETEMPLATE",self.tracktype) + config_txt=config_txt.replace("PTCUTTEMPLATE",self.ptcut) + config_txt=config_txt.replace("RUNCONTROLTEMPLATE",self.applyruncontrol) + lfn_with_quotes = map(lambda x: "\'"+x+"\'",lfn) + config_txt=config_txt.replace("FILESOURCETEMPLATE","["+",".join(lfn_with_quotes)+"]") + config_txt=config_txt.replace("OUTFILETEMPLATE",self.output_full_name+".root") + + fout.write(config_txt) + + for line in fin.readlines(): + + if 'END OF EXTRA CONDITIONS' in line: + for element in self.extraCondVect : + if("Rcd" in element): + params = self.extraCondVect[element].split(',') + + fout.write(" \n") + fout.write(" process.conditionsIn"+element+"= CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone( \n") + fout.write(" connect = cms.string('"+params[0]+"'), \n") + fout.write(" toGet = cms.VPSet(cms.PSet(record = cms.string('"+element+"'), \n") + fout.write(" tag = cms.string('"+params[1]+"'), \n") + if (len(params)>2): + fout.write(" label = cms.string('"+params[2]+"') \n") + fout.write(" ) \n") + fout.write(" ) \n") + fout.write(" ) \n") + fout.write(" process.prefer_conditionsIn"+element+" = cms.ESPrefer(\"PoolDBESSource\", \"conditionsIn"+element[0]+"\") \n \n") + fout.write(line) + fout.close() + + def createTheCfgFileOld(self,lfn): +############################### # write the cfg file self.cfg_dir = os.path.join(self.the_dir,"cfg") @@ -599,6 +676,9 @@ def getBatchjobId(self): def main(): ############################################## + global CopyRights + print('\n'+CopyRights) + # CMSSW section input_CMSSW_BASE = os.environ.get('CMSSW_BASE') AnalysisStep_dir = os.path.join(input_CMSSW_BASE,"src/Alignment/OfflineValidation/test") @@ -855,16 +935,15 @@ def main(): #mylist[run].pop() #print mylist - od = collections.OrderedDict(sorted(file_info.items())) - # print od + od = collections.OrderedDict(sorted(file_info.items())) + # print od - # get from the DB the int luminosities - if(len(myRuns)==0): - raise Exception('Will not run on any run.... please check again the configuration') - - myLumiDB = getLuminosity(myRuns[0],myRuns[-1],doRunBased) + # get from the DB the int luminosities + if(len(myRuns)==0): + raise Exception('Will not run on any run.... please check again the configuration') - print(myLumiDB) + myLumiDB = getLuminosity(myRuns[0],myRuns[-1],doRunBased) + print(myLumiDB) # start loop on samples for iConf in range(len(jobName)): @@ -884,21 +963,34 @@ def main(): output_file_list2.append("hadd ") inputFiles = [] - - if (to_bool(isMC[iConf])): - print(">>>> This is MC!") - cmd = 'dasgoclient -limit=0 -query \'file dataset='+opts.data+'\'' - #cmd = 'dasgoclient -query \'file dataset='+opts.data+'\'' - s = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) - out,err = s.communicate() - mylist2 = out.decode().split('\n') - mylist2.pop() - #print mylist + + if (to_bool(isMC[iConf]) or (not to_bool(doRunBased))): + if(to_bool(isMC[iConf])): + print("this is MC") + cmd = 'dasgoclient -query \'file dataset='+opts.data+'\'' + s = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) + out,err = s.communicate() + mylist = out.split('\n') + mylist.pop() + #print mylist - splitList = split(mylist2,10) - for files in splitList: - inputFiles.append(files) - myRuns.append(str(1)) + splitList = split(mylist,10) + for files in splitList: + inputFiles.append(files) + myRuns.append(str(1)) + else: + print("this is DATA (not doing full run-based selection)") + cmd = 'dasgoclient -query \'file dataset='+opts.data+' run='+runboundary[iConf]+'\'' + #print cmd + s = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) + out,err = s.communicate() + mylist = out.split('\n') + mylist.pop() + #print "len(mylist):",len(mylist) + print("mylist:",mylist) + inputFiles.append(mylist) + myRuns.append(str(runboundary[iConf])) + myLumiDB = getLuminosity(myRuns[0],myRuns[-1],True) else: #pass From 3297e3d1ad2e0eed25a46384624b1d7860846354 Mon Sep 17 00:00:00 2001 From: mmusich Date: Mon, 30 Mar 2020 14:56:31 +0200 Subject: [PATCH 191/778] more updates of configuration files --- .../test/testPVValidation_Relvals_DATA.ini | 12 ++++++++++-- .../test/testPVValidation_Relvals_MC.ini | 10 +++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini index bc54d3aedfc4a..8445da8e09a9d 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini @@ -1,6 +1,10 @@ ########################### # test command: -# python submitAllJobs.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini +# - for run-based: +# python PVValidationHTCondorSubmitter.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini -r +# single-run +# python PVValidationHTCondorSubmitter.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini + [Job] jobname: test @@ -8,7 +12,8 @@ isda: True ismc: False maxevents: 10000 -[Conditions] +[Conditions:OfflineGT] +jobname: testingOfflineGT gt: auto:run2_data allFromGT: False applyextracond: True @@ -32,3 +37,6 @@ lumilist: /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV [ExtraConditions] SiPixelTemplateDBObjectRcd:frontier://FrontierProd/CMS_CONDITIONS,SiPixelTemplateDBObject_38T_2015_v3_hltvalidation + +[validations] +OfflineGT: True \ No newline at end of file diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini index 9c196f6e9c65f..bf634085ffaeb 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini @@ -1,6 +1,6 @@ ########################### # test command: -# python submitAllJobs.py -j TEST -D /RelValNuGun_UP15/CMSSW_8_0_0_pre2-PU25ns_76X_mcRun2_asymptotic_v12-v1/GEN-SIM-RECO -i testPVValidation_RelVals_MC.ini +# python PVValidationHTCondorSubmitter.py -j TEST -D /QCD_Pt_470to600_TuneCP5_13TeV_pythia8/RunIIWinter19PFCalibDRPremix-TkAlMinBias-2016Conditions_newPixCond_105X_mcRun2_asymptotic_newPixCond_v2-v1/ALCARECO -i testPVValidation_Relvals_MC.ini [Job] jobname: test @@ -8,7 +8,8 @@ isda: True ismc: True maxevents: 10000 -[Conditions] +[Conditions:Run2MC] +jobname: testRun2MC gt: auto:run2_mc allFromGT: True applyextracond: True @@ -22,7 +23,7 @@ bowtag: TrackerSurfaceDeformations_2011Realistic_v2_mc [Type] vertextype: offlinePrimaryVertices -tracktype: generalTracks +tracktype: ALCARECOTkAlMinBias [Selection] applyruncontrol: True @@ -32,3 +33,6 @@ lumilist: None [ExtraConditions] SiPixelTemplateDBObjectRcd:frontier://FrontierProd/CMS_CONDITIONS,SiPixelTemplates38T_2010_2011_mc + +[validations] +Run2MC: True From ca0e8374dccffde354dcb08e857e7535b5eda294 Mon Sep 17 00:00:00 2001 From: mmusich Date: Sun, 26 Apr 2020 15:22:24 +0200 Subject: [PATCH 192/778] add possibility of configuring refitter and CPE type from submission tool --- .../test/PVValidationHTCondorSubmitter.py | 271 ++++++------------ .../test/PVValidation_T_cfg.py | 97 +++++-- .../test/testPVValidation.ini | 4 + .../test/testPVValidation_Relvals_DATA.ini | 6 +- .../test/testPVValidation_Relvals_MC.ini | 4 + 5 files changed, 172 insertions(+), 210 deletions(-) diff --git a/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py b/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py index 745cc7e500561..df54ecdffa2a5 100644 --- a/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py +++ b/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py @@ -21,19 +21,36 @@ import string, re import configparser as ConfigParser import json -#import ConfigParser, json import subprocess from optparse import OptionParser from subprocess import Popen, PIPE import collections import multiprocessing +from enum import Enum + +class RefitType(Enum): + STANDARD = 1 + COMMON = 2 CopyRights = '##################################\n' -CopyRights += '# submitAllJobs Script #\n' +CopyRights += '# PVValidationHTCondorSubmitter #\n' CopyRights += '# marco.musich@cern.ch #\n' -CopyRights += '# December 2015 #\n' +CopyRights += '# April 2020 #\n' CopyRights += '##################################\n' +############################################## +def check_proxy(): +############################################## + """Check if GRID proxy has been initialized.""" + + try: + with open(os.devnull, "w") as dump: + subprocess.check_call(["voms-proxy-info", "--exists"], + stdout = dump, stderr = dump) + except subprocess.CalledProcessError: + return False + return True + ############################################## def write_HTCondor_submit_file(path, name, nruns, proxy_path=None): ############################################## @@ -302,7 +319,7 @@ def split(sequence, size): class Job: ############# - def __init__(self,dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, applyruncontrol, ptcut, CMSSW_dir ,the_dir): + def __init__(self,dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir ,the_dir): ############################### theDataSet = dataset.split("/")[1]+"_"+(dataset.split("/")[2]).split("-")[0] @@ -331,7 +348,9 @@ def __init__(self,dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, self.bowDB = bowDB self.bowTAG = bowTAG self.vertextype = vertextype - self.tracktype = tracktype + self.tracktype = tracktype + self.refittertype = refittertype + self.ttrhtype = ttrhtype self.applyruncontrol = applyruncontrol self.ptcut = ptcut @@ -352,9 +371,6 @@ def __init__(self,dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, self.lfn_list=list() - #self.OUTDIR = "/eos/cern.ch/user/m/musich/ZbbAnalysis/test01Sept" # TODO: write a setter method - #self.OUTDIR = self.createEOSout() - def __del__(self): ############################### del self.lfn_list @@ -384,11 +400,7 @@ def createTheCfgFile(self,lfn): self.outputCfgName=self.output_full_name+"_cfg.py" fout=open(os.path.join(self.cfg_dir,self.outputCfgName),'w+b') - # decide which template according to data/mc - if self.isMC: - template_cfg_file = os.path.join(self.the_dir,"PVValidation_TEMPL_cfg.py") - else: - template_cfg_file = os.path.join(self.the_dir,"PVValidation_TEMPL_cfg.py") + template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_cfg.py") fin = open(template_cfg_file) @@ -413,7 +425,10 @@ def createTheCfgFile(self,lfn): config_txt=config_txt.replace("BOWSTAGTEMPLATE",self.bowTAG) config_txt=config_txt.replace("VERTEXTYPETEMPLATE",self.vertextype) config_txt=config_txt.replace("TRACKTYPETEMPLATE",self.tracktype) + config_txt=config_txt.replace("REFITTERTEMPLATE",self.refittertype) + config_txt=config_txt.replace("TTRHBUILDERTEMPLATE",self.ttrhtype) config_txt=config_txt.replace("PTCUTTEMPLATE",self.ptcut) + config_txt=config_txt.replace("INTLUMITEMPLATE",self.intlumi) config_txt=config_txt.replace("RUNCONTROLTEMPLATE",self.applyruncontrol) lfn_with_quotes = map(lambda x: "\'"+x+"\'",lfn) config_txt=config_txt.replace("FILESOURCETEMPLATE","["+",".join(lfn_with_quotes)+"]") @@ -441,141 +456,6 @@ def createTheCfgFile(self,lfn): fout.write(" process.prefer_conditionsIn"+element+" = cms.ESPrefer(\"PoolDBESSource\", \"conditionsIn"+element[0]+"\") \n \n") fout.write(line) fout.close() - - def createTheCfgFileOld(self,lfn): -############################### - - # write the cfg file - self.cfg_dir = os.path.join(self.the_dir,"cfg") - if not os.path.exists(self.cfg_dir): - os.makedirs(self.cfg_dir) - - self.outputCfgName=self.output_full_name+"_cfg.py" - fout=open(os.path.join(self.cfg_dir,self.outputCfgName),'w+b') - - # decide which template according to data/mc - if self.isMC: - #template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_DropBPix1_cfg.py") - template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_standardRefit_cfg.py") - #template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_standardRefit_GenericCPE_cfg.py") - else: - #template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_DropBPix1_cfg.py") - template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_standardRefit_cfg.py") - #template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_standardRefit_GenericCPE_cfg.py") - - fin = open(template_cfg_file) - - for line in fin.readlines(): - if(to_bool(self.applyEXTRACOND)): - if 'END OF EXTRA CONDITIONS' in line: - for element in self.extraCondVect : - if("Rcd" in element): - params = self.extraCondVect[element].split(',') - - fout.write(" \n") - fout.write(" process.conditionsIn"+element+"= CalibTracker.Configuration.Common.PoolDBESSource_cfi.poolDBESSource.clone( \n") - fout.write(" connect = cms.string('"+params[0]+"'), \n") - fout.write(" toGet = cms.VPSet(cms.PSet(record = cms.string('"+element+"'), \n") - fout.write(" tag = cms.string('"+params[1]+"'), \n") - if (len(params)>2): - fout.write(" label = cms.string('"+params[2]+"') \n") - fout.write(" ) \n") - fout.write(" ) \n") - fout.write(" ) \n") - fout.write(" process.prefer_conditionsIn"+element+" = cms.ESPrefer(\"PoolDBESSource\", \"conditionsIn"+element+"\") \n \n") - - if self.isMC: - if line.find("ISDATEMPLATE")!=-1: - line=line.replace("ISDATEMPLATE",self.isDA) - if line.find("ISMCTEMPLATE")!=-1: - line=line.replace("ISMCTEMPLATE",self.isMC) - if line.find("APPLYBOWSTEMPLATE")!=-1: - line=line.replace("APPLYBOWSTEMPLATE",self.applyBOWS) - if line.find("EXTRACONDTEMPLATE")!=-1: - line=line.replace("EXTRACONDTEMPLATE",self.applyEXTRACOND) - if line.find("RUNBOUNDARYTEMPLATE")!=-1: - line=line.replace("RUNBOUNDARYTEMPLATE",self.runboundary) - if line.find("LUMILISTTEMPLATE")!=-1: - line=line.replace("LUMILISTTEMPLATE",self.lumilist) - if line.find("INTLUMITEMPLATE")!=-1: - line=line.replace("INTLUMITEMPLATE",self.intlumi) - if line.find("MAXEVENTSTEMPLATE")!=-1: - line=line.replace("MAXEVENTSTEMPLATE",self.maxevents) - if line.find("GLOBALTAGTEMPLATE")!=-1: - line=line.replace("GLOBALTAGTEMPLATE",self.gt) - if line.find("ALLFROMGTTEMPLATE")!=-1: - line=line.replace("ALLFROMGTTEMPLATE",self.allFromGT) - if line.find("ALIGNOBJTEMPLATE")!=-1: - line=line.replace("ALIGNOBJTEMPLATE",self.alignmentDB) - if line.find("GEOMTAGTEMPLATE")!=-1: - line=line.replace("GEOMTAGTEMPLATE",self.alignmentTAG) - if line.find("APEOBJTEMPLATE")!=-1: - line=line.replace("APEOBJTEMPLATE",self.apeDB) - if line.find("ERRORTAGTEMPLATE")!=-1: - line=line.replace("ERRORTAGTEMPLATE",self.apeTAG) - if line.find("BOWSOBJECTTEMPLATE")!=-1: - line=line.replace("BOWSOBJECTTEMPLATE",self.bowDB) - if line.find("BOWSTAGTEMPLATE")!=-1: - line=line.replace("BOWSTAGTEMPLATE",self.bowTAG) - if line.find("VERTEXTYPETEMPLATE")!=-1: - line=line.replace("VERTEXTYPETEMPLATE",self.vertextype) - if line.find("TRACKTYPETEMPLATE")!=-1: - line=line.replace("TRACKTYPETEMPLATE",self.tracktype) - if line.find("PTCUTTEMPLATE")!=-1: - line=line.replace("PTCUTTEMPLATE",self.ptcut) - if line.find("RUNCONTROLTEMPLATE")!=-1: - line=line.replace("RUNCONTROLTEMPLATE",self.applyruncontrol) - else: - if line.find("ISDATTEMPLATE")!=-1: - line=line.replace("ISDATEMPLATE",self.isDA) - if line.find("ISMCTEMPLATE")!=-1: - line=line.replace("ISMCTEMPLATE",self.isMC) - if line.find("APPLYBOWSTEMPLATE")!=-1: - line=line.replace("APPLYBOWSTEMPLATE",self.applyBOWS) - if line.find("EXTRACONDTEMPLATE")!=-1: - line=line.replace("EXTRACONDTEMPLATE",self.applyEXTRACOND) - if line.find("RUNBOUNDARYTEMPLATE")!=-1: - line=line.replace("RUNBOUNDARYTEMPLATE",self.runboundary) - if line.find("LUMILISTTEMPLATE")!=-1: - line=line.replace("LUMILISTTEMPLATE",self.lumilist) - if line.find("INTLUMITEMPLATE")!=-1: - line=line.replace("INTLUMITEMPLATE",self.intlumi) - if line.find("MAXEVENTSTEMPLATE")!=-1: - line=line.replace("MAXEVENTSTEMPLATE",self.maxevents) - if line.find("GLOBALTAGTEMPLATE")!=-1: - line=line.replace("GLOBALTAGTEMPLATE",self.gt) - if line.find("ALLFROMGTTEMPLATE")!=-1: - line=line.replace("ALLFROMGTTEMPLATE",self.allFromGT) - if line.find("ALIGNOBJTEMPLATE")!=-1: - line=line.replace("ALIGNOBJTEMPLATE",self.alignmentDB) - if line.find("GEOMTAGTEMPLATE")!=-1: - line=line.replace("GEOMTAGTEMPLATE",self.alignmentTAG) - if line.find("APEOBJTEMPLATE")!=-1: - line=line.replace("APEOBJTEMPLATE",self.apeDB) - if line.find("ERRORTAGTEMPLATE")!=-1: - line=line.replace("ERRORTAGTEMPLATE",self.apeTAG) - if line.find("BOWSOBJECTTEMPLATE")!=-1: - line=line.replace("BOWSOBJECTTEMPLATE",self.bowDB) - if line.find("BOWSTAGTEMPLATE")!=-1: - line=line.replace("BOWSTAGTEMPLATE",self.bowTAG) - if line.find("VERTEXTYPETEMPLATE")!=-1: - line=line.replace("VERTEXTYPETEMPLATE",self.vertextype) - if line.find("TRACKTYPETEMPLATE")!=-1: - line=line.replace("TRACKTYPETEMPLATE",self.tracktype) - if line.find("PTCUTTEMPLATE")!=-1: - line=line.replace("PTCUTTEMPLATE",self.ptcut) - if line.find("RUNCONTROLTEMPLATE")!=-1: - line=line.replace("RUNCONTROLTEMPLATE",self.applyruncontrol) - - if line.find("FILESOURCETEMPLATE")!=-1: - lfn_with_quotes = map(lambda x: "\'"+x+"\'",lfn) - #print "["+",".join(lfn_with_quotes)+"]" - line=line.replace("FILESOURCETEMPLATE","["+",".join(lfn_with_quotes)+"]") - if line.find("OUTFILETEMPLATE")!=-1: - line=line.replace("OUTFILETEMPLATE",self.output_full_name+".root") - fout.write(line.encode(encoding='UTF-8')) - - fout.close() def createTheLSFFile(self): ############################### @@ -676,6 +556,11 @@ def getBatchjobId(self): def main(): ############################################## + ## check first there is a valid grid proxy + if not check_proxy(): + print("Please create proxy via 'voms-proxy-init -voms cms -rfc'.") + sys.exit(1) + global CopyRights print('\n'+CopyRights) @@ -701,10 +586,11 @@ def main(): (opts, args) = parser.parse_args() now = datetime.datetime.now() - #t = now.strftime("test_%Y_%m_%d_%H_%M_%S_DATA_PixQualityFlag") + #t = now.strftime("test_%Y_%m_%d_%H_%M_%S_") + #t = "2016UltraLegacy" #t = "2017UltraLegacy" - t = "2018UltraLegacy" - #t = "2016UltraLegacy" + #t = "2018UltraLegacy" + t="" t+=opts.taskname USER = os.environ.get('USER') @@ -738,6 +624,8 @@ def main(): vertextype = [] tracktype = [] + refittertype = [] + ttrhtype = [] applyruncontrol = [] ptcut = [] @@ -751,9 +639,6 @@ def main(): print("********************************************************") print("* Parsing from input file:", ConfigFile," ") - #config = ConfigParser.ConfigParser() - #config.read(ConfigFile) - config = BetterConfigParser() config.read(ConfigFile) @@ -789,12 +674,23 @@ def main(): vertextype.append(ConfigSectionMap(config,"Type")['vertextype']) tracktype.append(ConfigSectionMap(config,"Type")['tracktype']) - + + ## in case there exists a specification for the refitter + + if(config.exists("Refit","refittertype")): + refittertype.append(ConfigSectionMap(config,"Refit")['refittertype']) + else: + refittertype.append(str(RefitType.COMMON)) + + if(config.exists("Refit","ttrhtype")): + ttrhtype.append(ConfigSectionMap(config,"Refit")['ttrhtype']) + else: + ttrhtype.append("WithAngleAndTemplate") + applyruncontrol.append(ConfigSectionMap(config,"Selection")['applyruncontrol']) ptcut.append(ConfigSectionMap(config,"Selection")['ptcut']) runboundary.append(ConfigSectionMap(config,"Selection")['runboundary']) lumilist.append(ConfigSectionMap(config,"Selection")['lumilist']) - else : print("********************************************************") @@ -819,9 +715,9 @@ def main(): bowDB = ['frontier://FrontierProd/CMS_CONDITIONS'] bowTAG = ['TrackerSurafceDeformations_v1_express'] - vertextype = ['offlinePrimaryVertices'] - tracktype = ['ALCARECOTkAlMinBias'] - + vertextype = ['offlinePrimaryVertices'] + tracktype = ['ALCARECOTkAlMinBias'] + applyruncontrol = ['False'] ptcut = ['3'] runboundary = ['1'] @@ -834,28 +730,30 @@ def main(): print("********************************************************") print("- submitted : ",opts.submit) print("- taskname : ",opts.taskname) - print("- Jobname : ",jobName) - print("- use DA : ",isDA) - print("- is MC : ",isMC) + print("- Jobname : ",jobName) + print("- use DA : ",isDA) + print("- is MC : ",isMC) print("- is run-based: ",doRunBased) - print("- evts/job : ",maxevents) - print("- GlobatTag : ",gt) + print("- evts/job : ",maxevents) + print("- GlobatTag : ",gt) print("- allFromGT? : ",allFromGT) print("- extraCond? : ",applyEXTRACOND) - print("- extraCond : ",conditions) - print("- Align db : ",alignmentDB) - print("- Align tag : ",alignmentTAG) - print("- APE db : ",apeDB) - print("- APE tag : ",apeTAG) - print("- use bows? : ",applyBOWS) + print("- extraCond : ",conditions) + print("- Align db : ",alignmentDB) + print("- Align tag : ",alignmentTAG) + print("- APE db : ",apeDB) + print("- APE tag : ",apeTAG) + print("- use bows? : ",applyBOWS) print("- K&B db : ",bowDB) - print("- K&B tag : ",bowTAG) - print("- VertexColl : ",vertextype) - print("- TrackColl : ",tracktype) + print("- K&B tag : ",bowTAG) + print("- VertexColl : ",vertextype) + print("- TrackColl : ",tracktype) + print("- RefitterSeq : ",refittertype) + print("- TTRHBuilder : ",ttrhtype) print("- RunControl? : ",applyruncontrol) - print("- Pt> ",ptcut) - print("- run= ",runboundary) - print("- JSON : ",lumilist) + print("- Pt> ",ptcut) + print("- run= ",runboundary) + print("- JSON : ",lumilist) print("- Out Dir : ",eosdir) print("********************************************************") @@ -868,14 +766,12 @@ def main(): print(">>>> This is Data!") print(">>>> Doing run based selection") cmd = 'dasgoclient -limit=0 -query \'run dataset='+opts.data+'\'' - #cmd = 'dasgoclient -query \'run dataset='+opts.data+'\'' p = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) out, err = p.communicate() print(out) listOfRuns=out.decode().split("\n") listOfRuns.pop() listOfRuns.sort() - #myRuns = listOfRuns print("Will run on ",len(listOfRuns),"runs") print(listOfRuns) @@ -1043,15 +939,15 @@ def main(): runInfo["apeDB"] = apeDB[iConf] runInfo["apeTag"] = apeTAG[iConf] runInfo["applyBows"] = applyBOWS[iConf] - runInfo["bowDB"] = bowDB[iConf] - runInfo["bowTag"] = bowTAG[iConf] - runInfo["ptCut"] = ptcut[iConf] - runInfo["lumilist"] = lumilist[iConf] - runInfo["applyEXTRACOND"] = applyEXTRACOND[iConf] - runInfo["conditions"] = conditions[iConf] - runInfo["nfiles"] = len(theSrcFiles) - runInfo["srcFiles"] = theSrcFiles - runInfo["intLumi"] = theLumi + runInfo["bowDB"] = bowDB[iConf] + runInfo["bowTag"] = bowTAG[iConf] + runInfo["ptCut"] = ptcut[iConf] + runInfo["lumilist"] = lumilist[iConf] + runInfo["applyEXTRACOND"] = applyEXTRACOND[iConf] + runInfo["conditions"] = conditions[iConf] + runInfo["nfiles"] = len(theSrcFiles) + runInfo["srcFiles"] = theSrcFiles + runInfo["intLumi"] = theLumi updateDB(((iConf+1)*10)+(jobN+1),runInfo) @@ -1068,6 +964,7 @@ def main(): apeDB[iConf], apeTAG[iConf], bowDB[iConf], bowTAG[iConf], vertextype[iConf], tracktype[iConf], + refittertype[iConf], ttrhtype[iConf], applyruncontrol[iConf], ptcut[iConf],input_CMSSW_BASE,AnalysisStep_dir) diff --git a/Alignment/OfflineValidation/test/PVValidation_T_cfg.py b/Alignment/OfflineValidation/test/PVValidation_T_cfg.py index f3e3a77380d85..d3486968d339f 100644 --- a/Alignment/OfflineValidation/test/PVValidation_T_cfg.py +++ b/Alignment/OfflineValidation/test/PVValidation_T_cfg.py @@ -1,12 +1,18 @@ from __future__ import print_function import FWCore.ParameterSet.Config as cms +from enum import Enum import sys +class RefitType(Enum): + STANDARD = 1 + COMMON = 2 + isDA = ISDATEMPLATE isMC = ISMCTEMPLATE allFromGT = ALLFROMGTTEMPLATE applyBows = APPLYBOWSTEMPLATE applyExtraConditions = EXTRACONDTEMPLATE +theRefitter = REFITTERTEMPLATE process = cms.Process("PrimaryVertexValidation") @@ -50,11 +56,6 @@ def customiseKinksAndBows(process): duplicateCheckMode = cms.untracked.string('checkAllFilesOpened') ) -#process.load("Alignment.OfflineValidation.DATASETTEMPLATE"); -process.load("FWCore.MessageService.MessageLogger_cfi") -process.MessageLogger.destinations = ['cout', 'cerr'] -process.MessageLogger.cerr.FwkReport.reportEvery = 1000 - runboundary = RUNBOUNDARYTEMPLATE process.source.firstRun = cms.untracked.uint32(int(runboundary)) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(MAXEVENTSTEMPLATE) ) @@ -187,27 +188,79 @@ def customiseKinksAndBows(process): #################################################################### # Load and Configure common selection sequence #################################################################### -import Alignment.CommonAlignment.tools.trackselectionRefitting as trackselRefit -process.seqTrackselRefit = trackselRefit.getSequence(process,'TRACKTYPETEMPLATE') -process.HighPurityTrackSelector.trackQualities = cms.vstring() -process.HighPurityTrackSelector.pMin = cms.double(0.) -#process.TrackerTrackHitFilter.usePixelQualityFlag = cms.bool(False) # do not use the pixel quality flag -#process.TrackerTrackHitFilter.commands = cms.vstring("drop PXB 1") # drop BPix1 hits -process.AlignmentTrackSelector.pMin = cms.double(0.) -process.AlignmentTrackSelector.ptMin = cms.double(0.) -process.AlignmentTrackSelector.nHitMin2D = cms.uint32(0) -process.AlignmentTrackSelector.nHitMin = cms.double(0.) -process.AlignmentTrackSelector.d0Min = cms.double(-999999.0) -process.AlignmentTrackSelector.d0Max = cms.double(+999999.0) -process.AlignmentTrackSelector.dzMin = cms.double(-999999.0) -process.AlignmentTrackSelector.dzMax = cms.double(+999999.0) +# import Alignment.CommonAlignment.tools.trackselectionRefitting as trackselRx1efit +# process.seqTrackselRefit = trackselRefit.getSequence(process,'TRACKTYPETEMPLATE') +# process.HighPurityTrackSelector.trackQualities = cms.vstring() +# process.HighPurityTrackSelector.pMin = cms.double(0.) +# #process.TrackerTrackHitFilter.usePixelQualityFlag = cms.bool(False) # do not use the pixel quality flag +# #process.TrackerTrackHitFilter.commands = cms.vstring("drop PXB 1") # drop BPix1 hits +# process.AlignmentTrackSelector.pMin = cms.double(0.) +# process.AlignmentTrackSelector.ptMin = cms.double(0.) +# process.AlignmentTrackSelector.nHitMin2D = cms.uint32(0) +# process.AlignmentTrackSelector.nHitMin = cms.double(0.) +# process.AlignmentTrackSelector.d0Min = cms.double(-999999.0) +# process.AlignmentTrackSelector.d0Max = cms.double(+999999.0) +# process.AlignmentTrackSelector.dzMin = cms.double(-999999.0) +# process.AlignmentTrackSelector.dzMax = cms.double(+999999.0) + +if(theRefitter == RefitType.COMMON): + + print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: using the common track selection and refit sequence!") + #################################################################### + # Load and Configure Common Track Selection and refitting sequence + #################################################################### + import Alignment.CommonAlignment.tools.trackselectionRefitting as trackselRefit + process.seqTrackselRefit = trackselRefit.getSequence(process, 'TRACKTYPETEMPLATE', + isPVValidation=True, + TTRHBuilder='TTRHBUILDERTEMPLATE', + usePixelQualityFlag=True, + openMassWindow=False, + cosmicsDecoMode=True, + cosmicsZeroTesla=False, + momentumConstraint=None, + cosmicTrackSplitting=False, + use_d0cut=False, + ) + if((process.TrackerTrackHitFilter.usePixelQualityFlag.value()==True) and (process.FirstTrackRefitter.TTRHBuilder.value()=="WithTrackAngle")): + print(" \n\n","*"*70,"\n *\t\t\t\t WARNING!!!!!\t\t\t\n *\n * Found an inconsistent configuration!\n * TTRHBuilder = WithTrackAngle requires usePixelQualityFlag = False.\n * Going to reset it! \n *\n","*"*70) + process.TrackerTrackHitFilter.usePixelQualityFlag = False + +elif (theRefitter == RefitType.STANDARD): + + print(">>>>>>>>>> testPVValidation_cfg.py: msg%-i: using the standard single refit sequence!") + #################################################################### + # Load and Configure Measurement Tracker Event + # (needed in case NavigationSchool is set != '') + #################################################################### + # process.load("RecoTracker.MeasurementDet.MeasurementTrackerEventProducer_cfi") + # process.MeasurementTrackerEvent.pixelClusterProducer = 'TRACKTYPETEMPLATE' + # process.MeasurementTrackerEvent.stripClusterProducer = 'TRACKTYPETEMPLATE' + # process.MeasurementTrackerEvent.inactivePixelDetectorLabels = cms.VInputTag() + # process.MeasurementTrackerEvent.inactiveStripDetectorLabels = cms.VInputTag() + + #################################################################### + # Load and Configure TrackRefitter + #################################################################### + process.load("RecoTracker.TrackProducer.TrackRefitters_cff") + import RecoTracker.TrackProducer.TrackRefitters_cff + process.FinalTrackRefitter = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone() + process.FinalTrackRefitter.src = "TRACKTYPETEMPLATE" + process.FinalTrackRefitter.TrajectoryInEvent = True + process.FinalTrackRefitter.NavigationSchool = '' + process.FinalTrackRefitter.TTRHBuilder = "TTRHBUILDERTEMPLATE" + + #################################################################### + # Sequence + #################################################################### + process.seqTrackselRefit = cms.Sequence(process.offlineBeamSpot* + # in case NavigatioSchool is set !='' + #process.MeasurementTrackerEvent* + process.FinalTrackRefitter) #################################################################### # Output file #################################################################### -process.TFileService = cms.Service("TFileService", - fileName=cms.string("OUTFILETEMPLATE") - ) +process.TFileService = cms.Service("TFileService",fileName=cms.string("OUTFILETEMPLATE")) #################################################################### # Imports of parameters diff --git a/Alignment/OfflineValidation/test/testPVValidation.ini b/Alignment/OfflineValidation/test/testPVValidation.ini index 5799de3c6eaa6..d22c259b57063 100644 --- a/Alignment/OfflineValidation/test/testPVValidation.ini +++ b/Alignment/OfflineValidation/test/testPVValidation.ini @@ -18,6 +18,10 @@ lumilist: /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV vertextype: offlinePrimaryVertices tracktype: ALCARECOTkAlMinBias +[Refit] +refittertype: RefitType.STANDARD +ttrhtype: WithAngleAndTemplate + [Conditions:PromptGT] jobname: testingPromptGT gt: auto:run3_data_promptlike diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini index 8445da8e09a9d..6962718577459 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini @@ -5,7 +5,6 @@ # single-run # python PVValidationHTCondorSubmitter.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini - [Job] jobname: test isda: True @@ -29,6 +28,11 @@ bowtag: TrackerSurafceDeformations_v1_express vertextype: offlinePrimaryVertices tracktype: ALCARECOTkAlMinBias +[Refit] +refittertype: RefitType.COMMON +ttrhtype: WithTrackAngle +#ttrhtype: WithAngleAndTemplate + [Selection] applyruncontrol: True ptcut: 3. diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini index bf634085ffaeb..9ebd48de56198 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini @@ -25,6 +25,10 @@ bowtag: TrackerSurfaceDeformations_2011Realistic_v2_mc vertextype: offlinePrimaryVertices tracktype: ALCARECOTkAlMinBias +[Refit] +refittertype: RefitType.COMMON +ttrhtype: WithAngleAndTemplate + [Selection] applyruncontrol: True ptcut: 3. From 065dacb98d93fafa03317def69f2e812035846c4 Mon Sep 17 00:00:00 2001 From: mmusich Date: Tue, 16 Jun 2020 18:45:24 +0200 Subject: [PATCH 193/778] move file from test to script directory + rename + make it executable --- .../submitPVValidationJobs.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Alignment/OfflineValidation/{test/PVValidationHTCondorSubmitter.py => scripts/submitPVValidationJobs.py} (99%) mode change 100644 => 100755 diff --git a/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py old mode 100644 new mode 100755 similarity index 99% rename from Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py rename to Alignment/OfflineValidation/scripts/submitPVValidationJobs.py index df54ecdffa2a5..ba371befd3626 --- a/Alignment/OfflineValidation/test/PVValidationHTCondorSubmitter.py +++ b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py @@ -63,7 +63,7 @@ def write_HTCondor_submit_file(path, name, nruns, proxy_path=None): job_submit_template="""\ universe = vanilla -requirements = (OpSysAndVer =?= "SLCern6") +requirements = (OpSysAndVer =?= "CentOS7") executable = {script:s} output = {jobm:s}/{out:s}.out error = {jobm:s}/{out:s}.err From bf88a8329f7a0044ea6fda3500e4a6e76efb695f Mon Sep 17 00:00:00 2001 From: Andrzej Date: Fri, 2 Oct 2020 12:19:09 +0200 Subject: [PATCH 194/778] feat: add hadronFlavour for SubJet in nano --- PhysicsTools/NanoAOD/python/jets_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PhysicsTools/NanoAOD/python/jets_cff.py b/PhysicsTools/NanoAOD/python/jets_cff.py index fcd53d9769290..05cab141890b9 100644 --- a/PhysicsTools/NanoAOD/python/jets_cff.py +++ b/PhysicsTools/NanoAOD/python/jets_cff.py @@ -681,6 +681,7 @@ variables = cms.PSet( nBHadrons = Var("jetFlavourInfo().getbHadrons().size()", "uint8", doc="number of b-hadrons"), nCHadrons = Var("jetFlavourInfo().getcHadrons().size()", "uint8", doc="number of c-hadrons"), + hadronFlavour = Var("hadronFlavour()", int, doc="flavour from hadron ghost clustering"), ) ) From b8e7ce95faae9d3ea4b8f5a6e565a9238bc2043f Mon Sep 17 00:00:00 2001 From: Nicola Amapane Date: Fri, 2 Oct 2020 13:15:55 +0200 Subject: [PATCH 195/778] Remove dependency from DDCMS/interface/DDShapes.h --- .../GeomBuilder/src/DD4hep_volumeHandle.cc | 96 ++++++++++++------- .../GeomBuilder/src/DD4hep_volumeHandle.h | 33 ++++++- MagneticField/GeomBuilder/src/buildBox.icc | 9 +- MagneticField/GeomBuilder/src/buildCons.icc | 21 ++-- .../GeomBuilder/src/buildPseudoTrap.icc | 12 +-- MagneticField/GeomBuilder/src/buildTrap.icc | 29 +++--- .../GeomBuilder/src/buildTruncTubs.icc | 23 ++--- MagneticField/GeomBuilder/src/buildTubs.icc | 13 +-- MagneticField/GeomBuilder/src/volumeHandle.cc | 80 ++++++++++++---- MagneticField/GeomBuilder/src/volumeHandle.h | 33 ++++++- 10 files changed, 213 insertions(+), 136 deletions(-) diff --git a/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc b/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc index 09f578a58a446..94146538c00f9 100644 --- a/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc +++ b/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc @@ -14,8 +14,6 @@ #include "DataFormats/Math/interface/Vector3D.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "DetectorDescription/DDCMS/interface/DDShapes.h" - #include #include @@ -23,9 +21,16 @@ using namespace SurfaceOrientation; using namespace std; using namespace magneticfield; using namespace edm; +//using namespace angle_units::operators; + +using DDBox = dd4hep::Box; +using DDTrap = dd4hep::Trap; +using DDTubs = dd4hep::Tube; +using DDCons = dd4hep::ConeSegment; +using DDTruncTubs = dd4hep::TruncatedTube; volumeHandle::volumeHandle(const cms::DDFilteredView &fv, bool expand2Pi, bool debugVal) - : BaseVolumeHandle(expand2Pi, debugVal), theShape(fv.legacyShape(cms::dd::getCurrentShape(fv))), solid(fv) { + : BaseVolumeHandle(expand2Pi, debugVal), theShape(fv.legacyShape(fv.shape())), solid(fv) { name = fv.name(); copyno = fv.copyNum(); const auto *const transArray = fv.trans(); @@ -41,25 +46,66 @@ volumeHandle::volumeHandle(const cms::DDFilteredView &fv, bool expand2Pi, bool d } referencePlane(fv); switch (theShape) { - case DDSolidShape::ddbox: - buildBox(); - break; - case DDSolidShape::ddtrap: - buildTrap(); - break; - case DDSolidShape::ddcons: - buildCons(); - break; - case DDSolidShape::ddtubs: - buildTubs(); - break; + case DDSolidShape::ddbox: { + DDBox box(solid.solid()); + // DD4hep returns units in cm, no conversion needed. + double halfX = box.x(); + double halfY = box.y(); + double halfZ = box.z(); + buildBox(halfX, halfY, halfZ); + } break; + case DDSolidShape::ddtrap: { + DDTrap trap(solid.solid()); + double x1 = trap.bottomLow1(); + double x2 = trap.topLow1(); + double x3 = trap.bottomLow2(); + double x4 = trap.topLow2(); + double y1 = trap.high1(); + double y2 = trap.high2(); + double theta = trap.theta(); + double phi = trap.phi(); + double halfZ = trap.dZ(); + double alpha1 = trap.alpha1(); + double alpha2 = trap.alpha2(); + buildTrap(x1, x2, x3, x4, y1, y2, theta, phi, halfZ, alpha1, alpha2); + } break; + + case DDSolidShape::ddcons: { + DDCons cons(solid.solid()); + double zhalf = cons.dZ(); + double rInMinusZ = cons.rMin1(); + double rOutMinusZ = cons.rMax1(); + double rInPlusZ = cons.rMin2(); + double rOutPlusZ = cons.rMax2(); + double startPhi = cons.startPhi(); + double deltaPhi = cons.endPhi() - startPhi; + buildCons(zhalf, rInMinusZ, rOutMinusZ, rInPlusZ, rOutPlusZ, startPhi, deltaPhi); + } break; + case DDSolidShape::ddtubs: { + DDTubs tubs(solid.solid()); + double zhalf = tubs.dZ(); + double rIn = tubs.rMin(); + double rOut = tubs.rMax(); + double startPhi = tubs.startPhi(); + double deltaPhi = tubs.endPhi() - startPhi; + buildTubs(zhalf, rIn, rOut, startPhi, deltaPhi); + } break; case DDSolidShape::ddpseudotrap: { vector d = solid.volume().volume().solid().dimensions(); buildPseudoTrap(d[0], d[1], d[2], d[3], d[4], d[5], d[6]); } break; - case DDSolidShape::ddtrunctubs: - buildTruncTubs(); - break; + case DDSolidShape::ddtrunctubs: { + DDTruncTubs tubs(solid.solid()); + double zhalf = tubs.dZ(); // half of the z-Axis + double rIn = tubs.rMin(); // inner radius + double rOut = tubs.rMax(); // outer radius + double startPhi = tubs.startPhi(); // angular start of the tube-section + double deltaPhi = tubs.deltaPhi(); // angular span of the tube-section + double cutAtStart = tubs.cutAtStart(); // truncation at begin of the tube-section + double cutAtDelta = tubs.cutAtDelta(); // truncation at end of the tube-section + bool cutInside = tubs.cutInside(); // true, if truncation is on the inner side of the tube-section + buildTruncTubs(zhalf, rIn, rOut, startPhi, deltaPhi, cutAtStart, cutAtDelta, cutInside); + } break; default: LogError("magneticfield::volumeHandle") << "ctor: Unexpected shape # " << static_cast(theShape) << " for vol " << name; @@ -183,20 +229,6 @@ std::vector volumeHandle::sides() const { return result; } -// The files included below are used here and in the old DD version of this file. -// To allow them to be used in both places, they call a "convertUnits" function -// that is defined differently between old and new DD. -// For the old DD, another version of this function converts mm to cm. - -namespace { - template - inline constexpr NumType convertUnits(NumType centimeters) { - return (centimeters); - } -} // namespace - -using namespace cms::dd; - #include "buildBox.icc" #include "buildTrap.icc" #include "buildTubs.icc" diff --git a/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.h b/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.h index e037835a4bfcd..6b7a784b314ea 100644 --- a/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.h +++ b/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.h @@ -40,18 +40,41 @@ namespace magneticfield { void referencePlane(const cms::DDFilteredView& fv); // Build the surfaces for a box - void buildBox(); + void buildBox(double halfX, double halfY, double halfZ); // Build the surfaces for a trapezoid - void buildTrap(); + void buildTrap(double x1, + double x2, + double x3, + double x4, + double y1, + double y2, + double theta, + double phi, + double halfZ, + double alpha1, + double alpha2); // Build the surfaces for a ddtubs shape - void buildTubs(); + void buildTubs(double zhalf, double rIn, double rOut, double startPhi, double deltaPhi); // Build the surfaces for a ddcons shape - void buildCons(); + void buildCons(double zhalf, + double rInMinusZ, + double rOutMinusZ, + double rInPlusZ, + double rOutPlusZ, + double startPhi, + double deltaPhi); // Build the surfaces for a ddpseudotrap. This is not a supported // shape in DD4hep; it is handled here to cope with legacy geometries. void buildPseudoTrap(double x1, double x2, double y1, double y2, double halfZ, double radius, bool atMinusZ); // Build the surfaces for a ddtrunctubs shape - void buildTruncTubs(); + void buildTruncTubs(double zhalf, + double rIn, + double rOut, + double startPhi, + double deltaPhi, + double cutAtStart, + double cutAtDelta, + bool cutInside); // Shape at initialization const DDSolidShape theShape; diff --git a/MagneticField/GeomBuilder/src/buildBox.icc b/MagneticField/GeomBuilder/src/buildBox.icc index 63f269cee2b22..15027724473d1 100644 --- a/MagneticField/GeomBuilder/src/buildBox.icc +++ b/MagneticField/GeomBuilder/src/buildBox.icc @@ -4,16 +4,9 @@ * \author N. Amapane - INFN Torino */ -void volumeHandle::buildBox() { +void volumeHandle::buildBox(double halfX, double halfY, double halfZ) { LogTrace("MagGeoBuilder") << "Building box surfaces...: "; - DDBox box(solid); - // Old DD needs mm to cm conversion, but DD4hep needs no conversion. - // convertUnits should be defined appropriately. - double halfX = convertUnits(box.halfX()); - double halfY = convertUnits(box.halfY()); - double halfZ = convertUnits(box.halfZ()); - // Global vectors of the normals to X, Y, Z axes GlobalVector planeXAxis = refPlane->toGlobal(LocalVector(1, 0, 0)); GlobalVector planeYAxis = refPlane->toGlobal(LocalVector(0, 1, 0)); diff --git a/MagneticField/GeomBuilder/src/buildCons.icc b/MagneticField/GeomBuilder/src/buildCons.icc index 007fd5eab5b09..3dc381fbc398e 100644 --- a/MagneticField/GeomBuilder/src/buildCons.icc +++ b/MagneticField/GeomBuilder/src/buildCons.icc @@ -6,21 +6,14 @@ #include "DataFormats/GeometrySurface/interface/SimpleConeBounds.h" -void volumeHandle::buildCons() { +void volumeHandle::buildCons(double zhalf, + double rInMinusZ, + double rOutMinusZ, + double rInPlusZ, + double rOutPlusZ, + double startPhi, + double deltaPhi) { LogTrace("MagGeoBuilder") << "Building cons surfaces...: "; - - DDCons cons(solid); - - // Old DD needs mm to cm conversion, but DD4hep needs no conversion. - // convertUnits should be defined appropriately. - double zhalf = convertUnits(cons.zhalf()); - double rInMinusZ = convertUnits(cons.rInMinusZ()); - double rOutMinusZ = convertUnits(cons.rOutMinusZ()); - double rInPlusZ = convertUnits(cons.rInPlusZ()); - double rOutPlusZ = convertUnits(cons.rOutPlusZ()); - double startPhi = cons.phiFrom(); - double deltaPhi = cons.deltaPhi(); - LogTrace("MagGeoBuilder") << "zhalf " << zhalf << newln << "rInMinusZ " << rInMinusZ << newln << "rOutMinusZ " << rOutMinusZ << newln << "rInPlusZ " << rInPlusZ << newln << "rOutPlusZ " << rOutPlusZ << newln << "phiFrom " << startPhi << newln << "deltaPhi " << deltaPhi; diff --git a/MagneticField/GeomBuilder/src/buildPseudoTrap.icc b/MagneticField/GeomBuilder/src/buildPseudoTrap.icc index ef02d4f316670..3c57e627b090f 100644 --- a/MagneticField/GeomBuilder/src/buildPseudoTrap.icc +++ b/MagneticField/GeomBuilder/src/buildPseudoTrap.icc @@ -13,16 +13,8 @@ */ void volumeHandle::buildPseudoTrap( - double x1_, double x2_, double y1_, double y2_, double halfZ_, double radius_, bool atMinusZ) { - // Old DD needs mm to cm conversion, but DD4hep needs no conversion. - // convertUnits should be defined appropriately. - double halfZ = convertUnits(halfZ_); - double x1 = convertUnits(x1_); - double x2 = convertUnits(x2_); - double y1 = convertUnits(y1_); - double y2 = convertUnits(y2_); - double radius = convertUnits(radius_); - + double x1, double x2, double y1, double y2, double halfZ, double radius, bool atMinusZ) { + LogTrace("MagGeoBuilder") << "Building PseudoTrap surfaces...: "; LogTrace("MagGeoBuilder") << "halfZ " << halfZ << newln << "x1 " << x1 << newln << "x2 " << x2 << newln << "y1 " << y1 << newln << "y2 " << y2 << newln << "radius " << radius << newln << "atMinusZ " << atMinusZ; diff --git a/MagneticField/GeomBuilder/src/buildTrap.icc b/MagneticField/GeomBuilder/src/buildTrap.icc index a205b9abb825f..094f8c6012ab3 100644 --- a/MagneticField/GeomBuilder/src/buildTrap.icc +++ b/MagneticField/GeomBuilder/src/buildTrap.icc @@ -4,25 +4,18 @@ * \author N. Amapane - INFN Torino */ -void volumeHandle::buildTrap() { +void volumeHandle::buildTrap(double x1, + double x2, + double x3, + double x4, + double y1, + double y2, + double theta, + double phi, + double halfZ, + double alpha1, + double alpha2) { LogTrace("MagGeoBuilder") << "Building trapezoid surfaces...: "; - - DDTrap trap(solid); //FIXME - - // Old DD needs mm to cm conversion, but DD4hep needs no conversion. - // convertUnits should be defined appropriately. - double x1 = convertUnits(trap.x1()); - double x2 = convertUnits(trap.x2()); - double x3 = convertUnits(trap.x3()); - double x4 = convertUnits(trap.x4()); - double y1 = convertUnits(trap.y1()); - double y2 = convertUnits(trap.y2()); - double theta = trap.theta(); - double phi = trap.phi(); - double halfZ = convertUnits(trap.halfZ()); - double alpha1 = trap.alpha1(); - double alpha2 = trap.alpha2(); - LogTrace("MagGeoBuilder") << "x1 " << x1 << newln << "x2 " << x2 << newln << "x3 " << x3 << newln << "x4 " << x4 << newln << "y1 " << y1 << newln << "y2 " << y2 << newln << "theta " << theta << newln << "phi " << phi << newln << "halfZ " << halfZ << newln << "alpha1 " << alpha1 << newln diff --git a/MagneticField/GeomBuilder/src/buildTruncTubs.icc b/MagneticField/GeomBuilder/src/buildTruncTubs.icc index 1e8f6e3d367c1..068efe9e87e71 100644 --- a/MagneticField/GeomBuilder/src/buildTruncTubs.icc +++ b/MagneticField/GeomBuilder/src/buildTruncTubs.icc @@ -9,22 +9,15 @@ * \author N. Amapane - INFN Torino */ -void volumeHandle::buildTruncTubs() { +void volumeHandle::buildTruncTubs(double zhalf, + double rIn, + double rOut, + double startPhi, + double deltaPhi, + double cutAtStart, + double cutAtDelta, + bool cutInside) { LogTrace("MagGeoBuilder") << "Building TruncTubs surfaces...: "; - - DDTruncTubs tubs(solid); - - // Old DD needs mm to cm conversion, but DD4hep needs no conversion. - // convertUnits should be defined appropriately. - double zhalf = convertUnits(tubs.zHalf()); // half of the z-Axis - double rIn = convertUnits(tubs.rIn()); // inner radius - double rOut = convertUnits(tubs.rOut()); // outer radius - double startPhi = tubs.startPhi(); // angular start of the tube-section - double deltaPhi = tubs.deltaPhi(); // angular span of the tube-section - double cutAtStart = convertUnits(tubs.cutAtStart()); // truncation at begin of the tube-section - double cutAtDelta = convertUnits(tubs.cutAtDelta()); // truncation at end of the tube-section - bool cutInside = tubs.cutInside(); // true, if truncation is on the inner side of the tube-section - LogTrace("MagGeoBuilder") << "zhalf " << zhalf << newln << "rIn " << rIn << newln << "rOut " << rOut << newln << "startPhi " << startPhi << newln << "deltaPhi " << deltaPhi << newln << "cutAtStart " << cutAtStart << newln << "cutAtDelta " << cutAtDelta << newln diff --git a/MagneticField/GeomBuilder/src/buildTubs.icc b/MagneticField/GeomBuilder/src/buildTubs.icc index bac6b816b889a..9e9872d4e1286 100644 --- a/MagneticField/GeomBuilder/src/buildTubs.icc +++ b/MagneticField/GeomBuilder/src/buildTubs.icc @@ -1,16 +1,5 @@ -void volumeHandle::buildTubs() { +void volumeHandle::buildTubs(double zhalf, double rIn, double rOut, double startPhi, double deltaPhi) { LogTrace("MagGeoBuilder") << "Building tubs surfaces...: "; - - DDTubs tubs(solid); - - // Old DD needs mm to cm conversion, but DD4hep needs no conversion. - // convertUnits should be defined appropriately. - double zhalf = convertUnits(tubs.zhalf()); - double rIn = convertUnits(tubs.rIn()); - double rOut = convertUnits(tubs.rOut()); - double startPhi = tubs.startPhi(); - double deltaPhi = tubs.deltaPhi(); - LogTrace("MagGeoBuilder") << "zhalf " << zhalf << newln << "rIn " << rIn << newln << "rOut " << rOut << newln << "startPhi " << startPhi << newln << "deltaPhi " << deltaPhi; diff --git a/MagneticField/GeomBuilder/src/volumeHandle.cc b/MagneticField/GeomBuilder/src/volumeHandle.cc index 71b269e81216e..97d6877a3b8c8 100644 --- a/MagneticField/GeomBuilder/src/volumeHandle.cc +++ b/MagneticField/GeomBuilder/src/volumeHandle.cc @@ -27,6 +27,17 @@ using namespace SurfaceOrientation; using namespace std; +#include "DataFormats/Math/interface/GeantUnits.h" + +namespace { + // Old DD returns lengths in mm, but CMS code uses cm + template + inline constexpr NumType convertUnits(NumType millimeters) // Millimeters -> centimeters + { + return (geant_units::operators::convertMmToCm(millimeters)); + } +} // namespace + MagGeoBuilderFromDDD::volumeHandle::volumeHandle(const DDExpandedView &fv, bool expand2Pi, bool debugVal) : magneticfield::BaseVolumeHandle(expand2Pi, debugVal) { name = fv.logicalPart().name().name(); @@ -50,18 +61,64 @@ MagGeoBuilderFromDDD::volumeHandle::volumeHandle(const DDExpandedView &fv, bool referencePlane(fv); if (solid.shape() == DDSolidShape::ddbox) { - buildBox(); + DDBox box(solid); + double halfX = convertUnits(box.halfX()); + double halfY = convertUnits(box.halfY()); + double halfZ = convertUnits(box.halfZ()); + buildBox(halfX, halfY, halfZ); } else if (solid.shape() == DDSolidShape::ddtrap) { - buildTrap(); + DDTrap trap(solid); + double x1 = convertUnits(trap.x1()); + double x2 = convertUnits(trap.x2()); + double x3 = convertUnits(trap.x3()); + double x4 = convertUnits(trap.x4()); + double y1 = convertUnits(trap.y1()); + double y2 = convertUnits(trap.y2()); + double theta = trap.theta(); + double phi = trap.phi(); + double halfZ = convertUnits(trap.halfZ()); + double alpha1 = trap.alpha1(); + double alpha2 = trap.alpha2(); + buildTrap(x1, x2, x3, x4, y1, y2, theta, phi, halfZ, alpha1, alpha2); } else if (solid.shape() == DDSolidShape::ddcons) { - buildCons(); + DDCons cons(solid); + double zhalf = convertUnits(cons.zhalf()); + double rInMinusZ = convertUnits(cons.rInMinusZ()); + double rOutMinusZ = convertUnits(cons.rOutMinusZ()); + double rInPlusZ = convertUnits(cons.rInPlusZ()); + double rOutPlusZ = convertUnits(cons.rOutPlusZ()); + double startPhi = cons.phiFrom(); + double deltaPhi = cons.deltaPhi(); + buildCons(zhalf, rInMinusZ, rOutMinusZ, rInPlusZ, rOutPlusZ, startPhi, deltaPhi); } else if (solid.shape() == DDSolidShape::ddtubs) { - buildTubs(); + DDTubs tubs(solid); + double zhalf = convertUnits(tubs.zhalf()); + double rIn = convertUnits(tubs.rIn()); + double rOut = convertUnits(tubs.rOut()); + double startPhi = tubs.startPhi(); + double deltaPhi = tubs.deltaPhi(); + buildTubs(zhalf, rIn, rOut, startPhi, deltaPhi); } else if (solid.shape() == DDSolidShape::ddpseudotrap) { DDPseudoTrap ptrap(solid); - buildPseudoTrap(ptrap.x1(), ptrap.x2(), ptrap.y1(), ptrap.y2(), ptrap.halfZ(), ptrap.radius(), ptrap.atMinusZ()); + double x1 = convertUnits(ptrap.x1()); + double x2 = convertUnits(ptrap.x2()); + double y1 = convertUnits(ptrap.y1()); + double y2 = convertUnits(ptrap.y2()); + double halfZ = convertUnits(ptrap.halfZ()); + double radius = convertUnits(ptrap.radius()); + bool atMinusZ = ptrap.atMinusZ(); + buildPseudoTrap(x1, x2, y1, y2, halfZ, radius, atMinusZ); } else if (solid.shape() == DDSolidShape::ddtrunctubs) { - buildTruncTubs(); + DDTruncTubs tubs(solid); + double zhalf = convertUnits(tubs.zHalf()); // half of the z-Axis + double rIn = convertUnits(tubs.rIn()); // inner radius + double rOut = convertUnits(tubs.rOut()); // outer radius + double startPhi = tubs.startPhi(); // angular start of the tube-section + double deltaPhi = tubs.deltaPhi(); // angular span of the tube-section + double cutAtStart = convertUnits(tubs.cutAtStart()); // truncation at begin of the tube-section + double cutAtDelta = convertUnits(tubs.cutAtDelta()); // truncation at end of the tube-section + bool cutInside = tubs.cutInside(); // true, if truncation is on the inner side of the tube-section + buildTruncTubs(zhalf, rIn, rOut, startPhi, deltaPhi, cutAtStart, cutAtDelta, cutInside); } else { cout << "volumeHandle ctor: Unexpected solid: " << DDSolidShapesName::name(solid.shape()) << endl; } @@ -233,20 +290,9 @@ std::vector MagGeoBuilderFromDDD::volumeHandle::sides() const { return result; } -#include "DataFormats/Math/interface/GeantUnits.h" - using volumeHandle = MagGeoBuilderFromDDD::volumeHandle; using namespace magneticfield; -namespace { - // Old DD returns lengths in mm, but CMS code uses cm - template - inline constexpr NumType convertUnits(NumType millimeters) // Millimeters -> centimeters - { - return (geant_units::operators::convertMmToCm(millimeters)); - } -} // namespace - #include "buildBox.icc" #include "buildTrap.icc" #include "buildTubs.icc" diff --git a/MagneticField/GeomBuilder/src/volumeHandle.h b/MagneticField/GeomBuilder/src/volumeHandle.h index c7f5ab9ed418e..1627ab81606d7 100644 --- a/MagneticField/GeomBuilder/src/volumeHandle.h +++ b/MagneticField/GeomBuilder/src/volumeHandle.h @@ -39,17 +39,40 @@ class MagGeoBuilderFromDDD::volumeHandle : public magneticfield::BaseVolumeHandl void referencePlane(const DDExpandedView& fv); // Build the surfaces for a box - void buildBox(); + void buildBox(double halfX, double halfY, double halfZ); // Build the surfaces for a trapezoid - void buildTrap(); + void buildTrap(double x1, + double x2, + double x3, + double x4, + double y1, + double y2, + double theta, + double phi, + double halfZ, + double alpha1, + double alpha2); // Build the surfaces for a ddtubs shape - void buildTubs(); + void buildTubs(double zhalf, double rIn, double rOut, double startPhi, double deltaPhi); // Build the surfaces for a ddcons shape - void buildCons(); + void buildCons(double zhalf, + double rInMinusZ, + double rOutMinusZ, + double rInPlusZ, + double rOutPlusZ, + double startPhi, + double deltaPhi); // Build the surfaces for a ddpseudotrap shape void buildPseudoTrap(double x1, double x2, double y1, double y2, double halfZ, double radius, bool atMinusZ); // Build the surfaces for a ddtrunctubs shape - void buildTruncTubs(); + void buildTruncTubs(double zhalf, + double rIn, + double rOut, + double startPhi, + double deltaPhi, + double cutAtStart, + double cutAtDelta, + bool cutInside); // the DDSolid. DDSolid solid; From 825e3ace622ec4dfe3e3e25f7524ba978c0d425b Mon Sep 17 00:00:00 2001 From: Nicola Amapane Date: Fri, 2 Oct 2020 15:55:06 +0200 Subject: [PATCH 196/778] cleanup obsolete, unused standard sequences --- .../python/MagneticField_38T_PostLS1_cff.py | 13 ------------- .../python/MagneticField_AutoFromDBCurrent_cff.py | 6 ------ 2 files changed, 19 deletions(-) delete mode 100644 Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py delete mode 100644 Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py diff --git a/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py b/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py deleted file mode 100644 index 739c9b113917b..0000000000000 --- a/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -### THIS CFF IS DEPRECATED!!!! ### -# please use MagneticField_cff.py instead - -from __future__ import print_function -print(" ##################################################################### ") -print(" # WARNING: the module # ") -print(" # Configuration.StandardSequences.MagneticField_38T_PostLS1_cff # ") -print(" # is deprecated. Please import # ") -print(" # Configuration.StandardSequences.MagneticField_cff # ") -print(" ##################################################################### ") - -from Configuration.StandardSequences.MagneticField_38T_cff import * - diff --git a/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py b/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py deleted file mode 100644 index 97ca9a181ced2..0000000000000 --- a/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py +++ /dev/null @@ -1,6 +0,0 @@ -# This cff is obsolete and will eventually be deprecated. -# Please replace it with -# Configuration.StandardSequences.MagneticField_cff.py -# in your setup. - -from Configuration.StandardSequences.MagneticField_cff import * From fe8e5261437959d620a4bc57abed3fea8c49a346 Mon Sep 17 00:00:00 2001 From: Nicola Amapane Date: Fri, 2 Oct 2020 16:02:28 +0200 Subject: [PATCH 197/778] Add IB tests for MagneticField --- MagneticField/Engine/test/BuildFile.xml | 5 +++ .../Engine/test/regressionTestHelper.cpp | 2 + MagneticField/Engine/test/runTest.sh | 39 +++++++++++++++++++ .../Engine/test/testMagneticField.cc | 3 ++ 4 files changed, 49 insertions(+) create mode 100644 MagneticField/Engine/test/regressionTestHelper.cpp create mode 100755 MagneticField/Engine/test/runTest.sh diff --git a/MagneticField/Engine/test/BuildFile.xml b/MagneticField/Engine/test/BuildFile.xml index acf003627dd4b..15fb3ad1efbea 100644 --- a/MagneticField/Engine/test/BuildFile.xml +++ b/MagneticField/Engine/test/BuildFile.xml @@ -11,3 +11,8 @@ + + + + + diff --git a/MagneticField/Engine/test/regressionTestHelper.cpp b/MagneticField/Engine/test/regressionTestHelper.cpp new file mode 100644 index 0000000000000..2f0e0c40064da --- /dev/null +++ b/MagneticField/Engine/test/regressionTestHelper.cpp @@ -0,0 +1,2 @@ +#include "FWCore/Utilities/interface/TestHelper.h" +RUNTEST() diff --git a/MagneticField/Engine/test/runTest.sh b/MagneticField/Engine/test/runTest.sh new file mode 100755 index 0000000000000..4cbd3a060588c --- /dev/null +++ b/MagneticField/Engine/test/runTest.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +function die { echo $1: status $2 ; exit $2; } + +echo "===== Test MF map regressions ====" + +#Note: Only the most relevant tests are left uncommented since the full set is highly redundant and time consuming. + +#Run II, 3.8T +(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DDD) || die "MF regression failure, from xml, DDD, 3.8T" $? +(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB) || die "MF regression failure, from DB, DDD, 3.8T" $? +(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DD4Hep) || die "MF regression failure, from xml, DD4hep, 3.8T" $? +(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB_DD4Hep) || die "MF regression failure, from DB, DD4hep, 3.8T" $? + +#Run I, 3.8T +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DDD era=RunI) || die "MF regression failure, from xml, DDD, 3.8T RunI" $? +(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB era=RunI) || die "MF regression failure, from DB, DDD, 3.8T RunI" $? +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DD4Hep era=RunI) || die "MF regression failure, from xml, DD4hep, 3.8T RunI" $? +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB_DD4Hep era=RunI) || die "MF regression failure, from DB, DD4hep, 3.8T RunI" $? + +#Run II, 3.5T +export CURRENT=16730 +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DDD current=$CURRENT) || die "MF regression failure, from xml, DDD, 3.5T" $? +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB current=$CURRENT) || die "MF regression failure, from DB, DDD, 3.5T" $? +(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DD4Hep current=$CURRENT) || die "MF regression failure, from xml, DD4hep, 3.5T" $? +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB_DD4Hep current=$CURRENT) || die "MF regression failure, from DB, DD4hep, 3.5T" $? + +#Run II, 3T +export CURRENT=14340 +(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DDD current=$CURRENT) || die "MF regression failure, from xml, DDD, 3T" $? +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB current=$CURRENT) || die "MF regression failure, from DB, DDD, 3T" $? +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DD4Hep current=$CURRENT) || die "MF regression failure, from xml, DD4hep, 3T" $? +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB_DD4Hep current=$CURRENT) || die "MF regression failure, from DB, DD4hep, 3T" $? + +#Run II, 2T +export CURRENT=9500 +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=static_DDD current=$CURRENT) || die "MF regression failure, from xml, DDD, 2T" $? +#(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB current=$CURRENT) || die "MF regression failure, from DB, DDD, 2T" $? +(cmsRun ${LOCAL_TEST_DIR}/regression.py producerType=fromDB_DD4Hep current=$CURRENT) || die "MF regression failure, from DB, DD4hep, 2T" $? diff --git a/MagneticField/Engine/test/testMagneticField.cc b/MagneticField/Engine/test/testMagneticField.cc index 5d5bf28d74bb5..b7385b5a8f79a 100644 --- a/MagneticField/Engine/test/testMagneticField.cc +++ b/MagneticField/Engine/test/testMagneticField.cc @@ -263,6 +263,9 @@ void testMagneticField::validate(string filename, string type) { << " testMagneticField::validate: tested " << count << " points " << fail << " failures; max delta = " << maxdelta << endl << endl; + if (fail != 0) + throw cms::Exception("RegressionFailure") << "MF regression found: " << fail << " failures"; + ; } } From 3139d73c99a1aa8150e84e5282b37ff5bebb8d44 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Fri, 2 Oct 2020 16:43:10 +0200 Subject: [PATCH 198/778] remove spurious include --- Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc b/Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc index db0c1244847e7..3bf5dcc50aa92 100644 --- a/Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc +++ b/Geometry/VeryForwardGeometryBuilder/src/DetGeomDesc.cc @@ -14,7 +14,6 @@ #include "CondFormats/PPSObjects/interface/CTPPSRPAlignmentCorrectionData.h" #include "DetectorDescription/Core/interface/DDSolid.h" -#include "DetectorDescription/DDCMS/interface/DDShapes.h" #include "DetectorDescription/DDCMS/interface/DDSolidShapes.h" #include "DataFormats/CTPPSDetId/interface/TotemRPDetId.h" From 8dbf57276e8fe5f7631b7eb2803ad750b3a64b61 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Fri, 2 Oct 2020 16:52:52 +0200 Subject: [PATCH 199/778] Try to resolve the orientation index issue for HGCal V13/V14 --- .../data/hfnoseCons/v1/hfnoseCons.xml | 1 + .../data/hfnoseCons/v1m/hfnoseCons.xml | 1 + .../data/hgcalCons/v10/hgcalCons.xml | 3 +++ .../data/hgcalCons/v11/hgcalCons.xml | 3 +++ .../data/hgcalCons/v11m/hgcalCons.xml | 3 +++ .../data/hgcalCons/v12/hgcalCons.xml | 3 +++ .../data/hgcalCons/v13/hgcalCons.xml | 3 +++ .../data/hgcalCons/v14/hgcalCons.xml | 3 +++ .../data/hgcalCons/v9/hgcalCons.xml | 3 +++ .../data/hgcalCons/v9a/hgcalCons.xml | 2 ++ .../data/hgcalCons/v9ap/hgcalCons.xml | 2 ++ .../data/hgcalCons/v9p/hgcalCons.xml | 2 ++ .../interface/HGCalParameters.h | 1 + .../interface/HGCalWaferMask.h | 1 + .../src/HGCalGeomParameters.cc | 6 ++---- .../src/HGCalParametersFromDD.cc | 19 ++++++++++------- .../HGCalCommonData/src/HGCalWaferMask.cc | 21 +++++++++++++++++++ 17 files changed, 66 insertions(+), 11 deletions(-) diff --git a/Geometry/ForwardCommonData/data/hfnoseCons/v1/hfnoseCons.xml b/Geometry/ForwardCommonData/data/hfnoseCons/v1/hfnoseCons.xml index 41ce568fe04eb..346e3f1a72300 100644 --- a/Geometry/ForwardCommonData/data/hfnoseCons/v1/hfnoseCons.xml +++ b/Geometry/ForwardCommonData/data/hfnoseCons/v1/hfnoseCons.xml @@ -26,6 +26,7 @@ + diff --git a/Geometry/ForwardCommonData/data/hfnoseCons/v1m/hfnoseCons.xml b/Geometry/ForwardCommonData/data/hfnoseCons/v1m/hfnoseCons.xml index 92d00284cde44..6aa4bf6fd73ef 100644 --- a/Geometry/ForwardCommonData/data/hfnoseCons/v1m/hfnoseCons.xml +++ b/Geometry/ForwardCommonData/data/hfnoseCons/v1m/hfnoseCons.xml @@ -26,6 +26,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v10/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v10/hgcalCons.xml index dd4d0a55023a4..b8e6992b99b28 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v10/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v10/hgcalCons.xml @@ -34,6 +34,7 @@ + @@ -87,6 +88,7 @@ + @@ -138,6 +140,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v11/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v11/hgcalCons.xml index a35bcfb2a10b9..dcc722165a39e 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v11/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v11/hgcalCons.xml @@ -34,6 +34,7 @@ + @@ -87,6 +88,7 @@ + @@ -138,6 +140,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v11m/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v11m/hgcalCons.xml index 9024454b5ff6c..52d6c1b05327c 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v11m/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v11m/hgcalCons.xml @@ -34,6 +34,7 @@ + @@ -87,6 +88,7 @@ + @@ -138,6 +140,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml index 9024454b5ff6c..52d6c1b05327c 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml @@ -34,6 +34,7 @@ + @@ -87,6 +88,7 @@ + @@ -138,6 +140,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v13/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v13/hgcalCons.xml index 6c5b5c19c2fb5..353da44cecb5f 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v13/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v13/hgcalCons.xml @@ -34,6 +34,7 @@ + @@ -87,6 +88,7 @@ + @@ -138,6 +140,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml index a4b324db44f17..fd8485e3f726b 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml @@ -34,6 +34,7 @@ + @@ -87,6 +88,7 @@ + @@ -138,6 +140,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v9/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v9/hgcalCons.xml index 9e027afcee3ca..b54022e32474b 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v9/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v9/hgcalCons.xml @@ -34,6 +34,7 @@ + @@ -80,6 +81,7 @@ + @@ -126,6 +128,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v9a/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v9a/hgcalCons.xml index bce725d8f1c78..d5fb6a9788f25 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v9a/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v9a/hgcalCons.xml @@ -37,6 +37,7 @@ + @@ -99,6 +100,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v9ap/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v9ap/hgcalCons.xml index 79804d7383a53..ae7dd56906aec 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v9ap/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v9ap/hgcalCons.xml @@ -37,6 +37,7 @@ + @@ -99,6 +100,7 @@ + diff --git a/Geometry/HGCalCommonData/data/hgcalCons/v9p/hgcalCons.xml b/Geometry/HGCalCommonData/data/hgcalCons/v9p/hgcalCons.xml index 61b2a1549dc61..c35b90c0db843 100644 --- a/Geometry/HGCalCommonData/data/hgcalCons/v9p/hgcalCons.xml +++ b/Geometry/HGCalCommonData/data/hgcalCons/v9p/hgcalCons.xml @@ -34,6 +34,7 @@ + @@ -81,6 +82,7 @@ + diff --git a/Geometry/HGCalCommonData/interface/HGCalParameters.h b/Geometry/HGCalCommonData/interface/HGCalParameters.h index 62de72f0b098d..a6a1b0afd0b7e 100644 --- a/Geometry/HGCalCommonData/interface/HGCalParameters.h +++ b/Geometry/HGCalCommonData/interface/HGCalParameters.h @@ -171,6 +171,7 @@ class HGCalParameters { wafer_map typesInLayers_; waferT_map waferTypes_; int waferMaskMode_; + int waferZSide_; waferInfo_map waferInfoMap_; tileInfo_map tileInfoMap_; std::vector > tileRingR_; diff --git a/Geometry/HGCalCommonData/interface/HGCalWaferMask.h b/Geometry/HGCalCommonData/interface/HGCalWaferMask.h index 8b4ac51473ff6..d2d6f6d6ef329 100644 --- a/Geometry/HGCalCommonData/interface/HGCalWaferMask.h +++ b/Geometry/HGCalCommonData/interface/HGCalWaferMask.h @@ -19,6 +19,7 @@ class HGCalWaferMask { static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners); static bool goodCell(int u, int v, int N, int type, int rotn); + static int getRotation(int zside, int type, int rotn); static std::pair getTypeMode(const double& xpos, const double& ypos, const double& delX, diff --git a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc index 50941059e7493..3b0e769cfa4f3 100644 --- a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc +++ b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc @@ -1167,11 +1167,9 @@ void HGCalGeomParameters::loadSpecParsHexagon8(HGCalParameters& php, const std::vector& waferOrien) { // Store parameters from Philip's file for (unsigned int k = 0; k < waferIndex.size(); ++k) { - php.waferInfoMap_[waferIndex[k]] = HGCalParameters::waferInfo(waferTypes[k], waferParts[k], waferOrien[k]); + php.waferInfoMap_[waferIndex[k]] = HGCalParameters::waferInfo(waferTypes[k], waferParts[k], HGCalWaferMask::getRotation(php.waferZSide_, waferParts[k], waferOrien[k])); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "[" << k << ":" << waferIndex[k] << "] " - << " Type " << waferTypes[k] << " Partial type " << waferParts[k] << " Orientation " - << waferOrien[k]; + edm::LogVerbatim("HGCalGeom") << "[" << k << ":" << waferIndex[k] << ":" << HGCalWaferIndex::waferLayer(waferIndex[k]) << ":" << HGCalWaferIndex::waferU(waferIndex[k]) << ":" << HGCalWaferIndex::waferV(waferIndex[k]) << "] " << " Type " << waferTypes[k] << " Partial type " << waferParts[k] << " Orientation " << waferOrien[k] << ":" << HGCalWaferMask::getRotation(php.waferZSide_, waferParts[k], waferOrien[k]); #endif } } diff --git a/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc b/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc index c88cbca98ab3f..dfec92682f062 100644 --- a/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc +++ b/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc @@ -104,6 +104,7 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv, } php.minTileSize_ = 0; php.waferMaskMode_ = 0; + php.waferZSide_ = 0; } if ((php.mode_ == HGCalGeometryMode::Hexagon8) || (php.mode_ == HGCalGeometryMode::Hexagon8Full) || (php.mode_ == HGCalGeometryMode::Hexagon8File)) { @@ -115,11 +116,12 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv, php.detectorType_ = static_cast(getDDDValue("DetectorType", sv)); php.minTileSize_ = 0; php.waferMaskMode_ = static_cast(getDDDValue("WaferMaskMode", sv)); + php.waferZSide_ = static_cast(getDDDValue("WaferZside", sv)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " ZSide Level " << php.levelZSide_ << " first layers " << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " Wafer Mask Mode " - << php.waferMaskMode_; + << php.waferMaskMode_ << " Zside " << php.waferZSide_; #endif attribute = "OnlyForHGCalNumbering"; value = namet; @@ -202,12 +204,12 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv, php.waferSize_ = php.waferR_ = 0; php.sensorSeparation_ = php.mouseBite_ = 0; php.waferMaskMode_ = static_cast(getDDDValue("WaferMaskMode", sv)); + php.waferZSide_ = static_cast(getDDDValue("WaferZside", sv)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers " << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " thickenss " << php.waferThick_ << " Tile Mask Mode " - << php.waferMaskMode_; - ; + << php.waferMaskMode_ << " Zside " << php.waferZSide_; #endif // Load the SpecPars geom->loadSpecParsTrapezoid(fv, php); @@ -277,6 +279,7 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv, #endif php.minTileSize_ = 0; php.waferMaskMode_ = 0; + php.waferZSide_ = 0; } if ((php.mode_ == HGCalGeometryMode::Hexagon8) || (php.mode_ == HGCalGeometryMode::Hexagon8Full) || (php.mode_ == HGCalGeometryMode::Hexagon8File)) { @@ -292,12 +295,13 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv, php.minTileSize_ = 0; tempD = fv.get >(name, "WaferMaskMode"); php.waferMaskMode_ = static_cast(tempD[0]); + tempD = fv.get >(name, "WaferZside"); + php.waferZSide_ = static_cast(tempD[0]); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " ZSide Level " << php.levelZSide_ << " first layers " << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " Wafer Mask Mode " - << php.waferMaskMode_; - ; + << php.waferMaskMode_ << " ZSide " << php.waferZSide_; #endif tempS = fv.get >(namet, "WaferMode"); @@ -389,12 +393,13 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv, php.sensorSeparation_ = php.mouseBite_ = 0; tempD = fv.get >(name, "WaferMaskMode"); php.waferMaskMode_ = static_cast(tempD[0]); + tempD = fv.get >(name, "WaferZside"); + php.waferZSide_ = static_cast(tempD[0]); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers " << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " thickenss " << php.waferThick_ << " min tile size " - << php.minTileSize_ << " Tile Mask Mode " << php.waferMaskMode_; - ; + << php.minTileSize_ << " Tile Mask Mode " << php.waferMaskMode_ << " ZSide " << php.waferZSide_; #endif // Load the SpecPars geom->loadSpecParsTrapezoid(fv, vmap, php, name); diff --git a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc index ebb7327e1c45d..adadaeb01102b 100644 --- a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc +++ b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc @@ -333,6 +333,27 @@ bool HGCalWaferMask::goodCell(int u, int v, int n, int type, int rotn) { return good; } +int HGCalWaferMask::getRotation(int zside, int type, int rotn) { + + int newrotn (rotn); + if ((zside < 0) && (type != HGCalTypes::WaferFull)) { + if (type == HGCalTypes::WaferFive) { //WaferFive + static const int rot1[6] = {HGCalTypes::WaferCorner4, HGCalTypes::WaferCorner3, HGCalTypes::WaferCorner2, HGCalTypes::WaferCorner1, HGCalTypes::WaferCorner0, HGCalTypes::WaferCorner5}; + newrotn = rot1[rotn]; + } else if ((type == HGCalTypes::WaferThree) || (type == HGCalTypes::WaferSemi) || (type == HGCalTypes::WaferSemi2)) { //WaferThree/WaferSemi/WaferSemi2 + static const int rot2[6] = {HGCalTypes::WaferCorner2, HGCalTypes::WaferCorner1, HGCalTypes::WaferCorner0, HGCalTypes::WaferCorner5, HGCalTypes::WaferCorner4, HGCalTypes::WaferCorner3}; + newrotn = rot2[rotn]; + } else { //WaferHalf/WaferChopTwo/WaferChopTwoM + static const int rot3[6] = {HGCalTypes::WaferCorner3, HGCalTypes::WaferCorner2, HGCalTypes::WaferCorner1, HGCalTypes::WaferCorner0, HGCalTypes::WaferCorner5, HGCalTypes::WaferCorner4}; + newrotn = rot3[rotn]; + } + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HGCalGeom") << "zside " << zside << " type " << type << " rotn " << rotn << ":" << newrotn; +#endif + return newrotn; +} + std::pair HGCalWaferMask::getTypeMode(const double& xpos, const double& ypos, const double& delX, From 45a162b99b52bd92edd89bdd8c300aa6dad18b56 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Fri, 2 Oct 2020 17:01:49 +0200 Subject: [PATCH 200/778] Code check --- .../src/HGCalGeomParameters.cc | 11 ++++++-- .../src/HGCalParametersFromDD.cc | 3 ++- .../HGCalCommonData/src/HGCalWaferMask.cc | 27 ++++++++++++++----- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc index 3b0e769cfa4f3..556d523ac413b 100644 --- a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc +++ b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc @@ -1167,9 +1167,16 @@ void HGCalGeomParameters::loadSpecParsHexagon8(HGCalParameters& php, const std::vector& waferOrien) { // Store parameters from Philip's file for (unsigned int k = 0; k < waferIndex.size(); ++k) { - php.waferInfoMap_[waferIndex[k]] = HGCalParameters::waferInfo(waferTypes[k], waferParts[k], HGCalWaferMask::getRotation(php.waferZSide_, waferParts[k], waferOrien[k])); + php.waferInfoMap_[waferIndex[k]] = HGCalParameters::waferInfo( + waferTypes[k], waferParts[k], HGCalWaferMask::getRotation(php.waferZSide_, waferParts[k], waferOrien[k])); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "[" << k << ":" << waferIndex[k] << ":" << HGCalWaferIndex::waferLayer(waferIndex[k]) << ":" << HGCalWaferIndex::waferU(waferIndex[k]) << ":" << HGCalWaferIndex::waferV(waferIndex[k]) << "] " << " Type " << waferTypes[k] << " Partial type " << waferParts[k] << " Orientation " << waferOrien[k] << ":" << HGCalWaferMask::getRotation(php.waferZSide_, waferParts[k], waferOrien[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << ":" << waferIndex[k] << ":" + << HGCalWaferIndex::waferLayer(waferIndex[k]) << ":" + << HGCalWaferIndex::waferU(waferIndex[k]) << ":" + << HGCalWaferIndex::waferV(waferIndex[k]) << "] " + << " Type " << waferTypes[k] << " Partial type " << waferParts[k] << " Orientation " + << waferOrien[k] << ":" + << HGCalWaferMask::getRotation(php.waferZSide_, waferParts[k], waferOrien[k]); #endif } } diff --git a/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc b/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc index dfec92682f062..4c80478bf5cb4 100644 --- a/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc +++ b/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc @@ -399,7 +399,8 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv, edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers " << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " thickenss " << php.waferThick_ << " min tile size " - << php.minTileSize_ << " Tile Mask Mode " << php.waferMaskMode_ << " ZSide " << php.waferZSide_; + << php.minTileSize_ << " Tile Mask Mode " << php.waferMaskMode_ << " ZSide " + << php.waferZSide_; #endif // Load the SpecPars geom->loadSpecParsTrapezoid(fv, vmap, php, name); diff --git a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc index adadaeb01102b..09779ed5adc01 100644 --- a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc +++ b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc @@ -334,17 +334,32 @@ bool HGCalWaferMask::goodCell(int u, int v, int n, int type, int rotn) { } int HGCalWaferMask::getRotation(int zside, int type, int rotn) { - - int newrotn (rotn); + int newrotn(rotn); if ((zside < 0) && (type != HGCalTypes::WaferFull)) { if (type == HGCalTypes::WaferFive) { //WaferFive - static const int rot1[6] = {HGCalTypes::WaferCorner4, HGCalTypes::WaferCorner3, HGCalTypes::WaferCorner2, HGCalTypes::WaferCorner1, HGCalTypes::WaferCorner0, HGCalTypes::WaferCorner5}; + static const int rot1[6] = {HGCalTypes::WaferCorner4, + HGCalTypes::WaferCorner3, + HGCalTypes::WaferCorner2, + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5}; newrotn = rot1[rotn]; - } else if ((type == HGCalTypes::WaferThree) || (type == HGCalTypes::WaferSemi) || (type == HGCalTypes::WaferSemi2)) { //WaferThree/WaferSemi/WaferSemi2 - static const int rot2[6] = {HGCalTypes::WaferCorner2, HGCalTypes::WaferCorner1, HGCalTypes::WaferCorner0, HGCalTypes::WaferCorner5, HGCalTypes::WaferCorner4, HGCalTypes::WaferCorner3}; + } else if ((type == HGCalTypes::WaferThree) || (type == HGCalTypes::WaferSemi) || + (type == HGCalTypes::WaferSemi2)) { //WaferThree/WaferSemi/WaferSemi2 + static const int rot2[6] = {HGCalTypes::WaferCorner2, + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5, + HGCalTypes::WaferCorner4, + HGCalTypes::WaferCorner3}; newrotn = rot2[rotn]; } else { //WaferHalf/WaferChopTwo/WaferChopTwoM - static const int rot3[6] = {HGCalTypes::WaferCorner3, HGCalTypes::WaferCorner2, HGCalTypes::WaferCorner1, HGCalTypes::WaferCorner0, HGCalTypes::WaferCorner5, HGCalTypes::WaferCorner4}; + static const int rot3[6] = {HGCalTypes::WaferCorner3, + HGCalTypes::WaferCorner2, + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5, + HGCalTypes::WaferCorner4}; newrotn = rot3[rotn]; } } From 8af9c7c399068dbb2bb963ea3d88ee22da6c8913 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Fri, 2 Oct 2020 17:37:47 +0200 Subject: [PATCH 201/778] Add a customisation to run the "GRun" HLT menu on Run 2 data/MC --- .../python/customizeHLTforCMSSW.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index d831223b55701..3e0d89204be22 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -170,6 +170,40 @@ def customiseFor2017DtUnpacking(process): return process + +def customisePixelGainForRun2Input(process): + """Customise the HLT to run on Run 2 data/MC using the old definition of the pixel calibrations + + Up to 11.0.x, the pixel calibarations were fully specified in the configuration: + VCaltoElectronGain = 47 + VCaltoElectronGain_L1 = 50 + VCaltoElectronOffset = -60 + VCaltoElectronOffset_L1 = -670 + + Starting with 11.1.x, the calibrations for Run 3 were moved to the conditions, leaving in the configuration only: + VCaltoElectronGain = 1 + VCaltoElectronGain_L1 = 1 + VCaltoElectronOffset = 0 + VCaltoElectronOffset_L1 = 0 + + Since the conditions for Run 2 have not been updated to the new scheme, the HLT configuration needs to be reverted. + """ + # revert the Pixel parameters to be compatible with the Run 2 conditions + for producer in producers_by_type(process, "SiPixelClusterProducer"): + producer.VCaltoElectronGain = 47 + producer.VCaltoElectronGain_L1 = 50 + producer.VCaltoElectronOffset = -60 + producer.VCaltoElectronOffset_L1 = -670 + + return process + + +def customiseFor2018Input(process): + """Customise the HLT to run on Run 2 data/MC""" + process = customisePixelGainForRun2Input(process) + process = synchronizeHCALHLTofflineRun3on2018data(process) + + def customiseFor31295(process): """Reorganization of kdtrees for PFBlockAlgo and optimize track-hcal links""" From e42ee21acb653c42fa514123dfc2ade8e685c2fc Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 2 Oct 2020 18:13:10 +0200 Subject: [PATCH 202/778] update the example ini files with the lauching script, now in the path --- Alignment/OfflineValidation/test/testPVValidation.ini | 2 +- .../OfflineValidation/test/testPVValidation_Relvals_DATA.ini | 4 ++-- .../OfflineValidation/test/testPVValidation_Relvals_MC.ini | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Alignment/OfflineValidation/test/testPVValidation.ini b/Alignment/OfflineValidation/test/testPVValidation.ini index d22c259b57063..77ec285ff8315 100644 --- a/Alignment/OfflineValidation/test/testPVValidation.ini +++ b/Alignment/OfflineValidation/test/testPVValidation.ini @@ -1,6 +1,6 @@ ########################### # test command: -# python PVValidationHTCondorSubmitter.py -r -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation.ini +# submitPVValidationJobs.py -r -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation.ini [Job] jobname: test diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini index 6962718577459..132f550e2587a 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini @@ -1,9 +1,9 @@ ########################### # test command: # - for run-based: -# python PVValidationHTCondorSubmitter.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini -r +# submitPVValidationJobs.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini -r # single-run -# python PVValidationHTCondorSubmitter.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini +# submitPVValidationJobs.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini [Job] jobname: test diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini index 9ebd48de56198..fcc76b345d83a 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_MC.ini @@ -1,6 +1,6 @@ ########################### # test command: -# python PVValidationHTCondorSubmitter.py -j TEST -D /QCD_Pt_470to600_TuneCP5_13TeV_pythia8/RunIIWinter19PFCalibDRPremix-TkAlMinBias-2016Conditions_newPixCond_105X_mcRun2_asymptotic_newPixCond_v2-v1/ALCARECO -i testPVValidation_Relvals_MC.ini +# submitPVValidationJobs.py -j TEST -D /QCD_Pt_470to600_TuneCP5_13TeV_pythia8/RunIIWinter19PFCalibDRPremix-TkAlMinBias-2016Conditions_newPixCond_105X_mcRun2_asymptotic_newPixCond_v2-v1/ALCARECO -i testPVValidation_Relvals_MC.ini [Job] jobname: test From e6927f180f2e60992568610b837af7546b3d6053 Mon Sep 17 00:00:00 2001 From: mmusich Date: Fri, 2 Oct 2020 19:12:51 +0200 Subject: [PATCH 203/778] remove unused file --- .../test/PVValidation_T_standardRefit_cfg.py | 302 ------------------ 1 file changed, 302 deletions(-) delete mode 100644 Alignment/OfflineValidation/test/PVValidation_T_standardRefit_cfg.py diff --git a/Alignment/OfflineValidation/test/PVValidation_T_standardRefit_cfg.py b/Alignment/OfflineValidation/test/PVValidation_T_standardRefit_cfg.py deleted file mode 100644 index 4c8f31dc7a683..0000000000000 --- a/Alignment/OfflineValidation/test/PVValidation_T_standardRefit_cfg.py +++ /dev/null @@ -1,302 +0,0 @@ -import FWCore.ParameterSet.Config as cms -import sys - -isDA = ISDATEMPLATE -isMC = ISMCTEMPLATE -allFromGT = ALLFROMGTTEMPLATE -applyBows = APPLYBOWSTEMPLATE -applyExtraConditions = EXTRACONDTEMPLATE - -process = cms.Process("PrimaryVertexValidation") - -################################################################### -def customiseAlignmentAndAPE(process): -################################################################### - if not hasattr(process.GlobalTag,'toGet'): - process.GlobalTag.toGet=cms.VPSet() - process.GlobalTag.toGet.extend( cms.VPSet(cms.PSet(record = cms.string("TrackerAlignmentRcd"), - tag = cms.string("GEOMTAGTEMPLATE"), - connect = cms.string("ALIGNOBJTEMPLATE") - ), - cms.PSet(record = cms.string("TrackerAlignmentErrorExtendedRcd"), - tag = cms.string("ERRORTAGTEMPLATE"), - connect = cms.string("APEOBJTEMPLATE") - ) - ) - ) - return process - -################################################################### -def customiseKinksAndBows(process): -################################################################### - if not hasattr(process.GlobalTag,'toGet'): - process.GlobalTag.toGet=cms.VPSet() - process.GlobalTag.toGet.extend(cms.VPSet(cms.PSet(record = cms.string("TrackerSurfaceDeformationRcd"), - tag = cms.string("BOWSTAGTEMPLATE"), - connect = cms.string("BOWSOBJECTTEMPLATE") - ), - ) - ) - return process - -################################################################### -# Event source and run selection -################################################################### -readFiles = cms.untracked.vstring() -readFiles.extend(FILESOURCETEMPLATE) -process.source = cms.Source("PoolSource", - fileNames = readFiles , - duplicateCheckMode = cms.untracked.string('checkAllFilesOpened') - ) - -#process.load("Alignment.OfflineValidation.DATASETTEMPLATE"); -process.load("FWCore.MessageService.MessageLogger_cfi") -process.MessageLogger.destinations = ['cout', 'cerr'] -process.MessageLogger.cerr.FwkReport.reportEvery = 1000 - -runboundary = RUNBOUNDARYTEMPLATE -process.source.firstRun = cms.untracked.uint32(int(runboundary)) -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(MAXEVENTSTEMPLATE) ) - -################################################################### -# JSON Filtering -################################################################### -if isMC: - print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is Simulation!" - runboundary = 1 -else: - print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: This is DATA!" - import FWCore.PythonUtilities.LumiList as LumiList - process.source.lumisToProcess = LumiList.LumiList(filename ='LUMILISTTEMPLATE').getVLuminosityBlockRange() - -################################################################### -# Messages -################################################################### -process.load("FWCore.MessageService.MessageLogger_cfi") -process.MessageLogger.destinations = ['cout', 'cerr'] -process.MessageLogger.cerr.FwkReport.reportEvery = 1000 - -#################################################################### -# Produce the Transient Track Record in the event -#################################################################### -process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi") - -#################################################################### -# Get the Magnetic Field -#################################################################### -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') - -################################################################### -# Standard loads -################################################################### -process.load("Configuration.Geometry.GeometryRecoDB_cff") - -#################################################################### -# Get the BeamSpot -#################################################################### -process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff") - -#################################################################### -# Get the GlogalTag -#################################################################### -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'GLOBALTAGTEMPLATE', '') - -if allFromGT: - print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: All is taken from GT" -else: - #################################################################### - # Get Alignment constants and APE - #################################################################### - process=customiseAlignmentAndAPE(process) - - #################################################################### - # Kinks and Bows (optional) - #################################################################### - if applyBows: - print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Applying TrackerSurfaceDeformations!" - process=customiseKinksAndBows(process) - else: - print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: MultiPVValidation: Not applying TrackerSurfaceDeformations!" - - #################################################################### - # Extra corrections not included in the GT - #################################################################### - if applyExtraConditions: - - import CalibTracker.Configuration.Common.PoolDBESSource_cfi - ##### END OF EXTRA CONDITIONS - - else: - print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Not applying extra calibration constants!" - -#################################################################### -# Load and Configure event selection -#################################################################### -process.primaryVertexFilter = cms.EDFilter("VertexSelector", - src = cms.InputTag("VERTEXTYPETEMPLATE"), - cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), - filter = cms.bool(True) - ) - -process.noscraping = cms.EDFilter("FilterOutScraping", - applyfilter = cms.untracked.bool(True), - src = cms.untracked.InputTag("TRACKTYPETEMPLATE"), - debugOn = cms.untracked.bool(False), - numtrack = cms.untracked.uint32(10), - thresh = cms.untracked.double(0.25) - ) - -process.load("Alignment.CommonAlignment.filterOutLowPt_cfi") -process.filterOutLowPt.applyfilter = True -process.filterOutLowPt.src = "TRACKTYPETEMPLATE" -process.filterOutLowPt.numtrack = 0 -process.filterOutLowPt.thresh = 1 -process.filterOutLowPt.ptmin = PTCUTTEMPLATE -process.filterOutLowPt.runControl = RUNCONTROLTEMPLATE -process.filterOutLowPt.runControlNumber = [runboundary] - -if isMC: - process.goodvertexSkim = cms.Sequence(process.noscraping+process.filterOutLowPt) -else: - process.goodvertexSkim = cms.Sequence(process.primaryVertexFilter + process.noscraping + process.filterOutLowPt) - -#################################################################### -# Load and Configure Measurement Tracker Event -# (this would be needed in case NavigationSchool is set != from '' -#################################################################### -# process.load("RecoTracker.MeasurementDet.MeasurementTrackerEventProducer_cfi") -# process.MeasurementTrackerEvent.pixelClusterProducer = 'TRACKTYPETEMPLATE' -# process.MeasurementTrackerEvent.stripClusterProducer = 'TRACKTYPETEMPLATE' -# process.MeasurementTrackerEvent.inactivePixelDetectorLabels = cms.VInputTag() -# process.MeasurementTrackerEvent.inactiveStripDetectorLabels = cms.VInputTag() - -#################################################################### -# Load and Configure TrackRefitter -#################################################################### -process.load("RecoTracker.TrackProducer.TrackRefitters_cff") -import RecoTracker.TrackProducer.TrackRefitters_cff -process.FinalTrackRefitter = RecoTracker.TrackProducer.TrackRefitter_cfi.TrackRefitter.clone() -process.FinalTrackRefitter.src = "TRACKTYPETEMPLATE" -process.FinalTrackRefitter.TrajectoryInEvent = True -process.FinalTrackRefitter.NavigationSchool = '' -process.FinalTrackRefitter.TTRHBuilder = "WithAngleAndTemplate" - -#################################################################### -# Load and Configure common selection sequence -#################################################################### -# import Alignment.CommonAlignment.tools.trackselectionRefitting as trackselRefit -# process.seqTrackselRefit = trackselRefit.getSequence(process,'TRACKTYPETEMPLATE') -# process.HighPurityTrackSelector.trackQualities = cms.vstring() -# process.HighPurityTrackSelector.pMin = cms.double(0.) -# process.TrackerTrackHitFilter.usePixelQualityFlag = cms.bool(False) -# #process.TrackerTrackHitFilter.commands = cms.vstring("drop PXB 1") -# process.AlignmentTrackSelector.pMin = cms.double(0.) -# process.AlignmentTrackSelector.ptMin = cms.double(0.) -# process.AlignmentTrackSelector.nHitMin2D = cms.uint32(0) -# process.AlignmentTrackSelector.nHitMin = cms.double(0.) -# process.AlignmentTrackSelector.d0Min = cms.double(-999999.0) -# process.AlignmentTrackSelector.d0Max = cms.double(+999999.0) -# process.AlignmentTrackSelector.dzMin = cms.double(-999999.0) -# process.AlignmentTrackSelector.dzMax = cms.double(+999999.0) - -#################################################################### -# Output file -#################################################################### -process.TFileService = cms.Service("TFileService", - fileName=cms.string("OUTFILETEMPLATE") - ) - -#################################################################### -# Deterministic annealing clustering -#################################################################### -if isDA: - print ">>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running DA Algorithm!" - process.PVValidation = cms.EDAnalyzer("PrimaryVertexValidation", - TrackCollectionTag = cms.InputTag("FinalTrackRefitter"), - VertexCollectionTag = cms.InputTag("VERTEXTYPETEMPLATE"), - Debug = cms.bool(False), - storeNtuple = cms.bool(False), - useTracksFromRecoVtx = cms.bool(False), - isLightNtuple = cms.bool(True), - askFirstLayerHit = cms.bool(False), - numberOfBins = cms.untracked.int32(48), - probePt = cms.untracked.double(PTCUTTEMPLATE), - probeEta = cms.untracked.double(2.7), - runControl = cms.untracked.bool(RUNCONTROLTEMPLATE), - intLumi = cms.untracked.double(INTLUMITEMPLATE), - runControlNumber = cms.untracked.vuint32(int(runboundary)), - - TkFilterParameters = cms.PSet(algorithm=cms.string('filter'), - maxNormalizedChi2 = cms.double(5.0), # chi2ndof < 5 - minPixelLayersWithHits = cms.int32(2), # PX hits > 2 - minSiliconLayersWithHits = cms.int32(5), # TK hits > 5 - maxD0Significance = cms.double(5.0), # fake cut (requiring 1 PXB hit) - minPt = cms.double(0.0), # better for softish events - maxEta = cms.double(5.0), # as per recommendation in PR #18330 - trackQuality = cms.string("any") - ), - - ## MM 04.05.2017 (use settings as in: https://github.com/cms-sw/cmssw/pull/18330) - TkClusParameters=cms.PSet(algorithm=cms.string('DA_vect'), - TkDAClusParameters = cms.PSet(coolingFactor = cms.double(0.6), # moderate annealing speed - Tmin = cms.double(2.0), # end of vertex splitting - Tpurge = cms.double(2.0), # cleaning - Tstop = cms.double(0.5), # end of annealing - vertexSize = cms.double(0.006), # added in quadrature to track-z resolutions - d0CutOff = cms.double(3.), # downweight high IP tracks - dzCutOff = cms.double(3.), # outlier rejection after freeze-out (T>>>>>>>>> testPVValidation_cfg.py: msg%-i: Running GAP Algorithm!" - process.PVValidation = cms.EDAnalyzer("PrimaryVertexValidation", - TrackCollectionTag = cms.InputTag("FinalTrackRefitter"), - VertexCollectionTag = cms.InputTag("VERTEXTYPETEMPLATE"), - Debug = cms.bool(False), - isLightNtuple = cms.bool(True), - storeNtuple = cms.bool(False), - useTracksFromRecoVtx = cms.bool(False), - askFirstLayerHit = cms.bool(False), - numberOfBins = cms.untracked.int32(48), - probePt = cms.untracked.double(PTCUTTEMPLATE), - probeEta = cms.untracked.double(2.7), - runControl = cms.untracked.bool(RUNCONTROLTEMPLATE), - runControlNumber = cms.untracked.vuint32(int(runboundary)), - - TkFilterParameters = cms.PSet(algorithm=cms.string('filter'), - maxNormalizedChi2 = cms.double(5.0), # chi2ndof < 20 - minPixelLayersWithHits=cms.int32(2), # PX hits > 2 - minSiliconLayersWithHits = cms.int32(5), # TK hits > 5 - maxD0Significance = cms.double(5.0), # fake cut (requiring 1 PXB hit) - minPt = cms.double(0.0), # better for softish events - maxEta = cms.double(5.0), # as per recommendation in PR #18330 - trackQuality = cms.string("any") - ), - - TkClusParameters = cms.PSet(algorithm = cms.string('gap'), - TkGapClusParameters = cms.PSet(zSeparation = cms.double(0.2) # 0.2 cm max separation betw. clusters - ) - ) - ) - -#################################################################### -# Path -#################################################################### -process.p = cms.Path(process.goodvertexSkim* - # in case the common refitting sequence is removed - process.offlineBeamSpot* - #process.seqTrackselRefit* - # in case the navigation shool is removed - #process.MeasurementTrackerEvent* - # in case the common refitting sequence is removed - process.FinalTrackRefitter* - process.PVValidation) From 1ab9bc85f558e38edc06d74d659e433c0ea2ee6b Mon Sep 17 00:00:00 2001 From: Dan Riley Date: Fri, 2 Oct 2020 14:40:32 -0400 Subject: [PATCH 204/778] use standard libuuid functions, add binary uuid option, use binary uuids for ProcessGUID --- FWCore/Framework/src/InputSource.cc | 2 +- FWCore/Utilities/interface/GlobalIdentifier.h | 2 +- FWCore/Utilities/src/GlobalIdentifier.cc | 4 +- FWCore/Utilities/src/Guid.cc | 79 ++++++------------- FWCore/Utilities/src/Guid.h | 45 ++++------- FWCore/Utilities/test/Guid_t.cpp | 27 +++++-- .../Utilities/plugins/PileUpFilter.cc | 2 - 7 files changed, 69 insertions(+), 92 deletions(-) diff --git a/FWCore/Framework/src/InputSource.cc b/FWCore/Framework/src/InputSource.cc index 64bbcfef683c1..54cdcbd05527a 100644 --- a/FWCore/Framework/src/InputSource.cc +++ b/FWCore/Framework/src/InputSource.cc @@ -57,7 +57,7 @@ namespace edm { processHistoryRegistry_(new ProcessHistoryRegistry), branchIDListHelper_(desc.branchIDListHelper_), thinnedAssociationsHelper_(desc.thinnedAssociationsHelper_), - processGUID_(createGlobalIdentifier()), + processGUID_(createGlobalIdentifier(true)), time_(), newRun_(true), newLumi_(true), diff --git a/FWCore/Utilities/interface/GlobalIdentifier.h b/FWCore/Utilities/interface/GlobalIdentifier.h index fa7fe15895d60..a4256cb27a956 100644 --- a/FWCore/Utilities/interface/GlobalIdentifier.h +++ b/FWCore/Utilities/interface/GlobalIdentifier.h @@ -3,7 +3,7 @@ #include namespace edm { - std::string createGlobalIdentifier(); + std::string createGlobalIdentifier(bool binary = false); } #endif diff --git a/FWCore/Utilities/src/GlobalIdentifier.cc b/FWCore/Utilities/src/GlobalIdentifier.cc index 071747a2a91e9..d83fd800ee88a 100644 --- a/FWCore/Utilities/src/GlobalIdentifier.cc +++ b/FWCore/Utilities/src/GlobalIdentifier.cc @@ -2,8 +2,8 @@ #include "Guid.h" namespace edm { - std::string createGlobalIdentifier() { + std::string createGlobalIdentifier(bool binary) { Guid guid; - return guid.toString(); + return binary ? guid.toBinary() : guid.toString(); } } // namespace edm diff --git a/FWCore/Utilities/src/Guid.cc b/FWCore/Utilities/src/Guid.cc index 14918174bee35..eaa513ad55afe 100644 --- a/FWCore/Utilities/src/Guid.cc +++ b/FWCore/Utilities/src/Guid.cc @@ -10,72 +10,45 @@ // // ==================================================================== #include "Guid.h" -#include -#include #include -#include -#include -#include -#include "uuid/uuid.h" +#include namespace edm { - constexpr char const* const fmt_Guid = "{:08X}-{:04X}-{:04X}-{:02X}{:02X}-{:02X}{:02X}{:02X}{:02X}{:02X}{:02X}"; /// Initialize a new Guid - void Guid::init() { - uuid_t me_; - ::uuid_generate_random(me_); - unsigned int* d1 = reinterpret_cast(me_); - unsigned short* d2 = reinterpret_cast(me_ + 4); - unsigned short* d3 = reinterpret_cast(me_ + 6); - Data1 = *d1; - Data2 = *d2; - Data3 = *d3; - for (int i = 0; i < 8; ++i) { - Data4[i] = me_[i + 8]; + void Guid::init(bool usetime) { + if (usetime) { + ::uuid_generate_time(data_); + } else { + // uuid_generate() defaults to uuid_generate_random() if /dev/urandom + // is available; if /dev/urandom is not available, then it is better + // to let uuid_generate() choose the best fallback rather than forcing + // use of an inferior source of randomness + ::uuid_generate(data_); } } + std::string const Guid::toBinary() const { + return std::string(reinterpret_cast(data_), sizeof(data_)); + } + + Guid const& Guid::fromBinary(std::string const& source) { + assert(source.size() == sizeof(data_)); + std::memcpy(data_, source.data(), sizeof(data_)); + return *this; + } + std::string const Guid::toString() const { - return fmt::format( - fmt_Guid, Data1, Data2, Data3, Data4[0], Data4[1], Data4[2], Data4[3], Data4[4], Data4[5], Data4[6], Data4[7]); + char out[UUID_STR_LEN]; + ::uuid_unparse(data_, out); + return std::string(out); } // fromString is used only in a unit test, so performance is not critical. Guid const& Guid::fromString(std::string const& source) { - char const dash = '-'; - size_t const iSize = 8; - size_t const sSize = 4; - size_t const cSize = 2; - size_t offset = 0; - Data1 = strtol(source.substr(offset, iSize).c_str(), nullptr, 16); - offset += iSize; - assert(dash == source[offset++]); - Data2 = strtol(source.substr(offset, sSize).c_str(), nullptr, 16); - offset += sSize; - assert(dash == source[offset++]); - Data3 = strtol(source.substr(offset, sSize).c_str(), nullptr, 16); - offset += sSize; - assert(dash == source[offset++]); - Data4[0] = strtol(source.substr(offset, cSize).c_str(), nullptr, 16); - offset += cSize; - Data4[1] = strtol(source.substr(offset, cSize).c_str(), nullptr, 16); - offset += cSize; - assert(dash == source[offset++]); - Data4[2] = strtol(source.substr(offset, cSize).c_str(), nullptr, 16); - offset += cSize; - Data4[3] = strtol(source.substr(offset, cSize).c_str(), nullptr, 16); - offset += cSize; - Data4[4] = strtol(source.substr(offset, cSize).c_str(), nullptr, 16); - offset += cSize; - Data4[5] = strtol(source.substr(offset, cSize).c_str(), nullptr, 16); - offset += cSize; - Data4[6] = strtol(source.substr(offset, cSize).c_str(), nullptr, 16); - offset += cSize; - Data4[7] = strtol(source.substr(offset, cSize).c_str(), nullptr, 16); - offset += cSize; - assert(source.size() == offset); + auto err = ::uuid_parse(source.c_str(), data_); + assert(err == 0); return *this; } - bool Guid::operator<(Guid const& g) const { return ::memcmp(&g.Data1, &Data1, 16) < 0; } + bool Guid::operator<(Guid const& g) const { return ::uuid_compare(data_, g.data_) < 0; } } // namespace edm diff --git a/FWCore/Utilities/src/Guid.h b/FWCore/Utilities/src/Guid.h index d909e9d120cbd..fb38fd6c53b98 100644 --- a/FWCore/Utilities/src/Guid.h +++ b/FWCore/Utilities/src/Guid.h @@ -1,6 +1,7 @@ #ifndef FWCOre_Utilities_Guid_h #define FWCOre_Utilities_Guid_h +#include "uuid/uuid.h" #include /* @@ -19,34 +20,25 @@ namespace edm { * @author Zhen Xie Include DCE implementation for linux * @version 1.1 * @date 03/09/2002 + * + * Simplified by Dan Riley for CMS to use standard libuuid functions */ class Guid { // size is 16 public: - unsigned int Data1; - unsigned short Data2; - unsigned short Data3; - unsigned char Data4[8]; - /// Standard constructor (With initializaton) Guid() { init(); } /// Standard constructor (With initialization) - explicit Guid(bool) { init(); } + explicit Guid(bool usetime) { init(usetime); } /// Constructor for Guid from char* - explicit Guid(char const* s) { fromString(s); } + explicit Guid(char const* s, bool binary = false) { binary ? fromBinary(s) : fromString(s); } /// Constructor for Guid from string - explicit Guid(std::string const& s) { fromString(s); } + explicit Guid(std::string const& s, bool binary = false) { binary ? fromBinary(s) : fromString(s); } /// Copy constructor Guid(Guid const& c) { *this = c; } /// Assignment operator Guid& operator=(Guid const& g) { if (this != &g) { - Data1 = g.Data1; - Data2 = g.Data2; - Data3 = g.Data3; - unsigned int* p = reinterpret_cast(&Data4[0]); - unsigned int const* q = reinterpret_cast(&g.Data4[0]); - *(p + 1) = *(q + 1); - *p = *q; + ::uuid_copy(data_, g.data_); } return *this; } @@ -55,27 +47,24 @@ namespace edm { /// Equality operator bool operator==(Guid const& g) const { if (this != &g) { - if (Data1 != g.Data1) - return false; - if (Data2 != g.Data2) - return false; - if (Data3 != g.Data3) - return false; - unsigned int const* p = reinterpret_cast(&Data4[0]); - unsigned int const* q = reinterpret_cast(&g.Data4[0]); - return *p == *q && *(p + 1) == *(q + 1); + return ::uuid_compare(data_, g.data_) == 0; } return true; } /// Non-equality operator bool operator!=(Guid const& g) const { return !(this->operator==(g)); } - /// Automatic conversion from string reprentation + /// conversion to binary string reprentation + std::string const toBinary() const; + /// conversion from binary string representation + Guid const& fromBinary(std::string const& s); + /// conversion to formatted string reprentation std::string const toString() const; - /// Automatic conversion to string representation + /// conversion from formatted string representation Guid const& fromString(std::string const& s); - /// initialize a new Guid private: - void init(); + /// initialize a new Guid + void init(bool usetime = false); + uuid_t data_; }; } // namespace edm #endif diff --git a/FWCore/Utilities/test/Guid_t.cpp b/FWCore/Utilities/test/Guid_t.cpp index 2eb03cd54dd53..2d73e7b7a7da6 100644 --- a/FWCore/Utilities/test/Guid_t.cpp +++ b/FWCore/Utilities/test/Guid_t.cpp @@ -6,14 +6,31 @@ int main() { edm::Guid guid; - std::string guidString = guid.toString(); - edm::Guid guid2; - guid2.fromString(guidString); + + auto guidString = guid.toString(); + edm::Guid guid2(guidString, false); edm::Guid guid3(guid2); + + auto guidBinary = guid.toBinary(); + edm::Guid guid4(guidBinary, true); + assert(guid == guid2); assert(guid == guid3); - std::string guidString2 = guid2.toString(); - std::string guidString3 = guid3.toString(); + assert(guid == guid4); + + auto guidString2 = guid2.toString(); + auto guidString3 = guid3.toString(); + auto guidString4 = guid4.toString(); + assert(guidString2 == guidString); assert(guidString3 == guidString); + assert(guidString4 == guidString); + + auto guidBinary2 = guid2.toBinary(); + auto guidBinary3 = guid3.toBinary(); + auto guidBinary4 = guid4.toBinary(); + + assert(guidBinary2 == guidBinary); + assert(guidBinary3 == guidBinary); + assert(guidBinary4 == guidBinary); } diff --git a/PhysicsTools/Utilities/plugins/PileUpFilter.cc b/PhysicsTools/Utilities/plugins/PileUpFilter.cc index cea725344a456..b4ffbc4bbbea8 100644 --- a/PhysicsTools/Utilities/plugins/PileUpFilter.cc +++ b/PhysicsTools/Utilities/plugins/PileUpFilter.cc @@ -9,8 +9,6 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -//#include "FWCore/Utilities/interface/StreamID.h" -#include "FWCore/Utilities/interface/GlobalIdentifier.h" #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" From 99c96dfb511d8ccc4b0ed8730dd7fc23f957311c Mon Sep 17 00:00:00 2001 From: Dan Riley Date: Fri, 2 Oct 2020 15:26:12 -0400 Subject: [PATCH 205/778] formatting --- FWCore/Utilities/src/Guid.cc | 4 +--- FWCore/Utilities/src/Guid.h | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/FWCore/Utilities/src/Guid.cc b/FWCore/Utilities/src/Guid.cc index eaa513ad55afe..fc8796402f980 100644 --- a/FWCore/Utilities/src/Guid.cc +++ b/FWCore/Utilities/src/Guid.cc @@ -27,9 +27,7 @@ namespace edm { } } - std::string const Guid::toBinary() const { - return std::string(reinterpret_cast(data_), sizeof(data_)); - } + std::string const Guid::toBinary() const { return std::string(reinterpret_cast(data_), sizeof(data_)); } Guid const& Guid::fromBinary(std::string const& source) { assert(source.size() == sizeof(data_)); diff --git a/FWCore/Utilities/src/Guid.h b/FWCore/Utilities/src/Guid.h index fb38fd6c53b98..0aa50b9b5e05c 100644 --- a/FWCore/Utilities/src/Guid.h +++ b/FWCore/Utilities/src/Guid.h @@ -61,6 +61,7 @@ namespace edm { std::string const toString() const; /// conversion from formatted string representation Guid const& fromString(std::string const& s); + private: /// initialize a new Guid void init(bool usetime = false); From 3509ff90375d2cb7100192eef159b05aa0c435f2 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 2 Oct 2020 21:18:32 -0500 Subject: [PATCH 206/778] Add fit function --- Validation/MuonGEMDigis/src/GEMDigiMatcher.cc | 2 +- .../MuonHits/interface/CSCSimHitMatcher.h | 1 + .../MuonHits/interface/MuonSimHitMatcher.h | 2 + Validation/MuonHits/src/CSCSimHitMatcher.cc | 39 +++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Validation/MuonGEMDigis/src/GEMDigiMatcher.cc b/Validation/MuonGEMDigis/src/GEMDigiMatcher.cc index ca861540a6d58..27d6de5508663 100644 --- a/Validation/MuonGEMDigis/src/GEMDigiMatcher.cc +++ b/Validation/MuonGEMDigis/src/GEMDigiMatcher.cc @@ -13,7 +13,7 @@ GEMDigiMatcher::GEMDigiMatcher(const edm::ParameterSet& pset, edm::ConsumesColle maxBXDigi_ = gemDigi.getParameter("maxBX"); matchDeltaStrip_ = gemDigi.getParameter("matchDeltaStrip"); verboseDigi_ = gemDigi.getParameter("verbose"); - matchToSimLink_ = gemDigi.getParameter("matchToSimLink"); + matchToSimLink_ = gemDigi.getParameter("matchToSimLink"); const auto& gemPad = pset.getParameterSet("gemPadDigi"); minBXPad_ = gemPad.getParameter("minBX"); diff --git a/Validation/MuonHits/interface/CSCSimHitMatcher.h b/Validation/MuonHits/interface/CSCSimHitMatcher.h index 99bdcc5b54046..e2d0ffd67f7ad 100644 --- a/Validation/MuonHits/interface/CSCSimHitMatcher.h +++ b/Validation/MuonHits/interface/CSCSimHitMatcher.h @@ -55,6 +55,7 @@ class CSCSimHitMatcher : public MuonSimHitMatcher { // local bending in a CSC chamber float LocalBendingInChamber(unsigned int detid) const; + void fitHitsInChamber(unsigned int detid, float& mean, float& slope) const; // calculate average strip number for a provided collection of simhits float simHitsMeanStrip(const edm::PSimHitContainer& sim_hits) const; diff --git a/Validation/MuonHits/interface/MuonSimHitMatcher.h b/Validation/MuonHits/interface/MuonSimHitMatcher.h index 5a7c254de8b22..7b9a4c3ac21a1 100644 --- a/Validation/MuonHits/interface/MuonSimHitMatcher.h +++ b/Validation/MuonHits/interface/MuonSimHitMatcher.h @@ -66,6 +66,8 @@ class MuonSimHitMatcher { // calculate the average position at the second station GlobalPoint simHitsMeanPositionStation(int n) const; + const TrackingGeometry* geometry() { return geometry_; } + protected: std::vector getIdsOfSimTrackShower(unsigned trk_id, const edm::SimTrackContainer& simTracks, diff --git a/Validation/MuonHits/src/CSCSimHitMatcher.cc b/Validation/MuonHits/src/CSCSimHitMatcher.cc index 86051eb9d143f..4734f8e2637d7 100644 --- a/Validation/MuonHits/src/CSCSimHitMatcher.cc +++ b/Validation/MuonHits/src/CSCSimHitMatcher.cc @@ -1,4 +1,6 @@ #include "Validation/MuonHits/interface/CSCSimHitMatcher.h" +#include "TGraphErrors.h" +#include "TF1.h" using namespace std; @@ -204,6 +206,43 @@ float CSCSimHitMatcher::LocalBendingInChamber(unsigned int detid) const { return deltaPhi(phi_layer6, phi_layer1); } +// difference in strip per layer +void CSCSimHitMatcher::fitHitsInChamber(unsigned int detid, float& intercept, float& slope) const { + const CSCDetId cscid(detid); + + const auto& sim_hits = hitsInChamber(detid); + + if (sim_hits.empty()) + return; + + vector x; + vector y; + vector xe; + vector ye; + + const float HALF_STRIP_ERROR = 0.288675; + + for (const auto& h : sim_hits) { + const LocalPoint& lp = h.entryPoint(); + const auto& d = h.detUnitId(); + float s = dynamic_cast(geometry_)->layer(d)->geometry()->strip(lp); + // shift to key half strip layer (layer 3) + x.push_back(CSCDetId(d).layer() - 3); + y.push_back(s); + xe.push_back(float(0)); + ye.push_back(2 * HALF_STRIP_ERROR); + } + if (x.size() < 2) + return; + + std::unique_ptr gr(new TGraphErrors(x.size(), &x[0], &y[0], &xe[0], &ye[0])); + std::unique_ptr fit(new TF1("fit", "pol1", -3, 4)); + gr->Fit("fit", "EMQ"); + + intercept = fit->GetParameter(0); + slope = fit->GetParameter(1); +} + float CSCSimHitMatcher::simHitsMeanStrip(const edm::PSimHitContainer& sim_hits) const { if (sim_hits.empty()) return -1.f; From 92300ead407495e1b16a9695ff41ce0b059896f8 Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 2 Oct 2020 21:23:48 -0500 Subject: [PATCH 207/778] Add slope function --- DataFormats/CSCDigi/interface/CSCCLCTDigi.h | 7 ++++++- DataFormats/CSCDigi/src/CSCCLCTDigi.cc | 19 +++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/DataFormats/CSCDigi/interface/CSCCLCTDigi.h b/DataFormats/CSCDigi/interface/CSCCLCTDigi.h index 46c643ef16003..57f80333bce22 100644 --- a/DataFormats/CSCDigi/interface/CSCCLCTDigi.h +++ b/DataFormats/CSCDigi/interface/CSCCLCTDigi.h @@ -74,13 +74,18 @@ class CSCCLCTDigi { /// set the slope void setSlope(const uint16_t slope); + /// slope in number of half-strips/layer + float getFractionalSlope(const uint16_t slope = 5) const; + /// return striptype uint16_t getStripType() const { return striptype_; } /// set stripType void setStripType(const uint16_t stripType) { striptype_ = stripType; } - /// return bend (left or right) + /// return bending + /// 0: left-bending (negative delta-strip) + /// 1: right-bending (positive delta-strip) uint16_t getBend() const { return bend_; } /// set bend diff --git a/DataFormats/CSCDigi/src/CSCCLCTDigi.cc b/DataFormats/CSCDigi/src/CSCCLCTDigi.cc index 9ffcd09f95477..a63007f938ed7 100644 --- a/DataFormats/CSCDigi/src/CSCCLCTDigi.cc +++ b/DataFormats/CSCDigi/src/CSCCLCTDigi.cc @@ -115,6 +115,21 @@ void CSCCLCTDigi::setSlope(const uint16_t slope) { setDataWord(slope, pattern_, kRun3SlopeShift, kRun3SlopeMask); } +// slope in number of half-strips/layer +float CSCCLCTDigi::getFractionalSlope(const uint16_t nBits) const { + if (isRun3()) { + const float minSlope = 0; + const float maxSlope = 2.5; + const int range = pow(2, nBits); + const float deltaSlope = (maxSlope - minSlope) / range; + const float slopeValue = minSlope + deltaSlope * getSlope(); + return (2 * getBend() - 1) * slopeValue; + } else { + int slope[11] = {0, 0, -8, 8, -6, 6, -4, 4, -2, 2, 0}; + return float(slope[getPattern()] / 5.); + } +} + uint16_t CSCCLCTDigi::getKeyStrip(const uint16_t n) const { // 10-bit case for strip data word if (compCode_ != -1 and n == 8) { @@ -132,9 +147,9 @@ uint16_t CSCCLCTDigi::getKeyStrip(const uint16_t n) const { /// return the fractional strip (middle of the strip) float CSCCLCTDigi::getFractionalStrip(const uint16_t n) const { - if (n == 8) { + if (compCode_ != -1 and n == 8) { return 0.125f * (getKeyStrip(n) + 0.5); - } else if (n == 4) { + } else if (compCode_ != -1 and n == 4) { return 0.25f * (getKeyStrip(n) + 0.5); } else { return 0.5f * (getKeyStrip(n) + 0.5); From 3230fbc30ca2978825f057a10c55d05c29af112d Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 2 Oct 2020 21:30:38 -0500 Subject: [PATCH 208/778] Fix position bias in CCLUT --- .../interface/CSCCathodeLCTProcessor.h | 2 +- .../src/CSCCathodeLCTProcessor.cc | 55 ++++++++++--------- .../test/macros/CCLUTLinearFitWriter.cpp | 45 ++++++++++++--- 3 files changed, 67 insertions(+), 35 deletions(-) diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h index af81ddfff36f2..7fd3317965ddd 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCCathodeLCTProcessor.h @@ -158,7 +158,7 @@ class CSCCathodeLCTProcessor : public CSCBaseboard { int calculateComparatorCode(const std::array, 6>& halfStripPattern) const; // sets the 1/4 and 1/8 strip bits given a floating point position offset - void assignPositionCC(const unsigned offset, uint16_t& halfstrip, bool& quartstrip, bool& eightstrip) const; + void assignPositionCC(const unsigned offset, std::tuple& returnValue) const; // runs the CCLUT procedure void runCCLUT(CSCCLCTDigi& digi) const; diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc index 93fc48b53ce49..dd43c22dc9a65 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc @@ -3,7 +3,6 @@ #include #include #include -#include // Default values of configuration parameters. const unsigned int CSCCathodeLCTProcessor::def_fifo_tbins = 12; @@ -1310,9 +1309,7 @@ int CSCCathodeLCTProcessor::calculateComparatorCode(const std::array& returnValue) const { /* | Value | Half-Strip Offset | Delta Half-Strip | Quarter-Strip Bit | Eighth-Strip Bit | |-------|--------------------|-------------------|--------------------|------------------| @@ -1333,17 +1330,25 @@ void CSCCathodeLCTProcessor::assignPositionCC(const unsigned offset, | 14 | 7/4 | 1 | 1 | 1 | | 15 | 2 | 2 | 0 | 0 | */ - if (offset <= 2) - halfstrip -= 2; - else if (offset > 2 and offset <= 6) - halfstrip--; - else if (offset > 10 and offset <= 14) - halfstrip += 1; - else if (offset == 15) - halfstrip += 2; - - quartstrip = std::bitset<4>(offset + 1)[1]; - eightstrip = !std::bitset<4>(offset)[0]; + std::vector> my_tuple = { + {-2, false, true}, + {-2, true, false}, + {-2, true, true}, + {-1, false, false}, + {-1, false, true}, + {-1, true, false}, + {-1, true, true}, + {0, false, false}, + {0, false, true}, + {0, true, false}, + {0, true, true}, + {1, false, false}, + {1, false, true}, + {1, true, false}, + {1, true, true}, + {2, false, false}, + }; + returnValue = my_tuple[offset]; } void CSCCathodeLCTProcessor::runCCLUT(CSCCLCTDigi& digi) const { @@ -1403,24 +1408,23 @@ void CSCCathodeLCTProcessor::runCCLUT(CSCCLCTDigi& digi) const { unsigned run2PatternCC(lutpatconv_[pattern]->lookup(comparatorCode)); // if the slope is negative, set bending to 0 - if (slopeCC < 16) - digi.setBend(0); - else - digi.setBend(1); + const bool slopeCCSign((slopeCC >> 4) & 0x1); + const unsigned slopeCCValue(slopeCC & 0xf); + digi.setBend(slopeCCSign); // calculate the new position uint16_t halfstrip = digi.getKeyStrip(); - bool quartstrip = false; - bool eightstrip = false; - assignPositionCC(positionCC, halfstrip, quartstrip, eightstrip); + std::tuple halfstripoffset; + assignPositionCC(positionCC, halfstripoffset); + halfstrip += std::get<0>(halfstripoffset); // store the new 1/2, 1/4 and 1/8 strip positions digi.setStrip(halfstrip - digi.getCFEB() * 32); - digi.setQuartStrip(quartstrip); - digi.setEightStrip(eightstrip); + digi.setQuartStrip(std::get<1>(halfstripoffset)); + digi.setEightStrip(std::get<2>(halfstripoffset)); // store the bending angle value in the pattern data member - digi.setSlope(slopeCC); + digi.setSlope(slopeCCValue); // set the quasi Run-2 pattern - to accommodate integration with EMTF/OMTF if (run2PatternCC == 0) { @@ -1444,7 +1448,6 @@ void CSCCathodeLCTProcessor::runCCLUT(CSCCLCTDigi& digi) const { } unsigned CSCCathodeLCTProcessor::convertSlopeToRun2Pattern(const unsigned slope) const { - // interesting: the "right-bending" patterns have a negative slope const unsigned slopeList[32] = {2, 2, 2, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 9, 9, 9, 9, 7, 7, 7, 7, 5, 5, 5, 3, 3, 3}; return slopeList[slope]; diff --git a/L1Trigger/CSCTriggerPrimitives/test/macros/CCLUTLinearFitWriter.cpp b/L1Trigger/CSCTriggerPrimitives/test/macros/CCLUTLinearFitWriter.cpp index 5bda4446a8d7b..85b5ec88ba7e5 100644 --- a/L1Trigger/CSCTriggerPrimitives/test/macros/CCLUTLinearFitWriter.cpp +++ b/L1Trigger/CSCTriggerPrimitives/test/macros/CCLUTLinearFitWriter.cpp @@ -130,7 +130,8 @@ void writeHeaderPosOffsetLUT(ofstream& file); void writeHeaderSlopeLUT(ofstream& file); unsigned firmwareWord(const unsigned quality, const unsigned slope, const unsigned offset); void setDataWord(unsigned& word, const unsigned newWord, const unsigned shift, const unsigned mask); -unsigned assign(const float fvalue, const float fmin, const float fmax, const unsigned nbits); +unsigned assignPosition(const float fvalue, const float fmin, const float fmax, const unsigned nbits); +unsigned assignBending(const float fvalue, const float fmin, const float fmax, const unsigned nbits); int CCLUTLinearFitWriter(unsigned N_LAYER_REQUIREMENT = 3) { //all the patterns we will fit @@ -340,10 +341,16 @@ int CCLUTLinearFitWriter(unsigned N_LAYER_REQUIREMENT = 3) { const float fmaxOffset = 2; const float fminOffset = -1.75; const float fmaxSlope = 2.5; - const float fminSlope = -2.5; + const float fminSlope = 0; - const unsigned offset_bin = assign(offset, fminOffset, fmaxOffset, 4); - const unsigned slope_bin = assign(slope, fminSlope, fmaxSlope, 5); + // negative bending -> 0 + // positive bending -> 1 + const bool slope_sign(slope >= 0); + + const unsigned offset_bin = assignPosition(offset, fminOffset, fmaxOffset, 4); + unsigned slope_bin = assignBending(std::abs(slope), fminSlope, fmaxSlope, 4); + if (slope_sign) + slope_bin += 16; const unsigned fwword = firmwareWord(0, slope_bin, offset_bin); // write to output files @@ -496,7 +503,28 @@ void writeHeaderSlopeLUT(ofstream& file) { << "#
v1.0 12 32
\n"; } -unsigned assign(const float fvalue, const float fmin, const float fmax, const unsigned nbits) { +unsigned assignPosition(const float fvalue, const float fmin, const float fmax, const unsigned nbits) { + bool debug; + unsigned value = 0; + const unsigned range = pow(2, nbits); + const unsigned minValue = 0; + const unsigned maxValue = range - 1; + const double fdelta = (fmax - fmin) / range; + + if (fvalue >= fmax) { + value = maxValue; + } else if (fvalue <= fmin) { + value = minValue; + } else { + value = std::min(unsigned(std::ceil((fvalue - fmin) / fdelta)), maxValue); + } + if (debug) + std::cout << "fvalue " << fvalue << " " << fmin << " " << fmax << " " << nbits << " " << value << std::endl; + + return value; +} + +unsigned assignBending(const float fvalue, const float fmin, const float fmax, const unsigned nbits) { bool debug; unsigned value = 0; const unsigned range = pow(2, nbits); @@ -509,7 +537,7 @@ unsigned assign(const float fvalue, const float fmin, const float fmax, const un } else if (fvalue <= fmin) { value = minValue; } else { - value = int(std::floor((fvalue - fmin) / fdelta)); + value = std::min(unsigned(std::floor((fvalue - fmin) / fdelta)), maxValue); } if (debug) std::cout << "fvalue " << fvalue << " " << fmin << " " << fmax << " " << nbits << " " << value << std::endl; @@ -520,11 +548,12 @@ unsigned assign(const float fvalue, const float fmin, const float fmax, const un unsigned firmwareWord(const unsigned quality, const unsigned slope, const unsigned offset) { /* construct fw dataword: [8:0] is quality (set all to 0 for now) - [13, 9] is slope + [12:9] is slope value + [13] is slope sign [17:14] is offset */ enum Masks { OffsetMask = 0xf, SlopeMask = 0x1f, QualityMask = 0x1ff }; - enum Shifts { OffsetShift = 13, SlopeShift = 9, QualityShift = 0 }; + enum Shifts { OffsetShift = 14, SlopeShift = 9, QualityShift = 0 }; unsigned fwword = 0; setDataWord(fwword, quality, QualityShift, QualityMask); From 130af96b32903eaedc09babb1f0e1b846ead2e6b Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Fri, 2 Oct 2020 21:39:28 -0500 Subject: [PATCH 209/778] Slope is 4 bits excluding sign --- DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h b/DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h index a4a93aea99aaf..8f30c9d47bb4f 100644 --- a/DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h +++ b/DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h @@ -21,7 +21,7 @@ class CSCCorrelatedLCTDigi { enum LCTKeyStripMasks { kEightStripMask = 0x1, kQuartStripMask = 0x1, kHalfStripMask = 0xff }; enum LCTKeyStripShifts { kEightStripShift = 9, kQuartStripShift = 8, kHalfStripShift = 0 }; // temporary to facilitate CCLUT-EMTF/OMTF integration studies - enum LCTPatternMasks { kRun3SlopeMask = 0x1f, kRun3PatternMask = 0x7, kLegacyPatternMask = 0xf }; + enum LCTPatternMasks { kRun3SlopeMask = 0xf, kRun3PatternMask = 0x7, kLegacyPatternMask = 0xf }; enum LCTPatternShifts { kRun3SlopeShift = 7, kRun3PatternShift = 4, kLegacyPatternShift = 0 }; enum class Version { Legacy = 0, Run3 }; From 95f3e8cda04a41d142441c1fcc6018504f8ae25e Mon Sep 17 00:00:00 2001 From: Sven Dildick Date: Sat, 3 Oct 2020 00:10:33 -0500 Subject: [PATCH 210/778] Slope is stored as a separate member --- L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc index d50ee8c2190b1..1654127d9740f 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc @@ -489,9 +489,6 @@ CSCCorrelatedLCTDigi CSCMotherboard::constructLCTs(const CSCALCTDigi& aLCT, int trknmb) const { // CLCT pattern number unsigned int pattern = encodePattern(cLCT.getPattern()); - if (use_run3_patterns_ and use_comparator_codes_) { - pattern = cLCT.getSlope(); - } // LCT quality number unsigned int quality; From 9c4fad1812af4f979107efedea7791481d2ccaff Mon Sep 17 00:00:00 2001 From: Nicola Amapane Date: Sat, 3 Oct 2020 08:57:54 +0200 Subject: [PATCH 211/778] Revert "cleanup obsolete, unused standard sequences". These are, unfortunately, still in use. Will target them in a future PR. --- .../python/MagneticField_38T_PostLS1_cff.py | 13 +++++++++++++ .../python/MagneticField_AutoFromDBCurrent_cff.py | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py create mode 100644 Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py diff --git a/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py b/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py new file mode 100644 index 0000000000000..739c9b113917b --- /dev/null +++ b/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py @@ -0,0 +1,13 @@ +### THIS CFF IS DEPRECATED!!!! ### +# please use MagneticField_cff.py instead + +from __future__ import print_function +print(" ##################################################################### ") +print(" # WARNING: the module # ") +print(" # Configuration.StandardSequences.MagneticField_38T_PostLS1_cff # ") +print(" # is deprecated. Please import # ") +print(" # Configuration.StandardSequences.MagneticField_cff # ") +print(" ##################################################################### ") + +from Configuration.StandardSequences.MagneticField_38T_cff import * + diff --git a/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py b/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py new file mode 100644 index 0000000000000..97ca9a181ced2 --- /dev/null +++ b/Configuration/StandardSequences/python/MagneticField_AutoFromDBCurrent_cff.py @@ -0,0 +1,6 @@ +# This cff is obsolete and will eventually be deprecated. +# Please replace it with +# Configuration.StandardSequences.MagneticField_cff.py +# in your setup. + +from Configuration.StandardSequences.MagneticField_cff import * From e67d14cd06504aacc3f89f5e6a3f3ea50235d9fa Mon Sep 17 00:00:00 2001 From: ddesouza Date: Sat, 3 Oct 2020 16:44:17 +0200 Subject: [PATCH 212/778] Change the ifs --- .../plugins/HiHFFilterProducer.cc | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc index 714fb3dfbc618..777e0b457ca75 100644 --- a/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc +++ b/RecoHI/HiCentralityAlgos/plugins/HiHFFilterProducer.cc @@ -63,23 +63,15 @@ void HiHFFilterProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet if (et < 0.0) continue; if (eta_plus) { - if (energy >= 2.0) - nTowersTh2HFplus += 1; - if (energy >= 3.0) - nTowersTh3HFplus += 1; - if (energy >= 4.0) - nTowersTh4HFplus += 1; - if (energy >= 5.0) - nTowersTh5HFplus += 1; + nTowersTh2HFplus += energy >= 2.0 ? 1 : 0; + nTowersTh3HFplus += energy >= 3.0 ? 1 : 0; + nTowersTh4HFplus += energy >= 4.0 ? 1 : 0; + nTowersTh5HFplus += energy >= 5.0 ? 1 : 0; } else if (eta_minus) { - if (energy >= 2.0) - nTowersTh2HFminus += 1; - if (energy >= 3.0) - nTowersTh3HFminus += 1; - if (energy >= 4.0) - nTowersTh4HFminus += 1; - if (energy >= 5.0) - nTowersTh5HFminus += 1; + nTowersTh2HFminus += energy >= 2.0 ? 1 : 0; + nTowersTh3HFminus += energy >= 3.0 ? 1 : 0; + nTowersTh4HFminus += energy >= 4.0 ? 1 : 0; + nTowersTh5HFminus += energy >= 5.0 ? 1 : 0; } } From c213926c17647c7f512972484d9ddb50f7eeabf2 Mon Sep 17 00:00:00 2001 From: Dan Riley Date: Sun, 4 Oct 2020 11:05:15 -0400 Subject: [PATCH 213/778] inequality tests --- FWCore/Utilities/test/Guid_t.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/FWCore/Utilities/test/Guid_t.cpp b/FWCore/Utilities/test/Guid_t.cpp index 2d73e7b7a7da6..c1498e7cc4d89 100644 --- a/FWCore/Utilities/test/Guid_t.cpp +++ b/FWCore/Utilities/test/Guid_t.cpp @@ -33,4 +33,11 @@ int main() { assert(guidBinary2 == guidBinary); assert(guidBinary3 == guidBinary); assert(guidBinary4 == guidBinary); + + edm::Guid otherGuid; + assert(otherGuid != guid); + + edm::Guid otherBinaryGuid{ otherGuid.toBinary(), true }; + assert(otherBinaryGuid == otherGuid); + assert(otherBinaryGuid != guid4); } From 0ae6f53352f64c8393e46f1687c37cc95c49bc15 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 4 Oct 2020 17:07:31 +0200 Subject: [PATCH 214/778] Run 2 csvV2 calibrations for 2018 PbPb data --- .../producersHeavyIons/heavyIonJets_cff.py | 1 + .../PatAlgos/python/slimming/miniAOD_tools.py | 1 - RecoBTag/Combined/BuildFile.xml | 1 + .../interface/hiRun2LegacyCSVv2Tagger.h | 56 ++++++ .../plugins/hiRun2LegacyCSVv2ESProducer.cc | 8 + .../python/hiRun2LegacyCSVv2Computer_cfi.py | 27 +++ .../python/hiRun2LegacyCSVv2JetTags_cfi.py | 12 ++ .../python/hiRun2LegacyCSVv2_helpers.py | 32 +++ .../hiRun2LegacyCSVv2_trainingSettings.py | 183 ++++++++++++++++++ .../python/hiRun2LegacyCSVv2_trainingvars.py | 143 ++++++++++++++ .../Combined/src/hiRun2LegacyCSVv2Tagger.cc | 175 +++++++++++++++++ .../combinedSecondaryVertexV2BJetTags_cfi.py | 2 + 12 files changed, 640 insertions(+), 1 deletion(-) create mode 100644 RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h create mode 100644 RecoBTag/Combined/plugins/hiRun2LegacyCSVv2ESProducer.cc create mode 100644 RecoBTag/Combined/python/hiRun2LegacyCSVv2Computer_cfi.py create mode 100644 RecoBTag/Combined/python/hiRun2LegacyCSVv2JetTags_cfi.py create mode 100644 RecoBTag/Combined/python/hiRun2LegacyCSVv2_helpers.py create mode 100644 RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingSettings.py create mode 100644 RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingvars.py create mode 100644 RecoBTag/Combined/src/hiRun2LegacyCSVv2Tagger.cc diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index 05680c7e97ef5..67f426266176c 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -32,6 +32,7 @@ from RecoBTag.SecondaryVertex.simpleSecondaryVertex2TrkComputer_cfi import * from RecoBTag.SecondaryVertex.simpleSecondaryVertex3TrkComputer_cfi import * from RecoBTag.SecondaryVertex.combinedSecondaryVertexV2Computer_cfi import * +from RecoBTag.Combined.hiRun2LegacyCSVv2Computer_cfi import * from RecoBTag.ImpactParameter.jetBProbabilityComputer_cfi import * from RecoBTag.ImpactParameter.jetProbabilityComputer_cfi import * from RecoBTag.ImpactParameter.trackCounting3D2ndComputer_cfi import * diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index b6981349253b1..33afe7996060b 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -474,7 +474,6 @@ def _add_jetsPuppi(process): _run2_miniAOD_ANY.toModify(process.patJets, addTagInfos = False ) - _hiGeneral.toModify(process.patJets, addTagInfos = True ) _hiGeneral.toModify(process.patJets, tagInfoSources = cms.VInputTag(["impactParameterTagInfos","secondaryVertexTagInfos"]) ) ## puppi met diff --git a/RecoBTag/Combined/BuildFile.xml b/RecoBTag/Combined/BuildFile.xml index 41dca0fa9e5cf..5ce318d8b0e6e 100644 --- a/RecoBTag/Combined/BuildFile.xml +++ b/RecoBTag/Combined/BuildFile.xml @@ -7,6 +7,7 @@ + diff --git a/RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h b/RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h new file mode 100644 index 0000000000000..7e8c7b7966580 --- /dev/null +++ b/RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h @@ -0,0 +1,56 @@ +#ifndef RecoBTag_Combined_hiRun2LegacyCSVv2Tagger_h +#define RecoBTag_Combined_hiRun2LegacyCSVv2Tagger_h + +#include "FWCore/Framework/interface/ESConsumesCollector.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "CommonTools/MVAUtils/interface/TMVAEvaluator.h" +#include "RecoBTau/JetTagComputer/interface/JetTagComputer.h" +#include "RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h" +#include "DataFormats/BTauReco/interface/TaggingVariable.h" +#include "RecoBTau/JetTagComputer/interface/JetTagComputerRecord.h" + +#include +#include + +/** \class hiRun2LegacyCSVv2Tagger + * \author M. Nguyen + * copied from CharmTagger.h (by M. Verzetti) + */ + +class hiRun2LegacyCSVv2Tagger : public JetTagComputer { +public: + struct Tokens { + Tokens(const edm::ParameterSet& configuration, edm::ESConsumesCollector&& cc); + edm::ESGetToken gbrForest_; + }; + + /// explicit ctor + hiRun2LegacyCSVv2Tagger(const edm::ParameterSet&, Tokens); + ~hiRun2LegacyCSVv2Tagger() override; //{} + float discriminator(const TagInfoHelper& tagInfo) const override; + void initialize(const JetTagComputerRecord& record) override; + + typedef std::vector vpset; + + struct MVAVar { + std::string name; + reco::btau::TaggingVariableName id; + size_t index; + bool has_index; + float default_value; + }; + +private: + std::unique_ptr mvaID_; + CombinedSVSoftLeptonComputer sl_computer_; + CombinedSVComputer sv_computer_; + std::vector variables_; + + std::string mva_name_; + edm::FileInPath weight_file_; + bool use_GBRForest_; + bool use_adaBoost_; + Tokens tokens_; +}; + +#endif diff --git a/RecoBTag/Combined/plugins/hiRun2LegacyCSVv2ESProducer.cc b/RecoBTag/Combined/plugins/hiRun2LegacyCSVv2ESProducer.cc new file mode 100644 index 0000000000000..7492f61e0953f --- /dev/null +++ b/RecoBTag/Combined/plugins/hiRun2LegacyCSVv2ESProducer.cc @@ -0,0 +1,8 @@ +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "RecoBTau/JetTagComputer/interface/JetTagComputerESProducer.h" +#include "RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h" + +typedef JetTagComputerESProducer hiRun2LegacyCSVv2ESProducer; +DEFINE_FWK_EVENTSETUP_MODULE(hiRun2LegacyCSVv2ESProducer); diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2Computer_cfi.py b/RecoBTag/Combined/python/hiRun2LegacyCSVv2Computer_cfi.py new file mode 100644 index 0000000000000..aa053e319ea02 --- /dev/null +++ b/RecoBTag/Combined/python/hiRun2LegacyCSVv2Computer_cfi.py @@ -0,0 +1,27 @@ +import FWCore.ParameterSet.Config as cms +import RecoBTag.SecondaryVertex.candidateCombinedSecondaryVertexV2Computer_cfi as sl_cfg +from RecoBTag.Combined.hiRun2LegacyCSVv2_trainingSettings import hiRun2LegacyCSVv2_vpset +from RecoBTag.Combined.hiRun2LegacyCSVv2_helpers import get_vars + + +hiRun2LegacyCSVv2Computer = cms.ESProducer( + 'hiRun2LegacyCSVv2ESProducer', + slComputerCfg = cms.PSet( + **sl_cfg.candidateCombinedSecondaryVertexV2Computer.parameters_() + ), + weightFile = cms.FileInPath('RecoBTag/Combined/data/TMVA_Btag_CsJets_PbPb2018_BDTG.weights.xml'), + + variables = hiRun2LegacyCSVv2_vpset, + computer = cms.ESInputTag('dummy:dummy'), + tagInfos = cms.VInputTag( + cms.InputTag('impactParameterTagInfos'), + cms.InputTag('secondaryVertexFinderTagInfos'), + ), + mvaName = cms.string('BDT'), + useCondDB = cms.bool(False), + gbrForestLabel = cms.string(''), + useGBRForest = cms.bool(True), + useAdaBoost = cms.bool(False) + ) + + diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2JetTags_cfi.py b/RecoBTag/Combined/python/hiRun2LegacyCSVv2JetTags_cfi.py new file mode 100644 index 0000000000000..fc4862fe08647 --- /dev/null +++ b/RecoBTag/Combined/python/hiRun2LegacyCSVv2JetTags_cfi.py @@ -0,0 +1,12 @@ +import FWCore.ParameterSet.Config as cms + +hiRun2LegacyCSVv2JetTags = cms.EDProducer( + "JetTagProducer", + jetTagComputer = cms.string('hiRun2LegacyCSVv2Tags'), + tagInfos = cms.VInputTag( + cms.InputTag('impactParameterTagInfos'), + cms.InputTag('secondaryVertexFinderTagInfos'), + ) +) + + diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_helpers.py b/RecoBTag/Combined/python/hiRun2LegacyCSVv2_helpers.py new file mode 100644 index 0000000000000..2dea109fcc29a --- /dev/null +++ b/RecoBTag/Combined/python/hiRun2LegacyCSVv2_helpers.py @@ -0,0 +1,32 @@ +import os +from RecoBTag.Combined.hiRun2LegacyCSVv2_trainingvars import get_var_pset +import xml.etree.ElementTree as ET +from pdb import set_trace + +def get_path(file_in_path): + 'mimics edm.FileInPath behavior' + search_env = os.environ.get('CMSSW_SEARCH_PATH', '') + if not search_env: + raise RuntimeError('The environmental variable CMSSW_SEARCH_PATH must be set') + search_paths = search_env.split(':') + for spath in search_paths: + full_path = os.path.join(spath, file_in_path) + if os.path.isfile(full_path): + return full_path + raise RuntimeError('No suitable path found for %s' % file_in_path) + +def get_vars(xml_path, useFileInPath=True): + full_path = get_path(xml_path) if useFileInPath else xml_path + xml_tree = ET.parse(full_path) + root = xml_tree.getroot() + variables = None + for i in root: + if i.tag == 'Variables': + variables = i + + if i is None: + raise RuntimeError('Could not find Variables inside the xml weights') + + var_names = [i.attrib['Title'] for i in variables] + return [get_var_pset(i) for i in var_names] + diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingSettings.py b/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingSettings.py new file mode 100644 index 0000000000000..0cd9539d99817 --- /dev/null +++ b/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingSettings.py @@ -0,0 +1,183 @@ +import FWCore.ParameterSet.Config as cms +hiRun2LegacyCSVv2_vpset = cms.VPSet([ +cms.PSet( + default = cms.double(-100), + idx = cms.int32(0), + name = cms.string('TagVarCSV_trackSip3dSig_0'), + taggingVarName = cms.string('trackSip3dSig') +), cms.PSet( + default = cms.double(-100), + idx = cms.int32(1), + name = cms.string('TagVarCSV_trackSip3dSig_1'), + taggingVarName = cms.string('trackSip3dSig') +), cms.PSet( + default = cms.double(-100), + idx = cms.int32(2), + name = cms.string('TagVarCSV_trackSip3dSig_2'), + taggingVarName = cms.string('trackSip3dSig') +), cms.PSet( + default = cms.double(-100), + idx = cms.int32(3), + name = cms.string('TagVarCSV_trackSip3dSig_3'), + taggingVarName = cms.string('trackSip3dSig') +), cms.PSet( + default = cms.double(-999), + name = cms.string('TagVarCSV_trackSip3dSigAboveCharm'), + taggingVarName = cms.string('trackSip3dSigAboveCharm') +), cms.PSet( + default = cms.double(-1), + idx = cms.int32(0), + name = cms.string('TagVarCSV_trackPtRel_0'), + taggingVarName = cms.string('trackPtRel') +), cms.PSet( + default = cms.double(-1), + idx = cms.int32(1), + name = cms.string('TagVarCSV_trackPtRel_1'), + taggingVarName = cms.string('trackPtRel') +), cms.PSet( + default = cms.double(-1), + idx = cms.int32(2), + name = cms.string('TagVarCSV_trackPtRel_2'), + taggingVarName = cms.string('trackPtRel') +), cms.PSet( + default = cms.double(-1), + idx = cms.int32(3), + name = cms.string('TagVarCSV_trackPtRel_3'), + taggingVarName = cms.string('trackPtRel') +), cms.PSet( + default = cms.double(-1), + idx = cms.int32(0), + name = cms.string('TagVarCSV_trackEtaRel_0'), + taggingVarName = cms.string('trackEtaRel') +), cms.PSet( + default = cms.double(-1), + idx = cms.int32(1), + name = cms.string('TagVarCSV_trackEtaRel_1'), + taggingVarName = cms.string('trackEtaRel') +), cms.PSet( + default = cms.double(-1), + idx = cms.int32(2), + name = cms.string('TagVarCSV_trackEtaRel_2'), + taggingVarName = cms.string('trackEtaRel') +), cms.PSet( + default = cms.double(-1), + idx = cms.int32(3), + name = cms.string('TagVarCSV_trackEtaRel_3'), + taggingVarName = cms.string('trackEtaRel') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(0), + name = cms.string('TagVarCSV_trackDeltaR_0'), + taggingVarName = cms.string('trackDeltaR') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(1), + name = cms.string('TagVarCSV_trackDeltaR_1'), + taggingVarName = cms.string('trackDeltaR') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(2), + name = cms.string('TagVarCSV_trackDeltaR_2'), + taggingVarName = cms.string('trackDeltaR') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(3), + name = cms.string('TagVarCSV_trackDeltaR_3'), + taggingVarName = cms.string('trackDeltaR') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(0), + name = cms.string('TagVarCSV_trackPtRatio_0'), + taggingVarName = cms.string('trackPtRatio') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(1), + name = cms.string('TagVarCSV_trackPtRatio_1'), + taggingVarName = cms.string('trackPtRatio') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(2), + name = cms.string('TagVarCSV_trackPtRatio_2'), + taggingVarName = cms.string('trackPtRatio') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(3), + name = cms.string('TagVarCSV_trackPtRatio_3'), + taggingVarName = cms.string('trackPtRatio') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(0), + name = cms.string('TagVarCSV_trackJetDist_0'), + taggingVarName = cms.string('trackJetDist') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(1), + name = cms.string('TagVarCSV_trackJetDist_1'), + taggingVarName = cms.string('trackJetDist') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(2), + name = cms.string('TagVarCSV_trackJetDist_2'), + taggingVarName = cms.string('trackJetDist') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(3), + name = cms.string('TagVarCSV_trackJetDist_3'), + taggingVarName = cms.string('trackJetDist') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(0), + name = cms.string('TagVarCSV_trackDecayLenVal_0'), + taggingVarName = cms.string('trackDecayLenVal') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(1), + name = cms.string('TagVarCSV_trackDecayLenVal_1'), + taggingVarName = cms.string('trackDecayLenVal') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(2), + name = cms.string('TagVarCSV_trackDecayLenVal_2'), + taggingVarName = cms.string('trackDecayLenVal') +), cms.PSet( + default = cms.double(-0.1), + idx = cms.int32(3), + name = cms.string('TagVarCSV_trackDecayLenVal_3'), + taggingVarName = cms.string('trackDecayLenVal') +), cms.PSet( + default = cms.double(-0.1), + name = cms.string('TagVarCSV_trackSumJetEtRatio'), + taggingVarName = cms.string('trackSumJetEtRatio') +), cms.PSet( + default = cms.double(-0.1), + name = cms.string('TagVarCSV_trackSumJetDeltaR'), + taggingVarName = cms.string('trackSumJetDeltaR') +), cms.PSet( + default = cms.double(-0.1), + name = cms.string('TagVarCSV_vertexMass'), + taggingVarName = cms.string('vertexMass') +), cms.PSet( + default = cms.double(0), + name = cms.string('TagVarCSV_vertexNTracks'), + taggingVarName = cms.string('vertexNTracks') +), cms.PSet( + default = cms.double(-10), + name = cms.string('TagVarCSV_vertexEnergyRatio'), + taggingVarName = cms.string('vertexEnergyRatio') +), cms.PSet( + default = cms.double(-0.1), + name = cms.string('TagVarCSV_vertexJetDeltaR'), + taggingVarName = cms.string('vertexJetDeltaR') +), cms.PSet( + default = cms.double(-1), + name = cms.string('TagVarCSV_flightDistance2dSig'), + taggingVarName = cms.string('flightDistance2dSig') +), cms.PSet( + default = cms.double(0), + name = cms.string('TagVarCSV_jetNSecondaryVertices'), + taggingVarName = cms.string('jetNSecondaryVertices') +),cms.PSet( + default = cms.double(0), + name = cms.string('TagVarCSV_vertexCategory'), + taggingVarName = cms.string('vertexCategory') +)]) diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingvars.py b/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingvars.py new file mode 100644 index 0000000000000..d5ef7f6809e6d --- /dev/null +++ b/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingvars.py @@ -0,0 +1,143 @@ +import re +import FWCore.ParameterSet.Config as cms + +training_vars = { + 'muonMultiplicity': {'default': -1, 'type': 'i'}, + 'trackPPar': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'flightDistance3dSig': {'default': -1, 'max_idx': 1, 'type': 'f'}, + 'trackSip2dVal': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'vertexBoostOverSqrtJetPt': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, + 'trackEtaRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'vertexMass': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, + 'trackDecayLenVal': {'default': -0.1, 'max_idx': 3, 'type': 'f'}, + 'trackJetPt': {'default': -1, 'type': 'f'}, + 'neutralHadronMultiplicity': {'default': -1, 'type': 'i'}, + 'flightDistance3dVal': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, + 'trackJetDist': {'default': -0.1, 'max_idx': 3, 'type': 'f'}, + 'leptonSip3d': {'default': -10000, 'max_idx': 3, 'type': 'f'}, + 'neutralHadronEnergyFraction': {'default': -0.1, 'type': 'f'}, + 'trackPtRatio': {'default': -0.1, 'max_idx': 3, 'type': 'f'}, + 'hadronMultiplicity': {'default': -1, 'type': 'i'}, + 'trackSumJetEtRatio': {'default': -0.1, 'type': 'f'}, + 'vertexJetDeltaR': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, + 'leptonRatioRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'chargedHadronMultiplicity': {'default': -1, 'type': 'i'}, + 'jetNTracks': {'default': -0.1, 'type': 'i'}, + 'trackDeltaR': {'default': -0.1, 'max_idx': 3, 'type': 'f'}, + 'vertexFitProb': {'default': -1, 'max_idx': 1, 'type': 'f'}, + 'trackSip3dValAboveCharm': {'default': -1, 'max_idx': 1, 'type': 'f'}, + 'jetEta': {'default': -3, 'type': 'f'}, + 'leptonDeltaR': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'hadronPhotonMultiplicity': {'default': -1, 'type': 'i'}, + 'leptonPtRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'flightDistance2dVal': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, + 'trackSumJetDeltaR': {'default': -0.1, 'type': 'f'}, + 'photonMultiplicity': {'default': -1, 'type': 'i'}, + 'chargedHadronEnergyFraction': {'default': -0.1, 'type': 'f'}, + 'trackSip3dSigAboveQuarterCharm': {'default': -999, 'max_idx': 1, 'type': 'f'}, + 'vertexLeptonCategory': {'default': -1, 'type': 'i'}, + 'massVertexEnergyFraction': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, + 'trackSip2dSig': {'default': -100, 'max_idx': 3, 'type': 'f'}, + 'flightDistance2dSig': {'default': -1, 'max_idx': 1, 'type': 'f'}, + 'jetPt': {'default': -1, 'type': 'f'}, + 'totalMultiplicity': {'default': -1, 'type': 'i'}, + 'trackSip2dValAboveCharm': {'default': -1, 'max_idx': 1, 'type': 'f'}, + 'electronEnergyFraction': {'default': -0.1, 'type': 'f'}, + 'jetNSecondaryVertices': {'default': 0, 'type': 'i'}, + 'trackSip2dSigAboveCharm': {'default': -999, 'max_idx': 1, 'type': 'f'}, + 'vertexCategory': {'default': -1, 'type': 'i'}, + 'vertexEnergyRatio': {'default': -10, 'max_idx': 1, 'type': 'f'}, + 'photonEnergyFraction': {'default': -0.1, 'type': 'f'}, + 'flavour': {'default': -1, 'type': 'i'}, + 'muonEnergyFraction': {'default': -0.1, 'type': 'f'}, + 'vertexNTracks': {'default': 0, 'max_idx': 1, 'type': 'i'}, + 'trackSip2dSigAboveQuarterCharm': {'default': -999, 'max_idx': 1, 'type': 'f'}, + 'trackSip3dVal': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'leptonRatio': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'trackPtRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'leptonEtaRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, + 'trackPParRatio': {'default': 1.1, 'max_idx': 3, 'type': 'f'}, + 'trackSip3dSig': {'default': -100, 'max_idx': 3, 'type': 'f'}, + 'trackSip3dSigAboveCharm': {'default': -999, 'max_idx': 1, 'type': 'f'}, + 'electronMultiplicity': {'default': -1, 'type': 'i'} +} + +#tv = {} +#for k,v in training_vars.items(): +# tv['TagVarCSV_'+k] = v +#training_vars = tv + +# +# This could be a python class, but given it only used to convert the previous dict +# to CMSSW format I think is overkill +# +varname_regex_=re.compile(r'TagVarCSV_(?P[a-zA-Z0-9]+)(:?_(?P\d+))?$') +def var_match(varname): + '''matches the name used in the MVA training to + get the TaggingVariableName and index''' + + print "printing varname_regex" + print "*************************************" + print varname_regex_ + print "*************************************" + print "printed varname_regex" + #return + + match = varname_regex_.match(varname) + if not match: + raise ValueError( + 'Variable name {0} does not match ' + 'the default regular expression'.format(varname) + ) + return match + +def get_var_name(varname): + #return varname + 'returns the TaggingVariableName of a MVA Name' + print('testintg ... '+varname) + match = var_match(varname) + name = match.group('name') + if name not in training_vars: + raise ValueError( + 'Variable name {0}, matched to name {1}, ' + 'is not among the known trainig variables.'.format( + varname, name) + ) + return name + +def get_var_default(varname): + 'returns the default value used in the traing' + name = get_var_name(varname) + return training_vars[name]['default'] + +def get_var_idx(varname): + 'returns the index in case of vectorial TaggingVariableName' + match = var_match(varname) + idx = match.group('idx') + return int(idx) if idx else None + +def get_var_pset(mvaname): + print "mvaname = ", mvaname + 'returns the cms.PSet to be used by CharmTaggerESProducer' + pset = cms.PSet( + name = cms.string(mvaname), + taggingVarName = cms.string(get_var_name(mvaname)), + default = cms.double(get_var_default(mvaname)) + ) + idx = get_var_idx(mvaname) + if idx is not None: + pset.idx = cms.int32(idx) + return pset + +if __name__ == '__main__': + assert(varname_regex_.match('leptonEtaRel_10').groupdict() == {'name': 'leptonEtaRel', 'idx': '10'}) + assert(varname_regex_.match('leptonEtaRel_1').groupdict() == {'name': 'leptonEtaRel', 'idx': '1'}) + assert(varname_regex_.match('leptonEtaRel').groupdict() == {'name': 'leptonEtaRel', 'idx': None}) + assert(varname_regex_.match('lepton_EtaRel') == None) + + assert(get_var_default('leptonEtaRel_10') == training_vars['leptonEtaRel']['default']) + assert(get_var_default('electronMultiplicity') == training_vars['electronMultiplicity']['default']) + assert(get_var_idx('leptonEtaRel_10') == 10) + assert(get_var_idx('leptonEtaRel_3') == 3) + assert(get_var_idx('FOOBAR') == None) + diff --git a/RecoBTag/Combined/src/hiRun2LegacyCSVv2Tagger.cc b/RecoBTag/Combined/src/hiRun2LegacyCSVv2Tagger.cc new file mode 100644 index 0000000000000..38d5a690c9e7a --- /dev/null +++ b/RecoBTag/Combined/src/hiRun2LegacyCSVv2Tagger.cc @@ -0,0 +1,175 @@ +#include "RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h" + +#include "DataFormats/BTauReco/interface/CandSoftLeptonTagInfo.h" +#include "DataFormats/BTauReco/interface/CandIPTagInfo.h" +#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h" +#include "FWCore/Utilities/interface/ESInputTag.h" +#include "CondFormats/DataRecord/interface/GBRWrapperRcd.h" + +#include +#include + +#include +#include +#include +#include + +const bool PbPbdebug = false; + +hiRun2LegacyCSVv2Tagger::Tokens::Tokens(const edm::ParameterSet &configuration, edm::ESConsumesCollector &&cc) { + if (configuration.getParameter("useCondDB")) { + gbrForest_ = cc.consumes(edm::ESInputTag{"", + configuration.existsAs("gbrForestLabel") + ? configuration.getParameter("gbrForestLabel") + : ""}); + } +} + +hiRun2LegacyCSVv2Tagger::hiRun2LegacyCSVv2Tagger(const edm::ParameterSet &configuration, Tokens tokens) + : sl_computer_(configuration.getParameter("slComputerCfg")), + sv_computer_(configuration.getParameter("slComputerCfg")), + mva_name_(configuration.getParameter("mvaName")), + weight_file_(configuration.getParameter("weightFile")), + use_GBRForest_(configuration.getParameter("useGBRForest")), + use_adaBoost_(configuration.getParameter("useAdaBoost")), + tokens_{tokens} { + vpset vars_definition = configuration.getParameter("variables"); + + for (auto &var : vars_definition) { + MVAVar mva_var; + mva_var.name = var.getParameter("name"); + mva_var.id = reco::getTaggingVariableName(var.getParameter("taggingVarName")); + + mva_var.has_index = var.existsAs("idx"); + mva_var.index = mva_var.has_index ? var.getParameter("idx") : 0; + mva_var.default_value = var.getParameter("default"); + + if (PbPbdebug) + std::cout << "hiRun2LegacyCSVv2:mva_var.id =" << mva_var.id + << " var.getParameter(taggingVarName)=" << var.getParameter("taggingVarName") + << " index = " << mva_var.index << std::endl; + + variables_.push_back(mva_var); + } + + uses(0, "impactParameterTagInfos"); + uses(1, "secondaryVertexTagInfos"); +} + +void hiRun2LegacyCSVv2Tagger::initialize(const JetTagComputerRecord &record) { + mvaID_ = std::make_unique(); + + std::vector variable_names; + variable_names.reserve(variables_.size()); + + for (auto &var : variables_) { + variable_names.push_back(var.name); + } + std::vector spectators; + + if (tokens_.gbrForest_.isInitialized()) { + mvaID_->initializeGBRForest(&record.get(tokens_.gbrForest_), variable_names, spectators, use_adaBoost_); + } else { + mvaID_->initialize("Color:Silent:Error", + mva_name_, + weight_file_.fullPath(), + variable_names, + spectators, + use_GBRForest_, + use_adaBoost_); + } +} + +hiRun2LegacyCSVv2Tagger::~hiRun2LegacyCSVv2Tagger() {} + +/// b-tag a jet based on track-to-jet parameters in the extened info collection +float hiRun2LegacyCSVv2Tagger::discriminator(const TagInfoHelper &tagInfo) const { + // default value, used if there are no leptons associated to this jet + const reco::TrackIPTagInfo &ip_info = tagInfo.get(0); + const reco::SecondaryVertexTagInfo &sv_info = tagInfo.get(1); + reco::TaggingVariableList vars = sv_computer_(ip_info, sv_info); + + // Loop over input variables + std::map inputs; + + //For debugging; + float save_pt_value = -1.0; + float save_eta_value = -999.0; + bool passes_cuts = false; + + bool notTaggable = false; + bool noTrack = false; + bool printdebug = false; + float vtxMassVal = 0.; + + for (auto &mva_var : variables_) { + //vectorial tagging variable + if (mva_var.has_index) { + std::vector vals = vars.getList(mva_var.id, false); + inputs[mva_var.name] = (vals.size() > mva_var.index) ? vals[mva_var.index] : mva_var.default_value; + + if (mva_var.name == "TagVarCSV_trackSip3dSig_0" && inputs[mva_var.name] < -98.999) + noTrack = true; + if (passes_cuts) { + if (printdebug) + std::cout << inputs[mva_var.name] << "\t"; + } + + if (mva_var.name == "Jet_pt") { + save_pt_value = inputs[mva_var.name]; + } + + if (mva_var.name == "Jet_eta") { + save_eta_value = inputs[mva_var.name]; + passes_cuts = (save_pt_value > 30 && save_eta_value > -2.4 && save_eta_value < 2.4); + if (printdebug) { + if (passes_cuts) + std::cout << save_pt_value << "\t" << save_eta_value << "\t"; + } + } + + } + //single value tagging var + else { + inputs[mva_var.name] = vars.get(mva_var.id, mva_var.default_value); + + //IK: vtxMass check to check vtxType: vtxType = 2 (no vtx), vtxMass < 0, vtxType = 1 (pseudo vtx), vtxMass > 0 + if (mva_var.name == "TagVarCSV_vertexMass") { + vtxMassVal = inputs[mva_var.name]; + } + + if (passes_cuts) { + if (printdebug) + std::cout << inputs[mva_var.name] << "\t"; + } + } + } + + //IK: if no reco vtx (including pseudo vtx) and no tracks passing all selections (including K0s veto) -> jet is not taggable + + if (vtxMassVal < 0 && noTrack) { + notTaggable = true; + } + + //get the MVA output + float tag = (mvaID_->evaluate(inputs) + 1) / 2.; + if (printdebug) { + if (passes_cuts) + std::cout << tag << "\n"; + } + + if (notTaggable) { + tag = -1; + if (PbPbdebug) + std::cout << " --- jet not taggable" << std::endl; + } + + if (PbPbdebug) { + std::cout << "Looking at a jet of " << save_pt_value << " GeV" << std::endl; + for (const auto &x : inputs) + std::cout << "Variable = " << x.first << " value = " << x.second << std::endl; + std::cout << " --- Result : " << tag << std::endl; + } + + return tag; +} diff --git a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2BJetTags_cfi.py b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2BJetTags_cfi.py index c4a4a33c8f9b5..ebcf23c1ae87b 100644 --- a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2BJetTags_cfi.py +++ b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2BJetTags_cfi.py @@ -5,3 +5,5 @@ tagInfos = cms.VInputTag(cms.InputTag("impactParameterTagInfos"), cms.InputTag("secondaryVertexTagInfos")) ) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toModify(combinedSecondaryVertexV2BJetTags,jetTagComputer = 'hiRun2LegacyCSVv2Computer') From 8849191aba7da5aac36c887693aa0e95c6ea96ce Mon Sep 17 00:00:00 2001 From: Dan Riley Date: Sun, 4 Oct 2020 11:29:10 -0400 Subject: [PATCH 215/778] formatting --- FWCore/Utilities/test/Guid_t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FWCore/Utilities/test/Guid_t.cpp b/FWCore/Utilities/test/Guid_t.cpp index c1498e7cc4d89..d1845a48285c3 100644 --- a/FWCore/Utilities/test/Guid_t.cpp +++ b/FWCore/Utilities/test/Guid_t.cpp @@ -37,7 +37,7 @@ int main() { edm::Guid otherGuid; assert(otherGuid != guid); - edm::Guid otherBinaryGuid{ otherGuid.toBinary(), true }; + edm::Guid otherBinaryGuid{otherGuid.toBinary(), true}; assert(otherBinaryGuid == otherGuid); assert(otherBinaryGuid != guid4); } From ff52b6ef31bccaeef68bb1319e912e81a2c432a2 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Sun, 4 Oct 2020 17:41:52 +0200 Subject: [PATCH 216/778] find a specpar based on a parameter pack --- .../DDCMS/interface/DDFilteredView.h | 18 +- .../DDCMS/src/DDFilteredView.cc | 94 +++++++-- DetectorDescription/DDCMS/test/BuildFile.xml | 5 + .../DDCMS/test/DDFilteredView.find.cppunit.cc | 185 ++++++++++++++++++ 4 files changed, 280 insertions(+), 22 deletions(-) create mode 100644 DetectorDescription/DDCMS/test/DDFilteredView.find.cppunit.cc diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 19c89e79607ba..319747456a14f 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -222,6 +222,20 @@ namespace cms { //! print Filter paths and selections void printFilter() const; + //! find a current Node SpecPar that has at least + // one of the attributes + template + void findSpecPar(T const& first, Ts const&... rest) { + currentSpecPar_ = find(first); + if constexpr (sizeof...(rest) > 0) { + // this line will only be instantiated if there are further + // arguments. if rest... is empty, there will be no call to + // findSpecPar(next). + if (currentSpecPar_ == nullptr) + findSpecPar(rest...); + } + } + private: bool accept(std::string_view); int nodeCopyNo(const std::string_view) const; @@ -236,7 +250,9 @@ namespace cms { // speeding up avoiding the same search over // the registry const DDSpecPar* find(const std::string&) const; - + void filter(DDSpecParRefs&, const std::string&) const; + const std::string_view front(const std::string_view) const; + ExpandedNodes nodes_; std::vector it_; std::vector> filters_; diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index fb20cff1e59d1..ba8171f9baa54 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -158,15 +158,16 @@ void DDFilteredView::rot(dd4hep::Rotation3D& matrixOut) const { } void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { + currentSpecPar_ = nullptr; + if (!filters_.empty()) { filters_.clear(); filters_.shrink_to_fit(); } for (const auto& i : specs) { for (const auto& j : i->paths) { - vector toks = split(j, "/"); auto const& filter = find_if(begin(filters_), end(filters_), [&](auto const& f) { - auto const& k = find_if(begin(f->skeys), end(f->skeys), [&](auto const& p) { return toks.front() == p; }); + auto const& k = find_if(begin(f->skeys), end(f->skeys), [&](auto const& p) { return front(j) == p; }); if (k != end(f->skeys)) { currentFilter_ = f.get(); return true; @@ -175,8 +176,8 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { }); if (filter == end(filters_)) { filters_.emplace_back(unique_ptr( - new Filter{{toks.front()}, - {std::regex(std::string("^").append({toks.front().data(), toks.front().size()}).append("$"))}, + new Filter{{front(j)}, + {std::regex(std::string("^").append({front(j).data(), front(j).size()}).append("$"))}, nullptr, nullptr, i})); @@ -186,6 +187,7 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { } } // all next levels + vector toks = split(j, "/"); for (size_t pos = 1; pos < toks.size(); ++pos) { if (currentFilter_->next != nullptr) { currentFilter_ = currentFilter_->next.get(); @@ -217,6 +219,8 @@ void DDFilteredView::printFilter() const { } bool DDFilteredView::firstChild() { + currentSpecPar_ = nullptr; + if (it_.empty()) { LogVerbatim("DDFilteredView") << "Iterator vector has zero size."; return false; @@ -291,6 +295,8 @@ bool DDFilteredView::match(const std::string& path, const std::vector> DDFilteredView::children(const std::string& selectPath) { + currentSpecPar_ = nullptr; + std::vector> paths; if (it_.empty()) { LogVerbatim("DDFilteredView") << "Iterator vector has zero size."; @@ -325,6 +331,8 @@ std::vector> DDFilteredView::children(const std::string& sele } bool DDFilteredView::firstSibling() { + currentSpecPar_ = nullptr; + assert(node_); if (it_.empty() or currentFilter_ == nullptr) return false; @@ -349,6 +357,8 @@ bool DDFilteredView::firstSibling() { } bool DDFilteredView::nextSibling() { + currentSpecPar_ = nullptr; + assert(node_); if (it_.empty() or currentFilter_ == nullptr) return false; @@ -370,6 +380,8 @@ bool DDFilteredView::nextSibling() { } bool DDFilteredView::sibling() { + currentSpecPar_ = nullptr; + if (it_.empty() or currentFilter_ == nullptr) return false; it_.back().SetType(1); @@ -384,6 +396,8 @@ bool DDFilteredView::sibling() { } bool DDFilteredView::checkChild() { + currentSpecPar_ = nullptr; + if (it_.empty() or currentFilter_ == nullptr) return false; it_.back().SetType(1); @@ -397,6 +411,7 @@ bool DDFilteredView::checkChild() { } bool DDFilteredView::parent() { + currentSpecPar_ = nullptr; if (it_.empty() or currentFilter_ == nullptr) return false; up(); @@ -406,6 +421,8 @@ bool DDFilteredView::parent() { } bool DDFilteredView::next(int type) { + currentSpecPar_ = nullptr; + if (it_.empty()) return false; it_.back().SetType(type); @@ -418,6 +435,8 @@ bool DDFilteredView::next(int type) { } void DDFilteredView::down() { + currentSpecPar_ = nullptr; + if (it_.empty() or currentFilter_ == nullptr) return; it_.emplace_back(Iterator(it_.back())); @@ -427,6 +446,8 @@ void DDFilteredView::down() { } void DDFilteredView::up() { + currentSpecPar_ = nullptr; + if (it_.size() > 1 and currentFilter_ != nullptr) { it_.pop_back(); it_.back().SetType(0); @@ -485,9 +506,12 @@ std::string_view DDFilteredView::get(const string& key) { template <> double DDFilteredView::get(const string& key) { double result(0.0); - std::string_view tmpStrV = get(key); - if (!tmpStrV.empty()) - result = dd4hep::_toDouble({tmpStrV.data(), tmpStrV.size()}); + + currentSpecPar_ = find(key); + if (currentSpecPar_ != nullptr) { + result = getNextValue(key); + } + return result; } @@ -552,7 +576,8 @@ const int DDFilteredView::level() const { bool DDFilteredView::goTo(const nav_type& newpos) { bool result(false); - + currentSpecPar_ = nullptr; + // save the current position it_.emplace_back(Iterator(it_.back().GetTopVolume())); Node* node = nullptr; @@ -593,30 +618,30 @@ const ExpandedNodes& DDFilteredView::history() { nodes_.tags.clear(); nodes_.offsets.clear(); nodes_.copyNos.clear(); - bool result(false); int level = it_.back().GetLevel(); for (int nit = level; nit > 0; --nit) { - for_each(begin(registry_->specpars), end(registry_->specpars), [&](auto const& i) { + for (auto const& i : registry_->specpars) { auto k = find_if(begin(i.second.paths), end(i.second.paths), [&](auto const& j) { - return (isMatch(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), *begin(split(j, "/"))) and - (i.second.hasValue("CopyNoTag") or i.second.hasValue("CopyNoOffset"))); - }); + return (isMatch(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), front(j))) and + (i.second.hasValue("CopyNoTag") or i.second.hasValue("CopyNoOffset")); + }); if (k != end(i.second.paths)) { nodes_.tags.emplace_back(i.second.dblValue("CopyNoTag")); nodes_.offsets.emplace_back(i.second.dblValue("CopyNoOffset")); nodes_.copyNos.emplace_back(it_.back().GetNode(nit)->GetNumber()); - result = true; } - }); + } } return nodes_; } const DDSpecPar* DDFilteredView::find(const std::string& key) const { + DDSpecParRefs refs; - registry_->filter(refs, key, ""); + filter(refs, key); + int level = it_.back().GetLevel(); for (auto const& i : refs) { auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { @@ -676,15 +701,42 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { return nullptr; } + +void DDFilteredView::filter(DDSpecParRefs& refs, const std::string& key) const { + for (auto const& it : registry_->specpars) { + if (it.second.hasValue(key) || (it.second.spars.find(key) != end(it.second.spars))) { + refs.emplace_back(&it.second); + } + } +} + +const std::string_view DDFilteredView::front(const std::string_view path) const { + auto const& lpos = path.find_first_not_of('/'); + if (lpos != path.npos) { + auto rpos = path.find_first_of('/', lpos); + if (rpos == path.npos) { + rpos = path.size(); + } + return path.substr(lpos, rpos); + } + + // throw cms::Exception("Filtered View") << "Path must start with '//' " << path; + return path; +} + double DDFilteredView::getNextValue(const std::string& key) const { double result(0.0); - std::string_view tmpresult; if (currentSpecPar_ != nullptr) { - tmpresult = currentSpecPar_->strValue(key); - } - if (!tmpresult.empty()) { - result = dd4hep::_toDouble({tmpresult.data(), tmpresult.size()}); + std::string_view svalue = currentSpecPar_->strValue(key); + if (!svalue.empty()) { + result = dd4hep::_toDouble({svalue.data(), svalue.size()}); + } else if (currentSpecPar_->hasValue(key)) { + auto const& nitem = currentSpecPar_->numpars.find(key); + if (nitem != end(currentSpecPar_->numpars)) { + result = nitem->second[0]; + } + } } return result; diff --git a/DetectorDescription/DDCMS/test/BuildFile.xml b/DetectorDescription/DDCMS/test/BuildFile.xml index a42d8b3517ec6..e11219692203e 100644 --- a/DetectorDescription/DDCMS/test/BuildFile.xml +++ b/DetectorDescription/DDCMS/test/BuildFile.xml @@ -14,6 +14,11 @@ + + + + + diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.find.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.find.cppunit.cc new file mode 100644 index 0000000000000..c2fb46e2e75e8 --- /dev/null +++ b/DetectorDescription/DDCMS/test/DDFilteredView.find.cppunit.cc @@ -0,0 +1,185 @@ +#include + +#include "DetectorDescription/DDCMS/interface/DDFilteredView.h" +#include "DetectorDescription/DDCMS/interface/DDDetector.h" +#include "FWCore/ParameterSet/interface/FileInPath.h" +#include "DD4hep/Detector.h" + +#include +#include +#include + +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" + +using namespace cms; + +class testDDFilteredViewFind : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(testDDFilteredViewFind); + CPPUNIT_TEST(checkFilteredView); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp() override; + void tearDown() override {} + void checkFilteredView(); + +private: + void printMe(const cms::DDFilteredView&); + double refRadLength_ = 0.03142; + double refXi_ = 6.24526e-05; + int refCopyNoTag_ = 1000; + int refCopyNoOffset_ = 100; + int refCopyNo_ = 1; + std::string fileName_; + std::vector refPos_{0, 0, 6, 2, 2}; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(testDDFilteredViewFind); + +void testDDFilteredViewFind::setUp() { + fileName_ = edm::FileInPath("Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml").fullPath(); +} + +void testDDFilteredViewFind::checkFilteredView() { + std::unique_ptr det = std::make_unique("DUMMY", fileName_); + DDFilteredView fview(det.get(), det->description()->worldVolume()); + + int count = 1; + auto testPos = fview.navPos(); + while (fview.next(0)) { + std::cout << "#" << count << ": "; + printMe(fview); + + if (count == 45) { + testPos = fview.navPos(); + } + if (count == 50) { + break; + } + count++; + } + + // world_volume/OCMS_1/CMSE_1/Tracker_1/PixelBarrel_1/pixbarlayer0:PixelBarrelLayer0_1/PixelBarrelLadderFull0_6/PixelBarrelModuleBoxFull_1/PixelBarrelModuleFullPlus_4/PixelBarrelSensorFull_1/PixelBarrelActiveFull0_1 + // + std::vector activeVol{0, 0, 6, 2, 93, 12, 1, 7, 1, 0}; + fview.goTo(activeVol); + printMe(fview); + fview.findSpecPar("TrackerRadLength", "TrackerXi"); + + double radLength = fview.getNextValue("TrackerRadLength"); + double xi = fview.getNextValue("TrackerXi"); + CPPUNIT_ASSERT(radLength == refRadLength_); + CPPUNIT_ASSERT(xi == refXi_); + + std::cout << "TrackerRadLength = " << radLength << "\nTrackerXi = " << xi << "\n"; + + std::cout << "\n==== Let's go to #45\n"; + fview.goTo(testPos); + printMe(fview); + + int i = 0; + for (auto it : fview.navPos()) { + CPPUNIT_ASSERT(it == testPos[i++]); + } + i = 0; + for (auto it : testPos) { + CPPUNIT_ASSERT(it == refPos_[i++]); + } + + // Start with Muon + std::cout << "\n==== Let's go to Muon\n"; + fview.goTo({0, 0, 8}); + printMe(fview); + + CPPUNIT_ASSERT(fview.name() == "MUON"); + + // Go to the first daughter + fview.next(0); + printMe(fview); + + // Use it as an escape level + int startLevel = fview.level(); + + count = 1; + + do { + std::cout << "#" << count++ << ": "; + std::cout << "started at level " << startLevel << "\n"; + printMe(fview); + + } while (fview.next(0) && fview.level() < startLevel); + + std::cout << "\n==== Continue iteration\n"; + + count = 1; + fview.next(0); + startLevel = fview.level(); + printMe(fview); + + do { + std::cout << "#" << count++; + std::cout << " started at level " << startLevel << ":\n"; + printMe(fview); + } while (fview.next(0) && fview.level() < startLevel); + + fview.next(0); + printMe(fview); + + std::cout << "\n==== Let's do it again, go to Muon\n"; + fview.goTo({0, 0, 8}); + printMe(fview); + CPPUNIT_ASSERT(fview.name() == "MUON"); + + // Go to the first daughter + fview.next(0); + printMe(fview); + + // Use it as an escape level + startLevel = fview.level(); + + count = 1; + + do { + std::cout << "#" << count++ << ": "; + std::cout << "started at level " << startLevel << "\n"; + printMe(fview); + + } while (fview.next(0) && fview.level() < startLevel); + + fview.goTo({0, 0, 8, 0}); + printMe(fview); + fview.findSpecPar("CopyNoTag", "CopyNoOffset"); + + auto tag = fview.getNextValue("CopyNoTag"); + auto offset = fview.getNextValue("CopyNoOffset"); + std::cout << "CopyNoTag = " << tag << "\n"; + std::cout << "CopyNoOffset = " << fview.getNextValue("CopyNoOffset") << "\n"; + CPPUNIT_ASSERT(refCopyNoTag_ == tag); + CPPUNIT_ASSERT(refCopyNoOffset_ == offset); + + const auto& nodes = fview.history(); + int ctr(0); + for(const auto& t : nodes.tags) { + std::cout << t << ": " << nodes.offsets[ctr] << ", " << nodes.copyNos[ctr] << "\n"; + CPPUNIT_ASSERT(refCopyNoTag_ == t); + CPPUNIT_ASSERT(refCopyNoOffset_ == nodes.offsets[ctr]); + CPPUNIT_ASSERT(refCopyNo_ == nodes.copyNos[ctr]); + ctr++; + } +} + +void testDDFilteredViewFind::printMe(const cms::DDFilteredView& fview) { + std::cout << ">>> " << fview.level() << " level: " << fview.name() << " is a " + << cms::dd::name(cms::DDSolidShapeMap, fview.shape()) << "\n"; + std::cout << "Full path to it is " << fview.path() << "\n"; + + auto copies = fview.copyNos(); + std::cout << " copy Nos: "; + std::for_each(copies.rbegin(), copies.rend(), [](const auto& it) { std::cout << it << ", "; }); + std::cout << "\n levels : "; + for (auto it : fview.navPos()) { + std::cout << it << ", "; + } + std::cout << "\n"; +} From a77cdd18aca6339e0f318024417b2d12d9c40a96 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Sun, 4 Oct 2020 17:43:56 +0200 Subject: [PATCH 217/778] code format --- .../DDCMS/interface/DDFilteredView.h | 14 ++++----- .../DDCMS/src/DDFilteredView.cc | 30 +++++++++---------- .../DDCMS/test/DDFilteredView.find.cppunit.cc | 6 ++-- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 319747456a14f..9942b0f90b17c 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -228,12 +228,12 @@ namespace cms { void findSpecPar(T const& first, Ts const&... rest) { currentSpecPar_ = find(first); if constexpr (sizeof...(rest) > 0) { - // this line will only be instantiated if there are further - // arguments. if rest... is empty, there will be no call to - // findSpecPar(next). - if (currentSpecPar_ == nullptr) - findSpecPar(rest...); - } + // this line will only be instantiated if there are further + // arguments. if rest... is empty, there will be no call to + // findSpecPar(next). + if (currentSpecPar_ == nullptr) + findSpecPar(rest...); + } } private: @@ -252,7 +252,7 @@ namespace cms { const DDSpecPar* find(const std::string&) const; void filter(DDSpecParRefs&, const std::string&) const; const std::string_view front(const std::string_view) const; - + ExpandedNodes nodes_; std::vector it_; std::vector> filters_; diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index ba8171f9baa54..d7283887642a8 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -176,7 +176,7 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { }); if (filter == end(filters_)) { filters_.emplace_back(unique_ptr( - new Filter{{front(j)}, + new Filter{{front(j)}, {std::regex(std::string("^").append({front(j).data(), front(j).size()}).append("$"))}, nullptr, nullptr, @@ -422,7 +422,7 @@ bool DDFilteredView::parent() { bool DDFilteredView::next(int type) { currentSpecPar_ = nullptr; - + if (it_.empty()) return false; it_.back().SetType(type); @@ -436,7 +436,7 @@ bool DDFilteredView::next(int type) { void DDFilteredView::down() { currentSpecPar_ = nullptr; - + if (it_.empty() or currentFilter_ == nullptr) return; it_.emplace_back(Iterator(it_.back())); @@ -447,7 +447,7 @@ void DDFilteredView::down() { void DDFilteredView::up() { currentSpecPar_ = nullptr; - + if (it_.size() > 1 and currentFilter_ != nullptr) { it_.pop_back(); it_.back().SetType(0); @@ -506,12 +506,12 @@ std::string_view DDFilteredView::get(const string& key) { template <> double DDFilteredView::get(const string& key) { double result(0.0); - + currentSpecPar_ = find(key); if (currentSpecPar_ != nullptr) { - result = getNextValue(key); + result = getNextValue(key); } - + return result; } @@ -577,7 +577,7 @@ const int DDFilteredView::level() const { bool DDFilteredView::goTo(const nav_type& newpos) { bool result(false); currentSpecPar_ = nullptr; - + // save the current position it_.emplace_back(Iterator(it_.back().GetTopVolume())); Node* node = nullptr; @@ -623,9 +623,9 @@ const ExpandedNodes& DDFilteredView::history() { for (int nit = level; nit > 0; --nit) { for (auto const& i : registry_->specpars) { auto k = find_if(begin(i.second.paths), end(i.second.paths), [&](auto const& j) { - return (isMatch(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), front(j))) and - (i.second.hasValue("CopyNoTag") or i.second.hasValue("CopyNoOffset")); - }); + return (isMatch(noNamespace(it_.back().GetNode(nit)->GetVolume()->GetName()), front(j))) and + (i.second.hasValue("CopyNoTag") or i.second.hasValue("CopyNoOffset")); + }); if (k != end(i.second.paths)) { nodes_.tags.emplace_back(i.second.dblValue("CopyNoTag")); nodes_.offsets.emplace_back(i.second.dblValue("CopyNoOffset")); @@ -638,7 +638,6 @@ const ExpandedNodes& DDFilteredView::history() { } const DDSpecPar* DDFilteredView::find(const std::string& key) const { - DDSpecParRefs refs; filter(refs, key); @@ -701,7 +700,6 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { return nullptr; } - void DDFilteredView::filter(DDSpecParRefs& refs, const std::string& key) const { for (auto const& it : registry_->specpars) { if (it.second.hasValue(key) || (it.second.spars.find(key) != end(it.second.spars))) { @@ -719,11 +717,11 @@ const std::string_view DDFilteredView::front(const std::string_view path) const } return path.substr(lpos, rpos); } - + // throw cms::Exception("Filtered View") << "Path must start with '//' " << path; return path; } - + double DDFilteredView::getNextValue(const std::string& key) const { double result(0.0); @@ -734,7 +732,7 @@ double DDFilteredView::getNextValue(const std::string& key) const { } else if (currentSpecPar_->hasValue(key)) { auto const& nitem = currentSpecPar_->numpars.find(key); if (nitem != end(currentSpecPar_->numpars)) { - result = nitem->second[0]; + result = nitem->second[0]; } } } diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.find.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.find.cppunit.cc index c2fb46e2e75e8..bcdca588e3607 100644 --- a/DetectorDescription/DDCMS/test/DDFilteredView.find.cppunit.cc +++ b/DetectorDescription/DDCMS/test/DDFilteredView.find.cppunit.cc @@ -66,7 +66,7 @@ void testDDFilteredViewFind::checkFilteredView() { fview.goTo(activeVol); printMe(fview); fview.findSpecPar("TrackerRadLength", "TrackerXi"); - + double radLength = fview.getNextValue("TrackerRadLength"); double xi = fview.getNextValue("TrackerXi"); CPPUNIT_ASSERT(radLength == refRadLength_); @@ -157,10 +157,10 @@ void testDDFilteredViewFind::checkFilteredView() { std::cout << "CopyNoOffset = " << fview.getNextValue("CopyNoOffset") << "\n"; CPPUNIT_ASSERT(refCopyNoTag_ == tag); CPPUNIT_ASSERT(refCopyNoOffset_ == offset); - + const auto& nodes = fview.history(); int ctr(0); - for(const auto& t : nodes.tags) { + for (const auto& t : nodes.tags) { std::cout << t << ": " << nodes.offsets[ctr] << ", " << nodes.copyNos[ctr] << "\n"; CPPUNIT_ASSERT(refCopyNoTag_ == t); CPPUNIT_ASSERT(refCopyNoOffset_ == nodes.offsets[ctr]); From 5100d835684ef07cca0df1cdefa8eec4f06efeb0 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Sun, 4 Oct 2020 20:04:20 +0200 Subject: [PATCH 218/778] clean BuildFiles in DetectorDescription --- DetectorDescription/DDCMS/BuildFile.xml | 2 -- DetectorDescription/DDCMS/plugins/BuildFile.xml | 1 - DetectorDescription/Parser/BuildFile.xml | 1 - DetectorDescription/Parser/test/BuildFile.xml | 1 - DetectorDescription/RegressionTest/test/BuildFile.xml | 1 - ElectroWeakAnalysis/ZEE/BuildFile.xml | 2 -- Geometry/HcalAlgo/plugins/BuildFile.xml | 1 + 7 files changed, 1 insertion(+), 8 deletions(-) diff --git a/DetectorDescription/DDCMS/BuildFile.xml b/DetectorDescription/DDCMS/BuildFile.xml index a6230025fa30d..224846daa3e09 100644 --- a/DetectorDescription/DDCMS/BuildFile.xml +++ b/DetectorDescription/DDCMS/BuildFile.xml @@ -1,7 +1,5 @@ - - diff --git a/DetectorDescription/DDCMS/plugins/BuildFile.xml b/DetectorDescription/DDCMS/plugins/BuildFile.xml index 1f5ae9d225324..3bac0040bd395 100644 --- a/DetectorDescription/DDCMS/plugins/BuildFile.xml +++ b/DetectorDescription/DDCMS/plugins/BuildFile.xml @@ -1,5 +1,4 @@ - diff --git a/DetectorDescription/Parser/BuildFile.xml b/DetectorDescription/Parser/BuildFile.xml index 8d6c4d394eee0..339b566e781a8 100644 --- a/DetectorDescription/Parser/BuildFile.xml +++ b/DetectorDescription/Parser/BuildFile.xml @@ -1,6 +1,5 @@ - diff --git a/DetectorDescription/Parser/test/BuildFile.xml b/DetectorDescription/Parser/test/BuildFile.xml index 8a92c9dd9d81d..d171bb809b4aa 100644 --- a/DetectorDescription/Parser/test/BuildFile.xml +++ b/DetectorDescription/Parser/test/BuildFile.xml @@ -5,7 +5,6 @@ - diff --git a/DetectorDescription/RegressionTest/test/BuildFile.xml b/DetectorDescription/RegressionTest/test/BuildFile.xml index b332b5d7fe42e..312272bd7223c 100644 --- a/DetectorDescription/RegressionTest/test/BuildFile.xml +++ b/DetectorDescription/RegressionTest/test/BuildFile.xml @@ -122,7 +122,6 @@ - diff --git a/ElectroWeakAnalysis/ZEE/BuildFile.xml b/ElectroWeakAnalysis/ZEE/BuildFile.xml index 193a76506e264..41daee4783660 100644 --- a/ElectroWeakAnalysis/ZEE/BuildFile.xml +++ b/ElectroWeakAnalysis/ZEE/BuildFile.xml @@ -9,8 +9,6 @@ - - diff --git a/Geometry/HcalAlgo/plugins/BuildFile.xml b/Geometry/HcalAlgo/plugins/BuildFile.xml index f29bd316cd91a..a4072fcb1c7a8 100644 --- a/Geometry/HcalAlgo/plugins/BuildFile.xml +++ b/Geometry/HcalAlgo/plugins/BuildFile.xml @@ -5,6 +5,7 @@
+ From 41abcc72a7c65fa8d37e1d2b57f882a82f8b5f3b Mon Sep 17 00:00:00 2001 From: aravind sugunan Date: Mon, 5 Oct 2020 09:04:15 +0200 Subject: [PATCH 219/778] Fix modified: PVClusterComparer.cc --- RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc b/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc index 52bb3bd2875ea..cb398e94e57a3 100644 --- a/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc +++ b/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc @@ -78,7 +78,7 @@ double PVClusterComparer::pTSquaredSum(const reco::Vertex &v) { void PVClusterComparer::setChisquareQuantile() { std::vector maxChi2(20, 0.); if (track_prob_min_ >= 0. && track_prob_min_ <= 1.) - for (size_t ndof = 0; ndof < maxChi2_.size(); ++ndof) + for (size_t ndof = 0; ndof < maxChi2.size(); ++ndof) // http://root.cern.ch/root/html/TMath.html#TMath:ChisquareQuantile maxChi2[ndof] = TMath::ChisquareQuantile(1 - track_prob_min_, ndof); From ecd2d29281fb0e2e25a4c522dbdee8ad1f57d5f4 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Mon, 5 Oct 2020 11:24:54 +0200 Subject: [PATCH 220/778] Comments --- .../plugins/DDDCmsTrackerContruction.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc index 59bdaa09ed0c0..e2ea18288813c 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc @@ -94,10 +94,10 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const cms::DDC } /* - * Print all Tracker GeoemtricDets before DetIds building. - * The tree is lareday fully constructed from XMLs, + * Print all Tracker GeometricDets, before DetIds building process. + * The tree is already fully constructed from XMLs, * and all GeometricDets are sorted according to their geometric position. - * This allows a convenient debugging, as the DetIds are assigned according to this information. + * This allows a convenient debugging, as the DetIds will be later assigned according to this information. */ void DDDCmsTrackerContruction::printAllTrackerGeometricDetsBeforeDetIDBuilding(const GeometricDet* tracker) { std::ofstream outputFile("All_Tracker_GeometricDets_before_DetId_building.log", std::ios::out); From 4c915831a45745f81c4b07968e547a3e0848e8d1 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Mon, 5 Oct 2020 11:44:11 +0200 Subject: [PATCH 221/778] remove SensitiveDetector --- .../DDCMS/interface/DDPlugins.h | 15 +-- .../DDCMS/plugins/dd4hep/DDAngular.cc | 2 +- .../plugins/dd4hep/DDDefinitions2Objects.cc | 105 +++--------------- .../DDCMS/plugins/dd4hep/DDLinear.cc | 2 +- .../DDCMS/plugins/test/DDTestVectorAlgo.cc | 2 +- .../DDCMS/src/DDFilteredView.cc | 9 +- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 4 +- .../plugins/dd4hep/DDEcalEndcapAlgo.cc | 4 +- .../plugins/dd4hep/DDEcalPreshowerAlgo.cc | 4 +- .../plugins/dd4hep/DDBHMAngular.cc | 4 +- .../plugins/dd4hep/DDTotemAngular.cc | 4 +- .../plugins/dd4hep/DDAHcalModuleAlgo.cc | 4 +- .../plugins/dd4hep/DDHGCalCell.cc | 3 +- .../plugins/dd4hep/DDHGCalEEAlgo.cc | 3 +- .../plugins/dd4hep/DDHGCalEEFileAlgo.cc | 3 +- .../plugins/dd4hep/DDHGCalHEAlgo.cc | 3 +- .../plugins/dd4hep/DDHGCalHEFileAlgo.cc | 3 +- .../plugins/dd4hep/DDHGCalModule.cc | 4 +- .../plugins/dd4hep/DDHGCalModuleAlgo.cc | 4 +- .../plugins/dd4hep/DDHGCalNoTaperEndcap.cc | 4 +- .../plugins/dd4hep/DDHGCalTBModule.cc | 4 +- .../plugins/dd4hep/DDHGCalTBModuleX.cc | 4 +- .../plugins/dd4hep/DDHGCalWafer.cc | 4 +- .../plugins/dd4hep/DDHGCalWafer8.cc | 4 +- .../plugins/dd4hep/DDHGCalWaferAlgo.cc | 4 +- .../HcalAlgo/plugins/dd4hep/DDHCalAngular.cc | 4 +- .../plugins/dd4hep/DDHCalBarrelAlgo.cc | 3 +- .../plugins/dd4hep/DDHCalEndcapAlgo.cc | 3 +- .../plugins/dd4hep/DDHCalEndcapModuleAlgo.cc | 3 +- .../plugins/dd4hep/DDHCalFibreBundle.cc | 4 +- .../plugins/dd4hep/DDHCalForwardAlgo.cc | 4 +- .../HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc | 4 +- .../plugins/dd4hep/DDHCalTBCableAlgo.cc | 4 +- .../plugins/dd4hep/DDHCalTBZposAlgo.cc | 4 +- .../plugins/dd4hep/DDHCalTestBeamAlgo.cc | 4 +- .../HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc | 4 +- .../plugins/dd4hep/DDMTDLinear.cc | 2 +- .../plugins/dd4hep/DDGEMAngular.cc | 4 +- .../plugins/dd4hep/DDMuonAngular.cc | 4 +- .../plugins/dd4hep/DDCutTubsFromPoints.cc | 4 +- .../plugins/dd4hep/DDPixBarLayerAlgo.cc | 2 +- .../dd4hep/DDPixBarLayerUpgradeAlgo.cc | 2 +- .../plugins/dd4hep/DDPixFwdDiskAlgo.cc | 4 +- .../plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc | 4 +- .../plugins/dd4hep/DDTECCoolAlgo.cc | 2 +- .../plugins/dd4hep/DDTECModuleAlgo.cc | 2 +- .../plugins/dd4hep/DDTECOptoHybAlgo.cc | 2 +- .../plugins/dd4hep/DDTECPhiAlgo.cc | 2 +- .../plugins/dd4hep/DDTECPhiAltAlgo.cc | 2 +- .../plugins/dd4hep/DDTIBLayerAlgo.cc | 4 +- .../plugins/dd4hep/DDTIDAxialCableAlgo.cc | 2 +- .../plugins/dd4hep/DDTIDModuleAlgo.cc | 2 +- .../plugins/dd4hep/DDTIDModulePosAlgo.cc | 2 +- .../plugins/dd4hep/DDTIDRingAlgo.cc | 2 +- .../plugins/dd4hep/DDTOBAxCableAlgo.cc | 2 +- .../plugins/dd4hep/DDTOBRadCableAlgo.cc | 2 +- .../plugins/dd4hep/DDTOBRodAlgo.cc | 2 +- .../plugins/dd4hep/DDTrackerAngular.cc | 2 +- .../plugins/dd4hep/DDTrackerLinear.cc | 2 +- .../plugins/dd4hep/DDTrackerPhiAlgo.cc | 2 +- .../plugins/dd4hep/DDTrackerPhiAltAlgo.cc | 2 +- .../plugins/dd4hep/DDTrackerRingAlgo.cc | 2 +- .../plugins/dd4hep/DDTrackerXYZPosAlgo.cc | 2 +- .../plugins/dd4hep/DDTrackerZPosAlgo.cc | 2 +- 64 files changed, 115 insertions(+), 200 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDPlugins.h b/DetectorDescription/DDCMS/interface/DDPlugins.h index 225f31c4fdc3d..e871945ae4071 100644 --- a/DetectorDescription/DDCMS/interface/DDPlugins.h +++ b/DetectorDescription/DDCMS/interface/DDPlugins.h @@ -7,23 +7,20 @@ namespace dd4hep { - class SensitiveDetector; - template class DDCMSDetElementFactory : public dd4hep::PluginFactoryBase { public: static long create(dd4hep::Detector& detector, cms::DDParsingContext& context, - dd4hep::xml::Handle_t element, - dd4hep::SensitiveDetector& sensitive); + dd4hep::xml::Handle_t element); }; } // namespace dd4hep namespace { template class Factory; - DD4HEP_PLUGIN_FACTORY_ARGS_4(long, dd4hep::Detector*, cms::DDParsingContext*, ns::xml_h*, dd4hep::SensitiveDetector*) { - return dd4hep::DDCMSDetElementFactory

::create(*a0, *a1, *a2, *a3); + DD4HEP_PLUGIN_FACTORY_ARGS_3(long, dd4hep::Detector*, cms::DDParsingContext*, ns::xml_h*) { + return dd4hep::DDCMSDetElementFactory

::create(*a0, *a1, *a2); } } // namespace @@ -31,12 +28,12 @@ namespace { DD4HEP_OPEN_PLUGIN(dd4hep, ddcms_det_element_##name) { \ typedef DDCMSDetElementFactory _IMP; \ template <> \ - long _IMP::create(dd4hep::Detector& d, cms::DDParsingContext& c, xml::Handle_t e, dd4hep::SensitiveDetector& h) { \ - return func(d, c, e, h); \ + long _IMP::create(dd4hep::Detector& d, cms::DDParsingContext& c, xml::Handle_t e) { \ + return func(d, c, e); \ } \ DD4HEP_PLUGINSVC_FACTORY(ddcms_det_element_##name, \ name, \ - long(dd4hep::Detector*, cms::DDParsingContext*, ns::xml_h*, dd4hep::SensitiveDetector*), \ + long(dd4hep::Detector*, cms::DDParsingContext*, ns::xml_h*), \ __LINE__) \ } diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDAngular.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDAngular.cc index 7db87cc60cce4..75b51dfa7537d 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDAngular.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDAngular.cc @@ -20,7 +20,7 @@ namespace { } } // namespace -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 855c8116f0e3e..744cb954689c5 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -25,9 +25,9 @@ #include #include #include +#include +#include #include -#include "tbb/concurrent_unordered_map.h" -#include "tbb/concurrent_vector.h" using namespace std; using namespace dd4hep; @@ -50,8 +50,8 @@ namespace dd4hep { class DDLConstant; struct DDRegistry { - tbb::concurrent_vector includes; - tbb::concurrent_unordered_map unresolvedConst, allConst, originalConst; + std::vector includes; + std::unordered_map unresolvedConst, allConst, originalConst; }; class MaterialSection; @@ -101,8 +101,6 @@ namespace dd4hep { class PartSelector; class Parameter; - class vissection; - class vis; class debug; } // namespace @@ -133,13 +131,6 @@ namespace dd4hep { template <> void Converter::operator()(xml_h element) const; - /// Converter for tags - template <> - void Converter::operator()(xml_h element) const; - /// Convert compact visualization attributes - template <> - void Converter::operator()(xml_h element) const; - /// Converter for tags template <> void Converter::operator()(xml_h element) const; @@ -279,13 +270,6 @@ void Converter::operator()(xml_h element) const { xml_coll_t(element, DD_CMU(Vector)).for_each(Converter(description, context, optional)); } -/// Converter for tags -template <> -void Converter::operator()(xml_h element) const { - cms::DDNamespace ns(_param(), element); - xml_coll_t(element, DD_CMU(vis)).for_each(Converter(description, ns.context(), optional)); -} - /// Converter for tags template <> void Converter::operator()(xml_h element) const { @@ -347,7 +331,6 @@ template <> void Converter::operator()(xml_h element) const { cms::DDNamespace ns(_param(), element); for (xml_coll_t solid(element, _U(star)); solid; ++solid) { - string tag = solid.tag(); using cms::hash; switch (hash(solid.tag())) { case hash("Box"): @@ -411,7 +394,7 @@ void Converter::operator()(xml_h element) const { Converter(description, ns.context(), optional)(solid); break; default: - throw std::runtime_error("Request to process unknown shape '" + xml_dim_t(solid).nameStr() + "' [" + tag + "]"); + throw std::runtime_error("Request to process unknown shape '" + xml_dim_t(solid).nameStr() + "' [" + solid.tag() + "]"); break; } } @@ -468,59 +451,6 @@ void Converter::operator()(xml_h element) const { res->unresolvedConst[real] = val; } -/** Convert compact visualization attribute to Detector visualization attribute - * - * - */ -template <> -void Converter::operator()(xml_h e) const { - cms::DDNamespace ns(_param()); - VisAttr attr(e.attr(_U(name))); - float red = e.hasAttr(_U(r)) ? e.attr(_U(r)) : 1.0f; - float green = e.hasAttr(_U(g)) ? e.attr(_U(g)) : 1.0f; - float blue = e.hasAttr(_U(b)) ? e.attr(_U(b)) : 1.0f; - - printout(ns.context()->debug_visattr ? ALWAYS : DEBUG, - "Compact", - "++ Converting VisAttr structure: %-16s. R=%.3f G=%.3f B=%.3f", - attr.name(), - red, - green, - blue); - attr.setColor(red, green, blue); - if (e.hasAttr(_U(alpha))) - attr.setAlpha(e.attr(_U(alpha))); - if (e.hasAttr(_U(visible))) - attr.setVisible(e.attr(_U(visible))); - if (e.hasAttr(_U(lineStyle))) { - string ls = e.attr(_U(lineStyle)); - if (ls == "unbroken") - attr.setLineStyle(VisAttr::SOLID); - else if (ls == "broken") - attr.setLineStyle(VisAttr::DASHED); - } else { - attr.setLineStyle(VisAttr::SOLID); - } - if (e.hasAttr(_U(drawingStyle))) { - string ds = e.attr(_U(drawingStyle)); - if (ds == "wireframe") - attr.setDrawingStyle(VisAttr::WIREFRAME); - else if (ds == "solid") - attr.setDrawingStyle(VisAttr::SOLID); - } else { - attr.setDrawingStyle(VisAttr::SOLID); - } - if (e.hasAttr(_U(showDaughters))) - attr.setShowDaughters(e.attr(_U(showDaughters))); - else - attr.setShowDaughters(true); - description.addVisAttribute(attr); -} - /// Converter for tags template <> void Converter::operator()(xml_h element) const { @@ -577,7 +507,7 @@ void Converter::operator()(xml_h element) const { "+++ Compared to XML values: Atomic weight %g, Atomic number %u", atomicWeight, atomicNumber); - static const double weightTolerance = 1.0e-6; + static constexpr double const& weightTolerance = 1.0e-6; if (atomicNumber != elt->Z() || (std::abs(atomicWeight - elt->A()) > (weightTolerance * (atomicWeight + elt->A())))) newMatDef = true; @@ -981,7 +911,7 @@ void Converter::operator()(xml_h element) const { size_t idx = value.find('['); if (idx == string::npos || type == "string") { - registry.specpars[specParName].spars[name].emplace_back(value); + registry.specpars[specParName].spars[name].emplace_back(std::move(value)); return; } @@ -1657,17 +1587,14 @@ void Converter::operator()(xml_h element) const { } size_t idx; - SensitiveDetector sd; string type = "DDCMS_" + ns.realName(name); while ((idx = type.find(NAMESPACE_SEP)) != string::npos) type[idx] = '_'; - // SensitiveDetector and Segmentation currently are undefined. Let's keep it like this - // until we found something better..... printout( ns.context()->debug_algorithms ? ALWAYS : DEBUG, "DD4CMS", "+++ Start executing algorithm %s....", type.c_str()); - long ret = PluginService::Create(type, &description, ns.context(), &element, &sd); + long ret = PluginService::Create(type, &description, ns.context(), &element); if (ret == s_executed) { printout(ns.context()->debug_algorithms ? ALWAYS : DEBUG, "DD4CMS", @@ -1707,8 +1634,8 @@ namespace { return output; } - tbb::concurrent_vector splitNumeric(const string& str, const string& delims = ",") { - tbb::concurrent_vector output; + std::vector splitNumeric(const string& str, const string& delims = ",") { + std::vector output; for_each_token(cbegin(str), cend(str), cbegin(delims), cend(delims), [&output](auto first, auto second) { if (first != second) { @@ -1745,8 +1672,8 @@ void Converter::operator()(xml_h element) const { nEntries.c_str(), val.c_str()); try { - tbb::concurrent_vector results = splitNumeric(val); - registry->insert({name, results}); + std::vector results = splitNumeric(val); + registry->insert({name, tbb::concurrent_vector(results.begin(), results.end()) }); } catch (const exception& e) { printout(INFO, "DD4CMS", @@ -1830,7 +1757,7 @@ void Converter::operator()(xml_h /* element */) const { n.c_str(), res->originalConst[n].c_str()); ns.addConstantNS(n, v, "number"); - res->unresolvedConst.unsafe_erase(n); + res->unresolvedConst.erase(n); break; } } @@ -1888,7 +1815,6 @@ static long load_dddefinition(Detector& det, xml_h element) { print_doc((doc = dddef.document()).root()); xml_coll_t(dddef, DD_CMU(DisabledAlgo)).for_each(Converter(det, &context, &res)); xml_coll_t(dddef, DD_CMU(ConstantsSection)).for_each(Converter(det, &context, &res)); - xml_coll_t(dddef, DD_CMU(VisSection)).for_each(Converter(det, &context)); xml_coll_t(dddef, DD_CMU(RotationSection)).for_each(Converter(det, &context)); xml_coll_t(dddef, DD_CMU(MaterialSection)).for_each(Converter(det, &context)); @@ -1910,12 +1836,11 @@ static long load_dddefinition(Detector& det, xml_h element) { while (!context.unresolvedVectors.empty()) { for (auto it = context.unresolvedVectors.begin(); it != context.unresolvedVectors.end();) { - auto const& name = it->first; - tbb::concurrent_vector result; + std::vector result; for (const auto& i : it->second) { result.emplace_back(dd4hep::_toDouble(i)); } - registry->insert({name, result}); + registry->insert({it->first, tbb::concurrent_vector(begin(result), end(result))}); // All components are resolved it = context.unresolvedVectors.erase(it); } diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDLinear.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDLinear.cc index eabf048a44f30..2debec3d5b082 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDLinear.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDLinear.cc @@ -12,7 +12,7 @@ using namespace cms_units::operators; using DD3Vector = ROOT::Math::DisplacementVector3D >; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); diff --git a/DetectorDescription/DDCMS/plugins/test/DDTestVectorAlgo.cc b/DetectorDescription/DDCMS/plugins/test/DDTestVectorAlgo.cc index e067f2476a18a..181a0e979d550 100644 --- a/DetectorDescription/DDCMS/plugins/test/DDTestVectorAlgo.cc +++ b/DetectorDescription/DDCMS/plugins/test/DDTestVectorAlgo.cc @@ -6,7 +6,7 @@ using namespace std; using namespace dd4hep; using namespace cms; -static long algorithm(Detector&, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector&) { +static long algorithm(Detector&, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); vector materials = args.vecStr("MaterialNames"); diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index d7283887642a8..264a48660f871 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -166,8 +166,9 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { } for (const auto& i : specs) { for (const auto& j : i->paths) { + auto const& firstTok = front(j); auto const& filter = find_if(begin(filters_), end(filters_), [&](auto const& f) { - auto const& k = find_if(begin(f->skeys), end(f->skeys), [&](auto const& p) { return front(j) == p; }); + auto const& k = find_if(begin(f->skeys), end(f->skeys), [&](auto const& p) { return firstTok == p; }); if (k != end(f->skeys)) { currentFilter_ = f.get(); return true; @@ -176,8 +177,8 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { }); if (filter == end(filters_)) { filters_.emplace_back(unique_ptr( - new Filter{{front(j)}, - {std::regex(std::string("^").append({front(j).data(), front(j).size()}).append("$"))}, + new Filter{{firstTok}, + {std::regex(std::string("^").append({firstTok.data(), firstTok.size()}).append("$"))}, nullptr, nullptr, i})); @@ -715,7 +716,7 @@ const std::string_view DDFilteredView::front(const std::string_view path) const if (rpos == path.npos) { rpos = path.size(); } - return path.substr(lpos, rpos); + return path.substr(lpos, rpos - lpos); } // throw cms::Exception("Filtered View") << "Path must start with '//' " << path; diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index 4ac5cee6ffc08..8eb3638d05fc9 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -473,8 +473,8 @@ namespace { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + BenchmarkGrd counter("DDEcalBarrelNewAlgo"); cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc index 425010e1d387f..6b320b3f9d9d5 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc @@ -93,8 +93,8 @@ namespace { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + BenchmarkGrd counter("DDEcalEndcapAlgo"); cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalPreshowerAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalPreshowerAlgo.cc index e41f731a5a751..5a7c4e6df4fe8 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalPreshowerAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalPreshowerAlgo.cc @@ -81,8 +81,8 @@ namespace { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + BenchmarkGrd counter("DDEcalPreshowerAlgo"); cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/ForwardCommonData/plugins/dd4hep/DDBHMAngular.cc b/Geometry/ForwardCommonData/plugins/dd4hep/DDBHMAngular.cc index 8d4fb7f7de506..bb695aa62c8bd 100644 --- a/Geometry/ForwardCommonData/plugins/dd4hep/DDBHMAngular.cc +++ b/Geometry/ForwardCommonData/plugins/dd4hep/DDBHMAngular.cc @@ -9,8 +9,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); int units = args.value("number"); diff --git a/Geometry/ForwardCommonData/plugins/dd4hep/DDTotemAngular.cc b/Geometry/ForwardCommonData/plugins/dd4hep/DDTotemAngular.cc index 7f35b73ceeead..d396fc618952f 100644 --- a/Geometry/ForwardCommonData/plugins/dd4hep/DDTotemAngular.cc +++ b/Geometry/ForwardCommonData/plugins/dd4hep/DDTotemAngular.cc @@ -10,8 +10,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); double startAngle = args.value("startAngle"); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc index c11dc820da1b7..b45a0aebf3168 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc @@ -17,8 +17,8 @@ using namespace cms_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); static constexpr double tol = 0.00001; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc index 20cc843f21edb..dcb6886e75a19 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc @@ -7,8 +7,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section of original DDHGCalCell.h diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc index dbb60879e9b20..af28d5a0b3bde 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc @@ -407,8 +407,7 @@ struct HGCalEEAlgo { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { HGCalEEAlgo eealgo(ctxt, e); return cms::s_executed; } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc index 0ff7db7c2e0b6..04de9f145969d 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc @@ -398,8 +398,7 @@ struct HGCalEEFileAlgo { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { HGCalEEFileAlgo eealgo(ctxt, e); return cms::s_executed; } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc index d6b915f3febde..3328aecdcfeaf 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc @@ -580,8 +580,7 @@ struct HGCalHEAlgo { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { HGCalHEAlgo healgo(ctxt, e); return cms::s_executed; } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc index d980eb35dc6c8..dab2387f82d6b 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc @@ -596,8 +596,7 @@ struct HGCalHEFileAlgo { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { HGCalHEFileAlgo healgo(ctxt, e); return cms::s_executed; } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc index 9e8a377341d9b..1463d28b22c3e 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc @@ -23,8 +23,8 @@ using namespace cms_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); static constexpr double tol = 0.01; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc index 108acae00fd36..dc97a2960715b 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc @@ -23,8 +23,8 @@ using namespace cms_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); static constexpr double tol = 0.01; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc index 529813fdf0f7d..7430a7609c119 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc @@ -9,8 +9,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); std::string motherName = args.parentName(); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc index 98e98f3e75bdc..b61f7ac192419 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc @@ -16,8 +16,8 @@ using namespace cms_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); static constexpr double tol2 = 0.00001; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc index 93f825c2b4fc4..70dbf80b3381a 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc @@ -188,8 +188,8 @@ namespace DDHGCalGeom { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc index 13049f1e936fa..678f92a9ef6dd 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc @@ -10,8 +10,8 @@ using namespace cms_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); std::string nsName = static_cast(ns.name()); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc index d0cc8cf40e137..5f1ba67cd714e 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc @@ -15,8 +15,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); std::string motherName = args.parentName(); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc index f4c8d896afd4e..564eabc465ed2 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc @@ -9,8 +9,8 @@ using namespace cms_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc index 97443179649d6..9ffaac60db2f8 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc @@ -8,8 +8,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section of original DDHCalAngular.h diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalBarrelAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalBarrelAlgo.cc index 5d9f8fefbad7e..c0fc96a58fde9 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalBarrelAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalBarrelAlgo.cc @@ -979,8 +979,7 @@ struct HcalBarrelAlgo { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { HcalBarrelAlgo hcalbarrelalgo(ctxt, e); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalBarrelAlgo construction"; diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapAlgo.cc index 0a0a11fc346e2..103a08777f2bb 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapAlgo.cc @@ -979,8 +979,7 @@ struct HCalEndcapAlgo { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { HCalEndcapAlgo hcalendcapalgo(ctxt, e); return 1; } diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapModuleAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapModuleAlgo.cc index cea73008637db..75bc5acf82b55 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapModuleAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapModuleAlgo.cc @@ -584,8 +584,7 @@ struct HCalEndcapModuleAlgo { static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { HCalEndcapModuleAlgo hcalendcapalgo(ctxt, e); return 1; } diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalFibreBundle.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalFibreBundle.cc index bb2cd388c00e4..f7a78ce1e603f 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalFibreBundle.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalFibreBundle.cc @@ -9,8 +9,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalForwardAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalForwardAlgo.cc index a02e535053a8c..76baf9f638b57 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalForwardAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalForwardAlgo.cc @@ -9,8 +9,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc index 0bb408fda4e65..eee26d5d47791 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc @@ -8,8 +8,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section of original DDHCalLinearXY.h diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBCableAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBCableAlgo.cc index aad21b4c7b534..454ceb796fc56 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBCableAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBCableAlgo.cc @@ -9,8 +9,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBZposAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBZposAlgo.cc index 374afe04d0e45..719fe00eee102 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBZposAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBZposAlgo.cc @@ -8,8 +8,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTestBeamAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTestBeamAlgo.cc index b058cfcdb8cc7..e836a24313bcd 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTestBeamAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTestBeamAlgo.cc @@ -8,8 +8,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc index db567282d27bc..8e6e44d361294 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc @@ -8,8 +8,8 @@ using namespace geant_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/MTDCommonData/plugins/dd4hep/DDMTDLinear.cc b/Geometry/MTDCommonData/plugins/dd4hep/DDMTDLinear.cc index 6d55501b878b9..e8c5888ddccc1 100644 --- a/Geometry/MTDCommonData/plugins/dd4hep/DDMTDLinear.cc +++ b/Geometry/MTDCommonData/plugins/dd4hep/DDMTDLinear.cc @@ -13,7 +13,7 @@ using namespace cms_units::operators; using DD3Vector = ROOT::Math::DisplacementVector3D >; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); diff --git a/Geometry/MuonCommonData/plugins/dd4hep/DDGEMAngular.cc b/Geometry/MuonCommonData/plugins/dd4hep/DDGEMAngular.cc index 465f0aafc4ebd..9e560a89578bc 100644 --- a/Geometry/MuonCommonData/plugins/dd4hep/DDGEMAngular.cc +++ b/Geometry/MuonCommonData/plugins/dd4hep/DDGEMAngular.cc @@ -9,8 +9,8 @@ using namespace cms_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/MuonCommonData/plugins/dd4hep/DDMuonAngular.cc b/Geometry/MuonCommonData/plugins/dd4hep/DDMuonAngular.cc index a1e3445b1908b..982b4e58a13d5 100644 --- a/Geometry/MuonCommonData/plugins/dd4hep/DDMuonAngular.cc +++ b/Geometry/MuonCommonData/plugins/dd4hep/DDMuonAngular.cc @@ -7,8 +7,8 @@ using namespace cms_units::operators; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& context, - xml_h element, - dd4hep::SensitiveDetector& /* sens */) { + xml_h element) { + cms::DDNamespace ns(context, element, true); cms::DDAlgoArguments args(context, element); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc index 206c1a657d7af..b56d2e548c587 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc @@ -8,8 +8,8 @@ using namespace cms_units::operators; // _deg and convertRadToDeg static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerAlgo.cc index a7f6ce1dfeac5..033f1c6a203eb 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& description, cms::DDParsingContext& ctxt, xml_h e) { PlacedVolume pv; cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerUpgradeAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerUpgradeAlgo.cc index a78ccfa27df6c..d9defe1687447 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerUpgradeAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixBarLayerUpgradeAlgo.cc @@ -5,7 +5,7 @@ using namespace cms_units::operators; -static long algorithm(dd4hep::Detector&, cms::DDParsingContext& ctxt, xml_h e, dd4hep::SensitiveDetector&) { +static long algorithm(dd4hep::Detector&, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); std::string parentName = args.parentName(); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc index 5169e97ba16b0..be740452e901c 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc @@ -16,8 +16,8 @@ using namespace cms_units::operators; // _deg and convertRadToDeg static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc index c985cde705bcd..a75c2781ef13d 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc @@ -15,8 +15,8 @@ using namespace cms_units::operators; // _deg and convertRadToDeg static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, - xml_h e, - dd4hep::SensitiveDetector& /* sens */) { + xml_h e) { + cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECCoolAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECCoolAlgo.cc index 9df138f36be77..2c0e1b25ab434 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECCoolAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECCoolAlgo.cc @@ -11,7 +11,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); int startCopyNo = args.find("StartCopyNo") ? args.value("StartCopyNo") : 1; diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc index 6c11657f44a58..90bea5e91b823 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); Volume mother = ns.volume(args.parentName()); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECOptoHybAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECOptoHybAlgo.cc index f6a0675a8502b..dbb0849494589 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECOptoHybAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECOptoHybAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); int startCopyNo = args.value("StartCopyNo"); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAlgo.cc index f818467063c93..755a242d1960d 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); Volume mother = ns.volume(args.parentName()); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAltAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAltAlgo.cc index 05ee4ca1eca18..f917bfda3a6b1 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAltAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECPhiAltAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); Volume mother = ns.volume(args.parentName()); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc index d396043db2223..c6b04b9fce645 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc @@ -10,8 +10,8 @@ using namespace cms_units::operators; static long algorithm(Detector& /* description */, cms::DDParsingContext& context, - xml_h element, - SensitiveDetector& /* sens */) { + xml_h element) { + using VecDouble = vector; cms::DDNamespace ns(context, element, true); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDAxialCableAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDAxialCableAlgo.cc index 9ce9fe2c798ee..07fdc959f2695 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDAxialCableAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDAxialCableAlgo.cc @@ -16,7 +16,7 @@ using namespace cms; using namespace cms_units::operators; namespace { - long algorithm(dd4hep::Detector &description, cms::DDParsingContext &ctxt, xml_h e, SensitiveDetector & /* sens */) { + long algorithm(dd4hep::Detector &description, cms::DDParsingContext &ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModuleAlgo.cc index 780f98466b265..7c89675fac138 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModuleAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); string mother = args.parentName(); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModulePosAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModulePosAlgo.cc index f82c65e820b06..90930bfec9a77 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModulePosAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDModulePosAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); string parentName = args.parentName(); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDRingAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDRingAlgo.cc index a4f5acde25fee..88faaf5ac6668 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDRingAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIDRingAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); Volume mother = ns.volume(args.parentName()); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBAxCableAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBAxCableAlgo.cc index b206ee60b1471..c59c9f268e94e 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBAxCableAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBAxCableAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); vector sectorNumber = args.vecStr("SectorNumber"); // Id. Number of the sectors diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRadCableAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRadCableAlgo.cc index 9ef5449e9e33b..2fc9115960983 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRadCableAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRadCableAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); double diskDz = args.dble("DiskDz"); // Disk thickness diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRodAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRodAlgo.cc index 813351451a605..7fc4c111a3d57 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRodAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTOBRodAlgo.cc @@ -6,7 +6,7 @@ using namespace std; using namespace dd4hep; using namespace cms; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); string parentName = args.parentName(); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerAngular.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerAngular.cc index dec99b6f49d99..d1b7b9daceebc 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerAngular.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerAngular.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); // Header section of original DDTrackerAngular.h diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerLinear.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerLinear.cc index ae73dca82d271..98ee3d30f2838 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerLinear.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerLinear.cc @@ -6,7 +6,7 @@ using namespace std; using namespace dd4hep; using namespace cms; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); int startcn = args.find("StartCopyNo") ? args.value("StartCopyNo") : 1; diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAlgo.cc index 48b194e2a237d..02112cab990d4 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); Volume mother = ns.volume(args.parentName()); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAltAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAltAlgo.cc index dc7b1e790435a..df4961a5775d8 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAltAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerPhiAltAlgo.cc @@ -8,7 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); Volume mother = ns.volume(args.parentName()); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerRingAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerRingAlgo.cc index c276a1d04c1cd..3423bb31fd81d 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerRingAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerRingAlgo.cc @@ -9,7 +9,7 @@ using namespace cms; using namespace cms_units::operators; namespace { - long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { + long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); Volume mother = ns.volume(args.parentName()); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerXYZPosAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerXYZPosAlgo.cc index 26269b21a7703..3261a1b2afc25 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerXYZPosAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerXYZPosAlgo.cc @@ -6,7 +6,7 @@ using namespace std; using namespace dd4hep; using namespace cms; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); int startCopyNo = args.find("StartCopyNo") ? args.value("StartCopyNo") : 1; diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerZPosAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerZPosAlgo.cc index ca9131b6f18b5..5d3c8450d7060 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerZPosAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTrackerZPosAlgo.cc @@ -7,7 +7,7 @@ using namespace std; using namespace dd4hep; using namespace cms; -static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e, SensitiveDetector& /* sens */) { +static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); DDAlgoArguments args(ctxt, e); int startCopyNo = args.find("StartCopyNo") ? args.value("StartCopyNo") : 1; From 262cbd7c01167f82200c12b96fdbd7fb84876e7e Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Mon, 5 Oct 2020 11:46:43 +0200 Subject: [PATCH 222/778] Changed DDDCmsTrackerContruction with no member data and static functions to the use of a namespace ;p --- .../plugins/DDDCmsTrackerContruction.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h index 4081e7e1040ba..8013a57dd41b3 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h @@ -19,13 +19,10 @@ namespace cms { * then call subdet builders */ -class DDDCmsTrackerContruction { -public: - DDDCmsTrackerContruction() = delete; - ///takes ownership of detidShifts - static std::unique_ptr construct(DDCompactView const& cpv, std::vector const& detidShifts); - static std::unique_ptr construct(cms::DDCompactView const& cpv, std::vector const& detidShifts); - static void printAllTrackerGeometricDetsBeforeDetIDBuilding(const GeometricDet* tracker); -}; // NB: no point having a class in which evth is static, should just use namespace... +namespace DDDCmsTrackerContruction { + std::unique_ptr construct(DDCompactView const& cpv, std::vector const& detidShifts); + std::unique_ptr construct(cms::DDCompactView const& cpv, std::vector const& detidShifts); + void printAllTrackerGeometricDetsBeforeDetIDBuilding(const GeometricDet* tracker); +}; #endif From 3d1b51fc93eec99f5a1f5d214d64e0c4eecbca5c Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama Date: Mon, 5 Oct 2020 05:13:09 -0500 Subject: [PATCH 223/778] Cleanup --- Validation/RecoParticleFlow/plugins/PFClusterValidation.cc | 2 +- Validation/RecoParticleFlow/test/run_relval.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Validation/RecoParticleFlow/plugins/PFClusterValidation.cc b/Validation/RecoParticleFlow/plugins/PFClusterValidation.cc index 1755c4fdf4bd8..b41f06d350c44 100644 --- a/Validation/RecoParticleFlow/plugins/PFClusterValidation.cc +++ b/Validation/RecoParticleFlow/plugins/PFClusterValidation.cc @@ -15,7 +15,7 @@ PFClusterValidation::PFClusterValidation(const edm::ParameterSet& conf) { consumes(conf.getUntrackedParameter("pflowClusterHCAL")); pfClusterHOTok_ = consumes(conf.getUntrackedParameter("pflowClusterHO")); pfClusterHFTok_ = consumes( - conf.getUntrackedParameter("pflowClusterHF")); // cms.InputTag("particleFlowClusterECAL"); + conf.getUntrackedParameter("pflowClusterHF")); } PFClusterValidation::~PFClusterValidation() {} diff --git a/Validation/RecoParticleFlow/test/run_relval.sh b/Validation/RecoParticleFlow/test/run_relval.sh index 0b11ebab93be5..274a40a213e22 100755 --- a/Validation/RecoParticleFlow/test/run_relval.sh +++ b/Validation/RecoParticleFlow/test/run_relval.sh @@ -108,7 +108,7 @@ if [ $STEP == "RECO" ]; then FILENAME=`sed -n "${NJOB}p" $INPUT_FILELIST` echo "FILENAME="$FILENAME - cmsDriver.py step3 --conditions $CONDITIONS -s RAW2DIGI,L1Reco,RECO,RECOSIM,EI,PAT --datatier MINIAODSIM --nThreads $NTHREADS -n -1 --era $ERA --eventcontent MINIAODSIM --geometry=$GEOM --filein step2.root --fileout file:step3_inMINIAODSIM.root --no_exec --python_filename=step3.py + cmsDriver.py step3 --conditions $CONDITIONS -s RAW2DIGI,L1Reco,RECO,RECOSIM,PAT --datatier MINIAODSIM --nThreads $NTHREADS -n -1 --era $ERA --eventcontent MINIAODSIM --geometry=$GEOM --filein step2.root --fileout file:step3_inMINIAODSIM.root --no_exec --python_filename=step3.py else @@ -127,7 +127,7 @@ if [ $STEP == "RECO" ]; then echo "FILENAME="$FILENAME #Run the actual CMS reco with particle flow. echo "Running step RECO" - cmsDriver.py step3 --conditions $CONDITIONS -s RAW2DIGI,L1Reco,RECO,RECOSIM,EI,PAT --datatier MINIAODSIM --nThreads $NTHREADS -n -1 --era $ERA --eventcontent MINIAODSIM --geometry=$GEOM --filein $FILENAME --fileout file:step3_inMINIAODSIM.root | tee step3.log 2>&1 + cmsDriver.py step3 --conditions $CONDITIONS -s RAW2DIGI,L1Reco,RECO,RECOSIM,PAT --datatier MINIAODSIM --nThreads $NTHREADS -n -1 --era $ERA --eventcontent MINIAODSIM --geometry=$GEOM --filein $FILENAME --fileout file:step3_inMINIAODSIM.root | tee step3.log 2>&1 #NanoAOD #On lxplus, this step takes about 1 minute / 1000 events From 3990ecc976b578498addc9703db6f1394fdf7987 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Mon, 5 Oct 2020 12:37:49 +0200 Subject: [PATCH 224/778] code format --- .../DDCMS/interface/DDPlugins.h | 24 ++++++++----------- .../plugins/dd4hep/DDDefinitions2Objects.cc | 10 ++++---- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 5 +--- .../plugins/dd4hep/DDEcalEndcapAlgo.cc | 5 +--- .../plugins/dd4hep/DDEcalPreshowerAlgo.cc | 5 +--- .../plugins/dd4hep/DDBHMAngular.cc | 5 +--- .../plugins/dd4hep/DDTotemAngular.cc | 5 +--- .../plugins/dd4hep/DDAHcalModuleAlgo.cc | 5 +--- .../plugins/dd4hep/DDHGCalCell.cc | 4 +--- .../plugins/dd4hep/DDHGCalEEAlgo.cc | 4 +--- .../plugins/dd4hep/DDHGCalEEFileAlgo.cc | 4 +--- .../plugins/dd4hep/DDHGCalHEAlgo.cc | 4 +--- .../plugins/dd4hep/DDHGCalHEFileAlgo.cc | 4 +--- .../plugins/dd4hep/DDHGCalModule.cc | 5 +--- .../plugins/dd4hep/DDHGCalModuleAlgo.cc | 5 +--- .../plugins/dd4hep/DDHGCalNoTaperEndcap.cc | 5 +--- .../plugins/dd4hep/DDHGCalTBModule.cc | 5 +--- .../plugins/dd4hep/DDHGCalTBModuleX.cc | 5 +--- .../plugins/dd4hep/DDHGCalWafer.cc | 5 +--- .../plugins/dd4hep/DDHGCalWafer8.cc | 5 +--- .../plugins/dd4hep/DDHGCalWaferAlgo.cc | 5 +--- .../HcalAlgo/plugins/dd4hep/DDHCalAngular.cc | 5 +--- .../plugins/dd4hep/DDHCalBarrelAlgo.cc | 4 +--- .../plugins/dd4hep/DDHCalEndcapAlgo.cc | 4 +--- .../plugins/dd4hep/DDHCalEndcapModuleAlgo.cc | 4 +--- .../plugins/dd4hep/DDHCalFibreBundle.cc | 5 +--- .../plugins/dd4hep/DDHCalForwardAlgo.cc | 5 +--- .../HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc | 5 +--- .../plugins/dd4hep/DDHCalTBCableAlgo.cc | 5 +--- .../plugins/dd4hep/DDHCalTBZposAlgo.cc | 5 +--- .../plugins/dd4hep/DDHCalTestBeamAlgo.cc | 5 +--- .../HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc | 5 +--- .../plugins/dd4hep/DDGEMAngular.cc | 5 +--- .../plugins/dd4hep/DDMuonAngular.cc | 5 +--- .../plugins/dd4hep/DDCutTubsFromPoints.cc | 5 +--- .../plugins/dd4hep/DDPixFwdDiskAlgo.cc | 5 +--- .../plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc | 5 +--- .../plugins/dd4hep/DDTIBLayerAlgo.cc | 5 +--- 38 files changed, 52 insertions(+), 154 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDPlugins.h b/DetectorDescription/DDCMS/interface/DDPlugins.h index e871945ae4071..69bccd35fc8b5 100644 --- a/DetectorDescription/DDCMS/interface/DDPlugins.h +++ b/DetectorDescription/DDCMS/interface/DDPlugins.h @@ -10,9 +10,7 @@ namespace dd4hep { template class DDCMSDetElementFactory : public dd4hep::PluginFactoryBase { public: - static long create(dd4hep::Detector& detector, - cms::DDParsingContext& context, - dd4hep::xml::Handle_t element); + static long create(dd4hep::Detector& detector, cms::DDParsingContext& context, dd4hep::xml::Handle_t element); }; } // namespace dd4hep @@ -24,17 +22,15 @@ namespace { } } // namespace -#define DECLARE_DDCMS_DETELEMENT(name, func) \ - DD4HEP_OPEN_PLUGIN(dd4hep, ddcms_det_element_##name) { \ - typedef DDCMSDetElementFactory _IMP; \ - template <> \ - long _IMP::create(dd4hep::Detector& d, cms::DDParsingContext& c, xml::Handle_t e) { \ - return func(d, c, e); \ - } \ - DD4HEP_PLUGINSVC_FACTORY(ddcms_det_element_##name, \ - name, \ - long(dd4hep::Detector*, cms::DDParsingContext*, ns::xml_h*), \ - __LINE__) \ +#define DECLARE_DDCMS_DETELEMENT(name, func) \ + DD4HEP_OPEN_PLUGIN(dd4hep, ddcms_det_element_##name) { \ + typedef DDCMSDetElementFactory _IMP; \ + template <> \ + long _IMP::create(dd4hep::Detector& d, cms::DDParsingContext& c, xml::Handle_t e) { \ + return func(d, c, e); \ + } \ + DD4HEP_PLUGINSVC_FACTORY( \ + ddcms_det_element_##name, name, long(dd4hep::Detector*, cms::DDParsingContext*, ns::xml_h*), __LINE__) \ } #endif diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 744cb954689c5..66a6d4391176e 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -28,6 +28,7 @@ #include #include #include +#include using namespace std; using namespace dd4hep; @@ -394,7 +395,8 @@ void Converter::operator()(xml_h element) const { Converter(description, ns.context(), optional)(solid); break; default: - throw std::runtime_error("Request to process unknown shape '" + xml_dim_t(solid).nameStr() + "' [" + solid.tag() + "]"); + throw std::runtime_error("Request to process unknown shape '" + xml_dim_t(solid).nameStr() + "' [" + + solid.tag() + "]"); break; } } @@ -1673,7 +1675,7 @@ void Converter::operator()(xml_h element) const { val.c_str()); try { std::vector results = splitNumeric(val); - registry->insert({name, tbb::concurrent_vector(results.begin(), results.end()) }); + registry->insert({name, tbb::concurrent_vector>(results.begin(), results.end())}); } catch (const exception& e) { printout(INFO, "DD4CMS", @@ -1836,11 +1838,11 @@ static long load_dddefinition(Detector& det, xml_h element) { while (!context.unresolvedVectors.empty()) { for (auto it = context.unresolvedVectors.begin(); it != context.unresolvedVectors.end();) { - std::vector result; + std::vector result; for (const auto& i : it->second) { result.emplace_back(dd4hep::_toDouble(i)); } - registry->insert({it->first, tbb::concurrent_vector(begin(result), end(result))}); + registry->insert({it->first, tbb::concurrent_vector>(begin(result), end(result))}); // All components are resolved it = context.unresolvedVectors.erase(it); } diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index 8eb3638d05fc9..0f7049bdfa500 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -471,10 +471,7 @@ namespace { } } // namespace -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { BenchmarkGrd counter("DDEcalBarrelNewAlgo"); cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc index 6b320b3f9d9d5..5bd7f36b4dcd5 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc @@ -91,10 +91,7 @@ namespace { } } // namespace -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { BenchmarkGrd counter("DDEcalEndcapAlgo"); cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalPreshowerAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalPreshowerAlgo.cc index 5a7c4e6df4fe8..f3ae51194ca83 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalPreshowerAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalPreshowerAlgo.cc @@ -79,10 +79,7 @@ namespace { }; } // namespace -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { BenchmarkGrd counter("DDEcalPreshowerAlgo"); cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/ForwardCommonData/plugins/dd4hep/DDBHMAngular.cc b/Geometry/ForwardCommonData/plugins/dd4hep/DDBHMAngular.cc index bb695aa62c8bd..ccc1576a64f70 100644 --- a/Geometry/ForwardCommonData/plugins/dd4hep/DDBHMAngular.cc +++ b/Geometry/ForwardCommonData/plugins/dd4hep/DDBHMAngular.cc @@ -7,10 +7,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); int units = args.value("number"); diff --git a/Geometry/ForwardCommonData/plugins/dd4hep/DDTotemAngular.cc b/Geometry/ForwardCommonData/plugins/dd4hep/DDTotemAngular.cc index d396fc618952f..ded85160369ff 100644 --- a/Geometry/ForwardCommonData/plugins/dd4hep/DDTotemAngular.cc +++ b/Geometry/ForwardCommonData/plugins/dd4hep/DDTotemAngular.cc @@ -8,10 +8,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); double startAngle = args.value("startAngle"); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc index b45a0aebf3168..3208df17fc5a5 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc @@ -15,10 +15,7 @@ //#define EDM_ML_DEBUG using namespace cms_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); static constexpr double tol = 0.00001; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc index dcb6886e75a19..c1a5614677b84 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc @@ -5,9 +5,7 @@ //#define EDM_ML_DEBUG -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section of original DDHGCalCell.h diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc index af28d5a0b3bde..b30553e2155be 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc @@ -405,9 +405,7 @@ struct HGCalEEAlgo { } }; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { HGCalEEAlgo eealgo(ctxt, e); return cms::s_executed; } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc index 04de9f145969d..64888112e560f 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc @@ -396,9 +396,7 @@ struct HGCalEEFileAlgo { double alpha_, cosAlpha_; }; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { HGCalEEFileAlgo eealgo(ctxt, e); return cms::s_executed; } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc index 3328aecdcfeaf..4849a6704f296 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc @@ -578,9 +578,7 @@ struct HGCalHEAlgo { static constexpr double tol2_ = 0.00001; }; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { HGCalHEAlgo healgo(ctxt, e); return cms::s_executed; } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc index dab2387f82d6b..594b30efeb327 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc @@ -594,9 +594,7 @@ struct HGCalHEFileAlgo { double alpha_, cosAlpha_; }; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { HGCalHEFileAlgo healgo(ctxt, e); return cms::s_executed; } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc index 1463d28b22c3e..449baac840b4c 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc @@ -21,10 +21,7 @@ #endif using namespace cms_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); static constexpr double tol = 0.01; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc index dc97a2960715b..b2980da6bf079 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc @@ -21,10 +21,7 @@ #endif using namespace cms_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); static constexpr double tol = 0.01; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc index 7430a7609c119..57099c0259021 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc @@ -7,10 +7,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); std::string motherName = args.parentName(); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc index b61f7ac192419..e01e8f1b2bcaf 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc @@ -14,10 +14,7 @@ #endif using namespace cms_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); static constexpr double tol2 = 0.00001; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc index 70dbf80b3381a..972ff1fa32226 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc @@ -186,10 +186,7 @@ namespace DDHGCalGeom { } } // namespace DDHGCalGeom -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc index 678f92a9ef6dd..7dcfad3476c4f 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc @@ -8,10 +8,7 @@ using namespace cms_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); std::string nsName = static_cast(ns.name()); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc index 5f1ba67cd714e..3a23e65f4ec78 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc @@ -13,10 +13,7 @@ //#define EDM_ML_DEBUG -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); std::string motherName = args.parentName(); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc index 564eabc465ed2..0f3cb2dea5878 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc @@ -7,10 +7,7 @@ //#define EDM_ML_DEBUG using namespace cms_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc index 9ffaac60db2f8..bb266496e8dea 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalAngular.cc @@ -6,10 +6,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section of original DDHCalAngular.h diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalBarrelAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalBarrelAlgo.cc index c0fc96a58fde9..9afc136332798 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalBarrelAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalBarrelAlgo.cc @@ -977,9 +977,7 @@ struct HcalBarrelAlgo { } }; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { HcalBarrelAlgo hcalbarrelalgo(ctxt, e); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HCalGeom") << "<<== End of DDHCalBarrelAlgo construction"; diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapAlgo.cc index 103a08777f2bb..407d20b53488a 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapAlgo.cc @@ -977,9 +977,7 @@ struct HCalEndcapAlgo { } }; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { HCalEndcapAlgo hcalendcapalgo(ctxt, e); return 1; } diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapModuleAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapModuleAlgo.cc index 75bc5acf82b55..e48cf32fc9dc0 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapModuleAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalEndcapModuleAlgo.cc @@ -582,9 +582,7 @@ struct HCalEndcapModuleAlgo { } }; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { HCalEndcapModuleAlgo hcalendcapalgo(ctxt, e); return 1; } diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalFibreBundle.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalFibreBundle.cc index f7a78ce1e603f..c1a70b62f8d33 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalFibreBundle.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalFibreBundle.cc @@ -7,10 +7,7 @@ using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalForwardAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalForwardAlgo.cc index 76baf9f638b57..4f3feadc55e97 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalForwardAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalForwardAlgo.cc @@ -7,10 +7,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc index eee26d5d47791..a81346e56495e 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalLinearXY.cc @@ -6,10 +6,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section of original DDHCalLinearXY.h diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBCableAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBCableAlgo.cc index 454ceb796fc56..29b7d09efcfb9 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBCableAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBCableAlgo.cc @@ -7,10 +7,7 @@ using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBZposAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBZposAlgo.cc index 719fe00eee102..7cf68f17a867f 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBZposAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTBZposAlgo.cc @@ -6,10 +6,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTestBeamAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTestBeamAlgo.cc index e836a24313bcd..de63d970585db 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTestBeamAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalTestBeamAlgo.cc @@ -6,10 +6,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc index 8e6e44d361294..808feeb1b9b2a 100644 --- a/Geometry/HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc +++ b/Geometry/HcalAlgo/plugins/dd4hep/DDHCalXtalAlgo.cc @@ -6,10 +6,7 @@ //#define EDM_ML_DEBUG using namespace geant_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); // Header section diff --git a/Geometry/MuonCommonData/plugins/dd4hep/DDGEMAngular.cc b/Geometry/MuonCommonData/plugins/dd4hep/DDGEMAngular.cc index 9e560a89578bc..bd0f142e908c2 100644 --- a/Geometry/MuonCommonData/plugins/dd4hep/DDGEMAngular.cc +++ b/Geometry/MuonCommonData/plugins/dd4hep/DDGEMAngular.cc @@ -7,10 +7,7 @@ using namespace cms_units::operators; //#define EDM_ML_DEBUG -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/MuonCommonData/plugins/dd4hep/DDMuonAngular.cc b/Geometry/MuonCommonData/plugins/dd4hep/DDMuonAngular.cc index 982b4e58a13d5..bce404d155062 100644 --- a/Geometry/MuonCommonData/plugins/dd4hep/DDMuonAngular.cc +++ b/Geometry/MuonCommonData/plugins/dd4hep/DDMuonAngular.cc @@ -5,10 +5,7 @@ using namespace cms_units::operators; -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& context, - xml_h element) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& context, xml_h element) { cms::DDNamespace ns(context, element, true); cms::DDAlgoArguments args(context, element); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc index b56d2e548c587..9d80c78f67402 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDCutTubsFromPoints.cc @@ -6,10 +6,7 @@ using namespace cms_units::operators; // _deg and convertRadToDeg -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc index be740452e901c..cc62ea472ea8e 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixFwdDiskAlgo.cc @@ -14,10 +14,7 @@ using namespace cms_units::operators; // _deg and convertRadToDeg -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc index a75c2781ef13d..486e550951737 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDPixPhase1FwdDiskAlgo.cc @@ -13,10 +13,7 @@ using namespace cms_units::operators; // _deg and convertRadToDeg -static long algorithm(dd4hep::Detector& /* description */, - cms::DDParsingContext& ctxt, - xml_h e) { - +static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { cms::DDNamespace ns(ctxt, e, true); cms::DDAlgoArguments args(ctxt, e); diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc index c6b04b9fce645..c181199d645e6 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc @@ -8,10 +8,7 @@ using namespace dd4hep; using namespace cms; using namespace cms_units::operators; -static long algorithm(Detector& /* description */, - cms::DDParsingContext& context, - xml_h element) { - +static long algorithm(Detector& /* description */, cms::DDParsingContext& context, xml_h element) { using VecDouble = vector; cms::DDNamespace ns(context, element, true); From 967790b397da65b93e1c8d06fb5c5bd42021c585 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 5 Oct 2020 12:41:36 +0200 Subject: [PATCH 225/778] added parameters --- SimG4Core/Application/python/g4SimHits_cfi.py | 12 +++-- .../Application/src/RunManagerMTWorker.cc | 2 +- .../MagneticField/interface/CMSFieldManager.h | 13 ++++-- .../MagneticField/src/CMSFieldManager.cc | 44 +++++++++++++++++-- 4 files changed, 59 insertions(+), 12 deletions(-) diff --git a/SimG4Core/Application/python/g4SimHits_cfi.py b/SimG4Core/Application/python/g4SimHits_cfi.py index a196110598721..e0273e1964809 100644 --- a/SimG4Core/Application/python/g4SimHits_cfi.py +++ b/SimG4Core/Application/python/g4SimHits_cfi.py @@ -100,16 +100,20 @@ StepperParam = cms.PSet( VacRegions = cms.vstring(), # VacRegions = cms.vstring('DefaultRegionForTheWorld','BeamPipeVacuum','BeamPipeOutside'), - MaximumEpsilonStep = cms.untracked.double(0.01), ## in mm + EnergyThTracker = cms.double(10000), ## in GeV + RmaxTracker = cms.double(1233), ## in mm + ZmaxTracker = cms.double(2932), ## in mm + MaximumEpsilonStep = cms.untracked.double(0.01), DeltaOneStep = cms.double(0.001), ## in mm MaximumLoopCounts = cms.untracked.double(1000.0), DeltaChord = cms.double(0.001), ## in mm MinStep = cms.double(0.1), ## in mm DeltaIntersectionAndOneStep = cms.untracked.double(-1.0), - DeltaIntersection = cms.double(0.0001),## in mm + DeltaIntersection = cms.double(0.0001), ## in mm + DeltaIntersectionTracker = cms.double(1e-6),## in mm MaxStep = cms.double(150.), ## in cm - MinimumEpsilonStep = cms.untracked.double(1e-05), ## in mm - EnergyThSimple = cms.double(0.015), ## in GeV + MinimumEpsilonStep = cms.untracked.double(1e-05), + EnergyThSimple = cms.double(0.015), ## in GeV DeltaChordSimple = cms.double(0.1), ## in mm DeltaOneStepSimple = cms.double(0.1), ## in mm DeltaIntersectionSimple = cms.double(0.01), ## in mm diff --git a/SimG4Core/Application/src/RunManagerMTWorker.cc b/SimG4Core/Application/src/RunManagerMTWorker.cc index e1655796b1777..bd228e42ab983 100644 --- a/SimG4Core/Application/src/RunManagerMTWorker.cc +++ b/SimG4Core/Application/src/RunManagerMTWorker.cc @@ -477,7 +477,7 @@ std::unique_ptr RunManagerMTWorker::produce(const edm::Event& inpevt if (!(m_tls && m_tls->threadInitialized)) { edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::produce(): stream " << inpevt.streamID() << " thread " << getThreadIndex() - << " initializing in the produce(..) method - there is a problem"; + << " Geant4 initialisation for this thread"; initializeG4(&runManagerMaster, es); m_tls->threadInitialized = true; } diff --git a/SimG4Core/MagneticField/interface/CMSFieldManager.h b/SimG4Core/MagneticField/interface/CMSFieldManager.h index d8d11c3af39d3..92693225a9e70 100644 --- a/SimG4Core/MagneticField/interface/CMSFieldManager.h +++ b/SimG4Core/MagneticField/interface/CMSFieldManager.h @@ -41,14 +41,16 @@ class CMSFieldManager : public G4FieldManager { void SetMonopoleTracking(G4bool); + CMSFieldManager(const CMSFieldManager &) = delete; + CMSFieldManager &operator=(const CMSFieldManager &) = delete; + private: bool isInsideVacuum(const G4Track *); + bool isInsideTracker(const G4Track *); void setDefaultChordFinder(); + void setChordFinderForTracker(); void setChordFinderForVacuum(); - CMSFieldManager(const CMSFieldManager &) = delete; - CMSFieldManager &operator=(const CMSFieldManager &) = delete; - std::unique_ptr theField; G4ChordFinder *m_currChordFinder; @@ -62,13 +64,18 @@ class CMSFieldManager : public G4FieldManager { double m_dChord; double m_dOneStep; double m_dIntersection; + double m_dInterTracker; + double m_Rmax2; + double m_Zmax; double m_stepMax; + double m_energyThTracker; double m_energyThreshold; double m_dChordSimple; double m_dOneStepSimple; double m_dIntersectionSimple; double m_stepMaxSimple; + bool m_cfTracker; bool m_cfVacuum; }; #endif diff --git a/SimG4Core/MagneticField/src/CMSFieldManager.cc b/SimG4Core/MagneticField/src/CMSFieldManager.cc index 9895e2d236bdc..b739767aed0c4 100644 --- a/SimG4Core/MagneticField/src/CMSFieldManager.cc +++ b/SimG4Core/MagneticField/src/CMSFieldManager.cc @@ -19,12 +19,17 @@ CMSFieldManager::CMSFieldManager() m_dChord(0.001), m_dOneStep(0.001), m_dIntersection(0.0001), + m_dInterTracker(1e-6), + m_Rmax2(1.e+6), + m_Zmax(3.e+3), m_stepMax(1000000.), + m_energyThTracker(1.e+7), m_energyThreshold(0.0), m_dChordSimple(0.1), m_dOneStepSimple(0.1), m_dIntersectionSimple(0.01), m_stepMaxSimple(1000.), + m_cfTracker(false), m_cfVacuum(false) {} CMSFieldManager::~CMSFieldManager() { @@ -54,11 +59,16 @@ void CMSFieldManager::InitialiseForVolume(const edm::ParameterSet &p, m_dChord = p.getParameter("DeltaChord") * CLHEP::mm; m_dOneStep = p.getParameter("DeltaOneStep") * CLHEP::mm; m_dIntersection = p.getParameter("DeltaIntersection") * CLHEP::mm; + m_dInterTracker = p.getParameter("DeltaIntersectionTracker") * CLHEP::mm; m_stepMax = p.getParameter("MaxStep") * CLHEP::cm; m_energyThreshold = p.getParameter("EnergyThSimple") * CLHEP::GeV; + m_energyThTracker = p.getParameter("EnergyThTracker") * CLHEP::GeV; + + double rmax = p.getParameter("RmaxTracker") * CLHEP::mm; + m_Rmax2 = rmax*rmax; + m_Zmax = p.getParameter("ZmaxTracker") * CLHEP::mm; - // double m_dChordSimple = p.getParameter("DeltaChordSimple") * CLHEP::mm; m_dOneStepSimple = p.getParameter("DeltaOneStepSimple") * CLHEP::mm; m_dIntersectionSimple = p.getParameter("DeltaIntersectionSimple") * CLHEP::mm; @@ -77,7 +87,9 @@ void CMSFieldManager::InitialiseForVolume(const edm::ParameterSet &p, << " DeltaChord " << m_dChord << " mm\n" << " DeltaOneStep " << m_dOneStep << " mm\n" << " DeltaIntersection " << m_dIntersection << " mm\n" - << " EnergyThreshold " << m_energyThreshold << " MeV\n" + << " DeltaInterTracker " << m_dInterTracker << " mm\n" + << " EnergyThresholdSimple " << m_energyThreshold / CLHEP::MeV << " MeV\n" + << " EnergyThresholdTracker " << m_energyThTracker / CLHEP::MeV << " MeV\n" << " DeltaChordSimple " << m_dChordSimple << " mm\n" << " DeltaOneStepSimple " << m_dOneStepSimple << " mm\n" << " DeltaIntersectionSimple " << m_dIntersectionSimple << " mm\n" @@ -124,12 +136,17 @@ void CMSFieldManager::InitialiseForVolume(const edm::ParameterSet &p, void CMSFieldManager::ConfigureForTrack(const G4Track *track) { // run time parameters per track - if ((track->GetKineticEnergy() <= m_energyThreshold && track->GetParentID() > 0) || isInsideVacuum(track)) { + if ((track->GetKineticEnergy() > m_energyThTracker) && isInsideTracker(track)) { + if (!m_cfTracker) { + setChordFinderForTracker(); + } + + } else if ((track->GetKineticEnergy() <= m_energyThreshold) || isInsideVacuum(track)) { if (!m_cfVacuum) { setChordFinderForVacuum(); } - } else if (m_cfVacuum) { + } else if (m_cfTracker || m_cfVacuum) { // restore defaults setDefaultChordFinder(); } @@ -163,6 +180,13 @@ bool CMSFieldManager::isInsideVacuum(const G4Track *track) { return false; } +bool CMSFieldManager::isInsideTracker(const G4Track *track) { + const G4ThreeVector& pos = track->GetPosition(); + const double x = pos.x(); + const double y = pos.y(); + return (x*x + y*y < m_Rmax2 && std::abs(pos.z()) < m_Zmax); +} + void CMSFieldManager::setDefaultChordFinder() { m_currChordFinder = m_chordFinder; m_currChordFinder->SetDeltaChord(m_dChord); @@ -170,7 +194,18 @@ void CMSFieldManager::setDefaultChordFinder() { SetDeltaOneStep(m_dOneStep); SetDeltaIntersection(m_dIntersection); m_propagator->SetLargestAcceptableStep(m_stepMax); + m_cfVacuum = m_cfTracker = false; +} + +void CMSFieldManager::setChordFinderForTracker() { + m_currChordFinder = m_chordFinder; + m_currChordFinder->SetDeltaChord(m_dChord); + SetChordFinder(m_currChordFinder); + SetDeltaOneStep(m_dOneStep); + SetDeltaIntersection(m_dInterTracker); + m_propagator->SetLargestAcceptableStep(m_stepMax); m_cfVacuum = false; + m_cfTracker = true; } void CMSFieldManager::setChordFinderForVacuum() { @@ -179,4 +214,5 @@ void CMSFieldManager::setChordFinderForVacuum() { SetDeltaIntersection(m_dIntersectionSimple); m_propagator->SetLargestAcceptableStep(m_stepMaxSimple); m_cfVacuum = true; + m_cfTracker = false; } From dc1c9278aad001414072e236d76c55760ccd5c82 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Mon, 5 Oct 2020 12:52:07 +0200 Subject: [PATCH 226/778] code-format --- SimG4Core/MagneticField/src/CMSFieldManager.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SimG4Core/MagneticField/src/CMSFieldManager.cc b/SimG4Core/MagneticField/src/CMSFieldManager.cc index b739767aed0c4..fec1f322ed765 100644 --- a/SimG4Core/MagneticField/src/CMSFieldManager.cc +++ b/SimG4Core/MagneticField/src/CMSFieldManager.cc @@ -66,8 +66,8 @@ void CMSFieldManager::InitialiseForVolume(const edm::ParameterSet &p, m_energyThTracker = p.getParameter("EnergyThTracker") * CLHEP::GeV; double rmax = p.getParameter("RmaxTracker") * CLHEP::mm; - m_Rmax2 = rmax*rmax; - m_Zmax = p.getParameter("ZmaxTracker") * CLHEP::mm; + m_Rmax2 = rmax * rmax; + m_Zmax = p.getParameter("ZmaxTracker") * CLHEP::mm; m_dChordSimple = p.getParameter("DeltaChordSimple") * CLHEP::mm; m_dOneStepSimple = p.getParameter("DeltaOneStepSimple") * CLHEP::mm; @@ -181,10 +181,10 @@ bool CMSFieldManager::isInsideVacuum(const G4Track *track) { } bool CMSFieldManager::isInsideTracker(const G4Track *track) { - const G4ThreeVector& pos = track->GetPosition(); + const G4ThreeVector &pos = track->GetPosition(); const double x = pos.x(); const double y = pos.y(); - return (x*x + y*y < m_Rmax2 && std::abs(pos.z()) < m_Zmax); + return (x * x + y * y < m_Rmax2 && std::abs(pos.z()) < m_Zmax); } void CMSFieldManager::setDefaultChordFinder() { From 97a6e6768eb87c4d0dcabee616eb1f9d1d100968 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Mon, 5 Oct 2020 13:02:56 +0200 Subject: [PATCH 227/778] code format --- .../DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 66a6d4391176e..68ef1ca3f00f1 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -1675,7 +1675,8 @@ void Converter::operator()(xml_h element) const { val.c_str()); try { std::vector results = splitNumeric(val); - registry->insert({name, tbb::concurrent_vector>(results.begin(), results.end())}); + registry->insert( + {name, tbb::concurrent_vector>(results.begin(), results.end())}); } catch (const exception& e) { printout(INFO, "DD4CMS", @@ -1842,7 +1843,9 @@ static long load_dddefinition(Detector& det, xml_h element) { for (const auto& i : it->second) { result.emplace_back(dd4hep::_toDouble(i)); } - registry->insert({it->first, tbb::concurrent_vector>(begin(result), end(result))}); + registry->insert( + {it->first, + tbb::concurrent_vector>(begin(result), end(result))}); // All components are resolved it = context.unresolvedVectors.erase(it); } From 4419b08d662c1f676680e67f92b0f314da2952ec Mon Sep 17 00:00:00 2001 From: Sebastien Wertz Date: Thu, 17 Sep 2020 15:27:24 +0200 Subject: [PATCH 228/778] nanoAOD: fix electron IP sign use gsf track for electrons remove leftover line in LeptonUpdater use best track by default --- PhysicsTools/NanoAOD/python/electrons_cff.py | 62 ++++++++----------- PhysicsTools/NanoAOD/python/nano_cff.py | 8 +-- .../PatAlgos/plugins/LeptonUpdater.cc | 10 ++- 3 files changed, 35 insertions(+), 45 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 2f79b5d6a1699..7e6fc91411bb7 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -32,6 +32,7 @@ src = cms.InputTag("slimmedElectronsTo106X"), vertices = cms.InputTag("offlineSlimmedPrimaryVertices"), computeMiniIso = cms.bool(False), + fixDxySign = cms.bool(True), pfCandsForMiniIso = cms.InputTag("packedPFCandidates"), miniIsoParamsB = PhysicsTools.PatAlgos.producersLayer1.electronProducer_cfi.patElectrons.miniIsoParamsB, # so they're in sync miniIsoParamsE = PhysicsTools.PatAlgos.producersLayer1.electronProducer_cfi.patElectrons.miniIsoParamsE, # so they're in sync @@ -124,17 +125,12 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): _bitmapVIDForEleHEEP_docstring = _get_bitmapVIDForEle_docstring(electron_id_modules_WorkingPoints_nanoAOD.modules,bitmapVIDForEleHEEP.WorkingPoints) -for modifier in run2_miniAOD_80XLegacy, : +for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: modifier.toModify(bitmapVIDForEle, src = "slimmedElectronsUpdated") modifier.toModify(bitmapVIDForEleSpring15, src = "slimmedElectronsUpdated") modifier.toModify(bitmapVIDForEleSum16, src = "slimmedElectronsUpdated") modifier.toModify(bitmapVIDForEleHEEP, src = "slimmedElectronsUpdated") -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: - modifier.toModify(bitmapVIDForEle, src = "slimmedElectronsTo106X") - modifier.toModify(bitmapVIDForEleSpring15, src = "slimmedElectronsTo106X") - modifier.toModify(bitmapVIDForEleSum16, src = "slimmedElectronsTo106X") - modifier.toModify(bitmapVIDForEleHEEP, src = "slimmedElectronsTo106X") - + isoForEle = cms.EDProducer("EleIsoValueMapProducer", src = cms.InputTag("slimmedElectrons"), @@ -150,22 +146,20 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): run2_nanoAOD_94X2016.toModify(isoForEle, EAFile_MiniIso = "RecoEgamma/ElectronIdentification/data/Spring15/effAreaElectrons_cone03_pfNeuHadronsAndPhotons_25ns.txt", EAFile_PFIso = "RecoEgamma/ElectronIdentification/data/Summer16/effAreaElectrons_cone03_pfNeuHadronsAndPhotons_80X.txt") -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: - modifier.toModify(isoForEle, src = "slimmedElectronsTo106X") +for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: + modifier.toModify(isoForEle, src = "slimmedElectronsUpdated") ptRatioRelForEle = cms.EDProducer("ElectronJetVarProducer", srcJet = cms.InputTag("updatedJets"), srcLep = cms.InputTag("slimmedElectrons"), srcVtx = cms.InputTag("offlineSlimmedPrimaryVertices"), ) -run2_miniAOD_80XLegacy.toModify(ptRatioRelForEle, srcLep = "slimmedElectronsUpdated") -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: - modifier.toModify(ptRatioRelForEle, srcLep = "slimmedElectronsTo106X") +for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: + modifier.toModify(ptRatioRelForEle, srcLep = "slimmedElectronsUpdated") seedGainEle = cms.EDProducer("ElectronSeedGainProducer", src = cms.InputTag("slimmedElectrons")) -run2_miniAOD_80XLegacy.toModify(seedGainEle, src = "slimmedElectronsUpdated") -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: - modifier.toModify(seedGainEle, src = "slimmedElectronsTo106X") +for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: + modifier.toModify(seedGainEle, src = "slimmedElectronsUpdated") import RecoEgamma.EgammaTools.calibratedEgammas_cff @@ -180,13 +174,13 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2017_17Nov2017_v1_ele_unc"), ) for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016: - modifier.toModify(calibratedPatElectrons94X, src = "slimmedElectronsTo106X") + modifier.toModify(calibratedPatElectrons94X, src = "slimmedElectronsUpdated") calibratedPatElectrons102X = RecoEgamma.EgammaTools.calibratedEgammas_cff.calibratedPatElectrons.clone( produceCalibratedObjs = False, correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_Step2Closure_CoarseEtaR9Gain_v2"), ) -run2_nanoAOD_102Xv1.toModify(calibratedPatElectrons102X, src = "slimmedElectronsTo106X") +run2_nanoAOD_102Xv1.toModify(calibratedPatElectrons102X, src = "slimmedElectronsUpdated") slimmedElectronsWithUserData = cms.EDProducer("PATElectronUserDataEmbedder", src = cms.InputTag("slimmedElectrons"), @@ -239,9 +233,8 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): jetForLepJetVar = cms.InputTag("ptRatioRelForEle:jetForLepJetVar") # warning: Ptr is null if no match is found ), ) -run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData, src = "slimmedElectronsUpdated") -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: - modifier.toModify(slimmedElectronsWithUserData, src = "slimmedElectronsTo106X") +for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: + modifier.toModify(slimmedElectronsWithUserData, src = "slimmedElectronsUpdated") run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userFloats, mvaSpring16GP = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring16GeneralPurposeV1Values"), @@ -257,8 +250,6 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): ecalTrkEnergyPreCorrNew = cms.InputTag("calibratedPatElectrons94X","ecalTrkEnergyPreCorr"), ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectrons94X","ecalTrkEnergyPostCorr"), ) -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: - modifier.toModify(slimmedElectronsWithUserData, src = "slimmedElectronsTo106X") #the94X miniAOD V2 had a bug in the scale and smearing for electrons in the E/p comb @@ -506,18 +497,15 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): _withUpdateAnd80XLegacyScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons80XLegacy + bitmapVIDForEleSpring15 +bitmapVIDForEleSum16 + slimmedElectronsWithUserData) run2_miniAOD_80XLegacy.toReplaceWith(electronSequence, _withUpdateAnd80XLegacyScale_sequence) -_with94XScale_sequence = electronSequence.copy() -_with94XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons94X + slimmedElectronsWithUserData) -_with94XScale_sequence.replace(bitmapVIDForEle, _updateTo106X_sequence + bitmapVIDForEle) -run2_nanoAOD_94XMiniAODv1.toReplaceWith(electronSequence, _with94XScale_sequence) -run2_nanoAOD_94XMiniAODv2.toReplaceWith(electronSequence, _with94XScale_sequence) - -_with_bitmapVIDForEleSpring15AndSum16_sequence = electronSequence.copy() -_with_bitmapVIDForEleSpring15AndSum16_sequence.replace(slimmedElectronsWithUserData, bitmapVIDForEleSpring15 + bitmapVIDForEleSum16 + slimmedElectronsWithUserData) -_with_bitmapVIDForEleSpring15AndSum16_sequence.replace(bitmapVIDForEle, _updateTo106X_sequence + bitmapVIDForEle) -run2_nanoAOD_94X2016.toReplaceWith(electronSequence, _with_bitmapVIDForEleSpring15AndSum16_sequence) - -_with102XScale_sequence = electronSequence.copy() -_with102XScale_sequence.replace(bitmapVIDForEle, _updateTo106X_sequence + bitmapVIDForEle) -_with102XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons102X + slimmedElectronsWithUserData) -run2_nanoAOD_102Xv1.toReplaceWith(electronSequence, _with102XScale_sequence) +_withUpdateAnd94XScale_sequence = _withUpdate_sequence.copy() +_withUpdateAnd94XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons94X + slimmedElectronsWithUserData) +run2_nanoAOD_94XMiniAODv1.toReplaceWith(electronSequence, _withUpdateAnd94XScale_sequence) +run2_nanoAOD_94XMiniAODv2.toReplaceWith(electronSequence, _withUpdateAnd94XScale_sequence) + +_withUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence = _withUpdate_sequence.copy() +_withUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence.replace(slimmedElectronsWithUserData, bitmapVIDForEleSpring15 + bitmapVIDForEleSum16 + slimmedElectronsWithUserData) +run2_nanoAOD_94X2016.toReplaceWith(electronSequence, _withUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence) + +_withUpdateAnd102XScale_sequence = _withUpdate_sequence.copy() +_withUpdateAnd102XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons102X + slimmedElectronsWithUserData) +run2_nanoAOD_102Xv1.toReplaceWith(electronSequence, _withUpdateAnd102XScale_sequence) diff --git a/PhysicsTools/NanoAOD/python/nano_cff.py b/PhysicsTools/NanoAOD/python/nano_cff.py index 5c82480c28d31..0f5a62f2c73d0 100644 --- a/PhysicsTools/NanoAOD/python/nano_cff.py +++ b/PhysicsTools/NanoAOD/python/nano_cff.py @@ -220,14 +220,10 @@ def nanoAOD_activateVID(process): for modname in electron_id_modules_WorkingPoints_nanoAOD.modules: setupAllVIDIdsInModule(process,modname,setupVIDElectronSelection) process.electronSequence.insert(process.electronSequence.index(process.bitmapVIDForEle),process.egmGsfElectronIDSequence) - for modifier in run2_miniAOD_80XLegacy, : + for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: modifier.toModify(process.electronMVAValueMapProducer, src = "slimmedElectronsUpdated") modifier.toModify(process.egmGsfElectronIDs, physicsObjectSrc = "slimmedElectronsUpdated") - for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: - modifier.toModify(process.electronMVAValueMapProducer, src = "slimmedElectronsTo106X") - modifier.toModify(process.egmGsfElectronIDs, physicsObjectSrc = "slimmedElectronsTo106X") - - + switchOnVIDPhotonIdProducer(process,DataFormat.MiniAOD) # do not call this to avoid resetting photon IDs in VID, if called before inside makePuppiesFromMiniAOD for modname in photon_id_modules_WorkingPoints_nanoAOD.modules: diff --git a/PhysicsTools/PatAlgos/plugins/LeptonUpdater.cc b/PhysicsTools/PatAlgos/plugins/LeptonUpdater.cc index d0be628738ac3..7a454341e3d72 100644 --- a/PhysicsTools/PatAlgos/plugins/LeptonUpdater.cc +++ b/PhysicsTools/PatAlgos/plugins/LeptonUpdater.cc @@ -181,9 +181,15 @@ void pat::LeptonUpdater::produce(edm::StreamID, edm::Event &iEvent, edm::Even float signPV = 1.; float signBS = 1.; if (beamSpotIsValid) { - signBS = copysign(1., lep.bestTrack()->dxy(beamSpot)); + if constexpr (std::is_same_v) + signBS = copysign(1., lep.gsfTrack()->dxy(beamSpot)); + else + signBS = copysign(1., lep.bestTrack()->dxy(beamSpot)); } - signPV = copysign(1., lep.bestTrack()->dxy(pv.position())); + if constexpr (std::is_same_v) + signPV = copysign(1., lep.gsfTrack()->dxy(pv.position())); + else + signPV = copysign(1., lep.bestTrack()->dxy(pv.position())); lep.setDB(abs(lep.dB(T::PV2D)) * signPV, lep.edB(T::PV2D), T::PV2D); lep.setDB(abs(lep.dB(T::BS2D)) * signBS, lep.edB(T::BS2D), T::BS2D); } From 28b4c3607d22ad5075be941a2c68481ba86d79df Mon Sep 17 00:00:00 2001 From: Sebastien Wertz Date: Mon, 5 Oct 2020 09:53:34 +0200 Subject: [PATCH 229/778] add run2_nanoAOD_106Xv1 modifier for electrons --- PhysicsTools/NanoAOD/python/electrons_cff.py | 30 +++++++++++--------- PhysicsTools/NanoAOD/python/nano_cff.py | 4 +-- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 7e6fc91411bb7..2c5a659a1d07b 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -5,6 +5,7 @@ from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2 from Configuration.Eras.Modifier_run2_nanoAOD_94X2016_cff import run2_nanoAOD_94X2016 from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1 +from Configuration.Eras.Modifier_run2_nanoAOD_106Xv1_cff import run2_nanoAOD_106Xv1 from PhysicsTools.NanoAOD.common_cff import * import PhysicsTools.PatAlgos.producersLayer1.electronProducer_cfi @@ -125,7 +126,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): _bitmapVIDForEleHEEP_docstring = _get_bitmapVIDForEle_docstring(electron_id_modules_WorkingPoints_nanoAOD.modules,bitmapVIDForEleHEEP.WorkingPoints) -for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: +for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(bitmapVIDForEle, src = "slimmedElectronsUpdated") modifier.toModify(bitmapVIDForEleSpring15, src = "slimmedElectronsUpdated") modifier.toModify(bitmapVIDForEleSum16, src = "slimmedElectronsUpdated") @@ -146,7 +147,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): run2_nanoAOD_94X2016.toModify(isoForEle, EAFile_MiniIso = "RecoEgamma/ElectronIdentification/data/Spring15/effAreaElectrons_cone03_pfNeuHadronsAndPhotons_25ns.txt", EAFile_PFIso = "RecoEgamma/ElectronIdentification/data/Summer16/effAreaElectrons_cone03_pfNeuHadronsAndPhotons_80X.txt") -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: +for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(isoForEle, src = "slimmedElectronsUpdated") ptRatioRelForEle = cms.EDProducer("ElectronJetVarProducer", @@ -154,11 +155,11 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): srcLep = cms.InputTag("slimmedElectrons"), srcVtx = cms.InputTag("offlineSlimmedPrimaryVertices"), ) -for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: +for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(ptRatioRelForEle, srcLep = "slimmedElectronsUpdated") seedGainEle = cms.EDProducer("ElectronSeedGainProducer", src = cms.InputTag("slimmedElectrons")) -for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: +for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(seedGainEle, src = "slimmedElectronsUpdated") import RecoEgamma.EgammaTools.calibratedEgammas_cff @@ -180,7 +181,8 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): produceCalibratedObjs = False, correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_Step2Closure_CoarseEtaR9Gain_v2"), ) -run2_nanoAOD_102Xv1.toModify(calibratedPatElectrons102X, src = "slimmedElectronsUpdated") +for modifier in run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: + modifier.toModify(calibratedPatElectrons102X, src = "slimmedElectronsUpdated") slimmedElectronsWithUserData = cms.EDProducer("PATElectronUserDataEmbedder", src = cms.InputTag("slimmedElectrons"), @@ -233,7 +235,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): jetForLepJetVar = cms.InputTag("ptRatioRelForEle:jetForLepJetVar") # warning: Ptr is null if no match is found ), ) -for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: +for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(slimmedElectronsWithUserData, src = "slimmedElectronsUpdated") run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userFloats, @@ -261,11 +263,12 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectrons94X","ecalTrkEnergyPostCorr"), ) -run2_nanoAOD_102Xv1.toModify(slimmedElectronsWithUserData.userFloats, - ecalTrkEnergyErrPostCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyErrPostCorr"), - ecalTrkEnergyPreCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyPreCorr"), - ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyPostCorr"), -) +for modifier in run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: + modifier.toModify(slimmedElectronsWithUserData.userFloats, + ecalTrkEnergyErrPostCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyErrPostCorr"), + ecalTrkEnergyPreCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyPreCorr"), + ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyPostCorr"), + ) run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userIntFromBools, @@ -415,7 +418,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): #the94X miniAOD V2 had a bug in the scale and smearing for electrons in the E/p comb #therefore we redo it but but we need use a new name for the userFloat as we cant override existing userfloats #for technical reasons -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_miniAOD_80XLegacy,run2_nanoAOD_102Xv1: +for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_miniAOD_80XLegacy,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(electronTable.variables, pt = Var("pt*userFloat('ecalTrkEnergyPostCorrNew')/userFloat('ecalTrkEnergyPreCorrNew')", float, precision=-1, doc="p_{T}"), energyErr = Var("userFloat('ecalTrkEnergyErrPostCorrNew')", float, precision=6, doc="energy error of the cluster-track combination"), @@ -508,4 +511,5 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): _withUpdateAnd102XScale_sequence = _withUpdate_sequence.copy() _withUpdateAnd102XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons102X + slimmedElectronsWithUserData) -run2_nanoAOD_102Xv1.toReplaceWith(electronSequence, _withUpdateAnd102XScale_sequence) +for modifier in run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: + modifier.toReplaceWith(electronSequence, _withUpdateAnd102XScale_sequence) diff --git a/PhysicsTools/NanoAOD/python/nano_cff.py b/PhysicsTools/NanoAOD/python/nano_cff.py index 0f5a62f2c73d0..7894dd61ab221 100644 --- a/PhysicsTools/NanoAOD/python/nano_cff.py +++ b/PhysicsTools/NanoAOD/python/nano_cff.py @@ -220,7 +220,7 @@ def nanoAOD_activateVID(process): for modname in electron_id_modules_WorkingPoints_nanoAOD.modules: setupAllVIDIdsInModule(process,modname,setupVIDElectronSelection) process.electronSequence.insert(process.electronSequence.index(process.bitmapVIDForEle),process.egmGsfElectronIDSequence) - for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: + for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: modifier.toModify(process.electronMVAValueMapProducer, src = "slimmedElectronsUpdated") modifier.toModify(process.egmGsfElectronIDs, physicsObjectSrc = "slimmedElectronsUpdated") @@ -229,7 +229,7 @@ def nanoAOD_activateVID(process): for modname in photon_id_modules_WorkingPoints_nanoAOD.modules: setupAllVIDIdsInModule(process,modname,setupVIDPhotonSelection) process.photonSequence.insert(process.photonSequence.index(bitmapVIDForPho),process.egmPhotonIDSequence) - for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1: + for modifier in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1: modifier.toModify(process.photonMVAValueMapProducer, src = "slimmedPhotonsTo106X") modifier.toModify(process.egmPhotonIDs, physicsObjectSrc = "slimmedPhotonsTo106X") return process From abe9770ec3c66ca01ea6d013974fe1bf5aae6efe Mon Sep 17 00:00:00 2001 From: Giacomo Govi Date: Mon, 5 Oct 2020 15:08:46 +0200 Subject: [PATCH 230/778] Added new Logger service --- CondCore/CondDB/interface/Logger.h | 139 ++++++++++++++++++++++ CondCore/CondDB/src/Logger.cc | 178 ++++++++++++++++++++++++++++ CondCore/CondDB/test/testLogger.cpp | 20 ++++ 3 files changed, 337 insertions(+) create mode 100644 CondCore/CondDB/interface/Logger.h create mode 100644 CondCore/CondDB/src/Logger.cc create mode 100644 CondCore/CondDB/test/testLogger.cpp diff --git a/CondCore/CondDB/interface/Logger.h b/CondCore/CondDB/interface/Logger.h new file mode 100644 index 0000000000000..1e89517b1d87d --- /dev/null +++ b/CondCore/CondDB/interface/Logger.h @@ -0,0 +1,139 @@ +#ifndef CondCore_CondDB_Logger_h +#define CondCore_CondDB_Logger_h +// +// Package: CondDB +// Class : O2OLogger +// +/**\class Logger Logger.h CondCore/CondDB/interface/Logger.h + Description: utility for collecting log information and store them into the Condition DB. +*/ +// +// Author: Giacomo Govi +// Created: Sep 2020 +// +#include "FWCore/MessageLogger/interface/MessageLogger.h" +// +#include +#include + +namespace cond { + + namespace persistency { + + class ConnectionPool; + + template + class EchoedLogStream { + public: + EchoedLogStream()=delete; + explicit EchoedLogStream(const std::string& jobName, std::stringstream& buffer): + m_edmLogger(jobName), + m_buffer(&buffer){ + } + virtual ~EchoedLogStream(){} + template + EchoedLogStream& operator<<(const T& t){ + *m_buffer << t; + m_edmLogger < + class EchoedLogStream { + public: + EchoedLogStream()=delete; + explicit EchoedLogStream(const std::string& jobName, std::stringstream& buffer): + m_edmLogger(jobName,__FILE__,__LINE__), + m_buffer(&buffer){ + } + virtual ~EchoedLogStream(){} + template + EchoedLogStream& operator<<(const T& t){ + *m_buffer << t; + m_edmLogger < logInfo(); + EchoedLogStream logDebug(); + EchoedLogStream logError(); + EchoedLogStream logWarning(); + + private: + void clearBuffer(); + + private: + std::string m_jobName; + std::string m_connectionString; + ConnectionPool* m_sharedConnectionPool; + bool m_started; + boost::posix_time::ptime m_startTime; + boost::posix_time::ptime m_endTime; + int m_retCode; + std::stringstream m_log; + }; + + } // namespace persistency +} // namespace cond +#endif diff --git a/CondCore/CondDB/src/Logger.cc b/CondCore/CondDB/src/Logger.cc new file mode 100644 index 0000000000000..2c8b1cfb7a89e --- /dev/null +++ b/CondCore/CondDB/src/Logger.cc @@ -0,0 +1,178 @@ +#include "CondCore/CondDB/interface/Logger.h" +#include "CondCore/CondDB/interface/ConnectionPool.h" +#include "CondCore/CondDB/interface/Exception.h" +// +#include "DbCore.h" +#include "RelationalAccess/ITransaction.h" +// +#include +#include +// +namespace cond { + + namespace persistency { + + conddb_table(O2O_RUN) { + conddb_column(JOB_NAME, std::string); + conddb_column(START_TIME, boost::posix_time::ptime); + conddb_column(END_TIME, boost::posix_time::ptime); + conddb_column(STATUS_CODE, int); + conddb_column(LOG, std::string); + class Table { + public: + explicit Table(coral::ISchema& schema): m_schema(schema) {} + ~Table() {} + void insert(const std::string& jobName, + const boost::posix_time::ptime& start, + const boost::posix_time::ptime& end, + int retCode, + const std::string& log ){ + RowBuffer + dataToInsert(std::tie(jobName, + start, + end, + retCode, + log)); + insertInTable(m_schema, tname, dataToInsert.get()); + } + private: + coral::ISchema& m_schema; + }; + } + + + void Logger::clearBuffer(){ + m_log.str(""); + m_log.clear(); + } + + Logger::Logger(const std::string& jobName): + m_jobName(jobName), + m_connectionString(""), + m_sharedConnectionPool(nullptr), + m_started( false ), + m_startTime(), + m_endTime(), + m_retCode(0), + m_log(){ + } + + // + Logger::~Logger(){} + + void Logger::setDbDestination(const std::string& connectionString, + ConnectionPool& connectionPool){ + m_connectionString = connectionString; + m_sharedConnectionPool = &connectionPool; + } + + // + void Logger::start(){ + if(!m_started){ + if(!m_log.str().empty()) clearBuffer(); + m_startTime = boost::posix_time::microsec_clock::universal_time(); + m_started = true; + log("START_JOB")<<" "< format(format_s); + std::stringstream timestamp; + timestamp.imbue(std::locale(std::locale::classic(), facet )); + timestamp << t; + return timestamp.str(); + } + + std::string get_timestamp(){ + auto now = boost::posix_time::microsec_clock::universal_time(); + return print_timestamp(now); + } + std::string get_timestamp_for_filename(){ + auto now = boost::posix_time::microsec_clock::universal_time(); + return print_timestamp(now, "%Y-%m-%d_%H-%M-%S"); + } + + // + void Logger::saveOnFile(){ + if(!m_log.str().empty()){ + std::string fileName(get_timestamp_for_filename()+".log"); + std::ofstream fout(fileName,std::ofstream::app); + fout << m_log.str() <createCoralSession(m_connectionString, true); + coralSession->transaction().start(false); + try{ + O2O_RUN::Table destinationTable(coralSession->nominalSchema()); + destinationTable.insert(m_jobName,m_startTime,m_endTime,m_retCode,m_log.str()); + coralSession->transaction().commit(); + } catch( const std::exception& e ){ + coralSession->transaction().rollback(); + // dump on file on this circumstance... + logError()<< e.what(); + saveOnFile(); + throwException(std::string("Failure while saving log on database:")+e.what(),"Logger::saveOnDb"); + } + } + } + + void Logger::save(){ + if(!m_connectionString.empty()) saveOnDb(); + else saveOnFile(); + } + + std::iostream& Logger::log( const std::string& tag){ + if(std::size(m_log.str())!=0) m_log << std::endl; + m_log << "["< Logger::logInfo() { + log( "INFO" ); + return EchoedLogStream(m_jobName, m_log); + } + EchoedLogStream Logger::logDebug() { + log( "DEBUG" ); + return EchoedLogStream(m_jobName, m_log); + } + EchoedLogStream Logger::logError() { + log( "ERROR" ); + return EchoedLogStream(m_jobName, m_log); + } + EchoedLogStream Logger::logWarning() { + log( "WARNING" ); + return EchoedLogStream(m_jobName, m_log); + } + + + } // namespace persistency +} // namespace cond diff --git a/CondCore/CondDB/test/testLogger.cpp b/CondCore/CondDB/test/testLogger.cpp new file mode 100644 index 0000000000000..8466d2f9e9815 --- /dev/null +++ b/CondCore/CondDB/test/testLogger.cpp @@ -0,0 +1,20 @@ + +#include "CondCore/CondDB/interface/Logger.h" +// +#include + +using namespace cond::persistency; + +int main(int argc, char** argv) { + Logger logger("TestO2O_gg_code"); + logger.start(); + std::string s("XYZ"); + logger.logInfo()<<"Step #"<<1<<" and string is ["< Date: Mon, 5 Oct 2020 15:10:15 +0200 Subject: [PATCH 231/778] Added buildfile for new Logger test --- CondCore/CondDB/test/BuildFile.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CondCore/CondDB/test/BuildFile.xml b/CondCore/CondDB/test/BuildFile.xml index d12070acf2fe5..eb81a6ea7cae9 100644 --- a/CondCore/CondDB/test/BuildFile.xml +++ b/CondCore/CondDB/test/BuildFile.xml @@ -29,6 +29,9 @@ + + + From 23b2ac524a38fa74bef80f6fdf82ccdf633e2d21 Mon Sep 17 00:00:00 2001 From: Giacomo Govi Date: Mon, 5 Oct 2020 15:11:55 +0200 Subject: [PATCH 232/778] Added Reporter for collecting Coral messages --- CondCore/CondDB/interface/ConnectionPool.h | 6 + CondCore/CondDB/src/ConnectionPool.cc | 10 ++ CondCore/CondDB/src/CoralMsgReporter.cc | 134 +++++++++++++++++++++ CondCore/CondDB/src/CoralMsgReporter.h | 67 +++++++++++ 4 files changed, 217 insertions(+) create mode 100644 CondCore/CondDB/src/CoralMsgReporter.cc create mode 100644 CondCore/CondDB/src/CoralMsgReporter.h diff --git a/CondCore/CondDB/interface/ConnectionPool.h b/CondCore/CondDB/interface/ConnectionPool.h index f9340e0a47da5..f291d9cf2ba11 100644 --- a/CondCore/CondDB/interface/ConnectionPool.h +++ b/CondCore/CondDB/interface/ConnectionPool.h @@ -15,6 +15,7 @@ namespace edm { namespace coral { class IConnectionServiceConfiguration; class ISessionProxy; + class IMsgReporter; } // namespace coral namespace cond { @@ -25,6 +26,9 @@ namespace cond { namespace persistency { // + class CoralMsgReporter; + class Logger; + enum DbAuthenticationSystem { UndefinedAuthentication = 0, CondDbKey, CoralXMLFile }; // a wrapper for the coral connection service. @@ -34,6 +38,7 @@ namespace cond { ~ConnectionPool(); void setMessageVerbosity(coral::MsgLevel level); + void setLogDestination(Logger& logger); void setAuthenticationPath(const std::string& p); void setAuthenticationSystem(int authSysCode); void setFrontierSecurity(const std::string& signature); @@ -59,6 +64,7 @@ namespace cond { std::string m_authPath = std::string(""); int m_authSys = 0; coral::MsgLevel m_messageLevel = coral::Error; + std::unique_ptr m_msgReporter; bool m_loggingEnabled = false; //The frontier security option is turned on for all sessions //usig this wrapper of the CORAL connection setup for configuring the server access diff --git a/CondCore/CondDB/src/ConnectionPool.cc b/CondCore/CondDB/src/ConnectionPool.cc index 7a7d1e8dfa820..247bf2d1c841b 100644 --- a/CondCore/CondDB/src/ConnectionPool.cc +++ b/CondCore/CondDB/src/ConnectionPool.cc @@ -2,6 +2,7 @@ #include "DbConnectionString.h" #include "SessionImpl.h" #include "IOVSchema.h" +#include "CoralMsgReporter.h" // #include "CondCore/CondDB/interface/CoralServiceManager.h" #include "CondCore/CondDB/interface/Auth.h" @@ -72,6 +73,11 @@ namespace cond { coralConfig.disableConnectionSharing(); // message streaming coral::MessageStream::setMsgVerbosity(m_messageLevel); + if (m_msgReporter.get() != nullptr) { + m_msgReporter->setOutputLevel(m_messageLevel); + coral::MessageStream::installMsgReporter(static_cast(m_msgReporter.get())); + } + // authentication std::string authServiceName("CORAL/Services/EnvironmentAuthenticationService"); std::string authPath = m_authPath; // authentication @@ -165,5 +171,9 @@ namespace cond { void ConnectionPool::setMessageVerbosity(coral::MsgLevel level) { m_messageLevel = level; } + void ConnectionPool::setLogDestination(Logger& logger) { + m_msgReporter = std::make_unique(logger); + } + } // namespace persistency } // namespace cond diff --git a/CondCore/CondDB/src/CoralMsgReporter.cc b/CondCore/CondDB/src/CoralMsgReporter.cc new file mode 100644 index 0000000000000..b16b59ed253ca --- /dev/null +++ b/CondCore/CondDB/src/CoralMsgReporter.cc @@ -0,0 +1,134 @@ +// Include files +#include +#include // fix bug #58581 +#include // fix bug #58581 + +// Local include files +#include "CondCore/CondDB/interface/Logger.h" +#include "CoralMsgReporter.h" + +/// Default constructor +cond::persistency::CoralMsgReporter::CoralMsgReporter( Logger& logger ) + : m_logger( logger ), + m_level( coral::Error ), + m_format( 0 ), + m_mutex(){ + // Use a non-default format? + //char* msgformat = getenv ( "CORAL_MSGFORMAT" ); + if ( getenv ( "CORAL_MESSAGEREPORTER_FORMATTED" ) ) m_format = 1; + + // Use a non-default message level? + if ( getenv( "CORAL_MSGLEVEL" ) ) + { + // Check only the first char of the environment variable + switch ( *getenv( "CORAL_MSGLEVEL" ) ) + { + case '0': + case 'n': + case 'N': m_level = coral::Nil; break; + + case '1': + case 'v': + case 'V': m_level = coral::Verbose; break; + + case '2': + case 'd': + case 'D': m_level = coral::Debug; break; + + case '3': + case 'i': + case 'I': m_level = coral::Info; break; + + case '4': + case 'w': + case 'W': m_level = coral::Warning; break; + + case '5': + case 'e': + case 'E': m_level = coral::Error; break; + + case '6': + case 'f': + case 'F': m_level = coral::Fatal; break; + + case '7': + case 'a': + case 'A': m_level = coral::Always; break; + + default: break; // keep the default + } + } +} + +/// Access output level +coral::MsgLevel +cond::persistency::CoralMsgReporter::outputLevel() const +{ + return m_level; +} + +/// Modify output level +void +cond::persistency::CoralMsgReporter::setOutputLevel(coral::MsgLevel lvl) +{ + m_level = lvl; +} + +/// Report message to stdout +void +cond::persistency::CoralMsgReporter::report( int lvl, + const std::string& src, + const std::string& msg ) +{ + if ( lvl < m_level ) return; + std::lock_guard lock(m_mutex); + + std::stringstream out; + /** + if ( m_format == 1 ) // COOL format + { + // Formatted CORAL reporter (as in COOL) + //std::ostream& out = std::cout; + const std::string::size_type src_name_maxsize = 36; + if ( src.size() <= src_name_maxsize ) + { + out << src << std::string( src_name_maxsize-src.size(), ' ' ); + } + else + { + out << src.substr( 0, src_name_maxsize-3 ) << "..."; + } + switch ( lvl ) + { + case 0: out << " Nil "; break; + case 1: out << " Verbose "; break; + case 2: out << " Debug "; break; + case 3: out << " Info "; break; + case 4: out << " Warning "; break; + case 5: out << " Error "; break; + case 6: out << " Fatal "; break; + case 7: out << " Always "; break; + default: out << " Unknown "; break; + } + out << msg << std::endl; + } + else{ + **/ + // Default CORAL reporter + switch ( lvl ) { + case coral::Nil: + case coral::Verbose: + case coral::Debug: + m_logger.logDebug()<<"CORAL: "< +#include "CoralBase/MessageStream.h" + +namespace cond +{ + + namespace persistency + { + + class Logger; + + class CoralMsgReporter : public coral::IMsgReporter + { + + public: + + // Empty ctr is suppressed + CoralMsgReporter() = delete; + + /// Default constructor + explicit CoralMsgReporter( Logger& logger ); + + /// Destructor + ~CoralMsgReporter() override {} + + /// Release reference to reporter + void release() override + { + delete this; + } + + /// Access output level + coral::MsgLevel outputLevel() const override; + + /// Modify output level + void setOutputLevel( coral::MsgLevel lvl ) override; + + /// Report a message + void report( int lvl, + const std::string& src, + const std::string& msg ) override; + + private: + + // the destination of the streams... + Logger& m_logger; + + /// The current message level threshold + coral::MsgLevel m_level; + + /// Use a different format output + size_t m_format; + + /// The mutex lock + std::recursive_mutex m_mutex; + + }; + + } + +} +#endif From 745e0876c307f44619666477ca98496fe4d40d24 Mon Sep 17 00:00:00 2001 From: Giacomo Govi Date: Mon, 5 Oct 2020 15:12:54 +0200 Subject: [PATCH 233/778] Fixes... --- CondCore/CondDB/src/DbCore.h | 2 +- CondCore/Utilities/python/o2olib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CondCore/CondDB/src/DbCore.h b/CondCore/CondDB/src/DbCore.h index e3cd9b2f00833..42dc567b6fbf1 100644 --- a/CondCore/CondDB/src/DbCore.h +++ b/CondCore/CondDB/src/DbCore.h @@ -225,7 +225,7 @@ namespace cond { } void addStaticCondition(const std::string& condition) { - if (m_clause.size() > 0) { + if (!m_clause.empty()) { m_clause += " AND "; } m_clause += condition; diff --git a/CondCore/Utilities/python/o2olib.py b/CondCore/Utilities/python/o2olib.py index 1604913250741..e3bf619dc681e 100644 --- a/CondCore/Utilities/python/o2olib.py +++ b/CondCore/Utilities/python/o2olib.py @@ -14,7 +14,7 @@ import CondCore.Utilities.credentials as auth prod_db_service = ['cms_orcon_prod','cms_orcon_prod/cms_cond_general_w'] -dev_db_service = ['cms_orcoff_prep','cms_orcoff_prep/cms_test_conditions'] +dev_db_service = ['cms_orcoff_prep','cms_orcoff_prep/cms_cond_general_w'] schema_name = 'CMS_CONDITIONS' sqlalchemy_tpl = 'oracle://%s:%s@%s' coral_tpl = 'oracle://%s/%s' From d38bfb94fdec78d8ae3fe862ef66297b760544c5 Mon Sep 17 00:00:00 2001 From: Giacomo Govi Date: Mon, 5 Oct 2020 15:14:14 +0200 Subject: [PATCH 234/778] Integrated Logging in the PoolDBOutputService package --- .../interface/OnlineDBOutputService.h | 21 ++++++------ .../interface/PoolDBOutputService.h | 12 ++++--- .../src/OnlineDBOutputService.cc | 15 +++++---- .../src/PoolDBOutputService.cc | 32 ++++++++++++------- .../python/testLumiBasedUpdateAnalyzer_cfg.py | 13 +++++--- .../testLumiBasedUpdateAnalyzer_oracle.cfg.py | 11 ++++--- .../test/stubs/LumiBasedUpdateAnalyzer.cc | 16 +++++++--- 7 files changed, 74 insertions(+), 46 deletions(-) diff --git a/CondCore/DBOutputService/interface/OnlineDBOutputService.h b/CondCore/DBOutputService/interface/OnlineDBOutputService.h index 3b02fcbe23ea8..910fe2acd900a 100644 --- a/CondCore/DBOutputService/interface/OnlineDBOutputService.h +++ b/CondCore/DBOutputService/interface/OnlineDBOutputService.h @@ -28,9 +28,6 @@ namespace cond { namespace service { class OnlineDBOutputService : public PoolDBOutputService { - public: - static constexpr const char* const MSGSOURCE = "OnlineDBOuputService"; - public: OnlineDBOutputService(const edm::ParameterSet& iConfig, edm::ActivityRegistry& iAR); @@ -43,7 +40,7 @@ namespace cond { bool writeForNextLumisection(const PayloadType* payload, const std::string& recordName) { cond::Time_t targetTime = getLastLumiProcessed() + m_latencyInLumisections; auto t0 = std::chrono::high_resolution_clock::now(); - edm::LogInfo(MSGSOURCE) << "Updating lumisection " << targetTime; + logger().logInfo() << "Updating lumisection " << targetTime; cond::Hash payloadId = PoolDBOutputService::writeOne(payload, targetTime, recordName); bool ret = true; if (payloadId.empty()) { @@ -51,28 +48,28 @@ namespace cond { } auto t1 = std::chrono::high_resolution_clock::now(); auto w_lat = std::chrono::duration_cast(t1 - t0).count(); - edm::LogInfo(MSGSOURCE) << "Update has taken " << w_lat << " microsecs."; + logger().logInfo() << "Update has taken " << w_lat << " microsecs."; // check for late updates... cond::Time_t lastProcessed = getLastLumiProcessed(); - edm::LogInfo(MSGSOURCE) << "Last lumisection processed after update: " << lastProcessed; + logger().logInfo() << "Last lumisection processed after update: " << lastProcessed; // check the pre-loaded iov - edm::LogInfo(MSGSOURCE) << "Preloading lumisection " << targetTime; + logger().logInfo() << "Preloading lumisection " << targetTime; auto t2 = std::chrono::high_resolution_clock::now(); cond::Iov_t usedIov = preLoadIov(recordName, targetTime); auto t3 = std::chrono::high_resolution_clock::now(); - edm::LogInfo(MSGSOURCE) << "Iov for preloaded lumisection " << targetTime << " is " << usedIov.since; + logger().logInfo() << "Iov for preloaded lumisection " << targetTime << " is " << usedIov.since; auto p_lat = std::chrono::duration_cast(t3 - t2).count(); - edm::LogInfo(MSGSOURCE) << "Preload has taken " << p_lat << " microsecs."; + logger().logInfo() << "Preload has taken " << p_lat << " microsecs."; if (usedIov.since < targetTime) { - edm::LogWarning(MSGSOURCE) << "Found a late update for lumisection " << targetTime << "(found since " - << usedIov.since << "). A revert is required."; + logger().logWarning() << "Found a late update for lumisection " << targetTime << "(found since " + << usedIov.since << "). A revert is required."; PoolDBOutputService::eraseSinceTime(payloadId, targetTime, recordName); PoolDBOutputService::commitTransaction(); ret = false; } auto t4 = std::chrono::high_resolution_clock::now(); auto t_lat = std::chrono::duration_cast(t4 - t0).count(); - edm::LogInfo(MSGSOURCE) << "Total update time: " << t_lat << " microsecs."; + logger().logInfo() << "Total update time: " << t_lat << " microsecs."; return ret; } diff --git a/CondCore/DBOutputService/interface/PoolDBOutputService.h b/CondCore/DBOutputService/interface/PoolDBOutputService.h index 43f1093ed0730..d7c87728db99c 100644 --- a/CondCore/DBOutputService/interface/PoolDBOutputService.h +++ b/CondCore/DBOutputService/interface/PoolDBOutputService.h @@ -4,6 +4,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "CondCore/CondDB/interface/ConnectionPool.h" #include "CondCore/CondDB/interface/Session.h" +#include "CondCore/CondDB/interface/Logger.h" #include #include #include @@ -63,6 +64,7 @@ namespace cond { try { this->initDB(); Record& myrecord = this->lookUpRecord(recordName); + m_logger.logInfo() << "Tag mapped to record " << recordName << ": " << myrecord.m_tag; bool newTag = isNewTagRequest(recordName); if (myrecord.m_onlyAppendUpdatePolicy && !newTag) { cond::TagInfo_t tInfo; @@ -71,8 +73,8 @@ namespace cond { if (lastSince == cond::time::MAX_VAL) lastSince = 0; if (time <= lastSince) { - edm::LogInfo(MSGSOURCE) << "Won't append iov with since " << std::to_string(time) - << ", because is less or equal to last available since = " << lastSince; + m_logger.logInfo() << "Won't append iov with since " << std::to_string(time) + << ", because is less or equal to last available since = " << lastSince; if (m_autoCommit) doCommitTransaction(); scope.close(); @@ -88,7 +90,7 @@ namespace cond { } if (m_autoCommit) { if (m_writeTransactionDelay) { - edm::LogWarning(MSGSOURCE) << "Waiting " << m_writeTransactionDelay << "s before commit the changes..."; + m_logger.logWarning() << "Waiting " << m_writeTransactionDelay << "s before commit the changes..."; ::sleep(m_writeTransactionDelay); } doCommitTransaction(); @@ -184,6 +186,8 @@ namespace cond { void forceInit(); + cond::persistency::Logger& logger() { return m_logger; } + private: struct Record { Record() @@ -231,7 +235,7 @@ namespace cond { cond::UserLogInfo& lookUpUserLogInfo(const std::string& recordName); private: - static constexpr const char* const MSGSOURCE = "PoolDBOuputService"; + cond::persistency::Logger m_logger; std::recursive_mutex m_mutex; cond::TimeType m_timetype; std::vector m_currentTimes; diff --git a/CondCore/DBOutputService/src/OnlineDBOutputService.cc b/CondCore/DBOutputService/src/OnlineDBOutputService.cc index 2b93bf5bf4b3d..24f109d043a3a 100644 --- a/CondCore/DBOutputService/src/OnlineDBOutputService.cc +++ b/CondCore/DBOutputService/src/OnlineDBOutputService.cc @@ -49,6 +49,8 @@ namespace cond { std::ifstream lastLumiFile(fileName); if (lastLumiFile) { lastLumiFile >> lastLumiProcessed; + } else { + throw Exception(std::string("Can't access lastLumi file ") + fileName); } return lastLumiProcessed; } @@ -70,8 +72,6 @@ namespace cond { unsigned int run = boost::lexical_cast(srun); unsigned int lumi = boost::lexical_cast(slumi); lastLumiProcessed = cond::time::lumiTime(run, lumi); - edm::LogInfo(service::OnlineDBOutputService::MSGSOURCE) - << "Last lumi: " << lastLumiProcessed << " Current run: " << run << " lumi id:" << lumi; return lastLumiProcessed; } @@ -106,6 +106,9 @@ cond::Time_t cond::service::OnlineDBOutputService::getLastLumiProcessed() { std::string info(""); if (!m_omsServiceUrl.empty()) { lastLumiProcessed = cond::getLastLumiFromOMS(m_omsServiceUrl); + logger().logInfo() << "Last lumi: " << lastLumiProcessed + << " Current run: " << cond::time::unpack(lastLumiProcessed).first + << " lumi id:" << cond::time::unpack(lastLumiProcessed).second; } else { if (!m_lastLumiUrl.empty()) { std::string info(""); @@ -113,16 +116,16 @@ cond::Time_t cond::service::OnlineDBOutputService::getLastLumiProcessed() { throw Exception("Can't get last Lumisection from DAQ."); unsigned int lastL = boost::lexical_cast(info); lastLumiProcessed = cond::time::lumiTime(m_runNumber, lastL); - edm::LogInfo(MSGSOURCE) << "Last lumi: " << lastLumiProcessed << " Current run: " << m_runNumber - << " lumi id:" << lastL; + logger().logInfo() << "Last lumi: " << lastLumiProcessed << " Current run: " << m_runNumber + << " lumi id:" << lastL; } else { if (m_lastLumiFile.empty()) { throw Exception("File name for last lumi has not been provided."); } else { lastLumiProcessed = cond::getLatestLumiFromFile(m_lastLumiFile); auto upkTime = cond::time::unpack(lastLumiProcessed); - edm::LogInfo(MSGSOURCE) << "Last lumi: " << lastLumiProcessed << " Current run: " << upkTime.first - << " lumi id:" << upkTime.second; + logger().logInfo() << "Last lumi: " << lastLumiProcessed << " Current run: " << upkTime.first + << " lumi id:" << upkTime.second; } } } diff --git a/CondCore/DBOutputService/src/PoolDBOutputService.cc b/CondCore/DBOutputService/src/PoolDBOutputService.cc index 23230766faa12..420e5b6182bd2 100644 --- a/CondCore/DBOutputService/src/PoolDBOutputService.cc +++ b/CondCore/DBOutputService/src/PoolDBOutputService.cc @@ -7,6 +7,7 @@ #include "FWCore/ServiceRegistry/interface/GlobalContext.h" #include "FWCore/ServiceRegistry/interface/SystemBounds.h" #include "CondCore/CondDB/interface/Exception.h" +#include "CondCore/CondDB/interface/Exception.h" // #include #include @@ -35,7 +36,13 @@ void cond::service::PoolDBOutputService::fillRecord(edm::ParameterSet& recordPse } cond::service::PoolDBOutputService::PoolDBOutputService(const edm::ParameterSet& iConfig, edm::ActivityRegistry& iAR) - : m_currentTimes{}, m_session(), m_transactionActive(false), m_dbInitialised(false), m_records(), m_logheaders() { + : m_logger(iConfig.getUntrackedParameter("jobName", "DBOutputService")), + m_currentTimes{}, + m_session(), + m_transactionActive(false), + m_dbInitialised(false), + m_records(), + m_logheaders() { std::string timetypestr = iConfig.getUntrackedParameter("timetype", "runnumber"); m_timetype = cond::time::timeTypeFromName(timetypestr); m_autoCommit = iConfig.getUntrackedParameter("autoCommit", false); @@ -43,9 +50,13 @@ cond::service::PoolDBOutputService::PoolDBOutputService(const edm::ParameterSet& edm::ParameterSet connectionPset = iConfig.getParameter("DBParameters"); m_connection.setParameters(connectionPset); + m_connection.setLogDestination(m_logger); m_connection.configure(); std::string connectionString = iConfig.getParameter("connect"); m_session = m_connection.createSession(connectionString, true); + bool saveLogsOnDb = iConfig.getUntrackedParameter("saveLogsOnDB", false); + if (saveLogsOnDb) + m_logger.setDbDestination(connectionString, m_connection); // implicit start doStartTransaction(); @@ -189,8 +200,8 @@ void cond::service::PoolDBOutputService::createNewIOV(const std::string& firstPa if (!myrecord.m_isNewTag) { cond::throwException(myrecord.m_tag + " is not a new tag", "PoolDBOutputService::createNewIOV"); } - edm::LogInfo(MSGSOURCE) << "Creating new tag " << myrecord.m_tag << ", adding iov with since " << firstSinceTime - << " pointing to payload id " << firstPayloadId; + m_logger.logInfo() << "Creating new tag " << myrecord.m_tag << ", adding iov with since " << firstSinceTime + << " pointing to payload id " << firstPayloadId; doStartTransaction(); cond::persistency::TransactionScope scope(m_session.transaction()); try { @@ -212,8 +223,8 @@ void cond::service::PoolDBOutputService::createNewIOV(const std::string& firstPa const std::string payloadType, cond::Time_t firstSinceTime, Record& myrecord) { - edm::LogInfo(MSGSOURCE) << "Creating new tag " << myrecord.m_tag << " for payload type " << payloadType - << ", adding iov with since " << firstSinceTime; + m_logger.logInfo() << "Creating new tag " << myrecord.m_tag << " for payload type " << payloadType + << ", adding iov with since " << firstSinceTime; // FIX ME: synchronization type and description have to be passed as the other parameters? cond::persistency::IOVEditor editor = m_session.createIov(payloadType, myrecord.m_tag, myrecord.m_timetype, cond::SYNCH_ANY); @@ -248,7 +259,7 @@ bool cond::service::PoolDBOutputService::appendSinceTime(const std::string& payl bool cond::service::PoolDBOutputService::appendSinceTime(const std::string& payloadId, cond::Time_t time, Record& myrecord) { - edm::LogInfo(MSGSOURCE) << "Updating existing tag " << myrecord.m_tag << ", adding iov with since " << time; + m_logger.logInfo() << "Updating existing tag " << myrecord.m_tag << ", adding iov with since " << time; std::string payloadType(""); try { cond::persistency::IOVEditor editor = m_session.editIov(myrecord.m_tag); @@ -271,8 +282,8 @@ void cond::service::PoolDBOutputService::eraseSinceTime(const std::string& paylo cond::throwException(std::string("Cannot delete from non-existing tag ") + myrecord.m_tag, "PoolDBOutputService::appendSinceTime"); } - edm::LogInfo(MSGSOURCE) << "Updating existing tag " << myrecord.m_tag << ", removing iov with since " << sinceTime - << " pointing to payload id " << payloadId; + m_logger.logInfo() << "Updating existing tag " << myrecord.m_tag << ", removing iov with since " << sinceTime + << " pointing to payload id " << payloadId; doStartTransaction(); cond::persistency::TransactionScope scope(m_session.transaction()); try { @@ -312,8 +323,7 @@ void cond::service::PoolDBOutputService::closeIOV(Time_t lastTill, const std::st cond::throwException(std::string("Cannot close non-existing tag ") + myrecord.m_tag, "PoolDBOutputService::closeIOV"); } - edm::LogInfo(MSGSOURCE) << "Updating existing tag " << myrecord.m_tag << ", closing with end of validity " - << lastTill; + m_logger.logInfo() << "Updating existing tag " << myrecord.m_tag << ", closing with end of validity " << lastTill; doStartTransaction(); cond::persistency::TransactionScope scope(m_session.transaction()); try { @@ -338,7 +348,7 @@ void cond::service::PoolDBOutputService::setLogHeaderForRecord(const std::string bool cond::service::PoolDBOutputService::getTagInfo(const std::string& recordName, cond::TagInfo_t& result) { Record& record = lookUpRecord(recordName); result.name = record.m_tag; - LogDebug(MSGSOURCE) << "Fetching tag info for " << record.m_tag; + m_logger.logDebug() << "Fetching tag info for " << record.m_tag; doStartTransaction(); bool ret = false; cond::persistency::TransactionScope scope(m_session.transaction()); diff --git a/CondCore/DBOutputService/test/python/testLumiBasedUpdateAnalyzer_cfg.py b/CondCore/DBOutputService/test/python/testLumiBasedUpdateAnalyzer_cfg.py index 37c20eae0746f..5cc6c027a4622 100644 --- a/CondCore/DBOutputService/test/python/testLumiBasedUpdateAnalyzer_cfg.py +++ b/CondCore/DBOutputService/test/python/testLumiBasedUpdateAnalyzer_cfg.py @@ -9,9 +9,9 @@ ) process.MessageLogger = cms.Service("MessageLogger", - cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')), - destinations = cms.untracked.vstring('cout') - ) + cout = cms.untracked.PSet(threshold = cms.untracked.string('DEBUG')), + destinations = cms.untracked.vstring('cout') +) process.OnlineDBOutputService = cms.Service("OnlineDBOutputService", DBParameters = cms.PSet( @@ -19,10 +19,12 @@ authenticationPath = cms.untracked.string('.') ), #timetype = cms.untracked.string('runnumber'), + jobName = cms.untracked.string("TestLumiBasedUpdate"), autoCommit = cms.untracked.bool(True), connect = cms.string('sqlite_file:test_lumi.db'), preLoadConnectionString = cms.untracked.string('sqlite_file:test_lumi.db'), - omsServiceUrl = cms.untracked.string('http://cmsoms-services.cms:9949/urn:xdaq-application:lid=100/getRunAndLumiSection'), + #omsServiceUrl = cms.untracked.string('http://cmsoms-services.cms:9949/urn:xdaq-application:lid=100/getRunAndLumiSection'), + lastLumiFile = cms.untracked.string('lastLumi.txt'), toPut = cms.VPSet(cms.PSet( record = cms.string('PedestalsRcd'), tag = cms.string('mytest'), @@ -33,7 +35,8 @@ process.mytest = cms.EDAnalyzer("LumiBasedUpdateAnalyzer", record = cms.string('PedestalsRcd'), - omsServiceUrl = cms.untracked.string('http://cmsoms-services.cms:9949/urn:xdaq-application:lid=100/getRunAndLumiSection') + lastLumiFile = cms.untracked.string('lastLumi.txt') + #omsServiceUrl = cms.untracked.string('http://cmsoms-services.cms:9949/urn:xdaq-application:lid=100/getRunAndLumiSection') ) process.p = cms.Path(process.mytest) diff --git a/CondCore/DBOutputService/test/python/testLumiBasedUpdateAnalyzer_oracle.cfg.py b/CondCore/DBOutputService/test/python/testLumiBasedUpdateAnalyzer_oracle.cfg.py index 776a3a241c6da..9b2843be2a2b5 100644 --- a/CondCore/DBOutputService/test/python/testLumiBasedUpdateAnalyzer_oracle.cfg.py +++ b/CondCore/DBOutputService/test/python/testLumiBasedUpdateAnalyzer_oracle.cfg.py @@ -29,16 +29,19 @@ process.OnlineDBOutputService = cms.Service("OnlineDBOutputService", DBParameters = cms.PSet( - messageLevel = cms.untracked.int32(0), + messageLevel = cms.untracked.int32(1), authenticationPath = cms.untracked.string('/build/gg') ), #timetype = cms.untracked.string('runnumber'), + jobName = cms.untracked.string("TestLumiBasedUpdate"), connect = cms.string('oracle://cms_orcoff_prep/CMS_CONDITIONS'), preLoadConnectionString = cms.untracked.string('frontier://FrontierPrep/CMS_CONDITIONS'), - runNumber = cms.untracked.uint64(options.runNumber), - lastLumiFile = cms.untracked.string('/build/gg/last_lumi.txt'), - writeTransactionDelay = cms.untracked.uint32(options.transDelay), + runNumber = cms.untracked.uint64(options.runNumber), + #lastLumiFile = cms.untracked.string('/build/gg/last_lumi.txt'), + writeTransactionDelay = cms.untracked.uint32(options.transDelay), autoCommit = cms.untracked.bool(True), + lastLumiFile = cms.untracked.string('lastLumi.txt'), + saveLogsOnDB = cms.untracked.bool(True), toPut = cms.VPSet(cms.PSet( record = cms.string('PedestalsRcd'), tag = cms.string('BeamSpot_test_updateByLumi_00'), diff --git a/CondCore/DBOutputService/test/stubs/LumiBasedUpdateAnalyzer.cc b/CondCore/DBOutputService/test/stubs/LumiBasedUpdateAnalyzer.cc index a0f84849a1326..de009ad66a14b 100644 --- a/CondCore/DBOutputService/test/stubs/LumiBasedUpdateAnalyzer.cc +++ b/CondCore/DBOutputService/test/stubs/LumiBasedUpdateAnalyzer.cc @@ -26,36 +26,44 @@ void LumiBasedUpdateAnalyzer::analyze(const edm::Event& evt, const edm::EventSet std::cout << "Service is unavailable" << std::endl; return; } + mydbservice->logger().start(); unsigned int irun = evt.id().run(); cond::Time_t lastLumi = cond::time::MIN_VAL; if (!m_omsServiceUrl.empty()) { lastLumi = cond::getLastLumiFromOMS(m_omsServiceUrl); } else { - cond::getLatestLumiFromFile(m_lastLumiFile); + lastLumi = cond::getLatestLumiFromFile(m_lastLumiFile); if (lastLumi == m_prevLumi) { + mydbservice->logger().logInfo() << "Last lumi:" << lastLumi << " Prev lumi:" << m_prevLumi; + mydbservice->logger().end(1); return; } m_prevLumi = lastLumi; m_prevLumiTime = std::chrono::steady_clock::now(); } unsigned int lumiId = cond::time::unpack(lastLumi).second; - std::cout << "## last lumi: " << lastLumi << " run: " << cond::time::unpack(lastLumi).first << " lumiid:" << lumiId - << std::endl; + mydbservice->logger().logInfo() << "Last lumi: " << lastLumi << " run: " << cond::time::unpack(lastLumi).first + << " lumiid:" << lumiId; std::string tag = mydbservice->tag(m_record); std::cout << "tag " << tag << std::endl; std::cout << "run " << irun << std::endl; + mydbservice->logger().logDebug() << "Tag: " << tag << " Run: " << irun; BeamSpotObjects mybeamspot; mybeamspot.SetPosition(0.053, 0.1, 0.13); mybeamspot.SetSigmaZ(3.8); mybeamspot.SetType(int(lumiId)); std::cout << mybeamspot.GetBeamType() << std::endl; - + mydbservice->logger().logDebug() << "BeamType: " << mybeamspot.GetBeamType(); + int ret = 0; try { mydbservice->writeForNextLumisection(&mybeamspot, m_record); } catch (const std::exception& e) { std::cout << "Error:" << e.what() << std::endl; + mydbservice->logger().logError() << e.what(); + ret = -1; } //::sleep(13); + mydbservice->logger().end(ret); } void LumiBasedUpdateAnalyzer::endJob() {} DEFINE_FWK_MODULE(LumiBasedUpdateAnalyzer); From 460cadfa6f481acbac49058dd3ce2384fcf3512c Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Mon, 5 Oct 2020 15:24:42 +0200 Subject: [PATCH 235/778] comments on units --- Geometry/TrackerNumberingBuilder/interface/GeometricDet.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index 2a1630332ccd4..b60f60a33f651 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -97,8 +97,8 @@ class GeometricDet { void setGeographicalID(DetId id) { geographicalID_ = id; } // VOLUME POSITION in CMS frame of reference - const Translation& translation() const { return trans_; } - double rho() const { return rho_; } + const Translation& translation() const { return trans_; } // in mm + double rho() const { return rho_; } // in mm double phi() const { return phi_; } const RotationMatrix& rotation() const { return rot_; } @@ -109,7 +109,7 @@ class GeometricDet { // SOLID SHAPE // old DD - LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } + LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } // in mm // DD4hep const cms::DDSolidShape& shape_dd4hep() const { return shape_; } // solid shape parameters @@ -120,7 +120,7 @@ class GeometricDet { << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; } return params_; - } + } // in mm // RADIATION LENGTH AND ENERGY LOSS double radLength() const { return radLength_; } From af8723c9fe567a2bdb568864fcfae619ae854149 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo Date: Mon, 5 Oct 2020 15:25:21 +0200 Subject: [PATCH 236/778] temporary printouts --- .../plugins/DDDCmsTrackerContruction.cc | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc index e2ea18288813c..efa46fb93da18 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc @@ -13,7 +13,7 @@ #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerBuilder.h" #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.h" -#define DEBUG false +#define DEBUG true std::unique_ptr DDDCmsTrackerContruction::construct(const DDCompactView& cpv, std::vector const& detidShifts) { @@ -39,14 +39,14 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const DDCompac CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); - if (DEBUG) { - printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); - } - edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); theCmsTrackerDetIdBuilder.buildId(*tracker); + if (DEBUG) { + printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); + } + fv.parent(); // // set the Tracker @@ -82,14 +82,14 @@ std::unique_ptr DDDCmsTrackerContruction::construct(const cms::DDC CmsTrackerBuilder theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); - if (DEBUG) { - printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); - } - edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); theCmsTrackerDetIdBuilder.buildId(*tracker); + if (DEBUG) { + printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); + } + return tracker; } @@ -120,6 +120,15 @@ void DDDCmsTrackerContruction::printAllTrackerGeometricDetsBeforeDetIDBuilding(c outputFile << "............................." << std::endl; outputFile << "myDet->geographicalID() = " << myDet->geographicalId() << std::endl; outputFile << "myDet->name() = " << myDet->name() << std::endl; + + /* + outputFile << "myDet->navpos() = " << myDet->navpos() << std::endl; + outputFile << "myDet->navType() = "; + for (const auto& pos : myDet->navType()) { + outputFile << pos << " "; + } + outputFile << " " << std::endl;*/ + outputFile << "myDet->module->type() = " << std::fixed << std::setprecision(7) << myDet->type() << std::endl; outputFile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() << std::endl; From efb824ae2e419631a14ca77a940f7978f45f9494 Mon Sep 17 00:00:00 2001 From: Giacomo Govi Date: Mon, 5 Oct 2020 15:38:58 +0200 Subject: [PATCH 237/778] Making code-format happy --- CondCore/CondDB/interface/Logger.h | 80 +++++------ CondCore/CondDB/src/CoralMsgReporter.cc | 142 ++++++++++--------- CondCore/CondDB/src/CoralMsgReporter.h | 30 ++-- CondCore/CondDB/src/Logger.cc | 181 ++++++++++++------------ CondCore/CondDB/test/testLogger.cpp | 8 +- 5 files changed, 211 insertions(+), 230 deletions(-) diff --git a/CondCore/CondDB/interface/Logger.h b/CondCore/CondDB/interface/Logger.h index 1e89517b1d87d..399db18216d2d 100644 --- a/CondCore/CondDB/interface/Logger.h +++ b/CondCore/CondDB/interface/Logger.h @@ -25,68 +25,66 @@ namespace cond { template class EchoedLogStream { public: - EchoedLogStream()=delete; - explicit EchoedLogStream(const std::string& jobName, std::stringstream& buffer): - m_edmLogger(jobName), - m_buffer(&buffer){ - } - virtual ~EchoedLogStream(){} + EchoedLogStream() = delete; + explicit EchoedLogStream(const std::string& jobName, std::stringstream& buffer) + : m_edmLogger(jobName), m_buffer(&buffer) {} + virtual ~EchoedLogStream() {} template - EchoedLogStream& operator<<(const T& t){ - *m_buffer << t; - m_edmLogger < + template <> class EchoedLogStream { public: - EchoedLogStream()=delete; - explicit EchoedLogStream(const std::string& jobName, std::stringstream& buffer): - m_edmLogger(jobName,__FILE__,__LINE__), - m_buffer(&buffer){ - } - virtual ~EchoedLogStream(){} + EchoedLogStream() = delete; + explicit EchoedLogStream(const std::string& jobName, std::stringstream& buffer) + : m_edmLogger(jobName, __FILE__, __LINE__), m_buffer(&buffer) {} + virtual ~EchoedLogStream() {} template - EchoedLogStream& operator<<(const T& t){ - *m_buffer << t; - m_edmLogger < logInfo(); EchoedLogStream logDebug(); diff --git a/CondCore/CondDB/src/CoralMsgReporter.cc b/CondCore/CondDB/src/CoralMsgReporter.cc index b16b59ed253ca..603a23be845ae 100644 --- a/CondCore/CondDB/src/CoralMsgReporter.cc +++ b/CondCore/CondDB/src/CoralMsgReporter.cc @@ -1,86 +1,88 @@ // Include files #include -#include // fix bug #58581 -#include // fix bug #58581 +#include // fix bug #58581 +#include // fix bug #58581 // Local include files #include "CondCore/CondDB/interface/Logger.h" #include "CoralMsgReporter.h" /// Default constructor -cond::persistency::CoralMsgReporter::CoralMsgReporter( Logger& logger ) - : m_logger( logger ), - m_level( coral::Error ), - m_format( 0 ), - m_mutex(){ +cond::persistency::CoralMsgReporter::CoralMsgReporter(Logger& logger) + : m_logger(logger), m_level(coral::Error), m_format(0), m_mutex() { // Use a non-default format? //char* msgformat = getenv ( "CORAL_MSGFORMAT" ); - if ( getenv ( "CORAL_MESSAGEREPORTER_FORMATTED" ) ) m_format = 1; + if (getenv("CORAL_MESSAGEREPORTER_FORMATTED")) + m_format = 1; // Use a non-default message level? - if ( getenv( "CORAL_MSGLEVEL" ) ) - { + if (getenv("CORAL_MSGLEVEL")) { // Check only the first char of the environment variable - switch ( *getenv( "CORAL_MSGLEVEL" ) ) - { - case '0': - case 'n': - case 'N': m_level = coral::Nil; break; + switch (*getenv("CORAL_MSGLEVEL")) { + case '0': + case 'n': + case 'N': + m_level = coral::Nil; + break; - case '1': - case 'v': - case 'V': m_level = coral::Verbose; break; + case '1': + case 'v': + case 'V': + m_level = coral::Verbose; + break; - case '2': - case 'd': - case 'D': m_level = coral::Debug; break; + case '2': + case 'd': + case 'D': + m_level = coral::Debug; + break; - case '3': - case 'i': - case 'I': m_level = coral::Info; break; + case '3': + case 'i': + case 'I': + m_level = coral::Info; + break; - case '4': - case 'w': - case 'W': m_level = coral::Warning; break; + case '4': + case 'w': + case 'W': + m_level = coral::Warning; + break; - case '5': - case 'e': - case 'E': m_level = coral::Error; break; + case '5': + case 'e': + case 'E': + m_level = coral::Error; + break; - case '6': - case 'f': - case 'F': m_level = coral::Fatal; break; + case '6': + case 'f': + case 'F': + m_level = coral::Fatal; + break; - case '7': - case 'a': - case 'A': m_level = coral::Always; break; + case '7': + case 'a': + case 'A': + m_level = coral::Always; + break; - default: break; // keep the default + default: + break; // keep the default } } } /// Access output level -coral::MsgLevel -cond::persistency::CoralMsgReporter::outputLevel() const -{ - return m_level; -} +coral::MsgLevel cond::persistency::CoralMsgReporter::outputLevel() const { return m_level; } /// Modify output level -void -cond::persistency::CoralMsgReporter::setOutputLevel(coral::MsgLevel lvl) -{ - m_level = lvl; -} +void cond::persistency::CoralMsgReporter::setOutputLevel(coral::MsgLevel lvl) { m_level = lvl; } /// Report message to stdout -void -cond::persistency::CoralMsgReporter::report( int lvl, - const std::string& src, - const std::string& msg ) -{ - if ( lvl < m_level ) return; +void cond::persistency::CoralMsgReporter::report(int lvl, const std::string& src, const std::string& msg) { + if (lvl < m_level) + return; std::lock_guard lock(m_mutex); std::stringstream out; @@ -114,21 +116,21 @@ cond::persistency::CoralMsgReporter::report( int lvl, } else{ **/ - // Default CORAL reporter - switch ( lvl ) { - case coral::Nil: - case coral::Verbose: - case coral::Debug: - m_logger.logDebug()<<"CORAL: "< #include "CoralBase/MessageStream.h" -namespace cond -{ +namespace cond { - namespace persistency - { + namespace persistency { class Logger; - class CoralMsgReporter : public coral::IMsgReporter - { - + class CoralMsgReporter : public coral::IMsgReporter { public: - // Empty ctr is suppressed CoralMsgReporter() = delete; /// Default constructor - explicit CoralMsgReporter( Logger& logger ); + explicit CoralMsgReporter(Logger& logger); /// Destructor ~CoralMsgReporter() override {} /// Release reference to reporter - void release() override - { - delete this; - } + void release() override { delete this; } /// Access output level coral::MsgLevel outputLevel() const override; /// Modify output level - void setOutputLevel( coral::MsgLevel lvl ) override; + void setOutputLevel(coral::MsgLevel lvl) override; /// Report a message - void report( int lvl, - const std::string& src, - const std::string& msg ) override; + void report(int lvl, const std::string& src, const std::string& msg) override; private: - // the destination of the streams... Logger& m_logger; @@ -58,10 +47,9 @@ namespace cond /// The mutex lock std::recursive_mutex m_mutex; - }; - } + } // namespace persistency -} +} // namespace cond #endif diff --git a/CondCore/CondDB/src/Logger.cc b/CondCore/CondDB/src/Logger.cc index 2c8b1cfb7a89e..8d6a592e1fa60 100644 --- a/CondCore/CondDB/src/Logger.cc +++ b/CondCore/CondDB/src/Logger.cc @@ -20,159 +20,152 @@ namespace cond { conddb_column(LOG, std::string); class Table { public: - explicit Table(coral::ISchema& schema): m_schema(schema) {} + explicit Table(coral::ISchema& schema) : m_schema(schema) {} ~Table() {} - void insert(const std::string& jobName, - const boost::posix_time::ptime& start, - const boost::posix_time::ptime& end, - int retCode, - const std::string& log ){ - RowBuffer - dataToInsert(std::tie(jobName, - start, - end, - retCode, - log)); - insertInTable(m_schema, tname, dataToInsert.get()); - } + void insert(const std::string& jobName, + const boost::posix_time::ptime& start, + const boost::posix_time::ptime& end, + int retCode, + const std::string& log) { + RowBuffer dataToInsert( + std::tie(jobName, start, end, retCode, log)); + insertInTable(m_schema, tname, dataToInsert.get()); + } + private: coral::ISchema& m_schema; }; } - - void Logger::clearBuffer(){ + void Logger::clearBuffer() { m_log.str(""); m_log.clear(); } - - Logger::Logger(const std::string& jobName): - m_jobName(jobName), - m_connectionString(""), - m_sharedConnectionPool(nullptr), - m_started( false ), - m_startTime(), - m_endTime(), - m_retCode(0), - m_log(){ - } - + + Logger::Logger(const std::string& jobName) + : m_jobName(jobName), + m_connectionString(""), + m_sharedConnectionPool(nullptr), + m_started(false), + m_startTime(), + m_endTime(), + m_retCode(0), + m_log() {} + // - Logger::~Logger(){} + Logger::~Logger() {} - void Logger::setDbDestination(const std::string& connectionString, - ConnectionPool& connectionPool){ + void Logger::setDbDestination(const std::string& connectionString, ConnectionPool& connectionPool) { m_connectionString = connectionString; m_sharedConnectionPool = &connectionPool; } // - void Logger::start(){ - if(!m_started){ - if(!m_log.str().empty()) clearBuffer(); - m_startTime = boost::posix_time::microsec_clock::universal_time(); - m_started = true; - log("START_JOB")<<" "< format(format_s); + facet->format(format_s); std::stringstream timestamp; - timestamp.imbue(std::locale(std::locale::classic(), facet )); + timestamp.imbue(std::locale(std::locale::classic(), facet)); timestamp << t; return timestamp.str(); } - std::string get_timestamp(){ + std::string get_timestamp() { auto now = boost::posix_time::microsec_clock::universal_time(); return print_timestamp(now); } - std::string get_timestamp_for_filename(){ + std::string get_timestamp_for_filename() { auto now = boost::posix_time::microsec_clock::universal_time(); return print_timestamp(now, "%Y-%m-%d_%H-%M-%S"); } // - void Logger::saveOnFile(){ - if(!m_log.str().empty()){ - std::string fileName(get_timestamp_for_filename()+".log"); - std::ofstream fout(fileName,std::ofstream::app); - fout << m_log.str() <createCoralSession(m_connectionString, true); - coralSession->transaction().start(false); - try{ - O2O_RUN::Table destinationTable(coralSession->nominalSchema()); - destinationTable.insert(m_jobName,m_startTime,m_endTime,m_retCode,m_log.str()); - coralSession->transaction().commit(); - } catch( const std::exception& e ){ - coralSession->transaction().rollback(); - // dump on file on this circumstance... - logError()<< e.what(); - saveOnFile(); - throwException(std::string("Failure while saving log on database:")+e.what(),"Logger::saveOnDb"); - } + void Logger::saveOnDb() { + if (!m_log.str().empty()) { + if (m_sharedConnectionPool == nullptr) { + throwException("Connection pool handle has not been provided.", "Logger::saveOnDb"); + } + if (m_connectionString.empty()) { + throwException("Connection string for destination database has not been provided.", "Logger::saveOnDb"); + } + auto coralSession = m_sharedConnectionPool->createCoralSession(m_connectionString, true); + coralSession->transaction().start(false); + try { + O2O_RUN::Table destinationTable(coralSession->nominalSchema()); + destinationTable.insert(m_jobName, m_startTime, m_endTime, m_retCode, m_log.str()); + coralSession->transaction().commit(); + } catch (const std::exception& e) { + coralSession->transaction().rollback(); + // dump on file on this circumstance... + logError() << e.what(); + saveOnFile(); + throwException(std::string("Failure while saving log on database:") + e.what(), "Logger::saveOnDb"); + } } } - void Logger::save(){ - if(!m_connectionString.empty()) saveOnDb(); - else saveOnFile(); + void Logger::save() { + if (!m_connectionString.empty()) + saveOnDb(); + else + saveOnFile(); } - std::iostream& Logger::log( const std::string& tag){ - if(std::size(m_log.str())!=0) m_log << std::endl; - m_log << "["< Logger::logInfo() { - log( "INFO" ); + log("INFO"); return EchoedLogStream(m_jobName, m_log); } EchoedLogStream Logger::logDebug() { - log( "DEBUG" ); + log("DEBUG"); return EchoedLogStream(m_jobName, m_log); } EchoedLogStream Logger::logError() { - log( "ERROR" ); + log("ERROR"); return EchoedLogStream(m_jobName, m_log); } EchoedLogStream Logger::logWarning() { - log( "WARNING" ); + log("WARNING"); return EchoedLogStream(m_jobName, m_log); } - } // namespace persistency } // namespace cond diff --git a/CondCore/CondDB/test/testLogger.cpp b/CondCore/CondDB/test/testLogger.cpp index 8466d2f9e9815..3f98e83998f95 100644 --- a/CondCore/CondDB/test/testLogger.cpp +++ b/CondCore/CondDB/test/testLogger.cpp @@ -9,11 +9,11 @@ int main(int argc, char** argv) { Logger logger("TestO2O_gg_code"); logger.start(); std::string s("XYZ"); - logger.logInfo()<<"Step #"<<1<<" and string is ["< Date: Mon, 5 Oct 2020 16:13:27 +0200 Subject: [PATCH 238/778] For MultiClusters, the collection will define the DQM folder as input - default: ticlMultiClustersFromTrackstersMerge --- .../HGCalValidation/python/hgcalPlots.py | 391 ++++++++---------- .../scripts/makeHGCalValidationPlots.py | 10 +- 2 files changed, 170 insertions(+), 231 deletions(-) diff --git a/Validation/HGCalValidation/python/hgcalPlots.py b/Validation/HGCalValidation/python/hgcalPlots.py index 7131c0aaf9cae..6b82a35b12168 100644 --- a/Validation/HGCalValidation/python/hgcalPlots.py +++ b/Validation/HGCalValidation/python/hgcalPlots.py @@ -2267,237 +2267,176 @@ purpose=PlotPurpose.Timing, page="Energy_vs_Score_LC2CP_zplus")) #================================================================================================= -hgcalMultiClustersPlotter = Plotter() -# [A] Score of CaloParticles wrt Multi Clusters -hgcalMultiClustersPlotter.append("ScoreCaloParticlesToMultiClusters", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _score_caloparticle_to_multiclusters, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="ScoreCaloParticlesToMultiClusters")) - -# [B] Score of MultiClusters wrt CaloParticles -hgcalMultiClustersPlotter.append("ScoreMultiClustersToCaloParticles", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _score_multicluster_to_caloparticles, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="ScoreMultiClustersToCaloParticles")) - -# [C] Shared Energy between CaloParticle and MultiClusters -hgcalMultiClustersPlotter.append("SharedEnergy_CP2MCL", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _sharedEnergy_caloparticle_to_multicluster, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="SharedEnergyCaloParticleToMultiCluster")) - -# [C2] Shared Energy between MultiClusters and CaloParticle -hgcalMultiClustersPlotter.append("SharedEnergy_MCL2CP", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _sharedEnergy_multicluster_to_caloparticle, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="SharedEnergyMultiClusterToCaloParticle")) - -# [E] Efficiency Plots -hgcalMultiClustersPlotter.append("Efficiencies", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _efficiencies, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Efficiencies")) - -# [F] Duplicate Plots -hgcalMultiClustersPlotter.append("Duplicates", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _duplicates, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Duplicates")) - -# [G] Fake Rate Plots -hgcalMultiClustersPlotter.append("FakeRate", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _fakes, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Fakes")) - -# [H] Merge Rate Plots -hgcalMultiClustersPlotter.append("MergeRate", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _merges, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Merges")) - -# [I] Energy vs Score 2D plots CP to MCL and MCL to CP -hgcalMultiClustersPlotter.append("Energy_vs_Score_CP2MCL_MCL2CP", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - #_energyscore_cp2mcl_mcl2cp, - _energyscore_cp2mcl, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Energy_vs_Score_CP2MCL")) - -# [J] Energy vs Score 2D plots MCL to CP -hgcalMultiClustersPlotter.append("Energy_vs_Score_MCL2CP", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _energyscore_mcl2cp, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Energy_vs_Score_MCL2CP")) - -#[K] Number of multiclusters per event. -hgcalMultiClustersPlotter.append("NumberofMultiClusters", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _totmulticlusternum, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="NumberofMultiClusters" - )) +def create_hgcalMultiClustersPlotter(collection = 'ticlMultiClustersFromTrackstersMerge'): -#[L] total number of layer clusters in multicluster per event and per layer -hgcalMultiClustersPlotter.append("NumberofLayerClustersinMultiClusterPerEventAndPerLayer", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _clusternum_in_multicluster, - _clusternum_in_multicluster_vs_layer, - _clusternum_in_multicluster_perlayer_zminus_EE, - _clusternum_in_multicluster_perlayer_zminus_FH, - _clusternum_in_multicluster_perlayer_zminus_BH, - _clusternum_in_multicluster_perlayer_zplus_EE, - _clusternum_in_multicluster_perlayer_zplus_FH, - _clusternum_in_multicluster_perlayer_zplus_BH, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="NumberofLayerClustersinMultiClusterPerEventAndPerLayer" - )) + hgcalMultiClustersPlotter = Plotter() + dqmfolder = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/" + collection -#[M] For each multicluster: pt, eta, phi, energy, x, y, z. -hgcalMultiClustersPlotter.append("MultiClustersPtEtaPhiEneXYZ", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _multicluster_pt, - _multicluster_eta, - _multicluster_phi, - _multicluster_energy, - _multicluster_x, - _multicluster_y, - _multicluster_z, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="MultiClustersPtEtaPhiEneXYZ" - )) - -#[N] Multicluster first, last, total number of layers -hgcalMultiClustersPlotter.append("NumberofMultiClusters_First_Last_NLayers", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _multicluster_firstlayer, - _multicluster_lastlayer, - _multicluster_layersnum, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="NumberofMultiClusters_First_Last_NLayers" - )) + # [A] Score of CaloParticles wrt Multi Clusters + hgcalMultiClustersPlotter.append("ScoreCaloParticlesToMultiClusters", [ + dqmfolder + ], PlotFolder( + _score_caloparticle_to_multiclusters, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="ScoreCaloParticlesToMultiClusters")) -#[O] Multiplicity of layer clusters in multicluster -hgcalMultiClustersPlotter.append("Multiplicity", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _multiplicityOfLCinMCL, - _multiplicityOfLCinMCL_vs_layerclusterenergy, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Multiplicity", - numberOfEventsHistogram=_multiplicity_numberOfEventsHistogram - )) + # [B] Score of MultiClusters wrt CaloParticles + hgcalMultiClustersPlotter.append("ScoreMultiClustersToCaloParticles", [ + dqmfolder + ], PlotFolder( + _score_multicluster_to_caloparticles, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="ScoreMultiClustersToCaloParticles")) + + # [C] Shared Energy between CaloParticle and MultiClusters + hgcalMultiClustersPlotter.append("SharedEnergy_CP2MCL", [ + dqmfolder + ], PlotFolder( + _sharedEnergy_caloparticle_to_multicluster, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="SharedEnergyCaloParticleToMultiCluster")) + + # [C2] Shared Energy between MultiClusters and CaloParticle + hgcalMultiClustersPlotter.append("SharedEnergy_MCL2CP", [ + dqmfolder + ], PlotFolder( + _sharedEnergy_multicluster_to_caloparticle, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="SharedEnergyMultiClusterToCaloParticle")) + + # [E] Efficiency Plots + hgcalMultiClustersPlotter.append("Efficiencies", [ + dqmfolder + ], PlotFolder( + _efficiencies, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Efficiencies")) + + # [F] Duplicate Plots + hgcalMultiClustersPlotter.append("Duplicates", [ + dqmfolder + ], PlotFolder( + _duplicates, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Duplicates")) + + # [G] Fake Rate Plots + hgcalMultiClustersPlotter.append("FakeRate", [ + dqmfolder + ], PlotFolder( + _fakes, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Fakes")) + + # [H] Merge Rate Plots + hgcalMultiClustersPlotter.append("MergeRate", [ + dqmfolder + ], PlotFolder( + _merges, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Merges")) + + # [I] Energy vs Score 2D plots CP to MCL and MCL to CP + hgcalMultiClustersPlotter.append("Energy_vs_Score_CP2MCL_MCL2CP", [ + dqmfolder + ], PlotFolder( + #_energyscore_cp2mcl_mcl2cp, + _energyscore_cp2mcl, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Energy_vs_Score_CP2MCL")) + + # [J] Energy vs Score 2D plots MCL to CP + hgcalMultiClustersPlotter.append("Energy_vs_Score_MCL2CP", [ + dqmfolder + ], PlotFolder( + _energyscore_mcl2cp, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Energy_vs_Score_MCL2CP")) + + #[K] Number of multiclusters per event. + hgcalMultiClustersPlotter.append("NumberofMultiClusters", [ + dqmfolder + ], PlotFolder( + _totmulticlusternum, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="NumberofMultiClusters" + )) + + #[L] total number of layer clusters in multicluster per event and per layer + hgcalMultiClustersPlotter.append("NumberofLayerClustersinMultiClusterPerEventAndPerLayer", [ + dqmfolder + ], PlotFolder( + _clusternum_in_multicluster, + _clusternum_in_multicluster_vs_layer, + _clusternum_in_multicluster_perlayer_zminus_EE, + _clusternum_in_multicluster_perlayer_zminus_FH, + _clusternum_in_multicluster_perlayer_zminus_BH, + _clusternum_in_multicluster_perlayer_zplus_EE, + _clusternum_in_multicluster_perlayer_zplus_FH, + _clusternum_in_multicluster_perlayer_zplus_BH, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="NumberofLayerClustersinMultiClusterPerEventAndPerLayer" + )) + + #[M] For each multicluster: pt, eta, phi, energy, x, y, z. + hgcalMultiClustersPlotter.append("MultiClustersPtEtaPhiEneXYZ", [ + dqmfolder + ], PlotFolder( + _multicluster_pt, + _multicluster_eta, + _multicluster_phi, + _multicluster_energy, + _multicluster_x, + _multicluster_y, + _multicluster_z, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="MultiClustersPtEtaPhiEneXYZ" + )) + + #[N] Multicluster first, last, total number of layers + hgcalMultiClustersPlotter.append("NumberofMultiClusters_First_Last_NLayers", [ + dqmfolder + ], PlotFolder( + _multicluster_firstlayer, + _multicluster_lastlayer, + _multicluster_layersnum, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="NumberofMultiClusters_First_Last_NLayers" + )) + + #[O] Multiplicity of layer clusters in multicluster + hgcalMultiClustersPlotter.append("Multiplicity", [ + dqmfolder + ], PlotFolder( + _multiplicityOfLCinMCL, + _multiplicityOfLCinMCL_vs_layerclusterenergy, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Multiplicity", + numberOfEventsHistogram=_multiplicity_numberOfEventsHistogram + )) + + #We append here two PlotFolder because we want the text to be in percent + #and the number of events are different in zplus and zminus + hgcalMultiClustersPlotter.append("Multiplicity", [ + dqmfolder + ], PlotFolder( + _multiplicityOfLCinMCL_vs_layercluster_zminus, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Multiplicity", + numberOfEventsHistogram=_multiplicity_zminus_numberOfEventsHistogram + )) + + hgcalMultiClustersPlotter.append("Multiplicity", [ + dqmfolder + ], PlotFolder( + _multiplicityOfLCinMCL_vs_layercluster_zplus, + loopSubFolders=False, + purpose=PlotPurpose.Timing, page="Multiplicity", + numberOfEventsHistogram=_multiplicity_zplus_numberOfEventsHistogram + )) -#We append here two PlotFolder because we want the text to be in percent -#and the number of events are different in zplus and zminus -hgcalMultiClustersPlotter.append("Multiplicity", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _multiplicityOfLCinMCL_vs_layercluster_zminus, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Multiplicity", - numberOfEventsHistogram=_multiplicity_zminus_numberOfEventsHistogram - )) + return hgcalMultiClustersPlotter -hgcalMultiClustersPlotter.append("Multiplicity", [ - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersMerge", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersTrk", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersEM", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/ticlMultiClustersFromTrackstersHAD", - "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/hgcalMultiClusters", - ], PlotFolder( - _multiplicityOfLCinMCL_vs_layercluster_zplus, - loopSubFolders=False, - purpose=PlotPurpose.Timing, page="Multiplicity", - numberOfEventsHistogram=_multiplicity_zplus_numberOfEventsHistogram - )) #================================================================================================= # hitValidation diff --git a/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py b/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py index 0a24d270d74eb..eca79bace0f0a 100755 --- a/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py +++ b/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py @@ -29,8 +29,8 @@ def main(opts): if opts.collection=="hgcalLayerClusters": hgclayclus = [hgcalPlots.hgcalLayerClustersPlotter] val.doPlots(hgclayclus, plotterDrawArgs=drawArgs) - elif opts.collection in ["hgcalMultiClusters", "multiClustersFromTrackstersMIP", "multiClustersFromTrackstersTrk", "multiClustersFromTrackstersEM", "multiClustersFromTrackstersHAD"]: - hgcmulticlus = [hgcalPlots.hgcalMultiClustersPlotter] + elif opts.collection in ["ticlMultiClustersFromTrackstersMerge","ticlMultiClustersFromTrackstersTrk","ticlMultiClustersFromTrackstersEM","ticlMultiClustersFromTrackstersHAD"]: + hgcmulticlus = [hgcalPlots.create_hgcalMultiClustersPlotter(opts.collection)] val.doPlots(hgcmulticlus, plotterDrawArgs=drawArgs) elif opts.collection=="hitValidation": hgchit = [hgcalPlots.hgcalHitPlotter] @@ -97,13 +97,13 @@ def main(opts): help="Validation name for HTML page generation (enters to element) (default '')") parser.add_argument("--verbose", action="store_true", default = False, help="Be verbose") - parser.add_argument("--collection", choices=["hgcalLayerClusters", "hgcalMultiClusters", "multiClustersFromTrackstersMIP", "multiClustersFromTrackstersTrk", "multiClustersFromTrackstersEM", "multiClustersFromTrackstersHAD", "hitValidation", "hitCalibration", "all"], default="hgcalLayerClusters", - help="Choose output plots collections: hgcalLayerCluster, hgcalMultiClusters, multiClustersFromTrackstersMIP, multiClustersFromTrackstersTrk, multiClustersFromTrackstersEM, multiClustersFromTrackstersHAD, hitValidation, hitCalibration, all") + parser.add_argument("--collection", choices=["hgcalLayerClusters", "ticlMultiClustersFromTrackstersMerge","ticlMultiClustersFromTrackstersTrk","ticlMultiClustersFromTrackstersEM","ticlMultiClustersFromTrackstersHAD", "hitValidation", "hitCalibration", "all"], default="hgcalLayerClusters", + help="Choose output plots collections: hgcalLayerCluster, ticlMultiClustersFromTrackstersMerge, ticlMultiClustersFromTrackstersTrk, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD, hitValidation, hitCalibration, all") opts = parser.parse_args() if opts.collection == "all" and len(opts.outputDir)==1: - raise RuntimeError("need to assign names for all dirrectories") + raise RuntimeError("need to assign names for all directories") for f in opts.files: if not os.path.exists(f): From ba6ac6933890e76219dd49d1f6e5381c8e7b1a9d Mon Sep 17 00:00:00 2001 From: Andrzej <novak@physik.rwth-aachen.de> Date: Mon, 5 Oct 2020 16:34:55 +0200 Subject: [PATCH 239/778] fix: add new vars to dqm --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 759ee13f16c94..4c9089be7c537 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -124,10 +124,13 @@ Plot1D('btagCMVA', 'btagCMVA', 20, -1, 1, 'CMVA V2 btag discriminator'), Plot1D('btagCSVV2', 'btagCSVV2', 20, -1, 1, ' pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)'), Plot1D('btagDDBvL', 'btagDDBvL', 20, -1, 1, 'DeepDoubleX (mass-decorrelated) discriminator for H(Z)->bb vs QCD'), + Plot1D('btagDDBvLV2', 'btagDDBvLV2', 20, 0, 1, 'DeepDoubleX V2(mass-decorrelated) discriminator for H(Z)->bb vs QCD'), Plot1D('btagDDBvL_noMD', 'btagDDBvL_noMD', 20, 0, 1, 'DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->bb vs QCD'), Plot1D('btagDDCvB', 'btagDDCvB', 20, -1, 1, 'DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs H(Z)->bb'), + Plot1D('btagDDCvBV2', 'btagDDCvBV2', 20, 0, 1, 'DeepDoubleX V2 (mass-decorrelated) discriminator for H(Z)->cc vs H(Z)->bb'), Plot1D('btagDDCvB_noMD', 'btagDDCvB_noMD', 20, 0, 1, 'DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs H(Z)->bb'), Plot1D('btagDDCvL', 'btagDDCvL', 20, -1, 1, 'DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs QCD'), + Plot1D('btagDDCvLV2', 'btagDDCvLV2', 20, 0, 1, 'DeepDoubleX V2 (mass-decorrelated) discriminator for H(Z)->cc vs QCD'), Plot1D('btagDDCvL_noMD', 'btagDDCvL_noMD', 20, 0, 1, 'DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs QCD'), Plot1D('btagDeepB', 'btagDeepB', 20, -1, 1, 'Deep B+BB btag discriminator'), Plot1D('btagHbb', 'btagHbb', 20, -1, 1, 'Higgs to BB tagger discriminator'), @@ -342,8 +345,13 @@ Plot1D('btagCSVV2', 'btagCSVV2', 20, -1, 1, ' pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)'), Plot1D('btagDeepB', 'btagDeepB', 20, -1, 1, 'Deep B+BB btag discriminator'), Plot1D('btagDeepC', 'btagDeepC', 20, 0, 1, 'DeepCSV charm btag discriminator'), + Plot1D('btagDeepCvB', 'btagDeepCvB', 20, -1, 1, 'DeepCSV c vs b+bb discriminator'), + Plot1D('btagDeepCvL', 'btagDeepCvL', 20, -1, 1, 'DeepCSV c vs udsg discriminator'), Plot1D('btagDeepFlavB', 'btagDeepFlavB', 20, 0, 1, 'DeepFlavour b+bb tag discriminator'), Plot1D('btagDeepFlavC', 'btagDeepFlavC', 20, 0, 1, 'DeepFlavour charm tag discriminator'), + Plot1D('btagDeepFlavCvB', 'btagDeepFlavCvB', 20, -1, 1, 'DeepJet c vs b+bb+lepb discriminator'), + Plot1D('btagDeepFlavCvL', 'btagDeepFlavCvL', 20, -1, 1, 'DeepJet c vs uds+g discriminator'), + Plot1D('btagDeepFlavQG', 'btagDeepFlavQG', 20, -1, 1, 'DeepJet g vs uds discriminator'), Plot1D('cRegCorr', 'cRegCorr', 20, 0.6, 2, 'pt correction for c-jet energy regression'), Plot1D('cRegRes', 'cRegRes', 20, 0.05, 0.4, 'res on pt corrected with c-jet regression'), Plot1D('chEmEF', 'chEmEF', 20, 0, 1, 'charged Electromagnetic Energy Fraction'), @@ -608,6 +616,7 @@ Plot1D('btagCSVV2', 'btagCSVV2', 20, -1, 1, ' pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)'), Plot1D('btagDeepB', 'btagDeepB', 20, -1, 1, 'Deep B+BB btag discriminator'), Plot1D('eta', 'eta', 20, -4, 4, 'eta'), + Plot1D('hadronFlavour', 'hadronFlavour', 6, -0.5, 5.5, 'flavour from hadron ghost clustering'), Plot1D('mass', 'mass', 20, -200, 200, 'mass'), Plot1D('n2b1', 'n2b1', 20, 0, 1, 'N2 (beta=1)'), Plot1D('n3b1', 'n3b1', 20, 0, 5, 'N3 (beta=1)'), From 7c98cc7f7da3c70d64548c69ede92f3f75d2aefb Mon Sep 17 00:00:00 2001 From: Erica Brondolin <erica.brondolin@cern.ch> Date: Mon, 5 Oct 2020 16:39:50 +0200 Subject: [PATCH 240/778] Add hgcalMultiClusters which currently is not used by default --- .../HGCalValidation/scripts/makeHGCalValidationPlots.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py b/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py index eca79bace0f0a..ef16b1ead2244 100755 --- a/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py +++ b/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py @@ -29,7 +29,7 @@ def main(opts): if opts.collection=="hgcalLayerClusters": hgclayclus = [hgcalPlots.hgcalLayerClustersPlotter] val.doPlots(hgclayclus, plotterDrawArgs=drawArgs) - elif opts.collection in ["ticlMultiClustersFromTrackstersMerge","ticlMultiClustersFromTrackstersTrk","ticlMultiClustersFromTrackstersEM","ticlMultiClustersFromTrackstersHAD"]: + elif opts.collection in ["hgcalMultiClusters","ticlMultiClustersFromTrackstersMerge","ticlMultiClustersFromTrackstersTrk","ticlMultiClustersFromTrackstersEM","ticlMultiClustersFromTrackstersHAD"]: hgcmulticlus = [hgcalPlots.create_hgcalMultiClustersPlotter(opts.collection)] val.doPlots(hgcmulticlus, plotterDrawArgs=drawArgs) elif opts.collection=="hitValidation": @@ -97,8 +97,8 @@ def main(opts): help="Validation name for HTML page generation (enters to <title> element) (default '')") parser.add_argument("--verbose", action="store_true", default = False, help="Be verbose") - parser.add_argument("--collection", choices=["hgcalLayerClusters", "ticlMultiClustersFromTrackstersMerge","ticlMultiClustersFromTrackstersTrk","ticlMultiClustersFromTrackstersEM","ticlMultiClustersFromTrackstersHAD", "hitValidation", "hitCalibration", "all"], default="hgcalLayerClusters", - help="Choose output plots collections: hgcalLayerCluster, ticlMultiClustersFromTrackstersMerge, ticlMultiClustersFromTrackstersTrk, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD, hitValidation, hitCalibration, all") + parser.add_argument("--collection", choices=["hgcalLayerClusters", "hgcalMultiClusters", "ticlMultiClustersFromTrackstersMerge", "ticlMultiClustersFromTrackstersTrk", "ticlMultiClustersFromTrackstersEM", "ticlMultiClustersFromTrackstersHAD", "hitValidation", "hitCalibration", "all"], default="hgcalLayerClusters", + help="Choose output plots collections: hgcalLayerCluster, hgcalMultiClusters, ticlMultiClustersFromTrackstersMerge, ticlMultiClustersFromTrackstersTrk, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD, hitValidation, hitCalibration, all") opts = parser.parse_args() From 100022661c183622adb014052e2ecc07cbc79d24 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Mon, 5 Oct 2020 16:56:58 +0200 Subject: [PATCH 241/778] Important: should NOT stop once copy number only have been compared, should still do the volume name comparison. --- DetectorDescription/DDCMS/src/DDFilteredView.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index fb20cff1e59d1..dce8c973df705 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -477,7 +477,7 @@ std::string_view DDFilteredView::get<string_view>(const string& key) { currentSpecPar_ = find(key); if (currentSpecPar_ != nullptr) { - result = currentSpecPar_->strValue(key); + result = currentSpecPar_->strValue(key); /// Dont use that ir doesnt work } return result; } @@ -613,7 +613,7 @@ const ExpandedNodes& DDFilteredView::history() { return nodes_; } - +//mySpecParSection->value<std::vector<T>>(parameterName); const DDSpecPar* DDFilteredView::find(const std::string& key) const { DDSpecParRefs refs; registry_->filter(refs, key, ""); @@ -636,13 +636,13 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { if (name.find(':') == name.npos) { refname.remove_prefix(rpos + 1); } - } + } // dont understand this + + // compare copy number auto cpos = refname.rfind('['); if (cpos != refname.npos) { if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum()) { refname.remove_suffix(refname.size() - cpos); - flag = true; - continue; } else { flag = false; break; From f2cded6e979943c73b5452b6c48f8a76b4fb8eaa Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Mon, 5 Oct 2020 16:57:44 +0200 Subject: [PATCH 242/778] continue statement does not harm here, but is not useful, so avoid make things heavier --- DetectorDescription/DDCMS/src/DDFilteredView.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index dce8c973df705..5d49680dcd965 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -654,7 +654,6 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { break; } else { flag = true; - continue; } } else { if (!regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))) { @@ -662,7 +661,6 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { break; } else { flag = true; - continue; } } } From 5bef95bb4ff94164727e87291dee509f9e3cef9f Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Mon, 5 Oct 2020 17:01:43 +0200 Subject: [PATCH 243/778] comments --- .../DDCMS/src/DDFilteredView.cc | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 5d49680dcd965..1ff15905e851d 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -638,7 +638,7 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { } } // dont understand this - // compare copy number + // Compare copy number. auto cpos = refname.rfind('['); if (cpos != refname.npos) { if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum()) { @@ -648,22 +648,20 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { break; } } - if (!dd4hep::dd::isRegex(refname)) { - if (!dd4hep::dd::compareEqual(name, refname)) { - flag = false; - break; - } else { - flag = true; - } - } else { - if (!regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))) { - flag = false; - break; - } else { - flag = true; - } - } + + // Now that copy numbers are compared, compare the rest: the volume names. + const bool isRegex = dd4hep::dd::isRegex(refname); + const bool areVolumeNamesEqual = (!isRegex ? + dd4hep::dd::compareEqual(name, refname) + : regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))); + if (!areVolumeNamesEqual) { + flag = false; + break; + } else { + flag = true; + } } + return flag; }); if (k != end(i->paths)) { From 45b819969ba24b61eba8a2b465c7feafbcdd818e Mon Sep 17 00:00:00 2001 From: Ernesto Migliore <ernesto.migliore@cern.ch> Date: Fri, 11 Sep 2020 06:55:12 +0200 Subject: [PATCH 244/778] remove deprecated phase-2 geometries and workflows D51, D54, D56, D57, D58, D59, D61, D62 and w/f --- Configuration/Geometry/README.md | 14 +- .../python/GeometryExtended2026D51Reco_cff.py | 60 -------- .../python/GeometryExtended2026D51_cff.py | 13 -- .../python/GeometryExtended2026D54Reco_cff.py | 60 -------- .../python/GeometryExtended2026D54_cff.py | 13 -- .../python/GeometryExtended2026D56Reco_cff.py | 60 -------- .../python/GeometryExtended2026D56_cff.py | 13 -- .../python/GeometryExtended2026D57Reco_cff.py | 60 -------- .../python/GeometryExtended2026D57_cff.py | 13 -- .../python/GeometryExtended2026D58Reco_cff.py | 63 -------- .../python/GeometryExtended2026D58_cff.py | 16 --- .../python/GeometryExtended2026D59Reco_cff.py | 60 -------- .../python/GeometryExtended2026D59_cff.py | 13 -- .../python/GeometryExtended2026D61Reco_cff.py | 60 -------- .../python/GeometryExtended2026D61_cff.py | 13 -- .../python/GeometryExtended2026D62Reco_cff.py | 60 -------- .../python/GeometryExtended2026D62_cff.py | 13 -- .../Geometry/python/dict2026Geometry.py | 116 +-------------- .../PyReleaseValidation/python/relval_2026.py | 8 -- .../StandardSequences/python/GeometryConf.py | 8 -- .../cmsExtendedGeometry2026D51XML_cfi.py | 128 ----------------- .../cmsExtendedGeometry2026D54XML_cfi.py | 128 ----------------- .../cmsExtendedGeometry2026D56XML_cfi.py | 128 ----------------- .../cmsExtendedGeometry2026D57XML_cfi.py | 128 ----------------- .../cmsExtendedGeometry2026D58XML_cfi.py | 135 ------------------ .../cmsExtendedGeometry2026D59XML_cfi.py | 129 ----------------- .../cmsExtendedGeometry2026D61XML_cfi.py | 128 ----------------- .../cmsExtendedGeometry2026D62XML_cfi.py | 129 ----------------- 28 files changed, 5 insertions(+), 1764 deletions(-) delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D51Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D51_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D54Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D54_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D56Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D56_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D57Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D57_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D58Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D58_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D59Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D59_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D61Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D61_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D62Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D62_cff.py delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D51XML_cfi.py delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D54XML_cfi.py delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D56XML_cfi.py delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D57XML_cfi.py delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D58XML_cfi.py delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D59XML_cfi.py delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D61XML_cfi.py delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D62XML_cfi.py diff --git a/Configuration/Geometry/README.md b/Configuration/Geometry/README.md index b56045838cabb..2fe809a6ab33f 100644 --- a/Configuration/Geometry/README.md +++ b/Configuration/Geometry/README.md @@ -34,10 +34,8 @@ Different versions of various subdetectors can be combined. The available versio Tracker: * T15: Phase2 tilted tracker (v6.1.6) w/ phase 2 pixel (v6.1.3) (Active geometry: same as T14. Material Budget: major update in IT, gathering info from recent Mechanical designs.) -* T17: Phase2 tilted tracker (v6.1.6) w/ phase 2 pixel (v6.1.5) TFPX: Changed sensors spacing within all double-disks + Increased distance between Disks 6 and 7 + Put TBPX portcards between Disks 6 and 7. -* T19: Phase2 tilted tracker (v6.1.6) w/ phase 2 pixel (v7.0.0) Inner Tracker description with 3D sensors in TBPX L1 + TBPX L2 + TFPX R1. -* T20: Phase2 tilted tracker. Outer Tracker (v6.1.6): All sensors 200 um -> 290 um + Update in Module MB + PS modules: s-sensor 164 um longer + Major update in OTST MB. Inner Tracker: (v6.1.5) from T17 is called. -* T21: Phase2 tilted tracker. Outer Tracker (v8.0.0): TBPS update in Layer 1 (facilitate IT insertion) + In all TEDD, update sensors Z inter-spacing. Inner Tracker: (v6.1.5) from T17. +* T21: Phase2 tilted tracker. Outer Tracker (v8.0.0): TBPS update in Layer 1 (facilitate IT insertion) + In all TEDD, update sensors Z inter-spacing. Inner Tracker: (v6.1.5) from previous T17 +(TFPX: Changed sensors spacing within all double-disks + Increased distance between Disks 6 and 7 + TBPX portcards between Disks 6 and 7.) * T22: Phase2 tilted tracker. Outer Tracker (v8.0.0): same as T21. Inner Tracker: Based on (v6.1.5) (T21), but with 50x50 pixel aspect ratio everywhere. * T23: Phase2 tilted tracker. Outer Tracker (v8.0.0): same as T21. Inner Tracker: Based on (v6.1.5) (T21), but with 3D sensors in TBPX L1 + TBPX L2 + TFPX R1. @@ -76,16 +74,8 @@ The script also handles the common and forward elements of the geometry: Several detector combinations have been generated: * D49 = T15+C9+M4+I10+O4+F2 * D50 = T15+C9+M4+I11+O4+F2 -* D51 = T17+C9+M4+I10+O4+F2 * D53 = T15+C9+M4+I12+O4+F2 -* D54 = T19+C9+M4+I10+O4+F2 -* D56 = T20+C9+M4+I10+O4+F2 -* D57 = T17+C11+M6+I11+O5+F4 -* D58 = T17+C12+M6+I11+O5+F5 -* D59 = T17+C13+M7+I11+O6+F6 * D60 = T15+C10+M4+I10+O4+F3 -* D61 = T17+C9+M5+I10+O4+F2 -* D62 = T17+C14+M7+I11+O7+F6 * D63 = T21+C11+M4+I11+O5+F4 * D64 = T22+C11+M4+I11+O5+F4 * D65 = T23+C11+M4+I11+O5+F4 diff --git a/Configuration/Geometry/python/GeometryExtended2026D51Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D51Reco_cff.py deleted file mode 100644 index fbd8cda7ebe2b..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D51Reco_cff.py +++ /dev/null @@ -1,60 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D51_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive" - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cfi import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cfi import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D51_cff.py b/Configuration/Geometry/python/GeometryExtended2026D51_cff.py deleted file mode 100644 index 48211910a9c40..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D51_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D51XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D54Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D54Reco_cff.py deleted file mode 100644 index 4bc99569efaac..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D54Reco_cff.py +++ /dev/null @@ -1,60 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D54_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive" - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cfi import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cfi import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D54_cff.py b/Configuration/Geometry/python/GeometryExtended2026D54_cff.py deleted file mode 100644 index 1d77b0915d6aa..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D54_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D54XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D56Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D56Reco_cff.py deleted file mode 100644 index 1220baa28a049..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D56Reco_cff.py +++ /dev/null @@ -1,60 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D56_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive" - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cfi import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cfi import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D56_cff.py b/Configuration/Geometry/python/GeometryExtended2026D56_cff.py deleted file mode 100644 index 9d49bb981e8fb..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D56_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D56XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D57Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D57Reco_cff.py deleted file mode 100644 index 68e355e71e988..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D57Reco_cff.py +++ /dev/null @@ -1,60 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D57_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive" - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D57_cff.py b/Configuration/Geometry/python/GeometryExtended2026D57_cff.py deleted file mode 100644 index 35d72ada0d153..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D57_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D57XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D58Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D58Reco_cff.py deleted file mode 100644 index b1d66af797243..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D58Reco_cff.py +++ /dev/null @@ -1,63 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D58_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.HFNoseTopology_cfi import * -from Geometry.ForwardGeometry.HFNoseGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive", - "HGCalHFNoseSensitive", - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D58_cff.py b/Configuration/Geometry/python/GeometryExtended2026D58_cff.py deleted file mode 100644 index b22a26b360e99..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D58_cff.py +++ /dev/null @@ -1,16 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D58XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.ForwardCommonData.hfnoseParametersInitialization_cfi import * -from Geometry.ForwardCommonData.hfnoseNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * - -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D59Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D59Reco_cff.py deleted file mode 100644 index 6ddd2da8ed4c4..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D59Reco_cff.py +++ /dev/null @@ -1,60 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D59_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive" - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D59_cff.py b/Configuration/Geometry/python/GeometryExtended2026D59_cff.py deleted file mode 100644 index 30d2925623d5f..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D59_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D59XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D61Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D61Reco_cff.py deleted file mode 100644 index 20f04b1fd9c4f..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D61Reco_cff.py +++ /dev/null @@ -1,60 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D61_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive" - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cfi import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cfi import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D61_cff.py b/Configuration/Geometry/python/GeometryExtended2026D61_cff.py deleted file mode 100644 index 4cfd417095473..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D61_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D61XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D62Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D62Reco_cff.py deleted file mode 100644 index f4ed0aa8521ea..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D62Reco_cff.py +++ /dev/null @@ -1,60 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D62_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive" - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D62_cff.py b/Configuration/Geometry/python/GeometryExtended2026D62_cff.py deleted file mode 100644 index e1e8bd16f8e03..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D62_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D62XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index 9ec1c45ce6809..99115fab9469d 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -153,108 +153,6 @@ ], "era" : "phase2_tracker, trackingPhase2PU140", }, - "T17" : { - 1 : [ - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker613_MB_2019_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - ], - "sim" : [ - 'from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import *', - ], - "reco" : [ - 'from Geometry.CommonTopologies.globalTrackingGeometry_cfi import *', - 'from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *', - 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', - 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', - 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', - ], - "era" : "phase2_tracker, trackingPhase2PU140", - }, - "T19" : { - 1 : [ - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker700/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker700/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker700/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker700/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker700/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - ], - "sim" : [ - 'from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import *', - ], - "reco" : [ - 'from Geometry.CommonTopologies.globalTrackingGeometry_cfi import *', - 'from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *', - 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', - 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', - 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', - ], - "era" : "phase2_tracker, trackingPhase2PU140", - }, - "T20" : { - 1 : [ - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - ], - "sim" : [ - 'from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import *', - ], - "reco" : [ - 'from Geometry.CommonTopologies.globalTrackingGeometry_cfi import *', - 'from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *', - 'from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *', - 'from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *', - 'from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *', - 'trackerGeometry.applyAlignment = cms.bool(False)', - ], - "era" : "phase2_tracker, trackingPhase2PU140", - }, "T21" : { 1 : [ 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', @@ -1034,7 +932,7 @@ 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', 'Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml', 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', ], @@ -1343,16 +1241,8 @@ detectorVersionDict = { ("O4","T15","C9","M4","F2","I10") : "D49", ("O4","T15","C9","M4","F2","I11") : "D50", - ("O4","T17","C9","M4","F2","I10") : "D51", ("O4","T15","C9","M4","F2","I12") : "D53", - ("O4","T19","C9","M4","F2","I10") : "D54", - ("O4","T20","C9","M4","F2","I10") : "D56", - ("O5","T17","C11","M6","F4","I11") : "D57", - ("O5","T17","C12","M6","F5","I11") : "D58", - ("O6","T17","C13","M7","F6","I11") : "D59", ("O4","T15","C10","M4","F3","I10") : "D60", - ("O4","T17","C9","M5","F2","I10") : "D61", - ("O7","T17","C14","M7","F6","I11") : "D62", ("O5","T21","C11","M4","F4","I11") : "D63", ("O5","T22","C11","M4","F4","I11") : "D64", ("O5","T23","C11","M4","F4","I11") : "D65", @@ -1360,5 +1250,5 @@ ("O5","T21","C11","M9","F4","I11") : "D67", } -deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D52", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D55" ]) -deprecatedSubdets = set([ "T1", "T2" ,"T3", "T4", "T7", "T8", "T9", "T10", "T11", "T12", "T13", "T18", "C1", "C2", "C3", "C5", "C7", "M1", "I1", "I2", "I3", "I4", "I6", "I8", "O1", "F1", "T5" ,"T6", "T14", "T16", "C4", "C6", "C8", "M2", "M3", "I5", "I7", "I9", "O2", "O3" ]) +deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D51", "D52", "D54", "D55", "D56", "D57", "D58", "D59", "D61", "D62" ]) +deprecatedSubdets = set([ "T1", "T2" ,"T3", "T4", "T5", "T6", "T7", "T8", "T9", "T10", "T11", "T12", "T13", "T14", "T16", "T17", "T18", "T19", "T20", "C1", "C2", "C3", "C5", "C7", "M1", "I1", "I2", "I3", "I4", "I6", "I8", "O1", "F1", "C4", "C6", "C8", "M2", "M3", "I5", "I7", "I9", "O2", "O3" ]) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index 60c8042e44598..5445eb806179c 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -19,15 +19,7 @@ numWFIB.extend([23434.99,23434.999]) #2026D49 premixing combined stage1+stage2 (ttbar+PU200, ttbar+PU50 for PR test) numWFIB.extend([23234.21,23434.21]) #2026D49 prodlike, prodlike PU numWFIB.extend([23234.103]) #2026D49 aging -numWFIB.extend([23634.0]) #2026D51 -numWFIB.extend([24834.0]) #2026D54 -numWFIB.extend([26634.0]) #2026D56 -numWFIB.extend([27034.0]) #2026D57 -numWFIB.extend([27434.0]) #2026D58 -numWFIB.extend([27834.0]) #2026D59 numWFIB.extend([28234.0]) #2026D60 -numWFIB.extend([28634.0]) #2026D61 -numWFIB.extend([29034.0]) #2026D62 numWFIB.extend([29434.0]) #2026D63 numWFIB.extend([29834.0]) #2026D64 numWFIB.extend([30234.0]) #2026D65 diff --git a/Configuration/StandardSequences/python/GeometryConf.py b/Configuration/StandardSequences/python/GeometryConf.py index a6df62840627b..d342e548203d2 100644 --- a/Configuration/StandardSequences/python/GeometryConf.py +++ b/Configuration/StandardSequences/python/GeometryConf.py @@ -33,16 +33,8 @@ 'HCal' : 'Configuration.Geometry.GeometrySimHCAL_cff,Configuration.Geometry.GeometryRecoHCAL_cff', 'Extended2026D49' : 'Extended2026D49,Extended2026D49Reco', 'Extended2026D50' : 'Extended2026D50,Extended2026D50Reco', - 'Extended2026D51' : 'Extended2026D51,Extended2026D51Reco', 'Extended2026D53' : 'Extended2026D53,Extended2026D53Reco', - 'Extended2026D54' : 'Extended2026D54,Extended2026D54Reco', - 'Extended2026D56' : 'Extended2026D56,Extended2026D56Reco', - 'Extended2026D57' : 'Extended2026D57,Extended2026D57Reco', - 'Extended2026D58' : 'Extended2026D58,Extended2026D58Reco', - 'Extended2026D59' : 'Extended2026D59,Extended2026D59Reco', 'Extended2026D60' : 'Extended2026D60,Extended2026D60Reco', - 'Extended2026D61' : 'Extended2026D61,Extended2026D61Reco', - 'Extended2026D62' : 'Extended2026D62,Extended2026D62Reco', 'Extended2026D63' : 'Extended2026D63,Extended2026D63Reco', 'Extended2026D64' : 'Extended2026D64,Extended2026D64Reco', 'Extended2026D65' : 'Extended2026D65,Extended2026D65Reco', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D51XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D51XML_cfi.py deleted file mode 100644 index 7fc74ce80443d..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D51XML_cfi.py +++ /dev/null @@ -1,128 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v3/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v2/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v3/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v1/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker613_MB_2019_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v11/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v11/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v11/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v11/hgcalCons.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v2/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v2/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v1/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v2/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v2/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2017/v1/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/btl.xml', - 'Geometry/MTDCommonData/data/etl/v2/etl.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/v3/mtd.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/CrystalBarPhiFlat/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/CrystalBarPhiFlat/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D54XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D54XML_cfi.py deleted file mode 100644 index dc7b0b5bdeb17..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D54XML_cfi.py +++ /dev/null @@ -1,128 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v3/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v2/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v3/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v1/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker700/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker700/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker700/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker700/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker700/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v11/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v11/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v11/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v11/hgcalCons.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v2/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v2/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v1/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v2/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v2/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2017/v1/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/btl.xml', - 'Geometry/MTDCommonData/data/etl/v2/etl.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/v3/mtd.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/CrystalBarPhiFlat/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/CrystalBarPhiFlat/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D56XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D56XML_cfi.py deleted file mode 100644 index 0485973e3253e..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D56XML_cfi.py +++ /dev/null @@ -1,128 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v3/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v2/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v3/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v1/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v11/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v11/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v11/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v11/hgcalCons.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v2/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v2/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v1/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v2/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v2/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2017/v1/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/btl.xml', - 'Geometry/MTDCommonData/data/etl/v2/etl.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/v3/mtd.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/CrystalBarPhiFlat/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/CrystalBarPhiFlat/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D57XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D57XML_cfi.py deleted file mode 100644 index d7007771da85f..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D57XML_cfi.py +++ /dev/null @@ -1,128 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v4/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker613_MB_2019_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v5/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', - 'Geometry/MTDCommonData/data/btl/v1/btl.xml', - 'Geometry/MTDCommonData/data/etl/v3/etl.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/v1/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D58XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D58XML_cfi.py deleted file mode 100644 index 23e083e13d894..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D58XML_cfi.py +++ /dev/null @@ -1,135 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v4/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker613_MB_2019_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml', - 'Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml', - 'Geometry/ForwardCommonData/data/hfnoseCell/v1/hfnoseCell.xml', - 'Geometry/ForwardCommonData/data/hfnoseWafer/v1/hfnoseWafer.xml', - 'Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml', - 'Geometry/ForwardCommonData/data/hfnoseCons/v1m/hfnoseCons.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v5/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2026/v3/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/brm/2026/v2/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', - 'Geometry/MTDCommonData/data/btl/v1/btl.xml', - 'Geometry/MTDCommonData/data/etl/v3/etl.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/ForwardSimData/data/hfnosesens.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/v1/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/ForwardSimData/data/hfnoseProdCuts.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D59XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D59XML_cfi.py deleted file mode 100644 index 2f23ccc8574e8..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D59XML_cfi.py +++ /dev/null @@ -1,129 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v5/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v4/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker613_MB_2019_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v13/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v13/hgcalCons.xml', - 'Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v6/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', - 'Geometry/MTDCommonData/data/btl/v1/btl.xml', - 'Geometry/MTDCommonData/data/etl/v3/etl.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/v1/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D61XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D61XML_cfi.py deleted file mode 100644 index 90072999192c1..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D61XML_cfi.py +++ /dev/null @@ -1,128 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v3/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v2/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v3/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v1/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker613_MB_2019_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v11/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v11/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v11/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v11/hgcalCons.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v3/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v3/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v2/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2017/v1/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/btl.xml', - 'Geometry/MTDCommonData/data/etl/v2/etl.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/v3/mtd.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/CrystalBarPhiFlat/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/CrystalBarPhiFlat/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/CrystalBarPhiFlat/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D62XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D62XML_cfi.py deleted file mode 100644 index 81048dea638af..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D62XML_cfi.py +++ /dev/null @@ -1,129 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v5/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v5/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613_MB_2019_04/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/TiltedTracker613_MB_2019_04/trackerRecoMaterial.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v14/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml', - 'Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v6/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', - 'Geometry/MTDCommonData/data/btl/v1/btl.xml', - 'Geometry/MTDCommonData/data/etl/v3/etl.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/v1/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) From f81a9b4e396258f7b9fb73653d31755ef3aa9342 Mon Sep 17 00:00:00 2001 From: Ernesto Migliore <ernesto.migliore@cern.ch> Date: Thu, 24 Sep 2020 16:27:59 +0200 Subject: [PATCH 245/778] remove deprecated phase-2 geometries and workflows D51, D54, D56, D57, D58, D59, D61, D62 and w/f --- Configuration/AlCa/python/autoCondPhase2.py | 30 +++------------------ 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/Configuration/AlCa/python/autoCondPhase2.py b/Configuration/AlCa/python/autoCondPhase2.py index 4df41cc2b5e23..23bcacb4b6427 100644 --- a/Configuration/AlCa/python/autoCondPhase2.py +++ b/Configuration/AlCa/python/autoCondPhase2.py @@ -14,10 +14,8 @@ ## Active geometries: https://github.com/cms-sw/cmssw/blob/master/Configuration/Geometry/README.md ## ## T15: Phase2 tilted tracker (v6.1.6) w/ phase 2 pixel (v6.1.3) (Active geometry: same as T14. Material Budget: major update in IT, gathering info from recent Mechanical designs.) -## T17: Phase2 tilted tracker (v6.1.6) w/ phase 2 pixel (v6.1.5) TFPX: Changed sensors spacing within all double-disks + Increased distance between Disks 6 and 7 + Put TBPX portcards between Disks 6 and 7. -## T19: Phase2 tilted tracker (v6.1.6) w/ phase 2 pixel (v7.0.0) Inner Tracker description with 3D sensors in TBPX L1 + TBPX L2 + TFPX R1. -## T20: Phase2 tilted tracker. Outer Tracker (v6.1.6): All sensors 200 um -> 290 um + Update in Module MB + PS modules: s-sensor 164 um longer + Major update in OTST MB. Inner Tracker: (v6.1.5) from T17 is called. -## T21: Phase2 tilted tracker. Outer Tracker (v8.0.0): TBPS update in Layer 1 (facilitate IT insertion) + In all TEDD, update sensors Z inter-spacing. Inner Tracker: (v6.1.5) from T17. +## T21: Phase2 tilted tracker. Outer Tracker (v8.0.0): TBPS update in Layer 1 (facilitate IT insertion) + In all TEDD, update sensors Z inter-spacing. Inner Tracker: (v6.1.5) from previous T17 +## (TFPX: Changed sensors spacing within all double-disks + Increased distance between Disks 6 and 7 + TBPX portcards between Disks 6 and 7.) ## T22: Phase2 tilted tracker. Outer Tracker (v8.0.0): same as T21. Inner Tracker: Based on (v6.1.5) (T21), but with 50x50 pixel aspect ratio everywhere. ## T23: Phase2 tilted tracker. Outer Tracker (v8.0.0): same as T21. Inner Tracker: Based on (v6.1.5) (T21), but with 3D sensors in TBPX L1 + TBPX L2 + TFPX R1. ## @@ -27,9 +25,6 @@ allTags["LA"] = { 'T15' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_v5_mc' ,SiPixelLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) - 'T17' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_v5_mc' ,SiPixelLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) - 'T19' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T19_v1_mc' ,SiPixelLARecord,connectionString, "", "2020-02-23 14:00:00.000"] ), ), #uH = 0.053/T (TBPX L3,L4), uH=0.0/T (TBPX L1,L2, TEPX+TFPX) - 'T20' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_v5_mc' ,SiPixelLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) 'T21' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_v5_mc' ,SiPixelLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) 'T22' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_v5_mc' ,SiPixelLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) 'T23' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T19_v1_mc' ,SiPixelLARecord,connectionString, "", "2020-02-23 14:00:00.000"] ), ), #uH = 0.053/T (TBPX L3,L4), uH=0.0/T (TBPX L1,L2, TEPX+TFPX) @@ -37,9 +32,6 @@ allTags["LAWidth"] = { 'T15' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (fall-back to offset) - 'T17' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (fall-back to offset) - 'T19' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T19_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2020-02-23 14:00:00.000"] ), ), # uH=0.0/T (fall-back to offset) - 'T20' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (fall-back to offset) 'T21' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (fall-back to offset) 'T22' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (fall-back to offset) 'T23' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T19_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2020-02-23 14:00:00.000"] ), ), # uH=0.0/T (fall-back to offset) @@ -47,9 +39,6 @@ allTags["LAfromAlignment"] = { 'T15' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (not in use) - 'T17' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (not in use) - 'T19' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T19_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2020-02-23 14:00:00.000"] ), ), # uH=0.0/T (not in use) - 'T20' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (not in use) 'T21' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (not in use) 'T22' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (not in use) 'T23' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T19_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2020-02-23 14:00:00.000"] ), ), # uH=0.0/T (not in use) @@ -57,9 +46,6 @@ allTags["SimLA"] = { 'T15' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T15_v5_mc' ,SiPixelSimLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) - 'T17' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T15_v5_mc' ,SiPixelSimLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) - 'T19' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T19_v1_mc' ,SiPixelSimLARecord,connectionString, "", "2020-02-23 14:00:00.000"] ), ), #uH = 0.053/T (TBPX L3,L4), uH=0.0/T (TBPX L1,L2, TEPX+TFPX) - 'T20' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T15_v5_mc' ,SiPixelSimLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) 'T21' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T15_v5_mc' ,SiPixelSimLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) 'T22' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T15_v5_mc' ,SiPixelSimLARecord,connectionString, "", "2020-05-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX) 'T23' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T19_v1_mc' ,SiPixelSimLARecord,connectionString, "", "2020-02-23 14:00:00.000"] ), ), #uH = 0.053/T (TBPX L3,L4), uH=0.0/T (TBPX L1,L2, TEPX+TFPX) @@ -67,16 +53,12 @@ allTags["GenError"] = { 'T15' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v6.1.5_25x100_v0_mc' ,SiPixelGenErrorRecord,connectionString, "", "2020-07-24 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V - 'T17' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v6.1.5_25x100_v0_mc' ,SiPixelGenErrorRecord,connectionString, "", "2020-07-24 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V - 'T20' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v6.1.5_25x100_v0_mc' ,SiPixelGenErrorRecord,connectionString, "", "2020-07-24 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V 'T21' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v6.1.5_25x100_v0_mc',SiPixelGenErrorRecord,connectionString, "", "2020-07-24 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V 'T22' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_IT_v6.1.5_50x50_v1_mc' ,SiPixelGenErrorRecord,connectionString, "", "2020-08-17 21:00:00"] ), ), # cell is 50um (local-x) x 50um (local-y) , VBias=350V } allTags["Template"] = { 'T15' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v6.1.5_25x100_v0_mc',SiPixelTemplatesRecord,connectionString, "", "2020-07-24 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V - 'T17' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v6.1.5_25x100_v0_mc',SiPixelTemplatesRecord,connectionString, "", "2020-07-24 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V - 'T20' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v6.1.5_25x100_v0_mc',SiPixelTemplatesRecord,connectionString, "", "2020-07-24 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V 'T21' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v6.1.5_25x100_v0_mc',SiPixelTemplatesRecord,connectionString, "", "2020-07-24 10:00:00"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V 'T22' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_IT_v6.1.5_50x50_v1_mc' ,SiPixelTemplatesRecord,connectionString, "", "2020-08-17 21:00:00"] ), ), # cell is 50um (local-x) x 50um (local-y) , VBias=350V } @@ -88,9 +70,6 @@ ''' allTags["OTLA"] = { 'T15' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngle_v0_mc' ,TrackerLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T - 'T17' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngle_v0_mc' ,TrackerLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T - 'T19' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngle_v0_mc' ,TrackerLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T - 'T20' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngle_v0_mc' ,TrackerLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T 'T21' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngle_v0_mc' ,TrackerLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T 'T22' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngle_v0_mc' ,TrackerLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T 'T23' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngle_v0_mc' ,TrackerLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T @@ -98,9 +77,6 @@ allTags["SimOTLA"] = { 'T15' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngleSim_v0_mc' ,TrackerSimLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T - 'T17' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngleSim_v0_mc' ,TrackerSimLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T - 'T19' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngleSim_v0_mc' ,TrackerSimLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T - 'T20' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngleSim_v0_mc' ,TrackerSimLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T 'T21' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngleSim_v0_mc' ,TrackerSimLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T 'T22' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngleSim_v0_mc' ,TrackerSimLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T 'T23' : ( ','.join( [ 'SiPhase2OuterTrackerLorentzAngleSim_v0_mc' ,TrackerSimLARecord,connectionString, "", "2020-07-19 17:00:00.000"] ), ), #uH = 0.07/T @@ -122,7 +98,7 @@ activeKeys = ["LA","LAWidth","SimLA","LAfromAlignment","GenError","Template"]#,"SimOTLA","OTLA"] # list of geometries supported -activeDets = ["T15","T17","T19","T20","T21","T22","T23"] +activeDets = ["T15","T21","T22","T23"] phase2GTs = {} for det in activeDets: appendedTags = () From 98a36193bf0ae8d86ddd837753ac9e97eca78d6f Mon Sep 17 00:00:00 2001 From: Ernesto Migliore <ernesto.migliore@cern.ch> Date: Thu, 24 Sep 2020 17:12:43 +0200 Subject: [PATCH 246/778] restore TDR_Eta16/gem21 in M8 after rebase in dict2026Geometry.py --- Configuration/Geometry/python/dict2026Geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index 99115fab9469d..ddc9f00e1fc90 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -932,7 +932,7 @@ 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', 'Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml', 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', ], From 79d614df85267260f0de3d9927ba1d7424943c5d Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Mon, 5 Oct 2020 17:15:46 +0200 Subject: [PATCH 247/778] remove tbb containers where they are not needed --- .../DDCMS/interface/DDCompactView.h | 5 +++ .../DDCMS/interface/DDDetector.h | 5 ++- .../DDCMS/interface/DDFilteredView.h | 4 +- .../DDCMS/interface/DDNamespace.h | 6 +-- .../DDCMS/interface/DDVectorRegistry.h | 8 ++-- .../plugins/DDVectorRegistryESProducer.cc | 7 ++- .../plugins/dd4hep/DDDefinitions2Objects.cc | 8 ++-- .../DDCMS/src/DDCompactView.cc | 43 +++++++++++++------ DetectorDescription/DDCMS/src/DDDetector.cc | 2 +- .../DDCMS/src/DDFilteredView.cc | 9 ++++ .../src/HcalParametersFromDD.cc | 22 +++++----- .../src/TrackerParametersFromDD.cc | 2 +- 12 files changed, 81 insertions(+), 40 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDCompactView.h b/DetectorDescription/DDCMS/interface/DDCompactView.h index 87192d0273ef0..1c19a9a0f58b4 100644 --- a/DetectorDescription/DDCMS/interface/DDCompactView.h +++ b/DetectorDescription/DDCMS/interface/DDCompactView.h @@ -35,6 +35,11 @@ namespace cms { template <typename T> std::vector<T> getVector(const std::string&) const; + template <typename T> + T const& get(const std::string&) const; + template <typename T> + T const& get(const std::string&, const std::string&) const; + private: const cms::DDDetector& m_det; }; diff --git a/DetectorDescription/DDCMS/interface/DDDetector.h b/DetectorDescription/DDCMS/interface/DDDetector.h index 46e7a3665f954..b1b8ec26125c7 100644 --- a/DetectorDescription/DDCMS/interface/DDDetector.h +++ b/DetectorDescription/DDCMS/interface/DDDetector.h @@ -1,6 +1,7 @@ #ifndef DetectorDescription_DDCMS_DDDetector_h #define DetectorDescription_DDCMS_DDDetector_h +#include "DetectorDescription/DDCMS/interface/DDVectorRegistry.h" #include <DD4hep/Detector.h> #include <DD4hep/SpecParRegistry.h> #include <string> @@ -13,7 +14,7 @@ namespace cms { explicit DDDetector(const std::string&, const std::string&, bool bigXML = false); DDDetector() = delete; - dd4hep::VectorsMap const& vectors() const { return m_vectors; } + cms::DDVectorsMap const& vectors() const { return m_vectors; } dd4hep::PartSelectionMap const& partsels() const { return m_partsels; } @@ -38,7 +39,7 @@ namespace cms { void processXML(const std::string&); dd4hep::Detector* m_description = nullptr; - dd4hep::VectorsMap m_vectors; + cms::DDVectorsMap m_vectors; dd4hep::PartSelectionMap m_partsels; dd4hep::SpecParRegistry m_specpars; const std::string m_tag; diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 9942b0f90b17c..4f5bafdc90938 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -20,11 +20,11 @@ // #include "DetectorDescription/DDCMS/interface/DDSolidShapes.h" #include "DetectorDescription/DDCMS/interface/ExpandedNodes.h" +#include "DetectorDescription/DDCMS/interface/DDVectorRegistry.h" #include <DD4hep/Filter.h> #include <DD4hep/SpecParRegistry.h> #include <DD4hep/Volumes.h> #include <memory> -#include <tuple> #include <vector> namespace cms { @@ -50,7 +50,6 @@ namespace cms { using DDSpecPar = dd4hep::SpecPar; using DDSpecParRefs = dd4hep::SpecParRefs; using DDSpecParRegistry = dd4hep::SpecParRegistry; - using DDVectorsMap = dd4hep::VectorsMap; using Iterator = TGeoIterator; using Node = TGeoNode; using Translation = ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<double>>; @@ -252,6 +251,7 @@ namespace cms { const DDSpecPar* find(const std::string&) const; void filter(DDSpecParRefs&, const std::string&) const; const std::string_view front(const std::string_view) const; + const std::string_view back(const std::string_view) const; ExpandedNodes nodes_; std::vector<Iterator> it_; diff --git a/DetectorDescription/DDCMS/interface/DDNamespace.h b/DetectorDescription/DDCMS/interface/DDNamespace.h index 2f1cbba09b045..e3d61e17973cd 100644 --- a/DetectorDescription/DDCMS/interface/DDNamespace.h +++ b/DetectorDescription/DDCMS/interface/DDNamespace.h @@ -5,13 +5,13 @@ #include "DD4hep/Objects.h" #include "DD4hep/Shapes.h" #include "DD4hep/Volumes.h" -#include "tbb/concurrent_unordered_map.h" -#include "tbb/concurrent_vector.h" +#include <unordered_map> +#include <vector> namespace cms { class DDParsingContext; - using DDVectorsMap = tbb::concurrent_unordered_map<std::string, tbb::concurrent_vector<double>>; + using DDVectorsMap = std::unordered_map<std::string, std::vector<double>>; class DDNamespace { public: diff --git a/DetectorDescription/DDCMS/interface/DDVectorRegistry.h b/DetectorDescription/DDCMS/interface/DDVectorRegistry.h index f4ac58b70db8d..42952e90367fb 100644 --- a/DetectorDescription/DDCMS/interface/DDVectorRegistry.h +++ b/DetectorDescription/DDCMS/interface/DDVectorRegistry.h @@ -2,12 +2,14 @@ #define DETECTOR_DESCRIPTION_DD_VECTOR_REGISTRY_H #include <string> -#include "tbb/concurrent_unordered_map.h" -#include "tbb/concurrent_vector.h" +#include <unordered_map> +#include <vector> namespace cms { + using DDVectorsMap = std::unordered_map<std::string, std::vector<double>>; + struct DDVectorRegistry { - tbb::concurrent_unordered_map<std::string, tbb::concurrent_vector<double> > vectors; + DDVectorsMap vectors; }; } // namespace cms diff --git a/DetectorDescription/DDCMS/plugins/DDVectorRegistryESProducer.cc b/DetectorDescription/DDCMS/plugins/DDVectorRegistryESProducer.cc index b5e908dca43ac..aa6062be2659a 100644 --- a/DetectorDescription/DDCMS/plugins/DDVectorRegistryESProducer.cc +++ b/DetectorDescription/DDCMS/plugins/DDVectorRegistryESProducer.cc @@ -31,10 +31,15 @@ #include "DetectorDescription/DDCMS/interface/DDDetector.h" #include "DD4hep/Detector.h" +#include <unordered_map> +#include <vector> + using namespace std; using namespace cms; using namespace edm; +using DDVectorsMap = std::unordered_map<std::string, std::vector<double>>; + class DDVectorRegistryESProducer : public edm::ESProducer { public: DDVectorRegistryESProducer(const edm::ParameterSet&); @@ -62,7 +67,7 @@ void DDVectorRegistryESProducer::fillDescriptions(edm::ConfigurationDescriptions DDVectorRegistryESProducer::ReturnType DDVectorRegistryESProducer::produce(const DDVectorRegistryRcd& iRecord) { LogDebug("Geometry") << "DDVectorRegistryESProducer::produce\n"; - const dd4hep::VectorsMap& registry = iRecord.get(m_token).vectors(); + const auto& registry = iRecord.get(m_token).vectors(); auto product = std::make_unique<DDVectorRegistry>(); product->vectors.insert(registry.begin(), registry.end()); diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 68ef1ca3f00f1..eaf0407c60032 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -28,7 +28,7 @@ #include <vector> #include <unordered_map> #include <utility> -#include <tbb/concurrent_vector.h> +//#include <tbb/concurrent_vector.h> using namespace std; using namespace dd4hep; @@ -1676,7 +1676,7 @@ void Converter<DDLVector>::operator()(xml_h element) const { try { std::vector<double> results = splitNumeric(val); registry->insert( - {name, tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(results.begin(), results.end())}); + {name, results});//tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(results.begin(), results.end())}); } catch (const exception& e) { printout(INFO, "DD4CMS", @@ -1844,8 +1844,8 @@ static long load_dddefinition(Detector& det, xml_h element) { result.emplace_back(dd4hep::_toDouble(i)); } registry->insert( - {it->first, - tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(begin(result), end(result))}); + {it->first, result }); + // tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(begin(result), end(result))}); // All components are resolved it = context.unresolvedVectors.erase(it); } diff --git a/DetectorDescription/DDCMS/src/DDCompactView.cc b/DetectorDescription/DDCMS/src/DDCompactView.cc index bc0d129ca044a..696ae32098f54 100644 --- a/DetectorDescription/DDCMS/src/DDCompactView.cc +++ b/DetectorDescription/DDCMS/src/DDCompactView.cc @@ -1,18 +1,19 @@ #include "DetectorDescription/DDCMS/interface/DDCompactView.h" +#include "FWCore/Utilities/interface/Exception.h" #include <DD4hep/Filter.h> #include <cmath> +#include "tbb/concurrent_vector.h" template <> std::vector<int> cms::DDCompactView::getVector<int>(const std::string& key) const { - const dd4hep::VectorsMap& vmap = this->detector()->vectors(); std::vector<int> result; + const auto& vmap = this->detector()->vectors(); for (auto const& it : vmap) { if (dd4hep::dd::noNamespace(it.first) == key) { - for (const auto& i : it.second) { - result.emplace_back(std::round(i)); - } - break; + std::transform(it.second.begin(), it.second.end(), std::back_inserter(result), + [](int n) -> int { return (int)n; }); + return result; } } return result; @@ -20,16 +21,34 @@ std::vector<int> cms::DDCompactView::getVector<int>(const std::string& key) cons template <> std::vector<double> cms::DDCompactView::getVector<double>(const std::string& key) const { - const dd4hep::VectorsMap& vmap = this->detector()->vectors(); - std::vector<double> result; + const auto& vmap = this->detector()->vectors(); + for (auto const& it : vmap) { + if (dd4hep::dd::noNamespace(it.first) == key) { + return it.second; + } + } + return std::vector<double>(); +} +template <> +std::vector<double> const& cms::DDCompactView::get<std::vector<double>>(const std::string& key) const { + const auto& vmap = this->detector()->vectors(); for (auto const& it : vmap) { if (dd4hep::dd::noNamespace(it.first) == key) { - for (const auto& i : it.second) { - result.emplace_back(i); - } - break; + return it.second; } } - return result; + throw cms::Exception("DDError") << "no vector<double> with name " << key; +} + +template <> +tbb::concurrent_vector<double> const& cms::DDCompactView::get<tbb::concurrent_vector<double>>(const std::string& name, const std::string& key) const { + const auto& spec = specpars().specPar(name); + if(spec != nullptr) { + auto const& nitem = spec->numpars.find(key); + if (nitem != end(spec->numpars)) { + return nitem->second; + } + } + throw cms::Exception("DDError") << "no SpecPar with name " << name << " and vector<double> key " << key; } diff --git a/DetectorDescription/DDCMS/src/DDDetector.cc b/DetectorDescription/DDCMS/src/DDDetector.cc index 04a4fea35edc1..0cef53c93bbb3 100644 --- a/DetectorDescription/DDCMS/src/DDDetector.cc +++ b/DetectorDescription/DDCMS/src/DDDetector.cc @@ -12,7 +12,7 @@ namespace cms { DDDetector::DDDetector(const std::string& tag, const std::string& fileName, bool bigXML) : m_tag(tag) { m_description = &dd4hep::Detector::getInstance(tag); - m_description->addExtension<dd4hep::VectorsMap>(&m_vectors); + m_description->addExtension<cms::DDVectorsMap>(&m_vectors); m_description->addExtension<dd4hep::PartSelectionMap>(&m_partsels); m_description->addExtension<dd4hep::SpecParRegistry>(&m_specpars); if (bigXML) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 264a48660f871..fcaae205728a4 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -723,6 +723,15 @@ const std::string_view DDFilteredView::front(const std::string_view path) const return path; } +const std::string_view DDFilteredView::back(const std::string_view path) const { + if (auto const& lpos = path.rfind('/') != path.npos) { + return path.substr(lpos, path.size()); + } + + // throw cms::Exception("Filtered View") << "Path must start with '//' " << path; + return path; +} + double DDFilteredView::getNextValue(const std::string& key) const { double result(0.0); diff --git a/Geometry/HcalCommonData/src/HcalParametersFromDD.cc b/Geometry/HcalCommonData/src/HcalParametersFromDD.cc index 0e096856272dd..4c886bf2c6376 100644 --- a/Geometry/HcalCommonData/src/HcalParametersFromDD.cc +++ b/Geometry/HcalCommonData/src/HcalParametersFromDD.cc @@ -152,22 +152,22 @@ bool HcalParametersFromDD::build(const cms::DDCompactView& cpv, HcalParameters& php.dzVcal = geom->getConstDzHF(); geom->getConstRHO(php.rHO); - php.phioff = cpv.getVector<double>("phioff"); - php.etaTable = cpv.getVector<double>("etaTable"); - php.rTable = cpv.getVector<double>("rTable"); - php.phibin = cpv.getVector<double>("phibin"); - php.phitable = cpv.getVector<double>("phitable"); + php.phioff = cpv.get<std::vector<double>>("phioff"); + php.etaTable = cpv.get<std::vector<double>>("etaTable"); + php.rTable = cpv.get<std::vector<double>>("rTable"); + php.phibin = cpv.get<std::vector<double>>("phibin"); + php.phitable = cpv.get<std::vector<double>>("phitable"); php.etaMin = cpv.getVector<int>("etaMin"); php.etaMax = cpv.getVector<int>("etaMax"); - php.etaRange = cpv.getVector<double>("etaRange"); - php.gparHF = cpv.getVector<double>("gparHF"); + php.etaRange = cpv.get<std::vector<double>>("etaRange"); + php.gparHF = cpv.get<std::vector<double>>("gparHF"); php.noff = cpv.getVector<int>("noff"); - php.Layer0Wt = cpv.getVector<double>("Layer0Wt"); - php.HBGains = cpv.getVector<double>("HBGains"); + php.Layer0Wt = cpv.get<std::vector<double>>("Layer0Wt"); + php.HBGains = cpv.get<std::vector<double>>("HBGains"); php.HBShift = cpv.getVector<int>("HBShift"); - php.HEGains = cpv.getVector<double>("HEGains"); + php.HEGains = cpv.get<std::vector<double>>("HEGains"); php.HEShift = cpv.getVector<int>("HEShift"); - php.HFGains = cpv.getVector<double>("HFGains"); + php.HFGains = cpv.get<std::vector<double>>("HFGains"); php.HFShift = cpv.getVector<int>("HFShift"); php.maxDepth = cpv.getVector<int>("MaxDepth"); diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc b/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc index f56a1447802f3..a404354aede4d 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc @@ -24,7 +24,7 @@ bool TrackerParametersFromDD::build(const DDCompactView* cvp, PTrackerParameters } bool TrackerParametersFromDD::build(const cms::DDCompactView* cvp, PTrackerParameters& ptp) { - dd4hep::VectorsMap vmap = cvp->detector()->vectors(); + const auto& vmap = cvp->detector()->vectors(); for (int subdet = 1; subdet <= 6; ++subdet) { std::stringstream sstm; sstm << "Subdetector" << subdet; From 116b0d907706774672e53f277efb3169cf02f9f0 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Mon, 5 Oct 2020 17:17:03 +0200 Subject: [PATCH 248/778] code format --- .../DDCMS/interface/DDVectorRegistry.h | 2 +- .../DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc | 8 ++++---- DetectorDescription/DDCMS/src/DDCompactView.cc | 13 +++++++------ Geometry/HcalCommonData/src/HcalParametersFromDD.cc | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDVectorRegistry.h b/DetectorDescription/DDCMS/interface/DDVectorRegistry.h index 42952e90367fb..bd1b7f52da996 100644 --- a/DetectorDescription/DDCMS/interface/DDVectorRegistry.h +++ b/DetectorDescription/DDCMS/interface/DDVectorRegistry.h @@ -7,7 +7,7 @@ namespace cms { using DDVectorsMap = std::unordered_map<std::string, std::vector<double>>; - + struct DDVectorRegistry { DDVectorsMap vectors; }; diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index eaf0407c60032..7edb3da685333 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -1676,7 +1676,8 @@ void Converter<DDLVector>::operator()(xml_h element) const { try { std::vector<double> results = splitNumeric(val); registry->insert( - {name, results});//tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(results.begin(), results.end())}); + {name, + results}); //tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(results.begin(), results.end())}); } catch (const exception& e) { printout(INFO, "DD4CMS", @@ -1843,9 +1844,8 @@ static long load_dddefinition(Detector& det, xml_h element) { for (const auto& i : it->second) { result.emplace_back(dd4hep::_toDouble(i)); } - registry->insert( - {it->first, result }); - // tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(begin(result), end(result))}); + registry->insert({it->first, result}); + // tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(begin(result), end(result))}); // All components are resolved it = context.unresolvedVectors.erase(it); } diff --git a/DetectorDescription/DDCMS/src/DDCompactView.cc b/DetectorDescription/DDCMS/src/DDCompactView.cc index 696ae32098f54..b434b15e912fc 100644 --- a/DetectorDescription/DDCMS/src/DDCompactView.cc +++ b/DetectorDescription/DDCMS/src/DDCompactView.cc @@ -11,8 +11,8 @@ std::vector<int> cms::DDCompactView::getVector<int>(const std::string& key) cons const auto& vmap = this->detector()->vectors(); for (auto const& it : vmap) { if (dd4hep::dd::noNamespace(it.first) == key) { - std::transform(it.second.begin(), it.second.end(), std::back_inserter(result), - [](int n) -> int { return (int)n; }); + std::transform( + it.second.begin(), it.second.end(), std::back_inserter(result), [](int n) -> int { return (int)n; }); return result; } } @@ -38,17 +38,18 @@ std::vector<double> const& cms::DDCompactView::get<std::vector<double>>(const st return it.second; } } - throw cms::Exception("DDError") << "no vector<double> with name " << key; + throw cms::Exception("DDError") << "no vector<double> with name " << key; } template <> -tbb::concurrent_vector<double> const& cms::DDCompactView::get<tbb::concurrent_vector<double>>(const std::string& name, const std::string& key) const { +tbb::concurrent_vector<double> const& cms::DDCompactView::get<tbb::concurrent_vector<double>>( + const std::string& name, const std::string& key) const { const auto& spec = specpars().specPar(name); - if(spec != nullptr) { + if (spec != nullptr) { auto const& nitem = spec->numpars.find(key); if (nitem != end(spec->numpars)) { return nitem->second; } } - throw cms::Exception("DDError") << "no SpecPar with name " << name << " and vector<double> key " << key; + throw cms::Exception("DDError") << "no SpecPar with name " << name << " and vector<double> key " << key; } diff --git a/Geometry/HcalCommonData/src/HcalParametersFromDD.cc b/Geometry/HcalCommonData/src/HcalParametersFromDD.cc index 4c886bf2c6376..7173c11e98f4f 100644 --- a/Geometry/HcalCommonData/src/HcalParametersFromDD.cc +++ b/Geometry/HcalCommonData/src/HcalParametersFromDD.cc @@ -186,10 +186,10 @@ bool HcalParametersFromDD::build(const cms::DDCompactView& cpv, HcalParameters& const cms::DDFilter filter("OnlyForHcalRecNumbering", "HCAL"); cms::DDFilteredView fv(cpv, filter); - std::vector<std::string> tempS = fv.get<std::vector<std::string> >("hcal", "TopologyMode"); + std::vector<std::string> tempS = fv.get<std::vector<std::string>>("hcal", "TopologyMode"); std::string sv = (!tempS.empty()) ? tempS[0] : "HcalTopologyMode::SLHC"; int topoMode = getTopologyMode(sv, true); - tempS = fv.get<std::vector<std::string> >("hcal", "TriggerMode"); + tempS = fv.get<std::vector<std::string>>("hcal", "TriggerMode"); sv = (!tempS.empty()) ? tempS[0] : "HcalTopologyMode::TriggerMode_2021"; int trigMode = getTopologyMode(sv, false); php.topologyMode = ((trigMode & 0xFF) << 8) | (topoMode & 0xFF); From 4571a638cea4c62f9ea4cf97a50cfcaa5baf209d Mon Sep 17 00:00:00 2001 From: Martin Grunewald <Martin.Grunewald@cern.ch> Date: Mon, 5 Oct 2020 17:20:42 +0200 Subject: [PATCH 249/778] Migration of HLT menus to CMSSW_11_2_0_pre7 --- .../Configuration/python/HLT_FULL_cff.py | 60 +++++++++------- .../Configuration/python/HLT_Fake1_cff.py | 4 +- .../Configuration/python/HLT_Fake2_cff.py | 9 +-- .../Configuration/python/HLT_Fake_cff.py | 4 +- .../Configuration/python/HLT_GRun_cff.py | 54 +++++++++------ .../Configuration/python/HLT_HIon_cff.py | 24 ++++--- .../Configuration/python/HLT_PIon_cff.py | 9 +-- .../Configuration/python/HLT_PRef_cff.py | 18 +++-- .../python/customizeHLTforCMSSW.py | 34 ---------- .../Configuration/test/OnLine_HLT_FULL.py | 68 ++++++++++++------- .../Configuration/test/OnLine_HLT_Fake.py | 4 +- .../Configuration/test/OnLine_HLT_Fake1.py | 4 +- .../Configuration/test/OnLine_HLT_Fake2.py | 9 +-- .../Configuration/test/OnLine_HLT_GRun.py | 62 ++++++++++------- .../Configuration/test/OnLine_HLT_HIon.py | 32 ++++++--- .../Configuration/test/OnLine_HLT_PIon.py | 17 +++-- .../Configuration/test/OnLine_HLT_PRef.py | 26 ++++--- 17 files changed, 250 insertions(+), 188 deletions(-) diff --git a/HLTrigger/Configuration/python/HLT_FULL_cff.py b/HLTrigger/Configuration/python/HLT_FULL_cff.py index a212a9199cc26..a7a0484cb0587 100644 --- a/HLTrigger/Configuration/python/HLT_FULL_cff.py +++ b/HLTrigger/Configuration/python/HLT_FULL_cff.py @@ -1,13 +1,13 @@ # hltGetConfiguration --cff --data /dev/CMSSW_11_2_0/HLT --type FULL -# /dev/CMSSW_11_2_0/HLT/V28 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/HLT/V32 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/HLT/V28') + tableName = cms.string('/dev/CMSSW_11_2_0/HLT/V32') ) fragment.transferSystem = cms.PSet( @@ -8082,6 +8082,7 @@ fragment.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -8095,12 +8096,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) fragment.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) @@ -8950,7 +8951,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -8986,7 +8988,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -9018,7 +9021,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -13577,11 +13581,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -32322,11 +32328,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -38132,11 +38140,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -43976,7 +43986,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -44008,7 +44019,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -54948,13 +54960,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForBtag" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForBtag" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -95350,13 +95362,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForBtagAK8" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForBtagAK8" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -95573,13 +95585,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForDBtagAK8" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForDBtagAK8" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -102276,11 +102288,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_Fake1_cff.py b/HLTrigger/Configuration/python/HLT_Fake1_cff.py index c94e596f8d5a3..95258496ee0a2 100644 --- a/HLTrigger/Configuration/python/HLT_Fake1_cff.py +++ b/HLTrigger/Configuration/python/HLT_Fake1_cff.py @@ -1,13 +1,13 @@ # hltGetConfiguration --cff --data /dev/CMSSW_11_2_0/Fake1 --type Fake1 -# /dev/CMSSW_11_2_0/Fake1/V5 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/Fake1/V6 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/Fake1/V5') + tableName = cms.string('/dev/CMSSW_11_2_0/Fake1/V6') ) fragment.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/python/HLT_Fake2_cff.py b/HLTrigger/Configuration/python/HLT_Fake2_cff.py index 89b17ae4d7d42..89beef03d3569 100644 --- a/HLTrigger/Configuration/python/HLT_Fake2_cff.py +++ b/HLTrigger/Configuration/python/HLT_Fake2_cff.py @@ -1,13 +1,13 @@ # hltGetConfiguration --cff --data /dev/CMSSW_11_2_0/Fake2 --type Fake2 -# /dev/CMSSW_11_2_0/Fake2/V5 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/Fake2/V6 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/Fake2/V5') + tableName = cms.string('/dev/CMSSW_11_2_0/Fake2/V6') ) fragment.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) @@ -96,6 +96,7 @@ fragment.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -109,12 +110,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) fragment.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) diff --git a/HLTrigger/Configuration/python/HLT_Fake_cff.py b/HLTrigger/Configuration/python/HLT_Fake_cff.py index 316568a7103b8..1e2ca3f995924 100644 --- a/HLTrigger/Configuration/python/HLT_Fake_cff.py +++ b/HLTrigger/Configuration/python/HLT_Fake_cff.py @@ -1,13 +1,13 @@ # hltGetConfiguration --cff --data /dev/CMSSW_11_2_0/Fake --type Fake -# /dev/CMSSW_11_2_0/Fake/V5 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/Fake/V6 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/Fake/V5') + tableName = cms.string('/dev/CMSSW_11_2_0/Fake/V6') ) fragment.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/python/HLT_GRun_cff.py b/HLTrigger/Configuration/python/HLT_GRun_cff.py index 13edc1d8d5c77..44eeef5a37178 100644 --- a/HLTrigger/Configuration/python/HLT_GRun_cff.py +++ b/HLTrigger/Configuration/python/HLT_GRun_cff.py @@ -1,13 +1,13 @@ # hltGetConfiguration --cff --data /dev/CMSSW_11_2_0/GRun --type GRun -# /dev/CMSSW_11_2_0/GRun/V9 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/GRun/V10 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/GRun/V9') + tableName = cms.string('/dev/CMSSW_11_2_0/GRun/V10') ) fragment.transferSystem = cms.PSet( @@ -6765,6 +6765,7 @@ fragment.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -6778,12 +6779,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) fragment.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) @@ -7633,7 +7634,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -7669,7 +7671,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -7701,7 +7704,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -12260,11 +12264,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -30957,11 +30963,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -36743,11 +36751,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -42189,7 +42199,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -42221,7 +42232,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -53175,13 +53187,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForBtag" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForBtag" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -86025,13 +86037,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForBtagAK8" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForBtagAK8" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -86248,13 +86260,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForDBtagAK8" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForDBtagAK8" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), diff --git a/HLTrigger/Configuration/python/HLT_HIon_cff.py b/HLTrigger/Configuration/python/HLT_HIon_cff.py index f7101426360fc..627948ab271ca 100644 --- a/HLTrigger/Configuration/python/HLT_HIon_cff.py +++ b/HLTrigger/Configuration/python/HLT_HIon_cff.py @@ -1,13 +1,13 @@ # hltGetConfiguration --cff --data /dev/CMSSW_11_2_0/HIon --type HIon -# /dev/CMSSW_11_2_0/HIon/V9 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/HIon/V10 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/HIon/V9') + tableName = cms.string('/dev/CMSSW_11_2_0/HIon/V10') ) fragment.transferSystem = cms.PSet( @@ -5888,6 +5888,7 @@ fragment.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -5901,12 +5902,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) fragment.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) @@ -6353,7 +6354,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -6389,7 +6391,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -6421,7 +6424,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -12211,11 +12215,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_PIon_cff.py b/HLTrigger/Configuration/python/HLT_PIon_cff.py index 1b815de9e12fd..bb2cf24f56f4f 100644 --- a/HLTrigger/Configuration/python/HLT_PIon_cff.py +++ b/HLTrigger/Configuration/python/HLT_PIon_cff.py @@ -1,13 +1,13 @@ # hltGetConfiguration --cff --data /dev/CMSSW_11_2_0/PIon --type PIon -# /dev/CMSSW_11_2_0/PIon/V9 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/PIon/V10 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/PIon/V9') + tableName = cms.string('/dev/CMSSW_11_2_0/PIon/V10') ) fragment.transferSystem = cms.PSet( @@ -5366,6 +5366,7 @@ fragment.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -5379,12 +5380,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) fragment.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) diff --git a/HLTrigger/Configuration/python/HLT_PRef_cff.py b/HLTrigger/Configuration/python/HLT_PRef_cff.py index ef6432befe1d7..a4f4213d5d949 100644 --- a/HLTrigger/Configuration/python/HLT_PRef_cff.py +++ b/HLTrigger/Configuration/python/HLT_PRef_cff.py @@ -1,13 +1,13 @@ # hltGetConfiguration --cff --data /dev/CMSSW_11_2_0/PRef --type PRef -# /dev/CMSSW_11_2_0/PRef/V9 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/PRef/V10 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms fragment = cms.ProcessFragment( "HLT" ) fragment.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/PRef/V9') + tableName = cms.string('/dev/CMSSW_11_2_0/PRef/V10') ) fragment.transferSystem = cms.PSet( @@ -5438,6 +5438,7 @@ fragment.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -5451,12 +5452,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) fragment.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) @@ -6071,7 +6072,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -6107,7 +6109,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -6139,7 +6142,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index d831223b55701..f336babc9d852 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -170,45 +170,11 @@ def customiseFor2017DtUnpacking(process): return process -def customiseFor31295(process): - """Reorganization of kdtrees for PFBlockAlgo and optimize track-hcal links""" - - # for PFBlockProducer - for producer in producers_by_type(process, "PFBlockProducer"): - if hasattr(producer,'linkDefinitions'): - for ps in producer.linkDefinitions.value(): - if hasattr(ps,'linkerName') and (ps.linkerName == 'TrackAndHCALLinker'): - if not hasattr(ps,'nMaxHcalLinksPerTrack'): - ps.nMaxHcalLinksPerTrack = cms.int32(1) - if hasattr(ps,'linkerName') and (ps.linkerName == 'ECALAndHCALLinker'): - if not hasattr(ps,'minAbsEtaEcal'): - ps.minAbsEtaEcal = cms.double(2.5) - - return process - -def customiseFor31263(process): - """Add the t0Label parameter (with default value) to DTTTrigSyncFromDB in HLT""" - - if hasattr(process,'hltDt1DRecHits'): - process.hltDt1DRecHits.recAlgoConfig.tTrigModeConfig.t0Label = cms.string("") - - if hasattr(process,'hltDt4DSegments'): - process.hltDt4DSegments.Reco4DAlgoConfig.recAlgoConfig.tTrigModeConfig.t0Label = cms.string("") - process.hltDt4DSegments.Reco4DAlgoConfig.Reco2DAlgoConfig.recAlgoConfig.tTrigModeConfig.t0Label = cms.string("") - - if hasattr(process,'hltDt4DSegmentsMeanTimer'): - process.hltDt4DSegmentsMeanTimer.Reco4DAlgoConfig.recAlgoConfig.tTrigModeConfig.t0Label = cms.string("") - process.hltDt4DSegmentsMeanTimer.Reco4DAlgoConfig.Reco2DAlgoConfig.recAlgoConfig.tTrigModeConfig.t0Label = cms.string("") - - return process - # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): # add call to action function in proper order: newest last! # process = customiseFor12718(process) - process = customiseFor31295(process) - process = customiseFor31263(process) return process diff --git a/HLTrigger/Configuration/test/OnLine_HLT_FULL.py b/HLTrigger/Configuration/test/OnLine_HLT_FULL.py index b7effc757641e..a1455690e4b95 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_FULL.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_FULL.py @@ -1,13 +1,13 @@ # hltGetConfiguration --full --data /dev/CMSSW_11_2_0/HLT --type FULL --unprescale --process HLTFULL --globaltag auto:run3_hlt_FULL --input file:RelVal_Raw_FULL_DATA.root -# /dev/CMSSW_11_2_0/HLT/V28 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/HLT/V32 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTFULL" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/HLT/V28') + tableName = cms.string('/dev/CMSSW_11_2_0/HLT/V32') ) process.transferSystem = cms.PSet( @@ -6483,10 +6483,14 @@ PixelShapeFile = cms.string( "RecoPixelVertexing/PixelLowPtUtilities/data/pixelShapePhase1_noL1.par" ) ) process.DTGeometryESModule = cms.ESProducer( "DTGeometryESModule", + DDDetector = cms.ESInputTag( "" ), appendToDataLabel = cms.string( "" ), + alignmentsLabel = cms.string( "" ), + attribute = cms.string( "MuStructure" ), + value = cms.string( "MuonBarrelDT" ), + fromDD4hep = cms.bool( False ), fromDDD = cms.bool( False ), - applyAlignment = cms.bool( True ), - alignmentsLabel = cms.string( "" ) + applyAlignment = cms.bool( True ) ) process.DTObjectMapESProducer = cms.ESProducer( "DTObjectMapESProducer", appendToDataLabel = cms.string( "" ) @@ -8390,6 +8394,7 @@ process.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -8403,12 +8408,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) process.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) @@ -9258,7 +9263,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -9294,7 +9300,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -9326,7 +9333,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -13885,11 +13893,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -32630,11 +32640,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -38440,11 +38452,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -44284,7 +44298,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -44316,7 +44331,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -55256,13 +55272,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForBtag" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForBtag" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -95658,13 +95674,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForBtagAK8" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForBtagAK8" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -95881,13 +95897,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForDBtagAK8" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForDBtagAK8" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -102584,11 +102600,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), diff --git a/HLTrigger/Configuration/test/OnLine_HLT_Fake.py b/HLTrigger/Configuration/test/OnLine_HLT_Fake.py index 3bcd2a71ed660..fa135dc00b5df 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_Fake.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_Fake.py @@ -1,13 +1,13 @@ # hltGetConfiguration --full --data /dev/CMSSW_11_2_0/Fake --type Fake --unprescale --process HLTFake --globaltag auto:run1_hlt_Fake --input file:RelVal_Raw_Fake_DATA.root -# /dev/CMSSW_11_2_0/Fake/V5 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/Fake/V6 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTFake" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/Fake/V5') + tableName = cms.string('/dev/CMSSW_11_2_0/Fake/V6') ) process.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/test/OnLine_HLT_Fake1.py b/HLTrigger/Configuration/test/OnLine_HLT_Fake1.py index 9816df60df83e..1e44cc52cd2d3 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_Fake1.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_Fake1.py @@ -1,13 +1,13 @@ # hltGetConfiguration --full --data /dev/CMSSW_11_2_0/Fake1 --type Fake1 --unprescale --process HLTFake1 --globaltag auto:run2_hlt_Fake1 --input file:RelVal_Raw_Fake1_DATA.root -# /dev/CMSSW_11_2_0/Fake1/V5 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/Fake1/V6 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTFake1" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/Fake1/V5') + tableName = cms.string('/dev/CMSSW_11_2_0/Fake1/V6') ) process.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) diff --git a/HLTrigger/Configuration/test/OnLine_HLT_Fake2.py b/HLTrigger/Configuration/test/OnLine_HLT_Fake2.py index 995d5afd6cec2..1293ac58c5903 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_Fake2.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_Fake2.py @@ -1,13 +1,13 @@ # hltGetConfiguration --full --data /dev/CMSSW_11_2_0/Fake2 --type Fake2 --unprescale --process HLTFake2 --globaltag auto:run2_hlt_Fake2 --input file:RelVal_Raw_Fake2_DATA.root -# /dev/CMSSW_11_2_0/Fake2/V5 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/Fake2/V6 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTFake2" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/Fake2/V5') + tableName = cms.string('/dev/CMSSW_11_2_0/Fake2/V6') ) process.streams = cms.PSet( A = cms.vstring( 'InitialPD' ) ) @@ -259,6 +259,7 @@ process.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -272,12 +273,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) process.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) diff --git a/HLTrigger/Configuration/test/OnLine_HLT_GRun.py b/HLTrigger/Configuration/test/OnLine_HLT_GRun.py index e1bdb994ae40b..dcc48fc3a737c 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_GRun.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_GRun.py @@ -1,13 +1,13 @@ # hltGetConfiguration --full --data /dev/CMSSW_11_2_0/GRun --type GRun --unprescale --process HLTGRun --globaltag auto:run3_hlt_GRun --input file:RelVal_Raw_GRun_DATA.root -# /dev/CMSSW_11_2_0/GRun/V9 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/GRun/V10 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTGRun" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/GRun/V9') + tableName = cms.string('/dev/CMSSW_11_2_0/GRun/V10') ) process.transferSystem = cms.PSet( @@ -5166,10 +5166,14 @@ PixelShapeFile = cms.string( "RecoPixelVertexing/PixelLowPtUtilities/data/pixelShapePhase1_noL1.par" ) ) process.DTGeometryESModule = cms.ESProducer( "DTGeometryESModule", + DDDetector = cms.ESInputTag( "" ), appendToDataLabel = cms.string( "" ), + alignmentsLabel = cms.string( "" ), + attribute = cms.string( "MuStructure" ), + value = cms.string( "MuonBarrelDT" ), + fromDD4hep = cms.bool( False ), fromDDD = cms.bool( False ), - applyAlignment = cms.bool( True ), - alignmentsLabel = cms.string( "" ) + applyAlignment = cms.bool( True ) ) process.DTObjectMapESProducer = cms.ESProducer( "DTObjectMapESProducer", appendToDataLabel = cms.string( "" ) @@ -7073,6 +7077,7 @@ process.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -7086,12 +7091,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) process.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) @@ -7941,7 +7946,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -7977,7 +7983,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -8009,7 +8016,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -12568,11 +12576,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -31265,11 +31275,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -37051,11 +37063,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), @@ -42497,7 +42511,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -42529,7 +42544,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -53483,13 +53499,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForBtag" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForBtag" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -86333,13 +86349,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForBtagAK8" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForBtagAK8" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), @@ -86556,13 +86572,13 @@ minimumTransverseMomentum = cms.double( 1.0 ), primaryVertex = cms.InputTag( "hltVerticesPFFilter" ), maximumLongitudinalImpactParameter = cms.double( 17.0 ), - computeGhostTrack = cms.bool( True ), + jets = cms.InputTag( "hltPFJetForDBtagAK8" ), maxDeltaR = cms.double( 0.4 ), candidates = cms.InputTag( "hltParticleFlow" ), jetDirectionUsingGhostTrack = cms.bool( False ), minimumNumberOfPixelHits = cms.int32( 2 ), jetDirectionUsingTracks = cms.bool( False ), - jets = cms.InputTag( "hltPFJetForDBtagAK8" ), + computeGhostTrack = cms.bool( True ), useTrackQuality = cms.bool( False ), ghostTrackPriorDeltaR = cms.double( 0.03 ), maximumChiSquared = cms.double( 5.0 ), diff --git a/HLTrigger/Configuration/test/OnLine_HLT_HIon.py b/HLTrigger/Configuration/test/OnLine_HLT_HIon.py index f151fd6212dc0..8262c5d7537e0 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_HIon.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_HIon.py @@ -1,13 +1,13 @@ # hltGetConfiguration --full --data /dev/CMSSW_11_2_0/HIon --type HIon --unprescale --process HLTHIon --globaltag auto:run3_hlt_HIon --input file:RelVal_Raw_HIon_DATA.root -# /dev/CMSSW_11_2_0/HIon/V9 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/HIon/V10 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTHIon" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/HIon/V9') + tableName = cms.string('/dev/CMSSW_11_2_0/HIon/V10') ) process.transferSystem = cms.PSet( @@ -4289,10 +4289,14 @@ PixelShapeFile = cms.string( "RecoPixelVertexing/PixelLowPtUtilities/data/pixelShapePhase1_noL1.par" ) ) process.DTGeometryESModule = cms.ESProducer( "DTGeometryESModule", + DDDetector = cms.ESInputTag( "" ), appendToDataLabel = cms.string( "" ), + alignmentsLabel = cms.string( "" ), + attribute = cms.string( "MuStructure" ), + value = cms.string( "MuonBarrelDT" ), + fromDD4hep = cms.bool( False ), fromDDD = cms.bool( False ), - applyAlignment = cms.bool( True ), - alignmentsLabel = cms.string( "" ) + applyAlignment = cms.bool( True ) ) process.DTObjectMapESProducer = cms.ESProducer( "DTObjectMapESProducer", appendToDataLabel = cms.string( "" ) @@ -6196,6 +6200,7 @@ process.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -6209,12 +6214,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) process.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataRepacker" ) @@ -6661,7 +6666,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -6697,7 +6703,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -6729,7 +6736,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -12519,11 +12527,13 @@ useKDTree = cms.bool( True ), linkerName = cms.string( "TrackAndHCALLinker" ), trajectoryLayerEntrance = cms.string( "HCALEntrance" ), - trajectoryLayerExit = cms.string( "HCALExit" ) + trajectoryLayerExit = cms.string( "HCALExit" ), + nMaxHcalLinksPerTrack = cms.int32( 1 ) ), cms.PSet( linkType = cms.string( "ECAL:HCAL" ), useKDTree = cms.bool( False ), - linkerName = cms.string( "ECALAndHCALLinker" ) + linkerName = cms.string( "ECALAndHCALLinker" ), + minAbsEtaEcal = cms.double( 2.5 ) ), cms.PSet( linkType = cms.string( "HFEM:HFHAD" ), useKDTree = cms.bool( False ), diff --git a/HLTrigger/Configuration/test/OnLine_HLT_PIon.py b/HLTrigger/Configuration/test/OnLine_HLT_PIon.py index 32fa1e698d266..e124ad36255b0 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_PIon.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_PIon.py @@ -1,13 +1,13 @@ # hltGetConfiguration --full --data /dev/CMSSW_11_2_0/PIon --type PIon --unprescale --process HLTPIon --globaltag auto:run3_hlt_PIon --input file:RelVal_Raw_PIon_DATA.root -# /dev/CMSSW_11_2_0/PIon/V9 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/PIon/V10 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTPIon" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/PIon/V9') + tableName = cms.string('/dev/CMSSW_11_2_0/PIon/V10') ) process.transferSystem = cms.PSet( @@ -3760,10 +3760,14 @@ PixelShapeFile = cms.string( "RecoPixelVertexing/PixelLowPtUtilities/data/pixelShapePhase1_noL1.par" ) ) process.DTGeometryESModule = cms.ESProducer( "DTGeometryESModule", + DDDetector = cms.ESInputTag( "" ), appendToDataLabel = cms.string( "" ), + alignmentsLabel = cms.string( "" ), + attribute = cms.string( "MuStructure" ), + value = cms.string( "MuonBarrelDT" ), + fromDD4hep = cms.bool( False ), fromDDD = cms.bool( False ), - applyAlignment = cms.bool( True ), - alignmentsLabel = cms.string( "" ) + applyAlignment = cms.bool( True ) ) process.DTObjectMapESProducer = cms.ESProducer( "DTObjectMapESProducer", appendToDataLabel = cms.string( "" ) @@ -5674,6 +5678,7 @@ process.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -5687,12 +5692,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) process.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) diff --git a/HLTrigger/Configuration/test/OnLine_HLT_PRef.py b/HLTrigger/Configuration/test/OnLine_HLT_PRef.py index 6b40c13019dbd..0e134b1fa4925 100644 --- a/HLTrigger/Configuration/test/OnLine_HLT_PRef.py +++ b/HLTrigger/Configuration/test/OnLine_HLT_PRef.py @@ -1,13 +1,13 @@ # hltGetConfiguration --full --data /dev/CMSSW_11_2_0/PRef --type PRef --unprescale --process HLTPRef --globaltag auto:run3_hlt_PRef --input file:RelVal_Raw_PRef_DATA.root -# /dev/CMSSW_11_2_0/PRef/V9 (CMSSW_11_2_0_pre5) +# /dev/CMSSW_11_2_0/PRef/V10 (CMSSW_11_2_0_pre7) import FWCore.ParameterSet.Config as cms process = cms.Process( "HLTPRef" ) process.HLTConfigVersion = cms.PSet( - tableName = cms.string('/dev/CMSSW_11_2_0/PRef/V9') + tableName = cms.string('/dev/CMSSW_11_2_0/PRef/V10') ) process.transferSystem = cms.PSet( @@ -3839,10 +3839,14 @@ PixelShapeFile = cms.string( "RecoPixelVertexing/PixelLowPtUtilities/data/pixelShapePhase1_noL1.par" ) ) process.DTGeometryESModule = cms.ESProducer( "DTGeometryESModule", + DDDetector = cms.ESInputTag( "" ), appendToDataLabel = cms.string( "" ), + alignmentsLabel = cms.string( "" ), + attribute = cms.string( "MuStructure" ), + value = cms.string( "MuonBarrelDT" ), + fromDD4hep = cms.bool( False ), fromDDD = cms.bool( False ), - applyAlignment = cms.bool( True ), - alignmentsLabel = cms.string( "" ) + applyAlignment = cms.bool( True ) ) process.DTObjectMapESProducer = cms.ESProducer( "DTObjectMapESProducer", appendToDataLabel = cms.string( "" ) @@ -5746,6 +5750,7 @@ process.hltGtStage2ObjectMap = cms.EDProducer( "L1TGlobalProducer", L1DataBxInEvent = cms.int32( 5 ), AlgorithmTriggersUnmasked = cms.bool( True ), + RequireMenuToMatchAlgoBlkInput = cms.bool( True ), EtSumInputTag = cms.InputTag( 'hltGtStage2Digis','EtSum' ), BstLengthBytes = cms.int32( -1 ), MuonInputTag = cms.InputTag( 'hltGtStage2Digis','Muon' ), @@ -5759,12 +5764,12 @@ PrescaleCSVFile = cms.string( "prescale_L1TGlobal.csv" ), PrintL1Menu = cms.untracked.bool( False ), ExtInputTag = cms.InputTag( "hltGtStage2Digis" ), - AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ), + TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ), PrescaleSet = cms.uint32( 1 ), EGammaInputTag = cms.InputTag( 'hltGtStage2Digis','EGamma' ), ProduceL1GtObjectMapRecord = cms.bool( True ), GetPrescaleColumnFromData = cms.bool( False ), - TauInputTag = cms.InputTag( 'hltGtStage2Digis','Tau' ) + AlgoBlkInputTag = cms.InputTag( "hltGtStage2Digis" ) ) process.hltScalersRawToDigi = cms.EDProducer( "ScalersRawToDigi", scalersInputTag = cms.InputTag( "rawDataCollector" ) @@ -6379,7 +6384,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -6415,7 +6421,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), @@ -6447,7 +6454,8 @@ doTOFCorrection = cms.bool( True ), vPropWire = cms.double( 24.4 ), doT0Correction = cms.bool( True ), - doWirePropCorrection = cms.bool( True ) + doWirePropCorrection = cms.bool( True ), + t0Label = cms.string( "" ) ), useUncertDB = cms.bool( True ), doVdriftCorr = cms.bool( True ), From 153b1aff6790781a109cbd468aaed66370575edb Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Mon, 5 Oct 2020 18:02:35 +0200 Subject: [PATCH 250/778] rename cleaned genJet collection --- .../PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index 05680c7e97ef5..e142b148c6683 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -15,13 +15,13 @@ src = 'allPartons', ) -ak4HiCleanedGenJets = heavyIonCleanedGenJets.clone(src = "ak4HiGenJets") +ak4HiGenJetsCleaned = heavyIonCleanedGenJets.clone(src = "ak4HiGenJets") cleanedGenJetsTask = cms.Task( genParticlesForJets, cleanedPartons, ak4HiGenJets, - ak4HiCleanedGenJets + ak4HiGenJetsCleaned ) from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfEmptyCollection, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation, akCs4PFJets From 8cfa21f61db8243411b02453e71e6a6f59fd5f1d Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Mon, 5 Oct 2020 18:15:58 +0200 Subject: [PATCH 251/778] address comments --- DetectorDescription/DDCMS/interface/DDFilteredView.h | 4 ++-- .../DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc | 2 +- DetectorDescription/DDCMS/src/DDFilteredView.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 4f5bafdc90938..d119a08dcab7d 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -250,8 +250,8 @@ namespace cms { // the registry const DDSpecPar* find(const std::string&) const; void filter(DDSpecParRefs&, const std::string&) const; - const std::string_view front(const std::string_view) const; - const std::string_view back(const std::string_view) const; + std::string_view front(const std::string_view) const; + std::string_view back(const std::string_view) const; ExpandedNodes nodes_; std::vector<Iterator> it_; diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 7edb3da685333..1a1eac6f355ee 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -509,7 +509,7 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { "+++ Compared to XML values: Atomic weight %g, Atomic number %u", atomicWeight, atomicNumber); - static constexpr double const& weightTolerance = 1.0e-6; + static constexpr double const weightTolerance = 1.0e-6; if (atomicNumber != elt->Z() || (std::abs(atomicWeight - elt->A()) > (weightTolerance * (atomicWeight + elt->A())))) newMatDef = true; diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index fcaae205728a4..38c655e459ae5 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -709,7 +709,7 @@ void DDFilteredView::filter(DDSpecParRefs& refs, const std::string& key) const { } } -const std::string_view DDFilteredView::front(const std::string_view path) const { +std::string_view DDFilteredView::front(const std::string_view path) const { auto const& lpos = path.find_first_not_of('/'); if (lpos != path.npos) { auto rpos = path.find_first_of('/', lpos); @@ -723,7 +723,7 @@ const std::string_view DDFilteredView::front(const std::string_view path) const return path; } -const std::string_view DDFilteredView::back(const std::string_view path) const { +std::string_view DDFilteredView::back(const std::string_view path) const { if (auto const& lpos = path.rfind('/') != path.npos) { return path.substr(lpos, path.size()); } From 08512638d0abe4bae931fd44d6d123bbc49ab8d2 Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Mon, 5 Oct 2020 18:28:15 +0200 Subject: [PATCH 252/778] cosmetics as suggested by @jpata --- MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc b/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc index 94146538c00f9..c5163a16db487 100644 --- a/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc +++ b/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc @@ -21,7 +21,6 @@ using namespace SurfaceOrientation; using namespace std; using namespace magneticfield; using namespace edm; -//using namespace angle_units::operators; using DDBox = dd4hep::Box; using DDTrap = dd4hep::Trap; @@ -78,7 +77,7 @@ volumeHandle::volumeHandle(const cms::DDFilteredView &fv, bool expand2Pi, bool d double rInPlusZ = cons.rMin2(); double rOutPlusZ = cons.rMax2(); double startPhi = cons.startPhi(); - double deltaPhi = cons.endPhi() - startPhi; + double deltaPhi = reco::deltaPhi(cons.endPhi(), startPhi); buildCons(zhalf, rInMinusZ, rOutMinusZ, rInPlusZ, rOutPlusZ, startPhi, deltaPhi); } break; case DDSolidShape::ddtubs: { From c37cf491dc223ddb295f1c6309f34f3e8b2b69a5 Mon Sep 17 00:00:00 2001 From: Kevin Pedro <kpedro88@gmail.com> Date: Mon, 5 Oct 2020 11:52:40 -0500 Subject: [PATCH 253/778] more removals --- Configuration/Geometry/README.md | 4 +- .../python/GeometryExtended2026D63Reco_cff.py | 60 -------- .../python/GeometryExtended2026D63_cff.py | 13 -- .../Geometry/python/dict2026Geometry.py | 51 +------ .../PyReleaseValidation/python/relval_2026.py | 1 - .../python/upgradeWorkflowComponents.py | 84 +----------- .../StandardSequences/python/GeometryConf.py | 1 - .../dd4hep/cmsExtendedGeometry2026D63.xml | 125 ----------------- .../cmsExtendedGeometry2026D63XML_cfi.py | 129 ------------------ 9 files changed, 4 insertions(+), 464 deletions(-) delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D63Reco_cff.py delete mode 100644 Configuration/Geometry/python/GeometryExtended2026D63_cff.py delete mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D63.xml delete mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D63XML_cfi.py diff --git a/Configuration/Geometry/README.md b/Configuration/Geometry/README.md index 2fe809a6ab33f..c62e6208201cb 100644 --- a/Configuration/Geometry/README.md +++ b/Configuration/Geometry/README.md @@ -49,8 +49,7 @@ Calorimeters: Muon system: * M4: Phase2 muon system for TDR w/ GE2/1, ME0, RE3/1, RE4/1 (incl. granularity in ME0, staggered GE2/1), 96 iRPC strips, no overlaps, MB4Shields -* M5: same as M4 but with: the right value for YE3 size, no "hidden" overlaps inside the Muon System and iRPC updated. -* M6: same as M5 but with adjustment of ME0 in view of updated boundaries +* M6: same as M4 with right value for YE3 size, no "hidden" overlaps, iRPC updated, adjustment of ME0 in view of updated boundaries * M7: same as M6 with further ajustment of ME0 for boundaries * M8: same as M7 with changed number of strips for GE21 * M9: same as M8 with GE0 replacing ME0 @@ -76,7 +75,6 @@ Several detector combinations have been generated: * D50 = T15+C9+M4+I11+O4+F2 * D53 = T15+C9+M4+I12+O4+F2 * D60 = T15+C10+M4+I10+O4+F3 -* D63 = T21+C11+M4+I11+O5+F4 * D64 = T22+C11+M4+I11+O5+F4 * D65 = T23+C11+M4+I11+O5+F4 * D66 = T21+C11+M8+I11+O5+F4 diff --git a/Configuration/Geometry/python/GeometryExtended2026D63Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D63Reco_cff.py deleted file mode 100644 index 6ccc14925af97..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D63Reco_cff.py +++ /dev/null @@ -1,60 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Configuration.Geometry.GeometryExtended2026D63_cff import * - -# tracker -from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * -from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * -from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * -from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * -from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -trackerGeometry.applyAlignment = cms.bool(False) - -# calo -from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * -from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * -from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * -CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", - SelectedCalos = cms.vstring("HCAL", - "ZDC", - "EcalBarrel", - "TOWER", - "HGCalEESensitive", - "HGCalHESiliconSensitive", - "HGCalHEScintillatorSensitive" - ) -) -from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * -from Geometry.HcalEventSetup.HcalGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * -from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * -from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * -from Geometry.EcalMapping.EcalMapping_cfi import * -from Geometry.EcalMapping.EcalMappingRecord_cfi import * - -# muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * -from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * - -# forward -from Geometry.ForwardGeometry.ForwardGeometry_cfi import * - -# timing -from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * -from Geometry.MTDGeometryBuilder.mtdParameters_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * -from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * -from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * -from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * -mtdGeometry.applyAlignment = cms.bool(False) - diff --git a/Configuration/Geometry/python/GeometryExtended2026D63_cff.py b/Configuration/Geometry/python/GeometryExtended2026D63_cff.py deleted file mode 100644 index 2ebaa71be01fa..0000000000000 --- a/Configuration/Geometry/python/GeometryExtended2026D63_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -from Geometry.CMSCommonData.cmsExtendedGeometry2026D63XML_cfi import * -from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * -from Geometry.EcalCommonData.ecalSimulationParameters_cff import * -from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * -from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * -from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * -from Geometry.MuonNumbering.muonGeometryConstants_cff import * -from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index ddc9f00e1fc90..30dfeccee4806 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -780,52 +780,6 @@ ], "era" : "phase2_muon, phase2_GEM", }, - "M5" : { - 1 : [ - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v3/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v3/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v2/me0.xml', - ], - 2 : [ - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', - ], - 3 : [ - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - ], - 4 : [ - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - ], - "sim" : [ - 'from Geometry.MuonNumbering.muonGeometryConstants_cff import *', - ], - "reco" : [ - 'from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *', - 'from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *', - 'from Geometry.GEMGeometryBuilder.gemGeometry_cfi import *', - 'from Geometry.GEMGeometryBuilder.me0Geometry_cfi import *', - 'from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *', - 'from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *', - ], - "era" : "phase2_muon, run3_GEM", - }, "M6" : { 1 : [ 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', @@ -1243,12 +1197,11 @@ ("O4","T15","C9","M4","F2","I11") : "D50", ("O4","T15","C9","M4","F2","I12") : "D53", ("O4","T15","C10","M4","F3","I10") : "D60", - ("O5","T21","C11","M4","F4","I11") : "D63", ("O5","T22","C11","M4","F4","I11") : "D64", ("O5","T23","C11","M4","F4","I11") : "D65", ("O5","T21","C11","M8","F4","I11") : "D66", ("O5","T21","C11","M9","F4","I11") : "D67", } -deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D51", "D52", "D54", "D55", "D56", "D57", "D58", "D59", "D61", "D62" ]) -deprecatedSubdets = set([ "T1", "T2" ,"T3", "T4", "T5", "T6", "T7", "T8", "T9", "T10", "T11", "T12", "T13", "T14", "T16", "T17", "T18", "T19", "T20", "C1", "C2", "C3", "C5", "C7", "M1", "I1", "I2", "I3", "I4", "I6", "I8", "O1", "F1", "C4", "C6", "C8", "M2", "M3", "I5", "I7", "I9", "O2", "O3" ]) +deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D51", "D52", "D54", "D55", "D56", "D57", "D58", "D59", "D61", "D62", "D63" ]) +deprecatedSubdets = set([ "T1", "T2" ,"T3", "T4", "T5", "T6", "T7", "T8", "T9", "T10", "T11", "T12", "T13", "T14", "T16", "T17", "T18", "T19", "T20", "C1", "C2", "C3", "C5", "C7", "M1", "I1", "I2", "I3", "I4", "I6", "I8", "O1", "F1", "C4", "C6", "C8", "M2", "M3", "I5", "I7", "I9", "O2", "O3", "M5" ]) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index 5445eb806179c..6157d215c6457 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -20,7 +20,6 @@ numWFIB.extend([23234.21,23434.21]) #2026D49 prodlike, prodlike PU numWFIB.extend([23234.103]) #2026D49 aging numWFIB.extend([28234.0]) #2026D60 -numWFIB.extend([29434.0]) #2026D63 numWFIB.extend([29834.0]) #2026D64 numWFIB.extend([30234.0]) #2026D65 numWFIB.extend([30634.0]) #2026D66 diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 3fdb8770becaa..fb0fd942348cf 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -30,28 +30,10 @@ upgradeKeys[2026] = [ '2026D49', '2026D49PU', - '2026D51', - '2026D51PU', '2026D53', '2026D53PU', - '2026D54', - '2026D54PU', - '2026D56', - '2026D56PU', - '2026D57', - '2026D57PU', - '2026D58', - '2026D58PU', - '2026D59', - '2026D59PU', '2026D60', '2026D60PU', - '2026D61', - '2026D61PU', - '2026D62', - '2026D62PU', - '2026D63', - '2026D63PU', '2026D64', '2026D64PU', '2026D65', @@ -69,7 +51,7 @@ } numWFSkip=200 # temporary measure to keep other WF numbers the same -numWFConflict = [[20000,23200],[24000,24400],[25000,26000],[26200,26600],[50000,51000]] +numWFConflict = [[20000,23200],[23600,24400],[24800,28200],[28600,29800],[50000,51000]] numWFAll={ 2017: [], 2026: [] @@ -941,13 +923,6 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C9', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, - '2026D51' : { - 'Geom' : 'Extended2026D51', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T15', - 'Era' : 'Phase2C9', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, '2026D53' : { 'Geom' : 'Extended2026D53', 'HLTmenu': '@fake2', @@ -955,42 +930,6 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C9', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, - '2026D54' : { - 'Geom' : 'Extended2026D54', # N.B.: Geometry with 3D pixels in the Inner Tracker. - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T19', # This symbolic GT has no pixel template / GenError informations. - 'ProcessModifier': 'phase2_PixelCPEGeneric', # This modifier removes all need for IT template information. DO NOT USE for standard planar sensors. - 'Era' : 'Phase2C9', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, - '2026D56' : { - 'Geom' : 'Extended2026D56', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T20', - 'Era' : 'Phase2C9', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, - '2026D57' : { - 'Geom' : 'Extended2026D57', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T17', - 'Era' : 'Phase2C11', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, - '2026D58' : { - 'Geom' : 'Extended2026D58', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T17', - 'Era' : 'Phase2C12', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, - '2026D59' : { - 'Geom' : 'Extended2026D59', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T17', - 'Era' : 'Phase2C11', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, '2026D60' : { 'Geom' : 'Extended2026D60', 'HLTmenu': '@fake2', @@ -998,27 +937,6 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C10', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, - '2026D61' : { - 'Geom' : 'Extended2026D61', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T17', - 'Era' : 'Phase2C9', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, - '2026D62' : { - 'Geom' : 'Extended2026D62', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T17', - 'Era' : 'Phase2C11', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, - '2026D63' : { - 'Geom' : 'Extended2026D63', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T21', - 'Era' : 'Phase2C11', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, '2026D64' : { 'Geom' : 'Extended2026D64', # N.B.: Geometry with square 50x50 um2 pixels in the Inner Tracker. 'HLTmenu': '@fake2', diff --git a/Configuration/StandardSequences/python/GeometryConf.py b/Configuration/StandardSequences/python/GeometryConf.py index d342e548203d2..64cbdc44d93b0 100644 --- a/Configuration/StandardSequences/python/GeometryConf.py +++ b/Configuration/StandardSequences/python/GeometryConf.py @@ -35,7 +35,6 @@ 'Extended2026D50' : 'Extended2026D50,Extended2026D50Reco', 'Extended2026D53' : 'Extended2026D53,Extended2026D53Reco', 'Extended2026D60' : 'Extended2026D60,Extended2026D60Reco', - 'Extended2026D63' : 'Extended2026D63,Extended2026D63Reco', 'Extended2026D64' : 'Extended2026D64,Extended2026D64Reco', 'Extended2026D65' : 'Extended2026D65,Extended2026D65Reco', 'Extended2026D66' : 'Extended2026D66,Extended2026D66Reco', diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D63.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D63.xml deleted file mode 100644 index 16a1ac83805b3..0000000000000 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D63.xml +++ /dev/null @@ -1,125 +0,0 @@ -<?xml version="1.0"?> -<DDDefinition> - <open_geometry/> - <close_geometry/> - - <IncludeSection> - <Include ref='Geometry/CMSCommonData/data/materials/2021/v1/materials.xml'/> - <Include ref='Geometry/CMSCommonData/data/rotations.xml'/> - <Include ref='Geometry/CMSCommonData/data/extend/v2/cmsextent.xml'/> - <Include ref='Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml'/> - <Include ref='Geometry/CMSCommonData/data/cms/2026/v4/cms.xml'/> - <Include ref='Geometry/CMSCommonData/data/cmsMother.xml'/> - <Include ref='Geometry/CMSCommonData/data/eta3/etaMax.xml'/> - <Include ref='Geometry/CMSCommonData/data/cmsTracker.xml'/> - <Include ref='Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml'/> - <Include ref='Geometry/CMSCommonData/data/cmsCalo.xml'/> - <Include ref='Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml'/> - <Include ref='Geometry/CMSCommonData/data/cmsMuon.xml'/> - <Include ref='Geometry/CMSCommonData/data/mgnt.xml'/> - <Include ref='Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml'/> - <Include ref='Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml'/> - <Include ref='Geometry/CMSCommonData/data/muonMB.xml'/> - <Include ref='Geometry/CMSCommonData/data/muonMagnet.xml'/> - <Include ref='Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml'/> - <Include ref='Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'/> - <Include ref='Geometry/TrackerCommonData/data/pixfwdCommon.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml'/> - <Include ref='Geometry/TrackerCommonData/data/trackermaterial.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml'/> - <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml'/> - <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml'/> - <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml'/> - <Include ref='Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml'/> - <Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'/> - <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml'/> - <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml'/> - <Include ref='Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml'/> - <Include ref='Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml'/> - <Include ref='Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml'/> - <Include ref='Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml'/> - <Include ref='Geometry/EcalCommonData/data/ebalgo.xml'/> - <Include ref='Geometry/EcalCommonData/data/ebcon.xml'/> - <Include ref='Geometry/EcalCommonData/data/ebrot.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcalrotations.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcalbarrelalgo.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcalouteralgo.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcalforwardalgo.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml'/> - <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> - <Include ref='Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml'/> - <Include ref='Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml'/> - <Include ref='Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml'/> - <Include ref='Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml'/> - <Include ref='Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml'/> - <Include ref='Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml'/> - <Include ref='Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml'/> - <Include ref='Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml'/> - <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> - <Include ref='Geometry/MuonCommonData/data/muonYoke/2021/v2/muonYoke.xml'/> - <Include ref='Geometry/MuonCommonData/data/mf/2026/v2/mf.xml'/> - <Include ref='Geometry/MuonCommonData/data/csc/2021/v1/csc.xml'/> - <Include ref='Geometry/MuonCommonData/data/rpcf/2026/v2/rpcf.xml'/> - <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> - <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> - <Include ref='Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml'/> - <Include ref='Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml'/> - <Include ref='Geometry/MuonCommonData/data/me0/TDR_Dev/v2/me0.xml'/> - <Include ref='Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml'/> - <Include ref='Geometry/ForwardCommonData/data/brmrotations.xml'/> - <Include ref='Geometry/ForwardCommonData/data/PostLS2/brm.xml'/> - <Include ref='Geometry/ForwardCommonData/data/zdcmaterials.xml'/> - <Include ref='Geometry/ForwardCommonData/data/lumimaterials.xml'/> - <Include ref='Geometry/ForwardCommonData/data/zdcrotations.xml'/> - <Include ref='Geometry/ForwardCommonData/data/lumirotations.xml'/> - <Include ref='Geometry/ForwardCommonData/data/zdc.xml'/> - <Include ref='Geometry/ForwardCommonData/data/zdclumi.xml'/> - <Include ref='Geometry/ForwardCommonData/data/cmszdc.xml'/> - <Include ref='Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml'/> - <Include ref='Geometry/MTDCommonData/data/btl/v1/btl.xml'/> - <Include ref='Geometry/MTDCommonData/data/etl/v3/etl.xml'/> - <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml'/> - <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml'/> - <Include ref='Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/muonNumbering.xml'/> - <Include ref='Geometry/EcalSimData/data/PhaseII/ecalsens.xml'/> - <Include ref='Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml'/> - <Include ref='Geometry/HcalSimData/data/hf.xml'/> - <Include ref='Geometry/HcalSimData/data/hfpmt.xml'/> - <Include ref='Geometry/HcalSimData/data/hffibrebundle.xml'/> - <Include ref='Geometry/HcalSimData/data/CaloUtil.xml'/> - <Include ref='Geometry/HGCalSimData/data/hgcsensv9.xml'/> - <Include ref='Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml'/> - <Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml'/> - <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml'/> - <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecs.xml'/> - <Include ref='Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml'/> - <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml'/> - <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml'/> - <Include ref='Geometry/ForwardCommonData/data/brmsens.xml'/> - <Include ref='Geometry/ForwardSimData/data/zdcsens.xml'/> - <Include ref='Geometry/MTDSimData/data/v1/mtdsens.xml'/> - <Include ref='Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml'/> - <Include ref='Geometry/EcalSimData/data/EcalProdCuts.xml'/> - <Include ref='Geometry/HGCalSimData/data/hgcProdCutsv9.xml'/> - <Include ref='Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml'/> - <Include ref='Geometry/ForwardSimData/data/zdcProdCuts.xml'/> - <Include ref='Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml'/> - <Include ref='Geometry/MTDSimData/data/v1/mtdProdCuts.xml'/> - <Include ref='Geometry/CMSCommonData/data/FieldParameters.xml'/> - </IncludeSection> -</DDDefinition> diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D63XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D63XML_cfi.py deleted file mode 100644 index 644bc1d0df2ea..0000000000000 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D63XML_cfi.py +++ /dev/null @@ -1,129 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# This config was generated automatically using generate2026Geometry.py -# If you notice a mistake, please update the generating script, not just this config - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring( - 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', - 'Geometry/CMSCommonData/data/rotations.xml', - 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', - 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', - 'Geometry/CMSCommonData/data/cms/2026/v4/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/CMSCommonData/data/cmsTracker.xml', - 'Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml', - 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', - 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', - 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', - 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', - 'Geometry/TrackerCommonData/data/trackermaterial.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', - 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', - 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', - 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', - 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', - 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', - 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', - 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', - 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', - 'Geometry/EcalCommonData/data/ebalgo.xml', - 'Geometry/EcalCommonData/data/ebcon.xml', - 'Geometry/EcalCommonData/data/ebrot.xml', - 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', - 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', - 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', - 'Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml', - 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', - 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', - 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', - 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', - 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', - 'Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', - 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', - 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v2/muonYoke.xml', - 'Geometry/MuonCommonData/data/mf/2026/v2/mf.xml', - 'Geometry/MuonCommonData/data/csc/2021/v1/csc.xml', - 'Geometry/MuonCommonData/data/rpcf/2026/v2/rpcf.xml', - 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', - 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', - 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', - 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', - 'Geometry/MuonCommonData/data/me0/TDR_Dev/v2/me0.xml', - 'Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml', - 'Geometry/ForwardCommonData/data/brmrotations.xml', - 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', - 'Geometry/ForwardCommonData/data/zdcmaterials.xml', - 'Geometry/ForwardCommonData/data/lumimaterials.xml', - 'Geometry/ForwardCommonData/data/zdcrotations.xml', - 'Geometry/ForwardCommonData/data/lumirotations.xml', - 'Geometry/ForwardCommonData/data/zdc.xml', - 'Geometry/ForwardCommonData/data/zdclumi.xml', - 'Geometry/ForwardCommonData/data/cmszdc.xml', - 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', - 'Geometry/MTDCommonData/data/btl/v1/btl.xml', - 'Geometry/MTDCommonData/data/etl/v3/etl.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', - 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', - )+ - cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/muonNumbering.xml', - 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HGCalSimData/data/hgcsensv9.xml', - 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', - 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', - 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', - 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', - 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', - 'Geometry/ForwardCommonData/data/brmsens.xml', - 'Geometry/ForwardSimData/data/zdcsens.xml', - 'Geometry/MTDSimData/data/v1/mtdsens.xml', - 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', - 'Geometry/EcalSimData/data/EcalProdCuts.xml', - 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', - 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', - 'Geometry/ForwardSimData/data/zdcProdCuts.xml', - 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', - 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml', - ), - rootNodeName = cms.string('cms:OCMS') -) From faa1b4d9e86bad809182a47ce4ebe12899232d88 Mon Sep 17 00:00:00 2001 From: Kevin Pedro <kpedro88@gmail.com> Date: Mon, 5 Oct 2020 12:03:52 -0500 Subject: [PATCH 254/778] migrate HGCal dev workflows to newer tracker --- Configuration/Geometry/README.md | 4 + .../python/GeometryExtended2026D68Reco_cff.py | 60 ++++++++ .../python/GeometryExtended2026D68_cff.py | 13 ++ .../python/GeometryExtended2026D69Reco_cff.py | 63 ++++++++ .../python/GeometryExtended2026D69_cff.py | 16 +++ .../python/GeometryExtended2026D70Reco_cff.py | 60 ++++++++ .../python/GeometryExtended2026D70_cff.py | 13 ++ .../python/GeometryExtended2026D71Reco_cff.py | 60 ++++++++ .../python/GeometryExtended2026D71_cff.py | 13 ++ .../Geometry/python/dict2026Geometry.py | 4 + .../PyReleaseValidation/python/relval_2026.py | 4 + .../python/upgradeWorkflowComponents.py | 36 +++++ .../StandardSequences/python/GeometryConf.py | 4 + .../dd4hep/cmsExtendedGeometry2026D68.xml | 125 ++++++++++++++++ .../dd4hep/cmsExtendedGeometry2026D69.xml | 132 +++++++++++++++++ .../dd4hep/cmsExtendedGeometry2026D70.xml | 126 ++++++++++++++++ .../dd4hep/cmsExtendedGeometry2026D71.xml | 126 ++++++++++++++++ .../cmsExtendedGeometry2026D68XML_cfi.py | 129 +++++++++++++++++ .../cmsExtendedGeometry2026D69XML_cfi.py | 136 ++++++++++++++++++ .../cmsExtendedGeometry2026D70XML_cfi.py | 130 +++++++++++++++++ .../cmsExtendedGeometry2026D71XML_cfi.py | 130 +++++++++++++++++ 21 files changed, 1384 insertions(+) create mode 100644 Configuration/Geometry/python/GeometryExtended2026D68Reco_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D68_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D69Reco_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D69_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D70Reco_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D70_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D71Reco_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D71_cff.py create mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D68.xml create mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D69.xml create mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D70.xml create mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D71.xml create mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D68XML_cfi.py create mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D69XML_cfi.py create mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D70XML_cfi.py create mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D71XML_cfi.py diff --git a/Configuration/Geometry/README.md b/Configuration/Geometry/README.md index c62e6208201cb..00d6f57f44408 100644 --- a/Configuration/Geometry/README.md +++ b/Configuration/Geometry/README.md @@ -79,5 +79,9 @@ Several detector combinations have been generated: * D65 = T23+C11+M4+I11+O5+F4 * D66 = T21+C11+M8+I11+O5+F4 * D67 = T21+C11+M9+I11+O5+F4 +* D68 = T21+C11+M6+I11+O5+F4 +* D69 = T21+C12+M6+I11+O5+F5 +* D70 = T21+C13+M7+I11+O6+F6 +* D71 = T21+C14+M7+I11+O7+F6 D49 is the HLT TDR baseline. diff --git a/Configuration/Geometry/python/GeometryExtended2026D68Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D68Reco_cff.py new file mode 100644 index 0000000000000..ac74dfda489c9 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D68Reco_cff.py @@ -0,0 +1,60 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Configuration.Geometry.GeometryExtended2026D68_cff import * + +# tracker +from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * +from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * +from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * +from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * +trackerGeometry.applyAlignment = cms.bool(False) + +# calo +from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "TOWER", + "HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive" + ) +) +from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * +from Geometry.EcalMapping.EcalMapping_cfi import * +from Geometry.EcalMapping.EcalMappingRecord_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# timing +from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * +from Geometry.MTDGeometryBuilder.mtdParameters_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * +from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * +from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * +from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * +mtdGeometry.applyAlignment = cms.bool(False) + diff --git a/Configuration/Geometry/python/GeometryExtended2026D68_cff.py b/Configuration/Geometry/python/GeometryExtended2026D68_cff.py new file mode 100644 index 0000000000000..103a7041e9d98 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D68_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Geometry.CMSCommonData.cmsExtendedGeometry2026D68XML_cfi import * +from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.EcalCommonData.ecalSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * +from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D69Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D69Reco_cff.py new file mode 100644 index 0000000000000..e8d869724eafa --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D69Reco_cff.py @@ -0,0 +1,63 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Configuration.Geometry.GeometryExtended2026D69_cff import * + +# tracker +from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * +from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * +from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * +from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * +trackerGeometry.applyAlignment = cms.bool(False) + +# calo +from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.HFNoseTopology_cfi import * +from Geometry.ForwardGeometry.HFNoseGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "TOWER", + "HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive", + "HGCalHFNoseSensitive", + ) +) +from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * +from Geometry.EcalMapping.EcalMapping_cfi import * +from Geometry.EcalMapping.EcalMappingRecord_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# timing +from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * +from Geometry.MTDGeometryBuilder.mtdParameters_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * +from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * +from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * +from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * +mtdGeometry.applyAlignment = cms.bool(False) + diff --git a/Configuration/Geometry/python/GeometryExtended2026D69_cff.py b/Configuration/Geometry/python/GeometryExtended2026D69_cff.py new file mode 100644 index 0000000000000..6d17bef008879 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D69_cff.py @@ -0,0 +1,16 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Geometry.CMSCommonData.cmsExtendedGeometry2026D69XML_cfi import * +from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.EcalCommonData.ecalSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * +from Geometry.ForwardCommonData.hfnoseParametersInitialization_cfi import * +from Geometry.ForwardCommonData.hfnoseNumberingInitialization_cfi import * +from Geometry.MuonNumbering.muonGeometryConstants_cff import * + +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D70Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D70Reco_cff.py new file mode 100644 index 0000000000000..ba550135188b7 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D70Reco_cff.py @@ -0,0 +1,60 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Configuration.Geometry.GeometryExtended2026D70_cff import * + +# tracker +from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * +from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * +from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * +from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * +trackerGeometry.applyAlignment = cms.bool(False) + +# calo +from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "TOWER", + "HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive" + ) +) +from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * +from Geometry.EcalMapping.EcalMapping_cfi import * +from Geometry.EcalMapping.EcalMappingRecord_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# timing +from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * +from Geometry.MTDGeometryBuilder.mtdParameters_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * +from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * +from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * +from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * +mtdGeometry.applyAlignment = cms.bool(False) + diff --git a/Configuration/Geometry/python/GeometryExtended2026D70_cff.py b/Configuration/Geometry/python/GeometryExtended2026D70_cff.py new file mode 100644 index 0000000000000..ee65ff807f58c --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D70_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Geometry.CMSCommonData.cmsExtendedGeometry2026D70XML_cfi import * +from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.EcalCommonData.ecalSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * +from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D71Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D71Reco_cff.py new file mode 100644 index 0000000000000..ae729bee658a0 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D71Reco_cff.py @@ -0,0 +1,60 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Configuration.Geometry.GeometryExtended2026D71_cff import * + +# tracker +from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * +from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * +from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * +from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * +trackerGeometry.applyAlignment = cms.bool(False) + +# calo +from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "TOWER", + "HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive" + ) +) +from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * +from Geometry.EcalMapping.EcalMapping_cfi import * +from Geometry.EcalMapping.EcalMappingRecord_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# timing +from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * +from Geometry.MTDGeometryBuilder.mtdParameters_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * +from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * +from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * +from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * +mtdGeometry.applyAlignment = cms.bool(False) + diff --git a/Configuration/Geometry/python/GeometryExtended2026D71_cff.py b/Configuration/Geometry/python/GeometryExtended2026D71_cff.py new file mode 100644 index 0000000000000..a4a5662d0ff3a --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D71_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Geometry.CMSCommonData.cmsExtendedGeometry2026D71XML_cfi import * +from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.EcalCommonData.ecalSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * +from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index 30dfeccee4806..4dbab6c32cb80 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -1201,6 +1201,10 @@ ("O5","T23","C11","M4","F4","I11") : "D65", ("O5","T21","C11","M8","F4","I11") : "D66", ("O5","T21","C11","M9","F4","I11") : "D67", + ("O5","T21","C11","M6","F4","I11") : "D68", + ("O5","T21","C12","M6","F5","I11") : "D69", + ("O6","T21","C13","M7","F6","I11") : "D70", + ("O7","T21","C14","M7","F6","I11") : "D71", } deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D51", "D52", "D54", "D55", "D56", "D57", "D58", "D59", "D61", "D62", "D63" ]) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index 6157d215c6457..e023aaf2653d8 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -24,6 +24,10 @@ numWFIB.extend([30234.0]) #2026D65 numWFIB.extend([30634.0]) #2026D66 numWFIB.extend([31034.0]) #2026D67 +numWFIB.extend([31434.0]) #2026D68 +numWFIB.extend([31834.0]) #2026D69 +numWFIB.extend([32234.0]) #2026D70 +numWFIB.extend([32634.0]) #2026D71 for numWF in numWFIB: workflows[numWF] = _upgrade_workflows[numWF] diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index fb0fd942348cf..348256ce9258b 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -42,6 +42,14 @@ '2026D66PU', '2026D67', '2026D67PU', + '2026D68', + '2026D68PU', + '2026D69', + '2026D69PU', + '2026D70', + '2026D70PU', + '2026D71', + '2026D71PU', ] # pre-generation of WF numbers @@ -966,6 +974,34 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C11M9', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, + '2026D68' : { + 'Geom' : 'Extended2026D68', + 'HLTmenu': '@fake2', + 'GT' : 'auto:phase2_realistic_T21', + 'Era' : 'Phase2C11', + 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], + }, + '2026D69' : { + 'Geom' : 'Extended2026D69', + 'HLTmenu': '@fake2', + 'GT' : 'auto:phase2_realistic_T21', + 'Era' : 'Phase2C12', + 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], + }, + '2026D70' : { + 'Geom' : 'Extended2026D70', + 'HLTmenu': '@fake2', + 'GT' : 'auto:phase2_realistic_T21', + 'Era' : 'Phase2C11', + 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], + }, + '2026D71' : { + 'Geom' : 'Extended2026D71', + 'HLTmenu': '@fake2', + 'GT' : 'auto:phase2_realistic_T21', + 'Era' : 'Phase2C11', + 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], + }, } # standard PU sequences diff --git a/Configuration/StandardSequences/python/GeometryConf.py b/Configuration/StandardSequences/python/GeometryConf.py index 64cbdc44d93b0..4e8c6777eecbb 100644 --- a/Configuration/StandardSequences/python/GeometryConf.py +++ b/Configuration/StandardSequences/python/GeometryConf.py @@ -39,4 +39,8 @@ 'Extended2026D65' : 'Extended2026D65,Extended2026D65Reco', 'Extended2026D66' : 'Extended2026D66,Extended2026D66Reco', 'Extended2026D67' : 'Extended2026D67,Extended2026D67Reco', + 'Extended2026D68' : 'Extended2026D68,Extended2026D68Reco', + 'Extended2026D69' : 'Extended2026D69,Extended2026D69Reco', + 'Extended2026D70' : 'Extended2026D70,Extended2026D70Reco', + 'Extended2026D71' : 'Extended2026D71,Extended2026D71Reco', } diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D68.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D68.xml new file mode 100644 index 0000000000000..af8ed7641dead --- /dev/null +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D68.xml @@ -0,0 +1,125 @@ +<?xml version="1.0"?> +<DDDefinition> + <open_geometry/> + <close_geometry/> + + <IncludeSection> + <Include ref='Geometry/CMSCommonData/data/materials/2021/v1/materials.xml'/> + <Include ref='Geometry/CMSCommonData/data/rotations.xml'/> + <Include ref='Geometry/CMSCommonData/data/extend/v2/cmsextent.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml'/> + <Include ref='Geometry/CMSCommonData/data/cms/2026/v4/cms.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMother.xml'/> + <Include ref='Geometry/CMSCommonData/data/eta3/etaMax.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsTracker.xml'/> + <Include ref='Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsCalo.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMuon.xml'/> + <Include ref='Geometry/CMSCommonData/data/mgnt.xml'/> + <Include ref='Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMB.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMagnet.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'/> + <Include ref='Geometry/TrackerCommonData/data/pixfwdCommon.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/trackermaterial.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml'/> + <Include ref='Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml'/> + <Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml'/> + <Include ref='Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebcon.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebrot.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalrotations.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalbarrelalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalouteralgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalforwardalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/mf/2026/v5/mf.xml'/> + <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> + <Include ref='Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml'/> + <Include ref='Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml'/> + <Include ref='Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml'/> + <Include ref='Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/PostLS2/brm.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcmaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumimaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumirotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdc.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdclumi.xml'/> + <Include ref='Geometry/ForwardCommonData/data/cmszdc.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml'/> + <Include ref='Geometry/MTDCommonData/data/btl/v1/btl.xml'/> + <Include ref='Geometry/MTDCommonData/data/etl/v3/etl.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml'/> + <Include ref='Geometry/EcalSimData/data/PhaseII/ecalsens.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml'/> + <Include ref='Geometry/HcalSimData/data/hf.xml'/> + <Include ref='Geometry/HcalSimData/data/hfpmt.xml'/> + <Include ref='Geometry/HcalSimData/data/hffibrebundle.xml'/> + <Include ref='Geometry/HcalSimData/data/CaloUtil.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcsensv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml'/> + <Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecs.xml'/> + <Include ref='Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmsens.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcsens.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdsens.xml'/> + <Include ref='Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml'/> + <Include ref='Geometry/EcalSimData/data/EcalProdCuts.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcProdCutsv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdProdCuts.xml'/> + <Include ref='Geometry/CMSCommonData/data/FieldParameters.xml'/> + </IncludeSection> +</DDDefinition> diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D69.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D69.xml new file mode 100644 index 0000000000000..a627242525199 --- /dev/null +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D69.xml @@ -0,0 +1,132 @@ +<?xml version="1.0"?> +<DDDefinition> + <open_geometry/> + <close_geometry/> + + <IncludeSection> + <Include ref='Geometry/CMSCommonData/data/materials/2021/v1/materials.xml'/> + <Include ref='Geometry/CMSCommonData/data/rotations.xml'/> + <Include ref='Geometry/CMSCommonData/data/extend/v2/cmsextent.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml'/> + <Include ref='Geometry/CMSCommonData/data/cms/2026/v4/cms.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMother.xml'/> + <Include ref='Geometry/CMSCommonData/data/eta3/etaMax.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsTracker.xml'/> + <Include ref='Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsCalo.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMuon.xml'/> + <Include ref='Geometry/CMSCommonData/data/mgnt.xml'/> + <Include ref='Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMB.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMagnet.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'/> + <Include ref='Geometry/TrackerCommonData/data/pixfwdCommon.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/trackermaterial.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml'/> + <Include ref='Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml'/> + <Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml'/> + <Include ref='Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebcon.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebrot.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalrotations.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalbarrelalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalouteralgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalforwardalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml'/> + <Include ref='Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml'/> + <Include ref='Geometry/ForwardCommonData/data/hfnoseCell/v1/hfnoseCell.xml'/> + <Include ref='Geometry/ForwardCommonData/data/hfnoseWafer/v1/hfnoseWafer.xml'/> + <Include ref='Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml'/> + <Include ref='Geometry/ForwardCommonData/data/hfnoseCons/v1m/hfnoseCons.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/mf/2026/v5/mf.xml'/> + <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> + <Include ref='Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml'/> + <Include ref='Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml'/> + <Include ref='Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml'/> + <Include ref='Geometry/ForwardCommonData/data/forwardshield/2026/v3/forwardshield.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brm/2026/v2/brm.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcmaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumimaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumirotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdc.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdclumi.xml'/> + <Include ref='Geometry/ForwardCommonData/data/cmszdc.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml'/> + <Include ref='Geometry/MTDCommonData/data/btl/v1/btl.xml'/> + <Include ref='Geometry/MTDCommonData/data/etl/v3/etl.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml'/> + <Include ref='Geometry/EcalSimData/data/PhaseII/ecalsens.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml'/> + <Include ref='Geometry/HcalSimData/data/hf.xml'/> + <Include ref='Geometry/HcalSimData/data/hfpmt.xml'/> + <Include ref='Geometry/HcalSimData/data/hffibrebundle.xml'/> + <Include ref='Geometry/HcalSimData/data/CaloUtil.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcsensv9.xml'/> + <Include ref='Geometry/ForwardSimData/data/hfnosesens.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml'/> + <Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecs.xml'/> + <Include ref='Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmsens.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcsens.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdsens.xml'/> + <Include ref='Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml'/> + <Include ref='Geometry/EcalSimData/data/EcalProdCuts.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcProdCutsv9.xml'/> + <Include ref='Geometry/ForwardSimData/data/hfnoseProdCuts.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdProdCuts.xml'/> + <Include ref='Geometry/CMSCommonData/data/FieldParameters.xml'/> + </IncludeSection> +</DDDefinition> diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D70.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D70.xml new file mode 100644 index 0000000000000..28743f3447e6e --- /dev/null +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D70.xml @@ -0,0 +1,126 @@ +<?xml version="1.0"?> +<DDDefinition> + <open_geometry/> + <close_geometry/> + + <IncludeSection> + <Include ref='Geometry/CMSCommonData/data/materials/2021/v1/materials.xml'/> + <Include ref='Geometry/CMSCommonData/data/rotations.xml'/> + <Include ref='Geometry/CMSCommonData/data/extend/v2/cmsextent.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml'/> + <Include ref='Geometry/CMSCommonData/data/cms/2026/v5/cms.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMother.xml'/> + <Include ref='Geometry/CMSCommonData/data/eta3/etaMax.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsTracker.xml'/> + <Include ref='Geometry/CMSCommonData/data/caloBase/2026/v4/caloBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsCalo.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMuon.xml'/> + <Include ref='Geometry/CMSCommonData/data/mgnt.xml'/> + <Include ref='Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMB.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMagnet.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'/> + <Include ref='Geometry/TrackerCommonData/data/pixfwdCommon.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/trackermaterial.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml'/> + <Include ref='Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml'/> + <Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml'/> + <Include ref='Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebcon.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebrot.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalrotations.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalbarrelalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalouteralgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalforwardalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcal/v13/hgcal.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalCons/v13/hgcalCons.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/mf/2026/v6/mf.xml'/> + <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> + <Include ref='Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml'/> + <Include ref='Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml'/> + <Include ref='Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml'/> + <Include ref='Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcmaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumimaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumirotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdc.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdclumi.xml'/> + <Include ref='Geometry/ForwardCommonData/data/cmszdc.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml'/> + <Include ref='Geometry/MTDCommonData/data/btl/v1/btl.xml'/> + <Include ref='Geometry/MTDCommonData/data/etl/v3/etl.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml'/> + <Include ref='Geometry/EcalSimData/data/PhaseII/ecalsens.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml'/> + <Include ref='Geometry/HcalSimData/data/hf.xml'/> + <Include ref='Geometry/HcalSimData/data/hfpmt.xml'/> + <Include ref='Geometry/HcalSimData/data/hffibrebundle.xml'/> + <Include ref='Geometry/HcalSimData/data/CaloUtil.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcsensv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml'/> + <Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecs.xml'/> + <Include ref='Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmsens.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcsens.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdsens.xml'/> + <Include ref='Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml'/> + <Include ref='Geometry/EcalSimData/data/EcalProdCuts.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcProdCutsv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdProdCuts.xml'/> + <Include ref='Geometry/CMSCommonData/data/FieldParameters.xml'/> + </IncludeSection> +</DDDefinition> diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D71.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D71.xml new file mode 100644 index 0000000000000..f7d2c1bc3ec0f --- /dev/null +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D71.xml @@ -0,0 +1,126 @@ +<?xml version="1.0"?> +<DDDefinition> + <open_geometry/> + <close_geometry/> + + <IncludeSection> + <Include ref='Geometry/CMSCommonData/data/materials/2021/v1/materials.xml'/> + <Include ref='Geometry/CMSCommonData/data/rotations.xml'/> + <Include ref='Geometry/CMSCommonData/data/extend/v2/cmsextent.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml'/> + <Include ref='Geometry/CMSCommonData/data/cms/2026/v5/cms.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMother.xml'/> + <Include ref='Geometry/CMSCommonData/data/eta3/etaMax.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsTracker.xml'/> + <Include ref='Geometry/CMSCommonData/data/caloBase/2026/v5/caloBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsCalo.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMuon.xml'/> + <Include ref='Geometry/CMSCommonData/data/mgnt.xml'/> + <Include ref='Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMB.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMagnet.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'/> + <Include ref='Geometry/TrackerCommonData/data/pixfwdCommon.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/trackermaterial.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml'/> + <Include ref='Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml'/> + <Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml'/> + <Include ref='Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebcon.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebrot.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalrotations.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalbarrelalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalouteralgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalforwardalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcal/v14/hgcal.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/mf/2026/v6/mf.xml'/> + <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> + <Include ref='Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml'/> + <Include ref='Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml'/> + <Include ref='Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml'/> + <Include ref='Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcmaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumimaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumirotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdc.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdclumi.xml'/> + <Include ref='Geometry/ForwardCommonData/data/cmszdc.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml'/> + <Include ref='Geometry/MTDCommonData/data/btl/v1/btl.xml'/> + <Include ref='Geometry/MTDCommonData/data/etl/v3/etl.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml'/> + <Include ref='Geometry/EcalSimData/data/PhaseII/ecalsens.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml'/> + <Include ref='Geometry/HcalSimData/data/hf.xml'/> + <Include ref='Geometry/HcalSimData/data/hfpmt.xml'/> + <Include ref='Geometry/HcalSimData/data/hffibrebundle.xml'/> + <Include ref='Geometry/HcalSimData/data/CaloUtil.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcsensv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml'/> + <Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecs.xml'/> + <Include ref='Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmsens.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcsens.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdsens.xml'/> + <Include ref='Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml'/> + <Include ref='Geometry/EcalSimData/data/EcalProdCuts.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcProdCutsv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdProdCuts.xml'/> + <Include ref='Geometry/CMSCommonData/data/FieldParameters.xml'/> + </IncludeSection> +</DDDefinition> diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D68XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D68XML_cfi.py new file mode 100644 index 0000000000000..b9dbd14f0199f --- /dev/null +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D68XML_cfi.py @@ -0,0 +1,129 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v4/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v5/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', + 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v3/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v1/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D69XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D69XML_cfi.py new file mode 100644 index 0000000000000..0f91219bc09c9 --- /dev/null +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D69XML_cfi.py @@ -0,0 +1,136 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v4/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml', + 'Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml', + 'Geometry/ForwardCommonData/data/hfnoseCell/v1/hfnoseCell.xml', + 'Geometry/ForwardCommonData/data/hfnoseWafer/v1/hfnoseWafer.xml', + 'Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml', + 'Geometry/ForwardCommonData/data/hfnoseCons/v1m/hfnoseCons.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v5/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', + 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v3/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/brm/2026/v2/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v3/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/ForwardSimData/data/hfnosesens.xml', + 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v1/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/ForwardSimData/data/hfnoseProdCuts.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D70XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D70XML_cfi.py new file mode 100644 index 0000000000000..f91680ea07bb9 --- /dev/null +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D70XML_cfi.py @@ -0,0 +1,130 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v5/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v4/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v13/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v13/hgcalCons.xml', + 'Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v6/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml', + 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v3/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v1/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D71XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D71XML_cfi.py new file mode 100644 index 0000000000000..d96ecd3aa728c --- /dev/null +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D71XML_cfi.py @@ -0,0 +1,130 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v5/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v5/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v14/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml', + 'Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v6/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v4/mfshield.xml', + 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v3/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v1/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) From e56e5a61d0292a5cfe4e902e8f0cb9b09472fdbf Mon Sep 17 00:00:00 2001 From: Sven Dildick <sven.dildick@cern.ch> Date: Mon, 5 Oct 2020 12:24:26 -0500 Subject: [PATCH 255/778] Disable calls to simlinks when matchToSimLink_ not set --- Validation/MuonGEMDigis/src/GEMDigiMatcher.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Validation/MuonGEMDigis/src/GEMDigiMatcher.cc b/Validation/MuonGEMDigis/src/GEMDigiMatcher.cc index 27d6de5508663..cea8c8e2afb04 100644 --- a/Validation/MuonGEMDigis/src/GEMDigiMatcher.cc +++ b/Validation/MuonGEMDigis/src/GEMDigiMatcher.cc @@ -33,7 +33,9 @@ GEMDigiMatcher::GEMDigiMatcher(const edm::ParameterSet& pset, edm::ConsumesColle // make a new simhits matcher muonSimHitMatcher_.reset(new GEMSimHitMatcher(pset, std::move(iC))); - gemSimLinkToken_ = iC.consumes<edm::DetSetVector<GEMDigiSimLink>>(gemSimLink.getParameter<edm::InputTag>("inputTag")); + if (matchToSimLink_) + gemSimLinkToken_ = + iC.consumes<edm::DetSetVector<GEMDigiSimLink>>(gemSimLink.getParameter<edm::InputTag>("inputTag")); gemDigiToken_ = iC.consumes<GEMDigiCollection>(gemDigi.getParameter<edm::InputTag>("inputTag")); gemPadToken_ = iC.consumes<GEMPadDigiCollection>(gemPad.getParameter<edm::InputTag>("inputTag")); gemClusterToken_ = iC.consumes<GEMPadDigiClusterCollection>(gemCluster.getParameter<edm::InputTag>("inputTag")); @@ -45,7 +47,8 @@ GEMDigiMatcher::GEMDigiMatcher(const edm::ParameterSet& pset, edm::ConsumesColle void GEMDigiMatcher::init(const edm::Event& iEvent, const edm::EventSetup& iSetup) { muonSimHitMatcher_->init(iEvent, iSetup); - iEvent.getByToken(gemSimLinkToken_, gemDigisSLH_); + if (matchToSimLink_) + iEvent.getByToken(gemSimLinkToken_, gemDigisSLH_); iEvent.getByToken(gemDigiToken_, gemDigisH_); iEvent.getByToken(gemPadToken_, gemPadsH_); iEvent.getByToken(gemClusterToken_, gemClustersH_); @@ -73,7 +76,8 @@ void GEMDigiMatcher::match(const SimTrack& t, const SimVertex& v) { return; // now match the digis - matchDigisSLToSimTrack(gemDigisSL); + if (matchToSimLink_) + matchDigisSLToSimTrack(gemDigisSL); matchDigisToSimTrack(gemDigis); matchPadsToSimTrack(gemPads); matchClustersToSimTrack(gemClusters); From 8474eb7a568a6bb5abd5c9c0410dc6ee61e48cfa Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Mon, 5 Oct 2020 20:11:29 +0200 Subject: [PATCH 256/778] Use akCs4PFJets for candidate-based tag infos --- DQMOffline/RecoB/python/dqmAnalyzer_cff.py | 4 ++++ .../ImpactParameter/python/pfImpactParameterTagInfos_cfi.py | 4 ++++ RecoBTag/SoftLepton/python/softPFElectronTagInfos_cfi.py | 4 ++++ RecoBTag/SoftLepton/python/softPFMuonTagInfos_cfi.py | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/DQMOffline/RecoB/python/dqmAnalyzer_cff.py b/DQMOffline/RecoB/python/dqmAnalyzer_cff.py index 450ee7563c0a1..09d2b82039a91 100644 --- a/DQMOffline/RecoB/python/dqmAnalyzer_cff.py +++ b/DQMOffline/RecoB/python/dqmAnalyzer_cff.py @@ -43,6 +43,10 @@ resolveAmbiguities = cms.bool(True) ) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(newpatJetGenJetMatch, src = "akCs4PFJets") + # Module execution for MC from Validation.RecoB.bTagAnalysis_cfi import * bTagValidation.jetMCSrc = 'myak4JetFlavourInfos' diff --git a/RecoBTag/ImpactParameter/python/pfImpactParameterTagInfos_cfi.py b/RecoBTag/ImpactParameter/python/pfImpactParameterTagInfos_cfi.py index 4dcb10eec2367..2dc3113fd4190 100644 --- a/RecoBTag/ImpactParameter/python/pfImpactParameterTagInfos_cfi.py +++ b/RecoBTag/ImpactParameter/python/pfImpactParameterTagInfos_cfi.py @@ -19,3 +19,7 @@ candidates = cms.InputTag("particleFlow"), maxDeltaR = cms.double(0.4) ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(pfImpactParameterTagInfos, jets = "akCs4PFJets") diff --git a/RecoBTag/SoftLepton/python/softPFElectronTagInfos_cfi.py b/RecoBTag/SoftLepton/python/softPFElectronTagInfos_cfi.py index cba5928b1213b..a7dcc3913b5c4 100644 --- a/RecoBTag/SoftLepton/python/softPFElectronTagInfos_cfi.py +++ b/RecoBTag/SoftLepton/python/softPFElectronTagInfos_cfi.py @@ -7,3 +7,7 @@ DeltaRElectronJet=cms.double(0.4), MaxSip3Dsig=cms.double(200) ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(softPFElectronsTagInfos, jets = "akCs4PFJets") diff --git a/RecoBTag/SoftLepton/python/softPFMuonTagInfos_cfi.py b/RecoBTag/SoftLepton/python/softPFMuonTagInfos_cfi.py index d6b9000414116..46a0f6764a713 100644 --- a/RecoBTag/SoftLepton/python/softPFMuonTagInfos_cfi.py +++ b/RecoBTag/SoftLepton/python/softPFMuonTagInfos_cfi.py @@ -11,3 +11,7 @@ filterRatio2 = cms.double(0.7), filterPromptMuons = cms.bool(False) ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(softPFMuonsTagInfos, jets = "akCs4PFJets") From 9fb5b42ed164cd9ffc969b52c3d3b4b3157e3328 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Mon, 5 Oct 2020 20:54:48 +0200 Subject: [PATCH 257/778] IMPORTANT: fix all regressions in copy number handling in FilteredView. The copy number of nodes in history should be looked at, not only the copy number from current node. --- .../DDCMS/src/DDFilteredView.cc | 56 +++++++++++++++++-- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 1ff15905e851d..b5694802fc246 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -613,22 +613,43 @@ const ExpandedNodes& DDFilteredView::history() { return nodes_; } -//mySpecParSection->value<std::vector<T>>(parameterName); + const DDSpecPar* DDFilteredView::find(const std::string& key) const { DDSpecParRefs refs; registry_->filter(refs, key, ""); int level = it_.back().GetLevel(); + const std::vector<int>& allCopyNumbers = copyNos(); + + // Loop on all XML SpecPar sections for (auto const& i : refs) { + + // Loop on all paths of a given XML SpecPar section auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { auto topos = j.size(); auto frompos = j.rfind('/'); bool flag = false; + + //bool isPrint = false; + + // Loop on all the volumes names from the XML path, until any discrepancy is found. for (int nit = level; frompos - 1 <= topos and nit > 0; --nit) { std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); + //const int nodeCopyNumber = it_.back().GetNode(nit)->GetVolume()->GetNumber(); + //const int nodeCopyNumber = PlacedVolume(it_.back().GetNode(nit)).copyNumber(); // WORKSSSSS + const int nodeCopyNumber = allCopyNumbers.at(level - nit); + std::string_view refname{&j[frompos + 1], topos - frompos - 1}; topos = frompos; frompos = j.substr(0, topos).rfind('/'); + //if (noNamespace(name) == "TOBActiveRphi2" && noNamespace(refname) == "TOBActiveRphi2") { isPrint = true; } + + /* + if (isPrint) { + std::cout << "BEFORE NAMESPACE CUT, name = " << name << std::endl; + std::cout << "BEFORE NAMESPACE CUT, refname = " << refname << std::endl; + }*/ + auto rpos = refname.find(':'); if (rpos == refname.npos) { name = noNamespace(name); @@ -638,17 +659,40 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { } } // dont understand this + /* + if (isPrint) { + std::cout << "AFTER NAMESPACE CUT, name = " << name << std::endl; + std::cout << "AFTER NAMESPACE CUT, refname = " << refname << std::endl; + }*/ + // Compare copy number. auto cpos = refname.rfind('['); + // copy number is specified in XML path if (cpos != refname.npos) { - if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum()) { - refname.remove_suffix(refname.size() - cpos); + const bool areCopyNumbersEqual = std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == nodeCopyNumber; + /* + if (isPrint) { + std::cout << "std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) = " << std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) << std::endl; + std::cout << "copyNum() = " << copyNum() << std::endl; + std::cout << "nodeCopyNumber = " << nodeCopyNumber << std::endl; + }*/ + + if (!areCopyNumbersEqual) { + flag = false; + break; } else { - flag = false; - break; + refname.remove_suffix(refname.size() - cpos); } } + /* + if (isPrint) { + std::cout << "AFTER COPY NUMBER CUT, name = " << name << std::endl; + std::cout << "AFTER COPY NUMBER CUT, refname = " << refname << std::endl; + std::cout << "i->value<std::vector<double>>(key).at(0) = " << i->value<std::vector<double>>(key).at(0) << std::endl; + std::cout << "i->strValue(key) = " << i->strValue(key) << std::endl; + }*/ + // Now that copy numbers are compared, compare the rest: the volume names. const bool isRegex = dd4hep::dd::isRegex(refname); const bool areVolumeNamesEqual = (!isRegex ? @@ -662,9 +706,11 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { } } + //if (isPrint) { std::cout << "exited path" << std::endl; } return flag; }); if (k != end(i->paths)) { + //std::cout << "exited SpecPar" << std::endl; return i; } } From f862fa2774e96ea3277f622458c6f7eb114ea20a Mon Sep 17 00:00:00 2001 From: Vladimir <Vladimir.Ivantchenko@cern.ch> Date: Mon, 5 Oct 2020 21:12:25 +0200 Subject: [PATCH 258/778] tracker size --- SimG4Core/Application/python/g4SimHits_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimG4Core/Application/python/g4SimHits_cfi.py b/SimG4Core/Application/python/g4SimHits_cfi.py index e0273e1964809..9bdd229b54148 100644 --- a/SimG4Core/Application/python/g4SimHits_cfi.py +++ b/SimG4Core/Application/python/g4SimHits_cfi.py @@ -102,7 +102,7 @@ # VacRegions = cms.vstring('DefaultRegionForTheWorld','BeamPipeVacuum','BeamPipeOutside'), EnergyThTracker = cms.double(10000), ## in GeV RmaxTracker = cms.double(1233), ## in mm - ZmaxTracker = cms.double(2932), ## in mm + ZmaxTracker = cms.double(1948), ## in mm MaximumEpsilonStep = cms.untracked.double(0.01), DeltaOneStep = cms.double(0.001), ## in mm MaximumLoopCounts = cms.untracked.double(1000.0), From 32486da974f8c54cf362f5255fe07b8f4884b3ad Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Mon, 5 Oct 2020 22:50:53 +0200 Subject: [PATCH 259/778] Address the warnings reported in #31672 --- Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml | 2 +- .../ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml b/Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml index 3a30a838f64d9..90bc84f97673e 100644 --- a/Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml +++ b/Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml @@ -23,7 +23,7 @@ <Constant name="HFNoseDz1" value="50.0*mm"/> <Constant name="HFNoseDz2" value="23.0*mm"/> <Constant name="HFNoseDz3" value="70.0*mm"/> - <Constant name="HFNoseDz0" value="18.35*mm"/> + <Constant name="HFNoseDz0" value="18.55*mm"/> <Constant name="NumberAbs1" value="1"/> <Constant name="NumberAbs2" value="6"/> <Constant name="NumberAbs3" value="2"/> diff --git a/Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml b/Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml index 203148953a21b..000de1de0eb3b 100644 --- a/Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml +++ b/Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml @@ -24,8 +24,8 @@ <Vector name="Layers" type="numeric" nEntries="8"> 13, 12, 12, 12, 12, 12, 10, 10</Vector> <Vector name="LayerThick" type="numeric" nEntries="8"> - 91.35*mm, 41.35*mm, 41.35*mm, 41.35*mm, 41.35*mm, 41.35*mm, 88.35*mm, - 88.35*mm </Vector> + 91.55*mm, 41.55*mm, 41.55*mm, 41.55*mm, 41.55*mm, 41.55*mm, 88.55*mm, + 88.55*mm </Vector> <Vector name="LayerType" type="numeric" nEntries="93"> 0, 1, 2, 1, 9, 8, 4,10, 5,11, 7, 3, 8, 1, 2, 1, 9, 8, 4,10, 5,11, 7, 3, 8, From 70b938217371443d1641c6c5b71c8a580e482b21 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 6 Oct 2020 02:55:42 +0200 Subject: [PATCH 260/778] Remove extrusion --- Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml b/Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml index 90bc84f97673e..32550600a139c 100644 --- a/Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml +++ b/Geometry/ForwardCommonData/data/hfnose/v4/hfnose.xml @@ -53,8 +53,8 @@ <Polycone name="HFNoseVol" startPhi="0*deg" deltaPhi="360*deg"> <ZSection z="[HFNoseZ1]" rMin="[HFNoseRMin1]" rMax="[HFNoseRMax1]"/> <ZSection z="[HFNoseZ2]" rMin="[HFNoseRMin2]" rMax="[HFNoseRMax2]"/> - <ZSection z="[HFNoseZ2]" rMin="[HFNoseRMin2]" rMax="[cms:CMSR3]"/> - <ZSection z="[HFNoseZ4]" rMin="[HFNoseRMin4]" rMax="[cms:CMSR3]"/> + <ZSection z="[HFNoseZ2]" rMin="[cms:ForwdBeamR1]" rMax="[cms:CMSR3]"/> + <ZSection z="[HFNoseZ4]" rMin="[cms:ForwdBeamR1]" rMax="[cms:CMSR3]"/> </Polycone> <Polycone name="HFNose" startPhi="0*deg" deltaPhi="360*deg"> <ZSection z="[HFNoseZ1]" rMin="[HFNoseRMin1]" rMax="[HFNoseRMax1]"/> From f134c7fc1d6660633392d27961dafb154681bb12 Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama <kenichi.hatakeyama@cern.ch> Date: Mon, 5 Oct 2020 21:25:49 -0500 Subject: [PATCH 261/778] Update NHitCuts_byTrackAlgo for hgcalTrack to be consistent as that for GeneralTracksImporter. --- RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py b/RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py index afa0fb7f4f751..576ea498e3f12 100644 --- a/RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py +++ b/RecoParticleFlow/PFTracking/python/hgcalTrackCollection_cfi.py @@ -7,7 +7,7 @@ # From GeneralTracksImporter useIterativeTracking = cms.bool(True), DPtOverPtCuts_byTrackAlgo = cms.vdouble(10.0,10.0,10.0,10.0,10.0,5.0), - NHitCuts_byTrackAlgo = cms.vuint32(3,3,3,3,3,32700), # the last value is nonsense + NHitCuts_byTrackAlgo = cms.vuint32(3,3,3,3,3,3), # From HGCClusterizer hgcalGeometryNames = cms.PSet( HGC_ECAL = cms.string('HGCalEESensitive'), From 8cd167ab985785acff96be4effe086cc96e67fd1 Mon Sep 17 00:00:00 2001 From: Vladimir <Vladimir.Ivantchenko@cern.ch> Date: Tue, 6 Oct 2020 08:55:06 +0200 Subject: [PATCH 262/778] + extra chord finder parameters --- SimG4Core/Application/python/g4SimHits_cfi.py | 6 ++++-- SimG4Core/MagneticField/interface/CMSFieldManager.h | 2 ++ SimG4Core/MagneticField/src/CMSFieldManager.cc | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/SimG4Core/Application/python/g4SimHits_cfi.py b/SimG4Core/Application/python/g4SimHits_cfi.py index 9bdd229b54148..4a674660c9d34 100644 --- a/SimG4Core/Application/python/g4SimHits_cfi.py +++ b/SimG4Core/Application/python/g4SimHits_cfi.py @@ -105,9 +105,11 @@ ZmaxTracker = cms.double(1948), ## in mm MaximumEpsilonStep = cms.untracked.double(0.01), DeltaOneStep = cms.double(0.001), ## in mm + DeltaOneStepTracker = cms.double(1e-4),## in mm MaximumLoopCounts = cms.untracked.double(1000.0), - DeltaChord = cms.double(0.001), ## in mm - MinStep = cms.double(0.1), ## in mm + DeltaChord = cms.double(0.001), ## in mm + DeltaChordTracker = cms.double(0.001), ## in mm + MinStep = cms.double(0.1), ## in mm DeltaIntersectionAndOneStep = cms.untracked.double(-1.0), DeltaIntersection = cms.double(0.0001), ## in mm DeltaIntersectionTracker = cms.double(1e-6),## in mm diff --git a/SimG4Core/MagneticField/interface/CMSFieldManager.h b/SimG4Core/MagneticField/interface/CMSFieldManager.h index 92693225a9e70..32a47ebf9628c 100644 --- a/SimG4Core/MagneticField/interface/CMSFieldManager.h +++ b/SimG4Core/MagneticField/interface/CMSFieldManager.h @@ -62,7 +62,9 @@ class CMSFieldManager : public G4FieldManager { std::vector<const G4Region *> m_regions; double m_dChord; + double m_dChordTracker; double m_dOneStep; + double m_dOneStepTracker; double m_dIntersection; double m_dInterTracker; double m_Rmax2; diff --git a/SimG4Core/MagneticField/src/CMSFieldManager.cc b/SimG4Core/MagneticField/src/CMSFieldManager.cc index fec1f322ed765..0dca37bbff60d 100644 --- a/SimG4Core/MagneticField/src/CMSFieldManager.cc +++ b/SimG4Core/MagneticField/src/CMSFieldManager.cc @@ -17,7 +17,9 @@ CMSFieldManager::CMSFieldManager() m_chordFinderMonopole(nullptr), m_propagator(nullptr), m_dChord(0.001), + m_dChordTracker(0.001), m_dOneStep(0.001), + m_dOneStepTracker(0.0001), m_dIntersection(0.0001), m_dInterTracker(1e-6), m_Rmax2(1.e+6), @@ -57,7 +59,9 @@ void CMSFieldManager::InitialiseForVolume(const edm::ParameterSet &p, // double m_dChord = p.getParameter<double>("DeltaChord") * CLHEP::mm; + m_dChordTracker = p.getParameter<double>("DeltaChord") * CLHEP::mm; m_dOneStep = p.getParameter<double>("DeltaOneStep") * CLHEP::mm; + m_dOneStepTracker = p.getParameter<double>("DeltaOneStepTracker") * CLHEP::mm; m_dIntersection = p.getParameter<double>("DeltaIntersection") * CLHEP::mm; m_dInterTracker = p.getParameter<double>("DeltaIntersectionTracker") * CLHEP::mm; m_stepMax = p.getParameter<double>("MaxStep") * CLHEP::cm; @@ -199,9 +203,9 @@ void CMSFieldManager::setDefaultChordFinder() { void CMSFieldManager::setChordFinderForTracker() { m_currChordFinder = m_chordFinder; - m_currChordFinder->SetDeltaChord(m_dChord); + m_currChordFinder->SetDeltaChord(m_dChordTracker); SetChordFinder(m_currChordFinder); - SetDeltaOneStep(m_dOneStep); + SetDeltaOneStep(m_dOneStepTracker); SetDeltaIntersection(m_dInterTracker); m_propagator->SetLargestAcceptableStep(m_stepMax); m_cfVacuum = false; From 69f354664d5a8d506749118bbb628168af50af41 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Tue, 6 Oct 2020 10:19:07 +0200 Subject: [PATCH 263/778] Added comments in matching-path function in DDFilteredView --- .../DDCMS/src/DDFilteredView.cc | 145 +++++++++--------- 1 file changed, 71 insertions(+), 74 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index b5694802fc246..62cea8d2813e3 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -614,104 +614,101 @@ const ExpandedNodes& DDFilteredView::history() { return nodes_; } +/* + * Among all SepcPar XML sections defining the key, + * find the first SpecPar section containing a path matching the current node path. + */ const DDSpecPar* DDFilteredView::find(const std::string& key) const { - DDSpecParRefs refs; - registry_->filter(refs, key, ""); - int level = it_.back().GetLevel(); + + // Filter the XML SpecPar sections: only those containing key are kept. + DDSpecParRefs allSpecParXMLSections; + registry_->filter(allSpecParXMLSections, key, ""); + + // Hierarchy levels info on current node + const int leafLevel = it_.back().GetLevel(); const std::vector<int>& allCopyNumbers = copyNos(); // Loop on all XML SpecPar sections - for (auto const& i : refs) { + for (auto const& mySpecParXMLSection : allSpecParXMLSections) { // Loop on all paths of a given XML SpecPar section - auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { - auto topos = j.size(); - auto frompos = j.rfind('/'); - bool flag = false; + auto foundMatchingXMLPath = find_if(begin(mySpecParXMLSection->paths), end(mySpecParXMLSection->paths), [&](auto const& myXMLPath) { - //bool isPrint = false; + // Initial conditions + auto myXMLVolumeNameStart = myXMLPath.rfind('/'); + auto myXMLVolumeNameEnd = myXMLPath.size(); + bool arePathsMatching = false; // Loop on all the volumes names from the XML path, until any discrepancy is found. - for (int nit = level; frompos - 1 <= topos and nit > 0; --nit) { - std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); - //const int nodeCopyNumber = it_.back().GetNode(nit)->GetVolume()->GetNumber(); - //const int nodeCopyNumber = PlacedVolume(it_.back().GetNode(nit)).copyNumber(); // WORKSSSSS - const int nodeCopyNumber = allCopyNumbers.at(level - nit); - - std::string_view refname{&j[frompos + 1], topos - frompos - 1}; - topos = frompos; - frompos = j.substr(0, topos).rfind('/'); - - //if (noNamespace(name) == "TOBActiveRphi2" && noNamespace(refname) == "TOBActiveRphi2") { isPrint = true; } - - /* - if (isPrint) { - std::cout << "BEFORE NAMESPACE CUT, name = " << name << std::endl; - std::cout << "BEFORE NAMESPACE CUT, refname = " << refname << std::endl; - }*/ - - auto rpos = refname.find(':'); - if (rpos == refname.npos) { - name = noNamespace(name); - } else { - if (name.find(':') == name.npos) { - refname.remove_prefix(rpos + 1); + for (int myNodeLevel = leafLevel; myXMLVolumeNameStart - 1 <= myXMLVolumeNameEnd and myNodeLevel >= 1; --myNodeLevel) { + // Get node name + std::string_view myNodeName = it_.back().GetNode(myNodeLevel)->GetVolume()->GetName(); + const int myNodeCopyNumber = allCopyNumbers.at(leafLevel - myNodeLevel); + + // Get XML volume name + std::string_view myXMLVolumeName{&myXMLPath[myXMLVolumeNameStart + 1], myXMLVolumeNameEnd - myXMLVolumeNameStart - 1}; + + // Re-initilialize + myXMLVolumeNameEnd = myXMLVolumeNameStart; + myXMLVolumeNameStart = myXMLPath.substr(0, myXMLVolumeNameEnd).rfind('/'); + + // NAMESPACES + // Only keep namespace, when both XML volume name AND node name have any. + const auto foundXMLNamespace = myXMLVolumeName.find(':'); + // XML name has no namespace: + if (foundXMLNamespace == std::string_view::npos) { + // remove namespace from node name + myNodeName = noNamespace(myNodeName); + } + // XML name has a namespace: + else { + // Node name has no namesdpace: + if (myNodeName.find(':') == std::string_view::npos) { + // remove namespace from XML name: + myXMLVolumeName.remove_prefix(foundXMLNamespace + 1); } - } // dont understand this - - /* - if (isPrint) { - std::cout << "AFTER NAMESPACE CUT, name = " << name << std::endl; - std::cout << "AFTER NAMESPACE CUT, refname = " << refname << std::endl; - }*/ - - // Compare copy number. - auto cpos = refname.rfind('['); - // copy number is specified in XML path - if (cpos != refname.npos) { - const bool areCopyNumbersEqual = std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == nodeCopyNumber; - /* - if (isPrint) { - std::cout << "std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) = " << std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) << std::endl; - std::cout << "copyNum() = " << copyNum() << std::endl; - std::cout << "nodeCopyNumber = " << nodeCopyNumber << std::endl; - }*/ + } + // COPY NUMBERS + // Compare copy numbers. + const auto foundXMLCopyNumber = myXMLVolumeName.rfind('['); + // Enter only if ever copy number is specified in XML path. + if (foundXMLCopyNumber != std::string_view::npos) { + // Check whether copy numbers are equal + const bool areCopyNumbersEqual = std::stoi(std::string(myXMLVolumeName.substr(foundXMLCopyNumber + 1, myXMLVolumeName.rfind(']')))) == myNodeCopyNumber; + // If copy numbers are not matching, exit if (!areCopyNumbersEqual) { - flag = false; + arePathsMatching = false; break; - } else { - refname.remove_suffix(refname.size() - cpos); + } + // Otherwise, remove copy number from volume name + else { + myXMLVolumeName.remove_suffix(myXMLVolumeName.size() - foundXMLCopyNumber); } } - /* - if (isPrint) { - std::cout << "AFTER COPY NUMBER CUT, name = " << name << std::endl; - std::cout << "AFTER COPY NUMBER CUT, refname = " << refname << std::endl; - std::cout << "i->value<std::vector<double>>(key).at(0) = " << i->value<std::vector<double>>(key).at(0) << std::endl; - std::cout << "i->strValue(key) = " << i->strValue(key) << std::endl; - }*/ - + // VOLUME NAME // Now that copy numbers are compared, compare the rest: the volume names. - const bool isRegex = dd4hep::dd::isRegex(refname); + const bool isRegex = dd4hep::dd::isRegex(myXMLVolumeName); const bool areVolumeNamesEqual = (!isRegex ? - dd4hep::dd::compareEqual(name, refname) - : regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))); + dd4hep::dd::compareEqual(myNodeName, myXMLVolumeName) + : regex_match(std::string(myNodeName.data(), myNodeName.size()), regex(std::string(myXMLVolumeName)))); + // If names are not matching, exit. if (!areVolumeNamesEqual) { - flag = false; + arePathsMatching = false; break; - } else { - flag = true; + } + // Otherwise, stay in loop to look at the other volumes of the same XML path + else { + arePathsMatching = true; } } - //if (isPrint) { std::cout << "exited path" << std::endl; } - return flag; + return arePathsMatching; }); - if (k != end(i->paths)) { - //std::cout << "exited SpecPar" << std::endl; - return i; + // If a path within one SpecPar section is found matching, return the SpecPar section. + if (foundMatchingXMLPath != end(mySpecParXMLSection->paths)) { + return mySpecParXMLSection; } } From 0df7638a9af66eb369210e1313d47a21c40fd219 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Tue, 6 Oct 2020 10:27:26 +0200 Subject: [PATCH 264/778] scram b code-format --- .../DDCMS/src/DDFilteredView.cc | 152 +++++++++--------- .../interface/GeometricDet.h | 8 +- .../plugins/DDDCmsTrackerContruction.h | 2 +- 3 files changed, 82 insertions(+), 80 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 62cea8d2813e3..8392a73cc0b4a 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -477,7 +477,7 @@ std::string_view DDFilteredView::get<string_view>(const string& key) { currentSpecPar_ = find(key); if (currentSpecPar_ != nullptr) { - result = currentSpecPar_->strValue(key); /// Dont use that ir doesnt work + result = currentSpecPar_->strValue(key); /// Dont use that ir doesnt work } return result; } @@ -619,7 +619,6 @@ const ExpandedNodes& DDFilteredView::history() { * find the first SpecPar section containing a path matching the current node path. */ const DDSpecPar* DDFilteredView::find(const std::string& key) const { - // Filter the XML SpecPar sections: only those containing key are kept. DDSpecParRefs allSpecParXMLSections; registry_->filter(allSpecParXMLSections, key, ""); @@ -630,82 +629,85 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { // Loop on all XML SpecPar sections for (auto const& mySpecParXMLSection : allSpecParXMLSections) { - // Loop on all paths of a given XML SpecPar section - auto foundMatchingXMLPath = find_if(begin(mySpecParXMLSection->paths), end(mySpecParXMLSection->paths), [&](auto const& myXMLPath) { - - // Initial conditions - auto myXMLVolumeNameStart = myXMLPath.rfind('/'); - auto myXMLVolumeNameEnd = myXMLPath.size(); - bool arePathsMatching = false; - - // Loop on all the volumes names from the XML path, until any discrepancy is found. - for (int myNodeLevel = leafLevel; myXMLVolumeNameStart - 1 <= myXMLVolumeNameEnd and myNodeLevel >= 1; --myNodeLevel) { - // Get node name - std::string_view myNodeName = it_.back().GetNode(myNodeLevel)->GetVolume()->GetName(); - const int myNodeCopyNumber = allCopyNumbers.at(leafLevel - myNodeLevel); - - // Get XML volume name - std::string_view myXMLVolumeName{&myXMLPath[myXMLVolumeNameStart + 1], myXMLVolumeNameEnd - myXMLVolumeNameStart - 1}; - - // Re-initilialize - myXMLVolumeNameEnd = myXMLVolumeNameStart; - myXMLVolumeNameStart = myXMLPath.substr(0, myXMLVolumeNameEnd).rfind('/'); - - // NAMESPACES - // Only keep namespace, when both XML volume name AND node name have any. - const auto foundXMLNamespace = myXMLVolumeName.find(':'); - // XML name has no namespace: - if (foundXMLNamespace == std::string_view::npos) { - // remove namespace from node name - myNodeName = noNamespace(myNodeName); - } - // XML name has a namespace: - else { - // Node name has no namesdpace: - if (myNodeName.find(':') == std::string_view::npos) { - // remove namespace from XML name: - myXMLVolumeName.remove_prefix(foundXMLNamespace + 1); + auto foundMatchingXMLPath = + find_if(begin(mySpecParXMLSection->paths), end(mySpecParXMLSection->paths), [&](auto const& myXMLPath) { + // Initial conditions + auto myXMLVolumeNameStart = myXMLPath.rfind('/'); + auto myXMLVolumeNameEnd = myXMLPath.size(); + bool arePathsMatching = false; + + // Loop on all the volumes names from the XML path, until any discrepancy is found. + for (int myNodeLevel = leafLevel; myXMLVolumeNameStart - 1 <= myXMLVolumeNameEnd and myNodeLevel >= 1; + --myNodeLevel) { + // Get node name + std::string_view myNodeName = it_.back().GetNode(myNodeLevel)->GetVolume()->GetName(); + const int myNodeCopyNumber = allCopyNumbers.at(leafLevel - myNodeLevel); + + // Get XML volume name + std::string_view myXMLVolumeName{&myXMLPath[myXMLVolumeNameStart + 1], + myXMLVolumeNameEnd - myXMLVolumeNameStart - 1}; + + // Re-initilialize + myXMLVolumeNameEnd = myXMLVolumeNameStart; + myXMLVolumeNameStart = myXMLPath.substr(0, myXMLVolumeNameEnd).rfind('/'); + + // NAMESPACES + // Only keep namespace, when both XML volume name AND node name have any. + const auto foundXMLNamespace = myXMLVolumeName.find(':'); + // XML name has no namespace: + if (foundXMLNamespace == std::string_view::npos) { + // remove namespace from node name + myNodeName = noNamespace(myNodeName); + } + // XML name has a namespace: + else { + // Node name has no namesdpace: + if (myNodeName.find(':') == std::string_view::npos) { + // remove namespace from XML name: + myXMLVolumeName.remove_prefix(foundXMLNamespace + 1); + } + } + + // COPY NUMBERS + // Compare copy numbers. + const auto foundXMLCopyNumber = myXMLVolumeName.rfind('['); + // Enter only if ever copy number is specified in XML path. + if (foundXMLCopyNumber != std::string_view::npos) { + // Check whether copy numbers are equal + const bool areCopyNumbersEqual = + std::stoi(std::string(myXMLVolumeName.substr(foundXMLCopyNumber + 1, myXMLVolumeName.rfind(']')))) == + myNodeCopyNumber; + // If copy numbers are not matching, exit + if (!areCopyNumbersEqual) { + arePathsMatching = false; + break; + } + // Otherwise, remove copy number from volume name + else { + myXMLVolumeName.remove_suffix(myXMLVolumeName.size() - foundXMLCopyNumber); + } + } + + // VOLUME NAME + // Now that copy numbers are compared, compare the rest: the volume names. + const bool isRegex = dd4hep::dd::isRegex(myXMLVolumeName); + const bool areVolumeNamesEqual = (!isRegex ? dd4hep::dd::compareEqual(myNodeName, myXMLVolumeName) + : regex_match(std::string(myNodeName.data(), myNodeName.size()), + regex(std::string(myXMLVolumeName)))); + // If names are not matching, exit. + if (!areVolumeNamesEqual) { + arePathsMatching = false; + break; + } + // Otherwise, stay in loop to look at the other volumes of the same XML path + else { + arePathsMatching = true; + } } - } - // COPY NUMBERS - // Compare copy numbers. - const auto foundXMLCopyNumber = myXMLVolumeName.rfind('['); - // Enter only if ever copy number is specified in XML path. - if (foundXMLCopyNumber != std::string_view::npos) { - // Check whether copy numbers are equal - const bool areCopyNumbersEqual = std::stoi(std::string(myXMLVolumeName.substr(foundXMLCopyNumber + 1, myXMLVolumeName.rfind(']')))) == myNodeCopyNumber; - // If copy numbers are not matching, exit - if (!areCopyNumbersEqual) { - arePathsMatching = false; - break; - } - // Otherwise, remove copy number from volume name - else { - myXMLVolumeName.remove_suffix(myXMLVolumeName.size() - foundXMLCopyNumber); - } - } - - // VOLUME NAME - // Now that copy numbers are compared, compare the rest: the volume names. - const bool isRegex = dd4hep::dd::isRegex(myXMLVolumeName); - const bool areVolumeNamesEqual = (!isRegex ? - dd4hep::dd::compareEqual(myNodeName, myXMLVolumeName) - : regex_match(std::string(myNodeName.data(), myNodeName.size()), regex(std::string(myXMLVolumeName)))); - // If names are not matching, exit. - if (!areVolumeNamesEqual) { - arePathsMatching = false; - break; - } - // Otherwise, stay in loop to look at the other volumes of the same XML path - else { - arePathsMatching = true; - } - } - - return arePathsMatching; - }); + return arePathsMatching; + }); // If a path within one SpecPar section is found matching, return the SpecPar section. if (foundMatchingXMLPath != end(mySpecParXMLSection->paths)) { return mySpecParXMLSection; diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index b60f60a33f651..15328325eaad9 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -97,8 +97,8 @@ class GeometricDet { void setGeographicalID(DetId id) { geographicalID_ = id; } // VOLUME POSITION in CMS frame of reference - const Translation& translation() const { return trans_; } // in mm - double rho() const { return rho_; } // in mm + const Translation& translation() const { return trans_; } // in mm + double rho() const { return rho_; } // in mm double phi() const { return phi_; } const RotationMatrix& rotation() const { return rot_; } @@ -109,7 +109,7 @@ class GeometricDet { // SOLID SHAPE // old DD - LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } // in mm + LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } // in mm // DD4hep const cms::DDSolidShape& shape_dd4hep() const { return shape_; } // solid shape parameters @@ -120,7 +120,7 @@ class GeometricDet { << "Called on a shape which is neither a box, a trap, nor a tub. This is not supported!"; } return params_; - } // in mm + } // in mm // RADIATION LENGTH AND ENERGY LOSS double radLength() const { return radLength_; } diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h index 8013a57dd41b3..a19138ef6f21c 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h @@ -23,6 +23,6 @@ namespace DDDCmsTrackerContruction { std::unique_ptr<GeometricDet> construct(DDCompactView const& cpv, std::vector<int> const& detidShifts); std::unique_ptr<GeometricDet> construct(cms::DDCompactView const& cpv, std::vector<int> const& detidShifts); void printAllTrackerGeometricDetsBeforeDetIDBuilding(const GeometricDet* tracker); -}; +}; // namespace DDDCmsTrackerContruction #endif From e2985c08537863d58f2be9c830f0d7150c2b7159 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Tue, 6 Oct 2020 10:40:46 +0200 Subject: [PATCH 265/778] minor comments --- .../DDCMS/src/DDFilteredView.cc | 2 +- .../interface/GeometricDet.h | 8 +++--- .../plugins/DDDCmsTrackerContruction.cc | 27 +++++++------------ .../src/GeometricDet.cc | 9 +++---- 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 8392a73cc0b4a..918173a3de589 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -477,7 +477,7 @@ std::string_view DDFilteredView::get<string_view>(const string& key) { currentSpecPar_ = find(key); if (currentSpecPar_ != nullptr) { - result = currentSpecPar_->strValue(key); /// Dont use that ir doesnt work + result = currentSpecPar_->strValue(key); } return result; } diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index 15328325eaad9..14384bcb316b3 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -109,7 +109,7 @@ class GeometricDet { // SOLID SHAPE // old DD - LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } // in mm + LegacySolidShape shape() const { return cms::dd::value(cms::LegacySolidShapeMap, shape_); } // DD4hep const cms::DDSolidShape& shape_dd4hep() const { return shape_; } // solid shape parameters @@ -170,13 +170,13 @@ class GeometricDet { nav_type ddd_; DetId geographicalID_; - Translation trans_; - double rho_; + Translation trans_; // in mm + double rho_; // in mm double phi_; RotationMatrix rot_; cms::DDSolidShape shape_; - std::vector<double> params_; + std::vector<double> params_; // in mm double radLength_; double xi_; diff --git a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc index efa46fb93da18..e2ea18288813c 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.cc @@ -13,7 +13,7 @@ #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerBuilder.h" #include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerDetIdBuilder.h" -#define DEBUG true +#define DEBUG false std::unique_ptr<GeometricDet> DDDCmsTrackerContruction::construct(const DDCompactView& cpv, std::vector<int> const& detidShifts) { @@ -39,14 +39,14 @@ std::unique_ptr<GeometricDet> DDDCmsTrackerContruction::construct(const DDCompac CmsTrackerBuilder<DDFilteredView> theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); - edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; - CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); - theCmsTrackerDetIdBuilder.buildId(*tracker); - if (DEBUG) { printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); } + edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; + CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); + theCmsTrackerDetIdBuilder.buildId(*tracker); + fv.parent(); // // set the Tracker @@ -82,14 +82,14 @@ std::unique_ptr<GeometricDet> DDDCmsTrackerContruction::construct(const cms::DDC CmsTrackerBuilder<cms::DDFilteredView> theCmsTrackerBuilder; theCmsTrackerBuilder.build(fv, tracker.get(), attribute); - edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; - CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); - theCmsTrackerDetIdBuilder.buildId(*tracker); - if (DEBUG) { printAllTrackerGeometricDetsBeforeDetIDBuilding(tracker.get()); } + edm::LogVerbatim("DDDCmsTrackerContruction") << "Assign DetIds"; + CmsTrackerDetIdBuilder theCmsTrackerDetIdBuilder(detidShifts); + theCmsTrackerDetIdBuilder.buildId(*tracker); + return tracker; } @@ -120,15 +120,6 @@ void DDDCmsTrackerContruction::printAllTrackerGeometricDetsBeforeDetIDBuilding(c outputFile << "............................." << std::endl; outputFile << "myDet->geographicalID() = " << myDet->geographicalId() << std::endl; outputFile << "myDet->name() = " << myDet->name() << std::endl; - - /* - outputFile << "myDet->navpos() = " << myDet->navpos() << std::endl; - outputFile << "myDet->navType() = "; - for (const auto& pos : myDet->navType()) { - outputFile << pos << " "; - } - outputFile << " " << std::endl;*/ - outputFile << "myDet->module->type() = " << std::fixed << std::setprecision(7) << myDet->type() << std::endl; outputFile << "myDet->module->translation() = " << std::fixed << std::setprecision(7) << myDet->translation() << std::endl; diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc index 122e9beea7fca..5146d235eae72 100644 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc +++ b/Geometry/TrackerNumberingBuilder/src/GeometricDet.cc @@ -69,7 +69,7 @@ GeometricDet::~GeometricDet() { deleteComponents(); } GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) : ddname_(fv->name()), type_(type), - ddd_(), + ddd_(), // To remove after DetExtra is removed (not used) trans_(fv->translation()), rho_(trans_.Rho()), phi_(trans_.Phi()), @@ -98,16 +98,15 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type) GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type) : ddname_(dd4hep::dd::noNamespace(fv->name())), type_(type), - ddd_(fv->navPos()), // To be studied + ddd_(fv->navPos()), // To remove after DetExtra is removed (not used) trans_(geant_units::operators::convertCmToMm(fv->translation())), rho_(trans_.Rho()), phi_(trans_.Phi()), rot_(fv->rotation()), shape_(fv->shape()), params_(computeLegacyShapeParameters(shape_, fv->solid())), - radLength_(fv->get<double>( - "TrackerRadLength")), // NOT OK: XMLs SpecPar handling by DD4hep FilteredView needs modification - xi_(fv->get<double>("TrackerXi")), // NOT OK: XMLs SpecPar handling by DD4hep FilteredView needs modification + radLength_(fv->get<double>("TrackerRadLength")), + xi_(fv->get<double>("TrackerXi")), pixROCRows_(fv->get<double>("PixelROCRows")), pixROCCols_(fv->get<double>("PixelROCCols")), pixROCx_(fv->get<double>("PixelROC_X")), From 11f74c8935a64480407cd5dff68f910bdd9f86f4 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Tue, 6 Oct 2020 11:58:25 +0200 Subject: [PATCH 266/778] extra test, getter without regexp and a copy number bugfix --- .../DDCMS/interface/DDFilteredView.h | 30 +++++++++++++++++++ .../DDCMS/plugins/test/DDTestSpecPars.cc | 7 +++-- .../DDCMS/src/DDFilteredView.cc | 6 ++-- DetectorDescription/DDCMS/test/BuildFile.xml | 5 ++++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index d119a08dcab7d..a39817c526410 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -192,6 +192,36 @@ namespace cms { template <typename T> T get(const std::string&); + //! extract attribute value for current Node + // keep the maespace for comparison + // assume there are no regular expressions + template <typename T> + std::vector<T> getValuesNS(const std::string& key) { + DDSpecParRefs refs; + registry_->filter(refs, key); + + std::string path = this->path(); + for (const auto& specPar : refs) { + for (const auto& part : specPar->paths) { + bool flag(true); + std::size_t from = 0; + for (auto name : dd4hep::dd::split(part, "/")) { + auto const& to = path.find(name, from); + if (to == std::string::npos) { + flag = false; + break; + } else { + from = to; + } + } + if (flag) { + return specPar->value<std::vector<T>>(key); + } + } + } + return std::vector<T>(); + } + //! extract another value from the same SpecPar // call get<double> first to find a relevant one double getNextValue(const std::string&) const; diff --git a/DetectorDescription/DDCMS/plugins/test/DDTestSpecPars.cc b/DetectorDescription/DDCMS/plugins/test/DDTestSpecPars.cc index ffc80caf84ef4..30610a900f5ef 100644 --- a/DetectorDescription/DDCMS/plugins/test/DDTestSpecPars.cc +++ b/DetectorDescription/DDCMS/plugins/test/DDTestSpecPars.cc @@ -32,15 +32,18 @@ void DDTestSpecPars::analyze(const Event&, const EventSetup& iEventSetup) { LogVerbatim("Geometry").log([®istry](auto& log) { log << "DD SpecPar Registry size: " << registry->specpars.size(); for (const auto& i : registry->specpars) { - log << " " << i.first << " => "; + log << " " << i.first << " == " << std::string({i.second.name.data(), i.second.name.size()}) << " =>"; + log << "\npaths:\n"; for (const auto& k : i.second.paths) log << k << ", "; + log << "\nstring parameters:\n"; for (const auto& l : i.second.spars) { - log << l.first << " => "; + log << l.first << " == " << i.second.strValue(l.first) << " = "; for (const auto& il : l.second) { log << il << ", "; } } + log << "\nnumeric parameters\n"; for (const auto& m : i.second.numpars) { log << m.first << " => "; for (const auto& im : m.second) { diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 38c655e459ae5..bb1aec63bacc4 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -643,6 +643,7 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { filter(refs, key); int level = it_.back().GetLevel(); + for (auto const& i : refs) { auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { auto topos = j.size(); @@ -650,6 +651,7 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { bool flag = false; for (int nit = level; frompos - 1 <= topos and nit > 0; --nit) { std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); + const int copyNum = it_.back().GetNode(nit)->GetNumber(); std::string_view refname{&j[frompos + 1], topos - frompos - 1}; topos = frompos; frompos = j.substr(0, topos).rfind('/'); @@ -664,10 +666,9 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { } auto cpos = refname.rfind('['); if (cpos != refname.npos) { - if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum()) { + if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum) { refname.remove_suffix(refname.size() - cpos); flag = true; - continue; } else { flag = false; break; @@ -679,7 +680,6 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { break; } else { flag = true; - continue; } } else { if (!regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))) { diff --git a/DetectorDescription/DDCMS/test/BuildFile.xml b/DetectorDescription/DDCMS/test/BuildFile.xml index e11219692203e..9a3691bc306b6 100644 --- a/DetectorDescription/DDCMS/test/BuildFile.xml +++ b/DetectorDescription/DDCMS/test/BuildFile.xml @@ -9,6 +9,11 @@ <use name="dd4hep"/> </bin> +<bin name="testDD4hepFilteredViewGet" file="DDFilteredView.get.cppunit.cc,testRunner.cpp"> + <use name="DetectorDescription/DDCMS"/> + <use name="dd4hep"/> +</bin> + <bin name="testDD4hepFilteredViewGoTo" file="DDFilteredView.goto.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> From db6af405ceb7dfe27dabb58a15336989cc0835ca Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Tue, 6 Oct 2020 12:02:20 +0200 Subject: [PATCH 267/778] add unit test --- .../DDCMS/test/DDFilteredView.get.cppunit.cc | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 DetectorDescription/DDCMS/test/DDFilteredView.get.cppunit.cc diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.get.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.get.cppunit.cc new file mode 100644 index 0000000000000..76a0590792ad3 --- /dev/null +++ b/DetectorDescription/DDCMS/test/DDFilteredView.get.cppunit.cc @@ -0,0 +1,188 @@ +#include <cppunit/extensions/HelperMacros.h> + +#include "DetectorDescription/DDCMS/interface/DDFilteredView.h" +#include "DetectorDescription/DDCMS/interface/DDDetector.h" +#include "FWCore/ParameterSet/interface/FileInPath.h" +#include "DD4hep/Detector.h" + +#include <string> +#include <memory> +#include <vector> + +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" + +using namespace cms; + +class testDDFilteredViewGet : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(testDDFilteredViewGet); + CPPUNIT_TEST(checkFilteredView); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp() override; + void tearDown() override {} + void checkFilteredView(); + +private: + void printMe(const cms::DDFilteredView&); + double refRadLength_ = 0.03142; + double refXi_ = 6.24526e-05; + int refCopyNoTag_ = 1000; + int refCopyNoOffset_ = 100; + int refCopyNo_ = 1; + std::string fileName_; + std::vector<int> refPos_{0, 0, 6, 2, 2}; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(testDDFilteredViewGet); + +void testDDFilteredViewGet::setUp() { + fileName_ = edm::FileInPath("Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml").fullPath(); +} + +void testDDFilteredViewGet::checkFilteredView() { + std::unique_ptr<DDDetector> det = std::make_unique<DDDetector>("DUMMY", fileName_); + DDFilteredView fview(det.get(), det->description()->worldVolume()); + + int count = 1; + auto testPos = fview.navPos(); + while (fview.next(0)) { + std::cout << "#" << count << ": "; + printMe(fview); + + if (count == 45) { + testPos = fview.navPos(); + } + if (count == 50) { + break; + } + count++; + } + + // world_volume/OCMS_1/CMSE_1/Tracker_1/PixelBarrel_1/pixbarlayer0:PixelBarrelLayer0_1/PixelBarrelLadderFull0_6/PixelBarrelModuleBoxFull_1/PixelBarrelModuleFullPlus_4/PixelBarrelSensorFull_1/PixelBarrelActiveFull0_1 + // + std::vector<int> activeVol{0, 0, 6, 2, 93, 12, 1, 7, 1, 0}; + fview.goTo(activeVol); + printMe(fview); + fview.findSpecPar("TrackerRadLength", "TrackerXi"); + + double radLength = fview.getNextValue("TrackerRadLength"); + double xi = fview.getNextValue("TrackerXi"); + CPPUNIT_ASSERT(radLength == refRadLength_); + CPPUNIT_ASSERT(xi == refXi_); + + std::cout << "TrackerRadLength = " << radLength << "\nTrackerXi = " << xi << "\n"; + auto vals = fview.getValuesNS<std::string>("TrackerRadLength"); + for (auto i : vals) + std::cout << "TrackerRadLength = " << i << "\n"; + + std::cout << "\n==== Let's go to #45\n"; + fview.goTo(testPos); + printMe(fview); + + int i = 0; + for (auto it : fview.navPos()) { + CPPUNIT_ASSERT(it == testPos[i++]); + } + i = 0; + for (auto it : testPos) { + CPPUNIT_ASSERT(it == refPos_[i++]); + } + + // Start with Muon + std::cout << "\n==== Let's go to Muon\n"; + fview.goTo({0, 0, 8}); + printMe(fview); + + CPPUNIT_ASSERT(fview.name() == "MUON"); + + // Go to the first daughter + fview.next(0); + printMe(fview); + + // Use it as an escape level + int startLevel = fview.level(); + + count = 1; + + do { + std::cout << "#" << count++ << ": "; + std::cout << "started at level " << startLevel << "\n"; + printMe(fview); + + } while (fview.next(0) && fview.level() < startLevel); + + std::cout << "\n==== Continue iteration\n"; + + count = 1; + fview.next(0); + startLevel = fview.level(); + printMe(fview); + + do { + std::cout << "#" << count++; + std::cout << " started at level " << startLevel << ":\n"; + printMe(fview); + } while (fview.next(0) && fview.level() < startLevel); + + fview.next(0); + printMe(fview); + + std::cout << "\n==== Let's do it again, go to Muon\n"; + fview.goTo({0, 0, 8}); + printMe(fview); + CPPUNIT_ASSERT(fview.name() == "MUON"); + + // Go to the first daughter + fview.next(0); + printMe(fview); + + // Use it as an escape level + startLevel = fview.level(); + + count = 1; + + do { + std::cout << "#" << count++ << ": "; + std::cout << "started at level " << startLevel << "\n"; + printMe(fview); + + } while (fview.next(0) && fview.level() < startLevel); + + fview.goTo({0, 0, 8, 0}); + printMe(fview); + fview.findSpecPar("CopyNoTag", "CopyNoOffset"); + + auto tag = fview.getNextValue("CopyNoTag"); + auto offset = fview.getNextValue("CopyNoOffset"); + std::cout << "CopyNoTag = " << tag << "\n"; + std::cout << "CopyNoOffset = " << fview.getNextValue("CopyNoOffset") << "\n"; + CPPUNIT_ASSERT(refCopyNoTag_ == tag); + CPPUNIT_ASSERT(refCopyNoOffset_ == offset); + + const auto& nodes = fview.history(); + int ctr(0); + for (const auto& t : nodes.tags) { + std::cout << t << ": " << nodes.offsets[ctr] << ", " << nodes.copyNos[ctr] << "\n"; + CPPUNIT_ASSERT(refCopyNoTag_ == t); + CPPUNIT_ASSERT(refCopyNoOffset_ == nodes.offsets[ctr]); + CPPUNIT_ASSERT(refCopyNo_ == nodes.copyNos[ctr]); + ctr++; + } +} + +void testDDFilteredViewGet::printMe(const cms::DDFilteredView& fview) { + std::cout << ">>> " << fview.level() << " level: " << fview.name() << " is a " + << cms::dd::name(cms::DDSolidShapeMap, fview.shape()) << "\n"; + std::cout << "Full path to it is " << fview.path() << "\n"; + + auto copies = fview.copyNos(); + std::cout << " copy Nos: "; + std::for_each(copies.rbegin(), copies.rend(), [](const auto& it) { std::cout << it << ", "; }); + std::cout << "\n levels : "; + for (auto it : fview.navPos()) { + std::cout << it << ", "; + } + std::cout << "\n"; +} From e90200c33b8c98a8a7b96c9927366e5bb8756aa0 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Tue, 6 Oct 2020 12:13:56 +0200 Subject: [PATCH 268/778] remove spurious include --- .../DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 1a1eac6f355ee..5d7a1bb5a47b4 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -28,7 +28,6 @@ #include <vector> #include <unordered_map> #include <utility> -//#include <tbb/concurrent_vector.h> using namespace std; using namespace dd4hep; From 3c3ed52d49c06b89d7048b21ab33280fa6c49342 Mon Sep 17 00:00:00 2001 From: Sergio Lo Meo <sergio.lomeo@cern.ch> Date: Tue, 6 Oct 2020 13:08:47 +0200 Subject: [PATCH 269/778] SubtractionSolid Vs UnionSolid For MB --- .../Geometry/python/dict2021Geometry.py | 8 +- .../data/dd4hep/cmsExtendedGeometry2021.xml | 8 +- .../cmsExtendedGeometry2021ZeroMaterial.xml | 8 +- .../python/cmsExtendedGeometry2021XML_cfi.py | 8 +- ...ExtendedGeometry2021ZeroMaterialXML_cfi.py | 8 +- .../MuonCommonData/data/mb1/2021/v1/mb1.xml | 1907 +++++++++++++++ .../MuonCommonData/data/mb2/2021/v1/mb2.xml | 2067 +++++++++++++++++ .../MuonCommonData/data/mb3/2021/v1/mb3.xml | 1738 ++++++++++++++ .../data/mbCommon/2021/v2/mbCommon.xml | 409 ++++ 9 files changed, 6141 insertions(+), 20 deletions(-) create mode 100644 Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml create mode 100644 Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml create mode 100644 Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml create mode 100644 Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml diff --git a/Configuration/Geometry/python/dict2021Geometry.py b/Configuration/Geometry/python/dict2021Geometry.py index fe584b067e9b8..84e8899e81184 100644 --- a/Configuration/Geometry/python/dict2021Geometry.py +++ b/Configuration/Geometry/python/dict2021Geometry.py @@ -1000,10 +1000,10 @@ "default" : 1, "M1" : { 1 : [ - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', 'Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml', diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml index 6ce3f568fec6d..521f45c29cc66 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -235,10 +235,10 @@ <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/2021/hcalSimNumbering.xml'/> <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/2021/hcalRecNumbering.xml'/> - <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml'/> <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> <Include ref='Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml'/> diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml index 5e29d7908bd90..5f0ae14c20cc9 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml @@ -234,10 +234,10 @@ <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/2021/hcalSimNumbering.xml'/> <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/2021/hcalRecNumbering.xml'/> - <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> - <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml'/> <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> <Include ref='Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml'/> diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py index e82adefa0373e..0816898e77c9d 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py @@ -236,10 +236,10 @@ 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/hcalSimNumbering.xml', 'Geometry/HcalCommonData/data/hcalRecNumbering/2021/hcalRecNumbering.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', 'Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py index a4dbff6e95407..1cd57edac0174 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py @@ -235,10 +235,10 @@ 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', 'Geometry/HcalCommonData/data/hcalSimNumbering/2021/hcalSimNumbering.xml', 'Geometry/HcalCommonData/data/hcalRecNumbering/2021/hcalRecNumbering.xml', - 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', - 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', - 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', - 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', 'Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml', diff --git a/Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml b/Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml new file mode 100644 index 0000000000000..d025e02b4f17b --- /dev/null +++ b/Geometry/MuonCommonData/data/mb1/2021/v1/mb1.xml @@ -0,0 +1,1907 @@ +<?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="mb1.xml" eval="true"> + <!--- #### MB1: Positions --> + <!--%% Radial coordinates for algos--> + <Constant name="MB1UnitRadius" value="4329.460186*mm"/> + <Constant name="MB1PosAngle" value="5.184184778*deg"/> + <!--%% Cartesian coordinates for sector 1 --> + <Constant name="MB1Pos_x" value="[mbCommon:MBHC_offset]+4285.*mm"/> + <Constant name="MB1Pos_y" value="391.2*mm"/> + <!--- #### MB1: Constants for DT superlayer Phi --> + <Constant name="MB1SLPhiPl_x" value="2121./2*mm"/> + <Constant name="MB1SLPhiL48" value="[mbCommon:MBCell_width]*48+[mbCommon:MBIbeamWall]"/> + <Constant name="MB1SLPhiL49" value="[mbCommon:MBCell_width]*49+[mbCommon:MBIbeamWall]"/> + <Constant name="MB1SLPhiL50" value="[mbCommon:MBCell_width]*50+[mbCommon:MBIbeamWall]"/> + <!--- #### MB1: Constants for DT superlayer Z (although they are placed with a rotation that interchanges X and Z, the _x refers to the coordinate X in EDMS, that is the Z in its final position; similar for _z --> + <Constant name="MB1SLZWire_length" value="2038./2.*mm"/> + <!--%% Wire length from EDMS: THIS NUMBER DEFINE THE SL DIMENSIONS--> + <Constant name="MB1SLZBareWire_length" value="[MB1SLZWire_length]-15.5*mm"/> + <!--%% Bare Wire _length == wire_lenght - depth in tappini--> + <Constant name="MB1SLZLayer_length" value="[MB1SLZBareWire_length]+2*[mbCommon:MBLayerElectronics_width]"/> + <!--%% The z length of the Al layer volume--> + <Constant name="MB1SLZPlI_z" value="[MB1SLZLayer_length]+6.5*mm"/> + <!--%% Distance between tappini and Al Plate edge--> + <Constant name="MB1SLZPlO_z" value="[MB1SLZPlI_z]+38.*mm"/> + <!--- #### MB1: X dimensions --> + <Constant name="MB1_x" value="1090.*mm"/> + <Constant name="MB1HC_x" value="2033/2.*mm"/> + <!--- #### MB1: Constants for DT positioning: distance from SL center to HC center --> + <Constant name="MB1pSLPhi1_HC_dist" value="16.*mm"/> + <Constant name="MB1pSLPhi2_HC_dist" value="-5.*mm"/> + <Constant name="MB1pSLZ_HC_dist" value="-5*mm"/> + <Constant name="MB1nSLPhi1_HC_dist" value="-16.*mm"/> + <Constant name="MB1nSLPhi2_HC_dist" value="5.*mm"/> + <Constant name="MB1nSLZ_HC_dist" value="5*mm"/> + <!--- #### MB1: Constants for RPCs --> + <Constant name="MB1RPC_x" value="2080./2*mm"/> + <Constant name="MB1RPC_Gas_x" value="[mb1:MB1RPC_x]-10.*mm"/> + <Constant name="MB1RPC_I_x_pos" value="15.2*mm"/> + <Constant name="MB1RPC_O_x_pos" value="60.2*mm"/> + <!--- #### MB1Chim: Constants for DT RPCs --> + <Constant name="MB1ChimRPC_GasRight_y_pos" value="[mbCommon:MBRPC_GasRight_y_pos]-([mbCommon:MBRPC_z]-[mbCommon:MBChimRPC_z])/2.-4.*mm"/> + <Constant name="MB1ChimRPC_GasLeft_y_pos" value="[mbCommon:MBRPC_GasLeft_y_pos]-([mbCommon:MBRPC_z]-[mbCommon:MBChimRPC_z])/2.-4.*mm"/> + </ConstantsSection> + <SolidSection label="mb1.xml"> + <!-- #### MB1 Unit: fake volume representing one DTBX + 1 or 2 RPC --> + <!-- #### MB1: DTBX chamber --> + <!--%% In MB1 the widest superlayer in x is the Z one --> + <Box name="MB1_a" dx="[MB1_x]" dy="[mbCommon:MBSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBHeight_With2RPC]"/> + <Box name="MB1_OLAP1" dx="17.*mm" dy="[mbCommon:MBSLPhiPlO_z]+13.*mm" dz="15.*mm"/> + <Box name="MB1_OLAP2" dx="5.6*mm" dy="[mbCommon:MBSLPhiPlO_z]+13.*mm" dz="6.6*mm"/> + <Box name="MB1_OLAP3" dx="5.*mm" dy="[mbCommon:MBSLPhiPlO_z]+13.*mm" dz="10.*mm"/> + <Box name="MB1_OLAP4" dx="20.*mm" dy="[mbCommon:MBSLPhiPlO_z]+13.*mm" dz="40.*mm"/> + <SubtractionSolid name="MB1N_b"> + <rSolid name="MB1_a"/> + <rSolid name="MB1_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB1_x]-16.8*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+14.8*mm"/> + </SubtractionSolid> + <UnionSolid name="MB1N"> + <rSolid name="MB1N_b"/> + <rSolid name="MB1_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB1_x]-5.5*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+6.5*mm"/> + </UnionSolid> + <UnionSolid name="MB1Nw0_c"> + <rSolid name="MB1N_b"/> + <rSolid name="MB1_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB1_x]-5.5*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+6.5*mm"/> + </UnionSolid> + <SubtractionSolid name="MB1Nw0_d"> + <rSolid name="MB1Nw0_c"/> + <rSolid name="MB1_OLAP3"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB1_x]+4.9*mm" y="0.*fm" z="[mbCommon:MBHeight_With2RPC]-9.9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB1Nw0"> + <rSolid name="MB1Nw0_d"/> + <rSolid name="MB1_OLAP4"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB1_x]-19.9*mm" y="0.*fm" z="[mbCommon:MBHeight_With2RPC]-39.9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB1P_b"> + <rSolid name="MB1_a"/> + <rSolid name="MB1_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB1_x]+16.8*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+14.8*mm"/> + </SubtractionSolid> + <UnionSolid name="MB1P"> + <rSolid name="MB1P_b"/> + <rSolid name="MB1_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB1_x]+5.5*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+6.5*mm"/> + </UnionSolid> + <UnionSolid name="MB1Pw0_c"> + <rSolid name="MB1P_b"/> + <rSolid name="MB1_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB1_x]+5.5*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+6.5*mm"/> + </UnionSolid> + <SubtractionSolid name="MB1Pw0_d"> + <rSolid name="MB1Pw0_c"/> + <rSolid name="MB1_OLAP3"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB1_x]-4.9*mm" y="0.*fm" z="[mbCommon:MBHeight_With2RPC]-9.9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB1Pw0"> + <rSolid name="MB1Pw0_d"/> + <rSolid name="MB1_OLAP4"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB1_x]+19.0*mm" y="0.*fm" z="[mbCommon:MBHeight_With2RPC]-39.9*mm"/> + </SubtractionSolid> + <!-- #### MB1: Superlayers Phi --> + <!--%% SuperLayer X,Z dimensions cover the outer Al plate + 2 mm for the closing profiles. Y is 5 Al plates + 4 Layer's --> + <Box name="MB1SuperLayerPhi" dx="[mb1:MB1SLPhiPl_x]+2.7*mm" dy="[mbCommon:MBSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% MB1SLPhiClosingPlateParal is parallel to gas cells, MB1SLPhiClosingPlatePerp is perpendicular --> + <!--%% Parallel are 2 mm thick and as long as outer Plates --> + <Box name="MB1SLPhiClosingPlateParal" dx="1.*mm" dy="[mbCommon:MBSLPhiPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB1SLPhi_C_PlateParal" dx="7.*mm" dy="[mbCommon:MBSLPhiPlO_z]-14.*mm" dz="1.*mm"/> + <!--%% Perpendicular are 12 mm thick and higher by 20 mm per side than the SL; 2.7 mm are added to reach the parallel "Cs" --> + <Box name="MB1SLPhiClosingPlatePerp" dx="[mb1:MB1SLPhiPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB1SLPhi_C_PlatePerp" dx="[mb1:MB1SLPhiPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <!--%% MB1SLPhiAlPlateOuter is 0.7 mm wider (perpendicular to the wires) to reach the parallel "Cs"--> + <Box name="MB1SLPhiAlPlateOuter" dx="[mb1:MB1SLPhiPl_x]+0.7*mm" dy="[mbCommon:MBSLPhiPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!--%% MB1SLPhiAlPlateOuter does not reach the parallel "Cs"--> + <Box name="MB1SLPhiAlPlateInner" dx="[mb1:MB1SLPhiPl_x]" dy="[mbCommon:MBSLPhiPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!--%% Fake layer volume contains the ibeams plus gas volumes: n+1 Ibeam's and n gas volumes. + (Ibeam wall width is ~1.35mm, but 0.1 is mylar, that is very light, so it set to 1.3) + It is first made of aluminium and them it is filled with the n gas volumes. + Z length is the bare wire length plus the electronics (==tappini)--> + <Box name="MB1SLPhiLayer_48Cells" dx="[MB1SLPhiL48]" dy="[mbCommon:MBSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLPhiLayer_49Cells" dx="[MB1SLPhiL49]" dy="[mbCommon:MBSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLPhiLayer_50Cells" dx="[MB1SLPhiL50]" dy="[mbCommon:MBSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <!--%% Tappini, Perpendicular to the Ibeams and at the two ends --> + <Box name="MB1SLPhiElectronics_48Cells" dx="[mb1:MB1SLPhiL48]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLPhiElectronics_49Cells" dx="[mb1:MB1SLPhiL49]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLPhiElectronics_50Cells" dx="[mb1:MB1SLPhiL50]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLPhiCommonElectronics" dx="[mb1:MB1SLPhiPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!-- #### MB1: Superlayer Z --> + <Box name="MB1SuperLayerZ" dx="[mbCommon:MBSLZPl_x]+2.7*mm" dy="[mb1:MB1SLZPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB1SLZClosingPlateParal" dx="1.*mm" dy="[mb1:MB1SLZPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB1SLZ_C_PlateParal" dx="7.*mm" dy="[mb1:MB1SLZPlO_z]-14.*mm" dz="1.*mm"/> + <Box name="MB1SLZClosingPlatePerp" dx="[mbCommon:MBSLZPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB1SLZ_C_PlatePerp" dx="[mbCommon:MBSLZPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <Box name="MB1SLZAlPlateOuter" dx="[mbCommon:MBSLZPl_x]+0.7*mm" dy="[mb1:MB1SLZPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB1SLZAlPlateInner" dx="[mbCommon:MBSLZPl_x]" dy="[mb1:MB1SLZPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB1SLZLayer_56Cells" dx="[mbCommon:MBSLZL56]" dy="[mb1:MB1SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLZLayer_57Cells" dx="[mbCommon:MBSLZL57]" dy="[mb1:MB1SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLZLayer_58Cells" dx="[mbCommon:MBSLZL58]" dy="[mb1:MB1SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLZElectronics_56Cells" dx="[mbCommon:MBSLZL56]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLZElectronics_57Cells" dx="[mbCommon:MBSLZL57]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLZElectronics_58Cells" dx="[mbCommon:MBSLZL58]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLZCommonElectronics" dx="[mbCommon:MBSLZPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!--%% Effective gas volume --> + <Box name="MB1SLZGas_aa" dx="20.35*mm-2*3.175*mm" dy="[MB1SLZBareWire_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1SLZGas_bb" dx="20.35*mm" dy="[MB1SLZBareWire_length]" dz="[mbCommon:MBGas_height]-2*0.65*mm"/> + <!--%% Horizontal bars to make the 'I' shape (without them it would be a '|') --> + <Box name="MB1SLZIBeamWing" dx="3.175*mm" dy="[MB1SLZBareWire_length]" dz="0.65*mm"/> + <UnionSolid name="MB1SLZGas"> + <rSolid name="MB1SLZGas_aa"/> + <rSolid name="MB1SLZGas_bb"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*fm" y="0.*fm" z="0.*fm"/> + </UnionSolid> + <!-- #### MB1: Honeycomb --> + <Box name="MB1HoneycombBox" dx="[mb1:MB1HC_x]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHC_height]"/> + <Box name="MB1Honeycomb" dx="[mb1:MB1HC_x]-125.*mm" dy="[mbCommon:MBHC_z]-125.*mm" dz="[mbCommon:MBHC_height]-2*[mbCommon:MBAlPlate_height]"/> + <Box name="MB1HcPlate" dx="[mb1:MB1HC_x]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB1Hc_LateralC" dx="[mbCommon:MBHC_C_dimension]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB1Hc_FrontC" dx="[mb1:MB1HC_x]-125.*mm" dy="[mbCommon:MBHC_C_dimension]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB1Hc_LateralElectronics" dx="[mbCommon:MBHCLatElectronics_width]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB1Hc_FrontElectronics" dx="[mb1:MB1HC_x]-125.*mm" dy="[mbCommon:MBHCFrontElectronics_width]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB1HcTorsionBar" dx="25*mm" dy="678*mm" dz="50.*mm"/> + <!-- #### MB1: RPC chambers --> + <Box name="MB1RPC" dx="[mb1:MB1RPC_x]" dy="[mbCommon:MBRPC_z]" dz="[mbCommon:MBRPC_y]"/> + <Box name="MB1RPC_GasLeft" dx="[mb1:MB1RPC_Gas_x]" dy="[mbCommon:MBRPC_GasLeft_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB1RPC_GasRight" dx="[mb1:MB1RPC_Gas_x]" dy="[mbCommon:MBRPC_GasRight_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <!-- #### MB1Chimney Unit --> + <!-- #### MB1Chim: DTBX chamber --> + <Box name="MB1Chim_a" dx="[MB1_x]" dy="[mbCommon:MBChimSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBHeight_With2RPC]"/> + <Box name="MB1Chim_OLAP2" dx="5.6*mm" dy="[mbCommon:MBChimSLPhiPlO_z]+13.*mm" dz="6.6*mm"/> + <SubtractionSolid name="MB1ChimN_b"> + <rSolid name="MB1Chim_a"/> + <rSolid name="MB1_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB1_x]-16.8*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+14.8*mm"/> + </SubtractionSolid> + <UnionSolid name="MB1ChimN"> + <rSolid name="MB1ChimN_b"/> + <rSolid name="MB1Chim_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB1_x]-5.5*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+6.5*mm"/> + </UnionSolid> + <SubtractionSolid name="MB1ChimP_b"> + <rSolid name="MB1Chim_a"/> + <rSolid name="MB1_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB1_x]+16.8*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+14.8*mm"/> + </SubtractionSolid> + <UnionSolid name="MB1ChimP"> + <rSolid name="MB1ChimP_b"/> + <rSolid name="MB1Chim_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB1_x]+5.5*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+6.5*mm"/> + </UnionSolid> + <!-- #### MB1Chim: DT Superlayers Phi --> + <Box name="MB1ChimSuperLayerPhi" dx="[mb1:MB1SLPhiPl_x]+2.7*mm" dy="[mbCommon:MBChimSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% Only extra parallel "Cs" are needed --> + <Box name="MB1ChimSLPhiClosingPlateParal" dx="1.*mm" dy="[mbCommon:MBChimSLPhiPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB1ChimSLPhi_C_PlateParal" dx="7.*mm" dy="[mbCommon:MBChimSLPhiPlO_z]-14.*mm" dz="1.*mm"/> + <Box name="MB1ChimSLPhiAlPlateOuter" dx="[mb1:MB1SLPhiPl_x]+0.7*mm" dy="[mbCommon:MBChimSLPhiPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB1ChimSLPhiAlPlateInner" dx="[mb1:MB1SLPhiPl_x]" dy="[mbCommon:MBChimSLPhiPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB1ChimSLPhiLayer_48Cells" dx="[mb1:MB1SLPhiL48]" dy="[mbCommon:MBChimSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1ChimSLPhiLayer_49Cells" dx="[mb1:MB1SLPhiL49]" dy="[mbCommon:MBChimSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1ChimSLPhiLayer_50Cells" dx="[mb1:MB1SLPhiL50]" dy="[mbCommon:MBChimSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <!-- #### MB1Chim: DT Superlayer Z --> + <Box name="MB1ChimSuperLayerZ" dx="[mbCommon:MBChimSLZPl_x]+2.7*mm" dy="[mb1:MB1SLZPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% Only extra perperdicular "Cs" are needed --> + <Box name="MB1ChimSLZClosingPlatePerp" dx="[mbCommon:MBChimSLZPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB1ChimSLZ_C_PlatePerp" dx="[mbCommon:MBChimSLZPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <Box name="MB1ChimSLZAlPlateOuter" dx="[mbCommon:MBChimSLZPl_x]+0.7*mm" dy="[mb1:MB1SLZPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB1ChimSLZAlPlateInner" dx="[mbCommon:MBChimSLZPl_x]" dy="[mb1:MB1SLZPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB1ChimSLZLayer_47Cells" dx="[mbCommon:MBChimSLZL47]" dy="[mb1:MB1SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1ChimSLZLayer_48Cells" dx="[mbCommon:MBChimSLZL48]" dy="[mb1:MB1SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1ChimSLZElectronics_47Cells" dx="[mbCommon:MBChimSLZL47]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1ChimSLZElectronics_48Cells" dx="[mbCommon:MBChimSLZL48]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB1ChimSLZCommonElectronics" dx="[mbCommon:MBChimSLZPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!-- #### MB1Chim: DT Honeycomb --> + <Box name="MB1ChimHoneycombBox" dx="[mb1:MB1HC_x]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHC_height]"/> + <Box name="MB1ChimHoneycomb" dx="[mb1:MB1HC_x]-125.*mm" dy="[mbCommon:MBChimHC_z]-125.*mm" dz="[mbCommon:MBHC_height]-2*[mbCommon:MBAlPlate_height]"/> + <Box name="MB1ChimHc_LateralC" dx="[mbCommon:MBHC_C_dimension]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB1ChimHc_LateralElectronics" dx="[mbCommon:MBHCLatElectronics_width]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB1ChimHcPlate" dx="[mb1:MB1HC_x]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!-- #### MB1Chim: RPC chambers --> + <Box name="MB1ChimRPC" dx="[mb1:MB1RPC_x]" dy="[mbCommon:MBChimRPC_z]" dz="[mbCommon:MBRPC_y]"/> + <Box name="MB1ChimRPC_GasLeft" dx="[mb1:MB1RPC_Gas_x]" dy="[mbCommon:MBChimRPC_OGasLeft_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB1ChimRPC_GasRight" dx="[mb1:MB1RPC_Gas_x]" dy="[mbCommon:MBChimRPC_OGasRight_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + </SolidSection> + <LogicalPartSection label="mb1.xml"> + <!-- #### MB1 Unit --> + <!-- #### MB1: DTBX --> + <LogicalPart name="MB1P" category="unspecified"> + <rSolid name="MB1P"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB1P0" category="unspecified"> + <rSolid name="MB1Pw0"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB1N" category="unspecified"> + <rSolid name="MB1N"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <!-- # In wheel_0, all the RPC chambers are Positive, while the DT are half positive, half negative --> + <LogicalPart name="MB1N0P" category="unspecified"> + <rSolid name="MB1Nw0"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <!-- #### MB1: DT Superlayers Phi --> + <LogicalPart name="MB1SuperLayerPhi" category="unspecified"> + <rSolid name="MB1SuperLayerPhi"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiClosingPlateParal" category="unspecified"> + <rSolid name="MB1SLPhiClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhi_C_PlateParal" category="unspecified"> + <rSolid name="MB1SLPhi_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiClosingPlatePerp" category="unspecified"> + <rSolid name="MB1SLPhiClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhi_C_PlatePerp" category="unspecified"> + <rSolid name="MB1SLPhi_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiAlPlateOuter" category="unspecified"> + <rSolid name="MB1SLPhiAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiAlPlateInner" category="unspecified"> + <rSolid name="MB1SLPhiAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiLayer_48Cells" category="unspecified"> + <rSolid name="MB1SLPhiLayer_48Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiLayer_49Cells" category="unspecified"> + <rSolid name="MB1SLPhiLayer_49Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiLayer_50Cells" category="unspecified"> + <rSolid name="MB1SLPhiLayer_50Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiElectronics_48Cells" category="unspecified"> + <rSolid name="MB1SLPhiElectronics_48Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiElectronics_49Cells" category="unspecified"> + <rSolid name="MB1SLPhiElectronics_49Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiElectronics_50Cells" category="unspecified"> + <rSolid name="MB1SLPhiElectronics_50Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1SLPhiCommonElectronics" category="unspecified"> + <rSolid name="MB1SLPhiCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB1: DT Superlayer Z --> + <LogicalPart name="MB1SuperLayerZ" category="unspecified"> + <rSolid name="MB1SuperLayerZ"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB1SLZClosingPlateParal" category="unspecified"> + <rSolid name="MB1SLZClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZClosingPlatePerp" category="unspecified"> + <rSolid name="MB1SLZClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZ_C_PlateParal" category="unspecified"> + <rSolid name="MB1SLZ_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZ_C_PlatePerp" category="unspecified"> + <rSolid name="MB1SLZ_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZAlPlateOuter" category="unspecified"> + <rSolid name="MB1SLZAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZAlPlateInner" category="unspecified"> + <rSolid name="MB1SLZAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZLayer_56Cells" category="unspecified"> + <rSolid name="MB1SLZLayer_56Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZLayer_57Cells" category="unspecified"> + <rSolid name="MB1SLZLayer_57Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZLayer_58Cells" category="unspecified"> + <rSolid name="MB1SLZLayer_58Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZIBeamWing" category="unspecified"> + <rSolid name="MB1SLZIBeamWing"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1SLZGas" category="unspecified"> + <rSolid name="MB1SLZGas"/> + <rMaterial name="materials:M_DTBX Gas"/> + </LogicalPart> + <LogicalPart name="MB1SLZElectronics_56Cells" category="unspecified"> + <rSolid name="MB1SLZElectronics_56Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1SLZElectronics_57Cells" category="unspecified"> + <rSolid name="MB1SLZElectronics_57Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1SLZElectronics_58Cells" category="unspecified"> + <rSolid name="MB1SLZElectronics_58Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1SLZCommonElectronics" category="unspecified"> + <rSolid name="MB1SLZCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB1: DT Honeycomb --> + <LogicalPart name="MB1HoneycombBox" category="unspecified"> + <rSolid name="MB1HoneycombBox"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB1Honeycomb" category="unspecified"> + <rSolid name="MB1Honeycomb"/> + <rMaterial name="materials:M_honeycomb"/> + </LogicalPart> + <LogicalPart name="MB1HcPlate" category="unspecified"> + <rSolid name="MB1HcPlate"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1Hc_LateralC" category="unspecified"> + <rSolid name="MB1Hc_LateralC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1Hc_FrontC" category="unspecified"> + <rSolid name="MB1Hc_FrontC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1Hc_LateralElectronics" category="unspecified"> + <rSolid name="MB1Hc_LateralElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1Hc_FrontElectronics" category="unspecified"> + <rSolid name="MB1Hc_FrontElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1HcTorsionBar" category="unspecified"> + <rSolid name="MB1HcTorsionBar"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <!-- #### MB1: RPC chambers --> + <LogicalPart name="MB1RPC_IP" category="unspecified"> + <rSolid name="MB1RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB1RPC_IN" category="unspecified"> + <rSolid name="MB1RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB1RPC_IGasLeft" category="unspecified"> + <rSolid name="MB1RPC_GasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB1RPC_IGasRight" category="unspecified"> + <rSolid name="MB1RPC_GasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB1RPC_OP" category="unspecified"> + <rSolid name="MB1RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB1RPC_ON" category="unspecified"> + <rSolid name="MB1RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB1RPC_OGasLeft" category="unspecified"> + <rSolid name="MB1RPC_GasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB1RPC_OGasRight" category="unspecified"> + <rSolid name="MB1RPC_GasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <!-- #### MB1Chimney Unit --> + <!-- #### MB1Chim: DTBX --> + <LogicalPart name="MB1ChimP" category="unspecified"> + <rSolid name="MB1ChimP"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB1ChimN" category="unspecified"> + <rSolid name="MB1ChimN"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <!-- #### MB1Chim: DT Superlayers Phi --> + <LogicalPart name="MB1ChimSuperLayerPhi" category="unspecified"> + <rSolid name="MB1ChimSuperLayerPhi"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLPhiClosingPlateParal" category="unspecified"> + <rSolid name="MB1ChimSLPhiClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLPhi_C_PlateParal" category="unspecified"> + <rSolid name="MB1ChimSLPhi_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLPhiAlPlateOuter" category="unspecified"> + <rSolid name="MB1ChimSLPhiAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLPhiAlPlateInner" category="unspecified"> + <rSolid name="MB1ChimSLPhiAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLPhiLayer_48Cells" category="unspecified"> + <rSolid name="MB1ChimSLPhiLayer_48Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLPhiLayer_49Cells" category="unspecified"> + <rSolid name="MB1ChimSLPhiLayer_49Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLPhiLayer_50Cells" category="unspecified"> + <rSolid name="MB1ChimSLPhiLayer_50Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <!-- #### MB1Chim: DT Superlayer Z --> + <LogicalPart name="MB1ChimSuperLayerZ" category="unspecified"> + <rSolid name="MB1ChimSuperLayerZ"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZClosingPlatePerp" category="unspecified"> + <rSolid name="MB1ChimSLZClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZ_C_PlatePerp" category="unspecified"> + <rSolid name="MB1ChimSLZ_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZAlPlateOuter" category="unspecified"> + <rSolid name="MB1ChimSLZAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZAlPlateInner" category="unspecified"> + <rSolid name="MB1ChimSLZAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZLayer_47Cells" category="unspecified"> + <rSolid name="MB1ChimSLZLayer_47Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZLayer_47Cells_startCell2" category="unspecified"> + <rSolid name="MB1ChimSLZLayer_47Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZLayer_48Cells" category="unspecified"> + <rSolid name="MB1ChimSLZLayer_48Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZElectronics_47Cells" category="unspecified"> + <rSolid name="MB1ChimSLZElectronics_47Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZElectronics_48Cells" category="unspecified"> + <rSolid name="MB1ChimSLZElectronics_48Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB1ChimSLZCommonElectronics" category="unspecified"> + <rSolid name="MB1ChimSLZCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB1Chim: DT Honeycomb --> + <LogicalPart name="MB1ChimHoneycombBox" category="unspecified"> + <rSolid name="MB1ChimHoneycombBox"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB1ChimHoneycomb" category="unspecified"> + <rSolid name="MB1ChimHoneycomb"/> + <rMaterial name="materials:M_honeycomb"/> + </LogicalPart> + <LogicalPart name="MB1ChimHcPlate" category="unspecified"> + <rSolid name="MB1ChimHcPlate"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimHc_LateralC" category="unspecified"> + <rSolid name="MB1ChimHc_LateralC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB1ChimHc_LateralElectronics" category="unspecified"> + <rSolid name="MB1ChimHc_LateralElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB1Chim: RPC chambers --> + <LogicalPart name="MB1ChimRPC_IP" category="unspecified"> + <rSolid name="MB1ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB1ChimRPC_IN" category="unspecified"> + <rSolid name="MB1ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB1ChimRPC_IGasLeft" category="unspecified"> + <rSolid name="MB1ChimRPC_GasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB1ChimRPC_IGasRight" category="unspecified"> + <rSolid name="MB1ChimRPC_GasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB1ChimRPC_OP" category="unspecified"> + <rSolid name="MB1ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB1ChimRPC_ON" category="unspecified"> + <rSolid name="MB1ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB1ChimRPC_OGasLeft" category="unspecified"> + <rSolid name="MB1ChimRPC_GasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB1ChimRPC_OGasRight" category="unspecified"> + <rSolid name="MB1ChimRPC_GasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + </LogicalPartSection> + <PosPartSection label="mb1.xml"> + <!-- #### MB1 Unit --> + <!-- #### MB1: DTBX chamber --> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb1:MB1N0P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB1UnitRadius]"/> + <Numeric name="StartAngle" value="[MB1PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB1PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb1:MB1P0"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB1UnitRadius]"/> + <Numeric name="StartAngle" value="30.*deg+[MB1PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB1PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb1:MB1P0"/> + <Numeric name="StartCopyNo" value="3"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB1UnitRadius]"/> + <Numeric name="StartAngle" value="60.*deg+[MB1PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB1PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb1:MB1N0P"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB1UnitRadius]"/> + <Numeric name="StartAngle" value="90.*deg+[MB1PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB1PosAngle] </Vector> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb1:MB1P"/> + <rRotation name="rotations:RM1872"/> + <Translation x="[MB1Pos_x]" y="[MB1Pos_y]" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb1:MB1P"/> + <rRotation name="rotations:RM1882"/> + <Translation x="[MB1Pos_x]*0.86602543-[MB1Pos_y]*0.5" y="[MB1Pos_x]*0.5+[MB1Pos_y]*0.86602543" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb1:MB1P"/> + <rRotation name="rotations:RM1892"/> + <Translation x="[MB1Pos_x]*0.5-[MB1Pos_y]*0.86602543" y="[MB1Pos_x]*0.86602543+[MB1Pos_y]*0.5" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb1:MB1ChimP"/> + <rRotation name="rotations:RM1902"/> + <Translation x="-[MB1Pos_y]" y="[MB1Pos_x]" z="[mbCommon:MBChimPos_z]"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="mb1:MB1P"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="Radius" value="[MB1UnitRadius]"/> + <Numeric name="StartAngle" value="120.*deg+[MB1PosAngle]"/> + <Numeric name="RangeAngle" value="210.*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB1PosAngle] </Vector> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb1:MB1N"/> + <rRotation name="rotations:E127"/> + <Translation x="[MB1Pos_x]" y="[MB1Pos_y]" z="[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb1:MB1N"/> + <rRotation name="rotations:MM200"/> + <Translation x="[MB1Pos_x]*0.86602543-[MB1Pos_y]*0.5" y="[MB1Pos_x]*0.5+[MB1Pos_y]*0.86602543" z="[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb1:MB1ChimN"/> + <rRotation name="rotations:MM300"/> + <Translation x="[MB1Pos_x]*0.5-[MB1Pos_y]*0.86602543" y="[MB1Pos_x]*0.86602543+[MB1Pos_y]*0.5" z="-[mbCommon:MBChimPos_z]"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="mb1:MB1N"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="Radius" value="[MB1UnitRadius]"/> + <Numeric name="StartAngle" value="90.*deg+[MB1PosAngle]"/> + <Numeric name="RangeAngle" value="240.*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB1PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="mb1:MB1P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="[MB1UnitRadius]"/> + <Numeric name="StartAngle" value="[MB1PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB1PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="mb1:MB1N"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="[MB1UnitRadius]"/> + <Numeric name="StartAngle" value="[MB1PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB1PosAngle] </Vector> + </Algorithm> + <!-- #### MB1: DT Superlayers Phi --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1P"/> + <rChild name="mb1:MB1SuperLayerPhi"/> + <Translation x="[mb1:MB1pSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1P"/> + <rChild name="mb1:MB1SuperLayerPhi"/> + <Translation x="[mb1:MB1pSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1P0"/> + <rChild name="mb1:MB1SuperLayerPhi"/> + <Translation x="[mb1:MB1pSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1P0"/> + <rChild name="mb1:MB1SuperLayerPhi"/> + <Translation x="[mb1:MB1pSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1N0P"/> + <rChild name="mb1:MB1SuperLayerPhi"/> + <Translation x="[mb1:MB1nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1N0P"/> + <rChild name="mb1:MB1SuperLayerPhi"/> + <Translation x="[mb1:MB1nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1N"/> + <rChild name="mb1:MB1SuperLayerPhi"/> + <Translation x="[mb1:MB1nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1N"/> + <rChild name="mb1:MB1SuperLayerPhi"/> + <Translation x="[mb1:MB1nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <!-- ## MB1: DT Superlayers Phi internal --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiLayer_49Cells"/> + <Translation x="0*fm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiLayer_50Cells"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiLayer_49Cells"/> + <Translation x="0*fm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiLayer_48Cells"/> + <Translation x="0*fm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiClosingPlateParal"/> + <Translation x="[mb1:MB1SLPhiPl_x]+1.7*mm" y="0.*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiClosingPlateParal"/> + <Translation x="-([mb1:MB1SLPhiPl_x]+1.7*mm)" y="0.*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlateParal"/> + <Translation x="[mb1:MB1SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlateParal"/> + <Translation x="[mb1:MB1SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlateParal"/> + <Translation x="-([mb1:MB1SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlateParal"/> + <Translation x="-([mb1:MB1SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1SLPhiLayer_48Cells"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="N" value="48"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb1:MB1SLPhiL48]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1SLPhiLayer_49Cells"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="N" value="49"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb1:MB1SLPhiL49]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1SLPhiLayer_50Cells"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="N" value="50"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb1:MB1SLPhiL50]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SLPhiLayer_48Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_48Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SLPhiLayer_48Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_48Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SLPhiLayer_49Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_49Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SLPhiLayer_49Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_49Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SLPhiLayer_50Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_50Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SLPhiLayer_50Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_50Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- #### MB1: DT Superlayer Z --> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1P"/> + <rChild name="mb1:MB1SuperLayerZ"/> + <Translation x="[mb1:MB1pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1P0"/> + <rChild name="mb1:MB1SuperLayerZ"/> + <Translation x="[mb1:MB1pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1N"/> + <rChild name="mb1:MB1SuperLayerZ"/> + <Translation x="[mb1:MB1nSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1N0P"/> + <rChild name="mb1:MB1SuperLayerZ"/> + <Translation x="[mb1:MB1nSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <!-- #### MB1: DT Superlayer Z internal --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="0.*mm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZLayer_57Cells"/> + <Translation x="0*fm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZLayer_58Cells"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZLayer_57Cells"/> + <Translation x="0*fm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZLayer_56Cells"/> + <Translation x="0*fm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZClosingPlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZClosingPlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZClosingPlatePerp"/> + <Translation x="0.*fm" y="[mb1:MB1SLZPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb1:MB1SLZPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb1:MB1SLZPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZCommonElectronics"/> + <Translation x="0.*fm" y="[mb1:MB1SLZPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SuperLayerZ"/> + <rChild name="mb1:MB1SLZCommonElectronics"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1SLZLayer_56Cells"/> + <String name="ChildName" value="mb1:MB1SLZGas"/> + <Numeric name="N" value="56"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL56]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1SLZLayer_57Cells"/> + <String name="ChildName" value="mb1:MB1SLZGas"/> + <Numeric name="N" value="57"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL57]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1SLZLayer_58Cells"/> + <String name="ChildName" value="mb1:MB1SLZGas"/> + <Numeric name="N" value="58"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL58]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SLZLayer_56Cells"/> + <rChild name="mb1:MB1SLZElectronics_56Cells"/> + <Translation x="0.*fm" y="[MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SLZLayer_56Cells"/> + <rChild name="mb1:MB1SLZElectronics_56Cells"/> + <Translation x="0.*fm" y="-([MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SLZLayer_57Cells"/> + <rChild name="mb1:MB1SLZElectronics_57Cells"/> + <Translation x="0.*fm" y="[MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SLZLayer_57Cells"/> + <rChild name="mb1:MB1SLZElectronics_57Cells"/> + <Translation x="0.*fm" y="-([MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1SLZLayer_58Cells"/> + <rChild name="mb1:MB1SLZElectronics_58Cells"/> + <Translation x="0.*fm" y="[MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1SLZLayer_58Cells"/> + <rChild name="mb1:MB1SLZElectronics_58Cells"/> + <Translation x="0.*fm" y="-([MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- ##### MB1: DT honeycomb --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1P"/> + <rChild name="mb1:MB1HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1P0"/> + <rChild name="mb1:MB1HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1N"/> + <rChild name="mb1:MB1HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1N0P"/> + <rChild name="mb1:MB1HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Honeycomb"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1HcPlate"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBHC_height]-0.75*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1HcPlate"/> + <Translation x="0*fm" y="0*fm" z="-([mbCommon:MBHC_height]-0.75*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_LateralC"/> + <Translation x="[mb1:MB1HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_LateralC"/> + <Translation x="[mb1:MB1HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_LateralC"/> + <Translation x="-([mb1:MB1HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_LateralC"/> + <Translation x="-([mb1:MB1HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension]" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension]" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension])" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension])" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_LateralElectronics"/> + <Translation x="[mb1:MB1HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width]" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_LateralElectronics"/> + <Translation x="-([mb1:MB1HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width])" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontElectronics"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width]" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontElectronics"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width])" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1HoneycombBox"/> + <rChild name="mb1:MB1HcTorsionBar"/> + <Translation x="[mb1:MB1HC_x]-25.*mm" y="0*fm" z="0*fm"/> + </PosPart> + <!-- ##### MB1: RPC chambers --> + <!-- ##### MB1: RPC_IP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1P"/> + <rChild name="mb1:MB1RPC_IP"/> + <Translation x="[mb1:MB1RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1P0"/> + <rChild name="mb1:MB1RPC_IP"/> + <Translation x="[mb1:MB1RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1RPC_IP"/> + <rChild name="mb1:MB1RPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1RPC_IP"/> + <rChild name="mb1:MB1RPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB1: RPC_OP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1P"/> + <rChild name="mb1:MB1RPC_OP"/> + <Translation x="[mb1:MB1RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1P0"/> + <rChild name="mb1:MB1RPC_OP"/> + <Translation x="[mb1:MB1RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1RPC_OP"/> + <rChild name="mb1:MB1RPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1RPC_OP"/> + <rChild name="mb1:MB1RPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB1: RPC_IN chamber --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1N"/> + <rChild name="mb1:MB1RPC_IN"/> + <Translation x="-[mb1:MB1RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1N0P"/> + <rChild name="mb1:MB1RPC_IP"/> + <Translation x="-[mb1:MB1RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1RPC_IN"/> + <rChild name="mb1:MB1RPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1RPC_IN"/> + <rChild name="mb1:MB1RPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB1: RPC_ON chamber --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1N"/> + <rChild name="mb1:MB1RPC_ON"/> + <Translation x="-[mb1:MB1RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1N0P"/> + <rChild name="mb1:MB1RPC_OP"/> + <Translation x="-[mb1:MB1RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1RPC_ON"/> + <rChild name="mb1:MB1RPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1RPC_ON"/> + <rChild name="mb1:MB1RPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- #### MB1Chimney Unit --> + <!-- #### MB1Chim: DTBX chamber --> + <!-- #### MB1: DT Superlayers Phi --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimP"/> + <rChild name="mb1:MB1ChimSuperLayerPhi"/> + <Translation x="[mb1:MB1pSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimP"/> + <rChild name="mb1:MB1ChimSuperLayerPhi"/> + <Translation x="[mb1:MB1pSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimN"/> + <rChild name="mb1:MB1ChimSuperLayerPhi"/> + <Translation x="[mb1:MB1nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimN"/> + <rChild name="mb1:MB1ChimSuperLayerPhi"/> + <Translation x="[mb1:MB1nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <!-- ## MB1: DT Superlayers Phi internal --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiLayer_49Cells"/> + <Translation x="0*fm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiLayer_50Cells"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiLayer_49Cells"/> + <Translation x="0*fm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiLayer_48Cells"/> + <Translation x="0*fm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiClosingPlateParal"/> + <Translation x="[mb1:MB1SLPhiPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhiClosingPlateParal"/> + <Translation x="-([mb1:MB1SLPhiPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhi_C_PlateParal"/> + <Translation x="[mb1:MB1SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhi_C_PlateParal"/> + <Translation x="[mb1:MB1SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhi_C_PlateParal"/> + <Translation x="-([mb1:MB1SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1ChimSLPhi_C_PlateParal"/> + <Translation x="-([mb1:MB1SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerPhi"/> + <rChild name="mb1:MB1SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1ChimSLPhiLayer_48Cells"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="N" value="48"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb1:MB1SLPhiL48]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1ChimSLPhiLayer_49Cells"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="N" value="49"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb1:MB1SLPhiL49]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1ChimSLPhiLayer_50Cells"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="N" value="50"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb1:MB1SLPhiL50]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSLPhiLayer_48Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_48Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSLPhiLayer_48Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_48Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSLPhiLayer_49Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_49Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSLPhiLayer_49Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_49Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSLPhiLayer_50Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_50Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSLPhiLayer_50Cells"/> + <rChild name="mb1:MB1SLPhiElectronics_50Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- #### MB1Chim: DT Superlayer Z --> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimP"/> + <rChild name="mb1:MB1ChimSuperLayerZ"/> + <Translation x="[mb1:MB1pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimN"/> + <rChild name="mb1:MB1ChimSuperLayerZ"/> + <Translation x="[mb1:MB1pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <!-- #### MB1Chim: DT Superlayer Z internal --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZLayer_47Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZLayer_48Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZLayer_48Cells"/> + <Translation x="10.5*mm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZLayer_47Cells_startCell2"/> + <Translation x="10.5*mm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1SLZClosingPlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1SLZClosingPlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZClosingPlatePerp"/> + <Translation x="0.*fm" y="[mb1:MB1SLZPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb1:MB1SLZPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb1:MB1SLZPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZCommonElectronics"/> + <Translation x="0.*fm" y="[mb1:MB1SLZPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSuperLayerZ"/> + <rChild name="mb1:MB1ChimSLZCommonElectronics"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1ChimSLZLayer_47Cells"/> + <String name="ChildName" value="mb1:MB1SLZGas"/> + <Numeric name="N" value="47"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL47]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1ChimSLZLayer_47Cells_startCell2"/> + <String name="ChildName" value="mb1:MB1SLZGas"/> + <Numeric name="N" value="47"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL47]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb1:MB1ChimSLZLayer_48Cells"/> + <String name="ChildName" value="mb1:MB1SLZGas"/> + <Numeric name="N" value="48"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL48]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSLZLayer_47Cells"/> + <rChild name="mb1:MB1ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="[mb1:MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSLZLayer_47Cells"/> + <rChild name="mb1:MB1ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSLZLayer_47Cells_startCell2"/> + <rChild name="mb1:MB1ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="[mb1:MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSLZLayer_47Cells_startCell2"/> + <rChild name="mb1:MB1ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimSLZLayer_48Cells"/> + <rChild name="mb1:MB1ChimSLZElectronics_48Cells"/> + <Translation x="0.*fm" y="[mb1:MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimSLZLayer_48Cells"/> + <rChild name="mb1:MB1ChimSLZElectronics_48Cells"/> + <Translation x="0.*fm" y="-([mb1:MB1SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- ##### MB1Chim: DT honeycomb --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimP"/> + <rChild name="mb1:MB1ChimHoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimN"/> + <rChild name="mb1:MB1ChimHoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHoneycomb"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHcPlate"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBHC_height]-0.75*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHcPlate"/> + <Translation x="0*fm" y="0*fm" z="-([mbCommon:MBHC_height]-0.75*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHc_LateralC"/> + <Translation x="[mb1:MB1HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHc_LateralC"/> + <Translation x="[mb1:MB1HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHc_LateralC"/> + <Translation x="-([mb1:MB1HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHc_LateralC"/> + <Translation x="-([mb1:MB1HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension]" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension]" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension])" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension])" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHc_LateralElectronics"/> + <Translation x="[mb1:MB1HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width]" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1ChimHc_LateralElectronics"/> + <Translation x="-([mb1:MB1HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width])" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontElectronics"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width]" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1Hc_FrontElectronics"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width])" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimHoneycombBox"/> + <rChild name="mb1:MB1HcTorsionBar"/> + <Translation x="[mb1:MB1HC_x]-25.*mm" y="0*fm" z="0*fm"/> + </PosPart> + <!-- ##### MB1Chim: RPC chambers --> + <!-- ##### MB1Chim: RPC_IP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimP"/> + <rChild name="mb1:MB1ChimRPC_IP"/> + <Translation x="[mb1:MB1RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimRPC_IP"/> + <rChild name="mb1:MB1ChimRPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb1:MB1ChimRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimRPC_IP"/> + <rChild name="mb1:MB1ChimRPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mb1:MB1ChimRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB1Chim: RPC_OP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimP"/> + <rChild name="mb1:MB1ChimRPC_OP"/> + <Translation x="[mb1:MB1RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimRPC_OP"/> + <rChild name="mb1:MB1ChimRPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mb1:MB1ChimRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimRPC_OP"/> + <rChild name="mb1:MB1ChimRPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mb1:MB1ChimRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB1Chim: RPC_IN chamber --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimN"/> + <rChild name="mb1:MB1ChimRPC_IN"/> + <Translation x="-[mb1:MB1RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimRPC_IN"/> + <rChild name="mb1:MB1ChimRPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb1:MB1ChimRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimRPC_IN"/> + <rChild name="mb1:MB1ChimRPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mb1:MB1ChimRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB1Chim: RPC_ON chamber --> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimN"/> + <rChild name="mb1:MB1ChimRPC_ON"/> + <Translation x="-[mb1:MB1RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimRPC_ON"/> + <rChild name="mb1:MB1ChimRPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mb1:MB1ChimRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb1:MB1ChimRPC_ON"/> + <rChild name="mb1:MB1ChimRPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mb1:MB1ChimRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + </PosPartSection> +</DDDefinition> diff --git a/Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml b/Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml new file mode 100644 index 0000000000000..64ac65c794bab --- /dev/null +++ b/Geometry/MuonCommonData/data/mb2/2021/v1/mb2.xml @@ -0,0 +1,2067 @@ +<?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="mb2.xml" eval="true"> + <!--- #### MB2: Positions --> + <!--%% Radial coordinates fo algos --> + <Constant name="MB2UnitRadius" value="5129.2287 *mm"/> + <Constant name="MB2PosAngle" value="-2.3945239*deg"/> + <!--%% Cartesian coordinates for sector 1 --> + <Constant name="MB2Pos_x" value="5098.*mm+[mbCommon:MBHC_offset]"/> + <Constant name="MB2Pos_y" value="-214.3*mm"/> + <!--- #### MB2: Constants for DT superlayer Phi --> + <Constant name="MB2SLPhiPl_x" value="2562./2*mm"/> + <Constant name="MB2SLPhiL59" value="[mbCommon:MBCell_width]*59+[mbCommon:MBIbeamWall]"/> + <Constant name="MB2SLPhiL60" value="[mbCommon:MBCell_width]*60+[mbCommon:MBIbeamWall]"/> + <!--- #### MB2: Constants for DT superlayer Z (although they are placed with a rotation that interchanges X and Z, the _x refers to the coordinate X in EDMS, that is the Z in its final position; similar for _z --> + <Constant name="MB2SLZWire_length" value="2501./2.*mm"/> + <!--%% Wire length from EDMS: THIS NUMBER DEFINE THE SL DIMENSIONS--> + <Constant name="MB2SLZBareWire_length" value="[MB2SLZWire_length]-15.5*mm"/> + <!--%% Bare Wire _length == wire_lenght - depth in tappini--> + <Constant name="MB2SLZLayer_length" value="[MB2SLZBareWire_length]+2*[mbCommon:MBLayerElectronics_width]"/> + <!--%% The z length of the Al layer volume--> + <Constant name="MB2SLZPlI_z" value="[MB2SLZLayer_length]+6.5*mm"/> + <!--%% Distance between tappini and Al Plate edge--> + <Constant name="MB2SLZPlO_z" value="[MB2SLZPlI_z]+38.*mm"/> + <!--- #### MB2: X dimensions --> + <Constant name="MB2_x" value="1334.*mm"/> + <Constant name="MB2HC_x" value="2488./2*mm"/> + <!--- #### MB2: Constants for DT positioning: distance from SL center to HC center --> + <Constant name="MB2pSLPhi1_HC_dist" value="-34.*mm"/> + <Constant name="MB2pSLPhi2_HC_dist" value="8.*mm"/> + <Constant name="MB2pSLZ_HC_dist" value="17.5*mm"/> + <Constant name="MB2nSLPhi1_HC_dist" value="34.*mm"/> + <Constant name="MB2nSLPhi2_HC_dist" value="-8.*mm"/> + <Constant name="MB2nSLZ_HC_dist" value="-17.5*mm"/> + <!--- #### MB2: Constants for DT RPCs --> + <Constant name="MB2RPC_x" value="2500./2*mm"/> + <Constant name="MB2RPC_Gas_x" value="[mb2:MB2RPC_x]-10.*mm"/> + <Constant name="MB2RPC_IGasLeft_y_pos" value="829*mm"/> + <Constant name="MB2RPC_IGasMiddle_y_pos" value="41.5*mm"/> + <Constant name="MB2RPC_IGasRight_y_pos" value="787.5*mm"/> + <Constant name="MB2RPC_I_x_pos" value="34.3*mm"/> + <Constant name="MB2RPC_O_x_pos" value="27.3*mm"/> + <!--- #### MB2Chim: Constants for DT RPCs --> + <Constant name="MB2ChimRPC_IGasLeft_y_pos" value="[mb2:MB2RPC_IGasLeft_y_pos]-([mbCommon:MBRPC_z]-[mbCommon:MBChimRPC_z])/2-4.*mm"/> + <Constant name="MB2ChimRPC_IGasMiddle_y_pos" value="[mb2:MB2RPC_IGasMiddle_y_pos]"/> + <Constant name="MB2ChimRPC_IGasRight_y_pos" value="[mb2:MB2RPC_IGasRight_y_pos]-([mbCommon:MBRPC_z]-[mbCommon:MBChimRPC_z])/2.-4.*mm"/> + <Constant name="MB2ChimRPC_OGasRight_y_pos" value="[mbCommon:MBRPC_GasRight_y_pos]-([mbCommon:MBRPC_z]-[mbCommon:MBChimRPC_z])/2-4.*mm"/> + <Constant name="MB2ChimRPC_OGasLeft_y_pos" value="[mbCommon:MBRPC_GasLeft_y_pos]-([mbCommon:MBRPC_z]-[mbCommon:MBChimRPC_z])/2.-4.*mm"/> + </ConstantsSection> + <SolidSection label="mb2.xml"> + <!-- #### MB2 Unit: fake volume representing one DTBX + 1 or 2 RPC --> + <!-- #### MB2: DTBX chamber --> + <!--%% In MB2 the widest superlayer in x is the Z one --> + <Box name="MB2_a" dx="[MB2_x]" dy="[mbCommon:MBSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBHeight_With2RPC]"/> + <Box name="MB2_OLAP1" dx="19.5*mm" dy="[mbCommon:MBSLPhiPlO_z]+13.*mm" dz="11.5*mm"/> + <Box name="MB2_OLAP2" dx="39.9*mm" dy="[mbCommon:MBSLPhiPlO_z]+13.*mm" dz="69.1*mm"/> + <SubtractionSolid name="MB2P_b"> + <rSolid name="MB2_a"/> + <rSolid name="MB2_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB2_x]-19.1*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+11.1*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB2P"> + <rSolid name="MB2P_b"/> + <rSolid name="MB2_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB2_x]-39.8*mm" y="0.*fm" z="[mbCommon:MBHeight_With2RPC]-68.9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB2N_b"> + <rSolid name="MB2_a"/> + <rSolid name="MB2_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB2_x]+19.1*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+11.1*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB2N"> + <rSolid name="MB2N_b"/> + <rSolid name="MB2_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB2_x]+39.8*mm" y="0.*fm" z="[mbCommon:MBHeight_With2RPC]-68.9*mm"/> + </SubtractionSolid> + <!-- #### MB2: Superlayers Phi --> + <!--%% SuperLayer X,Z dimensions cover the outer Al plate + 2 mm for the closing profiles. Y is 5 Al plates + 4 Layer's --> + <Box name="MB2SuperLayerPhi" dx="[mb2:MB2SLPhiPl_x]+2.7*mm" dy="[mbCommon:MBSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% MB2SLPhiClosingPlateParal is parallel to gas cells, MB2SLPhiClosingPlatePerp is perpendicular --> + <!--%% Parallel are 2 mm thick and as long as outer Plates --> + <Box name="MB2SLPhiClosingPlateParal" dx="1.*mm" dy="[mbCommon:MBSLPhiPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB2SLPhi_C_PlateParal" dx="7.*mm" dy="[mbCommon:MBSLPhiPlO_z]-14.*mm" dz="1.*mm"/> + <!--%% Perpendicular are 12 mm thick and higher by 20 mm per side than the SL; 2.7 mm are added to reach the parallel "Cs" --> + <Box name="MB2SLPhiClosingPlatePerp" dx="[mb2:MB2SLPhiPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB2SLPhi_C_PlatePerp" dx="[mb2:MB2SLPhiPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <!--%% MB2SLPhiAlPlateOuter is 0.7 mm wider (perpendicular to the wires) to reach the parallel "Cs"--> + <Box name="MB2SLPhiAlPlateOuter" dx="[mb2:MB2SLPhiPl_x]+0.7*mm" dy="[mbCommon:MBSLPhiPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!--%% MB2SLPhiAlPlateOuter does not reach the parallel "Cs"--> + <Box name="MB2SLPhiAlPlateInner" dx="[mb2:MB2SLPhiPl_x]" dy="[mbCommon:MBSLPhiPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!--%% Fake layer volume contains the ibeams plus gas volumes: n+1 Ibeam's and n gas volumes. + (Ibeam wall width is ~1.35mm, but 0.1 is mylar, that is very light, so it set to 1.3) + It is first made of aluminium and them it is filled with the n gas volumes. + Z length is the bare wire length plus the electronics (==tappini)--> + <Box name="MB2SLPhiLayer_59Cells" dx="[MB2SLPhiL59]" dy="[mbCommon:MBSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLPhiLayer_60Cells" dx="[MB2SLPhiL60]" dy="[mbCommon:MBSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <!--%% Tappini, Perpendicular to the Ibeams and at the two ends --> + <Box name="MB2SLPhiElectronics_59Cells" dx="[mb2:MB2SLPhiL59]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLPhiElectronics_60Cells" dx="[mb2:MB2SLPhiL60]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLPhiCommonElectronics" dx="[mb2:MB2SLPhiPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!-- #### MB2: Superlayer Z --> + <Box name="MB2SuperLayerZ" dx="[mbCommon:MBSLZPl_x]+2.7*mm" dy="[mb2:MB2SLZPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB2SLZClosingPlateParal" dx="1.*mm" dy="[mb2:MB2SLZPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB2SLZ_C_PlateParal" dx="7.*mm" dy="[mb2:MB2SLZPlO_z]-14.*mm" dz="1.*mm"/> + <Box name="MB2SLZClosingPlatePerp" dx="[mbCommon:MBSLZPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB2SLZ_C_PlatePerp" dx="[mbCommon:MBSLZPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <Box name="MB2SLZAlPlateOuter" dx="[mbCommon:MBSLZPl_x]+0.7*mm" dy="[mb2:MB2SLZPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB2SLZAlPlateInner" dx="[mbCommon:MBSLZPl_x]" dy="[mb2:MB2SLZPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB2SLZLayer_56Cells" dx="[mbCommon:MBSLZL56]" dy="[mb2:MB2SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLZLayer_57Cells" dx="[mbCommon:MBSLZL57]" dy="[mb2:MB2SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLZLayer_58Cells" dx="[mbCommon:MBSLZL58]" dy="[mb2:MB2SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLZElectronics_56Cells" dx="[mbCommon:MBSLZL56]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLZElectronics_57Cells" dx="[mbCommon:MBSLZL57]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLZElectronics_58Cells" dx="[mbCommon:MBSLZL58]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLZCommonElectronics" dx="[mbCommon:MBSLZPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!--%% Effective gas volume --> + <Box name="MB2SLZGas_aa" dx="20.35*mm-2*3.175*mm" dy="[MB2SLZBareWire_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2SLZGas_bb" dx="20.35*mm" dy="[MB2SLZBareWire_length]" dz="[mbCommon:MBGas_height]-2*0.65*mm"/> + <!--%% Horizontal bars to make the 'I' shape (without them it would be a '|') --> + <Box name="MB2SLZIBeamWing" dx="3.175*mm" dy="[MB2SLZBareWire_length]" dz="0.65*mm"/> + <UnionSolid name="MB2SLZGas"> + <rSolid name="MB2SLZGas_aa"/> + <rSolid name="MB2SLZGas_bb"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*fm" y="0.*fm" z="0.*fm"/> + </UnionSolid> + <!-- #### MB2: Honeycomb --> + <Box name="MB2HoneycombBox" dx="[mb2:MB2HC_x]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHC_height]"/> + <Box name="MB2Honeycomb" dx="[mb2:MB2HC_x]-125.*mm" dy="[mbCommon:MBHC_z]-125.*mm" dz="[mbCommon:MBHC_height]-2*[mbCommon:MBAlPlate_height]"/> + <Box name="MB2HcPlate" dx="[mb2:MB2HC_x]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB2Hc_LateralC" dx="[mbCommon:MBHC_C_dimension]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB2Hc_FrontC" dx="[mb2:MB2HC_x]-125.*mm" dy="[mbCommon:MBHC_C_dimension]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB2Hc_LateralElectronics" dx="[mbCommon:MBHCLatElectronics_width]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB2Hc_FrontElectronics" dx="[mb2:MB2HC_x]-125.*mm" dy="[mbCommon:MBHCFrontElectronics_width]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB2HcTorsionBar" dx="25*mm" dy="678*mm" dz="50.*mm"/> + <!-- #### MB2: RPC chambers --> + <Box name="MB2RPC" dx="[mb2:MB2RPC_x]" dy="[mbCommon:MBRPC_z]" dz="[mbCommon:MBRPC_y]"/> + <Box name="MB23RPC_IGasLeft" dx="[mb2:MB2RPC_Gas_x]" dy="384.5*mm" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB23RPC_IGasMiddle" dx="[mb2:MB2RPC_Gas_x]" dy="397.*mm" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB23RPC_IGasRight" dx="[mb2:MB2RPC_Gas_x]" dy="426.*mm" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB23RPC_OGasLeft" dx="[mb2:MB2RPC_Gas_x]" dy="384.5*mm" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB23RPC_OGasMiddle" dx="[mb2:MB2RPC_Gas_x]" dy="397.*mm" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB23RPC_OGasRight" dx="[mb2:MB2RPC_Gas_x]" dy="426.*mm" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB22RPC_IGasLeft" dx="[mb2:MB2RPC_Gas_x]" dy="[mbCommon:MBRPC_GasLeft_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB22RPC_IGasRight" dx="[mb2:MB2RPC_Gas_x]" dy="[mbCommon:MBRPC_GasRight_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB22RPC_OGasLeft" dx="[mb2:MB2RPC_Gas_x]" dy="[mbCommon:MBRPC_GasLeft_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB22RPC_OGasRight" dx="[mb2:MB2RPC_Gas_x]" dy="[mbCommon:MBRPC_GasRight_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <!-- #### MB2Chimney Unit --> + <!-- #### MB2Chim: DTBX chamber --> + <Box name="MB2Chim_a" dx="[MB2_x]" dy="[mbCommon:MBChimSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBHeight_With2RPC]"/> + <SubtractionSolid name="MB2ChimP_b"> + <rSolid name="MB2Chim_a"/> + <rSolid name="MB2_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB2_x]-19.1*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+11.1*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB2ChimP"> + <rSolid name="MB2ChimP_b"/> + <rSolid name="MB2_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB2_x]-39.8*mm" y="0.*fm" z="[mbCommon:MBHeight_With2RPC]-68.9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB2ChimN_b"> + <rSolid name="MB2Chim_a"/> + <rSolid name="MB2_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB2_x]+19.1*mm" y="0.*fm" z="-[mbCommon:MBHeight_With2RPC]+11.1*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB2ChimN"> + <rSolid name="MB2ChimN_b"/> + <rSolid name="MB2_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB2_x]+39.8*mm" y="0.*fm" z="[mbCommon:MBHeight_With2RPC]-68.9*mm"/> + </SubtractionSolid> + <!-- #### MB2Chim: DT Superlayers Phi --> + <Box name="MB2ChimSuperLayerPhi" dx="[mb2:MB2SLPhiPl_x]+2.7*mm" dy="[mbCommon:MBChimSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% Only extra parallel "Cs" are needed --> + <Box name="MB2ChimSLPhiClosingPlateParal" dx="1.*mm" dy="[mbCommon:MBChimSLPhiPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB2ChimSLPhi_C_PlateParal" dx="7.*mm" dy="[mbCommon:MBChimSLPhiPlO_z]-14.*mm" dz="1.*mm"/> + <Box name="MB2ChimSLPhiAlPlateOuter" dx="[mb2:MB2SLPhiPl_x]+0.7*mm" dy="[mbCommon:MBChimSLPhiPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB2ChimSLPhiAlPlateInner" dx="[mb2:MB2SLPhiPl_x]" dy="[mbCommon:MBChimSLPhiPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB2ChimSLPhiLayer_59Cells" dx="[mb2:MB2SLPhiL59]" dy="[mbCommon:MBChimSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2ChimSLPhiLayer_60Cells" dx="[mb2:MB2SLPhiL60]" dy="[mbCommon:MBChimSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <!-- #### MB2Chim: DT Superlayer Z --> + <Box name="MB2ChimSuperLayerZ" dx="[mbCommon:MBChimSLZPl_x]+2.7*mm" dy="[mb2:MB2SLZPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% Only extra perperdicular "Cs" are needed --> + <Box name="MB2ChimSLZClosingPlatePerp" dx="[mbCommon:MBChimSLZPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB2ChimSLZ_C_PlatePerp" dx="[mbCommon:MBChimSLZPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <Box name="MB2ChimSLZAlPlateOuter" dx="[mbCommon:MBChimSLZPl_x]+0.7*mm" dy="[mb2:MB2SLZPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB2ChimSLZAlPlateInner" dx="[mbCommon:MBChimSLZPl_x]" dy="[mb2:MB2SLZPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB2ChimSLZLayer_47Cells" dx="[mbCommon:MBChimSLZL47]" dy="[mb2:MB2SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2ChimSLZLayer_48Cells" dx="[mbCommon:MBChimSLZL48]" dy="[mb2:MB2SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2ChimSLZElectronics_47Cells" dx="[mbCommon:MBChimSLZL47]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2ChimSLZElectronics_48Cells" dx="[mbCommon:MBChimSLZL48]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB2ChimSLZCommonElectronics" dx="[mbCommon:MBChimSLZPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!-- #### MB2Chim: DT Honeycomb --> + <Box name="MB2ChimHoneycombBox" dx="[mb2:MB2HC_x]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHC_height]"/> + <Box name="MB2ChimHoneycomb" dx="[mb2:MB2HC_x]-125.*mm" dy="[mbCommon:MBChimHC_z]-125.*mm" dz="[mbCommon:MBHC_height]-2*[mbCommon:MBAlPlate_height]"/> + <Box name="MB2ChimHc_LateralC" dx="[mbCommon:MBHC_C_dimension]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB2ChimHc_LateralElectronics" dx="[mbCommon:MBHCLatElectronics_width]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB2ChimHcPlate" dx="[mb2:MB2HC_x]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!-- #### MB2Chim: RPC chambers --> + <Box name="MB2ChimRPC" dx="[mb2:MB2RPC_x]" dy="[mbCommon:MBChimRPC_z]" dz="[mbCommon:MBRPC_y]"/> + <Box name="MB2ChimRPC_IGasLeft" dx="[mb2:MB2RPC_Gas_x]" dy="(379.+195.)/2*mm" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB2ChimRPC_IGasRight" dx="[mb2:MB2RPC_Gas_x]" dy="(852.-195.)/2*mm" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB2ChimRPC_OGasLeft" dx="[mb2:MB2RPC_Gas_x]" dy="[mbCommon:MBChimRPC_OGasLeft_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB2ChimRPC_OGasRight" dx="[mb2:MB2RPC_Gas_x]" dy="[mbCommon:MBChimRPC_OGasRight_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + </SolidSection> + <LogicalPartSection label="mb2.xml"> + <!-- #### MB2 Unit --> + <!-- #### MB2: DTBX --> + <!-- START COMMENT + + The following two LogicalParts need not be built! Please tell me if you uncomment these two LP's + Michael Case + + <LogicalPart name="MB2P" category="unspecified"> + <rSolid name="MB2P"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB2N" category="unspecified"> + <rSolid name="MB2N"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + END COMMENT --> + <!-- # There are several combinations of DT and RPC chambers for this station: mixing DT positive and negative and RPC positive with 3 gas volumes inner and 2 outer, positive with 2 gas volumes inner and 2 outer, negative with 3 gas volumes inner and 2 outer, negative with 2 gas volumes inner and 2 outer + Wheel_0: DT pos, RPC pos 3/2 - MB2P32P + Wheel_0: DT neg, RPC pos 3/2 - MB2N32P + Wheel_1P: DT pos, RPC pos 3/2 - (also MB2P32P) + Wheel_2P: DT pos, RPC pos 2/3 - MB2P23P + Wheel_1N: DT neg, RPC neg 3/2 - MB2N32N + Wheel_2N: DT neg, RPC neg 2/3 - MB2N23N, + + plus MB2ChimP (32P) , MB2ChimN (32N) + --> + <LogicalPart name="MB2P32P" category="unspecified"> + <rSolid name="MB2P"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB2N32P" category="unspecified"> + <rSolid name="MB2N"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB2P23P" category="unspecified"> + <rSolid name="MB2P"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB2N32N" category="unspecified"> + <rSolid name="MB2N"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB2N23N" category="unspecified"> + <rSolid name="MB2N"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <!-- #### MB2: DT Superlayers Phi --> + <LogicalPart name="MB2SuperLayerPhi" category="unspecified"> + <rSolid name="MB2SuperLayerPhi"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiClosingPlateParal" category="unspecified"> + <rSolid name="MB2SLPhiClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhi_C_PlateParal" category="unspecified"> + <rSolid name="MB2SLPhi_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiClosingPlatePerp" category="unspecified"> + <rSolid name="MB2SLPhiClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhi_C_PlatePerp" category="unspecified"> + <rSolid name="MB2SLPhi_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiAlPlateOuter" category="unspecified"> + <rSolid name="MB2SLPhiAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiAlPlateInner" category="unspecified"> + <rSolid name="MB2SLPhiAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiLayer_59Cells" category="unspecified"> + <rSolid name="MB2SLPhiLayer_59Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiLayer_59Cells_startCell2" category="unspecified"> + <rSolid name="MB2SLPhiLayer_59Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiLayer_60Cells" category="unspecified"> + <rSolid name="MB2SLPhiLayer_60Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiElectronics_59Cells" category="unspecified"> + <rSolid name="MB2SLPhiElectronics_59Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiElectronics_60Cells" category="unspecified"> + <rSolid name="MB2SLPhiElectronics_60Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2SLPhiCommonElectronics" category="unspecified"> + <rSolid name="MB2SLPhiCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB2: DT Superlayer Z --> + <LogicalPart name="MB2SuperLayerZ" category="unspecified"> + <rSolid name="MB2SuperLayerZ"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB2SLZClosingPlateParal" category="unspecified"> + <rSolid name="MB2SLZClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZClosingPlatePerp" category="unspecified"> + <rSolid name="MB2SLZClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZ_C_PlateParal" category="unspecified"> + <rSolid name="MB2SLZ_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZ_C_PlatePerp" category="unspecified"> + <rSolid name="MB2SLZ_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZAlPlateOuter" category="unspecified"> + <rSolid name="MB2SLZAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZAlPlateInner" category="unspecified"> + <rSolid name="MB2SLZAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZLayer_56Cells" category="unspecified"> + <rSolid name="MB2SLZLayer_56Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZLayer_57Cells" category="unspecified"> + <rSolid name="MB2SLZLayer_57Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZLayer_58Cells" category="unspecified"> + <rSolid name="MB2SLZLayer_58Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZIBeamWing" category="unspecified"> + <rSolid name="MB2SLZIBeamWing"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2SLZGas" category="unspecified"> + <rSolid name="MB2SLZGas"/> + <rMaterial name="materials:M_DTBX Gas"/> + </LogicalPart> + <LogicalPart name="MB2SLZElectronics_56Cells" category="unspecified"> + <rSolid name="MB2SLZElectronics_56Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2SLZElectronics_57Cells" category="unspecified"> + <rSolid name="MB2SLZElectronics_57Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2SLZElectronics_58Cells" category="unspecified"> + <rSolid name="MB2SLZElectronics_58Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2SLZCommonElectronics" category="unspecified"> + <rSolid name="MB2SLZCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB2: DT Honeycomb --> + <LogicalPart name="MB2HoneycombBox" category="unspecified"> + <rSolid name="MB2HoneycombBox"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB2Honeycomb" category="unspecified"> + <rSolid name="MB2Honeycomb"/> + <rMaterial name="materials:M_honeycomb"/> + </LogicalPart> + <LogicalPart name="MB2HcPlate" category="unspecified"> + <rSolid name="MB2HcPlate"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2Hc_LateralC" category="unspecified"> + <rSolid name="MB2Hc_LateralC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2Hc_FrontC" category="unspecified"> + <rSolid name="MB2Hc_FrontC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2Hc_LateralElectronics" category="unspecified"> + <rSolid name="MB2Hc_LateralElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2Hc_FrontElectronics" category="unspecified"> + <rSolid name="MB2Hc_FrontElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2HcTorsionBar" category="unspecified"> + <rSolid name="MB2HcTorsionBar"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <!-- #### MB2: RPC chambers --> + <LogicalPart name="MB22RPC_IP" category="unspecified"> + <rSolid name="MB2RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB22RPC_IN" category="unspecified"> + <rSolid name="MB2RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB23RPC_IP" category="unspecified"> + <rSolid name="MB2RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB23RPC_IN" category="unspecified"> + <rSolid name="MB2RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB23RPC_IGasLeft" category="unspecified"> + <rSolid name="MB23RPC_IGasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB23RPC_IGasMiddle" category="unspecified"> + <rSolid name="MB23RPC_IGasMiddle"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB23RPC_IGasRight" category="unspecified"> + <rSolid name="MB23RPC_IGasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB22RPC_IGasLeft" category="unspecified"> + <rSolid name="MB22RPC_IGasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB22RPC_IGasRight" category="unspecified"> + <rSolid name="MB22RPC_IGasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB22RPC_OP" category="unspecified"> + <rSolid name="MB2RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB22RPC_ON" category="unspecified"> + <rSolid name="MB2RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB23RPC_OP" category="unspecified"> + <rSolid name="MB2RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB23RPC_ON" category="unspecified"> + <rSolid name="MB2RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB23RPC_OGasLeft" category="unspecified"> + <rSolid name="MB23RPC_OGasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB23RPC_OGasMiddle" category="unspecified"> + <rSolid name="MB23RPC_OGasMiddle"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB23RPC_OGasRight" category="unspecified"> + <rSolid name="MB23RPC_OGasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB22RPC_OGasLeft" category="unspecified"> + <rSolid name="MB22RPC_OGasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB22RPC_OGasRight" category="unspecified"> + <rSolid name="MB22RPC_OGasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <!-- #### MB2Chimney Unit --> + <!-- #### MB2Chim: DTBX --> + <LogicalPart name="MB2ChimP" category="unspecified"> + <rSolid name="MB2ChimP"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB2ChimN" category="unspecified"> + <rSolid name="MB2ChimN"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <!-- #### MB2Chim: DT Superlayers Phi --> + <LogicalPart name="MB2ChimSuperLayerPhi" category="unspecified"> + <rSolid name="MB2ChimSuperLayerPhi"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLPhiClosingPlateParal" category="unspecified"> + <rSolid name="MB2ChimSLPhiClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLPhi_C_PlateParal" category="unspecified"> + <rSolid name="MB2ChimSLPhi_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLPhiAlPlateOuter" category="unspecified"> + <rSolid name="MB2ChimSLPhiAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLPhiAlPlateInner" category="unspecified"> + <rSolid name="MB2ChimSLPhiAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLPhiLayer_59Cells" category="unspecified"> + <rSolid name="MB2ChimSLPhiLayer_59Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLPhiLayer_59Cells_startCell2" category="unspecified"> + <rSolid name="MB2ChimSLPhiLayer_59Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLPhiLayer_60Cells" category="unspecified"> + <rSolid name="MB2ChimSLPhiLayer_60Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <!-- #### MB2Chim: DT Superlayer Z --> + <LogicalPart name="MB2ChimSuperLayerZ" category="unspecified"> + <rSolid name="MB2ChimSuperLayerZ"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZClosingPlatePerp" category="unspecified"> + <rSolid name="MB2ChimSLZClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZ_C_PlatePerp" category="unspecified"> + <rSolid name="MB2ChimSLZ_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZAlPlateOuter" category="unspecified"> + <rSolid name="MB2ChimSLZAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZAlPlateInner" category="unspecified"> + <rSolid name="MB2ChimSLZAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZLayer_47Cells" category="unspecified"> + <rSolid name="MB2ChimSLZLayer_47Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZLayer_47Cells_startCell2" category="unspecified"> + <rSolid name="MB2ChimSLZLayer_47Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZLayer_48Cells" category="unspecified"> + <rSolid name="MB2ChimSLZLayer_48Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZElectronics_47Cells" category="unspecified"> + <rSolid name="MB2ChimSLZElectronics_47Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZElectronics_48Cells" category="unspecified"> + <rSolid name="MB2ChimSLZElectronics_48Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB2ChimSLZCommonElectronics" category="unspecified"> + <rSolid name="MB2ChimSLZCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB2Chim: DT Honeycomb --> + <LogicalPart name="MB2ChimHoneycombBox" category="unspecified"> + <rSolid name="MB2ChimHoneycombBox"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB2ChimHoneycomb" category="unspecified"> + <rSolid name="MB2ChimHoneycomb"/> + <rMaterial name="materials:M_honeycomb"/> + </LogicalPart> + <LogicalPart name="MB2ChimHcPlate" category="unspecified"> + <rSolid name="MB2ChimHcPlate"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimHc_LateralC" category="unspecified"> + <rSolid name="MB2ChimHc_LateralC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB2ChimHc_LateralElectronics" category="unspecified"> + <rSolid name="MB2ChimHc_LateralElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB2Chim: RPC chambers --> + <LogicalPart name="MB2ChimRPC_IP" category="unspecified"> + <rSolid name="MB2ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB2ChimRPC_IN" category="unspecified"> + <rSolid name="MB2ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB2ChimRPC_IGasLeft" category="unspecified"> + <rSolid name="MB2ChimRPC_IGasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB2ChimRPC_IGasMiddle" category="unspecified"> + <rSolid name="MB23RPC_IGasMiddle"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB2ChimRPC_IGasRight" category="unspecified"> + <rSolid name="MB2ChimRPC_IGasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB2ChimRPC_OP" category="unspecified"> + <rSolid name="MB2ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB2ChimRPC_ON" category="unspecified"> + <rSolid name="MB2ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB2ChimRPC_OGasLeft" category="unspecified"> + <rSolid name="MB2ChimRPC_OGasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB2ChimRPC_OGasRight" category="unspecified"> + <rSolid name="MB2ChimRPC_OGasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + </LogicalPartSection> + <PosPartSection label="mb2.xml"> + <!-- #### MB2 Unit --> + <!-- #### MB2: DTBX chamber --> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb2:MB2N32P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB2UnitRadius]"/> + <Numeric name="StartAngle" value="360.*deg+[MB2PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB2PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb2:MB2P32P"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB2UnitRadius]"/> + <Numeric name="StartAngle" value="30.*deg+[MB2PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB2PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb2:MB2P32P"/> + <Numeric name="StartCopyNo" value="3"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB2UnitRadius]"/> + <Numeric name="StartAngle" value="60.*deg+[MB2PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB2PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb2:MB2N32P"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB2UnitRadius]"/> + <Numeric name="StartAngle" value="90.*deg+[MB2PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB2PosAngle] </Vector> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb2:MB2P32P"/> + <rRotation name="rotations:RM1872"/> + <Translation x="[MB2Pos_x]" y="[MB2Pos_y]" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb2:MB2P32P"/> + <rRotation name="rotations:RM1882"/> + <Translation x="[MB2Pos_x]*0.86602543-[MB2Pos_y]*0.5" y="[MB2Pos_x]*0.5+[MB2Pos_y]*0.86602543" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb2:MB2P32P"/> + <rRotation name="rotations:RM1892"/> + <Translation x="[MB2Pos_x]*0.5-[MB2Pos_y]*0.86602543" y="[MB2Pos_x]*0.86602543+[MB2Pos_y]*0.5" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb2:MB2ChimP"/> + <rRotation name="rotations:RM1902"/> + <Translation x="-[MB2Pos_y]" y="[MB2Pos_x]" z="[mbCommon:MBChimPos_z]"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="mb2:MB2P32P"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="Radius" value="[MB2UnitRadius]"/> + <Numeric name="StartAngle" value="120.*deg+[MB2PosAngle]"/> + <Numeric name="RangeAngle" value="210.*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB2PosAngle] </Vector> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb2:MB2N32N"/> + <rRotation name="rotations:E127"/> + <Translation x="[MB2Pos_x]" y="[MB2Pos_y]" z="[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb2:MB2N32N"/> + <rRotation name="rotations:MM200"/> + <Translation x="[MB2Pos_x]*0.86602543-[MB2Pos_y]*0.5" y="[MB2Pos_x]*0.5+[MB2Pos_y]*0.86602543" z="[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb2:MB2ChimN"/> + <rRotation name="rotations:MM300"/> + <Translation x="[MB2Pos_x]*0.5-[MB2Pos_y]*0.86602543" y="[MB2Pos_x]*0.86602543+[MB2Pos_y]*0.5" z="-[mbCommon:MBChimPos_z]"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="mb2:MB2N32N"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="Radius" value="[MB2UnitRadius]"/> + <Numeric name="StartAngle" value="90.*deg+[MB2PosAngle]"/> + <Numeric name="RangeAngle" value="240.*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB2PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="mb2:MB2P23P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="[MB2UnitRadius]"/> + <Numeric name="StartAngle" value="360.*deg+[MB2PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB2PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="mb2:MB2N23N"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="[MB2UnitRadius]"/> + <Numeric name="StartAngle" value="360.*deg+[MB2PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB2PosAngle] </Vector> + </Algorithm> + <!-- #### MB2: DT Superlayers Phi --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2P32P"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2pSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2P32P"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2pSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2P23P"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2pSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2P23P"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2pSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N32P"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2N32P"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N32N"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2N32N"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N23N"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2N23N"/> + <rChild name="mb2:MB2SuperLayerPhi"/> + <Translation x="[mb2:MB2nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <!-- ## MB2: DT Superlayers Phi internal --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiLayer_59Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiLayer_60Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiLayer_60Cells"/> + <Translation x="10.5*mm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiLayer_59Cells_startCell2"/> + <Translation x="10.5*mm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiClosingPlateParal"/> + <Translation x="[mb2:MB2SLPhiPl_x]+1.7*mm" y="0.*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiClosingPlateParal"/> + <Translation x="-([mb2:MB2SLPhiPl_x]+1.7*mm)" y="0.*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlateParal"/> + <Translation x="[mb2:MB2SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlateParal"/> + <Translation x="[mb2:MB2SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlateParal"/> + <Translation x="-([mb2:MB2SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlateParal"/> + <Translation x="-([mb2:MB2SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2SLPhiLayer_59Cells"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="59"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb2:MB2SLPhiL59]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2SLPhiLayer_59Cells_startCell2"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="N" value="59"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb2:MB2SLPhiL59]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2SLPhiLayer_60Cells"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="60"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb2:MB2SLPhiL60]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SLPhiLayer_59Cells"/> + <rChild name="mb2:MB2SLPhiElectronics_59Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SLPhiLayer_59Cells"/> + <rChild name="mb2:MB2SLPhiElectronics_59Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SLPhiLayer_59Cells_startCell2"/> + <rChild name="mb2:MB2SLPhiElectronics_59Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SLPhiLayer_59Cells_startCell2"/> + <rChild name="mb2:MB2SLPhiElectronics_59Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SLPhiLayer_60Cells"/> + <rChild name="mb2:MB2SLPhiElectronics_60Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SLPhiLayer_60Cells"/> + <rChild name="mb2:MB2SLPhiElectronics_60Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- #### MB2: DT Superlayer Z --> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2P32P"/> + <rChild name="mb2:MB2SuperLayerZ"/> + <Translation x="[mb2:MB2pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2P23P"/> + <rChild name="mb2:MB2SuperLayerZ"/> + <Translation x="[mb2:MB2pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2N32P"/> + <rChild name="mb2:MB2SuperLayerZ"/> + <Translation x="[mb2:MB2nSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2N32N"/> + <rChild name="mb2:MB2SuperLayerZ"/> + <Translation x="[mb2:MB2nSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2N23N"/> + <rChild name="mb2:MB2SuperLayerZ"/> + <Translation x="[mb2:MB2nSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <!-- #### MB2: DT Superlayer Z internal --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="0.*mm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZLayer_57Cells"/> + <Translation x="0*fm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZLayer_58Cells"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZLayer_57Cells"/> + <Translation x="0*fm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZLayer_56Cells"/> + <Translation x="0*fm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZClosingPlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZClosingPlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZClosingPlatePerp"/> + <Translation x="0.*fm" y="[mb2:MB2SLZPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb2:MB2SLZPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb2:MB2SLZPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZCommonElectronics"/> + <Translation x="0.*fm" y="[mb2:MB2SLZPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SuperLayerZ"/> + <rChild name="mb2:MB2SLZCommonElectronics"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2SLZLayer_56Cells"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="N" value="56"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mb2:MB2SLZGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL56]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2SLZLayer_57Cells"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="57"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mb2:MB2SLZGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL57]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2SLZLayer_58Cells"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="58"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mb2:MB2SLZGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL58]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SLZLayer_56Cells"/> + <rChild name="mb2:MB2SLZElectronics_56Cells"/> + <Translation x="0.*fm" y="[MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SLZLayer_56Cells"/> + <rChild name="mb2:MB2SLZElectronics_56Cells"/> + <Translation x="0.*fm" y="-([MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SLZLayer_57Cells"/> + <rChild name="mb2:MB2SLZElectronics_57Cells"/> + <Translation x="0.*fm" y="[MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SLZLayer_57Cells"/> + <rChild name="mb2:MB2SLZElectronics_57Cells"/> + <Translation x="0.*fm" y="-([MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2SLZLayer_58Cells"/> + <rChild name="mb2:MB2SLZElectronics_58Cells"/> + <Translation x="0.*fm" y="[MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2SLZLayer_58Cells"/> + <rChild name="mb2:MB2SLZElectronics_58Cells"/> + <Translation x="0.*fm" y="-([MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- ##### MB2: DT honeycomb --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2P32P"/> + <rChild name="mb2:MB2HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2P23P"/> + <rChild name="mb2:MB2HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N32P"/> + <rChild name="mb2:MB2HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N32N"/> + <rChild name="mb2:MB2HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N23N"/> + <rChild name="mb2:MB2HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Honeycomb"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2HcPlate"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBHC_height]-0.75*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2HcPlate"/> + <Translation x="0*fm" y="0*fm" z="-([mbCommon:MBHC_height]-0.75*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_LateralC"/> + <Translation x="[mb2:MB2HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_LateralC"/> + <Translation x="[mb2:MB2HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_LateralC"/> + <Translation x="-([mb2:MB2HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_LateralC"/> + <Translation x="-([mb2:MB2HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension]" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension]" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension])" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension])" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_LateralElectronics"/> + <Translation x="[mb2:MB2HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width]" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_LateralElectronics"/> + <Translation x="-([mb2:MB2HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width])" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontElectronics"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width]" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontElectronics"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width])" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2HoneycombBox"/> + <rChild name="mb2:MB2HcTorsionBar"/> + <Translation x="[mb2:MB2HC_x]-25.*mm" y="0*fm" z="0*fm"/> + </PosPart> + <!-- ##### MB2: RPC chambers --> + <!-- ##### MB2/3: RPC_IP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2P32P"/> + <rChild name="mb2:MB23RPC_IP"/> + <Translation x="-[mb2:MB2RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_IP"/> + <rChild name="mb2:MB23RPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb2:MB2RPC_IGasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_IP"/> + <rChild name="mb2:MB23RPC_IGasMiddle"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb2:MB2RPC_IGasMiddle_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_IP"/> + <rChild name="mb2:MB23RPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mb2:MB2RPC_IGasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2/3: RPC_OP chamber --> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2P23P"/> + <rChild name="mb2:MB23RPC_OP"/> + <Translation x="-[mb2:MB2RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_OP"/> + <rChild name="mb2:MB23RPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mb2:MB2RPC_IGasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_OP"/> + <rChild name="mb2:MB23RPC_OGasMiddle"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mb2:MB2RPC_IGasMiddle_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_OP"/> + <rChild name="mb2:MB23RPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mb2:MB2RPC_IGasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2/3: RPC_IN chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N32P"/> + <rChild name="mb2:MB23RPC_IN"/> + <Translation x="[mb2:MB2RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N32N"/> + <rChild name="mb2:MB23RPC_IN"/> + <Translation x="[mb2:MB2RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_IN"/> + <rChild name="mb2:MB23RPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb2:MB2RPC_IGasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_IN"/> + <rChild name="mb2:MB23RPC_IGasMiddle"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb2:MB2RPC_IGasMiddle_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_IN"/> + <rChild name="mb2:MB23RPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mb2:MB2RPC_IGasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2/2: RPC_IP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2P23P"/> + <rChild name="mb2:MB22RPC_IP"/> + <Translation x="-[mb2:MB2RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB22RPC_IP"/> + <rChild name="mb2:MB22RPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB22RPC_IP"/> + <rChild name="mb2:MB22RPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2/2: RPC_OP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2P32P"/> + <rChild name="mb2:MB22RPC_OP"/> + <Translation x="-[mb2:MB2RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB22RPC_OP"/> + <rChild name="mb2:MB22RPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB22RPC_OP"/> + <rChild name="mb2:MB22RPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2/2: RPC_IN chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N23N"/> + <rChild name="mb2:MB22RPC_IN"/> + <Translation x="[mb2:MB2RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB22RPC_IN"/> + <rChild name="mb2:MB22RPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB22RPC_IN"/> + <rChild name="mb2:MB22RPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2/3: RPC_ON chamber --> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2N23N"/> + <rChild name="mb2:MB23RPC_ON"/> + <Translation x="[mb2:MB2RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_ON"/> + <rChild name="mb2:MB23RPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mb2:MB2RPC_IGasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_ON"/> + <rChild name="mb2:MB23RPC_OGasMiddle"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mb2:MB2RPC_IGasMiddle_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB23RPC_ON"/> + <rChild name="mb2:MB23RPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mb2:MB2RPC_IGasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2/2: RPC_ON chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N32P"/> + <rChild name="mb2:MB22RPC_ON"/> + <Translation x="[mb2:MB2RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2N32N"/> + <rChild name="mb2:MB22RPC_ON"/> + <Translation x="[mb2:MB2RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB22RPC_ON"/> + <rChild name="mb2:MB22RPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB22RPC_ON"/> + <rChild name="mb2:MB22RPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2: RPC_ON chamber --> + <!-- #### MB2Chimney Unit --> + <!-- #### MB2Chim: DTBX chamber --> + <!-- #### MB2: DT Superlayers Phi --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimP"/> + <rChild name="mb2:MB2ChimSuperLayerPhi"/> + <Translation x="[mb2:MB2pSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimP"/> + <rChild name="mb2:MB2ChimSuperLayerPhi"/> + <Translation x="[mb2:MB2pSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimN"/> + <rChild name="mb2:MB2ChimSuperLayerPhi"/> + <Translation x="[mb2:MB2nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimN"/> + <rChild name="mb2:MB2ChimSuperLayerPhi"/> + <Translation x="[mb2:MB2nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]"/> + </PosPart> + <!-- ## MB2: DT Superlayers Phi internal --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiLayer_59Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiLayer_60Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiLayer_60Cells"/> + <Translation x="10.5*mm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiLayer_59Cells_startCell2"/> + <Translation x="10.5*mm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiClosingPlateParal"/> + <Translation x="[mb2:MB2SLPhiPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhiClosingPlateParal"/> + <Translation x="-([mb2:MB2SLPhiPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhi_C_PlateParal"/> + <Translation x="[mb2:MB2SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhi_C_PlateParal"/> + <Translation x="[mb2:MB2SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhi_C_PlateParal"/> + <Translation x="-([mb2:MB2SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2ChimSLPhi_C_PlateParal"/> + <Translation x="-([mb2:MB2SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerPhi"/> + <rChild name="mb2:MB2SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2ChimSLPhiLayer_59Cells"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="59"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb2:MB2SLPhiL59]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2ChimSLPhiLayer_59Cells_startCell2"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="N" value="59"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb2:MB2SLPhiL59]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2ChimSLPhiLayer_60Cells"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="60"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb2:MB2SLPhiL60]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSLPhiLayer_59Cells"/> + <rChild name="mb2:MB2SLPhiElectronics_59Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSLPhiLayer_59Cells"/> + <rChild name="mb2:MB2SLPhiElectronics_59Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSLPhiLayer_59Cells_startCell2"/> + <rChild name="mb2:MB2SLPhiElectronics_59Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSLPhiLayer_59Cells_startCell2"/> + <rChild name="mb2:MB2SLPhiElectronics_59Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSLPhiLayer_60Cells"/> + <rChild name="mb2:MB2SLPhiElectronics_60Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSLPhiLayer_60Cells"/> + <rChild name="mb2:MB2SLPhiElectronics_60Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- #### MB2Chim: DT Superlayer Z --> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimP"/> + <rChild name="mb2:MB2ChimSuperLayerZ"/> + <Translation x="[mb2:MB2pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimN"/> + <rChild name="mb2:MB2ChimSuperLayerZ"/> + <Translation x="[mb2:MB2pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <!-- #### MB2Chim: DT Superlayer Z internal --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZLayer_47Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZLayer_48Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZLayer_48Cells"/> + <Translation x="10.5*mm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZLayer_47Cells_startCell2"/> + <Translation x="10.5*mm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2SLZClosingPlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2SLZClosingPlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZClosingPlatePerp"/> + <Translation x="0.*fm" y="[mb2:MB2SLZPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb2:MB2SLZPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb2:MB2SLZPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZCommonElectronics"/> + <Translation x="0.*fm" y="[mb2:MB2SLZPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSuperLayerZ"/> + <rChild name="mb2:MB2ChimSLZCommonElectronics"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2ChimSLZLayer_47Cells"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="47"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mb2:MB2SLZGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL47]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2ChimSLZLayer_47Cells_startCell2"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="N" value="47"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mb2:MB2SLZGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL47]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb2:MB2ChimSLZLayer_48Cells"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="48"/> + <Numeric name="IncrCopyNo" value="1"/> + <String name="ChildName" value="mb2:MB2SLZGas"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL48]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSLZLayer_47Cells"/> + <rChild name="mb2:MB2ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="[mb2:MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSLZLayer_47Cells"/> + <rChild name="mb2:MB2ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSLZLayer_47Cells_startCell2"/> + <rChild name="mb2:MB2ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="[mb2:MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSLZLayer_47Cells_startCell2"/> + <rChild name="mb2:MB2ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimSLZLayer_48Cells"/> + <rChild name="mb2:MB2ChimSLZElectronics_48Cells"/> + <Translation x="0.*fm" y="[mb2:MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimSLZLayer_48Cells"/> + <rChild name="mb2:MB2ChimSLZElectronics_48Cells"/> + <Translation x="0.*fm" y="-([mb2:MB2SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- ##### MB2Chim: DT honeycomb --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimP"/> + <rChild name="mb2:MB2ChimHoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimN"/> + <rChild name="mb2:MB2ChimHoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHoneycomb"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHcPlate"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBHC_height]-0.75*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHcPlate"/> + <Translation x="0*fm" y="0*fm" z="-([mbCommon:MBHC_height]-0.75*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHc_LateralC"/> + <Translation x="[mb2:MB2HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHc_LateralC"/> + <Translation x="[mb2:MB2HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHc_LateralC"/> + <Translation x="-([mb2:MB2HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHc_LateralC"/> + <Translation x="-([mb2:MB2HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension]" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension]" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension])" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension])" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHc_LateralElectronics"/> + <Translation x="[mb2:MB2HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width]" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2ChimHc_LateralElectronics"/> + <Translation x="-([mb2:MB2HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width])" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontElectronics"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width]" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2Hc_FrontElectronics"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width])" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimHoneycombBox"/> + <rChild name="mb2:MB2HcTorsionBar"/> + <Translation x="[mb2:MB2HC_x]-25.*mm" y="0*fm" z="0*fm"/> + </PosPart> + <!-- ##### MB2Chim: RPC chambers --> + <!-- ##### MB2Chim: RPC_IP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimP"/> + <rChild name="mb2:MB2ChimRPC_IP"/> + <Translation x="-[mb2:MB2RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_IP"/> + <rChild name="mb2:MB2ChimRPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb2:MB2ChimRPC_IGasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_IP"/> + <rChild name="mb2:MB2ChimRPC_IGasMiddle"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb2:MB2ChimRPC_IGasMiddle_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_IP"/> + <rChild name="mb2:MB2ChimRPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mb2:MB2ChimRPC_IGasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2Chim: RPC_OP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimP"/> + <rChild name="mb2:MB2ChimRPC_OP"/> + <Translation x="-[mb2:MB2RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_OP"/> + <rChild name="mb2:MB2ChimRPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mb2:MB2ChimRPC_OGasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_OP"/> + <rChild name="mb2:MB2ChimRPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mb2:MB2ChimRPC_OGasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2Chim: RPC_IN chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimN"/> + <rChild name="mb2:MB2ChimRPC_IN"/> + <Translation x="[mb2:MB2RPC_I_x_pos]" y="0*fm" z="[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_IN"/> + <rChild name="mb2:MB2ChimRPC_IGasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb2:MB2ChimRPC_IGasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_IN"/> + <rChild name="mb2:MB2ChimRPC_IGasMiddle"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="-[mb2:MB2ChimRPC_IGasMiddle_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_IN"/> + <rChild name="mb2:MB2ChimRPC_IGasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="0*cm" y="[mb2:MB2ChimRPC_IGasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB2Chim: RPC_ON chamber --> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimN"/> + <rChild name="mb2:MB2ChimRPC_ON"/> + <Translation x="[mb2:MB2RPC_O_x_pos]" y="0*fm" z="-[mbCommon:MBRPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_ON"/> + <rChild name="mb2:MB2ChimRPC_OGasLeft"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="-[mb2:MB2ChimRPC_OGasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb2:MB2ChimRPC_ON"/> + <rChild name="mb2:MB2ChimRPC_OGasRight"/> + <rRotation name="rotations:RPCD"/> + <Translation x="0*cm" y="[mb2:MB2ChimRPC_OGasRight_y_pos]" z="0*cm"/> + </PosPart> + </PosPartSection> +</DDDefinition> diff --git a/Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml b/Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml new file mode 100644 index 0000000000000..c572471257b03 --- /dev/null +++ b/Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml @@ -0,0 +1,1738 @@ +<?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="mb3.xml" eval="true"> + <!--- #### MB3: Positions --> + <!--%% Radial coordinates fo algos--> + <Constant name="MB3UnitRadius" value="6182.6939277*mm"/> + <Constant name="MB3PosAngle" value="2.046615755*deg"/> + <!--- #### MB3: Constants for DT superlayer Phi --> + <Constant name="MB3SLPhiPl_x" value="3066./2*mm"/> + <Constant name="MB3SLPhiL71" value="[mbCommon:MBCell_width]*71+[mbCommon:MBIbeamWall]"/> + <Constant name="MB3SLPhiL72" value="[mbCommon:MBCell_width]*72+[mbCommon:MBIbeamWall]"/> + <!--- #### MB3: Constants for DT superlayer Z (although they are placed with a rotation that interchanges X and Z, the _x refers to the coordinate X in EDMS, that is the Z in its final position; similar for _z --> + <Constant name="MB3SLZWire_length" value="3021./2.*mm"/> + <!--%% Wire length from EDMS: THIS NUMBER DEFINE THE SL DIMENSIONS--> + <Constant name="MB3SLZBareWire_length" value="[MB3SLZWire_length]-15.5*mm"/> + <!--%% Bare Wire _length == wire_lenght - depth in tappini--> + <Constant name="MB3SLZLayer_length" value="[MB3SLZBareWire_length]+2*[mbCommon:MBLayerElectronics_width]"/> + <!--%% The z length of the Al layer volume--> + <Constant name="MB3SLZPlI_z" value="[MB3SLZLayer_length]+6.5*mm"/> + <!--%% Distance between tappini and Al Plate edge--> + <Constant name="MB3SLZPlO_z" value="[MB3SLZPlI_z]+38.*mm"/> + <!--- #### MB3: X dimensions --> + <Constant name="MB3_x" value="1579.6*mm"/> + <Constant name="MB3HC_x" value="3037./2*mm"/> + <!--- #### MB3: Constants for DT positioning: distance from SL center to HC center --> + <Constant name="MB3pSLPhi1_HC_dist" value="15.*mm"/> + <Constant name="MB3pSLPhi2_HC_dist" value="15.*mm"/> + <Constant name="MB3pSLZ_HC_dist" value="-3*mm"/> + <Constant name="MB3nSLPhi1_HC_dist" value="-15.*mm"/> + <Constant name="MB3nSLPhi2_HC_dist" value="-15.*mm"/> + <Constant name="MB3nSLZ_HC_dist" value="3*mm"/> + <!--- #### MB3: Constants for RPCs --> + <Constant name="MB3RPC_EngineerXPos" value="5994.*mm"/> + <Constant name="MB3RPC_EngineerYPos" value="184.*mm"/> + <Constant name="MB3RPC_x" value="3000./2*mm"/> + <Constant name="MB3RPC_Gas_x" value="1480./2*mm"/> + <Constant name="MB3RPC_Gas_x_pos" value="75*cm"/> + <Constant name="MB3RPC_x_pos" value="[mb3:MB3UnitRadius]*sin([mb3:MB3PosAngle])-[mb3:MB3RPC_EngineerYPos]"/> + <!--- 36.80 mm --> + <Constant name="MB3RPC_z_pos" value="[mb3:MB3UnitRadius]*cos([mb3:MB3PosAngle])-([mb3:MB3RPC_EngineerXPos]+[mbCommon:MBRPC_EngineerChamberWidth])"/> + <!--- 157.25*mm --> + <Constant name="MB3Height_With1RPC" value="326./2.*mm+0.25*mm"/> + <!--- #### MB3Chim: Constants for DT RPCs --> + <Constant name="MB3ChimRPC_GasRight_y_pos" value="[mbCommon:MBRPC_GasRight_y_pos]-([mbCommon:MBRPC_z]-[mbCommon:MBChimRPC_z])/2.-4.*mm"/> + <Constant name="MB3ChimRPC_GasLeft_y_pos" value="[mbCommon:MBRPC_GasLeft_y_pos]-([mbCommon:MBRPC_z]-[mbCommon:MBChimRPC_z])/2.-4.*mm"/> + </ConstantsSection> + <SolidSection label="mb3.xml"> + <!-- #### MB3 Unit: fake volume representing one DTBX + 1 or 2 RPC --> + <!-- #### MB3: DTBX chamber --> + <!--%% In MB3 the widest superlayer in x is the Z one --> + <Box name="MB3_a" dx="[MB3_x]" dy="[mbCommon:MBSLPhiPlO_z]+12.*mm" dz="[MB3Height_With1RPC]+0.25*mm"/> + <Box name="MB3_OLAP1" dx="28.*mm" dy="[mbCommon:MBSLPhiPlO_z]+13.*mm" dz="18.75*mm"/> + <Box name="MB3_OLAP2" dx="25.75*mm" dy="[mbCommon:MBSLPhiPlO_z]+13.*mm" dz="44.75*mm"/> + <SubtractionSolid name="MB3P_b"> + <rSolid name="MB3_a"/> + <rSolid name="MB3_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB3_x]+27.6*mm" y="0.*fm" z="-[MB3Height_With1RPC]+18.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB3P"> + <rSolid name="MB3P_b"/> + <rSolid name="MB3_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB3_x]+25.26*mm" y="0.*fm" z="[MB3Height_With1RPC]-44.25*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB3N_b"> + <rSolid name="MB3_a"/> + <rSolid name="MB3_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB3_x]-27.6*mm" y="0.*fm" z="-[MB3Height_With1RPC]+18.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB3N"> + <rSolid name="MB3N_b"/> + <rSolid name="MB3_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB3_x]-25.26*mm" y="0.*fm" z="[MB3Height_With1RPC]-44.25*mm"/> + </SubtractionSolid> + <!-- #### MB3: Superlayers Phi --> + <!--%% SuperLayer X,Z dimensions cover the outer Al plate + 2 mm for the closing profiles. Y is 5 Al plates + 4 Layer's --> + <Box name="MB3SuperLayerPhi" dx="[mb3:MB3SLPhiPl_x]+2.7*mm" dy="[mbCommon:MBSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% MB3SLPhiClosingPlateParal is parallel to gas cells, MB3SLPhiClosingPlatePerp is perpendicular --> + <!--%% Parallel are 2 mm thick and as long as outer Plates --> + <Box name="MB3SLPhiClosingPlateParal" dx="1.*mm" dy="[mbCommon:MBSLPhiPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB3SLPhi_C_PlateParal" dx="7.*mm" dy="[mbCommon:MBSLPhiPlO_z]-14.*mm" dz="1.*mm"/> + <!--%% Perpendicular are 12 mm thick and higher by 20 mm per side than the SL; 2.7 mm are added to reach the parallel "Cs" --> + <Box name="MB3SLPhiClosingPlatePerp" dx="[mb3:MB3SLPhiPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB3SLPhi_C_PlatePerp" dx="[mb3:MB3SLPhiPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <!--%% MB3SLPhiAlPlateOuter is 0.7 mm wider (perpendicular to the wires) to reach the parallel "Cs"--> + <Box name="MB3SLPhiAlPlateOuter" dx="[mb3:MB3SLPhiPl_x]+0.7*mm" dy="[mbCommon:MBSLPhiPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!--%% MB3SLPhiAlPlateOuter does not reach the parallel "Cs"--> + <Box name="MB3SLPhiAlPlateInner" dx="[mb3:MB3SLPhiPl_x]" dy="[mbCommon:MBSLPhiPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!--%% Fake layer volume contains the ibeams plus gas volumes: n+1 Ibeam's and n gas volumes. + (Ibeam wall width is ~1.35mm, but 0.1 is mylar, that is very light, so it set to 1.3) + It is first made of aluminium and them it is filled with the n gas volumes. + Z length is the bare wire length plus the electronics (==tappini)--> + <Box name="MB3SLPhiLayer_71Cells" dx="[MB3SLPhiL71]" dy="[mbCommon:MBSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLPhiLayer_71Cells_startCell2" dx="[MB3SLPhiL71]" dy="[mbCommon:MBSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLPhiLayer_72Cells" dx="[MB3SLPhiL72]" dy="[mbCommon:MBSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <!--%% Tappini, Perpendicular to the Ibeams and at the two ends --> + <Box name="MB3SLPhiElectronics_71Cells" dx="[mb3:MB3SLPhiL71]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLPhiElectronics_72Cells" dx="[mb3:MB3SLPhiL72]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLPhiCommonElectronics" dx="[mb3:MB3SLPhiPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!-- #### MB3: Superlayer Z --> + <Box name="MB3SuperLayerZ" dx="[mbCommon:MBSLZPl_x]+2.7*mm" dy="[mb3:MB3SLZPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB3SLZClosingPlateParal" dx="1.*mm" dy="[mb3:MB3SLZPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB3SLZ_C_PlateParal" dx="7.*mm" dy="[mb3:MB3SLZPlO_z]-14.*mm" dz="1.*mm"/> + <Box name="MB3SLZClosingPlatePerp" dx="[mbCommon:MBSLZPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB3SLZ_C_PlatePerp" dx="[mbCommon:MBSLZPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <Box name="MB3SLZAlPlateOuter" dx="[mbCommon:MBSLZPl_x]+0.7*mm" dy="[mb3:MB3SLZPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB3SLZAlPlateInner" dx="[mbCommon:MBSLZPl_x]" dy="[mb3:MB3SLZPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB3SLZLayer_56Cells" dx="[mbCommon:MBSLZL56]" dy="[mb3:MB3SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLZLayer_57Cells" dx="[mbCommon:MBSLZL57]" dy="[mb3:MB3SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLZLayer_58Cells" dx="[mbCommon:MBSLZL58]" dy="[mb3:MB3SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLZElectronics_56Cells" dx="[mbCommon:MBSLZL56]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLZElectronics_57Cells" dx="[mbCommon:MBSLZL57]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLZElectronics_58Cells" dx="[mbCommon:MBSLZL58]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLZCommonElectronics" dx="[mbCommon:MBSLZPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!--%% Effective gas volume --> + <Box name="MB3SLZGas_aa" dx="20.35*mm-2*3.175*mm" dy="[MB3SLZBareWire_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3SLZGas_bb" dx="20.35*mm" dy="[MB3SLZBareWire_length]" dz="[mbCommon:MBGas_height]-2*0.65*mm"/> + <!--%% Horizontal bars to make the 'I' shape (without them it would be a '|') --> + <Box name="MB3SLZIBeamWing" dx="3.175*mm" dy="[MB3SLZBareWire_length]" dz="0.65*mm"/> + <UnionSolid name="MB3SLZGas"> + <rSolid name="MB3SLZGas_aa"/> + <rSolid name="MB3SLZGas_bb"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*fm" y="0.*fm" z="0.*fm"/> + </UnionSolid> + <!-- #### MB3: Honeycomb --> + <Box name="MB3HoneycombBox" dx="[mb3:MB3HC_x]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHC_height]"/> + <Box name="MB3Honeycomb" dx="[mb3:MB3HC_x]-125.*mm" dy="[mbCommon:MBHC_z]-125.*mm" dz="[mbCommon:MBHC_height]-2*[mbCommon:MBAlPlate_height]"/> + <Box name="MB3HcPlate" dx="[mb3:MB3HC_x]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB3Hc_LateralC" dx="[mbCommon:MBHC_C_dimension]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB3Hc_FrontC" dx="[mb3:MB3HC_x]-125.*mm" dy="[mbCommon:MBHC_C_dimension]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB3Hc_LateralElectronics" dx="[mbCommon:MBHCLatElectronics_width]" dy="[mbCommon:MBHC_z]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB3Hc_FrontElectronics" dx="[mb3:MB3HC_x]-125.*mm" dy="[mbCommon:MBHCFrontElectronics_width]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB3HcTorsionBar" dx="25*mm" dy="678*mm" dz="50.*mm"/> + <!-- #### MB3: RPC chambers --> + <Box name="MB3RPC" dx="[mb3:MB3RPC_x]" dy="[mbCommon:MBRPC_z]" dz="[mbCommon:MBRPC_y]"/> + <Box name="MB3RPC_GasLeft" dx="[mb3:MB3RPC_Gas_x]" dy="[mbCommon:MBRPC_GasLeft_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB3RPC_GasRight" dx="[mb3:MB3RPC_Gas_x]" dy="[mbCommon:MBRPC_GasRight_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <!-- #### MB3Chimney Unit --> + <!-- #### MB3Chim: DTBX chamber --> + <Box name="MB3Chim_a" dx="[MB3_x]" dy="[mbCommon:MBChimSLPhiPlO_z]+12.*mm" dz="[MB3Height_With1RPC]"/> + <SubtractionSolid name="MB3ChimP_b"> + <rSolid name="MB3Chim_a"/> + <rSolid name="MB3_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB3_x]+27.6*mm" y="0.*fm" z="-[MB3Height_With1RPC]+18.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB3ChimP"> + <rSolid name="MB3ChimP_b"/> + <rSolid name="MB3_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="-[MB3_x]+25.26*mm" y="0.*fm" z="[MB3Height_With1RPC]-44.25*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB3ChimN_b"> + <rSolid name="MB3Chim_a"/> + <rSolid name="MB3_OLAP1"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB3_x]-27.6*mm" y="0.*fm" z="-[MB3Height_With1RPC]+18.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="MB3ChimN"> + <rSolid name="MB3ChimN_b"/> + <rSolid name="MB3_OLAP2"/> + <rRotation name="rotations:000D"/> + <Translation x="[MB3_x]-25.26*mm" y="0.*fm" z="[MB3Height_With1RPC]-44.25*mm"/> + </SubtractionSolid> + <!-- #### MB3Chim: DT Superlayers Phi --> + <Box name="MB3ChimSuperLayerPhi" dx="[mb3:MB3SLPhiPl_x]+2.7*mm" dy="[mbCommon:MBChimSLPhiPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% Only extra parallel "Cs" are needed --> + <Box name="MB3ChimSLPhiClosingPlateParal" dx="1.*mm" dy="[mbCommon:MBChimSLPhiPlO_z]" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB3ChimSLPhi_C_PlateParal" dx="7.*mm" dy="[mbCommon:MBChimSLPhiPlO_z]-14.*mm" dz="1.*mm"/> + <Box name="MB3ChimSLPhiAlPlateOuter" dx="[mb3:MB3SLPhiPl_x]+0.7*mm" dy="[mbCommon:MBChimSLPhiPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB3ChimSLPhiAlPlateInner" dx="[mb3:MB3SLPhiPl_x]" dy="[mbCommon:MBChimSLPhiPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB3ChimSLPhiLayer_71Cells" dx="[mb3:MB3SLPhiL71]" dy="[mbCommon:MBChimSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3ChimSLPhiLayer_71Cells_startCell2" dx="[mb3:MB3SLPhiL71]" dy="[mbCommon:MBChimSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3ChimSLPhiLayer_72Cells" dx="[mb3:MB3SLPhiL72]" dy="[mbCommon:MBChimSLPhiLayer_length]" dz="[mbCommon:MBGas_height]"/> + <!-- #### MB3Chim: DT Superlayer Z --> + <Box name="MB3ChimSuperLayerZ" dx="[mbCommon:MBChimSLZPl_x]+2.7*mm" dy="[mb3:MB3SLZPlO_z]+12.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <!--%% Only extra perperdicular "Cs" are needed --> + <Box name="MB3ChimSLZClosingPlatePerp" dx="[mbCommon:MBChimSLZPl_x]+2.7*mm" dy="12./2.*mm" dz="[mbCommon:MBSuperLayer_height]"/> + <Box name="MB3ChimSLZ_C_PlatePerp" dx="[mbCommon:MBChimSLZPl_x]+0.7*mm" dy="7.*mm" dz="1.*mm"/> + <Box name="MB3ChimSLZAlPlateOuter" dx="[mbCommon:MBChimSLZPl_x]+0.7*mm" dy="[mb3:MB3SLZPlO_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB3ChimSLZAlPlateInner" dx="[mbCommon:MBChimSLZPl_x]" dy="[mb3:MB3SLZPlI_z]" dz="[mbCommon:MBAlPlate_height]"/> + <Box name="MB3ChimSLZLayer_47Cells" dx="[mbCommon:MBChimSLZL47]" dy="[mb3:MB3SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3ChimSLZLayer_48Cells" dx="[mbCommon:MBChimSLZL48]" dy="[mb3:MB3SLZLayer_length]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3ChimSLZElectronics_47Cells" dx="[mbCommon:MBChimSLZL47]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3ChimSLZElectronics_48Cells" dx="[mbCommon:MBChimSLZL48]" dy="[mbCommon:MBLayerElectronics_width]" dz="[mbCommon:MBGas_height]"/> + <Box name="MB3ChimSLZCommonElectronics" dx="[mbCommon:MBChimSLZPl_x]" dy="35./2.*mm" dz="[mbCommon:MBSuperLayer_height]-10.*mm"/> + <!-- #### MB3Chim: DT Honeycomb --> + <Box name="MB3ChimHoneycombBox" dx="[mb3:MB3HC_x]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHC_height]"/> + <Box name="MB3ChimHoneycomb" dx="[mb3:MB3HC_x]-125.*mm" dy="[mbCommon:MBChimHC_z]-125.*mm" dz="[mbCommon:MBHC_height]-2*[mbCommon:MBAlPlate_height]"/> + <Box name="MB3ChimHc_LateralC" dx="[mbCommon:MBHC_C_dimension]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHC_C_width]"/> + <Box name="MB3ChimHc_LateralElectronics" dx="[mbCommon:MBHCLatElectronics_width]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBHCElectronics_height]"/> + <Box name="MB3ChimHcPlate" dx="[mb3:MB3HC_x]" dy="[mbCommon:MBChimHC_z]" dz="[mbCommon:MBAlPlate_height]"/> + <!-- #### MB3Chim: RPC chambers --> + <Box name="MB3ChimRPC" dx="[mb3:MB3RPC_x]" dy="[mbCommon:MBChimRPC_z]" dz="[mbCommon:MBRPC_y]"/> + <Box name="MB3ChimRPC_GasLeft" dx="[mb3:MB3RPC_Gas_x]" dy="[mbCommon:MBChimRPC_OGasLeft_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + <Box name="MB3ChimRPC_GasRight" dx="[mb3:MB3RPC_Gas_x]" dy="[mbCommon:MBChimRPC_OGasRight_z]" dz="[mbCommon:MBRPC_Gas_y]"/> + </SolidSection> + <LogicalPartSection label="mb3.xml"> + <!-- #### MB3 Unit --> + <!-- #### MB3: DTBX --> + <LogicalPart name="MB3P" category="unspecified"> + <rSolid name="MB3P"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB3N" category="unspecified"> + <rSolid name="MB3N"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <!-- #### MB3: DT Superlayers Phi --> + <LogicalPart name="MB3SuperLayerPhi" category="unspecified"> + <rSolid name="MB3SuperLayerPhi"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiClosingPlateParal" category="unspecified"> + <rSolid name="MB3SLPhiClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhi_C_PlateParal" category="unspecified"> + <rSolid name="MB3SLPhi_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiClosingPlatePerp" category="unspecified"> + <rSolid name="MB3SLPhiClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhi_C_PlatePerp" category="unspecified"> + <rSolid name="MB3SLPhi_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiAlPlateOuter" category="unspecified"> + <rSolid name="MB3SLPhiAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiAlPlateInner" category="unspecified"> + <rSolid name="MB3SLPhiAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiLayer_71Cells" category="unspecified"> + <rSolid name="MB3SLPhiLayer_71Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiLayer_71Cells_startCell2" category="unspecified"> + <rSolid name="MB3SLPhiLayer_71Cells_startCell2"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiLayer_72Cells" category="unspecified"> + <rSolid name="MB3SLPhiLayer_72Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiElectronics_71Cells" category="unspecified"> + <rSolid name="MB3SLPhiElectronics_71Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiElectronics_72Cells" category="unspecified"> + <rSolid name="MB3SLPhiElectronics_72Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3SLPhiCommonElectronics" category="unspecified"> + <rSolid name="MB3SLPhiCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB3: DT Superlayer Z --> + <LogicalPart name="MB3SuperLayerZ" category="unspecified"> + <rSolid name="MB3SuperLayerZ"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB3SLZClosingPlateParal" category="unspecified"> + <rSolid name="MB3SLZClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZClosingPlatePerp" category="unspecified"> + <rSolid name="MB3SLZClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZ_C_PlateParal" category="unspecified"> + <rSolid name="MB3SLZ_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZ_C_PlatePerp" category="unspecified"> + <rSolid name="MB3SLZ_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZAlPlateOuter" category="unspecified"> + <rSolid name="MB3SLZAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZAlPlateInner" category="unspecified"> + <rSolid name="MB3SLZAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZLayer_56Cells" category="unspecified"> + <rSolid name="MB3SLZLayer_56Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZLayer_57Cells" category="unspecified"> + <rSolid name="MB3SLZLayer_57Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZLayer_58Cells" category="unspecified"> + <rSolid name="MB3SLZLayer_58Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZIBeamWing" category="unspecified"> + <rSolid name="MB3SLZIBeamWing"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3SLZGas" category="unspecified"> + <rSolid name="MB3SLZGas"/> + <rMaterial name="materials:M_DTBX Gas"/> + </LogicalPart> + <LogicalPart name="MB3SLZElectronics_56Cells" category="unspecified"> + <rSolid name="MB3SLZElectronics_56Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3SLZElectronics_57Cells" category="unspecified"> + <rSolid name="MB3SLZElectronics_57Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3SLZElectronics_58Cells" category="unspecified"> + <rSolid name="MB3SLZElectronics_58Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3SLZCommonElectronics" category="unspecified"> + <rSolid name="MB3SLZCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB3: DT Honeycomb --> + <LogicalPart name="MB3HoneycombBox" category="unspecified"> + <rSolid name="MB3HoneycombBox"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB3Honeycomb" category="unspecified"> + <rSolid name="MB3Honeycomb"/> + <rMaterial name="materials:M_honeycomb"/> + </LogicalPart> + <LogicalPart name="MB3HcPlate" category="unspecified"> + <rSolid name="MB3HcPlate"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3Hc_LateralC" category="unspecified"> + <rSolid name="MB3Hc_LateralC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3Hc_FrontC" category="unspecified"> + <rSolid name="MB3Hc_FrontC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3Hc_LateralElectronics" category="unspecified"> + <rSolid name="MB3Hc_LateralElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3Hc_FrontElectronics" category="unspecified"> + <rSolid name="MB3Hc_FrontElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3HcTorsionBar" category="unspecified"> + <rSolid name="MB3HcTorsionBar"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <!-- #### MB3: RPC chambers --> + <LogicalPart name="MB3RPC_P" category="unspecified"> + <rSolid name="MB3RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB3RPC_N" category="unspecified"> + <rSolid name="MB3RPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB3RPC_GasLeft" category="unspecified"> + <rSolid name="MB3RPC_GasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB3RPC_GasRight" category="unspecified"> + <rSolid name="MB3RPC_GasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <!-- #### MB3Chimney Unit --> + <!-- #### MB3Chim: DTBX --> + <LogicalPart name="MB3ChimP" category="unspecified"> + <rSolid name="MB3ChimP"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MB3ChimN" category="unspecified"> + <rSolid name="MB3ChimN"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <!-- #### MB3Chim: DT Superlayers Phi --> + <LogicalPart name="MB3ChimSuperLayerPhi" category="unspecified"> + <rSolid name="MB3ChimSuperLayerPhi"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLPhiClosingPlateParal" category="unspecified"> + <rSolid name="MB3ChimSLPhiClosingPlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLPhi_C_PlateParal" category="unspecified"> + <rSolid name="MB3ChimSLPhi_C_PlateParal"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLPhiAlPlateOuter" category="unspecified"> + <rSolid name="MB3ChimSLPhiAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLPhiAlPlateInner" category="unspecified"> + <rSolid name="MB3ChimSLPhiAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLPhiLayer_71Cells" category="unspecified"> + <rSolid name="MB3ChimSLPhiLayer_71Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLPhiLayer_71Cells_startCell2" category="unspecified"> + <rSolid name="MB3ChimSLPhiLayer_71Cells_startCell2"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLPhiLayer_72Cells" category="unspecified"> + <rSolid name="MB3ChimSLPhiLayer_72Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <!-- #### MB3Chim: DT Superlayer Z --> + <LogicalPart name="MB3ChimSuperLayerZ" category="unspecified"> + <rSolid name="MB3ChimSuperLayerZ"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZClosingPlatePerp" category="unspecified"> + <rSolid name="MB3ChimSLZClosingPlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZ_C_PlatePerp" category="unspecified"> + <rSolid name="MB3ChimSLZ_C_PlatePerp"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZAlPlateOuter" category="unspecified"> + <rSolid name="MB3ChimSLZAlPlateOuter"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZAlPlateInner" category="unspecified"> + <rSolid name="MB3ChimSLZAlPlateInner"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZLayer_47Cells" category="unspecified"> + <rSolid name="MB3ChimSLZLayer_47Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZLayer_47Cells_startCell2" category="unspecified"> + <rSolid name="MB3ChimSLZLayer_47Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZLayer_48Cells" category="unspecified"> + <rSolid name="MB3ChimSLZLayer_48Cells"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZElectronics_47Cells" category="unspecified"> + <rSolid name="MB3ChimSLZElectronics_47Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZElectronics_48Cells" category="unspecified"> + <rSolid name="MB3ChimSLZElectronics_48Cells"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <LogicalPart name="MB3ChimSLZCommonElectronics" category="unspecified"> + <rSolid name="MB3ChimSLZCommonElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB3Chim: DT Honeycomb --> + <LogicalPart name="MB3ChimHoneycombBox" category="unspecified"> + <rSolid name="MB3ChimHoneycombBox"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="MB3ChimHoneycomb" category="unspecified"> + <rSolid name="MB3ChimHoneycomb"/> + <rMaterial name="materials:M_honeycomb"/> + </LogicalPart> + <LogicalPart name="MB3ChimHcPlate" category="unspecified"> + <rSolid name="MB3ChimHcPlate"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimHc_LateralC" category="unspecified"> + <rSolid name="MB3ChimHc_LateralC"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="MB3ChimHc_LateralElectronics" category="unspecified"> + <rSolid name="MB3ChimHc_LateralElectronics"/> + <rMaterial name="materials:M_Electronics averag"/> + </LogicalPart> + <!-- #### MB3Chim: RPC chambers --> + <LogicalPart name="MB3ChimRPC_P" category="unspecified"> + <rSolid name="MB3ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB3ChimRPC_N" category="unspecified"> + <rSolid name="MB3ChimRPC"/> + <rMaterial name="materials:M_RPC_Bakelite"/> + </LogicalPart> + <LogicalPart name="MB3ChimRPC_GasLeft" category="unspecified"> + <rSolid name="MB3ChimRPC_GasLeft"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + <LogicalPart name="MB3ChimRPC_GasRight" category="unspecified"> + <rSolid name="MB3ChimRPC_GasRight"/> + <rMaterial name="materials:M_RPC_Gas"/> + </LogicalPart> + </LogicalPartSection> + <PosPartSection label="mb3.xml"> + <!-- #### MB3 Unit --> + <!-- #### MB3: DTBX chamber --> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb3:MB3N"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB3UnitRadius]"/> + <Numeric name="StartAngle" value="[MB3PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB3PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb3:MB3P"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB3UnitRadius]"/> + <Numeric name="StartAngle" value="30.*deg+[MB3PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB3PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb3:MB3P"/> + <Numeric name="StartCopyNo" value="3"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB3UnitRadius]"/> + <Numeric name="StartAngle" value="60.*deg+[MB3PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB3PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="mb3:MB3N"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="4"/> + <Numeric name="N" value="3"/> + <Numeric name="Radius" value="[MB3UnitRadius]"/> + <Numeric name="StartAngle" value="90.*deg+[MB3PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB3PosAngle] </Vector> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb3:MB3P"/> + <rRotation name="rotations:RM1872"/> + <Translation x="[MB3UnitRadius]*cos([MB3PosAngle])" y="[MB3UnitRadius]*sin([MB3PosAngle])" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb3:MB3P"/> + <rRotation name="rotations:RM1882"/> + <Translation x="[MB3UnitRadius]*cos([MB3PosAngle]+30*deg)" y="[MB3UnitRadius]*sin([MB3PosAngle]+30*deg)" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb3:MB3P"/> + <rRotation name="rotations:RM1892"/> + <Translation x="[MB3UnitRadius]*cos([MB3PosAngle]+60*deg)" y="[MB3UnitRadius]*sin([MB3PosAngle]+60*deg)" z="-[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mb3:MB3ChimP"/> + <rRotation name="rotations:RM1902"/> + <Translation x="[MB3UnitRadius]*cos([MB3PosAngle]+90*deg)" y="[MB3UnitRadius]*sin([MB3PosAngle]+90*deg)" z="[mbCommon:MBChimPos_z]"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="mb3:MB3P"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="Radius" value="[MB3UnitRadius]"/> + <Numeric name="StartAngle" value="120.*deg+[MB3PosAngle]"/> + <Numeric name="RangeAngle" value="210.*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB3PosAngle] </Vector> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb3:MB3N"/> + <rRotation name="rotations:E127"/> + <Translation x="[MB3UnitRadius]*cos([MB3PosAngle])" y="[MB3UnitRadius]*sin([MB3PosAngle])" z="[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb3:MB3N"/> + <rRotation name="rotations:MM200"/> + <Translation x="[MB3UnitRadius]*cos([MB3PosAngle]+30.*deg)" y="[MB3UnitRadius]*sin([MB3PosAngle]+30.*deg)" z="[mbCommon:MBPos_z]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mb3:MB3ChimN"/> + <rRotation name="rotations:MM300"/> + <Translation x="[MB3UnitRadius]*cos([MB3PosAngle]+60.*deg)" y="[MB3UnitRadius]*sin([MB3PosAngle]+60.*deg)" z="-[mbCommon:MBChimPos_z]"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="mb3:MB3N"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="Radius" value="[MB3UnitRadius]"/> + <Numeric name="StartAngle" value="90.*deg+[MB3PosAngle]"/> + <Numeric name="RangeAngle" value="240.*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB3PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="mb3:MB3P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="[MB3UnitRadius]"/> + <Numeric name="StartAngle" value="[MB3PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -[mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="6"> 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB3PosAngle] </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="mb3:MB3N"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="[MB3UnitRadius]"/> + <Numeric name="StartAngle" value="[MB3PosAngle]"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, [mbCommon:MBPos_z] </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="9"> 0.*deg, 0.*deg, 180*deg, 90.*deg, 0.*deg, 90.*deg, 0.*deg, 0.*deg, 270.*deg-[MB3PosAngle] </Vector> + </Algorithm> + <!-- #### MB3: DT Superlayers Phi --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3P"/> + <rChild name="mb3:MB3SuperLayerPhi"/> + <Translation x="[mb3:MB3pSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3P"/> + <rChild name="mb3:MB3SuperLayerPhi"/> + <Translation x="[mb3:MB3pSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3N"/> + <rChild name="mb3:MB3SuperLayerPhi"/> + <Translation x="[mb3:MB3nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3N"/> + <rChild name="mb3:MB3SuperLayerPhi"/> + <Translation x="[mb3:MB3nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <!-- ## MB3: DT Superlayers Phi internal --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiLayer_71Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiLayer_72Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiLayer_72Cells"/> + <Translation x="10.5*mm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiLayer_71Cells_startCell2"/> + <Translation x="10.5*mm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiClosingPlateParal"/> + <Translation x="[mb3:MB3SLPhiPl_x]+1.7*mm" y="0.*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiClosingPlateParal"/> + <Translation x="-([mb3:MB3SLPhiPl_x]+1.7*mm)" y="0.*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlateParal"/> + <Translation x="[mb3:MB3SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlateParal"/> + <Translation x="[mb3:MB3SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlateParal"/> + <Translation x="-([mb3:MB3SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlateParal"/> + <Translation x="-([mb3:MB3SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3SLPhiLayer_71Cells"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="71"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb3:MB3SLPhiL71]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3SLPhiLayer_71Cells_startCell2"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="N" value="71"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb3:MB3SLPhiL71]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3SLPhiLayer_72Cells"/> + <String name="ChildName" value="mbCommon:MBSLPhiGas"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="72"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb3:MB3SLPhiL72]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SLPhiLayer_71Cells"/> + <rChild name="mb3:MB3SLPhiElectronics_71Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SLPhiLayer_71Cells"/> + <rChild name="mb3:MB3SLPhiElectronics_71Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SLPhiLayer_71Cells_startCell2"/> + <rChild name="mb3:MB3SLPhiElectronics_71Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SLPhiLayer_71Cells_startCell2"/> + <rChild name="mb3:MB3SLPhiElectronics_71Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SLPhiLayer_72Cells"/> + <rChild name="mb3:MB3SLPhiElectronics_72Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SLPhiLayer_72Cells"/> + <rChild name="mb3:MB3SLPhiElectronics_72Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- #### MB3: DT Superlayer Z --> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3P"/> + <rChild name="mb3:MB3SuperLayerZ"/> + <Translation x="[mb3:MB3pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]-[mbCommon:MBSL_posDisp]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3N"/> + <rChild name="mb3:MB3SuperLayerZ"/> + <Translation x="[mb3:MB3nSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]-[mbCommon:MBSL_posDisp]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <!-- #### MB3: DT Superlayer Z internal --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="0.*mm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZLayer_57Cells"/> + <Translation x="0*fm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZLayer_58Cells"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZLayer_57Cells"/> + <Translation x="0*fm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZLayer_56Cells"/> + <Translation x="0*fm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZClosingPlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZClosingPlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZClosingPlatePerp"/> + <Translation x="0.*fm" y="[mb3:MB3SLZPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb3:MB3SLZPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb3:MB3SLZPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZCommonElectronics"/> + <Translation x="0.*fm" y="[mb3:MB3SLZPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SuperLayerZ"/> + <rChild name="mb3:MB3SLZCommonElectronics"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3SLZLayer_56Cells"/> + <String name="ChildName" value="mb3:MB3SLZGas"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="N" value="56"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL56]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3SLZLayer_57Cells"/> + <String name="ChildName" value="mb3:MB3SLZGas"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="57"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL57]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3SLZLayer_58Cells"/> + <String name="ChildName" value="mb3:MB3SLZGas"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="58"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBSLZL58]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SLZLayer_56Cells"/> + <rChild name="mb3:MB3SLZElectronics_56Cells"/> + <Translation x="0.*fm" y="[MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SLZLayer_56Cells"/> + <rChild name="mb3:MB3SLZElectronics_56Cells"/> + <Translation x="0.*fm" y="-([MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SLZLayer_57Cells"/> + <rChild name="mb3:MB3SLZElectronics_57Cells"/> + <Translation x="0.*fm" y="[MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SLZLayer_57Cells"/> + <rChild name="mb3:MB3SLZElectronics_57Cells"/> + <Translation x="0.*fm" y="-([MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3SLZLayer_58Cells"/> + <rChild name="mb3:MB3SLZElectronics_58Cells"/> + <Translation x="0.*fm" y="[MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3SLZLayer_58Cells"/> + <rChild name="mb3:MB3SLZElectronics_58Cells"/> + <Translation x="0.*fm" y="-([MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- ##### MB3: DT honeycomb --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3P"/> + <rChild name="mb3:MB3HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3N"/> + <rChild name="mb3:MB3HoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Honeycomb"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3HcPlate"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBHC_height]-0.75*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3HcPlate"/> + <Translation x="0*fm" y="0*fm" z="-([mbCommon:MBHC_height]-0.75*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_LateralC"/> + <Translation x="[mb3:MB3HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_LateralC"/> + <Translation x="[mb3:MB3HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_LateralC"/> + <Translation x="-([mb3:MB3HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_LateralC"/> + <Translation x="-([mb3:MB3HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension]" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension]" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension])" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-[mbCommon:MBHC_C_dimension])" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_LateralElectronics"/> + <Translation x="[mb3:MB3HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width]" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_LateralElectronics"/> + <Translation x="-([mb3:MB3HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width])" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontElectronics"/> + <Translation x="0*fm" y="[mbCommon:MBHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width]" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontElectronics"/> + <Translation x="0*fm" y="-([mbCommon:MBHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width])" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3HoneycombBox"/> + <rChild name="mb3:MB3HcTorsionBar"/> + <Translation x="[mb3:MB3HC_x]-25.*mm" y="0*fm" z="0*fm"/> + </PosPart> + <!-- ##### MB3: RPC chambers --> + <!-- ##### MB3: RPC_IP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3P"/> + <rChild name="mb3:MB3RPC_P"/> + <Translation x="[mb3:MB3RPC_x_pos]" y="0*fm" z="[mb3:MB3RPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3RPC_P"/> + <rChild name="mb3:MB3RPC_GasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="[mb3:MB3RPC_Gas_x_pos]" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3RPC_P"/> + <rChild name="mb3:MB3RPC_GasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="-[mb3:MB3RPC_Gas_x_pos]" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3RPC_P"/> + <rChild name="mb3:MB3RPC_GasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="[mb3:MB3RPC_Gas_x_pos]" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3RPC_P"/> + <rChild name="mb3:MB3RPC_GasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="-[mb3:MB3RPC_Gas_x_pos]" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB3: RPC_N chamber --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3N"/> + <rChild name="mb3:MB3RPC_N"/> + <Translation x="-[mb3:MB3RPC_x_pos]" y="0*fm" z="[mb3:MB3RPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3RPC_N"/> + <rChild name="mb3:MB3RPC_GasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="-[mb3:MB3RPC_Gas_x_pos]" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3RPC_N"/> + <rChild name="mb3:MB3RPC_GasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="[mb3:MB3RPC_Gas_x_pos]" y="-[mbCommon:MBRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3RPC_N"/> + <rChild name="mb3:MB3RPC_GasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="-[mb3:MB3RPC_Gas_x_pos]" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3RPC_N"/> + <rChild name="mb3:MB3RPC_GasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="+[mb3:MB3RPC_Gas_x_pos]" y="[mbCommon:MBRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- #### MB3Chimney Unit --> + <!-- #### MB3Chim: DTBX chamber --> + <!-- #### MB3: DT Superlayers Phi --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimP"/> + <rChild name="mb3:MB3ChimSuperLayerPhi"/> + <Translation x="[mb3:MB3pSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimP"/> + <rChild name="mb3:MB3ChimSuperLayerPhi"/> + <Translation x="[mb3:MB3pSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimN"/> + <rChild name="mb3:MB3ChimSuperLayerPhi"/> + <Translation x="[mb3:MB3nSLPhi1_HC_dist]" y="0*fm" z="[mbCommon:MBSL_pos_z]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimN"/> + <rChild name="mb3:MB3ChimSuperLayerPhi"/> + <Translation x="[mb3:MB3nSLPhi2_HC_dist]" y="0*fm" z="-[mbCommon:MBSL_pos_z]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <!-- ## MB3: DT Superlayers Phi internal --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiLayer_71Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiLayer_72Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiLayer_72Cells"/> + <Translation x="10.5*mm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiLayer_71Cells_startCell2"/> + <Translation x="10.5*mm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiClosingPlateParal"/> + <Translation x="[mb3:MB3SLPhiPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhiClosingPlateParal"/> + <Translation x="-([mb3:MB3SLPhiPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhi_C_PlateParal"/> + <Translation x="[mb3:MB3SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhi_C_PlateParal"/> + <Translation x="[mb3:MB3SLPhiPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhi_C_PlateParal"/> + <Translation x="-([mb3:MB3SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3ChimSLPhi_C_PlateParal"/> + <Translation x="-([mb3:MB3SLPhiPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3SLPhi_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerPhi"/> + <rChild name="mb3:MB3SLPhiCommonElectronics"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3ChimSLPhiLayer_71Cells"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="71"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb3:MB3SLPhiL71]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3ChimSLPhiLayer_71Cells_startCell2"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="N" value="71"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb3:MB3SLPhiL71]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3ChimSLPhiLayer_72Cells"/> + <String name="ChildName" value="mbCommon:MBChimSLPhiGas"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="72"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mb3:MB3SLPhiL72]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSLPhiLayer_71Cells"/> + <rChild name="mb3:MB3SLPhiElectronics_71Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSLPhiLayer_71Cells"/> + <rChild name="mb3:MB3SLPhiElectronics_71Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSLPhiLayer_71Cells_startCell2"/> + <rChild name="mb3:MB3SLPhiElectronics_71Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSLPhiLayer_71Cells_startCell2"/> + <rChild name="mb3:MB3SLPhiElectronics_71Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSLPhiLayer_72Cells"/> + <rChild name="mb3:MB3SLPhiElectronics_72Cells"/> + <Translation x="0.*fm" y="[mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSLPhiLayer_72Cells"/> + <rChild name="mb3:MB3SLPhiElectronics_72Cells"/> + <Translation x="0.*fm" y="-([mbCommon:MBChimSLPhiLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- #### MB3Chim: DT Superlayer Z --> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimP"/> + <rChild name="mb3:MB3ChimSuperLayerZ"/> + <Translation x="[mb3:MB3pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]-[mbCommon:MBSL_posDisp]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimN"/> + <rChild name="mb3:MB3ChimSuperLayerZ"/> + <Translation x="[mb3:MB3pSLZ_HC_dist]" y="0.*mm" z="-[mbCommon:MBHC_height]-[mbCommon:MBSL_posDisp]"/> + <rRotation name="rotations:R270"/> + </PosPart> + <!-- #### MB3Chim: DT Superlayer Z internal --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZAlPlateOuter"/> + <Translation x="0*fm" y="0*fm" z="-4*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0.*mm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZAlPlateInner"/> + <Translation x="0*fm" y="0*fm" z="-2*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZLayer_47Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZLayer_48Cells"/> + <Translation x="-10.5*mm" y="0*fm" z="[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZLayer_48Cells"/> + <Translation x="10.5*mm" y="0*fm" z="-[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZLayer_47Cells_startCell2"/> + <Translation x="10.5*mm" y="0*fm" z="-3*[mbCommon:MBCell_height]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3SLZClosingPlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+1.7*mm" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3SLZClosingPlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+1.7*mm)" y="0*fm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlateParal"/> + <Translation x="[mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3SLZ_C_PlateParal"/> + <Translation x="-([mbCommon:MBChimSLZPl_x]+0.7*mm-7.*mm)" y="0.*fm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZClosingPlatePerp"/> + <Translation x="0.*fm" y="[mb3:MB3SLZPlO_z]+6.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZClosingPlatePerp"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZPlO_z]+6.*mm)" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb3:MB3SLZPlO_z]-7.*mm" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="[mb3:MB3SLZPlO_z]-7.*mm" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZPlO_z]-7.*mm)" z="[mbCommon:MBSuperLayer_height]-2.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZ_C_PlatePerp"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZPlO_z]-7.*mm)" z="-([mbCommon:MBSuperLayer_height]-2.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZCommonElectronics"/> + <Translation x="0.*fm" y="[mb3:MB3SLZPlO_z]-35./2.*mm" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSuperLayerZ"/> + <rChild name="mb3:MB3ChimSLZCommonElectronics"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZPlO_z]-35./2.*mm)" z="0.*fm"/> + </PosPart> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3ChimSLZLayer_47Cells"/> + <String name="ChildName" value="mb3:MB3SLZGas"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="47"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL47]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3ChimSLZLayer_47Cells_startCell2"/> + <String name="ChildName" value="mb3:MB3SLZGas"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="N" value="47"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL47]-3*[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <Algorithm name="global:DDLinear"> + <rParent name="mb3:MB3ChimSLZLayer_48Cells"/> + <String name="ChildName" value="mb3:MB3SLZGas"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="N" value="48"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="[mbCommon:MBCell_width]*2."/> + <Vector name="Base" type="numeric" nEntries="3"> -[mbCommon:MBChimSLZL48]-[mbCommon:MBCell_width]+[mbCommon:MBIbeamWall], 0.*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="0.*deg"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSLZLayer_47Cells"/> + <rChild name="mb3:MB3ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="[mb3:MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSLZLayer_47Cells"/> + <rChild name="mb3:MB3ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSLZLayer_47Cells_startCell2"/> + <rChild name="mb3:MB3ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="[mb3:MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSLZLayer_47Cells_startCell2"/> + <rChild name="mb3:MB3ChimSLZElectronics_47Cells"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimSLZLayer_48Cells"/> + <rChild name="mb3:MB3ChimSLZElectronics_48Cells"/> + <Translation x="0.*fm" y="[mb3:MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width]" z="0.*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimSLZLayer_48Cells"/> + <rChild name="mb3:MB3ChimSLZElectronics_48Cells"/> + <Translation x="0.*fm" y="-([mb3:MB3SLZLayer_length]-[mbCommon:MBLayerElectronics_width])" z="0.*fm"/> + </PosPart> + <!-- ##### MB3Chim: DT honeycomb --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimP"/> + <rChild name="mb3:MB3ChimHoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimN"/> + <rChild name="mb3:MB3ChimHoneycombBox"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBSuperLayer_height]-[mbCommon:MBSL_posDisp]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHoneycomb"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHcPlate"/> + <Translation x="0*fm" y="0*fm" z="[mbCommon:MBHC_height]-0.75*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHcPlate"/> + <Translation x="0*fm" y="0*fm" z="-([mbCommon:MBHC_height]-0.75*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHc_LateralC"/> + <Translation x="[mb3:MB3HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHc_LateralC"/> + <Translation x="[mb3:MB3HC_x]-[mbCommon:MBHC_C_dimension]" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHc_LateralC"/> + <Translation x="-([mb3:MB3HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHc_LateralC"/> + <Translation x="-([mb3:MB3HC_x]-[mbCommon:MBHC_C_dimension])" y="0*fm" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension]" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontC"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension]" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension])" z="[mbCommon:MBHC_height]-5.5*mm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontC"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-[mbCommon:MBHC_C_dimension])" z="-([mbCommon:MBHC_height]-5.5*mm)"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHc_LateralElectronics"/> + <Translation x="[mb3:MB3HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width]" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3ChimHc_LateralElectronics"/> + <Translation x="-([mb3:MB3HC_x]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCLatElectronics_width])" y="0*fm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontElectronics"/> + <Translation x="0*fm" y="[mbCommon:MBChimHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width]" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3Hc_FrontElectronics"/> + <Translation x="0*fm" y="-([mbCommon:MBChimHC_z]-2*[mbCommon:MBHC_C_dimension]+[mbCommon:MBHCFrontElectronics_width])" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimHoneycombBox"/> + <rChild name="mb3:MB3HcTorsionBar"/> + <Translation x="[mb3:MB3HC_x]-25.*mm" y="0*fm" z="0*fm"/> + </PosPart> + <!-- ##### MB3Chim: RPC chambers --> + <!-- ##### MB3Chim: RPC_IP chamber --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimP"/> + <rChild name="mb3:MB3ChimRPC_P"/> + <Translation x="[mb3:MB3RPC_x_pos]" y="0*fm" z="[mb3:MB3RPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimRPC_P"/> + <rChild name="mb3:MB3ChimRPC_GasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="[mb3:MB3RPC_Gas_x_pos]" y="-[mb3:MB3ChimRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimRPC_P"/> + <rChild name="mb3:MB3ChimRPC_GasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="-[mb3:MB3RPC_Gas_x_pos]" y="-[mb3:MB3ChimRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimRPC_P"/> + <rChild name="mb3:MB3ChimRPC_GasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="[mb3:MB3RPC_Gas_x_pos]" y="[mb3:MB3ChimRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimRPC_P"/> + <rChild name="mb3:MB3ChimRPC_GasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="-[mb3:MB3RPC_Gas_x_pos]" y="[mb3:MB3ChimRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <!-- ##### MB3Chim: RPC_N chamber --> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimN"/> + <rChild name="mb3:MB3ChimRPC_N"/> + <Translation x="-[mb3:MB3RPC_x_pos]" y="0*fm" z="[mb3:MB3RPC_z_pos]"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimRPC_N"/> + <rChild name="mb3:MB3ChimRPC_GasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="-[mb3:MB3RPC_Gas_x_pos]" y="-[mb3:MB3ChimRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimRPC_N"/> + <rChild name="mb3:MB3ChimRPC_GasLeft"/> + <rRotation name="rotations:R180"/> + <Translation x="[mb3:MB3RPC_Gas_x_pos]" y="-[mb3:MB3ChimRPC_GasLeft_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mb3:MB3ChimRPC_N"/> + <rChild name="mb3:MB3ChimRPC_GasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="-[mb3:MB3RPC_Gas_x_pos]" y="[mb3:MB3ChimRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mb3:MB3ChimRPC_N"/> + <rChild name="mb3:MB3ChimRPC_GasRight"/> + <rRotation name="rotations:R180"/> + <Translation x="[mb3:MB3RPC_Gas_x_pos]" y="[mb3:MB3ChimRPC_GasRight_y_pos]" z="0*cm"/> + </PosPart> + </PosPartSection> +</DDDefinition> diff --git a/Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml b/Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml new file mode 100644 index 0000000000000..1b179b20771c1 --- /dev/null +++ b/Geometry/MuonCommonData/data/mbCommon/2021/v2/mbCommon.xml @@ -0,0 +1,409 @@ +<?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"> + <!-- ####### Constants common to all DTBX stations --> + <ConstantsSection label="mbCommon.xml" eval="true"> + <!--- #### Constants for all DT superlayers --> + <Constant name="MBHeight_With2RPC" value="362./2.*mm"/> + <Constant name="MBHeight_With1RPC" value="326./2.*mm"/> + <Constant name="MBSL_posDisp" value="[MBHeight_With2RPC]-[MBHeight_With1RPC]"/> + <Constant name="MBSL_pos_z" value="235./2.*mm"/> + <Constant name="MBCell_width" value="42./2.*mm"/> + <Constant name="MBIbeamWall" value="1.3*mm/2."/> + <Constant name="MBLayerElectronics_width" value="25./2.*mm"/> + <!--%% tappini --> + <Constant name="MBGas_height" value="11.5/2.*mm"/> + <Constant name="MBAlPlate_height" value="1.5/2.*mm"/> + <Constant name="MBCell_height" value="[MBGas_height]+[MBAlPlate_height]"/> + <Constant name="MBSuperLayer_height" value="4*[MBCell_height]+[MBAlPlate_height]"/> + <!---%% Honeycomb --> + <Constant name="MBHC_offset" value="26.75*mm"/> + <Constant name="MBHC_height" value="128./2.*mm"/> + <Constant name="MBHC_z" value="2458./2.*mm"/> + <Constant name="MBChimHC_z" value="[MBHC_z]-195.*mm"/> + <Constant name="MBHCElectronics_height" value="54.5*mm"/> + <Constant name="MBHCLatElectronics_width" value="70./2.*mm"/> + <Constant name="MBHCFrontElectronics_width" value="64.5/2.*mm"/> + <Constant name="MBHC_C_dimension" value="125./2.*mm"/> + <Constant name="MBHC_C_width" value="4.*mm"/> + <!--- ### Constants for all non-chimney DT superlayers --> + <Constant name="MBPos_z" value="8.5*mm"/> + <Constant name="MBSLPhiWire_length" value="2379./2.*mm"/> + <!--%% Wire length from EDMS: THIS NUMBER DEFINE THE SL DIMENSIONS--> + <Constant name="MBSLPhiBareWire_length" value="[MBSLPhiWire_length]-15.5*mm"/> + <!--%% Bare Wire _length == wire_lenght - depth in tappini--> + <Constant name="MBSLPhiLayer_length" value="[MBSLPhiBareWire_length]+2*[MBLayerElectronics_width]"/> + <!--%% The z length of the Al layer volume--> + <Constant name="MBSLPhiPlI_z" value="[MBSLPhiLayer_length]+6.5*mm"/> + <!--%% 6.5 is the distance between tappini and Al Plate edge--> + <Constant name="MBSLPhiPlO_z" value="[MBSLPhiPlI_z]+38.*mm"/> + <Constant name="MBSLZPl_x" value="2457./2*mm"/> + <Constant name="MBSLZL56" value="[MBCell_width]*56+[MBIbeamWall]"/> + <Constant name="MBSLZL57" value="[MBCell_width]*57+[MBIbeamWall]"/> + <Constant name="MBSLZL58" value="[MBCell_width]*58+[MBIbeamWall]"/> + <!--- #### Constants for all chimney DT superlayers --> + <Constant name="MBChimPos_z" value="186.5*mm"/> + <Constant name="MBChimSLPhiWire_length" value="1989./2.*mm"/> + <!--%% Just change this number --> + <Constant name="MBChimSLPhiBareWire_length" value="[MBChimSLPhiWire_length]-15.5*mm"/> + <Constant name="MBChimSLPhiLayer_length" value="[MBChimSLPhiBareWire_length]+2*[MBLayerElectronics_width]"/> + <Constant name="MBChimSLPhiPlI_z" value="[MBChimSLPhiLayer_length]+6.5*mm"/> + <Constant name="MBChimSLPhiPlO_z" value="[MBChimSLPhiPlI_z]+38.*mm"/> + <Constant name="MBChimSLZPl_x" value="[MBSLZPl_x]-399./2.*mm"/> + <Constant name="MBChimSLZL47" value="[MBCell_width]*47+[MBIbeamWall]"/> + <Constant name="MBChimSLZL48" value="[MBCell_width]*48+[MBIbeamWall]"/> + <!--- #### Constants for all RPCs --> + <Constant name="MBRPC_EngineerChamberWidth" value="55./2*mm"/> + <Constant name="MBRPC_y" value="12./2*mm"/> + <Constant name="MBRPC_Gas_y" value="4./2.*mm"/> + <Constant name="MBRPC_z" value="2455./2.*mm"/> + <Constant name="MBChimRPC_OGasLeft_z" value="389.5*mm+195./2.*mm"/> + <Constant name="MBChimRPC_OGasRight_z" value="626.*mm-195./2.*mm"/> + <Constant name="MBRPC_GasLeft_z" value="584.5*mm"/> + <Constant name="MBRPC_GasRight_z" value="626*mm"/> + <Constant name="MBRPC_x_pos" value="2*cm"/> + <Constant name="MBRPC_z_pos" value="17.5*cm"/> + <Constant name="MBRPC_GasLeft_y_pos" value="629*mm"/> + <Constant name="MBRPC_GasRight_y_pos" value="587.5*mm"/> + <Constant name="MBChimRPC_z" value="2081./2.*mm"/> + </ConstantsSection> + <SolidSection label="mbCommon.xml"> + <!-- #### DTBX Gas cell for non chimney chambers --> + <!--%% Effective gas volume: This volume should not include the Ibeam horizontal bars (those that make the 'I' shape; without them it would be a '|') --> + <Box name="MBSLPhiGas_aa" dx="20.35*mm-2*3.175*mm" dz="[MBGas_height]" dy="[MBSLPhiBareWire_length]"/> + <Box name="MBSLPhiGas_bb" dx="20.35*mm" dz="[MBGas_height]-2*0.65*mm" dy="[MBSLPhiBareWire_length]"/> + <Box name="MBSLPhiIBeamWing" dx="3.175*mm" dz="0.65*mm" dy="[MBSLPhiBareWire_length]"/> + <UnionSolid name="MBSLPhiGas"> + <rSolid name="MBSLPhiGas_aa"/> + <rSolid name="MBSLPhiGas_bb"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*fm" z="0.*fm" y="0.*fm"/> + </UnionSolid> + <!-- #### DTBX Gas cell for chimney chambers --> + <!--%% Effective gas volume. + This volume should not include the Ibeam horizontal bars (those that make the 'I' shape; without them it would be a '|') --> + <Box name="MBChimSLPhiGas_aa" dx="20.35*mm-2*3.175*mm" dz="[MBGas_height]" dy="[MBChimSLPhiBareWire_length]"/> + <Box name="MBChimSLPhiGas_bb" dx="20.35*mm" dz="[MBGas_height]-2*0.65*mm" dy="[MBChimSLPhiBareWire_length]"/> + <Box name="MBChimSLPhiIBeamWing" dx="3.175*mm" dz="0.65*mm" dy="[MBChimSLPhiBareWire_length]"/> + <UnionSolid name="MBChimSLPhiGas"> + <rSolid name="MBChimSLPhiGas_aa"/> + <rSolid name="MBChimSLPhiGas_bb"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*fm" z="0.*fm" y="0.*fm"/> + </UnionSolid> + <!--%%%%%%%%%%% Cables inside wheels --> + <Box name="MBCablesBox_Int" dx="50*cm" dy="10*cm" dz="1.268*m"/> + <Box name="MBCablesBox_IntChim" dx="50*cm" dy="10*cm" dz="1.073*m"/> + <Box name="MBCables_Int" dx="50*cm" dy="2*cm" dz="1.268*m"/> + <Box name="MBCables_IntChim" dx="50*cm" dy="2*cm" dz="1.073*m"/> + <!--%%%%%%%%%%% Cables outside wheels --> + <Box name="MBCables_Wheels0_1" dx="2.05*m" dy="70*cm" dz="5.4*cm"/> + <Box name="MBCables_Wheels1_2" dx="2.05*m" dy="70*cm" dz="3.25*cm"/> + <Tubs name="MBCables_Ext" rMin="8.05*m - 0.04*m" rMax="8.3*m - 0.2*m" dz="30*cm - 29*cm" startPhi="15*deg" deltaPhi="150*deg"/> + </SolidSection> + <LogicalPartSection label="mbCommon.xml"> + <!-- #### DTBX Gas cell for non chimney chambers --> + <LogicalPart name="MBSLPhiGas" category="unspecified"> + <rSolid name="MBSLPhiGas"/> + <rMaterial name="materials:M_DTBX Gas"/> + </LogicalPart> + <LogicalPart name="MBSLPhiIBeamWing" category="unspecified"> + <rSolid name="MBSLPhiIBeamWing"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <!-- #### DTBX Gas cell for chimney chambers --> + <LogicalPart name="MBChimSLPhiGas" category="unspecified"> + <rSolid name="MBChimSLPhiGas"/> + <rMaterial name="materials:M_DTBX Gas"/> + </LogicalPart> + <LogicalPart name="MBChimSLPhiIBeamWing" category="unspecified"> + <rSolid name="MBChimSLPhiIBeamWing"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <!--%%%%%%%%%%% Cables inside wheels --> + <LogicalPart name="MBCablesBox_Int" category="unspecified"> + <rSolid name="MBCablesBox_Int"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MBCables_Int" category="unspecified"> + <rSolid name="MBCables_Int"/> + <rMaterial name="materials:M_Cables"/> + </LogicalPart> + <LogicalPart name="MBCablesBox_IntChim" category="unspecified"> + <rSolid name="MBCablesBox_IntChim"/> + <rMaterial name="materials:M_B_Air"/> + </LogicalPart> + <LogicalPart name="MBCables_IntChim" category="unspecified"> + <rSolid name="MBCables_IntChim"/> + <rMaterial name="materials:M_Cables"/> + </LogicalPart> + <!--%%%%%%%%%%% Cables outside wheels --> + <LogicalPart name="MBCables_Wheels0_1" category="unspecified"> + <rSolid name="MBCables_Wheels0_1"/> + <rMaterial name="materials:M_Cables"/> + </LogicalPart> + <LogicalPart name="MBCables_Wheels1_2" category="unspecified"> + <rSolid name="MBCables_Wheels1_2"/> + <rMaterial name="materials:M_Cables"/> + </LogicalPart> + <LogicalPart name="MBCables_Ext" category="unspecified"> + <rSolid name="MBCables_Ext"/> + <rMaterial name="materials:M_Cables"/> + </LogicalPart> + </LogicalPartSection> + <PosPartSection label="mbCommon.xml"> + <!--%%%%%%%%%%% Cables inside wheels --> + <PosPart copyNumber="1"> + <rParent name="mbCommon:MBCablesBox_Int"/> + <rChild name="mbCommon:MBCables_Int"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm" y="-8*cm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mbCommon:MBCablesBox_IntChim"/> + <rChild name="mbCommon:MBCables_IntChim"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm" y="-8*cm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R270"/> + <Translation x="3.945*m" y="34.5763*cm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R300"/> + <Translation x="3.24359*m" y="2.27194*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R330"/> + <Translation x="1.67306*m" y="3.58935*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_IntChim"/> + <rRotation name="rotations:000D"/> + <Translation x="-34.5763*cm" y="3.945*m" z="19.5/2*cm"/> + </PosPart> + <PosPart copyNumber="5"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R030"/> + <Translation x="-2.27194*m" y="3.24359*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="6"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R060"/> + <Translation x="-3.58935*m" y="1.67306*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="7"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R090"/> + <Translation x="-3.945*m" y="-34.5764*cm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="8"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R120"/> + <Translation x="-3.24359*m" y="-2.27194*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="9"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R150"/> + <Translation x="-1.67306*m" y="-3.58935*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="10"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R180"/> + <Translation x="34.5764*cm" y="-3.945*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="11"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R210"/> + <Translation x="2.27194*m" y="-3.24359*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="12"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R240"/> + <Translation x="3.58935*m" y="-1.67306*m" z="0*fm"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="mbCommon:MBCablesBox_Int"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="3.96012*m"/> + <Numeric name="StartAngle" value="5.0089*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0 </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 264.9911*deg </Vector> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R270"/> + <Translation x="3.945*m" y="34.5763*cm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R300"/> + <Translation x="3.24359*m" y="2.27194*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_IntChim"/> + <rRotation name="rotations:R330"/> + <Translation x="1.67306*m" y="3.58935*m" z="-19.5/2.*cm"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:000D"/> + <Translation x="-34.5763*cm" y="3.945*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="5"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R030"/> + <Translation x="-2.27194*m" y="3.24359*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="6"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R060"/> + <Translation x="-3.58935*m" y="1.67306*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="7"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R090"/> + <Translation x="-3.945*m" y="-34.5764*cm" z="0*fm"/> + </PosPart> + <PosPart copyNumber="8"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R120"/> + <Translation x="-3.24359*m" y="-2.27194*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="9"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R150"/> + <Translation x="-1.67306*m" y="-3.58935*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="10"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R180"/> + <Translation x="34.5764*cm" y="-3.945*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="11"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R210"/> + <Translation x="2.27194*m" y="-3.24359*m" z="0*fm"/> + </PosPart> + <PosPart copyNumber="12"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="mbCommon:MBCablesBox_Int"/> + <rRotation name="rotations:R240"/> + <Translation x="3.58935*m" y="-1.67306*m" z="0*fm"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="mbCommon:MBCablesBox_Int"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="3.96012*m"/> + <Numeric name="StartAngle" value="5.0089*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0 </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 264.9911*deg </Vector> + </Algorithm> + <!--%%%%%%%%%%% Cables outside wheels --> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MB"/> + <String name="ChildName" value="mbCommon:MBCables_Wheels0_1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="6"/> + <Numeric name="Radius" value="5.85*m"/> + <Numeric name="StartAngle" value="0.*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 0.00*deg </Vector> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.322*m </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MB"/> + <String name="ChildName" value="mbCommon:MBCables_Wheels0_1"/> + <Numeric name="N" value="6"/> + <Numeric name="Radius" value="5.85*m"/> + <Numeric name="StartAngle" value="30.*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 0.00*deg </Vector> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.322*m </Vector> + <Numeric name="StartCopyNo" value="7"/> + <Numeric name="IncrCopyNo" value="1"/> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MB"/> + <String name="ChildName" value="mbCommon:MBCables_Wheels1_2"/> + <Numeric name="N" value="6"/> + <Numeric name="Radius" value="5.85*m"/> + <Numeric name="StartAngle" value="0.*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 0.00*deg </Vector> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -3.9865*m </Vector> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MB"/> + <String name="ChildName" value="mbCommon:MBCables_Wheels1_2"/> + <Numeric name="N" value="6"/> + <Numeric name="Radius" value="5.85*m"/> + <Numeric name="StartAngle" value="30.*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 0.00*deg </Vector> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 3.9865*m </Vector> + <Numeric name="StartCopyNo" value="7"/> + <Numeric name="IncrCopyNo" value="1"/> + </Algorithm> + <PosPart copyNumber="1"> + <rParent name="muonBase:MB"/> + <rChild name="mbCommon:MBCables_Ext"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm" y="0*fm" z="1.368*m"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="muonBase:MB"/> + <rChild name="mbCommon:MBCables_Ext"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm" y="0*fm" z="-1.368*m"/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="muonBase:MB"/> + <rChild name="mbCommon:MBCables_Ext"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm" y="0*fm" z="4.064*m"/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="muonBase:MB"/> + <rChild name="mbCommon:MBCables_Ext"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm" y="0*fm" z="-4.064*m"/> + </PosPart> + </PosPartSection> +</DDDefinition> From 6849d21e9212906d4fbe1b369cb2ffcbf9cacabf Mon Sep 17 00:00:00 2001 From: Erica Brondolin <erica.brondolin@cern.ch> Date: Tue, 6 Oct 2020 13:43:06 +0200 Subject: [PATCH 270/778] Rotate label axes to make them visible --- Validation/HGCalValidation/python/hgcalPlots.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Validation/HGCalValidation/python/hgcalPlots.py b/Validation/HGCalValidation/python/hgcalPlots.py index 6b82a35b12168..5955d0edc68ad 100644 --- a/Validation/HGCalValidation/python/hgcalPlots.py +++ b/Validation/HGCalValidation/python/hgcalPlots.py @@ -1346,26 +1346,26 @@ Plot("cellAssociation_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_assoc) for i in range(0,maxlayerzm) ], ncols=8 ) -_common_eff = {"stat": False, "legend": False} +_common_eff = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d"} _effplots = [Plot("effic_eta", xtitle="", **_common_eff)] _effplots.extend([Plot("effic_phi", xtitle="", **_common_eff)]) _effplots.extend([Plot("globalEfficiencies", xtitle="", **_common_eff)]) _efficiencies = PlotGroup("Efficiencies", _effplots, ncols=3) -_common_dup = {"stat": False, "legend": False} +_common_dup = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d"} _dupplots = [Plot("duplicate_eta", xtitle="", **_common_dup)] _dupplots.extend([Plot("duplicate_phi", xtitle="", **_common_dup)]) _dupplots.extend([Plot("globalEfficiencies", xtitle="", **_common_dup)]) _duplicates = PlotGroup("Duplicates", _dupplots, ncols=3) -_common_fake = {"stat": False, "legend": False} +_common_fake = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d"} _fakeplots = [Plot("fake_eta", xtitle="", **_common_fake)] _fakeplots.extend([Plot("fake_phi", xtitle="", **_common_fake)]) _fakeplots.extend([Plot("globalEfficiencies", xtitle="", **_common_fake)]) _fakes = PlotGroup("FakeRate", _fakeplots, ncols=3) -_common_merge = {"stat": False, "legend": False} +_common_merge = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d"} _mergeplots = [Plot("merge_eta", xtitle="", **_common_merge)] _mergeplots.extend([Plot("merge_phi", xtitle="", **_common_merge)]) _mergeplots.extend([Plot("globalEfficiencies", xtitle="", **_common_merge)]) From 600299646450c4dbfa2f94fe746fb638ef415dab Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Tue, 6 Oct 2020 14:41:04 +0200 Subject: [PATCH 271/778] general cleanup of the output --- .../scripts/submitPVResolutionJobs.py | 12 ++++--- .../scripts/submitPVValidationJobs.py | 32 ++++++++++++------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py b/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py index b30f2ecb73fdc..09df968c53f32 100755 --- a/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py +++ b/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py @@ -134,7 +134,8 @@ def getLuminosity(homedir,minRun,maxRun,isRunBased,verbose): #print("lumi",lumiToCache) myCachedLumi[runToCache] = lumiToCache - #print(myCachedLumi) + if(verbose): + print(myCachedLumi) return myCachedLumi ############################################## @@ -253,6 +254,9 @@ def main(): inputDict = as_dict(config) pprint.pprint(inputDict) + if(not bool(inputDict)): + raise SystemExit("\n\n ERROR! Could not parse any input file, perhaps you are submitting this from the wrong folder? \n\n") + ## check first there is a valid grid proxy forward_proxy(".") @@ -261,12 +265,12 @@ def main(): if(not os.path.exists("cfg")): os.system("mkdir cfg") - os.system("mkdir bash") + os.system("mkdir BASH") os.system("mkdir harvest") os.system("mkdir out") cwd = os.getcwd() - bashdir = os.path.join(cwd,"bash") + bashdir = os.path.join(cwd,"BASH") runs.sort() # get from the DB the int luminosities @@ -344,7 +348,7 @@ def main(): key = key.split(":", 1)[1] print("dealing with",key) - os.system("cp PrimaryVertexResolution_templ_cfg.py ./cfg/PrimaryVertexResolution_"+key+"_"+run+"_cfg.py") + os.system("cp "+input_CMSSW_BASE+"/src/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py ./cfg/PrimaryVertexResolution_"+key+"_"+run+"_cfg.py") os.system("sed -i 's|XXX_FILES_XXX|"+listOfFiles+"|g' "+cwd+"/cfg/PrimaryVertexResolution_"+key+"_"+run+"_cfg.py") os.system("sed -i 's|XXX_RUN_XXX|"+run+"|g' "+cwd+"/cfg/PrimaryVertexResolution_"+key+"_"+run+"_cfg.py") os.system("sed -i 's|YYY_KEY_YYY|"+key+"|g' "+cwd+"/cfg/PrimaryVertexResolution_"+key+"_"+run+"_cfg.py") diff --git a/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py index ba371befd3626..20fa721034c05 100755 --- a/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py +++ b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py @@ -21,6 +21,7 @@ import string, re import configparser as ConfigParser import json +import pprint import subprocess from optparse import OptionParser from subprocess import Popen, PIPE @@ -121,7 +122,7 @@ def getNEvents(run, dataset): return 0 if nEvents == "[]\n" else int(nEvents) ############################################## -def getLuminosity(minRun,maxRun,isRunBased): +def getLuminosity(minRun,maxRun,isRunBased,verbose): ############################################## """Expects something like +-------+------+--------+--------+-------------------+------------------+ @@ -138,8 +139,9 @@ def getLuminosity(minRun,maxRun,isRunBased): #output = subprocess.check_output(["/afs/cern.ch/user/m/musich/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS", "--normtag=/afs/cern.ch/user/l/lumipro/public/normtag_file/normtag_BRIL.json", "-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) output = subprocess.check_output(["/afs/cern.ch/user/m/musich/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS","-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv","-c","web"]) - print("INSIDE GET LUMINOSITY") - print(output) + if(verbose): + print("INSIDE GET LUMINOSITY") + print(output) for line in output.decode().split("\n"): if ("#" not in line): @@ -149,7 +151,8 @@ def getLuminosity(minRun,maxRun,isRunBased): #print "lumi",lumiToCache myCachedLumi[runToCache] = lumiToCache - print(myCachedLumi) + if(verbose): + print(myCachedLumi) return myCachedLumi ############################################## @@ -582,7 +585,8 @@ def main(): parser.add_option('-i','--input', help='set input configuration (overrides default)', dest='inputconfig',action='store',default=None) parser.add_option('-b','--begin', help='starting point', dest='start', action='store' ,default='1') parser.add_option('-e','--end', help='ending point', dest='end', action='store' ,default='999999') - + parser.add_option('-v','--verbose', help='verbose output', dest='verbose', action='store_true', default=False) + (opts, args) = parser.parse_args() now = datetime.datetime.now() @@ -768,12 +772,11 @@ def main(): cmd = 'dasgoclient -limit=0 -query \'run dataset='+opts.data+'\'' p = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) out, err = p.communicate() - print(out) + #print(out) listOfRuns=out.decode().split("\n") listOfRuns.pop() listOfRuns.sort() - print("Will run on ",len(listOfRuns),"runs") - print(listOfRuns) + print("Will run on ",len(listOfRuns),"runs: \n",listOfRuns) mytuple=[] @@ -838,8 +841,9 @@ def main(): if(len(myRuns)==0): raise Exception('Will not run on any run.... please check again the configuration') - myLumiDB = getLuminosity(myRuns[0],myRuns[-1],doRunBased) - print(myLumiDB) + myLumiDB = getLuminosity(myRuns[0],myRuns[-1],doRunBased,opts.verbose) + if(opts.verbose): + pprint.pprint(myLumiDB) # start loop on samples for iConf in range(len(jobName)): @@ -902,14 +906,18 @@ def main(): batchJobIds = [] mergedFile = None - print("myRuns =====>",myRuns) + if(opts.verbose): + print("myRuns =====>",myRuns) totalJobs=0 theBashDir=None theBaseName=None for jobN,theSrcFiles in enumerate(inputFiles): - print("JOB:",jobN,"run",myRuns[jobN],theSrcFiles) + if(opts.verbose): + print("JOB:",jobN,"run",myRuns[jobN],theSrcFiles) + else: + print("JOB:",jobN,"run",myRuns[jobN]) thejobIndex=None theLumi='1' From d974a8c076b4e1ae822a8aac557d4f53708be550 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Tue, 6 Oct 2020 14:41:31 +0200 Subject: [PATCH 272/778] update description of ini file for Split Vertex Validation --- Alignment/OfflineValidation/test/PVResolutionExample.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/Alignment/OfflineValidation/test/PVResolutionExample.ini b/Alignment/OfflineValidation/test/PVResolutionExample.ini index b2f1aa08af22d..a1206970d0b71 100644 --- a/Alignment/OfflineValidation/test/PVResolutionExample.ini +++ b/Alignment/OfflineValidation/test/PVResolutionExample.ini @@ -1,3 +1,4 @@ +# submitPVResolutionJobs.py -j UNIT_TEST -i PVResolutionExample.ini -D /JetHT/Run2018C-TkAlMinBias-12Nov2019_UL2018-v2/ALCARECO -v [Input] lumimask=/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions18/13TeV/DCSOnly/json_DCSONLY.txt [Validation:Prompt] From f2894b9df23a44e9b17c0a10635feaf1ce7733ae Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Tue, 6 Oct 2020 14:42:03 +0200 Subject: [PATCH 273/778] update unit test to run job submitters --- Alignment/OfflineValidation/test/test_all.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Alignment/OfflineValidation/test/test_all.sh b/Alignment/OfflineValidation/test/test_all.sh index ed9a27885be61..790ce51685cb0 100755 --- a/Alignment/OfflineValidation/test/test_all.sh +++ b/Alignment/OfflineValidation/test/test_all.sh @@ -151,5 +151,11 @@ split some_split_validation - prompt : split some_split_validation - express : EOF -echo "TESTING all-in-one tool ..." +echo " TESTING all-in-one tool ..." validateAlignments.py -c validation_config.ini -N testingAllInOneTool --dryRun || die "Failure running all-in-one test" $? + +echo " TESTING Primary Vertex Validation run-by-run submission ..." +submitPVValidationJobs.py -j UNIT_TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i ${LOCAL_TEST_DIR}/testPVValidation_Relvals_DATA.ini -r || die "Failure running PV Validaiton run-by-run submission" $? + +echo " TESTING Split Vertex Validation submission ..." +submitPVResolutionJobs.py -j UNIT_TEST -D /JetHT/Run2018C-TkAlMinBias-12Nov2019_UL2018-v2/ALCARECO -i ${LOCAL_TEST_DIR}/PVResolutionExample.ini || die "Failure running Split Vertex Validaiton submission" $? From 7dbcfcfd0440d42d1e83696271282f5a4e5e0604 Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Tue, 6 Oct 2020 15:47:27 +0200 Subject: [PATCH 274/778] clean more BuildFiles --- DataFormats/L1GlobalCaloTrigger/test/BuildFile.xml | 1 - DataFormats/L1GlobalTrigger/BuildFile.xml | 1 - DataFormats/L1TCalorimeter/BuildFile.xml | 2 -- DataFormats/L1TCalorimeterPhase2/BuildFile.xml | 4 ---- DataFormats/L1TGlobal/BuildFile.xml | 1 - DataFormats/L1TMuon/BuildFile.xml | 2 -- GeometryReaders/XMLIdealGeometryESSource/BuildFile.xml | 1 - HLTriggerOffline/Btag/BuildFile.xml | 4 +++- L1Trigger/L1TMuon/BuildFile.xml | 1 + L1Trigger/L1TMuonOverlap/BuildFile.xml | 1 + 10 files changed, 5 insertions(+), 13 deletions(-) diff --git a/DataFormats/L1GlobalCaloTrigger/test/BuildFile.xml b/DataFormats/L1GlobalCaloTrigger/test/BuildFile.xml index 53f976451cbf4..320b68fa6cb95 100644 --- a/DataFormats/L1GlobalCaloTrigger/test/BuildFile.xml +++ b/DataFormats/L1GlobalCaloTrigger/test/BuildFile.xml @@ -1,4 +1,3 @@ -<use name="DataFormats/L1CaloTrigger"/> <use name="DataFormats/L1GlobalCaloTrigger"/> <bin name="testL1GlobalCaloRegionDetId" file="testL1GlobalCaloRegionDetId.cpp"> </bin> diff --git a/DataFormats/L1GlobalTrigger/BuildFile.xml b/DataFormats/L1GlobalTrigger/BuildFile.xml index 8835c1e8f167e..b49ab126b248d 100644 --- a/DataFormats/L1GlobalTrigger/BuildFile.xml +++ b/DataFormats/L1GlobalTrigger/BuildFile.xml @@ -1,6 +1,5 @@ <use name="DataFormats/Common"/> <use name="DataFormats/Provenance"/> -<use name="DataFormats/StdDictionaries"/> <use name="DataFormats/L1GlobalMuonTrigger"/> <use name="FWCore/MessageLogger"/> <use name="FWCore/Utilities"/> diff --git a/DataFormats/L1TCalorimeter/BuildFile.xml b/DataFormats/L1TCalorimeter/BuildFile.xml index 18fcc075ce1ea..a88fa82e81730 100644 --- a/DataFormats/L1TCalorimeter/BuildFile.xml +++ b/DataFormats/L1TCalorimeter/BuildFile.xml @@ -1,5 +1,3 @@ -<use name="DataFormats/Candidate"/> -<use name="DataFormats/Common"/> <use name="DataFormats/L1Trigger"/> <export> <lib name="1"/> diff --git a/DataFormats/L1TCalorimeterPhase2/BuildFile.xml b/DataFormats/L1TCalorimeterPhase2/BuildFile.xml index 26cdc521839af..e8fab97541080 100644 --- a/DataFormats/L1TCalorimeterPhase2/BuildFile.xml +++ b/DataFormats/L1TCalorimeterPhase2/BuildFile.xml @@ -1,7 +1,3 @@ -<use name="FWCore/Framework"/> -<use name="FWCore/PluginManager"/> -<use name="FWCore/ParameterSet"/> -<use name="DataFormats/Candidate"/> <use name="DataFormats/L1Trigger"/> <use name="rootrflx"/> <export> diff --git a/DataFormats/L1TGlobal/BuildFile.xml b/DataFormats/L1TGlobal/BuildFile.xml index 18fcc075ce1ea..3ddb67cbcc89b 100644 --- a/DataFormats/L1TGlobal/BuildFile.xml +++ b/DataFormats/L1TGlobal/BuildFile.xml @@ -1,4 +1,3 @@ -<use name="DataFormats/Candidate"/> <use name="DataFormats/Common"/> <use name="DataFormats/L1Trigger"/> <export> diff --git a/DataFormats/L1TMuon/BuildFile.xml b/DataFormats/L1TMuon/BuildFile.xml index 9e146abaa54cb..71988edc547a7 100644 --- a/DataFormats/L1TMuon/BuildFile.xml +++ b/DataFormats/L1TMuon/BuildFile.xml @@ -2,10 +2,8 @@ <lib name="1"/> </export> <use name="DataFormats/CSCDigi"/> -<use name="DataFormats/L1DTTrackFinder"/> <use name="DataFormats/GEMDigi"/> <use name="DataFormats/MuonDetId"/> -<use name="DataFormats/L1CSCTrackFinder"/> <use name="DataFormats/Common"/> <use name="DataFormats/Candidate"/> <use name="rootrflx"/> diff --git a/GeometryReaders/XMLIdealGeometryESSource/BuildFile.xml b/GeometryReaders/XMLIdealGeometryESSource/BuildFile.xml index a376f7059ae40..cce7da7c7395d 100644 --- a/GeometryReaders/XMLIdealGeometryESSource/BuildFile.xml +++ b/GeometryReaders/XMLIdealGeometryESSource/BuildFile.xml @@ -5,6 +5,5 @@ <use name="FWCore/ParameterSet"/> <use name="Geometry/Records"/> <use name="CondFormats/Common"/> -<use name="CondFormats/GeometryObjects"/> <use name="MagneticField/Records"/> <flags EDM_PLUGIN="1"/> diff --git a/HLTriggerOffline/Btag/BuildFile.xml b/HLTriggerOffline/Btag/BuildFile.xml index aff5ba9347b6c..0499591e31b80 100644 --- a/HLTriggerOffline/Btag/BuildFile.xml +++ b/HLTriggerOffline/Btag/BuildFile.xml @@ -1,3 +1,5 @@ -<use name="DQMOffline/RecoB"/> +<use name="DataFormats/BTauReco"/> +<use name="DQMServices/Core"/> <use name="HLTrigger/HLTcore"/> +<use name="rootgraphics"/> <flags EDM_PLUGIN="1"/> diff --git a/L1Trigger/L1TMuon/BuildFile.xml b/L1Trigger/L1TMuon/BuildFile.xml index aae7229fef984..5fa2d49b805be 100644 --- a/L1Trigger/L1TMuon/BuildFile.xml +++ b/L1Trigger/L1TMuon/BuildFile.xml @@ -4,6 +4,7 @@ <use name="root"/> <use name="xerces-c"/> </export> +<use name="DataFormats/L1DTTrackFinder"/> <use name="DataFormats/L1TMuon"/> <use name="DataFormats/L1Trigger"/> <use name="DataFormats/RPCRecHit"/> diff --git a/L1Trigger/L1TMuonOverlap/BuildFile.xml b/L1Trigger/L1TMuonOverlap/BuildFile.xml index 3eb0515c366f6..c4827eb8dd3bf 100644 --- a/L1Trigger/L1TMuonOverlap/BuildFile.xml +++ b/L1Trigger/L1TMuonOverlap/BuildFile.xml @@ -3,6 +3,7 @@ </export> <use name="xerces-c"/> <use name="root"/> +<use name="DataFormats/L1DTTrackFinder"/> <use name="L1Trigger/RPCTrigger"/> <use name="DataFormats/L1TMuon"/> <use name="Geometry/Records"/> From 6f84b7d5c864bbcb78ef743583f717d55abe6c71 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Tue, 6 Oct 2020 21:02:54 +0200 Subject: [PATCH 275/778] Change class name and clean up based code review --- .../producersHeavyIons/heavyIonJets_cff.py | 2 +- ...egacyCSVv2Tagger.h => heavyIonCSVTagger.h} | 17 ++- .../Combined/plugins/heavyIonCSVESProducer.cc | 8 + .../plugins/hiRun2LegacyCSVv2ESProducer.cc | 8 - ...uter_cfi.py => heavyIonCSVComputer_cfi.py} | 17 +-- ...tTags_cfi.py => heavyIonCSVJetTags_cfi.py} | 6 +- ...ngs.py => heavyIonCSV_trainingSettings.py} | 2 +- .../python/hiRun2LegacyCSVv2_helpers.py | 32 ---- .../python/hiRun2LegacyCSVv2_trainingvars.py | 143 ------------------ ...acyCSVv2Tagger.cc => heavyIonCSVTagger.cc} | 95 ++---------- .../combinedSecondaryVertexV2BJetTags_cfi.py | 2 +- 11 files changed, 44 insertions(+), 288 deletions(-) rename RecoBTag/Combined/interface/{hiRun2LegacyCSVv2Tagger.h => heavyIonCSVTagger.h} (73%) create mode 100644 RecoBTag/Combined/plugins/heavyIonCSVESProducer.cc delete mode 100644 RecoBTag/Combined/plugins/hiRun2LegacyCSVv2ESProducer.cc rename RecoBTag/Combined/python/{hiRun2LegacyCSVv2Computer_cfi.py => heavyIonCSVComputer_cfi.py} (55%) rename RecoBTag/Combined/python/{hiRun2LegacyCSVv2JetTags_cfi.py => heavyIonCSVJetTags_cfi.py} (66%) rename RecoBTag/Combined/python/{hiRun2LegacyCSVv2_trainingSettings.py => heavyIonCSV_trainingSettings.py} (99%) delete mode 100644 RecoBTag/Combined/python/hiRun2LegacyCSVv2_helpers.py delete mode 100644 RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingvars.py rename RecoBTag/Combined/src/{hiRun2LegacyCSVv2Tagger.cc => heavyIonCSVTagger.cc} (58%) diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index 67f426266176c..04ff06aad908c 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -32,7 +32,7 @@ from RecoBTag.SecondaryVertex.simpleSecondaryVertex2TrkComputer_cfi import * from RecoBTag.SecondaryVertex.simpleSecondaryVertex3TrkComputer_cfi import * from RecoBTag.SecondaryVertex.combinedSecondaryVertexV2Computer_cfi import * -from RecoBTag.Combined.hiRun2LegacyCSVv2Computer_cfi import * +from RecoBTag.Combined.heavyIonCSVComputer_cfi import * from RecoBTag.ImpactParameter.jetBProbabilityComputer_cfi import * from RecoBTag.ImpactParameter.jetProbabilityComputer_cfi import * from RecoBTag.ImpactParameter.trackCounting3D2ndComputer_cfi import * diff --git a/RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h b/RecoBTag/Combined/interface/heavyIonCSVTagger.h similarity index 73% rename from RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h rename to RecoBTag/Combined/interface/heavyIonCSVTagger.h index 7e8c7b7966580..e42b36b17a38a 100644 --- a/RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h +++ b/RecoBTag/Combined/interface/heavyIonCSVTagger.h @@ -1,23 +1,24 @@ -#ifndef RecoBTag_Combined_hiRun2LegacyCSVv2Tagger_h -#define RecoBTag_Combined_hiRun2LegacyCSVv2Tagger_h +#ifndef RecoBTag_Combined_heavyIonCSVTagger_h +#define RecoBTag_Combined_heavyIonCSVTagger_h #include "FWCore/Framework/interface/ESConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "CommonTools/MVAUtils/interface/TMVAEvaluator.h" #include "RecoBTau/JetTagComputer/interface/JetTagComputer.h" -#include "RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h" +#include "RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h" +//#include "RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h" #include "DataFormats/BTauReco/interface/TaggingVariable.h" #include "RecoBTau/JetTagComputer/interface/JetTagComputerRecord.h" #include <memory> #include <type_traits> -/** \class hiRun2LegacyCSVv2Tagger +/** \class HeavyIonCSVTagger * \author M. Nguyen * copied from CharmTagger.h (by M. Verzetti) */ -class hiRun2LegacyCSVv2Tagger : public JetTagComputer { +class HeavyIonCSVTagger : public JetTagComputer { public: struct Tokens { Tokens(const edm::ParameterSet& configuration, edm::ESConsumesCollector&& cc); @@ -25,8 +26,8 @@ class hiRun2LegacyCSVv2Tagger : public JetTagComputer { }; /// explicit ctor - hiRun2LegacyCSVv2Tagger(const edm::ParameterSet&, Tokens); - ~hiRun2LegacyCSVv2Tagger() override; //{} + HeavyIonCSVTagger(const edm::ParameterSet&, Tokens); + ~HeavyIonCSVTagger() override; //{} float discriminator(const TagInfoHelper& tagInfo) const override; void initialize(const JetTagComputerRecord& record) override; @@ -42,7 +43,7 @@ class hiRun2LegacyCSVv2Tagger : public JetTagComputer { private: std::unique_ptr<TMVAEvaluator> mvaID_; - CombinedSVSoftLeptonComputer sl_computer_; + //CombinedSVSoftLeptonComputer sl_computer_; CombinedSVComputer sv_computer_; std::vector<MVAVar> variables_; diff --git a/RecoBTag/Combined/plugins/heavyIonCSVESProducer.cc b/RecoBTag/Combined/plugins/heavyIonCSVESProducer.cc new file mode 100644 index 0000000000000..4349cf10737ed --- /dev/null +++ b/RecoBTag/Combined/plugins/heavyIonCSVESProducer.cc @@ -0,0 +1,8 @@ +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "RecoBTau/JetTagComputer/interface/JetTagComputerESProducer.h" +#include "RecoBTag/Combined/interface/heavyIonCSVTagger.h" + +typedef JetTagComputerESProducer<HeavyIonCSVTagger> heavyIonCSVESProducer; +DEFINE_FWK_EVENTSETUP_MODULE(heavyIonCSVESProducer); diff --git a/RecoBTag/Combined/plugins/hiRun2LegacyCSVv2ESProducer.cc b/RecoBTag/Combined/plugins/hiRun2LegacyCSVv2ESProducer.cc deleted file mode 100644 index 7492f61e0953f..0000000000000 --- a/RecoBTag/Combined/plugins/hiRun2LegacyCSVv2ESProducer.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include "FWCore/Framework/interface/ModuleFactory.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "RecoBTau/JetTagComputer/interface/JetTagComputerESProducer.h" -#include "RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h" - -typedef JetTagComputerESProducer<hiRun2LegacyCSVv2Tagger> hiRun2LegacyCSVv2ESProducer; -DEFINE_FWK_EVENTSETUP_MODULE(hiRun2LegacyCSVv2ESProducer); diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2Computer_cfi.py b/RecoBTag/Combined/python/heavyIonCSVComputer_cfi.py similarity index 55% rename from RecoBTag/Combined/python/hiRun2LegacyCSVv2Computer_cfi.py rename to RecoBTag/Combined/python/heavyIonCSVComputer_cfi.py index aa053e319ea02..bb45e81a5a867 100644 --- a/RecoBTag/Combined/python/hiRun2LegacyCSVv2Computer_cfi.py +++ b/RecoBTag/Combined/python/heavyIonCSVComputer_cfi.py @@ -1,18 +1,15 @@ import FWCore.ParameterSet.Config as cms -import RecoBTag.SecondaryVertex.candidateCombinedSecondaryVertexV2Computer_cfi as sl_cfg -from RecoBTag.Combined.hiRun2LegacyCSVv2_trainingSettings import hiRun2LegacyCSVv2_vpset -from RecoBTag.Combined.hiRun2LegacyCSVv2_helpers import get_vars +import RecoBTag.SecondaryVertex.candidateCombinedSecondaryVertexV2Computer_cfi as sv_cfg +from RecoBTag.Combined.heavyIonCSV_trainingSettings import heavyIonCSV_vpset - -hiRun2LegacyCSVv2Computer = cms.ESProducer( - 'hiRun2LegacyCSVv2ESProducer', - slComputerCfg = cms.PSet( - **sl_cfg.candidateCombinedSecondaryVertexV2Computer.parameters_() +heavyIonCSVComputer = cms.ESProducer( + 'heavyIonCSVESProducer', + sv_cfg = cms.PSet( + **sv_cfg.candidateCombinedSecondaryVertexV2Computer.parameters_() ), weightFile = cms.FileInPath('RecoBTag/Combined/data/TMVA_Btag_CsJets_PbPb2018_BDTG.weights.xml'), - variables = hiRun2LegacyCSVv2_vpset, - computer = cms.ESInputTag('dummy:dummy'), + variables = heavyIonCSV_vpset, tagInfos = cms.VInputTag( cms.InputTag('impactParameterTagInfos'), cms.InputTag('secondaryVertexFinderTagInfos'), diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2JetTags_cfi.py b/RecoBTag/Combined/python/heavyIonCSVJetTags_cfi.py similarity index 66% rename from RecoBTag/Combined/python/hiRun2LegacyCSVv2JetTags_cfi.py rename to RecoBTag/Combined/python/heavyIonCSVJetTags_cfi.py index fc4862fe08647..2b601e9317eeb 100644 --- a/RecoBTag/Combined/python/hiRun2LegacyCSVv2JetTags_cfi.py +++ b/RecoBTag/Combined/python/heavyIonCSVJetTags_cfi.py @@ -1,12 +1,10 @@ import FWCore.ParameterSet.Config as cms -hiRun2LegacyCSVv2JetTags = cms.EDProducer( +heavyIonCSVJetTags = cms.EDProducer( "JetTagProducer", - jetTagComputer = cms.string('hiRun2LegacyCSVv2Tags'), + jetTagComputer = cms.string('heavyIonCSVTags'), tagInfos = cms.VInputTag( cms.InputTag('impactParameterTagInfos'), cms.InputTag('secondaryVertexFinderTagInfos'), ) ) - - diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingSettings.py b/RecoBTag/Combined/python/heavyIonCSV_trainingSettings.py similarity index 99% rename from RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingSettings.py rename to RecoBTag/Combined/python/heavyIonCSV_trainingSettings.py index 0cd9539d99817..9dca13d8fb225 100644 --- a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingSettings.py +++ b/RecoBTag/Combined/python/heavyIonCSV_trainingSettings.py @@ -1,5 +1,5 @@ import FWCore.ParameterSet.Config as cms -hiRun2LegacyCSVv2_vpset = cms.VPSet([ +heavyIonCSV_vpset = cms.VPSet([ cms.PSet( default = cms.double(-100), idx = cms.int32(0), diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_helpers.py b/RecoBTag/Combined/python/hiRun2LegacyCSVv2_helpers.py deleted file mode 100644 index 2dea109fcc29a..0000000000000 --- a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_helpers.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -from RecoBTag.Combined.hiRun2LegacyCSVv2_trainingvars import get_var_pset -import xml.etree.ElementTree as ET -from pdb import set_trace - -def get_path(file_in_path): - 'mimics edm.FileInPath behavior' - search_env = os.environ.get('CMSSW_SEARCH_PATH', '') - if not search_env: - raise RuntimeError('The environmental variable CMSSW_SEARCH_PATH must be set') - search_paths = search_env.split(':') - for spath in search_paths: - full_path = os.path.join(spath, file_in_path) - if os.path.isfile(full_path): - return full_path - raise RuntimeError('No suitable path found for %s' % file_in_path) - -def get_vars(xml_path, useFileInPath=True): - full_path = get_path(xml_path) if useFileInPath else xml_path - xml_tree = ET.parse(full_path) - root = xml_tree.getroot() - variables = None - for i in root: - if i.tag == 'Variables': - variables = i - - if i is None: - raise RuntimeError('Could not find Variables inside the xml weights') - - var_names = [i.attrib['Title'] for i in variables] - return [get_var_pset(i) for i in var_names] - diff --git a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingvars.py b/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingvars.py deleted file mode 100644 index d5ef7f6809e6d..0000000000000 --- a/RecoBTag/Combined/python/hiRun2LegacyCSVv2_trainingvars.py +++ /dev/null @@ -1,143 +0,0 @@ -import re -import FWCore.ParameterSet.Config as cms - -training_vars = { - 'muonMultiplicity': {'default': -1, 'type': 'i'}, - 'trackPPar': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'flightDistance3dSig': {'default': -1, 'max_idx': 1, 'type': 'f'}, - 'trackSip2dVal': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'vertexBoostOverSqrtJetPt': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, - 'trackEtaRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'vertexMass': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, - 'trackDecayLenVal': {'default': -0.1, 'max_idx': 3, 'type': 'f'}, - 'trackJetPt': {'default': -1, 'type': 'f'}, - 'neutralHadronMultiplicity': {'default': -1, 'type': 'i'}, - 'flightDistance3dVal': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, - 'trackJetDist': {'default': -0.1, 'max_idx': 3, 'type': 'f'}, - 'leptonSip3d': {'default': -10000, 'max_idx': 3, 'type': 'f'}, - 'neutralHadronEnergyFraction': {'default': -0.1, 'type': 'f'}, - 'trackPtRatio': {'default': -0.1, 'max_idx': 3, 'type': 'f'}, - 'hadronMultiplicity': {'default': -1, 'type': 'i'}, - 'trackSumJetEtRatio': {'default': -0.1, 'type': 'f'}, - 'vertexJetDeltaR': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, - 'leptonRatioRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'chargedHadronMultiplicity': {'default': -1, 'type': 'i'}, - 'jetNTracks': {'default': -0.1, 'type': 'i'}, - 'trackDeltaR': {'default': -0.1, 'max_idx': 3, 'type': 'f'}, - 'vertexFitProb': {'default': -1, 'max_idx': 1, 'type': 'f'}, - 'trackSip3dValAboveCharm': {'default': -1, 'max_idx': 1, 'type': 'f'}, - 'jetEta': {'default': -3, 'type': 'f'}, - 'leptonDeltaR': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'hadronPhotonMultiplicity': {'default': -1, 'type': 'i'}, - 'leptonPtRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'flightDistance2dVal': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, - 'trackSumJetDeltaR': {'default': -0.1, 'type': 'f'}, - 'photonMultiplicity': {'default': -1, 'type': 'i'}, - 'chargedHadronEnergyFraction': {'default': -0.1, 'type': 'f'}, - 'trackSip3dSigAboveQuarterCharm': {'default': -999, 'max_idx': 1, 'type': 'f'}, - 'vertexLeptonCategory': {'default': -1, 'type': 'i'}, - 'massVertexEnergyFraction': {'default': -0.1, 'max_idx': 1, 'type': 'f'}, - 'trackSip2dSig': {'default': -100, 'max_idx': 3, 'type': 'f'}, - 'flightDistance2dSig': {'default': -1, 'max_idx': 1, 'type': 'f'}, - 'jetPt': {'default': -1, 'type': 'f'}, - 'totalMultiplicity': {'default': -1, 'type': 'i'}, - 'trackSip2dValAboveCharm': {'default': -1, 'max_idx': 1, 'type': 'f'}, - 'electronEnergyFraction': {'default': -0.1, 'type': 'f'}, - 'jetNSecondaryVertices': {'default': 0, 'type': 'i'}, - 'trackSip2dSigAboveCharm': {'default': -999, 'max_idx': 1, 'type': 'f'}, - 'vertexCategory': {'default': -1, 'type': 'i'}, - 'vertexEnergyRatio': {'default': -10, 'max_idx': 1, 'type': 'f'}, - 'photonEnergyFraction': {'default': -0.1, 'type': 'f'}, - 'flavour': {'default': -1, 'type': 'i'}, - 'muonEnergyFraction': {'default': -0.1, 'type': 'f'}, - 'vertexNTracks': {'default': 0, 'max_idx': 1, 'type': 'i'}, - 'trackSip2dSigAboveQuarterCharm': {'default': -999, 'max_idx': 1, 'type': 'f'}, - 'trackSip3dVal': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'leptonRatio': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'trackPtRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'leptonEtaRel': {'default': -1, 'max_idx': 3, 'type': 'f'}, - 'trackPParRatio': {'default': 1.1, 'max_idx': 3, 'type': 'f'}, - 'trackSip3dSig': {'default': -100, 'max_idx': 3, 'type': 'f'}, - 'trackSip3dSigAboveCharm': {'default': -999, 'max_idx': 1, 'type': 'f'}, - 'electronMultiplicity': {'default': -1, 'type': 'i'} -} - -#tv = {} -#for k,v in training_vars.items(): -# tv['TagVarCSV_'+k] = v -#training_vars = tv - -# -# This could be a python class, but given it only used to convert the previous dict -# to CMSSW format I think is overkill -# -varname_regex_=re.compile(r'TagVarCSV_(?P<name>[a-zA-Z0-9]+)(:?_(?P<idx>\d+))?$') -def var_match(varname): - '''matches the name used in the MVA training to - get the TaggingVariableName and index''' - - print "printing varname_regex" - print "*************************************" - print varname_regex_ - print "*************************************" - print "printed varname_regex" - #return - - match = varname_regex_.match(varname) - if not match: - raise ValueError( - 'Variable name {0} does not match ' - 'the default regular expression'.format(varname) - ) - return match - -def get_var_name(varname): - #return varname - 'returns the TaggingVariableName of a MVA Name' - print('testintg ... '+varname) - match = var_match(varname) - name = match.group('name') - if name not in training_vars: - raise ValueError( - 'Variable name {0}, matched to name {1}, ' - 'is not among the known trainig variables.'.format( - varname, name) - ) - return name - -def get_var_default(varname): - 'returns the default value used in the traing' - name = get_var_name(varname) - return training_vars[name]['default'] - -def get_var_idx(varname): - 'returns the index in case of vectorial TaggingVariableName' - match = var_match(varname) - idx = match.group('idx') - return int(idx) if idx else None - -def get_var_pset(mvaname): - print "mvaname = ", mvaname - 'returns the cms.PSet to be used by CharmTaggerESProducer' - pset = cms.PSet( - name = cms.string(mvaname), - taggingVarName = cms.string(get_var_name(mvaname)), - default = cms.double(get_var_default(mvaname)) - ) - idx = get_var_idx(mvaname) - if idx is not None: - pset.idx = cms.int32(idx) - return pset - -if __name__ == '__main__': - assert(varname_regex_.match('leptonEtaRel_10').groupdict() == {'name': 'leptonEtaRel', 'idx': '10'}) - assert(varname_regex_.match('leptonEtaRel_1').groupdict() == {'name': 'leptonEtaRel', 'idx': '1'}) - assert(varname_regex_.match('leptonEtaRel').groupdict() == {'name': 'leptonEtaRel', 'idx': None}) - assert(varname_regex_.match('lepton_EtaRel') == None) - - assert(get_var_default('leptonEtaRel_10') == training_vars['leptonEtaRel']['default']) - assert(get_var_default('electronMultiplicity') == training_vars['electronMultiplicity']['default']) - assert(get_var_idx('leptonEtaRel_10') == 10) - assert(get_var_idx('leptonEtaRel_3') == 3) - assert(get_var_idx('FOOBAR') == None) - diff --git a/RecoBTag/Combined/src/hiRun2LegacyCSVv2Tagger.cc b/RecoBTag/Combined/src/heavyIonCSVTagger.cc similarity index 58% rename from RecoBTag/Combined/src/hiRun2LegacyCSVv2Tagger.cc rename to RecoBTag/Combined/src/heavyIonCSVTagger.cc index 38d5a690c9e7a..46288e92310b7 100644 --- a/RecoBTag/Combined/src/hiRun2LegacyCSVv2Tagger.cc +++ b/RecoBTag/Combined/src/heavyIonCSVTagger.cc @@ -1,22 +1,15 @@ -#include "RecoBTag/Combined/interface/hiRun2LegacyCSVv2Tagger.h" - -#include "DataFormats/BTauReco/interface/CandSoftLeptonTagInfo.h" +#include "RecoBTag/Combined/interface/heavyIonCSVTagger.h" #include "DataFormats/BTauReco/interface/CandIPTagInfo.h" #include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h" #include "FWCore/Utilities/interface/ESInputTag.h" #include "CondFormats/DataRecord/interface/GBRWrapperRcd.h" - -#include <iostream> #include <memory> - #include <algorithm> -#include <iostream> #include <map> #include <vector> -const bool PbPbdebug = false; -hiRun2LegacyCSVv2Tagger::Tokens::Tokens(const edm::ParameterSet &configuration, edm::ESConsumesCollector &&cc) { +HeavyIonCSVTagger::Tokens::Tokens(const edm::ParameterSet &configuration, edm::ESConsumesCollector &&cc) { if (configuration.getParameter<bool>("useCondDB")) { gbrForest_ = cc.consumes(edm::ESInputTag{"", configuration.existsAs<std::string>("gbrForestLabel") @@ -24,10 +17,9 @@ hiRun2LegacyCSVv2Tagger::Tokens::Tokens(const edm::ParameterSet &configuration, : ""}); } } - -hiRun2LegacyCSVv2Tagger::hiRun2LegacyCSVv2Tagger(const edm::ParameterSet &configuration, Tokens tokens) - : sl_computer_(configuration.getParameter<edm::ParameterSet>("slComputerCfg")), - sv_computer_(configuration.getParameter<edm::ParameterSet>("slComputerCfg")), +//sl_computer_(configuration.getParameter<edm::ParameterSet>("slComputerCfg")), +HeavyIonCSVTagger::HeavyIonCSVTagger(const edm::ParameterSet &configuration, Tokens tokens) + : sv_computer_(configuration.getParameter<edm::ParameterSet>("sv_cfg")), mva_name_(configuration.getParameter<std::string>("mvaName")), weight_file_(configuration.getParameter<edm::FileInPath>("weightFile")), use_GBRForest_(configuration.getParameter<bool>("useGBRForest")), @@ -44,11 +36,6 @@ hiRun2LegacyCSVv2Tagger::hiRun2LegacyCSVv2Tagger(const edm::ParameterSet &config mva_var.index = mva_var.has_index ? var.getParameter<int>("idx") : 0; mva_var.default_value = var.getParameter<double>("default"); - if (PbPbdebug) - std::cout << "hiRun2LegacyCSVv2:mva_var.id =" << mva_var.id - << " var.getParameter(taggingVarName)=" << var.getParameter<std::string>("taggingVarName") - << " index = " << mva_var.index << std::endl; - variables_.push_back(mva_var); } @@ -56,7 +43,7 @@ hiRun2LegacyCSVv2Tagger::hiRun2LegacyCSVv2Tagger(const edm::ParameterSet &config uses(1, "secondaryVertexTagInfos"); } -void hiRun2LegacyCSVv2Tagger::initialize(const JetTagComputerRecord &record) { +void HeavyIonCSVTagger::initialize(const JetTagComputerRecord &record) { mvaID_ = std::make_unique<TMVAEvaluator>(); std::vector<std::string> variable_names; @@ -80,26 +67,20 @@ void hiRun2LegacyCSVv2Tagger::initialize(const JetTagComputerRecord &record) { } } -hiRun2LegacyCSVv2Tagger::~hiRun2LegacyCSVv2Tagger() {} +HeavyIonCSVTagger::~HeavyIonCSVTagger() {} /// b-tag a jet based on track-to-jet parameters in the extened info collection -float hiRun2LegacyCSVv2Tagger::discriminator(const TagInfoHelper &tagInfo) const { +float HeavyIonCSVTagger::discriminator(const TagInfoHelper &tagInfo) const { // default value, used if there are no leptons associated to this jet const reco::TrackIPTagInfo &ip_info = tagInfo.get<reco::TrackIPTagInfo>(0); const reco::SecondaryVertexTagInfo &sv_info = tagInfo.get<reco::SecondaryVertexTagInfo>(1); reco::TaggingVariableList vars = sv_computer_(ip_info, sv_info); - + // Loop over input variables std::map<std::string, float> inputs; - - //For debugging; - float save_pt_value = -1.0; - float save_eta_value = -999.0; - bool passes_cuts = false; - + bool notTaggable = false; bool noTrack = false; - bool printdebug = false; float vtxMassVal = 0.; for (auto &mva_var : variables_) { @@ -107,69 +88,23 @@ float hiRun2LegacyCSVv2Tagger::discriminator(const TagInfoHelper &tagInfo) const if (mva_var.has_index) { std::vector<float> vals = vars.getList(mva_var.id, false); inputs[mva_var.name] = (vals.size() > mva_var.index) ? vals[mva_var.index] : mva_var.default_value; - - if (mva_var.name == "TagVarCSV_trackSip3dSig_0" && inputs[mva_var.name] < -98.999) - noTrack = true; - if (passes_cuts) { - if (printdebug) - std::cout << inputs[mva_var.name] << "\t"; - } - - if (mva_var.name == "Jet_pt") { - save_pt_value = inputs[mva_var.name]; - } - - if (mva_var.name == "Jet_eta") { - save_eta_value = inputs[mva_var.name]; - passes_cuts = (save_pt_value > 30 && save_eta_value > -2.4 && save_eta_value < 2.4); - if (printdebug) { - if (passes_cuts) - std::cout << save_pt_value << "\t" << save_eta_value << "\t"; - } - } - + if (mva_var.name == "TagVarCSV_trackSip3dSig_0" && inputs[mva_var.name] < -98.999) noTrack = true; } //single value tagging var else { inputs[mva_var.name] = vars.get(mva_var.id, mva_var.default_value); - //IK: vtxMass check to check vtxType: vtxType = 2 (no vtx), vtxMass < 0, vtxType = 1 (pseudo vtx), vtxMass > 0 - if (mva_var.name == "TagVarCSV_vertexMass") { - vtxMassVal = inputs[mva_var.name]; - } - - if (passes_cuts) { - if (printdebug) - std::cout << inputs[mva_var.name] << "\t"; - } + if (mva_var.name == "TagVarCSV_vertexMass") vtxMassVal = inputs[mva_var.name]; } } //IK: if no reco vtx (including pseudo vtx) and no tracks passing all selections (including K0s veto) -> jet is not taggable - - if (vtxMassVal < 0 && noTrack) { - notTaggable = true; - } + if (vtxMassVal < 0 && noTrack) notTaggable = true; //get the MVA output - float tag = (mvaID_->evaluate(inputs) + 1) / 2.; - if (printdebug) { - if (passes_cuts) - std::cout << tag << "\n"; - } - - if (notTaggable) { - tag = -1; - if (PbPbdebug) - std::cout << " --- jet not taggable" << std::endl; - } + float tag = (mvaID_->evaluate(inputs) + 1.) / 2.; - if (PbPbdebug) { - std::cout << "Looking at a jet of " << save_pt_value << " GeV" << std::endl; - for (const auto &x : inputs) - std::cout << "Variable = " << x.first << " value = " << x.second << std::endl; - std::cout << " --- Result : " << tag << std::endl; - } + if (notTaggable) tag = -1; return tag; } diff --git a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2BJetTags_cfi.py b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2BJetTags_cfi.py index ebcf23c1ae87b..edaf62b09956f 100644 --- a/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2BJetTags_cfi.py +++ b/RecoBTag/SecondaryVertex/python/combinedSecondaryVertexV2BJetTags_cfi.py @@ -6,4 +6,4 @@ cms.InputTag("secondaryVertexTagInfos")) ) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(combinedSecondaryVertexV2BJetTags,jetTagComputer = 'hiRun2LegacyCSVv2Computer') +pp_on_AA_2018.toModify(combinedSecondaryVertexV2BJetTags,jetTagComputer = 'heavyIonCSVComputer') From 714fcedc7632b65794e6d46aa7252aef92aad10e Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 6 Oct 2020 21:58:15 +0200 Subject: [PATCH 276/778] Add PU correction method for isotrack calibration --- Calibration/HcalCalibAlgos/macros/CalibCorr.C | 11 +- .../HcalCalibAlgos/macros/CalibFitPlots.C | 217 +++++++- Calibration/HcalCalibAlgos/macros/CalibSort.C | 526 +++++++++++++++++- .../macros/isotrackRootTreeMaker.py | 131 +++++ 4 files changed, 872 insertions(+), 13 deletions(-) create mode 100644 Calibration/HcalCalibAlgos/macros/isotrackRootTreeMaker.py diff --git a/Calibration/HcalCalibAlgos/macros/CalibCorr.C b/Calibration/HcalCalibAlgos/macros/CalibCorr.C index 462c861d98f05..961303adcbcd9 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibCorr.C +++ b/Calibration/HcalCalibAlgos/macros/CalibCorr.C @@ -30,19 +30,20 @@ // bool isItRBX(detId): if it/they is in the chosen RBX // bool isItRBX(ieta, iphi): if it is in the chosen RBX // void CalibCorrTest(infile, flag) -// Tests a file which contains correction factors used by CalibCorr +// Tests a file which contains correction factors used by CalibCorr ////////////////////////////////////////////////////////////////////////////// #include <algorithm> -#include <map> -#include <vector> -#include <string> #include <iomanip> #include <iostream> #include <fstream> #include <sstream> -#include <TROOT.h> +#include <map> +#include <string> +#include <vector> + #include <TChain.h> +#include <TROOT.h> void unpackDetId(unsigned int detId, int& subdet, int& zside, int& ieta, int& iphi, int& depth) { // The maskings are defined in DataFormats/DetId/interface/DetId.h diff --git a/Calibration/HcalCalibAlgos/macros/CalibFitPlots.C b/Calibration/HcalCalibAlgos/macros/CalibFitPlots.C index 78cdc7121d158..f40701e234706 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibFitPlots.C +++ b/Calibration/HcalCalibAlgos/macros/CalibFitPlots.C @@ -81,16 +81,27 @@ // PlotHistCorrLumis(infilec, conds, lumi, save) // Defaults: save=false // -// For plottong correlation of correction factors +// For plotting correlation of correction factors // PlotHistCorrRel(infile1, infile2, text1, text2, save) // Defaults: save=false // -// For plottong four histograms +// For plotting four histograms // PlotFourHists(infile, prefix0, type, drawStatBox, normalize, save, prefix1, // text1, prefix2, text2, prefix3, text3, prefix4, text4) // Defaults: type=0, drawStatBox=0, normalize=false, save=false, // prefixN="", textN="" // +// For plotting PU corrected histograms (o/p of CalibPlotCombine) +// PlotPUCorrHists(infile, prefix drawStatBox, approve, save) +// Defaults: infile = "corrfac.root", prefix = "", drawStatBox = 0, +// approve = true, save = false +// +// For plotting histograms obtained from fits to PU correction +// (o/p of CalibFitPU) for a given ieta using 2D/profile/Graphs +// PlotHistCorr(infile, prefix, text, eta, mode, drawStatBox, save) +// Defaults eta = 0 (all ieta values), mode = 1 (profile histograms), +// drawStatBox = true, save = false +// // where: // infile (std::string) = Name of the input ROOT file // outfile (std::string) = Name of the output ROOT file @@ -2629,3 +2640,205 @@ void PlotFourHists(std::string infile, } } } + +void PlotPUCorrHists(std::string infile = "corrfac.root", + std::string prefix = "", + int drawStatBox = 0, + bool approve = true, + bool save = false) { + std::string name1[4] = {"W0", "W1", "W2", "P"}; + std::string name2[4] = {"All", "Barrel", "Endcap", ""}; + std::string name3[2] = {"", "p = 40:60 GeV"}; + std::string name4[2] = {"Loose Isolation", "Tight Isolation"}; + std::string xtitle[4] = {"Correction Factor", "Correction Factor", + "Correction Factor", "i#eta"}; + std::string ytitle[4] = {"Tracks", "Tracks", "Tracks", "Correction Factor"}; + + gStyle->SetCanvasBorderMode(0); + gStyle->SetCanvasColor(kWhite); + gStyle->SetPadColor(kWhite); + gStyle->SetFillColor(kWhite); + gStyle->SetOptTitle(0); + gStyle->SetOptFit(0); + if (drawStatBox == 0) + gStyle->SetOptStat(0); + else + gStyle->SetOptStat(1110); + + char name[100], namep[100], title[100]; + TFile* file = new TFile(infile.c_str()); + + if (file != nullptr) { + for (int i1 = 0; i1 < 4; ++i1) { + for (int i2 = 0; i2 < 2; ++i2) { + for (int i3 = 0; i3 < 2; ++i3) { + sprintf (name, "%s%d%d", name1[i1].c_str(), i2, i3); + if (i2 == 0) + sprintf (title, "%s Tracks Selected with %s", name2[i1].c_str(), name4[i3].c_str()); + else + sprintf (title, "%s Tracks Selected with %s (%s)", name2[i1].c_str(), name4[i3].c_str(), name3[i2].c_str()); + TH1D* hist1(nullptr); + TProfile* hist2(nullptr); + if (i1 != 3) { + TH1D* hist = (TH1D*)file->FindObjectAny(name); + if (hist != nullptr) { + hist1 = (TH1D*)(hist->Clone()); + hist1->GetXaxis()->SetTitleSize(0.040); + hist1->GetXaxis()->SetTitle(xtitle[i1].c_str()); + hist1->GetYaxis()->SetTitle(ytitle[i1].c_str()); + hist1->GetYaxis()->SetLabelOffset(0.005); + hist1->GetYaxis()->SetLabelSize(0.035); + hist1->GetYaxis()->SetTitleSize(0.040); + hist1->GetYaxis()->SetTitleOffset(1.15); + } + } else { + TProfile* hist = (TProfile*)file->FindObjectAny(name); + if (hist != nullptr) { + hist2 = (TProfile*)(hist->Clone()); + hist2->GetXaxis()->SetTitleSize(0.040); + hist2->GetXaxis()->SetTitle(xtitle[i1].c_str()); + hist2->GetYaxis()->SetTitle(ytitle[i1].c_str()); + hist2->GetYaxis()->SetLabelOffset(0.005); + hist2->GetYaxis()->SetLabelSize(0.035); + hist2->GetYaxis()->SetTitleSize(0.040); + hist2->GetYaxis()->SetTitleOffset(1.15); +// hist2->GetYaxis()->SetRangeUser(0.0, 1.5); + hist2->SetMarkerStyle(20); + } + } + if ((hist1 != nullptr) || (hist2 != nullptr)) { + sprintf(namep, "c_%s%s", name, prefix.c_str()); + TCanvas* pad = new TCanvas(namep, namep, 700, 500); + pad->SetRightMargin(0.10); + pad->SetTopMargin(0.10); + if (hist1 != nullptr) { + pad->SetLogy(); + hist1->Draw(); + pad->Update(); + TPaveStats* st1 = (TPaveStats*)hist1->GetListOfFunctions()->FindObject("stats"); + if (st1 != nullptr) { + st1->SetY1NDC(0.77); + st1->SetY2NDC(0.90); + st1->SetX1NDC(0.70); + st1->SetX2NDC(0.90); + } + } else { + hist2->Draw(); + pad->Update(); + } + TPaveText* txt1 = new TPaveText(0.10, 0.905, 0.80, 0.95, "blNDC"); + txt1->SetFillColor(0); + char txt[100]; + sprintf(txt, "%s", title); + txt1->AddText(txt); + txt1->Draw("same"); + if (approve) { + double xoff = (i1 == 3) ? 0.11 : 0.22; + TPaveText *txt2 = new TPaveText(xoff,0.825,xoff+0.22,0.895,"blNDC"); + txt2->SetFillColor(0); + sprintf (txt, "CMS Preliminary"); + txt2->AddText(txt); + txt2->Draw("same"); + } + pad->Modified(); + pad->Update(); + if (save) { + sprintf(name, "%s.pdf", pad->GetName()); + pad->Print(name); + } + } + } + } + } + } +} + +void PlotHistCorr(const char* infile, std::string prefix, std::string text0, + int eta = 0, int mode = 1, bool drawStatBox = true, + bool save = false) { + gStyle->SetCanvasBorderMode(0); + gStyle->SetCanvasColor(kWhite); + gStyle->SetPadColor(kWhite); + gStyle->SetFillColor(kWhite); + gStyle->SetOptTitle(0); + if (drawStatBox) + gStyle->SetOptStat(1100); + else + gStyle->SetOptStat(0); + + std::string tags[3] = {"UnNoPU", "UnPU", "Cor"}; + std::string text[3] = {"Uncorrected no PU", "Uncorrected PU", "Corrected PU"}; + int colors[3] = {1, 4, 2}; + int styles[3] = {1, 3, 2}; + TFile* file = new TFile(infile); + if (mode < 0 || mode > 2) mode = 1; + int etamin = (eta == 0) ? -27 : eta; + int etamax = (eta == 0) ? 27 : eta; + for (int ieta = etamin; ieta <= etamax; ++ieta) { + char name[20]; + double yh(0.90), dy(0.09); + double yh1 = drawStatBox ? (yh - 3 * dy - 0.01) : (yh - 0.01); + TLegend* legend = new TLegend(0.55, yh1 - 0.15, 0.89, yh1); + legend->SetFillColor(kWhite); + sprintf(name, "c_%sEovp%d", prefix.c_str(), ieta); + TCanvas* pad = new TCanvas(name, name, 700, 500); + pad->SetRightMargin(0.10); + pad->SetTopMargin(0.10); + TH1D* hist[3]; + double ymax(0); + for (int k = 0; k < 3; ++k) { + if (k < 2) + sprintf (name, "EovP_ieta%d%s", ieta, tags[k].c_str()); + else + sprintf (name, "EovP_ieta%dCor%dPU", ieta, mode); + TH1D* hist1 = (TH1D*)file->FindObjectAny(name); + if (hist1 != nullptr) { + hist[k] = (TH1D*)(hist1->Clone()); + ymax = std::max(ymax, (hist1->GetMaximum())); + } + } + int imax = 10 * (2 + int(0.1 * ymax)); + for (int k = 0; k < 3; ++k) { + hist[k]->GetYaxis()->SetLabelOffset(0.005); + hist[k]->GetYaxis()->SetTitleOffset(1.20); + hist[k]->GetXaxis()->SetTitle("E/p"); + hist[k]->GetYaxis()->SetTitle("Tracks"); + hist[k]->SetLineColor(colors[k]); + hist[k]->SetLineStyle(styles[k]); + hist[k]->GetYaxis()->SetRangeUser(0.0, imax); + if (k == 0) + hist[k]->Draw(); + else + hist[k]->Draw("sames"); + legend->AddEntry(hist[k], text[k].c_str(), "lp"); + pad->Update(); + if (drawStatBox) { + TPaveStats* st1 = (TPaveStats*)hist[k]->GetListOfFunctions()->FindObject("stats"); + if (st1 != nullptr) { + st1->SetLineColor(colors[k]); + st1->SetTextColor(colors[k]); + st1->SetY1NDC(yh - dy); + st1->SetY2NDC(yh); + st1->SetX1NDC(0.70); + st1->SetX2NDC(0.90); + yh -= dy; + } + } + } + pad->Update(); + legend->Draw("same"); + pad->Update(); + TPaveText* txt1 = new TPaveText(0.10, 0.905, 0.80, 0.95, "blNDC"); + txt1->SetFillColor(0); + char title[100]; + sprintf (title, "%s for i#eta = %d", text0.c_str(), ieta); + txt1->AddText(title); + txt1->Draw("same"); + pad->Modified(); + pad->Update(); + if (save) { + sprintf(name, "%s.pdf", pad->GetName()); + pad->Print(name); + } + } +} diff --git a/Calibration/HcalCalibAlgos/macros/CalibSort.C b/Calibration/HcalCalibAlgos/macros/CalibSort.C index cf28bd516b0fd..695c76cc9c4af 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibSort.C +++ b/Calibration/HcalCalibAlgos/macros/CalibSort.C @@ -81,27 +81,43 @@ // append (bool) = true/false if the histogram file to be opened // in append/output mode // +// .L CalibSort.C+g (for the o/p of isotrackRootTreeMaker.py) +// CalibFitPU c1(fname) +// c1.Loop(extractPUparams, fileName) +// +// fname (const char*)= file name of the input ROOT tree which is +// output of isotrackRootTreeMaker.py +// extractPUparams (bool) = flag to see if extraction is needed +// filename (std::string)= root name of all files to be created/read +// (_par2d.txt, _parProf.txt, _parGraph.txt +// will be names of files of parameters from +// 2D, profile, graphs; .root for storing all +// histograms created) +// ////////////////////////////////////////////////////////////////////////////// -#include <TROOT.h> +#include <TCanvas.h> #include <TChain.h> -#include <TFile.h> #include <TF1.h> -#include <TH1D.h> -#include <TProfile.h> +#include <TFile.h> #include <TFitResult.h> #include <TFitResultPtr.h> -#include <TStyle.h> -#include <TCanvas.h> +#include <TGraph.h> +#include <TH1D.h> +#include <TH2D.h> #include <TLegend.h> #include <TPaveStats.h> #include <TPaveText.h> +#include <TProfile.h> +#include <TROOT.h> +#include <TStyle.h> #include <algorithm> #include <fstream> #include <iomanip> #include <iostream> #include <map> +#include <sstream> #include <string> #include <vector> @@ -1400,3 +1416,501 @@ void CalibPlotCombine::savePlot(const std::string &theName, bool append) { std::cout << "All done" << std::endl; theFile->Close(); } + +class CalibFitPU { +private: + TTree *fChain; //!pointer to the analyzed TTree or TChain + Int_t fCurrent; //!current Tree number in a TChain + + // Fixed size dimensions of array or collections stored in the TTree if any. + + // Declaration of leaf types + Int_t t_Event; + Double_t t_p_PU; + Double_t t_eHcal_PU; + Double_t t_delta_PU; + Double_t t_p_NoPU; + Double_t t_eHcal_noPU; + Double_t t_delta_NoPU; + Int_t t_ieta; + + // List of branches + TBranch *b_t_Event; + TBranch *b_t_p_PU; + TBranch *b_t_eHcal_PU; + TBranch *b_t_delta_PU; + TBranch *b_t_p_NoPU; + TBranch *b_t_eHcal_noPU; + TBranch *b_t_delta_NoPU; + TBranch *b_t_ieta; + +public: + CalibFitPU(const char* fname = "isotrackRelval.root"); + virtual ~CalibFitPU(); + virtual Int_t Cut(Long64_t entry); + virtual Int_t GetEntry(Long64_t entry); + virtual Long64_t LoadTree(Long64_t entry); + virtual void Init(TTree *tree); + virtual void Loop(bool extract_PU_parameters, std::string fileName); + virtual Bool_t Notify(); + virtual void Show(Long64_t entry = -1); +}; + +CalibFitPU::CalibFitPU(const char* fname) : fChain(0) { + // if parameter tree is not specified (or zero), connect the file + // used to generate this class and read the Tree. + TFile *f = new TFile(fname); + TTree* tree = new TTree(); + f->GetObject("tree", tree); + std::cout << "Find tree Tree in " << tree << " from " << fname << std::endl; + Init(tree); +} + +CalibFitPU::~CalibFitPU() { + if (!fChain) return; + delete fChain->GetCurrentFile(); +} + +Int_t CalibFitPU::GetEntry(Long64_t entry) { + // Read contents of entry. + if (!fChain) return 0; + return fChain->GetEntry(entry); +} + +Long64_t CalibFitPU::LoadTree(Long64_t entry) { + // Set the environment to read one entry + if (!fChain) return -5; + Long64_t centry = fChain->LoadTree(entry); + if (centry < 0) return centry; + if (fChain->GetTreeNumber() != fCurrent) { + fCurrent = fChain->GetTreeNumber(); + Notify(); + } + return centry; +} + +void CalibFitPU::Init(TTree *tree) { + // The Init() function is called when the selector needs to initialize + // a new tree or chain. Typically here the branch addresses and branch + // pointers of the tree will be set. + // It is normally not necessary to make changes to the generated + // code, but the routine can be extended by the user if needed. + // Init() will be called many times when running on PROOF + // (once per file to be processed). + + // Set branch addresses and branch pointers + if (!tree) return; + fChain = tree; + fCurrent = -1; + fChain->SetMakeClass(1); + + fChain->SetBranchAddress("t_Event", &t_Event, &b_t_Event); + fChain->SetBranchAddress("t_p_PU", &t_p_PU, &b_t_p_PU); + fChain->SetBranchAddress("t_eHcal_PU", &t_eHcal_PU, &b_t_eHcal_PU); + fChain->SetBranchAddress("t_delta_PU", &t_delta_PU, &b_t_delta_PU); + fChain->SetBranchAddress("t_p_NoPU", &t_p_NoPU, &b_t_p_NoPU); + fChain->SetBranchAddress("t_eHcal_noPU", &t_eHcal_noPU, &b_t_eHcal_noPU); + fChain->SetBranchAddress("t_delta_NoPU", &t_delta_NoPU, &b_t_delta_NoPU); + fChain->SetBranchAddress("t_ieta", &t_ieta, &b_t_ieta); + Notify(); +} + +Bool_t CalibFitPU::Notify() { + // The Notify() function is called when a new file is opened. This + // can be either for a new TTree in a TChain or when when a new TTree + // is started when using PROOF. It is normally not necessary to make changes + // to the generated code, but the routine can be extended by the + // user if needed. The return value is currently not used. + + return kTRUE; +} + +void CalibFitPU::Show(Long64_t entry) { + // Print contents of entry. + // If entry is not specified, print current entry + if (!fChain) return; + fChain->Show(entry); +} + +Int_t CalibFitPU::Cut(Long64_t) { + // This function may be called from Loop. + // returns 1 if entry is accepted. + // returns -1 otherwise. + return 1; +} + +void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { + // In a ROOT session, you can do: + // root> .L CalibFitPU.C + // root> CalibFitPU t + // root> t.GetEntry(12); // Fill t data members with entry number 12 + // root> t.Show(); // Show values of entry 12 + // root> t.Show(16); // Read and show values of entry 16 + // root> t.Loop(); // Loop on all entries + // + + // This is the loop skeleton where: + // jentry is the global entry number in the chain + // ientry is the entry number in the current Tree + // Note that the argument to GetEntry must be: + // jentry for TChain::GetEntry + // ientry for TTree::GetEntry and TBranch::GetEntry + // + // To read only selected branches, Insert statements like: + // METHOD1: + // fChain->SetBranchStatus("*",0); // disable all branches + // fChain->SetBranchStatus("branchname",1); // activate branchname + // METHOD2: replace line + // fChain->GetEntry(jentry); //read all branches + //by b_branchname->GetEntry(ientry); //read only this branch + if (fChain == 0) return; + + Long64_t nentries = fChain->GetEntriesFast(); + Long64_t nbytes = 0, nb = 0; + + char filename[100]; + + gStyle->SetCanvasBorderMode(0); + gStyle->SetCanvasColor(kWhite); + gStyle->SetPadColor(kWhite); + gStyle->SetFillColor(kWhite); + + const int n = 7; + int ieta_grid[n] = {7, 16, 25, 26, 27, 28, 29}; + double a00[n], a10[n], a20[n], a01[n], a11[n], a21[n], a02[n], a12[n], a22[n]; + const int nbin1 = 15; + double bins1[nbin1 + 1] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 6.0, 9.0}; + const int nbin2 = 7; + double bins2[nbin1 + 1] = {1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0}; + int nbins[n] = {4, 5, 12, nbin2, nbin2, nbin2, nbin2}; + char name[20], title[100]; + + std::vector<TH2D*> vec_h2; + std::vector<TGraph*> vec_gr; + std::vector<TProfile*> vec_hp; + + if (extract_PU_parameters) { + for (int k = 0; k < n; k++) { + sprintf (name, "h2_ieta%d", k); + int ieta1 = (k == 0) ? 1 : ieta_grid[k-1]; + sprintf (title, "PU Energy vs #Delta/p (i#eta = %d:%d)", ieta1, (ieta_grid[k] - 1)); + vec_h2.push_back(new TH2D(name, title, 100, 0, 10, 100, 0, 2)); + vec_gr.push_back(new TGraph()); + sprintf (name, "hp_ieta%d", k); + if (k < 3) + vec_hp.push_back(new TProfile(name, title, nbins[k], bins1)); + else + vec_hp.push_back(new TProfile(name, title, nbins[k], bins2)); + } + + int points[7] = {0, 0, 0, 0, 0, 0, 0}; + //=======================================Starting of event Loop======================================================= + + for (Long64_t jentry = 0; jentry < nentries; jentry++) { + Long64_t ientry = LoadTree(jentry); + if (ientry < 0) break; + nb = fChain->GetEntry(jentry); nbytes += nb; + + double deltaOvP = t_delta_PU / t_p_PU; + double diffEpuEnopuOvP = t_eHcal_noPU / t_eHcal_PU; + + for (int k = 0; k < n; k++) { + if (std::abs(t_ieta) < ieta_grid[k]) { + points[k]++; + vec_h2[k]->Fill(deltaOvP, diffEpuEnopuOvP); + vec_gr[k]->SetPoint(points[k], deltaOvP, diffEpuEnopuOvP); + vec_hp[k]->Fill(deltaOvP, diffEpuEnopuOvP); + break; + } + } + + } //End of Event Loop to extract PU correction parameters + + std::ofstream myfile0, myfile1, myfile2; + sprintf (filename, "%s_par2d.txt", fileName.c_str()); + myfile0.open (filename); + sprintf (filename, "%s_parProf.txt", fileName.c_str()); + myfile1.open (filename); + sprintf (filename, "%s_parGraph.txt", fileName.c_str()); + myfile2.open (filename); + + char namepng[20]; + for (int k = 0; k < n; k++){ + gStyle->SetOptStat(1100); + gStyle->SetOptFit(1); + + TF1* f1 = ((k < 2) ? (new TF1("f1", "[0]+[1]*x", 0, 5)) : + (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); + sprintf (name, "c_ieta%d2D", k); + TCanvas *pad1 = new TCanvas(name, name, 500, 500); + pad1->SetLeftMargin(0.10); + pad1->SetRightMargin(0.10); + pad1->SetTopMargin(0.10); + vec_h2[k]->GetXaxis()->SetLabelSize(0.035); + vec_h2[k]->GetYaxis()->SetLabelSize(0.035); + vec_h2[k]->GetXaxis()->SetTitle("#Delta/p"); + vec_h2[k]->GetYaxis()->SetTitle("E_{NoPU} / E_{PU}"); + vec_h2[k]->Draw(); + vec_h2[k]->Fit(f1); + + a00[k] = f1->GetParameter(0); + a10[k] = f1->GetParameter(1); + a20[k] = (k < 2) ? 0 : f1->GetParameter(2); + myfile0 << k << "\t" << a00[k] << "\t" << a10[k] << "\t" << a20[k] << "\n"; + pad1->Update(); + TPaveStats* st1 = (TPaveStats*)vec_h2[k]->GetListOfFunctions()->FindObject("stats"); + if (st1 != nullptr) { + st1->SetY1NDC(0.70); + st1->SetY2NDC(0.90); + st1->SetX1NDC(0.65); + st1->SetX2NDC(0.90); + } + pad1->Update(); + sprintf(namepng, "%s.png", pad1->GetName()); + pad1->Print(namepng); + + TF1* f2 = ((k < 2) ? (new TF1("f2", "[0]+[1]*x", 0, 5)) : + (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); + sprintf (name, "c_ieta%dPr", k); + TCanvas *pad2 = new TCanvas(name, name, 500, 500); + pad2->SetLeftMargin(0.10); + pad2->SetRightMargin(0.10); + pad2->SetTopMargin(0.10); + vec_hp[k]->GetXaxis()->SetLabelSize(0.035); + vec_hp[k]->GetYaxis()->SetLabelSize(0.035); + vec_hp[k]->GetXaxis()->SetTitle("#Delta/p"); + vec_hp[k]->GetYaxis()->SetTitle("E_{NoPU} / E_{PU}"); + vec_hp[k]->Draw(); + vec_hp[k]->Fit(f2); + + a01[k] = f2->GetParameter(0); + a11[k] = f2->GetParameter(1); + a21[k] = (k < 2) ? 0 : f2->GetParameter(2); + myfile1 << k << "\t" << a01[k] << "\t" << a11[k] << "\t" << a21[k] << "\n"; + pad2->Update(); + TPaveStats* st2 = (TPaveStats*)vec_hp[k]->GetListOfFunctions()->FindObject("stats"); + if (st2 != nullptr) { + st2->SetY1NDC(0.70); + st2->SetY2NDC(0.90); + st2->SetX1NDC(0.65); + st2->SetX2NDC(0.90); + } + pad2->Update(); + sprintf(namepng, "%s.png", pad2->GetName()); + pad2->Print(namepng); + + TF1* f3 = ((k < 2) ? (new TF1("f3", "[0]+[1]*x", 0, 5)) : + (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); + sprintf (name, "c_ieta%dGr", k); + TCanvas *pad3 = new TCanvas(name, name, 500, 500); + pad3->SetLeftMargin(0.10); + pad3->SetRightMargin(0.10); + pad3->SetTopMargin(0.10); + gStyle->SetOptFit(1111); + vec_gr[k]->GetXaxis()->SetLabelSize(0.035); + vec_gr[k]->GetYaxis()->SetLabelSize(0.035); + vec_gr[k]->GetXaxis()->SetTitle("#Delta/p"); + vec_gr[k]->GetYaxis()->SetTitle("E_{PU} - E_{NoPU}/p"); + vec_gr[k]->Fit(f3, "R"); + vec_gr[k]->Draw("Ap"); + f3->Draw("same"); + + a02[k] = f3->GetParameter(0); + a12[k] = f3->GetParameter(1); + a22[k] = (k < 2) ? 0 : f3->GetParameter(2); + myfile2 << k << "\t" << a02[k] << "\t" << a12[k] << "\t" << a22[k] << "\n"; + pad3->Update(); + TPaveStats* st3 = (TPaveStats*)vec_gr[k]->GetListOfFunctions()->FindObject("stats"); + if (st3 != nullptr) { + st3->SetY1NDC(0.70); + st3->SetY2NDC(0.90); + st3->SetX1NDC(0.65); + st3->SetX2NDC(0.90); + } + pad3->Update(); + pad3->Modified(); + sprintf(namepng, "%s.png", pad3->GetName()); + pad3->Print(namepng); + } + } else { + std::string line; + double number; + sprintf (filename, "%s_par2d.txt", fileName.c_str()); + std::ifstream myfile0(filename); + if (myfile0.is_open()) { + int iii = 0; + while (getline (myfile0, line)) { + std::istringstream iss2(line); + int ii = 0; + while (iss2 >> number) { + if (ii == 0) a00[iii] = number; + else if (ii == 1) a10[iii] = number; + else if (ii == 2) a20[iii] = number; + ++ii; + } + ++iii; + } + } + sprintf (filename, "%s_parProf.txt", fileName.c_str()); + std::ifstream myfile1(filename); + if (myfile1.is_open()) { + int iii = 0; + while (getline (myfile1, line)) { + std::istringstream iss2(line); + int ii = 0; + while (iss2 >> number) { + if (ii == 0) a01[iii] = number; + else if (ii == 1) a11[iii] = number; + else if (ii == 2) a21[iii] = number; + ++ii; + } + ++iii; + } + } + sprintf (filename, "%s_parGraph.txt", fileName.c_str()); + std::ifstream myfile2(filename); + if (myfile2.is_open()) { + int iii = 0; + while (getline (myfile2, line)) { + std::istringstream iss2(line); + int ii = 0; + while (iss2 >> number) { + if (ii == 0) a02[iii] = number; + else if (ii == 1) a12[iii] = number; + else if (ii == 2) a22[iii] = number; + ++ii; + } + ++iii; + } + } + } + + std::cout << "\nParameter Values:\n"; + for (int i=0; i<n; i++) { + std::cout << "[" << i << "] (" << a00[i] << ", " << a10[i] << ", " << a20[i] + << ") (" << a01[i] << ", " << a11[i] << ", " << a21[i] << ") (" + << a02[i] << ", " << a12[i] << ", " << a22[i] << ")\n"; + } + std::cout << "\n\n"; + std::vector<TH1F*> vec_EovP_UnCorr_PU, vec_EovP_UnCorr_NoPU; + std::vector<TH1F*> vec_EovP_Corr0_PU, vec_EovP_Corr0_NoPU; + std::vector<TH1F*> vec_EovP_Corr1_PU, vec_EovP_Corr1_NoPU; + std::vector<TH1F*> vec_EovP_Corr2_PU, vec_EovP_Corr2_NoPU; + TH1F* h_current; + + for (int k = 0; k < (2 * 28 + 1); k++) { + if (k!=28) { + sprintf(name, "EovP_ieta%dUnPU", k - 28); + sprintf(title, "E/p (Uncorrected PU) for i#eta = %d", k - 28); + h_current = new TH1F(name, title, 100, 0, 5); + h_current->GetXaxis()->SetTitle(title); + h_current->GetYaxis()->SetTitle("Tracks"); + vec_EovP_UnCorr_PU.push_back(h_current); + sprintf(name, "EovP_ieta%dUnNoPU", k - 28); + sprintf(title, "E/p (Uncorrected No PU) for i#eta = %d", k - 28); + h_current = new TH1F(name, title, 100, 0, 5); + h_current->GetXaxis()->SetTitle(title); + h_current->GetYaxis()->SetTitle("Tracks"); + vec_EovP_UnCorr_NoPU.push_back(h_current); + sprintf(name, "EovP_ieta%dCor0NoPU", k - 28); + sprintf(title, "E/p (Corrected using 2D No PU) for i#eta = %d", k - 28); + h_current = new TH1F(name, title, 100, 0, 5); + h_current->GetXaxis()->SetTitle(title); + h_current->GetYaxis()->SetTitle("Tracks"); + vec_EovP_Corr0_NoPU.push_back(h_current); + sprintf(name, "EovP_ieta%dCor0PU", k - 28); + sprintf(title, "E/p (Corrected using 2D PU) for i#eta = %d", k - 28); + h_current = new TH1F(name, title, 100, 0, 5); + h_current->GetXaxis()->SetTitle(title); + h_current->GetYaxis()->SetTitle("Tracks"); + vec_EovP_Corr0_PU.push_back(h_current); + sprintf(name, "EovP_ieta%dCor1NoPU", k - 28); + sprintf(title, "E/p (Corrected using profile No PU) for i#eta = %d", k - 28); + h_current = new TH1F(name, title, 100, 0, 5); + h_current->GetXaxis()->SetTitle(title); + h_current->GetYaxis()->SetTitle("Tracks"); + vec_EovP_Corr1_NoPU.push_back(h_current); + sprintf(name, "EovP_ieta%dCor1PU", k - 28); + sprintf(title, "E/p (Corrected using profile PU) for i#eta = %d", k - 28); + h_current = new TH1F(name, title, 100, 0, 5); + h_current->GetXaxis()->SetTitle(title); + h_current->GetYaxis()->SetTitle("Tracks"); + vec_EovP_Corr1_PU.push_back(h_current); + sprintf(name, "EovP_ieta%dCor2NoPU", k - 28); + sprintf(title, "E/p (Corrected using graph No PU) for i#eta = %d", k - 28); + h_current = new TH1F(name, title, 100, 0, 5); + h_current->GetXaxis()->SetTitle(title); + h_current->GetYaxis()->SetTitle("Tracks"); + vec_EovP_Corr2_NoPU.push_back(h_current); + sprintf(name, "EovP_ieta%dCor2PU", k - 28); + sprintf(title, "E/p (Corrected using graph PU) for i#eta = %d", k - 28); + h_current = new TH1F(name, title, 100, 0, 5); + h_current->GetXaxis()->SetTitle(title); + h_current->GetYaxis()->SetTitle("Tracks"); + vec_EovP_Corr2_PU.push_back(h_current); + } + } + std::cout << "Book " << (8 * vec_EovP_UnCorr_PU.size()) << " histograms\n"; + + //============================================================================================================================================== + + nbytes = nb = 0; + std::cout << nentries << " entries in the root file" << std::endl; + for (Long64_t jentry=0; jentry<nentries; jentry++) { + Long64_t ientry = LoadTree(jentry); + if (ientry < 0) break; + nb = fChain->GetEntry(jentry); nbytes += nb; + + int i1 = n; + for (int k = 0; k < n; k++) { + if (std::abs(t_ieta) < ieta_grid[k]) { + i1 = k; + break; + } + } + if ((t_ieta == 0) || (i1 >= n)) continue; + int i2 = (t_ieta < 0) ? (t_ieta + 28) : (t_ieta + 27); + + double EpuOvP = t_eHcal_PU / t_p_PU; + double EnopuOvP = t_eHcal_noPU / t_p_PU; + double deltaOvP = t_delta_PU / t_p_PU; + double deltaNopuOvP = t_delta_NoPU / t_p_PU; + + vec_EovP_UnCorr_PU[i2]->Fill(EpuOvP); + vec_EovP_UnCorr_NoPU[i2]->Fill(EnopuOvP); + + double c0p = (((i1 < 3) || (deltaOvP > 1.0)) ? (a00[i1] + a10[i1] * deltaOvP + a20[i1] * deltaOvP * deltaOvP) : 1.0); + double c1p = (((i1 < 3) || (deltaOvP > 1.0)) ? (a01[i1] + a11[i1] * deltaOvP + a21[i1] * deltaOvP * deltaOvP) : 1.0); + double c2p = (((i1 < 3) || (deltaOvP > 1.0)) ? (a02[i1] + a12[i1] * deltaOvP + a22[i1] * deltaOvP * deltaOvP) : 1.0); + double c0np = (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a00[i1] + a10[i1] * deltaNopuOvP + a12[i1] * deltaNopuOvP * deltaNopuOvP) : 1.0); + double c1np = (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a01[i1] + a11[i1] * deltaNopuOvP + a21[i1] * deltaNopuOvP * deltaNopuOvP) : 1.0); + double c2np = (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a02[i1] + a12[i1] * deltaNopuOvP + a22[i1] * deltaNopuOvP * deltaNopuOvP) : 1.0); + + vec_EovP_Corr0_PU[i2]->Fill(EpuOvP * c0p); + vec_EovP_Corr0_NoPU[i2]->Fill(EnopuOvP * c0np); + vec_EovP_Corr1_PU[i2]->Fill(EpuOvP * c1p); + vec_EovP_Corr1_NoPU[i2]->Fill(EnopuOvP * c1np); + vec_EovP_Corr2_PU[i2]->Fill(EpuOvP * c2p); + vec_EovP_Corr2_NoPU[i2]->Fill(EnopuOvP * c2np); + } + + sprintf (filename, "%s.root", fileName.c_str()); + TFile* f1=new TFile(filename, "RECREATE"); + f1->cd(); + for (unsigned int k = 0; k < vec_EovP_UnCorr_PU.size(); k++) { + vec_EovP_UnCorr_PU[k]->Write(); + vec_EovP_UnCorr_NoPU[k]->Write(); + vec_EovP_Corr0_PU[k]->Write(); + vec_EovP_Corr0_NoPU[k]->Write(); + vec_EovP_Corr1_PU[k]->Write(); + vec_EovP_Corr1_NoPU[k]->Write(); + vec_EovP_Corr2_PU[k]->Write(); + vec_EovP_Corr2_NoPU[k]->Write(); + } + for (unsigned int k = 0; k < vec_hp.size(); ++k) { + vec_h2[k]->Write(); + vec_hp[k]->Write(); + vec_gr[k]->Write(); + } + +} diff --git a/Calibration/HcalCalibAlgos/macros/isotrackRootTreeMaker.py b/Calibration/HcalCalibAlgos/macros/isotrackRootTreeMaker.py new file mode 100644 index 0000000000000..96c5efc4f63f9 --- /dev/null +++ b/Calibration/HcalCalibAlgos/macros/isotrackRootTreeMaker.py @@ -0,0 +1,131 @@ +###################################################################################### +# Makes pkl, root and text files comparing PU and noPU samples for training regressor and other stuff +# Usage: +# python3 isotrackRootTreeMaker.py -PU root://cmseos.fnal.gov//store/user/sghosh/ISOTRACK/DIPI_2021_PUpart.root -NPU root://cmseos.fnal.gov//store/user/sghosh/ISOTRACK/DIPI_2021_noPU.root -O isotrackRelval +###################################################################################### + +import uproot +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +import argparse +from mpl_toolkits.mplot3d import Axes3D + +parser = argparse.ArgumentParser() +parser.add_argument("-PU", "--filePU",help="input PU file",default="2021PU.root") +parser.add_argument("-NPU", "--fileNPU",help="input no PU file",default="2021noPU.root") +parser.add_argument("-O", "--opfilename",help="ouput file name",default="isotk_relval") + +fName1 = parser.parse_args().filePU +fName2 = parser.parse_args().fileNPU +foutput = parser.parse_args().opfilename + +# PU +tree1 = uproot.open(fName1,xrootdsource=dict(chunkbytes=1024**3, limitbytes=1024**3))['HcalIsoTrkAnalyzer/CalibTree'] + +#no PU +tree2 = uproot.open(fName2,xrootdsource=dict(chunkbytes=1024**3, limitbytes=1024**3))['HcalIsoTrkAnalyzer/CalibTree'] + +#tree2.keys() +print ("loaded files") +branchespu = ['t_Run','t_Event','t_nVtx','t_ieta','t_iphi','t_p','t_pt','t_gentrackP','t_eMipDR','t_eHcal','t_eHcal10','t_eHcal30','t_hmaxNearP','t_emaxNearP','t_hAnnular','t_eAnnular','t_rhoh','t_selectTk','t_qltyFlag'] +branchesnpu = ['t_Event','t_ieta','t_iphi','t_p','t_eHcal','t_eHcal10','t_eHcal30'] +#dictn = tree.arrays(branches=branches,entrystart=0, entrystop=300) +dictpu = tree1.arrays(branches=branchespu) +dictnpu = tree2.arrays(branches=branchesnpu) +dfspu = pd.DataFrame.from_dict(dictpu) +dfspu.columns=branchespu +dfsnpu = pd.DataFrame.from_dict(dictnpu) +dfsnpu.columns=branchesnpu +print ("loaded dicts and dfs") +print ("PU sample size:",dfspu.shape[0]) +print ("noPU sample size:",dfsnpu.shape[0]) +#dfspu +merged = pd.merge(dfspu, dfsnpu , on=['t_Event','t_ieta','t_iphi']) +print ("selected common events before cut:",merged.shape[0]) +#print(merged) +keepvars = ['t_nVtx','t_ieta','t_eHcal10_x','t_eHcal30_x','t_delta_x','t_eHcal10_y','t_eHcal30_y','t_delta_y','t_hmaxNearP','t_emaxNearP','t_hAnnular','t_eAnnular','t_rhoh','t_pt','t_eHcal_x','t_eHcal_y','t_p_x','t_p_y','t_eMipDR'] + +''' +#########################all ietas +cuts1 = (merged['t_selectTk'])&(merged['t_qltyFlag'])&(merged['t_hmaxNearP']<20)&(merged['t_eMipDR']<1)&(abs(merged['t_p'] - 50)<10)&(merged['t_eHcal_x']>10) +merged1=merged.loc[cuts1] +merged1 = merged1.reset_index(drop=True) +print ("selected events after cut for all ietas:",merged1.shape[0]) +merged1['t_delta']=merged1['t_eHcal30']-merged1['t_eHcal10'] +final_df_all = merged1[keepvars] +#final_dfnp = final_df.values +#np.save('isotk_relval_all.npy',final_df_all.values) +#np.save('isotk_relval_all.npy',final_df_all) +final_df_all.to_pickle(foutput+"_all.pkl") +final_df_all.to_csv(foutput+"_all.txt") +#########################split ieta < 16 + +cuts2 = (merged['t_selectTk'])&(merged['t_qltyFlag'])&(merged['t_hmaxNearP']<20)&(merged['t_eMipDR']<1)&(abs(merged['t_ieta'])<16)&(abs(merged['t_p'] - 50)<10)&(merged['t_eHcal_x']>10) +merged2=merged.loc[cuts2] +merged2 = merged2.reset_index(drop=True) +print ("selected events after cut for ieta < 16:",merged2.shape[0]) +merged2['t_delta']=merged2['t_eHcal30']-merged2['t_eHcal10'] +final_df_low = merged2[keepvars] +#final_dfnp = final_df.values +#np.save('isotk_relval_lo.npy',final_df_low.values) +#np.save('isotk_relval_lo.npy',final_df_low) +final_df_low.to_pickle(foutput+"_lo.pkl") +final_df_low.to_csv(foutput+"_lo.txt") +''' + +#########################split ieta > 24 + +cuts3 = (merged['t_selectTk'])&(merged['t_qltyFlag'])&(merged['t_hmaxNearP']<20)&(merged['t_eMipDR']<1)&(abs(merged['t_p_x'] - 50)<10)&(merged['t_eHcal_x']>10) +merged3=merged.loc[cuts3] +merged3 = merged3.reset_index(drop=True) +print ("selected events after cut for ieta > 24:",merged3.shape[0]) +merged3['t_delta_x']=merged3['t_eHcal30_x']-merged3['t_eHcal10_x'] +merged3['t_delta_y']=merged3['t_eHcal30_y']-merged3['t_eHcal10_y'] + +final_df_hi = merged3[keepvars] +final_df_hi.to_pickle(foutput+"_hi.pkl") +final_df_hi.to_csv(foutput+"_hi.txt") + +''' +threedee = plt.figure().gca(projection='3d') +threedee.scatter(final_df_hi['t_eHcal_x'], final_df_hi['t_eHcal_y'], final_df_hi['t_delta']) +threedee.set_xlabel('Corrected Energy') +threedee.set_ylabel('Uncorrected Energy') +threedee.set_zlabel('delta') +fig = threedee.get_figure() +fig.show() +fig.savefig('debu.png') + +print(type(merged3['t_p'])) +print(merged3['t_p']) +print(merged3['t_p'].to_numpy()) + +a=merged3['t_p'].to_numpy() +print(type(a)) +print(a.ndim) +print(a.shape) +''' + +print(merged3['t_ieta'].dtype) + +with uproot.recreate(foutput+".root") as f: + + f["tree"] = uproot.newtree({"t_Event": np.int32, + "t_p_PU": np.float64, + "t_eHcal_PU":np.float64, + "t_delta_PU":np.float64, + "t_p_NoPU": np.float64, + "t_eHcal_noPU":np.float64, + "t_delta_NoPU":np.float64, + "t_ieta":np.int32}) + + + f["tree"].extend({"t_Event": merged3['t_Event'], + "t_p_PU": merged3['t_p_x'].to_numpy(), + "t_eHcal_PU": merged3['t_eHcal_x'].to_numpy(), + "t_delta_PU": merged3['t_delta_x'].to_numpy(), + "t_p_NoPU": merged3['t_p_y'].to_numpy(), + "t_eHcal_noPU": merged3['t_eHcal_y'].to_numpy(), + "t_delta_NoPU": merged3['t_delta_y'].to_numpy(), + "t_ieta": merged3['t_ieta'].to_numpy()}) From 1f5b66d2d9650b030c5e3892d77924073b1dcd79 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 6 Oct 2020 22:09:07 +0200 Subject: [PATCH 277/778] Code check --- Calibration/HcalCalibAlgos/macros/CalibCorr.C | 2 +- .../HcalCalibAlgos/macros/CalibFitPlots.C | 214 ++++++------ Calibration/HcalCalibAlgos/macros/CalibSort.C | 325 ++++++++++-------- 3 files changed, 285 insertions(+), 256 deletions(-) diff --git a/Calibration/HcalCalibAlgos/macros/CalibCorr.C b/Calibration/HcalCalibAlgos/macros/CalibCorr.C index 961303adcbcd9..19b5b1123f136 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibCorr.C +++ b/Calibration/HcalCalibAlgos/macros/CalibCorr.C @@ -30,7 +30,7 @@ // bool isItRBX(detId): if it/they is in the chosen RBX // bool isItRBX(ieta, iphi): if it is in the chosen RBX // void CalibCorrTest(infile, flag) -// Tests a file which contains correction factors used by CalibCorr +// Tests a file which contains correction factors used by CalibCorr ////////////////////////////////////////////////////////////////////////////// #include <algorithm> diff --git a/Calibration/HcalCalibAlgos/macros/CalibFitPlots.C b/Calibration/HcalCalibAlgos/macros/CalibFitPlots.C index f40701e234706..23b263babeff9 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibFitPlots.C +++ b/Calibration/HcalCalibAlgos/macros/CalibFitPlots.C @@ -2642,16 +2642,15 @@ void PlotFourHists(std::string infile, } void PlotPUCorrHists(std::string infile = "corrfac.root", - std::string prefix = "", - int drawStatBox = 0, - bool approve = true, - bool save = false) { + std::string prefix = "", + int drawStatBox = 0, + bool approve = true, + bool save = false) { std::string name1[4] = {"W0", "W1", "W2", "P"}; std::string name2[4] = {"All", "Barrel", "Endcap", ""}; std::string name3[2] = {"", "p = 40:60 GeV"}; std::string name4[2] = {"Loose Isolation", "Tight Isolation"}; - std::string xtitle[4] = {"Correction Factor", "Correction Factor", - "Correction Factor", "i#eta"}; + std::string xtitle[4] = {"Correction Factor", "Correction Factor", "Correction Factor", "i#eta"}; std::string ytitle[4] = {"Tracks", "Tracks", "Tracks", "Correction Factor"}; gStyle->SetCanvasBorderMode(0); @@ -2671,91 +2670,95 @@ void PlotPUCorrHists(std::string infile = "corrfac.root", if (file != nullptr) { for (int i1 = 0; i1 < 4; ++i1) { for (int i2 = 0; i2 < 2; ++i2) { - for (int i3 = 0; i3 < 2; ++i3) { - sprintf (name, "%s%d%d", name1[i1].c_str(), i2, i3); - if (i2 == 0) - sprintf (title, "%s Tracks Selected with %s", name2[i1].c_str(), name4[i3].c_str()); - else - sprintf (title, "%s Tracks Selected with %s (%s)", name2[i1].c_str(), name4[i3].c_str(), name3[i2].c_str()); - TH1D* hist1(nullptr); - TProfile* hist2(nullptr); - if (i1 != 3) { - TH1D* hist = (TH1D*)file->FindObjectAny(name); - if (hist != nullptr) { - hist1 = (TH1D*)(hist->Clone()); - hist1->GetXaxis()->SetTitleSize(0.040); - hist1->GetXaxis()->SetTitle(xtitle[i1].c_str()); - hist1->GetYaxis()->SetTitle(ytitle[i1].c_str()); - hist1->GetYaxis()->SetLabelOffset(0.005); - hist1->GetYaxis()->SetLabelSize(0.035); - hist1->GetYaxis()->SetTitleSize(0.040); - hist1->GetYaxis()->SetTitleOffset(1.15); - } - } else { - TProfile* hist = (TProfile*)file->FindObjectAny(name); - if (hist != nullptr) { - hist2 = (TProfile*)(hist->Clone()); - hist2->GetXaxis()->SetTitleSize(0.040); - hist2->GetXaxis()->SetTitle(xtitle[i1].c_str()); - hist2->GetYaxis()->SetTitle(ytitle[i1].c_str()); - hist2->GetYaxis()->SetLabelOffset(0.005); - hist2->GetYaxis()->SetLabelSize(0.035); - hist2->GetYaxis()->SetTitleSize(0.040); - hist2->GetYaxis()->SetTitleOffset(1.15); -// hist2->GetYaxis()->SetRangeUser(0.0, 1.5); - hist2->SetMarkerStyle(20); - } - } - if ((hist1 != nullptr) || (hist2 != nullptr)) { - sprintf(namep, "c_%s%s", name, prefix.c_str()); - TCanvas* pad = new TCanvas(namep, namep, 700, 500); - pad->SetRightMargin(0.10); - pad->SetTopMargin(0.10); - if (hist1 != nullptr) { - pad->SetLogy(); - hist1->Draw(); - pad->Update(); - TPaveStats* st1 = (TPaveStats*)hist1->GetListOfFunctions()->FindObject("stats"); - if (st1 != nullptr) { - st1->SetY1NDC(0.77); - st1->SetY2NDC(0.90); - st1->SetX1NDC(0.70); - st1->SetX2NDC(0.90); - } - } else { - hist2->Draw(); - pad->Update(); - } - TPaveText* txt1 = new TPaveText(0.10, 0.905, 0.80, 0.95, "blNDC"); - txt1->SetFillColor(0); - char txt[100]; - sprintf(txt, "%s", title); - txt1->AddText(txt); - txt1->Draw("same"); - if (approve) { - double xoff = (i1 == 3) ? 0.11 : 0.22; - TPaveText *txt2 = new TPaveText(xoff,0.825,xoff+0.22,0.895,"blNDC"); - txt2->SetFillColor(0); - sprintf (txt, "CMS Preliminary"); - txt2->AddText(txt); - txt2->Draw("same"); - } - pad->Modified(); - pad->Update(); - if (save) { - sprintf(name, "%s.pdf", pad->GetName()); - pad->Print(name); - } - } - } + for (int i3 = 0; i3 < 2; ++i3) { + sprintf(name, "%s%d%d", name1[i1].c_str(), i2, i3); + if (i2 == 0) + sprintf(title, "%s Tracks Selected with %s", name2[i1].c_str(), name4[i3].c_str()); + else + sprintf(title, "%s Tracks Selected with %s (%s)", name2[i1].c_str(), name4[i3].c_str(), name3[i2].c_str()); + TH1D* hist1(nullptr); + TProfile* hist2(nullptr); + if (i1 != 3) { + TH1D* hist = (TH1D*)file->FindObjectAny(name); + if (hist != nullptr) { + hist1 = (TH1D*)(hist->Clone()); + hist1->GetXaxis()->SetTitleSize(0.040); + hist1->GetXaxis()->SetTitle(xtitle[i1].c_str()); + hist1->GetYaxis()->SetTitle(ytitle[i1].c_str()); + hist1->GetYaxis()->SetLabelOffset(0.005); + hist1->GetYaxis()->SetLabelSize(0.035); + hist1->GetYaxis()->SetTitleSize(0.040); + hist1->GetYaxis()->SetTitleOffset(1.15); + } + } else { + TProfile* hist = (TProfile*)file->FindObjectAny(name); + if (hist != nullptr) { + hist2 = (TProfile*)(hist->Clone()); + hist2->GetXaxis()->SetTitleSize(0.040); + hist2->GetXaxis()->SetTitle(xtitle[i1].c_str()); + hist2->GetYaxis()->SetTitle(ytitle[i1].c_str()); + hist2->GetYaxis()->SetLabelOffset(0.005); + hist2->GetYaxis()->SetLabelSize(0.035); + hist2->GetYaxis()->SetTitleSize(0.040); + hist2->GetYaxis()->SetTitleOffset(1.15); + // hist2->GetYaxis()->SetRangeUser(0.0, 1.5); + hist2->SetMarkerStyle(20); + } + } + if ((hist1 != nullptr) || (hist2 != nullptr)) { + sprintf(namep, "c_%s%s", name, prefix.c_str()); + TCanvas* pad = new TCanvas(namep, namep, 700, 500); + pad->SetRightMargin(0.10); + pad->SetTopMargin(0.10); + if (hist1 != nullptr) { + pad->SetLogy(); + hist1->Draw(); + pad->Update(); + TPaveStats* st1 = (TPaveStats*)hist1->GetListOfFunctions()->FindObject("stats"); + if (st1 != nullptr) { + st1->SetY1NDC(0.77); + st1->SetY2NDC(0.90); + st1->SetX1NDC(0.70); + st1->SetX2NDC(0.90); + } + } else { + hist2->Draw(); + pad->Update(); + } + TPaveText* txt1 = new TPaveText(0.10, 0.905, 0.80, 0.95, "blNDC"); + txt1->SetFillColor(0); + char txt[100]; + sprintf(txt, "%s", title); + txt1->AddText(txt); + txt1->Draw("same"); + if (approve) { + double xoff = (i1 == 3) ? 0.11 : 0.22; + TPaveText* txt2 = new TPaveText(xoff, 0.825, xoff + 0.22, 0.895, "blNDC"); + txt2->SetFillColor(0); + sprintf(txt, "CMS Preliminary"); + txt2->AddText(txt); + txt2->Draw("same"); + } + pad->Modified(); + pad->Update(); + if (save) { + sprintf(name, "%s.pdf", pad->GetName()); + pad->Print(name); + } + } + } } } } } -void PlotHistCorr(const char* infile, std::string prefix, std::string text0, - int eta = 0, int mode = 1, bool drawStatBox = true, - bool save = false) { +void PlotHistCorr(const char* infile, + std::string prefix, + std::string text0, + int eta = 0, + int mode = 1, + bool drawStatBox = true, + bool save = false) { gStyle->SetCanvasBorderMode(0); gStyle->SetCanvasColor(kWhite); gStyle->SetPadColor(kWhite); @@ -2771,7 +2774,8 @@ void PlotHistCorr(const char* infile, std::string prefix, std::string text0, int colors[3] = {1, 4, 2}; int styles[3] = {1, 3, 2}; TFile* file = new TFile(infile); - if (mode < 0 || mode > 2) mode = 1; + if (mode < 0 || mode > 2) + mode = 1; int etamin = (eta == 0) ? -27 : eta; int etamax = (eta == 0) ? 27 : eta; for (int ieta = etamin; ieta <= etamax; ++ieta) { @@ -2788,13 +2792,13 @@ void PlotHistCorr(const char* infile, std::string prefix, std::string text0, double ymax(0); for (int k = 0; k < 3; ++k) { if (k < 2) - sprintf (name, "EovP_ieta%d%s", ieta, tags[k].c_str()); + sprintf(name, "EovP_ieta%d%s", ieta, tags[k].c_str()); else - sprintf (name, "EovP_ieta%dCor%dPU", ieta, mode); + sprintf(name, "EovP_ieta%dCor%dPU", ieta, mode); TH1D* hist1 = (TH1D*)file->FindObjectAny(name); if (hist1 != nullptr) { - hist[k] = (TH1D*)(hist1->Clone()); - ymax = std::max(ymax, (hist1->GetMaximum())); + hist[k] = (TH1D*)(hist1->Clone()); + ymax = std::max(ymax, (hist1->GetMaximum())); } } int imax = 10 * (2 + int(0.1 * ymax)); @@ -2807,22 +2811,22 @@ void PlotHistCorr(const char* infile, std::string prefix, std::string text0, hist[k]->SetLineStyle(styles[k]); hist[k]->GetYaxis()->SetRangeUser(0.0, imax); if (k == 0) - hist[k]->Draw(); - else - hist[k]->Draw("sames"); + hist[k]->Draw(); + else + hist[k]->Draw("sames"); legend->AddEntry(hist[k], text[k].c_str(), "lp"); pad->Update(); if (drawStatBox) { - TPaveStats* st1 = (TPaveStats*)hist[k]->GetListOfFunctions()->FindObject("stats"); - if (st1 != nullptr) { - st1->SetLineColor(colors[k]); - st1->SetTextColor(colors[k]); - st1->SetY1NDC(yh - dy); - st1->SetY2NDC(yh); - st1->SetX1NDC(0.70); - st1->SetX2NDC(0.90); - yh -= dy; - } + TPaveStats* st1 = (TPaveStats*)hist[k]->GetListOfFunctions()->FindObject("stats"); + if (st1 != nullptr) { + st1->SetLineColor(colors[k]); + st1->SetTextColor(colors[k]); + st1->SetY1NDC(yh - dy); + st1->SetY2NDC(yh); + st1->SetX1NDC(0.70); + st1->SetX2NDC(0.90); + yh -= dy; + } } } pad->Update(); @@ -2831,7 +2835,7 @@ void PlotHistCorr(const char* infile, std::string prefix, std::string text0, TPaveText* txt1 = new TPaveText(0.10, 0.905, 0.80, 0.95, "blNDC"); txt1->SetFillColor(0); char title[100]; - sprintf (title, "%s for i#eta = %d", text0.c_str(), ieta); + sprintf(title, "%s for i#eta = %d", text0.c_str(), ieta); txt1->AddText(title); txt1->Draw("same"); pad->Modified(); diff --git a/Calibration/HcalCalibAlgos/macros/CalibSort.C b/Calibration/HcalCalibAlgos/macros/CalibSort.C index 695c76cc9c4af..2db36a495f84c 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibSort.C +++ b/Calibration/HcalCalibAlgos/macros/CalibSort.C @@ -1419,69 +1419,73 @@ void CalibPlotCombine::savePlot(const std::string &theName, bool append) { class CalibFitPU { private: - TTree *fChain; //!pointer to the analyzed TTree or TChain - Int_t fCurrent; //!current Tree number in a TChain + TTree *fChain; //!pointer to the analyzed TTree or TChain + Int_t fCurrent; //!current Tree number in a TChain // Fixed size dimensions of array or collections stored in the TTree if any. // Declaration of leaf types - Int_t t_Event; - Double_t t_p_PU; - Double_t t_eHcal_PU; - Double_t t_delta_PU; - Double_t t_p_NoPU; - Double_t t_eHcal_noPU; - Double_t t_delta_NoPU; - Int_t t_ieta; - + Int_t t_Event; + Double_t t_p_PU; + Double_t t_eHcal_PU; + Double_t t_delta_PU; + Double_t t_p_NoPU; + Double_t t_eHcal_noPU; + Double_t t_delta_NoPU; + Int_t t_ieta; + // List of branches - TBranch *b_t_Event; - TBranch *b_t_p_PU; - TBranch *b_t_eHcal_PU; - TBranch *b_t_delta_PU; - TBranch *b_t_p_NoPU; - TBranch *b_t_eHcal_noPU; - TBranch *b_t_delta_NoPU; - TBranch *b_t_ieta; + TBranch *b_t_Event; + TBranch *b_t_p_PU; + TBranch *b_t_eHcal_PU; + TBranch *b_t_delta_PU; + TBranch *b_t_p_NoPU; + TBranch *b_t_eHcal_noPU; + TBranch *b_t_delta_NoPU; + TBranch *b_t_ieta; public: - CalibFitPU(const char* fname = "isotrackRelval.root"); + CalibFitPU(const char *fname = "isotrackRelval.root"); virtual ~CalibFitPU(); - virtual Int_t Cut(Long64_t entry); - virtual Int_t GetEntry(Long64_t entry); + virtual Int_t Cut(Long64_t entry); + virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); - virtual void Init(TTree *tree); - virtual void Loop(bool extract_PU_parameters, std::string fileName); - virtual Bool_t Notify(); - virtual void Show(Long64_t entry = -1); + virtual void Init(TTree *tree); + virtual void Loop(bool extract_PU_parameters, std::string fileName); + virtual Bool_t Notify(); + virtual void Show(Long64_t entry = -1); }; -CalibFitPU::CalibFitPU(const char* fname) : fChain(0) { +CalibFitPU::CalibFitPU(const char *fname) : fChain(0) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. TFile *f = new TFile(fname); - TTree* tree = new TTree(); + TTree *tree = new TTree(); f->GetObject("tree", tree); std::cout << "Find tree Tree in " << tree << " from " << fname << std::endl; Init(tree); } CalibFitPU::~CalibFitPU() { - if (!fChain) return; + if (!fChain) + return; delete fChain->GetCurrentFile(); } Int_t CalibFitPU::GetEntry(Long64_t entry) { // Read contents of entry. - if (!fChain) return 0; + if (!fChain) + return 0; return fChain->GetEntry(entry); } Long64_t CalibFitPU::LoadTree(Long64_t entry) { // Set the environment to read one entry - if (!fChain) return -5; + if (!fChain) + return -5; Long64_t centry = fChain->LoadTree(entry); - if (centry < 0) return centry; + if (centry < 0) + return centry; if (fChain->GetTreeNumber() != fCurrent) { fCurrent = fChain->GetTreeNumber(); Notify(); @@ -1499,11 +1503,12 @@ void CalibFitPU::Init(TTree *tree) { // (once per file to be processed). // Set branch addresses and branch pointers - if (!tree) return; + if (!tree) + return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); - + fChain->SetBranchAddress("t_Event", &t_Event, &b_t_Event); fChain->SetBranchAddress("t_p_PU", &t_p_PU, &b_t_p_PU); fChain->SetBranchAddress("t_eHcal_PU", &t_eHcal_PU, &b_t_eHcal_PU); @@ -1521,14 +1526,15 @@ Bool_t CalibFitPU::Notify() { // is started when using PROOF. It is normally not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. The return value is currently not used. - + return kTRUE; } void CalibFitPU::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry - if (!fChain) return; + if (!fChain) + return; fChain->Show(entry); } @@ -1563,11 +1569,12 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { // METHOD2: replace line // fChain->GetEntry(jentry); //read all branches //by b_branchname->GetEntry(ientry); //read only this branch - if (fChain == 0) return; - + if (fChain == 0) + return; + Long64_t nentries = fChain->GetEntriesFast(); Long64_t nbytes = 0, nb = 0; - + char filename[100]; gStyle->SetCanvasBorderMode(0); @@ -1585,22 +1592,22 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { int nbins[n] = {4, 5, 12, nbin2, nbin2, nbin2, nbin2}; char name[20], title[100]; - std::vector<TH2D*> vec_h2; - std::vector<TGraph*> vec_gr; - std::vector<TProfile*> vec_hp; + std::vector<TH2D *> vec_h2; + std::vector<TGraph *> vec_gr; + std::vector<TProfile *> vec_hp; - if (extract_PU_parameters) { + if (extract_PU_parameters) { for (int k = 0; k < n; k++) { - sprintf (name, "h2_ieta%d", k); - int ieta1 = (k == 0) ? 1 : ieta_grid[k-1]; - sprintf (title, "PU Energy vs #Delta/p (i#eta = %d:%d)", ieta1, (ieta_grid[k] - 1)); + sprintf(name, "h2_ieta%d", k); + int ieta1 = (k == 0) ? 1 : ieta_grid[k - 1]; + sprintf(title, "PU Energy vs #Delta/p (i#eta = %d:%d)", ieta1, (ieta_grid[k] - 1)); vec_h2.push_back(new TH2D(name, title, 100, 0, 10, 100, 0, 2)); vec_gr.push_back(new TGraph()); - sprintf (name, "hp_ieta%d", k); - if (k < 3) - vec_hp.push_back(new TProfile(name, title, nbins[k], bins1)); + sprintf(name, "hp_ieta%d", k); + if (k < 3) + vec_hp.push_back(new TProfile(name, title, nbins[k], bins1)); else - vec_hp.push_back(new TProfile(name, title, nbins[k], bins2)); + vec_hp.push_back(new TProfile(name, title, nbins[k], bins2)); } int points[7] = {0, 0, 0, 0, 0, 0, 0}; @@ -1608,40 +1615,41 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { for (Long64_t jentry = 0; jentry < nentries; jentry++) { Long64_t ientry = LoadTree(jentry); - if (ientry < 0) break; - nb = fChain->GetEntry(jentry); nbytes += nb; + if (ientry < 0) + break; + nb = fChain->GetEntry(jentry); + nbytes += nb; double deltaOvP = t_delta_PU / t_p_PU; double diffEpuEnopuOvP = t_eHcal_noPU / t_eHcal_PU; - + for (int k = 0; k < n; k++) { - if (std::abs(t_ieta) < ieta_grid[k]) { - points[k]++; - vec_h2[k]->Fill(deltaOvP, diffEpuEnopuOvP); - vec_gr[k]->SetPoint(points[k], deltaOvP, diffEpuEnopuOvP); - vec_hp[k]->Fill(deltaOvP, diffEpuEnopuOvP); - break; - } + if (std::abs(t_ieta) < ieta_grid[k]) { + points[k]++; + vec_h2[k]->Fill(deltaOvP, diffEpuEnopuOvP); + vec_gr[k]->SetPoint(points[k], deltaOvP, diffEpuEnopuOvP); + vec_hp[k]->Fill(deltaOvP, diffEpuEnopuOvP); + break; + } } } //End of Event Loop to extract PU correction parameters - + std::ofstream myfile0, myfile1, myfile2; - sprintf (filename, "%s_par2d.txt", fileName.c_str()); - myfile0.open (filename); - sprintf (filename, "%s_parProf.txt", fileName.c_str()); - myfile1.open (filename); - sprintf (filename, "%s_parGraph.txt", fileName.c_str()); - myfile2.open (filename); - + sprintf(filename, "%s_par2d.txt", fileName.c_str()); + myfile0.open(filename); + sprintf(filename, "%s_parProf.txt", fileName.c_str()); + myfile1.open(filename); + sprintf(filename, "%s_parGraph.txt", fileName.c_str()); + myfile2.open(filename); + char namepng[20]; - for (int k = 0; k < n; k++){ + for (int k = 0; k < n; k++) { gStyle->SetOptStat(1100); gStyle->SetOptFit(1); - TF1* f1 = ((k < 2) ? (new TF1("f1", "[0]+[1]*x", 0, 5)) : - (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); - sprintf (name, "c_ieta%d2D", k); + TF1 *f1 = ((k < 2) ? (new TF1("f1", "[0]+[1]*x", 0, 5)) : (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); + sprintf(name, "c_ieta%d2D", k); TCanvas *pad1 = new TCanvas(name, name, 500, 500); pad1->SetLeftMargin(0.10); pad1->SetRightMargin(0.10); @@ -1652,13 +1660,13 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { vec_h2[k]->GetYaxis()->SetTitle("E_{NoPU} / E_{PU}"); vec_h2[k]->Draw(); vec_h2[k]->Fit(f1); - + a00[k] = f1->GetParameter(0); a10[k] = f1->GetParameter(1); a20[k] = (k < 2) ? 0 : f1->GetParameter(2); myfile0 << k << "\t" << a00[k] << "\t" << a10[k] << "\t" << a20[k] << "\n"; pad1->Update(); - TPaveStats* st1 = (TPaveStats*)vec_h2[k]->GetListOfFunctions()->FindObject("stats"); + TPaveStats *st1 = (TPaveStats *)vec_h2[k]->GetListOfFunctions()->FindObject("stats"); if (st1 != nullptr) { st1->SetY1NDC(0.70); st1->SetY2NDC(0.90); @@ -1669,9 +1677,8 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { sprintf(namepng, "%s.png", pad1->GetName()); pad1->Print(namepng); - TF1* f2 = ((k < 2) ? (new TF1("f2", "[0]+[1]*x", 0, 5)) : - (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); - sprintf (name, "c_ieta%dPr", k); + TF1 *f2 = ((k < 2) ? (new TF1("f2", "[0]+[1]*x", 0, 5)) : (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); + sprintf(name, "c_ieta%dPr", k); TCanvas *pad2 = new TCanvas(name, name, 500, 500); pad2->SetLeftMargin(0.10); pad2->SetRightMargin(0.10); @@ -1682,13 +1689,13 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { vec_hp[k]->GetYaxis()->SetTitle("E_{NoPU} / E_{PU}"); vec_hp[k]->Draw(); vec_hp[k]->Fit(f2); - + a01[k] = f2->GetParameter(0); a11[k] = f2->GetParameter(1); a21[k] = (k < 2) ? 0 : f2->GetParameter(2); myfile1 << k << "\t" << a01[k] << "\t" << a11[k] << "\t" << a21[k] << "\n"; pad2->Update(); - TPaveStats* st2 = (TPaveStats*)vec_hp[k]->GetListOfFunctions()->FindObject("stats"); + TPaveStats *st2 = (TPaveStats *)vec_hp[k]->GetListOfFunctions()->FindObject("stats"); if (st2 != nullptr) { st2->SetY1NDC(0.70); st2->SetY2NDC(0.90); @@ -1698,10 +1705,9 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { pad2->Update(); sprintf(namepng, "%s.png", pad2->GetName()); pad2->Print(namepng); - - TF1* f3 = ((k < 2) ? (new TF1("f3", "[0]+[1]*x", 0, 5)) : - (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); - sprintf (name, "c_ieta%dGr", k); + + TF1 *f3 = ((k < 2) ? (new TF1("f3", "[0]+[1]*x", 0, 5)) : (new TF1("f1", "[0]+[1]*x+[2]*x*x", 0, 5))); + sprintf(name, "c_ieta%dGr", k); TCanvas *pad3 = new TCanvas(name, name, 500, 500); pad3->SetLeftMargin(0.10); pad3->SetRightMargin(0.10); @@ -1712,15 +1718,15 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { vec_gr[k]->GetXaxis()->SetTitle("#Delta/p"); vec_gr[k]->GetYaxis()->SetTitle("E_{PU} - E_{NoPU}/p"); vec_gr[k]->Fit(f3, "R"); - vec_gr[k]->Draw("Ap"); + vec_gr[k]->Draw("Ap"); f3->Draw("same"); - + a02[k] = f3->GetParameter(0); a12[k] = f3->GetParameter(1); a22[k] = (k < 2) ? 0 : f3->GetParameter(2); myfile2 << k << "\t" << a02[k] << "\t" << a12[k] << "\t" << a22[k] << "\n"; pad3->Update(); - TPaveStats* st3 = (TPaveStats*)vec_gr[k]->GetListOfFunctions()->FindObject("stats"); + TPaveStats *st3 = (TPaveStats *)vec_gr[k]->GetListOfFunctions()->FindObject("stats"); if (st3 != nullptr) { st3->SetY1NDC(0.70); st3->SetY2NDC(0.90); @@ -1735,71 +1741,79 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { } else { std::string line; double number; - sprintf (filename, "%s_par2d.txt", fileName.c_str()); + sprintf(filename, "%s_par2d.txt", fileName.c_str()); std::ifstream myfile0(filename); if (myfile0.is_open()) { int iii = 0; - while (getline (myfile0, line)) { - std::istringstream iss2(line); - int ii = 0; - while (iss2 >> number) { - if (ii == 0) a00[iii] = number; - else if (ii == 1) a10[iii] = number; - else if (ii == 2) a20[iii] = number; - ++ii; - } - ++iii; + while (getline(myfile0, line)) { + std::istringstream iss2(line); + int ii = 0; + while (iss2 >> number) { + if (ii == 0) + a00[iii] = number; + else if (ii == 1) + a10[iii] = number; + else if (ii == 2) + a20[iii] = number; + ++ii; + } + ++iii; } } - sprintf (filename, "%s_parProf.txt", fileName.c_str()); + sprintf(filename, "%s_parProf.txt", fileName.c_str()); std::ifstream myfile1(filename); if (myfile1.is_open()) { int iii = 0; - while (getline (myfile1, line)) { - std::istringstream iss2(line); - int ii = 0; - while (iss2 >> number) { - if (ii == 0) a01[iii] = number; - else if (ii == 1) a11[iii] = number; - else if (ii == 2) a21[iii] = number; - ++ii; - } - ++iii; + while (getline(myfile1, line)) { + std::istringstream iss2(line); + int ii = 0; + while (iss2 >> number) { + if (ii == 0) + a01[iii] = number; + else if (ii == 1) + a11[iii] = number; + else if (ii == 2) + a21[iii] = number; + ++ii; + } + ++iii; } } - sprintf (filename, "%s_parGraph.txt", fileName.c_str()); + sprintf(filename, "%s_parGraph.txt", fileName.c_str()); std::ifstream myfile2(filename); if (myfile2.is_open()) { int iii = 0; - while (getline (myfile2, line)) { - std::istringstream iss2(line); - int ii = 0; - while (iss2 >> number) { - if (ii == 0) a02[iii] = number; - else if (ii == 1) a12[iii] = number; - else if (ii == 2) a22[iii] = number; - ++ii; - } - ++iii; + while (getline(myfile2, line)) { + std::istringstream iss2(line); + int ii = 0; + while (iss2 >> number) { + if (ii == 0) + a02[iii] = number; + else if (ii == 1) + a12[iii] = number; + else if (ii == 2) + a22[iii] = number; + ++ii; + } + ++iii; } } } std::cout << "\nParameter Values:\n"; - for (int i=0; i<n; i++) { - std::cout << "[" << i << "] (" << a00[i] << ", " << a10[i] << ", " << a20[i] - << ") (" << a01[i] << ", " << a11[i] << ", " << a21[i] << ") (" - << a02[i] << ", " << a12[i] << ", " << a22[i] << ")\n"; + for (int i = 0; i < n; i++) { + std::cout << "[" << i << "] (" << a00[i] << ", " << a10[i] << ", " << a20[i] << ") (" << a01[i] << ", " << a11[i] + << ", " << a21[i] << ") (" << a02[i] << ", " << a12[i] << ", " << a22[i] << ")\n"; } std::cout << "\n\n"; - std::vector<TH1F*> vec_EovP_UnCorr_PU, vec_EovP_UnCorr_NoPU; - std::vector<TH1F*> vec_EovP_Corr0_PU, vec_EovP_Corr0_NoPU; - std::vector<TH1F*> vec_EovP_Corr1_PU, vec_EovP_Corr1_NoPU; - std::vector<TH1F*> vec_EovP_Corr2_PU, vec_EovP_Corr2_NoPU; - TH1F* h_current; - + std::vector<TH1F *> vec_EovP_UnCorr_PU, vec_EovP_UnCorr_NoPU; + std::vector<TH1F *> vec_EovP_Corr0_PU, vec_EovP_Corr0_NoPU; + std::vector<TH1F *> vec_EovP_Corr1_PU, vec_EovP_Corr1_NoPU; + std::vector<TH1F *> vec_EovP_Corr2_PU, vec_EovP_Corr2_NoPU; + TH1F *h_current; + for (int k = 0; k < (2 * 28 + 1); k++) { - if (k!=28) { + if (k != 28) { sprintf(name, "EovP_ieta%dUnPU", k - 28); sprintf(title, "E/p (Uncorrected PU) for i#eta = %d", k - 28); h_current = new TH1F(name, title, 100, 0, 5); @@ -1852,39 +1866,51 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { } std::cout << "Book " << (8 * vec_EovP_UnCorr_PU.size()) << " histograms\n"; - //============================================================================================================================================== - + //============================================================================================================================================== + nbytes = nb = 0; std::cout << nentries << " entries in the root file" << std::endl; - for (Long64_t jentry=0; jentry<nentries; jentry++) { + for (Long64_t jentry = 0; jentry < nentries; jentry++) { Long64_t ientry = LoadTree(jentry); - if (ientry < 0) break; - nb = fChain->GetEntry(jentry); nbytes += nb; - + if (ientry < 0) + break; + nb = fChain->GetEntry(jentry); + nbytes += nb; + int i1 = n; for (int k = 0; k < n; k++) { if (std::abs(t_ieta) < ieta_grid[k]) { - i1 = k; - break; + i1 = k; + break; } } - if ((t_ieta == 0) || (i1 >= n)) continue; + if ((t_ieta == 0) || (i1 >= n)) + continue; int i2 = (t_ieta < 0) ? (t_ieta + 28) : (t_ieta + 27); - + double EpuOvP = t_eHcal_PU / t_p_PU; double EnopuOvP = t_eHcal_noPU / t_p_PU; double deltaOvP = t_delta_PU / t_p_PU; double deltaNopuOvP = t_delta_NoPU / t_p_PU; - + vec_EovP_UnCorr_PU[i2]->Fill(EpuOvP); vec_EovP_UnCorr_NoPU[i2]->Fill(EnopuOvP); - double c0p = (((i1 < 3) || (deltaOvP > 1.0)) ? (a00[i1] + a10[i1] * deltaOvP + a20[i1] * deltaOvP * deltaOvP) : 1.0); - double c1p = (((i1 < 3) || (deltaOvP > 1.0)) ? (a01[i1] + a11[i1] * deltaOvP + a21[i1] * deltaOvP * deltaOvP) : 1.0); - double c2p = (((i1 < 3) || (deltaOvP > 1.0)) ? (a02[i1] + a12[i1] * deltaOvP + a22[i1] * deltaOvP * deltaOvP) : 1.0); - double c0np = (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a00[i1] + a10[i1] * deltaNopuOvP + a12[i1] * deltaNopuOvP * deltaNopuOvP) : 1.0); - double c1np = (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a01[i1] + a11[i1] * deltaNopuOvP + a21[i1] * deltaNopuOvP * deltaNopuOvP) : 1.0); - double c2np = (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a02[i1] + a12[i1] * deltaNopuOvP + a22[i1] * deltaNopuOvP * deltaNopuOvP) : 1.0); + double c0p = + (((i1 < 3) || (deltaOvP > 1.0)) ? (a00[i1] + a10[i1] * deltaOvP + a20[i1] * deltaOvP * deltaOvP) : 1.0); + double c1p = + (((i1 < 3) || (deltaOvP > 1.0)) ? (a01[i1] + a11[i1] * deltaOvP + a21[i1] * deltaOvP * deltaOvP) : 1.0); + double c2p = + (((i1 < 3) || (deltaOvP > 1.0)) ? (a02[i1] + a12[i1] * deltaOvP + a22[i1] * deltaOvP * deltaOvP) : 1.0); + double c0np = + (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a00[i1] + a10[i1] * deltaNopuOvP + a12[i1] * deltaNopuOvP * deltaNopuOvP) + : 1.0); + double c1np = + (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a01[i1] + a11[i1] * deltaNopuOvP + a21[i1] * deltaNopuOvP * deltaNopuOvP) + : 1.0); + double c2np = + (((i1 < 3) || (deltaNopuOvP > 1.0)) ? (a02[i1] + a12[i1] * deltaNopuOvP + a22[i1] * deltaNopuOvP * deltaNopuOvP) + : 1.0); vec_EovP_Corr0_PU[i2]->Fill(EpuOvP * c0p); vec_EovP_Corr0_NoPU[i2]->Fill(EnopuOvP * c0np); @@ -1894,8 +1920,8 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { vec_EovP_Corr2_NoPU[i2]->Fill(EnopuOvP * c2np); } - sprintf (filename, "%s.root", fileName.c_str()); - TFile* f1=new TFile(filename, "RECREATE"); + sprintf(filename, "%s.root", fileName.c_str()); + TFile *f1 = new TFile(filename, "RECREATE"); f1->cd(); for (unsigned int k = 0; k < vec_EovP_UnCorr_PU.size(); k++) { vec_EovP_UnCorr_PU[k]->Write(); @@ -1912,5 +1938,4 @@ void CalibFitPU::Loop(bool extract_PU_parameters, std::string fileName) { vec_hp[k]->Write(); vec_gr[k]->Write(); } - } From 9c1687e5e266d3887a118ef2596b365da80b4dca Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar <tkmudholkar@gmail.com> Date: Wed, 7 Oct 2020 03:11:57 +0200 Subject: [PATCH 278/778] Change DQMOneLumiEDAnalyzer to DQMOneEDAnalyzer to allow concurrent processing of lumisections. --- DQM/EcalCommon/interface/EcalDQMonitor.h | 8 +++++--- DQM/EcalCommon/src/EcalDQMonitor.cc | 2 +- DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h | 6 +++--- DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc | 7 ++++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/DQM/EcalCommon/interface/EcalDQMonitor.h b/DQM/EcalCommon/interface/EcalDQMonitor.h index c434cc314a2a6..d014edad453f0 100644 --- a/DQM/EcalCommon/interface/EcalDQMonitor.h +++ b/DQM/EcalCommon/interface/EcalDQMonitor.h @@ -17,6 +17,8 @@ namespace edm { } // namespace edm namespace ecaldqm { + struct NoCache {}; + class EcalDQMonitor { public: EcalDQMonitor(edm::ParameterSet const &); @@ -28,14 +30,14 @@ namespace ecaldqm { void ecaldqmGetSetupObjects(edm::EventSetup const &); void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &); void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &); - void ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &); + void ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const; void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &); template <typename FuncOnWorker> void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const & = "", - int = 1); // loop over workers and capture exceptions + int = 1) const; // loop over workers and capture exceptions std::vector<DQWorker *> workers_; std::string const moduleName_; @@ -46,7 +48,7 @@ namespace ecaldqm { void EcalDQMonitor::executeOnWorkers_(FuncOnWorker _func, std::string const &_context, std::string const &_message /* = ""*/, - int _verbThreshold /* = 1*/) { + int _verbThreshold /* = 1*/) const { std::for_each(workers_.begin(), workers_.end(), [&](DQWorker *worker) { if (verbosity_ > _verbThreshold && !_message.empty()) edm::LogInfo("EcalDQM") << moduleName_ << ": " << _message << " @ " << worker->getName(); diff --git a/DQM/EcalCommon/src/EcalDQMonitor.cc b/DQM/EcalCommon/src/EcalDQMonitor.cc index 86f19334cd83d..13d28f1f64c74 100644 --- a/DQM/EcalCommon/src/EcalDQMonitor.cc +++ b/DQM/EcalCommon/src/EcalDQMonitor.cc @@ -112,7 +112,7 @@ namespace ecaldqm { edm::LogInfo("EcalDQM") << moduleName_ << "::ecaldqmEndRun"; } - void EcalDQMonitor::ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &_lumi, edm::EventSetup const &_es) { + void EcalDQMonitor::ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &_lumi, edm::EventSetup const &_es) const { executeOnWorkers_( [&_lumi, &_es](DQWorker *worker) { if (worker->onlineMode()) diff --git a/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h b/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h index 88e8e0d9e71e0..a7ffd5ce9ab4b 100644 --- a/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h +++ b/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h @@ -15,7 +15,7 @@ namespace edm { class ParameterSetDescription; } // namespace edm -class EcalDQMonitorTask : public DQMOneLumiEDAnalyzer<>, public ecaldqm::EcalDQMonitor { +class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::NoCache>>, public ecaldqm::EcalDQMonitor { public: EcalDQMonitorTask(edm::ParameterSet const&); ~EcalDQMonitorTask() override {} @@ -27,8 +27,8 @@ class EcalDQMonitorTask : public DQMOneLumiEDAnalyzer<>, public ecaldqm::EcalDQM private: void dqmEndRun(edm::Run const&, edm::EventSetup const&) override; - void dqmBeginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - void dqmEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + std::shared_ptr<ecaldqm::NoCache> globalBeginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) const override; + void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; void analyze(edm::Event const&, edm::EventSetup const&) override; typedef void (EcalDQMonitorTask::*Processor)(edm::Event const&, diff --git a/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc b/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc index 1ec17dbfd5cd6..9bc87b2c92a60 100644 --- a/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc +++ b/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc @@ -25,7 +25,7 @@ #include <sstream> EcalDQMonitorTask::EcalDQMonitorTask(edm::ParameterSet const& _ps) - : DQMOneLumiEDAnalyzer(), + : DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::NoCache> >(), ecaldqm::EcalDQMonitor(_ps), schedule_(), allowMissingCollections_(_ps.getUntrackedParameter<bool>("allowMissingCollections")), @@ -119,11 +119,12 @@ void EcalDQMonitorTask::dqmEndRun(edm::Run const& _run, edm::EventSetup const& _ executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms"); } -void EcalDQMonitorTask::dqmBeginLuminosityBlock(edm::LuminosityBlock const& _lumi, edm::EventSetup const& _es) { +std::shared_ptr<ecaldqm::NoCache> EcalDQMonitorTask::globalBeginLuminosityBlock(edm::LuminosityBlock const& _lumi, edm::EventSetup const& _es) const { ecaldqmBeginLuminosityBlock(_lumi, _es); + return nullptr; } -void EcalDQMonitorTask::dqmEndLuminosityBlock(edm::LuminosityBlock const& _lumi, edm::EventSetup const& _es) { +void EcalDQMonitorTask::globalEndLuminosityBlock(edm::LuminosityBlock const& _lumi, edm::EventSetup const& _es) { ecaldqmEndLuminosityBlock(_lumi, _es); if (lastResetTime_ != 0 && (time(nullptr) - lastResetTime_) / 3600. > resetInterval_) { From 8930cfd1cab2924a69527ead784c34a78033148b Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar <tkmudholkar@gmail.com> Date: Wed, 7 Oct 2020 06:25:34 +0200 Subject: [PATCH 279/778] Fixed code formatting issues. --- DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h | 12 +++++++----- DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h b/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h index a7ffd5ce9ab4b..eba669fdbeee0 100644 --- a/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h +++ b/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h @@ -15,7 +15,8 @@ namespace edm { class ParameterSetDescription; } // namespace edm -class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::NoCache>>, public ecaldqm::EcalDQMonitor { +class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::NoCache>>, + public ecaldqm::EcalDQMonitor { public: EcalDQMonitorTask(edm::ParameterSet const&); ~EcalDQMonitorTask() override {} @@ -27,7 +28,8 @@ class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecal private: void dqmEndRun(edm::Run const&, edm::EventSetup const&) override; - std::shared_ptr<ecaldqm::NoCache> globalBeginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) const override; + std::shared_ptr<ecaldqm::NoCache> globalBeginLuminosityBlock(edm::LuminosityBlock const&, + edm::EventSetup const&) const override; void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; void analyze(edm::Event const&, edm::EventSetup const&) override; @@ -42,9 +44,9 @@ class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecal /* DATA MEMBERS */ - edm::EDGetToken collectionTokens_[ecaldqm::nCollections]; // list of EDGetTokens - std::vector<std::pair<Processor, ecaldqm::Collections> > schedule_; // schedule of collections to run - bool allowMissingCollections_; // when true, skip missing collections silently + edm::EDGetToken collectionTokens_[ecaldqm::nCollections]; // list of EDGetTokens + std::vector<std::pair<Processor, ecaldqm::Collections>> schedule_; // schedule of collections to run + bool allowMissingCollections_; // when true, skip missing collections silently int processedEvents_; /* TASK TIME PROFILING */ diff --git a/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc b/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc index 9bc87b2c92a60..79868b8a0f42c 100644 --- a/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc +++ b/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc @@ -119,7 +119,8 @@ void EcalDQMonitorTask::dqmEndRun(edm::Run const& _run, edm::EventSetup const& _ executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms"); } -std::shared_ptr<ecaldqm::NoCache> EcalDQMonitorTask::globalBeginLuminosityBlock(edm::LuminosityBlock const& _lumi, edm::EventSetup const& _es) const { +std::shared_ptr<ecaldqm::NoCache> EcalDQMonitorTask::globalBeginLuminosityBlock(edm::LuminosityBlock const& _lumi, + edm::EventSetup const& _es) const { ecaldqmBeginLuminosityBlock(_lumi, _es); return nullptr; } From 02443b63f829949e457f5c863f28b431eebc281a Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Wed, 7 Oct 2020 09:31:13 +0200 Subject: [PATCH 280/778] refactor comparison functions --- .../DDCMS/interface/DDFilteredView.h | 13 +- .../DDCMS/src/DDFilteredView.cc | 172 +++++++++++------- 2 files changed, 120 insertions(+), 65 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index a39817c526410..8a5c79d2594f4 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -25,6 +25,7 @@ #include <DD4hep/SpecParRegistry.h> #include <DD4hep/Volumes.h> #include <memory> +#include <tuple> #include <vector> namespace cms { @@ -268,8 +269,8 @@ namespace cms { private: bool accept(std::string_view); int nodeCopyNo(const std::string_view) const; - std::vector<std::pair<std::string_view, int>> toNodeNames(const std::string&); - bool match(const std::string&, const std::vector<std::pair<std::string_view, int>>&) const; + std::vector<std::pair<std::string, int>> toNodeNames(const std::string&); + bool match(const std::string&, const std::vector<std::pair<std::string, int>>&) const; //! set the current node to the first sibling bool firstSibling(); @@ -283,6 +284,14 @@ namespace cms { std::string_view front(const std::string_view) const; std::string_view back(const std::string_view) const; + //! helper functions + std::string_view nodeNameAt(int) const; + const int nodeCopyNoAt(int) const; + bool compareEqualName(const std::string_view, const std::string_view) const; + std::tuple<std::string_view, std::string_view> alignNamespaces(std::string_view, std::string_view) const; + bool compareEqualCopyNumber(const std::string_view, int) const; + bool matchPath(const std::string_view) const; + ExpandedNodes nodes_; std::vector<Iterator> it_; std::vector<std::unique_ptr<Filter>> filters_; diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index bb1aec63bacc4..fded46cce8c18 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -247,11 +247,12 @@ int DDFilteredView::nodeCopyNo(const std::string_view copyNo) const { return -1; } -std::vector<std::pair<std::string_view, int>> DDFilteredView::toNodeNames(const std::string& path) { - std::vector<std::pair<std::string_view, int>> result; +std::vector<std::pair<std::string, int>> DDFilteredView::toNodeNames(const std::string& path) { + std::cout << "DDFilteredView::toNodeNames\n"; + std::vector<std::pair<std::string, int>> result; std::vector<string_view> names = split(path, "/"); - for (const auto& i : names) { - auto name = noNamespace(i); + for (auto it : names) { + auto name = noNamespace(it); int copyNo = -1; auto lpos = name.find_first_of('['); if (lpos != std::string::npos) { @@ -259,16 +260,15 @@ std::vector<std::pair<std::string_view, int>> DDFilteredView::toNodeNames(const if (rpos != std::string::npos) { copyNo = nodeCopyNo(name.substr(lpos + 1, rpos - 1)); } - result.emplace_back(name.substr(0, lpos), copyNo); - } else { - result.emplace_back(name, -1); + name.remove_suffix(name.size() - lpos); } + result.emplace_back(std::string(name.data(), name.size()), copyNo); } return result; } -bool DDFilteredView::match(const std::string& path, const std::vector<std::pair<std::string_view, int>>& names) const { +bool DDFilteredView::match(const std::string& path, const std::vector<std::pair<std::string, int>>& names) const { std::vector<std::pair<std::string_view, int>> toks; std::vector<string_view> pnames = split(path, "/"); for (const auto& i : pnames) { @@ -296,6 +296,7 @@ bool DDFilteredView::match(const std::string& path, const std::vector<std::pair< } std::vector<std::vector<Node*>> DDFilteredView::children(const std::string& selectPath) { + std::cout << "DDFilteredView::children \n"; currentSpecPar_ = nullptr; std::vector<std::vector<Node*>> paths; @@ -306,8 +307,14 @@ std::vector<std::vector<Node*>> DDFilteredView::children(const std::string& sele if (node_ == nullptr) { throw cms::Exception("DDFilteredView") << "Can't get children of a null node. Please, call firstChild()."; } + std::cout << "Here!\n"; it_.back().SetType(0); - std::vector<std::pair<std::string_view, int>> names = toNodeNames(selectPath); + std::vector<std::pair<std::string, int>> names = toNodeNames(selectPath); + std::cout << "Here!\n"; + for (auto i : names) { + std::cout << i.first << "[" << i.second << "]/"; + } + std::cout << "Here!\n"; auto rit = names.rbegin(); Node* node = it_.back().Next(); while (node != nullptr) { @@ -639,62 +646,15 @@ const ExpandedNodes& DDFilteredView::history() { } const DDSpecPar* DDFilteredView::find(const std::string& key) const { - DDSpecParRefs refs; - filter(refs, key); + DDSpecParRefs specParRefs; + filter(specParRefs, key); - int level = it_.back().GetLevel(); - - for (auto const& i : refs) { - auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { - auto topos = j.size(); - auto frompos = j.rfind('/'); - bool flag = false; - for (int nit = level; frompos - 1 <= topos and nit > 0; --nit) { - std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); - const int copyNum = it_.back().GetNode(nit)->GetNumber(); - std::string_view refname{&j[frompos + 1], topos - frompos - 1}; - topos = frompos; - frompos = j.substr(0, topos).rfind('/'); - - auto rpos = refname.find(':'); - if (rpos == refname.npos) { - name = noNamespace(name); - } else { - if (name.find(':') == name.npos) { - refname.remove_prefix(rpos + 1); - } - } - auto cpos = refname.rfind('['); - if (cpos != refname.npos) { - if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum) { - refname.remove_suffix(refname.size() - cpos); - flag = true; - } else { - flag = false; - break; - } - } - if (!dd4hep::dd::isRegex(refname)) { - if (!dd4hep::dd::compareEqual(name, refname)) { - flag = false; - break; - } else { - flag = true; - } - } else { - if (!regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))) { - flag = false; - break; - } else { - flag = true; - continue; - } - } - } - return flag; + for (auto const& specPar : specParRefs) { + auto pos = find_if(begin(specPar->paths), end(specPar->paths), [&](auto const& partSelector) { + return matchPath(partSelector); }); - if (k != end(i->paths)) { - return i; + if (pos != end(specPar->paths)) { + return specPar; } } @@ -709,6 +669,7 @@ void DDFilteredView::filter(DDSpecParRefs& refs, const std::string& key) const { } } +// First name in a path std::string_view DDFilteredView::front(const std::string_view path) const { auto const& lpos = path.find_first_not_of('/'); if (lpos != path.npos) { @@ -723,6 +684,7 @@ std::string_view DDFilteredView::front(const std::string_view path) const { return path; } +// Last name in a path std::string_view DDFilteredView::back(const std::string_view path) const { if (auto const& lpos = path.rfind('/') != path.npos) { return path.substr(lpos, path.size()); @@ -732,6 +694,90 @@ std::string_view DDFilteredView::back(const std::string_view path) const { return path; } +// Current Iterator level Node name +std::string_view DDFilteredView::nodeNameAt(int level) const { + assert(!it_.empty()); + assert(it_.back().GetLevel() >= level); + return it_.back().GetNode(level)->GetVolume()->GetName(); +} + +// Current Iterator level Node copy number +const int DDFilteredView::nodeCopyNoAt(int level) const { + assert(!it_.empty()); + assert(it_.back().GetLevel() >= level); + return it_.back().GetNode(level)->GetNumber(); +} + +// Compare if name matches a selection pattern that +// may or may not be defined as a regular expression +bool DDFilteredView::compareEqualName(const std::string_view selection, const std::string_view name) const { + return ( !(dd4hep::dd::isRegex(selection)) ? dd4hep::dd::compareEqual(name, selection) : + regex_match(std::string(name.data(), name.size()), regex(std::string(selection)))); +} + +// Check if both name and it's selection pattern +// contain a namespace and +// remove it if one of them does not +std::tuple<std::string_view, std::string_view> DDFilteredView::alignNamespaces(std::string_view selection, std::string_view name) const { + auto pos = selection.find(':'); + if (pos == selection.npos) { + name = noNamespace(name); + } else { + if (name.find(':') == name.npos) { + selection.remove_prefix(pos + 1); + } + } + return std::make_tuple(selection, name); +} + +// If a name has an XML-style copy number, e.g. Name[1] +// and compare it to an integer +bool DDFilteredView::compareEqualCopyNumber(const std::string_view name, int copy) const { + auto pos = name.rfind('['); + if (pos != name.npos) { + if (std::stoi(std::string(name.substr(pos + 1, name.rfind(']')))) == copy) { + return true; + } + } + + return false; +} + +bool DDFilteredView::matchPath(const std::string_view path) const { + assert(!it_.empty()); + int level = it_.back().GetLevel(); + + auto to = path.size(); + auto from = path.rfind('/'); + bool result = false; + for (int it = level; from - 1 <= to and it > 0; --it) { + std::string_view name = nodeNameAt(it); + std::string_view refname{&path[from + 1], to - from - 1}; + to = from; + from = path.substr(0, to).rfind('/'); + + std::tie(refname, name) = alignNamespaces(refname, name); + + auto pos = refname.rfind('['); + if (pos != refname.npos) { + if (!compareEqualCopyNumber(refname, nodeCopyNoAt(it))){ + result = false; + break; + } else { + refname.remove_suffix(refname.size() - pos); + result = true; + } + } + if(!compareEqualName(refname, name)) { + result = false; + break; + } else { + result = true; + } + } + return result; +} + double DDFilteredView::getNextValue(const std::string& key) const { double result(0.0); From 347ad0f3c744dc2397bf2cdf33e6eb3ffb07db2e Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Wed, 7 Oct 2020 09:37:18 +0200 Subject: [PATCH 281/778] code format --- .../DDCMS/interface/DDFilteredView.h | 4 +- .../DDCMS/src/DDFilteredView.cc | 37 ++++++++----------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 8a5c79d2594f4..370c9050c0612 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -284,14 +284,14 @@ namespace cms { std::string_view front(const std::string_view) const; std::string_view back(const std::string_view) const; - //! helper functions + //! helper functions std::string_view nodeNameAt(int) const; const int nodeCopyNoAt(int) const; bool compareEqualName(const std::string_view, const std::string_view) const; std::tuple<std::string_view, std::string_view> alignNamespaces(std::string_view, std::string_view) const; bool compareEqualCopyNumber(const std::string_view, int) const; bool matchPath(const std::string_view) const; - + ExpandedNodes nodes_; std::vector<Iterator> it_; std::vector<std::unique_ptr<Filter>> filters_; diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index fded46cce8c18..c5f808a299fc3 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -248,7 +248,6 @@ int DDFilteredView::nodeCopyNo(const std::string_view copyNo) const { } std::vector<std::pair<std::string, int>> DDFilteredView::toNodeNames(const std::string& path) { - std::cout << "DDFilteredView::toNodeNames\n"; std::vector<std::pair<std::string, int>> result; std::vector<string_view> names = split(path, "/"); for (auto it : names) { @@ -296,7 +295,6 @@ bool DDFilteredView::match(const std::string& path, const std::vector<std::pair< } std::vector<std::vector<Node*>> DDFilteredView::children(const std::string& selectPath) { - std::cout << "DDFilteredView::children \n"; currentSpecPar_ = nullptr; std::vector<std::vector<Node*>> paths; @@ -307,14 +305,8 @@ std::vector<std::vector<Node*>> DDFilteredView::children(const std::string& sele if (node_ == nullptr) { throw cms::Exception("DDFilteredView") << "Can't get children of a null node. Please, call firstChild()."; } - std::cout << "Here!\n"; it_.back().SetType(0); std::vector<std::pair<std::string, int>> names = toNodeNames(selectPath); - std::cout << "Here!\n"; - for (auto i : names) { - std::cout << i.first << "[" << i.second << "]/"; - } - std::cout << "Here!\n"; auto rit = names.rbegin(); Node* node = it_.back().Next(); while (node != nullptr) { @@ -650,9 +642,8 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { filter(specParRefs, key); for (auto const& specPar : specParRefs) { - auto pos = find_if(begin(specPar->paths), end(specPar->paths), [&](auto const& partSelector) { - return matchPath(partSelector); - }); + auto pos = find_if( + begin(specPar->paths), end(specPar->paths), [&](auto const& partSelector) { return matchPath(partSelector); }); if (pos != end(specPar->paths)) { return specPar; } @@ -711,14 +702,16 @@ const int DDFilteredView::nodeCopyNoAt(int level) const { // Compare if name matches a selection pattern that // may or may not be defined as a regular expression bool DDFilteredView::compareEqualName(const std::string_view selection, const std::string_view name) const { - return ( !(dd4hep::dd::isRegex(selection)) ? dd4hep::dd::compareEqual(name, selection) : - regex_match(std::string(name.data(), name.size()), regex(std::string(selection)))); + return (!(dd4hep::dd::isRegex(selection)) + ? dd4hep::dd::compareEqual(name, selection) + : regex_match(std::string(name.data(), name.size()), regex(std::string(selection)))); } // Check if both name and it's selection pattern // contain a namespace and // remove it if one of them does not -std::tuple<std::string_view, std::string_view> DDFilteredView::alignNamespaces(std::string_view selection, std::string_view name) const { +std::tuple<std::string_view, std::string_view> DDFilteredView::alignNamespaces(std::string_view selection, + std::string_view name) const { auto pos = selection.find(':'); if (pos == selection.npos) { name = noNamespace(name); @@ -755,20 +748,20 @@ bool DDFilteredView::matchPath(const std::string_view path) const { std::string_view refname{&path[from + 1], to - from - 1}; to = from; from = path.substr(0, to).rfind('/'); - + std::tie(refname, name) = alignNamespaces(refname, name); - + auto pos = refname.rfind('['); if (pos != refname.npos) { - if (!compareEqualCopyNumber(refname, nodeCopyNoAt(it))){ - result = false; - break; + if (!compareEqualCopyNumber(refname, nodeCopyNoAt(it))) { + result = false; + break; } else { - refname.remove_suffix(refname.size() - pos); - result = true; + refname.remove_suffix(refname.size() - pos); + result = true; } } - if(!compareEqualName(refname, name)) { + if (!compareEqualName(refname, name)) { result = false; break; } else { From 9503933ebd97d817ec36e5a6068f53be6a42d4de Mon Sep 17 00:00:00 2001 From: Juliette <juliette.alimena@cern.ch> Date: Wed, 7 Oct 2020 09:51:28 +0200 Subject: [PATCH 282/778] remove DisplacedSUSY_stopToB_M_300_1000mm_13 and add DisplacedSUSY_stopToB_M_800_500mm_13/14 gen fragments and in WFs --- ..._M_800_500mm_TuneCP5_13TeV_pythia8_cff.py} | 90 +- ...m_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py | 791 ++++++++++++++++++ .../python/relval_standard.py | 2 +- .../python/relval_steps.py | 7 +- .../python/upgradeWorkflowComponents.py | 3 +- 5 files changed, 809 insertions(+), 84 deletions(-) rename Configuration/Generator/python/{DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py => DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff.py} (97%) create mode 100644 Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py diff --git a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff.py similarity index 97% rename from Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py rename to Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff.py index f6d280d5b98d1..cf7e9ec6f0473 100644 --- a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py +++ b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff.py @@ -1,8 +1,8 @@ FLAVOR = 'stop' COM_ENERGY = 13000. # GeV -MASS_POINT = 300 # GeV -CROSS_SECTION = 8.51615 # pb -CTAU_POINT = 1000. # mm +MASS_POINT = 800 # GeV +CROSS_SECTION = 0.0283338 # pb +CTAU_POINT = 500 # mm SLHA_TABLE = """## Important note! ## This file has been modified by hand to give the gluino and the ## stop_1 a very narrow width, such that it can be used to try out @@ -39,18 +39,14 @@ ## The SUSY decays have calculated using SDECAY 1.1a * ## * ##****************************************************************** -# BLOCK DCINFO # Decay Program information 1 SDECAY # decay calculator 2 1.1a # version number -# BLOCK SPINFO # Spectrum calculator information 1 SOFTSUSY # spectrum calculator 2 2.0.5 # version number -# BLOCK MODSEL # Model selection 1 1 sugra -# BLOCK SMINPUTS # Standard Model inputs 1 1.27934000E+02 # alpha_em^-1(M_Z)^MSbar 2 1.16637000E-05 # G_F [GeV^-2] @@ -59,14 +55,12 @@ 5 4.25000000E+00 # mb(mb)^MSbar 6 1.75000000E+02 # mt pole mass 7 1.77700000E+00 # mtau pole mass -# BLOCK MINPAR # Input parameters - minimal models 1 1.00000000E+02 # m0 2 2.50000000E+02 # m12 3 1.00000000E+01 # tanb 4 1.00000000E+00 # sign(mu) 5 -1.00000000E+02 # A0 -# BLOCK MASS # Mass Spectrum # PDG code mass particle 5 4.88991651E+00 # b-quark pole mass calculated from mb(mb)_Msbar @@ -86,7 +80,7 @@ 2000004 5.49259265E+05 # ~c_R 1000005 5.13065179E+05 # ~b_1 2000005 5.43726676E+05 # ~b_2 - 1000006 300.00 # ~t_1 + 1000006 800.00 # ~t_1 2000006 5.85785818E+05 # ~t_2 1000011 2.02915690E+05 # ~e_L 2000011 1.44102799E+05 # ~e_R @@ -104,7 +98,6 @@ 1000035 3.81729382E+05 # ~chi_40 1000024 1.81696474E+05 # ~chi_1+ 1000037 3.79939320E+05 # ~chi_2+ -# BLOCK NMIX # Neutralino Mixing Matrix 1 1 9.86364430E-01 # N_11 1 2 -5.31103553E-02 # N_12 @@ -122,73 +115,58 @@ 4 2 3.10739017E-01 # N_42 4 3 6.49225960E-01 # N_43 4 4 -6.84377823E-01 # N_44 -# BLOCK UMIX # Chargino Mixing Matrix U 1 1 9.16834859E-01 # U_11 1 2 -3.99266629E-01 # U_12 2 1 3.99266629E-01 # U_21 2 2 9.16834859E-01 # U_22 -# BLOCK VMIX # Chargino Mixing Matrix V 1 1 9.72557835E-01 # V_11 1 2 -2.32661249E-01 # V_12 2 1 2.32661249E-01 # V_21 2 2 9.72557835E-01 # V_22 -# BLOCK STOPMIX # Stop Mixing Matrix 1 1 5.53644960E-01 # O_{11} 1 2 8.32752820E-01 # O_{12} 2 1 8.32752820E-01 # O_{21} 2 2 -5.53644960E-01 # O_{22} -# BLOCK SBOTMIX # Sbottom Mixing Matrix 1 1 9.38737896E-01 # O_{11} 1 2 3.44631925E-01 # O_{12} 2 1 -3.44631925E-01 # O_{21} 2 2 9.38737896E-01 # O_{22} -# BLOCK STAUMIX # Stau Mixing Matrix 1 1 2.82487190E-01 # O_{11} 1 2 9.59271071E-01 # O_{12} 2 1 9.59271071E-01 # O_{21} 2 2 -2.82487190E-01 # O_{22} -# BLOCK ALPHA # Higgs mixing -1.13825210E-01 # Mixing angle in the neutral Higgs boson sector -# BLOCK HMIX Q= 4.67034192E+02 # DRbar Higgs Parameters 1 3.57680977E+02 # mu(Q)MSSM DRbar 2 9.74862403E+00 # tan beta(Q)MSSM DRba 3 2.44894549E+02 # higgs vev(Q)MSSM DRb 4 1.66439065E+05 # mA^2(Q)MSSM DRbar -# BLOCK GAUGE Q= 4.67034192E+02 # The gauge couplings 3 1.10178679E+00 # g3(Q) MSbar -# BLOCK AU Q= 4.67034192E+02 # The trilinear couplings 1 1 0.00000000E+00 # A_u(Q) DRbar 2 2 0.00000000E+00 # A_c(Q) DRbar 3 3 -4.98129778E+02 # A_t(Q) DRbar -# BLOCK AD Q= 4.67034192E+02 # The trilinear couplings 1 1 0.00000000E+00 # A_d(Q) DRbar 2 2 0.00000000E+00 # A_s(Q) DRbar 3 3 -7.97274397E+02 # A_b(Q) DRbar -# BLOCK AE Q= 4.67034192E+02 # The trilinear couplings 1 1 0.00000000E+00 # A_e(Q) DRbar 2 2 0.00000000E+00 # A_mu(Q) DRbar 3 3 -2.51776873E+02 # A_tau(Q) DRbar -# BLOCK YU Q= 4.67034192E+02 # The Yukawa couplings 3 3 8.92844550E-01 # y_t(Q) DRbar -# BLOCK YD Q= 4.67034192E+02 # The Yukawa couplings 3 3 1.38840206E-01 # y_b(Q) DRbar -# BLOCK YE Q= 4.67034192E+02 # The Yukawa couplings 3 3 1.00890810E-01 # y_tau(Q) DRbar -# BLOCK MSOFT Q= 4.67034192E+02 # The soft SUSY breaking masses at the scale Q 1 1.01396534E+02 # M_1(Q) 2 1.91504241E+02 # M_2(Q) @@ -210,15 +188,10 @@ 47 5.23148807E+02 # mdR(Q) 48 5.23148807E+02 # msR(Q) 49 5.19867261E+02 # mbR(Q) -# -# -# # ================= # |The decay table| # ================= -# # - The multi-body decays for the inos, stops and sbottoms are included. -# # PDG Width DECAY 25 1.98610799E-03 # h decays # BR NDA ID1 ID2 @@ -226,7 +199,6 @@ 8.19070713E-01 2 5 -5 # BR(H1 -> b bb) 3.36338173E-02 2 24 -24 # BR(H1 -> W+ W-) 1.65251528E-03 2 23 23 # BR(H1 -> Z Z) -# # PDG Width DECAY 35 5.74801389E-01 # H decays # BR NDA ID1 ID2 @@ -240,7 +212,6 @@ 0.00000000E+00 2 37 -37 # BR(H -> H+ H-) 1.73348101E-02 2 25 25 # BR(H -> h h) 0.00000000E+00 2 36 36 # BR(H -> A A) -# # PDG Width DECAY 36 6.32178488E-01 # A decays # BR NDA ID1 ID2 @@ -251,7 +222,6 @@ 0.00000000E+00 2 23 35 # BR(A -> Z H) 0.00000000E+00 2 24 -37 # BR(A -> W+ H-) 0.00000000E+00 2 -24 37 # BR(A -> W- H+) -# # PDG Width DECAY 37 5.46962813E-01 # H+ decays # BR NDA ID1 ID2 @@ -260,7 +230,6 @@ 3.75315387E-03 2 24 25 # BR(H+ -> W+ h) 0.00000000E+00 2 24 35 # BR(H+ -> W+ H) 0.00000000E+00 2 24 36 # BR(H+ -> W+ A) -# # PDG Width DECAY 1000021 0.00E+00 # gluino decays # BR NDA ID1 ID2 @@ -288,9 +257,8 @@ 4.80642793E-02 2 -1000006 6 # BR(~g -> ~t_1* t ) 0.00000000E+00 2 2000006 -6 # BR(~g -> ~t_2 tb) 0.00000000E+00 2 -2000006 6 # BR(~g -> ~t_2* t ) -# # PDG Width -DECAY 1000006 1.97326971684839e-16 # stop1 decays +DECAY 1000006 3.9465394e-16 # stop1 decays # BR NDA ID1 ID2 3.33333333E-01 2 5 -11 3.33333333E-01 2 5 -13 @@ -306,7 +274,6 @@ # 0.00000000E+00 2 2000005 37 # BR(~t_1 -> ~b_2 H+) # 0.00000000E+00 2 1000005 24 # BR(~t_1 -> ~b_1 W+) # 0.00000000E+00 2 2000005 24 # BR(~t_1 -> ~b_2 W+) -# # PDG Width DECAY 2000006 7.37313275E+00 # stop2 decays # BR NDA ID1 ID2 @@ -325,7 +292,6 @@ 1.89913144E-01 2 1000006 23 # BR(~t_2 -> ~t_1 Z ) 0.00000000E+00 2 1000005 24 # BR(~t_2 -> ~b_1 W+) 0.00000000E+00 2 2000005 24 # BR(~t_2 -> ~b_2 W+) -# # PDG Width DECAY 1000005 3.73627601E+00 # sbottom1 decays # BR NDA ID1 ID2 @@ -340,7 +306,6 @@ 0.00000000E+00 2 2000006 -37 # BR(~b_1 -> ~t_2 H-) 1.37947979E-01 2 1000006 -24 # BR(~b_1 -> ~t_1 W-) 0.00000000E+00 2 2000006 -24 # BR(~b_1 -> ~t_2 W-) -# # PDG Width DECAY 2000005 8.01566294E-01 # sbottom2 decays # BR NDA ID1 ID2 @@ -359,7 +324,6 @@ 0.00000000E+00 2 1000005 23 # BR(~b_2 -> ~b_1 Z ) 2.65610832E-01 2 1000006 -24 # BR(~b_2 -> ~t_1 W-) 0.00000000E+00 2 2000006 -24 # BR(~b_2 -> ~t_2 W-) -# # PDG Width DECAY 1000002 5.47719539E+00 # sup_L decays # BR NDA ID1 ID2 @@ -370,7 +334,6 @@ 6.49499518E-01 2 1000024 1 # BR(~u_L -> ~chi_1+ d) 1.36031676E-02 2 1000037 1 # BR(~u_L -> ~chi_2+ d) 0.00000000E+00 2 1000021 2 # BR(~u_L -> ~g u) -# # PDG Width DECAY 2000002 1.15297292E+00 # sup_R decays # BR NDA ID1 ID2 @@ -381,7 +344,6 @@ 0.00000000E+00 2 1000024 1 # BR(~u_R -> ~chi_1+ d) 0.00000000E+00 2 1000037 1 # BR(~u_R -> ~chi_2+ d) 0.00000000E+00 2 1000021 2 # BR(~u_R -> ~g u) -# # PDG Width DECAY 1000001 5.31278772E+00 # sdown_L decays # BR NDA ID1 ID2 @@ -392,7 +354,6 @@ 6.06452481E-01 2 -1000024 2 # BR(~d_L -> ~chi_1- u) 4.36723179E-02 2 -1000037 2 # BR(~d_L -> ~chi_2- u) 0.00000000E+00 2 1000021 1 # BR(~d_L -> ~g d) -# # PDG Width DECAY 2000001 2.85812308E-01 # sdown_R decays # BR NDA ID1 ID2 @@ -403,7 +364,6 @@ 0.00000000E+00 2 -1000024 2 # BR(~d_R -> ~chi_1- u) 0.00000000E+00 2 -1000037 2 # BR(~d_R -> ~chi_2- u) 0.00000000E+00 2 1000021 1 # BR(~d_R -> ~g d) -# # PDG Width DECAY 1000004 5.47719539E+00 # scharm_L decays # BR NDA ID1 ID2 @@ -414,7 +374,6 @@ 6.49499518E-01 2 1000024 3 # BR(~c_L -> ~chi_1+ s) 1.36031676E-02 2 1000037 3 # BR(~c_L -> ~chi_2+ s) 0.00000000E+00 2 1000021 4 # BR(~c_L -> ~g c) -# # PDG Width DECAY 2000004 1.15297292E+00 # scharm_R decays # BR NDA ID1 ID2 @@ -425,7 +384,6 @@ 0.00000000E+00 2 1000024 3 # BR(~c_R -> ~chi_1+ s) 0.00000000E+00 2 1000037 3 # BR(~c_R -> ~chi_2+ s) 0.00000000E+00 2 1000021 4 # BR(~c_R -> ~g c) -# # PDG Width DECAY 1000003 5.31278772E+00 # sstrange_L decays # BR NDA ID1 ID2 @@ -436,7 +394,6 @@ 6.06452481E-01 2 -1000024 4 # BR(~s_L -> ~chi_1- c) 4.36723179E-02 2 -1000037 4 # BR(~s_L -> ~chi_2- c) 0.00000000E+00 2 1000021 3 # BR(~s_L -> ~g s) -# # PDG Width DECAY 2000003 2.85812308E-01 # sstrange_R decays # BR NDA ID1 ID2 @@ -447,7 +404,6 @@ 0.00000000E+00 2 -1000024 4 # BR(~s_R -> ~chi_1- c) 0.00000000E+00 2 -1000037 4 # BR(~s_R -> ~chi_2- c) 0.00000000E+00 2 1000021 3 # BR(~s_R -> ~g s) -# # PDG Width DECAY 1000011 2.13682161E-01 # selectron_L decays # BR NDA ID1 ID2 @@ -457,7 +413,6 @@ 0.00000000E+00 2 1000035 11 # BR(~e_L -> ~chi_40 e-) 2.62322035E-01 2 -1000024 12 # BR(~e_L -> ~chi_1- nu_e) 0.00000000E+00 2 -1000037 12 # BR(~e_L -> ~chi_2- nu_e) -# # PDG Width DECAY 2000011 2.16121626E-01 # selectron_R decays # BR NDA ID1 ID2 @@ -467,7 +422,6 @@ 0.00000000E+00 2 1000035 11 # BR(~e_R -> ~chi_40 e-) 0.00000000E+00 2 -1000024 12 # BR(~e_R -> ~chi_1- nu_e) 0.00000000E+00 2 -1000037 12 # BR(~e_R -> ~chi_2- nu_e) -# # PDG Width DECAY 1000013 2.13682161E-01 # smuon_L decays # BR NDA ID1 ID2 @@ -477,7 +431,6 @@ 0.00000000E+00 2 1000035 13 # BR(~mu_L -> ~chi_40 mu-) 2.62322035E-01 2 -1000024 14 # BR(~mu_L -> ~chi_1- nu_mu) 0.00000000E+00 2 -1000037 14 # BR(~mu_L -> ~chi_2- nu_mu) -# # PDG Width DECAY 2000013 2.16121626E-01 # smuon_R decays # BR NDA ID1 ID2 @@ -487,7 +440,6 @@ 0.00000000E+00 2 1000035 13 # BR(~mu_R -> ~chi_40 mu-) 0.00000000E+00 2 -1000024 14 # BR(~mu_R -> ~chi_1- nu_mu) 0.00000000E+00 2 -1000037 14 # BR(~mu_R -> ~chi_2- nu_mu) -# # PDG Width DECAY 1000015 1.48327268E-01 # stau_1 decays # BR NDA ID1 ID2 @@ -499,7 +451,6 @@ 0.00000000E+00 2 -1000037 16 # BR(~tau_1 -> ~chi_2- nu_tau) 0.00000000E+00 2 1000016 -37 # BR(~tau_1 -> ~nu_tauL H-) 0.00000000E+00 2 1000016 -24 # BR(~tau_1 -> ~nu_tauL W-) -# # PDG Width DECAY 2000015 2.69906096E-01 # stau_2 decays # BR NDA ID1 ID2 @@ -515,7 +466,6 @@ 0.00000000E+00 2 1000015 35 # BR(~tau_2 -> ~tau_1 H) 0.00000000E+00 2 1000015 36 # BR(~tau_2 -> ~tau_1 A) 0.00000000E+00 2 1000015 23 # BR(~tau_2 -> ~tau_1 Z) -# # PDG Width DECAY 1000012 1.49881634E-01 # snu_eL decays # BR NDA ID1 ID2 @@ -525,7 +475,6 @@ 0.00000000E+00 2 1000035 12 # BR(~nu_eL -> ~chi_40 nu_e) 1.41836867E-02 2 1000024 11 # BR(~nu_eL -> ~chi_1+ e-) 0.00000000E+00 2 1000037 11 # BR(~nu_eL -> ~chi_2+ e-) -# # PDG Width DECAY 1000014 1.49881634E-01 # snu_muL decays # BR NDA ID1 ID2 @@ -535,7 +484,6 @@ 0.00000000E+00 2 1000035 14 # BR(~nu_muL -> ~chi_40 nu_mu) 1.41836867E-02 2 1000024 13 # BR(~nu_muL -> ~chi_1+ mu-) 0.00000000E+00 2 1000037 13 # BR(~nu_muL -> ~chi_2+ mu-) -# # PDG Width DECAY 1000016 1.47518977E-01 # snu_tauL decays # BR NDA ID1 ID2 @@ -549,7 +497,6 @@ 0.00000000E+00 2 -2000015 -37 # BR(~nu_tauL -> ~tau_2+ H-) 0.00000000E+00 2 -1000015 -24 # BR(~nu_tauL -> ~tau_1+ W-) 0.00000000E+00 2 -2000015 -24 # BR(~nu_tauL -> ~tau_2+ W-) -# # PDG Width DECAY 1000024 1.70414503E-02 # chargino1+ decays # BR NDA ID1 ID2 @@ -582,7 +529,6 @@ 0.00000000E+00 2 1000023 37 # BR(~chi_1+ -> ~chi_20 H+) 0.00000000E+00 2 1000025 37 # BR(~chi_1+ -> ~chi_30 H+) 0.00000000E+00 2 1000035 37 # BR(~chi_1+ -> ~chi_40 H+) -# # PDG Width DECAY 1000037 2.48689510E+00 # chargino2+ decays # BR NDA ID1 ID2 @@ -619,10 +565,8 @@ 0.00000000E+00 2 1000023 37 # BR(~chi_2+ -> ~chi_20 H+) 0.00000000E+00 2 1000025 37 # BR(~chi_2+ -> ~chi_30 H+) 0.00000000E+00 2 1000035 37 # BR(~chi_2+ -> ~chi_40 H+) -# # PDG Width DECAY 1000022 0.00000000E+00 # neutralino1 decays -# # PDG Width DECAY 1000023 2.07770048E-02 # neutralino2 decays # BR NDA ID1 ID2 @@ -680,7 +624,6 @@ 0.00000000E+00 2 -1000014 14 # BR(~chi_20 -> ~nu_muL* nu_mu ) 0.00000000E+00 2 1000016 -16 # BR(~chi_20 -> ~nu_tau1 nu_taub) 0.00000000E+00 2 -1000016 16 # BR(~chi_20 -> ~nu_tau1* nu_tau ) -# # PDG Width DECAY 1000025 1.91598495E+00 # neutralino3 decays # BR NDA ID1 ID2 @@ -742,7 +685,6 @@ 3.18920485E-03 2 -1000014 14 # BR(~chi_30 -> ~nu_muL* nu_mu ) 3.20245934E-03 2 1000016 -16 # BR(~chi_30 -> ~nu_tau1 nu_taub) 3.20245934E-03 2 -1000016 16 # BR(~chi_30 -> ~nu_tau1* nu_tau ) -# # PDG Width DECAY 1000035 2.58585079E+00 # neutralino4 decays # BR NDA ID1 ID2 @@ -813,7 +755,8 @@ import FWCore.ParameterSet.Config as cms from Configuration.Generator.Pythia8CommonSettings_cfi import * -from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * +from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * +from Configuration.Generator.PSweightsPythia.PythiaPSweightsSettings_cfi import * generator = cms.EDFilter("Pythia8GeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), @@ -825,7 +768,8 @@ SLHATableForPythia8 = cms.string('%s' % SLHA_TABLE), PythiaParameters = cms.PSet( pythia8CommonSettingsBlock, - pythia8CUEP8M1SettingsBlock, + pythia8CP5SettingsBlock, + pythia8PSweightsSettingsBlock, processParameters = cms.vstring( 'SUSY:all = off', 'SUSY:gg2squarkantisquark = on', @@ -837,21 +781,11 @@ ), parameterSets = cms.vstring( 'pythia8CommonSettings', - 'pythia8CUEP8M1Settings', + 'pythia8CP5Settings', + 'pythia8PSweightsSettings', 'processParameters' ) ) ) -dirhadrongenfilter = cms.EDFilter("MCParticlePairFilter", - #Status = cms.untracked.vint32(1, 1), - MinPt = cms.untracked.vdouble(0., 0.), - MinP = cms.untracked.vdouble(0., 0.), - MaxEta = cms.untracked.vdouble(100., 100.), - MinEta = cms.untracked.vdouble(-100, -100), - ParticleCharge = cms.untracked.int32(0), - ParticleID1 = cms.untracked.vint32(1000612,1000622,1000632,1000642,1000652,1006113,1006211,1006213,1006223,1006311,1006313,1006321,1006323,1006333), - ParticleID2 = cms.untracked.vint32(1000612,1000622,1000632,1000642,1000652,1006113,1006211,1006213,1006223,1006311,1006313,1006321,1006323,1006333) -) - -ProductionFilterSequence = cms.Sequence(generator*dirhadrongenfilter) +ProductionFilterSequence = cms.Sequence(generator) diff --git a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py new file mode 100644 index 0000000000000..d52aec8471eb3 --- /dev/null +++ b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff.py @@ -0,0 +1,791 @@ +FLAVOR = 'stop' +COM_ENERGY = 14000. # GeV +MASS_POINT = 800 # GeV +CROSS_SECTION = 0.0283338 # pb +CTAU_POINT = 500 # mm +SLHA_TABLE = """## Important note! +## This file has been modified by hand to give the gluino and the +## stop_1 a very narrow width, such that it can be used to try out +## the R-hadron machinery. It is not a realistic SUSY scenario. +## +##****************************************************************** +## MadGraph/MadEvent * +##****************************************************************** +## * +## param_card corresponding the SPS point 1a (by SoftSusy 2.0.5) * +## * +##****************************************************************** +## Les Houches friendly file for the (MS)SM parameters of MadGraph * +## SM parameter set and decay widths produced by MSSMCalc * +##****************************************************************** +##*Please note the following IMPORTANT issues: * +## * +##0. REFRAIN from editing this file by hand! Some of the parame- * +## ters are not independent. Always use a calculator. * +## * +##1. alpha_S(MZ) has been used in the calculation of the parameters* +## This value is KEPT by madgraph when no pdf are used lpp(i)=0, * +## but, for consistency, it will be reset by madgraph to the * +## value expected IF the pdfs for collisions with hadrons are * +## used. * +## * +##2. Values of the charm and bottom kinematic (pole) masses are * +## those used in the matrix elements and phase space UNLESS they * +## are set to ZERO from the start in the model (particles.dat) * +## This happens, for example, when using 5-flavor QCD where * +## charm and bottom are treated as partons in the initial state * +## and a zero mass might be hardwired in the model definition. * +## * +## The SUSY decays have calculated using SDECAY 1.1a * +## * +##****************************************************************** +BLOCK DCINFO # Decay Program information + 1 SDECAY # decay calculator + 2 1.1a # version number +BLOCK SPINFO # Spectrum calculator information + 1 SOFTSUSY # spectrum calculator + 2 2.0.5 # version number +BLOCK MODSEL # Model selection + 1 1 sugra +BLOCK SMINPUTS # Standard Model inputs + 1 1.27934000E+02 # alpha_em^-1(M_Z)^MSbar + 2 1.16637000E-05 # G_F [GeV^-2] + 3 1.18000000E-01 # alpha_S(M_Z)^MSbar + 4 9.11876000E+01 # M_Z pole mass + 5 4.25000000E+00 # mb(mb)^MSbar + 6 1.75000000E+02 # mt pole mass + 7 1.77700000E+00 # mtau pole mass +BLOCK MINPAR # Input parameters - minimal models + 1 1.00000000E+02 # m0 + 2 2.50000000E+02 # m12 + 3 1.00000000E+01 # tanb + 4 1.00000000E+00 # sign(mu) + 5 -1.00000000E+02 # A0 +BLOCK MASS # Mass Spectrum +# PDG code mass particle + 5 4.88991651E+00 # b-quark pole mass calculated from mb(mb)_Msbar + 6 1.75000000E+02 # mt pole mass (not read by ME) + 24 7.98290131E+01 # W+ + 25 1.10899057E+02 # h + 35 3.99960116E+05 # H + 36 3.99583917E+05 # A + 37 4.07879012E+05 # H+ + 1000001 5.68441109E+05 # ~d_L + 2000001 5.45228462E+05 # ~d_R + 1000002 5.61119014E+05 # ~u_L + 2000002 5.49259265E+05 # ~u_R + 1000003 5.68441109E+05 # ~s_L + 2000003 5.45228462E+05 # ~s_R + 1000004 5.61119014E+05 # ~c_L + 2000004 5.49259265E+05 # ~c_R + 1000005 5.13065179E+05 # ~b_1 + 2000005 5.43726676E+05 # ~b_2 + 1000006 800.00 # ~t_1 + 2000006 5.85785818E+05 # ~t_2 + 1000011 2.02915690E+05 # ~e_L + 2000011 1.44102799E+05 # ~e_R + 1000012 1.85258326E+05 # ~nu_eL + 1000013 2.02915690E+05 # ~mu_L + 2000013 1.44102799E+05 # ~mu_R + 1000014 1.85258326E+05 # ~nu_muL + 1000015 1.34490864E+05 # ~tau_1 + 2000015 2.06867805E+05 # ~tau_2 + 1000016 1.84708464E+05 # ~nu_tauL + 1000021 5.0E+05 # ~g + 1000022 9.66880686E+05 # ~chi_10 + 1000023 1.81088157E+05 # ~chi_20 + 1000025 -3.63756027E+05 # ~chi_30 + 1000035 3.81729382E+05 # ~chi_40 + 1000024 1.81696474E+05 # ~chi_1+ + 1000037 3.79939320E+05 # ~chi_2+ +BLOCK NMIX # Neutralino Mixing Matrix + 1 1 9.86364430E-01 # N_11 + 1 2 -5.31103553E-02 # N_12 + 1 3 1.46433995E-01 # N_13 + 1 4 -5.31186117E-02 # N_14 + 2 1 9.93505358E-02 # N_21 + 2 2 9.44949299E-01 # N_22 + 2 3 -2.69846720E-01 # N_23 + 2 4 1.56150698E-01 # N_24 + 3 1 -6.03388002E-02 # N_31 + 3 2 8.77004854E-02 # N_32 + 3 3 6.95877493E-01 # N_33 + 3 4 7.10226984E-01 # N_34 + 4 1 -1.16507132E-01 # N_41 + 4 2 3.10739017E-01 # N_42 + 4 3 6.49225960E-01 # N_43 + 4 4 -6.84377823E-01 # N_44 +BLOCK UMIX # Chargino Mixing Matrix U + 1 1 9.16834859E-01 # U_11 + 1 2 -3.99266629E-01 # U_12 + 2 1 3.99266629E-01 # U_21 + 2 2 9.16834859E-01 # U_22 +BLOCK VMIX # Chargino Mixing Matrix V + 1 1 9.72557835E-01 # V_11 + 1 2 -2.32661249E-01 # V_12 + 2 1 2.32661249E-01 # V_21 + 2 2 9.72557835E-01 # V_22 +BLOCK STOPMIX # Stop Mixing Matrix + 1 1 5.53644960E-01 # O_{11} + 1 2 8.32752820E-01 # O_{12} + 2 1 8.32752820E-01 # O_{21} + 2 2 -5.53644960E-01 # O_{22} +BLOCK SBOTMIX # Sbottom Mixing Matrix + 1 1 9.38737896E-01 # O_{11} + 1 2 3.44631925E-01 # O_{12} + 2 1 -3.44631925E-01 # O_{21} + 2 2 9.38737896E-01 # O_{22} +BLOCK STAUMIX # Stau Mixing Matrix + 1 1 2.82487190E-01 # O_{11} + 1 2 9.59271071E-01 # O_{12} + 2 1 9.59271071E-01 # O_{21} + 2 2 -2.82487190E-01 # O_{22} +BLOCK ALPHA # Higgs mixing + -1.13825210E-01 # Mixing angle in the neutral Higgs boson sector +BLOCK HMIX Q= 4.67034192E+02 # DRbar Higgs Parameters + 1 3.57680977E+02 # mu(Q)MSSM DRbar + 2 9.74862403E+00 # tan beta(Q)MSSM DRba + 3 2.44894549E+02 # higgs vev(Q)MSSM DRb + 4 1.66439065E+05 # mA^2(Q)MSSM DRbar +BLOCK GAUGE Q= 4.67034192E+02 # The gauge couplings + 3 1.10178679E+00 # g3(Q) MSbar +BLOCK AU Q= 4.67034192E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_u(Q) DRbar + 2 2 0.00000000E+00 # A_c(Q) DRbar + 3 3 -4.98129778E+02 # A_t(Q) DRbar +BLOCK AD Q= 4.67034192E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_d(Q) DRbar + 2 2 0.00000000E+00 # A_s(Q) DRbar + 3 3 -7.97274397E+02 # A_b(Q) DRbar +BLOCK AE Q= 4.67034192E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_e(Q) DRbar + 2 2 0.00000000E+00 # A_mu(Q) DRbar + 3 3 -2.51776873E+02 # A_tau(Q) DRbar +BLOCK YU Q= 4.67034192E+02 # The Yukawa couplings + 3 3 8.92844550E-01 # y_t(Q) DRbar +BLOCK YD Q= 4.67034192E+02 # The Yukawa couplings + 3 3 1.38840206E-01 # y_b(Q) DRbar +BLOCK YE Q= 4.67034192E+02 # The Yukawa couplings + 3 3 1.00890810E-01 # y_tau(Q) DRbar +BLOCK MSOFT Q= 4.67034192E+02 # The soft SUSY breaking masses at the scale Q + 1 1.01396534E+02 # M_1(Q) + 2 1.91504241E+02 # M_2(Q) + 3 5.88263031E+02 # M_3(Q) + 21 3.23374943E+04 # mH1^2(Q) + 22 -1.28800134E+05 # mH2^2(Q) + 31 1.95334764E+02 # meL(Q) + 32 1.95334764E+02 # mmuL(Q) + 33 1.94495956E+02 # mtauL(Q) + 34 1.36494061E+02 # meR(Q) + 35 1.36494061E+02 # mmuR(Q) + 36 1.34043428E+02 # mtauR(Q) + 41 5.47573466E+02 # mqL1(Q) + 42 5.47573466E+02 # mqL2(Q) + 43 4.98763839E+02 # mqL3(Q) + 44 5.29511195E+02 # muR(Q) + 45 5.29511195E+02 # mcR(Q) + 46 4.23245877E+02 # mtR(Q) + 47 5.23148807E+02 # mdR(Q) + 48 5.23148807E+02 # msR(Q) + 49 5.19867261E+02 # mbR(Q) +# ================= +# |The decay table| +# ================= +# - The multi-body decays for the inos, stops and sbottoms are included. +# PDG Width +DECAY 25 1.98610799E-03 # h decays +# BR NDA ID1 ID2 + 1.45642955E-01 2 15 -15 # BR(H1 -> tau- tau+) + 8.19070713E-01 2 5 -5 # BR(H1 -> b bb) + 3.36338173E-02 2 24 -24 # BR(H1 -> W+ W-) + 1.65251528E-03 2 23 23 # BR(H1 -> Z Z) +# PDG Width +DECAY 35 5.74801389E-01 # H decays +# BR NDA ID1 ID2 + 1.39072676E-01 2 15 -15 # BR(H -> tau- tau+) + 4.84110879E-02 2 6 -6 # BR(H -> t tb) + 7.89500067E-01 2 5 -5 # BR(H -> b bb) + 3.87681171E-03 2 24 -24 # BR(H -> W+ W-) + 1.80454752E-03 2 23 23 # BR(H -> Z Z) + 0.00000000E+00 2 24 -37 # BR(H -> W+ H-) + 0.00000000E+00 2 -24 37 # BR(H -> W- H+) + 0.00000000E+00 2 37 -37 # BR(H -> H+ H-) + 1.73348101E-02 2 25 25 # BR(H -> h h) + 0.00000000E+00 2 36 36 # BR(H -> A A) +# PDG Width +DECAY 36 6.32178488E-01 # A decays +# BR NDA ID1 ID2 + 1.26659725E-01 2 15 -15 # BR(A -> tau- tau+) + 1.51081526E-01 2 6 -6 # BR(A -> t tb) + 7.19406137E-01 2 5 -5 # BR(A -> b bb) + 2.85261228E-03 2 23 25 # BR(A -> Z h) + 0.00000000E+00 2 23 35 # BR(A -> Z H) + 0.00000000E+00 2 24 -37 # BR(A -> W+ H-) + 0.00000000E+00 2 -24 37 # BR(A -> W- H+) +# PDG Width +DECAY 37 5.46962813E-01 # H+ decays +# BR NDA ID1 ID2 + 1.49435135E-01 2 -15 16 # BR(H+ -> tau+ nu_tau) + 8.46811711E-01 2 6 -5 # BR(H+ -> t bb) + 3.75315387E-03 2 24 25 # BR(H+ -> W+ h) + 0.00000000E+00 2 24 35 # BR(H+ -> W+ H) + 0.00000000E+00 2 24 36 # BR(H+ -> W+ A) +# PDG Width +DECAY 1000021 0.00E+00 # gluino decays +# BR NDA ID1 ID2 + 2.08454202E-02 2 1000001 -1 # BR(~g -> ~d_L db) + 2.08454202E-02 2 -1000001 1 # BR(~g -> ~d_L* d ) + 5.07075274E-02 2 2000001 -1 # BR(~g -> ~d_R db) + 5.07075274E-02 2 -2000001 1 # BR(~g -> ~d_R* d ) + 2.89787767E-02 2 1000002 -2 # BR(~g -> ~u_L ub) + 2.89787767E-02 2 -1000002 2 # BR(~g -> ~u_L* u ) + 4.46872773E-02 2 2000002 -2 # BR(~g -> ~u_R ub) + 4.46872773E-02 2 -2000002 2 # BR(~g -> ~u_R* u ) + 2.08454202E-02 2 1000003 -3 # BR(~g -> ~s_L sb) + 2.08454202E-02 2 -1000003 3 # BR(~g -> ~s_L* s ) + 5.07075274E-02 2 2000003 -3 # BR(~g -> ~s_R sb) + 5.07075274E-02 2 -2000003 3 # BR(~g -> ~s_R* s ) + 2.89787767E-02 2 1000004 -4 # BR(~g -> ~c_L cb) + 2.89787767E-02 2 -1000004 4 # BR(~g -> ~c_L* c ) + 4.46872773E-02 2 2000004 -4 # BR(~g -> ~c_R cb) + 4.46872773E-02 2 -2000004 4 # BR(~g -> ~c_R* c ) + 1.05840237E-01 2 1000005 -5 # BR(~g -> ~b_1 bb) + 1.05840237E-01 2 -1000005 5 # BR(~g -> ~b_1* b ) + 5.56574805E-02 2 2000005 -5 # BR(~g -> ~b_2 bb) + 5.56574805E-02 2 -2000005 5 # BR(~g -> ~b_2* b ) + 4.80642793E-02 2 1000006 -6 # BR(~g -> ~t_1 tb) + 4.80642793E-02 2 -1000006 6 # BR(~g -> ~t_1* t ) + 0.00000000E+00 2 2000006 -6 # BR(~g -> ~t_2 tb) + 0.00000000E+00 2 -2000006 6 # BR(~g -> ~t_2* t ) +# PDG Width +DECAY 1000006 3.9465394e-16 # stop1 decays +# BR NDA ID1 ID2 + 3.33333333E-01 2 5 -11 + 3.33333333E-01 2 5 -13 + 3.33333333E-01 2 5 -15 +# 1.92947616E-01 2 1000022 6 # BR(~t_1 -> ~chi_10 t ) +# 1.17469211E-01 2 1000023 6 # BR(~t_1 -> ~chi_20 t ) +# 0.00000000E+00 2 1000025 6 # BR(~t_1 -> ~chi_30 t ) +# 0.00000000E+00 2 1000035 6 # BR(~t_1 -> ~chi_40 t ) +# 6.75747693E-01 2 1000024 5 # BR(~t_1 -> ~chi_1+ b ) +# 1.38354802E-02 2 1000037 5 # BR(~t_1 -> ~chi_2+ b ) +# 0.00000000E+00 2 1000021 6 # BR(~t_1 -> ~g t ) +# 0.00000000E+00 2 1000005 37 # BR(~t_1 -> ~b_1 H+) +# 0.00000000E+00 2 2000005 37 # BR(~t_1 -> ~b_2 H+) +# 0.00000000E+00 2 1000005 24 # BR(~t_1 -> ~b_1 W+) +# 0.00000000E+00 2 2000005 24 # BR(~t_1 -> ~b_2 W+) +# PDG Width +DECAY 2000006 7.37313275E+00 # stop2 decays +# BR NDA ID1 ID2 + 2.96825635E-02 2 1000022 6 # BR(~t_2 -> ~chi_10 t ) + 8.68035358E-02 2 1000023 6 # BR(~t_2 -> ~chi_20 t ) + 4.18408351E-02 2 1000025 6 # BR(~t_2 -> ~chi_30 t ) + 1.93281647E-01 2 1000035 6 # BR(~t_2 -> ~chi_40 t ) + 2.19632356E-01 2 1000024 5 # BR(~t_2 -> ~chi_1+ b ) + 2.02206148E-01 2 1000037 5 # BR(~t_2 -> ~chi_2+ b ) + 0.00000000E+00 2 1000021 6 # BR(~t_2 -> ~g t ) + 3.66397706E-02 2 1000006 25 # BR(~t_2 -> ~t_1 h ) + 0.00000000E+00 2 1000006 35 # BR(~t_2 -> ~t_1 H ) + 0.00000000E+00 2 1000006 36 # BR(~t_2 -> ~t_1 A ) + 0.00000000E+00 2 1000005 37 # BR(~t_2 -> ~b_1 H+) + 0.00000000E+00 2 2000005 37 # BR(~t_2 -> ~b_2 H+) + 1.89913144E-01 2 1000006 23 # BR(~t_2 -> ~t_1 Z ) + 0.00000000E+00 2 1000005 24 # BR(~t_2 -> ~b_1 W+) + 0.00000000E+00 2 2000005 24 # BR(~t_2 -> ~b_2 W+) +# PDG Width +DECAY 1000005 3.73627601E+00 # sbottom1 decays +# BR NDA ID1 ID2 + 4.43307074E-02 2 1000022 5 # BR(~b_1 -> ~chi_10 b ) + 3.56319904E-01 2 1000023 5 # BR(~b_1 -> ~chi_20 b ) + 5.16083795E-03 2 1000025 5 # BR(~b_1 -> ~chi_30 b ) + 1.04105080E-02 2 1000035 5 # BR(~b_1 -> ~chi_40 b ) + 4.45830064E-01 2 -1000024 6 # BR(~b_1 -> ~chi_1- t ) + 0.00000000E+00 2 -1000037 6 # BR(~b_1 -> ~chi_2- t ) + 0.00000000E+00 2 1000021 5 # BR(~b_1 -> ~g b ) + 0.00000000E+00 2 1000006 -37 # BR(~b_1 -> ~t_1 H-) + 0.00000000E+00 2 2000006 -37 # BR(~b_1 -> ~t_2 H-) + 1.37947979E-01 2 1000006 -24 # BR(~b_1 -> ~t_1 W-) + 0.00000000E+00 2 2000006 -24 # BR(~b_1 -> ~t_2 W-) +# PDG Width +DECAY 2000005 8.01566294E-01 # sbottom2 decays +# BR NDA ID1 ID2 + 2.86200590E-01 2 1000022 5 # BR(~b_2 -> ~chi_10 b ) + 1.40315912E-01 2 1000023 5 # BR(~b_2 -> ~chi_20 b ) + 5.32635592E-02 2 1000025 5 # BR(~b_2 -> ~chi_30 b ) + 7.48748121E-02 2 1000035 5 # BR(~b_2 -> ~chi_40 b ) + 1.79734294E-01 2 -1000024 6 # BR(~b_2 -> ~chi_1- t ) + 0.00000000E+00 2 -1000037 6 # BR(~b_2 -> ~chi_2- t ) + 0.00000000E+00 2 1000021 5 # BR(~b_2 -> ~g b ) + 0.00000000E+00 2 1000005 25 # BR(~b_2 -> ~b_1 h ) + 0.00000000E+00 2 1000005 35 # BR(~b_2 -> ~b_1 H ) + 0.00000000E+00 2 1000005 36 # BR(~b_2 -> ~b_1 A ) + 0.00000000E+00 2 1000006 -37 # BR(~b_2 -> ~t_1 H-) + 0.00000000E+00 2 2000006 -37 # BR(~b_2 -> ~t_2 H-) + 0.00000000E+00 2 1000005 23 # BR(~b_2 -> ~b_1 Z ) + 2.65610832E-01 2 1000006 -24 # BR(~b_2 -> ~t_1 W-) + 0.00000000E+00 2 2000006 -24 # BR(~b_2 -> ~t_2 W-) +# PDG Width +DECAY 1000002 5.47719539E+00 # sup_L decays +# BR NDA ID1 ID2 + 6.65240987E-03 2 1000022 2 # BR(~u_L -> ~chi_10 u) + 3.19051458E-01 2 1000023 2 # BR(~u_L -> ~chi_20 u) + 8.44929059E-04 2 1000025 2 # BR(~u_L -> ~chi_30 u) + 1.03485173E-02 2 1000035 2 # BR(~u_L -> ~chi_40 u) + 6.49499518E-01 2 1000024 1 # BR(~u_L -> ~chi_1+ d) + 1.36031676E-02 2 1000037 1 # BR(~u_L -> ~chi_2+ d) + 0.00000000E+00 2 1000021 2 # BR(~u_L -> ~g u) +# PDG Width +DECAY 2000002 1.15297292E+00 # sup_R decays +# BR NDA ID1 ID2 + 9.86377420E-01 2 1000022 2 # BR(~u_R -> ~chi_10 u) + 8.46640647E-03 2 1000023 2 # BR(~u_R -> ~chi_20 u) + 1.23894695E-03 2 1000025 2 # BR(~u_R -> ~chi_30 u) + 3.91722611E-03 2 1000035 2 # BR(~u_R -> ~chi_40 u) + 0.00000000E+00 2 1000024 1 # BR(~u_R -> ~chi_1+ d) + 0.00000000E+00 2 1000037 1 # BR(~u_R -> ~chi_2+ d) + 0.00000000E+00 2 1000021 2 # BR(~u_R -> ~g u) +# PDG Width +DECAY 1000001 5.31278772E+00 # sdown_L decays +# BR NDA ID1 ID2 + 2.32317969E-02 2 1000022 1 # BR(~d_L -> ~chi_10 d) + 3.10235077E-01 2 1000023 1 # BR(~d_L -> ~chi_20 d) + 1.52334771E-03 2 1000025 1 # BR(~d_L -> ~chi_30 d) + 1.48849798E-02 2 1000035 1 # BR(~d_L -> ~chi_40 d) + 6.06452481E-01 2 -1000024 2 # BR(~d_L -> ~chi_1- u) + 4.36723179E-02 2 -1000037 2 # BR(~d_L -> ~chi_2- u) + 0.00000000E+00 2 1000021 1 # BR(~d_L -> ~g d) +# PDG Width +DECAY 2000001 2.85812308E-01 # sdown_R decays +# BR NDA ID1 ID2 + 9.86529614E-01 2 1000022 1 # BR(~d_R -> ~chi_10 d) + 8.44510350E-03 2 1000023 1 # BR(~d_R -> ~chi_20 d) + 1.21172119E-03 2 1000025 1 # BR(~d_R -> ~chi_30 d) + 3.81356102E-03 2 1000035 1 # BR(~d_R -> ~chi_40 d) + 0.00000000E+00 2 -1000024 2 # BR(~d_R -> ~chi_1- u) + 0.00000000E+00 2 -1000037 2 # BR(~d_R -> ~chi_2- u) + 0.00000000E+00 2 1000021 1 # BR(~d_R -> ~g d) +# PDG Width +DECAY 1000004 5.47719539E+00 # scharm_L decays +# BR NDA ID1 ID2 + 6.65240987E-03 2 1000022 4 # BR(~c_L -> ~chi_10 c) + 3.19051458E-01 2 1000023 4 # BR(~c_L -> ~chi_20 c) + 8.44929059E-04 2 1000025 4 # BR(~c_L -> ~chi_30 c) + 1.03485173E-02 2 1000035 4 # BR(~c_L -> ~chi_40 c) + 6.49499518E-01 2 1000024 3 # BR(~c_L -> ~chi_1+ s) + 1.36031676E-02 2 1000037 3 # BR(~c_L -> ~chi_2+ s) + 0.00000000E+00 2 1000021 4 # BR(~c_L -> ~g c) +# PDG Width +DECAY 2000004 1.15297292E+00 # scharm_R decays +# BR NDA ID1 ID2 + 9.86377420E-01 2 1000022 4 # BR(~c_R -> ~chi_10 c) + 8.46640647E-03 2 1000023 4 # BR(~c_R -> ~chi_20 c) + 1.23894695E-03 2 1000025 4 # BR(~c_R -> ~chi_30 c) + 3.91722611E-03 2 1000035 4 # BR(~c_R -> ~chi_40 c) + 0.00000000E+00 2 1000024 3 # BR(~c_R -> ~chi_1+ s) + 0.00000000E+00 2 1000037 3 # BR(~c_R -> ~chi_2+ s) + 0.00000000E+00 2 1000021 4 # BR(~c_R -> ~g c) +# PDG Width +DECAY 1000003 5.31278772E+00 # sstrange_L decays +# BR NDA ID1 ID2 + 2.32317969E-02 2 1000022 3 # BR(~s_L -> ~chi_10 s) + 3.10235077E-01 2 1000023 3 # BR(~s_L -> ~chi_20 s) + 1.52334771E-03 2 1000025 3 # BR(~s_L -> ~chi_30 s) + 1.48849798E-02 2 1000035 3 # BR(~s_L -> ~chi_40 s) + 6.06452481E-01 2 -1000024 4 # BR(~s_L -> ~chi_1- c) + 4.36723179E-02 2 -1000037 4 # BR(~s_L -> ~chi_2- c) + 0.00000000E+00 2 1000021 3 # BR(~s_L -> ~g s) +# PDG Width +DECAY 2000003 2.85812308E-01 # sstrange_R decays +# BR NDA ID1 ID2 + 9.86529614E-01 2 1000022 3 # BR(~s_R -> ~chi_10 s) + 8.44510350E-03 2 1000023 3 # BR(~s_R -> ~chi_20 s) + 1.21172119E-03 2 1000025 3 # BR(~s_R -> ~chi_30 s) + 3.81356102E-03 2 1000035 3 # BR(~s_R -> ~chi_40 s) + 0.00000000E+00 2 -1000024 4 # BR(~s_R -> ~chi_1- c) + 0.00000000E+00 2 -1000037 4 # BR(~s_R -> ~chi_2- c) + 0.00000000E+00 2 1000021 3 # BR(~s_R -> ~g s) +# PDG Width +DECAY 1000011 2.13682161E-01 # selectron_L decays +# BR NDA ID1 ID2 + 5.73155386E-01 2 1000022 11 # BR(~e_L -> ~chi_10 e-) + 1.64522579E-01 2 1000023 11 # BR(~e_L -> ~chi_20 e-) + 0.00000000E+00 2 1000025 11 # BR(~e_L -> ~chi_30 e-) + 0.00000000E+00 2 1000035 11 # BR(~e_L -> ~chi_40 e-) + 2.62322035E-01 2 -1000024 12 # BR(~e_L -> ~chi_1- nu_e) + 0.00000000E+00 2 -1000037 12 # BR(~e_L -> ~chi_2- nu_e) +# PDG Width +DECAY 2000011 2.16121626E-01 # selectron_R decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 11 # BR(~e_R -> ~chi_10 e-) + 0.00000000E+00 2 1000023 11 # BR(~e_R -> ~chi_20 e-) + 0.00000000E+00 2 1000025 11 # BR(~e_R -> ~chi_30 e-) + 0.00000000E+00 2 1000035 11 # BR(~e_R -> ~chi_40 e-) + 0.00000000E+00 2 -1000024 12 # BR(~e_R -> ~chi_1- nu_e) + 0.00000000E+00 2 -1000037 12 # BR(~e_R -> ~chi_2- nu_e) +# PDG Width +DECAY 1000013 2.13682161E-01 # smuon_L decays +# BR NDA ID1 ID2 + 5.73155386E-01 2 1000022 13 # BR(~mu_L -> ~chi_10 mu-) + 1.64522579E-01 2 1000023 13 # BR(~mu_L -> ~chi_20 mu-) + 0.00000000E+00 2 1000025 13 # BR(~mu_L -> ~chi_30 mu-) + 0.00000000E+00 2 1000035 13 # BR(~mu_L -> ~chi_40 mu-) + 2.62322035E-01 2 -1000024 14 # BR(~mu_L -> ~chi_1- nu_mu) + 0.00000000E+00 2 -1000037 14 # BR(~mu_L -> ~chi_2- nu_mu) +# PDG Width +DECAY 2000013 2.16121626E-01 # smuon_R decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 13 # BR(~mu_R -> ~chi_10 mu-) + 0.00000000E+00 2 1000023 13 # BR(~mu_R -> ~chi_20 mu-) + 0.00000000E+00 2 1000025 13 # BR(~mu_R -> ~chi_30 mu-) + 0.00000000E+00 2 1000035 13 # BR(~mu_R -> ~chi_40 mu-) + 0.00000000E+00 2 -1000024 14 # BR(~mu_R -> ~chi_1- nu_mu) + 0.00000000E+00 2 -1000037 14 # BR(~mu_R -> ~chi_2- nu_mu) +# PDG Width +DECAY 1000015 1.48327268E-01 # stau_1 decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 15 # BR(~tau_1 -> ~chi_10 tau-) + 0.00000000E+00 2 1000023 15 # BR(~tau_1 -> ~chi_20 tau-) + 0.00000000E+00 2 1000025 15 # BR(~tau_1 -> ~chi_30 tau-) + 0.00000000E+00 2 1000035 15 # BR(~tau_1 -> ~chi_40 tau-) + 0.00000000E+00 2 -1000024 16 # BR(~tau_1 -> ~chi_1- nu_tau) + 0.00000000E+00 2 -1000037 16 # BR(~tau_1 -> ~chi_2- nu_tau) + 0.00000000E+00 2 1000016 -37 # BR(~tau_1 -> ~nu_tauL H-) + 0.00000000E+00 2 1000016 -24 # BR(~tau_1 -> ~nu_tauL W-) +# PDG Width +DECAY 2000015 2.69906096E-01 # stau_2 decays +# BR NDA ID1 ID2 + 5.96653046E-01 2 1000022 15 # BR(~tau_2 -> ~chi_10 tau-) + 1.54536760E-01 2 1000023 15 # BR(~tau_2 -> ~chi_20 tau-) + 0.00000000E+00 2 1000025 15 # BR(~tau_2 -> ~chi_30 tau-) + 0.00000000E+00 2 1000035 15 # BR(~tau_2 -> ~chi_40 tau-) + 2.48810195E-01 2 -1000024 16 # BR(~tau_2 -> ~chi_1- nu_tau) + 0.00000000E+00 2 -1000037 16 # BR(~tau_2 -> ~chi_2- nu_tau) + 0.00000000E+00 2 1000016 -37 # BR(~tau_2 -> ~nu_tauL H-) + 0.00000000E+00 2 1000016 -24 # BR(~tau_2 -> ~nu_tauL W-) + 0.00000000E+00 2 1000015 25 # BR(~tau_2 -> ~tau_1 h) + 0.00000000E+00 2 1000015 35 # BR(~tau_2 -> ~tau_1 H) + 0.00000000E+00 2 1000015 36 # BR(~tau_2 -> ~tau_1 A) + 0.00000000E+00 2 1000015 23 # BR(~tau_2 -> ~tau_1 Z) +# PDG Width +DECAY 1000012 1.49881634E-01 # snu_eL decays +# BR NDA ID1 ID2 + 9.77700764E-01 2 1000022 12 # BR(~nu_eL -> ~chi_10 nu_e) + 8.11554922E-03 2 1000023 12 # BR(~nu_eL -> ~chi_20 nu_e) + 0.00000000E+00 2 1000025 12 # BR(~nu_eL -> ~chi_30 nu_e) + 0.00000000E+00 2 1000035 12 # BR(~nu_eL -> ~chi_40 nu_e) + 1.41836867E-02 2 1000024 11 # BR(~nu_eL -> ~chi_1+ e-) + 0.00000000E+00 2 1000037 11 # BR(~nu_eL -> ~chi_2+ e-) +# PDG Width +DECAY 1000014 1.49881634E-01 # snu_muL decays +# BR NDA ID1 ID2 + 9.77700764E-01 2 1000022 14 # BR(~nu_muL -> ~chi_10 nu_mu) + 8.11554922E-03 2 1000023 14 # BR(~nu_muL -> ~chi_20 nu_mu) + 0.00000000E+00 2 1000025 14 # BR(~nu_muL -> ~chi_30 nu_mu) + 0.00000000E+00 2 1000035 14 # BR(~nu_muL -> ~chi_40 nu_mu) + 1.41836867E-02 2 1000024 13 # BR(~nu_muL -> ~chi_1+ mu-) + 0.00000000E+00 2 1000037 13 # BR(~nu_muL -> ~chi_2+ mu-) +# PDG Width +DECAY 1000016 1.47518977E-01 # snu_tauL decays +# BR NDA ID1 ID2 + 9.85994529E-01 2 1000022 16 # BR(~nu_tauL -> ~chi_10 nu_tau) + 6.25129612E-03 2 1000023 16 # BR(~nu_tauL -> ~chi_20 nu_tau) + 0.00000000E+00 2 1000025 16 # BR(~nu_tauL -> ~chi_30 nu_tau) + 0.00000000E+00 2 1000035 16 # BR(~nu_tauL -> ~chi_40 nu_tau) + 7.75417479E-03 2 1000024 15 # BR(~nu_tauL -> ~chi_1+ tau-) + 0.00000000E+00 2 1000037 15 # BR(~nu_tauL -> ~chi_2+ tau-) + 0.00000000E+00 2 -1000015 -37 # BR(~nu_tauL -> ~tau_1+ H-) + 0.00000000E+00 2 -2000015 -37 # BR(~nu_tauL -> ~tau_2+ H-) + 0.00000000E+00 2 -1000015 -24 # BR(~nu_tauL -> ~tau_1+ W-) + 0.00000000E+00 2 -2000015 -24 # BR(~nu_tauL -> ~tau_2+ W-) +# PDG Width +DECAY 1000024 1.70414503E-02 # chargino1+ decays +# BR NDA ID1 ID2 + 0.00000000E+00 2 1000002 -1 # BR(~chi_1+ -> ~u_L db) + 0.00000000E+00 2 2000002 -1 # BR(~chi_1+ -> ~u_R db) + 0.00000000E+00 2 -1000001 2 # BR(~chi_1+ -> ~d_L* u ) + 0.00000000E+00 2 -2000001 2 # BR(~chi_1+ -> ~d_R* u ) + 0.00000000E+00 2 1000004 -3 # BR(~chi_1+ -> ~c_L sb) + 0.00000000E+00 2 2000004 -3 # BR(~chi_1+ -> ~c_R sb) + 0.00000000E+00 2 -1000003 4 # BR(~chi_1+ -> ~s_L* c ) + 0.00000000E+00 2 -2000003 4 # BR(~chi_1+ -> ~s_R* c ) + 0.00000000E+00 2 1000006 -5 # BR(~chi_1+ -> ~t_1 bb) + 0.00000000E+00 2 2000006 -5 # BR(~chi_1+ -> ~t_2 bb) + 0.00000000E+00 2 -1000005 6 # BR(~chi_1+ -> ~b_1* t ) + 0.00000000E+00 2 -2000005 6 # BR(~chi_1+ -> ~b_2* t ) + 0.00000000E+00 2 1000012 -11 # BR(~chi_1+ -> ~nu_eL e+ ) + 0.00000000E+00 2 1000014 -13 # BR(~chi_1+ -> ~nu_muL mu+ ) + 0.00000000E+00 2 1000016 -15 # BR(~chi_1+ -> ~nu_tau1 tau+) + 0.00000000E+00 2 -1000011 12 # BR(~chi_1+ -> ~e_L+ nu_e) + 0.00000000E+00 2 -2000011 12 # BR(~chi_1+ -> ~e_R+ nu_e) + 0.00000000E+00 2 -1000013 14 # BR(~chi_1+ -> ~mu_L+ nu_mu) + 0.00000000E+00 2 -2000013 14 # BR(~chi_1+ -> ~mu_R+ nu_mu) + 9.25161117E-01 2 -1000015 16 # BR(~chi_1+ -> ~tau_1+ nu_tau) + 0.00000000E+00 2 -2000015 16 # BR(~chi_1+ -> ~tau_2+ nu_tau) + 7.48388828E-02 2 1000022 24 # BR(~chi_1+ -> ~chi_10 W+) + 0.00000000E+00 2 1000023 24 # BR(~chi_1+ -> ~chi_20 W+) + 0.00000000E+00 2 1000025 24 # BR(~chi_1+ -> ~chi_30 W+) + 0.00000000E+00 2 1000035 24 # BR(~chi_1+ -> ~chi_40 W+) + 0.00000000E+00 2 1000022 37 # BR(~chi_1+ -> ~chi_10 H+) + 0.00000000E+00 2 1000023 37 # BR(~chi_1+ -> ~chi_20 H+) + 0.00000000E+00 2 1000025 37 # BR(~chi_1+ -> ~chi_30 H+) + 0.00000000E+00 2 1000035 37 # BR(~chi_1+ -> ~chi_40 H+) +# PDG Width +DECAY 1000037 2.48689510E+00 # chargino2+ decays +# BR NDA ID1 ID2 + 0.00000000E+00 2 1000002 -1 # BR(~chi_2+ -> ~u_L db) + 0.00000000E+00 2 2000002 -1 # BR(~chi_2+ -> ~u_R db) + 0.00000000E+00 2 -1000001 2 # BR(~chi_2+ -> ~d_L* u ) + 0.00000000E+00 2 -2000001 2 # BR(~chi_2+ -> ~d_R* u ) + 0.00000000E+00 2 1000004 -3 # BR(~chi_2+ -> ~c_L sb) + 0.00000000E+00 2 2000004 -3 # BR(~chi_2+ -> ~c_R sb) + 0.00000000E+00 2 -1000003 4 # BR(~chi_2+ -> ~s_L* c ) + 0.00000000E+00 2 -2000003 4 # BR(~chi_2+ -> ~s_R* c ) + 0.00000000E+00 2 1000006 -5 # BR(~chi_2+ -> ~t_1 bb) + 0.00000000E+00 2 2000006 -5 # BR(~chi_2+ -> ~t_2 bb) + 0.00000000E+00 2 -1000005 6 # BR(~chi_2+ -> ~b_1* t ) + 0.00000000E+00 2 -2000005 6 # BR(~chi_2+ -> ~b_2* t ) + 2.00968837E-02 2 1000012 -11 # BR(~chi_2+ -> ~nu_eL e+ ) + 2.00968837E-02 2 1000014 -13 # BR(~chi_2+ -> ~nu_muL mu+ ) + 2.74507395E-02 2 1000016 -15 # BR(~chi_2+ -> ~nu_tau1 tau+) + 5.20406111E-02 2 -1000011 12 # BR(~chi_2+ -> ~e_L+ nu_e) + 0.00000000E+00 2 -2000011 12 # BR(~chi_2+ -> ~e_R+ nu_e) + 5.20406111E-02 2 -1000013 14 # BR(~chi_2+ -> ~mu_L+ nu_mu) + 0.00000000E+00 2 -2000013 14 # BR(~chi_2+ -> ~mu_R+ nu_mu) + 2.82859898E-04 2 -1000015 16 # BR(~chi_2+ -> ~tau_1+ nu_tau) + 5.66729336E-02 2 -2000015 16 # BR(~chi_2+ -> ~tau_2+ nu_tau) + 2.31513269E-01 2 1000024 23 # BR(~chi_2+ -> ~chi_1+ Z ) + 6.76715120E-02 2 1000022 24 # BR(~chi_2+ -> ~chi_10 W+) + 2.93654849E-01 2 1000023 24 # BR(~chi_2+ -> ~chi_20 W+) + 0.00000000E+00 2 1000025 24 # BR(~chi_2+ -> ~chi_30 W+) + 0.00000000E+00 2 1000035 24 # BR(~chi_2+ -> ~chi_40 W+) + 1.78478848E-01 2 1000024 25 # BR(~chi_2+ -> ~chi_1+ h ) + 0.00000000E+00 2 1000024 35 # BR(~chi_2+ -> ~chi_1+ H ) + 0.00000000E+00 2 1000024 36 # BR(~chi_2+ -> ~chi_1+ A ) + 0.00000000E+00 2 1000022 37 # BR(~chi_2+ -> ~chi_10 H+) + 0.00000000E+00 2 1000023 37 # BR(~chi_2+ -> ~chi_20 H+) + 0.00000000E+00 2 1000025 37 # BR(~chi_2+ -> ~chi_30 H+) + 0.00000000E+00 2 1000035 37 # BR(~chi_2+ -> ~chi_40 H+) +# PDG Width +DECAY 1000022 0.00000000E+00 # neutralino1 decays +# PDG Width +DECAY 1000023 2.07770048E-02 # neutralino2 decays +# BR NDA ID1 ID2 + 0.00000000E+00 2 1000022 23 # BR(~chi_20 -> ~chi_10 Z ) + 0.00000000E+00 2 1000024 -24 # BR(~chi_20 -> ~chi_1+ W-) + 0.00000000E+00 2 -1000024 24 # BR(~chi_20 -> ~chi_1- W+) + 0.00000000E+00 2 1000037 -24 # BR(~chi_20 -> ~chi_2+ W-) + 0.00000000E+00 2 -1000037 24 # BR(~chi_20 -> ~chi_2- W+) + 0.00000000E+00 2 1000022 25 # BR(~chi_20 -> ~chi_10 h ) + 0.00000000E+00 2 1000022 35 # BR(~chi_20 -> ~chi_10 H ) + 0.00000000E+00 2 1000022 36 # BR(~chi_20 -> ~chi_10 A ) + 0.00000000E+00 2 1000024 -37 # BR(~chi_20 -> ~chi_1+ H-) + 0.00000000E+00 2 -1000024 37 # BR(~chi_20 -> ~chi_1- H+) + 0.00000000E+00 2 1000037 -37 # BR(~chi_20 -> ~chi_2+ H-) + 0.00000000E+00 2 -1000037 37 # BR(~chi_20 -> ~chi_2- H+) + 0.00000000E+00 2 1000002 -2 # BR(~chi_20 -> ~u_L ub) + 0.00000000E+00 2 -1000002 2 # BR(~chi_20 -> ~u_L* u ) + 0.00000000E+00 2 2000002 -2 # BR(~chi_20 -> ~u_R ub) + 0.00000000E+00 2 -2000002 2 # BR(~chi_20 -> ~u_R* u ) + 0.00000000E+00 2 1000001 -1 # BR(~chi_20 -> ~d_L db) + 0.00000000E+00 2 -1000001 1 # BR(~chi_20 -> ~d_L* d ) + 0.00000000E+00 2 2000001 -1 # BR(~chi_20 -> ~d_R db) + 0.00000000E+00 2 -2000001 1 # BR(~chi_20 -> ~d_R* d ) + 0.00000000E+00 2 1000004 -4 # BR(~chi_20 -> ~c_L cb) + 0.00000000E+00 2 -1000004 4 # BR(~chi_20 -> ~c_L* c ) + 0.00000000E+00 2 2000004 -4 # BR(~chi_20 -> ~c_R cb) + 0.00000000E+00 2 -2000004 4 # BR(~chi_20 -> ~c_R* c ) + 0.00000000E+00 2 1000003 -3 # BR(~chi_20 -> ~s_L sb) + 0.00000000E+00 2 -1000003 3 # BR(~chi_20 -> ~s_L* s ) + 0.00000000E+00 2 2000003 -3 # BR(~chi_20 -> ~s_R sb) + 0.00000000E+00 2 -2000003 3 # BR(~chi_20 -> ~s_R* s ) + 0.00000000E+00 2 1000006 -6 # BR(~chi_20 -> ~t_1 tb) + 0.00000000E+00 2 -1000006 6 # BR(~chi_20 -> ~t_1* t ) + 0.00000000E+00 2 2000006 -6 # BR(~chi_20 -> ~t_2 tb) + 0.00000000E+00 2 -2000006 6 # BR(~chi_20 -> ~t_2* t ) + 0.00000000E+00 2 1000005 -5 # BR(~chi_20 -> ~b_1 bb) + 0.00000000E+00 2 -1000005 5 # BR(~chi_20 -> ~b_1* b ) + 0.00000000E+00 2 2000005 -5 # BR(~chi_20 -> ~b_2 bb) + 0.00000000E+00 2 -2000005 5 # BR(~chi_20 -> ~b_2* b ) + 0.00000000E+00 2 1000011 -11 # BR(~chi_20 -> ~e_L- e+) + 0.00000000E+00 2 -1000011 11 # BR(~chi_20 -> ~e_L+ e-) + 2.95071995E-02 2 2000011 -11 # BR(~chi_20 -> ~e_R- e+) + 2.95071995E-02 2 -2000011 11 # BR(~chi_20 -> ~e_R+ e-) + 0.00000000E+00 2 1000013 -13 # BR(~chi_20 -> ~mu_L- mu+) + 0.00000000E+00 2 -1000013 13 # BR(~chi_20 -> ~mu_L+ mu-) + 2.95071995E-02 2 2000013 -13 # BR(~chi_20 -> ~mu_R- mu+) + 2.95071995E-02 2 -2000013 13 # BR(~chi_20 -> ~mu_R+ mu-) + 4.40985601E-01 2 1000015 -15 # BR(~chi_20 -> ~tau_1- tau+) + 4.40985601E-01 2 -1000015 15 # BR(~chi_20 -> ~tau_1+ tau-) + 0.00000000E+00 2 2000015 -15 # BR(~chi_20 -> ~tau_2- tau+) + 0.00000000E+00 2 -2000015 15 # BR(~chi_20 -> ~tau_2+ tau-) + 0.00000000E+00 2 1000012 -12 # BR(~chi_20 -> ~nu_eL nu_eb) + 0.00000000E+00 2 -1000012 12 # BR(~chi_20 -> ~nu_eL* nu_e ) + 0.00000000E+00 2 1000014 -14 # BR(~chi_20 -> ~nu_muL nu_mub) + 0.00000000E+00 2 -1000014 14 # BR(~chi_20 -> ~nu_muL* nu_mu ) + 0.00000000E+00 2 1000016 -16 # BR(~chi_20 -> ~nu_tau1 nu_taub) + 0.00000000E+00 2 -1000016 16 # BR(~chi_20 -> ~nu_tau1* nu_tau ) +# PDG Width +DECAY 1000025 1.91598495E+00 # neutralino3 decays +# BR NDA ID1 ID2 + 1.13226601E-01 2 1000022 23 # BR(~chi_30 -> ~chi_10 Z ) + 2.11969194E-01 2 1000023 23 # BR(~chi_30 -> ~chi_20 Z ) + 2.95329778E-01 2 1000024 -24 # BR(~chi_30 -> ~chi_1+ W-) + 2.95329778E-01 2 -1000024 24 # BR(~chi_30 -> ~chi_1- W+) + 0.00000000E+00 2 1000037 -24 # BR(~chi_30 -> ~chi_2+ W-) + 0.00000000E+00 2 -1000037 24 # BR(~chi_30 -> ~chi_2- W+) + 2.13076490E-02 2 1000022 25 # BR(~chi_30 -> ~chi_10 h ) + 0.00000000E+00 2 1000022 35 # BR(~chi_30 -> ~chi_10 H ) + 0.00000000E+00 2 1000022 36 # BR(~chi_30 -> ~chi_10 A ) + 1.24538329E-02 2 1000023 25 # BR(~chi_30 -> ~chi_20 h ) + 0.00000000E+00 2 1000023 35 # BR(~chi_30 -> ~chi_20 H ) + 0.00000000E+00 2 1000023 36 # BR(~chi_30 -> ~chi_20 A ) + 0.00000000E+00 2 1000024 -37 # BR(~chi_30 -> ~chi_1+ H-) + 0.00000000E+00 2 -1000024 37 # BR(~chi_30 -> ~chi_1- H+) + 0.00000000E+00 2 1000037 -37 # BR(~chi_30 -> ~chi_2+ H-) + 0.00000000E+00 2 -1000037 37 # BR(~chi_30 -> ~chi_2- H+) + 0.00000000E+00 2 1000002 -2 # BR(~chi_30 -> ~u_L ub) + 0.00000000E+00 2 -1000002 2 # BR(~chi_30 -> ~u_L* u ) + 0.00000000E+00 2 2000002 -2 # BR(~chi_30 -> ~u_R ub) + 0.00000000E+00 2 -2000002 2 # BR(~chi_30 -> ~u_R* u ) + 0.00000000E+00 2 1000001 -1 # BR(~chi_30 -> ~d_L db) + 0.00000000E+00 2 -1000001 1 # BR(~chi_30 -> ~d_L* d ) + 0.00000000E+00 2 2000001 -1 # BR(~chi_30 -> ~d_R db) + 0.00000000E+00 2 -2000001 1 # BR(~chi_30 -> ~d_R* d ) + 0.00000000E+00 2 1000004 -4 # BR(~chi_30 -> ~c_L cb) + 0.00000000E+00 2 -1000004 4 # BR(~chi_30 -> ~c_L* c ) + 0.00000000E+00 2 2000004 -4 # BR(~chi_30 -> ~c_R cb) + 0.00000000E+00 2 -2000004 4 # BR(~chi_30 -> ~c_R* c ) + 0.00000000E+00 2 1000003 -3 # BR(~chi_30 -> ~s_L sb) + 0.00000000E+00 2 -1000003 3 # BR(~chi_30 -> ~s_L* s ) + 0.00000000E+00 2 2000003 -3 # BR(~chi_30 -> ~s_R sb) + 0.00000000E+00 2 -2000003 3 # BR(~chi_30 -> ~s_R* s ) + 0.00000000E+00 2 1000006 -6 # BR(~chi_30 -> ~t_1 tb) + 0.00000000E+00 2 -1000006 6 # BR(~chi_30 -> ~t_1* t ) + 0.00000000E+00 2 2000006 -6 # BR(~chi_30 -> ~t_2 tb) + 0.00000000E+00 2 -2000006 6 # BR(~chi_30 -> ~t_2* t ) + 0.00000000E+00 2 1000005 -5 # BR(~chi_30 -> ~b_1 bb) + 0.00000000E+00 2 -1000005 5 # BR(~chi_30 -> ~b_1* b ) + 0.00000000E+00 2 2000005 -5 # BR(~chi_30 -> ~b_2 bb) + 0.00000000E+00 2 -2000005 5 # BR(~chi_30 -> ~b_2* b ) + 5.57220455E-04 2 1000011 -11 # BR(~chi_30 -> ~e_L- e+) + 5.57220455E-04 2 -1000011 11 # BR(~chi_30 -> ~e_L+ e-) + 1.25266782E-03 2 2000011 -11 # BR(~chi_30 -> ~e_R- e+) + 1.25266782E-03 2 -2000011 11 # BR(~chi_30 -> ~e_R+ e-) + 5.57220455E-04 2 1000013 -13 # BR(~chi_30 -> ~mu_L- mu+) + 5.57220455E-04 2 -1000013 13 # BR(~chi_30 -> ~mu_L+ mu-) + 1.25266782E-03 2 2000013 -13 # BR(~chi_30 -> ~mu_R- mu+) + 1.25266782E-03 2 -2000013 13 # BR(~chi_30 -> ~mu_R+ mu-) + 5.26279239E-03 2 1000015 -15 # BR(~chi_30 -> ~tau_1- tau+) + 5.26279239E-03 2 -1000015 15 # BR(~chi_30 -> ~tau_1+ tau-) + 6.72814564E-03 2 2000015 -15 # BR(~chi_30 -> ~tau_2- tau+) + 6.72814564E-03 2 -2000015 15 # BR(~chi_30 -> ~tau_2+ tau-) + 3.18920485E-03 2 1000012 -12 # BR(~chi_30 -> ~nu_eL nu_eb) + 3.18920485E-03 2 -1000012 12 # BR(~chi_30 -> ~nu_eL* nu_e ) + 3.18920485E-03 2 1000014 -14 # BR(~chi_30 -> ~nu_muL nu_mub) + 3.18920485E-03 2 -1000014 14 # BR(~chi_30 -> ~nu_muL* nu_mu ) + 3.20245934E-03 2 1000016 -16 # BR(~chi_30 -> ~nu_tau1 nu_taub) + 3.20245934E-03 2 -1000016 16 # BR(~chi_30 -> ~nu_tau1* nu_tau ) +# PDG Width +DECAY 1000035 2.58585079E+00 # neutralino4 decays +# BR NDA ID1 ID2 + 2.15369294E-02 2 1000022 23 # BR(~chi_40 -> ~chi_10 Z ) + 1.85499971E-02 2 1000023 23 # BR(~chi_40 -> ~chi_20 Z ) + 0.00000000E+00 2 1000025 23 # BR(~chi_40 -> ~chi_30 Z ) + 2.49541430E-01 2 1000024 -24 # BR(~chi_40 -> ~chi_1+ W-) + 2.49541430E-01 2 -1000024 24 # BR(~chi_40 -> ~chi_1- W+) + 0.00000000E+00 2 1000037 -24 # BR(~chi_40 -> ~chi_2+ W-) + 0.00000000E+00 2 -1000037 24 # BR(~chi_40 -> ~chi_2- W+) + 6.93213268E-02 2 1000022 25 # BR(~chi_40 -> ~chi_10 h ) + 0.00000000E+00 2 1000022 35 # BR(~chi_40 -> ~chi_10 H ) + 0.00000000E+00 2 1000022 36 # BR(~chi_40 -> ~chi_10 A ) + 1.47602336E-01 2 1000023 25 # BR(~chi_40 -> ~chi_20 h ) + 0.00000000E+00 2 1000023 35 # BR(~chi_40 -> ~chi_20 H ) + 0.00000000E+00 2 1000023 36 # BR(~chi_40 -> ~chi_20 A ) + 0.00000000E+00 2 1000025 25 # BR(~chi_40 -> ~chi_30 h ) + 0.00000000E+00 2 1000025 35 # BR(~chi_40 -> ~chi_30 H ) + 0.00000000E+00 2 1000025 36 # BR(~chi_40 -> ~chi_30 A ) + 0.00000000E+00 2 1000024 -37 # BR(~chi_40 -> ~chi_1+ H-) + 0.00000000E+00 2 -1000024 37 # BR(~chi_40 -> ~chi_1- H+) + 0.00000000E+00 2 1000037 -37 # BR(~chi_40 -> ~chi_2+ H-) + 0.00000000E+00 2 -1000037 37 # BR(~chi_40 -> ~chi_2- H+) + 0.00000000E+00 2 1000002 -2 # BR(~chi_40 -> ~u_L ub) + 0.00000000E+00 2 -1000002 2 # BR(~chi_40 -> ~u_L* u ) + 0.00000000E+00 2 2000002 -2 # BR(~chi_40 -> ~u_R ub) + 0.00000000E+00 2 -2000002 2 # BR(~chi_40 -> ~u_R* u ) + 0.00000000E+00 2 1000001 -1 # BR(~chi_40 -> ~d_L db) + 0.00000000E+00 2 -1000001 1 # BR(~chi_40 -> ~d_L* d ) + 0.00000000E+00 2 2000001 -1 # BR(~chi_40 -> ~d_R db) + 0.00000000E+00 2 -2000001 1 # BR(~chi_40 -> ~d_R* d ) + 0.00000000E+00 2 1000004 -4 # BR(~chi_40 -> ~c_L cb) + 0.00000000E+00 2 -1000004 4 # BR(~chi_40 -> ~c_L* c ) + 0.00000000E+00 2 2000004 -4 # BR(~chi_40 -> ~c_R cb) + 0.00000000E+00 2 -2000004 4 # BR(~chi_40 -> ~c_R* c ) + 0.00000000E+00 2 1000003 -3 # BR(~chi_40 -> ~s_L sb) + 0.00000000E+00 2 -1000003 3 # BR(~chi_40 -> ~s_L* s ) + 0.00000000E+00 2 2000003 -3 # BR(~chi_40 -> ~s_R sb) + 0.00000000E+00 2 -2000003 3 # BR(~chi_40 -> ~s_R* s ) + 0.00000000E+00 2 1000006 -6 # BR(~chi_40 -> ~t_1 tb) + 0.00000000E+00 2 -1000006 6 # BR(~chi_40 -> ~t_1* t ) + 0.00000000E+00 2 2000006 -6 # BR(~chi_40 -> ~t_2 tb) + 0.00000000E+00 2 -2000006 6 # BR(~chi_40 -> ~t_2* t ) + 0.00000000E+00 2 1000005 -5 # BR(~chi_40 -> ~b_1 bb) + 0.00000000E+00 2 -1000005 5 # BR(~chi_40 -> ~b_1* b ) + 0.00000000E+00 2 2000005 -5 # BR(~chi_40 -> ~b_2 bb) + 0.00000000E+00 2 -2000005 5 # BR(~chi_40 -> ~b_2* b ) + 9.64835418E-03 2 1000011 -11 # BR(~chi_40 -> ~e_L- e+) + 9.64835418E-03 2 -1000011 11 # BR(~chi_40 -> ~e_L+ e-) + 3.75684470E-03 2 2000011 -11 # BR(~chi_40 -> ~e_R- e+) + 3.75684470E-03 2 -2000011 11 # BR(~chi_40 -> ~e_R+ e-) + 9.64835418E-03 2 1000013 -13 # BR(~chi_40 -> ~mu_L- mu+) + 9.64835418E-03 2 -1000013 13 # BR(~chi_40 -> ~mu_L+ mu-) + 3.75684470E-03 2 2000013 -13 # BR(~chi_40 -> ~mu_R- mu+) + 3.75684470E-03 2 -2000013 13 # BR(~chi_40 -> ~mu_R+ mu-) + 2.68215241E-03 2 1000015 -15 # BR(~chi_40 -> ~tau_1- tau+) + 2.68215241E-03 2 -1000015 15 # BR(~chi_40 -> ~tau_1+ tau-) + 1.62289809E-02 2 2000015 -15 # BR(~chi_40 -> ~tau_2- tau+) + 1.62289809E-02 2 -2000015 15 # BR(~chi_40 -> ~tau_2+ tau-) + 2.53796547E-02 2 1000012 -12 # BR(~chi_40 -> ~nu_eL nu_eb) + 2.53796547E-02 2 -1000012 12 # BR(~chi_40 -> ~nu_eL* nu_e ) + 2.53796547E-02 2 1000014 -14 # BR(~chi_40 -> ~nu_muL nu_mub) + 2.53796547E-02 2 -1000014 14 # BR(~chi_40 -> ~nu_muL* nu_mu ) + 2.54724352E-02 2 1000016 -16 # BR(~chi_40 -> ~nu_tau1 nu_taub) + 2.54724352E-02 2 -1000016 16 # BR(~chi_40 -> ~nu_tau1* nu_tau ) +""" + +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * +from Configuration.Generator.PSweightsPythia.PythiaPSweightsSettings_cfi import * + +generator = cms.EDFilter("Pythia8GeneratorFilter", + pythiaPylistVerbosity = cms.untracked.int32(0), + filterEfficiency = cms.untracked.double(1), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(COM_ENERGY), + crossSection = cms.untracked.double(CROSS_SECTION), + maxEventsToPrint = cms.untracked.int32(0), + SLHATableForPythia8 = cms.string('%s' % SLHA_TABLE), + PythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CP5SettingsBlock, + pythia8PSweightsSettingsBlock, + processParameters = cms.vstring( + 'SUSY:all = off', + 'SUSY:gg2squarkantisquark = on', + 'SUSY:qqbar2squarkantisquark= on', + 'RHadrons:allow = on', + 'RHadrons:allowDecay = on', + 'RHadrons:setMasses = on', + '1000006:tau0 = %.1f' % CTAU_POINT, + ), + parameterSets = cms.vstring( + 'pythia8CommonSettings', + 'pythia8CP5Settings', + 'pythia8PSweightsSettings', + 'processParameters' + ) + ) +) + +ProductionFilterSequence = cms.Sequence(generator) diff --git a/Configuration/PyReleaseValidation/python/relval_standard.py b/Configuration/PyReleaseValidation/python/relval_standard.py index 4c0ddec48d777..1249cbc4d167f 100644 --- a/Configuration/PyReleaseValidation/python/relval_standard.py +++ b/Configuration/PyReleaseValidation/python/relval_standard.py @@ -660,7 +660,7 @@ workflows[1352] = ['', ['HSCPstop_M_200_13','DIGIUP15','RECOUP15','HARVESTUP15']] workflows[1353] = ['', ['RSGravitonToGaGa_13','DIGIUP15','RECOUP15','HARVESTUP15']] workflows[1354] = ['', ['WpToENu_M-2000_13','DIGIUP15','RECOUP15','HARVESTUP15']] -workflows[1355] = ['', ['DisplacedSUSY_stopToBottom_M_300_1000mm_13','DIGIUP15','RECOUP15','HARVESTUP15']] +workflows[1355] = ['', ['DisplacedSUSY_stopToBottom_M_800_500mm_13','DIGIUP15','RECOUP15','HARVESTUP15']] # fullSim 13TeV normal workflows starting from gridpacks LHE generation workflows[1360] = ['', ['TTbar012Jets_NLO_Mad_py8_Evt_13','DIGIUP15','RECOUP15','HARVESTUP15']] diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 48f983da0ea1b..a13345b14aab0 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -602,8 +602,7 @@ def gen2021hiprod(fragment,howMuch): steps['HSCPstop_M_200_13']=gen2015('HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_cff',Kby(9,100)) steps['RSGravitonToGaGa_13']=gen2015('RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_cfi',Kby(9,100)) steps['WpToENu_M-2000_13']=gen2015('WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_cff',Kby(9,100)) -steps['DisplacedSUSY_stopToBottom_M_300_1000mm_13']=gen2015('DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff',Kby(9,100)) - +steps['DisplacedSUSY_stopToBottom_M_800_500mm_13']=gen2015('DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff',Kby(9,100)) ### 2017 wf: only the ones for premixing (for the moment) steps['NuGun_UP17']=gen2017('SingleNuE10_cfi.py',Kby(9,50)) @@ -780,7 +779,7 @@ def identitySim(wf): steps['HSCPstop_M_200_13INPUT']={'INPUT':InputInfo(dataSet='/RelValHSCPstop_M_200_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} steps['RSGravitonToGaGa_13INPUT']={'INPUT':InputInfo(dataSet='/RelValRSGravitonToGaGa_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} steps['WpToENu_M-2000_13INPUT']={'INPUT':InputInfo(dataSet='/RelValWpToENu_M-2000_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} -steps['DisplacedSUSY_stopToBottom_M_300_1000mm_13INPUT']={'INPUT':InputInfo(dataSet='/RelValDisplacedSUSY_stopToBottom_M_300_1000mm_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} +steps['DisplacedSUSY_stopToBottom_M_800_500mm_13INPUT']={'INPUT':InputInfo(dataSet='/RelValDisplacedSUSY_stopToBottom_M_800_500mm_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} # particle guns with postLS1 geometry recycle GEN-SIM input steps['SingleElectronPt10_UP15INPUT']={'INPUT':InputInfo(dataSet='/RelValSingleElectronPt10_UP15/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} @@ -3220,7 +3219,7 @@ def gen2021HiMix(fragment,howMuch): defaultDataSets.update(puDataSets) # sometimes v1 won't be used - override it here - the dictionary key is gen fragment + '_' + geometry -versionOverrides={'BuMixing_BMuonFilter_forSTEAM_13TeV_TuneCUETP8M1_2017':'2','HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_2017':'2','RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_2017':'2','WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_2017':'2','DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_2017':'2','TenE_E_0_200_pythia8_2017':'2','TenE_E_0_200_pythia8_2017PU':'2', 'TenTau_E_15_500_pythia8_2018':'2','PhotonJet_Pt_10_13TeV_TuneCUETP8M1_2018':'2','Wjet_Pt_80_120_13TeV_TuneCUETP8M1_2018':'2'} +versionOverrides={'BuMixing_BMuonFilter_forSTEAM_13TeV_TuneCUETP8M1_2017':'2','HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_2017':'2','RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_2017':'2','WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_2017':'2','DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_2017':'2','TenE_E_0_200_pythia8_2017':'2','TenE_E_0_200_pythia8_2017PU':'2', 'TenTau_E_15_500_pythia8_2018':'2','PhotonJet_Pt_10_13TeV_TuneCUETP8M1_2018':'2','Wjet_Pt_80_120_13TeV_TuneCUETP8M1_2018':'2'} baseDataSetReleaseBetter={} for gen in upgradeFragments: diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 416152297f093..d7bb4c22134cd 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -1144,7 +1144,8 @@ def __init__(self, howMuch, dataset): ('HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_cff', UpgradeFragment(Kby(9,50),'HSCPstop_M_200_13')), ('RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_cfi', UpgradeFragment(Kby(9,50),'RSGravitonToGaGa_13')), ('WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_cff', UpgradeFragment(Kby(9,50),'WpToENu_M-2000_13')), - ('DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff', UpgradeFragment(Kby(9,50),'DisplacedSUSY_stopToB_M_300_1000mm_13')), + ('DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff', UpgradeFragment(Kby(9,50),'DisplacedSUSY_stopToB_M_800_500mm_13')), + ('DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff', UpgradeFragment(Kby(9,50),'DisplacedSUSY_stopToB_M_800_500mm_14')), ('TenE_E_0_200_pythia8_cfi', UpgradeFragment(Kby(9,100),'TenE_0_200')), ('FlatRandomPtAndDxyGunProducer_cfi', UpgradeFragment(Kby(9,100),'DisplacedMuonsDxy_0_500')), ('TenTau_E_15_500_pythia8_cfi', UpgradeFragment(Kby(9,100),'TenTau_15_500')), From 4128b1114be2166cd9f3340d4b43898050d9f2cd Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Mon, 28 Sep 2020 13:04:47 +0200 Subject: [PATCH 283/778] Filtered view is not a shape --- .../DDCMS/interface/DDFilteredView.h | 32 ------------------- .../DDCMS/test/DDFilteredView.cppunit.cc | 2 +- .../DDCMS/test/DDSolid.cppunit.cc | 2 +- .../src/EcalSimParametersFromDD.cc | 2 +- .../HcalCommonData/src/HcalGeomParameters.cc | 10 +++--- .../src/HcalTB02ParametersFromDD.cc | 2 +- .../src/RPCGeometryBuilder.cc | 2 +- 7 files changed, 10 insertions(+), 42 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index a39817c526410..c8cec9b28b3c0 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -136,39 +136,7 @@ namespace cms { //! set current node to the parent node in the filtered tree void up(); - // Get shape pointer of current node. - // Caller must check that current node matches desired type - // before calling this function. - - template <class Shape> - const Shape* getShapePtr() const { - Volume currVol = node_->GetVolume(); - return (dynamic_cast<Shape*>(currVol->GetShape())); - } - // Shape of current node - - template <class Shape> - bool isA() const { - return dd4hep::isA<Shape>(solid()); - } - - bool isABox() const { return isA<dd4hep::Box>(); } - - bool isAConeSeg() const { return isA<dd4hep::ConeSegment>(); } - - bool isAPseudoTrap() const { return isA<dd4hep::PseudoTrap>(); } - - bool isATrapezoid() const { return isA<dd4hep::Trap>(); } - - bool isATruncTube() const { return isA<dd4hep::TruncatedTube>(); } - - bool isATubeSeg() const { return isA<dd4hep::Tube>(); } - - bool isASubtraction() const { - return (isA<dd4hep::SubtractionSolid>() and not isA<dd4hep::TruncatedTube>() and not isA<dd4hep::PseudoTrap>()); - } - dd4hep::Solid solid() const; // Name of current node diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.cppunit.cc index b99800011a344..10ef4a6392246 100644 --- a/DetectorDescription/DDCMS/test/DDFilteredView.cppunit.cc +++ b/DetectorDescription/DDCMS/test/DDFilteredView.cppunit.cc @@ -70,7 +70,7 @@ void testDDFilteredView::checkFilteredView() { std::cout << fview.name() << " is a " << cms::dd::name(cms::DDSolidShapeMap, fview.shape()) << "\n"; std::cout << "Full path to it is " << fview.path() << "\n"; auto copyNos = fview.copyNos(); - if (fview.isA<dd4hep::Box>()) + if (dd4hep::isA<dd4hep::Box>(fview.solid())) cout << "It's a Box\n"; fview.parent(); std::cout << fview.name() << " is a " << cms::dd::name(cms::DDSolidShapeMap, fview.shape()) << "\n"; diff --git a/DetectorDescription/DDCMS/test/DDSolid.cppunit.cc b/DetectorDescription/DDCMS/test/DDSolid.cppunit.cc index 835c19576fa4e..0a800f1b17d74 100644 --- a/DetectorDescription/DDCMS/test/DDSolid.cppunit.cc +++ b/DetectorDescription/DDCMS/test/DDSolid.cppunit.cc @@ -42,7 +42,7 @@ void testDDSolid::checkDDSolid() { std::cout << fview.name() << " is a " << title << " == " << name << "\n"; CPPUNIT_ASSERT(title.compare(name) == 0); - if (fview.isASubtraction()) { + if ((dd4hep::isA<dd4hep::SubtractionSolid>(fview.solid()) and not dd4hep::isA<dd4hep::TruncatedTube>(fview.solid()) and not dd4hep::isA<dd4hep::PseudoTrap>(fview.solid()))) { DDSolid solid(fview.solid()); auto solidA = solid.solidA(); std::cout << "Solid A is a " << solidA->GetTitle() << "\n"; diff --git a/Geometry/EcalCommonData/src/EcalSimParametersFromDD.cc b/Geometry/EcalCommonData/src/EcalSimParametersFromDD.cc index b333477996654..4b3232f955cff 100644 --- a/Geometry/EcalCommonData/src/EcalSimParametersFromDD.cc +++ b/Geometry/EcalCommonData/src/EcalSimParametersFromDD.cc @@ -166,7 +166,7 @@ bool EcalSimParametersFromDD::build(const cms::DDCompactView* cpv, php.matNames_.emplace_back(matName); php.lvNames_.emplace_back(name); const std::vector<double>& paras = fv.parameters(); - double dz = (fv.isATrapezoid()) ? convertCmToMm(2 * paras[0]) : 0.0; + double dz = (dd4hep::isA<dd4hep::Trap>(fv.solid())) ? convertCmToMm(2 * paras[0]) : 0.0; php.dzs_.emplace_back(dz); } }; diff --git a/Geometry/HcalCommonData/src/HcalGeomParameters.cc b/Geometry/HcalCommonData/src/HcalGeomParameters.cc index bc334670d7cec..7c881a0545e50 100644 --- a/Geometry/HcalCommonData/src/HcalGeomParameters.cc +++ b/Geometry/HcalCommonData/src/HcalGeomParameters.cc @@ -260,18 +260,18 @@ void HcalGeomParameters::loadGeometry(const cms::DDCompactView& cpv, HcalParamet #endif double dx = 0, dy = 0, dz = 0, dx1 = 0, dx2 = 0; double alp(0); - if (fv.isABox()) { + if (dd4hep::isA<dd4hep::Box>(fv.solid())) { dx = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[0]; dy = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[1]; dz = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[2]; - } else if (fv.isATrapezoid()) { + } else if (dd4hep::isA<dd4hep::Trap>(fv.solid())) { dx1 = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[4]; dx2 = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[5]; dx = 0.25 * HcalGeomParameters::k_ScaleFromDD4HepToG4 * (paras[4] + paras[5] + paras[8] + paras[9]); dy = 0.5 * HcalGeomParameters::k_ScaleFromDD4HepToG4 * (paras[3] + paras[7]); dz = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[0]; alp = 0.5 * (paras[6] + paras[10]); - } else if (fv.isATubeSeg()) { + } else if (dd4hep::isA<dd4hep::Tube>(fv.solid())) { dx = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[0]; dy = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[1]; dz = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[2]; @@ -416,11 +416,11 @@ void HcalGeomParameters::loadGeometry(const cms::DDCompactView& cpv, HcalParamet for (unsigned j = 0; j < paras.size(); j++) edm::LogVerbatim("HCalGeom") << "HF Parameter[" << j << "] = " << paras[j]; #endif - if (fv.isA<dd4hep::Polycone>()) { + if (dd4hep::isA<dd4hep::Polycone>(fv.solid())) { int nz = (int)(paras.size()) - 3; dzVcal_ = 0.5 * HcalGeomParameters::k_ScaleFromDD4HepToG4 * (paras[nz] - paras[3]); hf = true; - } else if (fv.isATubeSeg() || fv.isAConeSeg()) { + } else if (dd4hep::isA<dd4hep::Tube>(fv.solid()) || dd4hep::isA<dd4hep::ConeSegment>(fv.solid())) { dzVcal_ = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[2]; hf = true; } diff --git a/Geometry/HcalTestBeamData/src/HcalTB02ParametersFromDD.cc b/Geometry/HcalTestBeamData/src/HcalTB02ParametersFromDD.cc index c53dc90520931..dee766f8d7679 100644 --- a/Geometry/HcalTestBeamData/src/HcalTB02ParametersFromDD.cc +++ b/Geometry/HcalTestBeamData/src/HcalTB02ParametersFromDD.cc @@ -42,7 +42,7 @@ bool HcalTB02ParametersFromDD::build(const cms::DDCompactView* cpv, HcalTB02Para const std::vector<double>& paras = fv.parameters(); edm::LogVerbatim("HcalTBSim") << "HcalTB02ParametersFromDD (for " << name << "): Solid " << namx << " Shape " << cms::dd::name(cms::DDSolidShapeMap, fv.shape()) << " Parameter 0 = " << paras[0]; - if (fv.isATrapezoid()) { + if (dd4hep::isA<dd4hep::Trap>(fv.solid())) { double dz = 2 * k_ScaleFromDD4HepToG4 * paras[0]; php.lengthMap_.insert(std::pair<std::string, double>(namx, dz)); } diff --git a/Geometry/RPCGeometryBuilder/src/RPCGeometryBuilder.cc b/Geometry/RPCGeometryBuilder/src/RPCGeometryBuilder.cc index 7ddfd79f3075c..b5e9711fd683c 100644 --- a/Geometry/RPCGeometryBuilder/src/RPCGeometryBuilder.cc +++ b/Geometry/RPCGeometryBuilder/src/RPCGeometryBuilder.cc @@ -274,7 +274,7 @@ std::unique_ptr<RPCGeometry> RPCGeometryBuilder::buildGeometry(cms::DDFilteredVi RPCRollSpecs* rollspecs = nullptr; Bounds* bounds = nullptr; - if (fview.isABox() == 1) { + if (dd4hep::isA<dd4hep::Box>(fview.solid())) { const float width = dpar[0]; const float length = dpar[1]; const float thickness = dpar[2]; From 979f97fbdc44573a2f530efb9e0e6d0d359f6fff Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Wed, 7 Oct 2020 09:59:45 +0200 Subject: [PATCH 284/778] code format --- DetectorDescription/DDCMS/test/DDSolid.cppunit.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DetectorDescription/DDCMS/test/DDSolid.cppunit.cc b/DetectorDescription/DDCMS/test/DDSolid.cppunit.cc index 0a800f1b17d74..0e0b4a03c6ca7 100644 --- a/DetectorDescription/DDCMS/test/DDSolid.cppunit.cc +++ b/DetectorDescription/DDCMS/test/DDSolid.cppunit.cc @@ -42,7 +42,9 @@ void testDDSolid::checkDDSolid() { std::cout << fview.name() << " is a " << title << " == " << name << "\n"; CPPUNIT_ASSERT(title.compare(name) == 0); - if ((dd4hep::isA<dd4hep::SubtractionSolid>(fview.solid()) and not dd4hep::isA<dd4hep::TruncatedTube>(fview.solid()) and not dd4hep::isA<dd4hep::PseudoTrap>(fview.solid()))) { + if ((dd4hep::isA<dd4hep::SubtractionSolid>(fview.solid()) and + not dd4hep::isA<dd4hep::TruncatedTube>(fview.solid()) and + not dd4hep::isA<dd4hep::PseudoTrap>(fview.solid()))) { DDSolid solid(fview.solid()); auto solidA = solid.solidA(); std::cout << "Solid A is a " << solidA->GetTitle() << "\n"; From 011392ca236bceaf3f0df59526bf80ca3fcd4080 Mon Sep 17 00:00:00 2001 From: Juliette <juliette.alimena@cern.ch> Date: Wed, 7 Oct 2020 12:30:58 +0200 Subject: [PATCH 285/778] moved new WF to the bottom, in order to not ruin the order of existing workflow IDs --- .../PyReleaseValidation/python/upgradeWorkflowComponents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index d7bb4c22134cd..e64a6d8891afe 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -1145,7 +1145,6 @@ def __init__(self, howMuch, dataset): ('RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_cfi', UpgradeFragment(Kby(9,50),'RSGravitonToGaGa_13')), ('WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_cff', UpgradeFragment(Kby(9,50),'WpToENu_M-2000_13')), ('DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff', UpgradeFragment(Kby(9,50),'DisplacedSUSY_stopToB_M_800_500mm_13')), - ('DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff', UpgradeFragment(Kby(9,50),'DisplacedSUSY_stopToB_M_800_500mm_14')), ('TenE_E_0_200_pythia8_cfi', UpgradeFragment(Kby(9,100),'TenE_0_200')), ('FlatRandomPtAndDxyGunProducer_cfi', UpgradeFragment(Kby(9,100),'DisplacedMuonsDxy_0_500')), ('TenTau_E_15_500_pythia8_cfi', UpgradeFragment(Kby(9,100),'TenTau_15_500')), @@ -1185,4 +1184,5 @@ def __init__(self, howMuch, dataset): ('Upsilon1SToMuMu_forSTEAM_14TeV_TuneCP5_cfi', UpgradeFragment(Kby(9,50),'Upsilon1SToMuMu_14')), ('TenTau_E_15_500_Eta3p1_pythia8_cfi', UpgradeFragment(Kby(9,100),'TenTau_15_500_Eta3p1')), ('QCD_Pt_1800_2400_14TeV_TuneCP5_cfi', UpgradeFragment(Kby(9,50), 'QCD_Pt_1800_2400_14')), + ('DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_14TeV_pythia8_cff', UpgradeFragment(Kby(9,50),'DisplacedSUSY_stopToB_M_800_500mm_14')), ]) From d79752629dccde45e19bcb04c72b0cba5948cf16 Mon Sep 17 00:00:00 2001 From: Sebastien Wertz <sebastien.wertz@cern.ch> Date: Wed, 7 Oct 2020 11:28:13 +0200 Subject: [PATCH 286/778] only fix IP sign --- PhysicsTools/NanoAOD/python/electrons_cff.py | 26 +++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 2c5a659a1d07b..2c46fed98fb5c 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -40,6 +40,9 @@ ) run2_miniAOD_80XLegacy.toModify( slimmedElectronsUpdated, computeMiniIso = True ) +# bypass the update to 106X in 106X to only pick up the IP sign fix +run2_nanoAOD_106Xv1.toModify(slimmedElectronsUpdated, src = cms.InputTag("slimmedElectrons")) + electron_id_modules_WorkingPoints_nanoAOD = cms.PSet( modules = cms.vstring( @@ -181,8 +184,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): produceCalibratedObjs = False, correctionFile = cms.string("EgammaAnalysis/ElectronTools/data/ScalesSmearings/Run2018_Step2Closure_CoarseEtaR9Gain_v2"), ) -for modifier in run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: - modifier.toModify(calibratedPatElectrons102X, src = "slimmedElectronsUpdated") +run2_nanoAOD_102Xv1.toModify(calibratedPatElectrons102X, src = "slimmedElectronsUpdated") slimmedElectronsWithUserData = cms.EDProducer("PATElectronUserDataEmbedder", src = cms.InputTag("slimmedElectrons"), @@ -263,13 +265,11 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectrons94X","ecalTrkEnergyPostCorr"), ) -for modifier in run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: - modifier.toModify(slimmedElectronsWithUserData.userFloats, - ecalTrkEnergyErrPostCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyErrPostCorr"), - ecalTrkEnergyPreCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyPreCorr"), - ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyPostCorr"), - ) - +run2_nanoAOD_102Xv1.toModify(slimmedElectronsWithUserData.userFloats, + ecalTrkEnergyErrPostCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyErrPostCorr"), + ecalTrkEnergyPreCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyPreCorr"), + ecalTrkEnergyPostCorrNew = cms.InputTag("calibratedPatElectrons102X","ecalTrkEnergyPostCorr"), +) run2_miniAOD_80XLegacy.toModify(slimmedElectronsWithUserData.userIntFromBools, mvaSpring16GP_WP90 = cms.InputTag("egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp90"), @@ -418,7 +418,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): #the94X miniAOD V2 had a bug in the scale and smearing for electrons in the E/p comb #therefore we redo it but but we need use a new name for the userFloat as we cant override existing userfloats #for technical reasons -for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_miniAOD_80XLegacy,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: +for modifier in run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_miniAOD_80XLegacy,run2_nanoAOD_102Xv1: modifier.toModify(electronTable.variables, pt = Var("pt*userFloat('ecalTrkEnergyPostCorrNew')/userFloat('ecalTrkEnergyPreCorrNew')", float, precision=-1, doc="p_{T}"), energyErr = Var("userFloat('ecalTrkEnergyErrPostCorrNew')", float, precision=6, doc="energy error of the cluster-track combination"), @@ -511,5 +511,7 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): _withUpdateAnd102XScale_sequence = _withUpdate_sequence.copy() _withUpdateAnd102XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons102X + slimmedElectronsWithUserData) -for modifier in run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1: - modifier.toReplaceWith(electronSequence, _withUpdateAnd102XScale_sequence) +run2_nanoAOD_102Xv1.toReplaceWith(electronSequence, _withUpdateAnd102XScale_sequence) + +_withPATUpdate106X_sequence = cms.Sequence(slimmedElectronsUpdated + electronSequence.copy()) +run2_nanoAOD_106Xv1.toReplaceWith(electronSequence, _withPATUpdate106X_sequence) From 500a29e8d6aa0496188151b95379fb2425d18ab2 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Wed, 7 Oct 2020 13:15:21 +0200 Subject: [PATCH 287/778] add modification to be compliant with Py3 --- .../scripts/submitPVResolutionJobs.py | 21 +++++++++++++------ .../scripts/submitPVValidationJobs.py | 10 ++++----- .../test/PrimaryVertexResolution_cfg.py | 14 ++++++------- .../test/PrimaryVertexResolution_templ_cfg.py | 13 ++++++------ 4 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py b/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py index 09df968c53f32..0ef252820d247 100755 --- a/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py +++ b/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py @@ -9,7 +9,6 @@ from __future__ import print_function import os,sys import getopt -import commands import time import json import ROOT @@ -21,7 +20,14 @@ import multiprocessing from optparse import OptionParser import os, shlex, shutil, getpass -import ConfigParser +import configparser as ConfigParser + +############################################## +def get_status_output(*args, **kwargs): +############################################## + p = subprocess.Popen(*args, **kwargs) + stdout, stderr = p.communicate() + return p.returncode, stdout, stderr ############################################## def check_proxy(): @@ -126,7 +132,7 @@ def getLuminosity(homedir,minRun,maxRun,isRunBased,verbose): print("INSIDE GET LUMINOSITY") print(output) - for line in output.split("\n"): + for line in output.decode().split("\n"): if ("#" not in line): runToCache = line.split(",")[0].split(":")[0] lumiToCache = line.split(",")[-1].replace("\r", "") @@ -247,8 +253,8 @@ def main(): try: config = ConfigParser.ConfigParser() config.read(opts.iniPathName) - except ConfigParser.MissingSectionHeaderError, e: - raise WrongIniFormatError(`e`) + except ConfigParser.MissingSectionHeaderError as e: + raise WrongIniFormatError(e) print("Parsed the following configuration \n\n") inputDict = as_dict(config) @@ -260,7 +266,10 @@ def main(): ## check first there is a valid grid proxy forward_proxy(".") - runs = commands.getstatusoutput("dasgoclient -query='run dataset="+opts.DATASET+"'")[1].split("\n") + #runs = commands.getstatusoutput("dasgoclient -query='run dataset="+opts.DATASET+"'")[1].split("\n") + runs = get_status_output("dasgoclient -query='run dataset="+opts.DATASET+"'",shell=True, stdout=PIPE, stderr=PIPE)[1].decode().split("\n") + runs.pop() + runs.sort() print("\n\n Will run on the following runs: \n",runs) if(not os.path.exists("cfg")): diff --git a/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py index 20fa721034c05..110519198052c 100755 --- a/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py +++ b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py @@ -315,7 +315,7 @@ def split(sequence, size): # based on http://sandrotosi.blogspot.com/2011/04/python-group-list-in-sub-lists-of-n.html # about generators see also http://stackoverflow.com/questions/231767/the-python-yield-keyword-explained ########################## - for i in xrange(0, len(sequence), size): + for i in range(0, len(sequence), size): yield sequence[i:i+size] ############# @@ -401,7 +401,7 @@ def createTheCfgFile(self,lfn): os.makedirs(self.cfg_dir) self.outputCfgName=self.output_full_name+"_cfg.py" - fout=open(os.path.join(self.cfg_dir,self.outputCfgName),'w+b') + fout=open(os.path.join(self.cfg_dir,self.outputCfgName),'w') template_cfg_file = os.path.join(self.the_dir,"PVValidation_T_cfg.py") @@ -870,7 +870,7 @@ def main(): cmd = 'dasgoclient -query \'file dataset='+opts.data+'\'' s = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) out,err = s.communicate() - mylist = out.split('\n') + mylist = out.decode().split('\n') mylist.pop() #print mylist @@ -884,13 +884,13 @@ def main(): #print cmd s = Popen(cmd , shell=True, stdout=PIPE, stderr=PIPE) out,err = s.communicate() - mylist = out.split('\n') + mylist = out.decode().split('\n') mylist.pop() #print "len(mylist):",len(mylist) print("mylist:",mylist) inputFiles.append(mylist) myRuns.append(str(runboundary[iConf])) - myLumiDB = getLuminosity(myRuns[0],myRuns[-1],True) + myLumiDB = getLuminosity(myRuns[0],myRuns[-1],True,opts.verbose) else: #pass diff --git a/Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py b/Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py index 16c4fda532ff5..4b0ac9e498977 100644 --- a/Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py +++ b/Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py @@ -18,9 +18,9 @@ def best_match(rcd): ''' find out where to best match the input conditions ''' - print rcd + print(rcd) for pattern, string in connection_map: - print pattern, fnmatch(rcd, pattern) + print(pattern, fnmatch(rcd, pattern)) if fnmatch(rcd, pattern): return string @@ -52,11 +52,11 @@ def best_match(rcd): options.parseArguments() -print "conditionGT : ", options.GlobalTag -print "conditionOverwrite: ", options.records -print "external conditions:", options.external -print "outputFile : ", options.outputRootFile -print "maxEvents : ", options.maxEvents +print("conditionGT : ", options.GlobalTag) +print("conditionOverwrite: ", options.records) +print("external conditions:", options.external) +print("outputFile : ", options.outputRootFile) +print("maxEvents : ", options.maxEvents) process.load("FWCore.MessageService.MessageLogger_cfi") process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True)) diff --git a/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py b/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py index 0afd22e6acc63..8c2c84451bec6 100644 --- a/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py +++ b/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py @@ -5,6 +5,7 @@ here doing refit of tracks and vertices using latest alignment ''' +from __future__ import print_function import FWCore.ParameterSet.Config as cms from fnmatch import fnmatch import FWCore.ParameterSet.VarParsing as VarParsing @@ -18,9 +19,9 @@ def best_match(rcd): ''' find out where to best match the input conditions ''' - print rcd + print(rcd) for pattern, string in connection_map: - print pattern, fnmatch(rcd, pattern) + print(pattern, fnmatch(rcd, pattern)) if fnmatch(rcd, pattern): return string @@ -58,10 +59,10 @@ def best_match(rcd): options.parseArguments() -print "conditionGT : ", options.GlobalTag -print "conditionOverwrite: ", options.records -print "external conditions:", options.external -print "outputFile : ", options.outputRootFile +print("conditionGT : ", options.GlobalTag) +print("conditionOverwrite: ", options.records) +print("external conditions:", options.external) +print("outputFile : ", options.outputRootFile) process.load("FWCore.MessageService.MessageLogger_cfi") process.MessageLogger.cerr = cms.untracked.PSet(placeholder = cms.untracked.bool(True)) From d989318ceb507ac38b57f3d1ede07d7c77849b53 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Wed, 7 Oct 2020 14:03:28 +0200 Subject: [PATCH 288/778] fix MF regression test in the Py3 case --- MagneticField/Engine/test/regression.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MagneticField/Engine/test/regression.py b/MagneticField/Engine/test/regression.py index 13052f05cdaf2..70e5f217a2eb7 100644 --- a/MagneticField/Engine/test/regression.py +++ b/MagneticField/Engine/test/regression.py @@ -1,4 +1,5 @@ +from __future__ import print_function import FWCore.ParameterSet.Config as cms import FWCore.ParameterSet.VarParsing as VarParsing import sys @@ -155,10 +156,10 @@ else : - print '\nERROR: invalid producerType', producerType,'\n' + print('\nERROR: invalid producerType', producerType,'\n') -print '\nRegression for MF built with', options.producerType, 'era:', options.era, 'current:', options.current,'\n' +print('\nRegression for MF built with', options.producerType, 'era:', options.era, 'current:', options.current,'\n') process.testMagneticField = cms.EDAnalyzer("testMagneticField", From 76c2c46ace319efb5b7b43574931f2f680791b37 Mon Sep 17 00:00:00 2001 From: Andrzej <novak@physik.rwth-aachen.de> Date: Tue, 6 Oct 2020 10:28:10 +0200 Subject: [PATCH 289/778] refactor: deprecate CMVA --- PhysicsTools/NanoAOD/python/jets_cff.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/jets_cff.py b/PhysicsTools/NanoAOD/python/jets_cff.py index 05cab141890b9..3adbb2fa2874b 100644 --- a/PhysicsTools/NanoAOD/python/jets_cff.py +++ b/PhysicsTools/NanoAOD/python/jets_cff.py @@ -261,7 +261,7 @@ jetTable.variables.pt.precision=10 ### Era dependent customization -for modifier in run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1: +for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1: # Deprecated after 106X modifier.toModify(jetTable.variables, btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10), @@ -431,7 +431,6 @@ n2b1 = Var("?hasUserFloat('nb1AK8PuppiSoftDrop:ecfN2')?userFloat('nb1AK8PuppiSoftDrop:ecfN2'):-99999.", float, doc="N2 with beta=1 (for jets with raw pT>250 GeV)", precision=10), n3b1 = Var("?hasUserFloat('nb1AK8PuppiSoftDrop:ecfN3')?userFloat('nb1AK8PuppiSoftDrop:ecfN3'):-99999.", float, doc="N3 with beta=1 (for jets with raw pT>250 GeV)", precision=10), msoftdrop = Var("groomedMass('SoftDropPuppi')",float, doc="Corrected soft drop mass with PUPPI",precision=10), - btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10), btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10), btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10), btagHbb = Var("bDiscriminator('pfBoostedDoubleSecondaryVertexAK8BJetTags')",float,doc="Higgs to BB tagger discriminator",precision=10), @@ -482,11 +481,12 @@ ) ) ### Era dependent customization -for modifier in run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1: +for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1: modifier.toModify( fatJetTable.variables.n2b1, expr = cms.string("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2')"),) modifier.toModify( fatJetTable.variables.n3b1, expr = cms.string("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3')"),) # Deprecated after 106X modifier.toModify( fatJetTable.variables, + btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10), btagDDBvL_noMD = Var("bDiscriminator('pfDeepDoubleBvLJetTags:probHbb')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->bb vs QCD",precision=10), btagDDCvL_noMD = Var("bDiscriminator('pfDeepDoubleCvLJetTags:probHcc')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs QCD",precision=10), btagDDCvB_noMD = Var("bDiscriminator('pfDeepDoubleCvBJetTags:probHcc')",float,doc="DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs H(Z)->bb",precision=10), @@ -526,7 +526,6 @@ singleton = cms.bool(False), # the number of entries is variable extension = cms.bool(False), # this is the main table for the jets variables = cms.PSet(P4Vars, - btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10), btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10), btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10), rawFactor = Var("1.-jecFactor('Uncorrected')",float,doc="1 - Factor to get back to raw pT",precision=6), @@ -539,6 +538,13 @@ ) ) +# Deprecation/backcomp +for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1: + # post 106X + modifier.toModify(subJetTable.variables, + btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10), + ) + #jets are not as precise as muons fatJetTable.variables.pt.precision=10 subJetTable.variables.pt.precision=10 From 49d2379ce6859c74d5781895d31bfc5cc6043185 Mon Sep 17 00:00:00 2001 From: Andrzej <novak@physik.rwth-aachen.de> Date: Tue, 6 Oct 2020 10:34:15 +0200 Subject: [PATCH 290/778] fix: sync DeepCSV defaults to -1 --- PhysicsTools/NanoAOD/python/jets_cff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/jets_cff.py b/PhysicsTools/NanoAOD/python/jets_cff.py index 3adbb2fa2874b..9dd55841396af 100644 --- a/PhysicsTools/NanoAOD/python/jets_cff.py +++ b/PhysicsTools/NanoAOD/python/jets_cff.py @@ -227,7 +227,7 @@ electronIdx1 = Var("?overlaps('electrons').size()>0?overlaps('electrons')[0].key():-1", int, doc="index of first matching electron"), electronIdx2 = Var("?overlaps('electrons').size()>1?overlaps('electrons')[1].key():-1", int, doc="index of second matching electron"), nElectrons = Var("?hasOverlaps('electrons')?overlaps('electrons').size():0", int, doc="number of electrons in the jet"), - btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10), + btagDeepB = Var("?(bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb'))>=0?bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb'):-1",float,doc="DeepCSV b+bb tag discriminator",precision=10), btagDeepFlavB = Var("bDiscriminator('pfDeepFlavourJetTags:probb')+bDiscriminator('pfDeepFlavourJetTags:probbb')+bDiscriminator('pfDeepFlavourJetTags:problepb')",float,doc="DeepJet b+bb+lepb tag discriminator",precision=10), btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10), btagDeepCvL = Var("?bDiscriminator('pfDeepCSVJetTags:probc')>=0?bDiscriminator('pfDeepCSVJetTags:probc')/(bDiscriminator('pfDeepCSVJetTags:probc')+bDiscriminator('pfDeepCSVJetTags:probudsg')):-1", float,doc="DeepCSV c vs udsg discriminator",precision=10), @@ -431,7 +431,7 @@ n2b1 = Var("?hasUserFloat('nb1AK8PuppiSoftDrop:ecfN2')?userFloat('nb1AK8PuppiSoftDrop:ecfN2'):-99999.", float, doc="N2 with beta=1 (for jets with raw pT>250 GeV)", precision=10), n3b1 = Var("?hasUserFloat('nb1AK8PuppiSoftDrop:ecfN3')?userFloat('nb1AK8PuppiSoftDrop:ecfN3'):-99999.", float, doc="N3 with beta=1 (for jets with raw pT>250 GeV)", precision=10), msoftdrop = Var("groomedMass('SoftDropPuppi')",float, doc="Corrected soft drop mass with PUPPI",precision=10), - btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10), + btagDeepB = Var("?(bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb'))>=0?bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb'):-1",float,doc="DeepCSV b+bb tag discriminator",precision=10), btagCSVV2 = Var("bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10), btagHbb = Var("bDiscriminator('pfBoostedDoubleSecondaryVertexAK8BJetTags')",float,doc="Higgs to BB tagger discriminator",precision=10), btagDDBvLV2 = Var("bDiscriminator('pfMassIndependentDeepDoubleBvLV2JetTags:probHbb')",float,doc="DeepDoubleX V2(mass-decorrelated) discriminator for H(Z)->bb vs QCD",precision=10), From 361bbe9882e547b3f1f9d956aba063bba21e1b3e Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 7 Oct 2020 15:18:22 +0200 Subject: [PATCH 291/778] Correct a few scripts --- Calibration/HcalCalibAlgos/macros/CalibCorr.C | 22 +++++++++++++++++-- .../HcalCalibAlgos/macros/CalibMonitor.C | 17 +++++++------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Calibration/HcalCalibAlgos/macros/CalibCorr.C b/Calibration/HcalCalibAlgos/macros/CalibCorr.C index 19b5b1123f136..35e8c1b374ba3 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibCorr.C +++ b/Calibration/HcalCalibAlgos/macros/CalibCorr.C @@ -139,13 +139,13 @@ double puFactor(int type, int ieta, double pmom, double eHcal, double ediff, boo int jeta = std::abs(ieta); double d2p = (ediff / pmom); const double DELTA_CUT = 0.03; - const int PU_IETA_3 = 25; if (type == 3) { // 16pu const double CONST_COR_COEF[4] = {0.971, 1.008, 0.985, 1.086}; const double LINEAR_COR_COEF[4] = {0, -0.359, -0.251, -0.535}; const double SQUARE_COR_COEF[4] = {0, 0, 0.048, 0.143}; const int PU_IETA_1 = 9; const int PU_IETA_2 = 16; + const int PU_IETA_3 = 25; unsigned icor = (unsigned(jeta >= PU_IETA_1) + unsigned(jeta >= PU_IETA_2) + unsigned(jeta >= PU_IETA_3)); if (d2p > DELTA_CUT) fac = (CONST_COR_COEF[icor] + LINEAR_COR_COEF[icor] * d2p + SQUARE_COR_COEF[icor] * d2p * d2p); @@ -158,24 +158,42 @@ double puFactor(int type, int ieta, double pmom, double eHcal, double ediff, boo const double SQUARE_COR_COEF[4] = {0, 0, 0.053, 0.170}; const int PU_IETA_1 = 9; const int PU_IETA_2 = 18; + const int PU_IETA_3 = 25; unsigned icor = (unsigned(jeta >= PU_IETA_1) + unsigned(jeta >= PU_IETA_2) + unsigned(jeta >= PU_IETA_3)); if (d2p > DELTA_CUT) fac = (CONST_COR_COEF[icor] + LINEAR_COR_COEF[icor] * d2p + SQUARE_COR_COEF[icor] * d2p * d2p); if (debug) std::cout << " d2p " << d2p << ":" << DELTA_CUT << " coeff " << icor << ":" << CONST_COR_COEF[icor] << ":" << LINEAR_COR_COEF[icor] << ":" << SQUARE_COR_COEF[icor] << " Fac " << fac; - } else { // 18pu + } else if (type == 5) { // 18pu const double CONST_COR_COEF[4] = {0.973, 0.998, 0.992, 0.965}; const double LINEAR_COR_COEF[4] = {0, -0.318, -0.261, -0.406}; const double SQUARE_COR_COEF[4] = {0, 0, 0.047, 0.089}; const int PU_IETA_1 = 7; const int PU_IETA_2 = 16; + const int PU_IETA_3 = 25; unsigned icor = (unsigned(jeta >= PU_IETA_1) + unsigned(jeta >= PU_IETA_2) + unsigned(jeta >= PU_IETA_3)); if (d2p > DELTA_CUT) fac = (CONST_COR_COEF[icor] + LINEAR_COR_COEF[icor] * d2p + SQUARE_COR_COEF[icor] * d2p * d2p); if (debug) std::cout << " d2p " << d2p << ":" << DELTA_CUT << " coeff " << icor << ":" << CONST_COR_COEF[icor] << ":" << LINEAR_COR_COEF[icor] << ":" << SQUARE_COR_COEF[icor] << " Fac " << fac; + } else { // 21pu + const double CONST_COR_COEF[6] = {0.98555, 0.976956, 0.976892, 0.544262, 0.447506, 0.380405}; + const double LINEAR_COR_COEF[6] = {-0.0452436, -0.140628, -0.229334, -0.0520421, -0.0892927, -0.0810484}; + const double SQUARE_COR_COEF[6] = {0, 0, 0.0333082, 0.00426112, 0.00887433, 0.0085219}; + const int PU_IETA_1 = 7; + const int PU_IETA_2 = 16; + const int PU_IETA_3 = 25; + const int PU_IETA_4 = 26; + const int PU_IETA_5 = 27; + unsigned icor = (unsigned(jeta >= PU_IETA_1) + unsigned(jeta >= PU_IETA_2) + unsigned(jeta >= PU_IETA_3) + unsigned(jeta >= PU_IETA_4) + unsigned(jeta >= PU_IETA_5)); + double deltaCut = (icor > 2) ? 1.0 : DELTA_CUT; + if (d2p > deltaCut) + fac = (CONST_COR_COEF[icor] + LINEAR_COR_COEF[icor] * d2p + SQUARE_COR_COEF[icor] * d2p * d2p); + if (debug) + std::cout << " d2p " << d2p << ":" << DELTA_CUT << " coeff " << icor << ":" << CONST_COR_COEF[icor] << ":" + << LINEAR_COR_COEF[icor] << ":" << SQUARE_COR_COEF[icor] << " Fac " << fac; } } if (fac < 0 || fac > 1) diff --git a/Calibration/HcalCalibAlgos/macros/CalibMonitor.C b/Calibration/HcalCalibAlgos/macros/CalibMonitor.C index f19bf17df7386..f5f5fbaf0085b 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibMonitor.C +++ b/Calibration/HcalCalibAlgos/macros/CalibMonitor.C @@ -246,12 +246,13 @@ public: TBranch *b_t_HitEnergies3; //! struct counter { + static const int npsize = 4; counter() { total = 0; - for (int k = 0; k < 4; ++k) + for (int k = 0; k < npsize; ++k) count[k] = 0; }; - unsigned int total, count[4]; + unsigned int total, count[npsize]; }; CalibMonitor(const char *fname, @@ -1099,13 +1100,13 @@ void CalibMonitor::Loop() { std::map<int, counter>::const_iterator itr = runEn1.find(t_Run); if (itr == runEn1.end()) { counter knt; - if ((kp >= 0) && (kp < (npsize - 1))) + if ((kp >= 0) && (kp < counter::npsize)) knt.count[kp] = 1; knt.total = 1; runEn1[t_Run] = knt; } else { counter knt = runEn1[t_Run]; - if ((kp >= 0) && (kp < (npsize - 1))) + if ((kp >= 0) && (kp < counter::npsize)) ++knt.count[kp]; ++knt.total; runEn1[t_Run] = knt; @@ -1117,13 +1118,13 @@ void CalibMonitor::Loop() { std::map<int, counter>::const_iterator itr = runEn2.find(t_Run); if (itr == runEn2.end()) { counter knt; - if ((kp >= 0) && (kp < (npsize - 1))) + if ((kp >= 0) && (kp < counter::npsize)) knt.count[kp] = 1; knt.total = 1; runEn2[t_Run] = knt; } else { counter knt = runEn2[t_Run]; - if ((kp >= 0) && (kp < (npsize - 1))) + if ((kp >= 0) && (kp < counter::npsize)) ++knt.count[kp]; ++knt.total; runEn2[t_Run] = knt; @@ -1152,13 +1153,13 @@ void CalibMonitor::Loop() { std::map<int, counter>::const_iterator itr = runSum.find(t_Run); if (itr == runSum.end()) { counter knt; - if ((kp >= 0) && (kp < (npsize - 1))) + if ((kp >= 0) && (kp < counter::npsize)) knt.count[kp] = 1; knt.total = 1; runSum[t_Run] = knt; } else { counter knt = runSum[t_Run]; - if ((kp >= 0) && (kp < (npsize - 1))) + if ((kp >= 0) && (kp < counter::npsize)) ++knt.count[kp]; ++knt.total; runSum[t_Run] = knt; From f4ce583df6ec982e766c7dd6e88dad508f45ef86 Mon Sep 17 00:00:00 2001 From: Loukas Gouskos <Loukas.Gouskos@cern.ch> Date: Wed, 7 Oct 2020 15:25:03 +0200 Subject: [PATCH 292/778] add ntracks to each sv --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 1 + PhysicsTools/NanoAOD/python/vertices_cff.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 759ee13f16c94..dff275a3aaaf6 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -589,6 +589,7 @@ Plot1D('x', 'x', 20, -0.5, 0.5, 'secondary vertex X position, in cm'), Plot1D('y', 'y', 20, -0.5, 0.5, 'secondary vertex Y position, in cm'), Plot1D('z', 'z', 20, -10, 10, 'secondary vertex Z position, in cm'), + Plot1D('ntracks', 'ntracks', 11, -0.5, 10.5, 'number of tracks'), ) ), SoftActivityJet = cms.PSet( diff --git a/PhysicsTools/NanoAOD/python/vertices_cff.py b/PhysicsTools/NanoAOD/python/vertices_cff.py index cb93c68a8283e..fea0cfe899758 100644 --- a/PhysicsTools/NanoAOD/python/vertices_cff.py +++ b/PhysicsTools/NanoAOD/python/vertices_cff.py @@ -29,8 +29,9 @@ x = Var("position().x()", float, doc = "secondary vertex X position, in cm",precision=10), y = Var("position().y()", float, doc = "secondary vertex Y position, in cm",precision=10), z = Var("position().z()", float, doc = "secondary vertex Z position, in cm",precision=14), - ndof = Var("vertexNdof()", float, doc = "number of degrees of freedom",precision=8), - chi2 = Var("vertexNormalizedChi2()", float, doc = "reduced chi2, i.e. chi/ndof",precision=8), + ndof = Var("vertexNdof()", float, doc = "number of degrees of freedom",precision=8), + chi2 = Var("vertexNormalizedChi2()", float, doc = "reduced chi2, i.e. chi/ndof",precision=8), + ntracks = Var("numberOfDaughters()", int, doc = "number of tracks"), ), ) svCandidateTable.variables.pt.precision=10 From 6b92516a79a5fcf2e9f6983af40a84c00fcc3b1e Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 7 Oct 2020 15:29:58 +0200 Subject: [PATCH 293/778] Code check --- Calibration/HcalCalibAlgos/macros/CalibCorr.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Calibration/HcalCalibAlgos/macros/CalibCorr.C b/Calibration/HcalCalibAlgos/macros/CalibCorr.C index 35e8c1b374ba3..3483354403333 100644 --- a/Calibration/HcalCalibAlgos/macros/CalibCorr.C +++ b/Calibration/HcalCalibAlgos/macros/CalibCorr.C @@ -187,7 +187,8 @@ double puFactor(int type, int ieta, double pmom, double eHcal, double ediff, boo const int PU_IETA_3 = 25; const int PU_IETA_4 = 26; const int PU_IETA_5 = 27; - unsigned icor = (unsigned(jeta >= PU_IETA_1) + unsigned(jeta >= PU_IETA_2) + unsigned(jeta >= PU_IETA_3) + unsigned(jeta >= PU_IETA_4) + unsigned(jeta >= PU_IETA_5)); + unsigned icor = (unsigned(jeta >= PU_IETA_1) + unsigned(jeta >= PU_IETA_2) + unsigned(jeta >= PU_IETA_3) + + unsigned(jeta >= PU_IETA_4) + unsigned(jeta >= PU_IETA_5)); double deltaCut = (icor > 2) ? 1.0 : DELTA_CUT; if (d2p > deltaCut) fac = (CONST_COR_COEF[icor] + LINEAR_COR_COEF[icor] * d2p + SQUARE_COR_COEF[icor] * d2p * d2p); From 0f965ddd5cb72886641d1b3633b3ea82c1b008de Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 7 Oct 2020 15:49:24 +0200 Subject: [PATCH 294/778] Take suggestions --- Geometry/HGCalCommonData/interface/HGCalTypes.h | 1 + Geometry/HGCalCommonData/src/HGCalWaferMask.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/Geometry/HGCalCommonData/interface/HGCalTypes.h b/Geometry/HGCalCommonData/interface/HGCalTypes.h index 7e3622a1cabf2..2eefec0c26b97 100644 --- a/Geometry/HGCalCommonData/interface/HGCalTypes.h +++ b/Geometry/HGCalCommonData/interface/HGCalTypes.h @@ -59,6 +59,7 @@ class HGCalTypes { }; static constexpr int32_t WaferCornerMin = 3; + static constexpr int32_t WaferCornerMax = 6; enum TileType { TileFine = 0, TileCoarseCast = 1, TileCoarseMould = 2 }; diff --git a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc index 09779ed5adc01..60a7f551299e6 100644 --- a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc +++ b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc @@ -334,6 +334,7 @@ bool HGCalWaferMask::goodCell(int u, int v, int n, int type, int rotn) { } int HGCalWaferMask::getRotation(int zside, int type, int rotn) { + if (rotn >= HGCalTypes::WaferCornerMax) rotn = HGCalTypes::WaferCorner0; int newrotn(rotn); if ((zside < 0) && (type != HGCalTypes::WaferFull)) { if (type == HGCalTypes::WaferFive) { //WaferFive From 9bb1b99b85d8b55734741acca678825a713951b8 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 7 Oct 2020 16:38:09 +0200 Subject: [PATCH 295/778] Sub-event aware genJet clustering for HI miniAOD --- .../python/Modifier_genJetSubEvent_cff.py | 4 + .../plugins/HiSignalGenJetProducer.cc | 138 ++++++++++++++++++ .../plugins/HiSignalParticleProducer.cc | 131 +++++++++++++++++ .../python/HiSignalGenJetProducer_cfi.py | 7 + .../python/HiSignalParticleProducer_cfi.py | 7 + 5 files changed, 287 insertions(+) create mode 100644 Configuration/Eras/python/Modifier_genJetSubEvent_cff.py create mode 100644 RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc create mode 100644 RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc create mode 100644 RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py create mode 100644 RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py diff --git a/Configuration/Eras/python/Modifier_genJetSubEvent_cff.py b/Configuration/Eras/python/Modifier_genJetSubEvent_cff.py new file mode 100644 index 0000000000000..dd720566cdebf --- /dev/null +++ b/Configuration/Eras/python/Modifier_genJetSubEvent_cff.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +genJetSubEvent = cms.Modifier() + diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc new file mode 100644 index 0000000000000..84c004698fd98 --- /dev/null +++ b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc @@ -0,0 +1,138 @@ +// -*- C++ -*- +// +// Package: HiSignalGenJetProducer +// Class: HiSignalGenJetProducer +// +/**\class HiSignalGenJetProducer HiSignalGenJetProducer.cc yetkin/HiSignalGenJetProducer/src/HiSignalGenJetProducer.cc + + Description: <one line class summary> + + Implementation: + <Notes on implementation> +*/ +// +// Original Author: Yetkin Yilmaz +// Created: Tue Jul 21 04:26:01 EDT 2009 +// +// + +// system include files +#include <memory> +#include <vector> + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDProducer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/InputTag.h" + +#include "DataFormats/Common/interface/View.h" +#include "DataFormats/JetReco/interface/GenJetCollection.h" +#include "DataFormats/GeometryVector/interface/VectorUtil.h" +#include "DataFormats/HepMCCandidate/interface/GenParticle.h" + +#include "DataFormats/Math/interface/Point3D.h" +#include "DataFormats/Math/interface/LorentzVector.h" + +using namespace std; +using namespace edm; + + +// +// class decleration +// + +class HiSignalGenJetProducer : public edm::EDProducer { +public: + explicit HiSignalGenJetProducer(const edm::ParameterSet&); + ~HiSignalGenJetProducer(); + + private: + virtual void produce(edm::Event&, const edm::EventSetup&) override; + // ----------member data --------------------------- + + edm::EDGetTokenT<edm::View<reco::GenJet> > jetSrc_; + +}; + +// +// constants, enums and typedefs +// + + +// +// static data member definitions +// + +// +// constructors and destructor +// + +HiSignalGenJetProducer::HiSignalGenJetProducer(const edm::ParameterSet& iConfig) : + jetSrc_(consumes<edm::View<reco::GenJet> >(iConfig.getParameter<edm::InputTag>("src"))) +{ + std::string alias = (iConfig.getParameter<InputTag>( "src")).label(); + produces<reco::GenJetCollection>().setBranchAlias (alias); +} + +HiSignalGenJetProducer::~HiSignalGenJetProducer() +{ + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) +} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ + +void +HiSignalGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + using namespace reco; + + auto jets = std::make_unique<GenJetCollection>(); + + edm::Handle<edm::View<GenJet> > genjets; + iEvent.getByToken(jetSrc_,genjets); + + int jetsize = genjets->size(); + + vector<int> selection; + for(int ijet = 0; ijet < jetsize; ++ijet){ + selection.push_back(-1); + } + + vector<int> selectedIndices; + vector<int> removedIndices; + + for(int ijet = 0; ijet < jetsize; ++ijet){ + + const GenJet* jet1 = &((*genjets)[ijet]); + + const GenParticle* gencon = jet1->getGenConstituent(0); + + if(gencon == 0) throw cms::Exception("GenConstituent","GenJet is missing its constituents"); + else if(gencon->collisionId() == 0){ + jets->push_back(*jet1); + selection[ijet] = 1; + }else{ + selection[ijet] = 0; + removedIndices.push_back(ijet); + } + } + + iEvent.put(std::move(jets)); + +} + +DEFINE_FWK_MODULE(HiSignalGenJetProducer); + + diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc new file mode 100644 index 0000000000000..47ae0efbb513c --- /dev/null +++ b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc @@ -0,0 +1,131 @@ +// -*- C++ -*- +// +// Package: HiSignalParticleProducer +// Class: HiSignalParticleProducer +// +/**\class HiSignalParticleProducer HiSignalParticleProducer.cc yetkin/HiSignalParticleProducer/src/HiSignalParticleProducer.cc + Description: <one line class summary> + Implementation: + <Notes on implementation> +*/ +// +// Original Author: Yetkin Yilmaz +// Created: Tue Jul 21 04:26:01 EDT 2009 +// +// + +// system include files +#include <memory> +#include <vector> + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDProducer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/InputTag.h" + +#include "DataFormats/Common/interface/View.h" +#include "DataFormats/JetReco/interface/GenJetCollection.h" +#include "DataFormats/GeometryVector/interface/VectorUtil.h" +#include "DataFormats/HepMCCandidate/interface/GenParticle.h" +#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" + +#include "DataFormats/Math/interface/Point3D.h" +#include "DataFormats/Math/interface/LorentzVector.h" + +using namespace std; +using namespace edm; + + +// +// class decleration +// + +class HiSignalParticleProducer : public edm::EDProducer { +public: + explicit HiSignalParticleProducer(const edm::ParameterSet&); + ~HiSignalParticleProducer(); + +private: + virtual void produce(edm::Event&, const edm::EventSetup&) override; + // ----------member data --------------------------- + + edm::EDGetTokenT<edm::View<reco::GenParticle> > genParticleSrc_; + +}; + +// +// constants, enums and typedefs +// + + +// +// static data member definitions +// + +// +// constructors and destructor +// + +HiSignalParticleProducer::HiSignalParticleProducer(const edm::ParameterSet& iConfig) : + genParticleSrc_(consumes<edm::View<reco::GenParticle> >(iConfig.getParameter<edm::InputTag>("src"))) +{ + std::string alias = (iConfig.getParameter<InputTag>( "src")).label(); + produces<reco::GenParticleCollection>().setBranchAlias (alias); +} + +HiSignalParticleProducer::~HiSignalParticleProducer() +{ + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) +} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ + +void +HiSignalParticleProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + using namespace reco; + + auto signalGenParticles = std::make_unique<GenParticleCollection>(); + + edm::Handle<edm::View<GenParticle> > genParticles; + iEvent.getByToken(genParticleSrc_,genParticles); + + int genParticleSize = genParticles->size(); + + vector<int> selection; + for(int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle){ + selection.push_back(-1); + } + + vector<int> selectedIndices; + vector<int> removedIndices; + + for(int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle){ + + const GenParticle* genParticle = &((*genParticles)[igenParticle]); + if(genParticle->collisionId() == 0){ + signalGenParticles->push_back(*genParticle); + selection[igenParticle] = 1; + }else{ + selection[igenParticle] = 0; + removedIndices.push_back(igenParticle); + } + } + + iEvent.put(std::move(signalGenParticles)); + +} + +DEFINE_FWK_MODULE(HiSignalParticleProducer); diff --git a/RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py b/RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py new file mode 100644 index 0000000000000..63a2d3af8e6c6 --- /dev/null +++ b/RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py @@ -0,0 +1,7 @@ +import FWCore.ParameterSet.Config as cms + + +hiSignalGenJets = cms.EDProducer('HiSignalGenJetProducer', + src = cms.InputTag('ak4HiGenJets') + ) + diff --git a/RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py b/RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py new file mode 100644 index 0000000000000..08645ffecb98e --- /dev/null +++ b/RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py @@ -0,0 +1,7 @@ +import FWCore.ParameterSet.Config as cms + + +hiSignalGenParticles = cms.EDProducer('HiSignalParticleProducer', + src = cms.InputTag('genParticles') + ) + From fb1c4968c167fb46ed1afbda37b5283bc9e9d9e3 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 7 Oct 2020 16:39:39 +0200 Subject: [PATCH 296/778] Oops, not all files were staged --- .../python/relval_standard.py | 6 ++--- .../python/relval_steps.py | 19 ++++++++++++++- .../StandardSequences/python/Eras.py | 3 ++- .../PatAlgos/plugins/PATGenJetSlimmer.cc | 3 ++- .../python/mcMatchLayer0/jetMatch_cfi.py | 6 +---- .../producersHeavyIons/heavyIonJets_cff.py | 23 ++++++++++++++----- .../PatAlgos/python/slimming/miniAOD_tools.py | 4 ++++ .../python/slimming/slimmedGenJets_cfi.py | 3 +++ .../plugins/SubEventGenJetProducer.cc | 9 ++++---- .../plugins/SubEventGenJetProducer.h | 3 ++- 10 files changed, 56 insertions(+), 23 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_standard.py b/Configuration/PyReleaseValidation/python/relval_standard.py index 4c0ddec48d777..f9fcc63844c93 100644 --- a/Configuration/PyReleaseValidation/python/relval_standard.py +++ b/Configuration/PyReleaseValidation/python/relval_standard.py @@ -700,14 +700,14 @@ workflows[148] = ['',['HydjetQ_MinBias_XeXe_5442GeV_2017','DIGIHI2017','RECOHI2017','HARVESTHI2017']] ### Run II cond., 2018 workflows[150] = ['',['HydjetQ_B12_5020GeV_2018','DIGIHI2018','RECOHI2018','HARVESTHI2018']] -workflows[158] = ['',['HydjetQ_B12_5020GeV_2018_ppReco','DIGIHI2018PPRECO','RECOHI2018PPRECO','ALCARECOHI2018PPRECO','HARVESTHI2018PPRECO']] -workflows[158.01] = ['',['HydjetQ_reminiaodPbPb2018_INPUT','REMINIAODHI2018PPRECO','HARVESTHI2018PPRECOMINIAOD']] +workflows[158] = ['',['HydjetQ_B12_5020GeV_2018_ppReco','DIGIHI2018PPRECO','RECOHI2018PPRECOMB','ALCARECOHI2018PPRECO','HARVESTHI2018PPRECO']] +workflows[158.01] = ['',['HydjetQ_reminiaodPbPb2018_INPUT','REMINIAODHI2018PPRECOMB','HARVESTHI2018PPRECOMINIAOD']] workflows[158.1] = ['',['QCD_Pt_80_120_13_HI','DIGIHI2018PPRECO','RECOHI2018PPRECO','HARVESTHI2018PPRECO']] workflows[158.2] = ['',['PhotonJets_Pt_10_13_HI','DIGIHI2018PPRECO','RECOHI2018PPRECO','HARVESTHI2018PPRECO']] workflows[158.3] = ['',['ZEEMM_13_HI','DIGIHI2018PPRECO','RECOHI2018PPRECO','HARVESTHI2018PPRECO']] # 158.0 with multiple concurrent lumi sections workflows[158.181] = ['',['HydjetQ_B12_5020GeV_2018_ppReco_ml','DIGIHI2018PPRECOml','RECOHI2018PPRECOml','ALCARECOHI2018PPRECOml','HARVESTHI2018PPRECO']] -workflows[159] = ['',['HydjetQ_B12_5020GeV_2021_ppReco','DIGIHI2021PPRECO','RECOHI2021PPRECO','ALCARECOHI2021PPRECO','HARVESTHI2021PPRECO']] +workflows[159] = ['',['HydjetQ_B12_5020GeV_2021_ppReco','DIGIHI2021PPRECO','RECOHI2021PPRECOMB','ALCARECOHI2021PPRECO','HARVESTHI2021PPRECO']] workflows[159.1] = ['',['QCD_Pt_80_120_14_HI_2021','DIGIHI2021PPRECO','RECOHI2021PPRECO','HARVESTHI2021PPRECO']] workflows[159.2] = ['',['PhotonJets_Pt_10_14_HI_2021','DIGIHI2021PPRECO','RECOHI2021PPRECO','HARVESTHI2021PPRECO']] workflows[159.3] = ['',['ZMM_14_HI_2021','DIGIHI2021PPRECO','RECOHI2021PPRECO','HARVESTHI2021PPRECO']] diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 48f983da0ea1b..3d7c2b346a3d9 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -967,6 +967,8 @@ def genS(fragment,howMuch): hiAlca2018 = {'--conditions':'auto:phase1_2018_realistic', '--era':'Run2_2018'} hiAlca2018_ppReco = {'--conditions':'auto:phase1_2018_realistic_hi', '--era':'Run2_2018_pp_on_AA'} hiAlca2021_ppReco = {'--conditions':'auto:phase1_2021_realistic_hi', '--era':'Run3_pp_on_PbPb'} +hiAlca2018_ppReco_mb = {'--conditions':'auto:phase1_2018_realistic_hi', '--era':'Run2_2018_pp_on_AA,genJetSubEvent'} +hiAlca2021_ppReco_mb = {'--conditions':'auto:phase1_2021_realistic_hi', '--era':'Run3_pp_on_PbPb,genJetSubEvent'} hiDefaults2011=merge([hiAlca2011,{'--scenario':'HeavyIons','-n':2}]) @@ -975,6 +977,8 @@ def genS(fragment,howMuch): hiDefaults2018=merge([hiAlca2018,{'--scenario':'HeavyIons','-n':2}]) hiDefaults2018_ppReco=merge([hiAlca2018_ppReco,{'-n':2}]) hiDefaults2021_ppReco=merge([hiAlca2021_ppReco,{'-n':2}]) +hiDefaults2018_ppReco_mb=merge([hiAlca2018_ppReco_mb,{'-n':2}]) +hiDefaults2021_ppReco_mb=merge([hiAlca2021_ppReco_mb,{'-n':2}]) steps['HydjetQ_B12_5020GeV_2011']=merge([{'-n':1,'--beamspot':'RealisticHI2011Collision'},hiDefaults2011,genS('Hydjet_Quenched_B12_5020GeV_cfi',U2000by1)]) steps['HydjetQ_B12_5020GeV_2015']=merge([{'-n':1,'--beamspot':'RealisticHICollisionFixZ2015'},hiDefaults2015,genS('Hydjet_Quenched_B12_5020GeV_cfi',U2000by1)]) @@ -2474,6 +2478,10 @@ def gen2021HiMix(fragment,howMuch): '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO', '--eventcontent':'RECOSIM,MINIAODSIM,DQM', },step3Up2015Defaults]) +steps['RECOHI2021PPRECOMB']=merge([hiDefaults2021_ppReco_mb,{'-s':'RAW2DIGI,L1Reco,RECO,EI,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM', + '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO', + '--eventcontent':'RECOSIM,MINIAODSIM,DQM', + },step3Up2015Defaults]) steps['ALCARECOHI2021PPRECO']=merge([hiDefaults2021_ppReco,{'-s':'ALCA:TkAlMinBias+SiStripCalMinBias', '--datatier':'ALCARECO', @@ -2484,13 +2492,22 @@ def gen2021HiMix(fragment,howMuch): '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO,ALCARECO', '--eventcontent':'RECOSIM,MINIAODSIM,DQM,ALCARECO', },step3Up2015Defaults]) -steps['RECOHI2018PPRECOml']=merge([concurrentLumis,steps['RECOHI2018PPRECO']]) +steps['RECOHI2018PPRECOMB']=merge([hiDefaults2018_ppReco_mb,{'-s':'RAW2DIGI,L1Reco,RECO,ALCA:SiStripCalZeroBias+SiPixelCalZeroBias,EI,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM', + '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO,ALCARECO', + '--eventcontent':'RECOSIM,MINIAODSIM,DQM,ALCARECO', + },step3Up2015Defaults]) +steps['RECOHI2018PPRECOml']=merge([concurrentLumis,steps['RECOHI2018PPRECOMB']]) steps['REMINIAODHI2018PPRECO']=merge([{'-s':'PAT,VALIDATION:@miniAODValidation,DQM:@miniAODDQM', '--datatier':'MINIAODSIM,DQMIO', '--eventcontent':'MINIAODSIM,DQM', '-n':100, },hiDefaults2018_ppReco,step3Up2015Defaults]) +steps['REMINIAODHI2018PPRECOMB']=merge([{'-s':'PAT,VALIDATION:@miniAODValidation,DQM:@miniAODDQM', + '--datatier':'MINIAODSIM,DQMIO', + '--eventcontent':'MINIAODSIM,DQM', + '-n':100, + },hiDefaults2018_ppReco_mb,step3Up2015Defaults]) steps['ALCARECOHI2018PPRECO']=merge([hiDefaults2018_ppReco,{'-s':'ALCA:TkAlMinBias+SiStripCalMinBias', '--datatier':'ALCARECO', diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index 5f5524eb6176a..2b8f78edd8c01 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -66,7 +66,8 @@ def __init__(self): 'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', 'run2_nanoAOD_106Xv1', 'hcalHardcodeConditions', 'hcalSkipPacker', 'run2_HLTconditions_2016','run2_HLTconditions_2017','run2_HLTconditions_2018', - 'bParking'] + 'bParking', + 'genJetSubEvent'] internalUseModChains = ['run2_2017_noTrackingModifier'] self.pythonCfgLines = {} diff --git a/PhysicsTools/PatAlgos/plugins/PATGenJetSlimmer.cc b/PhysicsTools/PatAlgos/plugins/PATGenJetSlimmer.cc index 57941ba94ac1c..8005033c9dd3b 100644 --- a/PhysicsTools/PatAlgos/plugins/PATGenJetSlimmer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATGenJetSlimmer.cc @@ -76,6 +76,7 @@ void pat::PATGenJetSlimmer::produce(edm::Event& iEvent, const edm::EventSetup& i auto mapping = std::make_unique<std::vector<int> >(); mapping->reserve(src->size()); + unsigned nm = 0; // number of mapped jets unsigned nl = 0; // number of loose jets for (View<reco::GenJet>::const_iterator it = src->begin(), ed = src->end(); it != ed; ++it) { bool selectedLoose = false; @@ -93,7 +94,7 @@ void pat::PATGenJetSlimmer::produce(edm::Event& iEvent, const edm::EventSetup& i out->push_back(*it); reco::GenJet& jet = out->back(); - mapping->push_back(it - src->begin()); + mapping->push_back(nm++); if (clearDaughters_) { jet.clearDaughters(); diff --git a/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py b/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py index 5b2c208f48e84..7a104c6646a03 100644 --- a/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py +++ b/PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py @@ -30,13 +30,9 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetGenJetMatch, - matched = 'ak4HiCleanedGenJets', maxDeltaR = 0.4, resolveByMatchQuality = True, src = "akCs4PFJets", ) -(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetPartonMatch, - matched = "cleanedPartons", - src = "akCs4PFJets", - ) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(patJetPartonMatch, src = "akCs4PFJets") diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index e142b148c6683..b3b56fb0f3c13 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -1,29 +1,40 @@ import FWCore.ParameterSet.Config as cms +from RecoHI.HiJetAlgos.HiSignalParticleProducer_cfi import hiSignalGenParticles from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets from RecoHI.HiJetAlgos.HiGenCleaner_cff import hiPartons from RecoHI.HiJetAlgos.HiGenJets_cff import ak4HiGenJets from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets +from RecoHI.HiJetAlgos.HiSignalGenJetProducer_cfi import hiSignalGenJets allPartons = cms.EDProducer( "PartonSelector", - src = cms.InputTag('genParticles'), + src = cms.InputTag('hiSignalGenParticles'), withLeptons = cms.bool(False), ) +from Configuration.Eras.Modifier_genJetSubEvent_cff import genJetSubEvent +genJetSubEvent.toModify(allPartons,src = "genParticles") + cleanedPartons = hiPartons.clone( src = 'allPartons', ) -ak4HiGenJetsCleaned = heavyIonCleanedGenJets.clone(src = "ak4HiGenJets") +ak4HiSignalGenJets = hiSignalGenJets.clone(src = "ak4HiGenJets") -cleanedGenJetsTask = cms.Task( +hiGenJetsTask = cms.Task( + hiSignalGenParticles, genParticlesForJets, - cleanedPartons, + allPartons, ak4HiGenJets, - ak4HiGenJetsCleaned + ak4HiSignalGenJets ) +ak4HiGenJetsCleaned = heavyIonCleanedGenJets.clone(src = "ak4HiGenJets") +hiCleanedGenJetsTask_ = hiGenJetsTask.copyAndExclude([hiSignalGenParticles,ak4HiSignalGenJets]) +hiCleanedGenJetsTask_.add(cleanedPartons,ak4HiGenJetsCleaned) +genJetSubEvent.toReplaceWith(hiGenJetsTask,hiCleanedGenJetsTask_) + from RecoHI.HiJetAlgos.HiRecoPFJets_cff import PFTowers, pfEmptyCollection, ak4PFJetsForFlow, hiPuRho, hiFJRhoFlowModulation, akCs4PFJets from RecoHI.HiTracking.highPurityGeneralTracks_cfi import highPurityGeneralTracks from RecoJets.JetAssociationProducers.ak5JTA_cff import * @@ -62,5 +73,5 @@ recoJetsHIpostAODTask = cms.Task( recoPFJetsHIpostAODTask, allPartons, - cleanedGenJetsTask, + hiGenJetsTask, ) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index b6981349253b1..c1652955fc706 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -588,6 +588,9 @@ def miniAOD_customizeMC(process): process.tauGenJetsBoosted.GenParticles = "prunedGenParticles" process.patJetPartons.particles = "genParticles" process.patJetPartonMatch.matched = "prunedGenParticles" + _hiGeneral.toModify(process.patJetPartonMatch, matched = "hiSignalGenParticles") + from Configuration.Eras.Modifier_genJetSubEvent_cff import genJetSubEvent + genJetSubEvent.toModify(process.patJetPartonMatch, matched = "cleanedPartons") process.patJetPartonMatch.mcStatus = [ 3, 23 ] process.patJetGenJetMatch.matched = "slimmedGenJets" (~_hiGeneral).toModify(process, patJetGenJetMatchAK8Puppi = dict(matched = "slimmedGenJetsAK8")) @@ -603,6 +606,7 @@ def miniAOD_customizeMC(process): from PhysicsTools.PatAlgos.producersHeavyIons.heavyIonJetSetup import removeJECsForMC _hiGeneral.toModify(process, removeJECsForMC) + _hiGeneral.toReplaceWith(task,task.copyAndExclude([process.slimmedGenJetsFlavourInfos])) def miniAOD_customizeOutput(out): diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py index 83709c6d51c9b..afba82607a686 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py @@ -22,4 +22,7 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(slimmedGenJets, src = "ak4HiSignalGenJets") (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) +from Configuration.Eras.Modifier_genJetSubEvent_cff import genJetSubEvent +genJetSubEvent.toModify(slimmedGenJets, src = "ak4HiGenJetsCleaned") diff --git a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc index 0e8a7b75a8418..23272547d3b4a 100644 --- a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc +++ b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc @@ -38,7 +38,7 @@ namespace { SubEventGenJetProducer::SubEventGenJetProducer(edm::ParameterSet const& conf) : VirtualJetProducer(conf) { // mapSrc_ = conf.getParameter<edm::InputTag>( "srcMap"); ignoreHydro_ = conf.getUntrackedParameter<bool>("ignoreHydro", true); - produces<reco::BasicJetCollection>(); + // the subjet collections are set through the config file in the "jetCollInstanceName" field. input_cand_token_ = consumes<reco::CandidateView>(src_); @@ -104,8 +104,7 @@ void SubEventGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& //////////////// - auto jets = std::make_unique<std::vector<GenJet>>(); - subJets_ = jets.get(); + jets_ = std::make_unique<std::vector<GenJet>>(); LogDebug("VirtualJetProducer") << "Inputted towers\n"; @@ -123,7 +122,7 @@ void SubEventGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& //Finalize LogDebug("SubEventJetProducer") << "Wrote jets\n"; - iEvent.put(std::move(jets)); + iEvent.put(std::move(jets_)); return; } @@ -156,7 +155,7 @@ void SubEventGenJetProducer::runAlgorithm(edm::Event& iEvent, edm::EventSetup co jet.setJetArea(jetArea); jet.setPileup(pu); - subJets_->push_back(jet); + jets_->push_back(jet); } } diff --git a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.h b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.h index 3b96a6a32111d..fdec50e56f487 100644 --- a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.h +++ b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.h @@ -10,6 +10,7 @@ ************************************************************/ +#include <memory> #include <vector> #include "RecoJets/JetProducers/plugins/VirtualJetProducer.h" #include "DataFormats/JetReco/interface/GenJetCollection.h" @@ -24,7 +25,7 @@ namespace cms { protected: std::vector<std::vector<fastjet::PseudoJet> > subInputs_; - std::vector<reco::GenJet>* subJets_; + std::unique_ptr<std::vector<reco::GenJet>> jets_; std::vector<int> hydroTag_; std::vector<int> nSubParticles_; bool ignoreHydro_; From b2701973f15907b56e600eb749d8b983c8bf09f6 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 7 Oct 2020 16:41:33 +0200 Subject: [PATCH 297/778] code checks and format --- .../plugins/HiSignalGenJetProducer.cc | 92 +++++++++---------- .../plugins/HiSignalParticleProducer.cc | 37 +++----- .../plugins/SubEventGenJetProducer.h | 2 +- 3 files changed, 56 insertions(+), 75 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc index 84c004698fd98..bd2b1f284bc79 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc @@ -41,29 +41,26 @@ using namespace std; using namespace edm; - // // class decleration // class HiSignalGenJetProducer : public edm::EDProducer { public: - explicit HiSignalGenJetProducer(const edm::ParameterSet&); - ~HiSignalGenJetProducer(); - - private: - virtual void produce(edm::Event&, const edm::EventSetup&) override; - // ----------member data --------------------------- + explicit HiSignalGenJetProducer(const edm::ParameterSet&); + ~HiSignalGenJetProducer() override; - edm::EDGetTokenT<edm::View<reco::GenJet> > jetSrc_; +private: + void produce(edm::Event&, const edm::EventSetup&) override; + // ----------member data --------------------------- + edm::EDGetTokenT<edm::View<reco::GenJet> > jetSrc_; }; // // constants, enums and typedefs // - // // static data member definitions // @@ -72,67 +69,60 @@ class HiSignalGenJetProducer : public edm::EDProducer { // constructors and destructor // -HiSignalGenJetProducer::HiSignalGenJetProducer(const edm::ParameterSet& iConfig) : - jetSrc_(consumes<edm::View<reco::GenJet> >(iConfig.getParameter<edm::InputTag>("src"))) -{ - std::string alias = (iConfig.getParameter<InputTag>( "src")).label(); - produces<reco::GenJetCollection>().setBranchAlias (alias); +HiSignalGenJetProducer::HiSignalGenJetProducer(const edm::ParameterSet& iConfig) + : jetSrc_(consumes<edm::View<reco::GenJet> >(iConfig.getParameter<edm::InputTag>("src"))) { + std::string alias = (iConfig.getParameter<InputTag>("src")).label(); + produces<reco::GenJetCollection>().setBranchAlias(alias); } -HiSignalGenJetProducer::~HiSignalGenJetProducer() -{ - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) +HiSignalGenJetProducer::~HiSignalGenJetProducer() { + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) } - // // member functions // // ------------ method called to produce the data ------------ -void -HiSignalGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - using namespace reco; +void HiSignalGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + using namespace edm; + using namespace reco; - auto jets = std::make_unique<GenJetCollection>(); + auto jets = std::make_unique<GenJetCollection>(); - edm::Handle<edm::View<GenJet> > genjets; - iEvent.getByToken(jetSrc_,genjets); + edm::Handle<edm::View<GenJet> > genjets; + iEvent.getByToken(jetSrc_, genjets); - int jetsize = genjets->size(); + int jetsize = genjets->size(); - vector<int> selection; - for(int ijet = 0; ijet < jetsize; ++ijet){ - selection.push_back(-1); - } + vector<int> selection; + selection.reserve(jetsize); + for (int ijet = 0; ijet < jetsize; ++ijet) { + selection.push_back(-1); + } - vector<int> selectedIndices; - vector<int> removedIndices; + vector<int> selectedIndices; + vector<int> removedIndices; - for(int ijet = 0; ijet < jetsize; ++ijet){ + for (int ijet = 0; ijet < jetsize; ++ijet) { + const GenJet* jet1 = &((*genjets)[ijet]); - const GenJet* jet1 = &((*genjets)[ijet]); + const GenParticle* gencon = jet1->getGenConstituent(0); - const GenParticle* gencon = jet1->getGenConstituent(0); - - if(gencon == 0) throw cms::Exception("GenConstituent","GenJet is missing its constituents"); - else if(gencon->collisionId() == 0){ - jets->push_back(*jet1); - selection[ijet] = 1; - }else{ - selection[ijet] = 0; - removedIndices.push_back(ijet); - } - } - - iEvent.put(std::move(jets)); + if (gencon == nullptr) + throw cms::Exception("GenConstituent", "GenJet is missing its constituents"); + else if (gencon->collisionId() == 0) { + jets->push_back(*jet1); + selection[ijet] = 1; + } else { + selection[ijet] = 0; + removedIndices.push_back(ijet); + } + } + iEvent.put(std::move(jets)); } DEFINE_FWK_MODULE(HiSignalGenJetProducer); - - diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc index 47ae0efbb513c..c007cc802048b 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc @@ -40,7 +40,6 @@ using namespace std; using namespace edm; - // // class decleration // @@ -48,21 +47,19 @@ using namespace edm; class HiSignalParticleProducer : public edm::EDProducer { public: explicit HiSignalParticleProducer(const edm::ParameterSet&); - ~HiSignalParticleProducer(); + ~HiSignalParticleProducer() override; private: - virtual void produce(edm::Event&, const edm::EventSetup&) override; + void produce(edm::Event&, const edm::EventSetup&) override; // ----------member data --------------------------- edm::EDGetTokenT<edm::View<reco::GenParticle> > genParticleSrc_; - }; // // constants, enums and typedefs // - // // static data member definitions // @@ -71,61 +68,55 @@ class HiSignalParticleProducer : public edm::EDProducer { // constructors and destructor // -HiSignalParticleProducer::HiSignalParticleProducer(const edm::ParameterSet& iConfig) : - genParticleSrc_(consumes<edm::View<reco::GenParticle> >(iConfig.getParameter<edm::InputTag>("src"))) -{ - std::string alias = (iConfig.getParameter<InputTag>( "src")).label(); - produces<reco::GenParticleCollection>().setBranchAlias (alias); +HiSignalParticleProducer::HiSignalParticleProducer(const edm::ParameterSet& iConfig) + : genParticleSrc_(consumes<edm::View<reco::GenParticle> >(iConfig.getParameter<edm::InputTag>("src"))) { + std::string alias = (iConfig.getParameter<InputTag>("src")).label(); + produces<reco::GenParticleCollection>().setBranchAlias(alias); } -HiSignalParticleProducer::~HiSignalParticleProducer() -{ +HiSignalParticleProducer::~HiSignalParticleProducer() { // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) } - // // member functions // // ------------ method called to produce the data ------------ -void -HiSignalParticleProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) -{ +void HiSignalParticleProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; using namespace reco; auto signalGenParticles = std::make_unique<GenParticleCollection>(); edm::Handle<edm::View<GenParticle> > genParticles; - iEvent.getByToken(genParticleSrc_,genParticles); + iEvent.getByToken(genParticleSrc_, genParticles); int genParticleSize = genParticles->size(); vector<int> selection; - for(int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle){ + selection.reserve(genParticleSize); + for (int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle) { selection.push_back(-1); } vector<int> selectedIndices; vector<int> removedIndices; - for(int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle){ - + for (int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle) { const GenParticle* genParticle = &((*genParticles)[igenParticle]); - if(genParticle->collisionId() == 0){ + if (genParticle->collisionId() == 0) { signalGenParticles->push_back(*genParticle); selection[igenParticle] = 1; - }else{ + } else { selection[igenParticle] = 0; removedIndices.push_back(igenParticle); } } iEvent.put(std::move(signalGenParticles)); - } DEFINE_FWK_MODULE(HiSignalParticleProducer); diff --git a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.h b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.h index fdec50e56f487..dd0d917be4a2a 100644 --- a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.h +++ b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.h @@ -24,7 +24,7 @@ namespace cms { void runAlgorithm(edm::Event&, const edm::EventSetup&) override; protected: - std::vector<std::vector<fastjet::PseudoJet> > subInputs_; + std::vector<std::vector<fastjet::PseudoJet>> subInputs_; std::unique_ptr<std::vector<reco::GenJet>> jets_; std::vector<int> hydroTag_; std::vector<int> nSubParticles_; From 794db4216701db874c8d0a09962e1c7bbab83e17 Mon Sep 17 00:00:00 2001 From: Kevin Pedro <kpedro88@gmail.com> Date: Wed, 7 Oct 2020 09:48:52 -0500 Subject: [PATCH 298/778] update to v2 API and corresponding server version --- .../SonicTriton/interface/TritonClient.h | 37 +-- .../SonicTriton/interface/TritonData.h | 29 ++- .../SonicTriton/interface/triton_utils.h | 2 +- .../SonicTriton/src/TritonClient.cc | 214 +++++++----------- .../SonicTriton/src/TritonData.cc | 61 +++-- .../SonicTriton/test/fetch_model.sh | 2 +- HeterogeneousCore/SonicTriton/test/triton | 4 +- .../SonicTriton/test/tritonTest_cfg.py | 2 +- 8 files changed, 173 insertions(+), 178 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/interface/TritonClient.h b/HeterogeneousCore/SonicTriton/interface/TritonClient.h index 3edd1e6ddc1b7..e5218e281166e 100644 --- a/HeterogeneousCore/SonicTriton/interface/TritonClient.h +++ b/HeterogeneousCore/SonicTriton/interface/TritonClient.h @@ -12,18 +12,20 @@ #include <exception> #include <unordered_map> -#include "request_grpc.h" +#include "grpc_client.h" +#include "grpc_service.pb.h" class TritonClient : public SonicClient<TritonInputMap, TritonOutputMap> { public: - using ModelStatus = nvidia::inferenceserver::ModelStatus; - using InferContext = nvidia::inferenceserver::client::InferContext; - struct ServerSideStats { - uint64_t request_count_; - uint64_t cumul_time_ns_; + uint64_t inference_count_; + uint64_t execution_count_; + uint64_t success_count_; + uint64_t cumm_time_ns_; uint64_t queue_time_ns_; - uint64_t compute_time_ns_; + uint64_t compute_input_time_ns_; + uint64_t compute_infer_time_ns_; + uint64_t compute_output_time_ns_; }; //constructor @@ -40,28 +42,29 @@ class TritonClient : public SonicClient<TritonInputMap, TritonOutputMap> { protected: //helper - bool getResults(std::map<std::string, std::unique_ptr<InferContext::Result>>& results); + bool getResults(std::shared_ptr<nvidia::inferenceserver::client::InferResult> results); void evaluate() override; void reportServerSideStats(const ServerSideStats& stats) const; - ServerSideStats summarizeServerStats(const ModelStatus& start_status, const ModelStatus& end_status) const; + ServerSideStats summarizeServerStats(const inference::ModelStatistics& start_status, const inference::ModelStatistics& end_status) const; - ModelStatus getServerSideStatus() const; + inference::ModelStatistics getServerSideStatus() const; //members - std::string url_; - unsigned timeout_; - std::string modelName_; - int modelVersion_; unsigned maxBatchSize_; unsigned batchSize_; bool noBatch_; bool verbose_; - std::unique_ptr<InferContext> context_; - std::unique_ptr<nvidia::inferenceserver::client::ServerStatusContext> serverCtx_; - std::unique_ptr<InferContext::Options> options_; + //IO pointers for triton + std::vector<nvidia::inferenceserver::client::InferInput*> inputsTriton_; + std::vector<const nvidia::inferenceserver::client::InferRequestedOutput*> outputsTriton_; + + std::unique_ptr<nvidia::inferenceserver::client::InferenceServerGrpcClient> client_; + //stores timeout, model name and version + nvidia::inferenceserver::client::InferOptions options_; }; #endif + diff --git a/HeterogeneousCore/SonicTriton/interface/TritonData.h b/HeterogeneousCore/SonicTriton/interface/TritonData.h index 1c9ba37f64a31..d2a04f419dbfe 100644 --- a/HeterogeneousCore/SonicTriton/interface/TritonData.h +++ b/HeterogeneousCore/SonicTriton/interface/TritonData.h @@ -12,7 +12,8 @@ #include <memory> #include <any> -#include "request_grpc.h" +#include "grpc_client.h" +#include "grpc_service.pb.h" //aliases for local input and output types template <typename DT> @@ -24,16 +25,18 @@ using TritonOutput = std::vector<edm::Span<const DT*>>; template <typename IO> class TritonData { public: - using Result = nvidia::inferenceserver::client::InferContext::Result; + using Result = nvidia::inferenceserver::client::InferResult; + using TensorMetadata = inference::ModelMetadataResponse_TensorMetadata; //constructor - TritonData(const std::string& name, std::shared_ptr<IO> data); + TritonData(const std::string& name, const TensorMetadata& model_info); //some members can be modified std::vector<int64_t>& shape() { return shape_; } void reset(); void setBatchSize(unsigned bsize) { batchSize_ = bsize; } - void setResult(std::unique_ptr<Result> result) { result_ = std::move(result); } + void setResult(std::shared_ptr<Result> result) { result_ = result; } + IO* data() { return data_.get(); } //io accessors template <typename DT> @@ -62,6 +65,7 @@ class TritonData { int64_t dimProduct(const std::vector<int64_t>& vec) const { return std::accumulate(vec.begin(), vec.end(), 1, std::multiplies<int64_t>()); } + void createObject(IO* ioptr) const; //members std::string name_; @@ -69,18 +73,18 @@ class TritonData { std::vector<int64_t> dims_; bool variableDims_; int64_t productDims_; - nvidia::inferenceserver::DataType dtype_; + inference::DataType dtype_; std::string dname_; int64_t byteSize_; std::vector<int64_t> shape_; unsigned batchSize_; std::any holder_; - std::unique_ptr<Result> result_; + std::shared_ptr<Result> result_; }; -using TritonInputData = TritonData<nvidia::inferenceserver::client::InferContext::Input>; +using TritonInputData = TritonData<nvidia::inferenceserver::client::InferInput>; using TritonInputMap = std::unordered_map<std::string, TritonInputData>; -using TritonOutputData = TritonData<nvidia::inferenceserver::client::InferContext::Output>; +using TritonOutputData = TritonData<nvidia::inferenceserver::client::InferRequestedOutput>; using TritonOutputMap = std::unordered_map<std::string, TritonOutputData>; //avoid "explicit specialization after instantiation" error @@ -94,9 +98,14 @@ template <> void TritonInputData::reset(); template <> void TritonOutputData::reset(); +template <> +void TritonInputData::createObject(nvidia::inferenceserver::client::InferInput* ioptr) const; +template <> +void TritonOutputData::createObject(nvidia::inferenceserver::client::InferRequestedOutput* ioptr) const; //explicit template instantiation declarations -extern template class TritonData<nvidia::inferenceserver::client::InferContext::Input>; -extern template class TritonData<nvidia::inferenceserver::client::InferContext::Output>; +extern template class TritonData<nvidia::inferenceserver::client::InferInput>; +extern template class TritonData<nvidia::inferenceserver::client::InferRequestedOutput>; #endif + diff --git a/HeterogeneousCore/SonicTriton/interface/triton_utils.h b/HeterogeneousCore/SonicTriton/interface/triton_utils.h index 9d90b22ceb61b..1a232f2f5828c 100644 --- a/HeterogeneousCore/SonicTriton/interface/triton_utils.h +++ b/HeterogeneousCore/SonicTriton/interface/triton_utils.h @@ -6,7 +6,7 @@ #include <vector> #include <unordered_set> -#include "request_grpc.h" +#include "grpc_client.h" namespace triton_utils { diff --git a/HeterogeneousCore/SonicTriton/src/TritonClient.cc b/HeterogeneousCore/SonicTriton/src/TritonClient.cc index 54ea03f8f72f5..61a5aac154bbf 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonClient.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonClient.cc @@ -3,7 +3,8 @@ #include "HeterogeneousCore/SonicTriton/interface/TritonClient.h" #include "HeterogeneousCore/SonicTriton/interface/triton_utils.h" -#include "request_grpc.h" +#include "grpc_client.h" +#include "grpc_service.pb.h" #include <string> #include <cmath> @@ -16,31 +17,35 @@ namespace ni = nvidia::inferenceserver; namespace nic = ni::client; -//based on https://github.com/NVIDIA/triton-inference-server/blob/v1.12.0/src/clients/c++/examples/simple_callback_client.cc +//based on https://github.com/triton-inference-server/server/blob/v2.3.0/src/clients/c++/examples/simple_grpc_async_infer_client.cc +//and https://github.com/triton-inference-server/server/blob/v2.3.0/src/clients/c++/perf_client/perf_client.cc TritonClient::TritonClient(const edm::ParameterSet& params) : SonicClient(params), - url_(params.getUntrackedParameter<std::string>("address") + ":" + - std::to_string(params.getUntrackedParameter<unsigned>("port"))), - timeout_(params.getUntrackedParameter<unsigned>("timeout")), - modelName_(params.getParameter<std::string>("modelName")), - modelVersion_(params.getParameter<int>("modelVersion")), - verbose_(params.getUntrackedParameter<bool>("verbose")) { + verbose_(params.getUntrackedParameter<bool>("verbose")), + options_(params.getParameter<std::string>("modelName")) + { clientName_ = "TritonClient"; //will get overwritten later, just used in constructor fullDebugName_ = clientName_; //connect to the server - triton_utils::throwIfError(nic::InferGrpcContext::Create(&context_, url_, modelName_, modelVersion_, false), + //TODO: add SSL options + std::string url(params.getUntrackedParameter<std::string>("address") + ":" + std::to_string(params.getUntrackedParameter<unsigned>("port"))); + triton_utils::throwIfError(nic::InferenceServerGrpcClient::Create(&client_, url, false), "TritonClient(): unable to create inference context"); - //get options - triton_utils::throwIfError(nic::InferContext::Options::Create(&options_), - "TritonClient(): unable to create inference context options"); + //set options + options_.model_version_ = params.getParameter<std::string>("modelVersion"); + options_.client_timeout_ = params.getUntrackedParameter<unsigned>("timeout"); + + //get model info + inference::ModelMetadataResponse modelMetadata; + triton_utils::throwIfError(client_->ModelMetadata(&modelMetadata, options_.model_name_, options_.model_version_), "TritonClient(): unable to get model metadata"); //get input and output (which know their sizes) - const auto& nicInputs = context_->Inputs(); - const auto& nicOutputs = context_->Outputs(); + const auto& nicInputs = modelMetadata.inputs(); + const auto& nicOutputs = modelMetadata.outputs(); //report all model errors at once std::stringstream msg; @@ -63,12 +68,14 @@ TritonClient::TritonClient(const edm::ParameterSet& params) if (verbose_) io_msg << "Model inputs: " << "\n"; + inputsTriton_.reserve(nicInputs.size()); for (const auto& nicInput : nicInputs) { - const auto& iname = nicInput->Name(); - const auto& curr_itr = + const auto& iname = nicInput.name(); + auto [curr_itr, success] = input_.emplace(std::piecewise_construct, std::forward_as_tuple(iname), std::forward_as_tuple(iname, nicInput)); + auto& curr_input = curr_itr->second; + inputsTriton_.push_back(curr_input.data()); if (verbose_) { - const auto& curr_input = curr_itr.first->second; io_msg << " " << iname << " (" << curr_input.dname() << ", " << curr_input.byteSize() << " b) : " << triton_utils::printColl(curr_input.dims()) << "\n"; } @@ -82,15 +89,15 @@ TritonClient::TritonClient(const edm::ParameterSet& params) if (verbose_) io_msg << "Model outputs: " << "\n"; + outputsTriton_.reserve(nicOutputs.size()); for (const auto& nicOutput : nicOutputs) { - const auto& oname = nicOutput->Name(); + const auto& oname = nicOutput.name(); if (!s_outputs.empty() and s_outputs.find(oname) == s_outputs.end()) continue; - const auto& curr_itr = output_.emplace( + auto [curr_itr, success] = output_.emplace( std::piecewise_construct, std::forward_as_tuple(oname), std::forward_as_tuple(oname, nicOutput)); - const auto& curr_output = curr_itr.first->second; - triton_utils::throwIfError(options_->AddRawResult(nicOutput), - "TritonClient(): unable to add raw result " + curr_itr.first->first); + auto& curr_output = curr_itr->second; + outputsTriton_.push_back(curr_output.data()); if (verbose_) { io_msg << " " << oname << " (" << curr_output.dname() << ", " << curr_output.byteSize() << " b) : " << triton_utils::printColl(curr_output.dims()) << "\n"; @@ -104,38 +111,30 @@ TritonClient::TritonClient(const edm::ParameterSet& params) throw cms::Exception("MissingOutput") << "Some requested outputs were not available on the server: " << triton_utils::printColl(s_outputs); + //config needed for batch size + inference::ModelConfigResponse modelConfigResponse; + triton_utils::throwIfError(client_->ModelConfig(&modelConfigResponse, options_.model_name_, options_.model_version_), "TritonClient(): unable to get model config"); + inference::ModelConfig modelConfig(modelConfigResponse.config()); + //check batch size limitations (after i/o setup) //triton uses max batch size = 0 to denote a model that does not support batching //but for models that do support batching, a given event may set batch size 0 to indicate no valid input is present //so set the local max to 1 and keep track of "no batch" case - maxBatchSize_ = context_->MaxBatchSize(); + + maxBatchSize_ = modelConfig.max_batch_size(); noBatch_ = maxBatchSize_ == 0; maxBatchSize_ = std::max(1u, maxBatchSize_); //check requested batch size setBatchSize(params.getUntrackedParameter<unsigned>("batchSize")); - //initial server settings - triton_utils::throwIfError(context_->SetRunOptions(*options_), "TritonClient(): unable to set run options"); - //print model info std::stringstream model_msg; if (verbose_) { - model_msg << "Model name: " << modelName_ << "\n" - << "Model version: " << modelVersion_ << "\n" + model_msg << "Model name: " << options_.model_name_ << "\n" + << "Model version: " << options_.model_version_ << "\n" << "Model max batch size: " << (noBatch_ ? 0 : maxBatchSize_) << "\n"; - } - - //only used for monitoring - bool has_server = false; - if (verbose_) { - //print model info edm::LogInfo(fullDebugName_) << model_msg.str() << io_msg.str(); - - has_server = triton_utils::warnIfError(nic::ServerStatusGrpcContext::Create(&serverCtx_, url_, false), - "TritonClient(): unable to create server context"); } - if (!has_server) - serverCtx_ = nullptr; } bool TritonClient::setBatchSize(unsigned bsize) { @@ -152,11 +151,6 @@ bool TritonClient::setBatchSize(unsigned bsize) { for (auto& element : output_) { element.second.setBatchSize(bsize); } - //set for server (and Input objects) - if (!noBatch_) { - options_->SetBatchSize(batchSize_); - triton_utils::throwIfError(context_->SetRunOptions(*options_), "setBatchSize(): unable to set run options"); - } return true; } } @@ -170,28 +164,17 @@ void TritonClient::reset() { } } -bool TritonClient::getResults(std::map<std::string, std::unique_ptr<nic::InferContext::Result>>& results) { - for (auto& element : results) { - const auto& oname = element.first; - auto& result = element.second; - - //check for corresponding entry in output map - auto itr = output_.find(oname); - if (itr == output_.end()) { - edm::LogError("TritonServerError") << "getResults(): no entry in output map for result " << oname; - return false; - } - auto& output = itr->second; - +bool TritonClient::getResults(std::shared_ptr<nic::InferResult> results) { + for (auto& [oname,output] : output_) { //set shape here before output becomes const if (output.variableDims()) { bool status = - triton_utils::warnIfError(result->GetRawShape(&(output.shape())), "getResults(): unable to get output shape"); + triton_utils::warnIfError(results->Shape(oname, &(output.shape())), "getResults(): unable to get output shape for "+oname); if (!status) return status; } - //transfer ownership - output.setResult(std::move(result)); + //extend lifetime + output.setResult(results); } return true; @@ -212,12 +195,11 @@ void TritonClient::evaluate() { //non-blocking call auto t1 = std::chrono::high_resolution_clock::now(); bool status = triton_utils::warnIfError( - context_->AsyncRun([t1, start_status, this](nic::InferContext* ctx, - const std::shared_ptr<nic::InferContext::Request>& request) { + client_->AsyncInfer([t1, start_status, this](nic::InferResult* results) { //get results - std::map<std::string, std::unique_ptr<nic::InferContext::Result>> results; + std::shared_ptr<nic::InferResult> results_ptr(results); bool status = - triton_utils::warnIfError(ctx->GetAsyncRunResults(request, &results), "evaluate(): unable to get result"); + triton_utils::warnIfError(results_ptr->RequestStatus(), "evaluate(): unable to get result"); if (!status) { finish(false); return; @@ -236,11 +218,11 @@ void TritonClient::evaluate() { } //check result - status = getResults(results); + status = getResults(results_ptr); //finish finish(status); - }), + }, options_, inputsTriton_, outputsTriton_), "evaluate(): unable to launch async run"); //if AsyncRun failed, finish() wasn't called @@ -249,8 +231,8 @@ void TritonClient::evaluate() { } else { //blocking call auto t1 = std::chrono::high_resolution_clock::now(); - std::map<std::string, std::unique_ptr<nic::InferContext::Result>> results; - bool status = triton_utils::warnIfError(context_->Run(&results), "evaluate(): unable to run and/or get result"); + nic::InferResult* results; + bool status = triton_utils::warnIfError(client_->Infer(&results, options_, inputsTriton_, outputsTriton_), "evaluate(): unable to run and/or get result"); if (!status) { finish(false); return; @@ -268,7 +250,8 @@ void TritonClient::evaluate() { reportServerSideStats(stats); } - status = getResults(results); + std::shared_ptr<nic::InferResult> results_ptr(results); + status = getResults(results_ptr); finish(status); } @@ -277,9 +260,11 @@ void TritonClient::evaluate() { void TritonClient::reportServerSideStats(const TritonClient::ServerSideStats& stats) const { std::stringstream msg; - // https://github.com/NVIDIA/tensorrt-inference-server/blob/v1.12.0/src/clients/c++/perf_client/inference_profiler.cc - const uint64_t count = stats.request_count_; - msg << " Request count: " << count; + // https://github.com/triton-inference-server/server/blob/v2.3.0/src/clients/c%2B%2B/perf_client/inference_profiler.cc + const uint64_t count = stats.success_count_; + msg << " Inference count: " << stats.inference_count_ << "\n"; + msg << " Execution count: " << stats.execution_count_ << "\n"; + msg << " Successful request count: " << count << "\n"; if (count > 0) { auto get_avg_us = [count](uint64_t tval) { @@ -287,75 +272,51 @@ void TritonClient::reportServerSideStats(const TritonClient::ServerSideStats& st return tval / us_to_ns / count; }; - const uint64_t cumul_avg_us = get_avg_us(stats.cumul_time_ns_); + const uint64_t cumm_avg_us = get_avg_us(stats.cumm_time_ns_); const uint64_t queue_avg_us = get_avg_us(stats.queue_time_ns_); - const uint64_t compute_avg_us = get_avg_us(stats.compute_time_ns_); + const uint64_t compute_input_avg_us = get_avg_us(stats.compute_input_time_ns_); + const uint64_t compute_infer_avg_us = get_avg_us(stats.compute_infer_time_ns_); + const uint64_t compute_output_avg_us = get_avg_us(stats.compute_output_time_ns_); + const uint64_t compute_avg_us = + compute_input_avg_us + compute_infer_avg_us + compute_output_avg_us; const uint64_t overhead = - (cumul_avg_us > queue_avg_us + compute_avg_us) ? (cumul_avg_us - queue_avg_us - compute_avg_us) : 0; + (cumm_avg_us > queue_avg_us + compute_avg_us) ? (cumm_avg_us - queue_avg_us - compute_avg_us) : 0; - msg << "\n" - << " Avg request latency: " << cumul_avg_us << " usec" - << "\n" + msg << " Avg request latency: " << cumm_avg_us << " usec" << "\n" << " (overhead " << overhead << " usec + " << "queue " << queue_avg_us << " usec + " - << "compute " << compute_avg_us << " usec)" << std::endl; + << "compute input " << compute_input_avg_us << " usec + " + << "compute infer " << compute_infer_avg_us << " usec + " + << "compute output " << compute_output_avg_us << " usec)" << std::endl; } if (!debugName_.empty()) edm::LogInfo(fullDebugName_) << msg.str(); } -TritonClient::ServerSideStats TritonClient::summarizeServerStats(const ni::ModelStatus& start_status, - const ni::ModelStatus& end_status) const { - // If model_version is -1 then look in the end status to find the - // latest (highest valued version) and use that as the version. - int64_t status_model_version = 0; - if (modelVersion_ < 0) { - for (const auto& vp : end_status.version_status()) { - status_model_version = std::max(status_model_version, vp.first); - } - } else - status_model_version = modelVersion_; - +TritonClient::ServerSideStats TritonClient::summarizeServerStats(const inference::ModelStatistics& start_status, + const inference::ModelStatistics& end_status) const { TritonClient::ServerSideStats server_stats; - auto vend_itr = end_status.version_status().find(status_model_version); - if (vend_itr != end_status.version_status().end()) { - auto end_itr = vend_itr->second.infer_stats().find(batchSize_); - if (end_itr != vend_itr->second.infer_stats().end()) { - uint64_t start_count = 0; - uint64_t start_cumul_time_ns = 0; - uint64_t start_queue_time_ns = 0; - uint64_t start_compute_time_ns = 0; - - auto vstart_itr = start_status.version_status().find(status_model_version); - if (vstart_itr != start_status.version_status().end()) { - auto start_itr = vstart_itr->second.infer_stats().find(batchSize_); - if (start_itr != vstart_itr->second.infer_stats().end()) { - start_count = start_itr->second.success().count(); - start_cumul_time_ns = start_itr->second.success().total_time_ns(); - start_queue_time_ns = start_itr->second.queue().total_time_ns(); - start_compute_time_ns = start_itr->second.compute().total_time_ns(); - } - } - - server_stats.request_count_ = end_itr->second.success().count() - start_count; - server_stats.cumul_time_ns_ = end_itr->second.success().total_time_ns() - start_cumul_time_ns; - server_stats.queue_time_ns_ = end_itr->second.queue().total_time_ns() - start_queue_time_ns; - server_stats.compute_time_ns_ = end_itr->second.compute().total_time_ns() - start_compute_time_ns; - } - } + + server_stats.inference_count_ = end_status.inference_count() - start_status.inference_count(); + server_stats.execution_count_ = end_status.execution_count() - start_status.execution_count(); + server_stats.success_count_ = end_status.inference_stats().success().count() - start_status.inference_stats().success().count(); + server_stats.cumm_time_ns_ = end_status.inference_stats().success().ns() - start_status.inference_stats().success().ns(); + server_stats.queue_time_ns_ = end_status.inference_stats().queue().ns() - start_status.inference_stats().queue().ns(); + server_stats.compute_input_time_ns_ = end_status.inference_stats().compute_input().ns() - start_status.inference_stats().compute_input().ns(); + server_stats.compute_infer_time_ns_ = end_status.inference_stats().compute_infer().ns() - start_status.inference_stats().compute_infer().ns(); + server_stats.compute_output_time_ns_ = end_status.inference_stats().compute_output().ns() - start_status.inference_stats().compute_output().ns(); + return server_stats; } -ni::ModelStatus TritonClient::getServerSideStatus() const { - if (serverCtx_) { - ni::ServerStatus server_status; - serverCtx_->GetServerStatus(&server_status); - auto itr = server_status.model_status().find(modelName_); - if (itr != server_status.model_status().end()) - return itr->second; +inference::ModelStatistics TritonClient::getServerSideStatus() const { + if (verbose_) { + inference::ModelStatisticsResponse resp; + triton_utils::warnIfError(client_->ModelInferenceStatistics(&resp, options_.model_name_, options_.model_version_), "getServerSideStatus(): unable to get model statistics"); + return *(resp.model_stats().begin()); } - return ni::ModelStatus{}; + return inference::ModelStatistics{}; } //for fillDescriptions @@ -363,7 +324,7 @@ void TritonClient::fillPSetDescription(edm::ParameterSetDescription& iDesc) { edm::ParameterSetDescription descClient; fillBasePSetDescription(descClient); descClient.add<std::string>("modelName"); - descClient.add<int>("modelVersion", -1); + descClient.add<std::string>("modelVersion", ""); //server parameters should not affect the physics results descClient.addUntracked<unsigned>("batchSize"); descClient.addUntracked<std::string>("address"); @@ -373,3 +334,4 @@ void TritonClient::fillPSetDescription(edm::ParameterSetDescription& iDesc) { descClient.addUntracked<std::vector<std::string>>("outputs", {}); iDesc.add<edm::ParameterSetDescription>("Client", descClient); } + diff --git a/HeterogeneousCore/SonicTriton/src/TritonData.cc b/HeterogeneousCore/SonicTriton/src/TritonData.cc index 19e598f9dd002..50e23f135256c 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonData.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonData.cc @@ -1,6 +1,7 @@ #include "HeterogeneousCore/SonicTriton/interface/TritonData.h" #include "HeterogeneousCore/SonicTriton/interface/triton_utils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" + #include "model_config.pb.h" #include <cstring> @@ -10,16 +11,17 @@ namespace nic = ni::client; namespace nvidia { namespace inferenceserver { - //in librequest.so, but corresponding header src/core/model_config.h not available - size_t GetDataTypeByteSize(const DataType dtype); + //in libgrpcclient.so, but corresponding header src/core/model_config.h not available + size_t GetDataTypeByteSize(const inference::DataType dtype); + inference::DataType ProtocolStringToDataType(const std::string& dtype); } // namespace inferenceserver } // namespace nvidia template <typename IO> -TritonData<IO>::TritonData(const std::string& name, std::shared_ptr<IO> data) - : name_(name), data_(std::move(data)), batchSize_(0) { +TritonData<IO>::TritonData(const std::string& name, const TritonData<IO>::TensorMetadata& model_info) + : name_(name), batchSize_(0) { //convert google::protobuf::RepeatedField to vector - const auto& dimsTmp = data_->Dims(); + const auto& dimsTmp = model_info.shape(); dims_.assign(dimsTmp.begin(), dimsTmp.end()); //check if variable dimensions @@ -29,10 +31,25 @@ TritonData<IO>::TritonData(const std::string& name, std::shared_ptr<IO> data) else productDims_ = dimProduct(dims_); - dtype_ = data_->DType(); - dname_ = ni::DataType_Name(dtype_); + dname_ = model_info.datatype(); + dtype_ = ni::ProtocolStringToDataType(dname_); //get byte size for input conversion byteSize_ = ni::GetDataTypeByteSize(dtype_); + + //create input or output object + IO* iotmp; + createObject(iotmp); + data_.reset(iotmp); +} + +template <> +void TritonInputData::createObject(nic::InferInput* ioptr) const { + nic::InferInput::Create(&ioptr, name_, shape(), dname_); +} + +template <> +void TritonOutputData::createObject(nic::InferRequestedOutput* ioptr) const { + nic::InferRequestedOutput::Create(&ioptr, name_); } //io accessors @@ -65,7 +82,7 @@ void TritonInputData::toServer(std::shared_ptr<TritonInput<DT>> ptr) { int64_t nInput = sizeShape(); for (unsigned i0 = 0; i0 < batchSize_; ++i0) { const DT* arr = data_in[i0].data(); - triton_utils::throwIfError(data_->SetRaw(reinterpret_cast<const uint8_t*>(arr), nInput * byteSize_), + triton_utils::throwIfError(data_->AppendRaw(reinterpret_cast<const uint8_t*>(arr), nInput * byteSize_), name_ + " input(): unable to set data for batch entry " + std::to_string(i0)); } @@ -96,18 +113,21 @@ TritonOutput<DT> TritonOutputData::fromServer() const { uint64_t nOutput = sizeShape(); TritonOutput<DT> dataOut; + const uint8_t* r0; + size_t contentByteSize; + size_t expectedContentByteSize = nOutput * byteSize_ * batchSize_; + triton_utils::throwIfError(result_->RawData(name_, &r0, &contentByteSize), + "output(): unable to get raw"); + if (contentByteSize != expectedContentByteSize) { + throw cms::Exception("TritonDataError") << name_ << " output(): unexpected content byte size " << contentByteSize + << " (expected " << expectedContentByteSize << ")"; + } + + const DT* r1 = reinterpret_cast<const DT*>(r0); dataOut.reserve(batchSize_); for (unsigned i0 = 0; i0 < batchSize_; ++i0) { - const uint8_t* r0; - size_t contentByteSize; - triton_utils::throwIfError(result_->GetRaw(i0, &r0, &contentByteSize), - "output(): unable to get raw for entry " + std::to_string(i0)); - if (contentByteSize != nOutput * byteSize_) { - throw cms::Exception("TritonDataError") << name_ << " output(): unexpected content byte size " << contentByteSize - << " (expected " << nOutput * byteSize_ << ")"; - } - const DT* r1 = reinterpret_cast<const DT*>(r0); - dataOut.emplace_back(r1, r1 + nOutput); + auto offset = i0 * nOutput; + dataOut.emplace_back(r1 + offset, r1 + offset + nOutput); } return dataOut; @@ -127,10 +147,11 @@ void TritonOutputData::reset() { } //explicit template instantiation declarations -template class TritonData<nic::InferContext::Input>; -template class TritonData<nic::InferContext::Output>; +template class TritonData<nic::InferInput>; +template class TritonData<nic::InferRequestedOutput>; template void TritonInputData::toServer(std::shared_ptr<TritonInput<float>> data_in); template void TritonInputData::toServer(std::shared_ptr<TritonInput<int64_t>> data_in); template TritonOutput<float> TritonOutputData::fromServer() const; + diff --git a/HeterogeneousCore/SonicTriton/test/fetch_model.sh b/HeterogeneousCore/SonicTriton/test/fetch_model.sh index a9533be37823a..bc469886e215c 100755 --- a/HeterogeneousCore/SonicTriton/test/fetch_model.sh +++ b/HeterogeneousCore/SonicTriton/test/fetch_model.sh @@ -51,4 +51,4 @@ output [ EOF mkdir -p 1 -cp /cvmfs/unpacked.cern.ch/registry.hub.docker.com/fastml/triton-torchgeo:20.06-v1-py3-geometric/torch_geometric/examples/model.pt 1/model.pt +cp /cvmfs/unpacked.cern.ch/registry.hub.docker.com/fastml/triton-torchgeo:20.09-py3-geometric/torch_geometric/examples/model.pt 1/model.pt diff --git a/HeterogeneousCore/SonicTriton/test/triton b/HeterogeneousCore/SonicTriton/test/triton index 7dd6ec7bd440f..a02c63e3f64e3 100755 --- a/HeterogeneousCore/SonicTriton/test/triton +++ b/HeterogeneousCore/SonicTriton/test/triton @@ -56,11 +56,11 @@ if [ "$OP" != start ] && [ "$OP" != stop ]; then fi DOCKER="sudo docker" -IMAGE=fastml/triton-torchgeo:20.06-v1-py3-geometric +IMAGE=fastml/triton-torchgeo:20.09-py3-geometric MODELS=${CMSSW_BASE}/src/HeterogeneousCore/SonicTriton/data/models LOG=log_triton_server.log LIB=lib -STARTED_INDICATOR="Started GRPCService" +STARTED_INDICATOR="Started GRPCInferenceService" EXTRA="" start_docker(){ diff --git a/HeterogeneousCore/SonicTriton/test/tritonTest_cfg.py b/HeterogeneousCore/SonicTriton/test/tritonTest_cfg.py index aa79ba84ceb59..0646e527d16b0 100644 --- a/HeterogeneousCore/SonicTriton/test/tritonTest_cfg.py +++ b/HeterogeneousCore/SonicTriton/test/tritonTest_cfg.py @@ -46,7 +46,7 @@ port = cms.untracked.uint32(options.port), timeout = cms.untracked.uint32(options.timeout), modelName = cms.string(models[options.producer]), - modelVersion = cms.int32(-1), + modelVersion = cms.string(""), verbose = cms.untracked.bool(options.verbose), allowedTries = cms.untracked.uint32(0), ) From 48f14426e7a9f15aaba7ba91fa7a724b451dd0f4 Mon Sep 17 00:00:00 2001 From: Kenneth Long <kdlong@hep.wisc.edu> Date: Wed, 7 Oct 2020 17:17:30 +0200 Subject: [PATCH 299/778] A few more NanoGen DQM plots, update default precision --- .../python/relval_generator.py | 3 +- PhysicsTools/NanoAOD/python/nanogenDQM_cff.py | 53 +++++++++++++++---- PhysicsTools/NanoAOD/python/nanogen_cff.py | 33 +++++++++--- 3 files changed, 69 insertions(+), 20 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_generator.py b/Configuration/PyReleaseValidation/python/relval_generator.py index 4a129b652bcbc..d9b4681d7b083 100644 --- a/Configuration/PyReleaseValidation/python/relval_generator.py +++ b/Configuration/PyReleaseValidation/python/relval_generator.py @@ -40,4 +40,5 @@ workflows[545]=['',['BsToMuMu_forSTEAM_13TeV','HARVESTGEN']] # Miscellaneous -workflows[595]=['',['DYToLL_M-50_13TeV_pythia8','NANOGENFromGen']] +workflows[546]=['',['DYToLL_M-50_13TeV_pythia8','NANOGENFromGen']] +workflows[547]=['',['DYToll01234Jets_5f_LO_MLM_Madgraph_LHE_13TeV','Hadronizer_TuneCP5_13TeV_MLM_5f_max4j_LHE_pythia8','NANOGENFromGen']] diff --git a/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py b/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py index 45cc01da8950e..ace11206e4426 100644 --- a/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py +++ b/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py @@ -3,18 +3,49 @@ from PhysicsTools.NanoAOD.nanoDQM_cfi import nanoDQM from PhysicsTools.NanoAOD.nanoDQM_tools_cff import * +from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer - -nanogenDQM = nanoDQM.clone() - -nanogenDQM.vplots = [nanoDQM.vplots.GenDressedLepton, - nanoDQM.vplots.GenIsolatedPhoton, - nanoDQM.vplots.GenJet, - nanoDQM.vplots.GenJetAK8, - nanoDQM.vplots.GenMET, - nanoDQM.vplots.GenPart, - nanoDQM.vplots.GenVisTau, - ] +nanogenDQM = DQMEDAnalyzer("NanoAODDQM", + vplots = cms.PSet(GenDressedLepton = nanoDQM.vplots.GenDressedLepton, + GenIsolatedPhoton = nanoDQM.vplots.GenIsolatedPhoton, + GenJet = nanoDQM.vplots.GenJet, + GenJetAK8 = nanoDQM.vplots.GenJetAK8, + GenMET = nanoDQM.vplots.GenMET, + GenPart = nanoDQM.vplots.GenPart, + GenVisTau = nanoDQM.vplots.GenVisTau, + LHEPart = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 20, 0, 20, 'LHE particles'), + Plot1D('eta', 'eta', 20, -30000, 30000, 'eta'), + Plot1D('pdgId', 'pdgId', 20, -6000, 6000, 'PDG id'), + Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'), + Plot1D('pt', 'pt', 20, 0, 200, 'pt'), + ) + ), + LHEScaleWeight = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 20, 0, 20, 'LHE scale weights'), + Plot1D('', '', 100, 0, 2, 'all weights'), + ) + ), + LHEPdfWeight = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 1000, 0, 2000, 'LHE PDF weights'), + Plot1D('', '', 100, 0, 2, 'all weights'), + ) + ), + PSWeight = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 50, 0, 50, 'LHE PDF weights'), + Plot1D('', '', 100, 0, 2, 'all weights'), + ) + ), + ) +) from DQMServices.Core.DQMQualityTester import DQMQualityTester nanoDQMQTester = DQMQualityTester( diff --git a/PhysicsTools/NanoAOD/python/nanogen_cff.py b/PhysicsTools/NanoAOD/python/nanogen_cff.py index 0eeddd06b1bcb..201d6eb95eff7 100644 --- a/PhysicsTools/NanoAOD/python/nanogen_cff.py +++ b/PhysicsTools/NanoAOD/python/nanogen_cff.py @@ -6,6 +6,7 @@ from PhysicsTools.NanoAOD.particlelevel_cff import * from PhysicsTools.NanoAOD.lheInfoTable_cfi import * from PhysicsTools.NanoAOD.genWeightsTable_cfi import * +from PhysicsTools.NanoAOD.common_cff import CandVars nanoMetadata = cms.EDProducer("UniqueStringProducer", strings = cms.PSet( @@ -49,6 +50,10 @@ def nanoGenCommonCustomize(process): process.particleLevel.lepMinPt = 0. process.particleLevel.lepMaxEta = 999. process.genJetFlavourTable.jetFlavourInfos = "genJetFlavourAssociation" + # Same as default RECO + setGenPhiPrecision(process, CandVars.pt.precision) + setGenPtPrecision(process, CandVars.eta.precision) + setGenPhiPrecision(process, CandVars.phi.precision) def customizeNanoGENFromMini(process): process.nanoAOD_step.insert(0, process.genParticles2HepMCHiggsVtx) @@ -115,14 +120,26 @@ def pruneGenParticlesMini(process): return process def setGenFullPrecision(process): - process.genParticleTable.variables.pt.precision = 23 - process.genParticleTable.variables.eta.precision = 23 - process.genParticleTable.variables.phi.precision = 23 - process.genJetTable.variables.pt.precision = 23 - process.genJetTable.variables.eta.precision = 23 - process.genJetTable.variables.phi.precision = 23 - process.metMCTable.variables.pt.precision = 23 - process.metMCTable.variables.phi.precision = 23 + setGenPtPrecision(process, 23) + setGenEtaPrecision(process, 23) + setGenPhiPrecision(process, 23) + +def setGenPtPrecision(process, precision): + process.genParticleTable.variables.pt.precision = precision + process.genJetTable.variables.pt.precision = precision + process.metMCTable.variables.pt.precision = precision + return process + +def setGenEtaPrecision(process, precision): + process.genParticleTable.variables.eta.precision = precision + process.genJetTable.variables.eta.precision = precision + process.metMCTable.variables.eta.precision = precision + return process + +def setGenPhiPrecision(process, precision): + process.genParticleTable.variables.phi.precision = precision + process.genJetTable.variables.phi.precision = precision + process.metMCTable.variables.phi.precision = precision return process def setLHEFullPrecision(process): From f591a41362c7444df5c3423ce29e490bbdf74024 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 7 Oct 2020 10:43:43 -0500 Subject: [PATCH 300/778] Changed EDGetToken test to use catch2 --- FWCore/Utilities/test/BuildFile.xml | 3 - FWCore/Utilities/test/EDGetToken_t.cpp | 51 -------------- .../Utilities/test/test_catch2_EDGetToken.cc | 70 +++++++++++++++++++ 3 files changed, 70 insertions(+), 54 deletions(-) delete mode 100644 FWCore/Utilities/test/EDGetToken_t.cpp create mode 100644 FWCore/Utilities/test/test_catch2_EDGetToken.cc diff --git a/FWCore/Utilities/test/BuildFile.xml b/FWCore/Utilities/test/BuildFile.xml index acd8d72b6d5b0..d6b02debe37a8 100644 --- a/FWCore/Utilities/test/BuildFile.xml +++ b/FWCore/Utilities/test/BuildFile.xml @@ -54,9 +54,6 @@ <use name="tbb"/> </bin> -<bin file="EDGetToken_t.cpp"> -</bin> - <bin file="RunningAverage_t.cpp"> <use name="tbb"/> </bin> diff --git a/FWCore/Utilities/test/EDGetToken_t.cpp b/FWCore/Utilities/test/EDGetToken_t.cpp deleted file mode 100644 index ff320e9e104c9..0000000000000 --- a/FWCore/Utilities/test/EDGetToken_t.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include <functional> -#include "FWCore/Utilities/interface/EDGetToken.h" - -namespace edm { - class TestEDGetToken { - public: - template <typename... Args> - static edm::EDGetToken makeToken(Args&&... iArgs) { - return edm::EDGetToken(std::forward<Args>(iArgs)...); - } - - template <typename T, typename... Args> - static edm::EDGetTokenT<T> makeTokenT(Args&&... iArgs) { - return edm::EDGetTokenT<T>(std::forward<Args>(iArgs)...); - } - }; -} // namespace edm - -#include <iostream> - -int main() { - edm::EDGetTokenT<int> token1 = edm::TestEDGetToken::makeTokenT<int>(); - if (!token1.isUninitialized() || !(token1.index() == 0xFFFFFFFF)) { - std::cout << "EDGetTokenT no argument constructor failed 1" << std::endl; - abort(); - } - - edm::EDGetTokenT<int> token2 = edm::TestEDGetToken::makeTokenT<int>(11U); - if (token2.isUninitialized() || !(token2.index() == 11)) { - std::cout << "EDGetTokenT 1 argument constructor failed 2" << std::endl; - abort(); - } - - edm::EDGetToken token10 = edm::TestEDGetToken::makeToken(); - if (!token10.isUninitialized() || !(token10.index() == 0xFFFFFFFF)) { - std::cout << "EDGetToken no argument constructor failed 10" << std::endl; - abort(); - } - - edm::EDGetToken token11 = edm::TestEDGetToken::makeToken(100); - if (token11.isUninitialized() || !(token11.index() == 100)) { - std::cout << "EDGetToken 1 argument constructor failed 11" << std::endl; - abort(); - } - - edm::EDGetToken token12(token2); - if (token12.isUninitialized() || !(token12.index() == 11)) { - std::cout << "EDGetToken 1 argument constructor failed 12" << std::endl; - abort(); - } -} diff --git a/FWCore/Utilities/test/test_catch2_EDGetToken.cc b/FWCore/Utilities/test/test_catch2_EDGetToken.cc new file mode 100644 index 0000000000000..79cf8ea7249db --- /dev/null +++ b/FWCore/Utilities/test/test_catch2_EDGetToken.cc @@ -0,0 +1,70 @@ +#include <functional> +#include "FWCore/Utilities/interface/EDGetToken.h" +#include "catch.hpp" + + +namespace edm { + class TestEDGetToken { + public: + template <typename... Args> + static edm::EDGetToken makeToken(Args&&... iArgs) { + return edm::EDGetToken(std::forward<Args>(iArgs)...); + } + + template <typename T, typename... Args> + static edm::EDGetTokenT<T> makeTokenT(Args&&... iArgs) { + return edm::EDGetTokenT<T>(std::forward<Args>(iArgs)...); + } + }; +} // namespace edm + +#include <iostream> + +TEST_CASE("Test EDGetToken","[EDGetToken]") { + SECTION("EDGetTokenT") { + SECTION("No argument ctr") { + edm::EDGetTokenT<int> token1 = edm::TestEDGetToken::makeTokenT<int>(); + REQUIRE(token1.isUninitialized()); + REQUIRE((token1.index() == 0xFFFFFFFF)); + } + SECTION("1 arg ctr") { + edm::EDGetTokenT<int> token2 = edm::TestEDGetToken::makeTokenT<int>(11U); + REQUIRE(!token2.isUninitialized()); + REQUIRE((token2.index() == 11)); + } + SECTION("non const arg copy ctr") { + edm::EDGetTokenT<int> token2 = edm::TestEDGetToken::makeTokenT<int>(11U); + edm::EDGetTokenT<int> token3(token2); + REQUIRE(!token3.isUninitialized()); + REQUIRE((token3.index() == 11)); + } + + SECTION("const arg copy ctr"){ + const edm::EDGetTokenT<int> cToken2 = edm::TestEDGetToken::makeTokenT<int>(11U); + edm::EDGetTokenT<int> token4(cToken2); + REQUIRE(!token4.isUninitialized()); + REQUIRE(token4.index() == 11); + } + } + + SECTION("EDGetToken") { + SECTION("No arg ctr") { + edm::EDGetToken token10 = edm::TestEDGetToken::makeToken(); + REQUIRE(token10.isUninitialized()); + REQUIRE(token10.index() == 0xFFFFFFFF); + } + + SECTION("1 arg ctr") { + edm::EDGetToken token11 = edm::TestEDGetToken::makeToken(100); + REQUIRE(!token11.isUninitialized()); + REQUIRE(token11.index() == 100); + } + + SECTION("EDGetTokenT to EDGetToken ctr") { + edm::EDGetTokenT<int> token2 = edm::TestEDGetToken::makeTokenT<int>(11U); + edm::EDGetToken token12(token2); + REQUIRE(!token12.isUninitialized()); + REQUIRE(token12.index() == 11); + } + } +} From 2353eadca83c3f4f82091ebb2e9c15c31617a947 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Wed, 7 Oct 2020 17:43:57 +0200 Subject: [PATCH 301/778] move lumilists to eos instead of afs for unit tests --- Alignment/OfflineValidation/test/PVResolutionExample.ini | 3 ++- .../OfflineValidation/test/testPVValidation_Relvals_DATA.ini | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Alignment/OfflineValidation/test/PVResolutionExample.ini b/Alignment/OfflineValidation/test/PVResolutionExample.ini index a1206970d0b71..afb3520952fee 100644 --- a/Alignment/OfflineValidation/test/PVResolutionExample.ini +++ b/Alignment/OfflineValidation/test/PVResolutionExample.ini @@ -1,6 +1,7 @@ # submitPVResolutionJobs.py -j UNIT_TEST -i PVResolutionExample.ini -D /JetHT/Run2018C-TkAlMinBias-12Nov2019_UL2018-v2/ALCARECO -v [Input] -lumimask=/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions18/13TeV/DCSOnly/json_DCSONLY.txt +#lumimask=/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions18/13TeV/DCSOnly/json_DCSONLY.txt +lumimask=/eos/cms/store/group/comm_dqm/certification/Collisions18/13TeV/DCSOnly/json_DCSONLY.txt [Validation:Prompt] globaltag=111X_dataRun2_v3 records=TrackerAlignmentRcd:TrackerAlignment_PCL_byRun_v2_express,TrackerAlignmentErrorExtendedRcd:TrackerAlignmentExtendedErr_2009_v2_express_IOVs,TrackerSurfaceDeformationRcd:TrackerSurafceDeformations_v1_express diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini index 132f550e2587a..102b225fdec3b 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini @@ -37,7 +37,8 @@ ttrhtype: WithTrackAngle applyruncontrol: True ptcut: 3. runboundary: 275657 -lumilist: /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV/DCSOnly/json_DCSONLY.txt +#/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV/DCSOnly/json_DCSONLY.txt +lumilist:/eos/cms/store/group/comm_dqm/certification/Collisions16/13TeV/DCSOnly/json_DCSONLY.txt [ExtraConditions] SiPixelTemplateDBObjectRcd:frontier://FrontierProd/CMS_CONDITIONS,SiPixelTemplateDBObject_38T_2015_v3_hltvalidation From 1e1cf79604251cbd7467f284348427f8c5a9e372 Mon Sep 17 00:00:00 2001 From: Vincenzo Innocente <vincenzo.innocente@cern.ch> Date: Fri, 5 Jul 2019 11:59:12 +0200 Subject: [PATCH 302/778] Port the whole pixel workflow to new heterogeneous framework (#384) - port the whole pixel workflow to new heterogeneous framework - implement a legacy cluster to SoA converter for the pixel RecHits - update the vertex producer to run on CPU as well as GPU --- .../Common/interface/HeterogeneousSoA.h | 247 ++++++++++++++++++ .../Common/interface/HostProduct.h | 40 +++ 2 files changed, 287 insertions(+) create mode 100644 CUDADataFormats/Common/interface/HeterogeneousSoA.h create mode 100644 CUDADataFormats/Common/interface/HostProduct.h diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h new file mode 100644 index 0000000000000..3ada1f2e1d83a --- /dev/null +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -0,0 +1,247 @@ +#ifndef CUDADataFormatsCommonHeterogeneousSoA_H +#define CUDADataFormatsCommonHeterogeneousSoA_H + +#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" +#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" + +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "HeterogeneousCore/CUDAServices/interface/CUDAService.h" +#include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h" +#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" + +// a heterogeneous unique pointer... +template<typename T> +class HeterogeneousSoA { +public: + + using Product = T; + + HeterogeneousSoA() = default; // make root happy + ~HeterogeneousSoA() = default; + HeterogeneousSoA(HeterogeneousSoA&&) = default; + HeterogeneousSoA& operator=(HeterogeneousSoA&&) = default; + + explicit HeterogeneousSoA(cudautils::device::unique_ptr<T> && p) : dm_ptr(std::move(p)) {} + explicit HeterogeneousSoA(cudautils::host::unique_ptr<T> && p) : hm_ptr(std::move(p)) {} + explicit HeterogeneousSoA(std::unique_ptr<T> && p) : std_ptr(std::move(p)) {} + + + auto const * get() const { + return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); + } + + auto const & operator*() const { + return *get(); + } + + auto const * operator->() const { + return get(); + } + + + auto * get() { + return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); + } + + auto & operator*() { + return *get(); + } + + auto * operator->() { + return get(); + } + + + + // in reality valid only for GPU version... + cudautils::host::unique_ptr<T> + toHostAsync(cuda::stream_t<>& stream) const { + assert(dm_ptr); + edm::Service<CUDAService> cs; + auto ret = cs->make_host_unique<T>(stream); + cudaCheck(cudaMemcpyAsync(ret.get(), dm_ptr.get(), sizeof(T), cudaMemcpyDefault, stream.id())); + return ret; + } + + + +private: + // a union wan't do it, a variant will not be more efficienct + cudautils::device::unique_ptr<T> dm_ptr; //! + cudautils::host::unique_ptr<T> hm_ptr; //! + std::unique_ptr<T> std_ptr; //! + +}; + + +/* +namespace cudaCompat { + + struct GPUTraits { + + template<typename T> + using unique_ptr = cudautils::device::unique_ptr<T>; + + template<typename T> + static auto make_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { + return cs->make_device_unique<T>(stream); + } + + template<typename T> + static auto make_unique(edm::Service<CUDAService> & cs, size_t size, cuda::stream_t<> &stream) { + return cs->make_device_unique<T>(size, stream); + } + + template<typename T> + static auto make_host_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { + return cs->make_host_unique<T>(stream); + } + + + template<typename T> + static auto make_device_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { + return cs->make_device_unique<T>(stream); + } + + template<typename T> + static auto make_device_unique(edm::Service<CUDAService> & cs, size_t size, cuda::stream_t<> &stream) { + return cs->make_device_unique<T>(size, stream); + } + + + }; + + + struct HostTraits { + + template<typename T> + using unique_ptr = cudautils::host::unique_ptr<T>; + + template<typename T> + static auto make_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { + return cs->make_host_unique<T>(stream); + } + + + template<typename T> + static auto make_host_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { + return cs->make_host_unique<T>(stream); + } + + + template<typename T> + static auto make_device_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { + return cs->make_device_unique<T>(stream); + } + + template<typename T> + static auto make_device_unique(edm::Service<CUDAService> & cs, size_t size, cuda::stream_t<> &stream) { + return cs->make_device_unique<T>(size, stream); + } + + + }; + + + struct CPUTraits { + + template<typename T> + using unique_ptr = std::unique_ptr<T>; + + template<typename T> + static auto make_unique(edm::Service<CUDAService>&, cuda::stream_t<> &) { + return std::make_unique<T>(); + } + + + template<typename T> + static auto make_unique(edm::Service<CUDAService>&, size_t size, cuda::stream_t<> &) { + return std::make_unique<T>(size); + } + + + template<typename T> + static auto make_host_unique(edm::Service<CUDAService>&, cuda::stream_t<> &) { + return std::make_unique<T>(); + } + + + template<typename T> + static auto make_device_unique(edm::Service<CUDAService>&, cuda::stream_t<> &) { + return std::make_unique<T>(); + } + + template<typename T> + static auto make_device_unique(edm::Service<CUDAService>&, size_t size, cuda::stream_t<> &) { + return std::make_unique<T>(size); + } + + + }; + +} + + + +// a heterogeneous unique pointer (of a different sort) ... +template<typename T, typename Traits> +class HeterogeneousSoAImpl { +public: + + template<typename V> + using unique_ptr = typename Traits:: template unique_ptr<V>; + + + HeterogeneousSoAImpl() = default; // make root happy + ~HeterogeneousSoAImpl() = default; + HeterogeneousSoAImpl(HeterogeneousSoAImpl&&) = default; + HeterogeneousSoAImpl& operator=(HeterogeneousSoAImpl&&) = default; + + explicit HeterogeneousSoAImpl(unique_ptr<T> && p) : m_ptr(std::move(p)) {} + explicit HeterogeneousSoAImpl(cuda::stream_t<> &stream); + + T const * get() const { + return m_ptr.get(); + } + + T * get() { + return m_ptr.get(); + } + + + cudautils::host::unique_ptr<T> toHostAsync(cuda::stream_t<>& stream) const; + +private: + unique_ptr<T> m_ptr; //! + +}; + + + +template<typename T, typename Traits> +HeterogeneousSoAImpl<T,Traits>::HeterogeneousSoAImpl(cuda::stream_t<> &stream) { + edm::Service<CUDAService> cs; + m_ptr = Traits:: template make_unique<T>(cs,stream); +} + + +// in reality valid only for GPU version... +template<typename T, typename Traits> +cudautils::host::unique_ptr<T> +HeterogeneousSoAImpl<T,Traits>::toHostAsync(cuda::stream_t<>& stream) const { + edm::Service<CUDAService> cs; + auto ret = cs->make_host_unique<T>(stream); + cudaCheck(cudaMemcpyAsync(ret.get(), get(), sizeof(T), cudaMemcpyDefault, stream.id())); + return ret; +} + + +template<typename T> +using HeterogeneousSoAGPU = HeterogeneousSoAImpl<T,cudaCompat::GPUTraits>; +template<typename T> +using HeterogeneousSoACPU = HeterogeneousSoAImpl<T,cudaCompat::CPUTraits>; +template<typename T> +using HeterogeneousSoAHost = HeterogeneousSoAImpl<T,cudaCompat::HostTraits>; +*/ + +#endif diff --git a/CUDADataFormats/Common/interface/HostProduct.h b/CUDADataFormats/Common/interface/HostProduct.h new file mode 100644 index 0000000000000..dfc5cfc866779 --- /dev/null +++ b/CUDADataFormats/Common/interface/HostProduct.h @@ -0,0 +1,40 @@ +#ifndef CUDADataFormatsCommonHostProduct_H +#define CUDADataFormatsCommonHostProduct_H + +#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" + +// a heterogeneous unique pointer... +template<typename T> +class HostProduct { +public: + + + HostProduct() = default; // make root happy + ~HostProduct() = default; + HostProduct(HostProduct&&) = default; + HostProduct& operator=(HostProduct&&) = default; + + explicit HostProduct(cudautils::host::unique_ptr<T> && p) : hm_ptr(std::move(p)) {} + explicit HostProduct(std::unique_ptr<T> && p) : std_ptr(std::move(p)) {} + + + auto const * get() const { + return hm_ptr ? hm_ptr.get() : std_ptr.get(); + } + + auto const & operator*() const { + return *get(); + } + + auto const * operator->() const { + return get(); + } + + +private: + cudautils::host::unique_ptr<T> hm_ptr; + std::unique_ptr<T> std_ptr; + +}; + +#endif From bdebe5ec25b3c077aa357983039618dcde45de25 Mon Sep 17 00:00:00 2001 From: Vincenzo Innocente <vincenzo.innocente@cern.ch> Date: Sun, 25 Aug 2019 14:04:02 +0200 Subject: [PATCH 303/778] Implement full Pixel SoA workflow on CPU (#385) --- CUDADataFormats/Common/interface/HeterogeneousSoA.h | 3 +-- CUDADataFormats/Common/interface/HostProduct.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h index 3ada1f2e1d83a..44b36c3add2cc 100644 --- a/CUDADataFormats/Common/interface/HeterogeneousSoA.h +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -74,7 +74,6 @@ class HeterogeneousSoA { }; -/* namespace cudaCompat { struct GPUTraits { @@ -242,6 +241,6 @@ template<typename T> using HeterogeneousSoACPU = HeterogeneousSoAImpl<T,cudaCompat::CPUTraits>; template<typename T> using HeterogeneousSoAHost = HeterogeneousSoAImpl<T,cudaCompat::HostTraits>; -*/ + #endif diff --git a/CUDADataFormats/Common/interface/HostProduct.h b/CUDADataFormats/Common/interface/HostProduct.h index dfc5cfc866779..cab50d402cdb5 100644 --- a/CUDADataFormats/Common/interface/HostProduct.h +++ b/CUDADataFormats/Common/interface/HostProduct.h @@ -32,8 +32,8 @@ class HostProduct { private: - cudautils::host::unique_ptr<T> hm_ptr; - std::unique_ptr<T> std_ptr; + cudautils::host::unique_ptr<T> hm_ptr; //! + std::unique_ptr<T> std_ptr; //! }; From d1f001530f0025bf802f7392108c2632cf9c734c Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Tue, 10 Sep 2019 16:03:58 -0500 Subject: [PATCH 304/778] Move event and stream caches, and caching allocators out from CUDAService (#364) To reduce dependencies on edm::Service, and to make CUDAService less of a collection of everything, split off from it: - the CUDAEventCache - the CUDAStreamCache - the caching allocators Other changes: - clean up unnecessary use of CUDAService - fix maxCachedFraction, add debug printouts - add make_*_unique_uninitialized that avoid the static_assert --- .../Common/interface/HeterogeneousSoA.h | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h index 44b36c3add2cc..3a161f404f44d 100644 --- a/CUDADataFormats/Common/interface/HeterogeneousSoA.h +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -4,8 +4,6 @@ #include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" #include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "HeterogeneousCore/CUDAServices/interface/CUDAService.h" #include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h" #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" @@ -57,8 +55,7 @@ class HeterogeneousSoA { cudautils::host::unique_ptr<T> toHostAsync(cuda::stream_t<>& stream) const { assert(dm_ptr); - edm::Service<CUDAService> cs; - auto ret = cs->make_host_unique<T>(stream); + auto ret = cudautils::make_host_unique<T>(stream); cudaCheck(cudaMemcpyAsync(ret.get(), dm_ptr.get(), sizeof(T), cudaMemcpyDefault, stream.id())); return ret; } @@ -82,29 +79,29 @@ namespace cudaCompat { using unique_ptr = cudautils::device::unique_ptr<T>; template<typename T> - static auto make_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { - return cs->make_device_unique<T>(stream); + static auto make_unique(cuda::stream_t<> &stream) { + return cudautils::make_device_unique<T>(stream); } template<typename T> - static auto make_unique(edm::Service<CUDAService> & cs, size_t size, cuda::stream_t<> &stream) { - return cs->make_device_unique<T>(size, stream); + static auto make_unique(size_t size, cuda::stream_t<> &stream) { + return cudautils::make_device_unique<T>(size, stream); } template<typename T> - static auto make_host_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { - return cs->make_host_unique<T>(stream); + static auto make_host_unique(cuda::stream_t<> &stream) { + return cudautils::make_host_unique<T>(stream); } template<typename T> - static auto make_device_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { - return cs->make_device_unique<T>(stream); + static auto make_device_unique(cuda::stream_t<> &stream) { + return cudautils::make_device_unique<T>(stream); } template<typename T> - static auto make_device_unique(edm::Service<CUDAService> & cs, size_t size, cuda::stream_t<> &stream) { - return cs->make_device_unique<T>(size, stream); + static auto make_device_unique(size_t size, cuda::stream_t<> &stream) { + return cudautils::make_device_unique<T>(size, stream); } @@ -117,25 +114,25 @@ namespace cudaCompat { using unique_ptr = cudautils::host::unique_ptr<T>; template<typename T> - static auto make_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { - return cs->make_host_unique<T>(stream); + static auto make_unique(cuda::stream_t<> &stream) { + return cudautils::make_host_unique<T>(stream); } template<typename T> - static auto make_host_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { - return cs->make_host_unique<T>(stream); + static auto make_host_unique(cuda::stream_t<> &stream) { + return cudautils::make_host_unique<T>(stream); } template<typename T> - static auto make_device_unique(edm::Service<CUDAService> & cs, cuda::stream_t<> &stream) { - return cs->make_device_unique<T>(stream); + static auto make_device_unique(cuda::stream_t<> &stream) { + return cudautils::make_device_unique<T>(stream); } template<typename T> - static auto make_device_unique(edm::Service<CUDAService> & cs, size_t size, cuda::stream_t<> &stream) { - return cs->make_device_unique<T>(size, stream); + static auto make_device_unique(size_t size, cuda::stream_t<> &stream) { + return cudautils::make_device_unique<T>(size, stream); } @@ -148,30 +145,30 @@ namespace cudaCompat { using unique_ptr = std::unique_ptr<T>; template<typename T> - static auto make_unique(edm::Service<CUDAService>&, cuda::stream_t<> &) { + static auto make_unique(cuda::stream_t<> &) { return std::make_unique<T>(); } template<typename T> - static auto make_unique(edm::Service<CUDAService>&, size_t size, cuda::stream_t<> &) { + static auto make_unique(size_t size, cuda::stream_t<> &) { return std::make_unique<T>(size); } template<typename T> - static auto make_host_unique(edm::Service<CUDAService>&, cuda::stream_t<> &) { + static auto make_host_unique(cuda::stream_t<> &) { return std::make_unique<T>(); } template<typename T> - static auto make_device_unique(edm::Service<CUDAService>&, cuda::stream_t<> &) { + static auto make_device_unique(cuda::stream_t<> &) { return std::make_unique<T>(); } template<typename T> - static auto make_device_unique(edm::Service<CUDAService>&, size_t size, cuda::stream_t<> &) { + static auto make_device_unique(size_t size, cuda::stream_t<> &) { return std::make_unique<T>(size); } @@ -219,8 +216,7 @@ class HeterogeneousSoAImpl { template<typename T, typename Traits> HeterogeneousSoAImpl<T,Traits>::HeterogeneousSoAImpl(cuda::stream_t<> &stream) { - edm::Service<CUDAService> cs; - m_ptr = Traits:: template make_unique<T>(cs,stream); + m_ptr = Traits:: template make_unique<T>(stream); } @@ -228,8 +224,7 @@ HeterogeneousSoAImpl<T,Traits>::HeterogeneousSoAImpl(cuda::stream_t<> &stream) { template<typename T, typename Traits> cudautils::host::unique_ptr<T> HeterogeneousSoAImpl<T,Traits>::toHostAsync(cuda::stream_t<>& stream) const { - edm::Service<CUDAService> cs; - auto ret = cs->make_host_unique<T>(stream); + auto ret = cudautils::make_host_unique<T>(stream); cudaCheck(cudaMemcpyAsync(ret.get(), get(), sizeof(T), cudaMemcpyDefault, stream.id())); return ret; } From 2e939359f81cfeacb45c7e59e7f51b57c40e0302 Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Thu, 12 Sep 2019 00:22:05 +0200 Subject: [PATCH 305/778] Apply clang-format style formatting --- .../Common/interface/HeterogeneousSoA.h | 203 +++++++----------- .../Common/interface/HostProduct.h | 29 +-- 2 files changed, 83 insertions(+), 149 deletions(-) diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h index 3a161f404f44d..e0e537b9b5c06 100644 --- a/CUDADataFormats/Common/interface/HeterogeneousSoA.h +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -8,234 +8,179 @@ #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" // a heterogeneous unique pointer... -template<typename T> +template <typename T> class HeterogeneousSoA { public: - using Product = T; - HeterogeneousSoA() = default; // make root happy + HeterogeneousSoA() = default; // make root happy ~HeterogeneousSoA() = default; - HeterogeneousSoA(HeterogeneousSoA&&) = default; - HeterogeneousSoA& operator=(HeterogeneousSoA&&) = default; - - explicit HeterogeneousSoA(cudautils::device::unique_ptr<T> && p) : dm_ptr(std::move(p)) {} - explicit HeterogeneousSoA(cudautils::host::unique_ptr<T> && p) : hm_ptr(std::move(p)) {} - explicit HeterogeneousSoA(std::unique_ptr<T> && p) : std_ptr(std::move(p)) {} - - - auto const * get() const { - return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); - } - - auto const & operator*() const { - return *get(); - } + HeterogeneousSoA(HeterogeneousSoA &&) = default; + HeterogeneousSoA &operator=(HeterogeneousSoA &&) = default; - auto const * operator->() const { - return get(); - } + explicit HeterogeneousSoA(cudautils::device::unique_ptr<T> &&p) : dm_ptr(std::move(p)) {} + explicit HeterogeneousSoA(cudautils::host::unique_ptr<T> &&p) : hm_ptr(std::move(p)) {} + explicit HeterogeneousSoA(std::unique_ptr<T> &&p) : std_ptr(std::move(p)) {} + auto const *get() const { return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); } - auto * get() { - return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); - } + auto const &operator*() const { return *get(); } - auto & operator*() { - return *get(); - } + auto const *operator-> () const { return get(); } - auto * operator->() { - return get(); - } + auto *get() { return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); } + auto &operator*() { return *get(); } + auto *operator-> () { return get(); } // in reality valid only for GPU version... - cudautils::host::unique_ptr<T> - toHostAsync(cuda::stream_t<>& stream) const { + cudautils::host::unique_ptr<T> toHostAsync(cuda::stream_t<> &stream) const { assert(dm_ptr); auto ret = cudautils::make_host_unique<T>(stream); cudaCheck(cudaMemcpyAsync(ret.get(), dm_ptr.get(), sizeof(T), cudaMemcpyDefault, stream.id())); return ret; } - - private: // a union wan't do it, a variant will not be more efficienct - cudautils::device::unique_ptr<T> dm_ptr; //! - cudautils::host::unique_ptr<T> hm_ptr; //! - std::unique_ptr<T> std_ptr; //! - + cudautils::device::unique_ptr<T> dm_ptr; //! + cudautils::host::unique_ptr<T> hm_ptr; //! + std::unique_ptr<T> std_ptr; //! }; - namespace cudaCompat { struct GPUTraits { + template <typename T> + using unique_ptr = cudautils::device::unique_ptr<T>; - template<typename T> - using unique_ptr = cudautils::device::unique_ptr<T>; - - template<typename T> - static auto make_unique(cuda::stream_t<> &stream) { + template <typename T> + static auto make_unique(cuda::stream_t<> &stream) { return cudautils::make_device_unique<T>(stream); } - template<typename T> - static auto make_unique(size_t size, cuda::stream_t<> &stream) { + template <typename T> + static auto make_unique(size_t size, cuda::stream_t<> &stream) { return cudautils::make_device_unique<T>(size, stream); } - template<typename T> - static auto make_host_unique(cuda::stream_t<> &stream) { + template <typename T> + static auto make_host_unique(cuda::stream_t<> &stream) { return cudautils::make_host_unique<T>(stream); } - - template<typename T> - static auto make_device_unique(cuda::stream_t<> &stream) { + template <typename T> + static auto make_device_unique(cuda::stream_t<> &stream) { return cudautils::make_device_unique<T>(stream); } - template<typename T> - static auto make_device_unique(size_t size, cuda::stream_t<> &stream) { + template <typename T> + static auto make_device_unique(size_t size, cuda::stream_t<> &stream) { return cudautils::make_device_unique<T>(size, stream); } - - }; - struct HostTraits { + template <typename T> + using unique_ptr = cudautils::host::unique_ptr<T>; - template<typename T> - using unique_ptr = cudautils::host::unique_ptr<T>; - - template<typename T> - static auto make_unique(cuda::stream_t<> &stream) { + template <typename T> + static auto make_unique(cuda::stream_t<> &stream) { return cudautils::make_host_unique<T>(stream); } - - template<typename T> - static auto make_host_unique(cuda::stream_t<> &stream) { + template <typename T> + static auto make_host_unique(cuda::stream_t<> &stream) { return cudautils::make_host_unique<T>(stream); } - - template<typename T> - static auto make_device_unique(cuda::stream_t<> &stream) { + template <typename T> + static auto make_device_unique(cuda::stream_t<> &stream) { return cudautils::make_device_unique<T>(stream); } - template<typename T> - static auto make_device_unique(size_t size, cuda::stream_t<> &stream) { + template <typename T> + static auto make_device_unique(size_t size, cuda::stream_t<> &stream) { return cudautils::make_device_unique<T>(size, stream); } - - }; - struct CPUTraits { + template <typename T> + using unique_ptr = std::unique_ptr<T>; - template<typename T> - using unique_ptr = std::unique_ptr<T>; - - template<typename T> - static auto make_unique(cuda::stream_t<> &) { + template <typename T> + static auto make_unique(cuda::stream_t<> &) { return std::make_unique<T>(); } - - template<typename T> - static auto make_unique(size_t size, cuda::stream_t<> &) { + template <typename T> + static auto make_unique(size_t size, cuda::stream_t<> &) { return std::make_unique<T>(size); } - - template<typename T> - static auto make_host_unique(cuda::stream_t<> &) { + template <typename T> + static auto make_host_unique(cuda::stream_t<> &) { return std::make_unique<T>(); } - - template<typename T> - static auto make_device_unique(cuda::stream_t<> &) { + template <typename T> + static auto make_device_unique(cuda::stream_t<> &) { return std::make_unique<T>(); } - template<typename T> - static auto make_device_unique(size_t size, cuda::stream_t<> &) { + template <typename T> + static auto make_device_unique(size_t size, cuda::stream_t<> &) { return std::make_unique<T>(size); } - - }; -} - - +} // namespace cudaCompat // a heterogeneous unique pointer (of a different sort) ... -template<typename T, typename Traits> +template <typename T, typename Traits> class HeterogeneousSoAImpl { public: + template <typename V> + using unique_ptr = typename Traits::template unique_ptr<V>; - template<typename V> - using unique_ptr = typename Traits:: template unique_ptr<V>; - - - HeterogeneousSoAImpl() = default; // make root happy + HeterogeneousSoAImpl() = default; // make root happy ~HeterogeneousSoAImpl() = default; - HeterogeneousSoAImpl(HeterogeneousSoAImpl&&) = default; - HeterogeneousSoAImpl& operator=(HeterogeneousSoAImpl&&) = default; + HeterogeneousSoAImpl(HeterogeneousSoAImpl &&) = default; + HeterogeneousSoAImpl &operator=(HeterogeneousSoAImpl &&) = default; - explicit HeterogeneousSoAImpl(unique_ptr<T> && p) : m_ptr(std::move(p)) {} + explicit HeterogeneousSoAImpl(unique_ptr<T> &&p) : m_ptr(std::move(p)) {} explicit HeterogeneousSoAImpl(cuda::stream_t<> &stream); - T const * get() const { - return m_ptr.get(); - } - - T * get() { - return m_ptr.get(); - } + T const *get() const { return m_ptr.get(); } + T *get() { return m_ptr.get(); } - cudautils::host::unique_ptr<T> toHostAsync(cuda::stream_t<>& stream) const; + cudautils::host::unique_ptr<T> toHostAsync(cuda::stream_t<> &stream) const; private: - unique_ptr<T> m_ptr; //! - + unique_ptr<T> m_ptr; //! }; - - -template<typename T, typename Traits> -HeterogeneousSoAImpl<T,Traits>::HeterogeneousSoAImpl(cuda::stream_t<> &stream) { - m_ptr = Traits:: template make_unique<T>(stream); +template <typename T, typename Traits> +HeterogeneousSoAImpl<T, Traits>::HeterogeneousSoAImpl(cuda::stream_t<> &stream) { + m_ptr = Traits::template make_unique<T>(stream); } - // in reality valid only for GPU version... -template<typename T, typename Traits> -cudautils::host::unique_ptr<T> -HeterogeneousSoAImpl<T,Traits>::toHostAsync(cuda::stream_t<>& stream) const { +template <typename T, typename Traits> +cudautils::host::unique_ptr<T> HeterogeneousSoAImpl<T, Traits>::toHostAsync(cuda::stream_t<> &stream) const { auto ret = cudautils::make_host_unique<T>(stream); cudaCheck(cudaMemcpyAsync(ret.get(), get(), sizeof(T), cudaMemcpyDefault, stream.id())); return ret; } - -template<typename T> -using HeterogeneousSoAGPU = HeterogeneousSoAImpl<T,cudaCompat::GPUTraits>; -template<typename T> -using HeterogeneousSoACPU = HeterogeneousSoAImpl<T,cudaCompat::CPUTraits>; -template<typename T> -using HeterogeneousSoAHost = HeterogeneousSoAImpl<T,cudaCompat::HostTraits>; - +template <typename T> +using HeterogeneousSoAGPU = HeterogeneousSoAImpl<T, cudaCompat::GPUTraits>; +template <typename T> +using HeterogeneousSoACPU = HeterogeneousSoAImpl<T, cudaCompat::CPUTraits>; +template <typename T> +using HeterogeneousSoAHost = HeterogeneousSoAImpl<T, cudaCompat::HostTraits>; #endif diff --git a/CUDADataFormats/Common/interface/HostProduct.h b/CUDADataFormats/Common/interface/HostProduct.h index cab50d402cdb5..17ad98ba403a4 100644 --- a/CUDADataFormats/Common/interface/HostProduct.h +++ b/CUDADataFormats/Common/interface/HostProduct.h @@ -4,37 +4,26 @@ #include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" // a heterogeneous unique pointer... -template<typename T> +template <typename T> class HostProduct { public: - - - HostProduct() = default; // make root happy + HostProduct() = default; // make root happy ~HostProduct() = default; HostProduct(HostProduct&&) = default; HostProduct& operator=(HostProduct&&) = default; - explicit HostProduct(cudautils::host::unique_ptr<T> && p) : hm_ptr(std::move(p)) {} - explicit HostProduct(std::unique_ptr<T> && p) : std_ptr(std::move(p)) {} + explicit HostProduct(cudautils::host::unique_ptr<T>&& p) : hm_ptr(std::move(p)) {} + explicit HostProduct(std::unique_ptr<T>&& p) : std_ptr(std::move(p)) {} + auto const* get() const { return hm_ptr ? hm_ptr.get() : std_ptr.get(); } - auto const * get() const { - return hm_ptr ? hm_ptr.get() : std_ptr.get(); - } - - auto const & operator*() const { - return *get(); - } + auto const& operator*() const { return *get(); } - auto const * operator->() const { - return get(); - } - + auto const* operator-> () const { return get(); } private: - cudautils::host::unique_ptr<T> hm_ptr; //! - std::unique_ptr<T> std_ptr; //! - + cudautils::host::unique_ptr<T> hm_ptr; //! + std::unique_ptr<T> std_ptr; //! }; #endif From 5d3f02666c1437b4a33bbe54573d46c1c5c21908 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Sat, 26 Oct 2019 13:57:43 -0500 Subject: [PATCH 306/778] Replace use of API wrapper stream and event with plain CUDA, part 1 (#389) Replace cuda::stream_t<> with cudaStream_t in client code Replace cuda::event_t with cudaEvent_t in the client code Clean up BuildFiles --- .../Common/interface/HeterogeneousSoA.h | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h index e0e537b9b5c06..9e44bfdf35969 100644 --- a/CUDADataFormats/Common/interface/HeterogeneousSoA.h +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -35,10 +35,10 @@ class HeterogeneousSoA { auto *operator-> () { return get(); } // in reality valid only for GPU version... - cudautils::host::unique_ptr<T> toHostAsync(cuda::stream_t<> &stream) const { + cudautils::host::unique_ptr<T> toHostAsync(cudaStream_t stream) const { assert(dm_ptr); auto ret = cudautils::make_host_unique<T>(stream); - cudaCheck(cudaMemcpyAsync(ret.get(), dm_ptr.get(), sizeof(T), cudaMemcpyDefault, stream.id())); + cudaCheck(cudaMemcpyAsync(ret.get(), dm_ptr.get(), sizeof(T), cudaMemcpyDefault, stream)); return ret; } @@ -56,27 +56,27 @@ namespace cudaCompat { using unique_ptr = cudautils::device::unique_ptr<T>; template <typename T> - static auto make_unique(cuda::stream_t<> &stream) { + static auto make_unique(cudaStream_t stream) { return cudautils::make_device_unique<T>(stream); } template <typename T> - static auto make_unique(size_t size, cuda::stream_t<> &stream) { + static auto make_unique(size_t size, cudaStream_t stream) { return cudautils::make_device_unique<T>(size, stream); } template <typename T> - static auto make_host_unique(cuda::stream_t<> &stream) { + static auto make_host_unique(cudaStream_t stream) { return cudautils::make_host_unique<T>(stream); } template <typename T> - static auto make_device_unique(cuda::stream_t<> &stream) { + static auto make_device_unique(cudaStream_t stream) { return cudautils::make_device_unique<T>(stream); } template <typename T> - static auto make_device_unique(size_t size, cuda::stream_t<> &stream) { + static auto make_device_unique(size_t size, cudaStream_t stream) { return cudautils::make_device_unique<T>(size, stream); } }; @@ -86,22 +86,22 @@ namespace cudaCompat { using unique_ptr = cudautils::host::unique_ptr<T>; template <typename T> - static auto make_unique(cuda::stream_t<> &stream) { + static auto make_unique(cudaStream_t stream) { return cudautils::make_host_unique<T>(stream); } template <typename T> - static auto make_host_unique(cuda::stream_t<> &stream) { + static auto make_host_unique(cudaStream_t stream) { return cudautils::make_host_unique<T>(stream); } template <typename T> - static auto make_device_unique(cuda::stream_t<> &stream) { + static auto make_device_unique(cudaStream_t stream) { return cudautils::make_device_unique<T>(stream); } template <typename T> - static auto make_device_unique(size_t size, cuda::stream_t<> &stream) { + static auto make_device_unique(size_t size, cudaStream_t stream) { return cudautils::make_device_unique<T>(size, stream); } }; @@ -111,27 +111,27 @@ namespace cudaCompat { using unique_ptr = std::unique_ptr<T>; template <typename T> - static auto make_unique(cuda::stream_t<> &) { + static auto make_unique(cudaStream_t) { return std::make_unique<T>(); } template <typename T> - static auto make_unique(size_t size, cuda::stream_t<> &) { + static auto make_unique(size_t size, cudaStream_t) { return std::make_unique<T>(size); } template <typename T> - static auto make_host_unique(cuda::stream_t<> &) { + static auto make_host_unique(cudaStream_t) { return std::make_unique<T>(); } template <typename T> - static auto make_device_unique(cuda::stream_t<> &) { + static auto make_device_unique(cudaStream_t) { return std::make_unique<T>(); } template <typename T> - static auto make_device_unique(size_t size, cuda::stream_t<> &) { + static auto make_device_unique(size_t size, cudaStream_t) { return std::make_unique<T>(size); } }; @@ -151,28 +151,28 @@ class HeterogeneousSoAImpl { HeterogeneousSoAImpl &operator=(HeterogeneousSoAImpl &&) = default; explicit HeterogeneousSoAImpl(unique_ptr<T> &&p) : m_ptr(std::move(p)) {} - explicit HeterogeneousSoAImpl(cuda::stream_t<> &stream); + explicit HeterogeneousSoAImpl(cudaStream_t stream); T const *get() const { return m_ptr.get(); } T *get() { return m_ptr.get(); } - cudautils::host::unique_ptr<T> toHostAsync(cuda::stream_t<> &stream) const; + cudautils::host::unique_ptr<T> toHostAsync(cudaStream_t stream) const; private: unique_ptr<T> m_ptr; //! }; template <typename T, typename Traits> -HeterogeneousSoAImpl<T, Traits>::HeterogeneousSoAImpl(cuda::stream_t<> &stream) { +HeterogeneousSoAImpl<T, Traits>::HeterogeneousSoAImpl(cudaStream_t stream) { m_ptr = Traits::template make_unique<T>(stream); } // in reality valid only for GPU version... template <typename T, typename Traits> -cudautils::host::unique_ptr<T> HeterogeneousSoAImpl<T, Traits>::toHostAsync(cuda::stream_t<> &stream) const { +cudautils::host::unique_ptr<T> HeterogeneousSoAImpl<T, Traits>::toHostAsync(cudaStream_t stream) const { auto ret = cudautils::make_host_unique<T>(stream); - cudaCheck(cudaMemcpyAsync(ret.get(), get(), sizeof(T), cudaMemcpyDefault, stream.id())); + cudaCheck(cudaMemcpyAsync(ret.get(), get(), sizeof(T), cudaMemcpyDefault, stream)); return ret; } From 41ef278585cfb8b4fa9b4d7c12d8844d2c85021e Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Wed, 27 Nov 2019 15:17:05 +0100 Subject: [PATCH 307/778] Drop obsolete heterogenous framework (#416) --- CUDADataFormats/Common/interface/HeterogeneousSoA.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h index 9e44bfdf35969..907b7647a3452 100644 --- a/CUDADataFormats/Common/interface/HeterogeneousSoA.h +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -1,11 +1,12 @@ #ifndef CUDADataFormatsCommonHeterogeneousSoA_H #define CUDADataFormatsCommonHeterogeneousSoA_H -#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" -#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" +#include <cassert> #include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h" #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" +#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" +#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h" // a heterogeneous unique pointer... template <typename T> From 62b09c0611da3328e2c0799b8393cf2651da8f07 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Fri, 17 Jan 2020 09:10:53 -0600 Subject: [PATCH 308/778] Implement changes from the CUDA framework review (#429) Rename the cudautils namespace to cms::cuda or cms::cudatest, and drop the CUDA prefix from the symbols defined there. Always record and query the CUDA event, to minimize need for error checking in CUDAScopedContextProduce destructor. Add comments to highlight the pieces in CachingDeviceAllocator that have been changed wrt. cub. Various other updates and clean up: - enable CUDA for compute capability 3.5. - clean up CUDAService, CUDA tests and plugins. - add CUDA existence protections to BuildFiles. - mark thread-safe static variables with CMS_THREAD_SAFE. --- .../Common/interface/HeterogeneousSoA.h | 40 +++++++++---------- .../Common/interface/HostProduct.h | 4 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h index 907b7647a3452..6fec0026dfaa1 100644 --- a/CUDADataFormats/Common/interface/HeterogeneousSoA.h +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -19,8 +19,8 @@ class HeterogeneousSoA { HeterogeneousSoA(HeterogeneousSoA &&) = default; HeterogeneousSoA &operator=(HeterogeneousSoA &&) = default; - explicit HeterogeneousSoA(cudautils::device::unique_ptr<T> &&p) : dm_ptr(std::move(p)) {} - explicit HeterogeneousSoA(cudautils::host::unique_ptr<T> &&p) : hm_ptr(std::move(p)) {} + explicit HeterogeneousSoA(cms::cuda::device::unique_ptr<T> &&p) : dm_ptr(std::move(p)) {} + explicit HeterogeneousSoA(cms::cuda::host::unique_ptr<T> &&p) : hm_ptr(std::move(p)) {} explicit HeterogeneousSoA(std::unique_ptr<T> &&p) : std_ptr(std::move(p)) {} auto const *get() const { return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); } @@ -36,17 +36,17 @@ class HeterogeneousSoA { auto *operator-> () { return get(); } // in reality valid only for GPU version... - cudautils::host::unique_ptr<T> toHostAsync(cudaStream_t stream) const { + cms::cuda::host::unique_ptr<T> toHostAsync(cudaStream_t stream) const { assert(dm_ptr); - auto ret = cudautils::make_host_unique<T>(stream); + auto ret = cms::cuda::make_host_unique<T>(stream); cudaCheck(cudaMemcpyAsync(ret.get(), dm_ptr.get(), sizeof(T), cudaMemcpyDefault, stream)); return ret; } private: // a union wan't do it, a variant will not be more efficienct - cudautils::device::unique_ptr<T> dm_ptr; //! - cudautils::host::unique_ptr<T> hm_ptr; //! + cms::cuda::device::unique_ptr<T> dm_ptr; //! + cms::cuda::host::unique_ptr<T> hm_ptr; //! std::unique_ptr<T> std_ptr; //! }; @@ -54,56 +54,56 @@ namespace cudaCompat { struct GPUTraits { template <typename T> - using unique_ptr = cudautils::device::unique_ptr<T>; + using unique_ptr = cms::cuda::device::unique_ptr<T>; template <typename T> static auto make_unique(cudaStream_t stream) { - return cudautils::make_device_unique<T>(stream); + return cms::cuda::make_device_unique<T>(stream); } template <typename T> static auto make_unique(size_t size, cudaStream_t stream) { - return cudautils::make_device_unique<T>(size, stream); + return cms::cuda::make_device_unique<T>(size, stream); } template <typename T> static auto make_host_unique(cudaStream_t stream) { - return cudautils::make_host_unique<T>(stream); + return cms::cuda::make_host_unique<T>(stream); } template <typename T> static auto make_device_unique(cudaStream_t stream) { - return cudautils::make_device_unique<T>(stream); + return cms::cuda::make_device_unique<T>(stream); } template <typename T> static auto make_device_unique(size_t size, cudaStream_t stream) { - return cudautils::make_device_unique<T>(size, stream); + return cms::cuda::make_device_unique<T>(size, stream); } }; struct HostTraits { template <typename T> - using unique_ptr = cudautils::host::unique_ptr<T>; + using unique_ptr = cms::cuda::host::unique_ptr<T>; template <typename T> static auto make_unique(cudaStream_t stream) { - return cudautils::make_host_unique<T>(stream); + return cms::cuda::make_host_unique<T>(stream); } template <typename T> static auto make_host_unique(cudaStream_t stream) { - return cudautils::make_host_unique<T>(stream); + return cms::cuda::make_host_unique<T>(stream); } template <typename T> static auto make_device_unique(cudaStream_t stream) { - return cudautils::make_device_unique<T>(stream); + return cms::cuda::make_device_unique<T>(stream); } template <typename T> static auto make_device_unique(size_t size, cudaStream_t stream) { - return cudautils::make_device_unique<T>(size, stream); + return cms::cuda::make_device_unique<T>(size, stream); } }; @@ -158,7 +158,7 @@ class HeterogeneousSoAImpl { T *get() { return m_ptr.get(); } - cudautils::host::unique_ptr<T> toHostAsync(cudaStream_t stream) const; + cms::cuda::host::unique_ptr<T> toHostAsync(cudaStream_t stream) const; private: unique_ptr<T> m_ptr; //! @@ -171,8 +171,8 @@ HeterogeneousSoAImpl<T, Traits>::HeterogeneousSoAImpl(cudaStream_t stream) { // in reality valid only for GPU version... template <typename T, typename Traits> -cudautils::host::unique_ptr<T> HeterogeneousSoAImpl<T, Traits>::toHostAsync(cudaStream_t stream) const { - auto ret = cudautils::make_host_unique<T>(stream); +cms::cuda::host::unique_ptr<T> HeterogeneousSoAImpl<T, Traits>::toHostAsync(cudaStream_t stream) const { + auto ret = cms::cuda::make_host_unique<T>(stream); cudaCheck(cudaMemcpyAsync(ret.get(), get(), sizeof(T), cudaMemcpyDefault, stream)); return ret; } diff --git a/CUDADataFormats/Common/interface/HostProduct.h b/CUDADataFormats/Common/interface/HostProduct.h index 17ad98ba403a4..aefd7b61f9781 100644 --- a/CUDADataFormats/Common/interface/HostProduct.h +++ b/CUDADataFormats/Common/interface/HostProduct.h @@ -12,7 +12,7 @@ class HostProduct { HostProduct(HostProduct&&) = default; HostProduct& operator=(HostProduct&&) = default; - explicit HostProduct(cudautils::host::unique_ptr<T>&& p) : hm_ptr(std::move(p)) {} + explicit HostProduct(cms::cuda::host::unique_ptr<T>&& p) : hm_ptr(std::move(p)) {} explicit HostProduct(std::unique_ptr<T>&& p) : std_ptr(std::move(p)) {} auto const* get() const { return hm_ptr ? hm_ptr.get() : std_ptr.get(); } @@ -22,7 +22,7 @@ class HostProduct { auto const* operator-> () const { return get(); } private: - cudautils::host::unique_ptr<T> hm_ptr; //! + cms::cuda::host::unique_ptr<T> hm_ptr; //! std::unique_ptr<T> std_ptr; //! }; From f9e4e0fbd908338103bd4b04f982613ca3ebdeea Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Wed, 25 Mar 2020 00:28:04 +0100 Subject: [PATCH 309/778] Integrate the comments from the upstream PRs (#442) Clean up the Patatrack code base following the comments received during the integration into the upstream release. Currently tracks the changes introduced due to - cms-sw#29109: Patatrack integration - trivial changes (1/N) - cms-sw#29110: Patatrack integration - common tools (2/N) List of changes: * Remove unused files * Fix compilation warnings * Fix AtomicPairCounter unit test * Rename the cudaCompat namespace to cms::cudacompat * Remove extra semicolon * Move SimpleVector and VecArray to the cms::cuda namespace * Add missing dependency * Move HistoContainer, AtomicPairCounter, prefixScan and radixSort to the cms::cuda namespace * Remove rule exception for HeterogeneousCore * Fix code rule violations: - replace using namespace cms::cuda in test/OneToManyAssoc_t.h . - add an exception for cudaCompat.h: cudaCompat relies on defining equivalent symbols to the CUDA intrinsics in the cms::cudacompat namespace, and pulling them in the global namespace when compiling device code without CUDA. * Protect the headers to compile only with a CUDA compiler --- .../Common/interface/HeterogeneousSoA.h | 184 +++++++++--------- 1 file changed, 93 insertions(+), 91 deletions(-) diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h index 6fec0026dfaa1..46a21510d0520 100644 --- a/CUDADataFormats/Common/interface/HeterogeneousSoA.h +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -50,94 +50,96 @@ class HeterogeneousSoA { std::unique_ptr<T> std_ptr; //! }; -namespace cudaCompat { - - struct GPUTraits { - template <typename T> - using unique_ptr = cms::cuda::device::unique_ptr<T>; - - template <typename T> - static auto make_unique(cudaStream_t stream) { - return cms::cuda::make_device_unique<T>(stream); - } - - template <typename T> - static auto make_unique(size_t size, cudaStream_t stream) { - return cms::cuda::make_device_unique<T>(size, stream); - } - - template <typename T> - static auto make_host_unique(cudaStream_t stream) { - return cms::cuda::make_host_unique<T>(stream); - } - - template <typename T> - static auto make_device_unique(cudaStream_t stream) { - return cms::cuda::make_device_unique<T>(stream); - } - - template <typename T> - static auto make_device_unique(size_t size, cudaStream_t stream) { - return cms::cuda::make_device_unique<T>(size, stream); - } - }; - - struct HostTraits { - template <typename T> - using unique_ptr = cms::cuda::host::unique_ptr<T>; - - template <typename T> - static auto make_unique(cudaStream_t stream) { - return cms::cuda::make_host_unique<T>(stream); - } - - template <typename T> - static auto make_host_unique(cudaStream_t stream) { - return cms::cuda::make_host_unique<T>(stream); - } - - template <typename T> - static auto make_device_unique(cudaStream_t stream) { - return cms::cuda::make_device_unique<T>(stream); - } - - template <typename T> - static auto make_device_unique(size_t size, cudaStream_t stream) { - return cms::cuda::make_device_unique<T>(size, stream); - } - }; - - struct CPUTraits { - template <typename T> - using unique_ptr = std::unique_ptr<T>; - - template <typename T> - static auto make_unique(cudaStream_t) { - return std::make_unique<T>(); - } - - template <typename T> - static auto make_unique(size_t size, cudaStream_t) { - return std::make_unique<T>(size); - } - - template <typename T> - static auto make_host_unique(cudaStream_t) { - return std::make_unique<T>(); - } - - template <typename T> - static auto make_device_unique(cudaStream_t) { - return std::make_unique<T>(); - } - - template <typename T> - static auto make_device_unique(size_t size, cudaStream_t) { - return std::make_unique<T>(size); - } - }; - -} // namespace cudaCompat +namespace cms { + namespace cudacompat { + + struct GPUTraits { + template <typename T> + using unique_ptr = cms::cuda::device::unique_ptr<T>; + + template <typename T> + static auto make_unique(cudaStream_t stream) { + return cms::cuda::make_device_unique<T>(stream); + } + + template <typename T> + static auto make_unique(size_t size, cudaStream_t stream) { + return cms::cuda::make_device_unique<T>(size, stream); + } + + template <typename T> + static auto make_host_unique(cudaStream_t stream) { + return cms::cuda::make_host_unique<T>(stream); + } + + template <typename T> + static auto make_device_unique(cudaStream_t stream) { + return cms::cuda::make_device_unique<T>(stream); + } + + template <typename T> + static auto make_device_unique(size_t size, cudaStream_t stream) { + return cms::cuda::make_device_unique<T>(size, stream); + } + }; + + struct HostTraits { + template <typename T> + using unique_ptr = cms::cuda::host::unique_ptr<T>; + + template <typename T> + static auto make_unique(cudaStream_t stream) { + return cms::cuda::make_host_unique<T>(stream); + } + + template <typename T> + static auto make_host_unique(cudaStream_t stream) { + return cms::cuda::make_host_unique<T>(stream); + } + + template <typename T> + static auto make_device_unique(cudaStream_t stream) { + return cms::cuda::make_device_unique<T>(stream); + } + + template <typename T> + static auto make_device_unique(size_t size, cudaStream_t stream) { + return cms::cuda::make_device_unique<T>(size, stream); + } + }; + + struct CPUTraits { + template <typename T> + using unique_ptr = std::unique_ptr<T>; + + template <typename T> + static auto make_unique(cudaStream_t) { + return std::make_unique<T>(); + } + + template <typename T> + static auto make_unique(size_t size, cudaStream_t) { + return std::make_unique<T>(size); + } + + template <typename T> + static auto make_host_unique(cudaStream_t) { + return std::make_unique<T>(); + } + + template <typename T> + static auto make_device_unique(cudaStream_t) { + return std::make_unique<T>(); + } + + template <typename T> + static auto make_device_unique(size_t size, cudaStream_t) { + return std::make_unique<T>(size); + } + }; + + } // namespace cudacompat +} // namespace cms // a heterogeneous unique pointer (of a different sort) ... template <typename T, typename Traits> @@ -178,10 +180,10 @@ cms::cuda::host::unique_ptr<T> HeterogeneousSoAImpl<T, Traits>::toHostAsync(cuda } template <typename T> -using HeterogeneousSoAGPU = HeterogeneousSoAImpl<T, cudaCompat::GPUTraits>; +using HeterogeneousSoAGPU = HeterogeneousSoAImpl<T, cms::cudacompat::GPUTraits>; template <typename T> -using HeterogeneousSoACPU = HeterogeneousSoAImpl<T, cudaCompat::CPUTraits>; +using HeterogeneousSoACPU = HeterogeneousSoAImpl<T, cms::cudacompat::CPUTraits>; template <typename T> -using HeterogeneousSoAHost = HeterogeneousSoAImpl<T, cudaCompat::HostTraits>; +using HeterogeneousSoAHost = HeterogeneousSoAImpl<T, cms::cudacompat::HostTraits>; #endif From 88a1751855bca00bf93e9f44fd34d4d49e38be76 Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Fri, 5 Jun 2020 08:54:56 +0200 Subject: [PATCH 310/778] Update HCAL local reconstruction on GPUs (#470) Move common ROOT dictionaries to a dedicated new package, CUDADataFormats/StdDictionaries . Remove unnecessary dictionary declarations. Determine the default module label automatically for templated and non-templated EDProducers and ESProducer, and remove the "name()" static method previously used to distinguish their template arguments. Use Event::emplace instead of Event:put where relevant. Protect the use of CUDA API calls in module constructors and destructors, checking that the CUDAService is available and enabled. Move the definition of EventSetup records to a package/library that does not define plugins. --- CUDADataFormats/StdDictionaries/BuildFile.xml | 5 +++++ CUDADataFormats/StdDictionaries/src/classes.h | 4 ++++ .../StdDictionaries/src/classes_def.xml | 14 ++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 CUDADataFormats/StdDictionaries/BuildFile.xml create mode 100644 CUDADataFormats/StdDictionaries/src/classes.h create mode 100644 CUDADataFormats/StdDictionaries/src/classes_def.xml diff --git a/CUDADataFormats/StdDictionaries/BuildFile.xml b/CUDADataFormats/StdDictionaries/BuildFile.xml new file mode 100644 index 0000000000000..0a1542b3b05c6 --- /dev/null +++ b/CUDADataFormats/StdDictionaries/BuildFile.xml @@ -0,0 +1,5 @@ +<use name="rootcore"/> +<use name="HeterogeneousCore/CUDAUtilities"/> +<export> + <lib name="1"/> +</export> diff --git a/CUDADataFormats/StdDictionaries/src/classes.h b/CUDADataFormats/StdDictionaries/src/classes.h new file mode 100644 index 0000000000000..9c4e1d810c3c2 --- /dev/null +++ b/CUDADataFormats/StdDictionaries/src/classes.h @@ -0,0 +1,4 @@ +#include <cstddef> +#include <vector> + +#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h" diff --git a/CUDADataFormats/StdDictionaries/src/classes_def.xml b/CUDADataFormats/StdDictionaries/src/classes_def.xml new file mode 100644 index 0000000000000..7060ec91efa1a --- /dev/null +++ b/CUDADataFormats/StdDictionaries/src/classes_def.xml @@ -0,0 +1,14 @@ +<lcgdict> + <class name="std::vector<std::byte, cms::cuda::HostAllocator<std::byte, 0>>" /> + + <class name="std::vector<uint8_t, cms::cuda::HostAllocator<uint8_t, 0>>" /> + <class name="std::vector<uint16_t, cms::cuda::HostAllocator<uint16_t, 0>>" /> + <class name="std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t, 0>>" /> + + <class name="std::vector<int8_t, cms::cuda::HostAllocator<int8_t, 0>>" /> + <class name="std::vector<int16_t, cms::cuda::HostAllocator<int16_t, 0>>" /> + <class name="std::vector<int32_t, cms::cuda::HostAllocator<int32_t, 0>>" /> + + <class name="std::vector<float, cms::cuda::HostAllocator<float, 0>>" /> + <class name="std::vector<double, cms::cuda::HostAllocator<double, 0>>" /> +</lcgdict> From 1fa9b32046741778e071db517e071a08cf750c2c Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Fri, 31 Jul 2020 11:29:39 +0200 Subject: [PATCH 311/778] Apply code formatting (#526) --- CUDADataFormats/Common/interface/HeterogeneousSoA.h | 4 ++-- CUDADataFormats/Common/interface/HostProduct.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CUDADataFormats/Common/interface/HeterogeneousSoA.h b/CUDADataFormats/Common/interface/HeterogeneousSoA.h index 46a21510d0520..3f2a551bc320f 100644 --- a/CUDADataFormats/Common/interface/HeterogeneousSoA.h +++ b/CUDADataFormats/Common/interface/HeterogeneousSoA.h @@ -27,13 +27,13 @@ class HeterogeneousSoA { auto const &operator*() const { return *get(); } - auto const *operator-> () const { return get(); } + auto const *operator->() const { return get(); } auto *get() { return dm_ptr ? dm_ptr.get() : (hm_ptr ? hm_ptr.get() : std_ptr.get()); } auto &operator*() { return *get(); } - auto *operator-> () { return get(); } + auto *operator->() { return get(); } // in reality valid only for GPU version... cms::cuda::host::unique_ptr<T> toHostAsync(cudaStream_t stream) const { diff --git a/CUDADataFormats/Common/interface/HostProduct.h b/CUDADataFormats/Common/interface/HostProduct.h index aefd7b61f9781..63a152298e42b 100644 --- a/CUDADataFormats/Common/interface/HostProduct.h +++ b/CUDADataFormats/Common/interface/HostProduct.h @@ -19,7 +19,7 @@ class HostProduct { auto const& operator*() const { return *get(); } - auto const* operator-> () const { return get(); } + auto const* operator->() const { return get(); } private: cms::cuda::host::unique_ptr<T> hm_ptr; //! From c39579ffb4124b7fbcc0feea930e30d5679e92d5 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 7 Oct 2020 19:10:48 +0200 Subject: [PATCH 312/778] Code check --- Geometry/HGCalCommonData/src/HGCalWaferMask.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc index 60a7f551299e6..9fba3622dbcaa 100644 --- a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc +++ b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc @@ -334,7 +334,8 @@ bool HGCalWaferMask::goodCell(int u, int v, int n, int type, int rotn) { } int HGCalWaferMask::getRotation(int zside, int type, int rotn) { - if (rotn >= HGCalTypes::WaferCornerMax) rotn = HGCalTypes::WaferCorner0; + if (rotn >= HGCalTypes::WaferCornerMax) + rotn = HGCalTypes::WaferCorner0; int newrotn(rotn); if ((zside < 0) && (type != HGCalTypes::WaferFull)) { if (type == HGCalTypes::WaferFive) { //WaferFive From 1dc1390875441c6587c14bf4c9e4e8282de6bcb3 Mon Sep 17 00:00:00 2001 From: Mikhail <Mikhail.Kirsanov@cern.ch> Date: Wed, 7 Oct 2020 19:52:52 +0200 Subject: [PATCH 313/778] remove inexistent pythia8 parameter from config --- Configuration/Generator/python/Pythia8CommonSettings_cfi.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Configuration/Generator/python/Pythia8CommonSettings_cfi.py b/Configuration/Generator/python/Pythia8CommonSettings_cfi.py index 470884e6446bd..8777667cf7f68 100644 --- a/Configuration/Generator/python/Pythia8CommonSettings_cfi.py +++ b/Configuration/Generator/python/Pythia8CommonSettings_cfi.py @@ -6,7 +6,6 @@ 'Main:timesAllowErrors = 10000', 'Check:epTolErr = 0.01', 'Beams:setProductionScalesFromLHEF = off', - 'SLHA:keepSM = on', 'SLHA:minMassSM = 1000.', 'ParticleDecays:limitTau0 = on', 'ParticleDecays:tau0Max = 10', From a94522ee51562913ad05295c0915eb291e505c74 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 7 Oct 2020 20:55:44 +0200 Subject: [PATCH 314/778] Upper case name, code streamlining --- ...eavyIonCSVTagger.h => HeavyIonCSVTagger.h} | 8 +++--- ...ESProducer.cc => HeavyIonCSVESProducer.cc} | 6 ++--- .../python/heavyIonCSVComputer_cfi.py | 2 +- ...vyIonCSVTagger.cc => HeavyIonCSVTagger.cc} | 26 ++++--------------- 4 files changed, 12 insertions(+), 30 deletions(-) rename RecoBTag/Combined/interface/{heavyIonCSVTagger.h => HeavyIonCSVTagger.h} (85%) rename RecoBTag/Combined/plugins/{heavyIonCSVESProducer.cc => HeavyIonCSVESProducer.cc} (52%) rename RecoBTag/Combined/src/{heavyIonCSVTagger.cc => HeavyIonCSVTagger.cc} (75%) diff --git a/RecoBTag/Combined/interface/heavyIonCSVTagger.h b/RecoBTag/Combined/interface/HeavyIonCSVTagger.h similarity index 85% rename from RecoBTag/Combined/interface/heavyIonCSVTagger.h rename to RecoBTag/Combined/interface/HeavyIonCSVTagger.h index e42b36b17a38a..b0360f54a19ea 100644 --- a/RecoBTag/Combined/interface/heavyIonCSVTagger.h +++ b/RecoBTag/Combined/interface/HeavyIonCSVTagger.h @@ -1,12 +1,11 @@ -#ifndef RecoBTag_Combined_heavyIonCSVTagger_h -#define RecoBTag_Combined_heavyIonCSVTagger_h +#ifndef RecoBTag_Combined_HeavyIonCSVTagger_h +#define RecoBTag_Combined_HeavyIonCSVTagger_h #include "FWCore/Framework/interface/ESConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "CommonTools/MVAUtils/interface/TMVAEvaluator.h" #include "RecoBTau/JetTagComputer/interface/JetTagComputer.h" #include "RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h" -//#include "RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h" #include "DataFormats/BTauReco/interface/TaggingVariable.h" #include "RecoBTau/JetTagComputer/interface/JetTagComputerRecord.h" @@ -27,7 +26,7 @@ class HeavyIonCSVTagger : public JetTagComputer { /// explicit ctor HeavyIonCSVTagger(const edm::ParameterSet&, Tokens); - ~HeavyIonCSVTagger() override; //{} + ~HeavyIonCSVTagger(); float discriminator(const TagInfoHelper& tagInfo) const override; void initialize(const JetTagComputerRecord& record) override; @@ -43,7 +42,6 @@ class HeavyIonCSVTagger : public JetTagComputer { private: std::unique_ptr<TMVAEvaluator> mvaID_; - //CombinedSVSoftLeptonComputer sl_computer_; CombinedSVComputer sv_computer_; std::vector<MVAVar> variables_; diff --git a/RecoBTag/Combined/plugins/heavyIonCSVESProducer.cc b/RecoBTag/Combined/plugins/HeavyIonCSVESProducer.cc similarity index 52% rename from RecoBTag/Combined/plugins/heavyIonCSVESProducer.cc rename to RecoBTag/Combined/plugins/HeavyIonCSVESProducer.cc index 4349cf10737ed..9add3528b65f4 100644 --- a/RecoBTag/Combined/plugins/heavyIonCSVESProducer.cc +++ b/RecoBTag/Combined/plugins/HeavyIonCSVESProducer.cc @@ -2,7 +2,7 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "RecoBTau/JetTagComputer/interface/JetTagComputerESProducer.h" -#include "RecoBTag/Combined/interface/heavyIonCSVTagger.h" +#include "RecoBTag/Combined/interface/HeavyIonCSVTagger.h" -typedef JetTagComputerESProducer<HeavyIonCSVTagger> heavyIonCSVESProducer; -DEFINE_FWK_EVENTSETUP_MODULE(heavyIonCSVESProducer); +typedef JetTagComputerESProducer<HeavyIonCSVTagger> HeavyIonCSVESProducer; +DEFINE_FWK_EVENTSETUP_MODULE(HeavyIonCSVESProducer); diff --git a/RecoBTag/Combined/python/heavyIonCSVComputer_cfi.py b/RecoBTag/Combined/python/heavyIonCSVComputer_cfi.py index bb45e81a5a867..d7f4b730303b5 100644 --- a/RecoBTag/Combined/python/heavyIonCSVComputer_cfi.py +++ b/RecoBTag/Combined/python/heavyIonCSVComputer_cfi.py @@ -3,7 +3,7 @@ from RecoBTag.Combined.heavyIonCSV_trainingSettings import heavyIonCSV_vpset heavyIonCSVComputer = cms.ESProducer( - 'heavyIonCSVESProducer', + 'HeavyIonCSVESProducer', sv_cfg = cms.PSet( **sv_cfg.candidateCombinedSecondaryVertexV2Computer.parameters_() ), diff --git a/RecoBTag/Combined/src/heavyIonCSVTagger.cc b/RecoBTag/Combined/src/HeavyIonCSVTagger.cc similarity index 75% rename from RecoBTag/Combined/src/heavyIonCSVTagger.cc rename to RecoBTag/Combined/src/HeavyIonCSVTagger.cc index 46288e92310b7..3acb7e5ac6ae9 100644 --- a/RecoBTag/Combined/src/heavyIonCSVTagger.cc +++ b/RecoBTag/Combined/src/HeavyIonCSVTagger.cc @@ -1,4 +1,4 @@ -#include "RecoBTag/Combined/interface/heavyIonCSVTagger.h" +#include "RecoBTag/Combined/interface/HeavyIonCSVTagger.h" #include "DataFormats/BTauReco/interface/CandIPTagInfo.h" #include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h" #include "FWCore/Utilities/interface/ESInputTag.h" @@ -17,7 +17,6 @@ HeavyIonCSVTagger::Tokens::Tokens(const edm::ParameterSet &configuration, edm::E : ""}); } } -//sl_computer_(configuration.getParameter<edm::ParameterSet>("slComputerCfg")), HeavyIonCSVTagger::HeavyIonCSVTagger(const edm::ParameterSet &configuration, Tokens tokens) : sv_computer_(configuration.getParameter<edm::ParameterSet>("sv_cfg")), mva_name_(configuration.getParameter<std::string>("mvaName")), @@ -80,26 +79,11 @@ float HeavyIonCSVTagger::discriminator(const TagInfoHelper &tagInfo) const { std::map<std::string, float> inputs; bool notTaggable = false; - bool noTrack = false; - float vtxMassVal = 0.; - - for (auto &mva_var : variables_) { - //vectorial tagging variable - if (mva_var.has_index) { - std::vector<float> vals = vars.getList(mva_var.id, false); - inputs[mva_var.name] = (vals.size() > mva_var.index) ? vals[mva_var.index] : mva_var.default_value; - if (mva_var.name == "TagVarCSV_trackSip3dSig_0" && inputs[mva_var.name] < -98.999) noTrack = true; - } - //single value tagging var - else { - inputs[mva_var.name] = vars.get(mva_var.id, mva_var.default_value); - //IK: vtxMass check to check vtxType: vtxType = 2 (no vtx), vtxMass < 0, vtxType = 1 (pseudo vtx), vtxMass > 0 - if (mva_var.name == "TagVarCSV_vertexMass") vtxMassVal = inputs[mva_var.name]; - } - } + std::vector<float> tagValList = vars.getList(reco::btau::trackSip3dSig, false); + bool noTrack = (tagValList.size() == 0); + bool noVertex = (vars.get(reco::btau::vertexCategory, -1.0) == 2); - //IK: if no reco vtx (including pseudo vtx) and no tracks passing all selections (including K0s veto) -> jet is not taggable - if (vtxMassVal < 0 && noTrack) notTaggable = true; + if (noTrack && noVertex) notTaggable = true; //get the MVA output float tag = (mvaID_->evaluate(inputs) + 1.) / 2.; From eafdff24c4a063f8d81bf9adf9d2b38c1be4a0ae Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 7 Oct 2020 22:39:31 +0200 Subject: [PATCH 315/778] loop to fill mva values restored --- RecoBTag/Combined/src/HeavyIonCSVTagger.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/RecoBTag/Combined/src/HeavyIonCSVTagger.cc b/RecoBTag/Combined/src/HeavyIonCSVTagger.cc index 3acb7e5ac6ae9..4ca43b0a457c2 100644 --- a/RecoBTag/Combined/src/HeavyIonCSVTagger.cc +++ b/RecoBTag/Combined/src/HeavyIonCSVTagger.cc @@ -83,6 +83,18 @@ float HeavyIonCSVTagger::discriminator(const TagInfoHelper &tagInfo) const { bool noTrack = (tagValList.size() == 0); bool noVertex = (vars.get(reco::btau::vertexCategory, -1.0) == 2); + for (auto &mva_var : variables_) { + //vectorial tagging variable + if (mva_var.has_index) { + std::vector<float> vals = vars.getList(mva_var.id, false); + inputs[mva_var.name] = (vals.size() > mva_var.index) ? vals[mva_var.index] : mva_var.default_value; + } + //single value tagging var + else { + inputs[mva_var.name] = vars.get(mva_var.id, mva_var.default_value); + } + } + if (noTrack && noVertex) notTaggable = true; //get the MVA output From 3f3a2f1ac7199ff82b435f8a619f88e64f7fa629 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 7 Oct 2020 22:49:47 +0200 Subject: [PATCH 316/778] code checks again --- .../Combined/interface/HeavyIonCSVTagger.h | 2 +- RecoBTag/Combined/src/HeavyIonCSVTagger.cc | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/RecoBTag/Combined/interface/HeavyIonCSVTagger.h b/RecoBTag/Combined/interface/HeavyIonCSVTagger.h index b0360f54a19ea..5bf4b53179e35 100644 --- a/RecoBTag/Combined/interface/HeavyIonCSVTagger.h +++ b/RecoBTag/Combined/interface/HeavyIonCSVTagger.h @@ -26,7 +26,7 @@ class HeavyIonCSVTagger : public JetTagComputer { /// explicit ctor HeavyIonCSVTagger(const edm::ParameterSet&, Tokens); - ~HeavyIonCSVTagger(); + ~HeavyIonCSVTagger() override; float discriminator(const TagInfoHelper& tagInfo) const override; void initialize(const JetTagComputerRecord& record) override; diff --git a/RecoBTag/Combined/src/HeavyIonCSVTagger.cc b/RecoBTag/Combined/src/HeavyIonCSVTagger.cc index 4ca43b0a457c2..08ea2795f8fc9 100644 --- a/RecoBTag/Combined/src/HeavyIonCSVTagger.cc +++ b/RecoBTag/Combined/src/HeavyIonCSVTagger.cc @@ -8,7 +8,6 @@ #include <map> #include <vector> - HeavyIonCSVTagger::Tokens::Tokens(const edm::ParameterSet &configuration, edm::ESConsumesCollector &&cc) { if (configuration.getParameter<bool>("useCondDB")) { gbrForest_ = cc.consumes(edm::ESInputTag{"", @@ -18,7 +17,7 @@ HeavyIonCSVTagger::Tokens::Tokens(const edm::ParameterSet &configuration, edm::E } } HeavyIonCSVTagger::HeavyIonCSVTagger(const edm::ParameterSet &configuration, Tokens tokens) - : sv_computer_(configuration.getParameter<edm::ParameterSet>("sv_cfg")), + : sv_computer_(configuration.getParameter<edm::ParameterSet>("sv_cfg")), mva_name_(configuration.getParameter<std::string>("mvaName")), weight_file_(configuration.getParameter<edm::FileInPath>("weightFile")), use_GBRForest_(configuration.getParameter<bool>("useGBRForest")), @@ -74,20 +73,20 @@ float HeavyIonCSVTagger::discriminator(const TagInfoHelper &tagInfo) const { const reco::TrackIPTagInfo &ip_info = tagInfo.get<reco::TrackIPTagInfo>(0); const reco::SecondaryVertexTagInfo &sv_info = tagInfo.get<reco::SecondaryVertexTagInfo>(1); reco::TaggingVariableList vars = sv_computer_(ip_info, sv_info); - + // Loop over input variables std::map<std::string, float> inputs; - + bool notTaggable = false; std::vector<float> tagValList = vars.getList(reco::btau::trackSip3dSig, false); - bool noTrack = (tagValList.size() == 0); - bool noVertex = (vars.get(reco::btau::vertexCategory, -1.0) == 2); + bool noTrack = (tagValList.empty()); + bool noVertex = (vars.get(reco::btau::vertexCategory, -1.0) == 2); for (auto &mva_var : variables_) { //vectorial tagging variable if (mva_var.has_index) { std::vector<float> vals = vars.getList(mva_var.id, false); - inputs[mva_var.name] = (vals.size() > mva_var.index) ? vals[mva_var.index] : mva_var.default_value; + inputs[mva_var.name] = (vals.size() > mva_var.index) ? vals[mva_var.index] : mva_var.default_value; } //single value tagging var else { @@ -95,12 +94,14 @@ float HeavyIonCSVTagger::discriminator(const TagInfoHelper &tagInfo) const { } } - if (noTrack && noVertex) notTaggable = true; + if (noTrack && noVertex) + notTaggable = true; //get the MVA output float tag = (mvaID_->evaluate(inputs) + 1.) / 2.; - if (notTaggable) tag = -1; + if (notTaggable) + tag = -1; return tag; } From fbff816e4da940307bd9541464506b944aa3f9b3 Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Wed, 7 Oct 2020 23:37:50 +0200 Subject: [PATCH 317/778] Fix compilation warning about usage of "const" on return value --- DataFormats/EcalDigi/interface/EcalMatacqDigi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataFormats/EcalDigi/interface/EcalMatacqDigi.h b/DataFormats/EcalDigi/interface/EcalMatacqDigi.h index 952bd894ec891..b7cbc3949cf01 100644 --- a/DataFormats/EcalDigi/interface/EcalMatacqDigi.h +++ b/DataFormats/EcalDigi/interface/EcalMatacqDigi.h @@ -50,12 +50,12 @@ class EcalMatacqDigi { /** Gets amplitude in ADC count of time sample i. i between 0 and size()-1. * Note: Amplitude is pedestal subtracted at acquisition time. */ - const float adcCount(const int& i) const { return data_[i]; } + float adcCount(const int& i) const { return data_[i]; } /** Gets amplitude in Volt of time sample i. i between 0 and size()-1. * Note: Amplitude is pedestal subtracted at acquisition time. */ - const float amplitudeV(const int& i) const { return data_[i] * lsb_; } + float amplitudeV(const int& i) const { return data_[i] * lsb_; } /** Gets Matacq electronics channel id */ From ae13142f40bb56c28ef2be8654a027f830ad8590 Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Thu, 8 Oct 2020 00:03:44 +0200 Subject: [PATCH 318/778] Cleanup the inclusion of CUDAService and other central services --- .../StandardSequences/python/Services_cff.py | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Configuration/StandardSequences/python/Services_cff.py b/Configuration/StandardSequences/python/Services_cff.py index 7b6b6c6ca35b6..0365d5f22bf51 100644 --- a/Configuration/StandardSequences/python/Services_cff.py +++ b/Configuration/StandardSequences/python/Services_cff.py @@ -1,21 +1,16 @@ -# The following comments couldn't be translated into the new config version: - -# - import FWCore.ParameterSet.Config as cms from SimGeneral.HepPDTESSource.pythiapdt_cfi import * -# Random numbers initialization service -# pick it up directly + +# random numbers initialization service from IOMC.RandomEngine.IOMC_cff import * -#an "intermediate layer" remains, just in case somebody is using it... -# from Configuration.StandardSequences.SimulationRandomNumberGeneratorSeeds_cff import * -from DQMServices.Core.DQMStore_cfg import * -# Add CUDAServices when using gpu Modifier is enabled -from Configuration.ProcessModifiers.gpu_cff import gpu -def _addCUDAServices(theProcess): - theProcess.load("HeterogeneousCore.CUDAServices.CUDAService_cfi") +# DQM store service +from DQMServices.Core.DQMStore_cfi import * -modifyConfigurationStandardSequencesServicesAddCUDAServices_ = gpu.makeProcessModifier( _addCUDAServices ) +# load CUDA services when the "gpu" modifier is enabled +def _addCUDAServices(process): + process.load("HeterogeneousCore.CUDAServices.CUDAService_cfi") +from Configuration.ProcessModifiers.gpu_cff import gpu +modifyConfigurationStandardSequencesServicesAddCUDAServices_ = gpu.makeProcessModifier(_addCUDAServices) From a04ed4af3b38d29ab34f629e9bb5b082c813b1bc Mon Sep 17 00:00:00 2001 From: Kevin Pedro <kpedro88@gmail.com> Date: Wed, 7 Oct 2020 18:35:55 -0500 Subject: [PATCH 319/778] change in batch size handling, simplify public interface --- HeterogeneousCore/SonicTriton/README.md | 16 +-- .../SonicTriton/interface/TritonClient.h | 1 + .../SonicTriton/interface/TritonData.h | 49 +++++--- .../SonicTriton/interface/triton_utils.h | 4 +- .../SonicTriton/src/TritonClient.cc | 41 +++--- .../SonicTriton/src/TritonData.cc | 117 ++++++++++++------ .../SonicTriton/src/triton_utils.cc | 2 +- .../SonicTriton/test/TritonGraphProducer.cc | 4 +- 8 files changed, 145 insertions(+), 89 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/README.md b/HeterogeneousCore/SonicTriton/README.md index 6293f2fac92bb..736c73a9a8320 100644 --- a/HeterogeneousCore/SonicTriton/README.md +++ b/HeterogeneousCore/SonicTriton/README.md @@ -23,23 +23,25 @@ The model information from the server can be printed by enabling `verbose` outpu * `modelName`: name of model with which to perform inference * `modelVersion`: version number of model (default: -1, use latest available version on server) * `batchSize`: number of objects sent per request - * can also be set on per-event basis + * can also be set on per-event basis using `setBatchSize()` * some models don't support batching * `address`: server IP address * `port`: server port -* `timeout`: maximum time a request is allowed to take - * currently not used, will be supported in next Triton version +* `timeout`: maximum allowed time for a request * `outputs`: optional, specify which output(s) the server should send Useful `TritonData` accessors include: -* `dims()`: return dimensions (provided by server) * `variableDims()`: return true if any variable dimensions * `sizeDims()`: return product of dimensions (-1 if any variable dimensions) -* `shape()`: return concrete shape (if any variable dimensions), otherwise `dims()` - * a non-`const` accessor is also provided to modify `shape()` directly (for specifying concrete values) +* `shape()`: return actual shape (list of dimensions) * `sizeShape()`: return product of shape dimensions (returns `sizeDims()` if no variable dimensions) -* `byteSize()`: return # bytes for data type +* `byteSize()`: return number of bytes for data type * `dname()`: return name of data type +* `batchSize()`: return current batch size + +To update the `TritonData` shape in the variable-dimension case: +* `setShape(const std::vector<int64_t>& newShape)`: update all (variable) dimensions with values provided in `newShape` +* `setShape(unsigned loc, int64_t val)`: update variable dimension at `loc` with `val` There are specific local input and output containers that should be used in producers. Here, `T` is a primitive type, and the two aliases listed below are passed to `TritonInputData::toServer()` diff --git a/HeterogeneousCore/SonicTriton/interface/TritonClient.h b/HeterogeneousCore/SonicTriton/interface/TritonClient.h index e5218e281166e..909dd430b40f4 100644 --- a/HeterogeneousCore/SonicTriton/interface/TritonClient.h +++ b/HeterogeneousCore/SonicTriton/interface/TritonClient.h @@ -68,3 +68,4 @@ class TritonClient : public SonicClient<TritonInputMap, TritonOutputMap> { #endif + diff --git a/HeterogeneousCore/SonicTriton/interface/TritonData.h b/HeterogeneousCore/SonicTriton/interface/TritonData.h index d2a04f419dbfe..aed74de11bb62 100644 --- a/HeterogeneousCore/SonicTriton/interface/TritonData.h +++ b/HeterogeneousCore/SonicTriton/interface/TritonData.h @@ -15,6 +15,9 @@ #include "grpc_client.h" #include "grpc_service.pb.h" +//forward declaration +class TritonClient; + //aliases for local input and output types template <typename DT> using TritonInput = std::vector<std::vector<DT>>; @@ -27,16 +30,14 @@ class TritonData { public: using Result = nvidia::inferenceserver::client::InferResult; using TensorMetadata = inference::ModelMetadataResponse_TensorMetadata; + using ShapeView = edm::Span<const int64_t*>; //constructor - TritonData(const std::string& name, const TensorMetadata& model_info); + TritonData(const std::string& name, const TensorMetadata& model_info, bool noBatch); //some members can be modified - std::vector<int64_t>& shape() { return shape_; } - void reset(); - void setBatchSize(unsigned bsize) { batchSize_ = bsize; } - void setResult(std::shared_ptr<Result> result) { result_ = result; } - IO* data() { return data_.get(); } + bool setShape(const std::vector<int64_t>& newShape) { return setShape(newShape, true); } + bool setShape(unsigned loc, int64_t val) { return setShape(loc, val, true); } //io accessors template <typename DT> @@ -45,8 +46,7 @@ class TritonData { TritonOutput<DT> fromServer() const; //const accessors - const std::vector<int64_t>& dims() const { return dims_; } - const std::vector<int64_t>& shape() const { return shape_.empty() ? dims() : shape_; } + const ShapeView& shape() const { return shape_; } int64_t byteSize() const { return byteSize_; } const std::string& dname() const { return dname_; } unsigned batchSize() const { return batchSize_; } @@ -55,29 +55,41 @@ class TritonData { bool variableDims() const { return variableDims_; } int64_t sizeDims() const { return productDims_; } //default to dims if shape isn't filled - int64_t sizeShape() const { return shape_.empty() ? sizeDims() : dimProduct(shape_); } + int64_t sizeShape() const { return variableDims_ ? dimProduct(shape_) : sizeDims(); } private: + friend class TritonClient; + + //private accessors only used by client + bool setShape(const std::vector<int64_t>& newShape, bool canThrow); + bool setShape(unsigned loc, int64_t val, bool canThrow); + void setBatchSize(unsigned bsize); + void reset(); + void setResult(std::shared_ptr<Result> result) { result_ = result; } + IO* data() { return data_.get(); } + //helpers - bool anyNeg(const std::vector<int64_t>& vec) const { + bool anyNeg(const ShapeView& vec) const { return std::any_of(vec.begin(), vec.end(), [](int64_t i) { return i < 0; }); } - int64_t dimProduct(const std::vector<int64_t>& vec) const { + int64_t dimProduct(const ShapeView& vec) const { return std::accumulate(vec.begin(), vec.end(), 1, std::multiplies<int64_t>()); } - void createObject(IO* ioptr) const; + void createObject(IO** ioptr) const; //members std::string name_; std::shared_ptr<IO> data_; - std::vector<int64_t> dims_; + const std::vector<int64_t> dims_; + bool noBatch_; + unsigned batchSize_; + std::vector<int64_t> fullShape_; + ShapeView shape_; bool variableDims_; int64_t productDims_; - inference::DataType dtype_; std::string dname_; + inference::DataType dtype_; int64_t byteSize_; - std::vector<int64_t> shape_; - unsigned batchSize_; std::any holder_; std::shared_ptr<Result> result_; }; @@ -99,9 +111,9 @@ void TritonInputData::reset(); template <> void TritonOutputData::reset(); template <> -void TritonInputData::createObject(nvidia::inferenceserver::client::InferInput* ioptr) const; +void TritonInputData::createObject(nvidia::inferenceserver::client::InferInput** ioptr) const; template <> -void TritonOutputData::createObject(nvidia::inferenceserver::client::InferRequestedOutput* ioptr) const; +void TritonOutputData::createObject(nvidia::inferenceserver::client::InferRequestedOutput** ioptr) const; //explicit template instantiation declarations extern template class TritonData<nvidia::inferenceserver::client::InferInput>; @@ -109,3 +121,4 @@ extern template class TritonData<nvidia::inferenceserver::client::InferRequested #endif + diff --git a/HeterogeneousCore/SonicTriton/interface/triton_utils.h b/HeterogeneousCore/SonicTriton/interface/triton_utils.h index 1a232f2f5828c..361334dd1df26 100644 --- a/HeterogeneousCore/SonicTriton/interface/triton_utils.h +++ b/HeterogeneousCore/SonicTriton/interface/triton_utils.h @@ -1,6 +1,8 @@ #ifndef HeterogeneousCore_SonicTriton_triton_utils #define HeterogeneousCore_SonicTriton_triton_utils +#include "FWCore/Utilities/interface/Span.h" + #include <string> #include <string_view> #include <vector> @@ -23,7 +25,7 @@ namespace triton_utils { } // namespace triton_utils -extern template std::string triton_utils::printColl(const std::vector<int64_t>& coll, const std::string& delim); +extern template std::string triton_utils::printColl(const edm::Span<const int64_t*>& coll, const std::string& delim); extern template std::string triton_utils::printColl(const std::vector<uint8_t>& coll, const std::string& delim); extern template std::string triton_utils::printColl(const std::vector<float>& coll, const std::string& delim); extern template std::string triton_utils::printColl(const std::unordered_set<std::string>& coll, diff --git a/HeterogeneousCore/SonicTriton/src/TritonClient.cc b/HeterogeneousCore/SonicTriton/src/TritonClient.cc index 61a5aac154bbf..0f6a96758d81e 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonClient.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonClient.cc @@ -39,6 +39,19 @@ TritonClient::TritonClient(const edm::ParameterSet& params) options_.model_version_ = params.getParameter<std::string>("modelVersion"); options_.client_timeout_ = params.getUntrackedParameter<unsigned>("timeout"); + //config needed for batch size + inference::ModelConfigResponse modelConfigResponse; + triton_utils::throwIfError(client_->ModelConfig(&modelConfigResponse, options_.model_name_, options_.model_version_), "TritonClient(): unable to get model config"); + inference::ModelConfig modelConfig(modelConfigResponse.config()); + + //check batch size limitations (after i/o setup) + //triton uses max batch size = 0 to denote a model that does not support batching + //but for models that do support batching, a given event may set batch size 0 to indicate no valid input is present + //so set the local max to 1 and keep track of "no batch" case + maxBatchSize_ = modelConfig.max_batch_size(); + noBatch_ = maxBatchSize_ == 0; + maxBatchSize_ = std::max(1u, maxBatchSize_); + //get model info inference::ModelMetadataResponse modelMetadata; triton_utils::throwIfError(client_->ModelMetadata(&modelMetadata, options_.model_name_, options_.model_version_), "TritonClient(): unable to get model metadata"); @@ -72,12 +85,12 @@ TritonClient::TritonClient(const edm::ParameterSet& params) for (const auto& nicInput : nicInputs) { const auto& iname = nicInput.name(); auto [curr_itr, success] = - input_.emplace(std::piecewise_construct, std::forward_as_tuple(iname), std::forward_as_tuple(iname, nicInput)); + input_.emplace(std::piecewise_construct, std::forward_as_tuple(iname), std::forward_as_tuple(iname, nicInput, noBatch_)); auto& curr_input = curr_itr->second; inputsTriton_.push_back(curr_input.data()); if (verbose_) { io_msg << " " << iname << " (" << curr_input.dname() << ", " << curr_input.byteSize() - << " b) : " << triton_utils::printColl(curr_input.dims()) << "\n"; + << " b) : " << triton_utils::printColl(curr_input.shape()) << "\n"; } } @@ -95,12 +108,12 @@ TritonClient::TritonClient(const edm::ParameterSet& params) if (!s_outputs.empty() and s_outputs.find(oname) == s_outputs.end()) continue; auto [curr_itr, success] = output_.emplace( - std::piecewise_construct, std::forward_as_tuple(oname), std::forward_as_tuple(oname, nicOutput)); + std::piecewise_construct, std::forward_as_tuple(oname), std::forward_as_tuple(oname, nicOutput, noBatch_)); auto& curr_output = curr_itr->second; outputsTriton_.push_back(curr_output.data()); if (verbose_) { io_msg << " " << oname << " (" << curr_output.dname() << ", " << curr_output.byteSize() - << " b) : " << triton_utils::printColl(curr_output.dims()) << "\n"; + << " b) : " << triton_utils::printColl(curr_output.shape()) << "\n"; } if (!s_outputs.empty()) s_outputs.erase(oname); @@ -111,20 +124,7 @@ TritonClient::TritonClient(const edm::ParameterSet& params) throw cms::Exception("MissingOutput") << "Some requested outputs were not available on the server: " << triton_utils::printColl(s_outputs); - //config needed for batch size - inference::ModelConfigResponse modelConfigResponse; - triton_utils::throwIfError(client_->ModelConfig(&modelConfigResponse, options_.model_name_, options_.model_version_), "TritonClient(): unable to get model config"); - inference::ModelConfig modelConfig(modelConfigResponse.config()); - - //check batch size limitations (after i/o setup) - //triton uses max batch size = 0 to denote a model that does not support batching - //but for models that do support batching, a given event may set batch size 0 to indicate no valid input is present - //so set the local max to 1 and keep track of "no batch" case - - maxBatchSize_ = modelConfig.max_batch_size(); - noBatch_ = maxBatchSize_ == 0; - maxBatchSize_ = std::max(1u, maxBatchSize_); - //check requested batch size + //check requested batch size and propagate to inputs and outputs setBatchSize(params.getUntrackedParameter<unsigned>("batchSize")); //print model info @@ -168,10 +168,12 @@ bool TritonClient::getResults(std::shared_ptr<nic::InferResult> results) { for (auto& [oname,output] : output_) { //set shape here before output becomes const if (output.variableDims()) { + std::vector<int64_t> tmp_shape; bool status = - triton_utils::warnIfError(results->Shape(oname, &(output.shape())), "getResults(): unable to get output shape for "+oname); + triton_utils::warnIfError(results->Shape(oname, &tmp_shape), "getResults(): unable to get output shape for "+oname); if (!status) return status; + output.setShape(tmp_shape, false); } //extend lifetime output.setResult(results); @@ -335,3 +337,4 @@ void TritonClient::fillPSetDescription(edm::ParameterSetDescription& iDesc) { iDesc.add<edm::ParameterSetDescription>("Client", descClient); } + diff --git a/HeterogeneousCore/SonicTriton/src/TritonData.cc b/HeterogeneousCore/SonicTriton/src/TritonData.cc index 50e23f135256c..df386f49e2aca 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonData.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonData.cc @@ -5,6 +5,7 @@ #include "model_config.pb.h" #include <cstring> +#include <sstream> namespace ni = nvidia::inferenceserver; namespace nic = ni::client; @@ -17,39 +18,89 @@ namespace nvidia { } // namespace inferenceserver } // namespace nvidia +//dims: kept constant, represents config.pbtxt parameters of model (converted from google::protobuf::RepeatedField to vector) +//fullShape: if batching is enabled, first entry is batch size; values can be modified +//shape: view into fullShape, excluding batch size entry template <typename IO> -TritonData<IO>::TritonData(const std::string& name, const TritonData<IO>::TensorMetadata& model_info) - : name_(name), batchSize_(0) { - //convert google::protobuf::RepeatedField to vector - const auto& dimsTmp = model_info.shape(); - dims_.assign(dimsTmp.begin(), dimsTmp.end()); - - //check if variable dimensions - variableDims_ = anyNeg(dims_); - if (variableDims_) - productDims_ = -1; - else - productDims_ = dimProduct(dims_); - - dname_ = model_info.datatype(); - dtype_ = ni::ProtocolStringToDataType(dname_); - //get byte size for input conversion - byteSize_ = ni::GetDataTypeByteSize(dtype_); - +TritonData<IO>::TritonData(const std::string& name, const TritonData<IO>::TensorMetadata& model_info, bool noBatch) + : name_(name), + dims_(model_info.shape().begin(), model_info.shape().end()), + noBatch_(noBatch), + batchSize_(0), + fullShape_(dims_), + shape_(&*(fullShape_.begin() + (noBatch_ ? 0 : 1)), &*(fullShape_.end())), + variableDims_(anyNeg(shape_)), + productDims_(variableDims_ ? -1 : dimProduct(shape_)), + dname_(model_info.datatype()), + dtype_(ni::ProtocolStringToDataType(dname_)), + byteSize_(ni::GetDataTypeByteSize(dtype_)) + { //create input or output object IO* iotmp; - createObject(iotmp); + createObject(&iotmp); data_.reset(iotmp); } template <> -void TritonInputData::createObject(nic::InferInput* ioptr) const { - nic::InferInput::Create(&ioptr, name_, shape(), dname_); +void TritonInputData::createObject(nic::InferInput** ioptr) const { + nic::InferInput::Create(ioptr, name_, fullShape_, dname_); } template <> -void TritonOutputData::createObject(nic::InferRequestedOutput* ioptr) const { - nic::InferRequestedOutput::Create(&ioptr, name_); +void TritonOutputData::createObject(nic::InferRequestedOutput** ioptr) const { + nic::InferRequestedOutput::Create(ioptr, name_); +} + +//setters +template <typename IO> +bool TritonData<IO>::setShape(const std::vector<int64_t>& newShape, bool canThrow) { + bool result = true; + for (unsigned i = 0; i < newShape.size(); ++i){ + result &= setShape(i, newShape[i], canThrow); + } + return result; +} + +template <typename IO> +bool TritonData<IO>::setShape(unsigned loc, int64_t val, bool canThrow) { + std::stringstream msg; + unsigned full_loc = loc + (noBatch_ ? 0 : 1); + + //check boundary + if (full_loc >= fullShape_.size()) { + msg << name_ << " setShape(): dimension " << full_loc << " out of bounds (" << fullShape_.size() << ")"; + if (canThrow) + throw cms::Exception("TritonDataError") << msg.str(); + else { + edm::LogWarning("TritonDataWarning") << msg.str(); + return false; + } + } + + if (val != fullShape_[full_loc]) { + if (dims_[full_loc] == -1) { + fullShape_[full_loc] = val; + return true; + } + else { + msg << name_ << " setShape(): attempt to change value of non-variable shape dimension " << loc; + if (canThrow) + throw cms::Exception("TritonDataError") << msg.str(); + else { + edm::LogWarning("TritonDataError") << msg.str(); + return false; + } + } + } + + return true; +} + +template <typename IO> +void TritonData<IO>::setBatchSize(unsigned bsize) { + batchSize_ = bsize; + if (!noBatch_) + fullShape_[0] = batchSize_; } //io accessors @@ -66,13 +117,7 @@ void TritonInputData::toServer(std::shared_ptr<TritonInput<DT>> ptr) { //shape must be specified for variable dims if (variableDims_) { - if (shape_.size() != dims_.size()) { - throw cms::Exception("TritonDataError") - << name_ << " input(): incorrect or missing shape (" << triton_utils::printColl(shape_) - << ") for model with variable dimensions (" << triton_utils::printColl(dims_) << ")"; - } else { - triton_utils::throwIfError(data_->SetShape(shape_), name_ + " input(): unable to set input shape"); - } + triton_utils::throwIfError(data_->SetShape(fullShape_), name_ + " input(): unable to set input shape"); } if (byteSize_ != sizeof(DT)) @@ -97,15 +142,6 @@ TritonOutput<DT> TritonOutputData::fromServer() const { throw cms::Exception("TritonDataError") << name_ << " output(): missing result"; } - //shape must be specified for variable dims - if (variableDims_) { - if (shape_.size() != dims_.size()) { - throw cms::Exception("TritonDataError") - << name_ << " output(): incorrect or missing shape (" << triton_utils::printColl(shape_) - << ") for model with variable dimensions (" << triton_utils::printColl(dims_) << ")"; - } - } - if (byteSize_ != sizeof(DT)) { throw cms::Exception("TritonDataError") << name_ << " output(): inconsistent byte size " << sizeof(DT) << " (should be " << byteSize_ << " for " << dname_ << ")"; @@ -135,14 +171,12 @@ TritonOutput<DT> TritonOutputData::fromServer() const { template <> void TritonInputData::reset() { - shape_.clear(); data_->Reset(); holder_.reset(); } template <> void TritonOutputData::reset() { - shape_.clear(); result_.reset(); } @@ -155,3 +189,4 @@ template void TritonInputData::toServer(std::shared_ptr<TritonInput<int64_t>> da template TritonOutput<float> TritonOutputData::fromServer() const; + diff --git a/HeterogeneousCore/SonicTriton/src/triton_utils.cc b/HeterogeneousCore/SonicTriton/src/triton_utils.cc index eaf9e734cc6be..6bf180da6f0e5 100644 --- a/HeterogeneousCore/SonicTriton/src/triton_utils.cc +++ b/HeterogeneousCore/SonicTriton/src/triton_utils.cc @@ -30,7 +30,7 @@ namespace triton_utils { } // namespace triton_utils -template std::string triton_utils::printColl(const std::vector<int64_t>& coll, const std::string& delim); +template std::string triton_utils::printColl(const edm::Span<const int64_t*>& coll, const std::string& delim); template std::string triton_utils::printColl(const std::vector<uint8_t>& coll, const std::string& delim); template std::string triton_utils::printColl(const std::vector<float>& coll, const std::string& delim); template std::string triton_utils::printColl(const std::unordered_set<std::string>& coll, const std::string& delim); diff --git a/HeterogeneousCore/SonicTriton/test/TritonGraphProducer.cc b/HeterogeneousCore/SonicTriton/test/TritonGraphProducer.cc index f2f185882a713..952a6e0bd08b1 100644 --- a/HeterogeneousCore/SonicTriton/test/TritonGraphProducer.cc +++ b/HeterogeneousCore/SonicTriton/test/TritonGraphProducer.cc @@ -33,13 +33,13 @@ class TritonGraphProducer : public SonicEDProducer<TritonClient> { //set shapes auto& input1 = iInput.at("x__0"); - input1.shape() = {nnodes, input1.dims()[1]}; + input1.setShape(0, nnodes); auto data1 = std::make_shared<TritonInput<float>>(1); auto& vdata1 = (*data1)[0]; vdata1.reserve(input1.sizeShape()); auto& input2 = iInput.at("edgeindex__1"); - input2.shape() = {input2.dims()[0], nedges}; + input2.setShape(1, nedges); auto data2 = std::make_shared<TritonInput<int64_t>>(1); auto& vdata2 = (*data2)[0]; vdata2.reserve(input2.sizeShape()); From cb57f606ec75365f6000df86752bdcaed9738e58 Mon Sep 17 00:00:00 2001 From: Kevin Pedro <kpedro88@gmail.com> Date: Wed, 7 Oct 2020 19:01:54 -0500 Subject: [PATCH 320/778] fix bugs --- HeterogeneousCore/SonicTriton/src/TritonClient.cc | 3 ++- HeterogeneousCore/SonicTriton/src/TritonData.cc | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/src/TritonClient.cc b/HeterogeneousCore/SonicTriton/src/TritonClient.cc index 0f6a96758d81e..50dca87a20836 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonClient.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonClient.cc @@ -37,7 +37,8 @@ TritonClient::TritonClient(const edm::ParameterSet& params) //set options options_.model_version_ = params.getParameter<std::string>("modelVersion"); - options_.client_timeout_ = params.getUntrackedParameter<unsigned>("timeout"); + //convert seconds to microseconds + options_.client_timeout_ = params.getUntrackedParameter<unsigned>("timeout") * 1e6; //config needed for batch size inference::ModelConfigResponse modelConfigResponse; diff --git a/HeterogeneousCore/SonicTriton/src/TritonData.cc b/HeterogeneousCore/SonicTriton/src/TritonData.cc index df386f49e2aca..0ddf632d04b0c 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonData.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonData.cc @@ -115,10 +115,8 @@ void TritonInputData::toServer(std::shared_ptr<TritonInput<DT>> ptr) { << " but specified batch size is " << batchSize_; } - //shape must be specified for variable dims - if (variableDims_) { - triton_utils::throwIfError(data_->SetShape(fullShape_), name_ + " input(): unable to set input shape"); - } + //shape must be specified for variable dims or if batch size changes + data_->SetShape(fullShape_); if (byteSize_ != sizeof(DT)) throw cms::Exception("TritonDataError") << name_ << " input(): inconsistent byte size " << sizeof(DT) From 5dac6e44b3c3ba485f72a8894566a32e54f1513e Mon Sep 17 00:00:00 2001 From: Kevin Pedro <kpedro88@gmail.com> Date: Wed, 7 Oct 2020 19:07:08 -0500 Subject: [PATCH 321/778] update HGCal unit test for new geometry --- Validation/Geometry/test/genHGCalPlots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/Geometry/test/genHGCalPlots.sh b/Validation/Geometry/test/genHGCalPlots.sh index a9dce20735a08..31a0e33d8a7b4 100755 --- a/Validation/Geometry/test/genHGCalPlots.sh +++ b/Validation/Geometry/test/genHGCalPlots.sh @@ -1,6 +1,6 @@ #!/bin/bash -ex -geom=Extended2026D62 +geom=Extended2026D71 VGEO_DIR=$CMSSW_BASE/src/Validation/Geometry TEST_DIR=${VGEO_DIR}/test/materialBudgetHGCalPlots From feb3396c94f77c7bb52bd2125fe8060567d46d21 Mon Sep 17 00:00:00 2001 From: Kevin Pedro <kpedro88@gmail.com> Date: Wed, 7 Oct 2020 19:16:25 -0500 Subject: [PATCH 322/778] code format --- .../SonicTriton/interface/TritonClient.h | 5 +- .../SonicTriton/interface/TritonData.h | 2 - .../SonicTriton/src/TritonClient.cc | 118 ++++++++++-------- .../SonicTriton/src/TritonData.cc | 13 +- 4 files changed, 70 insertions(+), 68 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/interface/TritonClient.h b/HeterogeneousCore/SonicTriton/interface/TritonClient.h index 909dd430b40f4..99ca5f8765fe7 100644 --- a/HeterogeneousCore/SonicTriton/interface/TritonClient.h +++ b/HeterogeneousCore/SonicTriton/interface/TritonClient.h @@ -47,7 +47,8 @@ class TritonClient : public SonicClient<TritonInputMap, TritonOutputMap> { void evaluate() override; void reportServerSideStats(const ServerSideStats& stats) const; - ServerSideStats summarizeServerStats(const inference::ModelStatistics& start_status, const inference::ModelStatistics& end_status) const; + ServerSideStats summarizeServerStats(const inference::ModelStatistics& start_status, + const inference::ModelStatistics& end_status) const; inference::ModelStatistics getServerSideStatus() const; @@ -67,5 +68,3 @@ class TritonClient : public SonicClient<TritonInputMap, TritonOutputMap> { }; #endif - - diff --git a/HeterogeneousCore/SonicTriton/interface/TritonData.h b/HeterogeneousCore/SonicTriton/interface/TritonData.h index aed74de11bb62..e8b678703665f 100644 --- a/HeterogeneousCore/SonicTriton/interface/TritonData.h +++ b/HeterogeneousCore/SonicTriton/interface/TritonData.h @@ -120,5 +120,3 @@ extern template class TritonData<nvidia::inferenceserver::client::InferInput>; extern template class TritonData<nvidia::inferenceserver::client::InferRequestedOutput>; #endif - - diff --git a/HeterogeneousCore/SonicTriton/src/TritonClient.cc b/HeterogeneousCore/SonicTriton/src/TritonClient.cc index 50dca87a20836..98380e6546f4d 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonClient.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonClient.cc @@ -23,15 +23,15 @@ namespace nic = ni::client; TritonClient::TritonClient(const edm::ParameterSet& params) : SonicClient(params), verbose_(params.getUntrackedParameter<bool>("verbose")), - options_(params.getParameter<std::string>("modelName")) - { + options_(params.getParameter<std::string>("modelName")) { clientName_ = "TritonClient"; //will get overwritten later, just used in constructor fullDebugName_ = clientName_; //connect to the server //TODO: add SSL options - std::string url(params.getUntrackedParameter<std::string>("address") + ":" + std::to_string(params.getUntrackedParameter<unsigned>("port"))); + std::string url(params.getUntrackedParameter<std::string>("address") + ":" + + std::to_string(params.getUntrackedParameter<unsigned>("port"))); triton_utils::throwIfError(nic::InferenceServerGrpcClient::Create(&client_, url, false), "TritonClient(): unable to create inference context"); @@ -42,7 +42,8 @@ TritonClient::TritonClient(const edm::ParameterSet& params) //config needed for batch size inference::ModelConfigResponse modelConfigResponse; - triton_utils::throwIfError(client_->ModelConfig(&modelConfigResponse, options_.model_name_, options_.model_version_), "TritonClient(): unable to get model config"); + triton_utils::throwIfError(client_->ModelConfig(&modelConfigResponse, options_.model_name_, options_.model_version_), + "TritonClient(): unable to get model config"); inference::ModelConfig modelConfig(modelConfigResponse.config()); //check batch size limitations (after i/o setup) @@ -55,7 +56,8 @@ TritonClient::TritonClient(const edm::ParameterSet& params) //get model info inference::ModelMetadataResponse modelMetadata; - triton_utils::throwIfError(client_->ModelMetadata(&modelMetadata, options_.model_name_, options_.model_version_), "TritonClient(): unable to get model metadata"); + triton_utils::throwIfError(client_->ModelMetadata(&modelMetadata, options_.model_name_, options_.model_version_), + "TritonClient(): unable to get model metadata"); //get input and output (which know their sizes) const auto& nicInputs = modelMetadata.inputs(); @@ -85,10 +87,10 @@ TritonClient::TritonClient(const edm::ParameterSet& params) inputsTriton_.reserve(nicInputs.size()); for (const auto& nicInput : nicInputs) { const auto& iname = nicInput.name(); - auto [curr_itr, success] = - input_.emplace(std::piecewise_construct, std::forward_as_tuple(iname), std::forward_as_tuple(iname, nicInput, noBatch_)); + auto [curr_itr, success] = input_.emplace( + std::piecewise_construct, std::forward_as_tuple(iname), std::forward_as_tuple(iname, nicInput, noBatch_)); auto& curr_input = curr_itr->second; - inputsTriton_.push_back(curr_input.data()); + inputsTriton_.push_back(curr_input.data()); if (verbose_) { io_msg << " " << iname << " (" << curr_input.dname() << ", " << curr_input.byteSize() << " b) : " << triton_utils::printColl(curr_input.shape()) << "\n"; @@ -166,12 +168,12 @@ void TritonClient::reset() { } bool TritonClient::getResults(std::shared_ptr<nic::InferResult> results) { - for (auto& [oname,output] : output_) { + for (auto& [oname, output] : output_) { //set shape here before output becomes const if (output.variableDims()) { std::vector<int64_t> tmp_shape; - bool status = - triton_utils::warnIfError(results->Shape(oname, &tmp_shape), "getResults(): unable to get output shape for "+oname); + bool status = triton_utils::warnIfError(results->Shape(oname, &tmp_shape), + "getResults(): unable to get output shape for " + oname); if (!status) return status; output.setShape(tmp_shape, false); @@ -198,34 +200,37 @@ void TritonClient::evaluate() { //non-blocking call auto t1 = std::chrono::high_resolution_clock::now(); bool status = triton_utils::warnIfError( - client_->AsyncInfer([t1, start_status, this](nic::InferResult* results) { - //get results - std::shared_ptr<nic::InferResult> results_ptr(results); - bool status = - triton_utils::warnIfError(results_ptr->RequestStatus(), "evaluate(): unable to get result"); - if (!status) { - finish(false); - return; - } - auto t2 = std::chrono::high_resolution_clock::now(); - - if (!debugName_.empty()) - edm::LogInfo(fullDebugName_) << "Remote time: " - << std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count(); - - const auto& end_status = getServerSideStatus(); - - if (verbose()) { - const auto& stats = summarizeServerStats(start_status, end_status); - reportServerSideStats(stats); - } - - //check result - status = getResults(results_ptr); - - //finish - finish(status); - }, options_, inputsTriton_, outputsTriton_), + client_->AsyncInfer( + [t1, start_status, this](nic::InferResult* results) { + //get results + std::shared_ptr<nic::InferResult> results_ptr(results); + bool status = triton_utils::warnIfError(results_ptr->RequestStatus(), "evaluate(): unable to get result"); + if (!status) { + finish(false); + return; + } + auto t2 = std::chrono::high_resolution_clock::now(); + + if (!debugName_.empty()) + edm::LogInfo(fullDebugName_) + << "Remote time: " << std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count(); + + const auto& end_status = getServerSideStatus(); + + if (verbose()) { + const auto& stats = summarizeServerStats(start_status, end_status); + reportServerSideStats(stats); + } + + //check result + status = getResults(results_ptr); + + //finish + finish(status); + }, + options_, + inputsTriton_, + outputsTriton_), "evaluate(): unable to launch async run"); //if AsyncRun failed, finish() wasn't called @@ -235,7 +240,8 @@ void TritonClient::evaluate() { //blocking call auto t1 = std::chrono::high_resolution_clock::now(); nic::InferResult* results; - bool status = triton_utils::warnIfError(client_->Infer(&results, options_, inputsTriton_, outputsTriton_), "evaluate(): unable to run and/or get result"); + bool status = triton_utils::warnIfError(client_->Infer(&results, options_, inputsTriton_, outputsTriton_), + "evaluate(): unable to run and/or get result"); if (!status) { finish(false); return; @@ -253,7 +259,7 @@ void TritonClient::evaluate() { reportServerSideStats(stats); } - std::shared_ptr<nic::InferResult> results_ptr(results); + std::shared_ptr<nic::InferResult> results_ptr(results); status = getResults(results_ptr); finish(status); @@ -263,7 +269,7 @@ void TritonClient::evaluate() { void TritonClient::reportServerSideStats(const TritonClient::ServerSideStats& stats) const { std::stringstream msg; - // https://github.com/triton-inference-server/server/blob/v2.3.0/src/clients/c%2B%2B/perf_client/inference_profiler.cc + // https://github.com/triton-inference-server/server/blob/v2.3.0/src/clients/c++/perf_client/inference_profiler.cc const uint64_t count = stats.success_count_; msg << " Inference count: " << stats.inference_count_ << "\n"; msg << " Execution count: " << stats.execution_count_ << "\n"; @@ -280,12 +286,12 @@ void TritonClient::reportServerSideStats(const TritonClient::ServerSideStats& st const uint64_t compute_input_avg_us = get_avg_us(stats.compute_input_time_ns_); const uint64_t compute_infer_avg_us = get_avg_us(stats.compute_infer_time_ns_); const uint64_t compute_output_avg_us = get_avg_us(stats.compute_output_time_ns_); - const uint64_t compute_avg_us = - compute_input_avg_us + compute_infer_avg_us + compute_output_avg_us; + const uint64_t compute_avg_us = compute_input_avg_us + compute_infer_avg_us + compute_output_avg_us; const uint64_t overhead = (cumm_avg_us > queue_avg_us + compute_avg_us) ? (cumm_avg_us - queue_avg_us - compute_avg_us) : 0; - msg << " Avg request latency: " << cumm_avg_us << " usec" << "\n" + msg << " Avg request latency: " << cumm_avg_us << " usec" + << "\n" << " (overhead " << overhead << " usec + " << "queue " << queue_avg_us << " usec + " << "compute input " << compute_input_avg_us << " usec + " @@ -303,12 +309,17 @@ TritonClient::ServerSideStats TritonClient::summarizeServerStats(const inference server_stats.inference_count_ = end_status.inference_count() - start_status.inference_count(); server_stats.execution_count_ = end_status.execution_count() - start_status.execution_count(); - server_stats.success_count_ = end_status.inference_stats().success().count() - start_status.inference_stats().success().count(); - server_stats.cumm_time_ns_ = end_status.inference_stats().success().ns() - start_status.inference_stats().success().ns(); + server_stats.success_count_ = + end_status.inference_stats().success().count() - start_status.inference_stats().success().count(); + server_stats.cumm_time_ns_ = + end_status.inference_stats().success().ns() - start_status.inference_stats().success().ns(); server_stats.queue_time_ns_ = end_status.inference_stats().queue().ns() - start_status.inference_stats().queue().ns(); - server_stats.compute_input_time_ns_ = end_status.inference_stats().compute_input().ns() - start_status.inference_stats().compute_input().ns(); - server_stats.compute_infer_time_ns_ = end_status.inference_stats().compute_infer().ns() - start_status.inference_stats().compute_infer().ns(); - server_stats.compute_output_time_ns_ = end_status.inference_stats().compute_output().ns() - start_status.inference_stats().compute_output().ns(); + server_stats.compute_input_time_ns_ = + end_status.inference_stats().compute_input().ns() - start_status.inference_stats().compute_input().ns(); + server_stats.compute_infer_time_ns_ = + end_status.inference_stats().compute_infer().ns() - start_status.inference_stats().compute_infer().ns(); + server_stats.compute_output_time_ns_ = + end_status.inference_stats().compute_output().ns() - start_status.inference_stats().compute_output().ns(); return server_stats; } @@ -316,8 +327,9 @@ TritonClient::ServerSideStats TritonClient::summarizeServerStats(const inference inference::ModelStatistics TritonClient::getServerSideStatus() const { if (verbose_) { inference::ModelStatisticsResponse resp; - triton_utils::warnIfError(client_->ModelInferenceStatistics(&resp, options_.model_name_, options_.model_version_), "getServerSideStatus(): unable to get model statistics"); - return *(resp.model_stats().begin()); + triton_utils::warnIfError(client_->ModelInferenceStatistics(&resp, options_.model_name_, options_.model_version_), + "getServerSideStatus(): unable to get model statistics"); + return *(resp.model_stats().begin()); } return inference::ModelStatistics{}; } @@ -337,5 +349,3 @@ void TritonClient::fillPSetDescription(edm::ParameterSetDescription& iDesc) { descClient.addUntracked<std::vector<std::string>>("outputs", {}); iDesc.add<edm::ParameterSetDescription>("Client", descClient); } - - diff --git a/HeterogeneousCore/SonicTriton/src/TritonData.cc b/HeterogeneousCore/SonicTriton/src/TritonData.cc index 0ddf632d04b0c..dd289726daa7c 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonData.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonData.cc @@ -33,8 +33,7 @@ TritonData<IO>::TritonData(const std::string& name, const TritonData<IO>::Tensor productDims_(variableDims_ ? -1 : dimProduct(shape_)), dname_(model_info.datatype()), dtype_(ni::ProtocolStringToDataType(dname_)), - byteSize_(ni::GetDataTypeByteSize(dtype_)) - { + byteSize_(ni::GetDataTypeByteSize(dtype_)) { //create input or output object IO* iotmp; createObject(&iotmp); @@ -55,7 +54,7 @@ void TritonOutputData::createObject(nic::InferRequestedOutput** ioptr) const { template <typename IO> bool TritonData<IO>::setShape(const std::vector<int64_t>& newShape, bool canThrow) { bool result = true; - for (unsigned i = 0; i < newShape.size(); ++i){ + for (unsigned i = 0; i < newShape.size(); ++i) { result &= setShape(i, newShape[i], canThrow); } return result; @@ -81,8 +80,7 @@ bool TritonData<IO>::setShape(unsigned loc, int64_t val, bool canThrow) { if (dims_[full_loc] == -1) { fullShape_[full_loc] = val; return true; - } - else { + } else { msg << name_ << " setShape(): attempt to change value of non-variable shape dimension " << loc; if (canThrow) throw cms::Exception("TritonDataError") << msg.str(); @@ -150,8 +148,7 @@ TritonOutput<DT> TritonOutputData::fromServer() const { const uint8_t* r0; size_t contentByteSize; size_t expectedContentByteSize = nOutput * byteSize_ * batchSize_; - triton_utils::throwIfError(result_->RawData(name_, &r0, &contentByteSize), - "output(): unable to get raw"); + triton_utils::throwIfError(result_->RawData(name_, &r0, &contentByteSize), "output(): unable to get raw"); if (contentByteSize != expectedContentByteSize) { throw cms::Exception("TritonDataError") << name_ << " output(): unexpected content byte size " << contentByteSize << " (expected " << expectedContentByteSize << ")"; @@ -186,5 +183,3 @@ template void TritonInputData::toServer(std::shared_ptr<TritonInput<float>> data template void TritonInputData::toServer(std::shared_ptr<TritonInput<int64_t>> data_in); template TritonOutput<float> TritonOutputData::fromServer() const; - - From b514b36f62ab2980c782b992d367a611b44506dd Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Thu, 8 Oct 2020 09:34:35 +0200 Subject: [PATCH 323/778] miscellaneous improvements --- .../scripts/submitPVResolutionJobs.py | 32 +++++++++++++++--- .../scripts/submitPVValidationJobs.py | 33 ++++++++++++------- .../test/PVResolutionExample.ini | 1 + .../test/testPVValidation_Relvals_DATA.ini | 5 +-- Alignment/OfflineValidation/test/test_all.sh | 8 +++-- 5 files changed, 60 insertions(+), 19 deletions(-) diff --git a/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py b/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py index 0ef252820d247..25a684d1c96ef 100755 --- a/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py +++ b/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py @@ -3,10 +3,19 @@ Submits per run Primary Vertex Resoltion Alignment validation using the split vertex method, usage: -python submitPVResolutionJobs.py -i PVResolutionExample.ini -D /JetHT/Run2018C-TkAlMinBias-12Nov2019_UL2018-v2/ALCARECO +submitPVResolutionJobs.py -i PVResolutionExample.ini -D /JetHT/Run2018C-TkAlMinBias-12Nov2019_UL2018-v2/ALCARECO ''' from __future__ import print_function + +__author__ = 'Marco Musich' +__copyright__ = 'Copyright 2020, CERN CMS' +__credits__ = ['Ernesto Migliore', 'Salvatore Di Guida'] +__license__ = 'Unknown' +__maintainer__ = 'Marco Musich' +__email__ = 'marco.musich@cern.ch' +__version__ = 1 + import os,sys import getopt import time @@ -16,12 +25,19 @@ import string import subprocess import pprint +import warnings from subprocess import Popen, PIPE import multiprocessing from optparse import OptionParser import os, shlex, shutil, getpass import configparser as ConfigParser +CopyRights = '##################################\n' +CopyRights += '# submitPVVResolutioJobs.py #\n' +CopyRights += '# marco.musich@cern.ch #\n' +CopyRights += '# October 2020 #\n' +CopyRights += '##################################\n' + ############################################## def get_status_output(*args, **kwargs): ############################################## @@ -147,9 +163,13 @@ def getLuminosity(homedir,minRun,maxRun,isRunBased,verbose): ############################################## def isInJSON(run,jsonfile): ############################################## - with open(jsonfile, 'rb') as myJSON: - jsonDATA = json.load(myJSON) - return (run in jsonDATA) + try: + with open(jsonfile, 'r') as myJSON: + jsonDATA = json.load(myJSON) + return (run in jsonDATA) + except: + warnings.warn('ATTENTION! Impossible to find lumi mask! All runs will be used.') + return True ####################################################### def as_dict(config): @@ -236,6 +256,9 @@ def main(): (opts, args) = parser.parse_args() + global CopyRights + print('\n'+CopyRights) + input_CMSSW_BASE = os.environ.get('CMSSW_BASE') ## prepare the eos output directory @@ -383,5 +406,6 @@ def main(): print(submissionCommand) os.system(submissionCommand) +################################################### if __name__ == "__main__": main() diff --git a/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py index 110519198052c..9cf7b200dfbc7 100755 --- a/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py +++ b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py @@ -1,13 +1,16 @@ #!/usr/bin/env python -'''Script that submits CMS Tracker Alignment Primary Vertex Validation workflows +'''Script that submits CMS Tracker Alignment Primary Vertex Validation workflows, +usage: + +submitPVValidationJobs.py -j TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i testPVValidation_Relvals_DATA.ini -r ''' from __future__ import print_function from builtins import range __author__ = 'Marco Musich' -__copyright__ = 'Copyright 2015, CERN CMS' +__copyright__ = 'Copyright 2020, CERN CMS' __credits__ = ['Ernesto Migliore', 'Salvatore Di Guida'] __license__ = 'Unknown' __maintainer__ = 'Marco Musich' @@ -26,6 +29,7 @@ from optparse import OptionParser from subprocess import Popen, PIPE import collections +import warnings import multiprocessing from enum import Enum @@ -34,7 +38,7 @@ class RefitType(Enum): COMMON = 2 CopyRights = '##################################\n' -CopyRights += '# PVValidationHTCondorSubmitter #\n' +CopyRights += '# submitPVValidationJobs.py #\n' CopyRights += '# marco.musich@cern.ch #\n' CopyRights += '# April 2020 #\n' CopyRights += '##################################\n' @@ -122,7 +126,7 @@ def getNEvents(run, dataset): return 0 if nEvents == "[]\n" else int(nEvents) ############################################## -def getLuminosity(minRun,maxRun,isRunBased,verbose): +def getLuminosity(homedir,minRun,maxRun,isRunBased,verbose): ############################################## """Expects something like +-------+------+--------+--------+-------------------+------------------+ @@ -136,8 +140,8 @@ def getLuminosity(minRun,maxRun,isRunBased,verbose): if(not isRunBased): return myCachedLumi - #output = subprocess.check_output(["/afs/cern.ch/user/m/musich/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS", "--normtag=/afs/cern.ch/user/l/lumipro/public/normtag_file/normtag_BRIL.json", "-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) - output = subprocess.check_output(["/afs/cern.ch/user/m/musich/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS","-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv","-c","web"]) + #output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS", "--normtag=/afs/cern.ch/user/l/lumipro/public/normtag_file/normtag_BRIL.json", "-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) + output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS","-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv","-c","web"]) if(verbose): print("INSIDE GET LUMINOSITY") @@ -158,9 +162,13 @@ def getLuminosity(minRun,maxRun,isRunBased,verbose): ############################################## def isInJSON(run,jsonfile): ############################################## - with open(jsonfile, 'rb') as myJSON: - jsonDATA = json.load(myJSON) - return (run in jsonDATA) + try: + with open(jsonfile, 'r') as myJSON: + jsonDATA = json.load(myJSON) + return (run in jsonDATA) + except: + warnings.warn('ATTENTION! Impossible to find lumi mask! All runs will be used.') + return True ############################################## def to_bool(value): @@ -567,6 +575,8 @@ def main(): global CopyRights print('\n'+CopyRights) + HOME = os.environ.get('HOME') + # CMSSW section input_CMSSW_BASE = os.environ.get('CMSSW_BASE') AnalysisStep_dir = os.path.join(input_CMSSW_BASE,"src/Alignment/OfflineValidation/test") @@ -841,7 +851,7 @@ def main(): if(len(myRuns)==0): raise Exception('Will not run on any run.... please check again the configuration') - myLumiDB = getLuminosity(myRuns[0],myRuns[-1],doRunBased,opts.verbose) + myLumiDB = getLuminosity(HOME,myRuns[0],myRuns[-1],doRunBased,opts.verbose) if(opts.verbose): pprint.pprint(myLumiDB) @@ -890,7 +900,7 @@ def main(): print("mylist:",mylist) inputFiles.append(mylist) myRuns.append(str(runboundary[iConf])) - myLumiDB = getLuminosity(myRuns[0],myRuns[-1],True,opts.verbose) + myLumiDB = getLuminosity(HOME,myRuns[0],myRuns[-1],True,opts.verbose) else: #pass @@ -1025,6 +1035,7 @@ def main(): fout.close() del output_file_list1 +################################################### if __name__ == "__main__": main() diff --git a/Alignment/OfflineValidation/test/PVResolutionExample.ini b/Alignment/OfflineValidation/test/PVResolutionExample.ini index afb3520952fee..b62cb860de030 100644 --- a/Alignment/OfflineValidation/test/PVResolutionExample.ini +++ b/Alignment/OfflineValidation/test/PVResolutionExample.ini @@ -1,5 +1,6 @@ # submitPVResolutionJobs.py -j UNIT_TEST -i PVResolutionExample.ini -D /JetHT/Run2018C-TkAlMinBias-12Nov2019_UL2018-v2/ALCARECO -v [Input] +# also on afs: #lumimask=/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions18/13TeV/DCSOnly/json_DCSONLY.txt lumimask=/eos/cms/store/group/comm_dqm/certification/Collisions18/13TeV/DCSOnly/json_DCSONLY.txt [Validation:Prompt] diff --git a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini index 102b225fdec3b..9387aeacd9ccf 100644 --- a/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini +++ b/Alignment/OfflineValidation/test/testPVValidation_Relvals_DATA.ini @@ -37,8 +37,9 @@ ttrhtype: WithTrackAngle applyruncontrol: True ptcut: 3. runboundary: 275657 -#/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV/DCSOnly/json_DCSONLY.txt -lumilist:/eos/cms/store/group/comm_dqm/certification/Collisions16/13TeV/DCSOnly/json_DCSONLY.txt +# also on afs +#lumilist: /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV/DCSOnly/json_DCSONLY.txt +lumilist: /eos/cms/store/group/comm_dqm/certification/Collisions16/13TeV/DCSOnly/json_DCSONLY.txt [ExtraConditions] SiPixelTemplateDBObjectRcd:frontier://FrontierProd/CMS_CONDITIONS,SiPixelTemplateDBObject_38T_2015_v3_hltvalidation diff --git a/Alignment/OfflineValidation/test/test_all.sh b/Alignment/OfflineValidation/test/test_all.sh index 790ce51685cb0..8e3b4ba4c75ac 100755 --- a/Alignment/OfflineValidation/test/test_all.sh +++ b/Alignment/OfflineValidation/test/test_all.sh @@ -154,8 +154,12 @@ EOF echo " TESTING all-in-one tool ..." validateAlignments.py -c validation_config.ini -N testingAllInOneTool --dryRun || die "Failure running all-in-one test" $? +printf "\n\n" + echo " TESTING Primary Vertex Validation run-by-run submission ..." -submitPVValidationJobs.py -j UNIT_TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i ${LOCAL_TEST_DIR}/testPVValidation_Relvals_DATA.ini -r || die "Failure running PV Validaiton run-by-run submission" $? +submitPVValidationJobs.py -j UNIT_TEST -D /HLTPhysics/Run2016C-TkAlMinBias-07Dec2018-v1/ALCARECO -i ${LOCAL_TEST_DIR}/testPVValidation_Relvals_DATA.ini -r || die "Failure running PV Validation run-by-run submission" $? + +printf "\n\n" echo " TESTING Split Vertex Validation submission ..." -submitPVResolutionJobs.py -j UNIT_TEST -D /JetHT/Run2018C-TkAlMinBias-12Nov2019_UL2018-v2/ALCARECO -i ${LOCAL_TEST_DIR}/PVResolutionExample.ini || die "Failure running Split Vertex Validaiton submission" $? +submitPVResolutionJobs.py -j UNIT_TEST -D /JetHT/Run2018C-TkAlMinBias-12Nov2019_UL2018-v2/ALCARECO -i ${LOCAL_TEST_DIR}/PVResolutionExample.ini || die "Failure running Split Vertex Validation submission" $? From d51f3d69de4fe314bf7be06deba15c05eaa03a88 Mon Sep 17 00:00:00 2001 From: Vladimir <Vladimir.Ivantchenko@cern.ch> Date: Thu, 8 Oct 2020 10:24:58 +0200 Subject: [PATCH 324/778] added parameterisation for positrons --- SimG4Core/Application/src/LowEnergyFastSimModel.cc | 14 ++++++++++---- SimG4Core/Application/src/ParametrisedEMPhysics.cc | 12 +----------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/SimG4Core/Application/src/LowEnergyFastSimModel.cc b/SimG4Core/Application/src/LowEnergyFastSimModel.cc index 73327ab36e54e..1d78de95f15f9 100644 --- a/SimG4Core/Application/src/LowEnergyFastSimModel.cc +++ b/SimG4Core/Application/src/LowEnergyFastSimModel.cc @@ -7,6 +7,9 @@ #include "G4Electron.hh" #include "GFlashHitMaker.hh" #include "G4Region.hh" +#include "G4PhysicalConstants.hh" + +constexpr double twomass = 2*CLHEP::electron_mass_c2; LowEnergyFastSimModel::LowEnergyFastSimModel(const G4String& name, G4Region* region, const edm::ParameterSet& parSet) : G4VFastSimulationModel(name, region), @@ -14,7 +17,7 @@ LowEnergyFastSimModel::LowEnergyFastSimModel(const G4String& name, G4Region* reg fRegion(region) {} G4bool LowEnergyFastSimModel::IsApplicable(const G4ParticleDefinition& particle) { - return &particle == G4Electron::Definition(); + return (11 == std::abs(particle.GetPDGEncoding())); } G4bool LowEnergyFastSimModel::ModelTrigger(const G4FastTrack& fastTrack) { @@ -25,13 +28,16 @@ G4bool LowEnergyFastSimModel::ModelTrigger(const G4FastTrack& fastTrack) { void LowEnergyFastSimModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastStep) { fastStep.KillPrimaryTrack(); fastStep.SetPrimaryTrackPathLength(0.0); - fastStep.SetTotalEnergyDeposited(fastTrack.GetPrimaryTrack()->GetKineticEnergy()); + double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy(); - const G4double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy(); const G4ThreeVector& pos = fastTrack.GetPrimaryTrack()->GetPosition(); G4double inPointEnergy = param.GetInPointEnergyFraction(energy) * energy; + // take into account positron annihilation + if(-11 == fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding()) + energy += twomass; + const G4ThreeVector& momDir = fastTrack.GetPrimaryTrack()->GetMomentumDirection(); const G4ThreeVector& ortho = momDir.orthogonal(); const G4ThreeVector& cross = momDir.cross(ortho); @@ -45,6 +51,7 @@ void LowEnergyFastSimModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastS // tail energy deposition G4double etail = energy - inPointEnergy; const G4int nspots = int(etail) + 1; + const G4double tailEnergy = etail / nspots; for (G4int i = 0; i < nspots; ++i) { const G4double radius = param.GetRadius(energy); const G4double z = param.GetZ(); @@ -52,7 +59,6 @@ void LowEnergyFastSimModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastS const G4double phi = CLHEP::twopi * G4UniformRand(); const G4ThreeVector tailPos = pos + z * momDir + radius * std::cos(phi) * ortho + radius * std::sin(phi) * cross; - const G4double tailEnergy = etail / nspots; spot.SetEnergy(tailEnergy); spot.SetPosition(tailPos); diff --git a/SimG4Core/Application/src/ParametrisedEMPhysics.cc b/SimG4Core/Application/src/ParametrisedEMPhysics.cc index 371c6ae3fed2c..9c25252e3a08c 100644 --- a/SimG4Core/Application/src/ParametrisedEMPhysics.cc +++ b/SimG4Core/Application/src/ParametrisedEMPhysics.cc @@ -122,17 +122,8 @@ void ParametrisedEMPhysics::ConstructParticle() { G4LeptonConstructor pLeptonConstructor; pLeptonConstructor.ConstructParticle(); - G4MesonConstructor pMesonConstructor; - pMesonConstructor.ConstructParticle(); - G4BaryonConstructor pBaryonConstructor; pBaryonConstructor.ConstructParticle(); - - G4ShortLivedConstructor pShortLivedConstructor; - pShortLivedConstructor.ConstructParticle(); - - G4IonConstructor pConstructor; - pConstructor.ConstructParticle(); } void ParametrisedEMPhysics::ConstructProcess() { @@ -160,6 +151,7 @@ void ParametrisedEMPhysics::ConstructProcess() { G4Positron::Positron()->GetProcessManager()->AddDiscreteProcess(m_tpmod->theFastSimulationManagerProcess.get()); } else if (lowEnergyGem) { G4Electron::Electron()->GetProcessManager()->AddDiscreteProcess(m_tpmod->theFastSimulationManagerProcess.get()); + G4Positron::Positron()->GetProcessManager()->AddDiscreteProcess(m_tpmod->theFastSimulationManagerProcess.get()); } if (gemHad || ghadHad) { @@ -319,8 +311,6 @@ void ParametrisedEMPhysics::ConstructProcess() { double th2 = theParSet.getUntrackedParameter<double>("ThresholdImportantEnergy") * MeV; int nt = theParSet.getUntrackedParameter<int>("ThresholdTrials"); ModifyTransportation(G4Electron::Electron(), nt, th1, th2); - ModifyTransportation(G4Positron::Positron(), nt, th1, th2); - ModifyTransportation(G4Proton::Proton(), nt, th1, th2); } edm::LogVerbatim("SimG4CoreApplication") << "ParametrisedEMPhysics::ConstructProcess() is done"; } From 1e0bf62fc37aff0b013198eb0b2d21e8e9282089 Mon Sep 17 00:00:00 2001 From: Vladimir <Vladimir.Ivantchenko@cern.ch> Date: Thu, 8 Oct 2020 10:27:16 +0200 Subject: [PATCH 325/778] improved comments --- SimG4Core/Application/src/LowEnergyFastSimModel.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SimG4Core/Application/src/LowEnergyFastSimModel.cc b/SimG4Core/Application/src/LowEnergyFastSimModel.cc index 1d78de95f15f9..3bdbe03727fbc 100644 --- a/SimG4Core/Application/src/LowEnergyFastSimModel.cc +++ b/SimG4Core/Application/src/LowEnergyFastSimModel.cc @@ -34,7 +34,7 @@ void LowEnergyFastSimModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastS G4double inPointEnergy = param.GetInPointEnergyFraction(energy) * energy; - // take into account positron annihilation + // take into account positron annihilation (not included in in-point) if(-11 == fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding()) energy += twomass; @@ -51,7 +51,7 @@ void LowEnergyFastSimModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastS // tail energy deposition G4double etail = energy - inPointEnergy; const G4int nspots = int(etail) + 1; - const G4double tailEnergy = etail / nspots; + const G4double tailEnergy = etail / (G4double)nspots; for (G4int i = 0; i < nspots; ++i) { const G4double radius = param.GetRadius(energy); const G4double z = param.GetZ(); From 5281b6013b4fc06d1ca1b2cf77b53167771f41d4 Mon Sep 17 00:00:00 2001 From: Vladimir <Vladimir.Ivantchenko@cern.ch> Date: Thu, 8 Oct 2020 10:28:30 +0200 Subject: [PATCH 326/778] code format --- SimG4Core/Application/src/LowEnergyFastSimModel.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SimG4Core/Application/src/LowEnergyFastSimModel.cc b/SimG4Core/Application/src/LowEnergyFastSimModel.cc index 3bdbe03727fbc..ef15c4a228cd2 100644 --- a/SimG4Core/Application/src/LowEnergyFastSimModel.cc +++ b/SimG4Core/Application/src/LowEnergyFastSimModel.cc @@ -9,7 +9,7 @@ #include "G4Region.hh" #include "G4PhysicalConstants.hh" -constexpr double twomass = 2*CLHEP::electron_mass_c2; +constexpr double twomass = 2 * CLHEP::electron_mass_c2; LowEnergyFastSimModel::LowEnergyFastSimModel(const G4String& name, G4Region* region, const edm::ParameterSet& parSet) : G4VFastSimulationModel(name, region), @@ -35,8 +35,8 @@ void LowEnergyFastSimModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastS G4double inPointEnergy = param.GetInPointEnergyFraction(energy) * energy; // take into account positron annihilation (not included in in-point) - if(-11 == fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding()) - energy += twomass; + if (-11 == fastTrack.GetPrimaryTrack()->GetDefinition()->GetPDGEncoding()) + energy += twomass; const G4ThreeVector& momDir = fastTrack.GetPrimaryTrack()->GetMomentumDirection(); const G4ThreeVector& ortho = momDir.orthogonal(); @@ -59,7 +59,6 @@ void LowEnergyFastSimModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastS const G4double phi = CLHEP::twopi * G4UniformRand(); const G4ThreeVector tailPos = pos + z * momDir + radius * std::cos(phi) * ortho + radius * std::sin(phi) * cross; - spot.SetEnergy(tailEnergy); spot.SetPosition(tailPos); fHitMaker.make(&spot, &fastTrack); From 776490a34c4e5a059b4700a07f222c1fa21dfb97 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti <fabio.cossutti@ts.infn.it> Date: Wed, 7 Oct 2020 11:03:23 +0200 Subject: [PATCH 327/778] Add ETL v5, move v4 and v5 into D72 and D73, deprecate D53 --- Configuration/Geometry/README.md | 4 +- .../python/GeometryExtended2026D72Reco_cff.py | 60 + .../python/GeometryExtended2026D72_cff.py | 13 + .../python/GeometryExtended2026D73Reco_cff.py | 60 + .../python/GeometryExtended2026D73_cff.py | 13 + .../Geometry/python/dict2026Geometry.py | 33 +- .../StandardSequences/python/GeometryConf.py | 3 +- .../dd4hep/cmsExtendedGeometry2026D72.xml | 125 + .../dd4hep/cmsExtendedGeometry2026D73.xml | 125 + .../cmsExtendedGeometry2026D72XML_cfi.py | 129 + .../cmsExtendedGeometry2026D73XML_cfi.py | 129 + Geometry/MTDCommonData/data/etl/v5/etl.xml | 3353 +++++++++++++++++ .../mtdParameters/v3/mtdStructureTopology.xml | 30 + .../MTDCommonData/interface/MTDTopologyMode.h | 2 +- .../MTDCommonData/src/ETLNumberingScheme.cc | 2 +- Geometry/MTDCommonData/src/MTDTopologyMode.cc | 2 + 16 files changed, 4077 insertions(+), 6 deletions(-) create mode 100644 Configuration/Geometry/python/GeometryExtended2026D72Reco_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D72_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D73Reco_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D73_cff.py create mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D72.xml create mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D73.xml create mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D72XML_cfi.py create mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D73XML_cfi.py create mode 100644 Geometry/MTDCommonData/data/etl/v5/etl.xml create mode 100644 Geometry/MTDCommonData/data/mtdParameters/v3/mtdStructureTopology.xml diff --git a/Configuration/Geometry/README.md b/Configuration/Geometry/README.md index 00d6f57f44408..13ce00ac4a90d 100644 --- a/Configuration/Geometry/README.md +++ b/Configuration/Geometry/README.md @@ -58,6 +58,7 @@ Fast Timing system: * I10: Fast Timing detector (LYSO barrel (bars along phi flat), silicon endcap), w/ passive materials, ETL in position defined in O4, material adjustments * I11: Same as I10, xml reorganized, comparison base for new ETL and DD4hep migration * I12: Starting from I11, new ETL layout from MTD TDR +* I13: Starting from I11, new ETL layout from post MTD TDR (2 sectors per disc face) The script also handles the common and forward elements of the geometry: * O4: detailed cavern description, changes for modified CALO region for endcap part, no overlaps inside the Muon System @@ -73,7 +74,6 @@ The script also handles the common and forward elements of the geometry: Several detector combinations have been generated: * D49 = T15+C9+M4+I10+O4+F2 * D50 = T15+C9+M4+I11+O4+F2 -* D53 = T15+C9+M4+I12+O4+F2 * D60 = T15+C10+M4+I10+O4+F3 * D64 = T22+C11+M4+I11+O5+F4 * D65 = T23+C11+M4+I11+O5+F4 @@ -83,5 +83,7 @@ Several detector combinations have been generated: * D69 = T21+C12+M6+I11+O5+F5 * D70 = T21+C13+M7+I11+O6+F6 * D71 = T21+C14+M7+I11+O7+F6 +* D72 = T21+C11+M6+I12+O5+F4 +* D73 = T21+C11+M6+I13+O5+F4 D49 is the HLT TDR baseline. diff --git a/Configuration/Geometry/python/GeometryExtended2026D72Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D72Reco_cff.py new file mode 100644 index 0000000000000..ecec6f15dc219 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D72Reco_cff.py @@ -0,0 +1,60 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Configuration.Geometry.GeometryExtended2026D72_cff import * + +# tracker +from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * +from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * +from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * +from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * +trackerGeometry.applyAlignment = cms.bool(False) + +# calo +from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "TOWER", + "HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive" + ) +) +from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * +from Geometry.EcalMapping.EcalMapping_cfi import * +from Geometry.EcalMapping.EcalMappingRecord_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# timing +from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * +from Geometry.MTDGeometryBuilder.mtdParameters_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * +from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * +from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * +from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * +mtdGeometry.applyAlignment = cms.bool(False) + diff --git a/Configuration/Geometry/python/GeometryExtended2026D72_cff.py b/Configuration/Geometry/python/GeometryExtended2026D72_cff.py new file mode 100644 index 0000000000000..3514fcab176a3 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D72_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Geometry.CMSCommonData.cmsExtendedGeometry2026D72XML_cfi import * +from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.EcalCommonData.ecalSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * +from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2026D73Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D73Reco_cff.py new file mode 100644 index 0000000000000..da47300decc90 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D73Reco_cff.py @@ -0,0 +1,60 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Configuration.Geometry.GeometryExtended2026D73_cff import * + +# tracker +from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * +from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * +from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * +from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * +trackerGeometry.applyAlignment = cms.bool(False) + +# calo +from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "TOWER", + "HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive" + ) +) +from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * +from Geometry.EcalMapping.EcalMapping_cfi import * +from Geometry.EcalMapping.EcalMappingRecord_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.me0Geometry_cfi import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# timing +from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * +from Geometry.MTDGeometryBuilder.mtdParameters_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * +from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * +from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * +from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * +mtdGeometry.applyAlignment = cms.bool(False) + diff --git a/Configuration/Geometry/python/GeometryExtended2026D73_cff.py b/Configuration/Geometry/python/GeometryExtended2026D73_cff.py new file mode 100644 index 0000000000000..bdcba9a84e0cb --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D73_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Geometry.CMSCommonData.cmsExtendedGeometry2026D73XML_cfi import * +from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.EcalCommonData.ecalSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * +from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index 4dbab6c32cb80..3f399daef8d58 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -1188,6 +1188,34 @@ ], "era" : "phase2_timing, phase2_timing_layer", }, + "I13" : { + 1 : [ + 'Geometry/MTDCommonData/data/mtdMaterial/v2/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v5/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v3/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml', + ], + 3 : [ + 'Geometry/MTDSimData/data/v2/mtdsens.xml' + ], + 4 : [ + 'Geometry/MTDSimData/data/v2/mtdProdCuts.xml' + ], + "sim" : [ + 'from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import *', + ], + "reco" :[ + 'from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import *', + 'from Geometry.MTDGeometryBuilder.mtdParameters_cff import *', + 'from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import *', + 'from Geometry.MTDNumberingBuilder.mtdTopology_cfi import *', + 'from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import *', + 'from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import *', + 'mtdGeometry.applyAlignment = cms.bool(False)' + ], + "era" : "phase2_timing, phase2_timing_layer", + }, } allDicts = [ commonDict, trackerDict, caloDict, muonDict, forwardDict, timingDict ] @@ -1195,7 +1223,6 @@ detectorVersionDict = { ("O4","T15","C9","M4","F2","I10") : "D49", ("O4","T15","C9","M4","F2","I11") : "D50", - ("O4","T15","C9","M4","F2","I12") : "D53", ("O4","T15","C10","M4","F3","I10") : "D60", ("O5","T22","C11","M4","F4","I11") : "D64", ("O5","T23","C11","M4","F4","I11") : "D65", @@ -1205,7 +1232,9 @@ ("O5","T21","C12","M6","F5","I11") : "D69", ("O6","T21","C13","M7","F6","I11") : "D70", ("O7","T21","C14","M7","F6","I11") : "D71", + ("O5","T21","C11","M6","F4","I12") : "D72", + ("O5","T21","C11","M6","F4","I13") : "D73", } -deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D51", "D52", "D54", "D55", "D56", "D57", "D58", "D59", "D61", "D62", "D63" ]) +deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D51", "D52", "D53", "D54", "D55", "D56", "D57", "D58", "D59", "D61", "D62", "D63" ]) deprecatedSubdets = set([ "T1", "T2" ,"T3", "T4", "T5", "T6", "T7", "T8", "T9", "T10", "T11", "T12", "T13", "T14", "T16", "T17", "T18", "T19", "T20", "C1", "C2", "C3", "C5", "C7", "M1", "I1", "I2", "I3", "I4", "I6", "I8", "O1", "F1", "C4", "C6", "C8", "M2", "M3", "I5", "I7", "I9", "O2", "O3", "M5" ]) diff --git a/Configuration/StandardSequences/python/GeometryConf.py b/Configuration/StandardSequences/python/GeometryConf.py index 4e8c6777eecbb..141e692b3587e 100644 --- a/Configuration/StandardSequences/python/GeometryConf.py +++ b/Configuration/StandardSequences/python/GeometryConf.py @@ -33,7 +33,6 @@ 'HCal' : 'Configuration.Geometry.GeometrySimHCAL_cff,Configuration.Geometry.GeometryRecoHCAL_cff', 'Extended2026D49' : 'Extended2026D49,Extended2026D49Reco', 'Extended2026D50' : 'Extended2026D50,Extended2026D50Reco', - 'Extended2026D53' : 'Extended2026D53,Extended2026D53Reco', 'Extended2026D60' : 'Extended2026D60,Extended2026D60Reco', 'Extended2026D64' : 'Extended2026D64,Extended2026D64Reco', 'Extended2026D65' : 'Extended2026D65,Extended2026D65Reco', @@ -43,4 +42,6 @@ 'Extended2026D69' : 'Extended2026D69,Extended2026D69Reco', 'Extended2026D70' : 'Extended2026D70,Extended2026D70Reco', 'Extended2026D71' : 'Extended2026D71,Extended2026D71Reco', + 'Extended2026D72' : 'Extended2026D72,Extended2026D72Reco', + 'Extended2026D73' : 'Extended2026D73,Extended2026D73Reco', } diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D72.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D72.xml new file mode 100644 index 0000000000000..a888757fae6f8 --- /dev/null +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D72.xml @@ -0,0 +1,125 @@ +<?xml version="1.0"?> +<DDDefinition> + <open_geometry/> + <close_geometry/> + + <IncludeSection> + <Include ref='Geometry/CMSCommonData/data/materials/2021/v1/materials.xml'/> + <Include ref='Geometry/CMSCommonData/data/rotations.xml'/> + <Include ref='Geometry/CMSCommonData/data/extend/v2/cmsextent.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml'/> + <Include ref='Geometry/CMSCommonData/data/cms/2026/v4/cms.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMother.xml'/> + <Include ref='Geometry/CMSCommonData/data/eta3/etaMax.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsTracker.xml'/> + <Include ref='Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsCalo.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMuon.xml'/> + <Include ref='Geometry/CMSCommonData/data/mgnt.xml'/> + <Include ref='Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMB.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMagnet.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'/> + <Include ref='Geometry/TrackerCommonData/data/pixfwdCommon.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/trackermaterial.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml'/> + <Include ref='Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml'/> + <Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml'/> + <Include ref='Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebcon.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebrot.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalrotations.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalbarrelalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalouteralgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalforwardalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/mf/2026/v5/mf.xml'/> + <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> + <Include ref='Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml'/> + <Include ref='Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml'/> + <Include ref='Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml'/> + <Include ref='Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/PostLS2/brm.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcmaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumimaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumirotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdc.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdclumi.xml'/> + <Include ref='Geometry/ForwardCommonData/data/cmszdc.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdMaterial/v2/mtdMaterial.xml'/> + <Include ref='Geometry/MTDCommonData/data/btl/v1/btl.xml'/> + <Include ref='Geometry/MTDCommonData/data/etl/v4/etl.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v2/mtdStructureTopology.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml'/> + <Include ref='Geometry/EcalSimData/data/PhaseII/ecalsens.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml'/> + <Include ref='Geometry/HcalSimData/data/hf.xml'/> + <Include ref='Geometry/HcalSimData/data/hfpmt.xml'/> + <Include ref='Geometry/HcalSimData/data/hffibrebundle.xml'/> + <Include ref='Geometry/HcalSimData/data/CaloUtil.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcsensv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml'/> + <Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecs.xml'/> + <Include ref='Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmsens.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcsens.xml'/> + <Include ref='Geometry/MTDSimData/data/v2/mtdsens.xml'/> + <Include ref='Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml'/> + <Include ref='Geometry/EcalSimData/data/EcalProdCuts.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcProdCutsv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml'/> + <Include ref='Geometry/MTDSimData/data/v2/mtdProdCuts.xml'/> + <Include ref='Geometry/CMSCommonData/data/FieldParameters.xml'/> + </IncludeSection> +</DDDefinition> diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D73.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D73.xml new file mode 100644 index 0000000000000..ae66188cad873 --- /dev/null +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D73.xml @@ -0,0 +1,125 @@ +<?xml version="1.0"?> +<DDDefinition> + <open_geometry/> + <close_geometry/> + + <IncludeSection> + <Include ref='Geometry/CMSCommonData/data/materials/2021/v1/materials.xml'/> + <Include ref='Geometry/CMSCommonData/data/rotations.xml'/> + <Include ref='Geometry/CMSCommonData/data/extend/v2/cmsextent.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml'/> + <Include ref='Geometry/CMSCommonData/data/cms/2026/v4/cms.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMother.xml'/> + <Include ref='Geometry/CMSCommonData/data/eta3/etaMax.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsTracker.xml'/> + <Include ref='Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsCalo.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMuon.xml'/> + <Include ref='Geometry/CMSCommonData/data/mgnt.xml'/> + <Include ref='Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMB.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMagnet.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'/> + <Include ref='Geometry/TrackerCommonData/data/pixfwdCommon.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/trackermaterial.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml'/> + <Include ref='Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml'/> + <Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml'/> + <Include ref='Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebcon.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebrot.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalrotations.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalbarrelalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalouteralgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalforwardalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/mf/2026/v5/mf.xml'/> + <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> + <Include ref='Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml'/> + <Include ref='Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml'/> + <Include ref='Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml'/> + <Include ref='Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/PostLS2/brm.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcmaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumimaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumirotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdc.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdclumi.xml'/> + <Include ref='Geometry/ForwardCommonData/data/cmszdc.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdMaterial/v2/mtdMaterial.xml'/> + <Include ref='Geometry/MTDCommonData/data/btl/v1/btl.xml'/> + <Include ref='Geometry/MTDCommonData/data/etl/v5/etl.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v3/mtdStructureTopology.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml'/> + <Include ref='Geometry/EcalSimData/data/PhaseII/ecalsens.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml'/> + <Include ref='Geometry/HcalSimData/data/hf.xml'/> + <Include ref='Geometry/HcalSimData/data/hfpmt.xml'/> + <Include ref='Geometry/HcalSimData/data/hffibrebundle.xml'/> + <Include ref='Geometry/HcalSimData/data/CaloUtil.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcsensv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml'/> + <Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecs.xml'/> + <Include ref='Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmsens.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcsens.xml'/> + <Include ref='Geometry/MTDSimData/data/v2/mtdsens.xml'/> + <Include ref='Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml'/> + <Include ref='Geometry/EcalSimData/data/EcalProdCuts.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcProdCutsv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml'/> + <Include ref='Geometry/MTDSimData/data/v2/mtdProdCuts.xml'/> + <Include ref='Geometry/CMSCommonData/data/FieldParameters.xml'/> + </IncludeSection> +</DDDefinition> diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D72XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D72XML_cfi.py new file mode 100644 index 0000000000000..651c09ab6b86c --- /dev/null +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D72XML_cfi.py @@ -0,0 +1,129 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v4/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v5/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', + 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v2/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v4/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v2/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v2/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v2/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D73XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D73XML_cfi.py new file mode 100644 index 0000000000000..49853ad7d5b89 --- /dev/null +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D73XML_cfi.py @@ -0,0 +1,129 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v4/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v3/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v4/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v2/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v12/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v12/hgcalCons.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v5/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Dev/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v1/mfshield.xml', + 'Geometry/MuonCommonData/data/me0/TDR_Dev/v3/me0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v2/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/PostLS2/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v2/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v5/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v3/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v2/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v1/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/MuonSimData/data/PhaseII/ME0EtaPart/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v2/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v2/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) diff --git a/Geometry/MTDCommonData/data/etl/v5/etl.xml b/Geometry/MTDCommonData/data/etl/v5/etl.xml new file mode 100644 index 0000000000000..717e3bcd1d51c --- /dev/null +++ b/Geometry/MTDCommonData/data/etl/v5/etl.xml @@ -0,0 +1,3353 @@ +<?xml version="1.0"?> +<DDDefinition xmlns="http://www.cern.ch/mms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/mms/DDL ../../../../DetectorDescription/Schema/DDLSchema.xsd"> + + <!-- Unit of measurement: mm --> + <ConstantsSection label="etl.xml" eval="true/false"> + <Constant name="ETLthickness" value="([caloBase:Zpos110]-[caloBase:Zpos100])-0.4*mm"/> + <Constant name="ETLcenter" value="0.5*([caloBase:Zpos110]+[caloBase:Zpos100])"/> + <Constant name="Disc1center" value="3000.42*mm+0.2*mm"/> + <Constant name="Disc2center" value="3030.42*mm+0.2*mm"/> + <Constant name="ETLrmin" value="[caloBase:Rmin100]"/> + <Constant name="ETLrmax" value="[caloBase:Rmax100]"/> + <Constant name="Disc_thickness" value="27.9"/> + <Constant name="Al_Disc_thickness" value="7.24"/> + <Constant name="Disc_Rmin" value="310"/> + <Constant name="Disc_Rmax" value="1190"/> + <Constant name="DeltaY" value="0.5"/> + <Constant name="ServiceHybrid_X" value="34"/> + <Constant name="ServiceHybrid_Y3" value="3*[SensorModule_Y]"/> + <Constant name="ServiceHybrid_Y6" value="6*[SensorModule_Y]"/> + <Constant name="ServiceHybrid_Y7" value="7*[SensorModule_Y]"/> + <Constant name="ServiceHybrid_Z" value="10.33"/> + <Constant name="SensorModule_X" value="25.85"/> <!-- 28.25mm - 2.4mm overlapping with SH --> + <Constant name="SensorModule_Y" value="43.1"/> + <Constant name="SensorModule_Z" value="2.29"/> + <Constant name="DeltaX_ServiceModule" value="29.925"/> <!-- ServiceHybrid_X/2 + SensorModule_X/2 --> + <Constant name="DeltaY_Service3_Service6" value="194.45"/> <!-- DeltaY + ServiceHybrid_Y3/2 + ServiceHybrid_Y6/2 --> + <Constant name="DeltaY_Service3_Service7" value="216"/> <!-- DeltaY + ServiceHybrid_Y3/2 + ServiceHybrid_Y7/2 --> + <Constant name="DeltaY_Service6_Service7" value="280.65"/> <!-- DeltaY + ServiceHybrid_Y6/2 + ServiceHybrid_Y7/2 --> + <Constant name="LGADdx" value="21.2"/> + <Constant name="LGADdy" value="42"/> + <Constant name="EModule_Timingactive" value="0.05"/> + <Constant name="LGAD_Substrate" value="0.25"/> + <Constant name="LGADdz" value="0.3"/> + <Constant name="lgadSep_X" value="0.25"/> + <Constant name="lgadSep_Y" value="0.5"/> + <Constant name="ETROCdx" value="22.3"/> + <Constant name="ETROCdy" value="20.8"/> + <Constant name="ETROCdz" value="0.25"/> + <Constant name="etrocSep_X" value="0.3"/> + <Constant name="etrocSep_Y" value="0.1"/> + <Constant name="x_start_front" value="1190-33.05-[SensorModule_X]/2"/> + <Constant name="x_start_back" value="-1190+16.05+[ServiceHybrid_X]/2"/> + <Constant name="y_offset" value="1+[SensorModule_Y]/2"/> + </ConstantsSection> + + + <SolidSection label="etl.xml"> + <Tubs name="EndcapTimingLayer" rMin="[ETLrmin]" rMax="[ETLrmax]" dz="0.5*[ETLthickness]" startPhi="0*deg" deltaPhi="360*deg"/> + <Tubs name="Disc" rMin="[Disc_Rmin]*mm" rMax="[Disc_Rmax]*mm" dz="0.5*[Disc_thickness]*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Tubs name="Al_Disc" rMin="[Disc_Rmin]*mm" rMax="[Disc_Rmax]*mm" dz="0.5*[Al_Disc_thickness]*mm" startPhi="0*deg" deltaPhi="360*deg"/> + + <!-- FRONT: face closest to IP, BACK: furthest from IP --> + <Tubs name="DiscSector_Front" rMin="[Disc_Rmin]*mm" rMax="[Disc_Rmax]*mm" dz="0.5*[ServiceHybrid_Z]*mm" startPhi="0*deg" deltaPhi="180*deg"/> <!-- half-disc on front face --> + <Tubs name="DiscSector_Back" rMin="[Disc_Rmin]*mm" rMax="[Disc_Rmax]*mm" dz="0.5*[ServiceHybrid_Z]*mm" startPhi="0*deg" deltaPhi="180*deg"/> <!-- half-disc on back face --> + + <Box name="SensorModule" dx="0.5*[SensorModule_X]*mm" dy="0.5*[SensorModule_Y]*mm" dz="0.5*[SensorModule_Z]*mm"/> + <Box name="ServiceHybrid3" dx="0.5*[ServiceHybrid_X]*mm" dy="0.5*[ServiceHybrid_Y3]*mm" dz="0.5*[ServiceHybrid_Z]*mm"/> + <Box name="ServiceHybrid6" dx="0.5*[ServiceHybrid_X]*mm" dy="0.5*[ServiceHybrid_Y6]*mm" dz="0.5*[ServiceHybrid_Z]*mm"/> + <Box name="ServiceHybrid7" dx="0.5*[ServiceHybrid_X]*mm" dy="0.5*[ServiceHybrid_Y7]*mm" dz="0.5*[ServiceHybrid_Z]*mm"/> + + <Box name="ThermalPad" dx="0.5*[SensorModule_X]*mm" dy="0.5*[SensorModule_Y]*mm" dz="0.5*(0.25)*mm"/> + <Box name="AlN_Carrier" dx="0.5*[SensorModule_X]*mm" dy="0.5*[SensorModule_Y]*mm" dz="0.5*(0.79)*mm"/> + <Box name="LairdFilm" dx="0.5*([ETROCdx]+0.5*[etrocSep_X])*mm" dy="0.5*([ETROCdy]*2+[etrocSep_Y])*mm" dz="0.5*(0.08)*mm"/> + <Box name="ETROC" dx="0.5*[ETROCdx]*mm" dy="0.5*[ETROCdy]*mm" dz="0.5*(0.28)*mm"/> <!-- solder bumps not considered, their thickness is included in that of the ETROC --> + <Box name="LGAD" dx="0.5*[LGADdx]*mm" dy="0.5*[LGADdy]*mm" dz="0.5*[LGADdz]*mm"/> + <Box name="EModule_Timingactive" dx="0.5*[LGADdx]*mm" dy="0.5*[LGADdy]*mm" dz="0.5*[EModule_Timingactive]*mm"/> + <Box name="LGAD_Substrate" dx="0.5*[LGADdx]*mm" dy="0.5*[LGADdy]*mm" dz="0.5*[LGAD_Substrate]*mm"/> + <Box name="AlN_Cover" dx="0.5*[LGADdx]*mm" dy="0.5*[LGADdy]*mm" dz="0.5*(0.59)*mm"/> <!-- epoxy included in the thickness of the AlN cover --> + </SolidSection> + + + <RotationSection label="etl.xml"> + <Rotation name="0" thetaX="90*deg" phiX="0*deg" thetaY="90*deg" phiY="90*deg" thetaZ="0*deg" phiZ="0*deg"/> + <Rotation name="270" thetaX="90*deg" phiX="270*deg" thetaY="90*deg" phiY="0*deg" thetaZ="0*deg" phiZ="0*deg"/> + <Rotation name="180" thetaX="90*deg" phiX="180*deg" thetaY="90*deg" phiY="270*deg" thetaZ="0*deg" phiZ="0*deg"/> + <Rotation name="90" thetaX="90*deg" phiX="90*deg" thetaY="90*deg" phiY="180*deg" thetaZ="0*deg" phiZ="0*deg"/> + <Rotation name="Reverse" thetaX="90*deg" phiX="0*deg" thetaY="90*deg" phiY="270*deg" thetaZ="180*deg" phiZ="0*deg"/> + </RotationSection> + + <Vector name="StartCopyNo_Front_Right" type="numeric" nEntries="27"> + 1, 7, 18, 33, 50, 69, 90, 112, 136, 161, 186, 207, 227, 247, 266, + 285, 305, 325, 349, 374, 398, 421, 443, 463, 481, 497, 510 + </Vector> + + <Vector name="StartCopyNo_Front_Left" type="numeric" nEntries="27"> + 1, 8, 21, 37, 55, 75, 97, 120, 144, 169, 193, 213, 233, 252, 271, + 291, 311, 332, 357, 382, 406, 428, 449, 468, 485, 500, 511 + </Vector> + + <Vector name="Offset_Front_Right" type="numeric" nEntries="27"> + [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], + [y_offset]+5*([SensorModule_Y]+[DeltaY]), [y_offset]+6*([SensorModule_Y]+[DeltaY]), [y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+8*([SensorModule_Y]+[DeltaY]), [y_offset]+8*([SensorModule_Y]+[DeltaY]), [y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+6*([SensorModule_Y]+[DeltaY]), [y_offset]+2*([SensorModule_Y]+[DeltaY]), + [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset] + </Vector> + + <Vector name="Offset_Front_Left" type="numeric" nEntries="27"> + [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], + [y_offset]+2*([SensorModule_Y]+[DeltaY]), [y_offset]+6*([SensorModule_Y]+[DeltaY]), [y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+8*([SensorModule_Y]+[DeltaY]), [y_offset]+8*([SensorModule_Y]+[DeltaY]), [y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+6*([SensorModule_Y]+[DeltaY]), [y_offset]+5*([SensorModule_Y]+[DeltaY]), + [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset] + </Vector> + + <Vector name="StartCopyNo_Back_Right" type="numeric" nEntries="27"> + 1, 10, 23, 39, 57, 77, 99, 122, 146, 171, 194, 214, 234, 254, 273, + 293, 313, 335, 360, 384, 407, 430, 451, 470, 487, 501, 511 + </Vector> + + <Vector name="StartCopyNo_Back_Left" type="numeric" nEntries="27"> + 1, 4, 14, 28, 45, 64, 85, 107, 130, 154, 179, 201, 221, 241, 260, + 280, 300, 320, 343, 368, 392, 415, 437, 457, 475, 491, 504 + </Vector> + + <Vector name="Offset_Back_Right" type="numeric" nEntries="27"> + [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset]+3*([SensorModule_Y]+[DeltaY]), + [y_offset]+6*([SensorModule_Y]+[DeltaY]), [y_offset]+7*([SensorModule_Y]+[DeltaY]), 0.8+[y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+8*([SensorModule_Y]+[DeltaY]), [y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+6*([SensorModule_Y]+[DeltaY]), [y_offset]+4*([SensorModule_Y]+[DeltaY]), [y_offset],[y_offset], [y_offset], [y_offset], [y_offset], [y_offset], + [y_offset], [y_offset], [y_offset], [y_offset] + </Vector> + + <Vector name="Offset_Back_Left" type="numeric" nEntries="27"> + [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset]+4*([SensorModule_Y]+[DeltaY]), [y_offset]+6*([SensorModule_Y]+[DeltaY]), 0.8+[y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+8*([SensorModule_Y]+[DeltaY]), [y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+7*([SensorModule_Y]+[DeltaY]), [y_offset]+6*([SensorModule_Y]+[DeltaY]), [y_offset]+3*([SensorModule_Y]+[DeltaY]), [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset], [y_offset] + </Vector> + + + <LogicalPartSection label="etl.xml"> + <LogicalPart name="EndcapTimingLayer" category="unspecified"> + <rSolid name="etl:EndcapTimingLayer"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <!-- Disc1Timing and Disc2Timing introduced to be compatible with previous scenarios. Can be replaced with 2 copies of DiscTiming, since the 2 disks are identical --> + <LogicalPart name="Disc1Timing" category="unspecified"> + <rSolid name="etl:Disc"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="Disc2Timing" category="unspecified"> + <rSolid name="etl:Disc"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="Al_Disc" category="unspecified"> + <rSolid name="etl:Al_Disc"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + + <!-- Sectors on Disc1 --> + <LogicalPart name="DiscSector_Front" category="unspecified"> + <rSolid name="etl:DiscSector_Front"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="DiscSector_Back" category="unspecified"> + <rSolid name="etl:DiscSector_Back"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + + <!-- Sensor module on front face --> + <LogicalPart name="SensorModule_Front_Right" category="unspecified"> + <rSolid name="etl:SensorModule"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="SensorModule_Front_Left" category="unspecified"> + <rSolid name="etl:SensorModule"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + + <!-- Sensor module on back face --> + <LogicalPart name="SensorModule_Back_Left" category="unspecified"> + <rSolid name="etl:SensorModule"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="SensorModule_Back_Right" category="unspecified"> + <rSolid name="etl:SensorModule"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + + <!-- Service Hybrids --> + <LogicalPart name="ServiceHybrid3" category="unspecified"> + <rSolid name="etl:ServiceHybrid3"/> + <rMaterial name="mtdMaterial:ServiceHybrid_PCB"/> + </LogicalPart> + <LogicalPart name="ServiceHybrid6" category="unspecified"> + <rSolid name="etl:ServiceHybrid6"/> + <rMaterial name="mtdMaterial:ServiceHybrid_PCB"/> + </LogicalPart> + <LogicalPart name="ServiceHybrid7" category="unspecified"> + <rSolid name="etl:ServiceHybrid7"/> + <rMaterial name="mtdMaterial:ServiceHybrid_PCB"/> + </LogicalPart> + + + <!-- Elements composing the sensor module --> + <LogicalPart name="ThermalPad" category="unspecified"> + <rSolid name="etl:ThermalPad"/> + <rMaterial name="materials:Epoxy"/> + </LogicalPart> + <LogicalPart name="AlN_Carrier" category="unspecified"> + <rSolid name="etl:AlN_Carrier"/> + <rMaterial name="mtdMaterial:Aluminium_Nitride"/> + </LogicalPart> + <LogicalPart name="LairdFilm" category="unspecified"> + <rSolid name="etl:LairdFilm"/> + <rMaterial name="mtdMaterial:Laird"/> + </LogicalPart> + <LogicalPart name="ETROC" category="unspecified"> + <rSolid name="etl:ETROC"/> + <rMaterial name="materials:Silicon"/> + </LogicalPart> + <LogicalPart name="LGAD" category="unspecified"> + <rSolid name="etl:LGAD"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="EModule_Timingactive" category="unspecified"> + <rSolid name="etl:EModule_Timingactive"/> + <rMaterial name="materials:Silicon"/> + </LogicalPart> + <LogicalPart name="LGAD_Substrate" category="unspecified"> + <rSolid name="etl:LGAD_Substrate"/> + <rMaterial name="materials:Silicon"/> + </LogicalPart> + <LogicalPart name="AlN_Cover" category="unspecified"> + <rSolid name="etl:AlN_Cover"/> + <rMaterial name="mtdMaterial:Aluminium_Nitride"/> + </LogicalPart> + </LogicalPartSection> + + + <PosPartSection label="etl.xml"> + <PosPart copyNumber="1"> + <rParent name="caloBase:CALOECFront"/> + <rChild name="etl:EndcapTimingLayer"/> + <Translation x="0." y="0." z="3024.68497*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:EndcapTimingLayer"/> + <rChild name="etl:Disc1Timing"/> + <Translation x="0." y="0." z="[Disc1center]-[ETLcenter]" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:EndcapTimingLayer"/> + <rChild name="etl:Disc2Timing"/> + <Translation x="0." y="0." z="[Disc2center]-[ETLcenter]" /> + </PosPart> + + <!-- Children volumes Disc1Timing --> + <PosPart copyNumber="1"> + <rParent name="etl:Disc1Timing"/> + <rChild name="etl:Al_Disc"/> + <Translation x="0*mm" y="0*mm" z="0*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:Disc1Timing"/> + <rChild name="etl:DiscSector_Front"/> + <rRotation name="etl:0"/> + <Translation x="0*mm" y="0*mm" z="-8.785*mm" /> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="etl:Disc1Timing"/> + <rChild name="etl:DiscSector_Front"/> + <rRotation name="etl:180"/> + <Translation x="0*mm" y="0*mm" z="-8.785*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:Disc1Timing"/> + <rChild name="etl:DiscSector_Back"/> + <rRotation name="etl:0"/> + <Translation x="0*mm" y="0*mm" z="8.785*mm" /> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="etl:Disc1Timing"/> + <rChild name="etl:DiscSector_Back"/> + <rRotation name="etl:180"/> + <Translation x="0*mm" y="0*mm" z="8.785*mm" /> + </PosPart> + + <!-- Children volumes Disc2Timing --> + <PosPart copyNumber="1"> + <rParent name="etl:Disc2Timing"/> + <rChild name="etl:Al_Disc"/> + <Translation x="0*mm" y="0*mm" z="0*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:Disc2Timing"/> + <rChild name="etl:DiscSector_Front"/> + <rRotation name="etl:0"/> + <Translation x="0*mm" y="0*mm" z="-8.785*mm" /> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="etl:Disc2Timing"/> + <rChild name="etl:DiscSector_Front"/> + <rRotation name="etl:180"/> + <Translation x="0*mm" y="0*mm" z="-8.785*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:Disc2Timing"/> + <rChild name="etl:DiscSector_Back"/> + <rRotation name="etl:0"/> + <Translation x="0*mm" y="0*mm" z="8.785*mm" /> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="etl:Disc2Timing"/> + <rChild name="etl:DiscSector_Back"/> + <rRotation name="etl:180"/> + <Translation x="0*mm" y="0*mm" z="8.785*mm" /> + </PosPart> + + <!-- Elements composing SensorModule_Front_Right --> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Right"/> + <rChild name="etl:ThermalPad"/> + <Translation x="0." y="0." z="1.02*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Right"/> + <rChild name="etl:AlN_Carrier"/> + <Translation x="0." y="0." z="0.5*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Right"/> + <rChild name="etl:LairdFilm"/> + <Translation x="1.7" y="0." z="0.065*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Right"/> + <rChild name="etl:ETROC"/> + <Translation x="1.625*mm" y="10.45*mm" z="-0.115*mm" /> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="etl:SensorModule_Front_Right"/> + <rChild name="etl:ETROC"/> + <Translation x="1.625*mm" y="-10.45*mm" z="-0.115*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Right"/> + <rChild name="etl:LGAD"/> + <Translation x="2.2*mm" y="0." z="-0.405*mm" /> + </PosPart> + <!-- definition of LGAD active/substrate volumes --> + <PosPart copyNumber="1"> + <rParent name="etl:LGAD"/> + <rChild name="etl:EModule_Timingactive"/> + <Translation x="0.*mm" y="0.*mm" z="-0.125*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:LGAD"/> + <rChild name="etl:LGAD_Substrate"/> + <Translation x="0.*mm" y="0.*mm" z="0.025*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Right"/> + <rChild name="etl:AlN_Cover"/> + <Translation x="2.2*mm" y="0." z="-0.85*mm" /> + </PosPart> + + <!-- Elements composing SensorModule_Front_Left --> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Left"/> + <rChild name="etl:ThermalPad"/> + <Translation x="0." y="0." z="1.02*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Left"/> + <rChild name="etl:AlN_Carrier"/> + <Translation x="0." y="0." z="0.5*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Left"/> + <rChild name="etl:LairdFilm"/> + <Translation x="-0.17" y="0." z="0.065*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Left"/> + <rChild name="etl:ETROC"/> + <Translation x="-1.625*mm" y="10.45*mm" z="-0.115*mm" /> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="etl:SensorModule_Front_Left"/> + <rChild name="etl:ETROC"/> + <Translation x="-1.625*mm" y="-10.45*mm" z="-0.115*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Left"/> + <rChild name="etl:LGAD"/> + <Translation x="-2.2*mm" y="0." z="-0.405*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Front_Left"/> + <rChild name="etl:AlN_Cover"/> + <Translation x="-2.2*mm" y="0." z="-0.85*mm" /> + </PosPart> + + <!-- Elements composing SensorModule_Back_Left --> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Left"/> + <rChild name="etl:ThermalPad"/> + <Translation x="0." y="0." z="-1.02*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Left"/> + <rChild name="etl:AlN_Carrier"/> + <Translation x="0." y="0." z="-0.5*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Left"/> + <rChild name="etl:LairdFilm"/> + <Translation x="0.17" y="0." z="-0.065*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Left"/> + <rChild name="etl:ETROC"/> + <Translation x="1.625*mm" y="10.45*mm" z="0.115*mm" /> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="etl:SensorModule_Back_Left"/> + <rChild name="etl:ETROC"/> + <Translation x="1.625*mm" y="-10.45*mm" z="0.115*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Left"/> + <rChild name="etl:LGAD"/> + <rRotation name="etl:Reverse" /> + <Translation x="2.2*mm" y="0." z="0.405*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Left"/> + <rChild name="etl:AlN_Cover"/> + <Translation x="2.2*mm" y="0." z="0.85*mm" /> + </PosPart> + + <!-- Elements composing SensorModule_Back_Right --> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Right"/> + <rChild name="etl:ThermalPad"/> + <Translation x="0." y="0." z="-1.02*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Right"/> + <rChild name="etl:AlN_Carrier"/> + <Translation x="0." y="0." z="-0.5*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Right"/> + <rChild name="etl:LairdFilm"/> + <Translation x="-0.17" y="0." z="-0.065*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Right"/> + <rChild name="etl:ETROC"/> + <Translation x="-1.625*mm" y="10.45*mm" z="0.115*mm" /> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="etl:SensorModule_Back_Right"/> + <rChild name="etl:ETROC"/> + <Translation x="-1.625*mm" y="-10.45*mm" z="0.115*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Right"/> + <rChild name="etl:LGAD"/> + <rRotation name="etl:Reverse" /> + <Translation x="-2.2*mm" y="0." z="0.405*mm" /> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="etl:SensorModule_Back_Right"/> + <rChild name="etl:AlN_Cover"/> + <Translation x="-2.2*mm" y="0." z="0.85*mm" /> + </PosPart> + </PosPartSection> + + + + + + + <!-- Algorithm Section begins --> + <!-- FRONT FACE --> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-[DeltaX_ServiceModule])*mm, (1+[ServiceHybrid_Y7]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-2*[DeltaX_ServiceModule])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="11"/> + <Numeric name="StartCopyNo" value="7"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-2*[DeltaX_ServiceModule]-[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-3*[DeltaX_ServiceModule]-[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-3*[DeltaX_ServiceModule]-[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="13"/> + <Numeric name="StartCopyNo" value="8"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-4*[DeltaX_ServiceModule]-[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="15"/> + <Numeric name="StartCopyNo" value="18"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-4*[DeltaX_ServiceModule]-2*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-5*[DeltaX_ServiceModule]-2*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-5*[DeltaX_ServiceModule]-2*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="3"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-5*[DeltaX_ServiceModule]-2*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="16"/> + <Numeric name="StartCopyNo" value="21"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-6*[DeltaX_ServiceModule]-2*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="17"/> + <Numeric name="StartCopyNo" value="33"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-6*[DeltaX_ServiceModule]-3*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="3"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-7*[DeltaX_ServiceModule]-3*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="18"/> + <Numeric name="StartCopyNo" value="37"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-8*[DeltaX_ServiceModule]-3*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="50"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-8*[DeltaX_ServiceModule]-4*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="6"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-9*[DeltaX_ServiceModule]-4*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-9*[DeltaX_ServiceModule]-4*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="55"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-10*[DeltaX_ServiceModule]-4*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="21"/> + <Numeric name="StartCopyNo" value="69"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-10*[DeltaX_ServiceModule]-5*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-11*[DeltaX_ServiceModule]-5*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="7"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-11*[DeltaX_ServiceModule]-5*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="6"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-11*[DeltaX_ServiceModule]-5*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[ServiceHybrid_Y6]+[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="75"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-12*[DeltaX_ServiceModule]-5*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="90"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-12*[DeltaX_ServiceModule]-6*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="3"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-13*[DeltaX_ServiceModule]-6*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="9"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-13*[DeltaX_ServiceModule]-6*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="7"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-13*[DeltaX_ServiceModule]-6*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="97"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-14*[DeltaX_ServiceModule]-6*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="112"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-14*[DeltaX_ServiceModule]-7*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="4"/> + <Numeric name="StartCopyNo" value="10"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-15*[DeltaX_ServiceModule]-7*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="120"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-16*[DeltaX_ServiceModule]-7*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="136"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-16*[DeltaX_ServiceModule]-8*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="14"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-17*[DeltaX_ServiceModule]-8*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="9"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-17*[DeltaX_ServiceModule]-8*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2+2*[ServiceHybrid_Y6]+2*[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="144"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-18*[DeltaX_ServiceModule]-8*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="161"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-18*[DeltaX_ServiceModule]-9*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-19*[DeltaX_ServiceModule]-9*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="17"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-19*[DeltaX_ServiceModule]-9*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="10"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-19*[DeltaX_ServiceModule]-9*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="169"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-20*[DeltaX_ServiceModule]-9*[SensorModule_X])*mm, ([y_offset]+2*[SensorModule_Y]+2*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="21"/> + <Numeric name="StartCopyNo" value="186"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-20*[DeltaX_ServiceModule]-10*[SensorModule_X])*mm, ([y_offset]+5*[SensorModule_Y]+5*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="6"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-21*[DeltaX_ServiceModule]-10*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="18"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-21*[DeltaX_ServiceModule]-10*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="193"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-22*[DeltaX_ServiceModule]-10*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="207"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-22*[DeltaX_ServiceModule]-11*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="7"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-23*[DeltaX_ServiceModule]-11*[SensorModule_X])*mm, (5.78+[y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="21"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-23*[DeltaX_ServiceModule]-11*[SensorModule_X])*mm, (5.78+[y_offset]+7*[SensorModule_Y]+6*[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="213"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-24*[DeltaX_ServiceModule]-11*[SensorModule_X])*mm, ([y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="227"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-24*[DeltaX_ServiceModule]-12*[SensorModule_X])*mm, ([y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="8"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-25*[DeltaX_ServiceModule]-12*[SensorModule_X])*mm, (5.7+[y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="12"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-25*[DeltaX_ServiceModule]-12*[SensorModule_X])*mm, (5.7+[y_offset]+8*[SensorModule_Y]+8*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="233"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-26*[DeltaX_ServiceModule]-12*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="247"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-26*[DeltaX_ServiceModule]-13*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="10"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-27*[DeltaX_ServiceModule]-13*[SensorModule_X])*mm, ([y_offset]+9*[SensorModule_Y]+9*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="24"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-27*[DeltaX_ServiceModule]-13*[SensorModule_X])*mm, ([y_offset]+9*[SensorModule_Y]+9*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="14"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-27*[DeltaX_ServiceModule]-13*[SensorModule_X])*mm, ([y_offset]+9*[SensorModule_Y]+9*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="252"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-28*[DeltaX_ServiceModule]-13*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="266"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-28*[DeltaX_ServiceModule]-14*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="12"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-29*[DeltaX_ServiceModule]-14*[SensorModule_X])*mm, (5.7+[y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="15"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-29*[DeltaX_ServiceModule]-14*[SensorModule_X])*mm, (5.7+[y_offset]+8*[SensorModule_Y]+8*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="271"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-30*[DeltaX_ServiceModule]-14*[SensorModule_X])*mm, ([y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="285"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-30*[DeltaX_ServiceModule]-15*[SensorModule_X])*mm, ([y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="14"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-31*[DeltaX_ServiceModule]-15*[SensorModule_X])*mm, (5.78+[y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="25"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-31*[DeltaX_ServiceModule]-15*[SensorModule_X])*mm, (5.78+[y_offset]+7*[SensorModule_Y]+6*[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="291"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-32*[DeltaX_ServiceModule]-15*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="305"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-32*[DeltaX_ServiceModule]-16*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="15"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-33*[DeltaX_ServiceModule]-16*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="28"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-33*[DeltaX_ServiceModule]-16*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="21"/> + <Numeric name="StartCopyNo" value="311"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-34*[DeltaX_ServiceModule]-16*[SensorModule_X])*mm, ([y_offset]+5*[SensorModule_Y]+5*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="325"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-34*[DeltaX_ServiceModule]-17*[SensorModule_X])*mm, ([y_offset]+2*[SensorModule_Y]+2*[DeltaY])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="16"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-35*[DeltaX_ServiceModule]-17*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="31"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-35*[DeltaX_ServiceModule]-17*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="17"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-35*[DeltaX_ServiceModule]-17*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="332"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-36*[DeltaX_ServiceModule]-17*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="349"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-36*[DeltaX_ServiceModule]-18*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="32"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-37*[DeltaX_ServiceModule]-18*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="19"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-37*[DeltaX_ServiceModule]-18*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2+2*[ServiceHybrid_Y6]+2*[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="357"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-38*[DeltaX_ServiceModule]-18*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="374"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-38*[DeltaX_ServiceModule]-19*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="4"/> + <Numeric name="StartCopyNo" value="35"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-39*[DeltaX_ServiceModule]-19*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="382"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-40*[DeltaX_ServiceModule]-19*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="398"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-40*[DeltaX_ServiceModule]-20*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="18"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-41*[DeltaX_ServiceModule]-20*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="39"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-41*[DeltaX_ServiceModule]-20*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="20"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-41*[DeltaX_ServiceModule]-20*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="406"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-42*[DeltaX_ServiceModule]-20*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="421"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-42*[DeltaX_ServiceModule]-21*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="19"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-43*[DeltaX_ServiceModule]-21*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="40"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-43*[DeltaX_ServiceModule]-21*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="22"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-43*[DeltaX_ServiceModule]-21*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[ServiceHybrid_Y6]+[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="21"/> + <Numeric name="StartCopyNo" value="428"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-44*[DeltaX_ServiceModule]-21*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="443"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-44*[DeltaX_ServiceModule]-22*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="42"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-45*[DeltaX_ServiceModule]-22*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="23"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-45*[DeltaX_ServiceModule]-22*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="449"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-46*[DeltaX_ServiceModule]-22*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="18"/> + <Numeric name="StartCopyNo" value="463"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-46*[DeltaX_ServiceModule]-23*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="43"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-47*[DeltaX_ServiceModule]-23*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="17"/> + <Numeric name="StartCopyNo" value="468"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-48*[DeltaX_ServiceModule]-23*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="16"/> + <Numeric name="StartCopyNo" value="481"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-48*[DeltaX_ServiceModule]-24*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="20"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-49*[DeltaX_ServiceModule]-24*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="46"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-49*[DeltaX_ServiceModule]-24*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="25"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-49*[DeltaX_ServiceModule]-24*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="15"/> + <Numeric name="StartCopyNo" value="485"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-50*[DeltaX_ServiceModule]-24*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="13"/> + <Numeric name="StartCopyNo" value="497"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-50*[DeltaX_ServiceModule]-25*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="47"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-51*[DeltaX_ServiceModule]-25*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="26"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-51*[DeltaX_ServiceModule]-25*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="11"/> + <Numeric name="StartCopyNo" value="500"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-52*[DeltaX_ServiceModule]-25*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Right"/> + <Numeric name="N" value="7"/> + <Numeric name="StartCopyNo" value="510"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-52*[DeltaX_ServiceModule]-26*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="27"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-53*[DeltaX_ServiceModule]-26*[SensorModule_X])*mm, (1+[ServiceHybrid_Y7]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Front"/> + <String name="ChildName" value="etl:SensorModule_Front_Left"/> + <Numeric name="N" value="6"/> + <Numeric name="StartCopyNo" value="511"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_front]-54*[DeltaX_ServiceModule]-26*[SensorModule_X])*mm, ([y_offset])*mm, 4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + + + + + + +<!-- BACK FACE --> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+[DeltaX_ServiceModule])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="9"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+[DeltaX_ServiceModule]+[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+2*[DeltaX_ServiceModule]+[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+2*[DeltaX_ServiceModule]+[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="10"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+3*[DeltaX_ServiceModule]+[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="13"/> + <Numeric name="StartCopyNo" value="10"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+3*[DeltaX_ServiceModule]+2*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="2"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+4*[DeltaX_ServiceModule]+2*[SensorModule_X])*mm, (1+[ServiceHybrid_Y7]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="14"/> + <Numeric name="StartCopyNo" value="14"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+5*[DeltaX_ServiceModule]+2*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="16"/> + <Numeric name="StartCopyNo" value="23"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+5*[DeltaX_ServiceModule]+3*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="3"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+6*[DeltaX_ServiceModule]+3*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+6*[DeltaX_ServiceModule]+3*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="17"/> + <Numeric name="StartCopyNo" value="28"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+7*[DeltaX_ServiceModule]+3*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="18"/> + <Numeric name="StartCopyNo" value="39"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+7*[DeltaX_ServiceModule]+4*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+8*[DeltaX_ServiceModule]+4*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="6"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+8*[DeltaX_ServiceModule]+4*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2+[ServiceHybrid_Y6]+[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="45"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+9*[DeltaX_ServiceModule]+4*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="57"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+9*[DeltaX_ServiceModule]+5*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="7"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+10*[DeltaX_ServiceModule]+5*[SensorModule_X])*mm, (1+[ServiceHybrid_Y7]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="21"/> + <Numeric name="StartCopyNo" value="64"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+11*[DeltaX_ServiceModule]+5*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="77"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+11*[DeltaX_ServiceModule]+6*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+12*[DeltaX_ServiceModule]+6*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="3"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+12*[DeltaX_ServiceModule]+6*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="10"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+12*[DeltaX_ServiceModule]+6*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[ServiceHybrid_Y6]+[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="85"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+13*[DeltaX_ServiceModule]+6*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="99"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+13*[DeltaX_ServiceModule]+7*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+14*[DeltaX_ServiceModule]+7*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+14*[DeltaX_ServiceModule]+7*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="11"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+14*[DeltaX_ServiceModule]+7*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="107"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+15*[DeltaX_ServiceModule]+7*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="122"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+15*[DeltaX_ServiceModule]+8*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="6"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+16*[DeltaX_ServiceModule]+8*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="6"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+16*[DeltaX_ServiceModule]+8*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="130"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+17*[DeltaX_ServiceModule]+8*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="146"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+17*[DeltaX_ServiceModule]+9*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="8"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+18*[DeltaX_ServiceModule]+9*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="9"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+18*[DeltaX_ServiceModule]+9*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="13"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+18*[DeltaX_ServiceModule]+9*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6]+[ServiceHybrid_Y6]+[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="154"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+19*[DeltaX_ServiceModule]+9*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="171"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+19*[DeltaX_ServiceModule]+10*[SensorModule_X])*mm, ([y_offset]+3*[SensorModule_Y]+3*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="10"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+20*[DeltaX_ServiceModule]+10*[SensorModule_X])*mm, ([y_offset]+4*[SensorModule_Y]+4*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="14"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+20*[DeltaX_ServiceModule]+10*[SensorModule_X])*mm, ([y_offset]+4*[SensorModule_Y]+4*[DeltaY]+2*[ServiceHybrid_Y3]+2*[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="179"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+21*[DeltaX_ServiceModule]+10*[SensorModule_X])*mm, (1+[y_offset]+4*[SensorModule_Y]+4*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="194"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+21*[DeltaX_ServiceModule]+11*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="13"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+22*[DeltaX_ServiceModule]+11*[SensorModule_X])*mm, ([y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="16"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+22*[DeltaX_ServiceModule]+11*[SensorModule_X])*mm, ([y_offset]+7*[SensorModule_Y]+7*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="201"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+23*[DeltaX_ServiceModule]+11*[SensorModule_X])*mm, (1+[y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="214"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+23*[DeltaX_ServiceModule]+12*[SensorModule_X])*mm, (0.8+[SensorModule_Y]/2+7*[SensorModule_Y]+7*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="15"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+24*[DeltaX_ServiceModule]+12*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="18"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+24*[DeltaX_ServiceModule]+12*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="221"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+25*[DeltaX_ServiceModule]+12*[SensorModule_X])*mm, (0.8+[y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="234"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+25*[DeltaX_ServiceModule]+13*[SensorModule_X])*mm, (0.8+[y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="17"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+26*[DeltaX_ServiceModule]+13*[SensorModule_X])*mm, (5+[y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="20"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+26*[DeltaX_ServiceModule]+13*[SensorModule_X])*mm, (5+[y_offset]+8*[SensorModule_Y]+8*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="241"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+27*[DeltaX_ServiceModule]+13*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="254"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+27*[DeltaX_ServiceModule]+14*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="19"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+28*[DeltaX_ServiceModule]+14*[SensorModule_X])*mm, (5+[y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="22"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+28*[DeltaX_ServiceModule]+14*[SensorModule_X])*mm, (5+[y_offset]+8*[SensorModule_Y]+8*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="260"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+29*[DeltaX_ServiceModule]+14*[SensorModule_X])*mm, (0.8+[y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="273"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+29*[DeltaX_ServiceModule]+15*[SensorModule_X])*mm, (0.8+[y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="21"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+30*[DeltaX_ServiceModule]+15*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="24"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+30*[DeltaX_ServiceModule]+15*[SensorModule_X])*mm, ([y_offset]+8*[SensorModule_Y]+8*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="280"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+31*[DeltaX_ServiceModule]+15*[SensorModule_X])*mm, (0.8+[SensorModule_Y]/2+7*[SensorModule_Y]+7*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="293"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+31*[DeltaX_ServiceModule]+16*[SensorModule_X])*mm, (1+[y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="23"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+32*[DeltaX_ServiceModule]+16*[SensorModule_X])*mm, ([y_offset]+7*[SensorModule_Y]+7*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="26"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+32*[DeltaX_ServiceModule]+16*[SensorModule_X])*mm, ([y_offset]+7*[SensorModule_Y]+7*[DeltaY]+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="300"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+33*[DeltaX_ServiceModule]+16*[SensorModule_X])*mm, ([y_offset]+6*[SensorModule_Y]+6*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="313"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+33*[DeltaX_ServiceModule]+17*[SensorModule_X])*mm, (1+[y_offset]+4*[SensorModule_Y]+4*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="25"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+34*[DeltaX_ServiceModule]+17*[SensorModule_X])*mm, ([y_offset]+4*[SensorModule_Y]+4*[DeltaY])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="28"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+34*[DeltaX_ServiceModule]+17*[SensorModule_X])*mm, ([y_offset]+4*[SensorModule_Y]+4*[DeltaY]+2*[ServiceHybrid_Y3]+2*[DeltaY]+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="320"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+35*[DeltaX_ServiceModule]+17*[SensorModule_X])*mm, ([y_offset]+3*[SensorModule_Y]+3*[DeltaY])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="335"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+35*[DeltaX_ServiceModule]+18*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="28"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+36*[DeltaX_ServiceModule]+18*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="11"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+36*[DeltaX_ServiceModule]+18*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="30"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+36*[DeltaX_ServiceModule]+18*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6]+[ServiceHybrid_Y6]+[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="25"/> + <Numeric name="StartCopyNo" value="343"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+37*[DeltaX_ServiceModule]+18*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="360"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+37*[DeltaX_ServiceModule]+19*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="30"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+38*[DeltaX_ServiceModule]+19*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="13"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+38*[DeltaX_ServiceModule]+19*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[ServiceHybrid_Y3]+[DeltaY]+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="24"/> + <Numeric name="StartCopyNo" value="368"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+39*[DeltaX_ServiceModule]+19*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="384"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+39*[DeltaX_ServiceModule]+20*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="32"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+40*[DeltaX_ServiceModule]+20*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="16"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+40*[DeltaX_ServiceModule]+20*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="31"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+40*[DeltaX_ServiceModule]+20*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="392"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+41*[DeltaX_ServiceModule]+20*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="23"/> + <Numeric name="StartCopyNo" value="407"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+41*[DeltaX_ServiceModule]+21*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="33"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+42*[DeltaX_ServiceModule]+21*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="17"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+42*[DeltaX_ServiceModule]+21*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="33"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+42*[DeltaX_ServiceModule]+21*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service6]+[ServiceHybrid_Y6]+[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="22"/> + <Numeric name="StartCopyNo" value="415"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+43*[DeltaX_ServiceModule]+21*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="21"/> + <Numeric name="StartCopyNo" value="430"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+43*[DeltaX_ServiceModule]+22*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="34"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+44*[DeltaX_ServiceModule]+22*[SensorModule_X])*mm, (1+[ServiceHybrid_Y7]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="20"/> + <Numeric name="StartCopyNo" value="437"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+45*[DeltaX_ServiceModule]+22*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="19"/> + <Numeric name="StartCopyNo" value="451"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+45*[DeltaX_ServiceModule]+23*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid6"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="19"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y6]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+46*[DeltaX_ServiceModule]+23*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="37"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+46*[DeltaX_ServiceModule]+23*[SensorModule_X])*mm, (1+[ServiceHybrid_Y6]/2+[ServiceHybrid_Y6]+[DeltaY]+[DeltaY_Service6_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="18"/> + <Numeric name="StartCopyNo" value="457"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+47*[DeltaX_ServiceModule]+23*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="17"/> + <Numeric name="StartCopyNo" value="470"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+47*[DeltaX_ServiceModule]+24*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="34"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+48*[DeltaX_ServiceModule]+24*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="38"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+48*[DeltaX_ServiceModule]+24*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="16"/> + <Numeric name="StartCopyNo" value="475"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+49*[DeltaX_ServiceModule]+24*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="14"/> + <Numeric name="StartCopyNo" value="487"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+49*[DeltaX_ServiceModule]+25*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="2"/> + <Numeric name="StartCopyNo" value="40"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+50*[DeltaX_ServiceModule]+25*[SensorModule_X])*mm, (1+[ServiceHybrid_Y7]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="13"/> + <Numeric name="StartCopyNo" value="491"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+51*[DeltaX_ServiceModule]+25*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="10"/> + <Numeric name="StartCopyNo" value="501"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+51*[DeltaX_ServiceModule]+26*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="35"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+52*[DeltaX_ServiceModule]+26*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid7"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="42"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y7]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+52*[DeltaX_ServiceModule]+26*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2+[DeltaY_Service3_Service7])*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Left"/> + <Numeric name="N" value="9"/> + <Numeric name="StartCopyNo" value="504"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+53*[DeltaX_ServiceModule]+26*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:SensorModule_Back_Right"/> + <Numeric name="N" value="3"/> + <Numeric name="StartCopyNo" value="511"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([SensorModule_Y]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+53*[DeltaX_ServiceModule]+27*[SensorModule_X])*mm, ([y_offset])*mm, -4.02*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + <Algorithm name="mtd:DDMTDLinear"> + <rParent name="etl:DiscSector_Back"/> + <String name="ChildName" value="etl:ServiceHybrid3"/> + <Numeric name="N" value="1"/> + <Numeric name="StartCopyNo" value="36"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="Delta" value="([ServiceHybrid_Y3]+[DeltaY])*mm"/> + <Vector name="Base" type="numeric" nEntries="3"> ([x_start_back]+54*[DeltaX_ServiceModule]+27*[SensorModule_X])*mm, (1+[ServiceHybrid_Y3]/2)*mm, 0.*mm </Vector> + <Numeric name="Theta" value="90.*deg"/> + <Numeric name="Phi" value="90.*deg"/> + <Numeric name="Theta_obj" value="90.*deg"/> + <Numeric name="Phi_obj" value="0.*deg"/> + </Algorithm> + + +</DDDefinition> diff --git a/Geometry/MTDCommonData/data/mtdParameters/v3/mtdStructureTopology.xml b/Geometry/MTDCommonData/data/mtdParameters/v3/mtdStructureTopology.xml new file mode 100644 index 0000000000000..0f7b6c28f7635 --- /dev/null +++ b/Geometry/MTDCommonData/data/mtdParameters/v3/mtdStructureTopology.xml @@ -0,0 +1,30 @@ +<?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="btlStructure"> + <PartSelector path="//BarrelTimingLayer"/> + <PartSelector path="//Layer1Timing"/> + <PartSelector path="//BModule1Layer1.*ZTimingwafer"/> + <PartSelector path="//BModule17Layer1.*ZTimingwafer"/> + <PartSelector path="//BModule33Layer1.*ZTimingwafer"/> + <Parameter name="MtdDDStructure" value="BarrelTimingLayer"/> +</SpecPar> +<SpecPar name="etlStructure"> + <PartSelector path="//EndcapTimingLayer"/> + <PartSelector path="//Disc1Timing"/> + <PartSelector path="//Disc2Timing"/> + <PartSelector path="//EModule_Timingactive"/> + <Parameter name="MtdDDStructure" value="EndcapTimingLayer"/> +</SpecPar> + +<SpecPar name="mtdNumbering"> + <PartSelector path="//etl:EndcapTimingLayer"/> + <PartSelector path="//btl:BarrelTimingLayer"/> + <Parameter name="OnlyForMTDRecNumbering" value="MTD" eval="false"/> + <Parameter name="TopologyMode" value="MTDTopologyMode::btlv1etlv5" eval="false"/> +</SpecPar> + + +</SpecParSection> +</DDDefinition> diff --git a/Geometry/MTDCommonData/interface/MTDTopologyMode.h b/Geometry/MTDCommonData/interface/MTDTopologyMode.h index f2f597cc182db..cd6dc4b08ca0b 100644 --- a/Geometry/MTDCommonData/interface/MTDTopologyMode.h +++ b/Geometry/MTDCommonData/interface/MTDTopologyMode.h @@ -10,7 +10,7 @@ namespace MTDTopologyMode { - enum class Mode { undefined = 0, tile = 1, bar = 2, barzflat = 3, barphiflat = 4, btlv1etlv4 = 5 }; + enum class Mode { undefined = 0, tile = 1, bar = 2, barzflat = 3, barphiflat = 4, btlv1etlv4 = 5, btlv1etlv5 = 6 }; Mode MTDStringToEnumParser(const std::string&); diff --git a/Geometry/MTDCommonData/src/ETLNumberingScheme.cc b/Geometry/MTDCommonData/src/ETLNumberingScheme.cc index 4bec5cc023d80..9de92bfb529c3 100644 --- a/Geometry/MTDCommonData/src/ETLNumberingScheme.cc +++ b/Geometry/MTDCommonData/src/ETLNumberingScheme.cc @@ -50,7 +50,7 @@ uint32_t ETLNumberingScheme::getUnitID(const MTDBaseNumber& baseNumber) const { ETLDetId tmpId; ringCopy = static_cast<int>(tmpId.encodeSector(discN, sectorS, sectorN)); - modtyp = (baseNumber.getLevelName(2).find("_Left") != std::string::npos) ? 2 : 1; + modtyp = (baseNumber.getLevelName(2).find("_Left") != std::string::npos) ? 1 : 2; } // Side choice: up to scenario D38 is given by level 7 (HGCal v9) diff --git a/Geometry/MTDCommonData/src/MTDTopologyMode.cc b/Geometry/MTDCommonData/src/MTDTopologyMode.cc index 3194d340f58e5..a4dd3a0cae2c5 100644 --- a/Geometry/MTDCommonData/src/MTDTopologyMode.cc +++ b/Geometry/MTDCommonData/src/MTDTopologyMode.cc @@ -17,6 +17,8 @@ namespace MTDTopologyMode { output = Mode::barphiflat; } else if (value == prefix + "btlv1etlv4") { output = Mode::btlv1etlv4; + } else if (value == prefix + "btlv1etlv5") { + output = Mode::btlv1etlv5; } else { throw cms::Exception("MTDTopologyModeError") << "the value " << value << " is not defined."; } From db05b7728a45a359495a6ead188f9589bbe72798 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti <fabio.cossutti@ts.infn.it> Date: Wed, 7 Oct 2020 14:38:55 +0200 Subject: [PATCH 328/778] Add tests wf for D72, D73 but not in the matrix, remove D53 --- .../PyReleaseValidation/python/relval_2026.py | 18 ++++++------- .../python/upgradeWorkflowComponents.py | 27 ++++++++++++------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index e023aaf2653d8..11eadabf48d46 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -19,15 +19,15 @@ numWFIB.extend([23434.99,23434.999]) #2026D49 premixing combined stage1+stage2 (ttbar+PU200, ttbar+PU50 for PR test) numWFIB.extend([23234.21,23434.21]) #2026D49 prodlike, prodlike PU numWFIB.extend([23234.103]) #2026D49 aging -numWFIB.extend([28234.0]) #2026D60 -numWFIB.extend([29834.0]) #2026D64 -numWFIB.extend([30234.0]) #2026D65 -numWFIB.extend([30634.0]) #2026D66 -numWFIB.extend([31034.0]) #2026D67 -numWFIB.extend([31434.0]) #2026D68 -numWFIB.extend([31834.0]) #2026D69 -numWFIB.extend([32234.0]) #2026D70 -numWFIB.extend([32634.0]) #2026D71 +numWFIB.extend([24434.0]) #2026D60 +numWFIB.extend([28234.0]) #2026D64 +numWFIB.extend([29834.0]) #2026D65 +numWFIB.extend([30234.0]) #2026D66 +numWFIB.extend([30634.0]) #2026D67 +numWFIB.extend([31034.0]) #2026D68 +numWFIB.extend([31434.0]) #2026D69 +numWFIB.extend([31834.0]) #2026D70 +numWFIB.extend([32234.0]) #2026D71 for numWF in numWFIB: workflows[numWF] = _upgrade_workflows[numWF] diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 348256ce9258b..a05926b04ba72 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -30,8 +30,6 @@ upgradeKeys[2026] = [ '2026D49', '2026D49PU', - '2026D53', - '2026D53PU', '2026D60', '2026D60PU', '2026D64', @@ -50,6 +48,10 @@ '2026D70PU', '2026D71', '2026D71PU', + '2026D72', + '2026D72PU', + '2026D73', + '2026D73PU', ] # pre-generation of WF numbers @@ -931,13 +933,6 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C9', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, - '2026D53' : { - 'Geom' : 'Extended2026D53', - 'HLTmenu': '@fake2', - 'GT' : 'auto:phase2_realistic_T15', - 'Era' : 'Phase2C9', - 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], - }, '2026D60' : { 'Geom' : 'Extended2026D60', 'HLTmenu': '@fake2', @@ -1002,6 +997,20 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C11', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, + '2026D72' : { + 'Geom' : 'Extended2026D72', + 'HLTmenu': '@fake2', + 'GT' : 'auto:phase2_realistic_T21', + 'Era' : 'Phase2C11', + 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], + }, + '2026D73' : { + 'Geom' : 'Extended2026D73', + 'HLTmenu': '@fake2', + 'GT' : 'auto:phase2_realistic_T21', + 'Era' : 'Phase2C11', + 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], + }, } # standard PU sequences From 0fb4d2158e12c5746e6da419484c059f4d6c8987 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti <fabio.cossutti@ts.infn.it> Date: Wed, 7 Oct 2020 15:20:09 +0200 Subject: [PATCH 329/778] Fix copy number for scenario D72 (was D53), avoid duplicated DetId --- Geometry/MTDCommonData/data/etl/v4/etl.xml | 94 +++++++++++----------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/Geometry/MTDCommonData/data/etl/v4/etl.xml b/Geometry/MTDCommonData/data/etl/v4/etl.xml index 6773c8b4db3fc..c724fba5c8eb7 100644 --- a/Geometry/MTDCommonData/data/etl/v4/etl.xml +++ b/Geometry/MTDCommonData/data/etl/v4/etl.xml @@ -521,7 +521,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="12"/> - <Numeric name="StartCopyNo" value="12"/> + <Numeric name="StartCopyNo" value="9"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+2*[DeltaX_ServiceModule]+[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -560,7 +560,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="15"/> - <Numeric name="StartCopyNo" value="20"/> + <Numeric name="StartCopyNo" value="21"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+4*[DeltaX_ServiceModule]+2*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -599,7 +599,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="15"/> - <Numeric name="StartCopyNo" value="20"/> + <Numeric name="StartCopyNo" value="22"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+6*[DeltaX_ServiceModule]+2*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -612,7 +612,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="35"/> + <Numeric name="StartCopyNo" value="36"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+6*[DeltaX_ServiceModule]+3*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -638,7 +638,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="34"/> + <Numeric name="StartCopyNo" value="37"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+8*[DeltaX_ServiceModule]+3*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -651,7 +651,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="20"/> - <Numeric name="StartCopyNo" value="53"/> + <Numeric name="StartCopyNo" value="54"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+8*[DeltaX_ServiceModule]+4*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -690,7 +690,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="53"/> + <Numeric name="StartCopyNo" value="55"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+10*[DeltaX_ServiceModule]+4*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -703,7 +703,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="73"/> + <Numeric name="StartCopyNo" value="74"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+10*[DeltaX_ServiceModule]+5*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -742,7 +742,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="73"/> + <Numeric name="StartCopyNo" value="76"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+12*[DeltaX_ServiceModule]+5*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -755,7 +755,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="94"/> + <Numeric name="StartCopyNo" value="95"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+12*[DeltaX_ServiceModule]+6*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -794,7 +794,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="94"/> + <Numeric name="StartCopyNo" value="97"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+14*[DeltaX_ServiceModule]+6*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -807,7 +807,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="115"/> + <Numeric name="StartCopyNo" value="116"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+14*[DeltaX_ServiceModule]+7*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -833,7 +833,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="115"/> + <Numeric name="StartCopyNo" value="118"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+16*[DeltaX_ServiceModule]+7*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -846,7 +846,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="139"/> + <Numeric name="StartCopyNo" value="140"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+16*[DeltaX_ServiceModule]+8*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -872,7 +872,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="139"/> + <Numeric name="StartCopyNo" value="142"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+18*[DeltaX_ServiceModule]+8*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -885,7 +885,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="163"/> + <Numeric name="StartCopyNo" value="164"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+18*[DeltaX_ServiceModule]+9*[SensorModuledx])*cm, (2.2925+[SensorModuledy]+[DeltaY])*cm, 0.178*cm </Vector> @@ -911,7 +911,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="163"/> + <Numeric name="StartCopyNo" value="166"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+20*[DeltaX_ServiceModule]+9*[SensorModuledx])*cm, (2.2925+4*[SensorModuledy]+4*[DeltaY])*cm, 0.178*cm </Vector> @@ -924,7 +924,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="187"/> + <Numeric name="StartCopyNo" value="188"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+20*[DeltaX_ServiceModule]+10*[SensorModuledx])*cm, (2.2925+6*[SensorModuledy]+6*[DeltaY])*cm, 0.178*cm </Vector> @@ -950,7 +950,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="184"/> + <Numeric name="StartCopyNo" value="187"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+22*[DeltaX_ServiceModule]+10*[SensorModuledx])*cm, ( 2.2925+6*[SensorModuledy]+6*[DeltaY])*cm, 0.178*cm </Vector> @@ -963,7 +963,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="205"/> + <Numeric name="StartCopyNo" value="206"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+22*[DeltaX_ServiceModule]+11*[SensorModuledx])*cm, ( 2.2925+7*[SensorModuledy]+7*[DeltaY])*cm, 0.178*cm </Vector> @@ -989,7 +989,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="202"/> + <Numeric name="StartCopyNo" value="205"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+24*[DeltaX_ServiceModule]+11*[SensorModuledx])*cm, ( 2.2925+7*[SensorModuledy]+7*[DeltaY])*cm, 0.178*cm </Vector> @@ -1002,7 +1002,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="223"/> + <Numeric name="StartCopyNo" value="224"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+24*[DeltaX_ServiceModule]+12*[SensorModuledx])*cm, ( 2.2925+8*[SensorModuledy]+8*[DeltaY])*cm, 0.178*cm </Vector> @@ -1028,7 +1028,7 @@ <rParent name="etl:DiscSector_Front"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="220"/> + <Numeric name="StartCopyNo" value="223"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-111.93+26*[DeltaX_ServiceModule]+12*[SensorModuledx])*cm, ( 2.2925+8*[SensorModuledy]+8*[DeltaY])*cm, 0.178*cm </Vector> @@ -1590,7 +1590,7 @@ <rParent name="etl:DiscSector_Back"/> <String name="ChildName" value="etl:SensorModule_Back_Left"/> <Numeric name="N" value="17"/> - <Numeric name="StartCopyNo" value="224"/> + <Numeric name="StartCopyNo" value="223"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (-113.555+25*[DeltaX_ServiceModule]+12*[SensorModuledx])*cm, (2.2925+8*[SensorModuledy]+8*[DeltaY])*cm, -0.178*cm </Vector> @@ -1683,7 +1683,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="12"/> - <Numeric name="StartCopyNo" value="12"/> + <Numeric name="StartCopyNo" value="9"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-2*[DeltaX_ServiceModule]-[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1722,7 +1722,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="15"/> - <Numeric name="StartCopyNo" value="20"/> + <Numeric name="StartCopyNo" value="21"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-4*[DeltaX_ServiceModule]-2*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1761,7 +1761,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="15"/> - <Numeric name="StartCopyNo" value="20"/> + <Numeric name="StartCopyNo" value="22"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-6*[DeltaX_ServiceModule]-2*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1774,7 +1774,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="35"/> + <Numeric name="StartCopyNo" value="36"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-6*[DeltaX_ServiceModule]-3*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1800,7 +1800,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="34"/> + <Numeric name="StartCopyNo" value="37"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-8*[DeltaX_ServiceModule]-3*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1813,7 +1813,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="20"/> - <Numeric name="StartCopyNo" value="53"/> + <Numeric name="StartCopyNo" value="54"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-8*[DeltaX_ServiceModule]-4*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1852,7 +1852,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="53"/> + <Numeric name="StartCopyNo" value="55"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-10*[DeltaX_ServiceModule]-4*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1865,7 +1865,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="73"/> + <Numeric name="StartCopyNo" value="74"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-10*[DeltaX_ServiceModule]-5*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1904,7 +1904,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="73"/> + <Numeric name="StartCopyNo" value="76"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-12*[DeltaX_ServiceModule]-5*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1917,7 +1917,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="94"/> + <Numeric name="StartCopyNo" value="95"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-12*[DeltaX_ServiceModule]-6*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1956,7 +1956,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="94"/> + <Numeric name="StartCopyNo" value="97"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-14*[DeltaX_ServiceModule]-6*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1969,7 +1969,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="115"/> + <Numeric name="StartCopyNo" value="116"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-14*[DeltaX_ServiceModule]-7*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -1995,7 +1995,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="115"/> + <Numeric name="StartCopyNo" value="118"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-16*[DeltaX_ServiceModule]-7*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -2008,7 +2008,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="139"/> + <Numeric name="StartCopyNo" value="140"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-16*[DeltaX_ServiceModule]-8*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -2034,7 +2034,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="139"/> + <Numeric name="StartCopyNo" value="142"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-18*[DeltaX_ServiceModule]-8*[SensorModuledx])*cm, 2.2925*cm, 0.178*cm </Vector> @@ -2047,7 +2047,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="24"/> - <Numeric name="StartCopyNo" value="163"/> + <Numeric name="StartCopyNo" value="164"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-18*[DeltaX_ServiceModule]-9*[SensorModuledx])*cm, (2.2925+[SensorModuledy]+[DeltaY])*cm, 0.178*cm </Vector> @@ -2073,7 +2073,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="21"/> - <Numeric name="StartCopyNo" value="163"/> + <Numeric name="StartCopyNo" value="166"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-20*[DeltaX_ServiceModule]-9*[SensorModuledx])*cm, (2.2925+4*[SensorModuledy]+4*[DeltaY])*cm, 0.178*cm </Vector> @@ -2086,7 +2086,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="187"/> + <Numeric name="StartCopyNo" value="188"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-20*[DeltaX_ServiceModule]-10*[SensorModuledx])*cm, (2.2925+6*[SensorModuledy]+6*[DeltaY])*cm, 0.178*cm </Vector> @@ -2112,7 +2112,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="184"/> + <Numeric name="StartCopyNo" value="187"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-22*[DeltaX_ServiceModule]-10*[SensorModuledx])*cm, ( 2.2925+6*[SensorModuledy]+6*[DeltaY])*cm, 0.178*cm </Vector> @@ -2125,7 +2125,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="205"/> + <Numeric name="StartCopyNo" value="206"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-22*[DeltaX_ServiceModule]-11*[SensorModuledx])*cm, ( 2.2925+7*[SensorModuledy]+7*[DeltaY])*cm, 0.178*cm </Vector> @@ -2151,7 +2151,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="202"/> + <Numeric name="StartCopyNo" value="205"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-24*[DeltaX_ServiceModule]-11*[SensorModuledx])*cm, ( 2.2925+7*[SensorModuledy]+7*[DeltaY])*cm, 0.178*cm </Vector> @@ -2164,7 +2164,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Right"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="223"/> + <Numeric name="StartCopyNo" value="224"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-24*[DeltaX_ServiceModule]-12*[SensorModuledx])*cm, ( 2.2925+8*[SensorModuledy]+8*[DeltaY])*cm, 0.178*cm </Vector> @@ -2190,7 +2190,7 @@ <rParent name="etl:DiscSector_Front_2"/> <String name="ChildName" value="etl:SensorModule_Front_Left"/> <Numeric name="N" value="18"/> - <Numeric name="StartCopyNo" value="220"/> + <Numeric name="StartCopyNo" value="223"/> <Numeric name="IncrCopyNo" value="1"/> <Numeric name="Delta" value="([SensorModuledy]+[DeltaY])*cm"/> <Vector name="Base" type="numeric" nEntries="3"> (111.93-26*[DeltaX_ServiceModule]-12*[SensorModuledx])*cm, ( 2.2925+8*[SensorModuledy]+8*[DeltaY])*cm, 0.178*cm </Vector> From d5bd3109f53038e313631dcdf0ecaf96fd1537c2 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Thu, 8 Oct 2020 11:30:36 +0200 Subject: [PATCH 330/778] add protection against missing brilcalc connection --- .../scripts/submitPVResolutionJobs.py | 12 ++++++++---- .../scripts/submitPVValidationJobs.py | 9 +++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py b/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py index 25a684d1c96ef..d13be902e072c 100755 --- a/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py +++ b/Alignment/OfflineValidation/scripts/submitPVResolutionJobs.py @@ -138,11 +138,15 @@ def getLuminosity(homedir,minRun,maxRun,isRunBased,verbose): if(not isRunBased): return myCachedLumi - ## using normtag - #output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS", "--normtag","/cvmfs/cms-bril.cern.ch/cms-lumi-pog/Normtags/normtag_PHYSICS.json", "-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) + try: + ## using normtag + #output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS", "--normtag","/cvmfs/cms-bril.cern.ch/cms-lumi-pog/Normtags/normtag_PHYSICS.json", "-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) - ## no normtag - output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS","-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) + ## no normtag + output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS","-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) + except: + warnings.warn('ATTENTION! Impossible to query the BRIL DB!') + return myCachedLumi if(verbose): print("INSIDE GET LUMINOSITY") diff --git a/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py index 9cf7b200dfbc7..efbc3f98ed037 100755 --- a/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py +++ b/Alignment/OfflineValidation/scripts/submitPVValidationJobs.py @@ -140,8 +140,13 @@ def getLuminosity(homedir,minRun,maxRun,isRunBased,verbose): if(not isRunBased): return myCachedLumi - #output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS", "--normtag=/afs/cern.ch/user/l/lumipro/public/normtag_file/normtag_BRIL.json", "-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) - output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS","-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv","-c","web"]) + try: + #output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS", "--normtag=/afs/cern.ch/user/l/lumipro/public/normtag_file/normtag_BRIL.json", "-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv"]) + + output = subprocess.check_output([homedir+"/.local/bin/brilcalc", "lumi", "-b", "STABLE BEAMS","-u", "/pb", "--begin", str(minRun),"--end",str(maxRun),"--output-style","csv","-c","web"]) + except: + warnings.warn('ATTENTION! Impossible to query the BRIL DB!') + return myCachedLumi if(verbose): print("INSIDE GET LUMINOSITY") From ce4ba1b8c155bd2c0141815a790364707735102c Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Thu, 8 Oct 2020 12:09:27 +0200 Subject: [PATCH 331/778] add nextChild that will stop iteration when a level set by a firstChild is reached --- .../DDCMS/interface/DDFilteredView.h | 1 + .../DDCMS/src/DDFilteredView.cc | 22 +++++ DetectorDescription/DDCMS/test/BuildFile.xml | 5 ++ .../test/DDFilteredView.firstChild.cppunit.cc | 87 +++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 DetectorDescription/DDCMS/test/DDFilteredView.firstChild.cppunit.cc diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 2768adbf36766..f1fe2729262f1 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -112,6 +112,7 @@ namespace cms { //! set the current node to the first child bool firstChild(); + bool nextChild(); //! set the current node to the child in path std::vector<std::vector<Node*>> children(const std::string& path); diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index c5f808a299fc3..044a0893eb082 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -239,6 +239,28 @@ bool DDFilteredView::firstChild() { return false; } +bool DDFilteredView::nextChild() { + currentSpecPar_ = nullptr; + + if (it_.empty()) { + LogVerbatim("DDFilteredView") << "Iterator vector has zero size."; + return false; + } + it_.back().SetType(0); + Node* node = nullptr; + while ((node = it_.back().Next())) { + if (it_.back().GetLevel() <= startLevel_) { + return false; + } + if (accept(noNamespace(node->GetVolume()->GetName()))) { + node_ = node; + return true; + } + } + LogVerbatim("DDFilteredView") << "Search for first child failed."; + return false; +} + int DDFilteredView::nodeCopyNo(const std::string_view copyNo) const { int result; if (auto [p, ec] = std::from_chars(copyNo.data(), copyNo.data() + copyNo.size(), result); ec == std::errc()) { diff --git a/DetectorDescription/DDCMS/test/BuildFile.xml b/DetectorDescription/DDCMS/test/BuildFile.xml index 9a3691bc306b6..3a55304f92426 100644 --- a/DetectorDescription/DDCMS/test/BuildFile.xml +++ b/DetectorDescription/DDCMS/test/BuildFile.xml @@ -4,6 +4,11 @@ <use name="dd4hep"/> </bin> +<bin name="testDD4hepFilteredViewFirstChild" file="DDFilteredView.firstChild.cppunit.cc,testRunner.cpp"> + <use name="DetectorDescription/DDCMS"/> + <use name="dd4hep"/> +</bin> + <bin name="testDD4hepFilteredViewLevel" file="DDFilteredView.level.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.firstChild.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.firstChild.cppunit.cc new file mode 100644 index 0000000000000..fd96d4a91e92f --- /dev/null +++ b/DetectorDescription/DDCMS/test/DDFilteredView.firstChild.cppunit.cc @@ -0,0 +1,87 @@ +#include <cppunit/extensions/HelperMacros.h> + +#include "DetectorDescription/DDCMS/interface/DDFilteredView.h" +#include "DetectorDescription/DDCMS/interface/DDDetector.h" +#include "FWCore/ParameterSet/interface/FileInPath.h" +#include "DD4hep/Detector.h" + +#include <string> +#include <memory> + +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" + +using namespace cms; +using namespace std; + +class testDDFilteredViewFirstChild : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(testDDFilteredViewFirstChild); + CPPUNIT_TEST(checkFilteredViewFirstChild); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp() override; + void tearDown() override {} + void checkFilteredViewFirstChild(); + +private: + string fileName_; + vector<double> refdattl_; + vector<string> refsattl_; + vector<double> refdLongFL_; + vector<string> refsLongFL_; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(testDDFilteredViewFirstChild); + +void testDDFilteredViewFirstChild::setUp() { + fileName_ = edm::FileInPath("Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml").fullPath(); + refdattl_ = {0.000809653, 0.000713002, 0.000654918, 0.000602767, 0.000566295, 0.000541647, 0.000516174, 0.000502512, + 0.000504225, 0.000506212, 0.000506275, 0.000487621, 0.000473034, 0.000454002, 0.000442383, 0.000441043, + 0.000443609, 0.000433124, 0.000440188, 0.000435257, 0.000439224, 0.000431385, 0.00041707, 0.000415677, + 0.000408389, 0.000400293, 0.000400989, 0.000395417, 0.00038936, 0.000383942}; + refsattl_ = {"0.8096535E-03/cm", "0.7130018E-03/cm", "0.6549183E-03/cm", "0.6027666E-03/cm", "0.5662951E-03/cm", + "0.5416475E-03/cm", "0.5161745E-03/cm", "0.5025120E-03/cm", "0.5042249E-03/cm", "0.5062117E-03/cm", + "0.5062750E-03/cm", "0.4876212E-03/cm", "0.4730343E-03/cm", "0.4540021E-03/cm", "0.4423832E-03/cm", + "0.4410428E-03/cm", "0.4436095E-03/cm", "0.4331241E-03/cm", "0.4401879E-03/cm", "0.4352570E-03/cm", + "0.4392237E-03/cm", "0.4313847E-03/cm", "0.4170704E-03/cm", "0.4156771E-03/cm", "0.4083890E-03/cm", + "0.4002930E-03/cm", "0.4009888E-03/cm", "0.3954170E-03/cm", "0.3893599E-03/cm", "0.3839422E-03/cm"}; + refdLongFL_ = { + 227.993, 237.122, 241.701, 256.48, 266.754, 275.988, 276.982, 284.989, 286.307, 290.478, 290.5, 292, 295.5}; + refsLongFL_ = {"227.9925651*cm", + "237.1215213*cm", + "241.7005445*cm", + "256.47981*cm", + "266.7540042*cm", + "275.987715*cm", + "276.9823529*cm", + "284.9889299*cm", + "286.3065327*cm", + "290.4779412*cm", + "290.5*cm", + "292.0*cm", + "295.5*cm"}; +} + +void testDDFilteredViewFirstChild::checkFilteredViewFirstChild() { + unique_ptr<DDDetector> det = make_unique<DDDetector>("DUMMY", fileName_); + DDFilteredView fview(det.get(), det->description()->worldVolume()); + const cms::DDSpecParRegistry& mypar = det->specpars(); + std::string attribute{"CMSCutsRegion"}; + cms::DDSpecParRefs ref; + mypar.filter(ref, attribute, "MuonChamber"); + fview.mergedSpecifics(ref); + + fview.firstChild(); + std::cout << fview.name() << " is a " << cms::dd::name(cms::DDSolidShapeMap, fview.shape()) << "\n"; + std::cout << "Full path to it is " << fview.path() << "\n"; + auto copyNos = fview.copyNos(); + if (dd4hep::isA<dd4hep::Box>(fview.solid())) + cout << "It's a Box\n"; + + std::cout << fview.name() << " is a " << cms::dd::name(cms::DDSolidShapeMap, fview.shape()) << "\n"; + do { + std::cout << fview.path() << "\n"; + } while (fview.nextChild()); + std::cout << "Current node is:\n" << fview.path() << "\n"; +} From b9fc74d125bea153978344fee72cace9c8904c92 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Thu, 8 Oct 2020 13:14:41 +0200 Subject: [PATCH 332/778] code format --- .../DDCMS/test/DDFilteredView.firstChild.cppunit.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DetectorDescription/DDCMS/test/DDFilteredView.firstChild.cppunit.cc b/DetectorDescription/DDCMS/test/DDFilteredView.firstChild.cppunit.cc index fd96d4a91e92f..0ec8016002224 100644 --- a/DetectorDescription/DDCMS/test/DDFilteredView.firstChild.cppunit.cc +++ b/DetectorDescription/DDCMS/test/DDFilteredView.firstChild.cppunit.cc @@ -71,17 +71,17 @@ void testDDFilteredViewFirstChild::checkFilteredViewFirstChild() { cms::DDSpecParRefs ref; mypar.filter(ref, attribute, "MuonChamber"); fview.mergedSpecifics(ref); - + fview.firstChild(); std::cout << fview.name() << " is a " << cms::dd::name(cms::DDSolidShapeMap, fview.shape()) << "\n"; std::cout << "Full path to it is " << fview.path() << "\n"; auto copyNos = fview.copyNos(); if (dd4hep::isA<dd4hep::Box>(fview.solid())) cout << "It's a Box\n"; - + std::cout << fview.name() << " is a " << cms::dd::name(cms::DDSolidShapeMap, fview.shape()) << "\n"; do { - std::cout << fview.path() << "\n"; - } while (fview.nextChild()); + std::cout << fview.path() << "\n"; + } while (fview.nextChild()); std::cout << "Current node is:\n" << fview.path() << "\n"; } From 5da2bd4a5345c818111c4d14cded01d8d0cc6125 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Thu, 8 Oct 2020 13:51:23 +0200 Subject: [PATCH 333/778] Restore DDFilteredView, bug fixes are integrated in https://github.com/cms-sw/cmssw/pull/31662/. --- .../DDCMS/src/DDFilteredView.cc | 149 +++++++----------- 1 file changed, 54 insertions(+), 95 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 918173a3de589..fb20cff1e59d1 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -614,103 +614,62 @@ const ExpandedNodes& DDFilteredView::history() { return nodes_; } -/* - * Among all SepcPar XML sections defining the key, - * find the first SpecPar section containing a path matching the current node path. - */ const DDSpecPar* DDFilteredView::find(const std::string& key) const { - // Filter the XML SpecPar sections: only those containing key are kept. - DDSpecParRefs allSpecParXMLSections; - registry_->filter(allSpecParXMLSections, key, ""); - - // Hierarchy levels info on current node - const int leafLevel = it_.back().GetLevel(); - const std::vector<int>& allCopyNumbers = copyNos(); - - // Loop on all XML SpecPar sections - for (auto const& mySpecParXMLSection : allSpecParXMLSections) { - // Loop on all paths of a given XML SpecPar section - auto foundMatchingXMLPath = - find_if(begin(mySpecParXMLSection->paths), end(mySpecParXMLSection->paths), [&](auto const& myXMLPath) { - // Initial conditions - auto myXMLVolumeNameStart = myXMLPath.rfind('/'); - auto myXMLVolumeNameEnd = myXMLPath.size(); - bool arePathsMatching = false; - - // Loop on all the volumes names from the XML path, until any discrepancy is found. - for (int myNodeLevel = leafLevel; myXMLVolumeNameStart - 1 <= myXMLVolumeNameEnd and myNodeLevel >= 1; - --myNodeLevel) { - // Get node name - std::string_view myNodeName = it_.back().GetNode(myNodeLevel)->GetVolume()->GetName(); - const int myNodeCopyNumber = allCopyNumbers.at(leafLevel - myNodeLevel); - - // Get XML volume name - std::string_view myXMLVolumeName{&myXMLPath[myXMLVolumeNameStart + 1], - myXMLVolumeNameEnd - myXMLVolumeNameStart - 1}; - - // Re-initilialize - myXMLVolumeNameEnd = myXMLVolumeNameStart; - myXMLVolumeNameStart = myXMLPath.substr(0, myXMLVolumeNameEnd).rfind('/'); - - // NAMESPACES - // Only keep namespace, when both XML volume name AND node name have any. - const auto foundXMLNamespace = myXMLVolumeName.find(':'); - // XML name has no namespace: - if (foundXMLNamespace == std::string_view::npos) { - // remove namespace from node name - myNodeName = noNamespace(myNodeName); - } - // XML name has a namespace: - else { - // Node name has no namesdpace: - if (myNodeName.find(':') == std::string_view::npos) { - // remove namespace from XML name: - myXMLVolumeName.remove_prefix(foundXMLNamespace + 1); - } - } - - // COPY NUMBERS - // Compare copy numbers. - const auto foundXMLCopyNumber = myXMLVolumeName.rfind('['); - // Enter only if ever copy number is specified in XML path. - if (foundXMLCopyNumber != std::string_view::npos) { - // Check whether copy numbers are equal - const bool areCopyNumbersEqual = - std::stoi(std::string(myXMLVolumeName.substr(foundXMLCopyNumber + 1, myXMLVolumeName.rfind(']')))) == - myNodeCopyNumber; - // If copy numbers are not matching, exit - if (!areCopyNumbersEqual) { - arePathsMatching = false; - break; - } - // Otherwise, remove copy number from volume name - else { - myXMLVolumeName.remove_suffix(myXMLVolumeName.size() - foundXMLCopyNumber); - } - } - - // VOLUME NAME - // Now that copy numbers are compared, compare the rest: the volume names. - const bool isRegex = dd4hep::dd::isRegex(myXMLVolumeName); - const bool areVolumeNamesEqual = (!isRegex ? dd4hep::dd::compareEqual(myNodeName, myXMLVolumeName) - : regex_match(std::string(myNodeName.data(), myNodeName.size()), - regex(std::string(myXMLVolumeName)))); - // If names are not matching, exit. - if (!areVolumeNamesEqual) { - arePathsMatching = false; - break; - } - // Otherwise, stay in loop to look at the other volumes of the same XML path - else { - arePathsMatching = true; - } + DDSpecParRefs refs; + registry_->filter(refs, key, ""); + int level = it_.back().GetLevel(); + for (auto const& i : refs) { + auto k = find_if(begin(i->paths), end(i->paths), [&](auto const& j) { + auto topos = j.size(); + auto frompos = j.rfind('/'); + bool flag = false; + for (int nit = level; frompos - 1 <= topos and nit > 0; --nit) { + std::string_view name = it_.back().GetNode(nit)->GetVolume()->GetName(); + std::string_view refname{&j[frompos + 1], topos - frompos - 1}; + topos = frompos; + frompos = j.substr(0, topos).rfind('/'); + + auto rpos = refname.find(':'); + if (rpos == refname.npos) { + name = noNamespace(name); + } else { + if (name.find(':') == name.npos) { + refname.remove_prefix(rpos + 1); } - - return arePathsMatching; - }); - // If a path within one SpecPar section is found matching, return the SpecPar section. - if (foundMatchingXMLPath != end(mySpecParXMLSection->paths)) { - return mySpecParXMLSection; + } + auto cpos = refname.rfind('['); + if (cpos != refname.npos) { + if (std::stoi(std::string(refname.substr(cpos + 1, refname.rfind(']')))) == copyNum()) { + refname.remove_suffix(refname.size() - cpos); + flag = true; + continue; + } else { + flag = false; + break; + } + } + if (!dd4hep::dd::isRegex(refname)) { + if (!dd4hep::dd::compareEqual(name, refname)) { + flag = false; + break; + } else { + flag = true; + continue; + } + } else { + if (!regex_match(std::string(name.data(), name.size()), regex(std::string(refname)))) { + flag = false; + break; + } else { + flag = true; + continue; + } + } + } + return flag; + }); + if (k != end(i->paths)) { + return i; } } From 9d77d2135fb1a08aa23b4a371111f68e5ec2cf99 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Thu, 8 Oct 2020 14:19:57 +0200 Subject: [PATCH 334/778] Different file name for DD4hep Module Numbering test, in view of integration of test comparisons to IBs. --- .../TrackerNumberingBuilder/interface/GeometricDet.h | 3 +++ .../TrackerNumberingBuilder/test/ModuleNumbering.cc | 10 ++++++---- .../test/trackerModuleNumberingDD4hep_cfg.py | 10 +++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h index 14384bcb316b3..108489bd721c5 100644 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h +++ b/Geometry/TrackerNumberingBuilder/interface/GeometricDet.h @@ -138,6 +138,9 @@ class GeometricDet { bool isUpperSensor() const { return isUpperSensor_; } double siliconAPVNum() const { return siliconAPVNum_; } + // DETECTOR DESCRIPTION ORIGIN INFO + bool isFromDD4hep() const { return isFromDD4hep_; } + // CHILDREN INFO GeometricDet* component(size_t index) { return const_cast<GeometricDet*>(container_[index]); } bool isLeaf() const { return container_.empty(); } diff --git a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc index 485c83f69519c..713ce1076f071 100644 --- a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc +++ b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc @@ -175,10 +175,6 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i edm::LogInfo("ModuleNumbering") << "begins"; - // output file - std::ofstream Output("ModuleNumbering.log", std::ios::out); - // - // reset counters iOK = 0; iERROR = 0; @@ -208,6 +204,12 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i edm::LogInfo("ModuleNumbering") << " And Contains Daughters: " << rDD.product()->deepComponents().size() << std::endl; + + // output file + const std::string& outputFileName = + (!rDD.product()->isFromDD4hep() ? "ModuleNumbering.log" : "ModuleNumbering_dd4hep.log"); + std::ofstream Output(outputFileName, std::ios::out); + CmsTrackerDebugNavigator nav(*rDDE.product()); nav.dump(*rDD.product(), *rDDE.product()); // diff --git a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py index 5c66cd1cd4ad2..7de65f1efb6ab 100644 --- a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py +++ b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumberingDD4hep_cfg.py @@ -19,13 +19,13 @@ process.MessageLogger = cms.Service( "MessageLogger", - statistics = cms.untracked.vstring('cout', 'tkmodulenumbering'), - categories = cms.untracked.vstring('Geometry', 'ModuleNumbering'), + statistics = cms.untracked.vstring('cout', 'tkmodulenumbering_dd4hep'), + categories = cms.untracked.vstring('Geometry', 'ModuleNumbering_dd4hep'), cout = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noLineBreaks = cms.untracked.bool(True) ), - tkmodulenumbering = cms.untracked.PSet( + tkmodulenumbering_dd4hep = cms.untracked.PSet( INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), @@ -43,12 +43,12 @@ Geometry = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), - ModuleNumbering = cms.untracked.PSet( + ModuleNumbering_dd4hep = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) ), destinations = cms.untracked.vstring('cout', - 'tkmodulenumbering') + 'tkmodulenumbering_dd4hep') ) process.prod = cms.EDAnalyzer("ModuleNumbering") From a91559403f2849b41265b25a9a02c4dc609b7206 Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 8 Oct 2020 14:52:58 +0200 Subject: [PATCH 335/778] fix DDFilteredView::parameters() crashing with a pseudotrapezoid, and remove corresponding hack in DD4hep_volumeHandle.cc --- DetectorDescription/DDCMS/src/DDFilteredView.cc | 2 +- MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index c5f808a299fc3..7e8cc8bcea428 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -471,7 +471,7 @@ const std::vector<double> DDFilteredView::parameters() const { assert(node_); Volume currVol = node_->GetVolume(); // Boolean shapes are a special case - if (currVol->GetShape()->IsA() == TGeoCompositeShape::Class()) { + if (currVol->GetShape()->IsA() == TGeoCompositeShape::Class() and not dd4hep::isA<dd4hep::PseudoTrap>(currVol.solid())) { const TGeoCompositeShape* shape = static_cast<const TGeoCompositeShape*>(currVol->GetShape()); const TGeoBoolNode* boolean = shape->GetBoolNode(); while (boolean->GetLeftShape()->IsA() != TGeoBBox::Class()) { diff --git a/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc b/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc index c5163a16db487..9f7b623c2c424 100644 --- a/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc +++ b/MagneticField/GeomBuilder/src/DD4hep_volumeHandle.cc @@ -90,7 +90,7 @@ volumeHandle::volumeHandle(const cms::DDFilteredView &fv, bool expand2Pi, bool d buildTubs(zhalf, rIn, rOut, startPhi, deltaPhi); } break; case DDSolidShape::ddpseudotrap: { - vector<double> d = solid.volume().volume().solid().dimensions(); + vector<double> d = solid.parameters(); buildPseudoTrap(d[0], d[1], d[2], d[3], d[4], d[5], d[6]); } break; case DDSolidShape::ddtrunctubs: { From 718908f7a54757c436ee4e0148019a801ba195fd Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 8 Oct 2020 15:20:18 +0200 Subject: [PATCH 336/778] code-format --- DetectorDescription/DDCMS/src/DDFilteredView.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 7e8cc8bcea428..1a5e2411b7d23 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -471,7 +471,8 @@ const std::vector<double> DDFilteredView::parameters() const { assert(node_); Volume currVol = node_->GetVolume(); // Boolean shapes are a special case - if (currVol->GetShape()->IsA() == TGeoCompositeShape::Class() and not dd4hep::isA<dd4hep::PseudoTrap>(currVol.solid())) { + if (currVol->GetShape()->IsA() == TGeoCompositeShape::Class() and + not dd4hep::isA<dd4hep::PseudoTrap>(currVol.solid())) { const TGeoCompositeShape* shape = static_cast<const TGeoCompositeShape*>(currVol->GetShape()); const TGeoBoolNode* boolean = shape->GetBoolNode(); while (boolean->GetLeftShape()->IsA() != TGeoBBox::Class()) { From 1d33be2d6015ca1288068aeaff9bbfae3c2cc121 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sun, 22 Sep 2019 20:49:17 +0200 Subject: [PATCH 337/778] commit VH technical integration changes only - VH switched off by default --- CommonTools/RecoAlgos/src/ClusterStorer.cc | 5 + DataFormats/TrackerRecHit2D/BuildFile.xml | 19 +- .../interface/BaseTrackerRecHit.h | 8 +- .../TrackerRecHit2D/interface/TkCloner.h | 3 + .../TrackerRecHit2D/interface/VectorHit.h | 164 +++ .../TrackerRecHit2D/interface/VectorHit2D.h | 32 + .../interface/trackerHitRTTI.h | 4 +- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 452 +++++++ DataFormats/TrackerRecHit2D/src/classes.h | 121 +- .../TrackerRecHit2D/src/classes_def.xml | 15 + .../src/TrackerGeomBuilderFromGeometricDet.cc | 4 +- .../python/RecoLocalTracker_cff.py | 1 + .../SiPhase2VectorHitBuilder/BuildFile.xml | 16 + .../interface/VectorHitBuilderAlgorithm.h | 80 ++ .../interface/VectorHitBuilderAlgorithmBase.h | 75 ++ .../interface/VectorHitBuilderEDProducer.h | 41 + .../plugins/BuildFile.xml | 4 + .../plugins/SealModules.cc | 11 + .../SiPhase2RecHitMatcherESProducer.cc | 34 + .../plugins/SiPhase2RecHitMatcherESProducer.h | 23 + .../python/SiPhase2RecHitMatcher_cfi.py | 17 + .../python/SiPhase2VectorHitBuilder_cfi.py | 12 + .../src/VectorHitBuilderAlgorithm.cc | 397 ++++++ .../src/VectorHitBuilderAlgorithmBase.cc | 151 +++ .../src/VectorHitBuilderEDProducer.cc | 107 ++ .../test/BuildFile.xml | 33 + .../test/ClustersValidationTGraph.cc | 584 +++++++++ .../test/Clusters_productionAndTesting.py | 103 ++ .../test/VHs_combinatorialStudies_PU200.py | 123 ++ .../test/VHs_productionAndTesting.py | 114 ++ ...oductionAndTesting_TenMuExtendedE_0_200.py | 105 ++ .../test/VectorHitsValidation.cc | 1154 +++++++++++++++++ .../test/VectorHitsValidation.h | 144 ++ .../test/step3_SeedingOT_tilted.py | 117 ++ .../src/SeedClusterRemoverPhase2.cc | 38 +- .../src/TrackClusterRemoverPhase2.cc | 14 + RecoTracker/CkfPattern/src/PrintoutHelper.cc | 10 +- .../plugins/DuplicateTrackMerger.cc | 10 + .../plugins/TrackerRecoGeometryESProducer.cc | 9 +- .../TrackerRecoGeometryESProducer_cfi.py | 6 +- RecoTracker/MeasurementDet/BuildFile.xml | 1 + .../plugins/MeasurementTrackerESProducer.cc | 9 + .../MeasurementTrackerEventProducer.cc | 3 + .../plugins/MeasurementTrackerImpl.cc | 5 +- .../plugins/MeasurementTrackerImpl.h | 1 + .../plugins/TkStackMeasurementDet.cc | 106 +- .../plugins/TkStackMeasurementDet.h | 18 +- .../MeasurementTrackerESProducer_cfi.py | 1 + .../MeasurementDet/src/TkMeasurementDetSet.cc | 1 + .../MeasurementDet/src/TkMeasurementDetSet.h | 11 +- .../Record/interface/CkfComponentsRecord.h | 1 + .../interface/GeometricSearchTrackerBuilder.h | 5 +- .../src/GeometricSearchTrackerBuilder.cc | 35 +- .../src/Phase2EndcapLayerBuilder.cc | 17 +- .../src/Phase2EndcapLayerBuilder.h | 4 +- .../src/Phase2EndcapRingBuilder.cc | 9 +- .../src/Phase2OTBarrelLayerBuilder.cc | 35 +- .../src/Phase2OTBarrelLayerBuilder.h | 7 +- .../TkDetLayers/src/Phase2OTBarrelRod.cc | 10 +- .../TkDetLayers/src/Phase2OTBarrelRod.h | 4 +- .../src/Phase2OTBarrelRodBuilder.cc | 119 +- .../src/Phase2OTBarrelRodBuilder.h | 7 +- .../interface/SeedingOTEDProducer.h | 71 + .../TkSeedGenerator/plugins/SealModules.cc | 3 + .../src/SeedingOTEDProducer.cc | 445 +++++++ .../TkSeedingLayers/src/HitExtractorSTRP.cc | 527 ++++---- .../TkSeedingLayers/src/HitExtractorSTRP.h | 10 + .../src/SeedingLayerSetsBuilder.cc | 3 + .../interface/TkClonerImpl.h | 3 +- ...ransientTrackingRecHitBuilderESProducer.cc | 1 + .../src/TkClonerImpl.cc | 9 + .../plugins/QuickTrackAssociatorByHitsImpl.cc | 9 +- 72 files changed, 5450 insertions(+), 400 deletions(-) create mode 100644 DataFormats/TrackerRecHit2D/interface/VectorHit.h create mode 100644 DataFormats/TrackerRecHit2D/interface/VectorHit2D.h create mode 100644 DataFormats/TrackerRecHit2D/src/VectorHit.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/BuildFile.xml create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting_TenMuExtendedE_0_200.py create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/step3_SeedingOT_tilted.py create mode 100644 RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h create mode 100644 RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc diff --git a/CommonTools/RecoAlgos/src/ClusterStorer.cc b/CommonTools/RecoAlgos/src/ClusterStorer.cc index e08c16c59fc07..820837d660ab1 100644 --- a/CommonTools/RecoAlgos/src/ClusterStorer.cc +++ b/CommonTools/RecoAlgos/src/ClusterStorer.cc @@ -9,6 +9,7 @@ #include "DataFormats/TrackerRecHit2D/interface/ProjectedSiStripRecHit2D.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h" #include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" // FastSim hits: #include "DataFormats/TrackerRecHit2D/interface/FastTrackerRecHit.h" #include "DataFormats/TrackerRecHit2D/interface/FastProjectedTrackerRecHit.h" @@ -47,6 +48,10 @@ namespace helper { //std::cout << "| It is a Phase2TrackerRecHit1D hit !!" << std::endl; phase2OTClusterRecords_.push_back( Phase2OTClusterHitRecord(static_cast<Phase2TrackerRecHit1D &>(newHit), hits, index)); + } else if (hit_type == typeid(VectorHit)) { + //FIXME:: this is just temporary solution for phase2, + //the VectorHit has 2 clusters but just a hit! + phase2OTClusterRecords_.push_back(Phase2OTClusterHitRecord(static_cast<VectorHit&>(newHit), hits, index)); } else { if (hit_type == typeid(FastTrackerRecHit) || hit_type == typeid(FastProjectedTrackerRecHit) || hit_type == typeid(FastMatchedTrackerRecHit)) { diff --git a/DataFormats/TrackerRecHit2D/BuildFile.xml b/DataFormats/TrackerRecHit2D/BuildFile.xml index 17ee9fb29a2e0..085dd084880ff 100644 --- a/DataFormats/TrackerRecHit2D/BuildFile.xml +++ b/DataFormats/TrackerRecHit2D/BuildFile.xml @@ -1,12 +1,13 @@ -<use name="DataFormats/Common"/> -<use name="DataFormats/CLHEP"/> -<use name="DataFormats/FTLRecHit"/> -<use name="DataFormats/TrackingRecHit"/> -<use name="DataFormats/TrajectorySeed"/> -<use name="DataFormats/Phase2TrackerCluster"/> -<use name="FWCore/MessageLogger"/> -<use name="FWCore/Framework"/> -<use name="Geometry/CommonDetUnit"/> +<use name="DataFormats/Common"/> +<use name="DataFormats/CLHEP"/> +<use name="DataFormats/FTLRecHit"/> +<use name="DataFormats/TrackingRecHit"/> +<use name="DataFormats/TrajectorySeed"/> +<use name="DataFormats/Phase2TrackerCluster"/> +<use name="FWCore/MessageLogger"/> +<use name="FWCore/Framework"/> +<use name="Geometry/CommonDetUnit"/> +<use name="Geometry/TrackerGeometryBuilder"/> <export> <lib name="1"/> </export> diff --git a/DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h b/DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h index 9928e44849e48..79a8fdfe4d2bc 100644 --- a/DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h +++ b/DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h @@ -23,6 +23,7 @@ class BaseTrackerRecHit : public TrackingRecHit { // no position (as in persistent) BaseTrackerRecHit(DetId id, trackerHitRTTI::RTTI rt) : TrackingRecHit(id, (unsigned int)(rt)), qualWord_(0) {} + BaseTrackerRecHit(const GeomDet & idet, trackerHitRTTI::RTTI rt) : TrackingRecHit(idet,(unsigned int)(rt)),qualWord_(0) {} BaseTrackerRecHit(const LocalPoint& p, const LocalError& e, GeomDet const& idet, trackerHitRTTI::RTTI rt) : TrackingRecHit(idet, (unsigned int)(rt)), pos_(p), err_(e), qualWord_(0) { @@ -49,18 +50,17 @@ class BaseTrackerRecHit : public TrackingRecHit { // verify that hits can share clusters... inline bool sameDetModule(TrackingRecHit const& hit) const; - bool hasPositionAndError() const final; + bool hasPositionAndError() const override; - LocalPoint localPosition() const final { + LocalPoint localPosition() const override{ check(); return pos_; } - LocalError localPositionError() const final { + LocalError localPositionError() const override{ check(); return err_; } - const LocalPoint& localPositionFast() const { check(); return pos_; diff --git a/DataFormats/TrackerRecHit2D/interface/TkCloner.h b/DataFormats/TrackerRecHit2D/interface/TkCloner.h index ed6ea47cd5d8d..81412962b97e6 100644 --- a/DataFormats/TrackerRecHit2D/interface/TkCloner.h +++ b/DataFormats/TrackerRecHit2D/interface/TkCloner.h @@ -11,6 +11,7 @@ class SiStripRecHit1D; class SiStripMatchedRecHit2D; class ProjectedSiStripRecHit2D; class Phase2TrackerRecHit1D; +class VectorHit; class TkCloner { public: @@ -39,6 +40,7 @@ class TkCloner { TrajectoryStateOnSurface const& tsos) const = 0; virtual std::unique_ptr<Phase2TrackerRecHit1D> operator()(Phase2TrackerRecHit1D const& hit, TrajectoryStateOnSurface const& tsos) const = 0; + virtual std::unique_ptr<VectorHit> operator()(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const=0; #ifndef __GCCXML__ virtual TrackingRecHit::ConstRecHitPointer makeShared(SiPixelRecHit const& hit, @@ -53,6 +55,7 @@ class TkCloner { TrajectoryStateOnSurface const& tsos) const = 0; virtual TrackingRecHit::ConstRecHitPointer makeShared(Phase2TrackerRecHit1D const& hit, TrajectoryStateOnSurface const& tsos) const = 0; + virtual TrackingRecHit::ConstRecHitPointer makeShared(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const=0; #endif }; #endif diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h new file mode 100644 index 0000000000000..693e332611e51 --- /dev/null +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -0,0 +1,164 @@ +#ifndef TrackerRecHit2D_VectorHit_h +#define TrackerRecHit2D_VectorHit_h + +/** \class VectorHit + * + * 4-parameter RecHits for Phase2 Tracker (x,y, dx/dz, dy/dz) + * + * $Date: 2015/03/30 $ + * \author Erica Brondolin + * + */ + +#include "DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit2D.h" +#include "DataFormats/TrackerRecHit2D/interface/OmniClusterRef.h" + +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" + +#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "DataFormats/GeometryVector/interface/LocalVector.h" +#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" +#include "MagneticField/Engine/interface/MagneticField.h" + +#include "DataFormats/TrackingRecHit/interface/KfComponentsHolder.h" + +#include "TkCloner.h" + +class VectorHit GCC11_FINAL : public BaseTrackerRecHit { + + public: + + typedef OmniClusterRef::Phase2Cluster1DRef ClusterRef; + + VectorHit() : thePosition(), theDirection(), theCovMatrix(), theDimension(0) { setType(bad); } + + VectorHit(const VectorHit& vh) ; + + VectorHit(const GeomDet& idet, const LocalPoint& posInner, const LocalVector& dir, + const AlgebraicSymMatrix& covMatrix, const double& Chi2, + OmniClusterRef const& lower, OmniClusterRef const& upper) ; + + VectorHit(const GeomDet& idet, const VectorHit2D& vh2Dzx, const VectorHit2D& vh2Dzy, + OmniClusterRef const& lower, OmniClusterRef const& upper) ; + + ~VectorHit() ; + + virtual VectorHit* clone() const override { return new VectorHit(*this);} +#ifndef __GCCXML__ + virtual RecHitPointer cloneSH() const override { return std::make_shared<VectorHit>(*this);} +#endif + + virtual bool sharesInput( const TrackingRecHit* other, SharedInputType what) const override; + bool sharesClusters(VectorHit const & h1, VectorHit const & h2, + SharedInputType what) const ; + + // Parameters of the segment, for the track fit + // For a 4D segment: (dx/dz,dy/dz,x,y) + bool hasPositionAndError() const GCC11_FINAL{ + //bool hasPositionAndError() const { + return true; +// return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) || +// (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0); + }; + + virtual AlgebraicVector parameters() const override; + virtual void getKfComponents( KfComponentsHolder & holder ) const override { getKfComponents4D(holder); } + void getKfComponents4D( KfComponentsHolder & holder ) const ; + + // returning methods + LocalPoint localPosition() const GCC11_FINAL { return thePosition; } + virtual LocalVector localDirection() const { return theDirection; } + AlgebraicSymMatrix parametersError() const override ; + LocalError localPositionError() const GCC11_FINAL ; + virtual LocalError localDirectionError() const ; + Global3DVector globalDirection() const; + + virtual double chi2() const { return theChi2; } + virtual int dimension() const override { return theDimension; } + + std::pair<double,double> curvatureORphi(std::string curvORphi = "curvature") const ; + float transverseMomentum(const MagneticField* magField); + float momentum(const MagneticField* magField); + + ClusterRef lowerCluster() const { return theLowerCluster.cluster_phase2OT(); } + ClusterRef upperCluster() const { return theUpperCluster.cluster_phase2OT(); } + OmniClusterRef const lowerClusterRef() const { return theLowerCluster; } + OmniClusterRef const upperClusterRef() const { return theUpperCluster; } + + //FIXME::to update with a proper CPE maybe... + Global3DPoint lowerGlobalPos() const ; + Global3DPoint upperGlobalPos() const ; + Global3DPoint phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) const; + GlobalError lowerGlobalPosErr() const ; + GlobalError upperGlobalPosErr() const ; + GlobalError phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet) const; + + virtual bool isPhase2() const override { return true; } + + //FIXME: I have always two clusters in a VH + virtual OmniClusterRef const & firstClusterRef() const GCC11_FINAL { return theLowerCluster;} + ClusterRef cluster() const { return theLowerCluster.cluster_phase2OT(); } + + //This method returns the delta in global coordinates + Global3DVector globalDelta() const; + float theta(); + + /// The projection matrix relates the trajectory state parameters to the segment parameters(). + virtual AlgebraicMatrix projectionMatrix() const override; + + // Degrees of freedom of the segment fit + virtual int degreesOfFreedom() const { return 0; } //number of hits (2+2) - dimension + + // Access to component RecHits (if any) + virtual std::vector<const TrackingRecHit*> recHits() const override; + virtual std::vector<TrackingRecHit*> recHits() override ; + + // setting methods + void setPosition(LocalPoint pos) { thePosition = pos; } + void setDirection(LocalVector dir) { theDirection = dir; } + void setCovMatrix(AlgebraicSymMatrix mat) { theCovMatrix = mat; } + + private: + // double dispatch + virtual VectorHit * clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override{ + return cloner(*this,tsos).release(); + } + virtual RecHitPointer cloneSH_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override{ + return cloner.makeShared(*this,tsos); + } + + LocalPoint thePosition; + LocalVector theDirection; + + // the covariance matrix, has the following meaning + // mat[0][0]=var(dx/dz) + // mat[1][1]=var(dy/dz) + // mat[2][2]=var(x) + // mat[3][3]=var(y) + // mat[0][2]=cov(dx/dz,x) + // mat[1][3]=cov(dy/dz,y) + AlgebraicSymMatrix theCovMatrix; + double theChi2; + int theDimension; + OmniClusterRef theLowerCluster; + OmniClusterRef theUpperCluster; + +}; + +inline bool operator<( const VectorHit& one, const VectorHit& other) { + + if ( one.chi2() > other.chi2() ) { + return true; + } + + return false; +} + +std::ostream& operator<<(std::ostream& os, const VectorHit& vh); + +typedef edmNew::DetSetVector<VectorHit> VectorHitCollection; +typedef VectorHitCollection VectorHitCollectionNew; + +#endif diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h new file mode 100644 index 0000000000000..91438a397746e --- /dev/null +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -0,0 +1,32 @@ +#ifndef TrackingRecHit_VectorHit2D_h +#define TrackingRecHit_VectorHit2D_h + +#include "DataFormats/GeometryVector/interface/LocalVector.h" +#include "DataFormats/GeometryVector/interface/LocalPoint.h" + +class VectorHit2D { + + public: + VectorHit2D() : thePosition(), theDirection(), theCovMatrix(), theChi2(), theDimension(2) {} + VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& Chi2) : + thePosition(pos), theDirection(dir), theCovMatrix(covMatrix), theChi2(Chi2), theDimension(2){}; + virtual ~VectorHit2D() {}; + + LocalPoint localPosition() const { return thePosition; } + LocalVector localDirection() const { return theDirection; } + LocalError localDirectionError() const { return LocalError(theCovMatrix[0][0],theCovMatrix[0][1],theCovMatrix[1][1]); } + AlgebraicSymMatrix22 covMatrix() const { return theCovMatrix; } + double chi2() const { return theChi2; } + int degreesOfFreedom() const { return 0; } //number of hits (2) - dimension + int dimension() const { return 2; } + + private: + LocalPoint thePosition; + LocalVector theDirection; + AlgebraicSymMatrix22 theCovMatrix; + double theChi2; + int theDimension; + +}; +#endif + diff --git a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h index 23370e4284049..6268b68ca0d8b 100644 --- a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h +++ b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h @@ -17,7 +17,8 @@ namespace trackerHitRTTI { fastProjMono = 8, fastMatch = 9, notFromCluster = 10, - mipTiming = 11 + mipTiming = 11, + vector = 12 }; inline RTTI rtti(TrackingRecHit const& hit) { return RTTI(hit.getRTTI()); } inline bool isUndef(TrackingRecHit const& hit) { return rtti(hit) == undef; } @@ -36,6 +37,7 @@ namespace trackerHitRTTI { inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); } inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 10); } inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; } + inline bool isVector(TrackingRecHit const & hit) { return rtti(hit)==vector;} inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; } } // namespace trackerHitRTTI diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc new file mode 100644 index 0000000000000..83ebea20d2b11 --- /dev/null +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -0,0 +1,452 @@ +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" + +VectorHit::VectorHit(const VectorHit& vh): + BaseTrackerRecHit(*vh.det(), trackerHitRTTI::vector), + thePosition(vh.localPosition()), + theDirection(vh.localDirection()), + theCovMatrix(vh.parametersError()), + theChi2(vh.chi2()), + theDimension(vh.dimension()), + theLowerCluster(vh.lowerClusterRef()), + theUpperCluster(vh.upperClusterRef()) +{} + +VectorHit::VectorHit(const GeomDet& idet, + const LocalPoint& posLower, + const LocalVector& dir, + const AlgebraicSymMatrix& covMatrix, + const double& Chi2, + OmniClusterRef const& lower, OmniClusterRef const& upper) : + BaseTrackerRecHit(idet, trackerHitRTTI::vector), + thePosition(posLower), + theDirection(dir), + theCovMatrix(covMatrix), + theChi2(Chi2), + theDimension(4), + theLowerCluster(lower), + theUpperCluster(upper) +{} + +VectorHit::VectorHit(const GeomDet& idet, const VectorHit2D& vh2Dzx, const VectorHit2D& vh2Dzy, + OmniClusterRef const& lower, OmniClusterRef const& upper) : + BaseTrackerRecHit(idet, trackerHitRTTI::vector), + theDimension(4), + theLowerCluster(lower), + theUpperCluster(upper) +{ + thePosition = LocalPoint(vh2Dzx.localPosition().x(), vh2Dzy.localPosition().x(), 0.); + + theDirection = LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), 1.); + //theDirection = LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), vh2Dzy.localDirection().z()); + //theDirection = theDirection.unit(); + + //building the cov matrix 4x4 starting from the 2x2 + AlgebraicSymMatrix22 covMatZX = vh2Dzx.covMatrix(); + AlgebraicSymMatrix22 covMatZY = vh2Dzy.covMatrix(); + + theCovMatrix=AlgebraicSymMatrix(4); + theCovMatrix[0][0] = covMatZX[0][0]; // var(dx/dz) + theCovMatrix[1][1] = covMatZY[0][0]; // var(dy/dz) + theCovMatrix[2][2] = covMatZX[1][1]; // var(x) + theCovMatrix[3][3] = covMatZY[1][1]; // var(y) + theCovMatrix[0][2] = covMatZX[0][1]; // cov(dx/dz,x) + theCovMatrix[1][3] = covMatZY[0][1]; // cov(dy/dz,y) + + theChi2 = vh2Dzx.chi2() + vh2Dzy.chi2(); +} + +bool VectorHit::sharesInput( const TrackingRecHit* other, SharedInputType what) const +{ + if (what==all && (geographicalId() != other->geographicalId())) return false; + + if (!sameDetModule(*other)) return false; + + if (trackerHitRTTI::isVector(*other) ) { + const VectorHit* otherVh = static_cast<const VectorHit*>(other); + return sharesClusters(*this, *otherVh, what); + } + + if (what==all) return false; + + // what about multi??? + auto const & otherClus = reinterpret_cast<const BaseTrackerRecHit *>(other)->firstClusterRef(); + return (otherClus==lowerClusterRef()) || (otherClus==upperClusterRef()); + +} + +bool VectorHit::sharesClusters(VectorHit const & h1, VectorHit const & h2, + SharedInputType what) const { + bool lower = h1.lowerClusterRef()== h2.lowerClusterRef(); + bool upper = h1.upperClusterRef()== h2.upperClusterRef(); + + return (what==TrackingRecHit::all) ? (lower && upper) : (upper||lower); + +} + +void VectorHit::getKfComponents4D( KfComponentsHolder & holder ) const { + //if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents"); + AlgebraicVector4 & pars = holder.params<4>(); + pars[0] = theDirection.x(); + pars[1] = theDirection.y(); + pars[2] = thePosition.x(); + pars[3] = thePosition.y(); + + AlgebraicSymMatrix44 & errs = holder.errors<4>(); + for(int i = 0; i < 4; i++){ + for(int j = 0; j < 4; j++){ + errs(i,j) = theCovMatrix[i][j]; + } + } + + ProjectMatrix<double,5,4> & pf = holder.projFunc<4>(); + pf.index[0] = 1; + pf.index[1] = 2; + pf.index[2] = 3; + pf.index[3] = 4; + + holder.measuredParams<4>() = AlgebraicVector4( & holder.tsosLocalParameters().At(1), 4 ); + holder.measuredErrors<4>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>( 1, 1 ); + +} + +VectorHit::~VectorHit() {} + +AlgebraicVector VectorHit::parameters() const { + + // (dx/dz,dy/dz,x,y) + AlgebraicVector result(4); + + result[0] = theDirection.x(); + result[1] = theDirection.y(); + result[2] = thePosition.x(); + result[3] = thePosition.y(); + return result; + +} + +Global3DPoint VectorHit::lowerGlobalPos() const { + const StackGeomDet* stackDet = dynamic_cast< const StackGeomDet* >(det()); + const PixelGeomDetUnit* geomDetLower = dynamic_cast< const PixelGeomDetUnit* >(stackDet->lowerDet()); + return phase2clusterGlobalPos(geomDetLower, lowerCluster()); +} + +Global3DPoint VectorHit::upperGlobalPos() const { + const StackGeomDet* stackDet = dynamic_cast< const StackGeomDet* >(det()); + const PixelGeomDetUnit* geomDetUpper = dynamic_cast< const PixelGeomDetUnit* >(stackDet->upperDet()); + return phase2clusterGlobalPos(geomDetUpper, upperCluster()); +} + +Global3DPoint VectorHit::phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) const { + const PixelTopology * topo = &geomDet->specificTopology(); + float ix = cluster->center(); + float iy = cluster->column()+0.5; // halfway the column + LocalPoint lp( topo->localX(ix), topo->localY(iy), 0 ); // x, y, z + Global3DPoint gp = geomDet->surface().toGlobal(lp); + return gp; +} + +GlobalError VectorHit::lowerGlobalPosErr() const { + const StackGeomDet* stackDet = dynamic_cast< const StackGeomDet* >(det()); + const PixelGeomDetUnit* geomDetLower = dynamic_cast< const PixelGeomDetUnit* >(stackDet->lowerDet()); + return phase2clusterGlobalPosErr(geomDetLower); +} + +GlobalError VectorHit::upperGlobalPosErr() const { + const StackGeomDet* stackDet = dynamic_cast< const StackGeomDet* >(det()); + const PixelGeomDetUnit* geomDetUpper = dynamic_cast< const PixelGeomDetUnit* >(stackDet->upperDet()); + return phase2clusterGlobalPosErr(geomDetUpper); +} + +GlobalError VectorHit::phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet) const { + const PixelTopology * topo = &geomDet->specificTopology(); + float pitchX = topo->pitch().first; + float pitchY = topo->pitch().second; + LocalError le( pow(pitchX, 2) / 12., 0, pow(pitchY, 2) / 12.); // e2_xx, e2_xy, e2_yy + GlobalError ge( ErrorFrameTransformer().transform( le, geomDet->surface() )); + return ge; +} + +Global3DVector VectorHit::globalDelta() const { + Local3DVector theLocalDelta = LocalVector(theDirection.x()*theDirection.z(), theDirection.y()*theDirection.z(), theDirection.z()); + Global3DVector g = det()->surface().toGlobal(theLocalDelta); + return g; +} + +Global3DVector VectorHit::globalDirection() const { + return (det()->surface().toGlobal(localDirection())); +} + +std::pair<double,double> VectorHit::curvatureORphi(std::string curvORphi) const { + + double curvature = 0.0; + double errorCurvature = 0.0; + double phi = 0.0; + + //global pos and errors + Global3DPoint gPositionLower = lowerGlobalPos(); + Global3DPoint gPositionUpper = upperGlobalPos(); + + GlobalError gErrorLower = lowerGlobalPosErr(); + GlobalError gErrorUpper = upperGlobalPosErr(); + + //insert lower and upper in the global sor + if(gPositionLower.perp() > gPositionUpper.perp()){ + gPositionLower = upperGlobalPos(); + gPositionUpper = lowerGlobalPos(); + gErrorLower = upperGlobalPosErr(); + gErrorUpper = lowerGlobalPosErr(); + } + + double h1 = gPositionLower.x()*gPositionUpper.y() - gPositionUpper.x()*gPositionLower.y(); + + //determine sign of curvature + AlgebraicVector2 n1; + n1[0] = -gPositionLower.y(); + n1[1] = gPositionLower.x(); + AlgebraicVector2 n2; + n2[0] = gPositionUpper.x()-gPositionLower.x(); + n2[1] = gPositionUpper.y()-gPositionLower.y(); + + double n3 = n1[0]*n2[0] + n1[1]*n2[1]; + double signCurv = -copysign(1.0,n3); + double phi1 = atan2(gPositionUpper.y()-gPositionLower.y(),gPositionUpper.x()-gPositionLower.x()); + + if(h1!=0) { + double h2 = 2*h1; + double r12 = pow(gPositionLower.x(),2) + pow(gPositionLower.y(),2); + double r22 = pow(gPositionUpper.x(),2) + pow(gPositionUpper.y(),2); + double h3 = (pow(gPositionLower.x(),2) - 2.*gPositionLower.x()*gPositionUpper.x() + pow(gPositionUpper.x(),2) + pow(gPositionLower.y(),2) - 2.*gPositionLower.y()*gPositionUpper.y() + pow(gPositionUpper.y(),2)); + double h4 = - pow(gPositionLower.x(),2)*gPositionUpper.x() + gPositionLower.x()*pow(gPositionUpper.x(),2) + + gPositionLower.x()*pow(gPositionUpper.y(),2) - gPositionUpper.x()*pow(gPositionLower.y(),2); + double h5 = pow(gPositionLower.x(),2)*gPositionUpper.y() - pow(gPositionUpper.x(),2)*gPositionLower.y() + + pow(gPositionLower.y(),2)*gPositionUpper.y() - gPositionLower.y()*pow(gPositionUpper.y(),2); + + //radius of circle + double rho = sqrt(r12*r22*h3)/(2.*h1); + curvature = 1./rho; + + //center of circle + double xcentre = h5/h2; + double ycentre = h4/h2; + + //to compute phi at the cluster points + double xtg = gPositionLower.y() - ycentre; + double ytg = -( gPositionLower.x() - xcentre); + + //to compute phi at the origin + //double xtg = ycentre; + //double ytg = -(xcentre); + phi = atan2(ytg,xtg); + + AlgebraicROOTObject<4,4>::Matrix jacobian; + for(int i = 0; i < 4; i++){ + for(int j = 0; j < 4; j++){ + jacobian[i][j] = 0.0; + } + } + + jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 + jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 + jacobian[2][0] = (h1*(2.*gPositionLower.x()*r22*h3 + (2.*gPositionLower.x() - 2.*gPositionUpper.x())*r12*r22))/(pow(r12*r22*h3,1.5)) + - (2.*gPositionUpper.y())/sqrt(r12*r22*h3); // dkappa/dx1 + jacobian[2][1] = (2.*gPositionUpper.x())/sqrt(r12*r22*h3) + (h1*(2.*gPositionLower.y()*r22*h3 + r12*r22*(2.*gPositionLower.y() + - 2.*gPositionUpper.y())))/pow(r12*r22*h3,1.5); // dkappa/dy1 + jacobian[2][2] = (2.*gPositionLower.y())/sqrt(r12*r22*h3) + (h1*(2.*gPositionUpper.x()*r12*h3 + - 2.*(gPositionLower.x() - gPositionUpper.x())*r12*r22))/pow(r12*r22*h3,1.5); // dkappa/dx2 + jacobian[2][3] = (h1*(2.*gPositionUpper.y()*r12*h3 - r12*r22*2.*(gPositionLower.y() - gPositionUpper.y())))/pow(r12*r22*h3,1.5) + - (2.*gPositionLower.x())/sqrt(r12*r22*h3); // dkappa/dy2 + + for(int i = 0; i < 4; i++){ + jacobian[2][i] = -jacobian[2][i]; + } + + AlgebraicVector2 M; + //to compute phi at the cluster points + M[0] = (gPositionLower.y() - ycentre)/pow(rho,2); // dphi/dxcentre + M[1] =-(gPositionLower.x() - xcentre)/pow(rho,2); // dphi/dycentre + //to compute phi at the origin + //float x0 = 0.0; + //float y0 = 0.0; + //M[0] = (y0 - ycentre)/pow(rho,2); // dphi/dxcentre + //M[1] =-(x0 - xcentre)/pow(rho,2); // dphi/dycentre + + AlgebraicROOTObject<2,4>::Matrix K; + K[0][0]=(2.*gPositionLower.x()*gPositionUpper.y())/h2 - (2.*gPositionUpper.y()*h5)/pow(h2,2); // dxm/dx1 + K[0][1]=(2.*gPositionUpper.x()*h5)/pow(h2,2) - (pow(gPositionUpper.x(),2) + pow(gPositionUpper.y(),2) - 2.*gPositionLower.y()*gPositionUpper.y())/h2; // dxm/dy1 + K[0][2]=(2.*gPositionLower.y()*h5)/pow(h2,2) - (2.*gPositionUpper.x()*gPositionLower.y())/h2; // dxm/dx2 + K[0][3]=(pow(gPositionLower.x(),2) + pow(gPositionLower.y(),2) - 2.*gPositionUpper.y()*gPositionLower.y())/h2 - (2.*gPositionLower.x()*h5)/pow(h2,2); // dxm/dy2 + K[1][0]=(pow(gPositionUpper.x(),2) - 2.*gPositionLower.x()*gPositionUpper.x() + pow(gPositionUpper.y(),2))/h2 - (2.*gPositionUpper.y()*h4)/pow(h2,2); // dym/dx1 + K[1][1]=(2.*gPositionUpper.x()*h4)/pow(h2,2) - (2.*gPositionUpper.x()*gPositionLower.y())/h2; // dym/dy1 + K[1][2]=(2.*gPositionLower.y()*h4)/pow(h2,2) - (pow(gPositionLower.x(),2) - 2.*gPositionUpper.x()*gPositionLower.x() + pow(gPositionLower.y(),2))/h2; // dym/dx2 + K[1][3]=(2.*gPositionLower.x()*gPositionUpper.y())/h2 - (2.*gPositionLower.x()*h4)/pow(h2,2); // dym/dy2 + + AlgebraicVector4 N = M*K; + jacobian[3][0] = N[0]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][1] = N[1]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][2] = N[2]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][3] = N[3]; // dphi/(dx1,dy1,dx2,dy2) + + //assign correct sign to the curvature errors + if( (signCurv < 0 && curvature > 0 ) || (signCurv > 0 && curvature < 0 )){ + curvature=-curvature; + for(int i = 0; i < 4; i++){ + jacobian[2][i] = -jacobian[2][i]; + } + } + + // bring phi in the same quadrant as phi1 + if (abs(phi-phi1) > M_PI/2.){ + phi = phi+M_PI; + if (phi>M_PI) + phi=phi-2.*M_PI; + } + + //computing the curvature error + AlgebraicVector4 curvatureJacobian; + for(int i = 0; i < 4; i++){ + curvatureJacobian[i] = jacobian[2][i]; + } + + AlgebraicROOTObject<4,4>::Matrix gErrors; + for(int i = 0; i < 4; i++){ + for(int j = 0; j < 4; j++){ + gErrors[i][j] = 0.0; + } + } + + gErrors[0][0] = gErrorLower.cxx(); + gErrors[0][1] = gErrorLower.cyx(); + gErrors[1][0] = gErrorLower.cyx(); + gErrors[1][1] = gErrorLower.cyy(); + gErrors[2][2] = gErrorUpper.cxx(); + gErrors[2][3] = gErrorUpper.cyx(); + gErrors[3][2] = gErrorUpper.cyx(); + gErrors[3][3] = gErrorUpper.cyy(); + + AlgebraicVector4 temp = curvatureJacobian; + temp = temp*gErrors; + errorCurvature = temp[0]*curvatureJacobian[0] + temp[1]*curvatureJacobian[1] + temp[2]*curvatureJacobian[2] + temp[3]*curvatureJacobian[3]; + //if(curvORphi == "curvature") std::cout << "curvature: " << curvature << std::endl; + //if(curvORphi == "curvature") std::cout << "curvature error: " << errorCurvature << std::endl; + + + } else { +std::cout << " straight line!" << std::endl; + return std::make_pair(0.0,0.0); + } + + if( curvORphi == "curvature" ) return std::make_pair(curvature,errorCurvature); + else if( curvORphi == "phi" ) return std::make_pair(phi,0.0); + else return std::make_pair(0.0,0.0); + +} + +float VectorHit::transverseMomentum(const MagneticField* magField){ + + GlobalPoint center(0.0, 0.0, 0.0); + float magnT = magField->inTesla(center).mag(); + double rho = 1./curvatureORphi("curvature").first; + //0.003 is because the curvature (rho) is in cm and not in m + return (0.003*magnT*rho); + +} + +float VectorHit::momentum(const MagneticField* magField){ + return transverseMomentum(magField)/(1.*sin(theta())); +} + +float VectorHit::theta(){ + return globalDirection().theta(); +} + +AlgebraicMatrix VectorHit::projectionMatrix() const { + +// static bool isInitialized=false; + static AlgebraicMatrix the4DProjectionMatrix(4, 5, 0); +/* + static AlgebraicMatrix the2DPhiProjMatrix(2, 5, 0); + static AlgebraicMatrix the2DZProjMatrix(2, 5, 0); + + if (!isInitialized) { + the4DProjectionMatrix[0][1] = 1; + the4DProjectionMatrix[1][2] = 1; + the4DProjectionMatrix[2][3] = 1; + the4DProjectionMatrix[3][4] = 1; + + the2DPhiProjMatrix[0][1] = 1; + the2DPhiProjMatrix[1][3] = 1; + + the2DZProjMatrix[0][2] = 1; + the2DZProjMatrix[1][4] = 1; + + isInitialized= true; + } + + if (dimension()==4) { + return the4DProjectionMatrix; + } else if (theProjection==phi) { + return the2DPhiProjMatrix; + } else if (theProjection==Z) { + return the2DZProjMatrix; + } else { + return AlgebraicMatrix(); + } +*/ return the4DProjectionMatrix; //ERICA:QUESTO NON ESISTEVA!! +} + + +LocalError VectorHit::localPositionError() const { + return LocalError(theCovMatrix[2][2],theCovMatrix[2][3],theCovMatrix[3][3]); +} + + +LocalError VectorHit::localDirectionError() const { + return LocalError(theCovMatrix[0][0],theCovMatrix[0][1],theCovMatrix[1][1]); +} + + + +AlgebraicSymMatrix VectorHit::parametersError() const { + + //think about a more efficient method + AlgebraicSymMatrix result(4); + for(int i = 0; i < theDimension; i++){ + for(int j = 0; j < theDimension; j++){ + result[i][j] = theCovMatrix[i][j]; + } + } + return result; +} + +std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { + + os << " VectorHit create in the DetId#: " << vh.geographicalId() << "\n" << + " Vectorhit local position : " << vh.localPosition() << "\n" << + " Vectorhit local direction : " << vh.localDirection() << "\n" << + " Vectorhit global direction : " << vh.globalDirection() << "\n" << + //" Vectorhit theta : " << vh.theta() << "\n" << + //" Cov: " << vh.parametersError() << "\n" << + //" Dim: " << vh.dimension() << "\n" << + //" chi2/ndof: " << vh.chi2() << "/" << vh.degreesOfFreedom() << "\n" << + " Lower cluster global position : " << vh.lowerGlobalPos() << "\n" << + " Upper cluster global position : " << vh.upperGlobalPos(); + + return os; +} + + +/// Access to component RecHits (if any) +std::vector<const TrackingRecHit*> VectorHit::recHits() const{ + std::vector<const TrackingRecHit*> pointersOfRecHits; + return pointersOfRecHits; +} + + +/// Non-const access to component RecHits (if any) +std::vector<TrackingRecHit*> VectorHit::recHits(){ + + std::vector<TrackingRecHit*> pointersOfRecHits; + return pointersOfRecHits; +} + diff --git a/DataFormats/TrackerRecHit2D/src/classes.h b/DataFormats/TrackerRecHit2D/src/classes.h index 45302da925815..44ede301244ff 100644 --- a/DataFormats/TrackerRecHit2D/src/classes.h +++ b/DataFormats/TrackerRecHit2D/src/classes.h @@ -9,9 +9,10 @@ #include "DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" -#include "DataFormats/Common/interface/RefProd.h" -#include "DataFormats/SiStripCluster/interface/SiStripCluster.h" -#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/Common/interface/RefProd.h" +#include "DataFormats/SiStripCluster/interface/SiStripCluster.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/Ref.h" #include "DataFormats/Common/interface/RefVector.h" @@ -27,6 +28,118 @@ #include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" #include "DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h" #include "DataFormats/TrackerRecHit2D/interface/MTDTrackingRecHit.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include <vector> -#endif // SISTRIPRECHIT_CLASSES_H +namespace DataFormats_TrackerRecHit2D { + struct dictionary { + ProjectedSiStripRecHit2D projHit; + SiStripRecHit2D a1; + SiStripRecHit1D a11; + SiStripMatchedRecHit2D a2; + SiPixelRecHit b1; + + edm::ClonePolicy<SiStripRecHit2D> a4; + edm::ClonePolicy<SiStripRecHit1D> a44; + edm::ClonePolicy<SiStripMatchedRecHit2D > a5; + edm::ClonePolicy<SiPixelRecHit> b2; + edm::ClonePolicy<SiTrackerMultiRecHit> e2; + + edm::OwnVector<SiStripRecHit2D, + edm::ClonePolicy<SiStripRecHit2D> > a6; + edm::OwnVector<SiStripRecHit2D, + edm::ClonePolicy<SiStripRecHit2D> >::const_iterator it6; + edm::OwnVector<SiStripRecHit1D, + edm::ClonePolicy<SiStripRecHit1D> > a66; + edm::OwnVector<SiStripRecHit1D, + edm::ClonePolicy<SiStripRecHit1D> >::const_iterator it66; + edm::OwnVector<SiStripMatchedRecHit2D, + edm::ClonePolicy<SiStripMatchedRecHit2D> > a7; + edm::OwnVector<SiStripMatchedRecHit2D, + edm::ClonePolicy<SiStripMatchedRecHit2D> >::const_iterator it7; + edm::OwnVector<SiPixelRecHit, + edm::ClonePolicy<SiPixelRecHit> > b3; + edm::OwnVector<SiPixelRecHit, + edm::ClonePolicy<SiPixelRecHit> >::const_iterator it3; + edm::OwnVector<SiTrackerMultiRecHit, + edm::ClonePolicy<SiTrackerMultiRecHit> > e3; + edm::OwnVector<SiTrackerMultiRecHit, + edm::ClonePolicy<SiTrackerMultiRecHit> >::const_iterator it10; + + edm::OwnVector<BaseTrackerRecHit> ovbtrh; + edm::Wrapper<edm::OwnVector<BaseTrackerRecHit>> wovbtrh; + + edm::Wrapper< edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit2D, + edm::ClonePolicy<SiStripRecHit2D> >, + edm::ClonePolicy<SiStripRecHit2D> > > siStripRecHit2DLocalPosCollectionWrapper; + edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit2D, + edm::ClonePolicy<SiStripRecHit2D> >, + edm::ClonePolicy<SiStripRecHit2D> >::id_iterator it2d; + + edm::Wrapper< edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit1D, + edm::ClonePolicy<SiStripRecHit1D> >, + edm::ClonePolicy<SiStripRecHit1D> > > siStripRecHit1DLocalPosCollectionWrapper; + edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit1D, + edm::ClonePolicy<SiStripRecHit1D> >, + edm::ClonePolicy<SiStripRecHit1D> >::id_iterator it1d; + + + edm::Wrapper< edm::RangeMap<DetId, + edm::OwnVector<SiStripMatchedRecHit2D, + edm::ClonePolicy<SiStripMatchedRecHit2D> >, + edm::ClonePolicy<SiStripMatchedRecHit2D> > > siStripRecHit2DMatchedLocalPosCollectionWrapper; + edm::RangeMap<DetId, + edm::OwnVector<SiStripMatchedRecHit2D, + edm::ClonePolicy<SiStripMatchedRecHit2D> >, + edm::ClonePolicy<SiStripMatchedRecHit2D> >::id_iterator itmatch; + + edm::Wrapper< edm::RangeMap<DetId, + edm::OwnVector<SiPixelRecHit, + edm::ClonePolicy<SiPixelRecHit> >, + edm::ClonePolicy<SiPixelRecHit> > > siPixelRecHitCollectionWrapper; + edm::RangeMap<DetId, + edm::OwnVector<SiPixelRecHit, + edm::ClonePolicy<SiPixelRecHit> >, + edm::ClonePolicy<SiPixelRecHit> >::id_iterator itpix; + + edm::Ref<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit2D,edm::ClonePolicy<SiStripRecHit2D> >,edm::ClonePolicy<SiStripRecHit2D> >,SiStripRecHit2D,edm::refhelper::FindUsingAdvance<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit2D,edm::ClonePolicy<SiStripRecHit2D> >,edm::ClonePolicy<SiStripRecHit2D> >,SiStripRecHit2D> > refRangeMapDetIdOwnVectorSiStripRecHit2D; + edm::RefVector<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit2D,edm::ClonePolicy<SiStripRecHit2D> >,edm::ClonePolicy<SiStripRecHit2D> >,SiStripRecHit2D,edm::refhelper::FindUsingAdvance<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit2D,edm::ClonePolicy<SiStripRecHit2D> >,edm::ClonePolicy<SiStripRecHit2D> >,SiStripRecHit2D> > refVectorRangeMapDetIdOwnVectorSiStripRecHit2D; + + edm::Ref<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit1D,edm::ClonePolicy<SiStripRecHit1D> >,edm::ClonePolicy<SiStripRecHit1D> >,SiStripRecHit1D,edm::refhelper::FindUsingAdvance<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit1D,edm::ClonePolicy<SiStripRecHit1D> >,edm::ClonePolicy<SiStripRecHit1D> >,SiStripRecHit1D> > refRangeMapDetIdOwnVectorSiStripRecHit1D; + edm::RefVector<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit1D,edm::ClonePolicy<SiStripRecHit1D> >,edm::ClonePolicy<SiStripRecHit1D> >,SiStripRecHit1D,edm::refhelper::FindUsingAdvance<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit1D,edm::ClonePolicy<SiStripRecHit1D> >,edm::ClonePolicy<SiStripRecHit1D> >,SiStripRecHit1D> > refVectorRangeMapDetIdOwnVectorSiStripRecHit1D; + + + edm::Wrapper<edmNew::DetSetVector<SiStripRecHit2D> > wdstvDummy1; + edm::Wrapper<edmNew::DetSetVector<SiStripRecHit1D> > wdstvDummy11; + edm::Wrapper<edmNew::DetSetVector<SiStripMatchedRecHit2D> > wdstvDummy2; + edm::Wrapper<edmNew::DetSetVector<SiPixelRecHit> > wdstvDummy3; + + edm::Wrapper<reco::ClusterRemovalInfo> clusterRemovalInfo; + + edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> > fastsimTrackerRecHitCollection; + edm::Wrapper<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> > > fastsimTrackerRecHitCollection_Wrapper; + + std::vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > fastsimTrackerRecHitRefCollection; + + edm::Wrapper<std::vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > > fastsimTrackerRecHitRefCollection_Wrapper; + + std::vector<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> > > fastsimTrackerRecHitCombinations; + edm::Wrapper<std::vector<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> > > >fastsimTrackerRecHitCombinations_Wrapper; + + std::vector<std::vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > > fastSimTrackerRecHitCombinationCollection; + edm::Wrapper<std::vector<std::vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > > > fastSimTrackerRecHitCombinationCollection_Wrapper; + + edm::Ref<vector<vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > >,vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > >,edm::refhelper::FindUsingAdvance<vector<vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > >,vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > > > fastSimTrackerRecHitCombinationRef; + + VectorHitCollectionNew vhc1_new; + edm::RefProd<VectorHitCollectionNew> vhc1_new2; + edm::Wrapper<VectorHitCollectionNew> wh1_new; + + }; +} + +#endif // SISTRIPRECHIT_CLASSES_H diff --git a/DataFormats/TrackerRecHit2D/src/classes_def.xml b/DataFormats/TrackerRecHit2D/src/classes_def.xml index e2a6415e917ad..e5527c17265f3 100644 --- a/DataFormats/TrackerRecHit2D/src/classes_def.xml +++ b/DataFormats/TrackerRecHit2D/src/classes_def.xml @@ -189,5 +189,20 @@ <class name="edm::Wrapper< MTDTrackingDetSetVector >"/> <class name="MTDTrackingOwnVector"/> <class name="edm::Wrapper< MTDTrackingOwnVector >"/> + <class name="VectorHit" ClassVersion="3"> + <version ClassVersion="3" checksum="546506376"/> + </class> + <class name="VectorHit2D" ClassVersion="2"> + <version ClassVersion="2" checksum="333065919"/> + </class> + + <class name="edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector>"/> + <class name="edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector> >"/> + <class name="edm::Wrapper<edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector> > >"/> + <class name="edmNew::DetSetVector<VectorHit> "/> + <class name="std::vector<VectorHit> "/> + <class name="edm::RefProd<VectorHitCollectionNew>"/> + <class name="edm::Wrapper< edmNew::DetSetVector<VectorHit> >"/> + </lcgdict> diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc index 8b75397ba05b3..67b76c66427ee 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc @@ -257,9 +257,9 @@ void TrackerGeomBuilderFromGeometricDet::buildGeomDet(TrackerGeometry* tracker) } else if (gduTypeName.find("Lower") != std::string::npos) { //FIXME::ERICA: the plane builder is built in the middle... - PlaneBuilderForGluedDet::ResultType plane = gluedplaneBuilder.plane(composed); + Plane* plane = new Plane(dus->surface()); composedDetId = theTopo->stack(gduId[i]); - StackGeomDet* stackDet = new StackGeomDet(&(*plane), dum, dus, composedDetId); + StackGeomDet* stackDet = new StackGeomDet(&(*plane), dus, dum, composedDetId); tracker->addDet((GeomDet*)stackDet); tracker->addDetId(composedDetId); } diff --git a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py index 4d25967bd803f..06ebb798faca2 100644 --- a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py +++ b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py @@ -23,6 +23,7 @@ from RecoLocalTracker.SiPhase2Clusterizer.phase2TrackerClusterizer_cfi import * from RecoLocalTracker.Phase2TrackerRecHits.Phase2StripCPEGeometricESProducer_cfi import * +from RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2RecHitMatcher_cfi import * _pixeltrackerlocalrecoTask_phase2 = pixeltrackerlocalrecoTask.copy() _pixeltrackerlocalrecoTask_phase2.add(siPhase2Clusters) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml new file mode 100644 index 0000000000000..dde4e31241cc2 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml @@ -0,0 +1,16 @@ +<use name="CommonTools/Statistics"/> +<use name="DataFormats/Common"/> +<use name="FWCore/ParameterSet"/> +<use name="FWCore/Framework"/> +<use name="FWCore/Utilities"/> +<use name="DataFormats/SiPixelDetId"/> +<use name="DataFormats/SiPixelCluster"/> +<use name="DataFormats/TrackerRecHit2D"/> +<use name="Geometry/CommonDetUnit"/> +<use name="Geometry/TrackerGeometryBuilder"/> +<use name="RecoLocalTracker/Phase2TrackerRecHits"/> +<use name="RecoLocalTracker/ClusterParameterEstimator"/> +<use name="RecoLocalTracker/Records"/> +<export> + <lib name="1"/> +</export> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h new file mode 100644 index 0000000000000..6a7b3d39b77c9 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -0,0 +1,80 @@ +//--------------------------------------------------------------------------- +// class VectorHitBuilderAlgorithm +// author: ebrondol,nathera +// date: May, 2015 +//--------------------------------------------------------------------------- + +#ifndef RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitBuilderAlgorithm_H +#define RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitBuilderAlgorithm_H + +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "CommonTools/Statistics/interface/LinearFit.h" + +#include "DataFormats/Common/interface/DetSetVector.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + + +class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { + public: + + VectorHitBuilderAlgorithm(const edm::ParameterSet& conf) : + VectorHitBuilderAlgorithmBase(conf), theFitter(new LinearFit()) {}; + ~VectorHitBuilderAlgorithm() { delete theFitter; }; + + void run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + VectorHitCollectionNew& vhAcc, VectorHitCollectionNew& vhRej, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej ); + + //not implemented yet + bool checkClustersCompatibilityBeforeBuilding(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + const detset & theLowerDetSet, + const detset & theUpperDetSet); + bool checkClustersCompatibility(Local3DPoint& posinner, Local3DPoint& posouter, LocalError& errinner, LocalError& errouter); + + class LocalPositionSort { + public: + LocalPositionSort(const TrackerGeometry *geometry, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe, const GeomDet * geomDet) : geom_(geometry), cpe_(cpe), geomDet_(geomDet) {} + bool operator()(Phase2TrackerCluster1DRef clus1, Phase2TrackerCluster1DRef clus2) const ; + private: + const TrackerGeometry *geom_; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; + const GeomDet * geomDet_; + }; + + std::vector<std::pair<VectorHit,bool>> buildVectorHits(const StackGeomDet * stack, + edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + const detset & DSVinner, const detset & DSVouter, + const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()); + + VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper); + + // Full I/O in DetSet + //void buildDetUnit( const edm::DetSetVector<Phase2TrackerCluster1D> & input, + // output_t& output); + + void fit2Dzx(const Local3DPoint lpCI, const Local3DPoint lpCO, + const LocalError leCI, const LocalError leCO, + Local3DPoint& pos, Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, double& chi2); + void fit2Dzy(const Local3DPoint lpCI, const Local3DPoint lpCO, + const LocalError leCI, const LocalError leCO, + Local3DPoint& pos, Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, double& chi2); + + void fit(const std::vector<float>& x, + const std::vector<float>& y, + const std::vector<float>& sigy, + Local3DPoint& pos, Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, double& chi2); + +// void build( const edm::DetSet<Phase2TrackerCluster1D> & input, +// output_t::FastFiller& output); + + + private: + LinearFit* theFitter; + +}; + +#endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h new file mode 100644 index 0000000000000..ad873f4508142 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -0,0 +1,75 @@ +#ifndef RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitBuilderAlgorithmBase_H +#define RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitBuilderAlgorithmBase_H + +#include "FWCore/Framework/interface/ESHandle.h" +#include "DataFormats/Common/interface/Handle.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" +#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" +#include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" + +namespace edm { + class ParameterSet; + template<typename T> class RefGetter; + class EventSetup; +} + +class VectorHitBuilderAlgorithmBase { + + public: + typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; + typedef edmNew::DetSet<Phase2TrackerCluster1D> detset; + typedef detset::const_iterator const_iterator; + typedef edmNew::DetSetVector<VectorHit> output_t; + typedef std::pair< StackGeomDet, std::vector<Phase2TrackerCluster1D> > StackClusters; + + VectorHitBuilderAlgorithmBase(const edm::ParameterSet&); + virtual ~VectorHitBuilderAlgorithmBase() {} + void initialize(const edm::EventSetup&); + void initTkGeom(edm::ESHandle< TrackerGeometry > tkGeomHandle); + void initTkTopo(edm::ESHandle< TrackerTopology > tkTopoHandle); + void initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd); + + //FIXME::ERICA::this should be template, return different collection for different algo used!! + virtual void run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, VectorHitCollectionNew& vhAcc, VectorHitCollectionNew& vhRej, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) = 0; + + virtual std::vector<std::pair<VectorHit,bool>> buildVectorHits (const StackGeomDet * stack, + edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + const detset & DSVinner, const detset & DSVouter, + const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) = 0; + + virtual VectorHit buildVectorHit(const StackGeomDet * stack, + Phase2TrackerCluster1DRef lower, + Phase2TrackerCluster1DRef upper) = 0; + + double computeParallaxCorrection(const PixelGeomDetUnit*&, const Point3DBase<float, LocalTag>&, const PixelGeomDetUnit*&, const Point3DBase<float, LocalTag>&); + + void printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters); + void printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* cluster); + + void loadDetSetVector( std::map< DetId,std::vector<VectorHit> >& theMap, edmNew::DetSetVector<VectorHit>& theCollection ) const ; + + const TrackerGeometry* theTkGeom; + const TrackerTopology* theTkTopo; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe; + unsigned int nMaxVHforeachStack; + std::vector< double > barrelCut; + std::vector< double > endcapCut; + +private: + edm::ESInputTag cpeTag_; + + + +// typedef SiStripRecHit2DCollection::FastFiller Collector; + +}; + +#endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h new file mode 100644 index 0000000000000..8adf92f4bc286 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h @@ -0,0 +1,41 @@ +//--------------------------------------------------------------------------- +// class VectorHitBuilderEDProducer +// author: ebrondol,nathera +// date: May, 2015 +//--------------------------------------------------------------------------- + +#ifndef RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitBuilderEDProducer_h +#define RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitBuilderEDProducer_h + +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h" +#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" + +class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> +{ + + public: + + explicit VectorHitBuilderEDProducer(const edm::ParameterSet&); + virtual ~VectorHitBuilderEDProducer(); + virtual void produce(edm::Event&, const edm::EventSetup&) override; + void setupAlgorithm(edm::ParameterSet const& conf); + void run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, + VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej); + VectorHitBuilderAlgorithmBase * algo() const { return stubsBuilder; }; + + private: + + VectorHitBuilderAlgorithmBase * stubsBuilder; + std::string offlinestubsTag; + unsigned int maxOfflinestubs; + std::string algoTag; + edm::EDGetTokenT< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer; + bool readytobuild; + +}; + +#endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/BuildFile.xml new file mode 100644 index 0000000000000..1e43153bea1ba --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/BuildFile.xml @@ -0,0 +1,4 @@ +<use name="RecoLocalTracker/SiPhase2VectorHitBuilder"/> +<library file="*.cc" name="RecoLocalTrackerSiPhase2VectorHitBuilderPlugins"> + <flags EDM_PLUGIN="1"/> +</library> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc new file mode 100644 index 0000000000000..63d60a3d5d6c7 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc @@ -0,0 +1,11 @@ + +#include "FWCore/PluginManager/interface/ModuleDef.h" +#include "FWCore/Utilities/interface/typelookup.h" +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h" + +DEFINE_FWK_EVENTSETUP_MODULE(SiPhase2RecHitMatcherESProducer); +DEFINE_FWK_MODULE(VectorHitBuilderEDProducer); + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc new file mode 100644 index 0000000000000..09093bc89ad65 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -0,0 +1,34 @@ +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h" + +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" + +SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet & p) +{ + name = p.getParameter<std::string>("ComponentName"); + pset_ = p; + setWhatProduced(this,name); +} + +std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer:: +produce(const TkPhase2OTCPERecord & iRecord) +{ + if( name == "SiPhase2VectorHitMatcher" ){ + matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); + + edm::ESHandle<TrackerGeometry> tGeomHandle; + edm::ESHandle<TrackerTopology> tTopoHandle; + + iRecord.getRecord<TrackerDigiGeometryRecord>().get(tGeomHandle); + iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle); + + matcher_->algo()->initTkGeom(tGeomHandle); + matcher_->algo()->initTkTopo(tTopoHandle); + } + return matcher_; +} + + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h new file mode 100644 index 0000000000000..80aaf0b36bb1f --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h @@ -0,0 +1,23 @@ +#ifndef RecoLocaltracker_SiPhase2VectorHitBuilder_SiPhase2RecHitMatcherESProducer_h +#define RecoLocaltracker_SiPhase2VectorHitBuilder_SiPhase2RecHitMatcherESProducer_h + +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" +#include <memory> + +class SiPhase2RecHitMatcherESProducer: public edm::ESProducer { + public: + SiPhase2RecHitMatcherESProducer(const edm::ParameterSet&); + std::shared_ptr<VectorHitBuilderEDProducer> produce(const TkPhase2OTCPERecord&); + private: + std::string name; + std::shared_ptr<VectorHitBuilderEDProducer> matcher_; + edm::ParameterSet pset_; +}; +#endif + + + + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py new file mode 100644 index 0000000000000..0780d27ef4258 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +SiPhase2RecHitMatcherESProducer = cms.ESProducer("SiPhase2RecHitMatcherESProducer", + ComponentName = cms.string('SiPhase2VectorHitMatcher'), + Clusters = cms.string('siPhase2Clusters'), + offlinestubs = cms.string('vectorHits'), + maxVectorHits = cms.int32(999999999), + maxVectorHitsInAStack = cms.int32(999), + Algorithm = cms.string('VectorHitBuilderAlgorithm'), + BarrelCut = cms.vdouble( 0., 0.05, 0.06, 0.08, 0.09, 0.12, 0.2), #layers are 6 + EndcapCut = cms.vdouble( 0., 0.1, 0.1, 0.1, 0.1, 0.1), #disks are 5 + CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"), + Phase2CPE_name = cms.string('Phase2StripCPE') +# NSigmaInside = cms.double(3.0) +) + + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py new file mode 100644 index 0000000000000..7949489ba3da8 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py @@ -0,0 +1,12 @@ +import FWCore.ParameterSet.Config as cms + +siPhase2VectorHits = cms.EDProducer("VectorHitBuilderEDProducer", + Clusters = cms.string('siPhase2Clusters'), + offlinestubs = cms.string('vectorHits'), + maxVectorHits = cms.int32(999999999), + maxVectorHitsInAStack = cms.int32(999), + Algorithm = cms.string('VectorHitBuilderAlgorithm'), + BarrelCut = cms.vdouble( 0., 0.05, 0.06, 0.08, 0.09, 0.12, 0.2), #layers are 6 + EndcapCut = cms.vdouble( 0., 0.1, 0.1, 0.1, 0.1, 0.1), #disks are 5 + CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE") +) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc new file mode 100644 index 0000000000000..6e7c2fabef3c9 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -0,0 +1,397 @@ +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/CommonTopologies/interface/PixelTopology.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit2D.h" + + +bool VectorHitBuilderAlgorithm::LocalPositionSort::operator()(Phase2TrackerCluster1DRef clus1, Phase2TrackerCluster1DRef clus2) const +{ + const PixelGeomDetUnit* gdu1 = dynamic_cast< const PixelGeomDetUnit* >(geomDet_); + auto && lparams1 = cpe_->localParameters( *clus1, *gdu1 ); // x, y, z, e2_xx, e2_xy, e2_yy + auto && lparams2 = cpe_->localParameters( *clus2, *gdu1 ); // x, y, z, e2_xx, e2_xy, e2_yy + return lparams1.first.x() < lparams2.first.x(); +} + + +void VectorHitBuilderAlgorithm::run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + VectorHitCollectionNew& vhAcc, + VectorHitCollectionNew& vhRej, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) +{ + + LogDebug("VectorHitBuilderAlgorithm") << "Run VectorHitBuilderAlgorithm ... \n" ; + const edmNew::DetSetVector<Phase2TrackerCluster1D>* ClustersPhase2Collection = clusters.product(); + + + std::map< DetId, std::vector<VectorHit> > tempVHAcc, tempVHRej; + std::map< DetId, std::vector<VectorHit> >::iterator it_temporary; + + //loop over the DetSetVector + LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << ClustersPhase2Collection->size() << std::endl ; + for( auto DSViter : *ClustersPhase2Collection){ + + unsigned int rawDetId1(DSViter.detId()); + DetId detId1(rawDetId1); + DetId lowerDetId, upperDetId; + if( theTkTopo->isLower(detId1) ){ + lowerDetId = detId1; + upperDetId = theTkTopo->partnerDetId(detId1); + } else if (theTkTopo->isUpper(detId1)) { + upperDetId = detId1; + lowerDetId = theTkTopo->partnerDetId(detId1); + } + DetId detIdStack = theTkTopo->stack(detId1); + + //debug + LogDebug("VectorHitBuilderAlgorithm") << " DetId stack : " << detIdStack.rawId() << std::endl; + LogDebug("VectorHitBuilderAlgorithm") << " DetId lower set of clusters : " << lowerDetId.rawId(); + LogDebug("VectorHitBuilderAlgorithm") << " DetId upper set of clusters : " << upperDetId.rawId() << std::endl; + + it_temporary = tempVHAcc.find(detIdStack); + if ( it_temporary != tempVHAcc.end() ) { + LogTrace("VectorHitBuilderAlgorithm") << " this stack has already been analyzed -> skip it "; + continue; + } + + const GeomDet* gd; + const StackGeomDet* stackDet; + edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator it_detLower = ClustersPhase2Collection->find( lowerDetId ); + edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator it_detUpper = ClustersPhase2Collection->find( upperDetId ); + + if ( it_detLower != ClustersPhase2Collection->end() && it_detUpper != ClustersPhase2Collection->end() ){ + + gd = theTkGeom->idToDet(detIdStack); + stackDet = dynamic_cast<const StackGeomDet*>(gd); + std::vector<VectorHit> vhsInStack_Acc; + std::vector<VectorHit> vhsInStack_Rej; + const auto vhsInStack_AccRej = buildVectorHits(stackDet, clusters, *it_detLower, *it_detUpper); + + //storing accepted and rejected VHs + for(auto vh : vhsInStack_AccRej ) { + if(vh.second == true){ + vhsInStack_Acc.push_back(vh.first); + } + else if(vh.second == false){ + vhsInStack_Rej.push_back(vh.first); + } + } + + //ERICA:: to be checked with map! + //sorting vhs for best chi2 + std::sort(vhsInStack_Acc.begin(), vhsInStack_Acc.end()); + + tempVHAcc[detIdStack] = vhsInStack_Acc; + tempVHRej[detIdStack] = vhsInStack_Rej; + + LogTrace("VectorHitBuilderAlgorithm") << "For detId #" << detIdStack.rawId() << " the following VHits have been accepted:"; + for (auto vhIt : vhsInStack_Acc){ + LogTrace("VectorHitBuilderAlgorithm") << "accepted VH: " << vhIt; + } + LogTrace("VectorHitBuilderAlgorithm") << "For detId #" << detIdStack.rawId() << " the following VHits have been rejected:"; + for (auto vhIt : vhsInStack_Rej){ + LogTrace("VectorHitBuilderAlgorithm") << "rejected VH: " << vhIt; + } + + } + + } + + loadDetSetVector(tempVHAcc, vhAcc); + loadDetSetVector(tempVHRej, vhRej); + + LogDebug("VectorHitBuilderAlgorithm") << "End run VectorHitBuilderAlgorithm ... \n" ; + return; + +} + +bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + const detset & theLowerDetSet, + const detset & theUpperDetSet) +{ + if(theLowerDetSet.size()==1 && theUpperDetSet.size()==1) return true; + + //order lower clusters in u + std::vector<Phase2TrackerCluster1D> lowerClusters; + if(theLowerDetSet.size()>1) LogDebug("VectorHitBuilderAlgorithm") << " more than 1 lower cluster! " << std::endl; + if(theUpperDetSet.size()>1) LogDebug("VectorHitBuilderAlgorithm") << " more than 1 upper cluster! " << std::endl; + for ( const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++ cil ) { + Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo( clusters, cil ); + lowerClusters.push_back(*clusterLower); + } + return true; +} + +bool VectorHitBuilderAlgorithm::checkClustersCompatibility(Local3DPoint& poslower, + Local3DPoint& posupper, + LocalError& errlower, + LocalError& errupper) +{ + + return true; + +} + +//---------------------------------------------------------------------------- +//ERICA::in the DT code the global position is used to compute the alpha angle and put a cut on that. +std::vector<std::pair<VectorHit,bool>> VectorHitBuilderAlgorithm::buildVectorHits(const StackGeomDet * stack, + edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + const detset & theLowerDetSet, + const detset & theUpperDetSet, + const std::vector<bool>& phase2OTClustersToSkip) +{ + + std::vector<std::pair<VectorHit,bool>> result; + if(checkClustersCompatibilityBeforeBuilding(clusters, theLowerDetSet, theUpperDetSet)){ + LogDebug("VectorHitBuilderAlgorithm") << " compatible -> continue ... " << std::endl; + } else { LogTrace("VectorHitBuilderAlgorithm") << " not compatible, going to the next cluster"; } + + std::vector<Phase2TrackerCluster1DRef> lowerClusters; + for ( const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++ cil ) { + Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo( clusters, cil ); + lowerClusters.push_back(clusterLower); + } + std::vector<Phase2TrackerCluster1DRef> upperClusters; + for ( const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ ciu ) { + Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo( clusters, ciu ); + upperClusters.push_back(clusterUpper); + } + + std::sort(lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom,&*cpe,&*stack->lowerDet())); + std::sort(upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom,&*cpe,&*stack->upperDet())); + + for ( auto cluL : lowerClusters){ + LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; + printCluster(stack->lowerDet(),&*cluL); + const PixelGeomDetUnit* gduLow = dynamic_cast< const PixelGeomDetUnit* >(stack->lowerDet()); + auto && lparamsLow = cpe->localParameters( *cluL, *gduLow ); + for ( auto cluU : upperClusters){ + LogDebug("VectorHitBuilderAlgorithm") << "\t upper clusters " << std::endl; + printCluster(stack->upperDet(),&*cluU); + const PixelGeomDetUnit* gduUpp = dynamic_cast< const PixelGeomDetUnit* >(stack->upperDet()); + auto && lparamsUpp = cpe->localParameters( *cluU, *gduUpp ); + + //applying the parallax correction + double pC = computeParallaxCorrection(gduLow,lparamsLow.first,gduUpp,lparamsUpp.first); + LogDebug("VectorHitBuilderAlgorithm") << " \t parallax correction:" << pC << std::endl; + double lpos_upp_corr = 0.0; + double lpos_low_corr = 0.0; + if(lparamsUpp.first.x() > lparamsLow.first.x()){ + if(lparamsUpp.first.x() > 0){ + lpos_low_corr = lparamsLow.first.x(); + lpos_upp_corr = lparamsUpp.first.x() - fabs(pC); + } + if(lparamsUpp.first.x() < 0){ + lpos_low_corr = lparamsLow.first.x() + fabs(pC); + lpos_upp_corr = lparamsUpp.first.x(); + } + } else if( lparamsUpp.first.x() < lparamsLow.first.x() ) { + if(lparamsUpp.first.x() > 0){ + lpos_low_corr = lparamsLow.first.x() - fabs(pC); + lpos_upp_corr = lparamsUpp.first.x(); + } + if(lparamsUpp.first.x() < 0){ + lpos_low_corr = lparamsLow.first.x(); + lpos_upp_corr = lparamsUpp.first.x() + fabs(pC); + } + } else { + if(lparamsUpp.first.x() > 0){ + lpos_low_corr = lparamsLow.first.x(); + lpos_upp_corr = lparamsUpp.first.x() - fabs(pC); + } + if(lparamsUpp.first.x() < 0){ + lpos_low_corr = lparamsLow.first.x(); + lpos_upp_corr = lparamsUpp.first.x() + fabs(pC); + } + } + + LogDebug("VectorHitBuilderAlgorithm") << " \t local pos upper corrected (x):" << lpos_upp_corr << std::endl; + LogDebug("VectorHitBuilderAlgorithm") << " \t local pos lower corrected (x):" << lpos_low_corr << std::endl; + + //building my tolerance : 10*sigma + double delta = 10.0*sqrt(lparamsLow.second.xx()+lparamsUpp.second.xx()); + LogDebug("VectorHitBuilderAlgorithm") << " \t delta: " << delta << std::endl; + + double width = lpos_low_corr - lpos_upp_corr; + LogDebug("VectorHitBuilderAlgorithm") << " \t width: " << width << std::endl; + + + unsigned int layerStack = theTkTopo->layer(stack->geographicalId()); + if(stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB ) LogDebug("VectorHitBuilderAlgorithm") << " \t is barrel. " << std::endl; + if(stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) LogDebug("VectorHitBuilderAlgorithm") << " \t is endcap. " << std::endl; + LogDebug("VectorHitBuilderAlgorithm") << " \t layer is : " << layerStack << std::endl; + + float cut = 0.0; + if(stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB ) cut = barrelCut.at(layerStack); + if(stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) cut = endcapCut.at(layerStack); + LogDebug("VectorHitBuilderAlgorithm") << " \t the cut is:" << cut << std::endl; + + //old cut: indipendent from layer + //if( (lpos_upp_corr < lpos_low_corr + delta) && + // (lpos_upp_corr > lpos_low_corr - delta) ){ + //new cut: dependent on layers + if(fabs(width) < cut){ + LogDebug("VectorHitBuilderAlgorithm") << " accepting VH! " << std::endl; + VectorHit vh = buildVectorHit( stack, cluL, cluU); + //protection: the VH can also be empty!! + if (vh.isValid()){ + result.push_back(std::make_pair(vh, true)); + } + + } else { + LogDebug("VectorHitBuilderAlgorithm") << " rejecting VH: " << std::endl; + //storing vh rejected for combinatiorial studies + VectorHit vh = buildVectorHit( stack, cluL, cluU); + result.push_back(std::make_pair(vh, false)); + } + + } + } + + return result; + +} + +VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet * stack, + Phase2TrackerCluster1DRef lower, + Phase2TrackerCluster1DRef upper) +{ + + LogTrace("VectorHitBuilderAlgorithm") << "Build VH with: "; + //printCluster(stack->lowerDet(),&*lower); + //printCluster(stack->upperDet(),&*upper); + + const PixelGeomDetUnit* geomDetLower = dynamic_cast< const PixelGeomDetUnit* >(stack->lowerDet()); + const PixelGeomDetUnit* geomDetUpper = dynamic_cast< const PixelGeomDetUnit* >(stack->upperDet()); + + auto && lparamsLower = cpe->localParameters( *lower, *geomDetLower ); // x, y, z, e2_xx, e2_xy, e2_yy + Global3DPoint gparamsLower = geomDetLower->surface().toGlobal(lparamsLower.first); + LogTrace("VectorHitBuilderAlgorithm") << "\t lower global pos: " << gparamsLower ; + + auto && lparamsUpper = cpe->localParameters( *upper, *geomDetUpper ); + Global3DPoint gparamsUpper = geomDetUpper->surface().toGlobal(lparamsUpper.first); + LogTrace("VectorHitBuilderAlgorithm") << "\t upper global pos: " << gparamsUpper ; + + //local parameters of upper cluster in lower system of reference + Local3DPoint lparamsUpperInLower = geomDetLower->surface().toLocal(gparamsUpper); + + LogTrace("VectorHitBuilderAlgorithm") << "\t lower global pos: " << gparamsLower ; + LogTrace("VectorHitBuilderAlgorithm") << "\t upper global pos: " << gparamsUpper ; + + LogTrace("VectorHitBuilderAlgorithm") << "A:\t lower local pos: " << lparamsLower.first << " with error: " << lparamsLower.second << std::endl; + LogTrace("VectorHitBuilderAlgorithm") << "A:\t upper local pos in the lower sof " << lparamsUpperInLower << " with error: " << lparamsUpper.second << std::endl; + + bool ok = checkClustersCompatibility(lparamsLower.first, lparamsUpper.first, lparamsLower.second, lparamsUpper.second); + + if(ok){ + + AlgebraicSymMatrix22 covMat2Dzx; + double chi22Dzx = 0.0; + Local3DPoint pos2Dzx; + Local3DVector dir2Dzx; + fit2Dzx(lparamsLower.first, lparamsUpperInLower, lparamsLower.second, lparamsUpper.second, pos2Dzx, dir2Dzx, covMat2Dzx, chi22Dzx); + LogTrace("VectorHitBuilderAlgorithm") << "\t pos2Dzx: " << pos2Dzx; + LogTrace("VectorHitBuilderAlgorithm") << "\t dir2Dzx: " << dir2Dzx; + LogTrace("VectorHitBuilderAlgorithm") << "\t cov2Dzx: " << covMat2Dzx; + VectorHit2D vh2Dzx = VectorHit2D(pos2Dzx, dir2Dzx, covMat2Dzx, chi22Dzx); + + AlgebraicSymMatrix22 covMat2Dzy; + double chi22Dzy = 0.0; + Local3DPoint pos2Dzy; + Local3DVector dir2Dzy; + fit2Dzy(lparamsLower.first, lparamsUpperInLower, lparamsLower.second, lparamsUpper.second, pos2Dzy, dir2Dzy, covMat2Dzy, chi22Dzy); + LogTrace("VectorHitBuilderAlgorithm") << "\t pos2Dzy: " << pos2Dzy; + LogTrace("VectorHitBuilderAlgorithm") << "\t dir2Dzy: " << dir2Dzy; + LogTrace("VectorHitBuilderAlgorithm") << "\t cov2Dzy: " << covMat2Dzy; + VectorHit2D vh2Dzy = VectorHit2D(pos2Dzy, dir2Dzy, covMat2Dzy, chi22Dzy); + + OmniClusterRef lowerOmni(lower); + OmniClusterRef upperOmni(upper); + VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni); + return vh; + + } + + return VectorHit(); + +} + + + +void VectorHitBuilderAlgorithm::fit2Dzx(const Local3DPoint lpCI, const Local3DPoint lpCO, + const LocalError leCI, const LocalError leCO, + Local3DPoint& pos, Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, + double& chi2) +{ + std::vector<float> x = {lpCI.z(), lpCO.z()}; + std::vector<float> y = {lpCI.x(), lpCO.x()}; + float sqCI = sqrt(leCI.xx()); + float sqCO = sqrt(leCO.xx()); + std::vector<float> sigy = {sqCI, sqCO}; + + fit(x,y,sigy,pos,dir,covMatrix,chi2); + + return; + +} + +void VectorHitBuilderAlgorithm::fit2Dzy(const Local3DPoint lpCI, const Local3DPoint lpCO, + const LocalError leCI, const LocalError leCO, + Local3DPoint& pos, Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, + double& chi2) +{ + std::vector<float> x = {lpCI.z(), lpCO.z()}; + std::vector<float> y = {lpCI.y(), lpCO.y()}; + float sqCI = sqrt(leCI.yy()); + float sqCO = sqrt(leCO.yy()); + std::vector<float> sigy = {sqCI, sqCO}; + + fit(x,y,sigy,pos,dir,covMatrix,chi2); + + return; + +} + +void VectorHitBuilderAlgorithm::fit(const std::vector<float>& x, + const std::vector<float>& y, + const std::vector<float>& sigy, + Local3DPoint& pos, Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, + double& chi2) +{ + + if(x.size() != y.size() || x.size() != sigy.size()){ + edm::LogError("VectorHitBuilderAlgorithm") << "Different size for x,z !! No fit possible."; + return; + } + + float slope = 0.; + float intercept = 0.; + float covss = 0.; + float covii = 0.; + float covsi = 0.; + + theFitter->fit(x,y,x.size(),sigy,slope,intercept,covss,covii,covsi); + + covMatrix[0][0] = covss; // this is var(dy/dz) + covMatrix[1][1] = covii; // this is var(y) + covMatrix[1][0] = covsi; // this is cov(dy/dz,y) + + for (unsigned int j=0; j < x.size(); j++){ + const double ypred = intercept + slope*x[j]; + const double dy = (y[j] - ypred)/sigy[j]; + chi2 += dy*dy; + } + + pos = Local3DPoint(intercept,0.,0.); + if(x.size()==2){ + //difference in z is the difference of the lowermost and the uppermost cluster z pos + float slopeZ = x.at(1) - x.at(0); + dir = LocalVector(slope,0.,slopeZ); + } else { + dir = LocalVector(slope,0.,-1.); + } + +} diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc new file mode 100644 index 0000000000000..df42069d3adf5 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -0,0 +1,151 @@ +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" +#include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" + +#include "Geometry/CommonTopologies/interface/PixelTopology.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" + +VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::ParameterSet& conf) : + nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), + barrelCut(conf.getParameter< std::vector< double > >("BarrelCut")), + endcapCut(conf.getParameter< std::vector< double > >("EndcapCut")), + cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) +{} + +void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) +{ + //FIXME:ask Vincenzo + /* + uint32_t tk_cache_id = es.get<TrackerDigiGeometryRecord>().cacheIdentifier(); + uint32_t c_cache_id = es.get<TkPhase2OTCPERecord>().cacheIdentifier(); + + if(tk_cache_id != tracker_cache_id) { + es.get<TrackerDigiGeometryRecord>().get(tracker); + tracker_cache_id = tk_cache_id; + } + if(c_cache_id != cpe_cache_id) { + es.get<TkPhase2OTCPERecord>().get(matcherTag, matcher); + es.get<TkPhase2OTCPERecord>().get(cpeTag, cpe); + cpe_cache_id = c_cache_id; + } + */ + + // get the geometry and topology + edm::ESHandle< TrackerGeometry > geomHandle; + es.get< TrackerDigiGeometryRecord >().get( geomHandle ); + initTkGeom(geomHandle); + + edm::ESHandle< TrackerTopology > tTopoHandle; + es.get< TrackerTopologyRcd >().get(tTopoHandle); + initTkTopo(tTopoHandle); + + // load the cpe via the eventsetup + edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpeHandle; + es.get<TkPhase2OTCPERecord>().get(cpeTag_, cpeHandle); + initCpe(cpeHandle.product()); +} + +void VectorHitBuilderAlgorithmBase::initTkGeom(edm::ESHandle< TrackerGeometry > tkGeomHandle){ + theTkGeom = tkGeomHandle.product(); +} +void VectorHitBuilderAlgorithmBase::initTkTopo(edm::ESHandle< TrackerTopology > tkTopoHandle){ + theTkTopo = tkTopoHandle.product(); +} +void VectorHitBuilderAlgorithmBase::initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd){ + cpe = cpeProd; +} + +double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit*& geomDetUnit_low, const Point3DBase<float, LocalTag>& lPosClu_low, + const PixelGeomDetUnit*& geomDetUnit_upp, const Point3DBase<float, LocalTag>& lPosClu_upp){ + double parallCorr = 0.0; + Global3DPoint origin(0,0,0); + Global3DPoint gPosClu_low = geomDetUnit_low->surface().toGlobal(lPosClu_low); + GlobalVector gV = gPosClu_low - origin; + LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV; + + LocalVector lV = geomDetUnit_low->surface().toLocal(gV); + LogTrace("VectorHitsBuilderValidation") << " local vector passing to the origin (in low sor):" << lV; + LocalVector lV_norm = lV/lV.z(); + LogTrace("VectorHitsBuilderValidation") << " normalized local vector passing to the origin (in low sor):" << lV_norm; + + Global3DPoint gPosClu_upp = geomDetUnit_upp->surface().toGlobal(lPosClu_upp); + Local3DPoint lPosClu_uppInLow = geomDetUnit_low->surface().toLocal(gPosClu_upp); + parallCorr = lV_norm.x() * lPosClu_uppInLow.z(); + + return parallCorr; +} + +void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters){ + + int nCluster = 0; + int numberOfDSV = 0; + edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator DSViter; + for( DSViter = clusters.begin() ; DSViter != clusters.end(); DSViter++){ + + ++numberOfDSV; + + // Loop over the clusters in the detector unit + for (edmNew::DetSet< Phase2TrackerCluster1D >::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); ++clustIt) { + + nCluster++; + + // get the detector unit's id + const GeomDetUnit* geomDetUnit(theTkGeom->idToDetUnit(DSViter->detId())); + if (!geomDetUnit) return; + + printCluster(geomDetUnit, clustIt); + + } + } + LogDebug("VectorHitBuilder") << " Number of input clusters: " << nCluster << std::endl; + +} + + +void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* clustIt){ + + if (!geomDetUnit) return; + const PixelGeomDetUnit* pixelGeomDetUnit = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit); + const PixelTopology& topol = pixelGeomDetUnit->specificTopology(); + if (!pixelGeomDetUnit) return; + + unsigned int layer = theTkTopo->layer(geomDetUnit->geographicalId()); + unsigned int module = theTkTopo->module(geomDetUnit->geographicalId()); + LogTrace("VectorHitBuilder") << "Layer:" << layer << " and DetId: " << geomDetUnit->geographicalId().rawId() << std::endl; + TrackerGeometry::ModuleType mType = theTkGeom->getDetectorType(geomDetUnit->geographicalId()); + if (mType == TrackerGeometry::ModuleType::Ph2PSP) + LogTrace("VectorHitBuilder") << "Pixel cluster (module:" << module << ") " << std::endl; + else if (mType == TrackerGeometry::ModuleType::Ph2SS || mType == TrackerGeometry::ModuleType::Ph2PSS) + LogTrace("VectorHitBuilder") << "Strip cluster (module:" << module << ") " << std::endl; + else LogTrace("VectorHitBuilder") << "no module?!" << std::endl; + LogTrace("VectorHitBuilder") << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl; + LogTrace("VectorHitBuilder") << " and width:" << pixelGeomDetUnit->surface().bounds().width() << " , lenght:" << pixelGeomDetUnit->surface().bounds().length() << std::endl; + + + auto && lparams = cpe->localParameters( *clustIt, *pixelGeomDetUnit ); + Global3DPoint gparams = pixelGeomDetUnit->surface().toGlobal(lparams.first); + + LogTrace("VectorHitBuilder") << "\t global pos " << gparams << std::endl; + LogTrace("VectorHitBuilder") << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl; + LogTrace("VectorHitBuilder") << std::endl; + + return; +} + +void VectorHitBuilderAlgorithmBase::loadDetSetVector( std::map< DetId,std::vector<VectorHit> >& theMap, edmNew::DetSetVector<VectorHit>& theCollection ) const{ + + std::map<DetId,std::vector<VectorHit> >::const_iterator it = theMap.begin(); + std::map<DetId,std::vector<VectorHit> >::const_iterator lastDet = theMap.end(); + for( ; it != lastDet ; ++it ) { + edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it->first); + std::vector<VectorHit>::const_iterator vh_it = it->second.begin(); + std::vector<VectorHit>::const_iterator vh_end = it->second.end(); + for( ; vh_it != vh_end ; ++vh_it) { + vh_col.push_back(*vh_it); + } + } + +} diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc new file mode 100644 index 0000000000000..60e6f58bc9ff2 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc @@ -0,0 +1,107 @@ +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) + : offlinestubsTag( conf.getParameter<std::string>( "offlinestubs" ) ), + maxOfflinestubs(conf.getParameter<int>( "maxVectorHits" )), + algoTag(conf.getParameter<std::string>( "Algorithm" )), + //clusterProducer(conf.getParameter<edm::InputTag>("Clusters")), + readytobuild(false) +{ + + clusterProducer = consumes< edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("Clusters"))); + + produces< edmNew::DetSetVector< Phase2TrackerCluster1D > >( "ClustersAccepted" ); + produces< edmNew::DetSetVector< Phase2TrackerCluster1D > >( "ClustersRejected" ); + produces< VectorHitCollectionNew >( offlinestubsTag + "Accepted" ); + produces< VectorHitCollectionNew >( offlinestubsTag + "Rejected" ); + setupAlgorithm(conf); +} + +VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { + delete stubsBuilder; +} + +void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) +{ + LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin"; + + // get input clusters data + edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clustersHandle; + event.getByToken( clusterProducer, clustersHandle); + + // create the final output collection + std::unique_ptr< edmNew::DetSetVector< Phase2TrackerCluster1D > > outputClustersAccepted( new edmNew::DetSetVector< Phase2TrackerCluster1D > ); + std::unique_ptr< edmNew::DetSetVector< Phase2TrackerCluster1D > > outputClustersRejected( new edmNew::DetSetVector< Phase2TrackerCluster1D > ); + std::unique_ptr< VectorHitCollectionNew > outputVHAccepted( new VectorHitCollectionNew() ); + std::unique_ptr< VectorHitCollectionNew > outputVHRejected( new VectorHitCollectionNew() ); + + if(readytobuild) stubsBuilder->initialize(es); + else edm::LogError("VectorHitBuilderEDProducer") << "Impossible initialization of builder!!"; + + // check on the input clusters + stubsBuilder->printClusters(*clustersHandle); + + // running the stub building algorithm + //ERICA::output should be moved in the different algo classes? + run( clustersHandle, *outputClustersAccepted, *outputClustersRejected, *outputVHAccepted, *outputVHRejected); + + unsigned int numberOfVectorHits = 0; + edmNew::DetSetVector<VectorHit>::const_iterator DSViter; + for( DSViter = (*outputVHAccepted).begin() ; DSViter != (*outputVHAccepted).end(); DSViter++){ + + edmNew::DetSet< VectorHit >::const_iterator vh; + for ( vh = DSViter->begin(); vh != DSViter->end(); ++vh) { + numberOfVectorHits++; + LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << *vh << std::endl; + } + + } +/* + if(numberOfVectorHits > maxOfflinestubs) { + edm::LogError("VectorHitBuilderEDProducer") << "Limit on the number of stubs exceeded. An empty output collection will be produced instead.\n"; + VectorHitCollectionNew empty; + empty.swap(outputAcc); + } +*/ + // write output to file + event.put( std::move(outputClustersAccepted), "ClustersAccepted" ); + event.put( std::move(outputClustersRejected), "ClustersRejected" ); + event.put( std::move(outputVHAccepted), offlinestubsTag + "Accepted" ); + event.put( std::move(outputVHRejected), offlinestubsTag + "Rejected" ); + +// LogDebug("VectorHitBuilderEDProducer") << " Executing " << algoTag << " resulted in " << numberOfVectorHits << "."; + LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n" ; + +} + +void VectorHitBuilderEDProducer::setupAlgorithm(edm::ParameterSet const& conf) { + + if ( algoTag == "VectorHitBuilderAlgorithm" ) { + stubsBuilder = new VectorHitBuilderAlgorithm(conf); + readytobuild = true; + } else { + edm::LogError("VectorHitBuilderEDProducer") << " Choice " << algoTag << " is invalid.\n" ; + readytobuild = false; + } + +} + + +void VectorHitBuilderEDProducer::run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, + VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej ){ + + if ( !readytobuild ) { + edm::LogError("VectorHitBuilderEDProducer") << " No stub builder algorithm was found - cannot run!" ; + return; + } + + stubsBuilder->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); + +} + +#include "FWCore/Utilities/interface/typelookup.h" +TYPELOOKUP_DATA_REG(VectorHitBuilderEDProducer); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml new file mode 100644 index 0000000000000..bd4c0a3c2dc1f --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml @@ -0,0 +1,33 @@ +<use name="boost"/> +<use name="root"/> +<use name="classlib"/> +<use name="clhep"/> +<use name="SimDataFormats/TrackingHit"/> +<use name="SimDataFormats/TrackerDigiSimLink"/> +<use name="SimDataFormats/CrossingFrame"/> +<use name="DataFormats/SiPixelDigi"/> +<use name="DataFormats/SiPixelDetId"/> +<use name="DataFormats/DetId"/> +<use name="Geometry/Records"/> +<use name="Geometry/CommonDetUnit"/> +<use name="Geometry/TrackerGeometryBuilder"/> +<use name="FWCore/Framework"/> +<use name="FWCore/ParameterSet"/> +<use name="CommonTools/UtilAlgos"/> +<use name="DQMServices/Core"/> +<use name="DataFormats/Common"/> +<use name="FWCore/PluginManager"/> +<use name="SimTracker/SiPhase2Digitizer"/> +<use name="DataFormats/TrackerRecHit2D"/> +<use name="DataFormats/Phase2TrackerCluster"/> +<use name="DataFormats/ParticleFlowCandidate"/> +<use name="DataFormats/ParticleFlowReco"/> +<use name="RecoLocalTracker/SiPhase2VectorHitBuilder"/> +<library file="VectorHitsValidation.cc" name="VectorHitsBuilderValidation"> + <flags EDM_PLUGIN="1"/> + <flags CXXFLAGS="-g3"/> +</library> +<library file="ClustersValidationTGraph.cc" name="ClustersValidationTGraph"> + <flags EDM_PLUGIN="1"/> + <flags CXXFLAGS="-g3"/> +</library> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc new file mode 100644 index 0000000000000..1730009db050a --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc @@ -0,0 +1,584 @@ +#include <map> +#include <vector> +#include <algorithm> + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" + +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" +#include "DataFormats/SiPixelDigi/interface/PixelDigi.h" + +#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" +#include "SimDataFormats/Track/interface/SimTrackContainer.h" +#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" + +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "CommonTools/Utils/interface/TFileDirectory.h" + +#include <TGraph.h> +#include <TH1F.h> +#include <THStack.h> +#include <TTree.h> + + + +struct ClusterHistos { + THStack* numberClustersMixed; + TH1F* numberClusterPixel; + TH1F* numberClusterStrip; + + THStack* clustersSizeMixed; + TH1F* clusterSizePixel; + TH1F* clusterSizeStrip; + + TGraph* globalPosXY[3]; + TGraph* localPosXY[3]; + + TH1F* deltaXClusterSimHits[3]; + TH1F* deltaYClusterSimHits[3]; + + TH1F* deltaXClusterSimHits_P[3]; + TH1F* deltaYClusterSimHits_P[3]; + + TH1F* digiEfficiency[3]; + + TH1F* primarySimHits; + TH1F* otherSimHits; +}; + +class Phase2TrackerClusterizerValidationTGraph : public edm::EDAnalyzer { + + public: + + typedef std::map< unsigned int, std::vector< PSimHit > > SimHitsMap; + typedef std::map< unsigned int, SimTrack > SimTracksMap; + + explicit Phase2TrackerClusterizerValidationTGraph(const edm::ParameterSet&); + ~Phase2TrackerClusterizerValidationTGraph(); + void beginJob(); + void endJob(); + void analyze(const edm::Event&, const edm::EventSetup&); + + private: + + std::map< unsigned int, ClusterHistos >::iterator createLayerHistograms(unsigned int); + unsigned int getLayerNumber(const DetId&, const TrackerTopology*); + unsigned int getModuleNumber(const DetId&, const TrackerTopology*); + unsigned int getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >&, const DetId&, unsigned int); + + edm::EDGetTokenT< edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; + edm::EDGetTokenT< edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; + edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken_; + edm::EDGetTokenT< edm::SimTrackContainer> simTracksToken_; + edm::EDGetTokenT< edm::SimVertexContainer > simVerticesToken_; + const TrackerGeometry* tkGeom; + const TrackerTopology* tkTopo; + + TTree* tree; + TGraph* trackerLayout_[3]; + TGraph* trackerLayoutXY_[3]; + TGraph* trackerLayoutXYBar_; + TGraph* trackerLayoutXYEC_; + + std::map< unsigned int, ClusterHistos > histograms_; + +}; + +Phase2TrackerClusterizerValidationTGraph::Phase2TrackerClusterizerValidationTGraph(const edm::ParameterSet& conf) { + srcClu_ = consumes< edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); + siphase2OTSimLinksToken_ = consumes<edm::DetSetVector<PixelDigiSimLink> >(conf.getParameter<edm::InputTag>("links")); + simHitsToken_ = consumes< edm::PSimHitContainer >(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); + simTracksToken_ = consumes< edm::SimTrackContainer >(edm::InputTag("g4SimHits")); + simVerticesToken_ = consumes< edm::SimVertexContainer >(edm::InputTag("g4SimHits")); +} + + Phase2TrackerClusterizerValidationTGraph::~Phase2TrackerClusterizerValidationTGraph() { } + + void Phase2TrackerClusterizerValidationTGraph::beginJob() { + edm::Service<TFileService> fs; + fs->file().cd("/"); + TFileDirectory td = fs->mkdir("Common"); + //Create common ntuple + tree = td.make< TTree >("Phase2TrackerClusters","Phase2TrackerClusters"); + // Create common histograms + trackerLayout_[0] = td.make< TGraph >();//"RVsZ_Mixed", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[0] -> SetName("RVsZ_Mixed"); + trackerLayout_[1] = td.make< TGraph >();//"RVsZ_Pixel", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[1] -> SetName("RVsZ_Pixel"); + trackerLayout_[2] = td.make< TGraph >();//"RVsZ_Strip", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[2] -> SetName("RVsZ_Strip"); + trackerLayoutXY_[0] = td.make< TGraph >();//"XVsY_Mixed", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXY_[0] -> SetName("YVsX_Mixed"); + trackerLayoutXY_[1] = td.make< TGraph >();//"XVsY_Pixel", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXY_[1] -> SetName("YVsX_Pixel"); + trackerLayoutXY_[2] = td.make< TGraph >();//"XVsY_Strip", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXY_[2] -> SetName("YVsX_Strip"); + trackerLayoutXYBar_ = td.make< TGraph >();//"XVsYBar", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXYBar_ -> SetName("YVsXBar"); + trackerLayoutXYEC_ = td.make< TGraph >();//"XVsYEC", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXYEC_ -> SetName("YVsXEC"); + } + +void Phase2TrackerClusterizerValidationTGraph::endJob() {} + +void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, const edm::EventSetup& eventSetup) { + + // Get the needed objects + + // Get the clusters + edm::Handle< Phase2TrackerCluster1DCollectionNew > clusters; + event.getByToken(srcClu_, clusters); + + // Get the Phase2 DigiSimLink + edm::Handle<edm::DetSetVector<PixelDigiSimLink> > siphase2SimLinks; + event.getByToken(siphase2OTSimLinksToken_, siphase2SimLinks); + + // Get the SimHits + edm::Handle< edm::PSimHitContainer > simHitsRaw; + event.getByToken(simHitsToken_, simHitsRaw); +// edm::Handle< edm::PSimHitContainer > simHitsRawEndcap; +// event.getByLabel("g4SimHits", "TrackerHitsPixelEndcapLowTof", simHitsRawEndcap); + + // Get the SimTracks + edm::Handle< edm::SimTrackContainer > simTracksRaw; + event.getByToken(simTracksToken_, simTracksRaw); + + // Get the SimVertex + edm::Handle< edm::SimVertexContainer > simVertices; + event.getByToken(simVerticesToken_, simVertices); + + // Get the geometry + edm::ESHandle< TrackerGeometry > geomHandle; + eventSetup.get< TrackerDigiGeometryRecord >().get(geomHandle); + tkGeom = &(*geomHandle); + edm::ESHandle< TrackerTopology > tTopoHandle; + eventSetup.get< TrackerTopologyRcd >().get(tTopoHandle); + tkTopo = tTopoHandle.product(); + + //set up for tree + int layer_number; + //int track_id; + int module_id; + int module_number; + int module_type; //1: pixel, 2: strip + float x_global, y_global, z_global; + float x_local, y_local, z_local; + + tree -> Branch("layer_number",&layer_number,"layer_number/I"); + //tree -> Branch("track_id",&track_id,"track_id/I"); + tree -> Branch("module_id",&module_id,"module_id/I"); + tree -> Branch("module_type",&module_type,"module_type/I"); + tree -> Branch("module_number",&module_number,"module_number/I"); + tree -> Branch("x_global",&x_global,"x_global/F"); + tree -> Branch("y_global",&y_global,"y_global/F"); + tree -> Branch("z_global",&z_global,"z_global/F"); + tree -> Branch("x_local",&x_local,"x_local/F"); + tree -> Branch("y_local",&y_local,"y_local/F"); + tree -> Branch("z_local",&z_local,"z_local/F"); + + // Rearrange the simTracks for ease of use <simTrackID, simTrack> + SimTracksMap simTracks; + for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end(); ++simTrackIt) simTracks.insert(std::pair< unsigned int, SimTrack >(simTrackIt->trackId(), *simTrackIt)); + + // Rearrange the simHits by detUnit + + + // Rearrange the simHits for ease of use + SimHitsMap simHitsDetUnit; + SimHitsMap simHitsTrackId; + for (edm::PSimHitContainer::const_iterator simHitIt(simHitsRaw->begin()); simHitIt != simHitsRaw->end(); ++simHitIt) { + SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt->detUnitId())); + if (simHitsDetUnitIt == simHitsDetUnit.end()) { + std::pair< SimHitsMap::iterator, bool > newIt(simHitsDetUnit.insert(std::pair< unsigned int, std::vector< PSimHit > >(simHitIt->detUnitId(), std::vector< PSimHit >()))); + simHitsDetUnitIt = newIt.first; + } + simHitsDetUnitIt->second.push_back(*simHitIt); + SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt->trackId())); + if (simHitsTrackIdIt == simHitsTrackId.end()) { + std::pair< SimHitsMap::iterator, bool > newIt(simHitsTrackId.insert(std::pair< unsigned int, std::vector< PSimHit > >(simHitIt->trackId(), std::vector< PSimHit >()))); + simHitsTrackIdIt = newIt.first; + } + simHitsTrackIdIt->second.push_back(*simHitIt); + } + + + + // ValidationTGraph + unsigned int nClustersTot(0), nClustersPixelTot(0), nClustersStripTot(0); + + // Loop over modules + for (Phase2TrackerCluster1DCollectionNew::const_iterator DSViter = clusters->begin(); DSViter != clusters->end(); ++DSViter) { + + // Get the detector unit's id + unsigned int rawid(DSViter->detId()); + module_id = rawid; + DetId detId(rawid); + + layer_number = getLayerNumber(detId, tkTopo); + module_number = getModuleNumber(detId, tkTopo); + unsigned int layer(getLayerNumber(detId, tkTopo)); + + + // Get the geometry of the tracker + const GeomDetUnit* geomDetUnit(tkGeom->idToDetUnit(detId)); + const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit); + const PixelTopology& topol = theGeomDet->specificTopology(); + + if (!geomDetUnit) break; + + // Create histograms for the layer if they do not yet exist + std::map< unsigned int, ClusterHistos >::iterator histogramLayer(histograms_.find(layer)); + if (histogramLayer == histograms_.end()) histogramLayer = createLayerHistograms(layer); + + // Number of clusters + unsigned int nClustersPixel(0), nClustersStrip(0); + + // Loop over the clusters in the detector unit + for (edmNew::DetSet< Phase2TrackerCluster1D >::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); ++clustIt) { + + + // Cluster related variables + MeasurementPoint mpClu(clustIt->center(), clustIt->column() + 0.5); + Local3DPoint localPosClu = geomDetUnit->topology().localPosition(mpClu); + x_local = localPosClu.x(); + y_local = localPosClu.y(); + z_local = localPosClu.z(); + std::cout << localPosClu << std::endl; + + Global3DPoint globalPosClu = geomDetUnit->surface().toGlobal(localPosClu); + x_global = globalPosClu.x(); + y_global = globalPosClu.y(); + z_global = globalPosClu.z(); + //std::cout << globalPosClu << std::endl; + + // Fill the position histograms + trackerLayout_[0]->SetPoint(nClustersTot, globalPosClu.z(), globalPosClu.perp()); + trackerLayoutXY_[0]->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); + + if (layer < 100) trackerLayoutXYBar_->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); + else trackerLayoutXYEC_->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); + + histogramLayer->second.localPosXY[0]->SetPoint(nClustersTot, localPosClu.x(), localPosClu.y()); + histogramLayer->second.globalPosXY[0]->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); + + // Pixel module + if (topol.ncolumns() == 32) { + module_type = 1; + trackerLayout_[1]->SetPoint(nClustersPixelTot, globalPosClu.z(), globalPosClu.perp()); + trackerLayoutXY_[1]->SetPoint(nClustersPixelTot, globalPosClu.x(), globalPosClu.y()); + + histogramLayer->second.localPosXY[1]->SetPoint(nClustersPixelTot, localPosClu.x(), localPosClu.y()); + histogramLayer->second.globalPosXY[1]->SetPoint(nClustersPixelTot, globalPosClu.x(), globalPosClu.y()); + histogramLayer->second.clusterSizePixel->Fill(clustIt->size()); + ++nClustersPixel; + ++nClustersPixelTot; + } + // Strip module + else if (topol.ncolumns() == 2) { + module_type = 2; + trackerLayout_[2]->SetPoint(nClustersStripTot, globalPosClu.z(), globalPosClu.perp()); + trackerLayoutXY_[2]->SetPoint(nClustersStripTot, globalPosClu.x(), globalPosClu.y()); + + histogramLayer->second.localPosXY[2]->SetPoint(nClustersStripTot, localPosClu.x(), localPosClu.y()); + histogramLayer->second.globalPosXY[2]->SetPoint(nClustersStripTot, globalPosClu.x(), globalPosClu.y()); + histogramLayer->second.clusterSizeStrip->Fill(clustIt->size()); + ++nClustersStrip; + ++nClustersStripTot; + } + + + + // * Digis related variables + + + std::vector< unsigned int > clusterSimTrackIds; + + // Get all the simTracks that form the cluster + for (unsigned int i(0); i < clustIt->size(); ++i) { + unsigned int channel(PixelDigi::pixelToChannel(clustIt->firstRow() + i, clustIt->column())); // Here we have to use the old pixelToChannel function (not Phase2TrackerDigi but PixelDigi), change this when using new Digis + unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detId, channel)); + clusterSimTrackIds.push_back(simTrackId); + std::cout << channel << std::endl; + std::cout << simTrackId << std::endl; + std::cout << std::endl; + } + unsigned int InnerChannel = clustIt->firstDigi().channel(); + std::cout << InnerChannel << std::endl; + + +/* + // SimHits related variables + + + + unsigned int primarySimHits(0); + unsigned int otherSimHits(0); + + for (edm::PSimHitContainer::const_iterator hitIt(simHitsRaw->begin()); hitIt != simHitsRaw->end(); ++hitIt) { + if (rawid == hitIt->detUnitId() and std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt->trackId()) != clusterSimTrackIds.end()) { + Local3DPoint localPosHit(hitIt->localPosition()); + + histogramLayer->second.deltaXClusterSimHits[0]->Fill(localPosClu.x() - localPosHit.x()); + histogramLayer->second.deltaYClusterSimHits[0]->Fill(localPosClu.y() - localPosHit.y()); + + // Pixel module + if (topol.ncolumns() == 32) { + histogramLayer->second.deltaXClusterSimHits[1]->Fill(localPosClu.x() - localPosHit.x()); + histogramLayer->second.deltaYClusterSimHits[1]->Fill(localPosClu.y() - localPosHit.y()); + } + // Strip module + else if (topol.ncolumns() == 2) { + histogramLayer->second.deltaXClusterSimHits[2]->Fill(localPosClu.x() - localPosHit.x()); + histogramLayer->second.deltaYClusterSimHits[2]->Fill(localPosClu.y() - localPosHit.y()); + } + + ++otherSimHits; + + std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(hitIt->trackId())); + if (simTrackIt == simTracks.end()) continue; + + // Primary particles only + unsigned int processType(hitIt->processType()); + if (simTrackIt->second.vertIndex() == 0 and (processType == 2 || processType == 7 || processType == 9 || processType == 11 || processType == 13 || processType == 15)) { + histogramLayer->second.deltaXClusterSimHits_P[0]->Fill(localPosClu.x() - localPosHit.x()); + histogramLayer->second.deltaYClusterSimHits_P[0]->Fill(localPosClu.y() - localPosHit.y()); + + // Pixel module + if (topol.ncolumns() == 32) { + histogramLayer->second.deltaXClusterSimHits_P[1]->Fill(localPosClu.x() - localPosHit.x()); + histogramLayer->second.deltaYClusterSimHits_P[1]->Fill(localPosClu.y() - localPosHit.y()); + } + // Strip module + else if (topol.ncolumns() == 2) { + histogramLayer->second.deltaXClusterSimHits_P[2]->Fill(localPosClu.x() - localPosHit.x()); + histogramLayer->second.deltaYClusterSimHits_P[2]->Fill(localPosClu.y() - localPosHit.y()); + } + + ++primarySimHits; + } + } + } + + otherSimHits -= primarySimHits; + + histogramLayer->second.primarySimHits->Fill(primarySimHits); + histogramLayer->second.otherSimHits->Fill(otherSimHits); +*/ + } + + if (nClustersPixel) histogramLayer->second.numberClusterPixel->Fill(nClustersPixel); + if (nClustersStrip) histogramLayer->second.numberClusterStrip->Fill(nClustersStrip); + nClustersTot++; + tree->Fill(); + } + +} + +// Create the histograms +std::map< unsigned int, ClusterHistos >::iterator Phase2TrackerClusterizerValidationTGraph::createLayerHistograms(unsigned int ival) { + std::ostringstream fname1, fname2; + + edm::Service<TFileService> fs; + fs->file().cd("/"); + + std::string tag; + unsigned int id; + if (ival < 100) { + id = ival; + fname1 << "Barrel"; + fname2 << "Layer_" << id; + tag = "_layer_"; + } + else { + int side = ival / 100; + id = ival - side * 100; + fname1 << "EndCap_Side_" << side; + fname2 << "Disc_" << id; + tag = "_disc_"; + } + + TFileDirectory td1 = fs->mkdir(fname1.str().c_str()); + TFileDirectory td = td1.mkdir(fname2.str().c_str()); + + ClusterHistos local_histos; + + std::ostringstream histoName; + + /* + * Number of clusters + */ + + histoName.str(""); histoName << "Number_Clusters_Pixel" << tag.c_str() << id; + local_histos.numberClusterPixel = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberClusterPixel->SetFillColor(kAzure + 7); + + histoName.str(""); histoName << "Number_Clusters_Strip" << tag.c_str() << id; + local_histos.numberClusterStrip = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberClusterStrip->SetFillColor(kOrange - 3); + + histoName.str(""); histoName << "Number_Clusters_Mixed" << tag.c_str() << id; + local_histos.numberClustersMixed = td.make< THStack >(histoName.str().c_str(), histoName.str().c_str()); + local_histos.numberClustersMixed->Add(local_histos.numberClusterPixel); + local_histos.numberClustersMixed->Add(local_histos.numberClusterStrip); + + /* + * Cluster size + */ + + histoName.str(""); histoName << "Cluster_Size_Pixel" << tag.c_str() << id; + local_histos.clusterSizePixel = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + local_histos.clusterSizePixel->SetFillColor(kAzure + 7); + + histoName.str(""); histoName << "Cluster_Size_Strip" << tag.c_str() << id; + local_histos.clusterSizeStrip = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + local_histos.clusterSizeStrip->SetFillColor(kOrange - 3); + + histoName.str(""); histoName << "Cluster_Size_Mixed" << tag.c_str() << id; + local_histos.clustersSizeMixed = td.make< THStack >(histoName.str().c_str(), histoName.str().c_str()); + local_histos.clustersSizeMixed->Add(local_histos.clusterSizePixel); + local_histos.clustersSizeMixed->Add(local_histos.clusterSizeStrip); + + /* + * Local and Global positions + */ + + histoName.str(""); histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; + local_histos.localPosXY[0] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Local_Position_XY_Pixel" << tag.c_str() << id; + local_histos.localPosXY[1] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Local_Position_XY_Strip" << tag.c_str() << id; + local_histos.localPosXY[2] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[2]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; + local_histos.globalPosXY[0] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Global_Position_XY_Pixel" << tag.c_str() << id; + local_histos.globalPosXY[1] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Global_Position_XY_Strip" << tag.c_str() << id; + local_histos.globalPosXY[2] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); + + /* + * Delta positions with SimHits + */ + + histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaXClusterSimHits[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Pixel" << tag.c_str() << id; + local_histos.deltaXClusterSimHits[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Strip" << tag.c_str() << id; + local_histos.deltaXClusterSimHits[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaYClusterSimHits[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Pixel" << tag.c_str() << id; + local_histos.deltaYClusterSimHits[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Strip" << tag.c_str() << id; + local_histos.deltaYClusterSimHits[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + /* + * Delta position with simHits for primary tracks only + */ + + histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaXClusterSimHits_P[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Pixel_P" << tag.c_str() << id; + local_histos.deltaXClusterSimHits_P[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Strip_P" << tag.c_str() << id; + local_histos.deltaXClusterSimHits_P[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaYClusterSimHits_P[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Pixel_P" << tag.c_str() << id; + local_histos.deltaYClusterSimHits_P[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Strip_P" << tag.c_str() << id; + local_histos.deltaYClusterSimHits_P[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + /* + * Information on the Digis per cluster + */ + + histoName.str(""); histoName << "Primary_Digis" << tag.c_str() << id; + local_histos.primarySimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + + histoName.str(""); histoName << "Other_Digis" << tag.c_str() << id; + local_histos.otherSimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + + /* + * End + */ + + std::pair< std::map< unsigned int, ClusterHistos >::iterator, bool > insertedIt(histograms_.insert(std::make_pair(ival, local_histos))); + fs->file().cd("/"); + + return insertedIt.first; +} + +unsigned int Phase2TrackerClusterizerValidationTGraph::getLayerNumber(const DetId& detid, const TrackerTopology* topo) { + if (detid.det() == DetId::Tracker) { + if (detid.subdetId() == PixelSubdetector::PixelBarrel) return (topo->pxbLayer(detid)); + else if (detid.subdetId() == PixelSubdetector::PixelEndcap) return (100 * topo->pxfSide(detid) + topo->pxfDisk(detid)); + else return 999; + } + return 999; +} + +unsigned int Phase2TrackerClusterizerValidationTGraph::getModuleNumber(const DetId& detid, const TrackerTopology* topo) { + if (detid.det() == DetId::Tracker) { + if (detid.subdetId() == PixelSubdetector::PixelBarrel) { + return ( topo->pxbModule(detid) ); + } + else if (detid.subdetId() == PixelSubdetector::PixelEndcap) { + return ( topo->pxfModule(detid) ); + } + else return 999; + } + return 999; +} + +unsigned int Phase2TrackerClusterizerValidationTGraph::getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& siphase2SimLinks, const DetId& detId, unsigned int channel) { + edm::DetSetVector< PixelDigiSimLink >::const_iterator DSViter(siphase2SimLinks->find(detId)); + if (DSViter == siphase2SimLinks->end()) return 0; + for (edm::DetSet< PixelDigiSimLink >::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { + if (channel == it->channel()) return it->SimTrackId(); + } + return 0; +} + +DEFINE_FWK_MODULE(Phase2TrackerClusterizerValidationTGraph); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py new file mode 100644 index 0000000000000..b257da7431545 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py @@ -0,0 +1,103 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('RECO',eras.Phase2C2) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryExtended2023D4Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.L1Reco_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +#process.load('Configuration.StandardSequences.Validation_cff') +#process.load('DQMOffline.Configuration.DQMOfflineMC_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +#adding only recolocalreco +process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') + +# import VectorHitBuilder +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('/store/relval/CMSSW_9_1_0_pre1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/90X_upgrade2023_realistic_v9_D4Timing-v1/00000/161D8583-1719-E711-BA42-0CC47A7C346E.root'), + secondaryFileNames = cms.untracked.vstring(), + skipEvents = cms.untracked.uint32(0) +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step3 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-RECO'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('file:step3_1event.root'), + outputCommands = cms.untracked.vstring( ('keep *') ), + splitLevel = cms.untracked.int32(0) +) + +# debug +process.MessageLogger = cms.Service('MessageLogger', + debugModules = cms.untracked.vstring('siPhase2Clusters'), + destinations = cms.untracked.vstring('cout'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR') + ) +) + +# Analyzer +# Analyzer +process.analysis = cms.EDAnalyzer('Phase2TrackerClusterizerValidation', + src = cms.InputTag("siPhase2Clusters"), + links = cms.InputTag("simSiPixelDigis", "Tracker") +) + +#process.analysis = cms.EDAnalyzer('Phase2TrackerClusterizerValidationTGraph', +# src = cms.string("siPhase2Clusters"), +# links = cms.InputTag("simSiPixelDigis", "Tracker") +#) +process.TFileService = cms.Service('TFileService', + fileName = cms.string('file:Clusters_validation.root') +) + + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.L1Reco_step = cms.Path(process.L1Reco) +process.trackerlocalreco_step = cms.Path(process.trackerlocalreco) +process.analysis_step = cms.Path(process.analysis) +process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.RECOSIMoutput_step, process.analysis_step) + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py new file mode 100644 index 0000000000000..a485506221930 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py @@ -0,0 +1,123 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('RECO',eras.Phase2C2) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +#process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('SimGeneral.MixingModule.mix_POISSON_average_cfi') +process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.L1Reco_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +#adding only recolocalreco +process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') + +# import VectorHitBuilder +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/02ACC76A-C93F-E711-B711-0CC47A4C8EC8.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/02FD72C1-D53F-E711-BD00-0CC47A7C3420.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/04EC6BD2-D53F-E711-B2B7-0025905B858E.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/061B97AF-C93F-E711-A425-0CC47A4C8F12.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/081DAA75-C93F-E711-8CAF-0025905B85CA.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0A1C6B0E-C93F-E711-9145-0CC47A7C3412.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0AE954E1-D53F-E711-AA9C-0CC47A4D7632.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0C0660A9-CA3F-E711-8583-0CC47A745298.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0C66279B-CA3F-E711-A4B3-0CC47A7AB7A0.root', + '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0E5BF643-D43F-E711-A64C-0CC47A7C34E6.root'), + #fileNames = cms.untracked.vstring('file:step2.root'), + secondaryFileNames = cms.untracked.vstring(), + skipEvents = cms.untracked.uint32(0) +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step3 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-RECO'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('file:step3_PU200.root'), + outputCommands = cms.untracked.vstring( ('keep *') ), + splitLevel = cms.untracked.int32(0) +) + +# debug +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring("debugVH_PU200"), + debugModules = cms.untracked.vstring("*"), + categories = cms.untracked.vstring("VectorHitsBuilderValidation"), + debugVH_PU200 = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), + DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), + default = cms.untracked.PSet(limit = cms.untracked.int32(0)), + #VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), + #VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), + VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) + ) + ) + +# Analyzer +process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', + src = cms.string("siPhase2Clusters"), + VH_acc = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), + VH_rej = cms.InputTag("siPhase2VectorHits", "vectorHitsRejected"), + CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"), + links = cms.InputTag("simSiPixelDigis", "Tracker"), + trackingParticleSrc = cms.InputTag('mix', 'MergedTrackTruth'), +) +process.TFileService = cms.Service('TFileService', + fileName = cms.string('file:VHs_validation_PU200_new.root') +) + + +# Other statements +process.mix.input.nbPileupEvents.averageNumber = cms.double(200.000000) +process.mix.bunchspace = cms.int32(25) +process.mix.minBunch = cms.int32(-3) +process.mix.maxBunch = cms.int32(3) +process.mix.input.fileNames = cms.untracked.vstring(['/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/0A883B39-083F-E711-8B09-0CC47A7C357A.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/22E509DA-053F-E711-AA7A-0025905B85BA.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/3E376DB4-043F-E711-985E-0CC47A74524E.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/509E21AC-023F-E711-A9F3-0025905B8604.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/5E53AC15-0A3F-E711-8965-0025905A60E0.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/62EC67CA-0B3F-E711-81AC-0025905A610C.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/6476C3E7-063F-E711-B412-0025905B855A.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/7256251B-0B3F-E711-BBEF-0CC47A78A3B4.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/8C943DC3-0B3F-E711-BA5F-0CC47A7C34B0.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/C092AF3B-083F-E711-A0EC-0025905A6070.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/DE2E5EC5-013F-E711-BE84-0CC47A78A3EC.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/DE80A4D4-093F-E711-8195-0CC47A4D75F6.root']) +process.mix.playback = True +process.mix.digitizers = cms.PSet() +for a in process.aliases: delattr(process, a) +process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string("randomEngineStateProducer") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.L1Reco_step = cms.Path(process.L1Reco) +process.trackerlocalreco_step = cms.Path(process.trackerlocalreco+process.siPhase2VectorHits) +process.analysis_step = cms.Path(process.analysis) +process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.RECOSIMoutput_step, process.analysis_step) + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py new file mode 100644 index 0000000000000..fd60e10fcb5dc --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py @@ -0,0 +1,114 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('RECO',eras.Phase2C2) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.L1Reco_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +#adding only recolocalreco +process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') + +# import VectorHitBuilder +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/0A0A27B4-153F-E711-ABC3-0025905A60C6.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/34817EB0-163F-E711-83C8-0CC47A7C340C.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/3CC9FD4E-173F-E711-B4DF-0025905A60D6.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/521169DF-173F-E711-BC3D-0CC47A7C35A4.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/6E767157-163F-E711-B315-0025905B8560.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/7A9BAA32-173F-E711-B7CA-0CC47A78A496.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/BA5F8EE0-173F-E711-97E9-0025905A6122.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/CA0AE5B2-153F-E711-B1CE-0025905B85EE.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/DEFFF299-173F-E711-9A88-0CC47A4C8EE2.root', + '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/FA58F15E-163F-E711-B748-0025905A607A.root'), + #fileNames = cms.untracked.vstring('file:step2.root'), + secondaryFileNames = cms.untracked.vstring(), + skipEvents = cms.untracked.uint32(0) +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step3 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-RECO'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('file:step3_1event.root'), + outputCommands = cms.untracked.vstring( ('keep *') ), + splitLevel = cms.untracked.int32(0) +) + +# debug +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring("debugVH_tilted"), + debugModules = cms.untracked.vstring("*"), + categories = cms.untracked.vstring("VectorHitBuilderEDProducer","VectorHitBuilderAlgorithm","VectorHitsBuilderValidation","VectorHitBuilder"), + debugVH_tilted = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), + DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), + default = cms.untracked.PSet(limit = cms.untracked.int32(0)), + VectorHitBuilder = cms.untracked.PSet(limit = cms.untracked.int32(-1)), + VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), + VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), + VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) + ) + ) + +# Analyzer +process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', + src = cms.string("siPhase2Clusters"), + VH_acc = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), + VH_rej = cms.InputTag("siPhase2VectorHits", "vectorHitsRejected"), + CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"), + links = cms.InputTag("simSiPixelDigis", "Tracker"), + trackingParticleSrc = cms.InputTag('mix', 'MergedTrackTruth'), +) +process.TFileService = cms.Service('TFileService', + fileName = cms.string('file:VHs_validation.root') +) + + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.L1Reco_step = cms.Path(process.L1Reco) +process.trackerlocalreco_step = cms.Path(process.trackerlocalreco+process.siPhase2VectorHits) +process.analysis_step = cms.Path(process.analysis) +process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.RECOSIMoutput_step, process.analysis_step) + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting_TenMuExtendedE_0_200.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting_TenMuExtendedE_0_200.py new file mode 100644 index 0000000000000..45c7942ff29e4 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting_TenMuExtendedE_0_200.py @@ -0,0 +1,105 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('RECO',eras.Phase2C2) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.L1Reco_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +#adding only recolocalreco +process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') + +# import VectorHitBuilder +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1000) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:step2_TenMuExtendedE_0_200.root'), + secondaryFileNames = cms.untracked.vstring(), + #skipEvents = cms.untracked.uint32(0), + #eventsToProcess = cms.untracked.VEventRange('1:952-1:952') +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step3 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-RECO'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('file:step3_1event.root'), + outputCommands = cms.untracked.vstring( ('keep *') ), + splitLevel = cms.untracked.int32(0) +) + +# debug +#process.MessageLogger = cms.Service("MessageLogger", +# destinations = cms.untracked.vstring("debugVH_tilted"), +# debugModules = cms.untracked.vstring("*"), +# categories = cms.untracked.vstring("VectorHitBuilderEDProducer","VectorHitBuilderAlgorithm","VectorHitsBuilderValidation","VectorHitBuilder"), +# debugVH_tilted = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), +# DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), +# default = cms.untracked.PSet(limit = cms.untracked.int32(0)), +# VectorHitBuilder = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) +# ) +# ) + +# Analyzer +process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', + src = cms.string("siPhase2Clusters"), + VH_acc = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), + VH_rej = cms.InputTag("siPhase2VectorHits", "vectorHitsRejected"), + CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"), + links = cms.InputTag("simSiPixelDigis", "Tracker"), + trackingParticleSrc = cms.InputTag('mix', 'MergedTrackTruth'), +) +process.TFileService = cms.Service('TFileService', + fileName = cms.string('file:VHs_validation_TenMu_new.root') +) + + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.L1Reco_step = cms.Path(process.L1Reco) +process.trackerlocalreco_step = cms.Path(process.trackerlocalreco+process.siPhase2VectorHits) +process.analysis_step = cms.Path(process.analysis) +process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.RECOSIMoutput_step, process.analysis_step) + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc new file mode 100644 index 0000000000000..10992b5d94984 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -0,0 +1,1154 @@ +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h" +#include "SimTracker/TrackerHitAssociation/interface/ClusterTPAssociation.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h" +#include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" +#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" + +VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet& conf) : + cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) +{ + srcClu_ = consumes< edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); + VHacc_ = consumes< VectorHitCollectionNew >(edm::InputTag(conf.getParameter<edm::InputTag>("VH_acc"))); + VHrej_ = consumes< VectorHitCollectionNew >(edm::InputTag(conf.getParameter<edm::InputTag>("VH_rej"))); + siphase2OTSimLinksToken_ = consumes<edm::DetSetVector<PixelDigiSimLink> >(conf.getParameter<edm::InputTag>("links")); + simHitsToken_ = consumes< edm::PSimHitContainer >(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); + simTracksToken_ = consumes< edm::SimTrackContainer >(edm::InputTag("g4SimHits")); + simVerticesToken_ = consumes< edm::SimVertexContainer >(edm::InputTag("g4SimHits")); + trackingParticleToken_ = consumes< TrackingParticleCollection >(conf.getParameter<edm::InputTag>("trackingParticleSrc")); +} + +VectorHitsBuilderValidation::~VectorHitsBuilderValidation() { +} + +void VectorHitsBuilderValidation::beginJob() { + + edm::Service<TFileService> fs; + fs->file().cd("/"); + TFileDirectory td = fs->mkdir("Common"); + + //Create common ntuple + tree = td.make< TTree >("VectorHits","VectorHits"); + + // Create common graphs + TFileDirectory tdGloPos = td.mkdir("GlobalPositions"); + trackerLayoutRZ_[0] = tdGloPos.make< TGraph >(); + trackerLayoutRZ_[0] -> SetName("RVsZ_Mixed"); + trackerLayoutRZ_[1] = tdGloPos.make< TGraph >(); + trackerLayoutRZ_[1] -> SetName("RVsZ_Pixel"); + trackerLayoutRZ_[2] = tdGloPos.make< TGraph >(); + trackerLayoutRZ_[2] -> SetName("RVsZ_Strip"); + trackerLayoutXY_[0] = tdGloPos.make< TGraph >(); + trackerLayoutXY_[0] -> SetName("YVsX_Mixed"); + trackerLayoutXY_[1] = tdGloPos.make< TGraph >(); + trackerLayoutXY_[1] -> SetName("YVsX_Pixel"); + trackerLayoutXY_[2] = tdGloPos.make< TGraph >(); + trackerLayoutXY_[2] -> SetName("YVsX_Strip"); + trackerLayoutXYBar_ = tdGloPos.make< TGraph >(); + trackerLayoutXYBar_ -> SetName("YVsXBar"); + trackerLayoutXYEC_ = tdGloPos.make< TGraph >(); + trackerLayoutXYEC_ -> SetName("YVsXEC"); + + TFileDirectory tdLocPos = td.mkdir("LocalPositions"); + localPosXvsDeltaX_[0] = tdLocPos.make< TGraph >(); + localPosXvsDeltaX_[0] -> SetName("localPosXvsDeltaX_Mixed"); + localPosXvsDeltaX_[1] = tdLocPos.make< TGraph >(); + localPosXvsDeltaX_[1] -> SetName("localPosXvsDeltaX_Pixel"); + localPosXvsDeltaX_[2] = tdLocPos.make< TGraph >(); + localPosXvsDeltaX_[2] -> SetName("localPosXvsDeltaX_Strip"); + localPosYvsDeltaY_[0] = tdLocPos.make< TGraph >(); + localPosYvsDeltaY_[0] -> SetName("localPosYvsDeltaY_Mixed"); + localPosYvsDeltaY_[1] = tdLocPos.make< TGraph >(); + localPosYvsDeltaY_[1] -> SetName("localPosYvsDeltaY_Pixel"); + localPosYvsDeltaY_[2] = tdLocPos.make< TGraph >(); + localPosYvsDeltaY_[2] -> SetName("localPosYvsDeltaY_Strip"); + + //drawing VHs arrows + TFileDirectory tdArr = td.mkdir("Directions"); + + //VHXY_[0] = tdArr.make< TCanvas >(); VHXY_[0] -> SetName("YVsX_Mixed"); + //VHXY_[1] = tdArr.make< TCanvas >(); VHXY_[1] -> SetName("YVsX_Pixel"); + //VHXY_[2] = tdArr.make< TCanvas >(); VHXY_[2] -> SetName("YVsX_Strip"); + + TFileDirectory tdWid = td.mkdir("CombinatorialStudies"); + ParallaxCorrectionRZ_ = tdWid.make< TH2D >("ParallaxCorrectionRZ","ParallaxCorrectionRZ", 100, 0., 300., 100., 0., 120.); + ParallaxCorrectionRZ_ -> SetName("ParallaxCorrectionFactor"); + VHaccLayer_ = tdWid.make< TH1F >("VHacceptedLayer","VHacceptedLayer", 250, 0., 250.); + VHaccLayer_ -> SetName("VHaccepted"); + VHrejLayer_ = tdWid.make< TH1F >("VHrejectedLayer","VHrejectedLayer", 250, 0., 250.); + VHrejLayer_ -> SetName("VHrejected"); + VHaccTrueLayer_ = tdWid.make< TH1F >("VHaccTrueLayer","VHaccTrueLayer", 250, 0., 250.); + VHaccTrueLayer_ -> SetName("VHaccepted_true"); + VHrejTrueLayer_ = tdWid.make< TH1F >("VHrejTrueLayer","VHrejTrueLayer", 250, 0., 250.); + VHrejTrueLayer_ -> SetName("VHrejected_true"); + VHaccTrue_signal_Layer_ = tdWid.make< TH1F >("VHaccTrueSignalLayer","VHaccTrueSignalLayer", 250, 0., 250.); + VHaccTrue_signal_Layer_ -> SetName("VHaccepted_true_signal"); + VHrejTrue_signal_Layer_ = tdWid.make< TH1F >("VHrejTrueSignalLayer","VHrejTrueSignalLayer", 250, 0., 250.); + VHrejTrue_signal_Layer_ -> SetName("VHrejected_true_signal"); + + VHaccTrueLayer_ratio = tdWid.make< TH1F >("VHaccTrueLayer_ratio","VHaccTrueLayer_ratio", 250, 0., 250.); + VHaccTrueLayer_ratio -> SetName("VHaccepted_true_ratio"); + VHrejTrueLayer_ratio = tdWid.make< TH1F >("VHrejTrueLayer_ratio","VHrejTrueLayer_ratio", 250, 0., 250.); + VHrejTrueLayer_ratio -> SetName("VHrejected_true_ratio"); + + +} + +void VectorHitsBuilderValidation::endJob() {} + +void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::EventSetup& eventSetup) { + + // Get the needed objects + + // Get the clusters + edm::Handle< Phase2TrackerCluster1DCollectionNew > clusters; + event.getByToken(srcClu_, clusters); + + // Get the vector hits + edm::Handle< VectorHitCollectionNew > vhsAcc; + event.getByToken(VHacc_, vhsAcc); + + edm::Handle< VectorHitCollectionNew > vhsRej; + event.getByToken(VHrej_, vhsRej); + + // load the cpe via the eventsetup + edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpeHandle; + eventSetup.get<TkPhase2OTCPERecord>().get(cpeTag_, cpeHandle); + cpe = cpeHandle.product(); + + // Get the Phase2 DigiSimLink + edm::Handle<edm::DetSetVector<PixelDigiSimLink> > siphase2SimLinks; + event.getByToken(siphase2OTSimLinksToken_, siphase2SimLinks); + + // Get the SimHits + edm::Handle< edm::PSimHitContainer > simHitsRaw; + event.getByToken(simHitsToken_, simHitsRaw); +// edm::Handle< edm::PSimHitContainer > simHitsRawEndcap; +// event.getByLabel("g4SimHits", "TrackerHitsPixelEndcapLowTof", simHitsRawEndcap); + + // Get the SimTracks + edm::Handle< edm::SimTrackContainer > simTracksRaw; + event.getByToken(simTracksToken_, simTracksRaw); + + // Get the SimVertex + edm::Handle< edm::SimVertexContainer > simVertices; + event.getByToken(simVerticesToken_, simVertices); + + // Get the geometry + edm::ESHandle< TrackerGeometry > geomHandle; + eventSetup.get< TrackerDigiGeometryRecord >().get(geomHandle); + tkGeom = &(*geomHandle); + + // Get the Topology + edm::ESHandle< TrackerTopology > tTopoHandle; + eventSetup.get< TrackerTopologyRcd >().get(tTopoHandle); + tkTopo = tTopoHandle.product(); + + edm::ESHandle< MagneticField > magFieldHandle; + eventSetup.get< IdealMagneticFieldRecord >().get(magFieldHandle); + magField = magFieldHandle.product(); + + //Tracking Particle collection + edm::Handle<TrackingParticleCollection> TPCollectionH; + event.getByToken(trackingParticleToken_,TPCollectionH); + + auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH); + std::map<std::pair<size_t, EncodedEventId>, TrackingParticleRef> mapping; + + for (TrackingParticleCollection::size_type itp = 0; itp < TPCollectionH.product()->size(); ++itp) { + TrackingParticleRef trackingParticle(TPCollectionH, itp); + EncodedEventId eid(trackingParticle->eventId()); + for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin(); + itrk != trackingParticle->g4Track_end(); ++itrk) { + std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid); + LogTrace("VectorHitsBuilderValidation") << "creating map for id: " << trkid.first << " with tp: " << trackingParticle.key() ; + mapping.insert(std::make_pair(trkid, trackingParticle)); + } + } + + //set up for tree + int eventNum; + int layer; + int module_id; + int module_number; + int module_type; //1: pixel, 2: strip + int VHacc = 0.0; + int VHrej = 0.0; + int vh_isTrue; + + float x_global, y_global, z_global; + float vh_x_local, vh_y_local; + float vh_x_le, vh_y_le; + float curvature, phi; + float QOverPT, QOverP; + float chi2; + + int low_tp_id, upp_tp_id; + float vh_sim_trackPt; + float sim_x_local, sim_y_local; + float sim_x_global, sim_y_global, sim_z_global; + float low_x_global, low_y_global, low_z_global; + float upp_x_global, upp_y_global, upp_z_global; + float low_xx_global_err, low_yy_global_err, low_zz_global_err; + float low_xy_global_err, low_zx_global_err, low_zy_global_err; + float upp_xx_global_err, upp_yy_global_err, upp_zz_global_err; + float upp_xy_global_err, upp_zx_global_err, upp_zy_global_err; + float deltaXVHSimHits, deltaYVHSimHits; + int multiplicity; + float width, deltaXlocal; + unsigned int processType(99); + + tree -> Branch("event",&eventNum,"eventNum/I"); + tree -> Branch("accepted",&VHacc,"VHacc/I"); + tree -> Branch("rejected",&VHrej,"VHrej/I"); + tree -> Branch("layer",&layer,"layer/I"); + tree -> Branch("module_id",&module_id,"module_id/I"); + tree -> Branch("module_type",&module_type,"module_type/I"); + tree -> Branch("module_number",&module_number,"module_number/I"); + tree -> Branch("vh_isTrue",&vh_isTrue,"vh_isTrue/I"); + tree -> Branch("x_global",&x_global,"x_global/F"); + tree -> Branch("y_global",&y_global,"y_global/F"); + tree -> Branch("z_global",&z_global,"z_global/F"); + tree -> Branch("vh_x_local",&vh_x_local,"vh_x_local/F"); + tree -> Branch("vh_y_local",&vh_y_local,"vh_y_local/F"); + tree -> Branch("vh_x_lError",&vh_x_le,"vh_x_le/F"); + tree -> Branch("vh_y_lError",&vh_y_le,"vh_y_le/F"); + tree -> Branch("curvature",&curvature,"curvature/F"); + tree -> Branch("chi2",&chi2,"chi2/F"); + tree -> Branch("phi",&phi,"phi/F"); + tree -> Branch("QOverP",&QOverP,"QOverP/F"); + tree -> Branch("QOverPT",&QOverPT,"QOverPT/F"); + tree -> Branch("low_tp_id",&low_tp_id,"low_tp_id/I"); + tree -> Branch("upp_tp_id",&upp_tp_id,"upp_tp_id/I"); + tree -> Branch("vh_sim_trackPt",&vh_sim_trackPt,"vh_sim_trackPt/F"); + tree -> Branch("sim_x_local",&sim_x_local,"sim_x_local/F"); + tree -> Branch("sim_y_local",&sim_y_local,"sim_y_local/F"); + tree -> Branch("sim_x_global",&sim_x_global,"sim_x_global/F"); + tree -> Branch("sim_y_global",&sim_y_global,"sim_y_global/F"); + tree -> Branch("sim_z_global",&sim_z_global,"sim_z_global/F"); + tree -> Branch("low_x_global",&low_x_global,"low_x_global/F"); + tree -> Branch("low_y_global",&low_y_global,"low_y_global/F"); + tree -> Branch("low_z_global",&low_z_global,"low_z_global/F"); + tree -> Branch("low_xx_global_err",&low_xx_global_err,"low_xx_global_err/F"); + tree -> Branch("low_yy_global_err",&low_yy_global_err,"low_yy_global_err/F"); + tree -> Branch("low_zz_global_err",&low_zz_global_err,"low_zz_global_err/F"); + tree -> Branch("low_xy_global_err",&low_xy_global_err,"low_xy_global_err/F"); + tree -> Branch("low_zx_global_err",&low_zx_global_err,"low_zx_global_err/F"); + tree -> Branch("low_zy_global_err",&low_zy_global_err,"low_zy_global_err/F"); + tree -> Branch("upp_x_global",&upp_x_global,"upp_x_global/F"); + tree -> Branch("upp_y_global",&upp_y_global,"upp_y_global/F"); + tree -> Branch("upp_z_global",&upp_z_global,"upp_z_global/F"); + tree -> Branch("upp_xx_global_err",&upp_xx_global_err,"upp_xx_global_err/F"); + tree -> Branch("upp_yy_global_err",&upp_yy_global_err,"upp_yy_global_err/F"); + tree -> Branch("upp_zz_global_err",&upp_zz_global_err,"upp_zz_global_err/F"); + tree -> Branch("upp_xy_global_err",&upp_xy_global_err,"upp_xy_global_err/F"); + tree -> Branch("upp_zx_global_err",&upp_zx_global_err,"upp_zx_global_err/F"); + tree -> Branch("upp_zy_global_err",&upp_zy_global_err,"upp_zy_global_err/F"); + tree -> Branch("deltaXVHSimHits",&deltaXVHSimHits,"deltaXVHSimHits/F"); + tree -> Branch("deltaYVHSimHits",&deltaYVHSimHits,"deltaYVHSimHits/F"); + tree -> Branch("multiplicity",&multiplicity,"multiplicity/I"); + tree -> Branch("width",&width,"width/F"); + tree -> Branch("deltaXlocal",&deltaXlocal,"deltaXlocal/F"); + tree -> Branch("processType",&processType,"processType/i"); + + // Rearrange the simTracks for ease of use <simTrackID, simTrack> + SimTracksMap simTracks; + for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end(); ++simTrackIt) simTracks.insert(std::pair< unsigned int, SimTrack >(simTrackIt->trackId(), *simTrackIt)); + + // Rearrange the simHits by detUnit for ease of use + SimHitsMap simHitsDetUnit; + SimHitsMap simHitsTrackId; + for (edm::PSimHitContainer::const_iterator simHitIt(simHitsRaw->begin()); simHitIt != simHitsRaw->end(); ++simHitIt) { + SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt->detUnitId())); + if (simHitsDetUnitIt == simHitsDetUnit.end()) { + std::pair< SimHitsMap::iterator, bool > newIt(simHitsDetUnit.insert(std::pair< unsigned int, std::vector< PSimHit > >(simHitIt->detUnitId(), std::vector< PSimHit >()))); + simHitsDetUnitIt = newIt.first; + } + simHitsDetUnitIt->second.push_back(*simHitIt); + + SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt->trackId())); + if (simHitsTrackIdIt == simHitsTrackId.end()) { + std::pair< SimHitsMap::iterator, bool > newIt(simHitsTrackId.insert(std::pair< unsigned int, std::vector< PSimHit > >(simHitIt->trackId(), std::vector< PSimHit >()))); + simHitsTrackIdIt = newIt.first; + } + simHitsTrackIdIt->second.push_back(*simHitIt); + } + + //Printout outer tracker clusters in the event + for (Phase2TrackerCluster1DCollectionNew::const_iterator DSViter = clusters->begin(); DSViter != clusters->end(); ++DSViter) { + unsigned int rawid(DSViter->detId()); DetId detId(rawid); + const GeomDetUnit* geomDetUnit(tkGeom->idToDetUnit(detId)); + const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit); + for (edmNew::DetSet< Phase2TrackerCluster1D >::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); ++clustIt) { + auto && lparams = cpe->localParameters( *clustIt, *theGeomDet ); + Global3DPoint gparams = theGeomDet->surface().toGlobal(lparams.first); + LogTrace("VectorHitsBuilderValidation") << "phase2 OT clusters: " << gparams << " DetId: " << rawid; + } + } + + for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { + for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + LogTrace("VectorHitsBuilderValidation") << "accepted VH: " << *vhIt; + } + } + for (VectorHitCollectionNew::const_iterator DSViter = vhsRej->begin(); DSViter != vhsRej->end(); ++DSViter) { + for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + LogTrace("VectorHitsBuilderValidation") << "rejected VH: " << *vhIt; + } + } + // Validation + eventNum = event.id().event(); + + unsigned int nVHsTot(0), nVHsPSTot(0), nVHs2STot(0); + std::vector<Global3DPoint> glVHs; + std::vector<Global3DVector> dirVHs; + std::vector<int> detIds; + + // Loop over modules + for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { + + // Get the detector unit's id + unsigned int rawid(DSViter->detId()); + module_id = rawid; + DetId detId(rawid); + + module_number = getModuleNumber(detId); + layer = getLayerNumber(detId); + + LogDebug("VectorHitsBuilderValidation") << "Layer: " << layer << " det id" << rawid << std::endl; + + // Get the geometry of the tracker + const GeomDet* geomDet(tkGeom->idToDet(detId)); + if (!geomDet) break; + + // Create histograms for the layer if they do not yet exist + std::map< unsigned int, VHHistos >::iterator histogramLayer(histograms_.find(layer)); + if (histogramLayer == histograms_.end()) histogramLayer = createLayerHistograms(layer); + // Number of clusters + unsigned int nVHsPS(0), nVHs2S(0); + + LogDebug("VectorHitsBuilderValidation") << "DSViter size: " << DSViter->size(); + + + // Loop over the vhs in the detector unit + for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + + // vh variables + if( vhIt->isValid() ){ + + LogDebug("VectorHitsBuilderValidation") << " vh analyzing ..." ; + chi2 = vhIt->chi2(); + LogTrace("VectorHitsBuilderValidation") << "VH chi2 " << chi2 << std::endl; + + Local3DPoint localPosVH = vhIt->localPosition(); + vh_x_local = localPosVH.x(); + vh_y_local = localPosVH.y(); + LogTrace("VectorHitsBuilderValidation") << "local VH position " << localPosVH << std::endl; + + LocalError localErrVH = vhIt->localPositionError(); + vh_x_le = localErrVH.xx(); + vh_y_le = localErrVH.yy(); + LogTrace("VectorHitsBuilderValidation") << "local VH error " << localErrVH << std::endl; + + Global3DPoint globalPosVH = geomDet->surface().toGlobal(localPosVH); + x_global = globalPosVH.x(); + y_global = globalPosVH.y(); + z_global = globalPosVH.z(); + glVHs.push_back(globalPosVH); + LogTrace("VectorHitsBuilderValidation") << " global VH position " << globalPosVH << std::endl; + + Local3DVector localDirVH = vhIt->localDirection(); + LogTrace("VectorHitsBuilderValidation") << "local VH direction " << localDirVH << std::endl; + + VectorHit vh = *vhIt; + Global3DVector globalDirVH = vh.globalDelta(); + dirVHs.push_back(globalDirVH); + LogTrace("VectorHitsBuilderValidation") << "global VH direction " << globalDirVH << std::endl; + + // Fill the position histograms + trackerLayoutRZ_[0]->SetPoint(nVHsTot, globalPosVH.z(), globalPosVH.perp()); + trackerLayoutXY_[0]->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + + if (layer < 100) trackerLayoutXYBar_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + else trackerLayoutXYEC_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + + histogramLayer->second.localPosXY[0]->SetPoint(nVHsTot, vh_x_local, vh_y_local); + histogramLayer->second.globalPosXY[0]->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + + localPosXvsDeltaX_[0]->SetPoint(nVHsTot, vh_x_local, localDirVH.x()); + localPosYvsDeltaY_[0]->SetPoint(nVHsTot, vh_y_local, localDirVH.y()); + + // Pixel module + const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); + const PixelGeomDetUnit* geomDetLower = dynamic_cast< const PixelGeomDetUnit* >(stackDet->lowerDet()); + DetId lowerDetId = stackDet->lowerDet()->geographicalId(); + DetId upperDetId = stackDet->upperDet()->geographicalId(); + + + TrackerGeometry::ModuleType mType = tkGeom->getDetectorType(lowerDetId); + module_type = 0; + if (mType == TrackerGeometry::ModuleType::Ph2PSP) { + module_type = 1; + trackerLayoutRZ_[1]->SetPoint(nVHsPSTot, globalPosVH.z(), globalPosVH.perp()); + trackerLayoutXY_[1]->SetPoint(nVHsPSTot, globalPosVH.x(), globalPosVH.y()); + + histogramLayer->second.localPosXY[1]->SetPoint(nVHsPSTot, vh_x_local, vh_y_local); + histogramLayer->second.globalPosXY[1]->SetPoint(nVHsPSTot, globalPosVH.x(), globalPosVH.y()); + + localPosXvsDeltaX_[1]->SetPoint(nVHsPSTot, vh_x_local, localDirVH.x()); + localPosYvsDeltaY_[1]->SetPoint(nVHsPSTot, vh_y_local, localDirVH.y()); + + ++nVHsPS; + ++nVHsPSTot; + } + + // Strip module + else if (mType == TrackerGeometry::ModuleType::Ph2SS) { + module_type = 2; + trackerLayoutRZ_[2]->SetPoint(nVHs2STot, globalPosVH.z(), globalPosVH.perp()); + trackerLayoutXY_[2]->SetPoint(nVHs2STot, globalPosVH.x(), globalPosVH.y()); + + histogramLayer->second.localPosXY[2]->SetPoint(nVHs2STot, vh_x_local, vh_y_local); + histogramLayer->second.globalPosXY[2]->SetPoint(nVHs2STot, globalPosVH.x(), globalPosVH.y()); + + localPosXvsDeltaX_[2]->SetPoint(nVHs2STot, vh_x_local, localDirVH.x()); + localPosYvsDeltaY_[2]->SetPoint(nVHs2STot, vh_y_local, localDirVH.y()); + + ++nVHs2S; + ++nVHs2STot; + } else if (mType == TrackerGeometry::ModuleType::Ph2PSS) { + edm::LogError("VectorHitsBuilderValidation") << "module type " << module_type << " should never happen!"; + } + LogTrace("VectorHitsBuilderValidation") << "module type " << module_type << std::endl; + + // get the geomDetUnit of the clusters + low_x_global = vhIt->lowerGlobalPos().x(); + low_y_global = vhIt->lowerGlobalPos().y(); + low_z_global = vhIt->lowerGlobalPos().z(); + upp_x_global = vhIt->upperGlobalPos().x(); + upp_y_global = vhIt->upperGlobalPos().y(); + upp_z_global = vhIt->upperGlobalPos().z(); + + low_xx_global_err = vhIt->lowerGlobalPosErr().cxx(); + low_yy_global_err = vhIt->lowerGlobalPosErr().cyy(); + low_zz_global_err = vhIt->lowerGlobalPosErr().czz(); + low_xy_global_err = vhIt->lowerGlobalPosErr().cyx(); + low_zx_global_err = vhIt->lowerGlobalPosErr().czx(); + low_zy_global_err = vhIt->lowerGlobalPosErr().czy(); + + upp_xx_global_err = vhIt->upperGlobalPosErr().cxx(); + upp_yy_global_err = vhIt->upperGlobalPosErr().cyy(); + upp_zz_global_err = vhIt->upperGlobalPosErr().czz(); + upp_xy_global_err = vhIt->upperGlobalPosErr().cyx(); + upp_zx_global_err = vhIt->upperGlobalPosErr().czx(); + upp_zy_global_err = vhIt->upperGlobalPosErr().czy(); + + LogDebug("VectorHitsBuilderValidation") << "print Clusters into the VH:" << std::endl; + printCluster(geomDetLower,vhIt->lowerClusterRef()); + LogTrace("VectorHitsBuilderValidation") << "\t global pos lower " << vhIt->lowerGlobalPos() << std::endl; + LogTrace("VectorHitsBuilderValidation") << "\t global posErr lower " << vhIt->lowerGlobalPosErr().cxx() << std::endl; + const GeomDetUnit* geomDetUpper = stackDet->upperDet(); + printCluster(geomDetUpper,vhIt->upperClusterRef()); + LogTrace("VectorHitsBuilderValidation") << "\t global pos upper " << vhIt->upperGlobalPos() << std::endl; + + //comparison with SIM hits + LogDebug("VectorHitsBuilderValidation") << "comparison Clusters with sim hits ... " << std::endl; + std::vector< unsigned int > clusterSimTrackIds; + std::vector< unsigned int > clusterSimTrackIdsUpp; + std::set<std::pair<uint32_t, EncodedEventId> > simTkIds; + const GeomDetUnit* geomDetUnit_low(tkGeom->idToDetUnit(lowerDetId)); + LogTrace("VectorHitsBuilderValidation") << " lowerDetID : " << lowerDetId.rawId(); + const GeomDetUnit* geomDetUnit_upp(tkGeom->idToDetUnit(upperDetId)); + LogTrace("VectorHitsBuilderValidation") << " upperDetID : " << upperDetId.rawId(); + + for (unsigned int istr(0); istr < (*(vhIt->lowerClusterRef().cluster_phase2OT())).size(); ++istr) { + uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vhIt->lowerClusterRef().cluster_phase2OT())).firstRow() + istr, (*(vhIt->lowerClusterRef().cluster_phase2OT())).column()); + unsigned int LowerSimTrackId(getSimTrackId(siphase2SimLinks, lowerDetId, channel)); + std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, lowerDetId, channel)); + if (trkid.size()==0) continue; + clusterSimTrackIds.push_back(LowerSimTrackId); + simTkIds.insert(trkid.begin(),trkid.end()); + LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << LowerSimTrackId << std::endl; + } + // In the case of PU, we need the TPs to find the proper SimTrackID + for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin(); + iset != simTkIds.end(); iset++) { + auto ipos = mapping.find(*iset); + if (ipos != mapping.end()) { + LogTrace("VectorHitsBuilderValidation") << "lower cluster in detid: " << lowerDetId.rawId() << " from tp: " << ipos->second.key() << " " << iset->first; + LogTrace("VectorHitsBuilderValidation") << "with pt(): " << (*ipos->second).pt(); + low_tp_id = ipos->second.key(); + vh_sim_trackPt = (*ipos->second).pt(); + } + } + + simTkIds.clear(); + for (unsigned int istr(0); istr < (*(vhIt->upperClusterRef().cluster_phase2OT())).size(); ++istr) { + uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vhIt->upperClusterRef().cluster_phase2OT())).firstRow() + istr, (*(vhIt->upperClusterRef().cluster_phase2OT())).column()); + unsigned int UpperSimTrackId(getSimTrackId(siphase2SimLinks, upperDetId, channel)); + std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, upperDetId, channel)); + if (trkid.size()==0) continue; + clusterSimTrackIdsUpp.push_back(UpperSimTrackId); + simTkIds.insert(trkid.begin(),trkid.end()); + LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << UpperSimTrackId << std::endl; + } + // In the case of PU, we need the TPs to find the proper SimTrackID + for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin(); + iset != simTkIds.end(); iset++) { + auto ipos = mapping.find(*iset); + if (ipos != mapping.end()) { + LogTrace("VectorHitsBuilderValidation") << "upper cluster in detid: " << upperDetId.rawId() << " from tp: " << ipos->second.key() << " " << iset->first << std::endl; + upp_tp_id = ipos->second.key(); + } + } + //compute if the vhits is 'true' or 'false' and save sim pT + std::pair<bool,uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + vh_isTrue = 0; + if(istrue.first){ + vh_isTrue = 1; + } + + + + // loop over all simHits + unsigned int totalSimHits(0); + unsigned int primarySimHits(0); + unsigned int otherSimHits(0); + + + for (edm::PSimHitContainer::const_iterator hitIt(simHitsRaw->begin()); hitIt != simHitsRaw->end(); ++hitIt) { + + if(hitIt->detUnitId() == geomDetLower->geographicalId()){// || hitIt->detUnitId() == geomDetUpper->geographicalId()){ + + //check clusters track id compatibility + if(std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt->trackId()) != clusterSimTrackIds.end()){ + + Local3DPoint localPosHit(hitIt->localPosition()); + sim_x_local = localPosHit.x(); + sim_y_local = localPosHit.y(); + + deltaXVHSimHits = vh_x_local - sim_x_local; + deltaYVHSimHits = vh_y_local - sim_y_local; + + Global3DPoint globalPosHit = geomDetLower->surface().toGlobal(localPosHit); + sim_x_global = globalPosHit.x(); + sim_y_global = globalPosHit.y(); + sim_z_global = globalPosHit.z(); + + histogramLayer->second.deltaXVHSimHits[0]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits[0]->Fill(vh_y_local - sim_y_local); + + // Pixel module + if (layer == 1 || layer == 2 || layer == 3) { + histogramLayer->second.deltaXVHSimHits[1]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits[1]->Fill(vh_y_local - sim_y_local); + } + // Strip module + else if (layer == 4 || layer == 5 || layer == 6) { + histogramLayer->second.deltaXVHSimHits[2]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits[2]->Fill(vh_y_local - sim_y_local); + } + + ++totalSimHits; + + std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(hitIt->trackId())); + if (simTrackIt == simTracks.end()) continue; + //LogTrace("VectorHitsBuilderValidation") << "--> with hitIt. The SimTrack has p: " << simTrackIt->second.momentum(); + + + // Primary particles only + processType = hitIt->processType(); + + if (simTrackIt->second.vertIndex() == 0 and (processType == 2 || processType == 7 || processType == 9 || processType == 11 || processType == 13 || processType == 15)) { + histogramLayer->second.deltaXVHSimHits_P[0]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[0]->Fill(vh_y_local - sim_y_local); + + // Pixel module + if (layer == 1 || layer == 2 || layer == 3) { + histogramLayer->second.deltaXVHSimHits_P[1]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[1]->Fill(vh_y_local - sim_y_local); + } + // Strip module + else if (layer == 4 || layer == 5 || layer == 6) { + histogramLayer->second.deltaXVHSimHits_P[2]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[2]->Fill(vh_y_local - sim_y_local); + } + + ++primarySimHits; + } + + otherSimHits = totalSimHits - primarySimHits; + + histogramLayer->second.totalSimHits->Fill(totalSimHits); + histogramLayer->second.primarySimHits->Fill(primarySimHits); + histogramLayer->second.otherSimHits->Fill(otherSimHits); + + } + } + }// loop simhits + + nVHsTot++; + //tree->Fill(); + + //****************************** + //combinatorial studies : not filling if more than 1 VH has been produced + //****************************** + multiplicity = DSViter->size(); + if(DSViter->size()>1){ + LogTrace("VectorHitsBuilderValidation") << " not filling if more than 1 VH has been produced"; + width = -100; + deltaXlocal = -100; + tree->Fill(); + continue; + } + + //curvature + curvature = vh.curvatureORphi("curvature").first; + phi = vh.curvatureORphi("phi").first; + QOverPT = vh.transverseMomentum(magField); + QOverP = vh.momentum(magField); + histogramLayer->second.curvature->Fill(curvature); + + //stub width + + auto && lparamsUpp = cpe->localParameters( *vhIt->upperClusterRef().cluster_phase2OT(), *geomDetUnit_upp ); + LogTrace("VectorHitsBuilderValidation") << " upper local pos (in its sor):" << lparamsUpp.first; + Global3DPoint gparamsUpp = geomDetUnit_upp->surface().toGlobal(lparamsUpp.first); + LogTrace("VectorHitsBuilderValidation") << " upper global pos :" << gparamsUpp; + Local3DPoint lparamsUppInLow = geomDetUnit_low->surface().toLocal(gparamsUpp); + LogTrace("VectorHitsBuilderValidation") << " upper local pos (in low sor):" << lparamsUppInLow; + auto && lparamsLow = cpe->localParameters( *vhIt->lowerClusterRef().cluster_phase2OT(), *geomDetUnit_low ); + LogTrace("VectorHitsBuilderValidation") << " lower local pos (in its sor):" << lparamsLow.first; + Global3DPoint gparamsLow = geomDetUnit_low->surface().toGlobal(lparamsLow.first); + LogTrace("VectorHitsBuilderValidation") << " lower global pos :" << gparamsLow; + + //width = difference of centroids in precise coordinate (in low sor) corrected with parallax correction + deltaXlocal = lparamsUppInLow.x() - lparamsLow.first.x(); + histogramLayer->second.deltaXlocal->Fill(deltaXlocal); + LogTrace("VectorHitsBuilderValidation") << " deltaXlocal : " << deltaXlocal; + + double parallCorr = 0.0; + + Global3DPoint origin(0,0,0); + GlobalVector gV = gparamsLow - origin; + //LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV; + LocalVector lV = geomDetUnit_low->surface().toLocal(gV); + //LogTrace("VectorHitsBuilderValidation") << " local vector passing to the origin (in low sor):" << lV; + LocalVector lV_norm = lV/lV.z(); + //LogTrace("VectorHitsBuilderValidation") << " normalized local vector passing to the origin (in low sor):" << lV_norm; + parallCorr = lV_norm.x() * lparamsUppInLow.z(); + LogTrace("VectorHitsBuilderValidation") << " parallalex correction:" << parallCorr; + + double lpos_upp_corr = 0.0; + double lpos_low_corr = 0.0; + if(lparamsUpp.first.x() > lparamsLow.first.x()){ + if(lparamsUpp.first.x() > 0){ + lpos_low_corr = lparamsLow.first.x(); + lpos_upp_corr = lparamsUpp.first.x() - fabs(parallCorr); + } + if(lparamsUpp.first.x() < 0){ + lpos_low_corr = lparamsLow.first.x() + fabs(parallCorr); + lpos_upp_corr = lparamsUpp.first.x(); + } + } else if( lparamsUpp.first.x() < lparamsLow.first.x() ) { + if(lparamsUpp.first.x() > 0){ + lpos_low_corr = lparamsLow.first.x() - fabs(parallCorr); + lpos_upp_corr = lparamsUpp.first.x(); + } + if(lparamsUpp.first.x() < 0){ + lpos_low_corr = lparamsLow.first.x(); + lpos_upp_corr = lparamsUpp.first.x() + fabs(parallCorr); + } + } else { + if(lparamsUpp.first.x() > 0){ + lpos_upp_corr = lparamsUpp.first.x() - fabs(parallCorr); + lpos_low_corr = lparamsLow.first.x(); + } + if(lparamsUpp.first.x() < 0){ + lpos_upp_corr = lparamsUpp.first.x() + fabs(parallCorr); + lpos_low_corr = lparamsLow.first.x(); + } + } + + LogDebug("VectorHitsBuilderValidation") << " \t local pos upper corrected (x):" << lpos_upp_corr << std::endl; + LogDebug("VectorHitsBuilderValidation") << " \t local pos lower corrected (x):" << lpos_low_corr << std::endl; + + width = lpos_low_corr - lpos_upp_corr; + histogramLayer->second.width->Fill(width); + LogTrace("VectorHitsBuilderValidation") << " width:" << width; + + tree->Fill(); + + + }// vh valid + + }// loop vhs + + if (nVHsPS) histogramLayer->second.numberVHsPS->Fill(nVHsPS); + if (nVHs2S) histogramLayer->second.numberVHs2S->Fill(nVHs2S); + LogTrace("VectorHitsBuilderValidation") << "nVHsPS for this layer : " << nVHsPS << ", nVHs2S for this layer : " << nVHs2S << std::endl; + } + + CreateVHsXYGraph(glVHs, dirVHs); + CreateVHsRZGraph(glVHs, dirVHs); + + int VHaccTrue = 0.0; + int VHaccFalse = 0.0; + int VHrejTrue = 0.0; + int VHrejFalse = 0.0; + int VHaccTrue_signal = 0.0; + int VHrejTrue_signal = 0.0; + + // Loop over modules + for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { + + unsigned int rawid(DSViter->detId()); + DetId detId(rawid); + int layerAcc = getLayerNumber(detId); + LogTrace("VectorHitsBuilderValidation") << "acc Layer: " << layerAcc << " det id" << rawid << std::endl; + for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + if( vhIt->isValid() ){ + VHaccLayer_->Fill(layerAcc); + VHacc++; + + //compute if the vhits is 'true' or 'false' + std::pair<bool,uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + if(istrue.first){ + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; + VHaccTrueLayer_->Fill(layerAcc); + //VHaccTrueLayer_ratio->Fill(layerAcc); + VHaccTrue++; + + //saving info of 'signal' track + std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(istrue.second)); + if (simTrackIt == simTracks.end()) continue; + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is associated with SimTrackId: " << istrue.second; + LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); + if (simTrackIt->second.momentum().pt() > 1 ) { + VHaccTrue_signal_Layer_->Fill(layerAcc); + LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; + VHaccTrue_signal++; + } + + } else { + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'false' vhit."; + VHaccFalse++; + } + + } + } + + } + + + //it is not really working.. + //VHaccTrueLayer_ratio->Divide(VHaccLayer_); + + for (VectorHitCollectionNew::const_iterator DSViter = vhsRej->begin(); DSViter != vhsRej->end(); ++DSViter) { + + unsigned int rawid(DSViter->detId()); + DetId detId(rawid); + int layerRej = getLayerNumber(detId); + LogTrace("VectorHitsBuilderValidation") << "rej Layer: " << layerRej << " det id" << rawid << std::endl; + for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + VHrejLayer_->Fill(layerRej); + VHrej++; + + //compute if the vhits is 'true' or 'false' + std::pair<bool,uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + if(istrue.first){ + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; + VHrejTrueLayer_->Fill(layerRej); + //VHrejTrueLayer_ratio->Fill(layerRej); + VHrejTrue++; + + //saving info of 'signal' track + std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(istrue.second)); + if (simTrackIt == simTracks.end()) continue; + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is associated with SimTrackId: " << istrue.second; + LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); + if (simTrackIt->second.momentum().pt() > 1 ) { + VHrejTrue_signal_Layer_->Fill(layerRej); + LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; + VHrejTrue_signal++; + } + + } else { + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'false' vhit."; + VHrejFalse++; + } + + } + + } + + //it is not really working.. + //VHrejTrueLayer_ratio->Divide(VHrejLayer_); + + int VHtot = VHacc + VHrej; + LogTrace("VectorHitsBuilderValidation") << "VH total: " << VHtot << " with " << VHacc << " VHs accepted and " << VHrej << " VHs rejected."; + LogTrace("VectorHitsBuilderValidation") << "of the VH accepted, there are " << VHaccTrue << " true and " << VHaccFalse << " false."; + LogTrace("VectorHitsBuilderValidation") << "of the VH rejected, there are " << VHrejTrue << " true and " << VHrejFalse << " false."; + LogTrace("VectorHitsBuilderValidation") << "of the true VH , there are " << VHaccTrue_signal << " accepted belonging to signal and " << VHrejTrue_signal << " rejected belonging to signal."; + +// CreateWindowCorrGraph(); + +} + +// Check if the vector hit is true (both clusters are formed from the same SimTrack +std::pair<bool,uint32_t> VectorHitsBuilderValidation::isTrue(const VectorHit vh, const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& siphase2SimLinks, DetId& detId) const{ + + const GeomDet* geomDet(tkGeom->idToDet(detId)); + const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); + const GeomDetUnit* geomDetLower = stackDet->lowerDet(); + const GeomDetUnit* geomDetUpper = stackDet->upperDet(); + + std::vector< unsigned int > lowClusterSimTrackIds; + //std::set<std::pair<uint32_t, EncodedEventId> > simTkIds; + + for (unsigned int istr(0); istr < (*(vh.lowerClusterRef().cluster_phase2OT())).size(); ++istr) { + uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, (*(vh.lowerClusterRef().cluster_phase2OT())).column()); + DetId detIdCluster = geomDetLower->geographicalId(); + unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detIdCluster, channel)); + LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << simTrackId << std::endl; + std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, detIdCluster, channel)); + if (trkid.size()==0) continue; + lowClusterSimTrackIds.push_back(simTrackId); + //simTkIds.insert(trkid.begin(),trkid.end()); + } + + std::vector< unsigned int >::iterator it_simTrackUpper; + + for (unsigned int istr(0); istr < (*(vh.upperClusterRef().cluster_phase2OT())).size(); ++istr) { + uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.upperClusterRef().cluster_phase2OT())).firstRow() + istr, (*(vh.upperClusterRef().cluster_phase2OT())).column()); + DetId detIdCluster = geomDetUpper->geographicalId(); + unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detIdCluster, channel)); + LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << simTrackId << std::endl; + std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, detIdCluster, channel)); + if (trkid.size()==0) continue; + it_simTrackUpper = std::find(lowClusterSimTrackIds.begin(), lowClusterSimTrackIds.end(), simTrackId); + if ( it_simTrackUpper != lowClusterSimTrackIds.end() ) { + LogTrace("VectorHitsBuilderValidation") << " UpperSimTrackId found in lowClusterSimTrackIds "; + return std::make_pair(true,simTrackId); + } + //clusterSimTrackIds.push_back(UpperSimTrackId); + //simTkIds.insert(trkid.begin(),trkid.end()); + } + return std::make_pair(false,0); +} + +// Create the histograms +std::map< unsigned int, VHHistos >::iterator VectorHitsBuilderValidation::createLayerHistograms(unsigned int ival) { + std::ostringstream fname1, fname2; + + edm::Service<TFileService> fs; + fs->file().cd("/"); + + std::string tag; + unsigned int id; + if (ival < 100) { + id = ival; + fname1 << "Barrel"; + fname2 << "Layer_" << id; + tag = "_layer_"; + } + else { + int side = ival / 100; + id = ival - side * 100; + fname1 << "EndCap_Side_" << side; + fname2 << "Disc_" << id; + tag = "_disc_"; + } + + TFileDirectory td1 = fs->mkdir(fname1.str().c_str()); + TFileDirectory td = td1.mkdir(fname2.str().c_str()); + + VHHistos local_histos; + + std::ostringstream histoName; + + /* + * Number of clusters + */ + + histoName.str(""); histoName << "Number_VHs_PS" << tag.c_str() << id; + local_histos.numberVHsPS = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberVHsPS->SetFillColor(kAzure + 7); + + histoName.str(""); histoName << "Number_VHs_2S" << tag.c_str() << id; + local_histos.numberVHs2S = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberVHs2S->SetFillColor(kOrange - 3); + + histoName.str(""); histoName << "Number_VHs_Mixed" << tag.c_str() << id; + local_histos.numberVHsMixed = td.make< THStack >(histoName.str().c_str(), histoName.str().c_str()); + local_histos.numberVHsMixed->Add(local_histos.numberVHsPS); + local_histos.numberVHsMixed->Add(local_histos.numberVHs2S); + + /* + * Local and Global positions + */ + + histoName.str(""); histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; + local_histos.localPosXY[0] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Local_Position_XY_PS" << tag.c_str() << id; + local_histos.localPosXY[1] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Local_Position_XY_2S" << tag.c_str() << id; + local_histos.localPosXY[2] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[2]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; + local_histos.globalPosXY[0] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Global_Position_XY_PS" << tag.c_str() << id; + local_histos.globalPosXY[1] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); histoName << "Global_Position_XY_2S" << tag.c_str() << id; + local_histos.globalPosXY[2] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); + + /* + * Delta positions with SimHits + */ + + histoName.str(""); histoName << "Delta_X_VH_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaXVHSimHits[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_X_VH_SimHits_PS" << tag.c_str() << id; + local_histos.deltaXVHSimHits[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_X_VH_SimHits_2S" << tag.c_str() << id; + local_histos.deltaXVHSimHits[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_VH_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaYVHSimHits[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_VH_SimHits_PS" << tag.c_str() << id; + local_histos.deltaYVHSimHits[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_VH_SimHits_2S" << tag.c_str() << id; + local_histos.deltaYVHSimHits[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + /* + * Delta position with simHits for primary tracks only + */ + + histoName.str(""); histoName << "Delta_X_VH_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_X_VH_SimHits_PS_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_X_VH_SimHits_2S_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_VH_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_VH_SimHits_PS_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); histoName << "Delta_Y_VH_SimHits_2S_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + /* + * Information on the Digis per cluster + */ + + histoName.str(""); histoName << "Total_Digis" << tag.c_str() << id; + local_histos.totalSimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + + histoName.str(""); histoName << "Primary_Digis" << tag.c_str() << id; + local_histos.primarySimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + + histoName.str(""); histoName << "Other_Digis" << tag.c_str() << id; + local_histos.otherSimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + + /* + * Study on the clusters combinatorial problem + */ + + histoName.str(""); histoName << "DeltaXlocal_clusters" << tag.c_str() << id; + local_histos.deltaXlocal= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + histoName.str(""); histoName << "Width" << tag.c_str() << id; + local_histos.width= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + histoName.str(""); histoName << "Curvature" << tag.c_str() << id; + local_histos.curvature= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + + std::pair< std::map< unsigned int, VHHistos >::iterator, bool > insertedIt(histograms_.insert(std::make_pair(ival, local_histos))); + fs->file().cd("/"); + + return insertedIt.first; +} + +void VectorHitsBuilderValidation::CreateVHsXYGraph(const std::vector<Global3DPoint> glVHs,const std::vector<Global3DVector> dirVHs){ + + if(glVHs.size() != dirVHs.size()){ + std::cout << "Cannot fullfil the graphs for this event. Return." << std::endl; + return; + } + + // opening canvas and drawing XY TGraph + + //TCanvas * VHXY_ = new TCanvas("RVsY_Mixed","RVsY_Mixed",800,600); + //VHXY_->cd(); + //trackerLayoutXY_[0]->Draw("AP"); + +// float finalposX, finalposY; + + for(unsigned int nVH = 0; nVH < glVHs.size(); nVH++){ + +// finalposX = glVHs.at(nVH).x() + dirVHs.at(nVH).x(); +// finalposY = glVHs.at(nVH).y() + dirVHs.at(nVH).y(); + //std::cout << glVHs.at(nVH) << " " << " \tr: " << glVHs.at(nVH).perp() << std::endl; + //std::cout << dirVHs.at(nVH).x() << "," << dirVHs.at(nVH).y() << std::endl; + + //same r + if((fabs(dirVHs.at(nVH).x()) < 10e-5) && (fabs(dirVHs.at(nVH).y()) < 10e-5)){ + + //std::cout << "same pos!"; + continue; + + } else { + + // TArrow* vh_arrow = new TArrow(glVHs.at(nVH).x(), glVHs.at(nVH).y(), finalposX, finalposY, 0.05, ">"); + // vh_arrow->Draw("same"); + + } + + + } + + return; +} + +void VectorHitsBuilderValidation::CreateVHsRZGraph(const std::vector<Global3DPoint> glVHs,const std::vector<Global3DVector> dirVHs){ + + if(glVHs.size() != dirVHs.size()){ + std::cout << "Cannot fullfil the graphs for this event. Return." << std::endl; + return; + } + + // opening canvas and drawing RZ TGraph + // + //TCanvas* VHRZ_ = new TCanvas("RVsZ_Mixed","RVsZ_Mixed",800,600); + //VHRZ_->cd(); + //trackerLayoutRZ_[0]->Draw("AP"); + +// float finalposX, finalposY, finalposR, finalposZ; + +// for(unsigned int nVH = 0; nVH < glVHs.size(); nVH++){ + +// finalposX = glVHs.at(nVH).x() + dirVHs.at(nVH).x(); +// finalposY = glVHs.at(nVH).y() + dirVHs.at(nVH).y(); +// finalposR = sqrt( pow(finalposX,2) + pow(finalposY,2) ); +// finalposZ = glVHs.at(nVH).z() + dirVHs.at(nVH).z(); + + //std::cout << dirVHs.at(nVH) " " << " \tr: " << dirVHs.at(nVH).perp() << std::endl; + //std::cout << finalposX << ", " << finalposY << " " << " \tr: " << finalposR << std::endl; + //std::cout << std::endl; + +// TArrow* vh_arrow = new TArrow(glVHs.at(nVH).z(), glVHs.at(nVH).perp(), finalposZ, finalposR, 0.05, "|>"); +// vh_arrow->SetLineWidth(2); +// vh_arrow->Draw("same"); + +// } + + return; +} + +void VectorHitsBuilderValidation::CreateWindowCorrGraph(){ + + //FIXME: This function is not working properly, yet. + + //return if we are not using Phase2 OT + if(!tkGeom->isThere(GeomDetEnumerators::P2OTB) && !tkGeom->isThere(GeomDetEnumerators::P2OTEC)) + return; + + for(auto det : tkGeom->detsTOB()){ +// std::cout << det->geographicalId().rawId() << std::endl; +// std::cout << det->surface().bounds().thickness() << std::endl; + ParallaxCorrectionRZ_->Fill(det->position().z(),det->position().perp(),5.); + } + for(auto det : tkGeom->detsTID()){ + //std::cout << det->geographicalId().rawId() << std::endl; + ParallaxCorrectionRZ_->Fill(det->position().z(),det->position().perp(),10.); + } + ParallaxCorrectionRZ_->Fill(0.,0.,5.); + return; +} + +unsigned int VectorHitsBuilderValidation::getLayerNumber(const DetId& detid) { + if (detid.det() == DetId::Tracker) { + if (detid.subdetId() == StripSubdetector::TOB) return (tkTopo->layer(detid)); + else if (detid.subdetId() == StripSubdetector::TID) return (100 * tkTopo->side(detid) + tkTopo->layer(detid)); + else return 999; + } + return 999; +} + +unsigned int VectorHitsBuilderValidation::getModuleNumber(const DetId& detid) { + return (tkTopo->module(detid)); +} + +std::vector< std::pair<uint32_t, EncodedEventId> > +VectorHitsBuilderValidation::getSimTrackIds(const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& simLinks, + const DetId& detId, uint32_t channel) const +{ + std::vector< std::pair<uint32_t, EncodedEventId> > simTrkId; + auto isearch = simLinks->find(detId); + if (isearch != simLinks->end()) { + // Loop over DigiSimLink in this det unit + edm::DetSet<PixelDigiSimLink> link_detset = (*isearch); + for (typename edm::DetSet<PixelDigiSimLink>::const_iterator it = link_detset.data.begin(); + it != link_detset.data.end(); ++it) { + if (channel == it->channel()) simTrkId.push_back(std::make_pair(it->SimTrackId(), it->eventId())); + } + } + return simTrkId; +} + +unsigned int VectorHitsBuilderValidation::getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& pixelSimLinks, const DetId& detId, unsigned int channel) const { + edm::DetSetVector< PixelDigiSimLink >::const_iterator DSViter(pixelSimLinks->find(detId)); + if (DSViter == pixelSimLinks->end()) return 0; + for (edm::DetSet< PixelDigiSimLink >::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { + if (channel == it->channel()) return it->SimTrackId(); + } + return 0; +} + +void VectorHitsBuilderValidation::printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster){ + + if (!geomDetUnit) return; + + const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit); + const PixelTopology& topol = theGeomDet->specificTopology(); + + unsigned int layer = getLayerNumber(geomDetUnit->geographicalId()); + unsigned int module = getModuleNumber(geomDetUnit->geographicalId()); + LogTrace("VectorHitsBuilderValidation") << "Layer:" << layer << std::endl; + if(topol.ncolumns() == 32) + LogTrace("VectorHitsBuilderValidation") << "Pixel cluster with detId:" << geomDetUnit->geographicalId().rawId() << "(module:" << module << ") " << std::endl; + else if(topol.ncolumns() == 2 ) + LogTrace("VectorHitsBuilderValidation") << "Strip cluster with detId:" << geomDetUnit->geographicalId().rawId() << "(module:" << module << ") " << std::endl; + else std::cout << "no module?!" << std::endl; + LogTrace("VectorHitsBuilderValidation") << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl; + LogTrace("VectorHitsBuilderValidation") << " and width:" << theGeomDet->surface().bounds().width() << " , lenght:" << theGeomDet->surface().bounds().length() << std::endl; + + auto && lparams = cpe->localParameters( *cluster.cluster_phase2OT(), *theGeomDet ); + //Global3DPoint gparams = theGeomDet->surface().toGlobal(lparams.first); + + LogTrace("VectorHitsBuilderValidation") << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl; + + return; +} + +DEFINE_FWK_MODULE(VectorHitsBuilderValidation); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h new file mode 100644 index 0000000000000..ba47ba6b3eb74 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -0,0 +1,144 @@ +#include <map> +#include <vector> +#include <algorithm> + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" + +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" +#include "DataFormats/SiPixelDigi/interface/PixelDigi.h" +#include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" + +#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" +#include "SimDataFormats/Track/interface/SimTrackContainer.h" +#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" + +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "CommonTools/Utils/interface/TFileDirectory.h" + +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "DataFormats/TrackerRecHit2D/interface/OmniClusterRef.h" + +#include <TH1F.h> +#include <TH2D.h> +#include <TGraph.h> +#include <THStack.h> +#include <TCanvas.h> +#include <TTree.h> +#include <TArrow.h> + +struct VHHistos { + THStack* numberVHsMixed; + TH1F* numberVHsPS; + TH1F* numberVHs2S; + + TGraph* globalPosXY[3]; + TGraph* localPosXY[3]; + + TH1F* deltaXVHSimHits[3]; + TH1F* deltaYVHSimHits[3]; + + TH1F* deltaXVHSimHits_P[3]; + TH1F* deltaYVHSimHits_P[3]; + + TH1F* digiEfficiency[3]; + + TH1F* totalSimHits; + TH1F* primarySimHits; + TH1F* otherSimHits; + + TH1F* curvature; + TH1F* width; + TH1F* deltaXlocal; +}; + +class VectorHitsBuilderValidation : public edm::EDAnalyzer { + + public: + typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D > Phase2TrackerCluster1DRef; + + typedef std::map< unsigned int, std::vector< PSimHit > > SimHitsMap; + typedef std::map< unsigned int, SimTrack > SimTracksMap; + + explicit VectorHitsBuilderValidation(const edm::ParameterSet&); + ~VectorHitsBuilderValidation(); + void beginJob(); + void endJob(); + void analyze(const edm::Event&, const edm::EventSetup&); + + private: + + std::map< unsigned int, VHHistos >::iterator createLayerHistograms(unsigned int); + void CreateVHsXYGraph( const std::vector<Global3DPoint>,const std::vector<Global3DVector> ); + void CreateVHsRZGraph( const std::vector<Global3DPoint>,const std::vector<Global3DVector> ); + void CreateWindowCorrGraph(); + + unsigned int getLayerNumber(const DetId&); + unsigned int getModuleNumber(const DetId& detid); + void printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster); + + std::pair<bool,uint32_t> isTrue(const VectorHit vh, const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& siphase2SimLinks, DetId& detId) const; + std::vector< std::pair<uint32_t, EncodedEventId> > getSimTrackIds(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >&, const DetId&, uint32_t) const; + unsigned int getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& pixelSimLinks, const DetId& detId, unsigned int channel) const; + + edm::EDGetTokenT< edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; + edm::EDGetTokenT< VectorHitCollectionNew > VHacc_; + edm::EDGetTokenT< VectorHitCollectionNew > VHrej_; + edm::ESInputTag cpeTag_; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe; + + edm::EDGetTokenT< edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; + edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken_; + edm::EDGetTokenT< edm::SimTrackContainer> simTracksToken_; + edm::EDGetTokenT< edm::SimVertexContainer > simVerticesToken_; + edm::EDGetTokenT<TrackingParticleCollection> trackingParticleToken_; + //SiPixelVectorHitBuilderAlgorithmBase *algo; + + const TrackerGeometry* tkGeom; + const TrackerTopology* tkTopo; + const MagneticField* magField; + + TTree* tree; + TGraph* trackerLayoutRZ_[3]; + TGraph* trackerLayoutXY_[3]; + TGraph* trackerLayoutXYBar_; + TGraph* trackerLayoutXYEC_; + TGraph* localPosXvsDeltaX_[3]; + TGraph* localPosYvsDeltaY_[3]; + TCanvas* VHXY_; + TCanvas* VHRZ_; + std::vector<TArrow*> arrowVHs; + + TH2D* ParallaxCorrectionRZ_; + TH1F* VHaccLayer_; + TH1F* VHrejLayer_; + TH1F* VHaccTrueLayer_; + TH1F* VHrejTrueLayer_; + TH1F* VHaccTrue_signal_Layer_; + TH1F* VHrejTrue_signal_Layer_; + TH1F* VHaccTrueLayer_ratio; + TH1F* VHrejTrueLayer_ratio; + + std::map< unsigned int, VHHistos > histograms_; + +}; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/step3_SeedingOT_tilted.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/step3_SeedingOT_tilted.py new file mode 100644 index 0000000000000..d91869a0a3f97 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/step3_SeedingOT_tilted.py @@ -0,0 +1,117 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.StandardSequences.Eras import eras + +process = cms.Process('RECO',eras.Phase2C2) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryExtended2023D4Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.L1Reco_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +#adding only recolocalreco +process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') + +# import VectorHitBuilder +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') + + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('file:21207_10events/step2.root'), + #fileNames = cms.untracked.vstring('/store/relval/CMSSW_8_1_0_pre7/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/81X_mcRun2_asymptotic_v0_2023tilted-v1/10000/2E7CB262-1534-E611-BB7A-0CC47A78A496.root'), + secondaryFileNames = cms.untracked.vstring(), + skipEvents = cms.untracked.uint32(0) +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('step3 nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM-RECO'), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('file:step3_1event.root'), + outputCommands = cms.untracked.vstring( ('keep *') ), + splitLevel = cms.untracked.int32(0) +) + +# Analyzer +process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', + src = cms.string("siPhase2Clusters"), + src2 = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), + links = cms.InputTag("simSiPixelDigis", "Tracker") +) +process.TFileService = cms.Service('TFileService', + fileName = cms.string('file:vh_validation_tilted.root') +) + +from RecoTracker.TkSeedGenerator.SeedingOTEDProducer_cfi import SeedingOTEDProducer as _SeedingOTEDProducer +process.phase2SeedingOTEDProducer = _SeedingOTEDProducer.clone() +process.initialStepSeeds = _SeedingOTEDProducer.clone() + +process.load('RecoLocalTracker.Phase2TrackerRecHits.Phase2StripCPEGeometricESProducer_cfi') + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') + + +# debug +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring("debugVH_tilted"), + debugModules = cms.untracked.vstring("*"), + categories = cms.untracked.vstring("VectorHitBuilderEDProducer","VectorHitBuilderAlgorithm","VectorHitsBuilderValidation","CkfPattern"), + debugVH_tilted = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), + DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), + default = cms.untracked.PSet(limit = cms.untracked.int32(0)), + VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), + VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), + CkfPattern = cms.untracked.PSet(limit = cms.untracked.int32(-1)), + VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) + ) + ) + + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.L1Reco_step = cms.Path(process.L1Reco) +process.trackerlocalreco_step = cms.Path(process.trackerlocalreco+process.siPixelClusters+process.siPhase2VectorHits) +process.seedingOT_step = cms.Path(process.MeasurementTrackerEvent+process.offlineBeamSpot+process.phase2SeedingOTEDProducer) +process.analysis_step = cms.Path(process.analysis) +process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.seedingOT_step,process.RECOSIMoutput_step, process.analysis_step) +#process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.RECOSIMoutput_step) +#process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.reconstruction_step,process.prevalidation_step,process.validation_step,process.dqmoffline_step,process.FEVTDEBUGHLToutput_step,process.DQMoutput_step) + +# customisation of the process. + + +# End of customisation functions + diff --git a/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc b/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc index e8b4fe68ca477..2a890e3d24a0c 100644 --- a/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc +++ b/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc @@ -11,6 +11,7 @@ #include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/Common/interface/DetSetVector.h" @@ -123,12 +124,39 @@ void SeedClusterRemoverPhase2::process(const TrackingRecHit *hit, float chi2, co OTs[cluster.key()] = false; assert(collectedOuterTrackers_.size() > cluster.key()); - collectedOuterTrackers_[cluster.key()] = true; + collectedOuterTrackers_[cluster.key()]=true; - } else - throw cms::Exception("NOT IMPLEMENTED") - << "I received a hit that was neither SiPixelRecHit nor Phase2TrackerRecHit1D but " << hitType.name() - << " on detid " << detid.rawId() << "\n"; + } else if (hitType == typeid(VectorHit)) { + + if(!doOuterTracker_) return; + + const VectorHit *vhit = static_cast<const VectorHit*>(hit); + LogDebug("SeedClusterRemoverPhase2") << "Plain VectorHit in det " << detid.rawId(); + + //lower cluster + Phase2TrackerRecHit1D::CluRef cluster = vhit->lowerCluster(); + if (cluster.id() != outerTrackerSourceProdID) throw cms::Exception("Inconsistent Data") << + "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() << + " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n."; + + assert(cluster.id() == outerTrackerSourceProdID); + + OTs[cluster.key()] = false; + assert(collectedOuterTrackers_.size() > cluster.key()); + collectedOuterTrackers_[cluster.key()]=true; + + // upper cluster + cluster = vhit->upperCluster(); + if (cluster.id() != outerTrackerSourceProdID) throw cms::Exception("Inconsistent Data") << + "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() << + " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n."; + + assert(cluster.id() == outerTrackerSourceProdID); + + OTs[cluster.key()] = false; + assert(collectedOuterTrackers_.size() > cluster.key()); + collectedOuterTrackers_[cluster.key()]=true; + } else throw cms::Exception("NOT IMPLEMENTED") << "I received a hit that was neither SiPixelRecHit nor Phase2TrackerRecHit1D but " << hitType.name() << " on detid " << detid.rawId() << "\n"; } void SeedClusterRemoverPhase2::produce(Event &iEvent, const EventSetup &iSetup) { diff --git a/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc b/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc index a7afaf340eba6..14753707e6e6d 100644 --- a/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc +++ b/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc @@ -18,6 +18,7 @@ #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackerRecHit2D/interface/ClusterRemovalInfo.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "TrackingTools/PatternTools/interface/TrackCollectionTokens.h" @@ -190,6 +191,19 @@ namespace { collectedPixels[cluster.key()] = true; else if (cluster.isPhase2()) collectedPhase2OTs[cluster.key()] = true; + + // Phase 2 OT is defined as Pixel detector (for now) + const auto &hitType = typeid(hit); + if (hitType == typeid(VectorHit)) { + auto const & vectorHit = reinterpret_cast<VectorHit const&>(hit); + auto const & lowCluster = vectorHit.lowerClusterRef(); + auto const & uppCluster = vectorHit.upperClusterRef(); + LogTrace("TrackClusterRemoverPhase2")<<"masking a VHit with lowCluster key: " << lowCluster.key() << " and upper key: " << uppCluster.key(); + if (lowCluster.isPhase2()) collectedPhase2OTs[lowCluster.key()]=true; + if (uppCluster.isPhase2()) collectedPhase2OTs[uppCluster.key()]=true; + } else { + LogTrace("TrackClusterRemoverPhase2")<<"it is not a VHits."; + } } } diff --git a/RecoTracker/CkfPattern/src/PrintoutHelper.cc b/RecoTracker/CkfPattern/src/PrintoutHelper.cc index 807f90e009355..024c28c661d9c 100644 --- a/RecoTracker/CkfPattern/src/PrintoutHelper.cc +++ b/RecoTracker/CkfPattern/src/PrintoutHelper.cc @@ -101,6 +101,14 @@ std::string PrintoutHelper::regressionTest(const TrackerGeometry& tracker, std:: } else buffer << "candidate with invalid last measurement state!" << std::endl; } - buffer << "================================================="; + buffer<<"================================================="; + buffer<<"=========== Traj in details =====================\n"; + for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); + it != unsmoothedResult.end(); it++) { + for(auto hit : it->measurements()){ + buffer<< "measurement : " << hit.recHit()->geographicalId().rawId() << std::endl; + } + buffer<<"================\n"; + } return buffer.str(); } diff --git a/RecoTracker/FinalTrackSelectors/plugins/DuplicateTrackMerger.cc b/RecoTracker/FinalTrackSelectors/plugins/DuplicateTrackMerger.cc index 0bd101844174c..3a20b4671a9ad 100644 --- a/RecoTracker/FinalTrackSelectors/plugins/DuplicateTrackMerger.cc +++ b/RecoTracker/FinalTrackSelectors/plugins/DuplicateTrackMerger.cc @@ -488,6 +488,16 @@ namespace { gbrVals_[7] = tmva_outer_nMissingInner_; gbrVals_[8] = tmva_inner_nMissingOuter_; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_ddsz_ : gbrVals_[0] " << gbrVals_[0]; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_ddxy_ : gbrVals_[1] " << gbrVals_[1]; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_dphi_ : gbrVals_[2] " << gbrVals_[2]; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_dlambda_ : gbrVals_[3] " << gbrVals_[3]; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_dqoverp_ : gbrVals_[4] " << gbrVals_[4]; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_d3dr_ : gbrVals_[5] " << gbrVals_[5]; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_d3dz_ : gbrVals_[6] " << gbrVals_[6]; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_outer_nMissingInner_ : gbrVals_[7] " << gbrVals_[7]; + IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_inner_nMissingOuter_ : gbrVals_[8] " << gbrVals_[8]; + auto mvaBDTG = forest_->GetClassifier(gbrVals_); IfLogTrace(debug_, "DuplicateTrackMerger") << " mvaBDTG " << mvaBDTG; if (mvaBDTG < minBDTG_) diff --git a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc index ee6462380a982..d014f2be7d47e 100644 --- a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc +++ b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc @@ -28,11 +28,14 @@ class TrackerRecoGeometryESProducer : public edm::ESProducer { private: edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopToken_; + bool _usePhase2Stacks; }; using namespace edm; -TrackerRecoGeometryESProducer::TrackerRecoGeometryESProducer(const edm::ParameterSet &p) { +TrackerRecoGeometryESProducer::TrackerRecoGeometryESProducer(const edm::ParameterSet &p) + : _usePhase2Stacks(p.getParameter<bool>("usePhase2Stacks")) +{ auto c = setWhatProduced(this); // 08-Oct-2007 - Patrick Janot @@ -44,18 +47,18 @@ TrackerRecoGeometryESProducer::TrackerRecoGeometryESProducer(const edm::Paramete tTopToken_ = c.consumes(); geomToken_ = c.consumes(edm::ESInputTag("", p.getUntrackedParameter<std::string>("trackerGeometryLabel"))); } - std::unique_ptr<GeometricSearchTracker> TrackerRecoGeometryESProducer::produce( const TrackerRecoGeometryRecord &iRecord) { TrackerGeometry const &tG = iRecord.get(geomToken_); GeometricSearchTrackerBuilder builder; - return std::unique_ptr<GeometricSearchTracker>(builder.build(tG.trackerDet(), &tG, &iRecord.get(tTopToken_))); + return std::unique_ptr<GeometricSearchTracker>(builder.build(tG.trackerDet(), &tG, &iRecord.get(tTopToken_), _usePhase2Stacks)); } void TrackerRecoGeometryESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { edm::ParameterSetDescription desc; + desc.add<bool>("usePhase2Stacks"); desc.addUntracked<std::string>("trackerGeometryLabel", ""); descriptions.addDefault(desc); } diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index fb33c1fff2fc2..22d95e29034d3 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,5 +1,9 @@ import FWCore.ParameterSet.Config as cms -TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer") +TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", + usePhase2Stacks = cms.bool(False) +) +from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) diff --git a/RecoTracker/MeasurementDet/BuildFile.xml b/RecoTracker/MeasurementDet/BuildFile.xml index 5ed4491d1708d..2790eaf681a10 100644 --- a/RecoTracker/MeasurementDet/BuildFile.xml +++ b/RecoTracker/MeasurementDet/BuildFile.xml @@ -22,3 +22,4 @@ <use name="RecoLocalTracker/Phase2TrackerRecHits"/> <use name="TrackingTools/DetLayers"/> <use name="TrackingTools/MeasurementDet"/> +<use name="RecoLocalTracker/SiPhase2VectorHitBuilder"/> diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc index 9087a115fa534..51e57e85f7075 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc @@ -10,12 +10,14 @@ #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" #include "RecoTracker/Record/interface/CkfComponentsRecord.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "RecoLocalTracker/Records/interface/TrackerCPERecord.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" @@ -54,6 +56,7 @@ class dso_hidden MeasurementTrackerESProducer : public edm::ESProducer { edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomToken_; edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> geometricSearchTrackerToken_; edm::ESGetToken<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord> phase2TrackerCPEToken_; + edm::ESGetToken<VectorHitBuilderEDProducer, TkPhase2OTCPERecord> phase2matcherToken_; MeasurementTrackerImpl::BadStripCutsDet badStripCuts_; @@ -155,9 +158,11 @@ MeasurementTrackerESProducer::MeasurementTrackerESProducer(const edm::ParameterS //FIXME:: just temporary solution for phase2! auto phase2 = p.getParameter<std::string>("Phase2StripCPE"); + auto phase2Matcher = p.getParameter<std::string>("Phase2HitMatcher"); if (not phase2.empty()) { usePhase2_ = true; phase2TrackerCPEToken_ = c.consumes(edm::ESInputTag("", phase2)); + phase2matcherToken_ = c.consumes(edm::ESInputTag("", phase2Matcher)); } } @@ -180,13 +185,16 @@ std::unique_ptr<MeasurementTracker> MeasurementTrackerESProducer::produce(const } const ClusterParameterEstimator<Phase2TrackerCluster1D> *ptr_phase2TrackerCPE = nullptr; + const VectorHitBuilderEDProducer *ptr_phase2Matcher = nullptr; if (usePhase2_) { ptr_phase2TrackerCPE = &iRecord.get(phase2TrackerCPEToken_); + ptr_phase2Matcher = &iRecord.get(phase2matcherToken_); } return std::make_unique<MeasurementTrackerImpl>(badStripCuts_, &iRecord.get(pixelCPEToken_), &iRecord.get(stripCPEToken_), &iRecord.get(hitMatcherToken_), + ptr_phase2Matcher, &iRecord.get(trackerTopologyToken_), &iRecord.get(trackerGeomToken_), &iRecord.get(geometricSearchTrackerToken_), @@ -210,6 +218,7 @@ void MeasurementTrackerESProducer::fillDescriptions(edm::ConfigurationDescriptio desc.add<std::string>("HitMatcher", "StandardMatcher"); desc.add<std::string>("Phase2StripCPE", "")->setComment("empty string used to turn off Phase 2"); + desc.add<std::string>("Phase2HitMatcher", ""); desc.add<std::string>("SiStripQualityLabel", ""); desc.add<bool>("UseStripModuleQualityDB", true); diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index d8a3b89ae5c97..efdcf7a2e0cde 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -350,6 +350,9 @@ void MeasurementTrackerEventProducer::updateStrips(const edm::Event& event, //FIXME: just a temporary solution for phase2! void MeasurementTrackerEventProducer::updatePhase2OT(const edm::Event& event, Phase2OTMeasurementDetSet& thePh2OTDets) const { + + thePh2OTDets.setEmpty(); + // Phase2OT Clusters if (isPhase2) { if (thePh2OTClusterLabel.isUninitialized()) { //clusters have not been produced diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index bd7c54e22fa4f..d606cbf28c264 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -77,6 +77,7 @@ MeasurementTrackerImpl::MeasurementTrackerImpl(const BadStripCutsDet& badStripCu const PixelClusterParameterEstimator* pixelCPE, const StripClusterParameterEstimator* stripCPE, const SiStripRecHitMatcher* hitMatcher, + const VectorHitBuilderEDProducer* ph2hitMatcher, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeom, const GeometricSearchTracker* geometricSearchTracker, @@ -91,7 +92,7 @@ MeasurementTrackerImpl::MeasurementTrackerImpl(const BadStripCutsDet& badStripCu : MeasurementTracker(trackerGeom, geometricSearchTracker), theStDetConditions(hitMatcher, stripCPE), thePxDetConditions(pixelCPE), - thePhase2DetConditions(phase2OTCPE) { + thePhase2DetConditions(ph2hitMatcher, phase2OTCPE) { this->initialize(trackerTopology); this->initializeStripStatus(badStripCuts, stripQuality, stripQualityFlags, stripQualityDebugFlags); this->initializePixelStatus(pixelQuality, pixelCabling, pixelQualityFlags, pixelQualityDebugFlags); @@ -284,7 +285,7 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) { //since the Stack will be composed by PS or 2S, //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. - theStackDets.push_back(TkStackMeasurementDet(gd, thePxDetConditions.pixelCPE())); + theStackDets.push_back(TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE() )); } void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) { diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h index 7794f31e5fe94..fd979dbf58005 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h @@ -56,6 +56,7 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker { const PixelClusterParameterEstimator* pixelCPE, const StripClusterParameterEstimator* stripCPE, const SiStripRecHitMatcher* hitMatcher, + const VectorHitBuilderEDProducer* ph2hitMatcher, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeom, const GeometricSearchTracker* geometricSearchTracker, diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index aab7c42efca4c..5fce1d99addba 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -1,17 +1,24 @@ #include "TkStackMeasurementDet.h" #include "TrackingTools/MeasurementDet/interface/MeasurementDetException.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h" using namespace std; -TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet, const PixelClusterParameterEstimator* cpe) - : MeasurementDet(gdet), thePixelCPE(cpe), theInnerDet(nullptr), theOuterDet(nullptr) {} +TkStackMeasurementDet::TkStackMeasurementDet( const StackGeomDet* gdet, + const VectorHitBuilderEDProducer* matcher, + const PixelClusterParameterEstimator* cpe) : + MeasurementDet(gdet), + theMatcher(matcher), + thePixelCPE(cpe), + theLowerDet(nullptr), theUpperDet(nullptr) +{} void TkStackMeasurementDet::init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet) { - theInnerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet); - theOuterDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(upperDet); + theLowerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet); + theUpperDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(upperDet); - if ((theInnerDet == nullptr) || (theOuterDet == nullptr)) { + if ((theLowerDet == nullptr) || (theUpperDet == nullptr)) { throw MeasurementDetException( "TkStackMeasurementDet ERROR: Trying to glue a det which is not a TkPhase2OTMeasurementDet"); } @@ -24,12 +31,91 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj HitCollectorForRecHits collector( &fastGeomDet(), theMatcher, theCPE, result ); collectRecHits(ts, collector); */ + if ( isEmpty(data.phase2OTData())== true ) return result; + LogTrace("MeasurementTracker")<<" is not empty"; + if (isActive(data) == false) return result; + LogTrace("MeasurementTracker")<<" and is active"; + + + const Phase2TrackerCluster1D* begin=0; + if (0 != data.phase2OTData().handle()->data().size()) { + begin = &(data.phase2OTData().handle()->data().front()); + } + + VectorHitBuilderAlgorithmBase * algo = theMatcher->algo() ; + //VectorHitBuilderAlgorithm* vhalgo = dynamic_cast<VectorHitBuilderAlgorithm *>(algobase); + LogTrace("MeasurementTracker") << "TkStackMeasurementDet::recHits algo has been set" << std::endl; + + const detset & lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); + const detset & upperDetSet = data.phase2OTData().detSet(upperDet()->index()); + + LogTrace("MeasurementTracker")<<" DetSets set with sizes:" << lowerDetSet.size() << " and " << upperDetSet.size() << "!"; + result.reserve(lowerDetSet.size()>upperDetSet.size() ? lowerDetSet.size() : upperDetSet.size()); + + + for ( const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++ cil ) { + + if (cil < begin){ + edm::LogError("IndexMisMatch")<<"TkStackMeasurementDet cannot create hit because of index mismatch."; + return result; + } + unsigned int indexl = cil-begin; + LogTrace("MeasurementTracker")<<" index cluster lower" << indexl << " on detId " << fastGeomDet().geographicalId().rawId(); + + for ( const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ ciu ) { + + unsigned int indexu = ciu-begin; + if (ciu < begin){ + edm::LogError("IndexMisMatch")<<"TkStackMeasurementDet cannot create hit because of index mismatch."; + return result; + } + LogTrace("VectorHitBuilderAlgorithm")<<" index cluster upper " << indexu; + + if(data.phase2OTClustersToSkip().empty() or ((not data.phase2OTClustersToSkip()[indexl]) and (not data.phase2OTClustersToSkip()[indexu])) ) { + Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo( data.phase2OTData().handle(), cil ); + Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo( data.phase2OTData().handle(), ciu ); + //ERICA:I would have prefer to keep buildVectorHits ... + VectorHit vh = algo->buildVectorHit( &specificGeomDet(), clusterLower, clusterUpper); + LogTrace("MeasurementTracker") << "TkStackMeasurementDet::rechits adding VectorHits!" << std::endl; + LogTrace("MeasurementTracker") << vh << std::endl; + result.push_back( std::make_shared<VectorHit>( vh )); + } + } + + } + return result; } -bool TkStackMeasurementDet::measurements(const TrajectoryStateOnSurface& stateOnThisDet, - const MeasurementEstimator& est, - const MeasurementTrackerEvent& data, - TempMeasurements& result) const { - return true; + + +bool TkStackMeasurementDet::measurements( const TrajectoryStateOnSurface& stateOnThisDet, + const MeasurementEstimator& est, const MeasurementTrackerEvent & data, + TempMeasurements & result) const { + LogDebug("MeasurementTracker")<<"TkStackMeasurementDet::measurements"; + + if (!isActive(data)) { + result.add(theInactiveHit, 0.F); + return true; + } + + LogTrace("MeasurementTracker")<<" is active"; + + auto oldSize = result.size(); + MeasurementDet::RecHitContainer && allHits = recHits(stateOnThisDet, data); + + for (auto && hit : allHits) { + std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, *hit); + //LogTrace("MeasurementTracker")<< "State on this Det: " << stateOnThisDet ; + LogDebug("MeasurementTracker")<< "New vh added with chi2: " << diffEst.second ; + if ( diffEst.first) + result.add(std::move(hit), diffEst.second); + } + + if (result.size()>oldSize) return true; + + // create a TrajectoryMeasurement with an invalid RecHit and zero estimate + result.add(theMissingHit, 0.F); + LogDebug("MeasurementTracker")<< "adding missing hit"; + return false; } diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index 91129ab61732c..9d6722e3e464f 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -5,6 +5,7 @@ #include "TkPhase2OTMeasurementDet.h" #include "Geometry/CommonDetUnit/interface/StackGeomDet.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "FWCore/Utilities/interface/Visibility.h" @@ -13,25 +14,31 @@ class TkStackMeasurementDet final : public MeasurementDet { public: - TkStackMeasurementDet(const StackGeomDet* gdet, const PixelClusterParameterEstimator* cpe); + TkStackMeasurementDet(const StackGeomDet* gdet, const VectorHitBuilderEDProducer* matcher, const PixelClusterParameterEstimator* cpe); void init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet); RecHitContainer recHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent& data) const override; const StackGeomDet& specificGeomDet() const { return static_cast<StackGeomDet const&>(fastGeomDet()); } + typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; + + typedef edmNew::DetSet<Phase2TrackerCluster1D> detset; + typedef detset::const_iterator const_iterator; bool measurements(const TrajectoryStateOnSurface& stateOnThisDet, const MeasurementEstimator& est, const MeasurementTrackerEvent& data, TempMeasurements& result) const override; - const TkPhase2OTMeasurementDet* lowerDet() const { return theInnerDet; } - const TkPhase2OTMeasurementDet* upperDet() const { return theOuterDet; } + const TkPhase2OTMeasurementDet* lowerDet() const { return theLowerDet; } + const TkPhase2OTMeasurementDet* upperDet() const { return theUpperDet; } + /// return TRUE if both lower and upper components are active bool isActive(const MeasurementTrackerEvent& data) const override { return lowerDet()->isActive(data) && upperDet()->isActive(data); } + bool isEmpty(const Phase2OTMeasurementDetSet & data) const {return data.empty(lowerDet()->index()) || data.empty(upperDet()->index());} /// return TRUE if at least one of the lower and upper components has badChannels bool hasBadComponents(const TrajectoryStateOnSurface& tsos, const MeasurementTrackerEvent& data) const override { @@ -39,9 +46,10 @@ class TkStackMeasurementDet final : public MeasurementDet { } private: + const VectorHitBuilderEDProducer* theMatcher; const PixelClusterParameterEstimator* thePixelCPE; - const TkPhase2OTMeasurementDet* theInnerDet; - const TkPhase2OTMeasurementDet* theOuterDet; + const TkPhase2OTMeasurementDet* theLowerDet; + const TkPhase2OTMeasurementDet* theUpperDet; }; #endif diff --git a/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py b/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py index d5b0dcefdc434..ca5973895e619 100644 --- a/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py +++ b/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py @@ -6,3 +6,4 @@ from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 trackingPhase2PU140.toModify(MeasurementTracker, Phase2StripCPE = 'Phase2StripCPE') +trackingPhase2PU140.toModify(MeasurementTracker, Phase2HitMatcher = 'SiPhase2VectorHitMatcher') diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc index f1dab6b903eff..8c6b86fa37d87 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc @@ -42,4 +42,5 @@ void PxMeasurementConditionSet::init(int size) { void Phase2OTMeasurementConditionSet::init(int size) { activeThisPeriod_.resize(size, true); id_.resize(size); + matcher()->algo()->initCpe(cpe()); } diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h index 6c5f3f89c317a..ccdf22fe6302f 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h @@ -6,6 +6,7 @@ class TkStripMeasurementDet; class TkStripMeasurementDet; class TkPixelMeasurementDet; class SiStripRecHitMatcher; +//class VectorHitBuilderEDProducer; class StripClusterParameterEstimator; class PixelClusterParameterEstimator; class Phase2StripCPE; @@ -20,6 +21,9 @@ class Phase2StripCPE; #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h" #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" + #include <unordered_map> // #define VISTAT @@ -404,7 +408,8 @@ class PxMeasurementDetSet { //FIXME:just temporary solution for phase2 OT that works! class Phase2OTMeasurementConditionSet { public: - Phase2OTMeasurementConditionSet(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe) : theCPE(cpe) {} + Phase2OTMeasurementConditionSet(const VectorHitBuilderEDProducer* ph2matcher, const ClusterParameterEstimator<Phase2TrackerCluster1D> *cpe) : + thePhase2Matcher(ph2matcher), theCPE(cpe) {} void init(int size); @@ -413,6 +418,7 @@ class Phase2OTMeasurementConditionSet { int find(unsigned int jd, int i = 0) const { return std::lower_bound(id_.begin() + i, id_.end(), jd) - id_.begin(); } const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe() const { return theCPE; } + const VectorHitBuilderEDProducer* matcher() const { return thePhase2Matcher;} bool isActiveThisPeriod(int i) const { return activeThisPeriod_[i]; } /** \brief Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). @@ -423,8 +429,9 @@ class Phase2OTMeasurementConditionSet { friend class MeasurementTrackerImpl; // Globals (not-per-event) + const VectorHitBuilderEDProducer* thePhase2Matcher; const ClusterParameterEstimator<Phase2TrackerCluster1D>* theCPE; - + // Locals, per-event std::vector<unsigned int> id_; std::vector<bool> activeThisPeriod_; diff --git a/RecoTracker/Record/interface/CkfComponentsRecord.h b/RecoTracker/Record/interface/CkfComponentsRecord.h index f6d513f77645f..6d64c5709ced9 100644 --- a/RecoTracker/Record/interface/CkfComponentsRecord.h +++ b/RecoTracker/Record/interface/CkfComponentsRecord.h @@ -39,3 +39,4 @@ class CkfComponentsRecord SiPixelLorentzAngleRcd, SiStripLorentzAngleDepRcd> > {}; #endif + diff --git a/RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h b/RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h index abe2be323bde5..834ae11b28432 100644 --- a/RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h +++ b/RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h @@ -17,8 +17,9 @@ class GeometricSearchTrackerBuilder { ~GeometricSearchTrackerBuilder() {} GeometricSearchTracker* build(const GeometricDet* theGeometricTracker, - const TrackerGeometry* theGeomDetGeometry, - const TrackerTopology* tTopo) __attribute__((cold)); + const TrackerGeometry* theGeomDetGeometry, + const TrackerTopology* tTopo, + const bool usePhase2Stacks = false) __attribute__ ((cold)); }; #endif diff --git a/RecoTracker/TkDetLayers/src/GeometricSearchTrackerBuilder.cc b/RecoTracker/TkDetLayers/src/GeometricSearchTrackerBuilder.cc index 9be742143e173..4ed5853b6b67f 100644 --- a/RecoTracker/TkDetLayers/src/GeometricSearchTrackerBuilder.cc +++ b/RecoTracker/TkDetLayers/src/GeometricSearchTrackerBuilder.cc @@ -19,9 +19,14 @@ using namespace std; -GeometricSearchTracker* GeometricSearchTrackerBuilder::build(const GeometricDet* theGeometricTracker, - const TrackerGeometry* theGeomDetGeometry, - const TrackerTopology* tTopo) { + +GeometricSearchTracker* +GeometricSearchTrackerBuilder::build(const GeometricDet* theGeometricTracker, + const TrackerGeometry* theGeomDetGeometry, + const TrackerTopology* tTopo, + const bool usePhase2Stacks) +{ + PixelBarrelLayerBuilder aPixelBarrelLayerBuilder; Phase2OTBarrelLayerBuilder aPhase2OTBarrelLayerBuilder; PixelForwardLayerBuilder<PixelBlade, PixelForwardLayer> aPixelForwardLayerBuilder; @@ -41,6 +46,7 @@ GeometricSearchTracker* GeometricSearchTrackerBuilder::build(const GeometricDet* vector<ForwardDetLayer const*> thePosTIDLayers; vector<ForwardDetLayer const*> theNegTECLayers; vector<ForwardDetLayer const*> thePosTECLayers; + bool useBrothers = !usePhase2Stacks; vector<const GeometricDet*> theGeometricDetLayers = theGeometricTracker->components(); for (vector<const GeometricDet*>::const_iterator it = theGeometricDetLayers.begin(); @@ -93,10 +99,10 @@ GeometricSearchTracker* GeometricSearchTrackerBuilder::build(const GeometricDet* if ((*it)->type() == GeometricDet::OTPhase2Barrel) { vector<const GeometricDet*> theTOBGeometricDetLayers = (*it)->components(); - for (vector<const GeometricDet*>::const_iterator it2 = theTOBGeometricDetLayers.begin(); - it2 != theTOBGeometricDetLayers.end(); - it2++) { - theTOBLayers.push_back(aPhase2OTBarrelLayerBuilder.build(*it2, theGeomDetGeometry)); + + for(vector<const GeometricDet*>::const_iterator it2=theTOBGeometricDetLayers.begin(); + it2!=theTOBGeometricDetLayers.end(); it2++){ + theTOBLayers.push_back( aPhase2OTBarrelLayerBuilder.build(*it2,theGeomDetGeometry,useBrothers) ); } } @@ -164,13 +170,14 @@ GeometricSearchTracker* GeometricSearchTrackerBuilder::build(const GeometricDet* if ((*it)->type() == GeometricDet::OTPhase2EndCap) { vector<const GeometricDet*> theTIDGeometricDetLayers = (*it)->components(); - for (vector<const GeometricDet*>::const_iterator it2 = theTIDGeometricDetLayers.begin(); - it2 != theTIDGeometricDetLayers.end(); - it2++) { - if ((*it2)->positionBounds().z() < 0) - theNegTIDLayers.push_back(aPhase2EndcapLayerBuilder.build(*it2, theGeomDetGeometry, true)); - if ((*it2)->positionBounds().z() > 0) - thePosTIDLayers.push_back(aPhase2EndcapLayerBuilder.build(*it2, theGeomDetGeometry, true)); + + bool useBrothers = !usePhase2Stacks; + for(vector<const GeometricDet*>::const_iterator it2=theTIDGeometricDetLayers.begin(); + it2!=theTIDGeometricDetLayers.end(); it2++){ + if((*it2)->positionBounds().z() < 0) + theNegTIDLayers.push_back( aPhase2EndcapLayerBuilder.build(*it2,theGeomDetGeometry,useBrothers) ); + if((*it2)->positionBounds().z() > 0) + thePosTIDLayers.push_back( aPhase2EndcapLayerBuilder.build(*it2,theGeomDetGeometry,useBrothers) ); } } diff --git a/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.cc index dd794dcab9b87..64be320013f11 100644 --- a/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.cc @@ -5,8 +5,9 @@ using namespace edm; using namespace std; Phase2EndcapLayer* Phase2EndcapLayerBuilder::build(const GeometricDet* aPhase2EndcapLayer, - const TrackerGeometry* theGeomDetGeometry, - const bool isOuterTracker) { + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) +{ LogTrace("TkDetLayers") << "Phase2EndcapLayerBuilder::build"; vector<const GeometricDet*> theGeometricRings = aPhase2EndcapLayer->components(); LogTrace("TkDetLayers") << "theGeometricRings.size(): " << theGeometricRings.size(); @@ -14,12 +15,12 @@ Phase2EndcapLayer* Phase2EndcapLayerBuilder::build(const GeometricDet* aPhase2En Phase2EndcapRingBuilder myBuilder; vector<const Phase2EndcapRing*> thePhase2EndcapRings; - for (vector<const GeometricDet*>::const_iterator it = theGeometricRings.begin(); it != theGeometricRings.end(); - it++) { - // if we are in the phaseII OT, it will use the brothers to build pt modules - // if we are in the phaseII pixel detector, it will not - thePhase2EndcapRings.push_back(myBuilder.build(*it, theGeomDetGeometry, isOuterTracker)); + for(vector<const GeometricDet*>::const_iterator it=theGeometricRings.begin(); + it!=theGeometricRings.end();it++){ + // if we are in the phaseII OT, it will use the brothers to build pt modules + // if we are in the phaseII pixel detector, it will not + thePhase2EndcapRings.push_back(myBuilder.build( *it,theGeomDetGeometry,useBrothers )); } - return new Phase2EndcapLayer(thePhase2EndcapRings, isOuterTracker); + return new Phase2EndcapLayer(thePhase2EndcapRings,useBrothers); } diff --git a/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.h b/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.h index 5a61c12b4dabe..f695b399f2125 100644 --- a/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.h +++ b/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.h @@ -15,8 +15,8 @@ class Phase2EndcapLayerBuilder { public: Phase2EndcapLayerBuilder(){}; Phase2EndcapLayer* build(const GeometricDet* aPhase2EndcapLayer, - const TrackerGeometry* theGeomDetGeometry, - const bool isOuterTracker) __attribute__((cold)); + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) __attribute__ ((cold)); }; #pragma GCC visibility pop diff --git a/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc index 2df7298f9ad94..69bfe5c15ebc9 100644 --- a/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc @@ -6,10 +6,11 @@ using namespace edm; using namespace std; Phase2EndcapRing* Phase2EndcapRingBuilder::build(const GeometricDet* aPhase2EndcapRing, - const TrackerGeometry* theGeomDetGeometry, - const bool useBrothers) { - vector<const GeometricDet*> allGeometricDets = aPhase2EndcapRing->components(); - vector<const GeometricDet*> compGeometricDets; + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) +{ + vector<const GeometricDet*> allGeometricDets = aPhase2EndcapRing->components(); + vector<const GeometricDet*> compGeometricDets; LogDebug("TkDetLayers") << "Phase2EndcapRingBuilder with #Modules: " << allGeometricDets.size() << std::endl; vector<const GeomDet*> frontGeomDets; diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.cc index b950df541c2b9..66304a77d886b 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.cc @@ -7,8 +7,10 @@ using namespace std; using namespace edm; Phase2OTBarrelLayer* Phase2OTBarrelLayerBuilder::build(const GeometricDet* aPhase2OTBarrelLayer, - const TrackerGeometry* theGeomDetGeometry) { - // This builder is very similar to TOBLayer one. Most of the code should be put in a + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) +{ + // This builder is very similar to TOBLayer one. Most of the code should be put in a // common place. LogTrace("TkDetLayers") << "Phase2OTBarrelLayerBuilder::build"; @@ -40,14 +42,18 @@ Phase2OTBarrelLayer* Phase2OTBarrelLayerBuilder::build(const GeometricDet* aPhas for (unsigned int index = 0; index != theGeometricDetRods.size(); index++) meanR += theGeometricDetRods[index]->positionBounds().perp(); if (!theGeometricDetRods.empty()) - meanR /= (double)theGeometricDetRods.size(); - for (unsigned int index = 0; index != theGeometricDetRods.size(); index++) { - if (theGeometricDetRods[index]->positionBounds().perp() < meanR) - theInnerRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], theGeomDetGeometry)); + meanR/=(double) theGeometricDetRods.size(); + + for(unsigned int index=0; index!=theGeometricDetRods.size(); index++){ + if(theGeometricDetRods[index]->positionBounds().perp() < meanR) + theInnerRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], + theGeomDetGeometry, useBrothers) ); + + if(theGeometricDetRods[index]->positionBounds().perp() > meanR) + theOuterRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], + theGeomDetGeometry, useBrothers) ); - if (theGeometricDetRods[index]->positionBounds().perp() > meanR) - theOuterRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], theGeomDetGeometry)); } if (theGeometricDetRings.empty()) @@ -63,12 +69,13 @@ Phase2OTBarrelLayer* Phase2OTBarrelLayerBuilder::build(const GeometricDet* aPhas // properly calculate the meanR value to separate rod in inner/outer. double centralZ = 0.0; - for (vector<const GeometricDet*>::const_iterator it = theGeometricDetRings.begin(); it != theGeometricDetRings.end(); - it++) { - if ((*it)->positionBounds().z() < centralZ) - theNegativeRings.push_back(myPhase2EndcapRingBuilder.build(*it, theGeomDetGeometry, true)); - if ((*it)->positionBounds().z() > centralZ) - thePositiveRings.push_back(myPhase2EndcapRingBuilder.build(*it, theGeomDetGeometry, true)); + + for(vector<const GeometricDet*>::const_iterator it=theGeometricDetRings.begin(); + it!=theGeometricDetRings.end();it++){ + if((*it)->positionBounds().z() < centralZ) + theNegativeRings.push_back(myPhase2EndcapRingBuilder.build( *it,theGeomDetGeometry,useBrothers )); + if((*it)->positionBounds().z() > centralZ) + thePositiveRings.push_back(myPhase2EndcapRingBuilder.build( *it,theGeomDetGeometry,useBrothers )); } return new Phase2OTtiltedBarrelLayer(theInnerRods, theOuterRods, theNegativeRings, thePositiveRings); diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.h b/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.h index aa1ebc03af197..93a57436d3977 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.h +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.h @@ -14,8 +14,11 @@ class Phase2OTBarrelLayerBuilder { public: Phase2OTBarrelLayerBuilder(){}; - Phase2OTBarrelLayer* build(const GeometricDet* aPhase2OTBarrelLayer, const TrackerGeometry* theGeomDetGeometry) - __attribute__((cold)); + Phase2OTBarrelLayer* build(const GeometricDet* aPhase2OTBarrelLayer, + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers = true) __attribute__ ((cold)); + + }; #pragma GCC visibility pop diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.cc index ba4a1bf7f5de2..0e377521e329e 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.cc @@ -26,8 +26,8 @@ namespace { Phase2OTBarrelRod::Phase2OTBarrelRod(vector<const GeomDet*>& innerDets, vector<const GeomDet*>& outerDets, - vector<const GeomDet*>& innerDetBrothers, - vector<const GeomDet*>& outerDetBrothers) + const vector<const GeomDet*>& innerDetBrothers, + const vector<const GeomDet*>& outerDetBrothers) : DetRod(true), theInnerDets(innerDets), theOuterDets(outerDets), @@ -61,6 +61,8 @@ Phase2OTBarrelRod::Phase2OTBarrelRod(vector<const GeomDet*>& innerDets, << " , " << (**i).position().perp() << " , " << (**i).position().eta() << " , " << (**i).position().phi(); } + if(theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) LogDebug("TkDetLayers") << "==== with stacks =====" ; + if(!theInnerDetBrothers.empty() && !theOuterDetBrothers.empty()) LogDebug("TkDetLayers") << "==== without stacks =====" ; for (vector<const GeomDet*>::const_iterator i = theOuterDets.begin(); i != theOuterDets.end(); i++) { LogDebug("TkDetLayers") << "outer Phase2OTBarrelRod's Det pos z,perp,eta,phi: " << (**i).position().z() << " , " @@ -198,6 +200,8 @@ bool Phase2OTBarrelRod::addClosest(const TrajectoryStateOnSurface& tsos, vector<DetGroup>& brotherresult) const { const vector<const GeomDet*>& sRod(subRod(crossing.subLayerIndex())); bool firstgroup = CompatibleDetToGroupAdder::add(*sRod[crossing.closestDetIndex()], tsos, prop, est, result); + if(theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) return firstgroup; + // it assumes that the closestDetIndex is ok also for the brother detectors: the crossing is NOT recomputed const vector<const GeomDet*>& sRodBrothers(subRodBrothers(crossing.subLayerIndex())); bool brothergroup = @@ -268,6 +272,7 @@ void Phase2OTBarrelRod::searchNeighbors(const TrajectoryStateOnSurface& tsos, break; if (!Adder::add(*sRod[idet], tsos, prop, est, result)) break; + if(theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) break; // If the two above checks are passed also the brother module will be added with no further checks Adder::add(*sBrotherRod[idet], tsos, prop, est, brotherresult); } @@ -276,6 +281,7 @@ void Phase2OTBarrelRod::searchNeighbors(const TrajectoryStateOnSurface& tsos, break; if (!Adder::add(*sRod[idet], tsos, prop, est, result)) break; + if(theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) break; // If the two above checks are passed also the brother module will be added with no further checks Adder::add(*sBrotherRod[idet], tsos, prop, est, brotherresult); } diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.h b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.h index 3e0b77fcd3ea4..85e97a5a05cee 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.h +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.h @@ -17,8 +17,8 @@ class Phase2OTBarrelRod final : public DetRod { Phase2OTBarrelRod(std::vector<const GeomDet*>& innerDets, std::vector<const GeomDet*>& outerDets, - std::vector<const GeomDet*>& innerDetBrothers, - std::vector<const GeomDet*>& outerDetBrothers) __attribute__((cold)); + const std::vector<const GeomDet*>& innerDetBrothers = std::vector<const GeomDet*>(), + const std::vector<const GeomDet*>& outerDetBrothers = std::vector<const GeomDet*>()) __attribute__((cold)); ~Phase2OTBarrelRod() override __attribute__((cold)); // GeometricSearchDet interface diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc index 786ffc5cd67a7..0719e5980555b 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc @@ -5,10 +5,13 @@ using namespace edm; using namespace std; Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2OTBarrelRod, - const TrackerGeometry* theGeomDetGeometry) { + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) +{ vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->components(); - vector<const GeometricDet*> compGeometricDets; +// vector<const GeometricDet*> compGeometricDets; LogDebug("TkDetLayers") << "Phase2OTBarrelRodBuilder with #Modules: " << allGeometricDets.size() << std::endl; + LogDebug("TkDetLayers") << " useBrothers: " << useBrothers << std::endl; vector<const GeomDet*> innerGeomDets; vector<const GeomDet*> outerGeomDets; @@ -16,47 +19,83 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 vector<const GeomDet*> outerGeomDetBrothers; double meanR = 0; - double meanRBrothers = 0; - for (vector<const GeometricDet*>::const_iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) { - compGeometricDets = (*it)->components(); - if (compGeometricDets.size() != 2) { - LogDebug("TkDetLayers") << " Stack not with two components but with " << compGeometricDets.size() << std::endl; - } else { - //LogTrace("TkDetLayers") << " compGeometricDets[0]->positionBounds().perp() " << compGeometricDets[0]->positionBounds().perp() << std::endl; - //LogTrace("TkDetLayers") << " compGeometricDets[1]->positionBounds().perp() " << compGeometricDets[1]->positionBounds().perp() << std::endl; - meanR = meanR + compGeometricDets[0]->positionBounds().perp(); - meanRBrothers = meanRBrothers + compGeometricDets[1]->positionBounds().perp(); - } - } - meanR = meanR / allGeometricDets.size(); - meanRBrothers = meanRBrothers / allGeometricDets.size(); - LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; - LogDebug("TkDetLayers") << " meanR Upper " << meanRBrothers << std::endl; - - for (vector<const GeometricDet*>::iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) { - compGeometricDets = (*it)->components(); - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalId()); - LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalId().rawId() << std::endl; - - if (compGeometricDets[0]->positionBounds().perp() < meanR) - innerGeomDets.push_back(theGeomDet); - - if (compGeometricDets[0]->positionBounds().perp() > meanR) - outerGeomDets.push_back(theGeomDet); - const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalId()); - LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalId().rawId() << std::endl; - if (compGeometricDets[1]->positionBounds().perp() < meanRBrothers) - innerGeomDetBrothers.push_back(theGeomDetBrother); + if(!useBrothers){ + + for(vector<const GeometricDet*>::const_iterator compGeometricDets=allGeometricDets.begin(); compGeometricDets!=allGeometricDets.end();compGeometricDets++){ + //LogTrace("TkDetLayers") << " compGeometricDets.positionBounds().perp() " << (*compGeometricDets)->positionBounds().perp() << std::endl; + meanR = meanR + (*compGeometricDets)->positionBounds().perp(); + } + meanR = meanR/allGeometricDets.size(); + LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; + + for(vector<const GeometricDet*>::const_iterator compGeometricDets=allGeometricDets.begin(); compGeometricDets!=allGeometricDets.end(); compGeometricDets++){ + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*compGeometricDets)->geographicalId() ); + + if( (*compGeometricDets)->positionBounds().perp() < meanR) + innerGeomDets.push_back(theGeomDet); + + if( (*compGeometricDets)->positionBounds().perp() > meanR) + outerGeomDets.push_back(theGeomDet); + } + + LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ; + LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ; + + return new Phase2OTBarrelRod(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers); - if (compGeometricDets[1]->positionBounds().perp() > meanRBrothers) - outerGeomDetBrothers.push_back(theGeomDetBrother); + vector<const GeometricDet*> compGeometricDets; + + vector<const GeomDet*> innerGeomDetBrothers; + vector<const GeomDet*> outerGeomDetBrothers; + + double meanRBrothers = 0; + for(vector<const GeometricDet*>::const_iterator it=allGeometricDets.begin(); it!=allGeometricDets.end();it++){ + compGeometricDets = (*it)->components(); + if (compGeometricDets.size() != 2){ + LogDebug("TkDetLayers") << " Stack not with two components but with " << compGeometricDets.size() << std::endl; + } else { + //LogTrace("TkDetLayers") << " compGeometricDets[0]->positionBounds().perp() " << compGeometricDets[0]->positionBounds().perp() << std::endl; + //LogTrace("TkDetLayers") << " compGeometricDets[1]->positionBounds().perp() " << compGeometricDets[1]->positionBounds().perp() << std::endl; + meanR = meanR + compGeometricDets[0]->positionBounds().perp(); + meanRBrothers = meanRBrothers + compGeometricDets[1]->positionBounds().perp(); + } + + } + meanR = meanR/allGeometricDets.size(); + meanRBrothers = meanRBrothers/allGeometricDets.size(); + LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; + LogDebug("TkDetLayers") << " meanR Upper " << meanRBrothers << std::endl; + + for(vector<const GeometricDet*>::iterator it=allGeometricDets.begin(); it!=allGeometricDets.end(); it++){ + compGeometricDets = (*it)->components(); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( compGeometricDets[0]->geographicalId() ); + LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalId().rawId() << std::endl; + + if( compGeometricDets[0]->positionBounds().perp() < meanR) + innerGeomDets.push_back(theGeomDet); + + if( compGeometricDets[0]->positionBounds().perp() > meanR) + outerGeomDets.push_back(theGeomDet); + + const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet( compGeometricDets[1]->geographicalId() ); + LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalId().rawId() << std::endl; + if( compGeometricDets[1]->positionBounds().perp() < meanRBrothers) + innerGeomDetBrothers.push_back(theGeomDetBrother); + + if( compGeometricDets[1]->positionBounds().perp() > meanRBrothers) + outerGeomDetBrothers.push_back(theGeomDetBrother); + } + + LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ; + LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ; + LogDebug("TkDetLayers") << "innerGeomDetsBro.size(): " << innerGeomDetBrothers.size() ; + LogDebug("TkDetLayers") << "outerGeomDetsBro.size(): " << outerGeomDetBrothers.size() ; + + return new Phase2OTBarrelRod(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers); + } - LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size(); - LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size(); - LogDebug("TkDetLayers") << "innerGeomDetsBro.size(): " << innerGeomDetBrothers.size(); - LogDebug("TkDetLayers") << "outerGeomDetsBro.size(): " << outerGeomDetBrothers.size(); + return new Phase2OTBarrelRod(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers); - return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); } diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.h b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.h index 641d04d4e7368..7a6876ec24adc 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.h +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.h @@ -14,8 +14,11 @@ class Phase2OTBarrelRodBuilder { public: Phase2OTBarrelRodBuilder(){}; - Phase2OTBarrelRod* build(const GeometricDet* thePhase2OTBarrelRod, const TrackerGeometry* theGeomDetGeometry) - __attribute__((cold)); + Phase2OTBarrelRod* build(const GeometricDet* thePhase2OTBarrelRod, + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers = true) __attribute__ ((cold)); + + }; #pragma GCC visibility pop diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h new file mode 100644 index 0000000000000..e731e3e595e5c --- /dev/null +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -0,0 +1,71 @@ +//--------------------------------------------------------------------------- +// class SeedingOTEDProducer +// author: ebrondol +// date: July, 2016 +//--------------------------------------------------------------------------- + +#ifndef RecoTracker_TkSeedGenerator_SeedingOTEDProducer_h +#define RecoTracker_TkSeedGenerator_SeedingOTEDProducer_h + +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DataFormats/BeamSpot/interface/BeamSpot.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" +#include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/EventSetup.h" + +class TrajectoryStateUpdator; + +class SeedingOTEDProducer : public edm::stream::EDProducer<> +{ + + public: + + explicit SeedingOTEDProducer(const edm::ParameterSet&); + virtual ~SeedingOTEDProducer(); + virtual void produce(edm::Event&, const edm::EventSetup&) override; + + static void fillDescriptions(edm::ConfigurationDescriptions&); + + TrajectorySeedCollection run( edm::Handle< VectorHitCollectionNew > ); + unsigned int checkLayer( unsigned int iidd ); + std::vector<VectorHit> collectVHsOnLayer( edm::Handle< VectorHitCollectionNew >, unsigned int ); + void printVHsOnLayer( edm::Handle< VectorHitCollectionNew >, unsigned int ); + const TrajectoryStateOnSurface buildInitialTSOS( VectorHit& ); + AlgebraicSymMatrix assign44To55( AlgebraicSymMatrix ); + std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator&, const TrackingRecHit& hit); + float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot); + float computeInverseMomentumError(VectorHit& vh, const float globalTheta, const MagneticField* magField, const double sigmaZ_beamSpot); + + TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, const DetId& id, const Propagator& prop); + + struct isInvalid { + bool operator()(const TrajectoryMeasurement& measurement) { + return ( ((measurement).recHit() == 0) || !((measurement).recHit()->isValid()) || !((measurement).updatedState().isValid()) ); + } + }; + + private: + + edm::EDGetTokenT< VectorHitCollectionNew > vhProducerToken; + const TrackerTopology* tkTopo; + const MeasurementTracker* measurementTracker; + const LayerMeasurements* layerMeasurements; + const MeasurementEstimator* estimator; + const Propagator* propagator; + const MagneticField* magField; + const TrajectoryStateUpdator* theUpdator; + const edm::EDGetTokenT<MeasurementTrackerEvent> tkMeasEventToken; + edm::EDGetTokenT<reco::BeamSpot> beamSpotToken; + const reco::BeamSpot* beamSpot; + std::string updatorName; +}; + +#endif diff --git a/RecoTracker/TkSeedGenerator/plugins/SealModules.cc b/RecoTracker/TkSeedGenerator/plugins/SealModules.cc index 4a64f677fc545..58fa1e15580b3 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SealModules.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SealModules.cc @@ -39,3 +39,6 @@ DEFINE_FWK_MODULE(SeedCreatorFromRegionConsecutiveHitsEDProducer); using SeedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer = SeedCreatorFromRegionHitsEDProducerT<SeedFromConsecutiveHitsTripletOnlyCreator>; DEFINE_FWK_MODULE(SeedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer); + +#include "RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h" +DEFINE_FWK_MODULE(SeedingOTEDProducer); diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc new file mode 100644 index 0000000000000..8606e5e9b27c8 --- /dev/null +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -0,0 +1,445 @@ +#include "RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h" +#include "FWCore/Framework/interface/Event.h" + +#include "Geometry/Records/interface/TrackerTopologyRcd.h" + +#include "RecoTracker/Record/interface/CkfComponentsRecord.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h" +#include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h" +#include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h" + +#include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h" +#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" +#include "TrackingTools/MeasurementDet/interface/TrajectoryMeasurementGroup.h" + +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf): + theUpdator(nullptr), + tkMeasEventToken( consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent")) ) +{ + vhProducerToken = consumes< VectorHitCollectionNew >(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); + beamSpotToken = consumes< reco::BeamSpot >(conf.getParameter<edm::InputTag>("beamSpotLabel")); + updatorName = conf.getParameter<std::string>("updator"); + produces<TrajectorySeedCollection>(); +} + +SeedingOTEDProducer::~SeedingOTEDProducer() { +} + +void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions){ + edm::ParameterSetDescription desc; + desc.add<edm::InputTag>("src", edm::InputTag("siPhase2VectorHits","vectorHitsAccepted")); + desc.add<edm::InputTag>("trackerEvent", edm::InputTag("MeasurementTrackerEvent")); + desc.add<edm::InputTag>("beamSpotLabel", edm::InputTag("offlineBeamSpot")); + desc.add<std::string>("updator", std::string("KFUpdator")); + descriptions.add("SeedingOTEDProducer", desc); +} + +void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) +{ + std::cout << "SeedingOT::produce() begin" << std::endl; + std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); + + edm::ESHandle<TrackerTopology> tTopoHandle; + es.get<TrackerTopologyRcd>().get(tTopoHandle); + tkTopo = tTopoHandle.product(); + + edm::ESHandle<MeasurementTracker> measurementTrackerHandle; + es.get<CkfComponentsRecord>().get(measurementTrackerHandle); + measurementTracker = measurementTrackerHandle.product(); + edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; + event.getByToken(tkMeasEventToken,measurementTrackerEvent); + + layerMeasurements = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); + + edm::ESHandle<Chi2MeasurementEstimatorBase> est; + es.get<TrackingComponentsRecord>().get("Chi2",est); + estimator = est.product(); + + edm::ESHandle<Propagator> prop; + es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",prop); + propagator = prop.product(); + + edm::ESHandle<MagneticField> magFieldHandle; + es.get<IdealMagneticFieldRecord>().get(magFieldHandle); + magField = magFieldHandle.product(); + + edm::ESHandle<TrajectoryStateUpdator> updatorHandle; + es.get<TrackingComponentsRecord>().get(updatorName, updatorHandle); + theUpdator = updatorHandle.product(); + + edm::Handle<reco::BeamSpot> beamSpotH; + event.getByToken(beamSpotToken, beamSpotH); + if (beamSpotH.isValid()) { + std::cout << "BeamSpot Position: " << *(beamSpotH.product()); + beamSpot = beamSpotH.product(); + } + + // Get the vector hits + edm::Handle< VectorHitCollectionNew > vhs; + event.getByToken(vhProducerToken, vhs); +/* + edm::ESHandle< ClusterParameterEstimator<Phase2TrackerCluster1D> > parameterestimator; + es.get<TkStripCPERecord>().get(cpe, parameterestimator); + const Phase2StripCPEGeometric & cpeOT(*parameterestimator); +*/ + TrajectorySeedCollection const& tempSeeds = run(vhs); + for( TrajectorySeedCollection::const_iterator qIt = tempSeeds.begin(); qIt < tempSeeds.end(); ++qIt ) { + seedsWithVHs->push_back( *qIt ); + } + + seedsWithVHs->shrink_to_fit(); + event.put(std::move(seedsWithVHs)); + + std::cout << "SeedingOT::produce() end" << std::endl; + +} + +TrajectorySeedCollection SeedingOTEDProducer::run( edm::Handle< VectorHitCollectionNew > VHs ){ + + TrajectorySeedCollection result; + + std::cout << "-----------------------------" << std::endl; + printVHsOnLayer(VHs,1); + printVHsOnLayer(VHs,2); + printVHsOnLayer(VHs,3); + printVHsOnLayer(VHs,4); + printVHsOnLayer(VHs,5); + printVHsOnLayer(VHs,6); + std::cout << "-----------------------------" << std::endl; + + //check if all the first three layers have VHs + std::vector<VectorHit> VHseedsL1 = collectVHsOnLayer(VHs,1); + std::vector<VectorHit> VHseedsL2 = collectVHsOnLayer(VHs,2); + std::vector<VectorHit> VHseedsL3 = collectVHsOnLayer(VHs,3); + if(VHseedsL1.empty() || VHseedsL2.empty() || VHseedsL3.empty()){ + std::cout << "------- seeds found: " << result.size() << " ------" << std::endl; + std::cout << "- L1 or L2 or L3 are empty! -" << std::endl; + std::cout << "-----------------------------" << std::endl; + return result; + } + + //seeds are built in the L3 of the OT + const BarrelDetLayer* barrelOTLayer2 = measurementTracker->geometricSearchTracker()->tobLayers().at(1); + std::cout << "VH seeds = " << VHseedsL3.size() << std::endl; + + //the search propag directiondepend on the sign of signZ*signPz, while the building is always the contrary + Propagator* searchingPropagator = &*propagator->clone(); + Propagator* buildingPropagator = &*propagator->clone(); + buildingPropagator->setPropagationDirection(alongMomentum); + + for(auto hitL3 : VHseedsL3){ + + //building a tsos out of a VectorHit + std::cout << "\t1a) Building a seed for the VH: " << hitL3 << std::endl; + const TrajectoryStateOnSurface initialTSOS = buildInitialTSOS(hitL3); + float signZ = copysign(1.0,initialTSOS.globalPosition().z()); + float signPz = copysign(1.0,initialTSOS.globalMomentum().z()); + + std::cout << "\t initialTSOS : " << initialTSOS << std::endl; + + //set the direction of the propagator + std::cout << "\t1b) Set the searchingPropagator direction: " << std::endl; + if(signZ*signPz > 0.0) + searchingPropagator->setPropagationDirection(oppositeToMomentum); + if(signZ*signPz < 0.0) + searchingPropagator->setPropagationDirection(alongMomentum); + + if(searchingPropagator->propagationDirection() == alongMomentum) + std::cout << "\t searchingPropagator along Momentum" << std::endl; + if(searchingPropagator->propagationDirection() == oppositeToMomentum) + std::cout << "\t ropagator opposite To Momentum" << std::endl; + + //find vHits in layer 2 + std::cout << "-----------------------------" << std::endl; + std::cout << "\t1c) Search/find hit in layer 2: " << std::endl; + std::vector<TrajectoryMeasurement> measurementsL2 = layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + std::cout << "\t vh compatibles on L2: " << measurementsL2.size() << std::endl; + + //other options + //LayerMeasurements::SimpleHitContainer hits; + //layerMeasurements->recHits(hits, *barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + //std::cout << "\t #try2 vh compatibles with recHits: " << hits.size() << std::endl; + //auto && measurementsL2G = layerMeasurements->groupedMeasurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + //std::cout << "\t #try3 vh grouped compatibles: " << measurementsL2G.size() << std::endl; + + + std::vector<TrajectoryMeasurement>::iterator measurementsL2end = std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid()); + measurementsL2.erase(measurementsL2end, measurementsL2.end()); + std::cout << "\t vh compatibles on L2(without invalidHit): " << measurementsL2.size() << std::endl; + std::cout << "-----------------------------" << std::endl; + + if(!measurementsL2.empty()){ + //not sure if building it everytime takes time/memory + const DetLayer* barrelOTLayer1 = measurementTracker->geometricSearchTracker()->tobLayers().at(0); + + for(auto mL2 : measurementsL2){ + + std::cout << "\t2a) Check the searchingPropagator direction: " << std::endl; + if(searchingPropagator->propagationDirection() == alongMomentum) + std::cout << "\t searchingPropagator along Momentum" << std::endl; + if(searchingPropagator->propagationDirection() == oppositeToMomentum) + std::cout << "\t searchingPropagator opposite To Momentum" << std::endl; + + const TrackingRecHit* hitL2 = mL2.recHit().get(); + std::cout << "\t2b) and the VH on layer 2: " << std::endl; + const VectorHit* vhit = dynamic_cast<const VectorHit*>(hitL2); + std::cout << "\t vh is valid >> " << (*vhit) << std::endl; + + //propagate to the L2 and update the TSOS + std::cout << "\t2c) Propagation and update on L2: " << std::endl; + std::pair<bool, TrajectoryStateOnSurface> updatedTSOS = propagateAndUpdate(initialTSOS, *searchingPropagator, *hitL2); + if(!updatedTSOS.first) std::cout << "\t updatedTSOS on L2 is NOT valid : " << updatedTSOS.second << std::endl; + if(!updatedTSOS.first) continue; + std::cout << "\t updatedTSOS is valid : " << updatedTSOS.second << std::endl; + std::cout << "\t chi2 VH/updatedTSOS : " << estimator->estimate(updatedTSOS.second, *hitL2).second << std::endl; + + //searching possible VHs in L1 + std::cout << "\t2d) Search/find hit in layer 1: " << std::endl; + std::vector<TrajectoryMeasurement> measurementsL1 = layerMeasurements->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator); + std::cout << "\t vh compatibles on L1: " << measurementsL1.size() << std::endl; + std::vector<TrajectoryMeasurement>::iterator measurementsL1end = std::remove_if(measurementsL1.begin(), measurementsL1.end(), isInvalid()); + measurementsL1.erase(measurementsL1end, measurementsL1.end()); + std::cout << "\t vh compatibles on L1(without invalidHit): " << measurementsL1.size() << std::endl; + std::cout << "-----------------------------" << std::endl; + + if(!measurementsL1.empty()){ + + for(auto mL1 : measurementsL1){ + std::cout << "\t3a) Check the searchingPropagator direction: " << std::endl; + if(searchingPropagator->propagationDirection() == alongMomentum) + std::cout << "\t searchingPropagator along Momentum" << std::endl; + if(searchingPropagator->propagationDirection() == oppositeToMomentum) + std::cout << "\t searchingPropagator opposite To Momentum" << std::endl; + + const TrackingRecHit* hitL1 = mL1.recHit().get(); + std::cout << "\t3b) and the VH on layer 1: " << std::endl; + const VectorHit* vhitL1 = dynamic_cast<const VectorHit*>(hitL1); + std::cout << "\t vh is valid >> " << (*vhitL1) << std::endl; + + //propagate to the L1 and update the TSOS + std::cout << "\t3c) Propagation and update on L1: " << std::endl; + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL1 = propagateAndUpdate(updatedTSOS.second, *searchingPropagator, *hitL1); + if(!updatedTSOSL1.first) std::cout << "\t updatedTSOS on L1 is NOT valid : " << updatedTSOSL1.second << std::endl; + if(!updatedTSOSL1.first) continue; + std::cout << "\t updatedTSOS on L1 : " << updatedTSOSL1.second << std::endl; + std::cout << "\t chi2 VH/updatedTSOS : " << estimator->estimate(updatedTSOSL1.second, *hitL1).second << std::endl; + + + std::cout << "\t3d) Creation of the Seed: " << std::endl; + // passSelection(updatedTSOS) : + // http://cmslxr.fnal.gov/lxr/source/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc?v=CMSSW_8_1_X_2016-09-04-2300#0474 + edm::OwnVector<TrackingRecHit> container; + container.push_back(hitL1->clone()); + container.push_back(hitL2->clone()); + container.push_back(hitL3.clone()); + + //building trajectory inside-out + std::cout << "\t3e) Building trajectory inside-out: " << std::endl; + if(searchingPropagator->propagationDirection() == alongMomentum){ + buildingPropagator->setPropagationDirection(oppositeToMomentum); + std::cout << "\t buildingPropagator opposite To Momentum" << std::endl; + } else if(searchingPropagator->propagationDirection() == oppositeToMomentum){ + buildingPropagator->setPropagationDirection(alongMomentum); + std::cout << "\t buildingPropagator along Momentum" << std::endl; + } + + updatedTSOSL1.second.rescaleError(100); + std::cout << "\t updatedTSOS on L1 : " << updatedTSOSL1.second << std::endl; + + TrajectoryStateOnSurface updatedTSOSL1_final = theUpdator->update(updatedTSOSL1.second,*hitL1); + if UNLIKELY(!updatedTSOSL1_final.isValid()) continue; + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); + std::cout << "\t updatedTSOS final on L3 : " << updatedTSOSL3_final.second << std::endl; + TrajectorySeed ts = createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(),*buildingPropagator); + result.push_back(ts); + } + + } + + std::cout << "-----" << std::endl; + } + } + + } + std::cout << "-----------------------------" << std::endl; + std::cout << "------- seeds found: " << result.size() << " ------" << std::endl; + std::cout << "-----------------------------" << std::endl; + + return result; +} + +unsigned int SeedingOTEDProducer::checkLayer( unsigned int iidd ){ + StripSubdetector strip = StripSubdetector(iidd); + unsigned int subid = strip.subdetId(); + if (subid == StripSubdetector::TIB || subid == StripSubdetector::TOB) { + return tkTopo->layer(iidd); + } + return 0; +} + +std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer( edm::Handle< VectorHitCollectionNew > VHs, unsigned int layerNumber ){ + + const VectorHitCollectionNew& input = *VHs; + std::vector<VectorHit> VHsOnLayer; + if (input.size() > 0 ) { + //std::cout << "initial VH collection size = " << input.size() << std::endl; + for (auto DSViter : input) { + if(checkLayer(DSViter.id()) == layerNumber){ + for(auto vh : DSViter){ + VHsOnLayer.push_back(vh); + } + } + } + } + + //std::cout << "VH in layer " << layerNumber << " collection size = " << VHsOnLayer.size() << std::endl; + + return VHsOnLayer; +} + +void SeedingOTEDProducer::printVHsOnLayer( edm::Handle< VectorHitCollectionNew > VHs, unsigned int layerNumber ){ + const VectorHitCollectionNew& input = *VHs; + if (input.size() > 0 ) { + for (auto DSViter : input) { + for(auto vh : DSViter){ + if(checkLayer(DSViter.id()) == layerNumber) std::cout << " VH in layer " << layerNumber << " >> " << vh << std::endl; + } + } + } else { + std::cout << " No VHs in layer " << layerNumber << "." << std::endl; + } +} + +const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS( VectorHit& vHit ){ + + //FIXME::charge is fine 1 every two times!! + int charge = 1; + //float pT = vHit.transverseMomentum(magField); + float p = vHit.momentum(magField); + float x = vHit.localPosition().x(); + float y = vHit.localPosition().y(); + float dx = vHit.localDirection().x(); + float dy = vHit.localDirection().y(); + // Pz and Dz should have the same sign + float signPz = copysign(1.0,vHit.globalPosition().z()); + + // having fun with theta + Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); + float theta = gv.theta(); + //std::cout << "\tgv : " << gv << std::endl; + //std::cout << "\tgv theta : " << theta << std::endl; + //std::cout << "\tgv theta error : " << computeGlobalThetaError(vHit, beamSpot->sigmaZ()) << std::endl; + //std::cout << "\tgv eta : " << gv.eta() << std::endl; + // gv transform to local (lv) + const Local3DVector lv( vHit.det()->surface().toLocal( gv ) ); + //std::cout << "\tlv : " << lv << std::endl; + // replace dy with second component of the lv renormalized to the z component + dy = lv.y()/lv.z(); + + LocalTrajectoryParameters ltpar2(charge/p, dx, dy, x, y, signPz); + AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); + // set the error on 1/p + mat[0][0] = pow(computeInverseMomentumError(vHit, theta,magField,beamSpot->sigmaZ()),2); + //std::cout << "\tltraj : " << charge << "," << 1./p <<","<< dx <<","<< dy <<","<< x <<","<< y <<","<< signPz << std::endl; + //std::cout << "\tmat : " << mat << std::endl; + + //building tsos + LocalTrajectoryError lterr(asSMatrix<5>(mat)); + const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit.det()->surface(), magField); + + return tsos; +} + +AlgebraicSymMatrix SeedingOTEDProducer::assign44To55( AlgebraicSymMatrix mat44 ){ + if(mat44.num_row() != 4 || mat44.num_col() != 4) + assert("Wrong dimension! This should be a 4x4 matrix!"); + + AlgebraicSymMatrix result(5,0); + for(int i = 1; i < 5; i++){ + for(int j = 1; j < 5; j++){ + result[i][j] = mat44[i-1][j-1]; + } + } + return result; +} + +std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit){ + TrajectoryStateOnSurface propTSOS = prop.propagate( initialTSOS, hit.det()->surface()); + TrajectoryStateOnSurface updatedTSOS = theUpdator->update(propTSOS,hit); + //std::cout << "updatedTSOS : " << updatedTSOS << std::endl; + if UNLIKELY(!updatedTSOS.isValid()) return std::make_pair( false, updatedTSOS); + return std::make_pair( true, updatedTSOS); +} + +float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot){ + + double derivative = vh.globalPosition().perp()/(pow(vh.globalPosition().z(),2)+pow(vh.globalPosition().perp(),2)); + double derivative2 = pow(derivative,2); + return pow( derivative2*vh.lowerGlobalPosErr().czz()+derivative2*pow(sigmaZ_beamSpot,2), 0.5); + +} + +float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, const float globalTheta, const MagneticField* magField, const double sigmaZ_beamSpot){ + + //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12) + float varianceInverseTransvMomentum = 1./12; + double derivativeTheta2 = pow(cos(globalTheta)/vh.transverseMomentum(magField),2); + double derivativeInverseTransvMomentum2 = pow(sin(globalTheta),2); + float thetaError = computeGlobalThetaError(vh, sigmaZ_beamSpot); + return pow(derivativeTheta2*pow(thetaError,2)+derivativeInverseTransvMomentum2*varianceInverseTransvMomentum,0.5); + +} + +TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, const DetId& id, const Propagator& prop) { +/* + //I have already propagator and updator + //const Propagator* propagator = &(*propagatorHandle); + //KFUpdator updator; + + // Now update initial state track using information from seed hits. + + TrajectoryStateOnSurface updatedState; + edm::OwnVector<TrackingRecHit> seedHits; + + for ( unsigned int iHit = 1; iHit < container.size(); iHit++) { + + std::pair<bool, TrajectoryStateOnSurface> state; + if(iHit==1) + state = propagateAndUpdate(tsos, *propagator, container[iHit]); + else + state = propagateAndUpdate(updatedState, *propagator, container[iHit]); + //std::cout << "-------> new state >> " << state.second << std::endl; + if(state.first) + updatedState = state.second; +*/ +/* + TrajectoryStateOnSurface state = (iHit==1) ? propagator->propagate(tsos, container[iHit].det()->surface()) : propagator->propagate(updatedState, container[iHit].det()->surface()); + + std::cout << "-------> new state >> " << state << std::endl; + + if (!state.isValid()) return TrajectorySeed(); + + //SeedingHitSet::ConstRecHitPointer tth = hits[iHit]; + //std::unique_ptr<BaseTrackerRecHit> newtth(refitHit( tth, state)); + //if (!checkHit(state,&*newtth)) return; + + std::cout << "-------> updated state >> " << state << std::endl; + updatedState = theUpdator->update(state, container[iHit]); + if (!updatedState.isValid()) return TrajectorySeed(); + + //seedHits.push_back(newtth.release()); +*/ +// } + + //if(!hit) return; + + PTrajectoryStateOnDet seedTSOS = trajectoryStateTransform::persistentState(tsos, id.rawId()); + return TrajectorySeed(seedTSOS,container,prop.propagationDirection()); + //if ( !filter || filter->compatible(seed)) seedCollection.push_back(std::move(seed)); + +} diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc index 44aa1e9d10cbd..54a96d8d94b96 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc @@ -18,83 +18,72 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/SiStripCluster/interface/SiStripClusterTools.h" -#include <tuple> +#include<tuple> -#include <iostream> +#include<iostream> using namespace ctfseeding; using namespace std; using namespace edm; -HitExtractorSTRP::HitExtractorSTRP(GeomDetEnumerators::SubDetector subdet, - TrackerDetSide side, - int idLayer, - float iminGoodCharge) - : theLayerSubDet(subdet), - theSide(side), - theIdLayer(idLayer), - minAbsZ(0), - theMinRing(1), - theMaxRing(0), - hasMatchedHits(false), - hasRPhiHits(false), - hasStereoHits(false), - hasRingSelector(false), - hasSimpleRphiHitsCleaner(true) { - minGoodCharge = iminGoodCharge; - if (minGoodCharge > 0) - skipClusters = true; -} +HitExtractorSTRP::HitExtractorSTRP(GeomDetEnumerators::SubDetector subdet, TrackerDetSide side, int idLayer, float iminGoodCharge): + theLayerSubDet(subdet), theSide(side), theIdLayer(idLayer), + minAbsZ(0), theMinRing(1), theMaxRing(0), + hasMatchedHits(false), hasRPhiHits(false), hasStereoHits(false), + hasVectorHits(false), + hasRingSelector(false), hasSimpleRphiHitsCleaner(true) +{ minGoodCharge=iminGoodCharge; if (minGoodCharge>0) skipClusters=true; } -void HitExtractorSTRP::useSkipClusters_(const edm::InputTag& m, edm::ConsumesCollector& iC) { +void HitExtractorSTRP::useSkipClusters_(const edm::InputTag & m, edm::ConsumesCollector& iC) { theSkipClusters = iC.consumes<SkipClustersCollection>(m); + theSkipPhase2Clusters = iC.consumes<SkipPhase2ClustersCollection>(m); } -void HitExtractorSTRP::useRingSelector(int minRing, int maxRing) { - hasRingSelector = true; - theMinRing = minRing; - theMaxRing = maxRing; +void HitExtractorSTRP::useRingSelector(int minRing, int maxRing) +{ + hasRingSelector=true; + theMinRing=minRing; + theMaxRing=maxRing; } -bool HitExtractorSTRP::ringRange(int ring) const { - if (!hasRingSelector) - return true; - return (ring >= theMinRing) & (ring <= theMaxRing); +bool HitExtractorSTRP::ringRange(int ring) const +{ + if (!hasRingSelector) return true; + return (ring >= theMinRing) & (ring <= theMaxRing); } -bool HitExtractorSTRP::skipThis( - DetId id, - OmniClusterRef const& clus, - edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >& stripClusterMask) const { - if (maskCluster && (stripClusterMask->mask(clus.key()))) - return true; +bool HitExtractorSTRP::skipThis(DetId id, OmniClusterRef const& clus, + edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > & stripClusterMask) const { + + if (maskCluster && (stripClusterMask->mask(clus.key())) ) return true; - if - UNLIKELY(minGoodCharge <= 0) return false; - return siStripClusterTools::chargePerCM(id, *clus.cluster_strip()) <= minGoodCharge; + if UNLIKELY(minGoodCharge<=0) return false; + return siStripClusterTools::chargePerCM(id,*clus.cluster_strip()) <= minGoodCharge; } -std::pair<bool, ProjectedSiStripRecHit2D*> HitExtractorSTRP::skipThis( - const TkTransientTrackingRecHitBuilder& ttrhBuilder, - TkHitRef matched, - edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >& stripClusterMask) const { - const SiStripMatchedRecHit2D& hit = (SiStripMatchedRecHit2D const&)(matched); + +std::pair<bool,ProjectedSiStripRecHit2D *> +HitExtractorSTRP::skipThis(const TkTransientTrackingRecHitBuilder& ttrhBuilder, + TkHitRef matched, + edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > & stripClusterMask) const { + const SiStripMatchedRecHit2D & hit = (SiStripMatchedRecHit2D const&)(matched); + assert(dynamic_cast<SiStripMatchedRecHit2D const*>(&matched)); - auto id = hit.geographicalId(); - ProjectedSiStripRecHit2D* replaceMe = nullptr; - bool rejectSt = skipThis(id, hit.stereoClusterRef(), stripClusterMask); - bool rejectMono = skipThis(id, hit.monoClusterRef(), stripClusterMask); + auto id = hit.geographicalId(); + ProjectedSiStripRecHit2D * replaceMe = nullptr; + bool rejectSt = skipThis(id,hit.stereoClusterRef(), stripClusterMask); + bool rejectMono = skipThis(id, hit.monoClusterRef(), stripClusterMask); - if ((!rejectSt) & (!rejectMono)) { + if ((!rejectSt)&(!rejectMono)){ // keepit - return std::make_pair(false, replaceMe); + return std::make_pair(false,replaceMe); } - if (failProjection || (rejectSt & rejectMono)) { + if (failProjection || (rejectSt&rejectMono) ){ //only skip if both hits are done - return std::make_pair(true, replaceMe); + return std::make_pair(true,replaceMe); } // replace with one @@ -102,65 +91,78 @@ std::pair<bool, ProjectedSiStripRecHit2D*> HitExtractorSTRP::skipThis( auto cloner = ttrhBuilder.cloner(); replaceMe = cloner.project(hit, rejectSt, TrajectoryStateOnSurface()).release(); if (rejectSt) - LogDebug("HitExtractorSTRP") << "a matched hit is partially masked, and the mono hit got projected onto: " - << replaceMe->geographicalId().rawId() << " key: " << hit.monoClusterRef().key(); - else - LogDebug("HitExtractorSTRP") << "a matched hit is partially masked, and the stereo hit got projected onto: " - << replaceMe->geographicalId().rawId() << " key: " << hit.stereoClusterRef().key(); + LogDebug("HitExtractorSTRP")<<"a matched hit is partially masked, and the mono hit got projected onto: "<<replaceMe->geographicalId().rawId()<<" key: "<<hit.monoClusterRef().key(); + else + LogDebug("HitExtractorSTRP")<<"a matched hit is partially masked, and the stereo hit got projected onto: "<<replaceMe->geographicalId().rawId()<<" key: "<<hit.stereoClusterRef().key(); - return std::make_pair(true, replaceMe); + return std::make_pair(true,replaceMe); } -void HitExtractorSTRP::cleanedOfClusters(const TkTransientTrackingRecHitBuilder& ttrhBuilder, - const edm::Event& ev, - HitExtractor::Hits& hits, - bool matched, - unsigned int cleanFrom) const { - LogDebug("HitExtractorPIX") << "getting: " << hits.size() << " in input."; - edm::Handle<SkipClustersCollection> stripClusterMask; - if (maskCluster) - ev.getByToken(theSkipClusters, stripClusterMask); - unsigned int skipped = 0; - unsigned int projected = 0; - for (unsigned int iH = cleanFrom; iH < hits.size(); ++iH) { - assert(hits[iH]->isValid()); - auto id = hits[iH]->geographicalId(); - if (matched) { - bool replace; - ProjectedSiStripRecHit2D* replaceMe; - std::tie(replace, replaceMe) = skipThis(ttrhBuilder, *hits[iH], stripClusterMask); - if (replace) { - if (!replaceMe) { - LogDebug("HitExtractorSTRP") << "skipping a matched hit on :" << hits[iH]->geographicalId().rawId(); - skipped++; - } else - projected++; - hits[iH].reset(replaceMe); - if (replaceMe == nullptr) - assert(hits[iH].empty()); - else - assert(hits[iH].isOwn()); + +void HitExtractorSTRP::cleanedOfClusters( const TkTransientTrackingRecHitBuilder& ttrhBuilder, + const edm::Event& ev, HitExtractor::Hits & hits, + bool matched, + unsigned int cleanFrom) const{ + unsigned int skipped=0; + unsigned int projected=0; + if(hasMatchedHits || hasRPhiHits || hasStereoHits){ + LogTrace("HitExtractorSTRP")<<"getting "<<hits.size()<<" strip hit in input."; + edm::Handle<SkipClustersCollection> stripClusterMask; + if (maskCluster) ev.getByToken(theSkipClusters,stripClusterMask); + for (unsigned int iH=cleanFrom;iH<hits.size();++iH){ + assert(hits[iH]->isValid()); + auto id = hits[iH]->geographicalId(); + if (matched) { + bool replace; ProjectedSiStripRecHit2D * replaceMe; std::tie(replace,replaceMe) = skipThis(ttrhBuilder, *hits[iH],stripClusterMask); + if (replace) { + if (!replaceMe) { + LogTrace("HitExtractorSTRP")<<"skipping a matched hit on :"<<hits[iH]->geographicalId().rawId(); + skipped++; + } else { projected++; } + hits[iH].reset(replaceMe); + if (replaceMe==nullptr) assert(hits[iH].empty()); + else assert(hits[iH].isOwn()); + } + } + else if (skipThis(id, hits[iH]->firstClusterRef(),stripClusterMask)){ + LogTrace("HitExtractorSTRP")<<"skipping a hit on :"<<hits[iH]->geographicalId().rawId()<<" key: "; + skipped++; + hits[iH].reset(); + } + } + } + if(hasVectorHits){ + LogTrace("HitExtractorSTRP")<<"getting "<<hits.size()<<" vector hit in input."; + edm::Handle<SkipPhase2ClustersCollection> ph2ClusterMask; + if (maskCluster) ev.getByToken(theSkipPhase2Clusters,ph2ClusterMask); + for (unsigned int iH=cleanFrom;iH<hits.size();++iH){ + LogTrace("HitExtractorSTRP")<<"analizing hit on :"<<hits[iH]->geographicalId().rawId(); + assert(hits[iH]->isValid()); + const VectorHit & vhit = dynamic_cast<VectorHit const&>(*hits[iH]); + LogTrace("HitExtractorSTRP")<<" key lower: "<<vhit.lowerClusterRef().key() << " and key upper: " << vhit.upperClusterRef().key(); + LogTrace("HitExtractorSTRP")<<" key lower: "<<hits[iH]->firstClusterRef().key() ; + + //FIXME:: introduce a "projected" version later? + if (maskCluster && (ph2ClusterMask->mask(vhit.lowerClusterRef().key()) || ph2ClusterMask->mask(vhit.upperClusterRef().key())) ){ + LogTrace("HitExtractorSTRP")<<"skipping a vector hit on :"<<hits[iH]->geographicalId().rawId()<<" key lower: "<<vhit.lowerClusterRef().key() << " and key upper: " << vhit.upperClusterRef().key(); + skipped++; + hits[iH].reset(); } - } else if (skipThis(id, hits[iH]->firstClusterRef(), stripClusterMask)) { - LogDebug("HitExtractorSTRP") << "skipping a hit on :" << hits[iH]->geographicalId().rawId() << " key: "; - skipped++; - hits[iH].reset(); } } + // remove empty elements... - auto last = std::remove_if(hits.begin() + cleanFrom, hits.end(), [](HitPointer const& p) { return p.empty(); }); - hits.resize(last - hits.begin()); + auto last = std::remove_if(hits.begin()+cleanFrom,hits.end(),[]( HitPointer const & p) {return p.empty();}); + hits.resize(last-hits.begin()); - // std::cout << "HitExtractorSTRP " <<"skipped :"<<skipped<<" strip rechits because of clusters and projected: "<<projected << std::endl; - LogDebug("HitExtractorSTRP") << "skipped :" << skipped - << " strip rechits because of clusters and projected: " << projected; + LogTrace("HitExtractorSTRP")<<"skipped :"<<skipped<<" rechits because of clusters and projected: "<<projected; } -HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder& ttrhBuilder, - const edm::Event& ev, - const edm::EventSetup& es) const { +HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event& ev, const edm::EventSetup& es) const +{ + LogDebug("HitExtractorSTRP")<<"HitExtractorSTRP::hits"; HitExtractor::Hits result; - unsigned int cleanFrom = 0; + unsigned int cleanFrom=0; //Retrieve tracker topology from geometry edm::ESHandle<TrackerTopology> tTopoHandle; @@ -171,226 +173,237 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder // TIB // if (theLayerSubDet == GeomDetEnumerators::TIB) { + LogTrace("HitExtractorSTRP")<<"Getting hits into the TIB"; if (hasMatchedHits) { edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; - ev.getByToken(theMatchedHits, matchedHits); - if (skipClusters) - cleanFrom = result.size(); - range2SeedingHits(*matchedHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom); + ev.getByToken( theMatchedHits, matchedHits); + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *matchedHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,true,cleanFrom); } if (hasRPhiHits) { edm::Handle<SiStripRecHit2DCollection> rphiHits; - ev.getByToken(theRPhiHits, rphiHits); - if (hasMatchedHits) { - if (!hasSimpleRphiHitsCleaner) { // this is a brutal "cleaning". Add something smarter in the future - if (skipClusters) - cleanFrom = result.size(); - range2SeedingHits(*rphiHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); - } + ev.getByToken( theRPhiHits, rphiHits); + if (hasMatchedHits){ + if (!hasSimpleRphiHitsCleaner){ // this is a brutal "cleaning". Add something smarter in the future + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *rphiHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } } else { - if (skipClusters) - cleanFrom = result.size(); - range2SeedingHits(*rphiHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *rphiHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); } } if (hasStereoHits) { edm::Handle<SiStripRecHit2DCollection> stereoHits; - ev.getByToken(theStereoHits, stereoHits); - if (skipClusters) - cleanFrom = result.size(); - range2SeedingHits(*stereoHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + ev.getByToken( theStereoHits, stereoHits); + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *stereoHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); } + if (hasVectorHits) { + LogError("HitExtractorSTRP")<<"TIB is not supposed to be in Phase2 TRK detector configuration. What follows have never been checked before! "; + edm::Handle<VectorHitCollectionNew> vectorHits; + ev.getByToken( theVectorHits, vectorHits); + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *vectorHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } + } - + // // TID // else if (theLayerSubDet == GeomDetEnumerators::TID) { + LogTrace("HitExtractorSTRP")<<"Getting hits into the TID"; if (hasMatchedHits) { - edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; - ev.getByToken(theMatchedHits, matchedHits); - if (skipClusters) - cleanFrom = result.size(); - auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); - SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); - for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tidRing(it->detId()); - if (!ringRange(ring)) - continue; - for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; - ++hit) { - result.emplace_back(*hit); + edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; + ev.getByToken( theMatchedHits, matchedHits); + if (skipClusters) cleanFrom=result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); + for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; + for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); + } } - } - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,true,cleanFrom); } if (hasRPhiHits) { - edm::Handle<SiStripRecHit2DCollection> rphiHits; - ev.getByToken(theRPhiHits, rphiHits); - if (skipClusters) - cleanFrom = result.size(); - auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); - SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); - for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tidRing(it->detId()); - if (!ringRange(ring)) - continue; - if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) - continue; // this is a brutal "cleaning". Add something smarter in the future - for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); + edm::Handle<SiStripRecHit2DCollection> rphiHits; + ev.getByToken( theRPhiHits, rphiHits); + if (skipClusters) cleanFrom=result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); + for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; + if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) continue; // this is a brutal "cleaning". Add something smarter in the future + for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); + } } - } - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); } if (hasStereoHits) { - edm::Handle<SiStripRecHit2DCollection> stereoHits; - ev.getByToken(theStereoHits, stereoHits); - if (skipClusters) - cleanFrom = result.size(); - auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); - SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); - for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tidRing(it->detId()); - if (!ringRange(ring)) - continue; - for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + edm::Handle<SiStripRecHit2DCollection> stereoHits; + ev.getByToken( theStereoHits, stereoHits); + if (skipClusters) cleanFrom=result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); + for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; + for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); + } + } + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } + if (hasVectorHits) { + LogTrace("HitExtractorSTRP")<<"Getting vector hits for IdLayer " << theIdLayer; + edm::Handle<VectorHitCollectionNew> vectorHits; + ev.getByToken( theVectorHits, vectorHits); + //FIXME: check the skipClusters with VHits + if (skipClusters) cleanFrom=result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + VectorHitCollection::Range range = vectorHits->equal_range(getter.first, getter.second); + for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; + for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.emplace_back(*hit); } } - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + LogTrace("HitExtractorSTRP")<<"result size value:" << result.size(); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); } } // // TOB // else if (theLayerSubDet == GeomDetEnumerators::TOB) { + LogTrace("HitExtractorSTRP")<<"Getting hits into the TOB"; if (hasMatchedHits) { edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; - ev.getByToken(theMatchedHits, matchedHits); - if (skipClusters) - cleanFrom = result.size(); - if (minAbsZ > 0.) { - auto getter = tTopo->tobDetIdLayerComparator(theIdLayer); - SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); - for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; - ++hit) { - if (fabs(hit->globalPosition().z()) >= minAbsZ) - result.emplace_back(*hit); - } - } + ev.getByToken( theMatchedHits, matchedHits); + if (skipClusters) cleanFrom=result.size(); + if (minAbsZ>0.) { + auto getter = tTopo->tobDetIdLayerComparator(theIdLayer); + SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); + for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + if (fabs(hit->globalPosition().z())>=minAbsZ) result.emplace_back(*hit); + } + } } else { - range2SeedingHits(*matchedHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + range2SeedingHits( *matchedHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); } - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,true,cleanFrom); } if (hasRPhiHits) { edm::Handle<SiStripRecHit2DCollection> rphiHits; - ev.getByToken(theRPhiHits, rphiHits); - if (hasMatchedHits) { - if (!hasSimpleRphiHitsCleaner) { // this is a brutal "cleaning". Add something smarter in the future - if (skipClusters) - cleanFrom = result.size(); - range2SeedingHits(*rphiHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); - } + ev.getByToken( theRPhiHits, rphiHits); + if (hasMatchedHits){ + if (!hasSimpleRphiHitsCleaner){ // this is a brutal "cleaning". Add something smarter in the future + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *rphiHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } } else { - if (skipClusters) - cleanFrom = result.size(); - range2SeedingHits(*rphiHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *rphiHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); } } if (hasStereoHits) { edm::Handle<SiStripRecHit2DCollection> stereoHits; - ev.getByToken(theStereoHits, stereoHits); - if (skipClusters) - cleanFrom = result.size(); - range2SeedingHits(*stereoHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + ev.getByToken( theStereoHits, stereoHits); + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *stereoHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); } + if (hasVectorHits) { + LogTrace("HitExtractorSTRP")<<"Getting vector hits for IdLayer " << theIdLayer; + edm::Handle<VectorHitCollectionNew> vectorHits; + ev.getByToken( theVectorHits, vectorHits); + //FIXME: check the skipClusters with VHits + if (skipClusters) cleanFrom=result.size(); + range2SeedingHits( *vectorHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } + } // // TEC // else if (theLayerSubDet == GeomDetEnumerators::TEC) { + LogTrace("HitExtractorSTRP")<<"Getting hits into the TEC"; if (hasMatchedHits) { - edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; - ev.getByToken(theMatchedHits, matchedHits); - if (skipClusters) - cleanFrom = result.size(); - auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); - SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); - for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tecRing(it->detId()); - if (!ringRange(ring)) - continue; - for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; - ++hit) { - result.emplace_back(*hit); + edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; + ev.getByToken( theMatchedHits, matchedHits); + if (skipClusters) cleanFrom=result.size(); + auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); + for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tecRing( it->detId() ); if (!ringRange(ring)) continue; + for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); + } } - } - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,true,cleanFrom); } if (hasRPhiHits) { - edm::Handle<SiStripRecHit2DCollection> rphiHits; - ev.getByToken(theRPhiHits, rphiHits); - if (skipClusters) - cleanFrom = result.size(); - auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); - SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); - for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tecRing(it->detId()); - if (!ringRange(ring)) - continue; - if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) - continue; // this is a brutal "cleaning". Add something smarter in the future - for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); + edm::Handle<SiStripRecHit2DCollection> rphiHits; + ev.getByToken( theRPhiHits, rphiHits); + if (skipClusters) cleanFrom=result.size(); + auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); + for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tecRing( it->detId() ); if (!ringRange(ring)) continue; + if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) continue; // this is a brutal "cleaning". Add something smarter in the future + for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); + } } - } - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } if (hasStereoHits) { - edm::Handle<SiStripRecHit2DCollection> stereoHits; - ev.getByToken(theStereoHits, stereoHits); - if (skipClusters) - cleanFrom = result.size(); - auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); - SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); - for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tecRing(it->detId()); - if (!ringRange(ring)) - continue; - for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + edm::Handle<SiStripRecHit2DCollection> stereoHits; + ev.getByToken( theStereoHits, stereoHits); + if (skipClusters) cleanFrom=result.size(); + auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); + for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tecRing( it->detId() ); if (!ringRange(ring)) continue; + for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); + } + } + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } + if (hasVectorHits) { + LogError("HitExtractorSTRP")<<"TEC is not supposed to be in Phase2 TRK detector configuration. What follows have never been checked before! "; + edm::Handle<VectorHitCollectionNew> vectorHits; + ev.getByToken( theVectorHits, vectorHits); + if (skipClusters) cleanFrom=result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + VectorHitCollection::Range range = vectorHits->equal_range(getter.first, getter.second); + for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; + for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.emplace_back(*hit); } } - if (skipClusters) - cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); } } - LogDebug("HitExtractorSTRP") << " giving: " << result.size() << " out"; - // std::cout << "HitExtractorSTRP "<<" giving: "<<result.size() << " for charge cut " << minGoodCharge << std::endl; + LogDebug("HitExtractorSTRP")<<" giving: "<<result.size()<<" out for charge cut " << minGoodCharge; return result; } + + diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h index f41f10d0e3f0f..deeaa9728ffbb 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h @@ -8,6 +8,7 @@ #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include <vector> #include <tuple> @@ -44,6 +45,11 @@ namespace ctfseeding { hasStereoHits = true; theStereoHits = iC.consumes<SiStripRecHit2DCollection>(m); } + + void useVectorHits(const edm::InputTag & m, edm::ConsumesCollector& iC) { + hasVectorHits = true; + theVectorHits = iC.consumes<VectorHitCollectionNew>(m); + } void useRingSelector(int minRing, int maxRing); void useSimpleRphiHitsCleaner(bool use) { hasSimpleRphiHitsCleaner = use; } @@ -72,6 +78,7 @@ namespace ctfseeding { bool ringRange(int ring) const; typedef edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > SkipClustersCollection; + typedef edm::ContainerMask< Phase2TrackerCluster1DCollectionNew > SkipPhase2ClustersCollection; void useSkipClusters_(const edm::InputTag& m, edm::ConsumesCollector& iC) override; private: @@ -81,12 +88,15 @@ namespace ctfseeding { double minAbsZ; int theMinRing, theMaxRing; edm::EDGetTokenT<SkipClustersCollection> theSkipClusters; + edm::EDGetTokenT<SkipPhase2ClustersCollection> theSkipPhase2Clusters; edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> theMatchedHits; edm::EDGetTokenT<SiStripRecHit2DCollection> theRPhiHits; edm::EDGetTokenT<SiStripRecHit2DCollection> theStereoHits; + edm::EDGetTokenT<VectorHitCollectionNew> theVectorHits; bool hasMatchedHits; bool hasRPhiHits; bool hasStereoHits; + bool hasVectorHits; bool hasRingSelector; bool hasSimpleRphiHitsCleaner; bool failProjection; diff --git a/RecoTracker/TkSeedingLayers/src/SeedingLayerSetsBuilder.cc b/RecoTracker/TkSeedingLayers/src/SeedingLayerSetsBuilder.cc index 96b4ed9599a93..4bd23772b1761 100644 --- a/RecoTracker/TkSeedingLayers/src/SeedingLayerSetsBuilder.cc +++ b/RecoTracker/TkSeedingLayers/src/SeedingLayerSetsBuilder.cc @@ -133,6 +133,9 @@ SeedingLayerSetsBuilder::LayerSpec::LayerSpec(unsigned short index, if (cfgLayer.exists("stereoRecHits")) { extr->useStereoHits(cfgLayer.getParameter<edm::InputTag>("stereoRecHits"), iC); } + if (cfgLayer.exists("vectorRecHits")) { + extr->useVectorHits(cfgLayer.getParameter<edm::InputTag>("vectorRecHits"), iC); + } if (cfgLayer.exists("useRingSlector") && cfgLayer.getParameter<bool>("useRingSlector")) { extr->useRingSelector(cfgLayer.getParameter<int>("minRing"), cfgLayer.getParameter<int>("maxRing")); } diff --git a/RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h b/RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h index d12a0bf069028..35f1c418bcb4f 100644 --- a/RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h +++ b/RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h @@ -33,6 +33,7 @@ class TkClonerImpl final : public TkCloner { TrajectoryStateOnSurface const& tsos) const override; std::unique_ptr<Phase2TrackerRecHit1D> operator()(Phase2TrackerRecHit1D const& hit, TrajectoryStateOnSurface const& tsos) const override; + std::unique_ptr<VectorHit> operator()(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const override; using TkCloner::makeShared; TrackingRecHit::ConstRecHitPointer makeShared(SiPixelRecHit const& hit, @@ -47,7 +48,7 @@ class TkClonerImpl final : public TkCloner { TrajectoryStateOnSurface const& tsos) const override; TrackingRecHit::ConstRecHitPointer makeShared(Phase2TrackerRecHit1D const& hit, TrajectoryStateOnSurface const& tsos) const override; - + TrackingRecHit::ConstRecHitPointer makeShared(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const override; // project either mono or stero hit... std::unique_ptr<ProjectedSiStripRecHit2D> project(SiStripMatchedRecHit2D const& hit, bool mono, diff --git a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc index 84908be991070..9c19f5c63f05a 100644 --- a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc +++ b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc @@ -5,6 +5,7 @@ #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" #include "RecoLocalTracker/Records/interface/TrackerCPERecord.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h" diff --git a/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc b/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc index b8c2b24f19888..9d729a1a1973e 100644 --- a/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc +++ b/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc @@ -6,6 +6,7 @@ #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" #include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" @@ -56,6 +57,10 @@ std::unique_ptr<Phase2TrackerRecHit1D> TkClonerImpl::operator()(Phase2TrackerRec return std::make_unique<Phase2TrackerRecHit1D>(params.first, params.second, *hit.det(), hit.cluster()); } +std::unique_ptr<VectorHit> TkClonerImpl::operator()(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const { + return std::unique_ptr<VectorHit>{new VectorHit(hit)}; +} + TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared(SiPixelRecHit const& hit, TrajectoryStateOnSurface const& tsos) const { // std::cout << "cloning " << typeid(hit).name() << std::endl; @@ -92,6 +97,10 @@ TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared(Phase2TrackerRecHit1 return std::make_unique<Phase2TrackerRecHit1D>(params.first, params.second, *hit.det(), hit.cluster()); } +TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const { + return std::make_shared<VectorHit>(hit); +} + namespace { #undef RecoTracker_TransientTrackingRecHit_TSiStripMatchedRecHit_RefitProj #undef RecoTracker_TransientTrackingRecHit_TSiStripMatchedRecHit_RefitLGL diff --git a/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc b/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc index f22a5c69e4352..fcc5ab60b3e26 100644 --- a/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc +++ b/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc @@ -5,6 +5,13 @@ #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" +#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" +#include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h" +#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" +#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" +#include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "DataFormats/SiStripDetId/interface/SiStripDetId.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/Math/interface/deltaR.h" @@ -800,7 +807,7 @@ double QuickTrackAssociatorByHitsImpl::weightedNumberOfTrackClusters(iter begin, weightedClusters += weight; } } - LogTrace("QuickTrackAssociatorByHitsImpl") << " total weighted clusters: " << weightedClusters; + LogTrace("QuickTrackAssociatorByHitsImpl") << " total weighted clusters: " << weightedClusters; return weightedClusters; } From 9643a44fd81636ad8b7279555ce55cd86ff2426a Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 1 Oct 2019 18:20:06 +0200 Subject: [PATCH 338/778] fixes after review by Mia --- .../TrackerRecHit2D/interface/VectorHit.h | 5 +-- .../TrackerRecHit2D/interface/VectorHit2D.h | 1 - DataFormats/TrackerRecHit2D/src/VectorHit.cc | 41 +++---------------- .../src/VectorHitBuilderAlgorithmBase.cc | 17 -------- 4 files changed, 7 insertions(+), 57 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 693e332611e51..6b60a684c205c 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -108,9 +108,6 @@ class VectorHit GCC11_FINAL : public BaseTrackerRecHit { /// The projection matrix relates the trajectory state parameters to the segment parameters(). virtual AlgebraicMatrix projectionMatrix() const override; - // Degrees of freedom of the segment fit - virtual int degreesOfFreedom() const { return 0; } //number of hits (2+2) - dimension - // Access to component RecHits (if any) virtual std::vector<const TrackingRecHit*> recHits() const override; virtual std::vector<TrackingRecHit*> recHits() override ; @@ -149,7 +146,7 @@ class VectorHit GCC11_FINAL : public BaseTrackerRecHit { inline bool operator<( const VectorHit& one, const VectorHit& other) { - if ( one.chi2() > other.chi2() ) { + if ( one.chi2() < other.chi2() ) { return true; } diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index 91438a397746e..c20a9b5d74aa1 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -17,7 +17,6 @@ class VectorHit2D { LocalError localDirectionError() const { return LocalError(theCovMatrix[0][0],theCovMatrix[0][1],theCovMatrix[1][1]); } AlgebraicSymMatrix22 covMatrix() const { return theCovMatrix; } double chi2() const { return theChi2; } - int degreesOfFreedom() const { return 0; } //number of hits (2) - dimension int dimension() const { return 2; } private: diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 83ebea20d2b11..09fce92d3bac7 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -179,9 +179,9 @@ Global3DVector VectorHit::globalDirection() const { std::pair<double,double> VectorHit::curvatureORphi(std::string curvORphi) const { - double curvature = 0.0; - double errorCurvature = 0.0; - double phi = 0.0; + double curvature = -999.; + double errorCurvature = -999.; + double phi = -999.; //global pos and errors Global3DPoint gPositionLower = lowerGlobalPos(); @@ -361,38 +361,9 @@ float VectorHit::theta(){ } AlgebraicMatrix VectorHit::projectionMatrix() const { - -// static bool isInitialized=false; + // obsolete (for what tracker is concerned...) interface static AlgebraicMatrix the4DProjectionMatrix(4, 5, 0); -/* - static AlgebraicMatrix the2DPhiProjMatrix(2, 5, 0); - static AlgebraicMatrix the2DZProjMatrix(2, 5, 0); - - if (!isInitialized) { - the4DProjectionMatrix[0][1] = 1; - the4DProjectionMatrix[1][2] = 1; - the4DProjectionMatrix[2][3] = 1; - the4DProjectionMatrix[3][4] = 1; - - the2DPhiProjMatrix[0][1] = 1; - the2DPhiProjMatrix[1][3] = 1; - - the2DZProjMatrix[0][2] = 1; - the2DZProjMatrix[1][4] = 1; - - isInitialized= true; - } - - if (dimension()==4) { - return the4DProjectionMatrix; - } else if (theProjection==phi) { - return the2DPhiProjMatrix; - } else if (theProjection==Z) { - return the2DZProjMatrix; - } else { - return AlgebraicMatrix(); - } -*/ return the4DProjectionMatrix; //ERICA:QUESTO NON ESISTEVA!! + return the4DProjectionMatrix; } @@ -428,7 +399,7 @@ std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { //" Vectorhit theta : " << vh.theta() << "\n" << //" Cov: " << vh.parametersError() << "\n" << //" Dim: " << vh.dimension() << "\n" << - //" chi2/ndof: " << vh.chi2() << "/" << vh.degreesOfFreedom() << "\n" << + //" chi2: " << vh.chi2() << "\n" << " Lower cluster global position : " << vh.lowerGlobalPos() << "\n" << " Upper cluster global position : " << vh.upperGlobalPos(); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index df42069d3adf5..864be497f603d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -2,7 +2,6 @@ #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" -#include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" @@ -17,22 +16,6 @@ VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::Paramete void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) { - //FIXME:ask Vincenzo - /* - uint32_t tk_cache_id = es.get<TrackerDigiGeometryRecord>().cacheIdentifier(); - uint32_t c_cache_id = es.get<TkPhase2OTCPERecord>().cacheIdentifier(); - - if(tk_cache_id != tracker_cache_id) { - es.get<TrackerDigiGeometryRecord>().get(tracker); - tracker_cache_id = tk_cache_id; - } - if(c_cache_id != cpe_cache_id) { - es.get<TkPhase2OTCPERecord>().get(matcherTag, matcher); - es.get<TkPhase2OTCPERecord>().get(cpeTag, cpe); - cpe_cache_id = c_cache_id; - } - */ - // get the geometry and topology edm::ESHandle< TrackerGeometry > geomHandle; es.get< TrackerDigiGeometryRecord >().get( geomHandle ); From 3bc0dde9888d8cd54aa184e5c46c941592016e69 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 1 Oct 2019 20:39:49 +0200 Subject: [PATCH 339/778] apply code checks --- CommonTools/RecoAlgos/src/ClusterStorer.cc | 2 +- .../interface/BaseTrackerRecHit.h | 7 +- .../TrackerRecHit2D/interface/TkCloner.h | 5 +- .../TrackerRecHit2D/interface/VectorHit.h | 96 +- .../TrackerRecHit2D/interface/VectorHit2D.h | 23 +- .../interface/trackerHitRTTI.h | 2 +- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 415 +++---- DataFormats/TrackerRecHit2D/src/classes.h | 251 ++-- .../interface/VectorHitBuilderAlgorithm.h | 101 +- .../interface/VectorHitBuilderAlgorithmBase.h | 58 +- .../interface/VectorHitBuilderEDProducer.h | 31 +- .../plugins/SealModules.cc | 1 - .../SiPhase2RecHitMatcherESProducer.cc | 18 +- .../plugins/SiPhase2RecHitMatcherESProducer.h | 11 +- .../src/VectorHitBuilderAlgorithm.cc | 339 +++--- .../src/VectorHitBuilderAlgorithmBase.cc | 96 +- .../src/VectorHitBuilderEDProducer.cc | 100 +- .../test/ClustersValidationTGraph.cc | 793 +++++++------ .../test/VectorHitsValidation.cc | 1010 +++++++++-------- .../test/VectorHitsValidation.h | 170 +-- .../src/SeedClusterRemoverPhase2.cc | 37 +- .../src/TrackClusterRemoverPhase2.cc | 21 +- RecoTracker/CkfPattern/src/PrintoutHelper.cc | 13 +- .../plugins/TrackerRecoGeometryESProducer.cc | 8 +- .../MeasurementTrackerEventProducer.cc | 1 - .../plugins/MeasurementTrackerImpl.cc | 4 +- .../plugins/MeasurementTrackerImpl.h | 2 +- .../plugins/TkStackMeasurementDet.cc | 110 +- .../plugins/TkStackMeasurementDet.h | 11 +- .../MeasurementDet/src/TkMeasurementDetSet.h | 9 +- .../Record/interface/CkfComponentsRecord.h | 1 - .../interface/GeometricSearchTrackerBuilder.h | 6 +- .../src/GeometricSearchTrackerBuilder.cc | 32 +- .../src/Phase2EndcapLayerBuilder.cc | 17 +- .../src/Phase2EndcapLayerBuilder.h | 4 +- .../src/Phase2EndcapRingBuilder.cc | 9 +- .../src/Phase2OTBarrelLayerBuilder.cc | 37 +- .../src/Phase2OTBarrelLayerBuilder.h | 6 +- .../TkDetLayers/src/Phase2OTBarrelRod.cc | 15 +- .../TkDetLayers/src/Phase2OTBarrelRod.h | 3 +- .../src/Phase2OTBarrelRodBuilder.cc | 108 +- .../src/Phase2OTBarrelRodBuilder.h | 6 +- .../interface/SeedingOTEDProducer.h | 45 +- .../src/SeedingOTEDProducer.cc | 269 ++--- .../TkSeedingLayers/src/HitExtractorSTRP.cc | 540 +++++---- .../TkSeedingLayers/src/HitExtractorSTRP.h | 8 +- .../interface/TkClonerImpl.h | 5 +- .../src/TkClonerImpl.cc | 5 +- 48 files changed, 2577 insertions(+), 2284 deletions(-) diff --git a/CommonTools/RecoAlgos/src/ClusterStorer.cc b/CommonTools/RecoAlgos/src/ClusterStorer.cc index 820837d660ab1..e015446c7d5be 100644 --- a/CommonTools/RecoAlgos/src/ClusterStorer.cc +++ b/CommonTools/RecoAlgos/src/ClusterStorer.cc @@ -51,7 +51,7 @@ namespace helper { } else if (hit_type == typeid(VectorHit)) { //FIXME:: this is just temporary solution for phase2, //the VectorHit has 2 clusters but just a hit! - phase2OTClusterRecords_.push_back(Phase2OTClusterHitRecord(static_cast<VectorHit&>(newHit), hits, index)); + phase2OTClusterRecords_.push_back(Phase2OTClusterHitRecord(static_cast<VectorHit &>(newHit), hits, index)); } else { if (hit_type == typeid(FastTrackerRecHit) || hit_type == typeid(FastProjectedTrackerRecHit) || hit_type == typeid(FastMatchedTrackerRecHit)) { diff --git a/DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h b/DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h index 79a8fdfe4d2bc..3b55cce07b2ea 100644 --- a/DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h +++ b/DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h @@ -23,7 +23,8 @@ class BaseTrackerRecHit : public TrackingRecHit { // no position (as in persistent) BaseTrackerRecHit(DetId id, trackerHitRTTI::RTTI rt) : TrackingRecHit(id, (unsigned int)(rt)), qualWord_(0) {} - BaseTrackerRecHit(const GeomDet & idet, trackerHitRTTI::RTTI rt) : TrackingRecHit(idet,(unsigned int)(rt)),qualWord_(0) {} + BaseTrackerRecHit(const GeomDet& idet, trackerHitRTTI::RTTI rt) + : TrackingRecHit(idet, (unsigned int)(rt)), qualWord_(0) {} BaseTrackerRecHit(const LocalPoint& p, const LocalError& e, GeomDet const& idet, trackerHitRTTI::RTTI rt) : TrackingRecHit(idet, (unsigned int)(rt)), pos_(p), err_(e), qualWord_(0) { @@ -52,12 +53,12 @@ class BaseTrackerRecHit : public TrackingRecHit { bool hasPositionAndError() const override; - LocalPoint localPosition() const override{ + LocalPoint localPosition() const override { check(); return pos_; } - LocalError localPositionError() const override{ + LocalError localPositionError() const override { check(); return err_; } diff --git a/DataFormats/TrackerRecHit2D/interface/TkCloner.h b/DataFormats/TrackerRecHit2D/interface/TkCloner.h index 81412962b97e6..cc98baef4ae8c 100644 --- a/DataFormats/TrackerRecHit2D/interface/TkCloner.h +++ b/DataFormats/TrackerRecHit2D/interface/TkCloner.h @@ -40,7 +40,7 @@ class TkCloner { TrajectoryStateOnSurface const& tsos) const = 0; virtual std::unique_ptr<Phase2TrackerRecHit1D> operator()(Phase2TrackerRecHit1D const& hit, TrajectoryStateOnSurface const& tsos) const = 0; - virtual std::unique_ptr<VectorHit> operator()(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const=0; + virtual std::unique_ptr<VectorHit> operator()(VectorHit const& hit, TrajectoryStateOnSurface const& tsos) const = 0; #ifndef __GCCXML__ virtual TrackingRecHit::ConstRecHitPointer makeShared(SiPixelRecHit const& hit, @@ -55,7 +55,8 @@ class TkCloner { TrajectoryStateOnSurface const& tsos) const = 0; virtual TrackingRecHit::ConstRecHitPointer makeShared(Phase2TrackerRecHit1D const& hit, TrajectoryStateOnSurface const& tsos) const = 0; - virtual TrackingRecHit::ConstRecHitPointer makeShared(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const=0; + virtual TrackingRecHit::ConstRecHitPointer makeShared(VectorHit const& hit, + TrajectoryStateOnSurface const& tsos) const = 0; #endif }; #endif diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 6b60a684c205c..83ed6e7b57a15 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -27,58 +27,62 @@ #include "TkCloner.h" class VectorHit GCC11_FINAL : public BaseTrackerRecHit { - - public: - +public: typedef OmniClusterRef::Phase2Cluster1DRef ClusterRef; VectorHit() : thePosition(), theDirection(), theCovMatrix(), theDimension(0) { setType(bad); } - VectorHit(const VectorHit& vh) ; + VectorHit(const VectorHit& vh); - VectorHit(const GeomDet& idet, const LocalPoint& posInner, const LocalVector& dir, - const AlgebraicSymMatrix& covMatrix, const double& Chi2, - OmniClusterRef const& lower, OmniClusterRef const& upper) ; + VectorHit(const GeomDet& idet, + const LocalPoint& posInner, + const LocalVector& dir, + const AlgebraicSymMatrix& covMatrix, + const double& Chi2, + OmniClusterRef const& lower, + OmniClusterRef const& upper); - VectorHit(const GeomDet& idet, const VectorHit2D& vh2Dzx, const VectorHit2D& vh2Dzy, - OmniClusterRef const& lower, OmniClusterRef const& upper) ; + VectorHit(const GeomDet& idet, + const VectorHit2D& vh2Dzx, + const VectorHit2D& vh2Dzy, + OmniClusterRef const& lower, + OmniClusterRef const& upper); - ~VectorHit() ; + ~VectorHit() override; - virtual VectorHit* clone() const override { return new VectorHit(*this);} + VectorHit* clone() const override { return new VectorHit(*this); } #ifndef __GCCXML__ - virtual RecHitPointer cloneSH() const override { return std::make_shared<VectorHit>(*this);} + RecHitPointer cloneSH() const override { return std::make_shared<VectorHit>(*this); } #endif - virtual bool sharesInput( const TrackingRecHit* other, SharedInputType what) const override; - bool sharesClusters(VectorHit const & h1, VectorHit const & h2, - SharedInputType what) const ; + bool sharesInput(const TrackingRecHit* other, SharedInputType what) const override; + bool sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedInputType what) const; // Parameters of the segment, for the track fit // For a 4D segment: (dx/dz,dy/dz,x,y) - bool hasPositionAndError() const GCC11_FINAL{ - //bool hasPositionAndError() const { + bool hasPositionAndError() const GCC11_FINAL { + //bool hasPositionAndError() const { return true; -// return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) || -// (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0); + // return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) || + // (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0); }; - virtual AlgebraicVector parameters() const override; - virtual void getKfComponents( KfComponentsHolder & holder ) const override { getKfComponents4D(holder); } - void getKfComponents4D( KfComponentsHolder & holder ) const ; + AlgebraicVector parameters() const override; + void getKfComponents(KfComponentsHolder& holder) const override { getKfComponents4D(holder); } + void getKfComponents4D(KfComponentsHolder& holder) const; // returning methods LocalPoint localPosition() const GCC11_FINAL { return thePosition; } virtual LocalVector localDirection() const { return theDirection; } - AlgebraicSymMatrix parametersError() const override ; - LocalError localPositionError() const GCC11_FINAL ; - virtual LocalError localDirectionError() const ; + AlgebraicSymMatrix parametersError() const override; + LocalError localPositionError() const GCC11_FINAL; + virtual LocalError localDirectionError() const; Global3DVector globalDirection() const; virtual double chi2() const { return theChi2; } - virtual int dimension() const override { return theDimension; } + int dimension() const override { return theDimension; } - std::pair<double,double> curvatureORphi(std::string curvORphi = "curvature") const ; + std::pair<double, double> curvatureORphi(std::string curvORphi = "curvature") const; float transverseMomentum(const MagneticField* magField); float momentum(const MagneticField* magField); @@ -88,42 +92,42 @@ class VectorHit GCC11_FINAL : public BaseTrackerRecHit { OmniClusterRef const upperClusterRef() const { return theUpperCluster; } //FIXME::to update with a proper CPE maybe... - Global3DPoint lowerGlobalPos() const ; - Global3DPoint upperGlobalPos() const ; + Global3DPoint lowerGlobalPos() const; + Global3DPoint upperGlobalPos() const; Global3DPoint phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) const; - GlobalError lowerGlobalPosErr() const ; - GlobalError upperGlobalPosErr() const ; + GlobalError lowerGlobalPosErr() const; + GlobalError upperGlobalPosErr() const; GlobalError phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet) const; - virtual bool isPhase2() const override { return true; } + bool isPhase2() const override { return true; } //FIXME: I have always two clusters in a VH - virtual OmniClusterRef const & firstClusterRef() const GCC11_FINAL { return theLowerCluster;} - ClusterRef cluster() const { return theLowerCluster.cluster_phase2OT(); } + OmniClusterRef const& firstClusterRef() const GCC11_FINAL { return theLowerCluster; } + ClusterRef cluster() const { return theLowerCluster.cluster_phase2OT(); } //This method returns the delta in global coordinates Global3DVector globalDelta() const; float theta(); /// The projection matrix relates the trajectory state parameters to the segment parameters(). - virtual AlgebraicMatrix projectionMatrix() const override; + AlgebraicMatrix projectionMatrix() const override; // Access to component RecHits (if any) - virtual std::vector<const TrackingRecHit*> recHits() const override; - virtual std::vector<TrackingRecHit*> recHits() override ; + std::vector<const TrackingRecHit*> recHits() const override; + std::vector<TrackingRecHit*> recHits() override; // setting methods void setPosition(LocalPoint pos) { thePosition = pos; } void setDirection(LocalVector dir) { theDirection = dir; } void setCovMatrix(AlgebraicSymMatrix mat) { theCovMatrix = mat; } - private: +private: // double dispatch - virtual VectorHit * clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override{ - return cloner(*this,tsos).release(); + VectorHit* clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override { + return cloner(*this, tsos).release(); } - virtual RecHitPointer cloneSH_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override{ - return cloner.makeShared(*this,tsos); + RecHitPointer cloneSH_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override { + return cloner.makeShared(*this, tsos); } LocalPoint thePosition; @@ -141,12 +145,10 @@ class VectorHit GCC11_FINAL : public BaseTrackerRecHit { int theDimension; OmniClusterRef theLowerCluster; OmniClusterRef theUpperCluster; - }; -inline bool operator<( const VectorHit& one, const VectorHit& other) { - - if ( one.chi2() < other.chi2() ) { +inline bool operator<(const VectorHit& one, const VectorHit& other) { + if (one.chi2() < other.chi2()) { return true; } @@ -156,6 +158,6 @@ inline bool operator<( const VectorHit& one, const VectorHit& other) { std::ostream& operator<<(std::ostream& os, const VectorHit& vh); typedef edmNew::DetSetVector<VectorHit> VectorHitCollection; -typedef VectorHitCollection VectorHitCollectionNew; +typedef VectorHitCollection VectorHitCollectionNew; #endif diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index c20a9b5d74aa1..7bc0d8eb1c098 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -3,29 +3,28 @@ #include "DataFormats/GeometryVector/interface/LocalVector.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" - -class VectorHit2D { - public: +class VectorHit2D { +public: VectorHit2D() : thePosition(), theDirection(), theCovMatrix(), theChi2(), theDimension(2) {} - VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& Chi2) : - thePosition(pos), theDirection(dir), theCovMatrix(covMatrix), theChi2(Chi2), theDimension(2){}; - virtual ~VectorHit2D() {}; + VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& Chi2) + : thePosition(pos), theDirection(dir), theCovMatrix(covMatrix), theChi2(Chi2), theDimension(2){}; + virtual ~VectorHit2D(){}; LocalPoint localPosition() const { return thePosition; } LocalVector localDirection() const { return theDirection; } - LocalError localDirectionError() const { return LocalError(theCovMatrix[0][0],theCovMatrix[0][1],theCovMatrix[1][1]); } + LocalError localDirectionError() const { + return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); + } AlgebraicSymMatrix22 covMatrix() const { return theCovMatrix; } - double chi2() const { return theChi2; } + double chi2() const { return theChi2; } int dimension() const { return 2; } - private: +private: LocalPoint thePosition; LocalVector theDirection; AlgebraicSymMatrix22 theCovMatrix; double theChi2; int theDimension; - }; -#endif - +#endif diff --git a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h index 6268b68ca0d8b..db8579d0db982 100644 --- a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h +++ b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h @@ -37,7 +37,7 @@ namespace trackerHitRTTI { inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); } inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 10); } inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; } - inline bool isVector(TrackingRecHit const & hit) { return rtti(hit)==vector;} + inline bool isVector(TrackingRecHit const& hit) { return rtti(hit) == vector; } inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; } } // namespace trackerHitRTTI diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 09fce92d3bac7..307d2afae51d7 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -1,40 +1,38 @@ #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" -VectorHit::VectorHit(const VectorHit& vh): - BaseTrackerRecHit(*vh.det(), trackerHitRTTI::vector), - thePosition(vh.localPosition()), - theDirection(vh.localDirection()), - theCovMatrix(vh.parametersError()), - theChi2(vh.chi2()), - theDimension(vh.dimension()), - theLowerCluster(vh.lowerClusterRef()), - theUpperCluster(vh.upperClusterRef()) -{} +VectorHit::VectorHit(const VectorHit& vh) + : BaseTrackerRecHit(*vh.det(), trackerHitRTTI::vector), + thePosition(vh.localPosition()), + theDirection(vh.localDirection()), + theCovMatrix(vh.parametersError()), + theChi2(vh.chi2()), + theDimension(vh.dimension()), + theLowerCluster(vh.lowerClusterRef()), + theUpperCluster(vh.upperClusterRef()) {} VectorHit::VectorHit(const GeomDet& idet, const LocalPoint& posLower, const LocalVector& dir, const AlgebraicSymMatrix& covMatrix, - const double& Chi2, - OmniClusterRef const& lower, OmniClusterRef const& upper) : - BaseTrackerRecHit(idet, trackerHitRTTI::vector), - thePosition(posLower), - theDirection(dir), - theCovMatrix(covMatrix), - theChi2(Chi2), - theDimension(4), - theLowerCluster(lower), - theUpperCluster(upper) -{} - -VectorHit::VectorHit(const GeomDet& idet, const VectorHit2D& vh2Dzx, const VectorHit2D& vh2Dzy, - OmniClusterRef const& lower, OmniClusterRef const& upper) : - BaseTrackerRecHit(idet, trackerHitRTTI::vector), - theDimension(4), - theLowerCluster(lower), - theUpperCluster(upper) -{ + const double& Chi2, + OmniClusterRef const& lower, + OmniClusterRef const& upper) + : BaseTrackerRecHit(idet, trackerHitRTTI::vector), + thePosition(posLower), + theDirection(dir), + theCovMatrix(covMatrix), + theChi2(Chi2), + theDimension(4), + theLowerCluster(lower), + theUpperCluster(upper) {} + +VectorHit::VectorHit(const GeomDet& idet, + const VectorHit2D& vh2Dzx, + const VectorHit2D& vh2Dzy, + OmniClusterRef const& lower, + OmniClusterRef const& upper) + : BaseTrackerRecHit(idet, trackerHitRTTI::vector), theDimension(4), theLowerCluster(lower), theUpperCluster(upper) { thePosition = LocalPoint(vh2Dzx.localPosition().x(), vh2Dzy.localPosition().x(), 0.); theDirection = LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), 1.); @@ -45,140 +43,134 @@ VectorHit::VectorHit(const GeomDet& idet, const VectorHit2D& vh2Dzx, const Vecto AlgebraicSymMatrix22 covMatZX = vh2Dzx.covMatrix(); AlgebraicSymMatrix22 covMatZY = vh2Dzy.covMatrix(); - theCovMatrix=AlgebraicSymMatrix(4); - theCovMatrix[0][0] = covMatZX[0][0]; // var(dx/dz) - theCovMatrix[1][1] = covMatZY[0][0]; // var(dy/dz) - theCovMatrix[2][2] = covMatZX[1][1]; // var(x) - theCovMatrix[3][3] = covMatZY[1][1]; // var(y) - theCovMatrix[0][2] = covMatZX[0][1]; // cov(dx/dz,x) - theCovMatrix[1][3] = covMatZY[0][1]; // cov(dy/dz,y) + theCovMatrix = AlgebraicSymMatrix(4); + theCovMatrix[0][0] = covMatZX[0][0]; // var(dx/dz) + theCovMatrix[1][1] = covMatZY[0][0]; // var(dy/dz) + theCovMatrix[2][2] = covMatZX[1][1]; // var(x) + theCovMatrix[3][3] = covMatZY[1][1]; // var(y) + theCovMatrix[0][2] = covMatZX[0][1]; // cov(dx/dz,x) + theCovMatrix[1][3] = covMatZY[0][1]; // cov(dy/dz,y) theChi2 = vh2Dzx.chi2() + vh2Dzy.chi2(); } -bool VectorHit::sharesInput( const TrackingRecHit* other, SharedInputType what) const -{ - if (what==all && (geographicalId() != other->geographicalId())) return false; - - if (!sameDetModule(*other)) return false; +bool VectorHit::sharesInput(const TrackingRecHit* other, SharedInputType what) const { + if (what == all && (geographicalId() != other->geographicalId())) + return false; - if (trackerHitRTTI::isVector(*other) ) { + if (!sameDetModule(*other)) + return false; + + if (trackerHitRTTI::isVector(*other)) { const VectorHit* otherVh = static_cast<const VectorHit*>(other); return sharesClusters(*this, *otherVh, what); } - - if (what==all) return false; + + if (what == all) + return false; // what about multi??? - auto const & otherClus = reinterpret_cast<const BaseTrackerRecHit *>(other)->firstClusterRef(); - return (otherClus==lowerClusterRef()) || (otherClus==upperClusterRef()); - + auto const& otherClus = reinterpret_cast<const BaseTrackerRecHit*>(other)->firstClusterRef(); + return (otherClus == lowerClusterRef()) || (otherClus == upperClusterRef()); } -bool VectorHit::sharesClusters(VectorHit const & h1, VectorHit const & h2, - SharedInputType what) const { - bool lower = h1.lowerClusterRef()== h2.lowerClusterRef(); - bool upper = h1.upperClusterRef()== h2.upperClusterRef(); - - return (what==TrackingRecHit::all) ? (lower && upper) : (upper||lower); - -} +bool VectorHit::sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedInputType what) const { + bool lower = h1.lowerClusterRef() == h2.lowerClusterRef(); + bool upper = h1.upperClusterRef() == h2.upperClusterRef(); -void VectorHit::getKfComponents4D( KfComponentsHolder & holder ) const { + return (what == TrackingRecHit::all) ? (lower && upper) : (upper || lower); +} + +void VectorHit::getKfComponents4D(KfComponentsHolder& holder) const { //if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents"); - AlgebraicVector4 & pars = holder.params<4>(); + AlgebraicVector4& pars = holder.params<4>(); pars[0] = theDirection.x(); pars[1] = theDirection.y(); pars[2] = thePosition.x(); pars[3] = thePosition.y(); - AlgebraicSymMatrix44 & errs = holder.errors<4>(); - for(int i = 0; i < 4; i++){ - for(int j = 0; j < 4; j++){ - errs(i,j) = theCovMatrix[i][j]; + AlgebraicSymMatrix44& errs = holder.errors<4>(); + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + errs(i, j) = theCovMatrix[i][j]; } } - ProjectMatrix<double,5,4> & pf = holder.projFunc<4>(); + ProjectMatrix<double, 5, 4>& pf = holder.projFunc<4>(); pf.index[0] = 1; pf.index[1] = 2; pf.index[2] = 3; pf.index[3] = 4; - holder.measuredParams<4>() = AlgebraicVector4( & holder.tsosLocalParameters().At(1), 4 ); - holder.measuredErrors<4>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>( 1, 1 ); - + holder.measuredParams<4>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), 4); + holder.measuredErrors<4>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); } VectorHit::~VectorHit() {} AlgebraicVector VectorHit::parameters() const { + // (dx/dz,dy/dz,x,y) + AlgebraicVector result(4); - // (dx/dz,dy/dz,x,y) - AlgebraicVector result(4); - - result[0] = theDirection.x(); - result[1] = theDirection.y(); - result[2] = thePosition.x(); - result[3] = thePosition.y(); - return result; - + result[0] = theDirection.x(); + result[1] = theDirection.y(); + result[2] = thePosition.x(); + result[3] = thePosition.y(); + return result; } Global3DPoint VectorHit::lowerGlobalPos() const { - const StackGeomDet* stackDet = dynamic_cast< const StackGeomDet* >(det()); - const PixelGeomDetUnit* geomDetLower = dynamic_cast< const PixelGeomDetUnit* >(stackDet->lowerDet()); + const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(det()); + const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); return phase2clusterGlobalPos(geomDetLower, lowerCluster()); } Global3DPoint VectorHit::upperGlobalPos() const { - const StackGeomDet* stackDet = dynamic_cast< const StackGeomDet* >(det()); - const PixelGeomDetUnit* geomDetUpper = dynamic_cast< const PixelGeomDetUnit* >(stackDet->upperDet()); + const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(det()); + const PixelGeomDetUnit* geomDetUpper = dynamic_cast<const PixelGeomDetUnit*>(stackDet->upperDet()); return phase2clusterGlobalPos(geomDetUpper, upperCluster()); } Global3DPoint VectorHit::phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) const { - const PixelTopology * topo = &geomDet->specificTopology(); + const PixelTopology* topo = &geomDet->specificTopology(); float ix = cluster->center(); - float iy = cluster->column()+0.5; // halfway the column - LocalPoint lp( topo->localX(ix), topo->localY(iy), 0 ); // x, y, z + float iy = cluster->column() + 0.5; // halfway the column + LocalPoint lp(topo->localX(ix), topo->localY(iy), 0); // x, y, z Global3DPoint gp = geomDet->surface().toGlobal(lp); return gp; } GlobalError VectorHit::lowerGlobalPosErr() const { - const StackGeomDet* stackDet = dynamic_cast< const StackGeomDet* >(det()); - const PixelGeomDetUnit* geomDetLower = dynamic_cast< const PixelGeomDetUnit* >(stackDet->lowerDet()); + const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(det()); + const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); return phase2clusterGlobalPosErr(geomDetLower); } GlobalError VectorHit::upperGlobalPosErr() const { - const StackGeomDet* stackDet = dynamic_cast< const StackGeomDet* >(det()); - const PixelGeomDetUnit* geomDetUpper = dynamic_cast< const PixelGeomDetUnit* >(stackDet->upperDet()); + const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(det()); + const PixelGeomDetUnit* geomDetUpper = dynamic_cast<const PixelGeomDetUnit*>(stackDet->upperDet()); return phase2clusterGlobalPosErr(geomDetUpper); } GlobalError VectorHit::phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet) const { - const PixelTopology * topo = &geomDet->specificTopology(); + const PixelTopology* topo = &geomDet->specificTopology(); float pitchX = topo->pitch().first; float pitchY = topo->pitch().second; - LocalError le( pow(pitchX, 2) / 12., 0, pow(pitchY, 2) / 12.); // e2_xx, e2_xy, e2_yy - GlobalError ge( ErrorFrameTransformer().transform( le, geomDet->surface() )); + LocalError le(pow(pitchX, 2) / 12., 0, pow(pitchY, 2) / 12.); // e2_xx, e2_xy, e2_yy + GlobalError ge(ErrorFrameTransformer().transform(le, geomDet->surface())); return ge; } Global3DVector VectorHit::globalDelta() const { - Local3DVector theLocalDelta = LocalVector(theDirection.x()*theDirection.z(), theDirection.y()*theDirection.z(), theDirection.z()); + Local3DVector theLocalDelta = + LocalVector(theDirection.x() * theDirection.z(), theDirection.y() * theDirection.z(), theDirection.z()); Global3DVector g = det()->surface().toGlobal(theLocalDelta); return g; } -Global3DVector VectorHit::globalDirection() const { - return (det()->surface().toGlobal(localDirection())); -} - -std::pair<double,double> VectorHit::curvatureORphi(std::string curvORphi) const { +Global3DVector VectorHit::globalDirection() const { return (det()->surface().toGlobal(localDirection())); } +std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const { double curvature = -999.; double errorCurvature = -999.; double phi = -999.; @@ -191,126 +183,148 @@ std::pair<double,double> VectorHit::curvatureORphi(std::string curvORphi) const GlobalError gErrorUpper = upperGlobalPosErr(); //insert lower and upper in the global sor - if(gPositionLower.perp() > gPositionUpper.perp()){ + if (gPositionLower.perp() > gPositionUpper.perp()) { gPositionLower = upperGlobalPos(); gPositionUpper = lowerGlobalPos(); gErrorLower = upperGlobalPosErr(); gErrorUpper = lowerGlobalPosErr(); } - double h1 = gPositionLower.x()*gPositionUpper.y() - gPositionUpper.x()*gPositionLower.y(); + double h1 = gPositionLower.x() * gPositionUpper.y() - gPositionUpper.x() * gPositionLower.y(); //determine sign of curvature AlgebraicVector2 n1; n1[0] = -gPositionLower.y(); n1[1] = gPositionLower.x(); AlgebraicVector2 n2; - n2[0] = gPositionUpper.x()-gPositionLower.x(); - n2[1] = gPositionUpper.y()-gPositionLower.y(); - - double n3 = n1[0]*n2[0] + n1[1]*n2[1]; - double signCurv = -copysign(1.0,n3); - double phi1 = atan2(gPositionUpper.y()-gPositionLower.y(),gPositionUpper.x()-gPositionLower.x()); - - if(h1!=0) { - double h2 = 2*h1; - double r12 = pow(gPositionLower.x(),2) + pow(gPositionLower.y(),2); - double r22 = pow(gPositionUpper.x(),2) + pow(gPositionUpper.y(),2); - double h3 = (pow(gPositionLower.x(),2) - 2.*gPositionLower.x()*gPositionUpper.x() + pow(gPositionUpper.x(),2) + pow(gPositionLower.y(),2) - 2.*gPositionLower.y()*gPositionUpper.y() + pow(gPositionUpper.y(),2)); - double h4 = - pow(gPositionLower.x(),2)*gPositionUpper.x() + gPositionLower.x()*pow(gPositionUpper.x(),2) - + gPositionLower.x()*pow(gPositionUpper.y(),2) - gPositionUpper.x()*pow(gPositionLower.y(),2); - double h5 = pow(gPositionLower.x(),2)*gPositionUpper.y() - pow(gPositionUpper.x(),2)*gPositionLower.y() - + pow(gPositionLower.y(),2)*gPositionUpper.y() - gPositionLower.y()*pow(gPositionUpper.y(),2); + n2[0] = gPositionUpper.x() - gPositionLower.x(); + n2[1] = gPositionUpper.y() - gPositionLower.y(); + + double n3 = n1[0] * n2[0] + n1[1] * n2[1]; + double signCurv = -copysign(1.0, n3); + double phi1 = atan2(gPositionUpper.y() - gPositionLower.y(), gPositionUpper.x() - gPositionLower.x()); + + if (h1 != 0) { + double h2 = 2 * h1; + double r12 = pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2); + double r22 = pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2); + double h3 = + (pow(gPositionLower.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.x(), 2) + + pow(gPositionLower.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y() + pow(gPositionUpper.y(), 2)); + double h4 = -pow(gPositionLower.x(), 2) * gPositionUpper.x() + gPositionLower.x() * pow(gPositionUpper.x(), 2) + + gPositionLower.x() * pow(gPositionUpper.y(), 2) - gPositionUpper.x() * pow(gPositionLower.y(), 2); + double h5 = pow(gPositionLower.x(), 2) * gPositionUpper.y() - pow(gPositionUpper.x(), 2) * gPositionLower.y() + + pow(gPositionLower.y(), 2) * gPositionUpper.y() - gPositionLower.y() * pow(gPositionUpper.y(), 2); //radius of circle - double rho = sqrt(r12*r22*h3)/(2.*h1); - curvature = 1./rho; + double rho = sqrt(r12 * r22 * h3) / (2. * h1); + curvature = 1. / rho; //center of circle - double xcentre = h5/h2; - double ycentre = h4/h2; + double xcentre = h5 / h2; + double ycentre = h4 / h2; //to compute phi at the cluster points double xtg = gPositionLower.y() - ycentre; - double ytg = -( gPositionLower.x() - xcentre); + double ytg = -(gPositionLower.x() - xcentre); //to compute phi at the origin //double xtg = ycentre; //double ytg = -(xcentre); - phi = atan2(ytg,xtg); + phi = atan2(ytg, xtg); - AlgebraicROOTObject<4,4>::Matrix jacobian; - for(int i = 0; i < 4; i++){ - for(int j = 0; j < 4; j++){ + AlgebraicROOTObject<4, 4>::Matrix jacobian; + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { jacobian[i][j] = 0.0; } } - jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 - jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 - jacobian[2][0] = (h1*(2.*gPositionLower.x()*r22*h3 + (2.*gPositionLower.x() - 2.*gPositionUpper.x())*r12*r22))/(pow(r12*r22*h3,1.5)) - - (2.*gPositionUpper.y())/sqrt(r12*r22*h3); // dkappa/dx1 - jacobian[2][1] = (2.*gPositionUpper.x())/sqrt(r12*r22*h3) + (h1*(2.*gPositionLower.y()*r22*h3 + r12*r22*(2.*gPositionLower.y() - - 2.*gPositionUpper.y())))/pow(r12*r22*h3,1.5); // dkappa/dy1 - jacobian[2][2] = (2.*gPositionLower.y())/sqrt(r12*r22*h3) + (h1*(2.*gPositionUpper.x()*r12*h3 - - 2.*(gPositionLower.x() - gPositionUpper.x())*r12*r22))/pow(r12*r22*h3,1.5); // dkappa/dx2 - jacobian[2][3] = (h1*(2.*gPositionUpper.y()*r12*h3 - r12*r22*2.*(gPositionLower.y() - gPositionUpper.y())))/pow(r12*r22*h3,1.5) - - (2.*gPositionLower.x())/sqrt(r12*r22*h3); // dkappa/dy2 - - for(int i = 0; i < 4; i++){ + jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 + jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 + jacobian[2][0] = + (h1 * (2. * gPositionLower.x() * r22 * h3 + (2. * gPositionLower.x() - 2. * gPositionUpper.x()) * r12 * r22)) / + (pow(r12 * r22 * h3, 1.5)) - + (2. * gPositionUpper.y()) / sqrt(r12 * r22 * h3); // dkappa/dx1 + jacobian[2][1] = + (2. * gPositionUpper.x()) / sqrt(r12 * r22 * h3) + + (h1 * (2. * gPositionLower.y() * r22 * h3 + r12 * r22 * (2. * gPositionLower.y() - 2. * gPositionUpper.y()))) / + pow(r12 * r22 * h3, 1.5); // dkappa/dy1 + jacobian[2][2] = + (2. * gPositionLower.y()) / sqrt(r12 * r22 * h3) + + (h1 * (2. * gPositionUpper.x() * r12 * h3 - 2. * (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) / + pow(r12 * r22 * h3, 1.5); // dkappa/dx2 + jacobian[2][3] = + (h1 * (2. * gPositionUpper.y() * r12 * h3 - r12 * r22 * 2. * (gPositionLower.y() - gPositionUpper.y()))) / + pow(r12 * r22 * h3, 1.5) - + (2. * gPositionLower.x()) / sqrt(r12 * r22 * h3); // dkappa/dy2 + + for (int i = 0; i < 4; i++) { jacobian[2][i] = -jacobian[2][i]; } AlgebraicVector2 M; //to compute phi at the cluster points - M[0] = (gPositionLower.y() - ycentre)/pow(rho,2); // dphi/dxcentre - M[1] =-(gPositionLower.x() - xcentre)/pow(rho,2); // dphi/dycentre + M[0] = (gPositionLower.y() - ycentre) / pow(rho, 2); // dphi/dxcentre + M[1] = -(gPositionLower.x() - xcentre) / pow(rho, 2); // dphi/dycentre //to compute phi at the origin //float x0 = 0.0; //float y0 = 0.0; //M[0] = (y0 - ycentre)/pow(rho,2); // dphi/dxcentre //M[1] =-(x0 - xcentre)/pow(rho,2); // dphi/dycentre - AlgebraicROOTObject<2,4>::Matrix K; - K[0][0]=(2.*gPositionLower.x()*gPositionUpper.y())/h2 - (2.*gPositionUpper.y()*h5)/pow(h2,2); // dxm/dx1 - K[0][1]=(2.*gPositionUpper.x()*h5)/pow(h2,2) - (pow(gPositionUpper.x(),2) + pow(gPositionUpper.y(),2) - 2.*gPositionLower.y()*gPositionUpper.y())/h2; // dxm/dy1 - K[0][2]=(2.*gPositionLower.y()*h5)/pow(h2,2) - (2.*gPositionUpper.x()*gPositionLower.y())/h2; // dxm/dx2 - K[0][3]=(pow(gPositionLower.x(),2) + pow(gPositionLower.y(),2) - 2.*gPositionUpper.y()*gPositionLower.y())/h2 - (2.*gPositionLower.x()*h5)/pow(h2,2); // dxm/dy2 - K[1][0]=(pow(gPositionUpper.x(),2) - 2.*gPositionLower.x()*gPositionUpper.x() + pow(gPositionUpper.y(),2))/h2 - (2.*gPositionUpper.y()*h4)/pow(h2,2); // dym/dx1 - K[1][1]=(2.*gPositionUpper.x()*h4)/pow(h2,2) - (2.*gPositionUpper.x()*gPositionLower.y())/h2; // dym/dy1 - K[1][2]=(2.*gPositionLower.y()*h4)/pow(h2,2) - (pow(gPositionLower.x(),2) - 2.*gPositionUpper.x()*gPositionLower.x() + pow(gPositionLower.y(),2))/h2; // dym/dx2 - K[1][3]=(2.*gPositionLower.x()*gPositionUpper.y())/h2 - (2.*gPositionLower.x()*h4)/pow(h2,2); // dym/dy2 - - AlgebraicVector4 N = M*K; - jacobian[3][0] = N[0]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][1] = N[1]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][2] = N[2]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][3] = N[3]; // dphi/(dx1,dy1,dx2,dy2) + AlgebraicROOTObject<2, 4>::Matrix K; + K[0][0] = + (2. * gPositionLower.x() * gPositionUpper.y()) / h2 - (2. * gPositionUpper.y() * h5) / pow(h2, 2); // dxm/dx1 + K[0][1] = (2. * gPositionUpper.x() * h5) / pow(h2, 2) - + (pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y()) / + h2; // dxm/dy1 + K[0][2] = + (2. * gPositionLower.y() * h5) / pow(h2, 2) - (2. * gPositionUpper.x() * gPositionLower.y()) / h2; // dxm/dx2 + K[0][3] = + (pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2) - 2. * gPositionUpper.y() * gPositionLower.y()) / h2 - + (2. * gPositionLower.x() * h5) / pow(h2, 2); // dxm/dy2 + K[1][0] = + (pow(gPositionUpper.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.y(), 2)) / h2 - + (2. * gPositionUpper.y() * h4) / pow(h2, 2); // dym/dx1 + K[1][1] = + (2. * gPositionUpper.x() * h4) / pow(h2, 2) - (2. * gPositionUpper.x() * gPositionLower.y()) / h2; // dym/dy1 + K[1][2] = (2. * gPositionLower.y() * h4) / pow(h2, 2) - + (pow(gPositionLower.x(), 2) - 2. * gPositionUpper.x() * gPositionLower.x() + pow(gPositionLower.y(), 2)) / + h2; // dym/dx2 + K[1][3] = + (2. * gPositionLower.x() * gPositionUpper.y()) / h2 - (2. * gPositionLower.x() * h4) / pow(h2, 2); // dym/dy2 + + AlgebraicVector4 N = M * K; + jacobian[3][0] = N[0]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][1] = N[1]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][2] = N[2]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][3] = N[3]; // dphi/(dx1,dy1,dx2,dy2) //assign correct sign to the curvature errors - if( (signCurv < 0 && curvature > 0 ) || (signCurv > 0 && curvature < 0 )){ - curvature=-curvature; - for(int i = 0; i < 4; i++){ + if ((signCurv < 0 && curvature > 0) || (signCurv > 0 && curvature < 0)) { + curvature = -curvature; + for (int i = 0; i < 4; i++) { jacobian[2][i] = -jacobian[2][i]; } } // bring phi in the same quadrant as phi1 - if (abs(phi-phi1) > M_PI/2.){ - phi = phi+M_PI; - if (phi>M_PI) - phi=phi-2.*M_PI; + if (abs(phi - phi1) > M_PI / 2.) { + phi = phi + M_PI; + if (phi > M_PI) + phi = phi - 2. * M_PI; } //computing the curvature error AlgebraicVector4 curvatureJacobian; - for(int i = 0; i < 4; i++){ + for (int i = 0; i < 4; i++) { curvatureJacobian[i] = jacobian[2][i]; } - AlgebraicROOTObject<4,4>::Matrix gErrors; - for(int i = 0; i < 4; i++){ - for(int j = 0; j < 4; j++){ + AlgebraicROOTObject<4, 4>::Matrix gErrors; + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { gErrors[i][j] = 0.0; } } @@ -325,40 +339,36 @@ std::pair<double,double> VectorHit::curvatureORphi(std::string curvORphi) const gErrors[3][3] = gErrorUpper.cyy(); AlgebraicVector4 temp = curvatureJacobian; - temp = temp*gErrors; - errorCurvature = temp[0]*curvatureJacobian[0] + temp[1]*curvatureJacobian[1] + temp[2]*curvatureJacobian[2] + temp[3]*curvatureJacobian[3]; + temp = temp * gErrors; + errorCurvature = temp[0] * curvatureJacobian[0] + temp[1] * curvatureJacobian[1] + temp[2] * curvatureJacobian[2] + + temp[3] * curvatureJacobian[3]; //if(curvORphi == "curvature") std::cout << "curvature: " << curvature << std::endl; //if(curvORphi == "curvature") std::cout << "curvature error: " << errorCurvature << std::endl; - } else { -std::cout << " straight line!" << std::endl; - return std::make_pair(0.0,0.0); + std::cout << " straight line!" << std::endl; + return std::make_pair(0.0, 0.0); } - - if( curvORphi == "curvature" ) return std::make_pair(curvature,errorCurvature); - else if( curvORphi == "phi" ) return std::make_pair(phi,0.0); - else return std::make_pair(0.0,0.0); + if (curvORphi == "curvature") + return std::make_pair(curvature, errorCurvature); + else if (curvORphi == "phi") + return std::make_pair(phi, 0.0); + else + return std::make_pair(0.0, 0.0); } -float VectorHit::transverseMomentum(const MagneticField* magField){ - +float VectorHit::transverseMomentum(const MagneticField* magField) { GlobalPoint center(0.0, 0.0, 0.0); float magnT = magField->inTesla(center).mag(); - double rho = 1./curvatureORphi("curvature").first; + double rho = 1. / curvatureORphi("curvature").first; //0.003 is because the curvature (rho) is in cm and not in m - return (0.003*magnT*rho); - + return (0.003 * magnT * rho); } -float VectorHit::momentum(const MagneticField* magField){ - return transverseMomentum(magField)/(1.*sin(theta())); -} +float VectorHit::momentum(const MagneticField* magField) { return transverseMomentum(magField) / (1. * sin(theta())); } -float VectorHit::theta(){ - return globalDirection().theta(); -} +float VectorHit::theta() { return globalDirection().theta(); } AlgebraicMatrix VectorHit::projectionMatrix() const { // obsolete (for what tracker is concerned...) interface @@ -366,24 +376,19 @@ AlgebraicMatrix VectorHit::projectionMatrix() const { return the4DProjectionMatrix; } - LocalError VectorHit::localPositionError() const { - return LocalError(theCovMatrix[2][2],theCovMatrix[2][3],theCovMatrix[3][3]); + return LocalError(theCovMatrix[2][2], theCovMatrix[2][3], theCovMatrix[3][3]); } - LocalError VectorHit::localDirectionError() const { - return LocalError(theCovMatrix[0][0],theCovMatrix[0][1],theCovMatrix[1][1]); + return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); } - - AlgebraicSymMatrix VectorHit::parametersError() const { - //think about a more efficient method AlgebraicSymMatrix result(4); - for(int i = 0; i < theDimension; i++){ - for(int j = 0; j < theDimension; j++){ + for (int i = 0; i < theDimension; i++) { + for (int j = 0; j < theDimension; j++) { result[i][j] = theCovMatrix[i][j]; } } @@ -391,33 +396,29 @@ AlgebraicSymMatrix VectorHit::parametersError() const { } std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { - - os << " VectorHit create in the DetId#: " << vh.geographicalId() << "\n" << - " Vectorhit local position : " << vh.localPosition() << "\n" << - " Vectorhit local direction : " << vh.localDirection() << "\n" << - " Vectorhit global direction : " << vh.globalDirection() << "\n" << - //" Vectorhit theta : " << vh.theta() << "\n" << - //" Cov: " << vh.parametersError() << "\n" << - //" Dim: " << vh.dimension() << "\n" << - //" chi2: " << vh.chi2() << "\n" << - " Lower cluster global position : " << vh.lowerGlobalPos() << "\n" << - " Upper cluster global position : " << vh.upperGlobalPos(); + os << " VectorHit create in the DetId#: " << vh.geographicalId() << "\n" + << " Vectorhit local position : " << vh.localPosition() << "\n" + << " Vectorhit local direction : " << vh.localDirection() << "\n" + << " Vectorhit global direction : " << vh.globalDirection() << "\n" + << + //" Vectorhit theta : " << vh.theta() << "\n" << + //" Cov: " << vh.parametersError() << "\n" << + //" Dim: " << vh.dimension() << "\n" << + //" chi2: " << vh.chi2() << "\n" << + " Lower cluster global position : " << vh.lowerGlobalPos() << "\n" + << " Upper cluster global position : " << vh.upperGlobalPos(); return os; } - /// Access to component RecHits (if any) -std::vector<const TrackingRecHit*> VectorHit::recHits() const{ +std::vector<const TrackingRecHit*> VectorHit::recHits() const { std::vector<const TrackingRecHit*> pointersOfRecHits; return pointersOfRecHits; } - /// Non-const access to component RecHits (if any) -std::vector<TrackingRecHit*> VectorHit::recHits(){ - +std::vector<TrackingRecHit*> VectorHit::recHits() { std::vector<TrackingRecHit*> pointersOfRecHits; return pointersOfRecHits; } - diff --git a/DataFormats/TrackerRecHit2D/src/classes.h b/DataFormats/TrackerRecHit2D/src/classes.h index 44ede301244ff..98ba7a9edea20 100644 --- a/DataFormats/TrackerRecHit2D/src/classes.h +++ b/DataFormats/TrackerRecHit2D/src/classes.h @@ -9,9 +9,9 @@ #include "DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" -#include "DataFormats/Common/interface/RefProd.h" -#include "DataFormats/SiStripCluster/interface/SiStripCluster.h" -#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/Common/interface/RefProd.h" +#include "DataFormats/SiStripCluster/interface/SiStripCluster.h" +#include "DataFormats/Common/interface/DetSetVector.h" #include "DataFormats/Common/interface/DetSetVectorNew.h" #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/Ref.h" @@ -33,113 +33,176 @@ namespace DataFormats_TrackerRecHit2D { struct dictionary { - ProjectedSiStripRecHit2D projHit; + ProjectedSiStripRecHit2D projHit; SiStripRecHit2D a1; SiStripRecHit1D a11; SiStripMatchedRecHit2D a2; SiPixelRecHit b1; - edm::ClonePolicy<SiStripRecHit2D> a4; - edm::ClonePolicy<SiStripRecHit1D> a44; - edm::ClonePolicy<SiStripMatchedRecHit2D > a5; + edm::ClonePolicy<SiStripRecHit2D> a4; + edm::ClonePolicy<SiStripRecHit1D> a44; + edm::ClonePolicy<SiStripMatchedRecHit2D> a5; edm::ClonePolicy<SiPixelRecHit> b2; - edm::ClonePolicy<SiTrackerMultiRecHit> e2; - - edm::OwnVector<SiStripRecHit2D, - edm::ClonePolicy<SiStripRecHit2D> > a6; - edm::OwnVector<SiStripRecHit2D, - edm::ClonePolicy<SiStripRecHit2D> >::const_iterator it6; - edm::OwnVector<SiStripRecHit1D, - edm::ClonePolicy<SiStripRecHit1D> > a66; - edm::OwnVector<SiStripRecHit1D, - edm::ClonePolicy<SiStripRecHit1D> >::const_iterator it66; - edm::OwnVector<SiStripMatchedRecHit2D, - edm::ClonePolicy<SiStripMatchedRecHit2D> > a7; - edm::OwnVector<SiStripMatchedRecHit2D, - edm::ClonePolicy<SiStripMatchedRecHit2D> >::const_iterator it7; - edm::OwnVector<SiPixelRecHit, - edm::ClonePolicy<SiPixelRecHit> > b3; - edm::OwnVector<SiPixelRecHit, - edm::ClonePolicy<SiPixelRecHit> >::const_iterator it3; - edm::OwnVector<SiTrackerMultiRecHit, - edm::ClonePolicy<SiTrackerMultiRecHit> > e3; - edm::OwnVector<SiTrackerMultiRecHit, - edm::ClonePolicy<SiTrackerMultiRecHit> >::const_iterator it10; + edm::ClonePolicy<SiTrackerMultiRecHit> e2; + + edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>> a6; + edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>::const_iterator it6; + edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>> a66; + edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>::const_iterator it66; + edm::OwnVector<SiStripMatchedRecHit2D, edm::ClonePolicy<SiStripMatchedRecHit2D>> a7; + edm::OwnVector<SiStripMatchedRecHit2D, edm::ClonePolicy<SiStripMatchedRecHit2D>>::const_iterator it7; + edm::OwnVector<SiPixelRecHit, edm::ClonePolicy<SiPixelRecHit>> b3; + edm::OwnVector<SiPixelRecHit, edm::ClonePolicy<SiPixelRecHit>>::const_iterator it3; + edm::OwnVector<SiTrackerMultiRecHit, edm::ClonePolicy<SiTrackerMultiRecHit>> e3; + edm::OwnVector<SiTrackerMultiRecHit, edm::ClonePolicy<SiTrackerMultiRecHit>>::const_iterator it10; edm::OwnVector<BaseTrackerRecHit> ovbtrh; edm::Wrapper<edm::OwnVector<BaseTrackerRecHit>> wovbtrh; - edm::Wrapper< edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit2D, - edm::ClonePolicy<SiStripRecHit2D> >, - edm::ClonePolicy<SiStripRecHit2D> > > siStripRecHit2DLocalPosCollectionWrapper; + edm::Wrapper<edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, + edm::ClonePolicy<SiStripRecHit2D>>> + siStripRecHit2DLocalPosCollectionWrapper; edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit2D, - edm::ClonePolicy<SiStripRecHit2D> >, - edm::ClonePolicy<SiStripRecHit2D> >::id_iterator it2d; - - edm::Wrapper< edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit1D, - edm::ClonePolicy<SiStripRecHit1D> >, - edm::ClonePolicy<SiStripRecHit1D> > > siStripRecHit1DLocalPosCollectionWrapper; - edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit1D, - edm::ClonePolicy<SiStripRecHit1D> >, - edm::ClonePolicy<SiStripRecHit1D> >::id_iterator it1d; - - - edm::Wrapper< edm::RangeMap<DetId, - edm::OwnVector<SiStripMatchedRecHit2D, - edm::ClonePolicy<SiStripMatchedRecHit2D> >, - edm::ClonePolicy<SiStripMatchedRecHit2D> > > siStripRecHit2DMatchedLocalPosCollectionWrapper; - edm::RangeMap<DetId, - edm::OwnVector<SiStripMatchedRecHit2D, - edm::ClonePolicy<SiStripMatchedRecHit2D> >, - edm::ClonePolicy<SiStripMatchedRecHit2D> >::id_iterator itmatch; - - edm::Wrapper< edm::RangeMap<DetId, - edm::OwnVector<SiPixelRecHit, - edm::ClonePolicy<SiPixelRecHit> >, - edm::ClonePolicy<SiPixelRecHit> > > siPixelRecHitCollectionWrapper; - edm::RangeMap<DetId, - edm::OwnVector<SiPixelRecHit, - edm::ClonePolicy<SiPixelRecHit> >, - edm::ClonePolicy<SiPixelRecHit> >::id_iterator itpix; - - edm::Ref<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit2D,edm::ClonePolicy<SiStripRecHit2D> >,edm::ClonePolicy<SiStripRecHit2D> >,SiStripRecHit2D,edm::refhelper::FindUsingAdvance<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit2D,edm::ClonePolicy<SiStripRecHit2D> >,edm::ClonePolicy<SiStripRecHit2D> >,SiStripRecHit2D> > refRangeMapDetIdOwnVectorSiStripRecHit2D; - edm::RefVector<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit2D,edm::ClonePolicy<SiStripRecHit2D> >,edm::ClonePolicy<SiStripRecHit2D> >,SiStripRecHit2D,edm::refhelper::FindUsingAdvance<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit2D,edm::ClonePolicy<SiStripRecHit2D> >,edm::ClonePolicy<SiStripRecHit2D> >,SiStripRecHit2D> > refVectorRangeMapDetIdOwnVectorSiStripRecHit2D; + edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, + edm::ClonePolicy<SiStripRecHit2D>>::id_iterator it2d; - edm::Ref<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit1D,edm::ClonePolicy<SiStripRecHit1D> >,edm::ClonePolicy<SiStripRecHit1D> >,SiStripRecHit1D,edm::refhelper::FindUsingAdvance<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit1D,edm::ClonePolicy<SiStripRecHit1D> >,edm::ClonePolicy<SiStripRecHit1D> >,SiStripRecHit1D> > refRangeMapDetIdOwnVectorSiStripRecHit1D; - edm::RefVector<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit1D,edm::ClonePolicy<SiStripRecHit1D> >,edm::ClonePolicy<SiStripRecHit1D> >,SiStripRecHit1D,edm::refhelper::FindUsingAdvance<edm::RangeMap<DetId,edm::OwnVector<SiStripRecHit1D,edm::ClonePolicy<SiStripRecHit1D> >,edm::ClonePolicy<SiStripRecHit1D> >,SiStripRecHit1D> > refVectorRangeMapDetIdOwnVectorSiStripRecHit1D; + edm::Wrapper<edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, + edm::ClonePolicy<SiStripRecHit1D>>> + siStripRecHit1DLocalPosCollectionWrapper; + edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, + edm::ClonePolicy<SiStripRecHit1D>>::id_iterator it1d; + edm::Wrapper<edm::RangeMap<DetId, + edm::OwnVector<SiStripMatchedRecHit2D, edm::ClonePolicy<SiStripMatchedRecHit2D>>, + edm::ClonePolicy<SiStripMatchedRecHit2D>>> + siStripRecHit2DMatchedLocalPosCollectionWrapper; + edm::RangeMap<DetId, + edm::OwnVector<SiStripMatchedRecHit2D, edm::ClonePolicy<SiStripMatchedRecHit2D>>, + edm::ClonePolicy<SiStripMatchedRecHit2D>>::id_iterator itmatch; - edm::Wrapper<edmNew::DetSetVector<SiStripRecHit2D> > wdstvDummy1; - edm::Wrapper<edmNew::DetSetVector<SiStripRecHit1D> > wdstvDummy11; - edm::Wrapper<edmNew::DetSetVector<SiStripMatchedRecHit2D> > wdstvDummy2; - edm::Wrapper<edmNew::DetSetVector<SiPixelRecHit> > wdstvDummy3; + edm::Wrapper<edm::RangeMap<DetId, + edm::OwnVector<SiPixelRecHit, edm::ClonePolicy<SiPixelRecHit>>, + edm::ClonePolicy<SiPixelRecHit>>> + siPixelRecHitCollectionWrapper; + edm::RangeMap<DetId, + edm::OwnVector<SiPixelRecHit, edm::ClonePolicy<SiPixelRecHit>>, + edm::ClonePolicy<SiPixelRecHit>>::id_iterator itpix; + + edm::Ref<edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, + edm::ClonePolicy<SiStripRecHit2D>>, + SiStripRecHit2D, + edm::refhelper::FindUsingAdvance< + edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, + edm::ClonePolicy<SiStripRecHit2D>>, + SiStripRecHit2D>> + refRangeMapDetIdOwnVectorSiStripRecHit2D; + edm::RefVector<edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, + edm::ClonePolicy<SiStripRecHit2D>>, + SiStripRecHit2D, + edm::refhelper::FindUsingAdvance< + edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, + edm::ClonePolicy<SiStripRecHit2D>>, + SiStripRecHit2D>> + refVectorRangeMapDetIdOwnVectorSiStripRecHit2D; + + edm::Ref<edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, + edm::ClonePolicy<SiStripRecHit1D>>, + SiStripRecHit1D, + edm::refhelper::FindUsingAdvance< + edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, + edm::ClonePolicy<SiStripRecHit1D>>, + SiStripRecHit1D>> + refRangeMapDetIdOwnVectorSiStripRecHit1D; + edm::RefVector<edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, + edm::ClonePolicy<SiStripRecHit1D>>, + SiStripRecHit1D, + edm::refhelper::FindUsingAdvance< + edm::RangeMap<DetId, + edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, + edm::ClonePolicy<SiStripRecHit1D>>, + SiStripRecHit1D>> + refVectorRangeMapDetIdOwnVectorSiStripRecHit1D; + + edm::Wrapper<edmNew::DetSetVector<SiStripRecHit2D>> wdstvDummy1; + edm::Wrapper<edmNew::DetSetVector<SiStripRecHit1D>> wdstvDummy11; + edm::Wrapper<edmNew::DetSetVector<SiStripMatchedRecHit2D>> wdstvDummy2; + edm::Wrapper<edmNew::DetSetVector<SiPixelRecHit>> wdstvDummy3; edm::Wrapper<reco::ClusterRemovalInfo> clusterRemovalInfo; - edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> > fastsimTrackerRecHitCollection; - edm::Wrapper<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> > > fastsimTrackerRecHitCollection_Wrapper; - - std::vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > fastsimTrackerRecHitRefCollection; - - edm::Wrapper<std::vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > > fastsimTrackerRecHitRefCollection_Wrapper; - - std::vector<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> > > fastsimTrackerRecHitCombinations; - edm::Wrapper<std::vector<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> > > >fastsimTrackerRecHitCombinations_Wrapper; - - std::vector<std::vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > > fastSimTrackerRecHitCombinationCollection; - edm::Wrapper<std::vector<std::vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > > > fastSimTrackerRecHitCombinationCollection_Wrapper; - - edm::Ref<vector<vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > >,vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > >,edm::refhelper::FindUsingAdvance<vector<vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > >,vector<edm::Ref<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit,edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit,edm::ClonePolicy<FastTrackerRecHit> >,FastTrackerRecHit> > > > > fastSimTrackerRecHitCombinationRef; - - VectorHitCollectionNew vhc1_new; - edm::RefProd<VectorHitCollectionNew> vhc1_new2; - edm::Wrapper<VectorHitCollectionNew> wh1_new; - + edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>> fastsimTrackerRecHitCollection; + edm::Wrapper<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>> + fastsimTrackerRecHitCollection_Wrapper; + + std::vector< + edm::Ref<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit, + edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit>>> + fastsimTrackerRecHitRefCollection; + + edm::Wrapper<std::vector< + edm::Ref<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit, + edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit>>>> + fastsimTrackerRecHitRefCollection_Wrapper; + + std::vector<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>> fastsimTrackerRecHitCombinations; + edm::Wrapper<std::vector<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>>> + fastsimTrackerRecHitCombinations_Wrapper; + + std::vector<std::vector< + edm::Ref<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit, + edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit>>>> + fastSimTrackerRecHitCombinationCollection; + edm::Wrapper<std::vector<std::vector< + edm::Ref<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit, + edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit>>>>> + fastSimTrackerRecHitCombinationCollection_Wrapper; + + edm::Ref< + vector<vector<edm::Ref< + edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit, + edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit>>>>, + vector<edm::Ref< + edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit, + edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit>>>, + edm::refhelper::FindUsingAdvance< + vector<vector<edm::Ref< + edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit, + edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit>>>>, + vector<edm::Ref< + edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit, + edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, + FastTrackerRecHit>>>>> + fastSimTrackerRecHitCombinationRef; + + VectorHitCollectionNew vhc1_new; + edm::RefProd<VectorHitCollectionNew> vhc1_new2; + edm::Wrapper<VectorHitCollectionNew> wh1_new; }; -} +} // namespace DataFormats_TrackerRecHit2D -#endif // SISTRIPRECHIT_CLASSES_H +#endif // SISTRIPRECHIT_CLASSES_H diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 6a7b3d39b77c9..754f517aa57be 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -14,67 +14,86 @@ #include "DataFormats/Common/interface/DetSetVector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { - public: - - VectorHitBuilderAlgorithm(const edm::ParameterSet& conf) : - VectorHitBuilderAlgorithmBase(conf), theFitter(new LinearFit()) {}; - ~VectorHitBuilderAlgorithm() { delete theFitter; }; +public: + VectorHitBuilderAlgorithm(const edm::ParameterSet& conf) + : VectorHitBuilderAlgorithmBase(conf), theFitter(new LinearFit()){}; + ~VectorHitBuilderAlgorithm() override { delete theFitter; }; - void run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - VectorHitCollectionNew& vhAcc, VectorHitCollectionNew& vhRej, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej ); + void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + VectorHitCollectionNew& vhAcc, + VectorHitCollectionNew& vhRej, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) override; //not implemented yet - bool checkClustersCompatibilityBeforeBuilding(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - const detset & theLowerDetSet, - const detset & theUpperDetSet); - bool checkClustersCompatibility(Local3DPoint& posinner, Local3DPoint& posouter, LocalError& errinner, LocalError& errouter); + bool checkClustersCompatibilityBeforeBuilding(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + const detset& theLowerDetSet, + const detset& theUpperDetSet); + bool checkClustersCompatibility(Local3DPoint& posinner, + Local3DPoint& posouter, + LocalError& errinner, + LocalError& errouter); class LocalPositionSort { - public: - LocalPositionSort(const TrackerGeometry *geometry, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe, const GeomDet * geomDet) : geom_(geometry), cpe_(cpe), geomDet_(geomDet) {} - bool operator()(Phase2TrackerCluster1DRef clus1, Phase2TrackerCluster1DRef clus2) const ; - private: - const TrackerGeometry *geom_; - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; - const GeomDet * geomDet_; + public: + LocalPositionSort(const TrackerGeometry* geometry, + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe, + const GeomDet* geomDet) + : geom_(geometry), cpe_(cpe), geomDet_(geomDet) {} + bool operator()(Phase2TrackerCluster1DRef clus1, Phase2TrackerCluster1DRef clus2) const; + + private: + const TrackerGeometry* geom_; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; + const GeomDet* geomDet_; }; - std::vector<std::pair<VectorHit,bool>> buildVectorHits(const StackGeomDet * stack, - edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - const detset & DSVinner, const detset & DSVouter, - const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()); + std::vector<std::pair<VectorHit, bool>> buildVectorHits( + const StackGeomDet* stack, + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + const detset& DSVinner, + const detset& DSVouter, + const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) override; - VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper); + VectorHit buildVectorHit(const StackGeomDet* stack, + Phase2TrackerCluster1DRef lower, + Phase2TrackerCluster1DRef upper) override; // Full I/O in DetSet //void buildDetUnit( const edm::DetSetVector<Phase2TrackerCluster1D> & input, // output_t& output); - void fit2Dzx(const Local3DPoint lpCI, const Local3DPoint lpCO, - const LocalError leCI, const LocalError leCO, - Local3DPoint& pos, Local3DVector& dir, - AlgebraicSymMatrix22& covMatrix, double& chi2); - void fit2Dzy(const Local3DPoint lpCI, const Local3DPoint lpCO, - const LocalError leCI, const LocalError leCO, - Local3DPoint& pos, Local3DVector& dir, - AlgebraicSymMatrix22& covMatrix, double& chi2); + void fit2Dzx(const Local3DPoint lpCI, + const Local3DPoint lpCO, + const LocalError leCI, + const LocalError leCO, + Local3DPoint& pos, + Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, + double& chi2); + void fit2Dzy(const Local3DPoint lpCI, + const Local3DPoint lpCO, + const LocalError leCI, + const LocalError leCO, + Local3DPoint& pos, + Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, + double& chi2); void fit(const std::vector<float>& x, const std::vector<float>& y, const std::vector<float>& sigy, - Local3DPoint& pos, Local3DVector& dir, - AlgebraicSymMatrix22& covMatrix, double& chi2); - -// void build( const edm::DetSet<Phase2TrackerCluster1D> & input, -// output_t::FastFiller& output); - + Local3DPoint& pos, + Local3DVector& dir, + AlgebraicSymMatrix22& covMatrix, + double& chi2); - private: - LinearFit* theFitter; + // void build( const edm::DetSet<Phase2TrackerCluster1D> & input, + // output_t::FastFiller& output); +private: + LinearFit* theFitter; }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index ad873f4508142..780b9b474485a 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -15,61 +15,67 @@ #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" namespace edm { - class ParameterSet; - template<typename T> class RefGetter; - class EventSetup; -} + class ParameterSet; + template <typename T> + class RefGetter; + class EventSetup; +} // namespace edm class VectorHitBuilderAlgorithmBase { - - public: +public: typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; typedef edmNew::DetSet<Phase2TrackerCluster1D> detset; typedef detset::const_iterator const_iterator; typedef edmNew::DetSetVector<VectorHit> output_t; - typedef std::pair< StackGeomDet, std::vector<Phase2TrackerCluster1D> > StackClusters; + typedef std::pair<StackGeomDet, std::vector<Phase2TrackerCluster1D>> StackClusters; VectorHitBuilderAlgorithmBase(const edm::ParameterSet&); virtual ~VectorHitBuilderAlgorithmBase() {} void initialize(const edm::EventSetup&); - void initTkGeom(edm::ESHandle< TrackerGeometry > tkGeomHandle); - void initTkTopo(edm::ESHandle< TrackerTopology > tkTopoHandle); + void initTkGeom(edm::ESHandle<TrackerGeometry> tkGeomHandle); + void initTkTopo(edm::ESHandle<TrackerTopology> tkTopoHandle); void initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd); //FIXME::ERICA::this should be template, return different collection for different algo used!! - virtual void run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, VectorHitCollectionNew& vhAcc, VectorHitCollectionNew& vhRej, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) = 0; - - virtual std::vector<std::pair<VectorHit,bool>> buildVectorHits (const StackGeomDet * stack, - edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - const detset & DSVinner, const detset & DSVouter, - const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) = 0; - - virtual VectorHit buildVectorHit(const StackGeomDet * stack, + virtual void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + VectorHitCollectionNew& vhAcc, + VectorHitCollectionNew& vhRej, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) = 0; + + virtual std::vector<std::pair<VectorHit, bool>> buildVectorHits( + const StackGeomDet* stack, + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + const detset& DSVinner, + const detset& DSVouter, + const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) = 0; + + virtual VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper) = 0; - double computeParallaxCorrection(const PixelGeomDetUnit*&, const Point3DBase<float, LocalTag>&, const PixelGeomDetUnit*&, const Point3DBase<float, LocalTag>&); + double computeParallaxCorrection(const PixelGeomDetUnit*&, + const Point3DBase<float, LocalTag>&, + const PixelGeomDetUnit*&, + const Point3DBase<float, LocalTag>&); void printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters); void printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* cluster); - void loadDetSetVector( std::map< DetId,std::vector<VectorHit> >& theMap, edmNew::DetSetVector<VectorHit>& theCollection ) const ; + void loadDetSetVector(std::map<DetId, std::vector<VectorHit>>& theMap, + edmNew::DetSetVector<VectorHit>& theCollection) const; const TrackerGeometry* theTkGeom; const TrackerTopology* theTkTopo; const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe; unsigned int nMaxVHforeachStack; - std::vector< double > barrelCut; - std::vector< double > endcapCut; + std::vector<double> barrelCut; + std::vector<double> endcapCut; private: edm::ESInputTag cpeTag_; - - -// typedef SiStripRecHit2DCollection::FastFiller Collector; - + // typedef SiStripRecHit2DCollection::FastFiller Collector; }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h index 8adf92f4bc286..24ccbf93a3d5f 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h @@ -13,29 +13,26 @@ #include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" -class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> -{ - - public: - +class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { +public: explicit VectorHitBuilderEDProducer(const edm::ParameterSet&); - virtual ~VectorHitBuilderEDProducer(); - virtual void produce(edm::Event&, const edm::EventSetup&) override; + ~VectorHitBuilderEDProducer() override; + void produce(edm::Event&, const edm::EventSetup&) override; void setupAlgorithm(edm::ParameterSet const& conf); - void run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, - VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej); - VectorHitBuilderAlgorithmBase * algo() const { return stubsBuilder; }; - - private: - - VectorHitBuilderAlgorithmBase * stubsBuilder; + void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, + VectorHitCollectionNew& outputAcc, + VectorHitCollectionNew& outputRej); + VectorHitBuilderAlgorithmBase* algo() const { return stubsBuilder; }; + +private: + VectorHitBuilderAlgorithmBase* stubsBuilder; std::string offlinestubsTag; unsigned int maxOfflinestubs; std::string algoTag; - edm::EDGetTokenT< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer; + edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer; bool readytobuild; - }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc index 63d60a3d5d6c7..9906f689a4d7f 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc @@ -8,4 +8,3 @@ DEFINE_FWK_EVENTSETUP_MODULE(SiPhase2RecHitMatcherESProducer); DEFINE_FWK_MODULE(VectorHitBuilderEDProducer); - diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 09093bc89ad65..73993fdb3eaed 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -6,22 +6,20 @@ #include "FWCore/Framework/interface/ESProducer.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" -SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet & p) -{ +SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet& p) { name = p.getParameter<std::string>("ComponentName"); pset_ = p; - setWhatProduced(this,name); + setWhatProduced(this, name); } -std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer:: -produce(const TkPhase2OTCPERecord & iRecord) -{ - if( name == "SiPhase2VectorHitMatcher" ){ - matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); +std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer::produce( + const TkPhase2OTCPERecord& iRecord) { + if (name == "SiPhase2VectorHitMatcher") { + matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); edm::ESHandle<TrackerGeometry> tGeomHandle; edm::ESHandle<TrackerTopology> tTopoHandle; - + iRecord.getRecord<TrackerDigiGeometryRecord>().get(tGeomHandle); iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle); @@ -30,5 +28,3 @@ produce(const TkPhase2OTCPERecord & iRecord) } return matcher_; } - - diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h index 80aaf0b36bb1f..be680a93c7c5e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h @@ -7,17 +7,14 @@ #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" #include <memory> -class SiPhase2RecHitMatcherESProducer: public edm::ESProducer { - public: +class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { +public: SiPhase2RecHitMatcherESProducer(const edm::ParameterSet&); std::shared_ptr<VectorHitBuilderEDProducer> produce(const TkPhase2OTCPERecord&); - private: + +private: std::string name; std::shared_ptr<VectorHitBuilderEDProducer> matcher_; edm::ParameterSet pset_; }; #endif - - - - diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 6e7c2fabef3c9..6787bd87f16ee 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -3,38 +3,32 @@ #include "Geometry/CommonTopologies/interface/PixelTopology.h" #include "DataFormats/TrackerRecHit2D/interface/VectorHit2D.h" - -bool VectorHitBuilderAlgorithm::LocalPositionSort::operator()(Phase2TrackerCluster1DRef clus1, Phase2TrackerCluster1DRef clus2) const -{ - const PixelGeomDetUnit* gdu1 = dynamic_cast< const PixelGeomDetUnit* >(geomDet_); - auto && lparams1 = cpe_->localParameters( *clus1, *gdu1 ); // x, y, z, e2_xx, e2_xy, e2_yy - auto && lparams2 = cpe_->localParameters( *clus2, *gdu1 ); // x, y, z, e2_xx, e2_xy, e2_yy +bool VectorHitBuilderAlgorithm::LocalPositionSort::operator()(Phase2TrackerCluster1DRef clus1, + Phase2TrackerCluster1DRef clus2) const { + const PixelGeomDetUnit* gdu1 = dynamic_cast<const PixelGeomDetUnit*>(geomDet_); + auto&& lparams1 = cpe_->localParameters(*clus1, *gdu1); // x, y, z, e2_xx, e2_xy, e2_yy + auto&& lparams2 = cpe_->localParameters(*clus2, *gdu1); // x, y, z, e2_xx, e2_xy, e2_yy return lparams1.first.x() < lparams2.first.x(); } +void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + VectorHitCollectionNew& vhAcc, + VectorHitCollectionNew& vhRej, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) { + LogDebug("VectorHitBuilderAlgorithm") << "Run VectorHitBuilderAlgorithm ... \n"; + const edmNew::DetSetVector<Phase2TrackerCluster1D>* ClustersPhase2Collection = clusters.product(); -void VectorHitBuilderAlgorithm::run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - VectorHitCollectionNew& vhAcc, - VectorHitCollectionNew& vhRej, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) -{ - - LogDebug("VectorHitBuilderAlgorithm") << "Run VectorHitBuilderAlgorithm ... \n" ; - const edmNew::DetSetVector<Phase2TrackerCluster1D>* ClustersPhase2Collection = clusters.product(); - - - std::map< DetId, std::vector<VectorHit> > tempVHAcc, tempVHRej; - std::map< DetId, std::vector<VectorHit> >::iterator it_temporary; + std::map<DetId, std::vector<VectorHit>> tempVHAcc, tempVHRej; + std::map<DetId, std::vector<VectorHit>>::iterator it_temporary; //loop over the DetSetVector - LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << ClustersPhase2Collection->size() << std::endl ; - for( auto DSViter : *ClustersPhase2Collection){ - + LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << ClustersPhase2Collection->size() << std::endl; + for (auto DSViter : *ClustersPhase2Collection) { unsigned int rawDetId1(DSViter.detId()); DetId detId1(rawDetId1); DetId lowerDetId, upperDetId; - if( theTkTopo->isLower(detId1) ){ + if (theTkTopo->isLower(detId1)) { lowerDetId = detId1; upperDetId = theTkTopo->partnerDetId(detId1); } else if (theTkTopo->isUpper(detId1)) { @@ -49,30 +43,30 @@ void VectorHitBuilderAlgorithm::run(edm::Handle< edmNew::DetSetVector<Phase2Trac LogDebug("VectorHitBuilderAlgorithm") << " DetId upper set of clusters : " << upperDetId.rawId() << std::endl; it_temporary = tempVHAcc.find(detIdStack); - if ( it_temporary != tempVHAcc.end() ) { + if (it_temporary != tempVHAcc.end()) { LogTrace("VectorHitBuilderAlgorithm") << " this stack has already been analyzed -> skip it "; continue; } const GeomDet* gd; const StackGeomDet* stackDet; - edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator it_detLower = ClustersPhase2Collection->find( lowerDetId ); - edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator it_detUpper = ClustersPhase2Collection->find( upperDetId ); - - if ( it_detLower != ClustersPhase2Collection->end() && it_detUpper != ClustersPhase2Collection->end() ){ + edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator it_detLower = + ClustersPhase2Collection->find(lowerDetId); + edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator it_detUpper = + ClustersPhase2Collection->find(upperDetId); + if (it_detLower != ClustersPhase2Collection->end() && it_detUpper != ClustersPhase2Collection->end()) { gd = theTkGeom->idToDet(detIdStack); stackDet = dynamic_cast<const StackGeomDet*>(gd); std::vector<VectorHit> vhsInStack_Acc; - std::vector<VectorHit> vhsInStack_Rej; + std::vector<VectorHit> vhsInStack_Rej; const auto vhsInStack_AccRej = buildVectorHits(stackDet, clusters, *it_detLower, *it_detUpper); //storing accepted and rejected VHs - for(auto vh : vhsInStack_AccRej ) { - if(vh.second == true){ + for (auto vh : vhsInStack_AccRej) { + if (vh.second == true) { vhsInStack_Acc.push_back(vh.first); - } - else if(vh.second == false){ + } else if (vh.second == false) { vhsInStack_Rej.push_back(vh.first); } } @@ -84,122 +78,122 @@ void VectorHitBuilderAlgorithm::run(edm::Handle< edmNew::DetSetVector<Phase2Trac tempVHAcc[detIdStack] = vhsInStack_Acc; tempVHRej[detIdStack] = vhsInStack_Rej; - LogTrace("VectorHitBuilderAlgorithm") << "For detId #" << detIdStack.rawId() << " the following VHits have been accepted:"; - for (auto vhIt : vhsInStack_Acc){ + LogTrace("VectorHitBuilderAlgorithm") + << "For detId #" << detIdStack.rawId() << " the following VHits have been accepted:"; + for (auto vhIt : vhsInStack_Acc) { LogTrace("VectorHitBuilderAlgorithm") << "accepted VH: " << vhIt; } - LogTrace("VectorHitBuilderAlgorithm") << "For detId #" << detIdStack.rawId() << " the following VHits have been rejected:"; - for (auto vhIt : vhsInStack_Rej){ + LogTrace("VectorHitBuilderAlgorithm") + << "For detId #" << detIdStack.rawId() << " the following VHits have been rejected:"; + for (auto vhIt : vhsInStack_Rej) { LogTrace("VectorHitBuilderAlgorithm") << "rejected VH: " << vhIt; } - } - } loadDetSetVector(tempVHAcc, vhAcc); loadDetSetVector(tempVHRej, vhRej); - LogDebug("VectorHitBuilderAlgorithm") << "End run VectorHitBuilderAlgorithm ... \n" ; + LogDebug("VectorHitBuilderAlgorithm") << "End run VectorHitBuilderAlgorithm ... \n"; return; - } -bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - const detset & theLowerDetSet, - const detset & theUpperDetSet) -{ - if(theLowerDetSet.size()==1 && theUpperDetSet.size()==1) return true; +bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding( + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + const detset& theLowerDetSet, + const detset& theUpperDetSet) { + if (theLowerDetSet.size() == 1 && theUpperDetSet.size() == 1) + return true; //order lower clusters in u std::vector<Phase2TrackerCluster1D> lowerClusters; - if(theLowerDetSet.size()>1) LogDebug("VectorHitBuilderAlgorithm") << " more than 1 lower cluster! " << std::endl; - if(theUpperDetSet.size()>1) LogDebug("VectorHitBuilderAlgorithm") << " more than 1 upper cluster! " << std::endl; - for ( const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++ cil ) { - Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo( clusters, cil ); + if (theLowerDetSet.size() > 1) + LogDebug("VectorHitBuilderAlgorithm") << " more than 1 lower cluster! " << std::endl; + if (theUpperDetSet.size() > 1) + LogDebug("VectorHitBuilderAlgorithm") << " more than 1 upper cluster! " << std::endl; + for (const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++cil) { + Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo(clusters, cil); lowerClusters.push_back(*clusterLower); } return true; } -bool VectorHitBuilderAlgorithm::checkClustersCompatibility(Local3DPoint& poslower, - Local3DPoint& posupper, - LocalError& errlower, - LocalError& errupper) -{ - +bool VectorHitBuilderAlgorithm::checkClustersCompatibility(Local3DPoint& poslower, + Local3DPoint& posupper, + LocalError& errlower, + LocalError& errupper) { return true; - } //---------------------------------------------------------------------------- //ERICA::in the DT code the global position is used to compute the alpha angle and put a cut on that. -std::vector<std::pair<VectorHit,bool>> VectorHitBuilderAlgorithm::buildVectorHits(const StackGeomDet * stack, - edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - const detset & theLowerDetSet, - const detset & theUpperDetSet, - const std::vector<bool>& phase2OTClustersToSkip) -{ - - std::vector<std::pair<VectorHit,bool>> result; - if(checkClustersCompatibilityBeforeBuilding(clusters, theLowerDetSet, theUpperDetSet)){ +std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHits( + const StackGeomDet* stack, + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + const detset& theLowerDetSet, + const detset& theUpperDetSet, + const std::vector<bool>& phase2OTClustersToSkip) { + std::vector<std::pair<VectorHit, bool>> result; + if (checkClustersCompatibilityBeforeBuilding(clusters, theLowerDetSet, theUpperDetSet)) { LogDebug("VectorHitBuilderAlgorithm") << " compatible -> continue ... " << std::endl; - } else { LogTrace("VectorHitBuilderAlgorithm") << " not compatible, going to the next cluster"; } + } else { + LogTrace("VectorHitBuilderAlgorithm") << " not compatible, going to the next cluster"; + } std::vector<Phase2TrackerCluster1DRef> lowerClusters; - for ( const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++ cil ) { - Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo( clusters, cil ); + for (const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++cil) { + Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo(clusters, cil); lowerClusters.push_back(clusterLower); } std::vector<Phase2TrackerCluster1DRef> upperClusters; - for ( const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ ciu ) { - Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo( clusters, ciu ); + for (const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ciu) { + Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo(clusters, ciu); upperClusters.push_back(clusterUpper); } - std::sort(lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom,&*cpe,&*stack->lowerDet())); - std::sort(upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom,&*cpe,&*stack->upperDet())); - - for ( auto cluL : lowerClusters){ + std::sort(lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->lowerDet())); + std::sort(upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->upperDet())); + + for (auto cluL : lowerClusters) { LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; - printCluster(stack->lowerDet(),&*cluL); - const PixelGeomDetUnit* gduLow = dynamic_cast< const PixelGeomDetUnit* >(stack->lowerDet()); - auto && lparamsLow = cpe->localParameters( *cluL, *gduLow ); - for ( auto cluU : upperClusters){ + printCluster(stack->lowerDet(), &*cluL); + const PixelGeomDetUnit* gduLow = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); + auto&& lparamsLow = cpe->localParameters(*cluL, *gduLow); + for (auto cluU : upperClusters) { LogDebug("VectorHitBuilderAlgorithm") << "\t upper clusters " << std::endl; - printCluster(stack->upperDet(),&*cluU); - const PixelGeomDetUnit* gduUpp = dynamic_cast< const PixelGeomDetUnit* >(stack->upperDet()); - auto && lparamsUpp = cpe->localParameters( *cluU, *gduUpp ); + printCluster(stack->upperDet(), &*cluU); + const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); + auto&& lparamsUpp = cpe->localParameters(*cluU, *gduUpp); //applying the parallax correction - double pC = computeParallaxCorrection(gduLow,lparamsLow.first,gduUpp,lparamsUpp.first); + double pC = computeParallaxCorrection(gduLow, lparamsLow.first, gduUpp, lparamsUpp.first); LogDebug("VectorHitBuilderAlgorithm") << " \t parallax correction:" << pC << std::endl; double lpos_upp_corr = 0.0; double lpos_low_corr = 0.0; - if(lparamsUpp.first.x() > lparamsLow.first.x()){ - if(lparamsUpp.first.x() > 0){ + if (lparamsUpp.first.x() > lparamsLow.first.x()) { + if (lparamsUpp.first.x() > 0) { lpos_low_corr = lparamsLow.first.x(); lpos_upp_corr = lparamsUpp.first.x() - fabs(pC); } - if(lparamsUpp.first.x() < 0){ + if (lparamsUpp.first.x() < 0) { lpos_low_corr = lparamsLow.first.x() + fabs(pC); lpos_upp_corr = lparamsUpp.first.x(); } - } else if( lparamsUpp.first.x() < lparamsLow.first.x() ) { - if(lparamsUpp.first.x() > 0){ + } else if (lparamsUpp.first.x() < lparamsLow.first.x()) { + if (lparamsUpp.first.x() > 0) { lpos_low_corr = lparamsLow.first.x() - fabs(pC); lpos_upp_corr = lparamsUpp.first.x(); } - if(lparamsUpp.first.x() < 0){ + if (lparamsUpp.first.x() < 0) { lpos_low_corr = lparamsLow.first.x(); lpos_upp_corr = lparamsUpp.first.x() + fabs(pC); } } else { - if(lparamsUpp.first.x() > 0){ + if (lparamsUpp.first.x() > 0) { lpos_low_corr = lparamsLow.first.x(); lpos_upp_corr = lparamsUpp.first.x() - fabs(pC); } - if(lparamsUpp.first.x() < 0){ + if (lparamsUpp.first.x() < 0) { lpos_low_corr = lparamsLow.first.x(); lpos_upp_corr = lparamsUpp.first.x() + fabs(pC); } @@ -209,87 +203,95 @@ std::vector<std::pair<VectorHit,bool>> VectorHitBuilderAlgorithm::buildVectorHit LogDebug("VectorHitBuilderAlgorithm") << " \t local pos lower corrected (x):" << lpos_low_corr << std::endl; //building my tolerance : 10*sigma - double delta = 10.0*sqrt(lparamsLow.second.xx()+lparamsUpp.second.xx()); + double delta = 10.0 * sqrt(lparamsLow.second.xx() + lparamsUpp.second.xx()); LogDebug("VectorHitBuilderAlgorithm") << " \t delta: " << delta << std::endl; double width = lpos_low_corr - lpos_upp_corr; LogDebug("VectorHitBuilderAlgorithm") << " \t width: " << width << std::endl; - unsigned int layerStack = theTkTopo->layer(stack->geographicalId()); - if(stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB ) LogDebug("VectorHitBuilderAlgorithm") << " \t is barrel. " << std::endl; - if(stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) LogDebug("VectorHitBuilderAlgorithm") << " \t is endcap. " << std::endl; + if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) + LogDebug("VectorHitBuilderAlgorithm") << " \t is barrel. " << std::endl; + if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) + LogDebug("VectorHitBuilderAlgorithm") << " \t is endcap. " << std::endl; LogDebug("VectorHitBuilderAlgorithm") << " \t layer is : " << layerStack << std::endl; float cut = 0.0; - if(stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB ) cut = barrelCut.at(layerStack); - if(stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) cut = endcapCut.at(layerStack); + if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) + cut = barrelCut.at(layerStack); + if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) + cut = endcapCut.at(layerStack); LogDebug("VectorHitBuilderAlgorithm") << " \t the cut is:" << cut << std::endl; //old cut: indipendent from layer - //if( (lpos_upp_corr < lpos_low_corr + delta) && + //if( (lpos_upp_corr < lpos_low_corr + delta) && // (lpos_upp_corr > lpos_low_corr - delta) ){ //new cut: dependent on layers - if(fabs(width) < cut){ + if (fabs(width) < cut) { LogDebug("VectorHitBuilderAlgorithm") << " accepting VH! " << std::endl; - VectorHit vh = buildVectorHit( stack, cluL, cluU); + VectorHit vh = buildVectorHit(stack, cluL, cluU); //protection: the VH can also be empty!! - if (vh.isValid()){ + if (vh.isValid()) { result.push_back(std::make_pair(vh, true)); } } else { LogDebug("VectorHitBuilderAlgorithm") << " rejecting VH: " << std::endl; //storing vh rejected for combinatiorial studies - VectorHit vh = buildVectorHit( stack, cluL, cluU); + VectorHit vh = buildVectorHit(stack, cluL, cluU); result.push_back(std::make_pair(vh, false)); } - } } return result; - } -VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet * stack, - Phase2TrackerCluster1DRef lower, - Phase2TrackerCluster1DRef upper) -{ - +VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, + Phase2TrackerCluster1DRef lower, + Phase2TrackerCluster1DRef upper) { LogTrace("VectorHitBuilderAlgorithm") << "Build VH with: "; //printCluster(stack->lowerDet(),&*lower); //printCluster(stack->upperDet(),&*upper); - const PixelGeomDetUnit* geomDetLower = dynamic_cast< const PixelGeomDetUnit* >(stack->lowerDet()); - const PixelGeomDetUnit* geomDetUpper = dynamic_cast< const PixelGeomDetUnit* >(stack->upperDet()); + const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); + const PixelGeomDetUnit* geomDetUpper = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); - auto && lparamsLower = cpe->localParameters( *lower, *geomDetLower ); // x, y, z, e2_xx, e2_xy, e2_yy + auto&& lparamsLower = cpe->localParameters(*lower, *geomDetLower); // x, y, z, e2_xx, e2_xy, e2_yy Global3DPoint gparamsLower = geomDetLower->surface().toGlobal(lparamsLower.first); - LogTrace("VectorHitBuilderAlgorithm") << "\t lower global pos: " << gparamsLower ; + LogTrace("VectorHitBuilderAlgorithm") << "\t lower global pos: " << gparamsLower; - auto && lparamsUpper = cpe->localParameters( *upper, *geomDetUpper ); + auto&& lparamsUpper = cpe->localParameters(*upper, *geomDetUpper); Global3DPoint gparamsUpper = geomDetUpper->surface().toGlobal(lparamsUpper.first); - LogTrace("VectorHitBuilderAlgorithm") << "\t upper global pos: " << gparamsUpper ; + LogTrace("VectorHitBuilderAlgorithm") << "\t upper global pos: " << gparamsUpper; //local parameters of upper cluster in lower system of reference Local3DPoint lparamsUpperInLower = geomDetLower->surface().toLocal(gparamsUpper); - LogTrace("VectorHitBuilderAlgorithm") << "\t lower global pos: " << gparamsLower ; - LogTrace("VectorHitBuilderAlgorithm") << "\t upper global pos: " << gparamsUpper ; - - LogTrace("VectorHitBuilderAlgorithm") << "A:\t lower local pos: " << lparamsLower.first << " with error: " << lparamsLower.second << std::endl; - LogTrace("VectorHitBuilderAlgorithm") << "A:\t upper local pos in the lower sof " << lparamsUpperInLower << " with error: " << lparamsUpper.second << std::endl; + LogTrace("VectorHitBuilderAlgorithm") << "\t lower global pos: " << gparamsLower; + LogTrace("VectorHitBuilderAlgorithm") << "\t upper global pos: " << gparamsUpper; - bool ok = checkClustersCompatibility(lparamsLower.first, lparamsUpper.first, lparamsLower.second, lparamsUpper.second); + LogTrace("VectorHitBuilderAlgorithm") << "A:\t lower local pos: " << lparamsLower.first + << " with error: " << lparamsLower.second << std::endl; + LogTrace("VectorHitBuilderAlgorithm") << "A:\t upper local pos in the lower sof " << lparamsUpperInLower + << " with error: " << lparamsUpper.second << std::endl; - if(ok){ + bool ok = + checkClustersCompatibility(lparamsLower.first, lparamsUpper.first, lparamsLower.second, lparamsUpper.second); + if (ok) { AlgebraicSymMatrix22 covMat2Dzx; double chi22Dzx = 0.0; Local3DPoint pos2Dzx; Local3DVector dir2Dzx; - fit2Dzx(lparamsLower.first, lparamsUpperInLower, lparamsLower.second, lparamsUpper.second, pos2Dzx, dir2Dzx, covMat2Dzx, chi22Dzx); + fit2Dzx(lparamsLower.first, + lparamsUpperInLower, + lparamsLower.second, + lparamsUpper.second, + pos2Dzx, + dir2Dzx, + covMat2Dzx, + chi22Dzx); LogTrace("VectorHitBuilderAlgorithm") << "\t pos2Dzx: " << pos2Dzx; LogTrace("VectorHitBuilderAlgorithm") << "\t dir2Dzx: " << dir2Dzx; LogTrace("VectorHitBuilderAlgorithm") << "\t cov2Dzx: " << covMat2Dzx; @@ -299,99 +301,102 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet * stack, double chi22Dzy = 0.0; Local3DPoint pos2Dzy; Local3DVector dir2Dzy; - fit2Dzy(lparamsLower.first, lparamsUpperInLower, lparamsLower.second, lparamsUpper.second, pos2Dzy, dir2Dzy, covMat2Dzy, chi22Dzy); + fit2Dzy(lparamsLower.first, + lparamsUpperInLower, + lparamsLower.second, + lparamsUpper.second, + pos2Dzy, + dir2Dzy, + covMat2Dzy, + chi22Dzy); LogTrace("VectorHitBuilderAlgorithm") << "\t pos2Dzy: " << pos2Dzy; LogTrace("VectorHitBuilderAlgorithm") << "\t dir2Dzy: " << dir2Dzy; LogTrace("VectorHitBuilderAlgorithm") << "\t cov2Dzy: " << covMat2Dzy; VectorHit2D vh2Dzy = VectorHit2D(pos2Dzy, dir2Dzy, covMat2Dzy, chi22Dzy); - OmniClusterRef lowerOmni(lower); - OmniClusterRef upperOmni(upper); + OmniClusterRef lowerOmni(lower); + OmniClusterRef upperOmni(upper); VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni); return vh; - } return VectorHit(); - } - - -void VectorHitBuilderAlgorithm::fit2Dzx(const Local3DPoint lpCI, const Local3DPoint lpCO, - const LocalError leCI, const LocalError leCO, - Local3DPoint& pos, Local3DVector& dir, +void VectorHitBuilderAlgorithm::fit2Dzx(const Local3DPoint lpCI, + const Local3DPoint lpCO, + const LocalError leCI, + const LocalError leCO, + Local3DPoint& pos, + Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) -{ + double& chi2) { std::vector<float> x = {lpCI.z(), lpCO.z()}; std::vector<float> y = {lpCI.x(), lpCO.x()}; float sqCI = sqrt(leCI.xx()); float sqCO = sqrt(leCO.xx()); std::vector<float> sigy = {sqCI, sqCO}; - fit(x,y,sigy,pos,dir,covMatrix,chi2); + fit(x, y, sigy, pos, dir, covMatrix, chi2); return; - } -void VectorHitBuilderAlgorithm::fit2Dzy(const Local3DPoint lpCI, const Local3DPoint lpCO, - const LocalError leCI, const LocalError leCO, - Local3DPoint& pos, Local3DVector& dir, +void VectorHitBuilderAlgorithm::fit2Dzy(const Local3DPoint lpCI, + const Local3DPoint lpCO, + const LocalError leCI, + const LocalError leCO, + Local3DPoint& pos, + Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) -{ + double& chi2) { std::vector<float> x = {lpCI.z(), lpCO.z()}; std::vector<float> y = {lpCI.y(), lpCO.y()}; float sqCI = sqrt(leCI.yy()); float sqCO = sqrt(leCO.yy()); std::vector<float> sigy = {sqCI, sqCO}; - fit(x,y,sigy,pos,dir,covMatrix,chi2); + fit(x, y, sigy, pos, dir, covMatrix, chi2); return; - } void VectorHitBuilderAlgorithm::fit(const std::vector<float>& x, const std::vector<float>& y, const std::vector<float>& sigy, - Local3DPoint& pos, Local3DVector& dir, + Local3DPoint& pos, + Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) -{ - - if(x.size() != y.size() || x.size() != sigy.size()){ + double& chi2) { + if (x.size() != y.size() || x.size() != sigy.size()) { edm::LogError("VectorHitBuilderAlgorithm") << "Different size for x,z !! No fit possible."; return; } - float slope = 0.; + float slope = 0.; float intercept = 0.; - float covss = 0.; - float covii = 0.; - float covsi = 0.; + float covss = 0.; + float covii = 0.; + float covsi = 0.; - theFitter->fit(x,y,x.size(),sigy,slope,intercept,covss,covii,covsi); + theFitter->fit(x, y, x.size(), sigy, slope, intercept, covss, covii, covsi); - covMatrix[0][0] = covss; // this is var(dy/dz) - covMatrix[1][1] = covii; // this is var(y) - covMatrix[1][0] = covsi; // this is cov(dy/dz,y) + covMatrix[0][0] = covss; // this is var(dy/dz) + covMatrix[1][1] = covii; // this is var(y) + covMatrix[1][0] = covsi; // this is cov(dy/dz,y) - for (unsigned int j=0; j < x.size(); j++){ - const double ypred = intercept + slope*x[j]; - const double dy = (y[j] - ypred)/sigy[j]; - chi2 += dy*dy; - } + for (unsigned int j = 0; j < x.size(); j++) { + const double ypred = intercept + slope * x[j]; + const double dy = (y[j] - ypred) / sigy[j]; + chi2 += dy * dy; + } - pos = Local3DPoint(intercept,0.,0.); - if(x.size()==2){ + pos = Local3DPoint(intercept, 0., 0.); + if (x.size() == 2) { //difference in z is the difference of the lowermost and the uppermost cluster z pos float slopeZ = x.at(1) - x.at(0); - dir = LocalVector(slope,0.,slopeZ); + dir = LocalVector(slope, 0., slopeZ); } else { - dir = LocalVector(slope,0.,-1.); + dir = LocalVector(slope, 0., -1.); } - } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 864be497f603d..80e027ed13c69 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -7,22 +7,20 @@ #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" -VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::ParameterSet& conf) : - nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), - barrelCut(conf.getParameter< std::vector< double > >("BarrelCut")), - endcapCut(conf.getParameter< std::vector< double > >("EndcapCut")), - cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) -{} - -void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) -{ +VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::ParameterSet& conf) + : nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), + barrelCut(conf.getParameter<std::vector<double> >("BarrelCut")), + endcapCut(conf.getParameter<std::vector<double> >("EndcapCut")), + cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) {} + +void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) { // get the geometry and topology - edm::ESHandle< TrackerGeometry > geomHandle; - es.get< TrackerDigiGeometryRecord >().get( geomHandle ); + edm::ESHandle<TrackerGeometry> geomHandle; + es.get<TrackerDigiGeometryRecord>().get(geomHandle); initTkGeom(geomHandle); - edm::ESHandle< TrackerTopology > tTopoHandle; - es.get< TrackerTopologyRcd >().get(tTopoHandle); + edm::ESHandle<TrackerTopology> tTopoHandle; + es.get<TrackerTopologyRcd>().get(tTopoHandle); initTkTopo(tTopoHandle); // load the cpe via the eventsetup @@ -31,27 +29,29 @@ void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) initCpe(cpeHandle.product()); } -void VectorHitBuilderAlgorithmBase::initTkGeom(edm::ESHandle< TrackerGeometry > tkGeomHandle){ +void VectorHitBuilderAlgorithmBase::initTkGeom(edm::ESHandle<TrackerGeometry> tkGeomHandle) { theTkGeom = tkGeomHandle.product(); } -void VectorHitBuilderAlgorithmBase::initTkTopo(edm::ESHandle< TrackerTopology > tkTopoHandle){ +void VectorHitBuilderAlgorithmBase::initTkTopo(edm::ESHandle<TrackerTopology> tkTopoHandle) { theTkTopo = tkTopoHandle.product(); } -void VectorHitBuilderAlgorithmBase::initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd){ +void VectorHitBuilderAlgorithmBase::initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) { cpe = cpeProd; } -double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit*& geomDetUnit_low, const Point3DBase<float, LocalTag>& lPosClu_low, - const PixelGeomDetUnit*& geomDetUnit_upp, const Point3DBase<float, LocalTag>& lPosClu_upp){ +double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit*& geomDetUnit_low, + const Point3DBase<float, LocalTag>& lPosClu_low, + const PixelGeomDetUnit*& geomDetUnit_upp, + const Point3DBase<float, LocalTag>& lPosClu_upp) { double parallCorr = 0.0; - Global3DPoint origin(0,0,0); + Global3DPoint origin(0, 0, 0); Global3DPoint gPosClu_low = geomDetUnit_low->surface().toGlobal(lPosClu_low); GlobalVector gV = gPosClu_low - origin; LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV; LocalVector lV = geomDetUnit_low->surface().toLocal(gV); LogTrace("VectorHitsBuilderValidation") << " local vector passing to the origin (in low sor):" << lV; - LocalVector lV_norm = lV/lV.z(); + LocalVector lV_norm = lV / lV.z(); LogTrace("VectorHitsBuilderValidation") << " normalized local vector passing to the origin (in low sor):" << lV_norm; Global3DPoint gPosClu_upp = geomDetUnit_upp->surface().toGlobal(lPosClu_upp); @@ -61,54 +61,53 @@ double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomD return parallCorr; } -void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters){ - +void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) { int nCluster = 0; int numberOfDSV = 0; edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator DSViter; - for( DSViter = clusters.begin() ; DSViter != clusters.end(); DSViter++){ - + for (DSViter = clusters.begin(); DSViter != clusters.end(); DSViter++) { ++numberOfDSV; // Loop over the clusters in the detector unit - for (edmNew::DetSet< Phase2TrackerCluster1D >::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); ++clustIt) { - + for (edmNew::DetSet<Phase2TrackerCluster1D>::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); + ++clustIt) { nCluster++; // get the detector unit's id const GeomDetUnit* geomDetUnit(theTkGeom->idToDetUnit(DSViter->detId())); - if (!geomDetUnit) return; + if (!geomDetUnit) + return; printCluster(geomDetUnit, clustIt); - } } LogDebug("VectorHitBuilder") << " Number of input clusters: " << nCluster << std::endl; - } - -void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* clustIt){ - - if (!geomDetUnit) return; - const PixelGeomDetUnit* pixelGeomDetUnit = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit); +void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* clustIt) { + if (!geomDetUnit) + return; + const PixelGeomDetUnit* pixelGeomDetUnit = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); const PixelTopology& topol = pixelGeomDetUnit->specificTopology(); - if (!pixelGeomDetUnit) return; + if (!pixelGeomDetUnit) + return; unsigned int layer = theTkTopo->layer(geomDetUnit->geographicalId()); unsigned int module = theTkTopo->module(geomDetUnit->geographicalId()); - LogTrace("VectorHitBuilder") << "Layer:" << layer << " and DetId: " << geomDetUnit->geographicalId().rawId() << std::endl; + LogTrace("VectorHitBuilder") << "Layer:" << layer << " and DetId: " << geomDetUnit->geographicalId().rawId() + << std::endl; TrackerGeometry::ModuleType mType = theTkGeom->getDetectorType(geomDetUnit->geographicalId()); - if (mType == TrackerGeometry::ModuleType::Ph2PSP) + if (mType == TrackerGeometry::ModuleType::Ph2PSP) LogTrace("VectorHitBuilder") << "Pixel cluster (module:" << module << ") " << std::endl; - else if (mType == TrackerGeometry::ModuleType::Ph2SS || mType == TrackerGeometry::ModuleType::Ph2PSS) + else if (mType == TrackerGeometry::ModuleType::Ph2SS || mType == TrackerGeometry::ModuleType::Ph2PSS) LogTrace("VectorHitBuilder") << "Strip cluster (module:" << module << ") " << std::endl; - else LogTrace("VectorHitBuilder") << "no module?!" << std::endl; + else + LogTrace("VectorHitBuilder") << "no module?!" << std::endl; LogTrace("VectorHitBuilder") << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl; - LogTrace("VectorHitBuilder") << " and width:" << pixelGeomDetUnit->surface().bounds().width() << " , lenght:" << pixelGeomDetUnit->surface().bounds().length() << std::endl; - + LogTrace("VectorHitBuilder") << " and width:" << pixelGeomDetUnit->surface().bounds().width() + << " , lenght:" << pixelGeomDetUnit->surface().bounds().length() << std::endl; - auto && lparams = cpe->localParameters( *clustIt, *pixelGeomDetUnit ); + auto&& lparams = cpe->localParameters(*clustIt, *pixelGeomDetUnit); Global3DPoint gparams = pixelGeomDetUnit->surface().toGlobal(lparams.first); LogTrace("VectorHitBuilder") << "\t global pos " << gparams << std::endl; @@ -118,17 +117,16 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, con return; } -void VectorHitBuilderAlgorithmBase::loadDetSetVector( std::map< DetId,std::vector<VectorHit> >& theMap, edmNew::DetSetVector<VectorHit>& theCollection ) const{ - - std::map<DetId,std::vector<VectorHit> >::const_iterator it = theMap.begin(); - std::map<DetId,std::vector<VectorHit> >::const_iterator lastDet = theMap.end(); - for( ; it != lastDet ; ++it ) { +void VectorHitBuilderAlgorithmBase::loadDetSetVector(std::map<DetId, std::vector<VectorHit> >& theMap, + edmNew::DetSetVector<VectorHit>& theCollection) const { + std::map<DetId, std::vector<VectorHit> >::const_iterator it = theMap.begin(); + std::map<DetId, std::vector<VectorHit> >::const_iterator lastDet = theMap.end(); + for (; it != lastDet; ++it) { edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it->first); std::vector<VectorHit>::const_iterator vh_it = it->second.begin(); std::vector<VectorHit>::const_iterator vh_end = it->second.end(); - for( ; vh_it != vh_end ; ++vh_it) { + for (; vh_it != vh_end; ++vh_it) { vh_col.push_back(*vh_it); } } - } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc index 60e6f58bc9ff2..a47ae33526242 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc @@ -4,62 +4,60 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) - : offlinestubsTag( conf.getParameter<std::string>( "offlinestubs" ) ), - maxOfflinestubs(conf.getParameter<int>( "maxVectorHits" )), - algoTag(conf.getParameter<std::string>( "Algorithm" )), - //clusterProducer(conf.getParameter<edm::InputTag>("Clusters")), - readytobuild(false) -{ - - clusterProducer = consumes< edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("Clusters"))); - - produces< edmNew::DetSetVector< Phase2TrackerCluster1D > >( "ClustersAccepted" ); - produces< edmNew::DetSetVector< Phase2TrackerCluster1D > >( "ClustersRejected" ); - produces< VectorHitCollectionNew >( offlinestubsTag + "Accepted" ); - produces< VectorHitCollectionNew >( offlinestubsTag + "Rejected" ); + : offlinestubsTag(conf.getParameter<std::string>("offlinestubs")), + maxOfflinestubs(conf.getParameter<int>("maxVectorHits")), + algoTag(conf.getParameter<std::string>("Algorithm")), + //clusterProducer(conf.getParameter<edm::InputTag>("Clusters")), + readytobuild(false) { + clusterProducer = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >( + edm::InputTag(conf.getParameter<std::string>("Clusters"))); + + produces<edmNew::DetSetVector<Phase2TrackerCluster1D> >("ClustersAccepted"); + produces<edmNew::DetSetVector<Phase2TrackerCluster1D> >("ClustersRejected"); + produces<VectorHitCollectionNew>(offlinestubsTag + "Accepted"); + produces<VectorHitCollectionNew>(offlinestubsTag + "Rejected"); setupAlgorithm(conf); } -VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { - delete stubsBuilder; -} +VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder; } -void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) -{ +void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin"; // get input clusters data - edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clustersHandle; - event.getByToken( clusterProducer, clustersHandle); + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clustersHandle; + event.getByToken(clusterProducer, clustersHandle); // create the final output collection - std::unique_ptr< edmNew::DetSetVector< Phase2TrackerCluster1D > > outputClustersAccepted( new edmNew::DetSetVector< Phase2TrackerCluster1D > ); - std::unique_ptr< edmNew::DetSetVector< Phase2TrackerCluster1D > > outputClustersRejected( new edmNew::DetSetVector< Phase2TrackerCluster1D > ); - std::unique_ptr< VectorHitCollectionNew > outputVHAccepted( new VectorHitCollectionNew() ); - std::unique_ptr< VectorHitCollectionNew > outputVHRejected( new VectorHitCollectionNew() ); - - if(readytobuild) stubsBuilder->initialize(es); - else edm::LogError("VectorHitBuilderEDProducer") << "Impossible initialization of builder!!"; + std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D> > outputClustersAccepted( + new edmNew::DetSetVector<Phase2TrackerCluster1D>); + std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D> > outputClustersRejected( + new edmNew::DetSetVector<Phase2TrackerCluster1D>); + std::unique_ptr<VectorHitCollectionNew> outputVHAccepted(new VectorHitCollectionNew()); + std::unique_ptr<VectorHitCollectionNew> outputVHRejected(new VectorHitCollectionNew()); + + if (readytobuild) + stubsBuilder->initialize(es); + else + edm::LogError("VectorHitBuilderEDProducer") << "Impossible initialization of builder!!"; // check on the input clusters stubsBuilder->printClusters(*clustersHandle); // running the stub building algorithm //ERICA::output should be moved in the different algo classes? - run( clustersHandle, *outputClustersAccepted, *outputClustersRejected, *outputVHAccepted, *outputVHRejected); + run(clustersHandle, *outputClustersAccepted, *outputClustersRejected, *outputVHAccepted, *outputVHRejected); unsigned int numberOfVectorHits = 0; edmNew::DetSetVector<VectorHit>::const_iterator DSViter; - for( DSViter = (*outputVHAccepted).begin() ; DSViter != (*outputVHAccepted).end(); DSViter++){ - - edmNew::DetSet< VectorHit >::const_iterator vh; - for ( vh = DSViter->begin(); vh != DSViter->end(); ++vh) { + for (DSViter = (*outputVHAccepted).begin(); DSViter != (*outputVHAccepted).end(); DSViter++) { + edmNew::DetSet<VectorHit>::const_iterator vh; + for (vh = DSViter->begin(); vh != DSViter->end(); ++vh) { numberOfVectorHits++; LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << *vh << std::endl; } - } -/* + /* if(numberOfVectorHits > maxOfflinestubs) { edm::LogError("VectorHitBuilderEDProducer") << "Limit on the number of stubs exceeded. An empty output collection will be produced instead.\n"; VectorHitCollectionNew empty; @@ -67,40 +65,36 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu } */ // write output to file - event.put( std::move(outputClustersAccepted), "ClustersAccepted" ); - event.put( std::move(outputClustersRejected), "ClustersRejected" ); - event.put( std::move(outputVHAccepted), offlinestubsTag + "Accepted" ); - event.put( std::move(outputVHRejected), offlinestubsTag + "Rejected" ); - -// LogDebug("VectorHitBuilderEDProducer") << " Executing " << algoTag << " resulted in " << numberOfVectorHits << "."; - LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n" ; + event.put(std::move(outputClustersAccepted), "ClustersAccepted"); + event.put(std::move(outputClustersRejected), "ClustersRejected"); + event.put(std::move(outputVHAccepted), offlinestubsTag + "Accepted"); + event.put(std::move(outputVHRejected), offlinestubsTag + "Rejected"); + // LogDebug("VectorHitBuilderEDProducer") << " Executing " << algoTag << " resulted in " << numberOfVectorHits << "."; + LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n"; } void VectorHitBuilderEDProducer::setupAlgorithm(edm::ParameterSet const& conf) { - - if ( algoTag == "VectorHitBuilderAlgorithm" ) { + if (algoTag == "VectorHitBuilderAlgorithm") { stubsBuilder = new VectorHitBuilderAlgorithm(conf); readytobuild = true; } else { - edm::LogError("VectorHitBuilderEDProducer") << " Choice " << algoTag << " is invalid.\n" ; + edm::LogError("VectorHitBuilderEDProducer") << " Choice " << algoTag << " is invalid.\n"; readytobuild = false; } - } - -void VectorHitBuilderEDProducer::run(edm::Handle< edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, - VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej ){ - - if ( !readytobuild ) { - edm::LogError("VectorHitBuilderEDProducer") << " No stub builder algorithm was found - cannot run!" ; +void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, + VectorHitCollectionNew& outputAcc, + VectorHitCollectionNew& outputRej) { + if (!readytobuild) { + edm::LogError("VectorHitBuilderEDProducer") << " No stub builder algorithm was found - cannot run!"; return; } stubsBuilder->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); - } #include "FWCore/Utilities/interface/typelookup.h" diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc index 1730009db050a..3a31e39b56183 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc @@ -40,113 +40,110 @@ #include <THStack.h> #include <TTree.h> - - struct ClusterHistos { - THStack* numberClustersMixed; - TH1F* numberClusterPixel; - TH1F* numberClusterStrip; + THStack* numberClustersMixed; + TH1F* numberClusterPixel; + TH1F* numberClusterStrip; - THStack* clustersSizeMixed; - TH1F* clusterSizePixel; - TH1F* clusterSizeStrip; + THStack* clustersSizeMixed; + TH1F* clusterSizePixel; + TH1F* clusterSizeStrip; - TGraph* globalPosXY[3]; - TGraph* localPosXY[3]; + TGraph* globalPosXY[3]; + TGraph* localPosXY[3]; - TH1F* deltaXClusterSimHits[3]; - TH1F* deltaYClusterSimHits[3]; + TH1F* deltaXClusterSimHits[3]; + TH1F* deltaYClusterSimHits[3]; - TH1F* deltaXClusterSimHits_P[3]; - TH1F* deltaYClusterSimHits_P[3]; + TH1F* deltaXClusterSimHits_P[3]; + TH1F* deltaYClusterSimHits_P[3]; - TH1F* digiEfficiency[3]; + TH1F* digiEfficiency[3]; - TH1F* primarySimHits; - TH1F* otherSimHits; + TH1F* primarySimHits; + TH1F* otherSimHits; }; class Phase2TrackerClusterizerValidationTGraph : public edm::EDAnalyzer { - - public: - - typedef std::map< unsigned int, std::vector< PSimHit > > SimHitsMap; - typedef std::map< unsigned int, SimTrack > SimTracksMap; - - explicit Phase2TrackerClusterizerValidationTGraph(const edm::ParameterSet&); - ~Phase2TrackerClusterizerValidationTGraph(); - void beginJob(); - void endJob(); - void analyze(const edm::Event&, const edm::EventSetup&); - - private: - - std::map< unsigned int, ClusterHistos >::iterator createLayerHistograms(unsigned int); - unsigned int getLayerNumber(const DetId&, const TrackerTopology*); - unsigned int getModuleNumber(const DetId&, const TrackerTopology*); - unsigned int getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >&, const DetId&, unsigned int); - - edm::EDGetTokenT< edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; - edm::EDGetTokenT< edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; - edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken_; - edm::EDGetTokenT< edm::SimTrackContainer> simTracksToken_; - edm::EDGetTokenT< edm::SimVertexContainer > simVerticesToken_; - const TrackerGeometry* tkGeom; - const TrackerTopology* tkTopo; - - TTree* tree; - TGraph* trackerLayout_[3]; - TGraph* trackerLayoutXY_[3]; - TGraph* trackerLayoutXYBar_; - TGraph* trackerLayoutXYEC_; - - std::map< unsigned int, ClusterHistos > histograms_; - +public: + typedef std::map<unsigned int, std::vector<PSimHit> > SimHitsMap; + typedef std::map<unsigned int, SimTrack> SimTracksMap; + + explicit Phase2TrackerClusterizerValidationTGraph(const edm::ParameterSet&); + ~Phase2TrackerClusterizerValidationTGraph(); + void beginJob(); + void endJob(); + void analyze(const edm::Event&, const edm::EventSetup&); + +private: + std::map<unsigned int, ClusterHistos>::iterator createLayerHistograms(unsigned int); + unsigned int getLayerNumber(const DetId&, const TrackerTopology*); + unsigned int getModuleNumber(const DetId&, const TrackerTopology*); + unsigned int getSimTrackId(const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >&, const DetId&, unsigned int); + + edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; + edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; + edm::EDGetTokenT<edm::PSimHitContainer> simHitsToken_; + edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; + edm::EDGetTokenT<edm::SimVertexContainer> simVerticesToken_; + const TrackerGeometry* tkGeom; + const TrackerTopology* tkTopo; + + TTree* tree; + TGraph* trackerLayout_[3]; + TGraph* trackerLayoutXY_[3]; + TGraph* trackerLayoutXYBar_; + TGraph* trackerLayoutXYEC_; + + std::map<unsigned int, ClusterHistos> histograms_; }; Phase2TrackerClusterizerValidationTGraph::Phase2TrackerClusterizerValidationTGraph(const edm::ParameterSet& conf) { - srcClu_ = consumes< edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); + srcClu_ = + consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); siphase2OTSimLinksToken_ = consumes<edm::DetSetVector<PixelDigiSimLink> >(conf.getParameter<edm::InputTag>("links")); - simHitsToken_ = consumes< edm::PSimHitContainer >(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); - simTracksToken_ = consumes< edm::SimTrackContainer >(edm::InputTag("g4SimHits")); - simVerticesToken_ = consumes< edm::SimVertexContainer >(edm::InputTag("g4SimHits")); + simHitsToken_ = consumes<edm::PSimHitContainer>(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); + simTracksToken_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits")); + simVerticesToken_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits")); } - Phase2TrackerClusterizerValidationTGraph::~Phase2TrackerClusterizerValidationTGraph() { } - - void Phase2TrackerClusterizerValidationTGraph::beginJob() { - edm::Service<TFileService> fs; - fs->file().cd("/"); - TFileDirectory td = fs->mkdir("Common"); - //Create common ntuple - tree = td.make< TTree >("Phase2TrackerClusters","Phase2TrackerClusters"); - // Create common histograms - trackerLayout_[0] = td.make< TGraph >();//"RVsZ_Mixed", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); - trackerLayout_[0] -> SetName("RVsZ_Mixed"); - trackerLayout_[1] = td.make< TGraph >();//"RVsZ_Pixel", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); - trackerLayout_[1] -> SetName("RVsZ_Pixel"); - trackerLayout_[2] = td.make< TGraph >();//"RVsZ_Strip", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); - trackerLayout_[2] -> SetName("RVsZ_Strip"); - trackerLayoutXY_[0] = td.make< TGraph >();//"XVsY_Mixed", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); - trackerLayoutXY_[0] -> SetName("YVsX_Mixed"); - trackerLayoutXY_[1] = td.make< TGraph >();//"XVsY_Pixel", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); - trackerLayoutXY_[1] -> SetName("YVsX_Pixel"); - trackerLayoutXY_[2] = td.make< TGraph >();//"XVsY_Strip", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); - trackerLayoutXY_[2] -> SetName("YVsX_Strip"); - trackerLayoutXYBar_ = td.make< TGraph >();//"XVsYBar", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); - trackerLayoutXYBar_ -> SetName("YVsXBar"); - trackerLayoutXYEC_ = td.make< TGraph >();//"XVsYEC", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); - trackerLayoutXYEC_ -> SetName("YVsXEC"); - } +Phase2TrackerClusterizerValidationTGraph::~Phase2TrackerClusterizerValidationTGraph() {} + +void Phase2TrackerClusterizerValidationTGraph::beginJob() { + edm::Service<TFileService> fs; + fs->file().cd("/"); + TFileDirectory td = fs->mkdir("Common"); + //Create common ntuple + tree = td.make<TTree>("Phase2TrackerClusters", "Phase2TrackerClusters"); + // Create common histograms + trackerLayout_[0] = td.make<TGraph>(); //"RVsZ_Mixed", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[0]->SetName("RVsZ_Mixed"); + trackerLayout_[1] = td.make<TGraph>(); //"RVsZ_Pixel", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[1]->SetName("RVsZ_Pixel"); + trackerLayout_[2] = td.make<TGraph>(); //"RVsZ_Strip", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[2]->SetName("RVsZ_Strip"); + trackerLayoutXY_[0] = + td.make<TGraph>(); //"XVsY_Mixed", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXY_[0]->SetName("YVsX_Mixed"); + trackerLayoutXY_[1] = + td.make<TGraph>(); //"XVsY_Pixel", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXY_[1]->SetName("YVsX_Pixel"); + trackerLayoutXY_[2] = + td.make<TGraph>(); //"XVsY_Strip", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXY_[2]->SetName("YVsX_Strip"); + trackerLayoutXYBar_ = td.make<TGraph>(); //"XVsYBar", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXYBar_->SetName("YVsXBar"); + trackerLayoutXYEC_ = td.make<TGraph>(); //"XVsYEC", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXYEC_->SetName("YVsXEC"); +} void Phase2TrackerClusterizerValidationTGraph::endJob() {} void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, const edm::EventSetup& eventSetup) { - - // Get the needed objects + // Get the needed objects // Get the clusters - edm::Handle< Phase2TrackerCluster1DCollectionNew > clusters; + edm::Handle<Phase2TrackerCluster1DCollectionNew> clusters; event.getByToken(srcClu_, clusters); // Get the Phase2 DigiSimLink @@ -154,179 +151,181 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, event.getByToken(siphase2OTSimLinksToken_, siphase2SimLinks); // Get the SimHits - edm::Handle< edm::PSimHitContainer > simHitsRaw; + edm::Handle<edm::PSimHitContainer> simHitsRaw; event.getByToken(simHitsToken_, simHitsRaw); -// edm::Handle< edm::PSimHitContainer > simHitsRawEndcap; -// event.getByLabel("g4SimHits", "TrackerHitsPixelEndcapLowTof", simHitsRawEndcap); + // edm::Handle< edm::PSimHitContainer > simHitsRawEndcap; + // event.getByLabel("g4SimHits", "TrackerHitsPixelEndcapLowTof", simHitsRawEndcap); // Get the SimTracks - edm::Handle< edm::SimTrackContainer > simTracksRaw; + edm::Handle<edm::SimTrackContainer> simTracksRaw; event.getByToken(simTracksToken_, simTracksRaw); // Get the SimVertex - edm::Handle< edm::SimVertexContainer > simVertices; + edm::Handle<edm::SimVertexContainer> simVertices; event.getByToken(simVerticesToken_, simVertices); // Get the geometry - edm::ESHandle< TrackerGeometry > geomHandle; - eventSetup.get< TrackerDigiGeometryRecord >().get(geomHandle); + edm::ESHandle<TrackerGeometry> geomHandle; + eventSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); tkGeom = &(*geomHandle); - edm::ESHandle< TrackerTopology > tTopoHandle; - eventSetup.get< TrackerTopologyRcd >().get(tTopoHandle); + edm::ESHandle<TrackerTopology> tTopoHandle; + eventSetup.get<TrackerTopologyRcd>().get(tTopoHandle); tkTopo = tTopoHandle.product(); - //set up for tree - int layer_number; - //int track_id; - int module_id; - int module_number; - int module_type; //1: pixel, 2: strip - float x_global, y_global, z_global; - float x_local, y_local, z_local; - - tree -> Branch("layer_number",&layer_number,"layer_number/I"); - //tree -> Branch("track_id",&track_id,"track_id/I"); - tree -> Branch("module_id",&module_id,"module_id/I"); - tree -> Branch("module_type",&module_type,"module_type/I"); - tree -> Branch("module_number",&module_number,"module_number/I"); - tree -> Branch("x_global",&x_global,"x_global/F"); - tree -> Branch("y_global",&y_global,"y_global/F"); - tree -> Branch("z_global",&z_global,"z_global/F"); - tree -> Branch("x_local",&x_local,"x_local/F"); - tree -> Branch("y_local",&y_local,"y_local/F"); - tree -> Branch("z_local",&z_local,"z_local/F"); - - // Rearrange the simTracks for ease of use <simTrackID, simTrack> - SimTracksMap simTracks; - for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end(); ++simTrackIt) simTracks.insert(std::pair< unsigned int, SimTrack >(simTrackIt->trackId(), *simTrackIt)); - - // Rearrange the simHits by detUnit - - - // Rearrange the simHits for ease of use - SimHitsMap simHitsDetUnit; - SimHitsMap simHitsTrackId; - for (edm::PSimHitContainer::const_iterator simHitIt(simHitsRaw->begin()); simHitIt != simHitsRaw->end(); ++simHitIt) { - SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt->detUnitId())); - if (simHitsDetUnitIt == simHitsDetUnit.end()) { - std::pair< SimHitsMap::iterator, bool > newIt(simHitsDetUnit.insert(std::pair< unsigned int, std::vector< PSimHit > >(simHitIt->detUnitId(), std::vector< PSimHit >()))); - simHitsDetUnitIt = newIt.first; - } - simHitsDetUnitIt->second.push_back(*simHitIt); - SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt->trackId())); - if (simHitsTrackIdIt == simHitsTrackId.end()) { - std::pair< SimHitsMap::iterator, bool > newIt(simHitsTrackId.insert(std::pair< unsigned int, std::vector< PSimHit > >(simHitIt->trackId(), std::vector< PSimHit >()))); - simHitsTrackIdIt = newIt.first; - } - simHitsTrackIdIt->second.push_back(*simHitIt); + //set up for tree + int layer_number; + //int track_id; + int module_id; + int module_number; + int module_type; //1: pixel, 2: strip + float x_global, y_global, z_global; + float x_local, y_local, z_local; + + tree->Branch("layer_number", &layer_number, "layer_number/I"); + //tree -> Branch("track_id",&track_id,"track_id/I"); + tree->Branch("module_id", &module_id, "module_id/I"); + tree->Branch("module_type", &module_type, "module_type/I"); + tree->Branch("module_number", &module_number, "module_number/I"); + tree->Branch("x_global", &x_global, "x_global/F"); + tree->Branch("y_global", &y_global, "y_global/F"); + tree->Branch("z_global", &z_global, "z_global/F"); + tree->Branch("x_local", &x_local, "x_local/F"); + tree->Branch("y_local", &y_local, "y_local/F"); + tree->Branch("z_local", &z_local, "z_local/F"); + + // Rearrange the simTracks for ease of use <simTrackID, simTrack> + SimTracksMap simTracks; + for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end(); + ++simTrackIt) + simTracks.insert(std::pair<unsigned int, SimTrack>(simTrackIt->trackId(), *simTrackIt)); + + // Rearrange the simHits by detUnit + + // Rearrange the simHits for ease of use + SimHitsMap simHitsDetUnit; + SimHitsMap simHitsTrackId; + for (edm::PSimHitContainer::const_iterator simHitIt(simHitsRaw->begin()); simHitIt != simHitsRaw->end(); ++simHitIt) { + SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt->detUnitId())); + if (simHitsDetUnitIt == simHitsDetUnit.end()) { + std::pair<SimHitsMap::iterator, bool> newIt(simHitsDetUnit.insert( + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt->detUnitId(), std::vector<PSimHit>()))); + simHitsDetUnitIt = newIt.first; } + simHitsDetUnitIt->second.push_back(*simHitIt); + SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt->trackId())); + if (simHitsTrackIdIt == simHitsTrackId.end()) { + std::pair<SimHitsMap::iterator, bool> newIt(simHitsTrackId.insert( + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt->trackId(), std::vector<PSimHit>()))); + simHitsTrackIdIt = newIt.first; + } + simHitsTrackIdIt->second.push_back(*simHitIt); + } + // ValidationTGraph + unsigned int nClustersTot(0), nClustersPixelTot(0), nClustersStripTot(0); + + // Loop over modules + for (Phase2TrackerCluster1DCollectionNew::const_iterator DSViter = clusters->begin(); DSViter != clusters->end(); + ++DSViter) { + // Get the detector unit's id + unsigned int rawid(DSViter->detId()); + module_id = rawid; + DetId detId(rawid); + + layer_number = getLayerNumber(detId, tkTopo); + module_number = getModuleNumber(detId, tkTopo); + unsigned int layer(getLayerNumber(detId, tkTopo)); + + // Get the geometry of the tracker + const GeomDetUnit* geomDetUnit(tkGeom->idToDetUnit(detId)); + const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); + const PixelTopology& topol = theGeomDet->specificTopology(); + + if (!geomDetUnit) + break; + + // Create histograms for the layer if they do not yet exist + std::map<unsigned int, ClusterHistos>::iterator histogramLayer(histograms_.find(layer)); + if (histogramLayer == histograms_.end()) + histogramLayer = createLayerHistograms(layer); + + // Number of clusters + unsigned int nClustersPixel(0), nClustersStrip(0); + + // Loop over the clusters in the detector unit + for (edmNew::DetSet<Phase2TrackerCluster1D>::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); + ++clustIt) { + // Cluster related variables + MeasurementPoint mpClu(clustIt->center(), clustIt->column() + 0.5); + Local3DPoint localPosClu = geomDetUnit->topology().localPosition(mpClu); + x_local = localPosClu.x(); + y_local = localPosClu.y(); + z_local = localPosClu.z(); + std::cout << localPosClu << std::endl; + + Global3DPoint globalPosClu = geomDetUnit->surface().toGlobal(localPosClu); + x_global = globalPosClu.x(); + y_global = globalPosClu.y(); + z_global = globalPosClu.z(); + //std::cout << globalPosClu << std::endl; + + // Fill the position histograms + trackerLayout_[0]->SetPoint(nClustersTot, globalPosClu.z(), globalPosClu.perp()); + trackerLayoutXY_[0]->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); + + if (layer < 100) + trackerLayoutXYBar_->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); + else + trackerLayoutXYEC_->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); + + histogramLayer->second.localPosXY[0]->SetPoint(nClustersTot, localPosClu.x(), localPosClu.y()); + histogramLayer->second.globalPosXY[0]->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); + + // Pixel module + if (topol.ncolumns() == 32) { + module_type = 1; + trackerLayout_[1]->SetPoint(nClustersPixelTot, globalPosClu.z(), globalPosClu.perp()); + trackerLayoutXY_[1]->SetPoint(nClustersPixelTot, globalPosClu.x(), globalPosClu.y()); + + histogramLayer->second.localPosXY[1]->SetPoint(nClustersPixelTot, localPosClu.x(), localPosClu.y()); + histogramLayer->second.globalPosXY[1]->SetPoint(nClustersPixelTot, globalPosClu.x(), globalPosClu.y()); + histogramLayer->second.clusterSizePixel->Fill(clustIt->size()); + ++nClustersPixel; + ++nClustersPixelTot; + } + // Strip module + else if (topol.ncolumns() == 2) { + module_type = 2; + trackerLayout_[2]->SetPoint(nClustersStripTot, globalPosClu.z(), globalPosClu.perp()); + trackerLayoutXY_[2]->SetPoint(nClustersStripTot, globalPosClu.x(), globalPosClu.y()); + + histogramLayer->second.localPosXY[2]->SetPoint(nClustersStripTot, localPosClu.x(), localPosClu.y()); + histogramLayer->second.globalPosXY[2]->SetPoint(nClustersStripTot, globalPosClu.x(), globalPosClu.y()); + histogramLayer->second.clusterSizeStrip->Fill(clustIt->size()); + ++nClustersStrip; + ++nClustersStripTot; + } + // * Digis related variables + + std::vector<unsigned int> clusterSimTrackIds; + + // Get all the simTracks that form the cluster + for (unsigned int i(0); i < clustIt->size(); ++i) { + unsigned int channel(PixelDigi::pixelToChannel( + clustIt->firstRow() + i, + clustIt + ->column())); // Here we have to use the old pixelToChannel function (not Phase2TrackerDigi but PixelDigi), change this when using new Digis + unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detId, channel)); + clusterSimTrackIds.push_back(simTrackId); + std::cout << channel << std::endl; + std::cout << simTrackId << std::endl; + std::cout << std::endl; + } + unsigned int InnerChannel = clustIt->firstDigi().channel(); + std::cout << InnerChannel << std::endl; - // ValidationTGraph - unsigned int nClustersTot(0), nClustersPixelTot(0), nClustersStripTot(0); - - // Loop over modules - for (Phase2TrackerCluster1DCollectionNew::const_iterator DSViter = clusters->begin(); DSViter != clusters->end(); ++DSViter) { - - // Get the detector unit's id - unsigned int rawid(DSViter->detId()); - module_id = rawid; - DetId detId(rawid); - - layer_number = getLayerNumber(detId, tkTopo); - module_number = getModuleNumber(detId, tkTopo); - unsigned int layer(getLayerNumber(detId, tkTopo)); - - - // Get the geometry of the tracker - const GeomDetUnit* geomDetUnit(tkGeom->idToDetUnit(detId)); - const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit); - const PixelTopology& topol = theGeomDet->specificTopology(); - - if (!geomDetUnit) break; - - // Create histograms for the layer if they do not yet exist - std::map< unsigned int, ClusterHistos >::iterator histogramLayer(histograms_.find(layer)); - if (histogramLayer == histograms_.end()) histogramLayer = createLayerHistograms(layer); - - // Number of clusters - unsigned int nClustersPixel(0), nClustersStrip(0); - - // Loop over the clusters in the detector unit - for (edmNew::DetSet< Phase2TrackerCluster1D >::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); ++clustIt) { - - - // Cluster related variables - MeasurementPoint mpClu(clustIt->center(), clustIt->column() + 0.5); - Local3DPoint localPosClu = geomDetUnit->topology().localPosition(mpClu); - x_local = localPosClu.x(); - y_local = localPosClu.y(); - z_local = localPosClu.z(); - std::cout << localPosClu << std::endl; - - Global3DPoint globalPosClu = geomDetUnit->surface().toGlobal(localPosClu); - x_global = globalPosClu.x(); - y_global = globalPosClu.y(); - z_global = globalPosClu.z(); - //std::cout << globalPosClu << std::endl; - - // Fill the position histograms - trackerLayout_[0]->SetPoint(nClustersTot, globalPosClu.z(), globalPosClu.perp()); - trackerLayoutXY_[0]->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); - - if (layer < 100) trackerLayoutXYBar_->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); - else trackerLayoutXYEC_->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); - - histogramLayer->second.localPosXY[0]->SetPoint(nClustersTot, localPosClu.x(), localPosClu.y()); - histogramLayer->second.globalPosXY[0]->SetPoint(nClustersTot, globalPosClu.x(), globalPosClu.y()); - - // Pixel module - if (topol.ncolumns() == 32) { - module_type = 1; - trackerLayout_[1]->SetPoint(nClustersPixelTot, globalPosClu.z(), globalPosClu.perp()); - trackerLayoutXY_[1]->SetPoint(nClustersPixelTot, globalPosClu.x(), globalPosClu.y()); - - histogramLayer->second.localPosXY[1]->SetPoint(nClustersPixelTot, localPosClu.x(), localPosClu.y()); - histogramLayer->second.globalPosXY[1]->SetPoint(nClustersPixelTot, globalPosClu.x(), globalPosClu.y()); - histogramLayer->second.clusterSizePixel->Fill(clustIt->size()); - ++nClustersPixel; - ++nClustersPixelTot; - } - // Strip module - else if (topol.ncolumns() == 2) { - module_type = 2; - trackerLayout_[2]->SetPoint(nClustersStripTot, globalPosClu.z(), globalPosClu.perp()); - trackerLayoutXY_[2]->SetPoint(nClustersStripTot, globalPosClu.x(), globalPosClu.y()); - - histogramLayer->second.localPosXY[2]->SetPoint(nClustersStripTot, localPosClu.x(), localPosClu.y()); - histogramLayer->second.globalPosXY[2]->SetPoint(nClustersStripTot, globalPosClu.x(), globalPosClu.y()); - histogramLayer->second.clusterSizeStrip->Fill(clustIt->size()); - ++nClustersStrip; - ++nClustersStripTot; - } - - - - // * Digis related variables - - - std::vector< unsigned int > clusterSimTrackIds; - - // Get all the simTracks that form the cluster - for (unsigned int i(0); i < clustIt->size(); ++i) { - unsigned int channel(PixelDigi::pixelToChannel(clustIt->firstRow() + i, clustIt->column())); // Here we have to use the old pixelToChannel function (not Phase2TrackerDigi but PixelDigi), change this when using new Digis - unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detId, channel)); - clusterSimTrackIds.push_back(simTrackId); - std::cout << channel << std::endl; - std::cout << simTrackId << std::endl; - std::cout << std::endl; - } - unsigned int InnerChannel = clustIt->firstDigi().channel(); - std::cout << InnerChannel << std::endl; - - -/* + /* // SimHits related variables @@ -384,201 +383,243 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, histogramLayer->second.primarySimHits->Fill(primarySimHits); histogramLayer->second.otherSimHits->Fill(otherSimHits); */ - } - - if (nClustersPixel) histogramLayer->second.numberClusterPixel->Fill(nClustersPixel); - if (nClustersStrip) histogramLayer->second.numberClusterStrip->Fill(nClustersStrip); - nClustersTot++; - tree->Fill(); - } + } + if (nClustersPixel) + histogramLayer->second.numberClusterPixel->Fill(nClustersPixel); + if (nClustersStrip) + histogramLayer->second.numberClusterStrip->Fill(nClustersStrip); + nClustersTot++; + tree->Fill(); + } } // Create the histograms -std::map< unsigned int, ClusterHistos >::iterator Phase2TrackerClusterizerValidationTGraph::createLayerHistograms(unsigned int ival) { - std::ostringstream fname1, fname2; - - edm::Service<TFileService> fs; - fs->file().cd("/"); - - std::string tag; - unsigned int id; - if (ival < 100) { - id = ival; - fname1 << "Barrel"; - fname2 << "Layer_" << id; - tag = "_layer_"; - } - else { - int side = ival / 100; - id = ival - side * 100; - fname1 << "EndCap_Side_" << side; - fname2 << "Disc_" << id; - tag = "_disc_"; - } +std::map<unsigned int, ClusterHistos>::iterator Phase2TrackerClusterizerValidationTGraph::createLayerHistograms( + unsigned int ival) { + std::ostringstream fname1, fname2; + + edm::Service<TFileService> fs; + fs->file().cd("/"); + + std::string tag; + unsigned int id; + if (ival < 100) { + id = ival; + fname1 << "Barrel"; + fname2 << "Layer_" << id; + tag = "_layer_"; + } else { + int side = ival / 100; + id = ival - side * 100; + fname1 << "EndCap_Side_" << side; + fname2 << "Disc_" << id; + tag = "_disc_"; + } - TFileDirectory td1 = fs->mkdir(fname1.str().c_str()); - TFileDirectory td = td1.mkdir(fname2.str().c_str()); + TFileDirectory td1 = fs->mkdir(fname1.str().c_str()); + TFileDirectory td = td1.mkdir(fname2.str().c_str()); - ClusterHistos local_histos; + ClusterHistos local_histos; - std::ostringstream histoName; + std::ostringstream histoName; - /* + /* * Number of clusters */ - histoName.str(""); histoName << "Number_Clusters_Pixel" << tag.c_str() << id; - local_histos.numberClusterPixel = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); - local_histos.numberClusterPixel->SetFillColor(kAzure + 7); + histoName.str(""); + histoName << "Number_Clusters_Pixel" << tag.c_str() << id; + local_histos.numberClusterPixel = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberClusterPixel->SetFillColor(kAzure + 7); - histoName.str(""); histoName << "Number_Clusters_Strip" << tag.c_str() << id; - local_histos.numberClusterStrip = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); - local_histos.numberClusterStrip->SetFillColor(kOrange - 3); + histoName.str(""); + histoName << "Number_Clusters_Strip" << tag.c_str() << id; + local_histos.numberClusterStrip = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberClusterStrip->SetFillColor(kOrange - 3); - histoName.str(""); histoName << "Number_Clusters_Mixed" << tag.c_str() << id; - local_histos.numberClustersMixed = td.make< THStack >(histoName.str().c_str(), histoName.str().c_str()); - local_histos.numberClustersMixed->Add(local_histos.numberClusterPixel); - local_histos.numberClustersMixed->Add(local_histos.numberClusterStrip); + histoName.str(""); + histoName << "Number_Clusters_Mixed" << tag.c_str() << id; + local_histos.numberClustersMixed = td.make<THStack>(histoName.str().c_str(), histoName.str().c_str()); + local_histos.numberClustersMixed->Add(local_histos.numberClusterPixel); + local_histos.numberClustersMixed->Add(local_histos.numberClusterStrip); - /* + /* * Cluster size */ - histoName.str(""); histoName << "Cluster_Size_Pixel" << tag.c_str() << id; - local_histos.clusterSizePixel = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - local_histos.clusterSizePixel->SetFillColor(kAzure + 7); + histoName.str(""); + histoName << "Cluster_Size_Pixel" << tag.c_str() << id; + local_histos.clusterSizePixel = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + local_histos.clusterSizePixel->SetFillColor(kAzure + 7); - histoName.str(""); histoName << "Cluster_Size_Strip" << tag.c_str() << id; - local_histos.clusterSizeStrip = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - local_histos.clusterSizeStrip->SetFillColor(kOrange - 3); + histoName.str(""); + histoName << "Cluster_Size_Strip" << tag.c_str() << id; + local_histos.clusterSizeStrip = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + local_histos.clusterSizeStrip->SetFillColor(kOrange - 3); - histoName.str(""); histoName << "Cluster_Size_Mixed" << tag.c_str() << id; - local_histos.clustersSizeMixed = td.make< THStack >(histoName.str().c_str(), histoName.str().c_str()); - local_histos.clustersSizeMixed->Add(local_histos.clusterSizePixel); - local_histos.clustersSizeMixed->Add(local_histos.clusterSizeStrip); + histoName.str(""); + histoName << "Cluster_Size_Mixed" << tag.c_str() << id; + local_histos.clustersSizeMixed = td.make<THStack>(histoName.str().c_str(), histoName.str().c_str()); + local_histos.clustersSizeMixed->Add(local_histos.clusterSizePixel); + local_histos.clustersSizeMixed->Add(local_histos.clusterSizeStrip); - /* + /* * Local and Global positions */ - histoName.str(""); histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; - local_histos.localPosXY[0] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); - local_histos.localPosXY[0]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Local_Position_XY_Pixel" << tag.c_str() << id; - local_histos.localPosXY[1] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); - local_histos.localPosXY[1]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Local_Position_XY_Strip" << tag.c_str() << id; - local_histos.localPosXY[2] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); - local_histos.localPosXY[2]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; - local_histos.globalPosXY[0] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); - local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Global_Position_XY_Pixel" << tag.c_str() << id; - local_histos.globalPosXY[1] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); - local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Global_Position_XY_Strip" << tag.c_str() << id; - local_histos.globalPosXY[2] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); - local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); - - /* + histoName.str(""); + histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; + local_histos.localPosXY[0] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Local_Position_XY_Pixel" << tag.c_str() << id; + local_histos.localPosXY[1] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Local_Position_XY_Strip" << tag.c_str() << id; + local_histos.localPosXY[2] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[2]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; + local_histos.globalPosXY[0] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_Pixel" << tag.c_str() << id; + local_histos.globalPosXY[1] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_Strip" << tag.c_str() << id; + local_histos.globalPosXY[2] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); + + /* * Delta positions with SimHits */ - histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Mixed" << tag.c_str() << id; - local_histos.deltaXClusterSimHits[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_Cluster_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaXClusterSimHits[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Pixel" << tag.c_str() << id; - local_histos.deltaXClusterSimHits[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_Cluster_SimHits_Pixel" << tag.c_str() << id; + local_histos.deltaXClusterSimHits[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Strip" << tag.c_str() << id; - local_histos.deltaXClusterSimHits[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_Cluster_SimHits_Strip" << tag.c_str() << id; + local_histos.deltaXClusterSimHits[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Mixed" << tag.c_str() << id; - local_histos.deltaYClusterSimHits[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_Cluster_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaYClusterSimHits[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Pixel" << tag.c_str() << id; - local_histos.deltaYClusterSimHits[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_Cluster_SimHits_Pixel" << tag.c_str() << id; + local_histos.deltaYClusterSimHits[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Strip" << tag.c_str() << id; - local_histos.deltaYClusterSimHits[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_Cluster_SimHits_Strip" << tag.c_str() << id; + local_histos.deltaYClusterSimHits[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - /* + /* * Delta position with simHits for primary tracks only */ - histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Mixed_P" << tag.c_str() << id; - local_histos.deltaXClusterSimHits_P[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_Cluster_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaXClusterSimHits_P[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Pixel_P" << tag.c_str() << id; - local_histos.deltaXClusterSimHits_P[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_Cluster_SimHits_Pixel_P" << tag.c_str() << id; + local_histos.deltaXClusterSimHits_P[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_X_Cluster_SimHits_Strip_P" << tag.c_str() << id; - local_histos.deltaXClusterSimHits_P[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_Cluster_SimHits_Strip_P" << tag.c_str() << id; + local_histos.deltaXClusterSimHits_P[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Mixed_P" << tag.c_str() << id; - local_histos.deltaYClusterSimHits_P[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_Cluster_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaYClusterSimHits_P[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Pixel_P" << tag.c_str() << id; - local_histos.deltaYClusterSimHits_P[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_Cluster_SimHits_Pixel_P" << tag.c_str() << id; + local_histos.deltaYClusterSimHits_P[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_Cluster_SimHits_Strip_P" << tag.c_str() << id; - local_histos.deltaYClusterSimHits_P[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_Cluster_SimHits_Strip_P" << tag.c_str() << id; + local_histos.deltaYClusterSimHits_P[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - /* + /* * Information on the Digis per cluster */ - histoName.str(""); histoName << "Primary_Digis" << tag.c_str() << id; - local_histos.primarySimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + histoName.str(""); + histoName << "Primary_Digis" << tag.c_str() << id; + local_histos.primarySimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - histoName.str(""); histoName << "Other_Digis" << tag.c_str() << id; - local_histos.otherSimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + histoName.str(""); + histoName << "Other_Digis" << tag.c_str() << id; + local_histos.otherSimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - /* + /* * End */ - std::pair< std::map< unsigned int, ClusterHistos >::iterator, bool > insertedIt(histograms_.insert(std::make_pair(ival, local_histos))); - fs->file().cd("/"); + std::pair<std::map<unsigned int, ClusterHistos>::iterator, bool> insertedIt( + histograms_.insert(std::make_pair(ival, local_histos))); + fs->file().cd("/"); - return insertedIt.first; + return insertedIt.first; } unsigned int Phase2TrackerClusterizerValidationTGraph::getLayerNumber(const DetId& detid, const TrackerTopology* topo) { - if (detid.det() == DetId::Tracker) { - if (detid.subdetId() == PixelSubdetector::PixelBarrel) return (topo->pxbLayer(detid)); - else if (detid.subdetId() == PixelSubdetector::PixelEndcap) return (100 * topo->pxfSide(detid) + topo->pxfDisk(detid)); - else return 999; - } - return 999; + if (detid.det() == DetId::Tracker) { + if (detid.subdetId() == PixelSubdetector::PixelBarrel) + return (topo->pxbLayer(detid)); + else if (detid.subdetId() == PixelSubdetector::PixelEndcap) + return (100 * topo->pxfSide(detid) + topo->pxfDisk(detid)); + else + return 999; + } + return 999; } -unsigned int Phase2TrackerClusterizerValidationTGraph::getModuleNumber(const DetId& detid, const TrackerTopology* topo) { +unsigned int Phase2TrackerClusterizerValidationTGraph::getModuleNumber(const DetId& detid, + const TrackerTopology* topo) { if (detid.det() == DetId::Tracker) { - if (detid.subdetId() == PixelSubdetector::PixelBarrel) { - return ( topo->pxbModule(detid) ); - } - else if (detid.subdetId() == PixelSubdetector::PixelEndcap) { - return ( topo->pxfModule(detid) ); - } - else return 999; + if (detid.subdetId() == PixelSubdetector::PixelBarrel) { + return (topo->pxbModule(detid)); + } else if (detid.subdetId() == PixelSubdetector::PixelEndcap) { + return (topo->pxfModule(detid)); + } else + return 999; } return 999; } -unsigned int Phase2TrackerClusterizerValidationTGraph::getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& siphase2SimLinks, const DetId& detId, unsigned int channel) { - edm::DetSetVector< PixelDigiSimLink >::const_iterator DSViter(siphase2SimLinks->find(detId)); - if (DSViter == siphase2SimLinks->end()) return 0; - for (edm::DetSet< PixelDigiSimLink >::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { - if (channel == it->channel()) return it->SimTrackId(); - } +unsigned int Phase2TrackerClusterizerValidationTGraph::getSimTrackId( + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& siphase2SimLinks, + const DetId& detId, + unsigned int channel) { + edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter(siphase2SimLinks->find(detId)); + if (DSViter == siphase2SimLinks->end()) return 0; + for (edm::DetSet<PixelDigiSimLink>::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { + if (channel == it->channel()) + return it->SimTrackId(); + } + return 0; } DEFINE_FWK_MODULE(Phase2TrackerClusterizerValidationTGraph); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 10992b5d94984..6c45bd53236e0 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -8,63 +8,62 @@ #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" -VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet& conf) : - cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) -{ - srcClu_ = consumes< edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); - VHacc_ = consumes< VectorHitCollectionNew >(edm::InputTag(conf.getParameter<edm::InputTag>("VH_acc"))); - VHrej_ = consumes< VectorHitCollectionNew >(edm::InputTag(conf.getParameter<edm::InputTag>("VH_rej"))); +VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet& conf) + : cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { + srcClu_ = + consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); + VHacc_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_acc"))); + VHrej_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_rej"))); siphase2OTSimLinksToken_ = consumes<edm::DetSetVector<PixelDigiSimLink> >(conf.getParameter<edm::InputTag>("links")); - simHitsToken_ = consumes< edm::PSimHitContainer >(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); - simTracksToken_ = consumes< edm::SimTrackContainer >(edm::InputTag("g4SimHits")); - simVerticesToken_ = consumes< edm::SimVertexContainer >(edm::InputTag("g4SimHits")); - trackingParticleToken_ = consumes< TrackingParticleCollection >(conf.getParameter<edm::InputTag>("trackingParticleSrc")); + simHitsToken_ = consumes<edm::PSimHitContainer>(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); + simTracksToken_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits")); + simVerticesToken_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits")); + trackingParticleToken_ = + consumes<TrackingParticleCollection>(conf.getParameter<edm::InputTag>("trackingParticleSrc")); } -VectorHitsBuilderValidation::~VectorHitsBuilderValidation() { -} +VectorHitsBuilderValidation::~VectorHitsBuilderValidation() {} void VectorHitsBuilderValidation::beginJob() { - edm::Service<TFileService> fs; fs->file().cd("/"); TFileDirectory td = fs->mkdir("Common"); //Create common ntuple - tree = td.make< TTree >("VectorHits","VectorHits"); + tree = td.make<TTree>("VectorHits", "VectorHits"); // Create common graphs TFileDirectory tdGloPos = td.mkdir("GlobalPositions"); - trackerLayoutRZ_[0] = tdGloPos.make< TGraph >(); - trackerLayoutRZ_[0] -> SetName("RVsZ_Mixed"); - trackerLayoutRZ_[1] = tdGloPos.make< TGraph >(); - trackerLayoutRZ_[1] -> SetName("RVsZ_Pixel"); - trackerLayoutRZ_[2] = tdGloPos.make< TGraph >(); - trackerLayoutRZ_[2] -> SetName("RVsZ_Strip"); - trackerLayoutXY_[0] = tdGloPos.make< TGraph >(); - trackerLayoutXY_[0] -> SetName("YVsX_Mixed"); - trackerLayoutXY_[1] = tdGloPos.make< TGraph >(); - trackerLayoutXY_[1] -> SetName("YVsX_Pixel"); - trackerLayoutXY_[2] = tdGloPos.make< TGraph >(); - trackerLayoutXY_[2] -> SetName("YVsX_Strip"); - trackerLayoutXYBar_ = tdGloPos.make< TGraph >(); - trackerLayoutXYBar_ -> SetName("YVsXBar"); - trackerLayoutXYEC_ = tdGloPos.make< TGraph >(); - trackerLayoutXYEC_ -> SetName("YVsXEC"); + trackerLayoutRZ_[0] = tdGloPos.make<TGraph>(); + trackerLayoutRZ_[0]->SetName("RVsZ_Mixed"); + trackerLayoutRZ_[1] = tdGloPos.make<TGraph>(); + trackerLayoutRZ_[1]->SetName("RVsZ_Pixel"); + trackerLayoutRZ_[2] = tdGloPos.make<TGraph>(); + trackerLayoutRZ_[2]->SetName("RVsZ_Strip"); + trackerLayoutXY_[0] = tdGloPos.make<TGraph>(); + trackerLayoutXY_[0]->SetName("YVsX_Mixed"); + trackerLayoutXY_[1] = tdGloPos.make<TGraph>(); + trackerLayoutXY_[1]->SetName("YVsX_Pixel"); + trackerLayoutXY_[2] = tdGloPos.make<TGraph>(); + trackerLayoutXY_[2]->SetName("YVsX_Strip"); + trackerLayoutXYBar_ = tdGloPos.make<TGraph>(); + trackerLayoutXYBar_->SetName("YVsXBar"); + trackerLayoutXYEC_ = tdGloPos.make<TGraph>(); + trackerLayoutXYEC_->SetName("YVsXEC"); TFileDirectory tdLocPos = td.mkdir("LocalPositions"); - localPosXvsDeltaX_[0] = tdLocPos.make< TGraph >(); - localPosXvsDeltaX_[0] -> SetName("localPosXvsDeltaX_Mixed"); - localPosXvsDeltaX_[1] = tdLocPos.make< TGraph >(); - localPosXvsDeltaX_[1] -> SetName("localPosXvsDeltaX_Pixel"); - localPosXvsDeltaX_[2] = tdLocPos.make< TGraph >(); - localPosXvsDeltaX_[2] -> SetName("localPosXvsDeltaX_Strip"); - localPosYvsDeltaY_[0] = tdLocPos.make< TGraph >(); - localPosYvsDeltaY_[0] -> SetName("localPosYvsDeltaY_Mixed"); - localPosYvsDeltaY_[1] = tdLocPos.make< TGraph >(); - localPosYvsDeltaY_[1] -> SetName("localPosYvsDeltaY_Pixel"); - localPosYvsDeltaY_[2] = tdLocPos.make< TGraph >(); - localPosYvsDeltaY_[2] -> SetName("localPosYvsDeltaY_Strip"); + localPosXvsDeltaX_[0] = tdLocPos.make<TGraph>(); + localPosXvsDeltaX_[0]->SetName("localPosXvsDeltaX_Mixed"); + localPosXvsDeltaX_[1] = tdLocPos.make<TGraph>(); + localPosXvsDeltaX_[1]->SetName("localPosXvsDeltaX_Pixel"); + localPosXvsDeltaX_[2] = tdLocPos.make<TGraph>(); + localPosXvsDeltaX_[2]->SetName("localPosXvsDeltaX_Strip"); + localPosYvsDeltaY_[0] = tdLocPos.make<TGraph>(); + localPosYvsDeltaY_[0]->SetName("localPosYvsDeltaY_Mixed"); + localPosYvsDeltaY_[1] = tdLocPos.make<TGraph>(); + localPosYvsDeltaY_[1]->SetName("localPosYvsDeltaY_Pixel"); + localPosYvsDeltaY_[2] = tdLocPos.make<TGraph>(); + localPosYvsDeltaY_[2]->SetName("localPosYvsDeltaY_Strip"); //drawing VHs arrows TFileDirectory tdArr = td.mkdir("Directions"); @@ -74,44 +73,42 @@ void VectorHitsBuilderValidation::beginJob() { //VHXY_[2] = tdArr.make< TCanvas >(); VHXY_[2] -> SetName("YVsX_Strip"); TFileDirectory tdWid = td.mkdir("CombinatorialStudies"); - ParallaxCorrectionRZ_ = tdWid.make< TH2D >("ParallaxCorrectionRZ","ParallaxCorrectionRZ", 100, 0., 300., 100., 0., 120.); - ParallaxCorrectionRZ_ -> SetName("ParallaxCorrectionFactor"); - VHaccLayer_ = tdWid.make< TH1F >("VHacceptedLayer","VHacceptedLayer", 250, 0., 250.); - VHaccLayer_ -> SetName("VHaccepted"); - VHrejLayer_ = tdWid.make< TH1F >("VHrejectedLayer","VHrejectedLayer", 250, 0., 250.); - VHrejLayer_ -> SetName("VHrejected"); - VHaccTrueLayer_ = tdWid.make< TH1F >("VHaccTrueLayer","VHaccTrueLayer", 250, 0., 250.); - VHaccTrueLayer_ -> SetName("VHaccepted_true"); - VHrejTrueLayer_ = tdWid.make< TH1F >("VHrejTrueLayer","VHrejTrueLayer", 250, 0., 250.); - VHrejTrueLayer_ -> SetName("VHrejected_true"); - VHaccTrue_signal_Layer_ = tdWid.make< TH1F >("VHaccTrueSignalLayer","VHaccTrueSignalLayer", 250, 0., 250.); - VHaccTrue_signal_Layer_ -> SetName("VHaccepted_true_signal"); - VHrejTrue_signal_Layer_ = tdWid.make< TH1F >("VHrejTrueSignalLayer","VHrejTrueSignalLayer", 250, 0., 250.); - VHrejTrue_signal_Layer_ -> SetName("VHrejected_true_signal"); - - VHaccTrueLayer_ratio = tdWid.make< TH1F >("VHaccTrueLayer_ratio","VHaccTrueLayer_ratio", 250, 0., 250.); - VHaccTrueLayer_ratio -> SetName("VHaccepted_true_ratio"); - VHrejTrueLayer_ratio = tdWid.make< TH1F >("VHrejTrueLayer_ratio","VHrejTrueLayer_ratio", 250, 0., 250.); - VHrejTrueLayer_ratio -> SetName("VHrejected_true_ratio"); - - + ParallaxCorrectionRZ_ = + tdWid.make<TH2D>("ParallaxCorrectionRZ", "ParallaxCorrectionRZ", 100, 0., 300., 100., 0., 120.); + ParallaxCorrectionRZ_->SetName("ParallaxCorrectionFactor"); + VHaccLayer_ = tdWid.make<TH1F>("VHacceptedLayer", "VHacceptedLayer", 250, 0., 250.); + VHaccLayer_->SetName("VHaccepted"); + VHrejLayer_ = tdWid.make<TH1F>("VHrejectedLayer", "VHrejectedLayer", 250, 0., 250.); + VHrejLayer_->SetName("VHrejected"); + VHaccTrueLayer_ = tdWid.make<TH1F>("VHaccTrueLayer", "VHaccTrueLayer", 250, 0., 250.); + VHaccTrueLayer_->SetName("VHaccepted_true"); + VHrejTrueLayer_ = tdWid.make<TH1F>("VHrejTrueLayer", "VHrejTrueLayer", 250, 0., 250.); + VHrejTrueLayer_->SetName("VHrejected_true"); + VHaccTrue_signal_Layer_ = tdWid.make<TH1F>("VHaccTrueSignalLayer", "VHaccTrueSignalLayer", 250, 0., 250.); + VHaccTrue_signal_Layer_->SetName("VHaccepted_true_signal"); + VHrejTrue_signal_Layer_ = tdWid.make<TH1F>("VHrejTrueSignalLayer", "VHrejTrueSignalLayer", 250, 0., 250.); + VHrejTrue_signal_Layer_->SetName("VHrejected_true_signal"); + + VHaccTrueLayer_ratio = tdWid.make<TH1F>("VHaccTrueLayer_ratio", "VHaccTrueLayer_ratio", 250, 0., 250.); + VHaccTrueLayer_ratio->SetName("VHaccepted_true_ratio"); + VHrejTrueLayer_ratio = tdWid.make<TH1F>("VHrejTrueLayer_ratio", "VHrejTrueLayer_ratio", 250, 0., 250.); + VHrejTrueLayer_ratio->SetName("VHrejected_true_ratio"); } void VectorHitsBuilderValidation::endJob() {} void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::EventSetup& eventSetup) { - // Get the needed objects // Get the clusters - edm::Handle< Phase2TrackerCluster1DCollectionNew > clusters; + edm::Handle<Phase2TrackerCluster1DCollectionNew> clusters; event.getByToken(srcClu_, clusters); // Get the vector hits - edm::Handle< VectorHitCollectionNew > vhsAcc; + edm::Handle<VectorHitCollectionNew> vhsAcc; event.getByToken(VHacc_, vhsAcc); - edm::Handle< VectorHitCollectionNew > vhsRej; + edm::Handle<VectorHitCollectionNew> vhsRej; event.getByToken(VHrej_, vhsRej); // load the cpe via the eventsetup @@ -124,36 +121,36 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev event.getByToken(siphase2OTSimLinksToken_, siphase2SimLinks); // Get the SimHits - edm::Handle< edm::PSimHitContainer > simHitsRaw; + edm::Handle<edm::PSimHitContainer> simHitsRaw; event.getByToken(simHitsToken_, simHitsRaw); -// edm::Handle< edm::PSimHitContainer > simHitsRawEndcap; -// event.getByLabel("g4SimHits", "TrackerHitsPixelEndcapLowTof", simHitsRawEndcap); + // edm::Handle< edm::PSimHitContainer > simHitsRawEndcap; + // event.getByLabel("g4SimHits", "TrackerHitsPixelEndcapLowTof", simHitsRawEndcap); // Get the SimTracks - edm::Handle< edm::SimTrackContainer > simTracksRaw; + edm::Handle<edm::SimTrackContainer> simTracksRaw; event.getByToken(simTracksToken_, simTracksRaw); // Get the SimVertex - edm::Handle< edm::SimVertexContainer > simVertices; + edm::Handle<edm::SimVertexContainer> simVertices; event.getByToken(simVerticesToken_, simVertices); // Get the geometry - edm::ESHandle< TrackerGeometry > geomHandle; - eventSetup.get< TrackerDigiGeometryRecord >().get(geomHandle); + edm::ESHandle<TrackerGeometry> geomHandle; + eventSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); tkGeom = &(*geomHandle); // Get the Topology - edm::ESHandle< TrackerTopology > tTopoHandle; - eventSetup.get< TrackerTopologyRcd >().get(tTopoHandle); + edm::ESHandle<TrackerTopology> tTopoHandle; + eventSetup.get<TrackerTopologyRcd>().get(tTopoHandle); tkTopo = tTopoHandle.product(); - edm::ESHandle< MagneticField > magFieldHandle; - eventSetup.get< IdealMagneticFieldRecord >().get(magFieldHandle); + edm::ESHandle<MagneticField> magFieldHandle; + eventSetup.get<IdealMagneticFieldRecord>().get(magFieldHandle); magField = magFieldHandle.product(); //Tracking Particle collection - edm::Handle<TrackingParticleCollection> TPCollectionH; - event.getByToken(trackingParticleToken_,TPCollectionH); + edm::Handle<TrackingParticleCollection> TPCollectionH; + event.getByToken(trackingParticleToken_, TPCollectionH); auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH); std::map<std::pair<size_t, EncodedEventId>, TrackingParticleRef> mapping; @@ -161,10 +158,12 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev for (TrackingParticleCollection::size_type itp = 0; itp < TPCollectionH.product()->size(); ++itp) { TrackingParticleRef trackingParticle(TPCollectionH, itp); EncodedEventId eid(trackingParticle->eventId()); - for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin(); - itrk != trackingParticle->g4Track_end(); ++itrk) { + for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin(); + itrk != trackingParticle->g4Track_end(); + ++itrk) { std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid); - LogTrace("VectorHitsBuilderValidation") << "creating map for id: " << trkid.first << " with tp: " << trackingParticle.key() ; + LogTrace("VectorHitsBuilderValidation") + << "creating map for id: " << trkid.first << " with tp: " << trackingParticle.key(); mapping.insert(std::make_pair(trkid, trackingParticle)); } } @@ -174,7 +173,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev int layer; int module_id; int module_number; - int module_type; //1: pixel, 2: strip + int module_type; //1: pixel, 2: strip int VHacc = 0.0; int VHrej = 0.0; int vh_isTrue; @@ -201,62 +200,64 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev float width, deltaXlocal; unsigned int processType(99); - tree -> Branch("event",&eventNum,"eventNum/I"); - tree -> Branch("accepted",&VHacc,"VHacc/I"); - tree -> Branch("rejected",&VHrej,"VHrej/I"); - tree -> Branch("layer",&layer,"layer/I"); - tree -> Branch("module_id",&module_id,"module_id/I"); - tree -> Branch("module_type",&module_type,"module_type/I"); - tree -> Branch("module_number",&module_number,"module_number/I"); - tree -> Branch("vh_isTrue",&vh_isTrue,"vh_isTrue/I"); - tree -> Branch("x_global",&x_global,"x_global/F"); - tree -> Branch("y_global",&y_global,"y_global/F"); - tree -> Branch("z_global",&z_global,"z_global/F"); - tree -> Branch("vh_x_local",&vh_x_local,"vh_x_local/F"); - tree -> Branch("vh_y_local",&vh_y_local,"vh_y_local/F"); - tree -> Branch("vh_x_lError",&vh_x_le,"vh_x_le/F"); - tree -> Branch("vh_y_lError",&vh_y_le,"vh_y_le/F"); - tree -> Branch("curvature",&curvature,"curvature/F"); - tree -> Branch("chi2",&chi2,"chi2/F"); - tree -> Branch("phi",&phi,"phi/F"); - tree -> Branch("QOverP",&QOverP,"QOverP/F"); - tree -> Branch("QOverPT",&QOverPT,"QOverPT/F"); - tree -> Branch("low_tp_id",&low_tp_id,"low_tp_id/I"); - tree -> Branch("upp_tp_id",&upp_tp_id,"upp_tp_id/I"); - tree -> Branch("vh_sim_trackPt",&vh_sim_trackPt,"vh_sim_trackPt/F"); - tree -> Branch("sim_x_local",&sim_x_local,"sim_x_local/F"); - tree -> Branch("sim_y_local",&sim_y_local,"sim_y_local/F"); - tree -> Branch("sim_x_global",&sim_x_global,"sim_x_global/F"); - tree -> Branch("sim_y_global",&sim_y_global,"sim_y_global/F"); - tree -> Branch("sim_z_global",&sim_z_global,"sim_z_global/F"); - tree -> Branch("low_x_global",&low_x_global,"low_x_global/F"); - tree -> Branch("low_y_global",&low_y_global,"low_y_global/F"); - tree -> Branch("low_z_global",&low_z_global,"low_z_global/F"); - tree -> Branch("low_xx_global_err",&low_xx_global_err,"low_xx_global_err/F"); - tree -> Branch("low_yy_global_err",&low_yy_global_err,"low_yy_global_err/F"); - tree -> Branch("low_zz_global_err",&low_zz_global_err,"low_zz_global_err/F"); - tree -> Branch("low_xy_global_err",&low_xy_global_err,"low_xy_global_err/F"); - tree -> Branch("low_zx_global_err",&low_zx_global_err,"low_zx_global_err/F"); - tree -> Branch("low_zy_global_err",&low_zy_global_err,"low_zy_global_err/F"); - tree -> Branch("upp_x_global",&upp_x_global,"upp_x_global/F"); - tree -> Branch("upp_y_global",&upp_y_global,"upp_y_global/F"); - tree -> Branch("upp_z_global",&upp_z_global,"upp_z_global/F"); - tree -> Branch("upp_xx_global_err",&upp_xx_global_err,"upp_xx_global_err/F"); - tree -> Branch("upp_yy_global_err",&upp_yy_global_err,"upp_yy_global_err/F"); - tree -> Branch("upp_zz_global_err",&upp_zz_global_err,"upp_zz_global_err/F"); - tree -> Branch("upp_xy_global_err",&upp_xy_global_err,"upp_xy_global_err/F"); - tree -> Branch("upp_zx_global_err",&upp_zx_global_err,"upp_zx_global_err/F"); - tree -> Branch("upp_zy_global_err",&upp_zy_global_err,"upp_zy_global_err/F"); - tree -> Branch("deltaXVHSimHits",&deltaXVHSimHits,"deltaXVHSimHits/F"); - tree -> Branch("deltaYVHSimHits",&deltaYVHSimHits,"deltaYVHSimHits/F"); - tree -> Branch("multiplicity",&multiplicity,"multiplicity/I"); - tree -> Branch("width",&width,"width/F"); - tree -> Branch("deltaXlocal",&deltaXlocal,"deltaXlocal/F"); - tree -> Branch("processType",&processType,"processType/i"); + tree->Branch("event", &eventNum, "eventNum/I"); + tree->Branch("accepted", &VHacc, "VHacc/I"); + tree->Branch("rejected", &VHrej, "VHrej/I"); + tree->Branch("layer", &layer, "layer/I"); + tree->Branch("module_id", &module_id, "module_id/I"); + tree->Branch("module_type", &module_type, "module_type/I"); + tree->Branch("module_number", &module_number, "module_number/I"); + tree->Branch("vh_isTrue", &vh_isTrue, "vh_isTrue/I"); + tree->Branch("x_global", &x_global, "x_global/F"); + tree->Branch("y_global", &y_global, "y_global/F"); + tree->Branch("z_global", &z_global, "z_global/F"); + tree->Branch("vh_x_local", &vh_x_local, "vh_x_local/F"); + tree->Branch("vh_y_local", &vh_y_local, "vh_y_local/F"); + tree->Branch("vh_x_lError", &vh_x_le, "vh_x_le/F"); + tree->Branch("vh_y_lError", &vh_y_le, "vh_y_le/F"); + tree->Branch("curvature", &curvature, "curvature/F"); + tree->Branch("chi2", &chi2, "chi2/F"); + tree->Branch("phi", &phi, "phi/F"); + tree->Branch("QOverP", &QOverP, "QOverP/F"); + tree->Branch("QOverPT", &QOverPT, "QOverPT/F"); + tree->Branch("low_tp_id", &low_tp_id, "low_tp_id/I"); + tree->Branch("upp_tp_id", &upp_tp_id, "upp_tp_id/I"); + tree->Branch("vh_sim_trackPt", &vh_sim_trackPt, "vh_sim_trackPt/F"); + tree->Branch("sim_x_local", &sim_x_local, "sim_x_local/F"); + tree->Branch("sim_y_local", &sim_y_local, "sim_y_local/F"); + tree->Branch("sim_x_global", &sim_x_global, "sim_x_global/F"); + tree->Branch("sim_y_global", &sim_y_global, "sim_y_global/F"); + tree->Branch("sim_z_global", &sim_z_global, "sim_z_global/F"); + tree->Branch("low_x_global", &low_x_global, "low_x_global/F"); + tree->Branch("low_y_global", &low_y_global, "low_y_global/F"); + tree->Branch("low_z_global", &low_z_global, "low_z_global/F"); + tree->Branch("low_xx_global_err", &low_xx_global_err, "low_xx_global_err/F"); + tree->Branch("low_yy_global_err", &low_yy_global_err, "low_yy_global_err/F"); + tree->Branch("low_zz_global_err", &low_zz_global_err, "low_zz_global_err/F"); + tree->Branch("low_xy_global_err", &low_xy_global_err, "low_xy_global_err/F"); + tree->Branch("low_zx_global_err", &low_zx_global_err, "low_zx_global_err/F"); + tree->Branch("low_zy_global_err", &low_zy_global_err, "low_zy_global_err/F"); + tree->Branch("upp_x_global", &upp_x_global, "upp_x_global/F"); + tree->Branch("upp_y_global", &upp_y_global, "upp_y_global/F"); + tree->Branch("upp_z_global", &upp_z_global, "upp_z_global/F"); + tree->Branch("upp_xx_global_err", &upp_xx_global_err, "upp_xx_global_err/F"); + tree->Branch("upp_yy_global_err", &upp_yy_global_err, "upp_yy_global_err/F"); + tree->Branch("upp_zz_global_err", &upp_zz_global_err, "upp_zz_global_err/F"); + tree->Branch("upp_xy_global_err", &upp_xy_global_err, "upp_xy_global_err/F"); + tree->Branch("upp_zx_global_err", &upp_zx_global_err, "upp_zx_global_err/F"); + tree->Branch("upp_zy_global_err", &upp_zy_global_err, "upp_zy_global_err/F"); + tree->Branch("deltaXVHSimHits", &deltaXVHSimHits, "deltaXVHSimHits/F"); + tree->Branch("deltaYVHSimHits", &deltaYVHSimHits, "deltaYVHSimHits/F"); + tree->Branch("multiplicity", &multiplicity, "multiplicity/I"); + tree->Branch("width", &width, "width/F"); + tree->Branch("deltaXlocal", &deltaXlocal, "deltaXlocal/F"); + tree->Branch("processType", &processType, "processType/i"); // Rearrange the simTracks for ease of use <simTrackID, simTrack> SimTracksMap simTracks; - for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end(); ++simTrackIt) simTracks.insert(std::pair< unsigned int, SimTrack >(simTrackIt->trackId(), *simTrackIt)); + for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end(); + ++simTrackIt) + simTracks.insert(std::pair<unsigned int, SimTrack>(simTrackIt->trackId(), *simTrackIt)); // Rearrange the simHits by detUnit for ease of use SimHitsMap simHitsDetUnit; @@ -264,38 +265,43 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev for (edm::PSimHitContainer::const_iterator simHitIt(simHitsRaw->begin()); simHitIt != simHitsRaw->end(); ++simHitIt) { SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt->detUnitId())); if (simHitsDetUnitIt == simHitsDetUnit.end()) { - std::pair< SimHitsMap::iterator, bool > newIt(simHitsDetUnit.insert(std::pair< unsigned int, std::vector< PSimHit > >(simHitIt->detUnitId(), std::vector< PSimHit >()))); - simHitsDetUnitIt = newIt.first; + std::pair<SimHitsMap::iterator, bool> newIt(simHitsDetUnit.insert( + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt->detUnitId(), std::vector<PSimHit>()))); + simHitsDetUnitIt = newIt.first; } simHitsDetUnitIt->second.push_back(*simHitIt); SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt->trackId())); if (simHitsTrackIdIt == simHitsTrackId.end()) { - std::pair< SimHitsMap::iterator, bool > newIt(simHitsTrackId.insert(std::pair< unsigned int, std::vector< PSimHit > >(simHitIt->trackId(), std::vector< PSimHit >()))); - simHitsTrackIdIt = newIt.first; + std::pair<SimHitsMap::iterator, bool> newIt(simHitsTrackId.insert( + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt->trackId(), std::vector<PSimHit>()))); + simHitsTrackIdIt = newIt.first; } simHitsTrackIdIt->second.push_back(*simHitIt); } //Printout outer tracker clusters in the event - for (Phase2TrackerCluster1DCollectionNew::const_iterator DSViter = clusters->begin(); DSViter != clusters->end(); ++DSViter) { - unsigned int rawid(DSViter->detId()); DetId detId(rawid); + for (Phase2TrackerCluster1DCollectionNew::const_iterator DSViter = clusters->begin(); DSViter != clusters->end(); + ++DSViter) { + unsigned int rawid(DSViter->detId()); + DetId detId(rawid); const GeomDetUnit* geomDetUnit(tkGeom->idToDetUnit(detId)); - const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit); - for (edmNew::DetSet< Phase2TrackerCluster1D >::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); ++clustIt) { - auto && lparams = cpe->localParameters( *clustIt, *theGeomDet ); + const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); + for (edmNew::DetSet<Phase2TrackerCluster1D>::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); + ++clustIt) { + auto&& lparams = cpe->localParameters(*clustIt, *theGeomDet); Global3DPoint gparams = theGeomDet->surface().toGlobal(lparams.first); LogTrace("VectorHitsBuilderValidation") << "phase2 OT clusters: " << gparams << " DetId: " << rawid; } } for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { - for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { LogTrace("VectorHitsBuilderValidation") << "accepted VH: " << *vhIt; } } for (VectorHitCollectionNew::const_iterator DSViter = vhsRej->begin(); DSViter != vhsRej->end(); ++DSViter) { - for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { LogTrace("VectorHitsBuilderValidation") << "rejected VH: " << *vhIt; } } @@ -309,7 +315,6 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev // Loop over modules for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { - // Get the detector unit's id unsigned int rawid(DSViter->detId()); module_id = rawid; @@ -322,24 +327,23 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev // Get the geometry of the tracker const GeomDet* geomDet(tkGeom->idToDet(detId)); - if (!geomDet) break; + if (!geomDet) + break; // Create histograms for the layer if they do not yet exist - std::map< unsigned int, VHHistos >::iterator histogramLayer(histograms_.find(layer)); - if (histogramLayer == histograms_.end()) histogramLayer = createLayerHistograms(layer); + std::map<unsigned int, VHHistos>::iterator histogramLayer(histograms_.find(layer)); + if (histogramLayer == histograms_.end()) + histogramLayer = createLayerHistograms(layer); // Number of clusters unsigned int nVHsPS(0), nVHs2S(0); LogDebug("VectorHitsBuilderValidation") << "DSViter size: " << DSViter->size(); - // Loop over the vhs in the detector unit - for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { - + for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { // vh variables - if( vhIt->isValid() ){ - - LogDebug("VectorHitsBuilderValidation") << " vh analyzing ..." ; + if (vhIt->isValid()) { + LogDebug("VectorHitsBuilderValidation") << " vh analyzing ..."; chi2 = vhIt->chi2(); LogTrace("VectorHitsBuilderValidation") << "VH chi2 " << chi2 << std::endl; @@ -372,8 +376,10 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev trackerLayoutRZ_[0]->SetPoint(nVHsTot, globalPosVH.z(), globalPosVH.perp()); trackerLayoutXY_[0]->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); - if (layer < 100) trackerLayoutXYBar_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); - else trackerLayoutXYEC_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + if (layer < 100) + trackerLayoutXYBar_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + else + trackerLayoutXYEC_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); histogramLayer->second.localPosXY[0]->SetPoint(nVHsTot, vh_x_local, vh_y_local); histogramLayer->second.globalPosXY[0]->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); @@ -383,11 +389,10 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev // Pixel module const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); - const PixelGeomDetUnit* geomDetLower = dynamic_cast< const PixelGeomDetUnit* >(stackDet->lowerDet()); + const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); DetId lowerDetId = stackDet->lowerDet()->geographicalId(); DetId upperDetId = stackDet->upperDet()->geographicalId(); - TrackerGeometry::ModuleType mType = tkGeom->getDetectorType(lowerDetId); module_type = 0; if (mType == TrackerGeometry::ModuleType::Ph2PSP) { @@ -447,17 +452,18 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev upp_zy_global_err = vhIt->upperGlobalPosErr().czy(); LogDebug("VectorHitsBuilderValidation") << "print Clusters into the VH:" << std::endl; - printCluster(geomDetLower,vhIt->lowerClusterRef()); + printCluster(geomDetLower, vhIt->lowerClusterRef()); LogTrace("VectorHitsBuilderValidation") << "\t global pos lower " << vhIt->lowerGlobalPos() << std::endl; - LogTrace("VectorHitsBuilderValidation") << "\t global posErr lower " << vhIt->lowerGlobalPosErr().cxx() << std::endl; + LogTrace("VectorHitsBuilderValidation") + << "\t global posErr lower " << vhIt->lowerGlobalPosErr().cxx() << std::endl; const GeomDetUnit* geomDetUpper = stackDet->upperDet(); - printCluster(geomDetUpper,vhIt->upperClusterRef()); + printCluster(geomDetUpper, vhIt->upperClusterRef()); LogTrace("VectorHitsBuilderValidation") << "\t global pos upper " << vhIt->upperGlobalPos() << std::endl; //comparison with SIM hits LogDebug("VectorHitsBuilderValidation") << "comparison Clusters with sim hits ... " << std::endl; - std::vector< unsigned int > clusterSimTrackIds; - std::vector< unsigned int > clusterSimTrackIdsUpp; + std::vector<unsigned int> clusterSimTrackIds; + std::vector<unsigned int> clusterSimTrackIdsUpp; std::set<std::pair<uint32_t, EncodedEventId> > simTkIds; const GeomDetUnit* geomDetUnit_low(tkGeom->idToDetUnit(lowerDetId)); LogTrace("VectorHitsBuilderValidation") << " lowerDetID : " << lowerDetId.rawId(); @@ -465,67 +471,77 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev LogTrace("VectorHitsBuilderValidation") << " upperDetID : " << upperDetId.rawId(); for (unsigned int istr(0); istr < (*(vhIt->lowerClusterRef().cluster_phase2OT())).size(); ++istr) { - uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vhIt->lowerClusterRef().cluster_phase2OT())).firstRow() + istr, (*(vhIt->lowerClusterRef().cluster_phase2OT())).column()); + uint32_t channel = + Phase2TrackerDigi::pixelToChannel((*(vhIt->lowerClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vhIt->lowerClusterRef().cluster_phase2OT())).column()); unsigned int LowerSimTrackId(getSimTrackId(siphase2SimLinks, lowerDetId, channel)); - std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, lowerDetId, channel)); - if (trkid.size()==0) continue; + std::vector<std::pair<uint32_t, EncodedEventId> > trkid( + getSimTrackIds(siphase2SimLinks, lowerDetId, channel)); + if (trkid.size() == 0) + continue; clusterSimTrackIds.push_back(LowerSimTrackId); - simTkIds.insert(trkid.begin(),trkid.end()); + simTkIds.insert(trkid.begin(), trkid.end()); LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << LowerSimTrackId << std::endl; } // In the case of PU, we need the TPs to find the proper SimTrackID - for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin(); - iset != simTkIds.end(); iset++) { - auto ipos = mapping.find(*iset); - if (ipos != mapping.end()) { - LogTrace("VectorHitsBuilderValidation") << "lower cluster in detid: " << lowerDetId.rawId() << " from tp: " << ipos->second.key() << " " << iset->first; - LogTrace("VectorHitsBuilderValidation") << "with pt(): " << (*ipos->second).pt(); + for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin(); + iset != simTkIds.end(); + iset++) { + auto ipos = mapping.find(*iset); + if (ipos != mapping.end()) { + LogTrace("VectorHitsBuilderValidation") << "lower cluster in detid: " << lowerDetId.rawId() + << " from tp: " << ipos->second.key() << " " << iset->first; + LogTrace("VectorHitsBuilderValidation") << "with pt(): " << (*ipos->second).pt(); low_tp_id = ipos->second.key(); vh_sim_trackPt = (*ipos->second).pt(); - } + } } - + simTkIds.clear(); for (unsigned int istr(0); istr < (*(vhIt->upperClusterRef().cluster_phase2OT())).size(); ++istr) { - uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vhIt->upperClusterRef().cluster_phase2OT())).firstRow() + istr, (*(vhIt->upperClusterRef().cluster_phase2OT())).column()); + uint32_t channel = + Phase2TrackerDigi::pixelToChannel((*(vhIt->upperClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vhIt->upperClusterRef().cluster_phase2OT())).column()); unsigned int UpperSimTrackId(getSimTrackId(siphase2SimLinks, upperDetId, channel)); - std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, upperDetId, channel)); - if (trkid.size()==0) continue; + std::vector<std::pair<uint32_t, EncodedEventId> > trkid( + getSimTrackIds(siphase2SimLinks, upperDetId, channel)); + if (trkid.size() == 0) + continue; clusterSimTrackIdsUpp.push_back(UpperSimTrackId); - simTkIds.insert(trkid.begin(),trkid.end()); + simTkIds.insert(trkid.begin(), trkid.end()); LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << UpperSimTrackId << std::endl; } // In the case of PU, we need the TPs to find the proper SimTrackID - for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin(); - iset != simTkIds.end(); iset++) { + for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin(); + iset != simTkIds.end(); + iset++) { auto ipos = mapping.find(*iset); if (ipos != mapping.end()) { - LogTrace("VectorHitsBuilderValidation") << "upper cluster in detid: " << upperDetId.rawId() << " from tp: " << ipos->second.key() << " " << iset->first << std::endl; + LogTrace("VectorHitsBuilderValidation") + << "upper cluster in detid: " << upperDetId.rawId() << " from tp: " << ipos->second.key() << " " + << iset->first << std::endl; upp_tp_id = ipos->second.key(); } } //compute if the vhits is 'true' or 'false' and save sim pT - std::pair<bool,uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + std::pair<bool, uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); vh_isTrue = 0; - if(istrue.first){ + if (istrue.first) { vh_isTrue = 1; } - - // loop over all simHits unsigned int totalSimHits(0); unsigned int primarySimHits(0); unsigned int otherSimHits(0); - for (edm::PSimHitContainer::const_iterator hitIt(simHitsRaw->begin()); hitIt != simHitsRaw->end(); ++hitIt) { - - if(hitIt->detUnitId() == geomDetLower->geographicalId()){// || hitIt->detUnitId() == geomDetUpper->geographicalId()){ + if (hitIt->detUnitId() == + geomDetLower->geographicalId()) { // || hitIt->detUnitId() == geomDetUpper->geographicalId()){ //check clusters track id compatibility - if(std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt->trackId()) != clusterSimTrackIds.end()){ - + if (std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt->trackId()) != + clusterSimTrackIds.end()) { Local3DPoint localPosHit(hitIt->localPosition()); sim_x_local = localPosHit.x(); sim_y_local = localPosHit.y(); @@ -542,42 +558,44 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev histogramLayer->second.deltaYVHSimHits[0]->Fill(vh_y_local - sim_y_local); // Pixel module - if (layer == 1 || layer == 2 || layer == 3) { - histogramLayer->second.deltaXVHSimHits[1]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits[1]->Fill(vh_y_local - sim_y_local); + if (layer == 1 || layer == 2 || layer == 3) { + histogramLayer->second.deltaXVHSimHits[1]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits[1]->Fill(vh_y_local - sim_y_local); } // Strip module else if (layer == 4 || layer == 5 || layer == 6) { - histogramLayer->second.deltaXVHSimHits[2]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits[2]->Fill(vh_y_local - sim_y_local); + histogramLayer->second.deltaXVHSimHits[2]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits[2]->Fill(vh_y_local - sim_y_local); } ++totalSimHits; - std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(hitIt->trackId())); - if (simTrackIt == simTracks.end()) continue; + std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(hitIt->trackId())); + if (simTrackIt == simTracks.end()) + continue; //LogTrace("VectorHitsBuilderValidation") << "--> with hitIt. The SimTrack has p: " << simTrackIt->second.momentum(); - // Primary particles only processType = hitIt->processType(); - if (simTrackIt->second.vertIndex() == 0 and (processType == 2 || processType == 7 || processType == 9 || processType == 11 || processType == 13 || processType == 15)) { - histogramLayer->second.deltaXVHSimHits_P[0]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits_P[0]->Fill(vh_y_local - sim_y_local); - - // Pixel module - if (layer == 1 || layer == 2 || layer == 3) { - histogramLayer->second.deltaXVHSimHits_P[1]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits_P[1]->Fill(vh_y_local - sim_y_local); - } - // Strip module - else if (layer == 4 || layer == 5 || layer == 6) { - histogramLayer->second.deltaXVHSimHits_P[2]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits_P[2]->Fill(vh_y_local - sim_y_local); - } - - ++primarySimHits; + if (simTrackIt->second.vertIndex() == 0 and + (processType == 2 || processType == 7 || processType == 9 || processType == 11 || processType == 13 || + processType == 15)) { + histogramLayer->second.deltaXVHSimHits_P[0]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[0]->Fill(vh_y_local - sim_y_local); + + // Pixel module + if (layer == 1 || layer == 2 || layer == 3) { + histogramLayer->second.deltaXVHSimHits_P[1]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[1]->Fill(vh_y_local - sim_y_local); + } + // Strip module + else if (layer == 4 || layer == 5 || layer == 6) { + histogramLayer->second.deltaXVHSimHits_P[2]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[2]->Fill(vh_y_local - sim_y_local); + } + + ++primarySimHits; } otherSimHits = totalSimHits - primarySimHits; @@ -585,10 +603,9 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev histogramLayer->second.totalSimHits->Fill(totalSimHits); histogramLayer->second.primarySimHits->Fill(primarySimHits); histogramLayer->second.otherSimHits->Fill(otherSimHits); - } } - }// loop simhits + } // loop simhits nVHsTot++; //tree->Fill(); @@ -597,7 +614,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev //combinatorial studies : not filling if more than 1 VH has been produced //****************************** multiplicity = DSViter->size(); - if(DSViter->size()>1){ + if (DSViter->size() > 1) { LogTrace("VectorHitsBuilderValidation") << " not filling if more than 1 VH has been produced"; width = -100; deltaXlocal = -100; @@ -614,13 +631,13 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev //stub width - auto && lparamsUpp = cpe->localParameters( *vhIt->upperClusterRef().cluster_phase2OT(), *geomDetUnit_upp ); + auto&& lparamsUpp = cpe->localParameters(*vhIt->upperClusterRef().cluster_phase2OT(), *geomDetUnit_upp); LogTrace("VectorHitsBuilderValidation") << " upper local pos (in its sor):" << lparamsUpp.first; Global3DPoint gparamsUpp = geomDetUnit_upp->surface().toGlobal(lparamsUpp.first); LogTrace("VectorHitsBuilderValidation") << " upper global pos :" << gparamsUpp; Local3DPoint lparamsUppInLow = geomDetUnit_low->surface().toLocal(gparamsUpp); LogTrace("VectorHitsBuilderValidation") << " upper local pos (in low sor):" << lparamsUppInLow; - auto && lparamsLow = cpe->localParameters( *vhIt->lowerClusterRef().cluster_phase2OT(), *geomDetUnit_low ); + auto&& lparamsLow = cpe->localParameters(*vhIt->lowerClusterRef().cluster_phase2OT(), *geomDetUnit_low); LogTrace("VectorHitsBuilderValidation") << " lower local pos (in its sor):" << lparamsLow.first; Global3DPoint gparamsLow = geomDetUnit_low->surface().toGlobal(lparamsLow.first); LogTrace("VectorHitsBuilderValidation") << " lower global pos :" << gparamsLow; @@ -632,42 +649,42 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev double parallCorr = 0.0; - Global3DPoint origin(0,0,0); + Global3DPoint origin(0, 0, 0); GlobalVector gV = gparamsLow - origin; //LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV; LocalVector lV = geomDetUnit_low->surface().toLocal(gV); //LogTrace("VectorHitsBuilderValidation") << " local vector passing to the origin (in low sor):" << lV; - LocalVector lV_norm = lV/lV.z(); + LocalVector lV_norm = lV / lV.z(); //LogTrace("VectorHitsBuilderValidation") << " normalized local vector passing to the origin (in low sor):" << lV_norm; parallCorr = lV_norm.x() * lparamsUppInLow.z(); LogTrace("VectorHitsBuilderValidation") << " parallalex correction:" << parallCorr; double lpos_upp_corr = 0.0; double lpos_low_corr = 0.0; - if(lparamsUpp.first.x() > lparamsLow.first.x()){ - if(lparamsUpp.first.x() > 0){ + if (lparamsUpp.first.x() > lparamsLow.first.x()) { + if (lparamsUpp.first.x() > 0) { lpos_low_corr = lparamsLow.first.x(); lpos_upp_corr = lparamsUpp.first.x() - fabs(parallCorr); } - if(lparamsUpp.first.x() < 0){ + if (lparamsUpp.first.x() < 0) { lpos_low_corr = lparamsLow.first.x() + fabs(parallCorr); lpos_upp_corr = lparamsUpp.first.x(); } - } else if( lparamsUpp.first.x() < lparamsLow.first.x() ) { - if(lparamsUpp.first.x() > 0){ + } else if (lparamsUpp.first.x() < lparamsLow.first.x()) { + if (lparamsUpp.first.x() > 0) { lpos_low_corr = lparamsLow.first.x() - fabs(parallCorr); lpos_upp_corr = lparamsUpp.first.x(); } - if(lparamsUpp.first.x() < 0){ + if (lparamsUpp.first.x() < 0) { lpos_low_corr = lparamsLow.first.x(); lpos_upp_corr = lparamsUpp.first.x() + fabs(parallCorr); } } else { - if(lparamsUpp.first.x() > 0){ + if (lparamsUpp.first.x() > 0) { lpos_upp_corr = lparamsUpp.first.x() - fabs(parallCorr); lpos_low_corr = lparamsLow.first.x(); } - if(lparamsUpp.first.x() < 0){ + if (lparamsUpp.first.x() < 0) { lpos_upp_corr = lparamsUpp.first.x() + fabs(parallCorr); lpos_low_corr = lparamsLow.first.x(); } @@ -682,53 +699,55 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev tree->Fill(); + } // vh valid - }// vh valid + } // loop vhs - }// loop vhs - - if (nVHsPS) histogramLayer->second.numberVHsPS->Fill(nVHsPS); - if (nVHs2S) histogramLayer->second.numberVHs2S->Fill(nVHs2S); - LogTrace("VectorHitsBuilderValidation") << "nVHsPS for this layer : " << nVHsPS << ", nVHs2S for this layer : " << nVHs2S << std::endl; + if (nVHsPS) + histogramLayer->second.numberVHsPS->Fill(nVHsPS); + if (nVHs2S) + histogramLayer->second.numberVHs2S->Fill(nVHs2S); + LogTrace("VectorHitsBuilderValidation") + << "nVHsPS for this layer : " << nVHsPS << ", nVHs2S for this layer : " << nVHs2S << std::endl; } CreateVHsXYGraph(glVHs, dirVHs); CreateVHsRZGraph(glVHs, dirVHs); - int VHaccTrue = 0.0; + int VHaccTrue = 0.0; int VHaccFalse = 0.0; - int VHrejTrue = 0.0; + int VHrejTrue = 0.0; int VHrejFalse = 0.0; - int VHaccTrue_signal = 0.0; - int VHrejTrue_signal = 0.0; + int VHaccTrue_signal = 0.0; + int VHrejTrue_signal = 0.0; // Loop over modules for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { - unsigned int rawid(DSViter->detId()); DetId detId(rawid); int layerAcc = getLayerNumber(detId); LogTrace("VectorHitsBuilderValidation") << "acc Layer: " << layerAcc << " det id" << rawid << std::endl; - for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { - if( vhIt->isValid() ){ - VHaccLayer_->Fill(layerAcc); + for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + if (vhIt->isValid()) { + VHaccLayer_->Fill(layerAcc); VHacc++; //compute if the vhits is 'true' or 'false' - std::pair<bool,uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); - if(istrue.first){ + std::pair<bool, uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + if (istrue.first) { LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; - VHaccTrueLayer_->Fill(layerAcc); + VHaccTrueLayer_->Fill(layerAcc); //VHaccTrueLayer_ratio->Fill(layerAcc); VHaccTrue++; //saving info of 'signal' track - std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(istrue.second)); - if (simTrackIt == simTracks.end()) continue; + std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(istrue.second)); + if (simTrackIt == simTracks.end()) + continue; LogTrace("VectorHitsBuilderValidation") << "this vectorhit is associated with SimTrackId: " << istrue.second; LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); - if (simTrackIt->second.momentum().pt() > 1 ) { - VHaccTrue_signal_Layer_->Fill(layerAcc); + if (simTrackIt->second.momentum().pt() > 1) { + VHaccTrue_signal_Layer_->Fill(layerAcc); LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; VHaccTrue_signal++; } @@ -737,416 +756,457 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'false' vhit."; VHaccFalse++; } - } } - - } - + } //it is not really working.. //VHaccTrueLayer_ratio->Divide(VHaccLayer_); for (VectorHitCollectionNew::const_iterator DSViter = vhsRej->begin(); DSViter != vhsRej->end(); ++DSViter) { - unsigned int rawid(DSViter->detId()); DetId detId(rawid); int layerRej = getLayerNumber(detId); LogTrace("VectorHitsBuilderValidation") << "rej Layer: " << layerRej << " det id" << rawid << std::endl; - for (edmNew::DetSet< VectorHit >::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { VHrejLayer_->Fill(layerRej); VHrej++; //compute if the vhits is 'true' or 'false' - std::pair<bool,uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); - if(istrue.first){ + std::pair<bool, uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + if (istrue.first) { LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; VHrejTrueLayer_->Fill(layerRej); //VHrejTrueLayer_ratio->Fill(layerRej); VHrejTrue++; //saving info of 'signal' track - std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(istrue.second)); - if (simTrackIt == simTracks.end()) continue; + std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(istrue.second)); + if (simTrackIt == simTracks.end()) + continue; LogTrace("VectorHitsBuilderValidation") << "this vectorhit is associated with SimTrackId: " << istrue.second; - LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); - if (simTrackIt->second.momentum().pt() > 1 ) { - VHrejTrue_signal_Layer_->Fill(layerRej); - LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; - VHrejTrue_signal++; - } + LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); + if (simTrackIt->second.momentum().pt() > 1) { + VHrejTrue_signal_Layer_->Fill(layerRej); + LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; + VHrejTrue_signal++; + } } else { LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'false' vhit."; VHrejFalse++; } - } - } //it is not really working.. //VHrejTrueLayer_ratio->Divide(VHrejLayer_); int VHtot = VHacc + VHrej; - LogTrace("VectorHitsBuilderValidation") << "VH total: " << VHtot << " with " << VHacc << " VHs accepted and " << VHrej << " VHs rejected."; - LogTrace("VectorHitsBuilderValidation") << "of the VH accepted, there are " << VHaccTrue << " true and " << VHaccFalse << " false."; - LogTrace("VectorHitsBuilderValidation") << "of the VH rejected, there are " << VHrejTrue << " true and " << VHrejFalse << " false."; - LogTrace("VectorHitsBuilderValidation") << "of the true VH , there are " << VHaccTrue_signal << " accepted belonging to signal and " << VHrejTrue_signal << " rejected belonging to signal."; - -// CreateWindowCorrGraph(); - + LogTrace("VectorHitsBuilderValidation") + << "VH total: " << VHtot << " with " << VHacc << " VHs accepted and " << VHrej << " VHs rejected."; + LogTrace("VectorHitsBuilderValidation") + << "of the VH accepted, there are " << VHaccTrue << " true and " << VHaccFalse << " false."; + LogTrace("VectorHitsBuilderValidation") + << "of the VH rejected, there are " << VHrejTrue << " true and " << VHrejFalse << " false."; + LogTrace("VectorHitsBuilderValidation") + << "of the true VH , there are " << VHaccTrue_signal << " accepted belonging to signal and " + << VHrejTrue_signal << " rejected belonging to signal."; + + // CreateWindowCorrGraph(); } // Check if the vector hit is true (both clusters are formed from the same SimTrack -std::pair<bool,uint32_t> VectorHitsBuilderValidation::isTrue(const VectorHit vh, const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& siphase2SimLinks, DetId& detId) const{ - +std::pair<bool, uint32_t> VectorHitsBuilderValidation::isTrue( + const VectorHit vh, const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& siphase2SimLinks, DetId& detId) const { const GeomDet* geomDet(tkGeom->idToDet(detId)); const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); const GeomDetUnit* geomDetLower = stackDet->lowerDet(); const GeomDetUnit* geomDetUpper = stackDet->upperDet(); - std::vector< unsigned int > lowClusterSimTrackIds; + std::vector<unsigned int> lowClusterSimTrackIds; //std::set<std::pair<uint32_t, EncodedEventId> > simTkIds; for (unsigned int istr(0); istr < (*(vh.lowerClusterRef().cluster_phase2OT())).size(); ++istr) { - uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, (*(vh.lowerClusterRef().cluster_phase2OT())).column()); + uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vh.lowerClusterRef().cluster_phase2OT())).column()); DetId detIdCluster = geomDetLower->geographicalId(); unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detIdCluster, channel)); LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << simTrackId << std::endl; std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, detIdCluster, channel)); - if (trkid.size()==0) continue; + if (trkid.size() == 0) + continue; lowClusterSimTrackIds.push_back(simTrackId); //simTkIds.insert(trkid.begin(),trkid.end()); } - std::vector< unsigned int >::iterator it_simTrackUpper; + std::vector<unsigned int>::iterator it_simTrackUpper; for (unsigned int istr(0); istr < (*(vh.upperClusterRef().cluster_phase2OT())).size(); ++istr) { - uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.upperClusterRef().cluster_phase2OT())).firstRow() + istr, (*(vh.upperClusterRef().cluster_phase2OT())).column()); + uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.upperClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vh.upperClusterRef().cluster_phase2OT())).column()); DetId detIdCluster = geomDetUpper->geographicalId(); unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detIdCluster, channel)); LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << simTrackId << std::endl; std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, detIdCluster, channel)); - if (trkid.size()==0) continue; + if (trkid.size() == 0) + continue; it_simTrackUpper = std::find(lowClusterSimTrackIds.begin(), lowClusterSimTrackIds.end(), simTrackId); - if ( it_simTrackUpper != lowClusterSimTrackIds.end() ) { + if (it_simTrackUpper != lowClusterSimTrackIds.end()) { LogTrace("VectorHitsBuilderValidation") << " UpperSimTrackId found in lowClusterSimTrackIds "; - return std::make_pair(true,simTrackId); + return std::make_pair(true, simTrackId); } //clusterSimTrackIds.push_back(UpperSimTrackId); //simTkIds.insert(trkid.begin(),trkid.end()); } - return std::make_pair(false,0); + return std::make_pair(false, 0); } // Create the histograms -std::map< unsigned int, VHHistos >::iterator VectorHitsBuilderValidation::createLayerHistograms(unsigned int ival) { - std::ostringstream fname1, fname2; - - edm::Service<TFileService> fs; - fs->file().cd("/"); - - std::string tag; - unsigned int id; - if (ival < 100) { - id = ival; - fname1 << "Barrel"; - fname2 << "Layer_" << id; - tag = "_layer_"; - } - else { - int side = ival / 100; - id = ival - side * 100; - fname1 << "EndCap_Side_" << side; - fname2 << "Disc_" << id; - tag = "_disc_"; - } +std::map<unsigned int, VHHistos>::iterator VectorHitsBuilderValidation::createLayerHistograms(unsigned int ival) { + std::ostringstream fname1, fname2; - TFileDirectory td1 = fs->mkdir(fname1.str().c_str()); - TFileDirectory td = td1.mkdir(fname2.str().c_str()); + edm::Service<TFileService> fs; + fs->file().cd("/"); + + std::string tag; + unsigned int id; + if (ival < 100) { + id = ival; + fname1 << "Barrel"; + fname2 << "Layer_" << id; + tag = "_layer_"; + } else { + int side = ival / 100; + id = ival - side * 100; + fname1 << "EndCap_Side_" << side; + fname2 << "Disc_" << id; + tag = "_disc_"; + } - VHHistos local_histos; + TFileDirectory td1 = fs->mkdir(fname1.str().c_str()); + TFileDirectory td = td1.mkdir(fname2.str().c_str()); - std::ostringstream histoName; + VHHistos local_histos; - /* + std::ostringstream histoName; + + /* * Number of clusters */ - histoName.str(""); histoName << "Number_VHs_PS" << tag.c_str() << id; - local_histos.numberVHsPS = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); - local_histos.numberVHsPS->SetFillColor(kAzure + 7); + histoName.str(""); + histoName << "Number_VHs_PS" << tag.c_str() << id; + local_histos.numberVHsPS = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberVHsPS->SetFillColor(kAzure + 7); - histoName.str(""); histoName << "Number_VHs_2S" << tag.c_str() << id; - local_histos.numberVHs2S = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); - local_histos.numberVHs2S->SetFillColor(kOrange - 3); + histoName.str(""); + histoName << "Number_VHs_2S" << tag.c_str() << id; + local_histos.numberVHs2S = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberVHs2S->SetFillColor(kOrange - 3); - histoName.str(""); histoName << "Number_VHs_Mixed" << tag.c_str() << id; - local_histos.numberVHsMixed = td.make< THStack >(histoName.str().c_str(), histoName.str().c_str()); - local_histos.numberVHsMixed->Add(local_histos.numberVHsPS); - local_histos.numberVHsMixed->Add(local_histos.numberVHs2S); + histoName.str(""); + histoName << "Number_VHs_Mixed" << tag.c_str() << id; + local_histos.numberVHsMixed = td.make<THStack>(histoName.str().c_str(), histoName.str().c_str()); + local_histos.numberVHsMixed->Add(local_histos.numberVHsPS); + local_histos.numberVHsMixed->Add(local_histos.numberVHs2S); - /* + /* * Local and Global positions */ - histoName.str(""); histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; - local_histos.localPosXY[0] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); - local_histos.localPosXY[0]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Local_Position_XY_PS" << tag.c_str() << id; - local_histos.localPosXY[1] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); - local_histos.localPosXY[1]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Local_Position_XY_2S" << tag.c_str() << id; - local_histos.localPosXY[2] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); - local_histos.localPosXY[2]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; - local_histos.globalPosXY[0] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); - local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Global_Position_XY_PS" << tag.c_str() << id; - local_histos.globalPosXY[1] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); - local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); - - histoName.str(""); histoName << "Global_Position_XY_2S" << tag.c_str() << id; - local_histos.globalPosXY[2] = td.make< TGraph >();//histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); - local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); - - /* + histoName.str(""); + histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; + local_histos.localPosXY[0] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Local_Position_XY_PS" << tag.c_str() << id; + local_histos.localPosXY[1] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Local_Position_XY_2S" << tag.c_str() << id; + local_histos.localPosXY[2] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + local_histos.localPosXY[2]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; + local_histos.globalPosXY[0] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_PS" << tag.c_str() << id; + local_histos.globalPosXY[1] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_2S" << tag.c_str() << id; + local_histos.globalPosXY[2] = + td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); + + /* * Delta positions with SimHits */ - histoName.str(""); histoName << "Delta_X_VH_SimHits_Mixed" << tag.c_str() << id; - local_histos.deltaXVHSimHits[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_VH_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaXVHSimHits[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_X_VH_SimHits_PS" << tag.c_str() << id; - local_histos.deltaXVHSimHits[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_VH_SimHits_PS" << tag.c_str() << id; + local_histos.deltaXVHSimHits[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_X_VH_SimHits_2S" << tag.c_str() << id; - local_histos.deltaXVHSimHits[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_VH_SimHits_2S" << tag.c_str() << id; + local_histos.deltaXVHSimHits[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_VH_SimHits_Mixed" << tag.c_str() << id; - local_histos.deltaYVHSimHits[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaYVHSimHits[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_VH_SimHits_PS" << tag.c_str() << id; - local_histos.deltaYVHSimHits[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_PS" << tag.c_str() << id; + local_histos.deltaYVHSimHits[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_VH_SimHits_2S" << tag.c_str() << id; - local_histos.deltaYVHSimHits[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_2S" << tag.c_str() << id; + local_histos.deltaYVHSimHits[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - /* + /* * Delta position with simHits for primary tracks only */ - histoName.str(""); histoName << "Delta_X_VH_SimHits_Mixed_P" << tag.c_str() << id; - local_histos.deltaXVHSimHits_P[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_VH_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_X_VH_SimHits_PS_P" << tag.c_str() << id; - local_histos.deltaXVHSimHits_P[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_VH_SimHits_PS_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_X_VH_SimHits_2S_P" << tag.c_str() << id; - local_histos.deltaXVHSimHits_P[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_X_VH_SimHits_2S_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_VH_SimHits_Mixed_P" << tag.c_str() << id; - local_histos.deltaYVHSimHits_P[0] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_VH_SimHits_PS_P" << tag.c_str() << id; - local_histos.deltaYVHSimHits_P[1] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_PS_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - histoName.str(""); histoName << "Delta_Y_VH_SimHits_2S_P" << tag.c_str() << id; - local_histos.deltaYVHSimHits_P[2] = td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_2S_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - /* + /* * Information on the Digis per cluster */ - histoName.str(""); histoName << "Total_Digis" << tag.c_str() << id; - local_histos.totalSimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + histoName.str(""); + histoName << "Total_Digis" << tag.c_str() << id; + local_histos.totalSimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - histoName.str(""); histoName << "Primary_Digis" << tag.c_str() << id; - local_histos.primarySimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + histoName.str(""); + histoName << "Primary_Digis" << tag.c_str() << id; + local_histos.primarySimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - histoName.str(""); histoName << "Other_Digis" << tag.c_str() << id; - local_histos.otherSimHits= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + histoName.str(""); + histoName << "Other_Digis" << tag.c_str() << id; + local_histos.otherSimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - /* + /* * Study on the clusters combinatorial problem */ - histoName.str(""); histoName << "DeltaXlocal_clusters" << tag.c_str() << id; - local_histos.deltaXlocal= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); - histoName.str(""); histoName << "Width" << tag.c_str() << id; - local_histos.width= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); - histoName.str(""); histoName << "Curvature" << tag.c_str() << id; - local_histos.curvature= td.make< TH1F >(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); - - std::pair< std::map< unsigned int, VHHistos >::iterator, bool > insertedIt(histograms_.insert(std::make_pair(ival, local_histos))); - fs->file().cd("/"); + histoName.str(""); + histoName << "DeltaXlocal_clusters" << tag.c_str() << id; + local_histos.deltaXlocal = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + histoName.str(""); + histoName << "Width" << tag.c_str() << id; + local_histos.width = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + histoName.str(""); + histoName << "Curvature" << tag.c_str() << id; + local_histos.curvature = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + + std::pair<std::map<unsigned int, VHHistos>::iterator, bool> insertedIt( + histograms_.insert(std::make_pair(ival, local_histos))); + fs->file().cd("/"); - return insertedIt.first; + return insertedIt.first; } -void VectorHitsBuilderValidation::CreateVHsXYGraph(const std::vector<Global3DPoint> glVHs,const std::vector<Global3DVector> dirVHs){ - - if(glVHs.size() != dirVHs.size()){ +void VectorHitsBuilderValidation::CreateVHsXYGraph(const std::vector<Global3DPoint> glVHs, + const std::vector<Global3DVector> dirVHs) { + if (glVHs.size() != dirVHs.size()) { std::cout << "Cannot fullfil the graphs for this event. Return." << std::endl; return; } // opening canvas and drawing XY TGraph - + //TCanvas * VHXY_ = new TCanvas("RVsY_Mixed","RVsY_Mixed",800,600); //VHXY_->cd(); //trackerLayoutXY_[0]->Draw("AP"); -// float finalposX, finalposY; - - for(unsigned int nVH = 0; nVH < glVHs.size(); nVH++){ + // float finalposX, finalposY; -// finalposX = glVHs.at(nVH).x() + dirVHs.at(nVH).x(); -// finalposY = glVHs.at(nVH).y() + dirVHs.at(nVH).y(); + for (unsigned int nVH = 0; nVH < glVHs.size(); nVH++) { + // finalposX = glVHs.at(nVH).x() + dirVHs.at(nVH).x(); + // finalposY = glVHs.at(nVH).y() + dirVHs.at(nVH).y(); //std::cout << glVHs.at(nVH) << " " << " \tr: " << glVHs.at(nVH).perp() << std::endl; //std::cout << dirVHs.at(nVH).x() << "," << dirVHs.at(nVH).y() << std::endl; //same r - if((fabs(dirVHs.at(nVH).x()) < 10e-5) && (fabs(dirVHs.at(nVH).y()) < 10e-5)){ - + if ((fabs(dirVHs.at(nVH).x()) < 10e-5) && (fabs(dirVHs.at(nVH).y()) < 10e-5)) { //std::cout << "same pos!"; continue; } else { - - // TArrow* vh_arrow = new TArrow(glVHs.at(nVH).x(), glVHs.at(nVH).y(), finalposX, finalposY, 0.05, ">"); - // vh_arrow->Draw("same"); - + // TArrow* vh_arrow = new TArrow(glVHs.at(nVH).x(), glVHs.at(nVH).y(), finalposX, finalposY, 0.05, ">"); + // vh_arrow->Draw("same"); } - - } return; } -void VectorHitsBuilderValidation::CreateVHsRZGraph(const std::vector<Global3DPoint> glVHs,const std::vector<Global3DVector> dirVHs){ - - if(glVHs.size() != dirVHs.size()){ +void VectorHitsBuilderValidation::CreateVHsRZGraph(const std::vector<Global3DPoint> glVHs, + const std::vector<Global3DVector> dirVHs) { + if (glVHs.size() != dirVHs.size()) { std::cout << "Cannot fullfil the graphs for this event. Return." << std::endl; return; } // opening canvas and drawing RZ TGraph // - //TCanvas* VHRZ_ = new TCanvas("RVsZ_Mixed","RVsZ_Mixed",800,600); + //TCanvas* VHRZ_ = new TCanvas("RVsZ_Mixed","RVsZ_Mixed",800,600); //VHRZ_->cd(); //trackerLayoutRZ_[0]->Draw("AP"); -// float finalposX, finalposY, finalposR, finalposZ; + // float finalposX, finalposY, finalposR, finalposZ; -// for(unsigned int nVH = 0; nVH < glVHs.size(); nVH++){ + // for(unsigned int nVH = 0; nVH < glVHs.size(); nVH++){ -// finalposX = glVHs.at(nVH).x() + dirVHs.at(nVH).x(); -// finalposY = glVHs.at(nVH).y() + dirVHs.at(nVH).y(); -// finalposR = sqrt( pow(finalposX,2) + pow(finalposY,2) ); -// finalposZ = glVHs.at(nVH).z() + dirVHs.at(nVH).z(); + // finalposX = glVHs.at(nVH).x() + dirVHs.at(nVH).x(); + // finalposY = glVHs.at(nVH).y() + dirVHs.at(nVH).y(); + // finalposR = sqrt( pow(finalposX,2) + pow(finalposY,2) ); + // finalposZ = glVHs.at(nVH).z() + dirVHs.at(nVH).z(); - //std::cout << dirVHs.at(nVH) " " << " \tr: " << dirVHs.at(nVH).perp() << std::endl; - //std::cout << finalposX << ", " << finalposY << " " << " \tr: " << finalposR << std::endl; - //std::cout << std::endl; + //std::cout << dirVHs.at(nVH) " " << " \tr: " << dirVHs.at(nVH).perp() << std::endl; + //std::cout << finalposX << ", " << finalposY << " " << " \tr: " << finalposR << std::endl; + //std::cout << std::endl; -// TArrow* vh_arrow = new TArrow(glVHs.at(nVH).z(), glVHs.at(nVH).perp(), finalposZ, finalposR, 0.05, "|>"); -// vh_arrow->SetLineWidth(2); -// vh_arrow->Draw("same"); + // TArrow* vh_arrow = new TArrow(glVHs.at(nVH).z(), glVHs.at(nVH).perp(), finalposZ, finalposR, 0.05, "|>"); + // vh_arrow->SetLineWidth(2); + // vh_arrow->Draw("same"); -// } + // } return; } -void VectorHitsBuilderValidation::CreateWindowCorrGraph(){ - +void VectorHitsBuilderValidation::CreateWindowCorrGraph() { //FIXME: This function is not working properly, yet. //return if we are not using Phase2 OT - if(!tkGeom->isThere(GeomDetEnumerators::P2OTB) && !tkGeom->isThere(GeomDetEnumerators::P2OTEC)) + if (!tkGeom->isThere(GeomDetEnumerators::P2OTB) && !tkGeom->isThere(GeomDetEnumerators::P2OTEC)) return; - for(auto det : tkGeom->detsTOB()){ -// std::cout << det->geographicalId().rawId() << std::endl; -// std::cout << det->surface().bounds().thickness() << std::endl; - ParallaxCorrectionRZ_->Fill(det->position().z(),det->position().perp(),5.); + for (auto det : tkGeom->detsTOB()) { + // std::cout << det->geographicalId().rawId() << std::endl; + // std::cout << det->surface().bounds().thickness() << std::endl; + ParallaxCorrectionRZ_->Fill(det->position().z(), det->position().perp(), 5.); } - for(auto det : tkGeom->detsTID()){ + for (auto det : tkGeom->detsTID()) { //std::cout << det->geographicalId().rawId() << std::endl; - ParallaxCorrectionRZ_->Fill(det->position().z(),det->position().perp(),10.); + ParallaxCorrectionRZ_->Fill(det->position().z(), det->position().perp(), 10.); } - ParallaxCorrectionRZ_->Fill(0.,0.,5.); + ParallaxCorrectionRZ_->Fill(0., 0., 5.); return; } unsigned int VectorHitsBuilderValidation::getLayerNumber(const DetId& detid) { if (detid.det() == DetId::Tracker) { - if (detid.subdetId() == StripSubdetector::TOB) return (tkTopo->layer(detid)); - else if (detid.subdetId() == StripSubdetector::TID) return (100 * tkTopo->side(detid) + tkTopo->layer(detid)); - else return 999; + if (detid.subdetId() == StripSubdetector::TOB) + return (tkTopo->layer(detid)); + else if (detid.subdetId() == StripSubdetector::TID) + return (100 * tkTopo->side(detid) + tkTopo->layer(detid)); + else + return 999; } return 999; } -unsigned int VectorHitsBuilderValidation::getModuleNumber(const DetId& detid) { - return (tkTopo->module(detid)); -} +unsigned int VectorHitsBuilderValidation::getModuleNumber(const DetId& detid) { return (tkTopo->module(detid)); } -std::vector< std::pair<uint32_t, EncodedEventId> > -VectorHitsBuilderValidation::getSimTrackIds(const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& simLinks, - const DetId& detId, uint32_t channel) const -{ - std::vector< std::pair<uint32_t, EncodedEventId> > simTrkId; +std::vector<std::pair<uint32_t, EncodedEventId> > VectorHitsBuilderValidation::getSimTrackIds( + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& simLinks, const DetId& detId, uint32_t channel) const { + std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId; auto isearch = simLinks->find(detId); if (isearch != simLinks->end()) { // Loop over DigiSimLink in this det unit edm::DetSet<PixelDigiSimLink> link_detset = (*isearch); - for (typename edm::DetSet<PixelDigiSimLink>::const_iterator it = link_detset.data.begin(); - it != link_detset.data.end(); ++it) { - if (channel == it->channel()) simTrkId.push_back(std::make_pair(it->SimTrackId(), it->eventId())); - } + for (typename edm::DetSet<PixelDigiSimLink>::const_iterator it = link_detset.data.begin(); + it != link_detset.data.end(); + ++it) { + if (channel == it->channel()) + simTrkId.push_back(std::make_pair(it->SimTrackId(), it->eventId())); + } } return simTrkId; } -unsigned int VectorHitsBuilderValidation::getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& pixelSimLinks, const DetId& detId, unsigned int channel) const { - edm::DetSetVector< PixelDigiSimLink >::const_iterator DSViter(pixelSimLinks->find(detId)); - if (DSViter == pixelSimLinks->end()) return 0; - for (edm::DetSet< PixelDigiSimLink >::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { - if (channel == it->channel()) return it->SimTrackId(); - } +unsigned int VectorHitsBuilderValidation::getSimTrackId( + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& pixelSimLinks, + const DetId& detId, + unsigned int channel) const { + edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter(pixelSimLinks->find(detId)); + if (DSViter == pixelSimLinks->end()) return 0; + for (edm::DetSet<PixelDigiSimLink>::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { + if (channel == it->channel()) + return it->SimTrackId(); + } + return 0; } -void VectorHitsBuilderValidation::printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster){ +void VectorHitsBuilderValidation::printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster) { + if (!geomDetUnit) + return; - if (!geomDetUnit) return; - - const PixelGeomDetUnit* theGeomDet = dynamic_cast< const PixelGeomDetUnit* >(geomDetUnit); + const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); const PixelTopology& topol = theGeomDet->specificTopology(); unsigned int layer = getLayerNumber(geomDetUnit->geographicalId()); unsigned int module = getModuleNumber(geomDetUnit->geographicalId()); LogTrace("VectorHitsBuilderValidation") << "Layer:" << layer << std::endl; - if(topol.ncolumns() == 32) - LogTrace("VectorHitsBuilderValidation") << "Pixel cluster with detId:" << geomDetUnit->geographicalId().rawId() << "(module:" << module << ") " << std::endl; - else if(topol.ncolumns() == 2 ) - LogTrace("VectorHitsBuilderValidation") << "Strip cluster with detId:" << geomDetUnit->geographicalId().rawId() << "(module:" << module << ") " << std::endl; - else std::cout << "no module?!" << std::endl; - LogTrace("VectorHitsBuilderValidation") << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl; - LogTrace("VectorHitsBuilderValidation") << " and width:" << theGeomDet->surface().bounds().width() << " , lenght:" << theGeomDet->surface().bounds().length() << std::endl; - - auto && lparams = cpe->localParameters( *cluster.cluster_phase2OT(), *theGeomDet ); + if (topol.ncolumns() == 32) + LogTrace("VectorHitsBuilderValidation") << "Pixel cluster with detId:" << geomDetUnit->geographicalId().rawId() + << "(module:" << module << ") " << std::endl; + else if (topol.ncolumns() == 2) + LogTrace("VectorHitsBuilderValidation") << "Strip cluster with detId:" << geomDetUnit->geographicalId().rawId() + << "(module:" << module << ") " << std::endl; + else + std::cout << "no module?!" << std::endl; + LogTrace("VectorHitsBuilderValidation") + << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl; + LogTrace("VectorHitsBuilderValidation") << " and width:" << theGeomDet->surface().bounds().width() + << " , lenght:" << theGeomDet->surface().bounds().length() << std::endl; + + auto&& lparams = cpe->localParameters(*cluster.cluster_phase2OT(), *theGeomDet); //Global3DPoint gparams = theGeomDet->surface().toGlobal(lparams.first); - LogTrace("VectorHitsBuilderValidation") << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl; + LogTrace("VectorHitsBuilderValidation") + << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl; return; } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index ba47ba6b3eb74..313e0aa78388b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -48,97 +48,99 @@ #include <TArrow.h> struct VHHistos { - THStack* numberVHsMixed; - TH1F* numberVHsPS; - TH1F* numberVHs2S; + THStack* numberVHsMixed; + TH1F* numberVHsPS; + TH1F* numberVHs2S; - TGraph* globalPosXY[3]; - TGraph* localPosXY[3]; + TGraph* globalPosXY[3]; + TGraph* localPosXY[3]; - TH1F* deltaXVHSimHits[3]; - TH1F* deltaYVHSimHits[3]; + TH1F* deltaXVHSimHits[3]; + TH1F* deltaYVHSimHits[3]; - TH1F* deltaXVHSimHits_P[3]; - TH1F* deltaYVHSimHits_P[3]; + TH1F* deltaXVHSimHits_P[3]; + TH1F* deltaYVHSimHits_P[3]; - TH1F* digiEfficiency[3]; + TH1F* digiEfficiency[3]; - TH1F* totalSimHits; - TH1F* primarySimHits; - TH1F* otherSimHits; + TH1F* totalSimHits; + TH1F* primarySimHits; + TH1F* otherSimHits; - TH1F* curvature; - TH1F* width; - TH1F* deltaXlocal; + TH1F* curvature; + TH1F* width; + TH1F* deltaXlocal; }; class VectorHitsBuilderValidation : public edm::EDAnalyzer { - - public: - typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D > Phase2TrackerCluster1DRef; - - typedef std::map< unsigned int, std::vector< PSimHit > > SimHitsMap; - typedef std::map< unsigned int, SimTrack > SimTracksMap; - - explicit VectorHitsBuilderValidation(const edm::ParameterSet&); - ~VectorHitsBuilderValidation(); - void beginJob(); - void endJob(); - void analyze(const edm::Event&, const edm::EventSetup&); - - private: - - std::map< unsigned int, VHHistos >::iterator createLayerHistograms(unsigned int); - void CreateVHsXYGraph( const std::vector<Global3DPoint>,const std::vector<Global3DVector> ); - void CreateVHsRZGraph( const std::vector<Global3DPoint>,const std::vector<Global3DVector> ); - void CreateWindowCorrGraph(); - - unsigned int getLayerNumber(const DetId&); - unsigned int getModuleNumber(const DetId& detid); - void printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster); - - std::pair<bool,uint32_t> isTrue(const VectorHit vh, const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& siphase2SimLinks, DetId& detId) const; - std::vector< std::pair<uint32_t, EncodedEventId> > getSimTrackIds(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >&, const DetId&, uint32_t) const; - unsigned int getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink > >& pixelSimLinks, const DetId& detId, unsigned int channel) const; - - edm::EDGetTokenT< edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; - edm::EDGetTokenT< VectorHitCollectionNew > VHacc_; - edm::EDGetTokenT< VectorHitCollectionNew > VHrej_; - edm::ESInputTag cpeTag_; - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe; - - edm::EDGetTokenT< edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; - edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken_; - edm::EDGetTokenT< edm::SimTrackContainer> simTracksToken_; - edm::EDGetTokenT< edm::SimVertexContainer > simVerticesToken_; - edm::EDGetTokenT<TrackingParticleCollection> trackingParticleToken_; - //SiPixelVectorHitBuilderAlgorithmBase *algo; - - const TrackerGeometry* tkGeom; - const TrackerTopology* tkTopo; - const MagneticField* magField; - - TTree* tree; - TGraph* trackerLayoutRZ_[3]; - TGraph* trackerLayoutXY_[3]; - TGraph* trackerLayoutXYBar_; - TGraph* trackerLayoutXYEC_; - TGraph* localPosXvsDeltaX_[3]; - TGraph* localPosYvsDeltaY_[3]; - TCanvas* VHXY_; - TCanvas* VHRZ_; - std::vector<TArrow*> arrowVHs; - - TH2D* ParallaxCorrectionRZ_; - TH1F* VHaccLayer_; - TH1F* VHrejLayer_; - TH1F* VHaccTrueLayer_; - TH1F* VHrejTrueLayer_; - TH1F* VHaccTrue_signal_Layer_; - TH1F* VHrejTrue_signal_Layer_; - TH1F* VHaccTrueLayer_ratio; - TH1F* VHrejTrueLayer_ratio; - - std::map< unsigned int, VHHistos > histograms_; - +public: + typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; + + typedef std::map<unsigned int, std::vector<PSimHit> > SimHitsMap; + typedef std::map<unsigned int, SimTrack> SimTracksMap; + + explicit VectorHitsBuilderValidation(const edm::ParameterSet&); + ~VectorHitsBuilderValidation(); + void beginJob(); + void endJob(); + void analyze(const edm::Event&, const edm::EventSetup&); + +private: + std::map<unsigned int, VHHistos>::iterator createLayerHistograms(unsigned int); + void CreateVHsXYGraph(const std::vector<Global3DPoint>, const std::vector<Global3DVector>); + void CreateVHsRZGraph(const std::vector<Global3DPoint>, const std::vector<Global3DVector>); + void CreateWindowCorrGraph(); + + unsigned int getLayerNumber(const DetId&); + unsigned int getModuleNumber(const DetId& detid); + void printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster); + + std::pair<bool, uint32_t> isTrue(const VectorHit vh, + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& siphase2SimLinks, + DetId& detId) const; + std::vector<std::pair<uint32_t, EncodedEventId> > getSimTrackIds( + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >&, const DetId&, uint32_t) const; + unsigned int getSimTrackId(const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& pixelSimLinks, + const DetId& detId, + unsigned int channel) const; + + edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; + edm::EDGetTokenT<VectorHitCollectionNew> VHacc_; + edm::EDGetTokenT<VectorHitCollectionNew> VHrej_; + edm::ESInputTag cpeTag_; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe; + + edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; + edm::EDGetTokenT<edm::PSimHitContainer> simHitsToken_; + edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; + edm::EDGetTokenT<edm::SimVertexContainer> simVerticesToken_; + edm::EDGetTokenT<TrackingParticleCollection> trackingParticleToken_; + //SiPixelVectorHitBuilderAlgorithmBase *algo; + + const TrackerGeometry* tkGeom; + const TrackerTopology* tkTopo; + const MagneticField* magField; + + TTree* tree; + TGraph* trackerLayoutRZ_[3]; + TGraph* trackerLayoutXY_[3]; + TGraph* trackerLayoutXYBar_; + TGraph* trackerLayoutXYEC_; + TGraph* localPosXvsDeltaX_[3]; + TGraph* localPosYvsDeltaY_[3]; + TCanvas* VHXY_; + TCanvas* VHRZ_; + std::vector<TArrow*> arrowVHs; + + TH2D* ParallaxCorrectionRZ_; + TH1F* VHaccLayer_; + TH1F* VHrejLayer_; + TH1F* VHaccTrueLayer_; + TH1F* VHrejTrueLayer_; + TH1F* VHaccTrue_signal_Layer_; + TH1F* VHrejTrue_signal_Layer_; + TH1F* VHaccTrueLayer_ratio; + TH1F* VHrejTrueLayer_ratio; + + std::map<unsigned int, VHHistos> histograms_; }; diff --git a/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc b/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc index 2a890e3d24a0c..c3946d8f19c8f 100644 --- a/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc +++ b/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc @@ -124,39 +124,44 @@ void SeedClusterRemoverPhase2::process(const TrackingRecHit *hit, float chi2, co OTs[cluster.key()] = false; assert(collectedOuterTrackers_.size() > cluster.key()); - collectedOuterTrackers_[cluster.key()]=true; + collectedOuterTrackers_[cluster.key()] = true; } else if (hitType == typeid(VectorHit)) { + if (!doOuterTracker_) + return; - if(!doOuterTracker_) return; - - const VectorHit *vhit = static_cast<const VectorHit*>(hit); + const VectorHit *vhit = static_cast<const VectorHit *>(hit); LogDebug("SeedClusterRemoverPhase2") << "Plain VectorHit in det " << detid.rawId(); //lower cluster Phase2TrackerRecHit1D::CluRef cluster = vhit->lowerCluster(); - if (cluster.id() != outerTrackerSourceProdID) throw cms::Exception("Inconsistent Data") << - "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() << - " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n."; - + if (cluster.id() != outerTrackerSourceProdID) + throw cms::Exception("Inconsistent Data") + << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() + << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n."; + assert(cluster.id() == outerTrackerSourceProdID); OTs[cluster.key()] = false; assert(collectedOuterTrackers_.size() > cluster.key()); - collectedOuterTrackers_[cluster.key()]=true; + collectedOuterTrackers_[cluster.key()] = true; - // upper cluster + // upper cluster cluster = vhit->upperCluster(); - if (cluster.id() != outerTrackerSourceProdID) throw cms::Exception("Inconsistent Data") << - "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() << - " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n."; - + if (cluster.id() != outerTrackerSourceProdID) + throw cms::Exception("Inconsistent Data") + << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() + << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n."; + assert(cluster.id() == outerTrackerSourceProdID); OTs[cluster.key()] = false; assert(collectedOuterTrackers_.size() > cluster.key()); - collectedOuterTrackers_[cluster.key()]=true; - } else throw cms::Exception("NOT IMPLEMENTED") << "I received a hit that was neither SiPixelRecHit nor Phase2TrackerRecHit1D but " << hitType.name() << " on detid " << detid.rawId() << "\n"; + collectedOuterTrackers_[cluster.key()] = true; + } else + throw cms::Exception("NOT IMPLEMENTED") + << "I received a hit that was neither SiPixelRecHit nor Phase2TrackerRecHit1D but " << hitType.name() + << " on detid " << detid.rawId() << "\n"; } void SeedClusterRemoverPhase2::produce(Event &iEvent, const EventSetup &iSetup) { diff --git a/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc b/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc index 14753707e6e6d..4ca48e1308910 100644 --- a/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc +++ b/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc @@ -193,17 +193,20 @@ namespace { collectedPhase2OTs[cluster.key()] = true; // Phase 2 OT is defined as Pixel detector (for now) - const auto &hitType = typeid(hit); + const auto& hitType = typeid(hit); if (hitType == typeid(VectorHit)) { - auto const & vectorHit = reinterpret_cast<VectorHit const&>(hit); - auto const & lowCluster = vectorHit.lowerClusterRef(); - auto const & uppCluster = vectorHit.upperClusterRef(); - LogTrace("TrackClusterRemoverPhase2")<<"masking a VHit with lowCluster key: " << lowCluster.key() << " and upper key: " << uppCluster.key(); - if (lowCluster.isPhase2()) collectedPhase2OTs[lowCluster.key()]=true; - if (uppCluster.isPhase2()) collectedPhase2OTs[uppCluster.key()]=true; + auto const& vectorHit = reinterpret_cast<VectorHit const&>(hit); + auto const& lowCluster = vectorHit.lowerClusterRef(); + auto const& uppCluster = vectorHit.upperClusterRef(); + LogTrace("TrackClusterRemoverPhase2") + << "masking a VHit with lowCluster key: " << lowCluster.key() << " and upper key: " << uppCluster.key(); + if (lowCluster.isPhase2()) + collectedPhase2OTs[lowCluster.key()] = true; + if (uppCluster.isPhase2()) + collectedPhase2OTs[uppCluster.key()] = true; } else { - LogTrace("TrackClusterRemoverPhase2")<<"it is not a VHits."; - } + LogTrace("TrackClusterRemoverPhase2") << "it is not a VHits."; + } } } diff --git a/RecoTracker/CkfPattern/src/PrintoutHelper.cc b/RecoTracker/CkfPattern/src/PrintoutHelper.cc index 024c28c661d9c..3fa643655cb1d 100644 --- a/RecoTracker/CkfPattern/src/PrintoutHelper.cc +++ b/RecoTracker/CkfPattern/src/PrintoutHelper.cc @@ -101,14 +101,13 @@ std::string PrintoutHelper::regressionTest(const TrackerGeometry& tracker, std:: } else buffer << "candidate with invalid last measurement state!" << std::endl; } - buffer<<"================================================="; - buffer<<"=========== Traj in details =====================\n"; - for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); - it != unsmoothedResult.end(); it++) { - for(auto hit : it->measurements()){ - buffer<< "measurement : " << hit.recHit()->geographicalId().rawId() << std::endl; + buffer << "================================================="; + buffer << "=========== Traj in details =====================\n"; + for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) { + for (auto hit : it->measurements()) { + buffer << "measurement : " << hit.recHit()->geographicalId().rawId() << std::endl; } - buffer<<"================\n"; + buffer << "================\n"; } return buffer.str(); } diff --git a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc index d014f2be7d47e..d3e89db5e9ec2 100644 --- a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc +++ b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc @@ -33,9 +33,8 @@ class TrackerRecoGeometryESProducer : public edm::ESProducer { using namespace edm; -TrackerRecoGeometryESProducer::TrackerRecoGeometryESProducer(const edm::ParameterSet &p) - : _usePhase2Stacks(p.getParameter<bool>("usePhase2Stacks")) -{ +TrackerRecoGeometryESProducer::TrackerRecoGeometryESProducer(const edm::ParameterSet &p) + : _usePhase2Stacks(p.getParameter<bool>("usePhase2Stacks")) { auto c = setWhatProduced(this); // 08-Oct-2007 - Patrick Janot @@ -52,7 +51,8 @@ std::unique_ptr<GeometricSearchTracker> TrackerRecoGeometryESProducer::produce( TrackerGeometry const &tG = iRecord.get(geomToken_); GeometricSearchTrackerBuilder builder; - return std::unique_ptr<GeometricSearchTracker>(builder.build(tG.trackerDet(), &tG, &iRecord.get(tTopToken_), _usePhase2Stacks)); + return std::unique_ptr<GeometricSearchTracker>( + builder.build(tG.trackerDet(), &tG, &iRecord.get(tTopToken_), _usePhase2Stacks)); } void TrackerRecoGeometryESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index efdcf7a2e0cde..364f91ee33896 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -350,7 +350,6 @@ void MeasurementTrackerEventProducer::updateStrips(const edm::Event& event, //FIXME: just a temporary solution for phase2! void MeasurementTrackerEventProducer::updatePhase2OT(const edm::Event& event, Phase2OTMeasurementDetSet& thePh2OTDets) const { - thePh2OTDets.setEmpty(); // Phase2OT Clusters diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index d606cbf28c264..d4426e2242f7c 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -77,7 +77,7 @@ MeasurementTrackerImpl::MeasurementTrackerImpl(const BadStripCutsDet& badStripCu const PixelClusterParameterEstimator* pixelCPE, const StripClusterParameterEstimator* stripCPE, const SiStripRecHitMatcher* hitMatcher, - const VectorHitBuilderEDProducer* ph2hitMatcher, + const VectorHitBuilderEDProducer* ph2hitMatcher, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeom, const GeometricSearchTracker* geometricSearchTracker, @@ -285,7 +285,7 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) { //since the Stack will be composed by PS or 2S, //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. - theStackDets.push_back(TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE() )); + theStackDets.push_back(TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE())); } void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) { diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h index fd979dbf58005..858dc57fb319d 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h @@ -56,7 +56,7 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker { const PixelClusterParameterEstimator* pixelCPE, const StripClusterParameterEstimator* stripCPE, const SiStripRecHitMatcher* hitMatcher, - const VectorHitBuilderEDProducer* ph2hitMatcher, + const VectorHitBuilderEDProducer* ph2hitMatcher, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeom, const GeometricSearchTracker* geometricSearchTracker, diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index 5fce1d99addba..e54e929f97224 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -5,14 +5,10 @@ using namespace std; -TkStackMeasurementDet::TkStackMeasurementDet( const StackGeomDet* gdet, - const VectorHitBuilderEDProducer* matcher, - const PixelClusterParameterEstimator* cpe) : - MeasurementDet(gdet), - theMatcher(matcher), - thePixelCPE(cpe), - theLowerDet(nullptr), theUpperDet(nullptr) -{} +TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet, + const VectorHitBuilderEDProducer* matcher, + const PixelClusterParameterEstimator* cpe) + : MeasurementDet(gdet), theMatcher(matcher), thePixelCPE(cpe), theLowerDet(nullptr), theUpperDet(nullptr) {} void TkStackMeasurementDet::init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet) { theLowerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet); @@ -31,91 +27,91 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj HitCollectorForRecHits collector( &fastGeomDet(), theMatcher, theCPE, result ); collectRecHits(ts, collector); */ - if ( isEmpty(data.phase2OTData())== true ) return result; - LogTrace("MeasurementTracker")<<" is not empty"; - if (isActive(data) == false) return result; - LogTrace("MeasurementTracker")<<" and is active"; - - - const Phase2TrackerCluster1D* begin=0; - if (0 != data.phase2OTData().handle()->data().size()) { - begin = &(data.phase2OTData().handle()->data().front()); + if (isEmpty(data.phase2OTData()) == true) + return result; + LogTrace("MeasurementTracker") << " is not empty"; + if (isActive(data) == false) + return result; + LogTrace("MeasurementTracker") << " and is active"; + + const Phase2TrackerCluster1D* begin = nullptr; + if (!data.phase2OTData().handle()->data().empty()) { + begin = &(data.phase2OTData().handle()->data().front()); } - VectorHitBuilderAlgorithmBase * algo = theMatcher->algo() ; + VectorHitBuilderAlgorithmBase* algo = theMatcher->algo(); //VectorHitBuilderAlgorithm* vhalgo = dynamic_cast<VectorHitBuilderAlgorithm *>(algobase); LogTrace("MeasurementTracker") << "TkStackMeasurementDet::recHits algo has been set" << std::endl; - const detset & lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); - const detset & upperDetSet = data.phase2OTData().detSet(upperDet()->index()); - - LogTrace("MeasurementTracker")<<" DetSets set with sizes:" << lowerDetSet.size() << " and " << upperDetSet.size() << "!"; - result.reserve(lowerDetSet.size()>upperDetSet.size() ? lowerDetSet.size() : upperDetSet.size()); + const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); + const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index()); + LogTrace("MeasurementTracker") << " DetSets set with sizes:" << lowerDetSet.size() << " and " << upperDetSet.size() + << "!"; + result.reserve(lowerDetSet.size() > upperDetSet.size() ? lowerDetSet.size() : upperDetSet.size()); - for ( const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++ cil ) { - - if (cil < begin){ - edm::LogError("IndexMisMatch")<<"TkStackMeasurementDet cannot create hit because of index mismatch."; + for (const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++cil) { + if (cil < begin) { + edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; return result; } - unsigned int indexl = cil-begin; - LogTrace("MeasurementTracker")<<" index cluster lower" << indexl << " on detId " << fastGeomDet().geographicalId().rawId(); - - for ( const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ ciu ) { - - unsigned int indexu = ciu-begin; - if (ciu < begin){ - edm::LogError("IndexMisMatch")<<"TkStackMeasurementDet cannot create hit because of index mismatch."; + unsigned int indexl = cil - begin; + LogTrace("MeasurementTracker") << " index cluster lower" << indexl << " on detId " + << fastGeomDet().geographicalId().rawId(); + + for (const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ciu) { + unsigned int indexu = ciu - begin; + if (ciu < begin) { + edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; return result; } - LogTrace("VectorHitBuilderAlgorithm")<<" index cluster upper " << indexu; + LogTrace("VectorHitBuilderAlgorithm") << " index cluster upper " << indexu; - if(data.phase2OTClustersToSkip().empty() or ((not data.phase2OTClustersToSkip()[indexl]) and (not data.phase2OTClustersToSkip()[indexu])) ) { - Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo( data.phase2OTData().handle(), cil ); - Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo( data.phase2OTData().handle(), ciu ); + if (data.phase2OTClustersToSkip().empty() or + ((not data.phase2OTClustersToSkip()[indexl]) and (not data.phase2OTClustersToSkip()[indexu]))) { + Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo(data.phase2OTData().handle(), cil); + Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo(data.phase2OTData().handle(), ciu); //ERICA:I would have prefer to keep buildVectorHits ... - VectorHit vh = algo->buildVectorHit( &specificGeomDet(), clusterLower, clusterUpper); + VectorHit vh = algo->buildVectorHit(&specificGeomDet(), clusterLower, clusterUpper); LogTrace("MeasurementTracker") << "TkStackMeasurementDet::rechits adding VectorHits!" << std::endl; LogTrace("MeasurementTracker") << vh << std::endl; - result.push_back( std::make_shared<VectorHit>( vh )); + result.push_back(std::make_shared<VectorHit>(vh)); } } - } return result; } - - -bool TkStackMeasurementDet::measurements( const TrajectoryStateOnSurface& stateOnThisDet, - const MeasurementEstimator& est, const MeasurementTrackerEvent & data, - TempMeasurements & result) const { - LogDebug("MeasurementTracker")<<"TkStackMeasurementDet::measurements"; +bool TkStackMeasurementDet::measurements(const TrajectoryStateOnSurface& stateOnThisDet, + const MeasurementEstimator& est, + const MeasurementTrackerEvent& data, + TempMeasurements& result) const { + LogDebug("MeasurementTracker") << "TkStackMeasurementDet::measurements"; if (!isActive(data)) { result.add(theInactiveHit, 0.F); return true; } - - LogTrace("MeasurementTracker")<<" is active"; + + LogTrace("MeasurementTracker") << " is active"; auto oldSize = result.size(); - MeasurementDet::RecHitContainer && allHits = recHits(stateOnThisDet, data); + MeasurementDet::RecHitContainer&& allHits = recHits(stateOnThisDet, data); - for (auto && hit : allHits) { - std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, *hit); + for (auto&& hit : allHits) { + std::pair<bool, double> diffEst = est.estimate(stateOnThisDet, *hit); //LogTrace("MeasurementTracker")<< "State on this Det: " << stateOnThisDet ; - LogDebug("MeasurementTracker")<< "New vh added with chi2: " << diffEst.second ; - if ( diffEst.first) + LogDebug("MeasurementTracker") << "New vh added with chi2: " << diffEst.second; + if (diffEst.first) result.add(std::move(hit), diffEst.second); } - if (result.size()>oldSize) return true; + if (result.size() > oldSize) + return true; // create a TrajectoryMeasurement with an invalid RecHit and zero estimate result.add(theMissingHit, 0.F); - LogDebug("MeasurementTracker")<< "adding missing hit"; + LogDebug("MeasurementTracker") << "adding missing hit"; return false; } diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index 9d6722e3e464f..df1e1af4c48b1 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -14,14 +14,16 @@ class TkStackMeasurementDet final : public MeasurementDet { public: - TkStackMeasurementDet(const StackGeomDet* gdet, const VectorHitBuilderEDProducer* matcher, const PixelClusterParameterEstimator* cpe); + TkStackMeasurementDet(const StackGeomDet* gdet, + const VectorHitBuilderEDProducer* matcher, + const PixelClusterParameterEstimator* cpe); void init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet); RecHitContainer recHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent& data) const override; const StackGeomDet& specificGeomDet() const { return static_cast<StackGeomDet const&>(fastGeomDet()); } typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; - + typedef edmNew::DetSet<Phase2TrackerCluster1D> detset; typedef detset::const_iterator const_iterator; @@ -33,12 +35,13 @@ class TkStackMeasurementDet final : public MeasurementDet { const TkPhase2OTMeasurementDet* lowerDet() const { return theLowerDet; } const TkPhase2OTMeasurementDet* upperDet() const { return theUpperDet; } - /// return TRUE if both lower and upper components are active bool isActive(const MeasurementTrackerEvent& data) const override { return lowerDet()->isActive(data) && upperDet()->isActive(data); } - bool isEmpty(const Phase2OTMeasurementDetSet & data) const {return data.empty(lowerDet()->index()) || data.empty(upperDet()->index());} + bool isEmpty(const Phase2OTMeasurementDetSet& data) const { + return data.empty(lowerDet()->index()) || data.empty(upperDet()->index()); + } /// return TRUE if at least one of the lower and upper components has badChannels bool hasBadComponents(const TrajectoryStateOnSurface& tsos, const MeasurementTrackerEvent& data) const override { diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h index ccdf22fe6302f..2a2fc822a318c 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h @@ -408,8 +408,9 @@ class PxMeasurementDetSet { //FIXME:just temporary solution for phase2 OT that works! class Phase2OTMeasurementConditionSet { public: - Phase2OTMeasurementConditionSet(const VectorHitBuilderEDProducer* ph2matcher, const ClusterParameterEstimator<Phase2TrackerCluster1D> *cpe) : - thePhase2Matcher(ph2matcher), theCPE(cpe) {} + Phase2OTMeasurementConditionSet(const VectorHitBuilderEDProducer* ph2matcher, + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe) + : thePhase2Matcher(ph2matcher), theCPE(cpe) {} void init(int size); @@ -418,7 +419,7 @@ class Phase2OTMeasurementConditionSet { int find(unsigned int jd, int i = 0) const { return std::lower_bound(id_.begin() + i, id_.end(), jd) - id_.begin(); } const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe() const { return theCPE; } - const VectorHitBuilderEDProducer* matcher() const { return thePhase2Matcher;} + const VectorHitBuilderEDProducer* matcher() const { return thePhase2Matcher; } bool isActiveThisPeriod(int i) const { return activeThisPeriod_[i]; } /** \brief Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). @@ -431,7 +432,7 @@ class Phase2OTMeasurementConditionSet { // Globals (not-per-event) const VectorHitBuilderEDProducer* thePhase2Matcher; const ClusterParameterEstimator<Phase2TrackerCluster1D>* theCPE; - + // Locals, per-event std::vector<unsigned int> id_; std::vector<bool> activeThisPeriod_; diff --git a/RecoTracker/Record/interface/CkfComponentsRecord.h b/RecoTracker/Record/interface/CkfComponentsRecord.h index 6d64c5709ced9..f6d513f77645f 100644 --- a/RecoTracker/Record/interface/CkfComponentsRecord.h +++ b/RecoTracker/Record/interface/CkfComponentsRecord.h @@ -39,4 +39,3 @@ class CkfComponentsRecord SiPixelLorentzAngleRcd, SiStripLorentzAngleDepRcd> > {}; #endif - diff --git a/RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h b/RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h index 834ae11b28432..893f7fdf1b2b9 100644 --- a/RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h +++ b/RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h @@ -17,9 +17,9 @@ class GeometricSearchTrackerBuilder { ~GeometricSearchTrackerBuilder() {} GeometricSearchTracker* build(const GeometricDet* theGeometricTracker, - const TrackerGeometry* theGeomDetGeometry, - const TrackerTopology* tTopo, - const bool usePhase2Stacks = false) __attribute__ ((cold)); + const TrackerGeometry* theGeomDetGeometry, + const TrackerTopology* tTopo, + const bool usePhase2Stacks = false) __attribute__((cold)); }; #endif diff --git a/RecoTracker/TkDetLayers/src/GeometricSearchTrackerBuilder.cc b/RecoTracker/TkDetLayers/src/GeometricSearchTrackerBuilder.cc index 4ed5853b6b67f..51cd455a23717 100644 --- a/RecoTracker/TkDetLayers/src/GeometricSearchTrackerBuilder.cc +++ b/RecoTracker/TkDetLayers/src/GeometricSearchTrackerBuilder.cc @@ -19,14 +19,10 @@ using namespace std; - -GeometricSearchTracker* -GeometricSearchTrackerBuilder::build(const GeometricDet* theGeometricTracker, - const TrackerGeometry* theGeomDetGeometry, - const TrackerTopology* tTopo, - const bool usePhase2Stacks) -{ - +GeometricSearchTracker* GeometricSearchTrackerBuilder::build(const GeometricDet* theGeometricTracker, + const TrackerGeometry* theGeomDetGeometry, + const TrackerTopology* tTopo, + const bool usePhase2Stacks) { PixelBarrelLayerBuilder aPixelBarrelLayerBuilder; Phase2OTBarrelLayerBuilder aPhase2OTBarrelLayerBuilder; PixelForwardLayerBuilder<PixelBlade, PixelForwardLayer> aPixelForwardLayerBuilder; @@ -100,9 +96,10 @@ GeometricSearchTrackerBuilder::build(const GeometricDet* theGeometricTracker, if ((*it)->type() == GeometricDet::OTPhase2Barrel) { vector<const GeometricDet*> theTOBGeometricDetLayers = (*it)->components(); - for(vector<const GeometricDet*>::const_iterator it2=theTOBGeometricDetLayers.begin(); - it2!=theTOBGeometricDetLayers.end(); it2++){ - theTOBLayers.push_back( aPhase2OTBarrelLayerBuilder.build(*it2,theGeomDetGeometry,useBrothers) ); + for (vector<const GeometricDet*>::const_iterator it2 = theTOBGeometricDetLayers.begin(); + it2 != theTOBGeometricDetLayers.end(); + it2++) { + theTOBLayers.push_back(aPhase2OTBarrelLayerBuilder.build(*it2, theGeomDetGeometry, useBrothers)); } } @@ -172,12 +169,13 @@ GeometricSearchTrackerBuilder::build(const GeometricDet* theGeometricTracker, vector<const GeometricDet*> theTIDGeometricDetLayers = (*it)->components(); bool useBrothers = !usePhase2Stacks; - for(vector<const GeometricDet*>::const_iterator it2=theTIDGeometricDetLayers.begin(); - it2!=theTIDGeometricDetLayers.end(); it2++){ - if((*it2)->positionBounds().z() < 0) - theNegTIDLayers.push_back( aPhase2EndcapLayerBuilder.build(*it2,theGeomDetGeometry,useBrothers) ); - if((*it2)->positionBounds().z() > 0) - thePosTIDLayers.push_back( aPhase2EndcapLayerBuilder.build(*it2,theGeomDetGeometry,useBrothers) ); + for (vector<const GeometricDet*>::const_iterator it2 = theTIDGeometricDetLayers.begin(); + it2 != theTIDGeometricDetLayers.end(); + it2++) { + if ((*it2)->positionBounds().z() < 0) + theNegTIDLayers.push_back(aPhase2EndcapLayerBuilder.build(*it2, theGeomDetGeometry, useBrothers)); + if ((*it2)->positionBounds().z() > 0) + thePosTIDLayers.push_back(aPhase2EndcapLayerBuilder.build(*it2, theGeomDetGeometry, useBrothers)); } } diff --git a/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.cc index 64be320013f11..bd8beefb265dd 100644 --- a/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.cc @@ -5,9 +5,8 @@ using namespace edm; using namespace std; Phase2EndcapLayer* Phase2EndcapLayerBuilder::build(const GeometricDet* aPhase2EndcapLayer, - const TrackerGeometry* theGeomDetGeometry, - const bool useBrothers) -{ + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) { LogTrace("TkDetLayers") << "Phase2EndcapLayerBuilder::build"; vector<const GeometricDet*> theGeometricRings = aPhase2EndcapLayer->components(); LogTrace("TkDetLayers") << "theGeometricRings.size(): " << theGeometricRings.size(); @@ -15,12 +14,12 @@ Phase2EndcapLayer* Phase2EndcapLayerBuilder::build(const GeometricDet* aPhase2En Phase2EndcapRingBuilder myBuilder; vector<const Phase2EndcapRing*> thePhase2EndcapRings; - for(vector<const GeometricDet*>::const_iterator it=theGeometricRings.begin(); - it!=theGeometricRings.end();it++){ - // if we are in the phaseII OT, it will use the brothers to build pt modules - // if we are in the phaseII pixel detector, it will not - thePhase2EndcapRings.push_back(myBuilder.build( *it,theGeomDetGeometry,useBrothers )); + for (vector<const GeometricDet*>::const_iterator it = theGeometricRings.begin(); it != theGeometricRings.end(); + it++) { + // if we are in the phaseII OT, it will use the brothers to build pt modules + // if we are in the phaseII pixel detector, it will not + thePhase2EndcapRings.push_back(myBuilder.build(*it, theGeomDetGeometry, useBrothers)); } - return new Phase2EndcapLayer(thePhase2EndcapRings,useBrothers); + return new Phase2EndcapLayer(thePhase2EndcapRings, useBrothers); } diff --git a/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.h b/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.h index f695b399f2125..b577b5b8c6380 100644 --- a/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.h +++ b/RecoTracker/TkDetLayers/src/Phase2EndcapLayerBuilder.h @@ -15,8 +15,8 @@ class Phase2EndcapLayerBuilder { public: Phase2EndcapLayerBuilder(){}; Phase2EndcapLayer* build(const GeometricDet* aPhase2EndcapLayer, - const TrackerGeometry* theGeomDetGeometry, - const bool useBrothers) __attribute__ ((cold)); + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) __attribute__((cold)); }; #pragma GCC visibility pop diff --git a/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc index 69bfe5c15ebc9..2df7298f9ad94 100644 --- a/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2EndcapRingBuilder.cc @@ -6,11 +6,10 @@ using namespace edm; using namespace std; Phase2EndcapRing* Phase2EndcapRingBuilder::build(const GeometricDet* aPhase2EndcapRing, - const TrackerGeometry* theGeomDetGeometry, - const bool useBrothers) -{ - vector<const GeometricDet*> allGeometricDets = aPhase2EndcapRing->components(); - vector<const GeometricDet*> compGeometricDets; + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) { + vector<const GeometricDet*> allGeometricDets = aPhase2EndcapRing->components(); + vector<const GeometricDet*> compGeometricDets; LogDebug("TkDetLayers") << "Phase2EndcapRingBuilder with #Modules: " << allGeometricDets.size() << std::endl; vector<const GeomDet*> frontGeomDets; diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.cc index 66304a77d886b..81c43d72e3158 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.cc @@ -7,10 +7,9 @@ using namespace std; using namespace edm; Phase2OTBarrelLayer* Phase2OTBarrelLayerBuilder::build(const GeometricDet* aPhase2OTBarrelLayer, - const TrackerGeometry* theGeomDetGeometry, - const bool useBrothers) -{ - // This builder is very similar to TOBLayer one. Most of the code should be put in a + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) { + // This builder is very similar to TOBLayer one. Most of the code should be put in a // common place. LogTrace("TkDetLayers") << "Phase2OTBarrelLayerBuilder::build"; @@ -43,17 +42,16 @@ Phase2OTBarrelLayer* Phase2OTBarrelLayerBuilder::build(const GeometricDet* aPhas meanR += theGeometricDetRods[index]->positionBounds().perp(); if (!theGeometricDetRods.empty()) - meanR/=(double) theGeometricDetRods.size(); - - for(unsigned int index=0; index!=theGeometricDetRods.size(); index++){ - if(theGeometricDetRods[index]->positionBounds().perp() < meanR) - theInnerRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], - theGeomDetGeometry, useBrothers) ); + meanR /= (double)theGeometricDetRods.size(); - if(theGeometricDetRods[index]->positionBounds().perp() > meanR) - theOuterRods.push_back(myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], - theGeomDetGeometry, useBrothers) ); + for (unsigned int index = 0; index != theGeometricDetRods.size(); index++) { + if (theGeometricDetRods[index]->positionBounds().perp() < meanR) + theInnerRods.push_back( + myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], theGeomDetGeometry, useBrothers)); + if (theGeometricDetRods[index]->positionBounds().perp() > meanR) + theOuterRods.push_back( + myPhase2OTBarrelRodBuilder.build(theGeometricDetRods[index], theGeomDetGeometry, useBrothers)); } if (theGeometricDetRings.empty()) @@ -69,13 +67,12 @@ Phase2OTBarrelLayer* Phase2OTBarrelLayerBuilder::build(const GeometricDet* aPhas // properly calculate the meanR value to separate rod in inner/outer. double centralZ = 0.0; - - for(vector<const GeometricDet*>::const_iterator it=theGeometricDetRings.begin(); - it!=theGeometricDetRings.end();it++){ - if((*it)->positionBounds().z() < centralZ) - theNegativeRings.push_back(myPhase2EndcapRingBuilder.build( *it,theGeomDetGeometry,useBrothers )); - if((*it)->positionBounds().z() > centralZ) - thePositiveRings.push_back(myPhase2EndcapRingBuilder.build( *it,theGeomDetGeometry,useBrothers )); + for (vector<const GeometricDet*>::const_iterator it = theGeometricDetRings.begin(); it != theGeometricDetRings.end(); + it++) { + if ((*it)->positionBounds().z() < centralZ) + theNegativeRings.push_back(myPhase2EndcapRingBuilder.build(*it, theGeomDetGeometry, useBrothers)); + if ((*it)->positionBounds().z() > centralZ) + thePositiveRings.push_back(myPhase2EndcapRingBuilder.build(*it, theGeomDetGeometry, useBrothers)); } return new Phase2OTtiltedBarrelLayer(theInnerRods, theOuterRods, theNegativeRings, thePositiveRings); diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.h b/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.h index 93a57436d3977..340193c50cc71 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.h +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelLayerBuilder.h @@ -15,10 +15,8 @@ class Phase2OTBarrelLayerBuilder { public: Phase2OTBarrelLayerBuilder(){}; Phase2OTBarrelLayer* build(const GeometricDet* aPhase2OTBarrelLayer, - const TrackerGeometry* theGeomDetGeometry, - const bool useBrothers = true) __attribute__ ((cold)); - - + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers = true) __attribute__((cold)); }; #pragma GCC visibility pop diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.cc index 0e377521e329e..b9cb3e4a22185 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.cc @@ -61,8 +61,10 @@ Phase2OTBarrelRod::Phase2OTBarrelRod(vector<const GeomDet*>& innerDets, << " , " << (**i).position().perp() << " , " << (**i).position().eta() << " , " << (**i).position().phi(); } - if(theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) LogDebug("TkDetLayers") << "==== with stacks =====" ; - if(!theInnerDetBrothers.empty() && !theOuterDetBrothers.empty()) LogDebug("TkDetLayers") << "==== without stacks =====" ; + if (theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) + LogDebug("TkDetLayers") << "==== with stacks ====="; + if (!theInnerDetBrothers.empty() && !theOuterDetBrothers.empty()) + LogDebug("TkDetLayers") << "==== without stacks ====="; for (vector<const GeomDet*>::const_iterator i = theOuterDets.begin(); i != theOuterDets.end(); i++) { LogDebug("TkDetLayers") << "outer Phase2OTBarrelRod's Det pos z,perp,eta,phi: " << (**i).position().z() << " , " @@ -200,7 +202,8 @@ bool Phase2OTBarrelRod::addClosest(const TrajectoryStateOnSurface& tsos, vector<DetGroup>& brotherresult) const { const vector<const GeomDet*>& sRod(subRod(crossing.subLayerIndex())); bool firstgroup = CompatibleDetToGroupAdder::add(*sRod[crossing.closestDetIndex()], tsos, prop, est, result); - if(theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) return firstgroup; + if (theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) + return firstgroup; // it assumes that the closestDetIndex is ok also for the brother detectors: the crossing is NOT recomputed const vector<const GeomDet*>& sRodBrothers(subRodBrothers(crossing.subLayerIndex())); @@ -272,7 +275,8 @@ void Phase2OTBarrelRod::searchNeighbors(const TrajectoryStateOnSurface& tsos, break; if (!Adder::add(*sRod[idet], tsos, prop, est, result)) break; - if(theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) break; + if (theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) + break; // If the two above checks are passed also the brother module will be added with no further checks Adder::add(*sBrotherRod[idet], tsos, prop, est, brotherresult); } @@ -281,7 +285,8 @@ void Phase2OTBarrelRod::searchNeighbors(const TrajectoryStateOnSurface& tsos, break; if (!Adder::add(*sRod[idet], tsos, prop, est, result)) break; - if(theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) break; + if (theInnerDetBrothers.empty() && theOuterDetBrothers.empty()) + break; // If the two above checks are passed also the brother module will be added with no further checks Adder::add(*sBrotherRod[idet], tsos, prop, est, brotherresult); } diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.h b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.h index 85e97a5a05cee..cf14dec6ac06d 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.h +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRod.h @@ -18,7 +18,8 @@ class Phase2OTBarrelRod final : public DetRod { Phase2OTBarrelRod(std::vector<const GeomDet*>& innerDets, std::vector<const GeomDet*>& outerDets, const std::vector<const GeomDet*>& innerDetBrothers = std::vector<const GeomDet*>(), - const std::vector<const GeomDet*>& outerDetBrothers = std::vector<const GeomDet*>()) __attribute__((cold)); + const std::vector<const GeomDet*>& outerDetBrothers = std::vector<const GeomDet*>()) + __attribute__((cold)); ~Phase2OTBarrelRod() override __attribute__((cold)); // GeometricSearchDet interface diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc index 0719e5980555b..0153f2bab2861 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc @@ -5,11 +5,10 @@ using namespace edm; using namespace std; Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2OTBarrelRod, - const TrackerGeometry* theGeomDetGeometry, - const bool useBrothers) -{ + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers) { vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->components(); -// vector<const GeometricDet*> compGeometricDets; + // vector<const GeometricDet*> compGeometricDets; LogDebug("TkDetLayers") << "Phase2OTBarrelRodBuilder with #Modules: " << allGeometricDets.size() << std::endl; LogDebug("TkDetLayers") << " useBrothers: " << useBrothers << std::endl; @@ -20,39 +19,55 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 double meanR = 0; - if(!useBrothers){ - - for(vector<const GeometricDet*>::const_iterator compGeometricDets=allGeometricDets.begin(); compGeometricDets!=allGeometricDets.end();compGeometricDets++){ + if (!useBrothers) { + for (vector<const GeometricDet*>::const_iterator compGeometricDets = allGeometricDets.begin(); + compGeometricDets != allGeometricDets.end(); + compGeometricDets++) { //LogTrace("TkDetLayers") << " compGeometricDets.positionBounds().perp() " << (*compGeometricDets)->positionBounds().perp() << std::endl; meanR = meanR + (*compGeometricDets)->positionBounds().perp(); } - meanR = meanR/allGeometricDets.size(); + meanR = meanR / allGeometricDets.size(); LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; +<<<<<<< HEAD for(vector<const GeometricDet*>::const_iterator compGeometricDets=allGeometricDets.begin(); compGeometricDets!=allGeometricDets.end(); compGeometricDets++){ const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*compGeometricDets)->geographicalId() ); if( (*compGeometricDets)->positionBounds().perp() < meanR) +======= + + for (vector<const GeometricDet*>::const_iterator compGeometricDets = allGeometricDets.begin(); + compGeometricDets != allGeometricDets.end(); + compGeometricDets++) { + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*compGeometricDets)->geographicalID()); + + if ((*compGeometricDets)->positionBounds().perp() < meanR) +>>>>>>> apply code checks innerGeomDets.push_back(theGeomDet); - - if( (*compGeometricDets)->positionBounds().perp() > meanR) + + if ((*compGeometricDets)->positionBounds().perp() > meanR) outerGeomDets.push_back(theGeomDet); } - - LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ; - LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ; - - return new Phase2OTBarrelRod(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers); +<<<<<<< HEAD +======= + LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size(); + LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size(); + + return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); + + } else { +>>>>>>> apply code checks vector<const GeometricDet*> compGeometricDets; - + vector<const GeomDet*> innerGeomDetBrothers; vector<const GeomDet*> outerGeomDetBrothers; - + double meanRBrothers = 0; - for(vector<const GeometricDet*>::const_iterator it=allGeometricDets.begin(); it!=allGeometricDets.end();it++){ - compGeometricDets = (*it)->components(); - if (compGeometricDets.size() != 2){ + for (vector<const GeometricDet*>::const_iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); + it++) { + compGeometricDets = (*it)->components(); + if (compGeometricDets.size() != 2) { LogDebug("TkDetLayers") << " Stack not with two components but with " << compGeometricDets.size() << std::endl; } else { //LogTrace("TkDetLayers") << " compGeometricDets[0]->positionBounds().perp() " << compGeometricDets[0]->positionBounds().perp() << std::endl; @@ -60,42 +75,39 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 meanR = meanR + compGeometricDets[0]->positionBounds().perp(); meanRBrothers = meanRBrothers + compGeometricDets[1]->positionBounds().perp(); } - } - meanR = meanR/allGeometricDets.size(); - meanRBrothers = meanRBrothers/allGeometricDets.size(); + meanR = meanR / allGeometricDets.size(); + meanRBrothers = meanRBrothers / allGeometricDets.size(); LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; LogDebug("TkDetLayers") << " meanR Upper " << meanRBrothers << std::endl; - - for(vector<const GeometricDet*>::iterator it=allGeometricDets.begin(); it!=allGeometricDets.end(); it++){ - compGeometricDets = (*it)->components(); - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( compGeometricDets[0]->geographicalId() ); - LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalId().rawId() << std::endl; - - if( compGeometricDets[0]->positionBounds().perp() < meanR) + + for (vector<const GeometricDet*>::iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) { + compGeometricDets = (*it)->components(); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalID()); + LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalID().rawId() << std::endl; + + if (compGeometricDets[0]->positionBounds().perp() < meanR) innerGeomDets.push_back(theGeomDet); - - if( compGeometricDets[0]->positionBounds().perp() > meanR) + + if (compGeometricDets[0]->positionBounds().perp() > meanR) outerGeomDets.push_back(theGeomDet); - - const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet( compGeometricDets[1]->geographicalId() ); - LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalId().rawId() << std::endl; - if( compGeometricDets[1]->positionBounds().perp() < meanRBrothers) + + const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalID()); + LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalID().rawId() << std::endl; + if (compGeometricDets[1]->positionBounds().perp() < meanRBrothers) innerGeomDetBrothers.push_back(theGeomDetBrother); - - if( compGeometricDets[1]->positionBounds().perp() > meanRBrothers) + + if (compGeometricDets[1]->positionBounds().perp() > meanRBrothers) outerGeomDetBrothers.push_back(theGeomDetBrother); } - - LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size() ; - LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size() ; - LogDebug("TkDetLayers") << "innerGeomDetsBro.size(): " << innerGeomDetBrothers.size() ; - LogDebug("TkDetLayers") << "outerGeomDetsBro.size(): " << outerGeomDetBrothers.size() ; - - return new Phase2OTBarrelRod(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers); - - } - return new Phase2OTBarrelRod(innerGeomDets,outerGeomDets,innerGeomDetBrothers,outerGeomDetBrothers); + LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size(); + LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size(); + LogDebug("TkDetLayers") << "innerGeomDetsBro.size(): " << innerGeomDetBrothers.size(); + LogDebug("TkDetLayers") << "outerGeomDetsBro.size(): " << outerGeomDetBrothers.size(); + + return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); + } + return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); } diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.h b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.h index 7a6876ec24adc..f51e0852451bb 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.h +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.h @@ -15,10 +15,8 @@ class Phase2OTBarrelRodBuilder { public: Phase2OTBarrelRodBuilder(){}; Phase2OTBarrelRod* build(const GeometricDet* thePhase2OTBarrelRod, - const TrackerGeometry* theGeomDetGeometry, - const bool useBrothers = true) __attribute__ ((cold)); - - + const TrackerGeometry* theGeomDetGeometry, + const bool useBrothers = true) __attribute__((cold)); }; #pragma GCC visibility pop diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h index e731e3e595e5c..92857dd689d7a 100644 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -23,38 +23,43 @@ class TrajectoryStateUpdator; -class SeedingOTEDProducer : public edm::stream::EDProducer<> -{ - - public: - +class SeedingOTEDProducer : public edm::stream::EDProducer<> { +public: explicit SeedingOTEDProducer(const edm::ParameterSet&); - virtual ~SeedingOTEDProducer(); - virtual void produce(edm::Event&, const edm::EventSetup&) override; + ~SeedingOTEDProducer() override; + void produce(edm::Event&, const edm::EventSetup&) override; static void fillDescriptions(edm::ConfigurationDescriptions&); - TrajectorySeedCollection run( edm::Handle< VectorHitCollectionNew > ); - unsigned int checkLayer( unsigned int iidd ); - std::vector<VectorHit> collectVHsOnLayer( edm::Handle< VectorHitCollectionNew >, unsigned int ); - void printVHsOnLayer( edm::Handle< VectorHitCollectionNew >, unsigned int ); - const TrajectoryStateOnSurface buildInitialTSOS( VectorHit& ); - AlgebraicSymMatrix assign44To55( AlgebraicSymMatrix ); - std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator&, const TrackingRecHit& hit); + TrajectorySeedCollection run(edm::Handle<VectorHitCollectionNew>); + unsigned int checkLayer(unsigned int iidd); + std::vector<VectorHit> collectVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); + void printVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); + const TrajectoryStateOnSurface buildInitialTSOS(VectorHit&); + AlgebraicSymMatrix assign44To55(AlgebraicSymMatrix); + std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, + const Propagator&, + const TrackingRecHit& hit); float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot); - float computeInverseMomentumError(VectorHit& vh, const float globalTheta, const MagneticField* magField, const double sigmaZ_beamSpot); + float computeInverseMomentumError(VectorHit& vh, + const float globalTheta, + const MagneticField* magField, + const double sigmaZ_beamSpot); - TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, const DetId& id, const Propagator& prop); + TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, + const edm::OwnVector<TrackingRecHit>& container, + const DetId& id, + const Propagator& prop); struct isInvalid { bool operator()(const TrajectoryMeasurement& measurement) { - return ( ((measurement).recHit() == 0) || !((measurement).recHit()->isValid()) || !((measurement).updatedState().isValid()) ); + return (((measurement).recHit() == nullptr) || !((measurement).recHit()->isValid()) || + !((measurement).updatedState().isValid())); } }; - private: - - edm::EDGetTokenT< VectorHitCollectionNew > vhProducerToken; +private: + edm::EDGetTokenT<VectorHitCollectionNew> vhProducerToken; const TrackerTopology* tkTopo; const MeasurementTracker* measurementTracker; const LayerMeasurements* layerMeasurements; diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 8606e5e9b27c8..d048057a51a17 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -16,30 +16,27 @@ #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf): - theUpdator(nullptr), - tkMeasEventToken( consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent")) ) -{ - vhProducerToken = consumes< VectorHitCollectionNew >(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); - beamSpotToken = consumes< reco::BeamSpot >(conf.getParameter<edm::InputTag>("beamSpotLabel")); +SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) + : theUpdator(nullptr), + tkMeasEventToken(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))) { + vhProducerToken = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); + beamSpotToken = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); updatorName = conf.getParameter<std::string>("updator"); produces<TrajectorySeedCollection>(); } - -SeedingOTEDProducer::~SeedingOTEDProducer() { -} -void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions){ +SeedingOTEDProducer::~SeedingOTEDProducer() {} + +void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.add<edm::InputTag>("src", edm::InputTag("siPhase2VectorHits","vectorHitsAccepted")); + desc.add<edm::InputTag>("src", edm::InputTag("siPhase2VectorHits", "vectorHitsAccepted")); desc.add<edm::InputTag>("trackerEvent", edm::InputTag("MeasurementTrackerEvent")); desc.add<edm::InputTag>("beamSpotLabel", edm::InputTag("offlineBeamSpot")); desc.add<std::string>("updator", std::string("KFUpdator")); descriptions.add("SeedingOTEDProducer", desc); } - -void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) -{ + +void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { std::cout << "SeedingOT::produce() begin" << std::endl; std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); @@ -51,16 +48,16 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) es.get<CkfComponentsRecord>().get(measurementTrackerHandle); measurementTracker = measurementTrackerHandle.product(); edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; - event.getByToken(tkMeasEventToken,measurementTrackerEvent); + event.getByToken(tkMeasEventToken, measurementTrackerEvent); layerMeasurements = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); - + edm::ESHandle<Chi2MeasurementEstimatorBase> est; - es.get<TrackingComponentsRecord>().get("Chi2",est); + es.get<TrackingComponentsRecord>().get("Chi2", est); estimator = est.product(); edm::ESHandle<Propagator> prop; - es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",prop); + es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial", prop); propagator = prop.product(); edm::ESHandle<MagneticField> magFieldHandle; @@ -79,49 +76,47 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) } // Get the vector hits - edm::Handle< VectorHitCollectionNew > vhs; + edm::Handle<VectorHitCollectionNew> vhs; event.getByToken(vhProducerToken, vhs); -/* + /* edm::ESHandle< ClusterParameterEstimator<Phase2TrackerCluster1D> > parameterestimator; es.get<TkStripCPERecord>().get(cpe, parameterestimator); const Phase2StripCPEGeometric & cpeOT(*parameterestimator); */ TrajectorySeedCollection const& tempSeeds = run(vhs); - for( TrajectorySeedCollection::const_iterator qIt = tempSeeds.begin(); qIt < tempSeeds.end(); ++qIt ) { - seedsWithVHs->push_back( *qIt ); + for (TrajectorySeedCollection::const_iterator qIt = tempSeeds.begin(); qIt < tempSeeds.end(); ++qIt) { + seedsWithVHs->push_back(*qIt); } seedsWithVHs->shrink_to_fit(); event.put(std::move(seedsWithVHs)); std::cout << "SeedingOT::produce() end" << std::endl; - } -TrajectorySeedCollection SeedingOTEDProducer::run( edm::Handle< VectorHitCollectionNew > VHs ){ - +TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { TrajectorySeedCollection result; std::cout << "-----------------------------" << std::endl; - printVHsOnLayer(VHs,1); - printVHsOnLayer(VHs,2); - printVHsOnLayer(VHs,3); - printVHsOnLayer(VHs,4); - printVHsOnLayer(VHs,5); - printVHsOnLayer(VHs,6); + printVHsOnLayer(VHs, 1); + printVHsOnLayer(VHs, 2); + printVHsOnLayer(VHs, 3); + printVHsOnLayer(VHs, 4); + printVHsOnLayer(VHs, 5); + printVHsOnLayer(VHs, 6); std::cout << "-----------------------------" << std::endl; //check if all the first three layers have VHs - std::vector<VectorHit> VHseedsL1 = collectVHsOnLayer(VHs,1); - std::vector<VectorHit> VHseedsL2 = collectVHsOnLayer(VHs,2); - std::vector<VectorHit> VHseedsL3 = collectVHsOnLayer(VHs,3); - if(VHseedsL1.empty() || VHseedsL2.empty() || VHseedsL3.empty()){ + std::vector<VectorHit> VHseedsL1 = collectVHsOnLayer(VHs, 1); + std::vector<VectorHit> VHseedsL2 = collectVHsOnLayer(VHs, 2); + std::vector<VectorHit> VHseedsL3 = collectVHsOnLayer(VHs, 3); + if (VHseedsL1.empty() || VHseedsL2.empty() || VHseedsL3.empty()) { std::cout << "------- seeds found: " << result.size() << " ------" << std::endl; std::cout << "- L1 or L2 or L3 are empty! -" << std::endl; std::cout << "-----------------------------" << std::endl; return result; } - + //seeds are built in the L3 of the OT const BarrelDetLayer* barrelOTLayer2 = measurementTracker->geometricSearchTracker()->tobLayers().at(1); std::cout << "VH seeds = " << VHseedsL3.size() << std::endl; @@ -131,32 +126,32 @@ TrajectorySeedCollection SeedingOTEDProducer::run( edm::Handle< VectorHitCollect Propagator* buildingPropagator = &*propagator->clone(); buildingPropagator->setPropagationDirection(alongMomentum); - for(auto hitL3 : VHseedsL3){ - + for (auto hitL3 : VHseedsL3) { //building a tsos out of a VectorHit std::cout << "\t1a) Building a seed for the VH: " << hitL3 << std::endl; const TrajectoryStateOnSurface initialTSOS = buildInitialTSOS(hitL3); - float signZ = copysign(1.0,initialTSOS.globalPosition().z()); - float signPz = copysign(1.0,initialTSOS.globalMomentum().z()); + float signZ = copysign(1.0, initialTSOS.globalPosition().z()); + float signPz = copysign(1.0, initialTSOS.globalMomentum().z()); std::cout << "\t initialTSOS : " << initialTSOS << std::endl; //set the direction of the propagator std::cout << "\t1b) Set the searchingPropagator direction: " << std::endl; - if(signZ*signPz > 0.0) + if (signZ * signPz > 0.0) searchingPropagator->setPropagationDirection(oppositeToMomentum); - if(signZ*signPz < 0.0) + if (signZ * signPz < 0.0) searchingPropagator->setPropagationDirection(alongMomentum); - if(searchingPropagator->propagationDirection() == alongMomentum) + if (searchingPropagator->propagationDirection() == alongMomentum) std::cout << "\t searchingPropagator along Momentum" << std::endl; - if(searchingPropagator->propagationDirection() == oppositeToMomentum) + if (searchingPropagator->propagationDirection() == oppositeToMomentum) std::cout << "\t ropagator opposite To Momentum" << std::endl; //find vHits in layer 2 std::cout << "-----------------------------" << std::endl; std::cout << "\t1c) Search/find hit in layer 2: " << std::endl; - std::vector<TrajectoryMeasurement> measurementsL2 = layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + std::vector<TrajectoryMeasurement> measurementsL2 = + layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); std::cout << "\t vh compatibles on L2: " << measurementsL2.size() << std::endl; //other options @@ -166,53 +161,57 @@ TrajectorySeedCollection SeedingOTEDProducer::run( edm::Handle< VectorHitCollect //auto && measurementsL2G = layerMeasurements->groupedMeasurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); //std::cout << "\t #try3 vh grouped compatibles: " << measurementsL2G.size() << std::endl; - - std::vector<TrajectoryMeasurement>::iterator measurementsL2end = std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid()); + std::vector<TrajectoryMeasurement>::iterator measurementsL2end = + std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid()); measurementsL2.erase(measurementsL2end, measurementsL2.end()); std::cout << "\t vh compatibles on L2(without invalidHit): " << measurementsL2.size() << std::endl; std::cout << "-----------------------------" << std::endl; - if(!measurementsL2.empty()){ + if (!measurementsL2.empty()) { //not sure if building it everytime takes time/memory const DetLayer* barrelOTLayer1 = measurementTracker->geometricSearchTracker()->tobLayers().at(0); - - for(auto mL2 : measurementsL2){ + for (auto mL2 : measurementsL2) { std::cout << "\t2a) Check the searchingPropagator direction: " << std::endl; - if(searchingPropagator->propagationDirection() == alongMomentum) + if (searchingPropagator->propagationDirection() == alongMomentum) std::cout << "\t searchingPropagator along Momentum" << std::endl; - if(searchingPropagator->propagationDirection() == oppositeToMomentum) + if (searchingPropagator->propagationDirection() == oppositeToMomentum) std::cout << "\t searchingPropagator opposite To Momentum" << std::endl; const TrackingRecHit* hitL2 = mL2.recHit().get(); std::cout << "\t2b) and the VH on layer 2: " << std::endl; const VectorHit* vhit = dynamic_cast<const VectorHit*>(hitL2); std::cout << "\t vh is valid >> " << (*vhit) << std::endl; - + //propagate to the L2 and update the TSOS std::cout << "\t2c) Propagation and update on L2: " << std::endl; - std::pair<bool, TrajectoryStateOnSurface> updatedTSOS = propagateAndUpdate(initialTSOS, *searchingPropagator, *hitL2); - if(!updatedTSOS.first) std::cout << "\t updatedTSOS on L2 is NOT valid : " << updatedTSOS.second << std::endl; - if(!updatedTSOS.first) continue; + std::pair<bool, TrajectoryStateOnSurface> updatedTSOS = + propagateAndUpdate(initialTSOS, *searchingPropagator, *hitL2); + if (!updatedTSOS.first) + std::cout << "\t updatedTSOS on L2 is NOT valid : " << updatedTSOS.second << std::endl; + if (!updatedTSOS.first) + continue; std::cout << "\t updatedTSOS is valid : " << updatedTSOS.second << std::endl; - std::cout << "\t chi2 VH/updatedTSOS : " << estimator->estimate(updatedTSOS.second, *hitL2).second << std::endl; - + std::cout << "\t chi2 VH/updatedTSOS : " << estimator->estimate(updatedTSOS.second, *hitL2).second + << std::endl; + //searching possible VHs in L1 std::cout << "\t2d) Search/find hit in layer 1: " << std::endl; - std::vector<TrajectoryMeasurement> measurementsL1 = layerMeasurements->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator); + std::vector<TrajectoryMeasurement> measurementsL1 = + layerMeasurements->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator); std::cout << "\t vh compatibles on L1: " << measurementsL1.size() << std::endl; - std::vector<TrajectoryMeasurement>::iterator measurementsL1end = std::remove_if(measurementsL1.begin(), measurementsL1.end(), isInvalid()); + std::vector<TrajectoryMeasurement>::iterator measurementsL1end = + std::remove_if(measurementsL1.begin(), measurementsL1.end(), isInvalid()); measurementsL1.erase(measurementsL1end, measurementsL1.end()); std::cout << "\t vh compatibles on L1(without invalidHit): " << measurementsL1.size() << std::endl; std::cout << "-----------------------------" << std::endl; - if(!measurementsL1.empty()){ - - for(auto mL1 : measurementsL1){ + if (!measurementsL1.empty()) { + for (auto mL1 : measurementsL1) { std::cout << "\t3a) Check the searchingPropagator direction: " << std::endl; - if(searchingPropagator->propagationDirection() == alongMomentum) + if (searchingPropagator->propagationDirection() == alongMomentum) std::cout << "\t searchingPropagator along Momentum" << std::endl; - if(searchingPropagator->propagationDirection() == oppositeToMomentum) + if (searchingPropagator->propagationDirection() == oppositeToMomentum) std::cout << "\t searchingPropagator opposite To Momentum" << std::endl; const TrackingRecHit* hitL1 = mL1.recHit().get(); @@ -222,12 +221,15 @@ TrajectorySeedCollection SeedingOTEDProducer::run( edm::Handle< VectorHitCollect //propagate to the L1 and update the TSOS std::cout << "\t3c) Propagation and update on L1: " << std::endl; - std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL1 = propagateAndUpdate(updatedTSOS.second, *searchingPropagator, *hitL1); - if(!updatedTSOSL1.first) std::cout << "\t updatedTSOS on L1 is NOT valid : " << updatedTSOSL1.second << std::endl; - if(!updatedTSOSL1.first) continue; + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL1 = + propagateAndUpdate(updatedTSOS.second, *searchingPropagator, *hitL1); + if (!updatedTSOSL1.first) + std::cout << "\t updatedTSOS on L1 is NOT valid : " << updatedTSOSL1.second << std::endl; + if (!updatedTSOSL1.first) + continue; std::cout << "\t updatedTSOS on L1 : " << updatedTSOSL1.second << std::endl; - std::cout << "\t chi2 VH/updatedTSOS : " << estimator->estimate(updatedTSOSL1.second, *hitL1).second << std::endl; - + std::cout << "\t chi2 VH/updatedTSOS : " << estimator->estimate(updatedTSOSL1.second, *hitL1).second + << std::endl; std::cout << "\t3d) Creation of the Seed: " << std::endl; // passSelection(updatedTSOS) : @@ -239,10 +241,10 @@ TrajectorySeedCollection SeedingOTEDProducer::run( edm::Handle< VectorHitCollect //building trajectory inside-out std::cout << "\t3e) Building trajectory inside-out: " << std::endl; - if(searchingPropagator->propagationDirection() == alongMomentum){ + if (searchingPropagator->propagationDirection() == alongMomentum) { buildingPropagator->setPropagationDirection(oppositeToMomentum); std::cout << "\t buildingPropagator opposite To Momentum" << std::endl; - } else if(searchingPropagator->propagationDirection() == oppositeToMomentum){ + } else if (searchingPropagator->propagationDirection() == oppositeToMomentum) { buildingPropagator->setPropagationDirection(alongMomentum); std::cout << "\t buildingPropagator along Momentum" << std::endl; } @@ -250,21 +252,23 @@ TrajectorySeedCollection SeedingOTEDProducer::run( edm::Handle< VectorHitCollect updatedTSOSL1.second.rescaleError(100); std::cout << "\t updatedTSOS on L1 : " << updatedTSOSL1.second << std::endl; - TrajectoryStateOnSurface updatedTSOSL1_final = theUpdator->update(updatedTSOSL1.second,*hitL1); - if UNLIKELY(!updatedTSOSL1_final.isValid()) continue; - std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); - std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); + TrajectoryStateOnSurface updatedTSOSL1_final = theUpdator->update(updatedTSOSL1.second, *hitL1); + if + UNLIKELY(!updatedTSOSL1_final.isValid()) continue; + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = + propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = + propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); std::cout << "\t updatedTSOS final on L3 : " << updatedTSOSL3_final.second << std::endl; - TrajectorySeed ts = createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(),*buildingPropagator); + TrajectorySeed ts = + createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(), *buildingPropagator); result.push_back(ts); } - } - + std::cout << "-----" << std::endl; } } - } std::cout << "-----------------------------" << std::endl; std::cout << "------- seeds found: " << result.size() << " ------" << std::endl; @@ -273,24 +277,24 @@ TrajectorySeedCollection SeedingOTEDProducer::run( edm::Handle< VectorHitCollect return result; } -unsigned int SeedingOTEDProducer::checkLayer( unsigned int iidd ){ +unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { StripSubdetector strip = StripSubdetector(iidd); unsigned int subid = strip.subdetId(); - if (subid == StripSubdetector::TIB || subid == StripSubdetector::TOB) { + if (subid == StripSubdetector::TIB || subid == StripSubdetector::TOB) { return tkTopo->layer(iidd); } return 0; } -std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer( edm::Handle< VectorHitCollectionNew > VHs, unsigned int layerNumber ){ - +std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<VectorHitCollectionNew> VHs, + unsigned int layerNumber) { const VectorHitCollectionNew& input = *VHs; std::vector<VectorHit> VHsOnLayer; - if (input.size() > 0 ) { + if (!input.empty()) { //std::cout << "initial VH collection size = " << input.size() << std::endl; for (auto DSViter : input) { - if(checkLayer(DSViter.id()) == layerNumber){ - for(auto vh : DSViter){ + if (checkLayer(DSViter.id()) == layerNumber) { + for (auto vh : DSViter) { VHsOnLayer.push_back(vh); } } @@ -302,12 +306,13 @@ std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer( edm::Handle< Vect return VHsOnLayer; } -void SeedingOTEDProducer::printVHsOnLayer( edm::Handle< VectorHitCollectionNew > VHs, unsigned int layerNumber ){ +void SeedingOTEDProducer::printVHsOnLayer(edm::Handle<VectorHitCollectionNew> VHs, unsigned int layerNumber) { const VectorHitCollectionNew& input = *VHs; - if (input.size() > 0 ) { + if (!input.empty()) { for (auto DSViter : input) { - for(auto vh : DSViter){ - if(checkLayer(DSViter.id()) == layerNumber) std::cout << " VH in layer " << layerNumber << " >> " << vh << std::endl; + for (auto vh : DSViter) { + if (checkLayer(DSViter.id()) == layerNumber) + std::cout << " VH in layer " << layerNumber << " >> " << vh << std::endl; } } } else { @@ -315,8 +320,7 @@ void SeedingOTEDProducer::printVHsOnLayer( edm::Handle< VectorHitCollectionNew > } } -const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS( VectorHit& vHit ){ - +const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& vHit) { //FIXME::charge is fine 1 every two times!! int charge = 1; //float pT = vHit.transverseMomentum(magField); @@ -324,9 +328,9 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS( VectorHit& float x = vHit.localPosition().x(); float y = vHit.localPosition().y(); float dx = vHit.localDirection().x(); - float dy = vHit.localDirection().y(); + float dy = vHit.localDirection().y(); // Pz and Dz should have the same sign - float signPz = copysign(1.0,vHit.globalPosition().z()); + float signPz = copysign(1.0, vHit.globalPosition().z()); // having fun with theta Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); @@ -336,15 +340,15 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS( VectorHit& //std::cout << "\tgv theta error : " << computeGlobalThetaError(vHit, beamSpot->sigmaZ()) << std::endl; //std::cout << "\tgv eta : " << gv.eta() << std::endl; // gv transform to local (lv) - const Local3DVector lv( vHit.det()->surface().toLocal( gv ) ); + const Local3DVector lv(vHit.det()->surface().toLocal(gv)); //std::cout << "\tlv : " << lv << std::endl; // replace dy with second component of the lv renormalized to the z component - dy = lv.y()/lv.z(); + dy = lv.y() / lv.z(); - LocalTrajectoryParameters ltpar2(charge/p, dx, dy, x, y, signPz); + LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p - mat[0][0] = pow(computeInverseMomentumError(vHit, theta,magField,beamSpot->sigmaZ()),2); + mat[0][0] = pow(computeInverseMomentumError(vHit, theta, magField, beamSpot->sigmaZ()), 2); //std::cout << "\tltraj : " << charge << "," << 1./p <<","<< dx <<","<< dy <<","<< x <<","<< y <<","<< signPz << std::endl; //std::cout << "\tmat : " << mat << std::endl; @@ -355,48 +359,54 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS( VectorHit& return tsos; } -AlgebraicSymMatrix SeedingOTEDProducer::assign44To55( AlgebraicSymMatrix mat44 ){ - if(mat44.num_row() != 4 || mat44.num_col() != 4) +AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) { + if (mat44.num_row() != 4 || mat44.num_col() != 4) assert("Wrong dimension! This should be a 4x4 matrix!"); - AlgebraicSymMatrix result(5,0); - for(int i = 1; i < 5; i++){ - for(int j = 1; j < 5; j++){ - result[i][j] = mat44[i-1][j-1]; + AlgebraicSymMatrix result(5, 0); + for (int i = 1; i < 5; i++) { + for (int j = 1; j < 5; j++) { + result[i][j] = mat44[i - 1][j - 1]; } } return result; } -std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit){ - TrajectoryStateOnSurface propTSOS = prop.propagate( initialTSOS, hit.det()->surface()); - TrajectoryStateOnSurface updatedTSOS = theUpdator->update(propTSOS,hit); +std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdate( + const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) { + TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); + TrajectoryStateOnSurface updatedTSOS = theUpdator->update(propTSOS, hit); //std::cout << "updatedTSOS : " << updatedTSOS << std::endl; - if UNLIKELY(!updatedTSOS.isValid()) return std::make_pair( false, updatedTSOS); - return std::make_pair( true, updatedTSOS); + if + UNLIKELY(!updatedTSOS.isValid()) return std::make_pair(false, updatedTSOS); + return std::make_pair(true, updatedTSOS); } -float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot){ - - double derivative = vh.globalPosition().perp()/(pow(vh.globalPosition().z(),2)+pow(vh.globalPosition().perp(),2)); - double derivative2 = pow(derivative,2); - return pow( derivative2*vh.lowerGlobalPosErr().czz()+derivative2*pow(sigmaZ_beamSpot,2), 0.5); - +float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) { + double derivative = + vh.globalPosition().perp() / (pow(vh.globalPosition().z(), 2) + pow(vh.globalPosition().perp(), 2)); + double derivative2 = pow(derivative, 2); + return pow(derivative2 * vh.lowerGlobalPosErr().czz() + derivative2 * pow(sigmaZ_beamSpot, 2), 0.5); } -float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, const float globalTheta, const MagneticField* magField, const double sigmaZ_beamSpot){ - +float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, + const float globalTheta, + const MagneticField* magField, + const double sigmaZ_beamSpot) { //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12) - float varianceInverseTransvMomentum = 1./12; - double derivativeTheta2 = pow(cos(globalTheta)/vh.transverseMomentum(magField),2); - double derivativeInverseTransvMomentum2 = pow(sin(globalTheta),2); + float varianceInverseTransvMomentum = 1. / 12; + double derivativeTheta2 = pow(cos(globalTheta) / vh.transverseMomentum(magField), 2); + double derivativeInverseTransvMomentum2 = pow(sin(globalTheta), 2); float thetaError = computeGlobalThetaError(vh, sigmaZ_beamSpot); - return pow(derivativeTheta2*pow(thetaError,2)+derivativeInverseTransvMomentum2*varianceInverseTransvMomentum,0.5); - + return pow(derivativeTheta2 * pow(thetaError, 2) + derivativeInverseTransvMomentum2 * varianceInverseTransvMomentum, + 0.5); } -TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, const DetId& id, const Propagator& prop) { -/* +TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& tsos, + const edm::OwnVector<TrackingRecHit>& container, + const DetId& id, + const Propagator& prop) { + /* //I have already propagator and updator //const Propagator* propagator = &(*propagatorHandle); //KFUpdator updator; @@ -417,7 +427,7 @@ TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& t if(state.first) updatedState = state.second; */ -/* + /* TrajectoryStateOnSurface state = (iHit==1) ? propagator->propagate(tsos, container[iHit].det()->surface()) : propagator->propagate(updatedState, container[iHit].det()->surface()); std::cout << "-------> new state >> " << state << std::endl; @@ -433,13 +443,12 @@ TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& t if (!updatedState.isValid()) return TrajectorySeed(); //seedHits.push_back(newtth.release()); -*/ -// } +*/ + // } //if(!hit) return; PTrajectoryStateOnDet seedTSOS = trajectoryStateTransform::persistentState(tsos, id.rawId()); - return TrajectorySeed(seedTSOS,container,prop.propagationDirection()); + return TrajectorySeed(seedTSOS, container, prop.propagationDirection()); //if ( !filter || filter->compatible(seed)) seedCollection.push_back(std::move(seed)); - } diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc index 54a96d8d94b96..c1ea40b32ef31 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc @@ -18,72 +18,85 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/SiStripCluster/interface/SiStripClusterTools.h" -#include<tuple> +#include <tuple> -#include<iostream> +#include <iostream> using namespace ctfseeding; using namespace std; using namespace edm; -HitExtractorSTRP::HitExtractorSTRP(GeomDetEnumerators::SubDetector subdet, TrackerDetSide side, int idLayer, float iminGoodCharge): - theLayerSubDet(subdet), theSide(side), theIdLayer(idLayer), - minAbsZ(0), theMinRing(1), theMaxRing(0), - hasMatchedHits(false), hasRPhiHits(false), hasStereoHits(false), - hasVectorHits(false), - hasRingSelector(false), hasSimpleRphiHitsCleaner(true) -{ minGoodCharge=iminGoodCharge; if (minGoodCharge>0) skipClusters=true; } +HitExtractorSTRP::HitExtractorSTRP(GeomDetEnumerators::SubDetector subdet, + TrackerDetSide side, + int idLayer, + float iminGoodCharge) + : theLayerSubDet(subdet), + theSide(side), + theIdLayer(idLayer), + minAbsZ(0), + theMinRing(1), + theMaxRing(0), + hasMatchedHits(false), + hasRPhiHits(false), + hasStereoHits(false), + hasVectorHits(false), + hasRingSelector(false), + hasSimpleRphiHitsCleaner(true) { + minGoodCharge = iminGoodCharge; + if (minGoodCharge > 0) + skipClusters = true; +} -void HitExtractorSTRP::useSkipClusters_(const edm::InputTag & m, edm::ConsumesCollector& iC) { +void HitExtractorSTRP::useSkipClusters_(const edm::InputTag& m, edm::ConsumesCollector& iC) { theSkipClusters = iC.consumes<SkipClustersCollection>(m); theSkipPhase2Clusters = iC.consumes<SkipPhase2ClustersCollection>(m); } -void HitExtractorSTRP::useRingSelector(int minRing, int maxRing) -{ - hasRingSelector=true; - theMinRing=minRing; - theMaxRing=maxRing; +void HitExtractorSTRP::useRingSelector(int minRing, int maxRing) { + hasRingSelector = true; + theMinRing = minRing; + theMaxRing = maxRing; } -bool HitExtractorSTRP::ringRange(int ring) const -{ - if (!hasRingSelector) return true; - return (ring >= theMinRing) & (ring <= theMaxRing); +bool HitExtractorSTRP::ringRange(int ring) const { + if (!hasRingSelector) + return true; + return (ring >= theMinRing) & (ring <= theMaxRing); } -bool HitExtractorSTRP::skipThis(DetId id, OmniClusterRef const& clus, - edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > & stripClusterMask) const { - - if (maskCluster && (stripClusterMask->mask(clus.key())) ) return true; +bool HitExtractorSTRP::skipThis( + DetId id, + OmniClusterRef const& clus, + edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >& stripClusterMask) const { + if (maskCluster && (stripClusterMask->mask(clus.key()))) + return true; - if UNLIKELY(minGoodCharge<=0) return false; - return siStripClusterTools::chargePerCM(id,*clus.cluster_strip()) <= minGoodCharge; + if + UNLIKELY(minGoodCharge <= 0) return false; + return siStripClusterTools::chargePerCM(id, *clus.cluster_strip()) <= minGoodCharge; } +std::pair<bool, ProjectedSiStripRecHit2D*> HitExtractorSTRP::skipThis( + const TkTransientTrackingRecHitBuilder& ttrhBuilder, + TkHitRef matched, + edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >& stripClusterMask) const { + const SiStripMatchedRecHit2D& hit = (SiStripMatchedRecHit2D const&)(matched); - -std::pair<bool,ProjectedSiStripRecHit2D *> -HitExtractorSTRP::skipThis(const TkTransientTrackingRecHitBuilder& ttrhBuilder, - TkHitRef matched, - edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > > & stripClusterMask) const { - const SiStripMatchedRecHit2D & hit = (SiStripMatchedRecHit2D const&)(matched); - assert(dynamic_cast<SiStripMatchedRecHit2D const*>(&matched)); - auto id = hit.geographicalId(); - ProjectedSiStripRecHit2D * replaceMe = nullptr; - bool rejectSt = skipThis(id,hit.stereoClusterRef(), stripClusterMask); - bool rejectMono = skipThis(id, hit.monoClusterRef(), stripClusterMask); + auto id = hit.geographicalId(); + ProjectedSiStripRecHit2D* replaceMe = nullptr; + bool rejectSt = skipThis(id, hit.stereoClusterRef(), stripClusterMask); + bool rejectMono = skipThis(id, hit.monoClusterRef(), stripClusterMask); - if ((!rejectSt)&(!rejectMono)){ + if ((!rejectSt) & (!rejectMono)) { // keepit - return std::make_pair(false,replaceMe); + return std::make_pair(false, replaceMe); } - if (failProjection || (rejectSt&rejectMono) ){ + if (failProjection || (rejectSt & rejectMono)) { //only skip if both hits are done - return std::make_pair(true,replaceMe); + return std::make_pair(true, replaceMe); } // replace with one @@ -91,60 +104,73 @@ HitExtractorSTRP::skipThis(const TkTransientTrackingRecHitBuilder& ttrhBuilder, auto cloner = ttrhBuilder.cloner(); replaceMe = cloner.project(hit, rejectSt, TrajectoryStateOnSurface()).release(); if (rejectSt) - LogDebug("HitExtractorSTRP")<<"a matched hit is partially masked, and the mono hit got projected onto: "<<replaceMe->geographicalId().rawId()<<" key: "<<hit.monoClusterRef().key(); - else - LogDebug("HitExtractorSTRP")<<"a matched hit is partially masked, and the stereo hit got projected onto: "<<replaceMe->geographicalId().rawId()<<" key: "<<hit.stereoClusterRef().key(); + LogDebug("HitExtractorSTRP") << "a matched hit is partially masked, and the mono hit got projected onto: " + << replaceMe->geographicalId().rawId() << " key: " << hit.monoClusterRef().key(); + else + LogDebug("HitExtractorSTRP") << "a matched hit is partially masked, and the stereo hit got projected onto: " + << replaceMe->geographicalId().rawId() << " key: " << hit.stereoClusterRef().key(); - return std::make_pair(true,replaceMe); + return std::make_pair(true, replaceMe); } - -void HitExtractorSTRP::cleanedOfClusters( const TkTransientTrackingRecHitBuilder& ttrhBuilder, - const edm::Event& ev, HitExtractor::Hits & hits, - bool matched, - unsigned int cleanFrom) const{ - unsigned int skipped=0; - unsigned int projected=0; - if(hasMatchedHits || hasRPhiHits || hasStereoHits){ - LogTrace("HitExtractorSTRP")<<"getting "<<hits.size()<<" strip hit in input."; +void HitExtractorSTRP::cleanedOfClusters(const TkTransientTrackingRecHitBuilder& ttrhBuilder, + const edm::Event& ev, + HitExtractor::Hits& hits, + bool matched, + unsigned int cleanFrom) const { + unsigned int skipped = 0; + unsigned int projected = 0; + if (hasMatchedHits || hasRPhiHits || hasStereoHits) { + LogTrace("HitExtractorSTRP") << "getting " << hits.size() << " strip hit in input."; edm::Handle<SkipClustersCollection> stripClusterMask; - if (maskCluster) ev.getByToken(theSkipClusters,stripClusterMask); - for (unsigned int iH=cleanFrom;iH<hits.size();++iH){ + if (maskCluster) + ev.getByToken(theSkipClusters, stripClusterMask); + for (unsigned int iH = cleanFrom; iH < hits.size(); ++iH) { assert(hits[iH]->isValid()); auto id = hits[iH]->geographicalId(); if (matched) { - bool replace; ProjectedSiStripRecHit2D * replaceMe; std::tie(replace,replaceMe) = skipThis(ttrhBuilder, *hits[iH],stripClusterMask); + bool replace; + ProjectedSiStripRecHit2D* replaceMe; + std::tie(replace, replaceMe) = skipThis(ttrhBuilder, *hits[iH], stripClusterMask); if (replace) { - if (!replaceMe) { - LogTrace("HitExtractorSTRP")<<"skipping a matched hit on :"<<hits[iH]->geographicalId().rawId(); - skipped++; - } else { projected++; } - hits[iH].reset(replaceMe); - if (replaceMe==nullptr) assert(hits[iH].empty()); - else assert(hits[iH].isOwn()); + if (!replaceMe) { + LogTrace("HitExtractorSTRP") << "skipping a matched hit on :" << hits[iH]->geographicalId().rawId(); + skipped++; + } else { + projected++; + } + hits[iH].reset(replaceMe); + if (replaceMe == nullptr) + assert(hits[iH].empty()); + else + assert(hits[iH].isOwn()); } - } - else if (skipThis(id, hits[iH]->firstClusterRef(),stripClusterMask)){ - LogTrace("HitExtractorSTRP")<<"skipping a hit on :"<<hits[iH]->geographicalId().rawId()<<" key: "; + } else if (skipThis(id, hits[iH]->firstClusterRef(), stripClusterMask)) { + LogTrace("HitExtractorSTRP") << "skipping a hit on :" << hits[iH]->geographicalId().rawId() << " key: "; skipped++; hits[iH].reset(); } } } - if(hasVectorHits){ - LogTrace("HitExtractorSTRP")<<"getting "<<hits.size()<<" vector hit in input."; + if (hasVectorHits) { + LogTrace("HitExtractorSTRP") << "getting " << hits.size() << " vector hit in input."; edm::Handle<SkipPhase2ClustersCollection> ph2ClusterMask; - if (maskCluster) ev.getByToken(theSkipPhase2Clusters,ph2ClusterMask); - for (unsigned int iH=cleanFrom;iH<hits.size();++iH){ - LogTrace("HitExtractorSTRP")<<"analizing hit on :"<<hits[iH]->geographicalId().rawId(); + if (maskCluster) + ev.getByToken(theSkipPhase2Clusters, ph2ClusterMask); + for (unsigned int iH = cleanFrom; iH < hits.size(); ++iH) { + LogTrace("HitExtractorSTRP") << "analizing hit on :" << hits[iH]->geographicalId().rawId(); assert(hits[iH]->isValid()); - const VectorHit & vhit = dynamic_cast<VectorHit const&>(*hits[iH]); - LogTrace("HitExtractorSTRP")<<" key lower: "<<vhit.lowerClusterRef().key() << " and key upper: " << vhit.upperClusterRef().key(); - LogTrace("HitExtractorSTRP")<<" key lower: "<<hits[iH]->firstClusterRef().key() ; + const VectorHit& vhit = dynamic_cast<VectorHit const&>(*hits[iH]); + LogTrace("HitExtractorSTRP") << " key lower: " << vhit.lowerClusterRef().key() + << " and key upper: " << vhit.upperClusterRef().key(); + LogTrace("HitExtractorSTRP") << " key lower: " << hits[iH]->firstClusterRef().key(); //FIXME:: introduce a "projected" version later? - if (maskCluster && (ph2ClusterMask->mask(vhit.lowerClusterRef().key()) || ph2ClusterMask->mask(vhit.upperClusterRef().key())) ){ - LogTrace("HitExtractorSTRP")<<"skipping a vector hit on :"<<hits[iH]->geographicalId().rawId()<<" key lower: "<<vhit.lowerClusterRef().key() << " and key upper: " << vhit.upperClusterRef().key(); + if (maskCluster && + (ph2ClusterMask->mask(vhit.lowerClusterRef().key()) || ph2ClusterMask->mask(vhit.upperClusterRef().key()))) { + LogTrace("HitExtractorSTRP") << "skipping a vector hit on :" << hits[iH]->geographicalId().rawId() + << " key lower: " << vhit.lowerClusterRef().key() + << " and key upper: " << vhit.upperClusterRef().key(); skipped++; hits[iH].reset(); } @@ -152,17 +178,18 @@ void HitExtractorSTRP::cleanedOfClusters( const TkTransientTrackingRecHitBuilder } // remove empty elements... - auto last = std::remove_if(hits.begin()+cleanFrom,hits.end(),[]( HitPointer const & p) {return p.empty();}); - hits.resize(last-hits.begin()); + auto last = std::remove_if(hits.begin() + cleanFrom, hits.end(), [](HitPointer const& p) { return p.empty(); }); + hits.resize(last - hits.begin()); - LogTrace("HitExtractorSTRP")<<"skipped :"<<skipped<<" rechits because of clusters and projected: "<<projected; + LogTrace("HitExtractorSTRP") << "skipped :" << skipped << " rechits because of clusters and projected: " << projected; } -HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder &ttrhBuilder, const edm::Event& ev, const edm::EventSetup& es) const -{ - LogDebug("HitExtractorSTRP")<<"HitExtractorSTRP::hits"; +HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder& ttrhBuilder, + const edm::Event& ev, + const edm::EventSetup& es) const { + LogDebug("HitExtractorSTRP") << "HitExtractorSTRP::hits"; HitExtractor::Hits result; - unsigned int cleanFrom=0; + unsigned int cleanFrom = 0; //Retrieve tracker topology from geometry edm::ESHandle<TrackerTopology> tTopoHandle; @@ -173,165 +200,206 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder // TIB // if (theLayerSubDet == GeomDetEnumerators::TIB) { - LogTrace("HitExtractorSTRP")<<"Getting hits into the TIB"; + LogTrace("HitExtractorSTRP") << "Getting hits into the TIB"; if (hasMatchedHits) { edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; - ev.getByToken( theMatchedHits, matchedHits); - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *matchedHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,true,cleanFrom); + ev.getByToken(theMatchedHits, matchedHits); + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*matchedHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom); } if (hasRPhiHits) { edm::Handle<SiStripRecHit2DCollection> rphiHits; - ev.getByToken( theRPhiHits, rphiHits); - if (hasMatchedHits){ - if (!hasSimpleRphiHitsCleaner){ // this is a brutal "cleaning". Add something smarter in the future - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *rphiHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); - } + ev.getByToken(theRPhiHits, rphiHits); + if (hasMatchedHits) { + if (!hasSimpleRphiHitsCleaner) { // this is a brutal "cleaning". Add something smarter in the future + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*rphiHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + } } else { - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *rphiHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*rphiHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } } if (hasStereoHits) { edm::Handle<SiStripRecHit2DCollection> stereoHits; - ev.getByToken( theStereoHits, stereoHits); - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *stereoHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + ev.getByToken(theStereoHits, stereoHits); + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*stereoHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } if (hasVectorHits) { - LogError("HitExtractorSTRP")<<"TIB is not supposed to be in Phase2 TRK detector configuration. What follows have never been checked before! "; + LogError("HitExtractorSTRP") << "TIB is not supposed to be in Phase2 TRK detector configuration. What follows " + "have never been checked before! "; edm::Handle<VectorHitCollectionNew> vectorHits; - ev.getByToken( theVectorHits, vectorHits); - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *vectorHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + ev.getByToken(theVectorHits, vectorHits); + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*vectorHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } - + } - + // // TID // else if (theLayerSubDet == GeomDetEnumerators::TID) { - LogTrace("HitExtractorSTRP")<<"Getting hits into the TID"; + LogTrace("HitExtractorSTRP") << "Getting hits into the TID"; if (hasMatchedHits) { - edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; - ev.getByToken( theMatchedHits, matchedHits); - if (skipClusters) cleanFrom=result.size(); - auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); - SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); - for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; - for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); - } + edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; + ev.getByToken(theMatchedHits, matchedHits); + if (skipClusters) + cleanFrom = result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); + SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); + for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tidRing(it->detId()); + if (!ringRange(ring)) + continue; + for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; + ++hit) { + result.emplace_back(*hit); } - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,true,cleanFrom); + } + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom); } if (hasRPhiHits) { - edm::Handle<SiStripRecHit2DCollection> rphiHits; - ev.getByToken( theRPhiHits, rphiHits); - if (skipClusters) cleanFrom=result.size(); - auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); - SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); - for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; - if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) continue; // this is a brutal "cleaning". Add something smarter in the future - for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); - } + edm::Handle<SiStripRecHit2DCollection> rphiHits; + ev.getByToken(theRPhiHits, rphiHits); + if (skipClusters) + cleanFrom = result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); + SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); + for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tidRing(it->detId()); + if (!ringRange(ring)) + continue; + if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) + continue; // this is a brutal "cleaning". Add something smarter in the future + for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); } - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } if (hasStereoHits) { - edm::Handle<SiStripRecHit2DCollection> stereoHits; - ev.getByToken( theStereoHits, stereoHits); - if (skipClusters) cleanFrom=result.size(); - auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); - SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); - for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; - for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); - } + edm::Handle<SiStripRecHit2DCollection> stereoHits; + ev.getByToken(theStereoHits, stereoHits); + if (skipClusters) + cleanFrom = result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); + SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); + for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tidRing(it->detId()); + if (!ringRange(ring)) + continue; + for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); } - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } if (hasVectorHits) { - LogTrace("HitExtractorSTRP")<<"Getting vector hits for IdLayer " << theIdLayer; + LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer; edm::Handle<VectorHitCollectionNew> vectorHits; - ev.getByToken( theVectorHits, vectorHits); + ev.getByToken(theVectorHits, vectorHits); //FIXME: check the skipClusters with VHits - if (skipClusters) cleanFrom=result.size(); - auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + if (skipClusters) + cleanFrom = result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); VectorHitCollection::Range range = vectorHits->equal_range(getter.first, getter.second); for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; + int ring = tTopo->tidRing(it->detId()); + if (!ringRange(ring)) + continue; for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.emplace_back(*hit); } } - LogTrace("HitExtractorSTRP")<<"result size value:" << result.size(); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + LogTrace("HitExtractorSTRP") << "result size value:" << result.size(); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } } // // TOB // else if (theLayerSubDet == GeomDetEnumerators::TOB) { - LogTrace("HitExtractorSTRP")<<"Getting hits into the TOB"; + LogTrace("HitExtractorSTRP") << "Getting hits into the TOB"; if (hasMatchedHits) { edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; - ev.getByToken( theMatchedHits, matchedHits); - if (skipClusters) cleanFrom=result.size(); - if (minAbsZ>0.) { - auto getter = tTopo->tobDetIdLayerComparator(theIdLayer); - SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); - for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - if (fabs(hit->globalPosition().z())>=minAbsZ) result.emplace_back(*hit); - } - } + ev.getByToken(theMatchedHits, matchedHits); + if (skipClusters) + cleanFrom = result.size(); + if (minAbsZ > 0.) { + auto getter = tTopo->tobDetIdLayerComparator(theIdLayer); + SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); + for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; + ++hit) { + if (fabs(hit->globalPosition().z()) >= minAbsZ) + result.emplace_back(*hit); + } + } } else { - range2SeedingHits( *matchedHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + range2SeedingHits(*matchedHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); } - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,true,cleanFrom); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom); } if (hasRPhiHits) { edm::Handle<SiStripRecHit2DCollection> rphiHits; - ev.getByToken( theRPhiHits, rphiHits); - if (hasMatchedHits){ - if (!hasSimpleRphiHitsCleaner){ // this is a brutal "cleaning". Add something smarter in the future - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *rphiHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); - } + ev.getByToken(theRPhiHits, rphiHits); + if (hasMatchedHits) { + if (!hasSimpleRphiHitsCleaner) { // this is a brutal "cleaning". Add something smarter in the future + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*rphiHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); + } } else { - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *rphiHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*rphiHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } } if (hasStereoHits) { edm::Handle<SiStripRecHit2DCollection> stereoHits; - ev.getByToken( theStereoHits, stereoHits); - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *stereoHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + ev.getByToken(theStereoHits, stereoHits); + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*stereoHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } if (hasVectorHits) { - LogTrace("HitExtractorSTRP")<<"Getting vector hits for IdLayer " << theIdLayer; + LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer; edm::Handle<VectorHitCollectionNew> vectorHits; - ev.getByToken( theVectorHits, vectorHits); + ev.getByToken(theVectorHits, vectorHits); //FIXME: check the skipClusters with VHits - if (skipClusters) cleanFrom=result.size(); - range2SeedingHits( *vectorHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + if (skipClusters) + cleanFrom = result.size(); + range2SeedingHits(*vectorHits, result, tTopo->tobDetIdLayerComparator(theIdLayer)); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } } @@ -340,70 +408,86 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder // TEC // else if (theLayerSubDet == GeomDetEnumerators::TEC) { - LogTrace("HitExtractorSTRP")<<"Getting hits into the TEC"; + LogTrace("HitExtractorSTRP") << "Getting hits into the TEC"; if (hasMatchedHits) { - edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; - ev.getByToken( theMatchedHits, matchedHits); - if (skipClusters) cleanFrom=result.size(); - auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); - SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); - for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tecRing( it->detId() ); if (!ringRange(ring)) continue; - for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); - } + edm::Handle<SiStripMatchedRecHit2DCollection> matchedHits; + ev.getByToken(theMatchedHits, matchedHits); + if (skipClusters) + cleanFrom = result.size(); + auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); + SiStripMatchedRecHit2DCollection::Range range = matchedHits->equal_range(getter.first, getter.second); + for (SiStripMatchedRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tecRing(it->detId()); + if (!ringRange(ring)) + continue; + for (SiStripMatchedRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; + ++hit) { + result.emplace_back(*hit); } - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,true,cleanFrom); + } + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, true, cleanFrom); } if (hasRPhiHits) { - edm::Handle<SiStripRecHit2DCollection> rphiHits; - ev.getByToken( theRPhiHits, rphiHits); - if (skipClusters) cleanFrom=result.size(); - auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); - SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); - for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tecRing( it->detId() ); if (!ringRange(ring)) continue; - if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) continue; // this is a brutal "cleaning". Add something smarter in the future - for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); - } + edm::Handle<SiStripRecHit2DCollection> rphiHits; + ev.getByToken(theRPhiHits, rphiHits); + if (skipClusters) + cleanFrom = result.size(); + auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); + SiStripRecHit2DCollection::Range range = rphiHits->equal_range(getter.first, getter.second); + for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tecRing(it->detId()); + if (!ringRange(ring)) + continue; + if ((SiStripDetId(it->detId()).partnerDetId() != 0) && hasSimpleRphiHitsCleaner) + continue; // this is a brutal "cleaning". Add something smarter in the future + for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); } - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); - + } + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } if (hasStereoHits) { - edm::Handle<SiStripRecHit2DCollection> stereoHits; - ev.getByToken( theStereoHits, stereoHits); - if (skipClusters) cleanFrom=result.size(); - auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); - SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); - for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tecRing( it->detId() ); if (!ringRange(ring)) continue; - for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); - } + edm::Handle<SiStripRecHit2DCollection> stereoHits; + ev.getByToken(theStereoHits, stereoHits); + if (skipClusters) + cleanFrom = result.size(); + auto getter = tTopo->tecDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); + SiStripRecHit2DCollection::Range range = stereoHits->equal_range(getter.first, getter.second); + for (SiStripRecHit2DCollection::const_iterator it = range.first; it != range.second; ++it) { + int ring = tTopo->tecRing(it->detId()); + if (!ringRange(ring)) + continue; + for (SiStripRecHit2DCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { + result.emplace_back(*hit); } - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + } + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } if (hasVectorHits) { - LogError("HitExtractorSTRP")<<"TEC is not supposed to be in Phase2 TRK detector configuration. What follows have never been checked before! "; + LogError("HitExtractorSTRP") << "TEC is not supposed to be in Phase2 TRK detector configuration. What follows " + "have never been checked before! "; edm::Handle<VectorHitCollectionNew> vectorHits; - ev.getByToken( theVectorHits, vectorHits); - if (skipClusters) cleanFrom=result.size(); - auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide),theIdLayer); + ev.getByToken(theVectorHits, vectorHits); + if (skipClusters) + cleanFrom = result.size(); + auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); VectorHitCollection::Range range = vectorHits->equal_range(getter.first, getter.second); for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) { - int ring = tTopo->tidRing( it->detId() ); if (!ringRange(ring)) continue; + int ring = tTopo->tidRing(it->detId()); + if (!ringRange(ring)) + continue; for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { result.emplace_back(*hit); } } - if (skipClusters) cleanedOfClusters(ttrhBuilder, ev,result,false,cleanFrom); + if (skipClusters) + cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } } - LogDebug("HitExtractorSTRP")<<" giving: "<<result.size()<<" out for charge cut " << minGoodCharge; + LogDebug("HitExtractorSTRP") << " giving: " << result.size() << " out for charge cut " << minGoodCharge; return result; } - - diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h index deeaa9728ffbb..7d6852c30c53d 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h @@ -46,9 +46,9 @@ namespace ctfseeding { theStereoHits = iC.consumes<SiStripRecHit2DCollection>(m); } - void useVectorHits(const edm::InputTag & m, edm::ConsumesCollector& iC) { - hasVectorHits = true; - theVectorHits = iC.consumes<VectorHitCollectionNew>(m); + void useVectorHits(const edm::InputTag& m, edm::ConsumesCollector& iC) { + hasVectorHits = true; + theVectorHits = iC.consumes<VectorHitCollectionNew>(m); } void useRingSelector(int minRing, int maxRing); void useSimpleRphiHitsCleaner(bool use) { hasSimpleRphiHitsCleaner = use; } @@ -78,7 +78,7 @@ namespace ctfseeding { bool ringRange(int ring) const; typedef edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > SkipClustersCollection; - typedef edm::ContainerMask< Phase2TrackerCluster1DCollectionNew > SkipPhase2ClustersCollection; + typedef edm::ContainerMask<Phase2TrackerCluster1DCollectionNew> SkipPhase2ClustersCollection; void useSkipClusters_(const edm::InputTag& m, edm::ConsumesCollector& iC) override; private: diff --git a/RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h b/RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h index 35f1c418bcb4f..9fdecece36a57 100644 --- a/RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h +++ b/RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h @@ -33,7 +33,7 @@ class TkClonerImpl final : public TkCloner { TrajectoryStateOnSurface const& tsos) const override; std::unique_ptr<Phase2TrackerRecHit1D> operator()(Phase2TrackerRecHit1D const& hit, TrajectoryStateOnSurface const& tsos) const override; - std::unique_ptr<VectorHit> operator()(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const override; + std::unique_ptr<VectorHit> operator()(VectorHit const& hit, TrajectoryStateOnSurface const& tsos) const override; using TkCloner::makeShared; TrackingRecHit::ConstRecHitPointer makeShared(SiPixelRecHit const& hit, @@ -48,7 +48,8 @@ class TkClonerImpl final : public TkCloner { TrajectoryStateOnSurface const& tsos) const override; TrackingRecHit::ConstRecHitPointer makeShared(Phase2TrackerRecHit1D const& hit, TrajectoryStateOnSurface const& tsos) const override; - TrackingRecHit::ConstRecHitPointer makeShared(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const override; + TrackingRecHit::ConstRecHitPointer makeShared(VectorHit const& hit, + TrajectoryStateOnSurface const& tsos) const override; // project either mono or stero hit... std::unique_ptr<ProjectedSiStripRecHit2D> project(SiStripMatchedRecHit2D const& hit, bool mono, diff --git a/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc b/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc index 9d729a1a1973e..b35f6a2c4b9d2 100644 --- a/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc +++ b/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc @@ -57,7 +57,7 @@ std::unique_ptr<Phase2TrackerRecHit1D> TkClonerImpl::operator()(Phase2TrackerRec return std::make_unique<Phase2TrackerRecHit1D>(params.first, params.second, *hit.det(), hit.cluster()); } -std::unique_ptr<VectorHit> TkClonerImpl::operator()(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const { +std::unique_ptr<VectorHit> TkClonerImpl::operator()(VectorHit const& hit, TrajectoryStateOnSurface const& tsos) const { return std::unique_ptr<VectorHit>{new VectorHit(hit)}; } @@ -97,7 +97,8 @@ TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared(Phase2TrackerRecHit1 return std::make_unique<Phase2TrackerRecHit1D>(params.first, params.second, *hit.det(), hit.cluster()); } -TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared(VectorHit const & hit, TrajectoryStateOnSurface const& tsos) const { +TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared(VectorHit const& hit, + TrajectoryStateOnSurface const& tsos) const { return std::make_shared<VectorHit>(hit); } From 09136ad90ad80dc611c09cf5a3e9c6897c246dc8 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 2 Oct 2019 01:45:07 +0200 Subject: [PATCH 340/778] address Iannas comments part 1 --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 11 --- .../TrackerRecHit2D/src/classes_def.xml | 1 - .../python/RecoLocalTracker_cff.py | 1 - .../interface/VectorHitBuilderEDProducer.h | 18 +++-- .../plugins/SealModules.cc | 2 - .../SiPhase2RecHitMatcherESProducer.cc | 57 +++++++++++++- .../plugins/SiPhase2RecHitMatcherESProducer.h | 20 ----- .../python/SiPhase2RecHitMatcher_cfi.py | 17 ----- .../python/SiPhase2VectorHitBuilder_cfi.py | 12 --- .../src/VectorHitBuilderEDProducer.cc | 76 +++++++++++++------ 10 files changed, 116 insertions(+), 99 deletions(-) delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 307d2afae51d7..e7e163857e7a8 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -36,8 +36,6 @@ VectorHit::VectorHit(const GeomDet& idet, thePosition = LocalPoint(vh2Dzx.localPosition().x(), vh2Dzy.localPosition().x(), 0.); theDirection = LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), 1.); - //theDirection = LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), vh2Dzy.localDirection().z()); - //theDirection = theDirection.unit(); //building the cov matrix 4x4 starting from the 2x2 AlgebraicSymMatrix22 covMatZX = vh2Dzx.covMatrix(); @@ -82,7 +80,6 @@ bool VectorHit::sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedI } void VectorHit::getKfComponents4D(KfComponentsHolder& holder) const { - //if (!hasPositionAndError()) throwExceptionUninitialized("getKfComponents"); AlgebraicVector4& pars = holder.params<4>(); pars[0] = theDirection.x(); pars[1] = theDirection.y(); @@ -229,8 +226,6 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const double ytg = -(gPositionLower.x() - xcentre); //to compute phi at the origin - //double xtg = ycentre; - //double ytg = -(xcentre); phi = atan2(ytg, xtg); AlgebraicROOTObject<4, 4>::Matrix jacobian; @@ -268,10 +263,6 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const M[0] = (gPositionLower.y() - ycentre) / pow(rho, 2); // dphi/dxcentre M[1] = -(gPositionLower.x() - xcentre) / pow(rho, 2); // dphi/dycentre //to compute phi at the origin - //float x0 = 0.0; - //float y0 = 0.0; - //M[0] = (y0 - ycentre)/pow(rho,2); // dphi/dxcentre - //M[1] =-(x0 - xcentre)/pow(rho,2); // dphi/dycentre AlgebraicROOTObject<2, 4>::Matrix K; K[0][0] = @@ -342,8 +333,6 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const temp = temp * gErrors; errorCurvature = temp[0] * curvatureJacobian[0] + temp[1] * curvatureJacobian[1] + temp[2] * curvatureJacobian[2] + temp[3] * curvatureJacobian[3]; - //if(curvORphi == "curvature") std::cout << "curvature: " << curvature << std::endl; - //if(curvORphi == "curvature") std::cout << "curvature error: " << errorCurvature << std::endl; } else { std::cout << " straight line!" << std::endl; diff --git a/DataFormats/TrackerRecHit2D/src/classes_def.xml b/DataFormats/TrackerRecHit2D/src/classes_def.xml index e5527c17265f3..d10e52aaa4d6d 100644 --- a/DataFormats/TrackerRecHit2D/src/classes_def.xml +++ b/DataFormats/TrackerRecHit2D/src/classes_def.xml @@ -196,7 +196,6 @@ <version ClassVersion="2" checksum="333065919"/> </class> - <class name="edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector>"/> <class name="edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector> >"/> <class name="edm::Wrapper<edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector> > >"/> <class name="edmNew::DetSetVector<VectorHit> "/> diff --git a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py index 06ebb798faca2..4d25967bd803f 100644 --- a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py +++ b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py @@ -23,7 +23,6 @@ from RecoLocalTracker.SiPhase2Clusterizer.phase2TrackerClusterizer_cfi import * from RecoLocalTracker.Phase2TrackerRecHits.Phase2StripCPEGeometricESProducer_cfi import * -from RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2RecHitMatcher_cfi import * _pixeltrackerlocalrecoTask_phase2 = pixeltrackerlocalrecoTask.copy() _pixeltrackerlocalrecoTask_phase2.add(siPhase2Clusters) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h index 24ccbf93a3d5f..be5ae1ee0f4fd 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h @@ -13,6 +13,9 @@ #include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> +#include <FWCore/ParameterSet/interface/ParameterSetDescription.h> + class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { public: explicit VectorHitBuilderEDProducer(const edm::ParameterSet&); @@ -24,15 +27,16 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej); - VectorHitBuilderAlgorithmBase* algo() const { return stubsBuilder; }; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + VectorHitBuilderAlgorithmBase* algo() const { return stubsBuilder_; }; private: - VectorHitBuilderAlgorithmBase* stubsBuilder; - std::string offlinestubsTag; - unsigned int maxOfflinestubs; - std::string algoTag; - edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer; - bool readytobuild; + VectorHitBuilderAlgorithmBase* stubsBuilder_; + std::string offlinestubsTag_; + unsigned int maxOfflinestubs_; + std::string algoTag_; + edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer_; + bool readytobuild_; }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc index 9906f689a4d7f..784c27e17a331 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc @@ -4,7 +4,5 @@ #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h" -DEFINE_FWK_EVENTSETUP_MODULE(SiPhase2RecHitMatcherESProducer); DEFINE_FWK_MODULE(VectorHitBuilderEDProducer); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 73993fdb3eaed..66d5528781366 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -1,4 +1,3 @@ -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -6,15 +5,32 @@ #include "FWCore/Framework/interface/ESProducer.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" +#include <memory> + +class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { +public: + SiPhase2RecHitMatcherESProducer(const edm::ParameterSet&); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + std::shared_ptr<VectorHitBuilderEDProducer> produce(const TkPhase2OTCPERecord&); + +private: + std::string name_; + std::shared_ptr<VectorHitBuilderEDProducer> matcher_; + edm::ParameterSet pset_; +}; + SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet& p) { - name = p.getParameter<std::string>("ComponentName"); + name_ = p.getParameter<std::string>("ComponentName"); pset_ = p; - setWhatProduced(this, name); + setWhatProduced(this, name_); } std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer::produce( const TkPhase2OTCPERecord& iRecord) { - if (name == "SiPhase2VectorHitMatcher") { + if (name_ == "SiPhase2VectorHitMatcher") { matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); edm::ESHandle<TrackerGeometry> tGeomHandle; @@ -28,3 +44,36 @@ std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer::pro } return matcher_; } + +void +SiPhase2RecHitMatcherESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add<std::string>("offlinestubs", "vectorHits"); + desc.add<int>("maxVectorHits", 999999999); + desc.add<std::string>("Algorithm", "VectorHitBuilderAlgorithm"); + desc.add<std::string>("ComponentName", "SiPhase2VectorHitMatcher"); + desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer","Phase2StripCPE")); + desc.add<std::vector<double>>("BarrelCut", { + 0.0, + 0.05, + 0.06, + 0.08, + 0.09, + 0.12, + 0.2, + }); + desc.add<std::string>("Phase2CPE_name", "Phase2StripCPE"); + desc.add<std::string>("Clusters", "siPhase2Clusters"); + desc.add<int>("maxVectorHitsInAStack", 999); + desc.add<std::vector<double>>("EndcapCut", { + 0.0, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + }); + descriptions.add("SiPhase2RecHitMatcherESProducer", desc); +} + +DEFINE_FWK_EVENTSETUP_MODULE(SiPhase2RecHitMatcherESProducer); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h deleted file mode 100644 index be680a93c7c5e..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef RecoLocaltracker_SiPhase2VectorHitBuilder_SiPhase2RecHitMatcherESProducer_h -#define RecoLocaltracker_SiPhase2VectorHitBuilder_SiPhase2RecHitMatcherESProducer_h - -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" -#include <memory> - -class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { -public: - SiPhase2RecHitMatcherESProducer(const edm::ParameterSet&); - std::shared_ptr<VectorHitBuilderEDProducer> produce(const TkPhase2OTCPERecord&); - -private: - std::string name; - std::shared_ptr<VectorHitBuilderEDProducer> matcher_; - edm::ParameterSet pset_; -}; -#endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py deleted file mode 100644 index 0780d27ef4258..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py +++ /dev/null @@ -1,17 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -SiPhase2RecHitMatcherESProducer = cms.ESProducer("SiPhase2RecHitMatcherESProducer", - ComponentName = cms.string('SiPhase2VectorHitMatcher'), - Clusters = cms.string('siPhase2Clusters'), - offlinestubs = cms.string('vectorHits'), - maxVectorHits = cms.int32(999999999), - maxVectorHitsInAStack = cms.int32(999), - Algorithm = cms.string('VectorHitBuilderAlgorithm'), - BarrelCut = cms.vdouble( 0., 0.05, 0.06, 0.08, 0.09, 0.12, 0.2), #layers are 6 - EndcapCut = cms.vdouble( 0., 0.1, 0.1, 0.1, 0.1, 0.1), #disks are 5 - CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"), - Phase2CPE_name = cms.string('Phase2StripCPE') -# NSigmaInside = cms.double(3.0) -) - - diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py deleted file mode 100644 index 7949489ba3da8..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py +++ /dev/null @@ -1,12 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -siPhase2VectorHits = cms.EDProducer("VectorHitBuilderEDProducer", - Clusters = cms.string('siPhase2Clusters'), - offlinestubs = cms.string('vectorHits'), - maxVectorHits = cms.int32(999999999), - maxVectorHitsInAStack = cms.int32(999), - Algorithm = cms.string('VectorHitBuilderAlgorithm'), - BarrelCut = cms.vdouble( 0., 0.05, 0.06, 0.08, 0.09, 0.12, 0.2), #layers are 6 - EndcapCut = cms.vdouble( 0., 0.1, 0.1, 0.1, 0.1, 0.1), #disks are 5 - CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE") -) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc index a47ae33526242..0fabf89f2187b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc @@ -4,29 +4,29 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) - : offlinestubsTag(conf.getParameter<std::string>("offlinestubs")), - maxOfflinestubs(conf.getParameter<int>("maxVectorHits")), - algoTag(conf.getParameter<std::string>("Algorithm")), - //clusterProducer(conf.getParameter<edm::InputTag>("Clusters")), - readytobuild(false) { - clusterProducer = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >( + : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")), + maxOfflinestubs_(conf.getParameter<int>("maxVectorHits")), + algoTag_(conf.getParameter<std::string>("Algorithm")), + //_clusterProducer(conf.getParameter<edm::InputTag>("Clusters")), + readytobuild_(false) { + clusterProducer_ = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >( edm::InputTag(conf.getParameter<std::string>("Clusters"))); produces<edmNew::DetSetVector<Phase2TrackerCluster1D> >("ClustersAccepted"); produces<edmNew::DetSetVector<Phase2TrackerCluster1D> >("ClustersRejected"); - produces<VectorHitCollectionNew>(offlinestubsTag + "Accepted"); - produces<VectorHitCollectionNew>(offlinestubsTag + "Rejected"); + produces<VectorHitCollectionNew>(offlinestubsTag_ + "Accepted"); + produces<VectorHitCollectionNew>(offlinestubsTag_ + "Rejected"); setupAlgorithm(conf); } -VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder; } +VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin"; // get input clusters data edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clustersHandle; - event.getByToken(clusterProducer, clustersHandle); + event.getByToken(clusterProducer_, clustersHandle); // create the final output collection std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D> > outputClustersAccepted( @@ -36,13 +36,13 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu std::unique_ptr<VectorHitCollectionNew> outputVHAccepted(new VectorHitCollectionNew()); std::unique_ptr<VectorHitCollectionNew> outputVHRejected(new VectorHitCollectionNew()); - if (readytobuild) - stubsBuilder->initialize(es); + if (readytobuild_) + stubsBuilder_->initialize(es); else edm::LogError("VectorHitBuilderEDProducer") << "Impossible initialization of builder!!"; // check on the input clusters - stubsBuilder->printClusters(*clustersHandle); + stubsBuilder_->printClusters(*clustersHandle); // running the stub building algorithm //ERICA::output should be moved in the different algo classes? @@ -58,7 +58,7 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu } } /* - if(numberOfVectorHits > maxOfflinestubs) { + if(numberOfVectorHits > _maxOfflinestubs) { edm::LogError("VectorHitBuilderEDProducer") << "Limit on the number of stubs exceeded. An empty output collection will be produced instead.\n"; VectorHitCollectionNew empty; empty.swap(outputAcc); @@ -67,20 +67,20 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu // write output to file event.put(std::move(outputClustersAccepted), "ClustersAccepted"); event.put(std::move(outputClustersRejected), "ClustersRejected"); - event.put(std::move(outputVHAccepted), offlinestubsTag + "Accepted"); - event.put(std::move(outputVHRejected), offlinestubsTag + "Rejected"); + event.put(std::move(outputVHAccepted), offlinestubsTag_ + "Accepted"); + event.put(std::move(outputVHRejected), offlinestubsTag_ + "Rejected"); - // LogDebug("VectorHitBuilderEDProducer") << " Executing " << algoTag << " resulted in " << numberOfVectorHits << "."; + // LogDebug("VectorHitBuilderEDProducer") << " Executing " << _algoTag << " resulted in " << numberOfVectorHits << "."; LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n"; } void VectorHitBuilderEDProducer::setupAlgorithm(edm::ParameterSet const& conf) { - if (algoTag == "VectorHitBuilderAlgorithm") { - stubsBuilder = new VectorHitBuilderAlgorithm(conf); - readytobuild = true; + if (algoTag_ == "VectorHitBuilderAlgorithm") { + stubsBuilder_ = new VectorHitBuilderAlgorithm(conf); + readytobuild_ = true; } else { - edm::LogError("VectorHitBuilderEDProducer") << " Choice " << algoTag << " is invalid.\n"; - readytobuild = false; + edm::LogError("VectorHitBuilderEDProducer") << " Choice " << algoTag_ << " is invalid.\n"; + readytobuild_ = false; } } @@ -89,12 +89,40 @@ void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2Trac edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej) { - if (!readytobuild) { + if (!readytobuild_) { edm::LogError("VectorHitBuilderEDProducer") << " No stub builder algorithm was found - cannot run!"; return; } - stubsBuilder->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); + stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); +} +void +VectorHitBuilderEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add<std::string>("offlinestubs", "vectorHits"); + desc.add<int>("maxVectorHits", 999999999); + desc.add<std::string>("Algorithm", "VectorHitBuilderAlgorithm"); + desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer","Phase2StripCPE")); + desc.add<std::vector<double>>("BarrelCut", { + 0.0, + 0.05, + 0.06, + 0.08, + 0.09, + 0.12, + 0.2, + }); + desc.add<std::string>("Clusters", "siPhase2Clusters"); + desc.add<int>("maxVectorHitsInAStack", 999); + desc.add<std::vector<double>>("EndcapCut", { + 0.0, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + }); + descriptions.add("siPhase2VectorHits", desc); } #include "FWCore/Utilities/interface/typelookup.h" From e0a73fd8657a52c9b47d9c5ebf401463bc236f39 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 2 Oct 2019 02:06:42 +0200 Subject: [PATCH 341/778] code checks --- .../SiPhase2RecHitMatcherESProducer.cc | 41 ++++++------- .../src/VectorHitBuilderEDProducer.cc | 57 ++++++++++--------- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 66d5528781366..154c88423ad64 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -45,34 +45,35 @@ std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer::pro return matcher_; } -void -SiPhase2RecHitMatcherESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { +void SiPhase2RecHitMatcherESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add<std::string>("offlinestubs", "vectorHits"); desc.add<int>("maxVectorHits", 999999999); desc.add<std::string>("Algorithm", "VectorHitBuilderAlgorithm"); desc.add<std::string>("ComponentName", "SiPhase2VectorHitMatcher"); - desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer","Phase2StripCPE")); - desc.add<std::vector<double>>("BarrelCut", { - 0.0, - 0.05, - 0.06, - 0.08, - 0.09, - 0.12, - 0.2, - }); + desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); + desc.add<std::vector<double>>("BarrelCut", + { + 0.0, + 0.05, + 0.06, + 0.08, + 0.09, + 0.12, + 0.2, + }); desc.add<std::string>("Phase2CPE_name", "Phase2StripCPE"); desc.add<std::string>("Clusters", "siPhase2Clusters"); desc.add<int>("maxVectorHitsInAStack", 999); - desc.add<std::vector<double>>("EndcapCut", { - 0.0, - 0.1, - 0.1, - 0.1, - 0.1, - 0.1, - }); + desc.add<std::vector<double>>("EndcapCut", + { + 0.0, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + }); descriptions.add("SiPhase2RecHitMatcherESProducer", desc); } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc index 0fabf89f2187b..0f8ce6b7fac77 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc @@ -9,11 +9,11 @@ VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& algoTag_(conf.getParameter<std::string>("Algorithm")), //_clusterProducer(conf.getParameter<edm::InputTag>("Clusters")), readytobuild_(false) { - clusterProducer_ = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >( - edm::InputTag(conf.getParameter<std::string>("Clusters"))); + clusterProducer_ = + consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>(edm::InputTag(conf.getParameter<std::string>("Clusters"))); - produces<edmNew::DetSetVector<Phase2TrackerCluster1D> >("ClustersAccepted"); - produces<edmNew::DetSetVector<Phase2TrackerCluster1D> >("ClustersRejected"); + produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersAccepted"); + produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersRejected"); produces<VectorHitCollectionNew>(offlinestubsTag_ + "Accepted"); produces<VectorHitCollectionNew>(offlinestubsTag_ + "Rejected"); setupAlgorithm(conf); @@ -25,13 +25,13 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin"; // get input clusters data - edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clustersHandle; + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clustersHandle; event.getByToken(clusterProducer_, clustersHandle); // create the final output collection - std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D> > outputClustersAccepted( + std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersAccepted( new edmNew::DetSetVector<Phase2TrackerCluster1D>); - std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D> > outputClustersRejected( + std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersRejected( new edmNew::DetSetVector<Phase2TrackerCluster1D>); std::unique_ptr<VectorHitCollectionNew> outputVHAccepted(new VectorHitCollectionNew()); std::unique_ptr<VectorHitCollectionNew> outputVHRejected(new VectorHitCollectionNew()); @@ -84,7 +84,7 @@ void VectorHitBuilderEDProducer::setupAlgorithm(edm::ParameterSet const& conf) { } } -void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, +void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, VectorHitCollectionNew& outputAcc, @@ -96,32 +96,33 @@ void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2Trac stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); } -void -VectorHitBuilderEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { +void VectorHitBuilderEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add<std::string>("offlinestubs", "vectorHits"); desc.add<int>("maxVectorHits", 999999999); desc.add<std::string>("Algorithm", "VectorHitBuilderAlgorithm"); - desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer","Phase2StripCPE")); - desc.add<std::vector<double>>("BarrelCut", { - 0.0, - 0.05, - 0.06, - 0.08, - 0.09, - 0.12, - 0.2, - }); + desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); + desc.add<std::vector<double>>("BarrelCut", + { + 0.0, + 0.05, + 0.06, + 0.08, + 0.09, + 0.12, + 0.2, + }); desc.add<std::string>("Clusters", "siPhase2Clusters"); desc.add<int>("maxVectorHitsInAStack", 999); - desc.add<std::vector<double>>("EndcapCut", { - 0.0, - 0.1, - 0.1, - 0.1, - 0.1, - 0.1, - }); + desc.add<std::vector<double>>("EndcapCut", + { + 0.0, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + }); descriptions.add("siPhase2VectorHits", desc); } From 3e0523b5537e2d2833df6e784d307583c708a3af Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 2 Oct 2019 02:15:04 +0200 Subject: [PATCH 342/778] set usePhase2Stacks to false by default in the fillDescription of TrackerRecoGeometryESProducer --- .../GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc index d3e89db5e9ec2..c3ba3660e7431 100644 --- a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc +++ b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc @@ -58,7 +58,7 @@ std::unique_ptr<GeometricSearchTracker> TrackerRecoGeometryESProducer::produce( void TrackerRecoGeometryESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { edm::ParameterSetDescription desc; - desc.add<bool>("usePhase2Stacks"); + desc.add<bool>("usePhase2Stacks",false); desc.addUntracked<std::string>("trackerGeometryLabel", ""); descriptions.addDefault(desc); } From 00ad9bb6a0663c87ce09e1fba11cdda3a39b265a Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 2 Oct 2019 17:39:08 +0200 Subject: [PATCH 343/778] try to fix header issues and fix missing import broken by the last commit --- DataFormats/TrackerRecHit2D/interface/VectorHit2D.h | 1 + DataFormats/TrackerRecHit2D/src/VectorHit.cc | 2 +- RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index 7bc0d8eb1c098..2ed4c5fd9b911 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -3,6 +3,7 @@ #include "DataFormats/GeometryVector/interface/LocalVector.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" +#include "DataFormats/CLHEP/interface/AlgebraicObjects.h" class VectorHit2D { public: diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index e7e163857e7a8..2f915c6f6187f 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -361,7 +361,7 @@ float VectorHit::theta() { return globalDirection().theta(); } AlgebraicMatrix VectorHit::projectionMatrix() const { // obsolete (for what tracker is concerned...) interface - static AlgebraicMatrix the4DProjectionMatrix(4, 5, 0); + static const AlgebraicMatrix the4DProjectionMatrix(4, 5, 0); return the4DProjectionMatrix; } diff --git a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py index 4d25967bd803f..06ebb798faca2 100644 --- a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py +++ b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py @@ -23,6 +23,7 @@ from RecoLocalTracker.SiPhase2Clusterizer.phase2TrackerClusterizer_cfi import * from RecoLocalTracker.Phase2TrackerRecHits.Phase2StripCPEGeometricESProducer_cfi import * +from RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2RecHitMatcher_cfi import * _pixeltrackerlocalrecoTask_phase2 = pixeltrackerlocalrecoTask.copy() _pixeltrackerlocalrecoTask_phase2.add(siPhase2Clusters) From e652383db425917262926ac0b2a781343cafab7a Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 2 Oct 2019 17:48:44 +0200 Subject: [PATCH 344/778] code checkes --- .../GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc index c3ba3660e7431..52a299f1eb172 100644 --- a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc +++ b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc @@ -58,7 +58,7 @@ std::unique_ptr<GeometricSearchTracker> TrackerRecoGeometryESProducer::produce( void TrackerRecoGeometryESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { edm::ParameterSetDescription desc; - desc.add<bool>("usePhase2Stacks",false); + desc.add<bool>("usePhase2Stacks", false); desc.addUntracked<std::string>("trackerGeometryLabel", ""); descriptions.addDefault(desc); } From 5ad296d1abf299d2148b2048dfb700de19ad9599 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 2 Oct 2019 18:24:27 +0200 Subject: [PATCH 345/778] restructure code in VectorHit.cc to satisfy static analyzer --- .../src/TrackerGeomBuilderFromGeometricDet.cc | 2 +- .../src/SeedingOTEDProducer.cc | 26 +++++++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc index 67b76c66427ee..ccd079e61e6ea 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc @@ -256,7 +256,7 @@ void TrackerGeomBuilderFromGeometricDet::buildGeomDet(TrackerGeometry* tracker) tracker->addDetId(composedDetId); } else if (gduTypeName.find("Lower") != std::string::npos) { - //FIXME::ERICA: the plane builder is built in the middle... + //The plane is *not* built in the middle, but on the Lower surface Plane* plane = new Plane(dus->surface()); composedDetId = theTopo->stack(gduId[i]); StackGeomDet* stackDet = new StackGeomDet(&(*plane), dus, dum, composedDetId); diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index d048057a51a17..829f3bcc14d21 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -321,36 +321,30 @@ void SeedingOTEDProducer::printVHsOnLayer(edm::Handle<VectorHitCollectionNew> VH } const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& vHit) { + + // having fun with theta + Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); + float theta = gv.theta(); + // gv transform to local (lv) + const Local3DVector lv(vHit.det()->surface().toLocal(gv)); + //FIXME::charge is fine 1 every two times!! int charge = 1; - //float pT = vHit.transverseMomentum(magField); float p = vHit.momentum(magField); float x = vHit.localPosition().x(); float y = vHit.localPosition().y(); float dx = vHit.localDirection().x(); - float dy = vHit.localDirection().y(); + // for dy use second component of the lv renormalized to the z component + float dy = lv.y() / lv.z(); + // Pz and Dz should have the same sign float signPz = copysign(1.0, vHit.globalPosition().z()); - // having fun with theta - Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); - float theta = gv.theta(); - //std::cout << "\tgv : " << gv << std::endl; - //std::cout << "\tgv theta : " << theta << std::endl; - //std::cout << "\tgv theta error : " << computeGlobalThetaError(vHit, beamSpot->sigmaZ()) << std::endl; - //std::cout << "\tgv eta : " << gv.eta() << std::endl; - // gv transform to local (lv) - const Local3DVector lv(vHit.det()->surface().toLocal(gv)); - //std::cout << "\tlv : " << lv << std::endl; - // replace dy with second component of the lv renormalized to the z component - dy = lv.y() / lv.z(); LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p mat[0][0] = pow(computeInverseMomentumError(vHit, theta, magField, beamSpot->sigmaZ()), 2); - //std::cout << "\tltraj : " << charge << "," << 1./p <<","<< dx <<","<< dy <<","<< x <<","<< y <<","<< signPz << std::endl; - //std::cout << "\tmat : " << mat << std::endl; //building tsos LocalTrajectoryError lterr(asSMatrix<5>(mat)); From 05858c25a5f26a188bd8ca45c9f2b70de6670e8f Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 2 Oct 2019 20:37:18 +0200 Subject: [PATCH 346/778] code format --- RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 829f3bcc14d21..cecbbfe9a2393 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -321,7 +321,6 @@ void SeedingOTEDProducer::printVHsOnLayer(edm::Handle<VectorHitCollectionNew> VH } const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& vHit) { - // having fun with theta Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); float theta = gv.theta(); @@ -340,7 +339,6 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& // Pz and Dz should have the same sign float signPz = copysign(1.0, vHit.globalPosition().z()); - LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p From 0ffda002e3337cc4bbba70718d000c692a2d716c Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Thu, 3 Oct 2019 21:30:08 +0200 Subject: [PATCH 347/778] fix most of the issues making the tests fail --- DataFormats/TrackerRecHit2D/interface/VectorHit2D.h | 1 + .../python/SiPhase2RecHitMatcher_cfi.py | 4 ++++ .../python/SiPhase2VectorHitBuilder_cfi.py | 4 ++++ RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index 2ed4c5fd9b911..2ae8a3893ab28 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -4,6 +4,7 @@ #include "DataFormats/GeometryVector/interface/LocalVector.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" #include "DataFormats/CLHEP/interface/AlgebraicObjects.h" +#include "DataFormats/GeometrySurface/interface/LocalError.h" class VectorHit2D { public: diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py new file mode 100644 index 0000000000000..b10e94e6c8b96 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +SiPhase2RecHitMatcherESProducer = cms.ESProducer("SiPhase2RecHitMatcherESProducer", +) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py new file mode 100644 index 0000000000000..d885267371172 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +siPhase2VectorHits = cms.EDProducer("VectorHitBuilderEDProducer", +) diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc index 8c6b86fa37d87..f8b9ede21b188 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc @@ -42,5 +42,5 @@ void PxMeasurementConditionSet::init(int size) { void Phase2OTMeasurementConditionSet::init(int size) { activeThisPeriod_.resize(size, true); id_.resize(size); - matcher()->algo()->initCpe(cpe()); + if (size > 0) matcher()->algo()->initCpe(cpe()); } From 7c1b91110b9533e3875176ded97acb83d990b9cf Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Thu, 3 Oct 2019 21:59:47 +0200 Subject: [PATCH 348/778] code checks --- RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc index f8b9ede21b188..ca70930c5e707 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc @@ -42,5 +42,6 @@ void PxMeasurementConditionSet::init(int size) { void Phase2OTMeasurementConditionSet::init(int size) { activeThisPeriod_.resize(size, true); id_.resize(size); - if (size > 0) matcher()->algo()->initCpe(cpe()); + if (size > 0) + matcher()->algo()->initCpe(cpe()); } From 872a25c335f4ed4ee7b67ddf90fe310a2cb9ecc0 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 9 Oct 2019 01:16:12 +0200 Subject: [PATCH 349/778] apply comments by andrea --- CommonTools/RecoAlgos/src/ClusterStorer.cc | 1 - .../TrackerRecHit2D/interface/VectorHit2D.h | 4 +- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 32 +++-- .../TrackerRecHit2D/src/classes_def.xml | 4 +- .../test/ClustersValidationTGraph.cc | 7 -- .../plugins/TkStackMeasurementDet.cc | 4 +- .../MeasurementDet/src/TkMeasurementDetSet.h | 2 - .../src/SeedingOTEDProducer.cc | 119 +----------------- .../plugins/QuickTrackAssociatorByHitsImpl.cc | 7 -- 9 files changed, 22 insertions(+), 158 deletions(-) diff --git a/CommonTools/RecoAlgos/src/ClusterStorer.cc b/CommonTools/RecoAlgos/src/ClusterStorer.cc index e015446c7d5be..760be3efc6c0b 100644 --- a/CommonTools/RecoAlgos/src/ClusterStorer.cc +++ b/CommonTools/RecoAlgos/src/ClusterStorer.cc @@ -45,7 +45,6 @@ namespace helper { } else if (hit_type == typeid(Phase2TrackerRecHit1D)) { //FIXME:: this is just temporary solution for phase2, //it is not really running in the phase2 tracking wf - yet... - //std::cout << "| It is a Phase2TrackerRecHit1D hit !!" << std::endl; phase2OTClusterRecords_.push_back( Phase2OTClusterHitRecord(static_cast<Phase2TrackerRecHit1D &>(newHit), hits, index)); } else if (hit_type == typeid(VectorHit)) { diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index 2ae8a3893ab28..88cea12308bf7 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -1,5 +1,5 @@ -#ifndef TrackingRecHit_VectorHit2D_h -#define TrackingRecHit_VectorHit2D_h +#ifndef TrackerRecHit2D_VectorHit2D_h +#define TrackerRecHit2D_VectorHit2D_h #include "DataFormats/GeometryVector/interface/LocalVector.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 2f915c6f6187f..32f71c58baf1c 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -214,8 +214,8 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const pow(gPositionLower.y(), 2) * gPositionUpper.y() - gPositionLower.y() * pow(gPositionUpper.y(), 2); //radius of circle - double rho = sqrt(r12 * r22 * h3) / (2. * h1); - curvature = 1. / rho; + double invRho2 = (2. * h1)/(r12 * r22 * h3); + curvature = sqrt(invRho2); //center of circle double xcentre = h5 / h2; @@ -234,25 +234,22 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const jacobian[i][j] = 0.0; } } - + double denom1 = 1./sqrt(r12 * r22 * h3); + double denom2 = 1./(pow(r12 * r22 * h3, 1.5)); jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 jacobian[2][0] = - (h1 * (2. * gPositionLower.x() * r22 * h3 + (2. * gPositionLower.x() - 2. * gPositionUpper.x()) * r12 * r22)) / - (pow(r12 * r22 * h3, 1.5)) - - (2. * gPositionUpper.y()) / sqrt(r12 * r22 * h3); // dkappa/dx1 + (h1 * (2. * gPositionLower.x() * r22 * h3 + (2. * gPositionLower.x() - 2. * gPositionUpper.x()) * r12 * r22)) * denom2 - + (2. * gPositionUpper.y()) * denom1; // dkappa/dx1 jacobian[2][1] = - (2. * gPositionUpper.x()) / sqrt(r12 * r22 * h3) + - (h1 * (2. * gPositionLower.y() * r22 * h3 + r12 * r22 * (2. * gPositionLower.y() - 2. * gPositionUpper.y()))) / - pow(r12 * r22 * h3, 1.5); // dkappa/dy1 + (2. * gPositionUpper.x()) * denom1 + + (h1 * (2. * gPositionLower.y() * r22 * h3 + r12 * r22 * (2. * gPositionLower.y() - 2. * gPositionUpper.y()))) * denom2; // dkappa/dy1 jacobian[2][2] = - (2. * gPositionLower.y()) / sqrt(r12 * r22 * h3) + - (h1 * (2. * gPositionUpper.x() * r12 * h3 - 2. * (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) / - pow(r12 * r22 * h3, 1.5); // dkappa/dx2 + (2. * gPositionLower.y()) * denom1 + + (h1 * (2. * gPositionUpper.x() * r12 * h3 - 2. * (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2; // dkappa/dx2 jacobian[2][3] = - (h1 * (2. * gPositionUpper.y() * r12 * h3 - r12 * r22 * 2. * (gPositionLower.y() - gPositionUpper.y()))) / - pow(r12 * r22 * h3, 1.5) - - (2. * gPositionLower.x()) / sqrt(r12 * r22 * h3); // dkappa/dy2 + (h1 * (2. * gPositionUpper.y() * r12 * h3 - r12 * r22 * 2. * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - + (2. * gPositionLower.x()) * denom1; // dkappa/dy2 for (int i = 0; i < 4; i++) { jacobian[2][i] = -jacobian[2][i]; @@ -260,8 +257,8 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const AlgebraicVector2 M; //to compute phi at the cluster points - M[0] = (gPositionLower.y() - ycentre) / pow(rho, 2); // dphi/dxcentre - M[1] = -(gPositionLower.x() - xcentre) / pow(rho, 2); // dphi/dycentre + M[0] = (gPositionLower.y() - ycentre) * invRho2; // dphi/dxcentre + M[1] = -(gPositionLower.x() - xcentre) * invRho2; // dphi/dycentre //to compute phi at the origin AlgebraicROOTObject<2, 4>::Matrix K; @@ -335,7 +332,6 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const temp[3] * curvatureJacobian[3]; } else { - std::cout << " straight line!" << std::endl; return std::make_pair(0.0, 0.0); } diff --git a/DataFormats/TrackerRecHit2D/src/classes_def.xml b/DataFormats/TrackerRecHit2D/src/classes_def.xml index d10e52aaa4d6d..87a581c22987b 100644 --- a/DataFormats/TrackerRecHit2D/src/classes_def.xml +++ b/DataFormats/TrackerRecHit2D/src/classes_def.xml @@ -192,8 +192,8 @@ <class name="VectorHit" ClassVersion="3"> <version ClassVersion="3" checksum="546506376"/> </class> - <class name="VectorHit2D" ClassVersion="2"> - <version ClassVersion="2" checksum="333065919"/> + <class name="VectorHit2D" ClassVersion="3"> + <version ClassVersion="3" checksum="333065919"/> </class> <class name="edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector> >"/> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc index 3a31e39b56183..9f34cc8bbb199 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc @@ -261,13 +261,11 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, x_local = localPosClu.x(); y_local = localPosClu.y(); z_local = localPosClu.z(); - std::cout << localPosClu << std::endl; Global3DPoint globalPosClu = geomDetUnit->surface().toGlobal(localPosClu); x_global = globalPosClu.x(); y_global = globalPosClu.y(); z_global = globalPosClu.z(); - //std::cout << globalPosClu << std::endl; // Fill the position histograms trackerLayout_[0]->SetPoint(nClustersTot, globalPosClu.z(), globalPosClu.perp()); @@ -318,12 +316,7 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, ->column())); // Here we have to use the old pixelToChannel function (not Phase2TrackerDigi but PixelDigi), change this when using new Digis unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detId, channel)); clusterSimTrackIds.push_back(simTrackId); - std::cout << channel << std::endl; - std::cout << simTrackId << std::endl; - std::cout << std::endl; } - unsigned int InnerChannel = clustIt->firstDigi().channel(); - std::cout << InnerChannel << std::endl; /* // SimHits related variables diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index e54e929f97224..eca45f74b3fc0 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -27,10 +27,10 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj HitCollectorForRecHits collector( &fastGeomDet(), theMatcher, theCPE, result ); collectRecHits(ts, collector); */ - if (isEmpty(data.phase2OTData()) == true) + if (isEmpty(data.phase2OTData())) return result; LogTrace("MeasurementTracker") << " is not empty"; - if (isActive(data) == false) + if (!isActive(data)) return result; LogTrace("MeasurementTracker") << " and is active"; diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h index 2a2fc822a318c..58189318ec154 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h @@ -6,7 +6,6 @@ class TkStripMeasurementDet; class TkStripMeasurementDet; class TkPixelMeasurementDet; class SiStripRecHitMatcher; -//class VectorHitBuilderEDProducer; class StripClusterParameterEstimator; class PixelClusterParameterEstimator; class Phase2StripCPE; @@ -21,7 +20,6 @@ class Phase2StripCPE; #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h" #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" #include <unordered_map> diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index cecbbfe9a2393..ad44f8df5fdcc 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -37,7 +37,6 @@ void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descr } void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { - std::cout << "SeedingOT::produce() begin" << std::endl; std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); edm::ESHandle<TrackerTopology> tTopoHandle; @@ -71,7 +70,6 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) edm::Handle<reco::BeamSpot> beamSpotH; event.getByToken(beamSpotToken, beamSpotH); if (beamSpotH.isValid()) { - std::cout << "BeamSpot Position: " << *(beamSpotH.product()); beamSpot = beamSpotH.product(); } @@ -91,35 +89,21 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) seedsWithVHs->shrink_to_fit(); event.put(std::move(seedsWithVHs)); - std::cout << "SeedingOT::produce() end" << std::endl; } TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { TrajectorySeedCollection result; - std::cout << "-----------------------------" << std::endl; - printVHsOnLayer(VHs, 1); - printVHsOnLayer(VHs, 2); - printVHsOnLayer(VHs, 3); - printVHsOnLayer(VHs, 4); - printVHsOnLayer(VHs, 5); - printVHsOnLayer(VHs, 6); - std::cout << "-----------------------------" << std::endl; - //check if all the first three layers have VHs std::vector<VectorHit> VHseedsL1 = collectVHsOnLayer(VHs, 1); std::vector<VectorHit> VHseedsL2 = collectVHsOnLayer(VHs, 2); std::vector<VectorHit> VHseedsL3 = collectVHsOnLayer(VHs, 3); if (VHseedsL1.empty() || VHseedsL2.empty() || VHseedsL3.empty()) { - std::cout << "------- seeds found: " << result.size() << " ------" << std::endl; - std::cout << "- L1 or L2 or L3 are empty! -" << std::endl; - std::cout << "-----------------------------" << std::endl; return result; } //seeds are built in the L3 of the OT const BarrelDetLayer* barrelOTLayer2 = measurementTracker->geometricSearchTracker()->tobLayers().at(1); - std::cout << "VH seeds = " << VHseedsL3.size() << std::endl; //the search propag directiondepend on the sign of signZ*signPz, while the building is always the contrary Propagator* searchingPropagator = &*propagator->clone(); @@ -128,129 +112,80 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio for (auto hitL3 : VHseedsL3) { //building a tsos out of a VectorHit - std::cout << "\t1a) Building a seed for the VH: " << hitL3 << std::endl; const TrajectoryStateOnSurface initialTSOS = buildInitialTSOS(hitL3); float signZ = copysign(1.0, initialTSOS.globalPosition().z()); float signPz = copysign(1.0, initialTSOS.globalMomentum().z()); - std::cout << "\t initialTSOS : " << initialTSOS << std::endl; //set the direction of the propagator - std::cout << "\t1b) Set the searchingPropagator direction: " << std::endl; if (signZ * signPz > 0.0) searchingPropagator->setPropagationDirection(oppositeToMomentum); if (signZ * signPz < 0.0) searchingPropagator->setPropagationDirection(alongMomentum); if (searchingPropagator->propagationDirection() == alongMomentum) - std::cout << "\t searchingPropagator along Momentum" << std::endl; if (searchingPropagator->propagationDirection() == oppositeToMomentum) - std::cout << "\t ropagator opposite To Momentum" << std::endl; //find vHits in layer 2 - std::cout << "-----------------------------" << std::endl; - std::cout << "\t1c) Search/find hit in layer 2: " << std::endl; std::vector<TrajectoryMeasurement> measurementsL2 = layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); - std::cout << "\t vh compatibles on L2: " << measurementsL2.size() << std::endl; //other options //LayerMeasurements::SimpleHitContainer hits; //layerMeasurements->recHits(hits, *barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); - //std::cout << "\t #try2 vh compatibles with recHits: " << hits.size() << std::endl; //auto && measurementsL2G = layerMeasurements->groupedMeasurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); - //std::cout << "\t #try3 vh grouped compatibles: " << measurementsL2G.size() << std::endl; + std::vector<TrajectoryMeasurement> measurementsL2 = + layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); std::vector<TrajectoryMeasurement>::iterator measurementsL2end = std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid()); measurementsL2.erase(measurementsL2end, measurementsL2.end()); - std::cout << "\t vh compatibles on L2(without invalidHit): " << measurementsL2.size() << std::endl; - std::cout << "-----------------------------" << std::endl; if (!measurementsL2.empty()) { //not sure if building it everytime takes time/memory const DetLayer* barrelOTLayer1 = measurementTracker->geometricSearchTracker()->tobLayers().at(0); for (auto mL2 : measurementsL2) { - std::cout << "\t2a) Check the searchingPropagator direction: " << std::endl; - if (searchingPropagator->propagationDirection() == alongMomentum) - std::cout << "\t searchingPropagator along Momentum" << std::endl; - if (searchingPropagator->propagationDirection() == oppositeToMomentum) - std::cout << "\t searchingPropagator opposite To Momentum" << std::endl; const TrackingRecHit* hitL2 = mL2.recHit().get(); - std::cout << "\t2b) and the VH on layer 2: " << std::endl; - const VectorHit* vhit = dynamic_cast<const VectorHit*>(hitL2); - std::cout << "\t vh is valid >> " << (*vhit) << std::endl; //propagate to the L2 and update the TSOS - std::cout << "\t2c) Propagation and update on L2: " << std::endl; std::pair<bool, TrajectoryStateOnSurface> updatedTSOS = propagateAndUpdate(initialTSOS, *searchingPropagator, *hitL2); - if (!updatedTSOS.first) - std::cout << "\t updatedTSOS on L2 is NOT valid : " << updatedTSOS.second << std::endl; if (!updatedTSOS.first) continue; - std::cout << "\t updatedTSOS is valid : " << updatedTSOS.second << std::endl; - std::cout << "\t chi2 VH/updatedTSOS : " << estimator->estimate(updatedTSOS.second, *hitL2).second - << std::endl; //searching possible VHs in L1 - std::cout << "\t2d) Search/find hit in layer 1: " << std::endl; std::vector<TrajectoryMeasurement> measurementsL1 = layerMeasurements->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator); - std::cout << "\t vh compatibles on L1: " << measurementsL1.size() << std::endl; std::vector<TrajectoryMeasurement>::iterator measurementsL1end = std::remove_if(measurementsL1.begin(), measurementsL1.end(), isInvalid()); measurementsL1.erase(measurementsL1end, measurementsL1.end()); - std::cout << "\t vh compatibles on L1(without invalidHit): " << measurementsL1.size() << std::endl; - std::cout << "-----------------------------" << std::endl; if (!measurementsL1.empty()) { for (auto mL1 : measurementsL1) { - std::cout << "\t3a) Check the searchingPropagator direction: " << std::endl; - if (searchingPropagator->propagationDirection() == alongMomentum) - std::cout << "\t searchingPropagator along Momentum" << std::endl; - if (searchingPropagator->propagationDirection() == oppositeToMomentum) - std::cout << "\t searchingPropagator opposite To Momentum" << std::endl; const TrackingRecHit* hitL1 = mL1.recHit().get(); - std::cout << "\t3b) and the VH on layer 1: " << std::endl; - const VectorHit* vhitL1 = dynamic_cast<const VectorHit*>(hitL1); - std::cout << "\t vh is valid >> " << (*vhitL1) << std::endl; //propagate to the L1 and update the TSOS - std::cout << "\t3c) Propagation and update on L1: " << std::endl; std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL1 = propagateAndUpdate(updatedTSOS.second, *searchingPropagator, *hitL1); - if (!updatedTSOSL1.first) - std::cout << "\t updatedTSOS on L1 is NOT valid : " << updatedTSOSL1.second << std::endl; if (!updatedTSOSL1.first) continue; - std::cout << "\t updatedTSOS on L1 : " << updatedTSOSL1.second << std::endl; - std::cout << "\t chi2 VH/updatedTSOS : " << estimator->estimate(updatedTSOSL1.second, *hitL1).second - << std::endl; - std::cout << "\t3d) Creation of the Seed: " << std::endl; - // passSelection(updatedTSOS) : - // http://cmslxr.fnal.gov/lxr/source/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc?v=CMSSW_8_1_X_2016-09-04-2300#0474 edm::OwnVector<TrackingRecHit> container; container.push_back(hitL1->clone()); container.push_back(hitL2->clone()); container.push_back(hitL3.clone()); //building trajectory inside-out - std::cout << "\t3e) Building trajectory inside-out: " << std::endl; if (searchingPropagator->propagationDirection() == alongMomentum) { buildingPropagator->setPropagationDirection(oppositeToMomentum); - std::cout << "\t buildingPropagator opposite To Momentum" << std::endl; } else if (searchingPropagator->propagationDirection() == oppositeToMomentum) { buildingPropagator->setPropagationDirection(alongMomentum); - std::cout << "\t buildingPropagator along Momentum" << std::endl; } updatedTSOSL1.second.rescaleError(100); - std::cout << "\t updatedTSOS on L1 : " << updatedTSOSL1.second << std::endl; TrajectoryStateOnSurface updatedTSOSL1_final = theUpdator->update(updatedTSOSL1.second, *hitL1); if @@ -259,20 +194,15 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); - std::cout << "\t updatedTSOS final on L3 : " << updatedTSOSL3_final.second << std::endl; TrajectorySeed ts = createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(), *buildingPropagator); result.push_back(ts); } } - std::cout << "-----" << std::endl; } } } - std::cout << "-----------------------------" << std::endl; - std::cout << "------- seeds found: " << result.size() << " ------" << std::endl; - std::cout << "-----------------------------" << std::endl; return result; } @@ -291,7 +221,6 @@ std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<Vector const VectorHitCollectionNew& input = *VHs; std::vector<VectorHit> VHsOnLayer; if (!input.empty()) { - //std::cout << "initial VH collection size = " << input.size() << std::endl; for (auto DSViter : input) { if (checkLayer(DSViter.id()) == layerNumber) { for (auto vh : DSViter) { @@ -301,7 +230,6 @@ std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<Vector } } - //std::cout << "VH in layer " << layerNumber << " collection size = " << VHsOnLayer.size() << std::endl; return VHsOnLayer; } @@ -368,7 +296,6 @@ std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdat const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) { TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); TrajectoryStateOnSurface updatedTSOS = theUpdator->update(propTSOS, hit); - //std::cout << "updatedTSOS : " << updatedTSOS << std::endl; if UNLIKELY(!updatedTSOS.isValid()) return std::make_pair(false, updatedTSOS); return std::make_pair(true, updatedTSOS); @@ -398,49 +325,7 @@ TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& t const edm::OwnVector<TrackingRecHit>& container, const DetId& id, const Propagator& prop) { - /* - //I have already propagator and updator - //const Propagator* propagator = &(*propagatorHandle); - //KFUpdator updator; - - // Now update initial state track using information from seed hits. - - TrajectoryStateOnSurface updatedState; - edm::OwnVector<TrackingRecHit> seedHits; - - for ( unsigned int iHit = 1; iHit < container.size(); iHit++) { - - std::pair<bool, TrajectoryStateOnSurface> state; - if(iHit==1) - state = propagateAndUpdate(tsos, *propagator, container[iHit]); - else - state = propagateAndUpdate(updatedState, *propagator, container[iHit]); - //std::cout << "-------> new state >> " << state.second << std::endl; - if(state.first) - updatedState = state.second; -*/ - /* - TrajectoryStateOnSurface state = (iHit==1) ? propagator->propagate(tsos, container[iHit].det()->surface()) : propagator->propagate(updatedState, container[iHit].det()->surface()); - - std::cout << "-------> new state >> " << state << std::endl; - - if (!state.isValid()) return TrajectorySeed(); - - //SeedingHitSet::ConstRecHitPointer tth = hits[iHit]; - //std::unique_ptr<BaseTrackerRecHit> newtth(refitHit( tth, state)); - //if (!checkHit(state,&*newtth)) return; - - std::cout << "-------> updated state >> " << state << std::endl; - updatedState = theUpdator->update(state, container[iHit]); - if (!updatedState.isValid()) return TrajectorySeed(); - - //seedHits.push_back(newtth.release()); -*/ - // } - - //if(!hit) return; PTrajectoryStateOnDet seedTSOS = trajectoryStateTransform::persistentState(tsos, id.rawId()); return TrajectorySeed(seedTSOS, container, prop.propagationDirection()); - //if ( !filter || filter->compatible(seed)) seedCollection.push_back(std::move(seed)); } diff --git a/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc b/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc index fcc5ab60b3e26..3b49cff70bd7b 100644 --- a/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc +++ b/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc @@ -5,13 +5,6 @@ #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" -#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" -#include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h" -#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" -#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" -#include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" -#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" -#include "DataFormats/SiStripDetId/interface/SiStripDetId.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/Math/interface/deltaR.h" From ac8f3be934e02f4f95d221b255d5d7bc375d193c Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 9 Oct 2019 01:27:46 +0200 Subject: [PATCH 350/778] apply code checks --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 20 +++++++++++-------- .../src/SeedingOTEDProducer.cc | 15 ++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 32f71c58baf1c..1aa1f7a1dae9d 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -214,7 +214,7 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const pow(gPositionLower.y(), 2) * gPositionUpper.y() - gPositionLower.y() * pow(gPositionUpper.y(), 2); //radius of circle - double invRho2 = (2. * h1)/(r12 * r22 * h3); + double invRho2 = (2. * h1) / (r12 * r22 * h3); curvature = sqrt(invRho2); //center of circle @@ -234,21 +234,25 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const jacobian[i][j] = 0.0; } } - double denom1 = 1./sqrt(r12 * r22 * h3); - double denom2 = 1./(pow(r12 * r22 * h3, 1.5)); + double denom1 = 1. / sqrt(r12 * r22 * h3); + double denom2 = 1. / (pow(r12 * r22 * h3, 1.5)); jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 jacobian[2][0] = - (h1 * (2. * gPositionLower.x() * r22 * h3 + (2. * gPositionLower.x() - 2. * gPositionUpper.x()) * r12 * r22)) * denom2 - - (2. * gPositionUpper.y()) * denom1; // dkappa/dx1 + (h1 * (2. * gPositionLower.x() * r22 * h3 + (2. * gPositionLower.x() - 2. * gPositionUpper.x()) * r12 * r22)) * + denom2 - + (2. * gPositionUpper.y()) * denom1; // dkappa/dx1 jacobian[2][1] = (2. * gPositionUpper.x()) * denom1 + - (h1 * (2. * gPositionLower.y() * r22 * h3 + r12 * r22 * (2. * gPositionLower.y() - 2. * gPositionUpper.y()))) * denom2; // dkappa/dy1 + (h1 * (2. * gPositionLower.y() * r22 * h3 + r12 * r22 * (2. * gPositionLower.y() - 2. * gPositionUpper.y()))) * + denom2; // dkappa/dy1 jacobian[2][2] = (2. * gPositionLower.y()) * denom1 + - (h1 * (2. * gPositionUpper.x() * r12 * h3 - 2. * (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2; // dkappa/dx2 + (h1 * (2. * gPositionUpper.x() * r12 * h3 - 2. * (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * + denom2; // dkappa/dx2 jacobian[2][3] = - (h1 * (2. * gPositionUpper.y() * r12 * h3 - r12 * r22 * 2. * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - + (h1 * (2. * gPositionUpper.y() * r12 * h3 - r12 * r22 * 2. * (gPositionLower.y() - gPositionUpper.y()))) * + denom2 - (2. * gPositionLower.x()) * denom1; // dkappa/dy2 for (int i = 0; i < 4; i++) { diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index ad44f8df5fdcc..2aaa01760cc34 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -88,7 +88,6 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) seedsWithVHs->shrink_to_fit(); event.put(std::move(seedsWithVHs)); - } TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { @@ -116,7 +115,6 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio float signZ = copysign(1.0, initialTSOS.globalPosition().z()); float signPz = copysign(1.0, initialTSOS.globalMomentum().z()); - //set the direction of the propagator if (signZ * signPz > 0.0) searchingPropagator->setPropagationDirection(oppositeToMomentum); @@ -124,11 +122,11 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio searchingPropagator->setPropagationDirection(alongMomentum); if (searchingPropagator->propagationDirection() == alongMomentum) - if (searchingPropagator->propagationDirection() == oppositeToMomentum) + if (searchingPropagator->propagationDirection() == oppositeToMomentum) - //find vHits in layer 2 - std::vector<TrajectoryMeasurement> measurementsL2 = - layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + //find vHits in layer 2 + std::vector<TrajectoryMeasurement> measurementsL2 = + layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); //other options //LayerMeasurements::SimpleHitContainer hits; @@ -146,7 +144,6 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio const DetLayer* barrelOTLayer1 = measurementTracker->geometricSearchTracker()->tobLayers().at(0); for (auto mL2 : measurementsL2) { - const TrackingRecHit* hitL2 = mL2.recHit().get(); //propagate to the L2 and update the TSOS @@ -164,7 +161,6 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio if (!measurementsL1.empty()) { for (auto mL1 : measurementsL1) { - const TrackingRecHit* hitL1 = mL1.recHit().get(); //propagate to the L1 and update the TSOS @@ -199,7 +195,6 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio result.push_back(ts); } } - } } } @@ -230,7 +225,6 @@ std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<Vector } } - return VHsOnLayer; } @@ -325,7 +319,6 @@ TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& t const edm::OwnVector<TrackingRecHit>& container, const DetId& id, const Propagator& prop) { - PTrajectoryStateOnDet seedTSOS = trajectoryStateTransform::persistentState(tsos, id.rawId()); return TrajectorySeed(seedTSOS, container, prop.propagationDirection()); } From 35bc979aaac984fdce3c01a6095fd9374715009d Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 9 Oct 2019 01:34:38 +0200 Subject: [PATCH 351/778] fix things broken in SeedingOTEDProducer.cc by last commit --- RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 2aaa01760cc34..2e4b5347a4558 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -121,19 +121,15 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio if (signZ * signPz < 0.0) searchingPropagator->setPropagationDirection(alongMomentum); - if (searchingPropagator->propagationDirection() == alongMomentum) - if (searchingPropagator->propagationDirection() == oppositeToMomentum) - //find vHits in layer 2 - std::vector<TrajectoryMeasurement> measurementsL2 = - layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + //find vHits in layer 2 + std::vector<TrajectoryMeasurement> measurementsL2 = + layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); //other options //LayerMeasurements::SimpleHitContainer hits; //layerMeasurements->recHits(hits, *barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); //auto && measurementsL2G = layerMeasurements->groupedMeasurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); - std::vector<TrajectoryMeasurement> measurementsL2 = - layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); std::vector<TrajectoryMeasurement>::iterator measurementsL2end = std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid()); From 672156a45e30a483280cb43cd8322198a5e6219a Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 9 Oct 2019 07:22:52 +0200 Subject: [PATCH 352/778] fix the fixes --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 1aa1f7a1dae9d..a3256a2f969a0 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -214,7 +214,7 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const pow(gPositionLower.y(), 2) * gPositionUpper.y() - gPositionLower.y() * pow(gPositionUpper.y(), 2); //radius of circle - double invRho2 = (2. * h1) / (r12 * r22 * h3); + double invRho2 = (4. * h1 * h1) / (r12 * r22 * h3); curvature = sqrt(invRho2); //center of circle From 2dd7bf8229a85f279ff67eb89ef0f3edfe6b9dbd Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 9 Oct 2019 07:38:05 +0200 Subject: [PATCH 353/778] code formates --- RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 2e4b5347a4558..5c1f381df6122 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -121,10 +121,9 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio if (signZ * signPz < 0.0) searchingPropagator->setPropagationDirection(alongMomentum); - //find vHits in layer 2 std::vector<TrajectoryMeasurement> measurementsL2 = - layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); //other options //LayerMeasurements::SimpleHitContainer hits; From d5c6cb4df2f188d35c547367e249b401c0f5ab33 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Mon, 14 Oct 2019 18:40:37 +0200 Subject: [PATCH 354/778] resolve conflict in TkStackMeasurementDet.h --- .../python/RecoLocalTracker_cff.py | 2 +- .../SiPhase2RecHitMatcherESProducer.cc | 25 ++++++++----------- .../python/SiPhase2RecHitMatcher_cfi.py | 4 --- .../TrackerRecoGeometryESProducer_cfi.py | 2 +- 4 files changed, 13 insertions(+), 20 deletions(-) delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py diff --git a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py index 06ebb798faca2..7050eb08bdb14 100644 --- a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py +++ b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py @@ -23,7 +23,7 @@ from RecoLocalTracker.SiPhase2Clusterizer.phase2TrackerClusterizer_cfi import * from RecoLocalTracker.Phase2TrackerRecHits.Phase2StripCPEGeometricESProducer_cfi import * -from RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2RecHitMatcher_cfi import * +from RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2RecHitMatcherESProducer_cfi import * _pixeltrackerlocalrecoTask_phase2 = pixeltrackerlocalrecoTask.copy() _pixeltrackerlocalrecoTask_phase2.add(siPhase2Clusters) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 154c88423ad64..3ad78c6a587d9 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -15,33 +15,30 @@ class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { SiPhase2RecHitMatcherESProducer(const edm::ParameterSet&); static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); std::shared_ptr<VectorHitBuilderEDProducer> produce(const TkPhase2OTCPERecord&); + edm::ESGetToken<TrackerGeometry, TkPhase2OTCPERecord> tGeomToken_; + edm::ESGetToken<TrackerTopology, TkPhase2OTCPERecord> tTopoToken_; private: std::string name_; - std::shared_ptr<VectorHitBuilderEDProducer> matcher_; edm::ParameterSet pset_; }; SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet& p) { name_ = p.getParameter<std::string>("ComponentName"); pset_ = p; - setWhatProduced(this, name_); + auto cc = setWhatProduced(this, name_); + tGeomToken_ = cc.consumes<TrackerGeometry>(); + tTopoToken_ = cc.consumes<TrackerTopology>(); } std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer::produce( const TkPhase2OTCPERecord& iRecord) { - if (name_ == "SiPhase2VectorHitMatcher") { - matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); +// if (name_ == "SiPhase2VectorHitMatcher") { + std::shared_ptr<VectorHitBuilderEDProducer> matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); - edm::ESHandle<TrackerGeometry> tGeomHandle; - edm::ESHandle<TrackerTopology> tTopoHandle; - - iRecord.getRecord<TrackerDigiGeometryRecord>().get(tGeomHandle); - iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle); - - matcher_->algo()->initTkGeom(tGeomHandle); - matcher_->algo()->initTkTopo(tTopoHandle); - } + matcher_->algo()->initTkGeom(iRecord.getHandle(tGeomToken_)); + matcher_->algo()->initTkTopo(iRecord.getHandle(tTopoToken_)); +// } return matcher_; } @@ -74,7 +71,7 @@ void SiPhase2RecHitMatcherESProducer::fillDescriptions(edm::ConfigurationDescrip 0.1, 0.1, }); - descriptions.add("SiPhase2RecHitMatcherESProducer", desc); + descriptions.add("siPhase2RecHitMatcherESProducer", desc); } DEFINE_FWK_EVENTSETUP_MODULE(SiPhase2RecHitMatcherESProducer); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py deleted file mode 100644 index b10e94e6c8b96..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py +++ /dev/null @@ -1,4 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -SiPhase2RecHitMatcherESProducer = cms.ESProducer("SiPhase2RecHitMatcherESProducer", -) diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 22d95e29034d3..a89b539106034 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -5,5 +5,5 @@ ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) From 428127c40fc924c91f340e46176fb330bde458ed Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Mon, 14 Oct 2019 18:43:44 +0200 Subject: [PATCH 355/778] Revert "resolve conflict in TkStackMeasurementDet.h" This reverts commit a411999f99937e5d00ae323f7853adeb52144eb5. --- .../python/RecoLocalTracker_cff.py | 2 +- .../SiPhase2RecHitMatcherESProducer.cc | 25 +++++++++++-------- .../python/SiPhase2RecHitMatcher_cfi.py | 4 +++ .../TrackerRecoGeometryESProducer_cfi.py | 2 +- .../plugins/TkStackMeasurementDet.h | 2 +- 5 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py diff --git a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py index 7050eb08bdb14..06ebb798faca2 100644 --- a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py +++ b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py @@ -23,7 +23,7 @@ from RecoLocalTracker.SiPhase2Clusterizer.phase2TrackerClusterizer_cfi import * from RecoLocalTracker.Phase2TrackerRecHits.Phase2StripCPEGeometricESProducer_cfi import * -from RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2RecHitMatcherESProducer_cfi import * +from RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2RecHitMatcher_cfi import * _pixeltrackerlocalrecoTask_phase2 = pixeltrackerlocalrecoTask.copy() _pixeltrackerlocalrecoTask_phase2.add(siPhase2Clusters) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 3ad78c6a587d9..154c88423ad64 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -15,30 +15,33 @@ class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { SiPhase2RecHitMatcherESProducer(const edm::ParameterSet&); static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); std::shared_ptr<VectorHitBuilderEDProducer> produce(const TkPhase2OTCPERecord&); - edm::ESGetToken<TrackerGeometry, TkPhase2OTCPERecord> tGeomToken_; - edm::ESGetToken<TrackerTopology, TkPhase2OTCPERecord> tTopoToken_; private: std::string name_; + std::shared_ptr<VectorHitBuilderEDProducer> matcher_; edm::ParameterSet pset_; }; SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet& p) { name_ = p.getParameter<std::string>("ComponentName"); pset_ = p; - auto cc = setWhatProduced(this, name_); - tGeomToken_ = cc.consumes<TrackerGeometry>(); - tTopoToken_ = cc.consumes<TrackerTopology>(); + setWhatProduced(this, name_); } std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer::produce( const TkPhase2OTCPERecord& iRecord) { -// if (name_ == "SiPhase2VectorHitMatcher") { - std::shared_ptr<VectorHitBuilderEDProducer> matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); + if (name_ == "SiPhase2VectorHitMatcher") { + matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); - matcher_->algo()->initTkGeom(iRecord.getHandle(tGeomToken_)); - matcher_->algo()->initTkTopo(iRecord.getHandle(tTopoToken_)); -// } + edm::ESHandle<TrackerGeometry> tGeomHandle; + edm::ESHandle<TrackerTopology> tTopoHandle; + + iRecord.getRecord<TrackerDigiGeometryRecord>().get(tGeomHandle); + iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle); + + matcher_->algo()->initTkGeom(tGeomHandle); + matcher_->algo()->initTkTopo(tTopoHandle); + } return matcher_; } @@ -71,7 +74,7 @@ void SiPhase2RecHitMatcherESProducer::fillDescriptions(edm::ConfigurationDescrip 0.1, 0.1, }); - descriptions.add("siPhase2RecHitMatcherESProducer", desc); + descriptions.add("SiPhase2RecHitMatcherESProducer", desc); } DEFINE_FWK_EVENTSETUP_MODULE(SiPhase2RecHitMatcherESProducer); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py new file mode 100644 index 0000000000000..b10e94e6c8b96 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +SiPhase2RecHitMatcherESProducer = cms.ESProducer("SiPhase2RecHitMatcherESProducer", +) diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index a89b539106034..22d95e29034d3 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -5,5 +5,5 @@ ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index df1e1af4c48b1..4d8d0e04c2b37 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -4,7 +4,7 @@ #include "TrackingTools/MeasurementDet/interface/MeasurementDet.h" #include "TkPhase2OTMeasurementDet.h" -#include "Geometry/CommonDetUnit/interface/StackGeomDet.h" +#include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" From 236113f6d297d1c8cdaa0a1fae20aa1db7d8be9b Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Mon, 14 Oct 2019 18:48:09 +0200 Subject: [PATCH 356/778] resolve merge conflict in kStackMeasurementDet.h --- RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index 4d8d0e04c2b37..df1e1af4c48b1 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -4,7 +4,7 @@ #include "TrackingTools/MeasurementDet/interface/MeasurementDet.h" #include "TkPhase2OTMeasurementDet.h" -#include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" +#include "Geometry/CommonDetUnit/interface/StackGeomDet.h" #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" From ee3a1946c3437dbcd34fa90ec35f91d3e8c2bc50 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Mon, 14 Oct 2019 19:43:34 +0200 Subject: [PATCH 357/778] adapt includes to match changes in PR 28127 --- DataFormats/TrackerRecHit2D/interface/VectorHit.h | 2 +- .../interface/VectorHitBuilderAlgorithmBase.h | 4 ++-- .../src/VectorHitBuilderAlgorithmBase.cc | 2 +- .../SiPhase2VectorHitBuilder/test/VectorHitsValidation.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 83ed6e7b57a15..ef937d820ee2a 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -19,7 +19,7 @@ #include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" #include "DataFormats/GeometryVector/interface/LocalVector.h" -#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "MagneticField/Engine/interface/MagneticField.h" #include "DataFormats/TrackingRecHit/interface/KfComponentsHolder.h" diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 780b9b474485a..71d480b750b90 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -9,10 +9,10 @@ #include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" +#include "Geometry/CommonDetUnit/interface/StackGeomDet.h" #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" -#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" namespace edm { class ParameterSet; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 80e027ed13c69..9c892f46af67b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -5,7 +5,7 @@ #include "Geometry/CommonTopologies/interface/PixelTopology.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" -#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::ParameterSet& conf) : nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index 313e0aa78388b..89f0e93acea6a 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -15,7 +15,7 @@ #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" -#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" From c9eace11015f149bc077e4a436394052840d2ec1 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 16 Oct 2019 16:37:03 +0200 Subject: [PATCH 358/778] rebase to latest IB --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 2 +- .../SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc | 2 +- .../SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index a3256a2f969a0..05ba87ecba7ec 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -1,5 +1,5 @@ #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" -#include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" +#include "Geometry/CommonDetUnit/interface/StackGeomDet.h" VectorHit::VectorHit(const VectorHit& vh) : BaseTrackerRecHit(*vh.det(), trackerHitRTTI::vector), diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc index 9f34cc8bbb199..b6ffb8e031f64 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc @@ -15,7 +15,7 @@ #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" -#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 6c45bd53236e0..a75172161e98d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -2,7 +2,7 @@ #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h" #include "SimTracker/TrackerHitAssociation/interface/ClusterTPAssociation.h" #include "RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h" -#include "Geometry/TrackerGeometryBuilder/interface/StackGeomDet.h" +#include "Geometry/CommonDetUnit/interface/StackGeomDet.h" #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" From 8bdb8a4e097bd2655b0d72661436dcfb3f4b94f7 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 28 Aug 2020 11:02:33 -0500 Subject: [PATCH 359/778] refactor code to not use EDProducer as product of ESProducer - part I --- .../TrackerRecHit2D/interface/VectorHit.h | 10 +++---- .../Records/interface/TkPhase2OTCPERecord.h | 2 +- .../interface/VectorHitBuilderAlgorithm.h | 10 +++---- .../interface/VectorHitBuilderAlgorithmBase.h | 2 +- .../SiPhase2RecHitMatcherESProducer.cc | 29 ++++++++++--------- .../src/VectorHitBuilderAlgorithm.cc | 14 +++++---- .../plugins/MeasurementTrackerESProducer.cc | 6 ++-- .../plugins/MeasurementTrackerImpl.cc | 3 +- .../plugins/MeasurementTrackerImpl.h | 3 +- .../plugins/TkStackMeasurementDet.cc | 8 ++--- .../plugins/TkStackMeasurementDet.h | 6 ++-- .../MeasurementDet/src/TkMeasurementDetSet.cc | 2 +- .../MeasurementDet/src/TkMeasurementDetSet.h | 8 ++--- 13 files changed, 54 insertions(+), 49 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index ef937d820ee2a..b25c8ace397a4 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -26,7 +26,7 @@ #include "TkCloner.h" -class VectorHit GCC11_FINAL : public BaseTrackerRecHit { +class VectorHit : public BaseTrackerRecHit { public: typedef OmniClusterRef::Phase2Cluster1DRef ClusterRef; @@ -60,7 +60,7 @@ class VectorHit GCC11_FINAL : public BaseTrackerRecHit { // Parameters of the segment, for the track fit // For a 4D segment: (dx/dz,dy/dz,x,y) - bool hasPositionAndError() const GCC11_FINAL { + bool hasPositionAndError() const { //bool hasPositionAndError() const { return true; // return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) || @@ -72,10 +72,10 @@ class VectorHit GCC11_FINAL : public BaseTrackerRecHit { void getKfComponents4D(KfComponentsHolder& holder) const; // returning methods - LocalPoint localPosition() const GCC11_FINAL { return thePosition; } + LocalPoint localPosition() const { return thePosition; } virtual LocalVector localDirection() const { return theDirection; } AlgebraicSymMatrix parametersError() const override; - LocalError localPositionError() const GCC11_FINAL; + LocalError localPositionError() const; virtual LocalError localDirectionError() const; Global3DVector globalDirection() const; @@ -102,7 +102,7 @@ class VectorHit GCC11_FINAL : public BaseTrackerRecHit { bool isPhase2() const override { return true; } //FIXME: I have always two clusters in a VH - OmniClusterRef const& firstClusterRef() const GCC11_FINAL { return theLowerCluster; } + OmniClusterRef const& firstClusterRef() const { return theLowerCluster; } ClusterRef cluster() const { return theLowerCluster.cluster_phase2OT(); } //This method returns the delta in global coordinates diff --git a/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h b/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h index 44fea80269a6a..bb6a9ec9a4634 100644 --- a/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h +++ b/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h @@ -12,7 +12,7 @@ class TkPhase2OTCPERecord : public edm::eventsetup::DependentRecordImplementation< TkPhase2OTCPERecord, - edm::mpl::Vector<TrackerDigiGeometryRecord, IdealMagneticFieldRecord, SiPhase2OuterTrackerLorentzAngleRcd> > { + edm::mpl::Vector<TrackerDigiGeometryRecord, TrackerTopologyRcd, IdealMagneticFieldRecord, SiPhase2OuterTrackerLorentzAngleRcd> > { }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 754f517aa57be..72eb5c688aef6 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -33,7 +33,7 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { bool checkClustersCompatibility(Local3DPoint& posinner, Local3DPoint& posouter, LocalError& errinner, - LocalError& errouter); + LocalError& errouter) const; class LocalPositionSort { public: @@ -58,7 +58,7 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, - Phase2TrackerCluster1DRef upper) override; + Phase2TrackerCluster1DRef upper) const override; // Full I/O in DetSet //void buildDetUnit( const edm::DetSetVector<Phase2TrackerCluster1D> & input, @@ -71,7 +71,7 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2); + double& chi2) const; void fit2Dzy(const Local3DPoint lpCI, const Local3DPoint lpCO, const LocalError leCI, @@ -79,7 +79,7 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2); + double& chi2) const; void fit(const std::vector<float>& x, const std::vector<float>& y, @@ -87,7 +87,7 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2); + double& chi2) const; // void build( const edm::DetSet<Phase2TrackerCluster1D> & input, // output_t::FastFiller& output); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 71d480b750b90..faf6769ecc578 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -52,7 +52,7 @@ class VectorHitBuilderAlgorithmBase { virtual VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, - Phase2TrackerCluster1DRef upper) = 0; + Phase2TrackerCluster1DRef upper) const = 0; double computeParallaxCorrection(const PixelGeomDetUnit*&, const Point3DBase<float, LocalTag>&, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 154c88423ad64..7da1c8d474961 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -7,40 +7,41 @@ #include "FWCore/Framework/interface/ESProducer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include <memory> class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { public: SiPhase2RecHitMatcherESProducer(const edm::ParameterSet&); static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - std::shared_ptr<VectorHitBuilderEDProducer> produce(const TkPhase2OTCPERecord&); + std::shared_ptr<VectorHitBuilderAlgorithm> produce(const TkPhase2OTCPERecord&); private: std::string name_; - std::shared_ptr<VectorHitBuilderEDProducer> matcher_; + std::shared_ptr<VectorHitBuilderAlgorithm> matcher_; edm::ParameterSet pset_; + edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geometryToken_; + edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopoToken_; }; SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet& p) { name_ = p.getParameter<std::string>("ComponentName"); pset_ = p; - setWhatProduced(this, name_); + auto cc = setWhatProduced(this, name_); + geometryToken_ = cc.consumesFrom<TrackerGeometry,TrackerDigiGeometryRecord>(); + trackerTopoToken_ = cc.consumesFrom<TrackerTopology,TrackerTopologyRcd>(); } -std::shared_ptr<VectorHitBuilderEDProducer> SiPhase2RecHitMatcherESProducer::produce( +std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce( const TkPhase2OTCPERecord& iRecord) { if (name_ == "SiPhase2VectorHitMatcher") { - matcher_ = std::make_shared<VectorHitBuilderEDProducer>(pset_); + matcher_ = std::make_shared<VectorHitBuilderAlgorithm>(pset_); - edm::ESHandle<TrackerGeometry> tGeomHandle; - edm::ESHandle<TrackerTopology> tTopoHandle; - - iRecord.getRecord<TrackerDigiGeometryRecord>().get(tGeomHandle); - iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle); - - matcher_->algo()->initTkGeom(tGeomHandle); - matcher_->algo()->initTkTopo(tTopoHandle); + edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); + edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getHandle(trackerTopoToken_); + + matcher_->initTkGeom(tGeomHandle); + matcher_->initTkTopo(tTopoHandle); } return matcher_; } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 6787bd87f16ee..a84a73019fd64 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -121,7 +121,7 @@ bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding( bool VectorHitBuilderAlgorithm::checkClustersCompatibility(Local3DPoint& poslower, Local3DPoint& posupper, LocalError& errlower, - LocalError& errupper) { + LocalError& errupper) const{ return true; } @@ -247,9 +247,9 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi return result; } -VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, + VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, - Phase2TrackerCluster1DRef upper) { + Phase2TrackerCluster1DRef upper) const { LogTrace("VectorHitBuilderAlgorithm") << "Build VH with: "; //printCluster(stack->lowerDet(),&*lower); //printCluster(stack->upperDet(),&*upper); @@ -330,7 +330,7 @@ void VectorHitBuilderAlgorithm::fit2Dzx(const Local3DPoint lpCI, Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) { + double& chi2) const{ std::vector<float> x = {lpCI.z(), lpCO.z()}; std::vector<float> y = {lpCI.x(), lpCO.x()}; float sqCI = sqrt(leCI.xx()); @@ -349,7 +349,7 @@ void VectorHitBuilderAlgorithm::fit2Dzy(const Local3DPoint lpCI, Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) { + double& chi2) const{ std::vector<float> x = {lpCI.z(), lpCO.z()}; std::vector<float> y = {lpCI.y(), lpCO.y()}; float sqCI = sqrt(leCI.yy()); @@ -367,7 +367,7 @@ void VectorHitBuilderAlgorithm::fit(const std::vector<float>& x, Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) { + double& chi2) const{ if (x.size() != y.size() || x.size() != sigy.size()) { edm::LogError("VectorHitBuilderAlgorithm") << "Different size for x,z !! No fit possible."; return; @@ -400,3 +400,5 @@ void VectorHitBuilderAlgorithm::fit(const std::vector<float>& x, dir = LocalVector(slope, 0., -1.); } } +#include "FWCore/Utilities/interface/typelookup.h" +TYPELOOKUP_DATA_REG(VectorHitBuilderAlgorithm); diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc index 51e57e85f7075..36cca63a0fdce 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc @@ -10,7 +10,7 @@ #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" #include "RecoTracker/Record/interface/CkfComponentsRecord.h" @@ -56,7 +56,7 @@ class dso_hidden MeasurementTrackerESProducer : public edm::ESProducer { edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomToken_; edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> geometricSearchTrackerToken_; edm::ESGetToken<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord> phase2TrackerCPEToken_; - edm::ESGetToken<VectorHitBuilderEDProducer, TkPhase2OTCPERecord> phase2matcherToken_; + edm::ESGetToken<VectorHitBuilderAlgorithm, TkPhase2OTCPERecord> phase2matcherToken_; MeasurementTrackerImpl::BadStripCutsDet badStripCuts_; @@ -185,7 +185,7 @@ std::unique_ptr<MeasurementTracker> MeasurementTrackerESProducer::produce(const } const ClusterParameterEstimator<Phase2TrackerCluster1D> *ptr_phase2TrackerCPE = nullptr; - const VectorHitBuilderEDProducer *ptr_phase2Matcher = nullptr; + const VectorHitBuilderAlgorithm *ptr_phase2Matcher = nullptr; if (usePhase2_) { ptr_phase2TrackerCPE = &iRecord.get(phase2TrackerCPEToken_); ptr_phase2Matcher = &iRecord.get(phase2matcherToken_); diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index d4426e2242f7c..337082baf5e7d 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -25,6 +25,7 @@ #include "RecoLocalTracker/Records/interface/TrackerCPERecord.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPE.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" @@ -77,7 +78,7 @@ MeasurementTrackerImpl::MeasurementTrackerImpl(const BadStripCutsDet& badStripCu const PixelClusterParameterEstimator* pixelCPE, const StripClusterParameterEstimator* stripCPE, const SiStripRecHitMatcher* hitMatcher, - const VectorHitBuilderEDProducer* ph2hitMatcher, + const VectorHitBuilderAlgorithm* ph2hitMatcher, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeom, const GeometricSearchTracker* geometricSearchTracker, diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h index 858dc57fb319d..69c6a0e97d5ba 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h @@ -9,6 +9,7 @@ #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -56,7 +57,7 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker { const PixelClusterParameterEstimator* pixelCPE, const StripClusterParameterEstimator* stripCPE, const SiStripRecHitMatcher* hitMatcher, - const VectorHitBuilderEDProducer* ph2hitMatcher, + const VectorHitBuilderAlgorithm* ph2hitMatcher, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeom, const GeometricSearchTracker* geometricSearchTracker, diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index eca45f74b3fc0..ed13d52d1e0de 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -1,12 +1,12 @@ #include "TkStackMeasurementDet.h" #include "TrackingTools/MeasurementDet/interface/MeasurementDetException.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" using namespace std; TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet, - const VectorHitBuilderEDProducer* matcher, + const VectorHitBuilderAlgorithm* matcher, const PixelClusterParameterEstimator* cpe) : MeasurementDet(gdet), theMatcher(matcher), thePixelCPE(cpe), theLowerDet(nullptr), theUpperDet(nullptr) {} @@ -39,7 +39,7 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj begin = &(data.phase2OTData().handle()->data().front()); } - VectorHitBuilderAlgorithmBase* algo = theMatcher->algo(); + //VectorHitBuilderAlgorithm* algo = theMatcher; //VectorHitBuilderAlgorithm* vhalgo = dynamic_cast<VectorHitBuilderAlgorithm *>(algobase); LogTrace("MeasurementTracker") << "TkStackMeasurementDet::recHits algo has been set" << std::endl; @@ -72,7 +72,7 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo(data.phase2OTData().handle(), cil); Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo(data.phase2OTData().handle(), ciu); //ERICA:I would have prefer to keep buildVectorHits ... - VectorHit vh = algo->buildVectorHit(&specificGeomDet(), clusterLower, clusterUpper); + VectorHit vh = theMatcher->buildVectorHit(&specificGeomDet(), clusterLower, clusterUpper); LogTrace("MeasurementTracker") << "TkStackMeasurementDet::rechits adding VectorHits!" << std::endl; LogTrace("MeasurementTracker") << vh << std::endl; result.push_back(std::make_shared<VectorHit>(vh)); diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index df1e1af4c48b1..a5bbfde36414f 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -5,7 +5,7 @@ #include "TkPhase2OTMeasurementDet.h" #include "Geometry/CommonDetUnit/interface/StackGeomDet.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "FWCore/Utilities/interface/Visibility.h" @@ -15,7 +15,7 @@ class TkStackMeasurementDet final : public MeasurementDet { public: TkStackMeasurementDet(const StackGeomDet* gdet, - const VectorHitBuilderEDProducer* matcher, + const VectorHitBuilderAlgorithm* matcher, const PixelClusterParameterEstimator* cpe); void init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet); @@ -49,7 +49,7 @@ class TkStackMeasurementDet final : public MeasurementDet { } private: - const VectorHitBuilderEDProducer* theMatcher; + const VectorHitBuilderAlgorithm* theMatcher; const PixelClusterParameterEstimator* thePixelCPE; const TkPhase2OTMeasurementDet* theLowerDet; const TkPhase2OTMeasurementDet* theUpperDet; diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc index ca70930c5e707..dbc45685cb95e 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc @@ -43,5 +43,5 @@ void Phase2OTMeasurementConditionSet::init(int size) { activeThisPeriod_.resize(size, true); id_.resize(size); if (size > 0) - matcher()->algo()->initCpe(cpe()); + matcher()->initCpe(cpe()); } diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h index 58189318ec154..cfbfefbe3e471 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h @@ -20,7 +20,7 @@ class Phase2StripCPE; #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h" #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include <unordered_map> @@ -406,7 +406,7 @@ class PxMeasurementDetSet { //FIXME:just temporary solution for phase2 OT that works! class Phase2OTMeasurementConditionSet { public: - Phase2OTMeasurementConditionSet(const VectorHitBuilderEDProducer* ph2matcher, + Phase2OTMeasurementConditionSet(const VectorHitBuilderAlgorithm* ph2matcher, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe) : thePhase2Matcher(ph2matcher), theCPE(cpe) {} @@ -417,7 +417,7 @@ class Phase2OTMeasurementConditionSet { int find(unsigned int jd, int i = 0) const { return std::lower_bound(id_.begin() + i, id_.end(), jd) - id_.begin(); } const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe() const { return theCPE; } - const VectorHitBuilderEDProducer* matcher() const { return thePhase2Matcher; } + const VectorHitBuilderAlgorithm* matcher() const { return thePhase2Matcher; } bool isActiveThisPeriod(int i) const { return activeThisPeriod_[i]; } /** \brief Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). @@ -428,7 +428,7 @@ class Phase2OTMeasurementConditionSet { friend class MeasurementTrackerImpl; // Globals (not-per-event) - const VectorHitBuilderEDProducer* thePhase2Matcher; + const VectorHitBuilderAlgorithm* thePhase2Matcher; const ClusterParameterEstimator<Phase2TrackerCluster1D>* theCPE; // Locals, per-event From 9e38c4c02eaed9318a2f5385c8c33c45821bac43 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 28 Aug 2020 14:17:53 -0500 Subject: [PATCH 360/778] refactor code to not use EDProducer as product of ESProducer - part II --- RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml | 1 + .../plugins/SiPhase2RecHitMatcherESProducer.cc | 8 +++++++- RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc | 2 -- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml index dde4e31241cc2..b6e203a920b44 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml @@ -11,6 +11,7 @@ <use name="RecoLocalTracker/Phase2TrackerRecHits"/> <use name="RecoLocalTracker/ClusterParameterEstimator"/> <use name="RecoLocalTracker/Records"/> +<use name="RecoTracker/Record"/> <export> <lib name="1"/> </export> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 7da1c8d474961..9cb0d7c599f74 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -4,6 +4,7 @@ #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESProducer.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" +#include "RecoTracker/Record/interface/CkfComponentsRecord.h" #include "FWCore/Framework/interface/ESProducer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -22,6 +23,7 @@ class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { edm::ParameterSet pset_; edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geometryToken_; edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopoToken_; + edm::ESGetToken<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord> cpeToken_; }; SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet& p) { @@ -30,6 +32,7 @@ SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::Para auto cc = setWhatProduced(this, name_); geometryToken_ = cc.consumesFrom<TrackerGeometry,TrackerDigiGeometryRecord>(); trackerTopoToken_ = cc.consumesFrom<TrackerTopology,TrackerTopologyRcd>(); + cpeToken_ = cc.consumesFrom<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord>(); } std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce( @@ -39,9 +42,12 @@ std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::prod edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getHandle(trackerTopoToken_); - + + edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpeHandle= iRecord.getHandle(cpeToken_); + matcher_->initTkGeom(tGeomHandle); matcher_->initTkTopo(tTopoHandle); + matcher_->initCpe(cpeHandle.product()); } return matcher_; } diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc index dbc45685cb95e..f1dab6b903eff 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.cc @@ -42,6 +42,4 @@ void PxMeasurementConditionSet::init(int size) { void Phase2OTMeasurementConditionSet::init(int size) { activeThisPeriod_.resize(size, true); id_.resize(size); - if (size > 0) - matcher()->initCpe(cpe()); } From 4391753b32a22df971ead7456a3cd76a7c8020a7 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Sat, 29 Aug 2020 08:49:07 -0500 Subject: [PATCH 361/778] refactor code to not use EDProducer as product of ESProducer - part III --- .../plugins/SiPhase2RecHitMatcherESProducer.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 9cb0d7c599f74..8a5bb5afecfbd 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -32,7 +32,8 @@ SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::Para auto cc = setWhatProduced(this, name_); geometryToken_ = cc.consumesFrom<TrackerGeometry,TrackerDigiGeometryRecord>(); trackerTopoToken_ = cc.consumesFrom<TrackerTopology,TrackerTopologyRcd>(); - cpeToken_ = cc.consumesFrom<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord>(); + auto const P2otname = p.getParameter<edm::ESInputTag>("CPE"); + cpeToken_ = cc.consumesFrom<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord>(P2otname); } std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce( @@ -42,12 +43,12 @@ std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::prod edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getHandle(trackerTopoToken_); - - edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpeHandle= iRecord.getHandle(cpeToken_); + + auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); matcher_->initTkGeom(tGeomHandle); matcher_->initTkTopo(tTopoHandle); - matcher_->initCpe(cpeHandle.product()); + matcher_->initCpe(ptr_phase2TrackerCPE); } return matcher_; } @@ -58,7 +59,7 @@ void SiPhase2RecHitMatcherESProducer::fillDescriptions(edm::ConfigurationDescrip desc.add<int>("maxVectorHits", 999999999); desc.add<std::string>("Algorithm", "VectorHitBuilderAlgorithm"); desc.add<std::string>("ComponentName", "SiPhase2VectorHitMatcher"); - desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); + desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("", "Phase2StripCPE")); desc.add<std::vector<double>>("BarrelCut", { 0.0, From 7b018f727723edd486eab1e501014eef989acf6c Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Sat, 29 Aug 2020 15:01:43 -0500 Subject: [PATCH 362/778] slight cleanup of diff --- DataFormats/TrackerRecHit2D/BuildFile.xml | 20 +++++++------- .../SiPhase2VectorHitBuilder/BuildFile.xml | 27 +++++++++---------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/BuildFile.xml b/DataFormats/TrackerRecHit2D/BuildFile.xml index 085dd084880ff..f767813f2bbfc 100644 --- a/DataFormats/TrackerRecHit2D/BuildFile.xml +++ b/DataFormats/TrackerRecHit2D/BuildFile.xml @@ -1,13 +1,13 @@ -<use name="DataFormats/Common"/> -<use name="DataFormats/CLHEP"/> -<use name="DataFormats/FTLRecHit"/> -<use name="DataFormats/TrackingRecHit"/> -<use name="DataFormats/TrajectorySeed"/> -<use name="DataFormats/Phase2TrackerCluster"/> -<use name="FWCore/MessageLogger"/> -<use name="FWCore/Framework"/> -<use name="Geometry/CommonDetUnit"/> -<use name="Geometry/TrackerGeometryBuilder"/> +<use name="DataFormats/Common"/> +<use name="DataFormats/CLHEP"/> +<use name="DataFormats/FTLRecHit"/> +<use name="DataFormats/TrackingRecHit"/> +<use name="DataFormats/TrajectorySeed"/> +<use name="DataFormats/Phase2TrackerCluster"/> +<use name="FWCore/MessageLogger"/> +<use name="FWCore/Framework"/> +<use name="Geometry/CommonDetUnit"/> +<use name="Geometry/TrackerGeometryBuilder"/> <export> <lib name="1"/> </export> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml index b6e203a920b44..c5630c284bb8a 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml @@ -1,17 +1,16 @@ -<use name="CommonTools/Statistics"/> -<use name="DataFormats/Common"/> -<use name="FWCore/ParameterSet"/> -<use name="FWCore/Framework"/> -<use name="FWCore/Utilities"/> -<use name="DataFormats/SiPixelDetId"/> -<use name="DataFormats/SiPixelCluster"/> -<use name="DataFormats/TrackerRecHit2D"/> -<use name="Geometry/CommonDetUnit"/> -<use name="Geometry/TrackerGeometryBuilder"/> -<use name="RecoLocalTracker/Phase2TrackerRecHits"/> -<use name="RecoLocalTracker/ClusterParameterEstimator"/> -<use name="RecoLocalTracker/Records"/> -<use name="RecoTracker/Record"/> +<use name="CommonTools/Statistics"/> +<use name="DataFormats/Common"/> +<use name="FWCore/ParameterSet"/> +<use name="FWCore/Framework"/> +<use name="FWCore/Utilities"/> +<use name="DataFormats/SiPixelDetId"/> +<use name="DataFormats/SiPixelCluster"/> +<use name="DataFormats/TrackerRecHit2D"/> +<use name="Geometry/CommonDetUnit"/> +<use name="Geometry/TrackerGeometryBuilder"/> +<use name="RecoLocalTracker/Phase2TrackerRecHits"/> +<use name="RecoLocalTracker/ClusterParameterEstimator"/> +<use name="RecoLocalTracker/Records"/> <export> <lib name="1"/> </export> From cb8050bf6a3851e37a440a07f68718bb2cc83dfb Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 1 Sep 2020 17:40:58 +0200 Subject: [PATCH 363/778] apply code checks --- .../TrackerRecHit2D/interface/VectorHit.h | 8 ++++---- .../Records/interface/TkPhase2OTCPERecord.h | 9 +++++---- .../SiPhase2RecHitMatcherESProducer.cc | 11 +++++----- .../src/VectorHitBuilderAlgorithm.cc | 20 +++++++++---------- RecoTracker/CkfPattern/src/PrintoutHelper.cc | 2 +- .../src/SeedingOTEDProducer.cc | 16 +++++++-------- .../TkSeedingLayers/src/HitExtractorSTRP.cc | 4 ++-- .../src/TkClonerImpl.cc | 2 +- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index b25c8ace397a4..20427b4778759 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -60,7 +60,7 @@ class VectorHit : public BaseTrackerRecHit { // Parameters of the segment, for the track fit // For a 4D segment: (dx/dz,dy/dz,x,y) - bool hasPositionAndError() const { + bool hasPositionAndError() const override { //bool hasPositionAndError() const { return true; // return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) || @@ -72,10 +72,10 @@ class VectorHit : public BaseTrackerRecHit { void getKfComponents4D(KfComponentsHolder& holder) const; // returning methods - LocalPoint localPosition() const { return thePosition; } + LocalPoint localPosition() const override { return thePosition; } virtual LocalVector localDirection() const { return theDirection; } AlgebraicSymMatrix parametersError() const override; - LocalError localPositionError() const; + LocalError localPositionError() const override; virtual LocalError localDirectionError() const; Global3DVector globalDirection() const; @@ -102,7 +102,7 @@ class VectorHit : public BaseTrackerRecHit { bool isPhase2() const override { return true; } //FIXME: I have always two clusters in a VH - OmniClusterRef const& firstClusterRef() const { return theLowerCluster; } + OmniClusterRef const& firstClusterRef() const override { return theLowerCluster; } ClusterRef cluster() const { return theLowerCluster.cluster_phase2OT(); } //This method returns the delta in global coordinates diff --git a/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h b/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h index bb6a9ec9a4634..9423e0188ff5d 100644 --- a/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h +++ b/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h @@ -10,9 +10,10 @@ #include "FWCore/Utilities/interface/mplVector.h" class TkPhase2OTCPERecord - : public edm::eventsetup::DependentRecordImplementation< - TkPhase2OTCPERecord, - edm::mpl::Vector<TrackerDigiGeometryRecord, TrackerTopologyRcd, IdealMagneticFieldRecord, SiPhase2OuterTrackerLorentzAngleRcd> > { -}; + : public edm::eventsetup::DependentRecordImplementation<TkPhase2OTCPERecord, + edm::mpl::Vector<TrackerDigiGeometryRecord, + TrackerTopologyRcd, + IdealMagneticFieldRecord, + SiPhase2OuterTrackerLorentzAngleRcd> > {}; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 8a5bb5afecfbd..dce044097bc78 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -30,22 +30,21 @@ SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::Para name_ = p.getParameter<std::string>("ComponentName"); pset_ = p; auto cc = setWhatProduced(this, name_); - geometryToken_ = cc.consumesFrom<TrackerGeometry,TrackerDigiGeometryRecord>(); - trackerTopoToken_ = cc.consumesFrom<TrackerTopology,TrackerTopologyRcd>(); + geometryToken_ = cc.consumesFrom<TrackerGeometry, TrackerDigiGeometryRecord>(); + trackerTopoToken_ = cc.consumesFrom<TrackerTopology, TrackerTopologyRcd>(); auto const P2otname = p.getParameter<edm::ESInputTag>("CPE"); cpeToken_ = cc.consumesFrom<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord>(P2otname); } -std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce( - const TkPhase2OTCPERecord& iRecord) { +std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce(const TkPhase2OTCPERecord& iRecord) { if (name_ == "SiPhase2VectorHitMatcher") { matcher_ = std::make_shared<VectorHitBuilderAlgorithm>(pset_); edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getHandle(trackerTopoToken_); - auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); - + auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); + matcher_->initTkGeom(tGeomHandle); matcher_->initTkTopo(tTopoHandle); matcher_->initCpe(ptr_phase2TrackerCPE); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index a84a73019fd64..fe3ccb1e35536 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -63,7 +63,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track const auto vhsInStack_AccRej = buildVectorHits(stackDet, clusters, *it_detLower, *it_detUpper); //storing accepted and rejected VHs - for (auto vh : vhsInStack_AccRej) { + for (const auto& vh : vhsInStack_AccRej) { if (vh.second == true) { vhsInStack_Acc.push_back(vh.first); } else if (vh.second == false) { @@ -80,12 +80,12 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track LogTrace("VectorHitBuilderAlgorithm") << "For detId #" << detIdStack.rawId() << " the following VHits have been accepted:"; - for (auto vhIt : vhsInStack_Acc) { + for (const auto& vhIt : vhsInStack_Acc) { LogTrace("VectorHitBuilderAlgorithm") << "accepted VH: " << vhIt; } LogTrace("VectorHitBuilderAlgorithm") << "For detId #" << detIdStack.rawId() << " the following VHits have been rejected:"; - for (auto vhIt : vhsInStack_Rej) { + for (const auto& vhIt : vhsInStack_Rej) { LogTrace("VectorHitBuilderAlgorithm") << "rejected VH: " << vhIt; } } @@ -121,7 +121,7 @@ bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding( bool VectorHitBuilderAlgorithm::checkClustersCompatibility(Local3DPoint& poslower, Local3DPoint& posupper, LocalError& errlower, - LocalError& errupper) const{ + LocalError& errupper) const { return true; } @@ -154,12 +154,12 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi std::sort(lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->lowerDet())); std::sort(upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->upperDet())); - for (auto cluL : lowerClusters) { + for (const auto& cluL : lowerClusters) { LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; printCluster(stack->lowerDet(), &*cluL); const PixelGeomDetUnit* gduLow = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); auto&& lparamsLow = cpe->localParameters(*cluL, *gduLow); - for (auto cluU : upperClusters) { + for (const auto& cluU : upperClusters) { LogDebug("VectorHitBuilderAlgorithm") << "\t upper clusters " << std::endl; printCluster(stack->upperDet(), &*cluU); const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); @@ -247,7 +247,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi return result; } - VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, +VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper) const { LogTrace("VectorHitBuilderAlgorithm") << "Build VH with: "; @@ -330,7 +330,7 @@ void VectorHitBuilderAlgorithm::fit2Dzx(const Local3DPoint lpCI, Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) const{ + double& chi2) const { std::vector<float> x = {lpCI.z(), lpCO.z()}; std::vector<float> y = {lpCI.x(), lpCO.x()}; float sqCI = sqrt(leCI.xx()); @@ -349,7 +349,7 @@ void VectorHitBuilderAlgorithm::fit2Dzy(const Local3DPoint lpCI, Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) const{ + double& chi2) const { std::vector<float> x = {lpCI.z(), lpCO.z()}; std::vector<float> y = {lpCI.y(), lpCO.y()}; float sqCI = sqrt(leCI.yy()); @@ -367,7 +367,7 @@ void VectorHitBuilderAlgorithm::fit(const std::vector<float>& x, Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, - double& chi2) const{ + double& chi2) const { if (x.size() != y.size() || x.size() != sigy.size()) { edm::LogError("VectorHitBuilderAlgorithm") << "Different size for x,z !! No fit possible."; return; diff --git a/RecoTracker/CkfPattern/src/PrintoutHelper.cc b/RecoTracker/CkfPattern/src/PrintoutHelper.cc index 3fa643655cb1d..96a598b1354b2 100644 --- a/RecoTracker/CkfPattern/src/PrintoutHelper.cc +++ b/RecoTracker/CkfPattern/src/PrintoutHelper.cc @@ -104,7 +104,7 @@ std::string PrintoutHelper::regressionTest(const TrackerGeometry& tracker, std:: buffer << "================================================="; buffer << "=========== Traj in details =====================\n"; for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) { - for (auto hit : it->measurements()) { + for (const auto& hit : it->measurements()) { buffer << "measurement : " << hit.recHit()->geographicalId().rawId() << std::endl; } buffer << "================\n"; diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 5c1f381df6122..75696f84e7487 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -138,7 +138,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio //not sure if building it everytime takes time/memory const DetLayer* barrelOTLayer1 = measurementTracker->geometricSearchTracker()->tobLayers().at(0); - for (auto mL2 : measurementsL2) { + for (const auto& mL2 : measurementsL2) { const TrackingRecHit* hitL2 = mL2.recHit().get(); //propagate to the L2 and update the TSOS @@ -155,7 +155,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio measurementsL1.erase(measurementsL1end, measurementsL1.end()); if (!measurementsL1.empty()) { - for (auto mL1 : measurementsL1) { + for (const auto& mL1 : measurementsL1) { const TrackingRecHit* hitL1 = mL1.recHit().get(); //propagate to the L1 and update the TSOS @@ -179,8 +179,8 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio updatedTSOSL1.second.rescaleError(100); TrajectoryStateOnSurface updatedTSOSL1_final = theUpdator->update(updatedTSOSL1.second, *hitL1); - if - UNLIKELY(!updatedTSOSL1_final.isValid()) continue; + if UNLIKELY (!updatedTSOSL1_final.isValid()) + continue; std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = @@ -213,7 +213,7 @@ std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<Vector if (!input.empty()) { for (auto DSViter : input) { if (checkLayer(DSViter.id()) == layerNumber) { - for (auto vh : DSViter) { + for (const auto& vh : DSViter) { VHsOnLayer.push_back(vh); } } @@ -227,7 +227,7 @@ void SeedingOTEDProducer::printVHsOnLayer(edm::Handle<VectorHitCollectionNew> VH const VectorHitCollectionNew& input = *VHs; if (!input.empty()) { for (auto DSViter : input) { - for (auto vh : DSViter) { + for (const auto& vh : DSViter) { if (checkLayer(DSViter.id()) == layerNumber) std::cout << " VH in layer " << layerNumber << " >> " << vh << std::endl; } @@ -285,8 +285,8 @@ std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdat const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) { TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); TrajectoryStateOnSurface updatedTSOS = theUpdator->update(propTSOS, hit); - if - UNLIKELY(!updatedTSOS.isValid()) return std::make_pair(false, updatedTSOS); + if UNLIKELY (!updatedTSOS.isValid()) + return std::make_pair(false, updatedTSOS); return std::make_pair(true, updatedTSOS); } diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc index c1ea40b32ef31..09087a243275a 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc @@ -71,8 +71,8 @@ bool HitExtractorSTRP::skipThis( if (maskCluster && (stripClusterMask->mask(clus.key()))) return true; - if - UNLIKELY(minGoodCharge <= 0) return false; + if UNLIKELY (minGoodCharge <= 0) + return false; return siStripClusterTools::chargePerCM(id, *clus.cluster_strip()) <= minGoodCharge; } diff --git a/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc b/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc index b35f6a2c4b9d2..8c396591f7a96 100644 --- a/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc +++ b/RecoTracker/TransientTrackingRecHit/src/TkClonerImpl.cc @@ -58,7 +58,7 @@ std::unique_ptr<Phase2TrackerRecHit1D> TkClonerImpl::operator()(Phase2TrackerRec } std::unique_ptr<VectorHit> TkClonerImpl::operator()(VectorHit const& hit, TrajectoryStateOnSurface const& tsos) const { - return std::unique_ptr<VectorHit>{new VectorHit(hit)}; + return std::make_unique<VectorHit>(hit); } TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared(SiPixelRecHit const& hit, From 4e69b00a618dfc9f235b99c81c0c1ceb41ab5c36 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 2 Sep 2020 14:23:59 -0500 Subject: [PATCH 364/778] remove unnecessary dependencies in build files --- DataFormats/TrackerRecHit2D/BuildFile.xml | 1 - RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/BuildFile.xml b/DataFormats/TrackerRecHit2D/BuildFile.xml index f767813f2bbfc..17ee9fb29a2e0 100644 --- a/DataFormats/TrackerRecHit2D/BuildFile.xml +++ b/DataFormats/TrackerRecHit2D/BuildFile.xml @@ -7,7 +7,6 @@ <use name="FWCore/MessageLogger"/> <use name="FWCore/Framework"/> <use name="Geometry/CommonDetUnit"/> -<use name="Geometry/TrackerGeometryBuilder"/> <export> <lib name="1"/> </export> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml index bd4c0a3c2dc1f..3270d03161a4b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml @@ -17,7 +17,6 @@ <use name="DQMServices/Core"/> <use name="DataFormats/Common"/> <use name="FWCore/PluginManager"/> -<use name="SimTracker/SiPhase2Digitizer"/> <use name="DataFormats/TrackerRecHit2D"/> <use name="DataFormats/Phase2TrackerCluster"/> <use name="DataFormats/ParticleFlowCandidate"/> From 728f0d0bf1cf6479447e51e0ce67f57008c6925f Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 2 Sep 2020 16:30:46 -0500 Subject: [PATCH 365/778] add VectorHitMomentumHelper to avoid include of MagenticField.h in DataFormats --- .../TrackerRecHit2D/interface/VectorHit.h | 3 --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 10 -------- .../interface/VectorHitMomentumHelper.h | 25 +++++++++++++++++++ .../test/VectorHitsValidation.cc | 6 +++-- .../interface/SeedingOTEDProducer.h | 4 +-- .../src/SeedingOTEDProducer.cc | 16 ++++++++---- 6 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 20427b4778759..3f9d0277befa9 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -20,7 +20,6 @@ #include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" #include "DataFormats/GeometryVector/interface/LocalVector.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" -#include "MagneticField/Engine/interface/MagneticField.h" #include "DataFormats/TrackingRecHit/interface/KfComponentsHolder.h" @@ -83,8 +82,6 @@ class VectorHit : public BaseTrackerRecHit { int dimension() const override { return theDimension; } std::pair<double, double> curvatureORphi(std::string curvORphi = "curvature") const; - float transverseMomentum(const MagneticField* magField); - float momentum(const MagneticField* magField); ClusterRef lowerCluster() const { return theLowerCluster.cluster_phase2OT(); } ClusterRef upperCluster() const { return theUpperCluster.cluster_phase2OT(); } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 05ba87ecba7ec..9cd3fe81a3ea1 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -347,16 +347,6 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const return std::make_pair(0.0, 0.0); } -float VectorHit::transverseMomentum(const MagneticField* magField) { - GlobalPoint center(0.0, 0.0, 0.0); - float magnT = magField->inTesla(center).mag(); - double rho = 1. / curvatureORphi("curvature").first; - //0.003 is because the curvature (rho) is in cm and not in m - return (0.003 * magnT * rho); -} - -float VectorHit::momentum(const MagneticField* magField) { return transverseMomentum(magField) / (1. * sin(theta())); } - float VectorHit::theta() { return globalDirection().theta(); } AlgebraicMatrix VectorHit::projectionMatrix() const { diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h new file mode 100644 index 0000000000000..d524c3ad19099 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h @@ -0,0 +1,25 @@ +#ifndef VectorHitMomentumHelper_H +#define VectorHitMomentumHelper_H + +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "MagneticField/Engine/interface/MagneticField.h" + +class VectorHitMomentumHelper { +public: + VectorHitMomentumHelper(); + ~VectorHitMomentumHelper() { + } + + float transverseMomentum(VectorHit& vh,const MagneticField* magField){ + GlobalPoint center(0.0, 0.0, 0.0); + float magnT = magField->inTesla(center).mag(); + double rho = 1. / vh.curvatureORphi("curvature").first; + //0.003 is because the curvature (rho) is in cm and not in m + return (0.003 * magnT * rho); + } + float momentum(VectorHit& vh, const MagneticField* magField) { return transverseMomentum(vh , magField) / (1. * sin(vh.theta())); } + +private: +}; + +#endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index a75172161e98d..2d8911258ff7d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -7,6 +7,7 @@ #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet& conf) : cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { @@ -623,10 +624,11 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } //curvature + VectorHitMomentumHelper* vhMomHelper; curvature = vh.curvatureORphi("curvature").first; phi = vh.curvatureORphi("phi").first; - QOverPT = vh.transverseMomentum(magField); - QOverP = vh.momentum(magField); + QOverPT = vhMomHelper->transverseMomentum(vh,magField); + QOverP = vhMomHelper->momentum(vh,magField); histogramLayer->second.curvature->Fill(curvature); //stub width diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h index 92857dd689d7a..b790c7415eb9d 100644 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -43,8 +43,8 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot); float computeInverseMomentumError(VectorHit& vh, const float globalTheta, - const MagneticField* magField, - const double sigmaZ_beamSpot); + const double sigmaZ_beamSpot, + const double transverseMomentum); TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 75696f84e7487..95ca85becbdcc 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -16,6 +16,8 @@ #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" + SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) : theUpdator(nullptr), tkMeasEventToken(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))) { @@ -244,9 +246,13 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& // gv transform to local (lv) const Local3DVector lv(vHit.det()->surface().toLocal(gv)); + //Helper class to access momentum of VH + VectorHitMomentumHelper* vhMomHelper; + + //FIXME::charge is fine 1 every two times!! int charge = 1; - float p = vHit.momentum(magField); + float p = vhMomHelper->momentum(vHit,magField); float x = vHit.localPosition().x(); float y = vHit.localPosition().y(); float dx = vHit.localDirection().x(); @@ -259,7 +265,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p - mat[0][0] = pow(computeInverseMomentumError(vHit, theta, magField, beamSpot->sigmaZ()), 2); + mat[0][0] = pow(computeInverseMomentumError(vHit, theta, beamSpot->sigmaZ(),vhMomHelper->transverseMomentum(vHit,magField)), 2); //building tsos LocalTrajectoryError lterr(asSMatrix<5>(mat)); @@ -299,11 +305,11 @@ float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const do float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, const float globalTheta, - const MagneticField* magField, - const double sigmaZ_beamSpot) { + const double sigmaZ_beamSpot, + const double transverseMomentum) { //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12) float varianceInverseTransvMomentum = 1. / 12; - double derivativeTheta2 = pow(cos(globalTheta) / vh.transverseMomentum(magField), 2); + double derivativeTheta2 = pow(cos(globalTheta) / transverseMomentum, 2); double derivativeInverseTransvMomentum2 = pow(sin(globalTheta), 2); float thetaError = computeGlobalThetaError(vh, sigmaZ_beamSpot); return pow(derivativeTheta2 * pow(thetaError, 2) + derivativeInverseTransvMomentum2 * varianceInverseTransvMomentum, From 8b43243bc87f7d78ae2481dc051ea1ae15d0dd47 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 2 Sep 2020 16:40:19 -0500 Subject: [PATCH 366/778] apply code formats --- .../interface/VectorHitMomentumHelper.h | 19 ++++++++++--------- .../test/VectorHitsValidation.cc | 4 ++-- .../interface/SeedingOTEDProducer.h | 2 +- .../src/SeedingOTEDProducer.cc | 8 ++++---- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h index d524c3ad19099..eb33c3e090368 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h @@ -7,17 +7,18 @@ class VectorHitMomentumHelper { public: VectorHitMomentumHelper(); - ~VectorHitMomentumHelper() { - } + ~VectorHitMomentumHelper() {} - float transverseMomentum(VectorHit& vh,const MagneticField* magField){ - GlobalPoint center(0.0, 0.0, 0.0); - float magnT = magField->inTesla(center).mag(); - double rho = 1. / vh.curvatureORphi("curvature").first; - //0.003 is because the curvature (rho) is in cm and not in m - return (0.003 * magnT * rho); + float transverseMomentum(VectorHit& vh, const MagneticField* magField) { + GlobalPoint center(0.0, 0.0, 0.0); + float magnT = magField->inTesla(center).mag(); + double rho = 1. / vh.curvatureORphi("curvature").first; + //0.003 is because the curvature (rho) is in cm and not in m + return (0.003 * magnT * rho); + } + float momentum(VectorHit& vh, const MagneticField* magField) { + return transverseMomentum(vh, magField) / (1. * sin(vh.theta())); } - float momentum(VectorHit& vh, const MagneticField* magField) { return transverseMomentum(vh , magField) / (1. * sin(vh.theta())); } private: }; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 2d8911258ff7d..095022ddfd498 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -627,8 +627,8 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev VectorHitMomentumHelper* vhMomHelper; curvature = vh.curvatureORphi("curvature").first; phi = vh.curvatureORphi("phi").first; - QOverPT = vhMomHelper->transverseMomentum(vh,magField); - QOverP = vhMomHelper->momentum(vh,magField); + QOverPT = vhMomHelper->transverseMomentum(vh, magField); + QOverP = vhMomHelper->momentum(vh, magField); histogramLayer->second.curvature->Fill(curvature); //stub width diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h index b790c7415eb9d..1c140a9235c28 100644 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -44,7 +44,7 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { float computeInverseMomentumError(VectorHit& vh, const float globalTheta, const double sigmaZ_beamSpot, - const double transverseMomentum); + const double transverseMomentum); TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 95ca85becbdcc..87f010f69eaaf 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -249,10 +249,9 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& //Helper class to access momentum of VH VectorHitMomentumHelper* vhMomHelper; - //FIXME::charge is fine 1 every two times!! int charge = 1; - float p = vhMomHelper->momentum(vHit,magField); + float p = vhMomHelper->momentum(vHit, magField); float x = vHit.localPosition().x(); float y = vHit.localPosition().y(); float dx = vHit.localDirection().x(); @@ -265,7 +264,8 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p - mat[0][0] = pow(computeInverseMomentumError(vHit, theta, beamSpot->sigmaZ(),vhMomHelper->transverseMomentum(vHit,magField)), 2); + mat[0][0] = pow( + computeInverseMomentumError(vHit, theta, beamSpot->sigmaZ(), vhMomHelper->transverseMomentum(vHit, magField)), 2); //building tsos LocalTrajectoryError lterr(asSMatrix<5>(mat)); @@ -306,7 +306,7 @@ float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const do float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, const float globalTheta, const double sigmaZ_beamSpot, - const double transverseMomentum) { + const double transverseMomentum) { //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12) float varianceInverseTransvMomentum = 1. / 12; double derivativeTheta2 = pow(cos(globalTheta) / transverseMomentum, 2); From 472b65acbeb2bbdb583617b41ecb30d0f85a7ad5 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Thu, 3 Sep 2020 06:49:25 -0500 Subject: [PATCH 367/778] fix missing initializations --- .../interface/VectorHitMomentumHelper.h | 2 +- .../SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc | 2 +- RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h index eb33c3e090368..eaa42ff4da6d1 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h @@ -6,7 +6,7 @@ class VectorHitMomentumHelper { public: - VectorHitMomentumHelper(); + VectorHitMomentumHelper() {} ~VectorHitMomentumHelper() {} float transverseMomentum(VectorHit& vh, const MagneticField* magField) { diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 095022ddfd498..03a8fae76734e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -624,7 +624,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } //curvature - VectorHitMomentumHelper* vhMomHelper; + VectorHitMomentumHelper* vhMomHelper = new VectorHitMomentumHelper; curvature = vh.curvatureORphi("curvature").first; phi = vh.curvatureORphi("phi").first; QOverPT = vhMomHelper->transverseMomentum(vh, magField); diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 87f010f69eaaf..4fa5d68979303 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -247,7 +247,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& const Local3DVector lv(vHit.det()->surface().toLocal(gv)); //Helper class to access momentum of VH - VectorHitMomentumHelper* vhMomHelper; + VectorHitMomentumHelper* vhMomHelper = new VectorHitMomentumHelper; //FIXME::charge is fine 1 every two times!! int charge = 1; From 7725ff0678c73ac1f12ed5b2cbb34a070ee54c97 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Thu, 3 Sep 2020 08:54:54 -0500 Subject: [PATCH 368/778] trying to work around memory leaks --- .../interface/VectorHitMomentumHelper.h | 4 ++-- .../test/VectorHitsValidation.cc | 7 ++++--- .../SiPhase2VectorHitBuilder/test/VectorHitsValidation.h | 3 +++ .../TkSeedGenerator/interface/SeedingOTEDProducer.h | 5 +++++ RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc | 9 ++++----- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h index eaa42ff4da6d1..3959b0df1c04e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h @@ -9,14 +9,14 @@ class VectorHitMomentumHelper { VectorHitMomentumHelper() {} ~VectorHitMomentumHelper() {} - float transverseMomentum(VectorHit& vh, const MagneticField* magField) { + float transverseMomentum(VectorHit& vh, const MagneticField* magField) const { GlobalPoint center(0.0, 0.0, 0.0); float magnT = magField->inTesla(center).mag(); double rho = 1. / vh.curvatureORphi("curvature").first; //0.003 is because the curvature (rho) is in cm and not in m return (0.003 * magnT * rho); } - float momentum(VectorHit& vh, const MagneticField* magField) { + float momentum(VectorHit& vh, const MagneticField* magField) const { return transverseMomentum(vh, magField) / (1. * sin(vh.theta())); } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 03a8fae76734e..df918af05c770 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -7,7 +7,6 @@ #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet& conf) : cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { @@ -21,9 +20,12 @@ VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet simVerticesToken_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits")); trackingParticleToken_ = consumes<TrackingParticleCollection>(conf.getParameter<edm::InputTag>("trackingParticleSrc")); + vhMomHelper = new VectorHitMomentumHelper(); } -VectorHitsBuilderValidation::~VectorHitsBuilderValidation() {} +VectorHitsBuilderValidation::~VectorHitsBuilderValidation() { + delete vhMomHelper; +} void VectorHitsBuilderValidation::beginJob() { edm::Service<TFileService> fs; @@ -624,7 +626,6 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } //curvature - VectorHitMomentumHelper* vhMomHelper = new VectorHitMomentumHelper; curvature = vh.curvatureORphi("curvature").first; phi = vh.curvatureORphi("phi").first; QOverPT = vhMomHelper->transverseMomentum(vh, magField); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index 89f0e93acea6a..99f2c967bee6b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -27,6 +27,7 @@ #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" #include "DataFormats/SiPixelDigi/interface/PixelDigi.h" #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" #include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" #include "SimDataFormats/Track/interface/SimTrackContainer.h" @@ -143,4 +144,6 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { TH1F* VHrejTrueLayer_ratio; std::map<unsigned int, VHHistos> histograms_; + + const VectorHitMomentumHelper* vhMomHelper; }; diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h index 1c140a9235c28..41a99f54178fe 100644 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -16,6 +16,7 @@ #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -71,6 +72,10 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT<reco::BeamSpot> beamSpotToken; const reco::BeamSpot* beamSpot; std::string updatorName; + //Helper class to access momentum of VH + const VectorHitMomentumHelper* vhMomHelper; + + }; #endif diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 4fa5d68979303..8f4bf93132930 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -16,7 +16,6 @@ #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) : theUpdator(nullptr), @@ -24,10 +23,13 @@ SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) vhProducerToken = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); beamSpotToken = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); updatorName = conf.getParameter<std::string>("updator"); + vhMomHelper = new VectorHitMomentumHelper(); produces<TrajectorySeedCollection>(); } -SeedingOTEDProducer::~SeedingOTEDProducer() {} +SeedingOTEDProducer::~SeedingOTEDProducer() { + delete vhMomHelper; +} void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -246,9 +248,6 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& // gv transform to local (lv) const Local3DVector lv(vHit.det()->surface().toLocal(gv)); - //Helper class to access momentum of VH - VectorHitMomentumHelper* vhMomHelper = new VectorHitMomentumHelper; - //FIXME::charge is fine 1 every two times!! int charge = 1; float p = vhMomHelper->momentum(vHit, magField); From ac77617a19b371c75a5dc6e24b2cc34fe0b5f530 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Thu, 3 Sep 2020 09:04:12 -0500 Subject: [PATCH 369/778] apply code format --- .../SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc | 4 +--- .../TkSeedGenerator/interface/SeedingOTEDProducer.h | 2 -- RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc | 7 ++----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index df918af05c770..42a499ef409db 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -23,9 +23,7 @@ VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet vhMomHelper = new VectorHitMomentumHelper(); } -VectorHitsBuilderValidation::~VectorHitsBuilderValidation() { - delete vhMomHelper; -} +VectorHitsBuilderValidation::~VectorHitsBuilderValidation() { delete vhMomHelper; } void VectorHitsBuilderValidation::beginJob() { edm::Service<TFileService> fs; diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h index 41a99f54178fe..f1936acf5ed9a 100644 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -74,8 +74,6 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { std::string updatorName; //Helper class to access momentum of VH const VectorHitMomentumHelper* vhMomHelper; - - }; #endif diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 8f4bf93132930..0523d38b222d5 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -16,20 +16,17 @@ #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" - SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) : theUpdator(nullptr), tkMeasEventToken(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))) { vhProducerToken = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); beamSpotToken = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); updatorName = conf.getParameter<std::string>("updator"); - vhMomHelper = new VectorHitMomentumHelper(); + vhMomHelper = new VectorHitMomentumHelper(); produces<TrajectorySeedCollection>(); } -SeedingOTEDProducer::~SeedingOTEDProducer() { - delete vhMomHelper; -} +SeedingOTEDProducer::~SeedingOTEDProducer() { delete vhMomHelper; } void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; From 5f6110a05c5db5dba32317ceabc5ac5a57224480 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Thu, 3 Sep 2020 14:28:29 -0500 Subject: [PATCH 370/778] register consumes of ES products in SeedingOTEDProducer --- .../interface/SeedingOTEDProducer.h | 18 +++++++++ .../src/SeedingOTEDProducer.cc | 39 +++++++------------ 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h index f1936acf5ed9a..12cd02d30b944 100644 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -18,6 +18,16 @@ #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h" #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" +#include "RecoTracker/Record/interface/CkfComponentsRecord.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h" +#include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h" +#include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h" + +#include "Geometry/Records/interface/TrackerTopologyRcd.h" + +#include "FWCore/Utilities/interface/ESGetToken.h" + #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -74,6 +84,14 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { std::string updatorName; //Helper class to access momentum of VH const VectorHitMomentumHelper* vhMomHelper; + + edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; + edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_; + edm::ESGetToken<TrajectoryStateUpdator, TrackingComponentsRecord> updatorToken_; + edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> measurementTrackerToken_; + edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> estToken_; + }; #endif diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 0523d38b222d5..9e9f15110008f 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -1,13 +1,6 @@ #include "RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h" #include "FWCore/Framework/interface/Event.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" - -#include "RecoTracker/Record/interface/CkfComponentsRecord.h" -#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" -#include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h" -#include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h" -#include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h" #include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" @@ -18,7 +11,13 @@ SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) : theUpdator(nullptr), - tkMeasEventToken(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))) { + tkMeasEventToken(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), + topoToken_(esConsumes()), + propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial" ))), + magFieldToken_(esConsumes()), + updatorToken_(esConsumes()), + measurementTrackerToken_(esConsumes()), + estToken_(esConsumes(edm::ESInputTag("","Chi2"))) { vhProducerToken = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); beamSpotToken = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); updatorName = conf.getParameter<std::string>("updator"); @@ -40,33 +39,25 @@ void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descr void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); - edm::ESHandle<TrackerTopology> tTopoHandle; - es.get<TrackerTopologyRcd>().get(tTopoHandle); - tkTopo = tTopoHandle.product(); + + tkTopo = &es.getData(topoToken_); edm::ESHandle<MeasurementTracker> measurementTrackerHandle; - es.get<CkfComponentsRecord>().get(measurementTrackerHandle); + measurementTrackerHandle = es.getHandle(measurementTrackerToken_); measurementTracker = measurementTrackerHandle.product(); + edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; event.getByToken(tkMeasEventToken, measurementTrackerEvent); layerMeasurements = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); - edm::ESHandle<Chi2MeasurementEstimatorBase> est; - es.get<TrackingComponentsRecord>().get("Chi2", est); - estimator = est.product(); + estimator = &es.getData(estToken_); - edm::ESHandle<Propagator> prop; - es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial", prop); - propagator = prop.product(); + propagator = &es.getData(propagatorToken_); - edm::ESHandle<MagneticField> magFieldHandle; - es.get<IdealMagneticFieldRecord>().get(magFieldHandle); - magField = magFieldHandle.product(); + magField = &es.getData(magFieldToken_); - edm::ESHandle<TrajectoryStateUpdator> updatorHandle; - es.get<TrackingComponentsRecord>().get(updatorName, updatorHandle); - theUpdator = updatorHandle.product(); + theUpdator = &es.getData(updatorToken_); edm::Handle<reco::BeamSpot> beamSpotH; event.getByToken(beamSpotToken, beamSpotH); From b77526666614a8ca0603e488066e3cf2d19cf2da Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Thu, 3 Sep 2020 18:11:30 -0500 Subject: [PATCH 371/778] addressing PR comments part I --- .../TrackerRecHit2D/interface/VectorHit.h | 30 ++- .../TrackerRecHit2D/interface/VectorHit2D.h | 24 ++- .../interface/trackerHitRTTI.h | 4 +- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 36 ++-- DataFormats/TrackerRecHit2D/src/classes.h | 174 ------------------ .../TrackerRecHit2D/src/classes_def.xml | 8 +- .../interface/VectorHitMomentumHelper.h | 22 ++- .../test/VectorHitsValidation.cc | 12 +- .../test/VectorHitsValidation.h | 1 - .../interface/SeedingOTEDProducer.h | 2 - .../src/SeedingOTEDProducer.cc | 15 +- 11 files changed, 80 insertions(+), 248 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 3f9d0277befa9..712cee801d461 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -1,5 +1,5 @@ -#ifndef TrackerRecHit2D_VectorHit_h -#define TrackerRecHit2D_VectorHit_h +#ifndef DataFormats_TrackerRecHit2D_VectorHit_h +#define DataFormats_TrackerRecHit2D_VectorHit_h /** \class VectorHit * @@ -23,9 +23,9 @@ #include "DataFormats/TrackingRecHit/interface/KfComponentsHolder.h" -#include "TkCloner.h" +#include "DataFormats/TrackerRecHit2D/interface/TkCloner.h" -class VectorHit : public BaseTrackerRecHit { +class VectorHit final : public BaseTrackerRecHit { public: typedef OmniClusterRef::Phase2Cluster1DRef ClusterRef; @@ -37,7 +37,7 @@ class VectorHit : public BaseTrackerRecHit { const LocalPoint& posInner, const LocalVector& dir, const AlgebraicSymMatrix& covMatrix, - const double& Chi2, + const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper); @@ -50,9 +50,7 @@ class VectorHit : public BaseTrackerRecHit { ~VectorHit() override; VectorHit* clone() const override { return new VectorHit(*this); } -#ifndef __GCCXML__ RecHitPointer cloneSH() const override { return std::make_shared<VectorHit>(*this); } -#endif bool sharesInput(const TrackingRecHit* other, SharedInputType what) const override; bool sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedInputType what) const; @@ -78,11 +76,15 @@ class VectorHit : public BaseTrackerRecHit { virtual LocalError localDirectionError() const; Global3DVector globalDirection() const; - virtual double chi2() const { return theChi2; } + virtual float chi2() const { return theChi2; } int dimension() const override { return theDimension; } - std::pair<double, double> curvatureORphi(std::string curvORphi = "curvature") const; + + enum curvatureOrPhi { curvatureMode, phiMode }; + + std::pair<float, float> curvatureORphi(curvatureOrPhi curvatureMode) const; + /// "lower" is logical, not geometrically lower; in pixel-strip modules the "lower" is always a pixel ClusterRef lowerCluster() const { return theLowerCluster.cluster_phase2OT(); } ClusterRef upperCluster() const { return theUpperCluster.cluster_phase2OT(); } OmniClusterRef const lowerClusterRef() const { return theLowerCluster; } @@ -104,7 +106,7 @@ class VectorHit : public BaseTrackerRecHit { //This method returns the delta in global coordinates Global3DVector globalDelta() const; - float theta(); + float theta() const; /// The projection matrix relates the trajectory state parameters to the segment parameters(). AlgebraicMatrix projectionMatrix() const override; @@ -138,18 +140,14 @@ class VectorHit : public BaseTrackerRecHit { // mat[0][2]=cov(dx/dz,x) // mat[1][3]=cov(dy/dz,y) AlgebraicSymMatrix theCovMatrix; - double theChi2; + float theChi2; int theDimension; OmniClusterRef theLowerCluster; OmniClusterRef theUpperCluster; }; inline bool operator<(const VectorHit& one, const VectorHit& other) { - if (one.chi2() < other.chi2()) { - return true; - } - - return false; + return (one.chi2() < other.chi2()); } std::ostream& operator<<(std::ostream& os, const VectorHit& vh); diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index 88cea12308bf7..a30c92f2e20ad 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -1,32 +1,36 @@ -#ifndef TrackerRecHit2D_VectorHit2D_h -#define TrackerRecHit2D_VectorHit2D_h +#ifndef DataFormats_TrackerRecHit2D_VectorHit2D_h +#define DataFormats_TrackerRecHit2D_VectorHit2D_h #include "DataFormats/GeometryVector/interface/LocalVector.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" #include "DataFormats/CLHEP/interface/AlgebraicObjects.h" #include "DataFormats/GeometrySurface/interface/LocalError.h" +//Stores geometric information about VectorHits, their convariance matrix and chi2 of the compatability of the two hits + class VectorHit2D { public: VectorHit2D() : thePosition(), theDirection(), theCovMatrix(), theChi2(), theDimension(2) {} VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& Chi2) - : thePosition(pos), theDirection(dir), theCovMatrix(covMatrix), theChi2(Chi2), theDimension(2){}; + : thePosition(pos), theDirection(dir), theCovMatrix(covMatrix), theLocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]), theChi2(Chi2), theDimension(2){}; virtual ~VectorHit2D(){}; - LocalPoint localPosition() const { return thePosition; } - LocalVector localDirection() const { return theDirection; } - LocalError localDirectionError() const { - return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); + const LocalPoint* localPosition() const { return &thePosition; } + const LocalVector* localDirection() const { return &theDirection; } + const LocalError* localDirectionError() const { + //return &LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); + return &theLocalError; } - AlgebraicSymMatrix22 covMatrix() const { return theCovMatrix; } - double chi2() const { return theChi2; } + const AlgebraicSymMatrix22* covMatrix() const { return &theCovMatrix; } + float chi2() const { return theChi2; } int dimension() const { return 2; } private: LocalPoint thePosition; LocalVector theDirection; AlgebraicSymMatrix22 theCovMatrix; - double theChi2; + LocalError theLocalError; + float theChi2; int theDimension; }; #endif diff --git a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h index db8579d0db982..62c10afc74ee8 100644 --- a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h +++ b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h @@ -33,9 +33,9 @@ namespace trackerHitRTTI { inline bool isMatched(TrackingRecHit const& hit) { return rtti(hit) == match || rtti(hit) == fastMatch; } inline bool isMulti(TrackingRecHit const& hit) { return rtti(hit) == multi; } inline bool isSingleType(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 4); } - inline bool isFromDet(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 6); } + inline bool isFromDet(TrackingRecHit const& hit) { return ((rtti(hit) > 0) & (rtti(hit) < 6) || (rtti(hit) == 12)); } inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); } - inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 10); } + inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 10)) || (rtti(hit) == 12)); } inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; } inline bool isVector(TrackingRecHit const& hit) { return rtti(hit) == vector; } inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 9cd3fe81a3ea1..dbb169193922c 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -15,14 +15,14 @@ VectorHit::VectorHit(const GeomDet& idet, const LocalPoint& posLower, const LocalVector& dir, const AlgebraicSymMatrix& covMatrix, - const double& Chi2, + const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper) : BaseTrackerRecHit(idet, trackerHitRTTI::vector), thePosition(posLower), theDirection(dir), theCovMatrix(covMatrix), - theChi2(Chi2), + theChi2(chi2), theDimension(4), theLowerCluster(lower), theUpperCluster(upper) {} @@ -33,13 +33,13 @@ VectorHit::VectorHit(const GeomDet& idet, OmniClusterRef const& lower, OmniClusterRef const& upper) : BaseTrackerRecHit(idet, trackerHitRTTI::vector), theDimension(4), theLowerCluster(lower), theUpperCluster(upper) { - thePosition = LocalPoint(vh2Dzx.localPosition().x(), vh2Dzy.localPosition().x(), 0.); + thePosition = LocalPoint(vh2Dzx.localPosition()->x(), vh2Dzy.localPosition()->x(), 0.); - theDirection = LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), 1.); + theDirection = LocalVector(vh2Dzx.localDirection()->x(), vh2Dzy.localDirection()->x(), 1.); //building the cov matrix 4x4 starting from the 2x2 - AlgebraicSymMatrix22 covMatZX = vh2Dzx.covMatrix(); - AlgebraicSymMatrix22 covMatZY = vh2Dzy.covMatrix(); + const AlgebraicSymMatrix22 covMatZX = *vh2Dzx.covMatrix(); + const AlgebraicSymMatrix22 covMatZY = *vh2Dzy.covMatrix(); theCovMatrix = AlgebraicSymMatrix(4); theCovMatrix[0][0] = covMatZX[0][0]; // var(dx/dz) @@ -167,10 +167,10 @@ Global3DVector VectorHit::globalDelta() const { Global3DVector VectorHit::globalDirection() const { return (det()->surface().toGlobal(localDirection())); } -std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const { - double curvature = -999.; - double errorCurvature = -999.; - double phi = -999.; +std::pair<float, float> VectorHit::curvatureORphi(curvatureOrPhi curvORphi) const { + float curvature = -999.; + float errorCurvature = -999.; + float phi = -999.; //global pos and errors Global3DPoint gPositionLower = lowerGlobalPos(); @@ -187,7 +187,7 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const gErrorUpper = lowerGlobalPosErr(); } - double h1 = gPositionLower.x() * gPositionUpper.y() - gPositionUpper.x() * gPositionLower.y(); + float h1 = gPositionLower.x() * gPositionUpper.y() - gPositionUpper.x() * gPositionLower.y(); //determine sign of curvature AlgebraicVector2 n1; @@ -338,16 +338,14 @@ std::pair<double, double> VectorHit::curvatureORphi(std::string curvORphi) const } else { return std::make_pair(0.0, 0.0); } - - if (curvORphi == "curvature") - return std::make_pair(curvature, errorCurvature); - else if (curvORphi == "phi") - return std::make_pair(phi, 0.0); - else - return std::make_pair(0.0, 0.0); + switch(curvORphi){ + case curvatureMode : return std::make_pair(curvature, errorCurvature); + case phiMode : return std::make_pair(phi, 0.0); + } + return std::make_pair(0.0, 0.0); } -float VectorHit::theta() { return globalDirection().theta(); } +float VectorHit::theta() const { return globalDirection().theta(); } AlgebraicMatrix VectorHit::projectionMatrix() const { // obsolete (for what tracker is concerned...) interface diff --git a/DataFormats/TrackerRecHit2D/src/classes.h b/DataFormats/TrackerRecHit2D/src/classes.h index 98ba7a9edea20..03140aa37a5bb 100644 --- a/DataFormats/TrackerRecHit2D/src/classes.h +++ b/DataFormats/TrackerRecHit2D/src/classes.h @@ -31,178 +31,4 @@ #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include <vector> -namespace DataFormats_TrackerRecHit2D { - struct dictionary { - ProjectedSiStripRecHit2D projHit; - SiStripRecHit2D a1; - SiStripRecHit1D a11; - SiStripMatchedRecHit2D a2; - SiPixelRecHit b1; - - edm::ClonePolicy<SiStripRecHit2D> a4; - edm::ClonePolicy<SiStripRecHit1D> a44; - edm::ClonePolicy<SiStripMatchedRecHit2D> a5; - edm::ClonePolicy<SiPixelRecHit> b2; - edm::ClonePolicy<SiTrackerMultiRecHit> e2; - - edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>> a6; - edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>::const_iterator it6; - edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>> a66; - edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>::const_iterator it66; - edm::OwnVector<SiStripMatchedRecHit2D, edm::ClonePolicy<SiStripMatchedRecHit2D>> a7; - edm::OwnVector<SiStripMatchedRecHit2D, edm::ClonePolicy<SiStripMatchedRecHit2D>>::const_iterator it7; - edm::OwnVector<SiPixelRecHit, edm::ClonePolicy<SiPixelRecHit>> b3; - edm::OwnVector<SiPixelRecHit, edm::ClonePolicy<SiPixelRecHit>>::const_iterator it3; - edm::OwnVector<SiTrackerMultiRecHit, edm::ClonePolicy<SiTrackerMultiRecHit>> e3; - edm::OwnVector<SiTrackerMultiRecHit, edm::ClonePolicy<SiTrackerMultiRecHit>>::const_iterator it10; - - edm::OwnVector<BaseTrackerRecHit> ovbtrh; - edm::Wrapper<edm::OwnVector<BaseTrackerRecHit>> wovbtrh; - - edm::Wrapper<edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, - edm::ClonePolicy<SiStripRecHit2D>>> - siStripRecHit2DLocalPosCollectionWrapper; - edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, - edm::ClonePolicy<SiStripRecHit2D>>::id_iterator it2d; - - edm::Wrapper<edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, - edm::ClonePolicy<SiStripRecHit1D>>> - siStripRecHit1DLocalPosCollectionWrapper; - edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, - edm::ClonePolicy<SiStripRecHit1D>>::id_iterator it1d; - - edm::Wrapper<edm::RangeMap<DetId, - edm::OwnVector<SiStripMatchedRecHit2D, edm::ClonePolicy<SiStripMatchedRecHit2D>>, - edm::ClonePolicy<SiStripMatchedRecHit2D>>> - siStripRecHit2DMatchedLocalPosCollectionWrapper; - edm::RangeMap<DetId, - edm::OwnVector<SiStripMatchedRecHit2D, edm::ClonePolicy<SiStripMatchedRecHit2D>>, - edm::ClonePolicy<SiStripMatchedRecHit2D>>::id_iterator itmatch; - - edm::Wrapper<edm::RangeMap<DetId, - edm::OwnVector<SiPixelRecHit, edm::ClonePolicy<SiPixelRecHit>>, - edm::ClonePolicy<SiPixelRecHit>>> - siPixelRecHitCollectionWrapper; - edm::RangeMap<DetId, - edm::OwnVector<SiPixelRecHit, edm::ClonePolicy<SiPixelRecHit>>, - edm::ClonePolicy<SiPixelRecHit>>::id_iterator itpix; - - edm::Ref<edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, - edm::ClonePolicy<SiStripRecHit2D>>, - SiStripRecHit2D, - edm::refhelper::FindUsingAdvance< - edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, - edm::ClonePolicy<SiStripRecHit2D>>, - SiStripRecHit2D>> - refRangeMapDetIdOwnVectorSiStripRecHit2D; - edm::RefVector<edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, - edm::ClonePolicy<SiStripRecHit2D>>, - SiStripRecHit2D, - edm::refhelper::FindUsingAdvance< - edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit2D, edm::ClonePolicy<SiStripRecHit2D>>, - edm::ClonePolicy<SiStripRecHit2D>>, - SiStripRecHit2D>> - refVectorRangeMapDetIdOwnVectorSiStripRecHit2D; - - edm::Ref<edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, - edm::ClonePolicy<SiStripRecHit1D>>, - SiStripRecHit1D, - edm::refhelper::FindUsingAdvance< - edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, - edm::ClonePolicy<SiStripRecHit1D>>, - SiStripRecHit1D>> - refRangeMapDetIdOwnVectorSiStripRecHit1D; - edm::RefVector<edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, - edm::ClonePolicy<SiStripRecHit1D>>, - SiStripRecHit1D, - edm::refhelper::FindUsingAdvance< - edm::RangeMap<DetId, - edm::OwnVector<SiStripRecHit1D, edm::ClonePolicy<SiStripRecHit1D>>, - edm::ClonePolicy<SiStripRecHit1D>>, - SiStripRecHit1D>> - refVectorRangeMapDetIdOwnVectorSiStripRecHit1D; - - edm::Wrapper<edmNew::DetSetVector<SiStripRecHit2D>> wdstvDummy1; - edm::Wrapper<edmNew::DetSetVector<SiStripRecHit1D>> wdstvDummy11; - edm::Wrapper<edmNew::DetSetVector<SiStripMatchedRecHit2D>> wdstvDummy2; - edm::Wrapper<edmNew::DetSetVector<SiPixelRecHit>> wdstvDummy3; - - edm::Wrapper<reco::ClusterRemovalInfo> clusterRemovalInfo; - - edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>> fastsimTrackerRecHitCollection; - edm::Wrapper<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>> - fastsimTrackerRecHitCollection_Wrapper; - - std::vector< - edm::Ref<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit, - edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit>>> - fastsimTrackerRecHitRefCollection; - - edm::Wrapper<std::vector< - edm::Ref<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit, - edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit>>>> - fastsimTrackerRecHitRefCollection_Wrapper; - - std::vector<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>> fastsimTrackerRecHitCombinations; - edm::Wrapper<std::vector<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>>> - fastsimTrackerRecHitCombinations_Wrapper; - - std::vector<std::vector< - edm::Ref<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit, - edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit>>>> - fastSimTrackerRecHitCombinationCollection; - edm::Wrapper<std::vector<std::vector< - edm::Ref<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit, - edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit>>>>> - fastSimTrackerRecHitCombinationCollection_Wrapper; - - edm::Ref< - vector<vector<edm::Ref< - edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit, - edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit>>>>, - vector<edm::Ref< - edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit, - edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit>>>, - edm::refhelper::FindUsingAdvance< - vector<vector<edm::Ref< - edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit, - edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit>>>>, - vector<edm::Ref< - edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit, - edm::refhelper::FindUsingAdvance<edm::OwnVector<FastTrackerRecHit, edm::ClonePolicy<FastTrackerRecHit>>, - FastTrackerRecHit>>>>> - fastSimTrackerRecHitCombinationRef; - - VectorHitCollectionNew vhc1_new; - edm::RefProd<VectorHitCollectionNew> vhc1_new2; - edm::Wrapper<VectorHitCollectionNew> wh1_new; - }; -} // namespace DataFormats_TrackerRecHit2D - #endif // SISTRIPRECHIT_CLASSES_H diff --git a/DataFormats/TrackerRecHit2D/src/classes_def.xml b/DataFormats/TrackerRecHit2D/src/classes_def.xml index 87a581c22987b..569ec40801614 100644 --- a/DataFormats/TrackerRecHit2D/src/classes_def.xml +++ b/DataFormats/TrackerRecHit2D/src/classes_def.xml @@ -189,11 +189,11 @@ <class name="edm::Wrapper< MTDTrackingDetSetVector >"/> <class name="MTDTrackingOwnVector"/> <class name="edm::Wrapper< MTDTrackingOwnVector >"/> - <class name="VectorHit" ClassVersion="3"> - <version ClassVersion="3" checksum="546506376"/> + <class name="VectorHit" ClassVersion="4"> + <version ClassVersion="4" checksum="3655344937"/> </class> - <class name="VectorHit2D" ClassVersion="3"> - <version ClassVersion="3" checksum="333065919"/> + <class name="VectorHit2D" ClassVersion="5"> + <version ClassVersion="5" checksum="1341481267"/> </class> <class name="edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector> >"/> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h index 3959b0df1c04e..ecbae466fa2fb 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h @@ -6,21 +6,25 @@ class VectorHitMomentumHelper { public: - VectorHitMomentumHelper() {} + VectorHitMomentumHelper(const MagneticField* magField) { + GlobalPoint center(0.0, 0.0, 0.0); + intermediate = magField->inTesla(center).mag() * 0.003; + //0.003 is because the curvature (rho) is in cm and not in m +} ~VectorHitMomentumHelper() {} - float transverseMomentum(VectorHit& vh, const MagneticField* magField) const { - GlobalPoint center(0.0, 0.0, 0.0); - float magnT = magField->inTesla(center).mag(); - double rho = 1. / vh.curvatureORphi("curvature").first; - //0.003 is because the curvature (rho) is in cm and not in m - return (0.003 * magnT * rho); + float transverseMomentum(VectorHit& vh) const { + float rho = 1. / vh.curvatureORphi(VectorHit::curvatureMode).first; + return (intermediate * rho); } - float momentum(VectorHit& vh, const MagneticField* magField) const { - return transverseMomentum(vh, magField) / (1. * sin(vh.theta())); + float momentum(VectorHit& vh) const { + return transverseMomentum(vh) / (1. * sin(vh.theta())); } private: + + float intermediate; + }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 42a499ef409db..957dd83bd1f49 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -20,10 +20,9 @@ VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet simVerticesToken_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits")); trackingParticleToken_ = consumes<TrackingParticleCollection>(conf.getParameter<edm::InputTag>("trackingParticleSrc")); - vhMomHelper = new VectorHitMomentumHelper(); } -VectorHitsBuilderValidation::~VectorHitsBuilderValidation() { delete vhMomHelper; } +VectorHitsBuilderValidation::~VectorHitsBuilderValidation() { } void VectorHitsBuilderValidation::beginJob() { edm::Service<TFileService> fs; @@ -623,11 +622,12 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev continue; } + VectorHitMomentumHelper vhMomHelper(magField); //curvature - curvature = vh.curvatureORphi("curvature").first; - phi = vh.curvatureORphi("phi").first; - QOverPT = vhMomHelper->transverseMomentum(vh, magField); - QOverP = vhMomHelper->momentum(vh, magField); + curvature = vh.curvatureORphi(VectorHit::curvatureMode).first; + phi = vh.curvatureORphi(VectorHit::phiMode).first; + QOverPT = vhMomHelper.transverseMomentum(vh); + QOverP = vhMomHelper.momentum(vh); histogramLayer->second.curvature->Fill(curvature); //stub width diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index 99f2c967bee6b..c8789005d222e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -145,5 +145,4 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { std::map<unsigned int, VHHistos> histograms_; - const VectorHitMomentumHelper* vhMomHelper; }; diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h index 12cd02d30b944..c74506255a9c2 100644 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -82,8 +82,6 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT<reco::BeamSpot> beamSpotToken; const reco::BeamSpot* beamSpot; std::string updatorName; - //Helper class to access momentum of VH - const VectorHitMomentumHelper* vhMomHelper; edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 9e9f15110008f..1bc7657c39386 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -21,11 +21,10 @@ SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) vhProducerToken = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); beamSpotToken = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); updatorName = conf.getParameter<std::string>("updator"); - vhMomHelper = new VectorHitMomentumHelper(); produces<TrajectorySeedCollection>(); } -SeedingOTEDProducer::~SeedingOTEDProducer() { delete vhMomHelper; } +SeedingOTEDProducer::~SeedingOTEDProducer() { } void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -49,7 +48,8 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; event.getByToken(tkMeasEventToken, measurementTrackerEvent); - layerMeasurements = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); + //layerMeasurements = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); + LayerMeasurements layerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); estimator = &es.getData(estToken_); @@ -236,9 +236,14 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& // gv transform to local (lv) const Local3DVector lv(vHit.det()->surface().toLocal(gv)); + //Helper class to access momentum of VH + VectorHitMomentumHelper vhMomHelper(magField); + + + //FIXME::charge is fine 1 every two times!! int charge = 1; - float p = vhMomHelper->momentum(vHit, magField); + float p = vhMomHelper.momentum(vHit); float x = vHit.localPosition().x(); float y = vHit.localPosition().y(); float dx = vHit.localDirection().x(); @@ -252,7 +257,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p mat[0][0] = pow( - computeInverseMomentumError(vHit, theta, beamSpot->sigmaZ(), vhMomHelper->transverseMomentum(vHit, magField)), 2); + computeInverseMomentumError(vHit, theta, beamSpot->sigmaZ(), vhMomHelper.transverseMomentum(vHit)), 2); //building tsos LocalTrajectoryError lterr(asSMatrix<5>(mat)); From 142acec79464758ec2a431f7b24dc5126f8ca328 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 4 Sep 2020 12:11:50 -0500 Subject: [PATCH 372/778] addressing PR comments part II --- .../interface/trackerHitRTTI.h | 6 +- .../Records/interface/TkPhase2OTCPERecord.h | 2 +- .../SiPhase2RecHitMatcherESProducer.cc | 2 +- .../test/Clusters_productionAndTesting.py | 13 +++- .../test/VHs_combinatorialStudies_PU200.py | 4 +- .../plugins/TrackerRecoGeometryESProducer.cc | 6 +- .../TrackerRecoGeometryESProducer_cfi.py | 4 +- .../MeasurementTrackerESProducer_cfi.py | 6 +- .../interface/SeedingOTEDProducer.h | 24 +++--- .../src/SeedingOTEDProducer.cc | 77 +++++++++---------- 10 files changed, 74 insertions(+), 70 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h index 62c10afc74ee8..9d0a6bab0403d 100644 --- a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h +++ b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h @@ -33,9 +33,11 @@ namespace trackerHitRTTI { inline bool isMatched(TrackingRecHit const& hit) { return rtti(hit) == match || rtti(hit) == fastMatch; } inline bool isMulti(TrackingRecHit const& hit) { return rtti(hit) == multi; } inline bool isSingleType(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 4); } - inline bool isFromDet(TrackingRecHit const& hit) { return ((rtti(hit) > 0) & (rtti(hit) < 6) || (rtti(hit) == 12)); } + //inline bool isFromDet(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 6)) | (rtti(hit) == 12)); } + inline bool isFromDet(TrackingRecHit const& hit) { return ((rtti(hit) > 0) & (rtti(hit) < 6)); } inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); } - inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 10)) || (rtti(hit) == 12)); } + inline bool isFromDetOrFast(TrackingRecHit const& hit) { return ((rtti(hit) > 0) & (rtti(hit) < 10)); } + //inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 10)) | (rtti(hit) == 12)); } inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; } inline bool isVector(TrackingRecHit const& hit) { return rtti(hit) == vector; } inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; } diff --git a/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h b/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h index 9423e0188ff5d..3a6925080a227 100644 --- a/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h +++ b/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h @@ -12,7 +12,7 @@ class TkPhase2OTCPERecord : public edm::eventsetup::DependentRecordImplementation<TkPhase2OTCPERecord, edm::mpl::Vector<TrackerDigiGeometryRecord, - TrackerTopologyRcd, + //TrackerTopologyRcd, IdealMagneticFieldRecord, SiPhase2OuterTrackerLorentzAngleRcd> > {}; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index dce044097bc78..3cb618a0c297c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -41,7 +41,7 @@ std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::prod matcher_ = std::make_shared<VectorHitBuilderAlgorithm>(pset_); edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); - edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getHandle(trackerTopoToken_); + edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getRecord<TrackerDigiGeometryRecord>().getHandle(trackerTopoToken_); auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py index b257da7431545..7728a15e402a2 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py @@ -2,7 +2,7 @@ from Configuration.StandardSequences.Eras import eras -process = cms.Process('RECO',eras.Phase2C2) +process = cms.Process('RECO',eras.Phase2C9) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -10,7 +10,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023D4Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.RawToDigi_cff') process.load('Configuration.StandardSequences.L1Reco_cff') @@ -33,7 +33,7 @@ # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('/store/relval/CMSSW_9_1_0_pre1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/90X_upgrade2023_realistic_v9_D4Timing-v1/00000/161D8583-1719-E711-BA42-0CC47A7C346E.root'), + fileNames = cms.untracked.vstring('/store/relval/CMSSW_11_1_0_pre6/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/FF928A27-31CB-9C4D-93E0-475E2E73326E.root'), secondaryFileNames = cms.untracked.vstring(), skipEvents = cms.untracked.uint32(0) ) @@ -75,7 +75,12 @@ # Analyzer process.analysis = cms.EDAnalyzer('Phase2TrackerClusterizerValidation', src = cms.InputTag("siPhase2Clusters"), - links = cms.InputTag("simSiPixelDigis", "Tracker") + links = cms.InputTag("simSiPixelDigis", "Tracker"), + simhitsbarrel = cms.InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof"), + simhitsendcap = cms.InputTag("g4SimHits", "TrackerHitsPixelEndcapLowTof"), + simtracks = cms.InputTag("g4SimHits"), + ECasRings = cms.bool(True), + SimTrackMinPt = cms.double(2.) ) #process.analysis = cms.EDAnalyzer('Phase2TrackerClusterizerValidationTGraph', diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py index a485506221930..70c46e4ea1d2e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py @@ -2,7 +2,7 @@ from Configuration.StandardSequences.Eras import eras -process = cms.Process('RECO',eras.Phase2C2) +process = cms.Process('RECO',eras.Phase2C9) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -11,7 +11,7 @@ process.load('Configuration.EventContent.EventContent_cff') #process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('SimGeneral.MixingModule.mix_POISSON_average_cfi') -process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.RawToDigi_cff') process.load('Configuration.StandardSequences.L1Reco_cff') diff --git a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc index 52a299f1eb172..5242ff422eef2 100644 --- a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc +++ b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc @@ -28,13 +28,13 @@ class TrackerRecoGeometryESProducer : public edm::ESProducer { private: edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopToken_; - bool _usePhase2Stacks; + bool usePhase2Stacks_; }; using namespace edm; TrackerRecoGeometryESProducer::TrackerRecoGeometryESProducer(const edm::ParameterSet &p) - : _usePhase2Stacks(p.getParameter<bool>("usePhase2Stacks")) { + : usePhase2Stacks_(p.getParameter<bool>("usePhase2Stacks")) { auto c = setWhatProduced(this); // 08-Oct-2007 - Patrick Janot @@ -52,7 +52,7 @@ std::unique_ptr<GeometricSearchTracker> TrackerRecoGeometryESProducer::produce( GeometricSearchTrackerBuilder builder; return std::unique_ptr<GeometricSearchTracker>( - builder.build(tG.trackerDet(), &tG, &iRecord.get(tTopToken_), _usePhase2Stacks)); + builder.build(tG.trackerDet(), &tG, &iRecord.get(tTopToken_), usePhase2Stacks_)); } void TrackerRecoGeometryESProducer::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 22d95e29034d3..9a87a93207ed2 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(False) + usePhase2Stacks = cms.bool(True) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) diff --git a/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py b/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py index ca5973895e619..a09c7c51b6597 100644 --- a/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py +++ b/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py @@ -5,5 +5,7 @@ MeasurementTracker = _MeasurementTrackerESProducer_default.clone() from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(MeasurementTracker, Phase2StripCPE = 'Phase2StripCPE') -trackingPhase2PU140.toModify(MeasurementTracker, Phase2HitMatcher = 'SiPhase2VectorHitMatcher') +trackingPhase2PU140.toModify(MeasurementTracker, + Phase2StripCPE = 'Phase2StripCPE', + Phase2HitMatcher = 'SiPhase2VectorHitMatcher' +) diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h index c74506255a9c2..76ef523f69194 100644 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h @@ -70,18 +70,18 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { }; private: - edm::EDGetTokenT<VectorHitCollectionNew> vhProducerToken; - const TrackerTopology* tkTopo; - const MeasurementTracker* measurementTracker; - const LayerMeasurements* layerMeasurements; - const MeasurementEstimator* estimator; - const Propagator* propagator; - const MagneticField* magField; - const TrajectoryStateUpdator* theUpdator; - const edm::EDGetTokenT<MeasurementTrackerEvent> tkMeasEventToken; - edm::EDGetTokenT<reco::BeamSpot> beamSpotToken; - const reco::BeamSpot* beamSpot; - std::string updatorName; + edm::EDGetTokenT<VectorHitCollectionNew> vhProducerToken_; + const TrackerTopology* tkTopo_; + const MeasurementTracker* measurementTracker_; + const LayerMeasurements* layerMeasurements_; + const MeasurementEstimator* estimator_; + const Propagator* propagator_; + const MagneticField* magField_; + const TrajectoryStateUpdator* updator_; + const edm::EDGetTokenT<MeasurementTrackerEvent> tkMeasEventToken_; + edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_; + const reco::BeamSpot* beamSpot_; + std::string updatorName_; edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc index 1bc7657c39386..d2ca0fa2ab34b 100644 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc @@ -10,17 +10,17 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) - : theUpdator(nullptr), - tkMeasEventToken(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), + : updator_(nullptr), + tkMeasEventToken_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), topoToken_(esConsumes()), propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial" ))), magFieldToken_(esConsumes()), updatorToken_(esConsumes()), measurementTrackerToken_(esConsumes()), estToken_(esConsumes(edm::ESInputTag("","Chi2"))) { - vhProducerToken = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); - beamSpotToken = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); - updatorName = conf.getParameter<std::string>("updator"); + vhProducerToken_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); + beamSpotToken_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); + updatorName_ = conf.getParameter<std::string>("updator"); produces<TrajectorySeedCollection>(); } @@ -39,40 +39,35 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); - tkTopo = &es.getData(topoToken_); + tkTopo_ = &es.getData(topoToken_); edm::ESHandle<MeasurementTracker> measurementTrackerHandle; measurementTrackerHandle = es.getHandle(measurementTrackerToken_); - measurementTracker = measurementTrackerHandle.product(); + measurementTracker_ = measurementTrackerHandle.product(); edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; - event.getByToken(tkMeasEventToken, measurementTrackerEvent); + event.getByToken(tkMeasEventToken_, measurementTrackerEvent); - //layerMeasurements = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); - LayerMeasurements layerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); + LayerMeasurements layerMeasurements_(*measurementTrackerHandle, *measurementTrackerEvent); - estimator = &es.getData(estToken_); + estimator_ = &es.getData(estToken_); - propagator = &es.getData(propagatorToken_); + propagator_ = &es.getData(propagatorToken_); - magField = &es.getData(magFieldToken_); + magField_ = &es.getData(magFieldToken_); - theUpdator = &es.getData(updatorToken_); + updator_ = &es.getData(updatorToken_); edm::Handle<reco::BeamSpot> beamSpotH; - event.getByToken(beamSpotToken, beamSpotH); + event.getByToken(beamSpotToken_, beamSpotH); if (beamSpotH.isValid()) { - beamSpot = beamSpotH.product(); + beamSpot_ = beamSpotH.product(); } // Get the vector hits edm::Handle<VectorHitCollectionNew> vhs; - event.getByToken(vhProducerToken, vhs); - /* - edm::ESHandle< ClusterParameterEstimator<Phase2TrackerCluster1D> > parameterestimator; - es.get<TkStripCPERecord>().get(cpe, parameterestimator); - const Phase2StripCPEGeometric & cpeOT(*parameterestimator); -*/ + event.getByToken(vhProducerToken_, vhs); + TrajectorySeedCollection const& tempSeeds = run(vhs); for (TrajectorySeedCollection::const_iterator qIt = tempSeeds.begin(); qIt < tempSeeds.end(); ++qIt) { seedsWithVHs->push_back(*qIt); @@ -86,22 +81,22 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio TrajectorySeedCollection result; //check if all the first three layers have VHs - std::vector<VectorHit> VHseedsL1 = collectVHsOnLayer(VHs, 1); - std::vector<VectorHit> VHseedsL2 = collectVHsOnLayer(VHs, 2); - std::vector<VectorHit> VHseedsL3 = collectVHsOnLayer(VHs, 3); - if (VHseedsL1.empty() || VHseedsL2.empty() || VHseedsL3.empty()) { + std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(VHs, 1); + std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(VHs, 2); + std::vector<VectorHit> vhSeedsL3 = collectVHsOnLayer(VHs, 3); + if (vhSeedsL1.empty() || vhSeedsL2.empty() || vhSeedsL3.empty()) { return result; } //seeds are built in the L3 of the OT - const BarrelDetLayer* barrelOTLayer2 = measurementTracker->geometricSearchTracker()->tobLayers().at(1); + const BarrelDetLayer* barrelOTLayer2 = measurementTracker_->geometricSearchTracker()->tobLayers().at(1); //the search propag directiondepend on the sign of signZ*signPz, while the building is always the contrary - Propagator* searchingPropagator = &*propagator->clone(); - Propagator* buildingPropagator = &*propagator->clone(); + Propagator* searchingPropagator = &*propagator_->clone(); + Propagator* buildingPropagator = &*propagator_->clone(); buildingPropagator->setPropagationDirection(alongMomentum); - for (auto hitL3 : VHseedsL3) { + for (auto hitL3 : vhSeedsL3) { //building a tsos out of a VectorHit const TrajectoryStateOnSurface initialTSOS = buildInitialTSOS(hitL3); float signZ = copysign(1.0, initialTSOS.globalPosition().z()); @@ -115,7 +110,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio //find vHits in layer 2 std::vector<TrajectoryMeasurement> measurementsL2 = - layerMeasurements->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + layerMeasurements_->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator_); //other options //LayerMeasurements::SimpleHitContainer hits; @@ -128,7 +123,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio if (!measurementsL2.empty()) { //not sure if building it everytime takes time/memory - const DetLayer* barrelOTLayer1 = measurementTracker->geometricSearchTracker()->tobLayers().at(0); + const DetLayer* barrelOTLayer1 = measurementTracker_->geometricSearchTracker()->tobLayers().at(0); for (const auto& mL2 : measurementsL2) { const TrackingRecHit* hitL2 = mL2.recHit().get(); @@ -141,7 +136,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio //searching possible VHs in L1 std::vector<TrajectoryMeasurement> measurementsL1 = - layerMeasurements->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator); + layerMeasurements_->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator_); std::vector<TrajectoryMeasurement>::iterator measurementsL1end = std::remove_if(measurementsL1.begin(), measurementsL1.end(), isInvalid()); measurementsL1.erase(measurementsL1end, measurementsL1.end()); @@ -170,7 +165,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio updatedTSOSL1.second.rescaleError(100); - TrajectoryStateOnSurface updatedTSOSL1_final = theUpdator->update(updatedTSOSL1.second, *hitL1); + TrajectoryStateOnSurface updatedTSOSL1_final = updator_->update(updatedTSOSL1.second, *hitL1); if UNLIKELY (!updatedTSOSL1_final.isValid()) continue; std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = @@ -193,7 +188,7 @@ unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { StripSubdetector strip = StripSubdetector(iidd); unsigned int subid = strip.subdetId(); if (subid == StripSubdetector::TIB || subid == StripSubdetector::TOB) { - return tkTopo->layer(iidd); + return tkTopo_->layer(iidd); } return 0; } @@ -237,7 +232,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& const Local3DVector lv(vHit.det()->surface().toLocal(gv)); //Helper class to access momentum of VH - VectorHitMomentumHelper vhMomHelper(magField); + VectorHitMomentumHelper vhMomHelper(magField_); @@ -257,11 +252,11 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p mat[0][0] = pow( - computeInverseMomentumError(vHit, theta, beamSpot->sigmaZ(), vhMomHelper.transverseMomentum(vHit)), 2); + computeInverseMomentumError(vHit, theta, beamSpot_->sigmaZ(), vhMomHelper.transverseMomentum(vHit)), 2); //building tsos LocalTrajectoryError lterr(asSMatrix<5>(mat)); - const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit.det()->surface(), magField); + const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit.det()->surface(), magField_); return tsos; } @@ -282,7 +277,7 @@ AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) { std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdate( const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) { TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); - TrajectoryStateOnSurface updatedTSOS = theUpdator->update(propTSOS, hit); + TrajectoryStateOnSurface updatedTSOS = updator_->update(propTSOS, hit); if UNLIKELY (!updatedTSOS.isValid()) return std::make_pair(false, updatedTSOS); return std::make_pair(true, updatedTSOS); @@ -301,8 +296,8 @@ float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, const double transverseMomentum) { //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12) float varianceInverseTransvMomentum = 1. / 12; - double derivativeTheta2 = pow(cos(globalTheta) / transverseMomentum, 2); - double derivativeInverseTransvMomentum2 = pow(sin(globalTheta), 2); + float derivativeTheta2 = pow(cos(globalTheta) / transverseMomentum, 2); + float derivativeInverseTransvMomentum2 = pow(sin(globalTheta), 2); float thetaError = computeGlobalThetaError(vh, sigmaZ_beamSpot); return pow(derivativeTheta2 * pow(thetaError, 2) + derivativeInverseTransvMomentum2 * varianceInverseTransvMomentum, 0.5); From ce1a3eabff4e0a05c9604fdc24155a9c58f9ba91 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 4 Sep 2020 12:57:55 -0500 Subject: [PATCH 373/778] addressing PR comments part III --- .../interface/VectorHitBuilderAlgorithmBase.h | 8 +--- .../SiPhase2RecHitMatcherESProducer.cc | 37 ++++++++++--------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index faf6769ecc578..ea72094901a29 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -13,13 +13,7 @@ #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" - -namespace edm { - class ParameterSet; - template <typename T> - class RefGetter; - class EventSetup; -} // namespace edm +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" class VectorHitBuilderAlgorithmBase { public: diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 3cb618a0c297c..3d8f3dd9d3575 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -3,6 +3,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Utilities/interface/EDMException.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "RecoTracker/Record/interface/CkfComponentsRecord.h" @@ -15,11 +16,10 @@ class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { public: SiPhase2RecHitMatcherESProducer(const edm::ParameterSet&); static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - std::shared_ptr<VectorHitBuilderAlgorithm> produce(const TkPhase2OTCPERecord&); + std::unique_ptr<VectorHitBuilderAlgorithm> produce(const TkPhase2OTCPERecord&); private: std::string name_; - std::shared_ptr<VectorHitBuilderAlgorithm> matcher_; edm::ParameterSet pset_; edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geometryToken_; edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopoToken_; @@ -28,28 +28,31 @@ class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet& p) { name_ = p.getParameter<std::string>("ComponentName"); + if (!(name_ == "SiPhase2VectorHitMatcher")){ + throw cms::Exception("ConfigurationError") + << "Configuration specifies unknown ComponentName .\n" + << "Currently only 'SiPhase2VectorHitMatcher' is supported\n"; + } pset_ = p; auto cc = setWhatProduced(this, name_); - geometryToken_ = cc.consumesFrom<TrackerGeometry, TrackerDigiGeometryRecord>(); - trackerTopoToken_ = cc.consumesFrom<TrackerTopology, TrackerTopologyRcd>(); - auto const P2otname = p.getParameter<edm::ESInputTag>("CPE"); - cpeToken_ = cc.consumesFrom<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord>(P2otname); + geometryToken_ = cc.consumes(); + trackerTopoToken_ = cc.consumes(); + cpeToken_ = cc.consumes(p.getParameter<edm::ESInputTag>("CPE")); } -std::shared_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce(const TkPhase2OTCPERecord& iRecord) { - if (name_ == "SiPhase2VectorHitMatcher") { - matcher_ = std::make_shared<VectorHitBuilderAlgorithm>(pset_); +std::unique_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce(const TkPhase2OTCPERecord& iRecord) { + std::unique_ptr<VectorHitBuilderAlgorithm> matcher = std::make_unique<VectorHitBuilderAlgorithm>(pset_); - edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); - edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getRecord<TrackerDigiGeometryRecord>().getHandle(trackerTopoToken_); + edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); + edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getRecord<TrackerDigiGeometryRecord>().getHandle(trackerTopoToken_); - auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); + auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); - matcher_->initTkGeom(tGeomHandle); - matcher_->initTkTopo(tTopoHandle); - matcher_->initCpe(ptr_phase2TrackerCPE); - } - return matcher_; + matcher->initTkGeom(tGeomHandle); + matcher->initTkTopo(tTopoHandle); + matcher->initCpe(ptr_phase2TrackerCPE); + + return matcher; } void SiPhase2RecHitMatcherESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { From 59037885d2bfe47ceb1ad70b23a71f38b803b9b5 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 4 Sep 2020 14:42:35 -0500 Subject: [PATCH 374/778] restructure constructor of VectorHitBuilderAlgorithm and changed VectorHitBuilderEDProdcuer to use VectorHitBuilderAlgorithm via the EventSetup --- .../interface/VectorHitBuilderAlgorithm.h | 10 ++--- .../interface/VectorHitBuilderAlgorithmBase.h | 21 ++++++----- .../interface/VectorHitBuilderEDProducer.h | 13 ++++--- .../SiPhase2RecHitMatcherESProducer.cc | 9 +++-- .../src/VectorHitBuilderAlgorithm.cc | 6 +-- .../src/VectorHitBuilderAlgorithmBase.cc | 31 ++++++++++------ .../src/VectorHitBuilderEDProducer.cc | 37 +++---------------- 7 files changed, 58 insertions(+), 69 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 72eb5c688aef6..32806969c560c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -16,20 +16,20 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { public: - VectorHitBuilderAlgorithm(const edm::ParameterSet& conf) - : VectorHitBuilderAlgorithmBase(conf), theFitter(new LinearFit()){}; + VectorHitBuilderAlgorithm(const edm::ParameterSet& conf, const TrackerGeometry* tkGeomProd, const TrackerTopology* tkTopoProd, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) + : VectorHitBuilderAlgorithmBase(conf, tkGeomProd, tkTopoProd, cpeProd ), theFitter(new LinearFit()){}; ~VectorHitBuilderAlgorithm() override { delete theFitter; }; void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, VectorHitCollectionNew& vhAcc, VectorHitCollectionNew& vhRej, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) override; + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const override; //not implemented yet bool checkClustersCompatibilityBeforeBuilding(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, const detset& theLowerDetSet, - const detset& theUpperDetSet); + const detset& theUpperDetSet) const; bool checkClustersCompatibility(Local3DPoint& posinner, Local3DPoint& posouter, LocalError& errinner, @@ -54,7 +54,7 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, const detset& DSVinner, const detset& DSVouter, - const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) override; + const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) const override; VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index ea72094901a29..8fd95d97096ba 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -23,11 +23,14 @@ class VectorHitBuilderAlgorithmBase { typedef edmNew::DetSetVector<VectorHit> output_t; typedef std::pair<StackGeomDet, std::vector<Phase2TrackerCluster1D>> StackClusters; - VectorHitBuilderAlgorithmBase(const edm::ParameterSet&); + VectorHitBuilderAlgorithmBase(const edm::ParameterSet&, + const TrackerGeometry*, + const TrackerTopology*, + const ClusterParameterEstimator<Phase2TrackerCluster1D>*); virtual ~VectorHitBuilderAlgorithmBase() {} - void initialize(const edm::EventSetup&); - void initTkGeom(edm::ESHandle<TrackerGeometry> tkGeomHandle); - void initTkTopo(edm::ESHandle<TrackerTopology> tkTopoHandle); +// void initialize(const edm::EventSetup&); + void initTkGeom(const TrackerGeometry* tkGeomProd); + void initTkTopo(const TrackerTopology* tkTopoProd); void initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd); //FIXME::ERICA::this should be template, return different collection for different algo used!! @@ -35,14 +38,14 @@ class VectorHitBuilderAlgorithmBase { VectorHitCollectionNew& vhAcc, VectorHitCollectionNew& vhRej, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) = 0; + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const = 0; virtual std::vector<std::pair<VectorHit, bool>> buildVectorHits( const StackGeomDet* stack, edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, const detset& DSVinner, const detset& DSVouter, - const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) = 0; + const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) const = 0; virtual VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, @@ -51,10 +54,10 @@ class VectorHitBuilderAlgorithmBase { double computeParallaxCorrection(const PixelGeomDetUnit*&, const Point3DBase<float, LocalTag>&, const PixelGeomDetUnit*&, - const Point3DBase<float, LocalTag>&); + const Point3DBase<float, LocalTag>&) const; - void printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters); - void printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* cluster); + void printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) const; + void printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* cluster) const; void loadDetSetVector(std::map<DetId, std::vector<VectorHit>>& theMap, edmNew::DetSetVector<VectorHit>& theCollection) const; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h index be5ae1ee0f4fd..0bbc94142534d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h @@ -11,7 +11,9 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h" #include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> #include <FWCore/ParameterSet/interface/ParameterSetDescription.h> @@ -20,23 +22,22 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { public: explicit VectorHitBuilderEDProducer(const edm::ParameterSet&); ~VectorHitBuilderEDProducer() override; - void produce(edm::Event&, const edm::EventSetup&) override; - void setupAlgorithm(edm::ParameterSet const& conf); + void produce(edm::Event&, const edm::EventSetup&) override; void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej); static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - VectorHitBuilderAlgorithmBase* algo() const { return stubsBuilder_; }; + const VectorHitBuilderAlgorithm* algo() const { return stubsBuilder_; }; private: - VectorHitBuilderAlgorithmBase* stubsBuilder_; + const VectorHitBuilderAlgorithm * stubsBuilder_; std::string offlinestubsTag_; unsigned int maxOfflinestubs_; - std::string algoTag_; + edm::ESGetToken<VectorHitBuilderAlgorithm, TkPhase2OTCPERecord> stubsBuilderToken_; edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer_; - bool readytobuild_; + }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 3d8f3dd9d3575..ac3d944ba5307 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -41,16 +41,19 @@ SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::Para } std::unique_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce(const TkPhase2OTCPERecord& iRecord) { - std::unique_ptr<VectorHitBuilderAlgorithm> matcher = std::make_unique<VectorHitBuilderAlgorithm>(pset_); + std::unique_ptr<VectorHitBuilderAlgorithm> matcher = std::make_unique<VectorHitBuilderAlgorithm>(pset_, + &iRecord.get(geometryToken_), + &iRecord.getRecord<TrackerDigiGeometryRecord>().get(trackerTopoToken_), + &iRecord.get(cpeToken_)); - edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); +/* edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getRecord<TrackerDigiGeometryRecord>().getHandle(trackerTopoToken_); auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); matcher->initTkGeom(tGeomHandle); matcher->initTkTopo(tTopoHandle); - matcher->initCpe(ptr_phase2TrackerCPE); + matcher->initCpe(ptr_phase2TrackerCPE); */ return matcher; } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index fe3ccb1e35536..6448adf6be951 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -15,7 +15,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track VectorHitCollectionNew& vhAcc, VectorHitCollectionNew& vhRej, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) { + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const { LogDebug("VectorHitBuilderAlgorithm") << "Run VectorHitBuilderAlgorithm ... \n"; const edmNew::DetSetVector<Phase2TrackerCluster1D>* ClustersPhase2Collection = clusters.product(); @@ -101,7 +101,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding( edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, const detset& theLowerDetSet, - const detset& theUpperDetSet) { + const detset& theUpperDetSet) const { if (theLowerDetSet.size() == 1 && theUpperDetSet.size() == 1) return true; @@ -132,7 +132,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, const detset& theLowerDetSet, const detset& theUpperDetSet, - const std::vector<bool>& phase2OTClustersToSkip) { + const std::vector<bool>& phase2OTClustersToSkip) const { std::vector<std::pair<VectorHit, bool>> result; if (checkClustersCompatibilityBeforeBuilding(clusters, theLowerDetSet, theUpperDetSet)) { LogDebug("VectorHitBuilderAlgorithm") << " compatible -> continue ... " << std::endl; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 9c892f46af67b..fa54c5bd8a5d7 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -7,13 +7,22 @@ #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" -VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::ParameterSet& conf) +VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::ParameterSet& conf, + const TrackerGeometry* tkGeomProd, + const TrackerTopology* tkTopoProd, + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) : nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), barrelCut(conf.getParameter<std::vector<double> >("BarrelCut")), endcapCut(conf.getParameter<std::vector<double> >("EndcapCut")), - cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) {} + cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { -void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) { + initTkGeom(tkGeomProd); + initTkTopo(tkTopoProd); + initCpe(cpeProd); + +} + +/*void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) { // get the geometry and topology edm::ESHandle<TrackerGeometry> geomHandle; es.get<TrackerDigiGeometryRecord>().get(geomHandle); @@ -28,12 +37,12 @@ void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) { es.get<TkPhase2OTCPERecord>().get(cpeTag_, cpeHandle); initCpe(cpeHandle.product()); } - -void VectorHitBuilderAlgorithmBase::initTkGeom(edm::ESHandle<TrackerGeometry> tkGeomHandle) { - theTkGeom = tkGeomHandle.product(); +*/ +void VectorHitBuilderAlgorithmBase::initTkGeom(const TrackerGeometry* tkGeomProd) { + theTkGeom = tkGeomProd; } -void VectorHitBuilderAlgorithmBase::initTkTopo(edm::ESHandle<TrackerTopology> tkTopoHandle) { - theTkTopo = tkTopoHandle.product(); +void VectorHitBuilderAlgorithmBase::initTkTopo(const TrackerTopology* tkTopoProd) { + theTkTopo = tkTopoProd; } void VectorHitBuilderAlgorithmBase::initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) { cpe = cpeProd; @@ -42,7 +51,7 @@ void VectorHitBuilderAlgorithmBase::initCpe(const ClusterParameterEstimator<Phas double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit*& geomDetUnit_low, const Point3DBase<float, LocalTag>& lPosClu_low, const PixelGeomDetUnit*& geomDetUnit_upp, - const Point3DBase<float, LocalTag>& lPosClu_upp) { + const Point3DBase<float, LocalTag>& lPosClu_upp) const { double parallCorr = 0.0; Global3DPoint origin(0, 0, 0); Global3DPoint gPosClu_low = geomDetUnit_low->surface().toGlobal(lPosClu_low); @@ -61,7 +70,7 @@ double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomD return parallCorr; } -void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) { +void VectorHitBuilderAlgorithmBase::printClusters (const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) const { int nCluster = 0; int numberOfDSV = 0; edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator DSViter; @@ -84,7 +93,7 @@ void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Pha LogDebug("VectorHitBuilder") << " Number of input clusters: " << nCluster << std::endl; } -void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* clustIt) { +void VectorHitBuilderAlgorithmBase::printCluster (const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* clustIt) const { if (!geomDetUnit) return; const PixelGeomDetUnit* pixelGeomDetUnit = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc index 0f8ce6b7fac77..0e2f0f172e89c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc @@ -1,14 +1,11 @@ #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")), maxOfflinestubs_(conf.getParameter<int>("maxVectorHits")), - algoTag_(conf.getParameter<std::string>("Algorithm")), - //_clusterProducer(conf.getParameter<edm::InputTag>("Clusters")), - readytobuild_(false) { + stubsBuilderToken_(esConsumes(conf.getParameter<edm::ESInputTag>("Algorithm"))){ clusterProducer_ = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>(edm::InputTag(conf.getParameter<std::string>("Clusters"))); @@ -16,7 +13,8 @@ VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersRejected"); produces<VectorHitCollectionNew>(offlinestubsTag_ + "Accepted"); produces<VectorHitCollectionNew>(offlinestubsTag_ + "Rejected"); - setupAlgorithm(conf); + + } VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } @@ -36,11 +34,8 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu std::unique_ptr<VectorHitCollectionNew> outputVHAccepted(new VectorHitCollectionNew()); std::unique_ptr<VectorHitCollectionNew> outputVHRejected(new VectorHitCollectionNew()); - if (readytobuild_) - stubsBuilder_->initialize(es); - else - edm::LogError("VectorHitBuilderEDProducer") << "Impossible initialization of builder!!"; + stubsBuilder_ = &es.getData(stubsBuilderToken_); // check on the input clusters stubsBuilder_->printClusters(*clustersHandle); @@ -57,42 +52,20 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << *vh << std::endl; } } - /* - if(numberOfVectorHits > _maxOfflinestubs) { - edm::LogError("VectorHitBuilderEDProducer") << "Limit on the number of stubs exceeded. An empty output collection will be produced instead.\n"; - VectorHitCollectionNew empty; - empty.swap(outputAcc); - } -*/ // write output to file event.put(std::move(outputClustersAccepted), "ClustersAccepted"); event.put(std::move(outputClustersRejected), "ClustersRejected"); event.put(std::move(outputVHAccepted), offlinestubsTag_ + "Accepted"); event.put(std::move(outputVHRejected), offlinestubsTag_ + "Rejected"); - // LogDebug("VectorHitBuilderEDProducer") << " Executing " << _algoTag << " resulted in " << numberOfVectorHits << "."; LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n"; } -void VectorHitBuilderEDProducer::setupAlgorithm(edm::ParameterSet const& conf) { - if (algoTag_ == "VectorHitBuilderAlgorithm") { - stubsBuilder_ = new VectorHitBuilderAlgorithm(conf); - readytobuild_ = true; - } else { - edm::LogError("VectorHitBuilderEDProducer") << " Choice " << algoTag_ << " is invalid.\n"; - readytobuild_ = false; - } -} - void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej) { - if (!readytobuild_) { - edm::LogError("VectorHitBuilderEDProducer") << " No stub builder algorithm was found - cannot run!"; - return; - } stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); } @@ -100,7 +73,7 @@ void VectorHitBuilderEDProducer::fillDescriptions(edm::ConfigurationDescriptions edm::ParameterSetDescription desc; desc.add<std::string>("offlinestubs", "vectorHits"); desc.add<int>("maxVectorHits", 999999999); - desc.add<std::string>("Algorithm", "VectorHitBuilderAlgorithm"); + desc.add<edm::ESInputTag>("Algorithm", edm::ESInputTag("","SiPhase2VectorHitMatcher")); desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); desc.add<std::vector<double>>("BarrelCut", { From efcebdeb203586d49c1fa58e3af5d5b9637c041d Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 4 Sep 2020 17:17:38 -0500 Subject: [PATCH 375/778] clean file structure of the EDProducers --- .../interface/VectorHitBuilderEDProducer.h | 43 --- .../plugins/SealModules.cc | 8 - .../src/VectorHitBuilderAlgorithm.cc | 4 +- .../src/VectorHitBuilderEDProducer.cc | 103 ------ .../test/BuildFile.xml | 2 - .../test/ClustersValidationTGraph.cc | 14 +- .../test/VectorHitsValidation.cc | 15 + .../test/VectorHitsValidation.h | 4 + .../interface/SeedingOTEDProducer.h | 95 ------ .../TkSeedGenerator/plugins/SealModules.cc | 2 - .../src/SeedingOTEDProducer.cc | 312 ------------------ 11 files changed, 33 insertions(+), 569 deletions(-) delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc delete mode 100644 RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h delete mode 100644 RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h deleted file mode 100644 index 0bbc94142534d..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h +++ /dev/null @@ -1,43 +0,0 @@ -//--------------------------------------------------------------------------- -// class VectorHitBuilderEDProducer -// author: ebrondol,nathera -// date: May, 2015 -//--------------------------------------------------------------------------- - -#ifndef RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitBuilderEDProducer_h -#define RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitBuilderEDProducer_h - -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h" -#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" -#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" -#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" - -#include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> -#include <FWCore/ParameterSet/interface/ParameterSetDescription.h> - -class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { -public: - explicit VectorHitBuilderEDProducer(const edm::ParameterSet&); - ~VectorHitBuilderEDProducer() override; - void produce(edm::Event&, const edm::EventSetup&) override; - void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, - VectorHitCollectionNew& outputAcc, - VectorHitCollectionNew& outputRej); - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - const VectorHitBuilderAlgorithm* algo() const { return stubsBuilder_; }; - -private: - const VectorHitBuilderAlgorithm * stubsBuilder_; - std::string offlinestubsTag_; - unsigned int maxOfflinestubs_; - edm::ESGetToken<VectorHitBuilderAlgorithm, TkPhase2OTCPERecord> stubsBuilderToken_; - edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer_; - -}; - -#endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc deleted file mode 100644 index 784c27e17a331..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SealModules.cc +++ /dev/null @@ -1,8 +0,0 @@ - -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Utilities/interface/typelookup.h" -#include "FWCore/Framework/interface/ModuleFactory.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" - -DEFINE_FWK_MODULE(VectorHitBuilderEDProducer); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 6448adf6be951..efe23608bdfe3 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -254,7 +254,7 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, //printCluster(stack->lowerDet(),&*lower); //printCluster(stack->upperDet(),&*upper); - const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); + const PixelGeomDetUnit* geomDetLower = static_cast<const PixelGeomDetUnit*>(stack->lowerDet()); const PixelGeomDetUnit* geomDetUpper = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); auto&& lparamsLower = cpe->localParameters(*lower, *geomDetLower); // x, y, z, e2_xx, e2_xy, e2_yy @@ -400,5 +400,3 @@ void VectorHitBuilderAlgorithm::fit(const std::vector<float>& x, dir = LocalVector(slope, 0., -1.); } } -#include "FWCore/Utilities/interface/typelookup.h" -TYPELOOKUP_DATA_REG(VectorHitBuilderAlgorithm); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc deleted file mode 100644 index 0e2f0f172e89c..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderEDProducer.cc +++ /dev/null @@ -1,103 +0,0 @@ -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderEDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) - : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")), - maxOfflinestubs_(conf.getParameter<int>("maxVectorHits")), - stubsBuilderToken_(esConsumes(conf.getParameter<edm::ESInputTag>("Algorithm"))){ - clusterProducer_ = - consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>(edm::InputTag(conf.getParameter<std::string>("Clusters"))); - - produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersAccepted"); - produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersRejected"); - produces<VectorHitCollectionNew>(offlinestubsTag_ + "Accepted"); - produces<VectorHitCollectionNew>(offlinestubsTag_ + "Rejected"); - - -} - -VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } - -void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { - LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin"; - - // get input clusters data - edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clustersHandle; - event.getByToken(clusterProducer_, clustersHandle); - - // create the final output collection - std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersAccepted( - new edmNew::DetSetVector<Phase2TrackerCluster1D>); - std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersRejected( - new edmNew::DetSetVector<Phase2TrackerCluster1D>); - std::unique_ptr<VectorHitCollectionNew> outputVHAccepted(new VectorHitCollectionNew()); - std::unique_ptr<VectorHitCollectionNew> outputVHRejected(new VectorHitCollectionNew()); - - - stubsBuilder_ = &es.getData(stubsBuilderToken_); - // check on the input clusters - stubsBuilder_->printClusters(*clustersHandle); - - // running the stub building algorithm - //ERICA::output should be moved in the different algo classes? - run(clustersHandle, *outputClustersAccepted, *outputClustersRejected, *outputVHAccepted, *outputVHRejected); - - unsigned int numberOfVectorHits = 0; - edmNew::DetSetVector<VectorHit>::const_iterator DSViter; - for (DSViter = (*outputVHAccepted).begin(); DSViter != (*outputVHAccepted).end(); DSViter++) { - edmNew::DetSet<VectorHit>::const_iterator vh; - for (vh = DSViter->begin(); vh != DSViter->end(); ++vh) { - numberOfVectorHits++; - LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << *vh << std::endl; - } - } - // write output to file - event.put(std::move(outputClustersAccepted), "ClustersAccepted"); - event.put(std::move(outputClustersRejected), "ClustersRejected"); - event.put(std::move(outputVHAccepted), offlinestubsTag_ + "Accepted"); - event.put(std::move(outputVHRejected), offlinestubsTag_ + "Rejected"); - - LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n"; -} - -void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, - edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, - VectorHitCollectionNew& outputAcc, - VectorHitCollectionNew& outputRej) { - - stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); -} -void VectorHitBuilderEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - edm::ParameterSetDescription desc; - desc.add<std::string>("offlinestubs", "vectorHits"); - desc.add<int>("maxVectorHits", 999999999); - desc.add<edm::ESInputTag>("Algorithm", edm::ESInputTag("","SiPhase2VectorHitMatcher")); - desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); - desc.add<std::vector<double>>("BarrelCut", - { - 0.0, - 0.05, - 0.06, - 0.08, - 0.09, - 0.12, - 0.2, - }); - desc.add<std::string>("Clusters", "siPhase2Clusters"); - desc.add<int>("maxVectorHitsInAStack", 999); - desc.add<std::vector<double>>("EndcapCut", - { - 0.0, - 0.1, - 0.1, - 0.1, - 0.1, - 0.1, - }); - descriptions.add("siPhase2VectorHits", desc); -} - -#include "FWCore/Utilities/interface/typelookup.h" -TYPELOOKUP_DATA_REG(VectorHitBuilderEDProducer); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml index 3270d03161a4b..104d876b608e1 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml @@ -24,9 +24,7 @@ <use name="RecoLocalTracker/SiPhase2VectorHitBuilder"/> <library file="VectorHitsValidation.cc" name="VectorHitsBuilderValidation"> <flags EDM_PLUGIN="1"/> - <flags CXXFLAGS="-g3"/> </library> <library file="ClustersValidationTGraph.cc" name="ClustersValidationTGraph"> <flags EDM_PLUGIN="1"/> - <flags CXXFLAGS="-g3"/> </library> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc index b6ffb8e031f64..2c27178e0e6a9 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc @@ -12,6 +12,9 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" @@ -74,13 +77,13 @@ class Phase2TrackerClusterizerValidationTGraph : public edm::EDAnalyzer { void beginJob(); void endJob(); void analyze(const edm::Event&, const edm::EventSetup&); + static void fillDescriptions(edm::ConfigurationDescriptions&); private: std::map<unsigned int, ClusterHistos>::iterator createLayerHistograms(unsigned int); unsigned int getLayerNumber(const DetId&, const TrackerTopology*); unsigned int getModuleNumber(const DetId&, const TrackerTopology*); unsigned int getSimTrackId(const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >&, const DetId&, unsigned int); - edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; edm::EDGetTokenT<edm::PSimHitContainer> simHitsToken_; @@ -615,4 +618,13 @@ unsigned int Phase2TrackerClusterizerValidationTGraph::getSimTrackId( return 0; } +void Phase2TrackerClusterizerValidationTGraph::fillDescriptions(edm::ConfigurationDescriptions & descriptions){ + + edm::ParameterSetDescription desc; + desc.add<std::string>("src","siPhase2Clusters"); + desc.add<edm::InputTag>("links",edm::InputTag("simSiPixelDigis", "Tracker")); + descriptions.add("phase2TrackerClusterizerValidationTGraph",desc); +} + + DEFINE_FWK_MODULE(Phase2TrackerClusterizerValidationTGraph); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 957dd83bd1f49..f555338604e0e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -1212,4 +1212,19 @@ void VectorHitsBuilderValidation::printCluster(const GeomDetUnit* geomDetUnit, c return; } +void VectorHitsBuilderValidation::fillDescriptions(edm::ConfigurationDescriptions & descriptions){ + + edm::ParameterSetDescription desc; + desc.add<std::string>("src","siPhase2Clusters"); + desc.add<edm::InputTag>("links",edm::InputTag("simSiPixelDigis", "Tracker")); + desc.add<edm::InputTag>("VH_acc",edm::InputTag("siPhase2VectorHits", "vectorHitsAccepted")); + desc.add<edm::InputTag>("VH_rej",edm::InputTag("siPhase2VectorHits", "vectorHitsRejected")); + desc.add<edm::ESInputTag>("CPE",edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); + desc.add<edm::InputTag>("trackingParticleSrc",edm::InputTag("mix", "MergedTrackTruth")); + descriptions.add("vectorHitsBuilderValidation",desc); +} + + + + DEFINE_FWK_MODULE(VectorHitsBuilderValidation); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index c8789005d222e..c29d5849a1d81 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -12,6 +12,9 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" @@ -86,6 +89,7 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { void endJob(); void analyze(const edm::Event&, const edm::EventSetup&); + static void fillDescriptions(edm::ConfigurationDescriptions&); private: std::map<unsigned int, VHHistos>::iterator createLayerHistograms(unsigned int); void CreateVHsXYGraph(const std::vector<Global3DPoint>, const std::vector<Global3DVector>); diff --git a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h b/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h deleted file mode 100644 index 76ef523f69194..0000000000000 --- a/RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h +++ /dev/null @@ -1,95 +0,0 @@ -//--------------------------------------------------------------------------- -// class SeedingOTEDProducer -// author: ebrondol -// date: July, 2016 -//--------------------------------------------------------------------------- - -#ifndef RecoTracker_TkSeedGenerator_SeedingOTEDProducer_h -#define RecoTracker_TkSeedGenerator_SeedingOTEDProducer_h - -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" -#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" -#include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" - -#include "RecoTracker/Record/interface/CkfComponentsRecord.h" -#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" -#include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h" -#include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h" -#include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h" - -#include "Geometry/Records/interface/TrackerTopologyRcd.h" - -#include "FWCore/Utilities/interface/ESGetToken.h" - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetup.h" - -class TrajectoryStateUpdator; - -class SeedingOTEDProducer : public edm::stream::EDProducer<> { -public: - explicit SeedingOTEDProducer(const edm::ParameterSet&); - ~SeedingOTEDProducer() override; - void produce(edm::Event&, const edm::EventSetup&) override; - - static void fillDescriptions(edm::ConfigurationDescriptions&); - - TrajectorySeedCollection run(edm::Handle<VectorHitCollectionNew>); - unsigned int checkLayer(unsigned int iidd); - std::vector<VectorHit> collectVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); - void printVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); - const TrajectoryStateOnSurface buildInitialTSOS(VectorHit&); - AlgebraicSymMatrix assign44To55(AlgebraicSymMatrix); - std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, - const Propagator&, - const TrackingRecHit& hit); - float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot); - float computeInverseMomentumError(VectorHit& vh, - const float globalTheta, - const double sigmaZ_beamSpot, - const double transverseMomentum); - - TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, - const edm::OwnVector<TrackingRecHit>& container, - const DetId& id, - const Propagator& prop); - - struct isInvalid { - bool operator()(const TrajectoryMeasurement& measurement) { - return (((measurement).recHit() == nullptr) || !((measurement).recHit()->isValid()) || - !((measurement).updatedState().isValid())); - } - }; - -private: - edm::EDGetTokenT<VectorHitCollectionNew> vhProducerToken_; - const TrackerTopology* tkTopo_; - const MeasurementTracker* measurementTracker_; - const LayerMeasurements* layerMeasurements_; - const MeasurementEstimator* estimator_; - const Propagator* propagator_; - const MagneticField* magField_; - const TrajectoryStateUpdator* updator_; - const edm::EDGetTokenT<MeasurementTrackerEvent> tkMeasEventToken_; - edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_; - const reco::BeamSpot* beamSpot_; - std::string updatorName_; - - edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; - edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; - edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_; - edm::ESGetToken<TrajectoryStateUpdator, TrackingComponentsRecord> updatorToken_; - edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> measurementTrackerToken_; - edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> estToken_; - -}; - -#endif diff --git a/RecoTracker/TkSeedGenerator/plugins/SealModules.cc b/RecoTracker/TkSeedGenerator/plugins/SealModules.cc index 58fa1e15580b3..ee7dd08cc5e6c 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SealModules.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SealModules.cc @@ -40,5 +40,3 @@ using SeedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer = SeedCreatorFromRegionHitsEDProducerT<SeedFromConsecutiveHitsTripletOnlyCreator>; DEFINE_FWK_MODULE(SeedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer); -#include "RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h" -DEFINE_FWK_MODULE(SeedingOTEDProducer); diff --git a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc deleted file mode 100644 index d2ca0fa2ab34b..0000000000000 --- a/RecoTracker/TkSeedGenerator/src/SeedingOTEDProducer.cc +++ /dev/null @@ -1,312 +0,0 @@ -#include "RecoTracker/TkSeedGenerator/interface/SeedingOTEDProducer.h" -#include "FWCore/Framework/interface/Event.h" - - -#include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h" -#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" -#include "TrackingTools/MeasurementDet/interface/TrajectoryMeasurementGroup.h" - -#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) - : updator_(nullptr), - tkMeasEventToken_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), - topoToken_(esConsumes()), - propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial" ))), - magFieldToken_(esConsumes()), - updatorToken_(esConsumes()), - measurementTrackerToken_(esConsumes()), - estToken_(esConsumes(edm::ESInputTag("","Chi2"))) { - vhProducerToken_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); - beamSpotToken_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); - updatorName_ = conf.getParameter<std::string>("updator"); - produces<TrajectorySeedCollection>(); -} - -SeedingOTEDProducer::~SeedingOTEDProducer() { } - -void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - edm::ParameterSetDescription desc; - desc.add<edm::InputTag>("src", edm::InputTag("siPhase2VectorHits", "vectorHitsAccepted")); - desc.add<edm::InputTag>("trackerEvent", edm::InputTag("MeasurementTrackerEvent")); - desc.add<edm::InputTag>("beamSpotLabel", edm::InputTag("offlineBeamSpot")); - desc.add<std::string>("updator", std::string("KFUpdator")); - descriptions.add("SeedingOTEDProducer", desc); -} - -void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { - std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); - - - tkTopo_ = &es.getData(topoToken_); - - edm::ESHandle<MeasurementTracker> measurementTrackerHandle; - measurementTrackerHandle = es.getHandle(measurementTrackerToken_); - measurementTracker_ = measurementTrackerHandle.product(); - - edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; - event.getByToken(tkMeasEventToken_, measurementTrackerEvent); - - LayerMeasurements layerMeasurements_(*measurementTrackerHandle, *measurementTrackerEvent); - - estimator_ = &es.getData(estToken_); - - propagator_ = &es.getData(propagatorToken_); - - magField_ = &es.getData(magFieldToken_); - - updator_ = &es.getData(updatorToken_); - - edm::Handle<reco::BeamSpot> beamSpotH; - event.getByToken(beamSpotToken_, beamSpotH); - if (beamSpotH.isValid()) { - beamSpot_ = beamSpotH.product(); - } - - // Get the vector hits - edm::Handle<VectorHitCollectionNew> vhs; - event.getByToken(vhProducerToken_, vhs); - - TrajectorySeedCollection const& tempSeeds = run(vhs); - for (TrajectorySeedCollection::const_iterator qIt = tempSeeds.begin(); qIt < tempSeeds.end(); ++qIt) { - seedsWithVHs->push_back(*qIt); - } - - seedsWithVHs->shrink_to_fit(); - event.put(std::move(seedsWithVHs)); -} - -TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { - TrajectorySeedCollection result; - - //check if all the first three layers have VHs - std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(VHs, 1); - std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(VHs, 2); - std::vector<VectorHit> vhSeedsL3 = collectVHsOnLayer(VHs, 3); - if (vhSeedsL1.empty() || vhSeedsL2.empty() || vhSeedsL3.empty()) { - return result; - } - - //seeds are built in the L3 of the OT - const BarrelDetLayer* barrelOTLayer2 = measurementTracker_->geometricSearchTracker()->tobLayers().at(1); - - //the search propag directiondepend on the sign of signZ*signPz, while the building is always the contrary - Propagator* searchingPropagator = &*propagator_->clone(); - Propagator* buildingPropagator = &*propagator_->clone(); - buildingPropagator->setPropagationDirection(alongMomentum); - - for (auto hitL3 : vhSeedsL3) { - //building a tsos out of a VectorHit - const TrajectoryStateOnSurface initialTSOS = buildInitialTSOS(hitL3); - float signZ = copysign(1.0, initialTSOS.globalPosition().z()); - float signPz = copysign(1.0, initialTSOS.globalMomentum().z()); - - //set the direction of the propagator - if (signZ * signPz > 0.0) - searchingPropagator->setPropagationDirection(oppositeToMomentum); - if (signZ * signPz < 0.0) - searchingPropagator->setPropagationDirection(alongMomentum); - - //find vHits in layer 2 - std::vector<TrajectoryMeasurement> measurementsL2 = - layerMeasurements_->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator_); - - //other options - //LayerMeasurements::SimpleHitContainer hits; - //layerMeasurements->recHits(hits, *barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); - //auto && measurementsL2G = layerMeasurements->groupedMeasurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); - - std::vector<TrajectoryMeasurement>::iterator measurementsL2end = - std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid()); - measurementsL2.erase(measurementsL2end, measurementsL2.end()); - - if (!measurementsL2.empty()) { - //not sure if building it everytime takes time/memory - const DetLayer* barrelOTLayer1 = measurementTracker_->geometricSearchTracker()->tobLayers().at(0); - - for (const auto& mL2 : measurementsL2) { - const TrackingRecHit* hitL2 = mL2.recHit().get(); - - //propagate to the L2 and update the TSOS - std::pair<bool, TrajectoryStateOnSurface> updatedTSOS = - propagateAndUpdate(initialTSOS, *searchingPropagator, *hitL2); - if (!updatedTSOS.first) - continue; - - //searching possible VHs in L1 - std::vector<TrajectoryMeasurement> measurementsL1 = - layerMeasurements_->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator_); - std::vector<TrajectoryMeasurement>::iterator measurementsL1end = - std::remove_if(measurementsL1.begin(), measurementsL1.end(), isInvalid()); - measurementsL1.erase(measurementsL1end, measurementsL1.end()); - - if (!measurementsL1.empty()) { - for (const auto& mL1 : measurementsL1) { - const TrackingRecHit* hitL1 = mL1.recHit().get(); - - //propagate to the L1 and update the TSOS - std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL1 = - propagateAndUpdate(updatedTSOS.second, *searchingPropagator, *hitL1); - if (!updatedTSOSL1.first) - continue; - - edm::OwnVector<TrackingRecHit> container; - container.push_back(hitL1->clone()); - container.push_back(hitL2->clone()); - container.push_back(hitL3.clone()); - - //building trajectory inside-out - if (searchingPropagator->propagationDirection() == alongMomentum) { - buildingPropagator->setPropagationDirection(oppositeToMomentum); - } else if (searchingPropagator->propagationDirection() == oppositeToMomentum) { - buildingPropagator->setPropagationDirection(alongMomentum); - } - - updatedTSOSL1.second.rescaleError(100); - - TrajectoryStateOnSurface updatedTSOSL1_final = updator_->update(updatedTSOSL1.second, *hitL1); - if UNLIKELY (!updatedTSOSL1_final.isValid()) - continue; - std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = - propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); - std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = - propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); - TrajectorySeed ts = - createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(), *buildingPropagator); - result.push_back(ts); - } - } - } - } - } - - return result; -} - -unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { - StripSubdetector strip = StripSubdetector(iidd); - unsigned int subid = strip.subdetId(); - if (subid == StripSubdetector::TIB || subid == StripSubdetector::TOB) { - return tkTopo_->layer(iidd); - } - return 0; -} - -std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<VectorHitCollectionNew> VHs, - unsigned int layerNumber) { - const VectorHitCollectionNew& input = *VHs; - std::vector<VectorHit> VHsOnLayer; - if (!input.empty()) { - for (auto DSViter : input) { - if (checkLayer(DSViter.id()) == layerNumber) { - for (const auto& vh : DSViter) { - VHsOnLayer.push_back(vh); - } - } - } - } - - return VHsOnLayer; -} - -void SeedingOTEDProducer::printVHsOnLayer(edm::Handle<VectorHitCollectionNew> VHs, unsigned int layerNumber) { - const VectorHitCollectionNew& input = *VHs; - if (!input.empty()) { - for (auto DSViter : input) { - for (const auto& vh : DSViter) { - if (checkLayer(DSViter.id()) == layerNumber) - std::cout << " VH in layer " << layerNumber << " >> " << vh << std::endl; - } - } - } else { - std::cout << " No VHs in layer " << layerNumber << "." << std::endl; - } -} - -const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& vHit) { - // having fun with theta - Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); - float theta = gv.theta(); - // gv transform to local (lv) - const Local3DVector lv(vHit.det()->surface().toLocal(gv)); - - //Helper class to access momentum of VH - VectorHitMomentumHelper vhMomHelper(magField_); - - - - //FIXME::charge is fine 1 every two times!! - int charge = 1; - float p = vhMomHelper.momentum(vHit); - float x = vHit.localPosition().x(); - float y = vHit.localPosition().y(); - float dx = vHit.localDirection().x(); - // for dy use second component of the lv renormalized to the z component - float dy = lv.y() / lv.z(); - - // Pz and Dz should have the same sign - float signPz = copysign(1.0, vHit.globalPosition().z()); - - LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); - AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); - // set the error on 1/p - mat[0][0] = pow( - computeInverseMomentumError(vHit, theta, beamSpot_->sigmaZ(), vhMomHelper.transverseMomentum(vHit)), 2); - - //building tsos - LocalTrajectoryError lterr(asSMatrix<5>(mat)); - const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit.det()->surface(), magField_); - - return tsos; -} - -AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) { - if (mat44.num_row() != 4 || mat44.num_col() != 4) - assert("Wrong dimension! This should be a 4x4 matrix!"); - - AlgebraicSymMatrix result(5, 0); - for (int i = 1; i < 5; i++) { - for (int j = 1; j < 5; j++) { - result[i][j] = mat44[i - 1][j - 1]; - } - } - return result; -} - -std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdate( - const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) { - TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); - TrajectoryStateOnSurface updatedTSOS = updator_->update(propTSOS, hit); - if UNLIKELY (!updatedTSOS.isValid()) - return std::make_pair(false, updatedTSOS); - return std::make_pair(true, updatedTSOS); -} - -float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) { - double derivative = - vh.globalPosition().perp() / (pow(vh.globalPosition().z(), 2) + pow(vh.globalPosition().perp(), 2)); - double derivative2 = pow(derivative, 2); - return pow(derivative2 * vh.lowerGlobalPosErr().czz() + derivative2 * pow(sigmaZ_beamSpot, 2), 0.5); -} - -float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, - const float globalTheta, - const double sigmaZ_beamSpot, - const double transverseMomentum) { - //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12) - float varianceInverseTransvMomentum = 1. / 12; - float derivativeTheta2 = pow(cos(globalTheta) / transverseMomentum, 2); - float derivativeInverseTransvMomentum2 = pow(sin(globalTheta), 2); - float thetaError = computeGlobalThetaError(vh, sigmaZ_beamSpot); - return pow(derivativeTheta2 * pow(thetaError, 2) + derivativeInverseTransvMomentum2 * varianceInverseTransvMomentum, - 0.5); -} - -TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& tsos, - const edm::OwnVector<TrackingRecHit>& container, - const DetId& id, - const Propagator& prop) { - PTrajectoryStateOnDet seedTSOS = trajectoryStateTransform::persistentState(tsos, id.rawId()); - return TrajectorySeed(seedTSOS, container, prop.propagationDirection()); -} From 727cb464776fa5b6332b670b6bd41b656c9fc6ae Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 4 Sep 2020 17:18:04 -0500 Subject: [PATCH 376/778] add new files from last step --- .../plugins/VectorHitBuilderEDProducer.cc | 138 ++++++ .../src/ES_VectorHitBuilderAlgorithm.cc | 4 + .../plugins/SeedingOTEDProducer.cc | 397 ++++++++++++++++++ 3 files changed, 539 insertions(+) create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/src/ES_VectorHitBuilderAlgorithm.cc create mode 100644 RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc new file mode 100644 index 0000000000000..321f034532631 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -0,0 +1,138 @@ +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h" +#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" + +#include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> +#include <FWCore/ParameterSet/interface/ParameterSetDescription.h> + +class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { +public: + explicit VectorHitBuilderEDProducer(const edm::ParameterSet&); + ~VectorHitBuilderEDProducer( ) override; + void produce(edm::Event&, const edm::EventSetup&) override; + void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, + VectorHitCollectionNew& outputAcc, + VectorHitCollectionNew& outputRej); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + const VectorHitBuilderAlgorithm* algo() const { return stubsBuilder_; }; + +private: + const VectorHitBuilderAlgorithm * stubsBuilder_; + std::string offlinestubsTag_; + unsigned int maxOfflinestubs_; + edm::ESGetToken<VectorHitBuilderAlgorithm, TkPhase2OTCPERecord> stubsBuilderToken_; + edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer_; + +}; + +VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } + + +VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) + : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")), + maxOfflinestubs_(conf.getParameter<int>("maxVectorHits")), + stubsBuilderToken_(esConsumes(conf.getParameter<edm::ESInputTag>("Algorithm"))){ + clusterProducer_ = + consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>(edm::InputTag(conf.getParameter<std::string>("Clusters"))); + + produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersAccepted"); + produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersRejected"); + produces<VectorHitCollectionNew>(offlinestubsTag_ + "Accepted"); + produces<VectorHitCollectionNew>(offlinestubsTag_ + "Rejected"); + + +} + + +void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { + LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin"; + + // get input clusters data + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clustersHandle; + event.getByToken(clusterProducer_, clustersHandle); + + // create the final output collection + std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersAccepted( + new edmNew::DetSetVector<Phase2TrackerCluster1D>); + std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersRejected( + new edmNew::DetSetVector<Phase2TrackerCluster1D>); + std::unique_ptr<VectorHitCollectionNew> outputVHAccepted(new VectorHitCollectionNew()); + std::unique_ptr<VectorHitCollectionNew> outputVHRejected(new VectorHitCollectionNew()); + + + stubsBuilder_ = &es.getData(stubsBuilderToken_); + // check on the input clusters + stubsBuilder_->printClusters(*clustersHandle); + + // running the stub building algorithm + //ERICA::output should be moved in the different algo classes? + run(clustersHandle, *outputClustersAccepted, *outputClustersRejected, *outputVHAccepted, *outputVHRejected); + + unsigned int numberOfVectorHits = 0; + edmNew::DetSetVector<VectorHit>::const_iterator DSViter; + for (DSViter = (*outputVHAccepted).begin(); DSViter != (*outputVHAccepted).end(); DSViter++) { + edmNew::DetSet<VectorHit>::const_iterator vh; + for (vh = DSViter->begin(); vh != DSViter->end(); ++vh) { + numberOfVectorHits++; + LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << *vh << std::endl; + } + } + // write output to file + event.put(std::move(outputClustersAccepted), "ClustersAccepted"); + event.put(std::move(outputClustersRejected), "ClustersRejected"); + event.put(std::move(outputVHAccepted), offlinestubsTag_ + "Accepted"); + event.put(std::move(outputVHRejected), offlinestubsTag_ + "Rejected"); + + LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n"; +} + +void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, + edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, + VectorHitCollectionNew& outputAcc, + VectorHitCollectionNew& outputRej) { + + stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); +} +void VectorHitBuilderEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add<std::string>("offlinestubs", "vectorHits"); + desc.add<int>("maxVectorHits", 999999999); + desc.add<edm::ESInputTag>("Algorithm", edm::ESInputTag("","SiPhase2VectorHitMatcher")); + desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); + desc.add<std::vector<double>>("BarrelCut", + { + 0.0, + 0.05, + 0.06, + 0.08, + 0.09, + 0.12, + 0.2, + }); + desc.add<std::string>("Clusters", "siPhase2Clusters"); + desc.add<int>("maxVectorHitsInAStack", 999); + desc.add<std::vector<double>>("EndcapCut", + { + 0.0, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + }); + descriptions.add("siPhase2VectorHits", desc); +} +DEFINE_FWK_MODULE(VectorHitBuilderEDProducer); +#include "FWCore/Utilities/interface/typelookup.h" +TYPELOOKUP_DATA_REG(VectorHitBuilderEDProducer); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/ES_VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/ES_VectorHitBuilderAlgorithm.cc new file mode 100644 index 0000000000000..7bbb14a2b4f16 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/ES_VectorHitBuilderAlgorithm.cc @@ -0,0 +1,4 @@ +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(VectorHitBuilderAlgorithm); diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc new file mode 100644 index 0000000000000..6a298388a85eb --- /dev/null +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -0,0 +1,397 @@ + +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/Event.h" + +#include "DataFormats/BeamSpot/interface/BeamSpot.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" +#include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" + +#include "RecoTracker/Record/interface/CkfComponentsRecord.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" +#include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h" +#include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h" +#include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h" + +#include "Geometry/Records/interface/TrackerTopologyRcd.h" + +#include "FWCore/Utilities/interface/ESGetToken.h" + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/EventSetup.h" + + +#include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h" +#include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" +#include "TrackingTools/MeasurementDet/interface/TrajectoryMeasurementGroup.h" + +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +class TrajectoryStateUpdator; + +class SeedingOTEDProducer : public edm::stream::EDProducer<> { +public: + explicit SeedingOTEDProducer(const edm::ParameterSet&); + ~SeedingOTEDProducer() override; + void produce(edm::Event&, const edm::EventSetup&) override; + + static void fillDescriptions(edm::ConfigurationDescriptions&); + + TrajectorySeedCollection run(edm::Handle<VectorHitCollectionNew>); + unsigned int checkLayer(unsigned int iidd); + std::vector<VectorHit> collectVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); + void printVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); + const TrajectoryStateOnSurface buildInitialTSOS(VectorHit&); + AlgebraicSymMatrix assign44To55(AlgebraicSymMatrix); + std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, + const Propagator&, + const TrackingRecHit& hit); + float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot); + float computeInverseMomentumError(VectorHit& vh, + const float globalTheta, + const double sigmaZ_beamSpot, + const double transverseMomentum); + + TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, + const edm::OwnVector<TrackingRecHit>& container, + const DetId& id, + const Propagator& prop); + + struct isInvalid { + bool operator()(const TrajectoryMeasurement& measurement) { + return (((measurement).recHit() == nullptr) || !((measurement).recHit()->isValid()) || + !((measurement).updatedState().isValid())); + } + }; + +private: + edm::EDGetTokenT<VectorHitCollectionNew> vhProducerToken_; + const TrackerTopology* tkTopo_; + const MeasurementTracker* measurementTracker_; + const LayerMeasurements* layerMeasurements_; + const MeasurementEstimator* estimator_; + const Propagator* propagator_; + const MagneticField* magField_; + const TrajectoryStateUpdator* updator_; + const edm::EDGetTokenT<MeasurementTrackerEvent> tkMeasEventToken_; + edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_; + const reco::BeamSpot* beamSpot_; + std::string updatorName_; + + edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; + edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_; + edm::ESGetToken<TrajectoryStateUpdator, TrackingComponentsRecord> updatorToken_; + edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> measurementTrackerToken_; + edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> estToken_; + +}; + +SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) + : updator_(nullptr), + tkMeasEventToken_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), + topoToken_(esConsumes()), + propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial" ))), + magFieldToken_(esConsumes()), + updatorToken_(esConsumes()), + measurementTrackerToken_(esConsumes()), + estToken_(esConsumes(edm::ESInputTag("","Chi2"))) { + vhProducerToken_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); + beamSpotToken_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); + updatorName_ = conf.getParameter<std::string>("updator"); + produces<TrajectorySeedCollection>(); +} + +SeedingOTEDProducer::~SeedingOTEDProducer() { } + +void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add<edm::InputTag>("src", edm::InputTag("siPhase2VectorHits", "vectorHitsAccepted")); + desc.add<edm::InputTag>("trackerEvent", edm::InputTag("MeasurementTrackerEvent")); + desc.add<edm::InputTag>("beamSpotLabel", edm::InputTag("offlineBeamSpot")); + desc.add<std::string>("updator", std::string("KFUpdator")); + descriptions.add("SeedingOTEDProducer", desc); +} + +void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { + std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); + + + tkTopo_ = &es.getData(topoToken_); + + edm::ESHandle<MeasurementTracker> measurementTrackerHandle; + measurementTrackerHandle = es.getHandle(measurementTrackerToken_); + measurementTracker_ = measurementTrackerHandle.product(); + + edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; + event.getByToken(tkMeasEventToken_, measurementTrackerEvent); + + LayerMeasurements layerMeasurements_(*measurementTrackerHandle, *measurementTrackerEvent); + + estimator_ = &es.getData(estToken_); + + propagator_ = &es.getData(propagatorToken_); + + magField_ = &es.getData(magFieldToken_); + + updator_ = &es.getData(updatorToken_); + + edm::Handle<reco::BeamSpot> beamSpotH; + event.getByToken(beamSpotToken_, beamSpotH); + if (beamSpotH.isValid()) { + beamSpot_ = beamSpotH.product(); + } + + // Get the vector hits + edm::Handle<VectorHitCollectionNew> vhs; + event.getByToken(vhProducerToken_, vhs); + + TrajectorySeedCollection const& tempSeeds = run(vhs); + for (TrajectorySeedCollection::const_iterator qIt = tempSeeds.begin(); qIt < tempSeeds.end(); ++qIt) { + seedsWithVHs->push_back(*qIt); + } + + seedsWithVHs->shrink_to_fit(); + event.put(std::move(seedsWithVHs)); +} + +TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { + TrajectorySeedCollection result; + + //check if all the first three layers have VHs + std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(VHs, 1); + std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(VHs, 2); + std::vector<VectorHit> vhSeedsL3 = collectVHsOnLayer(VHs, 3); + if (vhSeedsL1.empty() || vhSeedsL2.empty() || vhSeedsL3.empty()) { + return result; + } + + //seeds are built in the L3 of the OT + const BarrelDetLayer* barrelOTLayer2 = measurementTracker_->geometricSearchTracker()->tobLayers().at(1); + + //the search propag directiondepend on the sign of signZ*signPz, while the building is always the contrary + Propagator* searchingPropagator = &*propagator_->clone(); + Propagator* buildingPropagator = &*propagator_->clone(); + buildingPropagator->setPropagationDirection(alongMomentum); + + for (auto hitL3 : vhSeedsL3) { + //building a tsos out of a VectorHit + const TrajectoryStateOnSurface initialTSOS = buildInitialTSOS(hitL3); + float signZ = copysign(1.0, initialTSOS.globalPosition().z()); + float signPz = copysign(1.0, initialTSOS.globalMomentum().z()); + + //set the direction of the propagator + if (signZ * signPz > 0.0) + searchingPropagator->setPropagationDirection(oppositeToMomentum); + if (signZ * signPz < 0.0) + searchingPropagator->setPropagationDirection(alongMomentum); + + //find vHits in layer 2 + std::vector<TrajectoryMeasurement> measurementsL2 = + layerMeasurements_->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator_); + + //other options + //LayerMeasurements::SimpleHitContainer hits; + //layerMeasurements->recHits(hits, *barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + //auto && measurementsL2G = layerMeasurements->groupedMeasurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); + + std::vector<TrajectoryMeasurement>::iterator measurementsL2end = + std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid()); + measurementsL2.erase(measurementsL2end, measurementsL2.end()); + + if (!measurementsL2.empty()) { + //not sure if building it everytime takes time/memory + const DetLayer* barrelOTLayer1 = measurementTracker_->geometricSearchTracker()->tobLayers().at(0); + + for (const auto& mL2 : measurementsL2) { + const TrackingRecHit* hitL2 = mL2.recHit().get(); + + //propagate to the L2 and update the TSOS + std::pair<bool, TrajectoryStateOnSurface> updatedTSOS = + propagateAndUpdate(initialTSOS, *searchingPropagator, *hitL2); + if (!updatedTSOS.first) + continue; + + //searching possible VHs in L1 + std::vector<TrajectoryMeasurement> measurementsL1 = + layerMeasurements_->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator_); + std::vector<TrajectoryMeasurement>::iterator measurementsL1end = + std::remove_if(measurementsL1.begin(), measurementsL1.end(), isInvalid()); + measurementsL1.erase(measurementsL1end, measurementsL1.end()); + + if (!measurementsL1.empty()) { + for (const auto& mL1 : measurementsL1) { + const TrackingRecHit* hitL1 = mL1.recHit().get(); + + //propagate to the L1 and update the TSOS + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL1 = + propagateAndUpdate(updatedTSOS.second, *searchingPropagator, *hitL1); + if (!updatedTSOSL1.first) + continue; + + edm::OwnVector<TrackingRecHit> container; + container.push_back(hitL1->clone()); + container.push_back(hitL2->clone()); + container.push_back(hitL3.clone()); + + //building trajectory inside-out + if (searchingPropagator->propagationDirection() == alongMomentum) { + buildingPropagator->setPropagationDirection(oppositeToMomentum); + } else if (searchingPropagator->propagationDirection() == oppositeToMomentum) { + buildingPropagator->setPropagationDirection(alongMomentum); + } + + updatedTSOSL1.second.rescaleError(100); + + TrajectoryStateOnSurface updatedTSOSL1_final = updator_->update(updatedTSOSL1.second, *hitL1); + if UNLIKELY (!updatedTSOSL1_final.isValid()) + continue; + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = + propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = + propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); + TrajectorySeed ts = + createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(), *buildingPropagator); + result.push_back(ts); + } + } + } + } + } + + return result; +} + +unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { + StripSubdetector strip = StripSubdetector(iidd); + unsigned int subid = strip.subdetId(); + if (subid == StripSubdetector::TIB || subid == StripSubdetector::TOB) { + return tkTopo_->layer(iidd); + } + return 0; +} + +std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<VectorHitCollectionNew> VHs, + unsigned int layerNumber) { + const VectorHitCollectionNew& input = *VHs; + std::vector<VectorHit> VHsOnLayer; + if (!input.empty()) { + for (auto DSViter : input) { + if (checkLayer(DSViter.id()) == layerNumber) { + for (const auto& vh : DSViter) { + VHsOnLayer.push_back(vh); + } + } + } + } + + return VHsOnLayer; +} + +void SeedingOTEDProducer::printVHsOnLayer(edm::Handle<VectorHitCollectionNew> VHs, unsigned int layerNumber) { + const VectorHitCollectionNew& input = *VHs; + if (!input.empty()) { + for (auto DSViter : input) { + for (const auto& vh : DSViter) { + if (checkLayer(DSViter.id()) == layerNumber) + std::cout << " VH in layer " << layerNumber << " >> " << vh << std::endl; + } + } + } else { + std::cout << " No VHs in layer " << layerNumber << "." << std::endl; + } +} + +const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& vHit) { + // having fun with theta + Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); + float theta = gv.theta(); + // gv transform to local (lv) + const Local3DVector lv(vHit.det()->surface().toLocal(gv)); + + //Helper class to access momentum of VH + VectorHitMomentumHelper vhMomHelper(magField_); + + + + //FIXME::charge is fine 1 every two times!! + int charge = 1; + float p = vhMomHelper.momentum(vHit); + float x = vHit.localPosition().x(); + float y = vHit.localPosition().y(); + float dx = vHit.localDirection().x(); + // for dy use second component of the lv renormalized to the z component + float dy = lv.y() / lv.z(); + + // Pz and Dz should have the same sign + float signPz = copysign(1.0, vHit.globalPosition().z()); + + LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); + AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); + // set the error on 1/p + mat[0][0] = pow( + computeInverseMomentumError(vHit, theta, beamSpot_->sigmaZ(), vhMomHelper.transverseMomentum(vHit)), 2); + + //building tsos + LocalTrajectoryError lterr(asSMatrix<5>(mat)); + const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit.det()->surface(), magField_); + + return tsos; +} + +AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) { + if (mat44.num_row() != 4 || mat44.num_col() != 4) + assert("Wrong dimension! This should be a 4x4 matrix!"); + + AlgebraicSymMatrix result(5, 0); + for (int i = 1; i < 5; i++) { + for (int j = 1; j < 5; j++) { + result[i][j] = mat44[i - 1][j - 1]; + } + } + return result; +} + +std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdate( + const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) { + TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); + TrajectoryStateOnSurface updatedTSOS = updator_->update(propTSOS, hit); + if UNLIKELY (!updatedTSOS.isValid()) + return std::make_pair(false, updatedTSOS); + return std::make_pair(true, updatedTSOS); +} + +float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) { + double derivative = + vh.globalPosition().perp() / (pow(vh.globalPosition().z(), 2) + pow(vh.globalPosition().perp(), 2)); + double derivative2 = pow(derivative, 2); + return pow(derivative2 * vh.lowerGlobalPosErr().czz() + derivative2 * pow(sigmaZ_beamSpot, 2), 0.5); +} + +float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, + const float globalTheta, + const double sigmaZ_beamSpot, + const double transverseMomentum) { + //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12) + float varianceInverseTransvMomentum = 1. / 12; + float derivativeTheta2 = pow(cos(globalTheta) / transverseMomentum, 2); + float derivativeInverseTransvMomentum2 = pow(sin(globalTheta), 2); + float thetaError = computeGlobalThetaError(vh, sigmaZ_beamSpot); + return pow(derivativeTheta2 * pow(thetaError, 2) + derivativeInverseTransvMomentum2 * varianceInverseTransvMomentum, + 0.5); +} + +TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& tsos, + const edm::OwnVector<TrackingRecHit>& container, + const DetId& id, + const Propagator& prop) { + PTrajectoryStateOnDet seedTSOS = trajectoryStateTransform::persistentState(tsos, id.rawId()); + return TrajectorySeed(seedTSOS, container, prop.propagationDirection()); +} +DEFINE_FWK_MODULE(SeedingOTEDProducer); From 17bbbd6678edae0d2ea3477e2970dfa72078e45f Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 4 Sep 2020 17:33:57 -0500 Subject: [PATCH 377/778] use det() --- DataFormats/TrackerRecHit2D/interface/VectorHit.h | 7 +++---- DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 712cee801d461..f03fc066c6581 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -58,10 +58,9 @@ class VectorHit final : public BaseTrackerRecHit { // Parameters of the segment, for the track fit // For a 4D segment: (dx/dz,dy/dz,x,y) bool hasPositionAndError() const override { - //bool hasPositionAndError() const { - return true; - // return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) || - // (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0); + //if det is present pose&err are available as well. + //if det() is not present (null) the hit ihas been read from file and not updated + return det(); }; AlgebraicVector parameters() const override; diff --git a/DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc b/DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc index 4b1d7c60c8051..672b3aeb55e6d 100644 --- a/DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc +++ b/DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc @@ -27,10 +27,9 @@ void BaseTrackerRecHit::check() const { #endif bool BaseTrackerRecHit::hasPositionAndError() const { + //if det is present pose&err are available as well. + // //if det() is not present (null) the hit ihas been read from file and not updated return det(); - - // return (err_.xx() != 0) || (err_.yy() != 0) || (err_.xy() != 0) || - // (pos_.x() != 0) || (pos_.y() != 0) || (pos_.z() != 0); } void BaseTrackerRecHit::getKfComponents1D(KfComponentsHolder &holder) const { From d06cd10e643e97d840d5c8fabf99c7da80062a36 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 4 Sep 2020 17:47:26 -0500 Subject: [PATCH 378/778] remove uncessary cfi files --- .../python/SiPhase2RecHitMatcher_cfi.py | 4 ---- .../python/SiPhase2VectorHitBuilder_cfi.py | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py deleted file mode 100644 index b10e94e6c8b96..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2RecHitMatcher_cfi.py +++ /dev/null @@ -1,4 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -SiPhase2RecHitMatcherESProducer = cms.ESProducer("SiPhase2RecHitMatcherESProducer", -) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py deleted file mode 100644 index d885267371172..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/python/SiPhase2VectorHitBuilder_cfi.py +++ /dev/null @@ -1,4 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -siPhase2VectorHits = cms.EDProducer("VectorHitBuilderEDProducer", -) From 9e1ca77b024b44afbc1735766fde6367c64e9227 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Fri, 4 Sep 2020 18:06:36 -0500 Subject: [PATCH 379/778] code checks and format --- .../TrackerRecHit2D/interface/VectorHit.h | 7 ++--- .../TrackerRecHit2D/interface/VectorHit2D.h | 7 ++++- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 12 ++++---- .../interface/VectorHitBuilderAlgorithm.h | 7 +++-- .../interface/VectorHitBuilderAlgorithmBase.h | 8 ++--- .../interface/VectorHitMomentumHelper.h | 14 ++++----- .../SiPhase2RecHitMatcherESProducer.cc | 18 +++++------ .../plugins/VectorHitBuilderEDProducer.cc | 21 +++++-------- .../src/VectorHitBuilderAlgorithmBase.cc | 30 ++++++++----------- .../test/ClustersValidationTGraph.cc | 12 ++++---- .../test/VectorHitsValidation.cc | 24 +++++++-------- .../test/VectorHitsValidation.h | 2 +- .../TkSeedGenerator/plugins/SealModules.cc | 1 - .../plugins/SeedingOTEDProducer.cc | 15 ++++------ 14 files changed, 79 insertions(+), 99 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index f03fc066c6581..7f726e4149533 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -78,8 +78,7 @@ class VectorHit final : public BaseTrackerRecHit { virtual float chi2() const { return theChi2; } int dimension() const override { return theDimension; } - - enum curvatureOrPhi { curvatureMode, phiMode }; + enum curvatureOrPhi { curvatureMode, phiMode }; std::pair<float, float> curvatureORphi(curvatureOrPhi curvatureMode) const; @@ -145,9 +144,7 @@ class VectorHit final : public BaseTrackerRecHit { OmniClusterRef theUpperCluster; }; -inline bool operator<(const VectorHit& one, const VectorHit& other) { - return (one.chi2() < other.chi2()); -} +inline bool operator<(const VectorHit& one, const VectorHit& other) { return (one.chi2() < other.chi2()); } std::ostream& operator<<(std::ostream& os, const VectorHit& vh); diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index a30c92f2e20ad..e7fd9bfb6f953 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -12,7 +12,12 @@ class VectorHit2D { public: VectorHit2D() : thePosition(), theDirection(), theCovMatrix(), theChi2(), theDimension(2) {} VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& Chi2) - : thePosition(pos), theDirection(dir), theCovMatrix(covMatrix), theLocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]), theChi2(Chi2), theDimension(2){}; + : thePosition(pos), + theDirection(dir), + theCovMatrix(covMatrix), + theLocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]), + theChi2(Chi2), + theDimension(2){}; virtual ~VectorHit2D(){}; const LocalPoint* localPosition() const { return &thePosition; } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index dbb169193922c..e01d9969999a6 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -38,8 +38,8 @@ VectorHit::VectorHit(const GeomDet& idet, theDirection = LocalVector(vh2Dzx.localDirection()->x(), vh2Dzy.localDirection()->x(), 1.); //building the cov matrix 4x4 starting from the 2x2 - const AlgebraicSymMatrix22 covMatZX = *vh2Dzx.covMatrix(); - const AlgebraicSymMatrix22 covMatZY = *vh2Dzy.covMatrix(); + const AlgebraicSymMatrix22 covMatZX = *vh2Dzx.covMatrix(); + const AlgebraicSymMatrix22 covMatZY = *vh2Dzy.covMatrix(); theCovMatrix = AlgebraicSymMatrix(4); theCovMatrix[0][0] = covMatZX[0][0]; // var(dx/dz) @@ -338,9 +338,11 @@ std::pair<float, float> VectorHit::curvatureORphi(curvatureOrPhi curvORphi) cons } else { return std::make_pair(0.0, 0.0); } - switch(curvORphi){ - case curvatureMode : return std::make_pair(curvature, errorCurvature); - case phiMode : return std::make_pair(phi, 0.0); + switch (curvORphi) { + case curvatureMode: + return std::make_pair(curvature, errorCurvature); + case phiMode: + return std::make_pair(phi, 0.0); } return std::make_pair(0.0, 0.0); } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 32806969c560c..082293459902d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -16,8 +16,11 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { public: - VectorHitBuilderAlgorithm(const edm::ParameterSet& conf, const TrackerGeometry* tkGeomProd, const TrackerTopology* tkTopoProd, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) - : VectorHitBuilderAlgorithmBase(conf, tkGeomProd, tkTopoProd, cpeProd ), theFitter(new LinearFit()){}; + VectorHitBuilderAlgorithm(const edm::ParameterSet& conf, + const TrackerGeometry* tkGeomProd, + const TrackerTopology* tkTopoProd, + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) + : VectorHitBuilderAlgorithmBase(conf, tkGeomProd, tkTopoProd, cpeProd), theFitter(new LinearFit()){}; ~VectorHitBuilderAlgorithm() override { delete theFitter; }; void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 8fd95d97096ba..b3154600a23e1 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -24,11 +24,11 @@ class VectorHitBuilderAlgorithmBase { typedef std::pair<StackGeomDet, std::vector<Phase2TrackerCluster1D>> StackClusters; VectorHitBuilderAlgorithmBase(const edm::ParameterSet&, - const TrackerGeometry*, - const TrackerTopology*, - const ClusterParameterEstimator<Phase2TrackerCluster1D>*); + const TrackerGeometry*, + const TrackerTopology*, + const ClusterParameterEstimator<Phase2TrackerCluster1D>*); virtual ~VectorHitBuilderAlgorithmBase() {} -// void initialize(const edm::EventSetup&); + // void initialize(const edm::EventSetup&); void initTkGeom(const TrackerGeometry* tkGeomProd); void initTkTopo(const TrackerTopology* tkTopoProd); void initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h index ecbae466fa2fb..f0c37453093fe 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h @@ -7,24 +7,20 @@ class VectorHitMomentumHelper { public: VectorHitMomentumHelper(const MagneticField* magField) { - GlobalPoint center(0.0, 0.0, 0.0); - intermediate = magField->inTesla(center).mag() * 0.003; - //0.003 is because the curvature (rho) is in cm and not in m -} + GlobalPoint center(0.0, 0.0, 0.0); + intermediate = magField->inTesla(center).mag() * 0.003; + //0.003 is because the curvature (rho) is in cm and not in m + } ~VectorHitMomentumHelper() {} float transverseMomentum(VectorHit& vh) const { float rho = 1. / vh.curvatureORphi(VectorHit::curvatureMode).first; return (intermediate * rho); } - float momentum(VectorHit& vh) const { - return transverseMomentum(vh) / (1. * sin(vh.theta())); - } + float momentum(VectorHit& vh) const { return transverseMomentum(vh) / (1. * sin(vh.theta())); } private: - float intermediate; - }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index ac3d944ba5307..e9197ae107b5c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -28,10 +28,9 @@ class SiPhase2RecHitMatcherESProducer : public edm::ESProducer { SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::ParameterSet& p) { name_ = p.getParameter<std::string>("ComponentName"); - if (!(name_ == "SiPhase2VectorHitMatcher")){ - throw cms::Exception("ConfigurationError") - << "Configuration specifies unknown ComponentName .\n" - << "Currently only 'SiPhase2VectorHitMatcher' is supported\n"; + if (!(name_ == "SiPhase2VectorHitMatcher")) { + throw cms::Exception("ConfigurationError") << "Configuration specifies unknown ComponentName .\n" + << "Currently only 'SiPhase2VectorHitMatcher' is supported\n"; } pset_ = p; auto cc = setWhatProduced(this, name_); @@ -41,12 +40,13 @@ SiPhase2RecHitMatcherESProducer::SiPhase2RecHitMatcherESProducer(const edm::Para } std::unique_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::produce(const TkPhase2OTCPERecord& iRecord) { - std::unique_ptr<VectorHitBuilderAlgorithm> matcher = std::make_unique<VectorHitBuilderAlgorithm>(pset_, - &iRecord.get(geometryToken_), - &iRecord.getRecord<TrackerDigiGeometryRecord>().get(trackerTopoToken_), - &iRecord.get(cpeToken_)); + std::unique_ptr<VectorHitBuilderAlgorithm> matcher = std::make_unique<VectorHitBuilderAlgorithm>( + pset_, + &iRecord.get(geometryToken_), + &iRecord.getRecord<TrackerDigiGeometryRecord>().get(trackerTopoToken_), + &iRecord.get(cpeToken_)); -/* edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); + /* edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getRecord<TrackerDigiGeometryRecord>().getHandle(trackerTopoToken_); auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index 321f034532631..6a7f8427e5631 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -16,9 +16,9 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { public: explicit VectorHitBuilderEDProducer(const edm::ParameterSet&); - ~VectorHitBuilderEDProducer( ) override; - void produce(edm::Event&, const edm::EventSetup&) override; - void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusters, + ~VectorHitBuilderEDProducer() override; + void produce(edm::Event&, const edm::EventSetup&) override; + void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, VectorHitCollectionNew& outputAcc, @@ -27,21 +27,19 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { const VectorHitBuilderAlgorithm* algo() const { return stubsBuilder_; }; private: - const VectorHitBuilderAlgorithm * stubsBuilder_; + const VectorHitBuilderAlgorithm* stubsBuilder_; std::string offlinestubsTag_; unsigned int maxOfflinestubs_; edm::ESGetToken<VectorHitBuilderAlgorithm, TkPhase2OTCPERecord> stubsBuilderToken_; - edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > clusterProducer_; - + edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusterProducer_; }; VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } - VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")), maxOfflinestubs_(conf.getParameter<int>("maxVectorHits")), - stubsBuilderToken_(esConsumes(conf.getParameter<edm::ESInputTag>("Algorithm"))){ + stubsBuilderToken_(esConsumes(conf.getParameter<edm::ESInputTag>("Algorithm"))) { clusterProducer_ = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>(edm::InputTag(conf.getParameter<std::string>("Clusters"))); @@ -49,11 +47,8 @@ VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersRejected"); produces<VectorHitCollectionNew>(offlinestubsTag_ + "Accepted"); produces<VectorHitCollectionNew>(offlinestubsTag_ + "Rejected"); - - } - void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin"; @@ -69,7 +64,6 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu std::unique_ptr<VectorHitCollectionNew> outputVHAccepted(new VectorHitCollectionNew()); std::unique_ptr<VectorHitCollectionNew> outputVHRejected(new VectorHitCollectionNew()); - stubsBuilder_ = &es.getData(stubsBuilderToken_); // check on the input clusters stubsBuilder_->printClusters(*clustersHandle); @@ -101,14 +95,13 @@ void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2Trac edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, VectorHitCollectionNew& outputAcc, VectorHitCollectionNew& outputRej) { - stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); } void VectorHitBuilderEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add<std::string>("offlinestubs", "vectorHits"); desc.add<int>("maxVectorHits", 999999999); - desc.add<edm::ESInputTag>("Algorithm", edm::ESInputTag("","SiPhase2VectorHitMatcher")); + desc.add<edm::ESInputTag>("Algorithm", edm::ESInputTag("", "SiPhase2VectorHitMatcher")); desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); desc.add<std::vector<double>>("BarrelCut", { diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index fa54c5bd8a5d7..6e5bc1ee39805 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -7,19 +7,18 @@ #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" -VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::ParameterSet& conf, - const TrackerGeometry* tkGeomProd, - const TrackerTopology* tkTopoProd, - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) +VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase( + const edm::ParameterSet& conf, + const TrackerGeometry* tkGeomProd, + const TrackerTopology* tkTopoProd, + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) : nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), barrelCut(conf.getParameter<std::vector<double> >("BarrelCut")), endcapCut(conf.getParameter<std::vector<double> >("EndcapCut")), cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { - - initTkGeom(tkGeomProd); - initTkTopo(tkTopoProd); - initCpe(cpeProd); - + initTkGeom(tkGeomProd); + initTkTopo(tkTopoProd); + initCpe(cpeProd); } /*void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) { @@ -38,12 +37,8 @@ VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase(const edm::Paramete initCpe(cpeHandle.product()); } */ -void VectorHitBuilderAlgorithmBase::initTkGeom(const TrackerGeometry* tkGeomProd) { - theTkGeom = tkGeomProd; -} -void VectorHitBuilderAlgorithmBase::initTkTopo(const TrackerTopology* tkTopoProd) { - theTkTopo = tkTopoProd; -} +void VectorHitBuilderAlgorithmBase::initTkGeom(const TrackerGeometry* tkGeomProd) { theTkGeom = tkGeomProd; } +void VectorHitBuilderAlgorithmBase::initTkTopo(const TrackerTopology* tkTopoProd) { theTkTopo = tkTopoProd; } void VectorHitBuilderAlgorithmBase::initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) { cpe = cpeProd; } @@ -70,7 +65,7 @@ double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomD return parallCorr; } -void VectorHitBuilderAlgorithmBase::printClusters (const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) const { +void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) const { int nCluster = 0; int numberOfDSV = 0; edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator DSViter; @@ -93,7 +88,8 @@ void VectorHitBuilderAlgorithmBase::printClusters (const edmNew::DetSetVector<Ph LogDebug("VectorHitBuilder") << " Number of input clusters: " << nCluster << std::endl; } -void VectorHitBuilderAlgorithmBase::printCluster (const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* clustIt) const { +void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, + const Phase2TrackerCluster1D* clustIt) const { if (!geomDetUnit) return; const PixelGeomDetUnit* pixelGeomDetUnit = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc index 2c27178e0e6a9..bdd97131c2c34 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc @@ -618,13 +618,11 @@ unsigned int Phase2TrackerClusterizerValidationTGraph::getSimTrackId( return 0; } -void Phase2TrackerClusterizerValidationTGraph::fillDescriptions(edm::ConfigurationDescriptions & descriptions){ - - edm::ParameterSetDescription desc; - desc.add<std::string>("src","siPhase2Clusters"); - desc.add<edm::InputTag>("links",edm::InputTag("simSiPixelDigis", "Tracker")); - descriptions.add("phase2TrackerClusterizerValidationTGraph",desc); +void Phase2TrackerClusterizerValidationTGraph::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add<std::string>("src", "siPhase2Clusters"); + desc.add<edm::InputTag>("links", edm::InputTag("simSiPixelDigis", "Tracker")); + descriptions.add("phase2TrackerClusterizerValidationTGraph", desc); } - DEFINE_FWK_MODULE(Phase2TrackerClusterizerValidationTGraph); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index f555338604e0e..73fe206403763 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -22,7 +22,7 @@ VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet consumes<TrackingParticleCollection>(conf.getParameter<edm::InputTag>("trackingParticleSrc")); } -VectorHitsBuilderValidation::~VectorHitsBuilderValidation() { } +VectorHitsBuilderValidation::~VectorHitsBuilderValidation() {} void VectorHitsBuilderValidation::beginJob() { edm::Service<TFileService> fs; @@ -1212,19 +1212,15 @@ void VectorHitsBuilderValidation::printCluster(const GeomDetUnit* geomDetUnit, c return; } -void VectorHitsBuilderValidation::fillDescriptions(edm::ConfigurationDescriptions & descriptions){ - - edm::ParameterSetDescription desc; - desc.add<std::string>("src","siPhase2Clusters"); - desc.add<edm::InputTag>("links",edm::InputTag("simSiPixelDigis", "Tracker")); - desc.add<edm::InputTag>("VH_acc",edm::InputTag("siPhase2VectorHits", "vectorHitsAccepted")); - desc.add<edm::InputTag>("VH_rej",edm::InputTag("siPhase2VectorHits", "vectorHitsRejected")); - desc.add<edm::ESInputTag>("CPE",edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); - desc.add<edm::InputTag>("trackingParticleSrc",edm::InputTag("mix", "MergedTrackTruth")); - descriptions.add("vectorHitsBuilderValidation",desc); +void VectorHitsBuilderValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add<std::string>("src", "siPhase2Clusters"); + desc.add<edm::InputTag>("links", edm::InputTag("simSiPixelDigis", "Tracker")); + desc.add<edm::InputTag>("VH_acc", edm::InputTag("siPhase2VectorHits", "vectorHitsAccepted")); + desc.add<edm::InputTag>("VH_rej", edm::InputTag("siPhase2VectorHits", "vectorHitsRejected")); + desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); + desc.add<edm::InputTag>("trackingParticleSrc", edm::InputTag("mix", "MergedTrackTruth")); + descriptions.add("vectorHitsBuilderValidation", desc); } - - - DEFINE_FWK_MODULE(VectorHitsBuilderValidation); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index c29d5849a1d81..87b92e8054ef3 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -90,6 +90,7 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { void analyze(const edm::Event&, const edm::EventSetup&); static void fillDescriptions(edm::ConfigurationDescriptions&); + private: std::map<unsigned int, VHHistos>::iterator createLayerHistograms(unsigned int); void CreateVHsXYGraph(const std::vector<Global3DPoint>, const std::vector<Global3DVector>); @@ -148,5 +149,4 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { TH1F* VHrejTrueLayer_ratio; std::map<unsigned int, VHHistos> histograms_; - }; diff --git a/RecoTracker/TkSeedGenerator/plugins/SealModules.cc b/RecoTracker/TkSeedGenerator/plugins/SealModules.cc index ee7dd08cc5e6c..4a64f677fc545 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SealModules.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SealModules.cc @@ -39,4 +39,3 @@ DEFINE_FWK_MODULE(SeedCreatorFromRegionConsecutiveHitsEDProducer); using SeedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer = SeedCreatorFromRegionHitsEDProducerT<SeedFromConsecutiveHitsTripletOnlyCreator>; DEFINE_FWK_MODULE(SeedCreatorFromRegionConsecutiveHitsTripletOnlyEDProducer); - diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 6a298388a85eb..e0878442d1ba2 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -25,7 +25,6 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/EventSetup.h" - #include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" #include "TrackingTools/MeasurementDet/interface/TrajectoryMeasurementGroup.h" @@ -90,25 +89,24 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { edm::ESGetToken<TrajectoryStateUpdator, TrackingComponentsRecord> updatorToken_; edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> measurementTrackerToken_; edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> estToken_; - }; SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) : updator_(nullptr), tkMeasEventToken_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), topoToken_(esConsumes()), - propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial" ))), + propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial"))), magFieldToken_(esConsumes()), updatorToken_(esConsumes()), measurementTrackerToken_(esConsumes()), - estToken_(esConsumes(edm::ESInputTag("","Chi2"))) { + estToken_(esConsumes(edm::ESInputTag("", "Chi2"))) { vhProducerToken_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); beamSpotToken_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); updatorName_ = conf.getParameter<std::string>("updator"); produces<TrajectorySeedCollection>(); } -SeedingOTEDProducer::~SeedingOTEDProducer() { } +SeedingOTEDProducer::~SeedingOTEDProducer() {} void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -122,7 +120,6 @@ void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descr void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); - tkTopo_ = &es.getData(topoToken_); edm::ESHandle<MeasurementTracker> measurementTrackerHandle; @@ -318,8 +315,6 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& //Helper class to access momentum of VH VectorHitMomentumHelper vhMomHelper(magField_); - - //FIXME::charge is fine 1 every two times!! int charge = 1; float p = vhMomHelper.momentum(vHit); @@ -335,8 +330,8 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p - mat[0][0] = pow( - computeInverseMomentumError(vHit, theta, beamSpot_->sigmaZ(), vhMomHelper.transverseMomentum(vHit)), 2); + mat[0][0] = + pow(computeInverseMomentumError(vHit, theta, beamSpot_->sigmaZ(), vhMomHelper.transverseMomentum(vHit)), 2); //building tsos LocalTrajectoryError lterr(asSMatrix<5>(mat)); From 6fa22296d674519e6fc6c0b30d551f5f87329581 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Sat, 5 Sep 2020 09:51:26 -0500 Subject: [PATCH 380/778] turn VHs off again and fix capitilization of import name --- .../Configuration/python/RecoLocalTracker_cff.py | 2 +- .../interface/VectorHitBuilderAlgorithmBase.h | 1 - .../plugins/SiPhase2RecHitMatcherESProducer.cc | 9 --------- .../python/TrackerRecoGeometryESProducer_cfi.py | 4 ++-- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py index 06ebb798faca2..3cae176059b3b 100644 --- a/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py +++ b/RecoLocalTracker/Configuration/python/RecoLocalTracker_cff.py @@ -23,7 +23,7 @@ from RecoLocalTracker.SiPhase2Clusterizer.phase2TrackerClusterizer_cfi import * from RecoLocalTracker.Phase2TrackerRecHits.Phase2StripCPEGeometricESProducer_cfi import * -from RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2RecHitMatcher_cfi import * +from RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2RecHitMatcher_cfi import * _pixeltrackerlocalrecoTask_phase2 = pixeltrackerlocalrecoTask.copy() _pixeltrackerlocalrecoTask_phase2.add(siPhase2Clusters) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index b3154600a23e1..9850c3a043095 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -28,7 +28,6 @@ class VectorHitBuilderAlgorithmBase { const TrackerTopology*, const ClusterParameterEstimator<Phase2TrackerCluster1D>*); virtual ~VectorHitBuilderAlgorithmBase() {} - // void initialize(const edm::EventSetup&); void initTkGeom(const TrackerGeometry* tkGeomProd); void initTkTopo(const TrackerTopology* tkTopoProd); void initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index e9197ae107b5c..5151870c930bb 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -46,15 +46,6 @@ std::unique_ptr<VectorHitBuilderAlgorithm> SiPhase2RecHitMatcherESProducer::prod &iRecord.getRecord<TrackerDigiGeometryRecord>().get(trackerTopoToken_), &iRecord.get(cpeToken_)); - /* edm::ESHandle<TrackerGeometry> tGeomHandle = iRecord.getHandle(geometryToken_); - edm::ESHandle<TrackerTopology> tTopoHandle = iRecord.getRecord<TrackerDigiGeometryRecord>().getHandle(trackerTopoToken_); - - auto ptr_phase2TrackerCPE = &iRecord.get(cpeToken_); - - matcher->initTkGeom(tGeomHandle); - matcher->initTkTopo(tTopoHandle); - matcher->initCpe(ptr_phase2TrackerCPE); */ - return matcher; } diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 9a87a93207ed2..22d95e29034d3 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(True) + usePhase2Stacks = cms.bool(False) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) From 2536365f3374283e15155b56f9fccbca11611c71 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Sat, 5 Sep 2020 11:40:56 -0500 Subject: [PATCH 381/778] fix overlooked switch from dynamic to static cast --- .../SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index efe23608bdfe3..cbbd5771ba0d2 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -255,7 +255,7 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, //printCluster(stack->upperDet(),&*upper); const PixelGeomDetUnit* geomDetLower = static_cast<const PixelGeomDetUnit*>(stack->lowerDet()); - const PixelGeomDetUnit* geomDetUpper = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); + const PixelGeomDetUnit* geomDetUpper = static_cast<const PixelGeomDetUnit*>(stack->upperDet()); auto&& lparamsLower = cpe->localParameters(*lower, *geomDetLower); // x, y, z, e2_xx, e2_xy, e2_yy Global3DPoint gparamsLower = geomDetLower->surface().toGlobal(lparamsLower.first); From 1009a209cb769101cee17df18ce5bdf95e32b7ab Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Sat, 5 Sep 2020 13:34:05 -0500 Subject: [PATCH 382/778] add vector hits to isFromDet and isFromDataOrFast in trackerHitRTTI --- DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h | 6 ++---- .../plugins/SiPhase2RecHitMatcherESProducer.cc | 2 +- .../TrackAssociation/interface/trackHitsToClusterRefs.h | 8 ++++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h index 9d0a6bab0403d..d3bf716b24409 100644 --- a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h +++ b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h @@ -33,11 +33,9 @@ namespace trackerHitRTTI { inline bool isMatched(TrackingRecHit const& hit) { return rtti(hit) == match || rtti(hit) == fastMatch; } inline bool isMulti(TrackingRecHit const& hit) { return rtti(hit) == multi; } inline bool isSingleType(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 4); } - //inline bool isFromDet(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 6)) | (rtti(hit) == 12)); } - inline bool isFromDet(TrackingRecHit const& hit) { return ((rtti(hit) > 0) & (rtti(hit) < 6)); } + inline bool isFromDet(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 6)) | (rtti(hit) == 12)); } inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); } - inline bool isFromDetOrFast(TrackingRecHit const& hit) { return ((rtti(hit) > 0) & (rtti(hit) < 10)); } - //inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 10)) | (rtti(hit) == 12)); } + inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 10)) | (rtti(hit) == 12)); } inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; } inline bool isVector(TrackingRecHit const& hit) { return rtti(hit) == vector; } inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc index 5151870c930bb..974a59fc59682 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/SiPhase2RecHitMatcherESProducer.cc @@ -78,7 +78,7 @@ void SiPhase2RecHitMatcherESProducer::fillDescriptions(edm::ConfigurationDescrip 0.1, 0.1, }); - descriptions.add("SiPhase2RecHitMatcherESProducer", desc); + descriptions.add("siPhase2RecHitMatcher", desc); } DEFINE_FWK_EVENTSETUP_MODULE(SiPhase2RecHitMatcherESProducer); diff --git a/SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h b/SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h index 3a17d4ab3e874..76a56e9f0ebd4 100644 --- a/SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h +++ b/SimTracker/TrackAssociation/interface/trackHitsToClusterRefs.h @@ -8,6 +8,7 @@ #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h" namespace track_associator { @@ -56,6 +57,13 @@ namespace track_associator { edm::LogError("TrackAssociator") << ">>> RecHit does not have an associated cluster!" << " file: " << __FILE__ << " line: " << __LINE__; returnValue.push_back(ph2Hit->omniClusterRef()); + } else if (tid == typeid(VectorHit)) { + const VectorHit *vectorHit = dynamic_cast<const VectorHit *>(rhit); + if (!vectorHit->cluster().isNonnull()) + edm::LogError("TrackAssociator") << ">>> RecHit does not have an associated cluster!" + << " file: " << __FILE__ << " line: " << __LINE__; + returnValue.push_back(vectorHit->firstClusterRef()); + } else { auto const &thit = static_cast<BaseTrackerRecHit const &>(*rhit); if (thit.isProjected()) { From b17261dbe4fa3eee252443b21b09540d2d868f90 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Sat, 5 Sep 2020 13:45:59 -0500 Subject: [PATCH 383/778] code format --- DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h index d3bf716b24409..b26198b498f69 100644 --- a/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h +++ b/DataFormats/TrackerRecHit2D/interface/trackerHitRTTI.h @@ -35,7 +35,9 @@ namespace trackerHitRTTI { inline bool isSingleType(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 4); } inline bool isFromDet(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 6)) | (rtti(hit) == 12)); } inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); } - inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 10)) | (rtti(hit) == 12)); } + inline bool isFromDetOrFast(TrackingRecHit const& hit) { + return (((rtti(hit) > 0) & (rtti(hit) < 10)) | (rtti(hit) == 12)); + } inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; } inline bool isVector(TrackingRecHit const& hit) { return rtti(hit) == vector; } inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; } From 01114c04d224e6aabd54028709cbcb6bd33aa94b Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Mon, 7 Sep 2020 21:18:15 -0500 Subject: [PATCH 384/778] small improvements requested by Vincenzo --- .../src/VectorHitBuilderAlgorithm.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index cbbd5771ba0d2..c20a651520f9d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -73,7 +73,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track //ERICA:: to be checked with map! //sorting vhs for best chi2 - std::sort(vhsInStack_Acc.begin(), vhsInStack_Acc.end()); + std::sort_heap(vhsInStack_Acc.begin(), vhsInStack_Acc.end()); tempVHAcc[detIdStack] = vhsInStack_Acc; tempVHRej[detIdStack] = vhsInStack_Rej; @@ -107,6 +107,7 @@ bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding( //order lower clusters in u std::vector<Phase2TrackerCluster1D> lowerClusters; + lowerClusters.reserve(theLowerDetSet.size()); if (theLowerDetSet.size() > 1) LogDebug("VectorHitBuilderAlgorithm") << " more than 1 lower cluster! " << std::endl; if (theUpperDetSet.size() > 1) @@ -151,8 +152,8 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi upperClusters.push_back(clusterUpper); } - std::sort(lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->lowerDet())); - std::sort(upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->upperDet())); + std::sort_heap(lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->lowerDet())); + std::sort_heap(upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->upperDet())); for (const auto& cluL : lowerClusters) { LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; From 2cdd767fd338dda8470426e075ba655aa2371961 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 8 Sep 2020 14:08:44 -0500 Subject: [PATCH 385/778] protect against invalid TSOSs when propagating between layers --- ...oductionAndTesting_TenMuExtendedE_0_200.py | 105 ------------------ .../plugins/SeedingOTEDProducer.cc | 21 +++- 2 files changed, 15 insertions(+), 111 deletions(-) delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting_TenMuExtendedE_0_200.py diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting_TenMuExtendedE_0_200.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting_TenMuExtendedE_0_200.py deleted file mode 100644 index 45c7942ff29e4..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting_TenMuExtendedE_0_200.py +++ /dev/null @@ -1,105 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from Configuration.StandardSequences.Eras import eras - -process = cms.Process('RECO',eras.Phase2C2) - -# import of standard configurations -process.load('Configuration.StandardSequences.Services_cff') -process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.EventContent.EventContent_cff') -process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') -process.load('Configuration.StandardSequences.MagneticField_cff') -process.load('Configuration.StandardSequences.RawToDigi_cff') -process.load('Configuration.StandardSequences.L1Reco_cff') -process.load('Configuration.StandardSequences.Reconstruction_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') - -#adding only recolocalreco -process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') - -# import VectorHitBuilder -process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') - - -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(1000) -) - -# Input source -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('file:step2_TenMuExtendedE_0_200.root'), - secondaryFileNames = cms.untracked.vstring(), - #skipEvents = cms.untracked.uint32(0), - #eventsToProcess = cms.untracked.VEventRange('1:952-1:952') -) - -process.options = cms.untracked.PSet( - -) - -# Production Info -process.configurationMetadata = cms.untracked.PSet( - annotation = cms.untracked.string('step3 nevts:10'), - name = cms.untracked.string('Applications'), - version = cms.untracked.string('$Revision: 1.19 $') -) - -# Output definition - -process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", - dataset = cms.untracked.PSet( - dataTier = cms.untracked.string('GEN-SIM-RECO'), - filterName = cms.untracked.string('') - ), - eventAutoFlushCompressedSize = cms.untracked.int32(5242880), - fileName = cms.untracked.string('file:step3_1event.root'), - outputCommands = cms.untracked.vstring( ('keep *') ), - splitLevel = cms.untracked.int32(0) -) - -# debug -#process.MessageLogger = cms.Service("MessageLogger", -# destinations = cms.untracked.vstring("debugVH_tilted"), -# debugModules = cms.untracked.vstring("*"), -# categories = cms.untracked.vstring("VectorHitBuilderEDProducer","VectorHitBuilderAlgorithm","VectorHitsBuilderValidation","VectorHitBuilder"), -# debugVH_tilted = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), -# DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), -# default = cms.untracked.PSet(limit = cms.untracked.int32(0)), -# VectorHitBuilder = cms.untracked.PSet(limit = cms.untracked.int32(-1)), -# VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), -# VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), -# VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) -# ) -# ) - -# Analyzer -process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', - src = cms.string("siPhase2Clusters"), - VH_acc = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), - VH_rej = cms.InputTag("siPhase2VectorHits", "vectorHitsRejected"), - CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"), - links = cms.InputTag("simSiPixelDigis", "Tracker"), - trackingParticleSrc = cms.InputTag('mix', 'MergedTrackTruth'), -) -process.TFileService = cms.Service('TFileService', - fileName = cms.string('file:VHs_validation_TenMu_new.root') -) - - -# Other statements -from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') - -# Path and EndPath definitions -process.raw2digi_step = cms.Path(process.RawToDigi) -process.L1Reco_step = cms.Path(process.L1Reco) -process.trackerlocalreco_step = cms.Path(process.trackerlocalreco+process.siPhase2VectorHits) -process.analysis_step = cms.Path(process.analysis) -process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) - -# Schedule definition -process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.RECOSIMoutput_step, process.analysis_step) - diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index e0878442d1ba2..e4a18f53b17dc 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -92,12 +92,12 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { }; SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) - : updator_(nullptr), - tkMeasEventToken_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), + //: updator_(nullptr), + : tkMeasEventToken_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), topoToken_(esConsumes()), propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial"))), magFieldToken_(esConsumes()), - updatorToken_(esConsumes()), + updatorToken_(esConsumes(edm::ESInputTag("","KFUpdator"))), measurementTrackerToken_(esConsumes()), estToken_(esConsumes(edm::ESInputTag("", "Chi2"))) { vhProducerToken_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); @@ -122,14 +122,17 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) tkTopo_ = &es.getData(topoToken_); - edm::ESHandle<MeasurementTracker> measurementTrackerHandle; +/* edm::ESHandle<MeasurementTracker> measurementTrackerHandle; measurementTrackerHandle = es.getHandle(measurementTrackerToken_); + measurementTracker_ = measurementTrackerHandel.product();*/ + edm::ESHandle<MeasurementTracker> measurementTrackerHandle = es.getHandle(measurementTrackerToken_); measurementTracker_ = measurementTrackerHandle.product(); edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; event.getByToken(tkMeasEventToken_, measurementTrackerEvent); - LayerMeasurements layerMeasurements_(*measurementTrackerHandle, *measurementTrackerEvent); + //LayerMeasurements layerMeasurements_(*measurementTrackerHandle, *measurementTrackerEvent); + layerMeasurements_ = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); estimator_ = &es.getData(estToken_); @@ -251,8 +254,12 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio continue; std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); - std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = + if (!updatedTSOSL2_final.first) + continue; + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); + if (!updatedTSOSL3_final.first) + continue; TrajectorySeed ts = createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(), *buildingPropagator); result.push_back(ts); @@ -356,6 +363,8 @@ AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) { std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdate( const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) { TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); + if UNLIKELY (!propTSOS.isValid()) + return std::make_pair(false, propTSOS); TrajectoryStateOnSurface updatedTSOS = updator_->update(propTSOS, hit); if UNLIKELY (!updatedTSOS.isValid()) return std::make_pair(false, updatedTSOS); From ccf9e94eb1a9900cfecfd103a45db4b3b3b367ab Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 8 Sep 2020 14:29:48 -0500 Subject: [PATCH 386/778] update validation configs to run on current RelVals --- .../plugins/VectorHitBuilderEDProducer.cc | 3 +- .../test/Clusters_productionAndTesting.py | 17 ++++++-- ... => VHs_SeedingOT_productionAndTesting.py} | 25 +++++++---- .../test/VHs_combinatorialStudies_PU200.py | 42 ++++++++++++------- .../test/VHs_productionAndTesting.py | 30 ++++++------- .../TrackerRecoGeometryESProducer_cfi.py | 4 +- 6 files changed, 76 insertions(+), 45 deletions(-) rename RecoLocalTracker/SiPhase2VectorHitBuilder/test/{step3_SeedingOT_tilted.py => VHs_SeedingOT_productionAndTesting.py} (69%) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index 6a7f8427e5631..d313d4bc920c9 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -34,7 +34,8 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusterProducer_; }; -VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } +//VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } +VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { } VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")), diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py index 7728a15e402a2..cac36312ac6a7 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/Clusters_productionAndTesting.py @@ -24,7 +24,7 @@ process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') # import VectorHitBuilder -process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2VectorHits_cfi') process.maxEvents = cms.untracked.PSet( @@ -33,7 +33,17 @@ # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('/store/relval/CMSSW_11_1_0_pre6/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/FF928A27-31CB-9C4D-93E0-475E2E73326E.root'), + fileNames = cms.untracked.vstring('/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/863B48BB-03ED-0548-AA60-1269291ED1E6.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/9B6E3A66-B330-8E42-B85E-96A9952A002E.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/29706FE9-16C9-CE4F-B744-66E07B250D1E.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/AAB16BEE-B0CE-644A-8E96-35236D793C04.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/36F89E35-DE2F-174B-95B7-7A9423DED2D8.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/1BE0A565-4F64-8D42-A5D5-62692F64F0A5.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/8671B5C9-DE1F-8B4C-8A1C-9C99898FE191.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/6CA0E490-73F4-1147-906D-050B8B3A3134.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/AFAB961F-E31F-064D-9031-BEAA10702345.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/2AB6718E-EEA6-494B-AC25-B59CF36DF941.root', + ), secondaryFileNames = cms.untracked.vstring(), skipEvents = cms.untracked.uint32(0) ) @@ -58,7 +68,8 @@ ), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), fileName = cms.untracked.string('file:step3_1event.root'), - outputCommands = cms.untracked.vstring( ('keep *') ), + outputCommands = process.RECOSIMEventContent.outputCommands, + #outputCommands = cms.untracked.vstring( ('keep *') ), splitLevel = cms.untracked.int32(0) ) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/step3_SeedingOT_tilted.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py similarity index 69% rename from RecoLocalTracker/SiPhase2VectorHitBuilder/test/step3_SeedingOT_tilted.py rename to RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py index d91869a0a3f97..2b8480df625d5 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/step3_SeedingOT_tilted.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py @@ -2,7 +2,7 @@ from Configuration.StandardSequences.Eras import eras -process = cms.Process('RECO',eras.Phase2C2) +process = cms.Process('RECO',eras.Phase2C9) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -10,7 +10,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023D4Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.RawToDigi_cff') process.load('Configuration.StandardSequences.L1Reco_cff') @@ -21,7 +21,7 @@ process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') # import VectorHitBuilder -process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2VectorHits_cfi') process.maxEvents = cms.untracked.PSet( @@ -30,8 +30,17 @@ # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('file:21207_10events/step2.root'), - #fileNames = cms.untracked.vstring('/store/relval/CMSSW_8_1_0_pre7/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/81X_mcRun2_asymptotic_v0_2023tilted-v1/10000/2E7CB262-1534-E611-BB7A-0CC47A78A496.root'), + fileNames = cms.untracked.vstring('/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/863B48BB-03ED-0548-AA60-1269291ED1E6.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/9B6E3A66-B330-8E42-B85E-96A9952A002E.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/29706FE9-16C9-CE4F-B744-66E07B250D1E.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/AAB16BEE-B0CE-644A-8E96-35236D793C04.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/36F89E35-DE2F-174B-95B7-7A9423DED2D8.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/1BE0A565-4F64-8D42-A5D5-62692F64F0A5.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/8671B5C9-DE1F-8B4C-8A1C-9C99898FE191.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/6CA0E490-73F4-1147-906D-050B8B3A3134.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/AFAB961F-E31F-064D-9031-BEAA10702345.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/2AB6718E-EEA6-494B-AC25-B59CF36DF941.root', + ), secondaryFileNames = cms.untracked.vstring(), skipEvents = cms.untracked.uint32(0) ) @@ -56,14 +65,14 @@ ), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), fileName = cms.untracked.string('file:step3_1event.root'), - outputCommands = cms.untracked.vstring( ('keep *') ), + outputCommands = process.RECOSIMEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) # Analyzer process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', src = cms.string("siPhase2Clusters"), - src2 = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), + VH_acc = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), links = cms.InputTag("simSiPixelDigis", "Tracker") ) process.TFileService = cms.Service('TFileService', @@ -107,8 +116,6 @@ # Schedule definition process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.seedingOT_step,process.RECOSIMoutput_step, process.analysis_step) -#process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.trackerlocalreco_step,process.RECOSIMoutput_step) -#process.schedule = cms.Schedule(process.raw2digi_step,process.L1Reco_step,process.reconstruction_step,process.prevalidation_step,process.validation_step,process.dqmoffline_step,process.FEVTDEBUGHLToutput_step,process.DQMoutput_step) # customisation of the process. diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py index 70c46e4ea1d2e..88e0af4c221fa 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py @@ -22,7 +22,7 @@ process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') # import VectorHitBuilder -process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2VectorHits_cfi') process.maxEvents = cms.untracked.PSet( @@ -31,16 +31,18 @@ # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/02ACC76A-C93F-E711-B711-0CC47A4C8EC8.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/02FD72C1-D53F-E711-BD00-0CC47A7C3420.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/04EC6BD2-D53F-E711-B2B7-0025905B858E.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/061B97AF-C93F-E711-A425-0CC47A4C8F12.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/081DAA75-C93F-E711-8CAF-0025905B85CA.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0A1C6B0E-C93F-E711-9145-0CC47A7C3412.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0AE954E1-D53F-E711-AA9C-0CC47A4D7632.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0C0660A9-CA3F-E711-8583-0CC47A745298.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0C66279B-CA3F-E711-A4B3-0CC47A7AB7A0.root', - '/store/relval/CMSSW_9_1_1/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_91X_upgrade2023_realistic_v1_D17PU200-v1/10000/0E5BF643-D43F-E711-A64C-0CC47A7C34E6.root'), + fileNames = cms.untracked.vstring( +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/C7A95D39-8FAB-D746-8C06-B11AECA047DD.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/E4D19FDC-9192-2F44-A4FA-21AB5A93344C.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/04E557E8-C456-B148-9EC6-2E5E40BD03C6.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/284ACE29-A506-CD40-9059-899981D7931C.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/5ACFC231-EBF6-2B4F-A88F-D01171F506CE.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/8E76FEBA-FF9B-544D-9C17-C5B31777FE39.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/2958EE82-39A5-154A-9650-5E97AAD44B3E.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/943CFE41-83ED-F04B-AA74-435821572336.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/01D965C0-05A4-C543-A676-7C6C67DC2175.root', +'/store/relval/CMSSW_11_2_0_pre3/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200_rsb-v1/20000/7D171FAD-4E5B-824A-A0DF-07175F0A9550.root', +), #fileNames = cms.untracked.vstring('file:step2.root'), secondaryFileNames = cms.untracked.vstring(), skipEvents = cms.untracked.uint32(0) @@ -66,7 +68,8 @@ ), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), fileName = cms.untracked.string('file:step3_PU200.root'), - outputCommands = cms.untracked.vstring( ('keep *') ), + outputCommands = process.RECOSIMEventContent.outputCommands, + #outputCommands = cms.untracked.vstring( ('keep *') ), splitLevel = cms.untracked.int32(0) ) @@ -78,8 +81,6 @@ debugVH_PU200 = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), default = cms.untracked.PSet(limit = cms.untracked.int32(0)), - #VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), - #VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) ) ) @@ -103,7 +104,18 @@ process.mix.bunchspace = cms.int32(25) process.mix.minBunch = cms.int32(-3) process.mix.maxBunch = cms.int32(3) -process.mix.input.fileNames = cms.untracked.vstring(['/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/0A883B39-083F-E711-8B09-0CC47A7C357A.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/22E509DA-053F-E711-AA7A-0025905B85BA.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/3E376DB4-043F-E711-985E-0CC47A74524E.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/509E21AC-023F-E711-A9F3-0025905B8604.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/5E53AC15-0A3F-E711-8965-0025905A60E0.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/62EC67CA-0B3F-E711-81AC-0025905A610C.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/6476C3E7-063F-E711-B412-0025905B855A.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/7256251B-0B3F-E711-BBEF-0CC47A78A3B4.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/8C943DC3-0B3F-E711-BA5F-0CC47A7C34B0.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/C092AF3B-083F-E711-A0EC-0025905A6070.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/DE2E5EC5-013F-E711-BE84-0CC47A78A3EC.root', '/store/relval/CMSSW_9_1_1/RelValMinBias_14TeV/GEN-SIM/91X_upgrade2023_realistic_v1_D17-v1/10000/DE80A4D4-093F-E711-8195-0CC47A4D75F6.root']) +process.mix.input.fileNames = cms.untracked.vstring([ +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/09AA31DF-737A-B142-A82B-6E48B4B965CD.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/A18897B2-7509-C845-B83A-CEE4AC55FF86.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/184F91C7-EA57-2B49-9E85-D1F494152CDD.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/A505AC6C-6DEA-484C-8FFC-1EA4B54892F5.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/5636AD91-D035-0B44-8D53-2B4FFE6A7722.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/03D1F17E-33EE-A94C-A869-00071F1F45C7.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/EB99E4B3-838A-CC4C-B1B2-8A9D1E1EB453.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/7F44A9B9-38C1-484F-9B4B-DCD0FD7224A8.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/2A3CCF08-CDD1-6246-827F-27CD0CC42478.root', +'/store/relval/CMSSW_11_2_0_pre5/RelValMinBias_14TeV/GEN-SIM-DIGI-RAW/110X_mcRun4_realistic_v3_2026D49noPU-v1/20000/0745B823-5DB0-B74F-B0A6-78E24ED39EE5.root', +]) process.mix.playback = True process.mix.digitizers = cms.PSet() for a in process.aliases: delattr(process, a) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py index fd60e10fcb5dc..0618b7982446a 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py @@ -2,7 +2,7 @@ from Configuration.StandardSequences.Eras import eras -process = cms.Process('RECO',eras.Phase2C2) +process = cms.Process('RECO',eras.Phase2C9) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -10,7 +10,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.RawToDigi_cff') process.load('Configuration.StandardSequences.L1Reco_cff') @@ -21,7 +21,7 @@ process.load('RecoLocalTracker.Configuration.RecoLocalTracker_cff') # import VectorHitBuilder -process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.SiPhase2VectorHitBuilder_cfi') +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2VectorHits_cfi') process.maxEvents = cms.untracked.PSet( @@ -30,17 +30,17 @@ # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/0A0A27B4-153F-E711-ABC3-0025905A60C6.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/34817EB0-163F-E711-83C8-0CC47A7C340C.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/3CC9FD4E-173F-E711-B4DF-0025905A60D6.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/521169DF-173F-E711-BC3D-0CC47A7C35A4.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/6E767157-163F-E711-B315-0025905B8560.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/7A9BAA32-173F-E711-B7CA-0CC47A78A496.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/BA5F8EE0-173F-E711-97E9-0025905A6122.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/CA0AE5B2-153F-E711-B1CE-0025905B85EE.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/DEFFF299-173F-E711-9A88-0CC47A4C8EE2.root', - '/store/relval/CMSSW_9_1_1/RelValSingleMuPt10Extended/GEN-SIM-DIGI-RAW/91X_upgrade2023_realistic_v1_D17-v1/10000/FA58F15E-163F-E711-B748-0025905A607A.root'), - #fileNames = cms.untracked.vstring('file:step2.root'), + fileNames = cms.untracked.vstring('/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/863B48BB-03ED-0548-AA60-1269291ED1E6.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/9B6E3A66-B330-8E42-B85E-96A9952A002E.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/29706FE9-16C9-CE4F-B744-66E07B250D1E.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/AAB16BEE-B0CE-644A-8E96-35236D793C04.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/36F89E35-DE2F-174B-95B7-7A9423DED2D8.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/1BE0A565-4F64-8D42-A5D5-62692F64F0A5.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/8671B5C9-DE1F-8B4C-8A1C-9C99898FE191.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/6CA0E490-73F4-1147-906D-050B8B3A3134.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/AFAB961F-E31F-064D-9031-BEAA10702345.root', + '/store/relval/CMSSW_11_2_0_pre3/RelValSingleMuFlatPt2To100/GEN-SIM-DIGI-RAW/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/2AB6718E-EEA6-494B-AC25-B59CF36DF941.root', + ), secondaryFileNames = cms.untracked.vstring(), skipEvents = cms.untracked.uint32(0) ) @@ -65,7 +65,7 @@ ), eventAutoFlushCompressedSize = cms.untracked.int32(5242880), fileName = cms.untracked.string('file:step3_1event.root'), - outputCommands = cms.untracked.vstring( ('keep *') ), + outputCommands = process.RECOSIMEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 22d95e29034d3..9a87a93207ed2 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(False) + usePhase2Stacks = cms.bool(True) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) From 33bbeff0a76a8cbfb91d6f2459b795b9ae6dd898 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 8 Sep 2020 16:38:00 -0500 Subject: [PATCH 387/778] made a lot of functions const --- .../plugins/SeedingOTEDProducer.cc | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index e4a18f53b17dc..7213cb57758e9 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -46,21 +46,21 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { unsigned int checkLayer(unsigned int iidd); std::vector<VectorHit> collectVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); void printVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); - const TrajectoryStateOnSurface buildInitialTSOS(VectorHit&); - AlgebraicSymMatrix assign44To55(AlgebraicSymMatrix); + const TrajectoryStateOnSurface buildInitialTSOS(VectorHit&) const; + AlgebraicSymMatrix assign44To55(AlgebraicSymMatrix) const; std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator&, - const TrackingRecHit& hit); - float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot); + const TrackingRecHit& hit) const; + float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) const; float computeInverseMomentumError(VectorHit& vh, const float globalTheta, const double sigmaZ_beamSpot, - const double transverseMomentum); + const double transverseMomentum) const; TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, const DetId& id, - const Propagator& prop); + const Propagator& prop) const; struct isInvalid { bool operator()(const TrajectoryMeasurement& measurement) { @@ -73,7 +73,7 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT<VectorHitCollectionNew> vhProducerToken_; const TrackerTopology* tkTopo_; const MeasurementTracker* measurementTracker_; - const LayerMeasurements* layerMeasurements_; + std::unique_ptr<LayerMeasurements> layerMeasurements_; const MeasurementEstimator* estimator_; const Propagator* propagator_; const MagneticField* magField_; @@ -132,7 +132,7 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) event.getByToken(tkMeasEventToken_, measurementTrackerEvent); //LayerMeasurements layerMeasurements_(*measurementTrackerHandle, *measurementTrackerEvent); - layerMeasurements_ = new LayerMeasurements(*measurementTrackerHandle, *measurementTrackerEvent); + layerMeasurements_ = std::make_unique<LayerMeasurements>(*measurementTrackerHandle, *measurementTrackerEvent); estimator_ = &es.getData(estToken_); @@ -312,7 +312,7 @@ void SeedingOTEDProducer::printVHsOnLayer(edm::Handle<VectorHitCollectionNew> VH } } -const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& vHit) { +const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& vHit) const { // having fun with theta Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); float theta = gv.theta(); @@ -347,7 +347,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& return tsos; } -AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) { +AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) const{ if (mat44.num_row() != 4 || mat44.num_col() != 4) assert("Wrong dimension! This should be a 4x4 matrix!"); @@ -361,7 +361,7 @@ AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) { } std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdate( - const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) { + const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) const { TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); if UNLIKELY (!propTSOS.isValid()) return std::make_pair(false, propTSOS); @@ -371,7 +371,7 @@ std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdat return std::make_pair(true, updatedTSOS); } -float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) { +float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) const { double derivative = vh.globalPosition().perp() / (pow(vh.globalPosition().z(), 2) + pow(vh.globalPosition().perp(), 2)); double derivative2 = pow(derivative, 2); @@ -381,7 +381,7 @@ float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const do float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, const float globalTheta, const double sigmaZ_beamSpot, - const double transverseMomentum) { + const double transverseMomentum) const { //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12) float varianceInverseTransvMomentum = 1. / 12; float derivativeTheta2 = pow(cos(globalTheta) / transverseMomentum, 2); @@ -394,7 +394,7 @@ float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, TrajectorySeed SeedingOTEDProducer::createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, const DetId& id, - const Propagator& prop) { + const Propagator& prop) const { PTrajectoryStateOnDet seedTSOS = trajectoryStateTransform::persistentState(tsos, id.rawId()); return TrajectorySeed(seedTSOS, container, prop.propagationDirection()); } From 758d273d7a94c91825f9c188f930c9f9d2f93ee1 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 8 Sep 2020 17:21:37 -0500 Subject: [PATCH 388/778] more improvements to SeedingOTEDProducer --- .../interface/VectorHitMomentumHelper.h | 4 +- .../plugins/SeedingOTEDProducer.cc | 39 ++++++++----------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h index f0c37453093fe..dbe8b1096fc2c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h @@ -13,11 +13,11 @@ class VectorHitMomentumHelper { } ~VectorHitMomentumHelper() {} - float transverseMomentum(VectorHit& vh) const { + float transverseMomentum(const VectorHit& vh) const { float rho = 1. / vh.curvatureORphi(VectorHit::curvatureMode).first; return (intermediate * rho); } - float momentum(VectorHit& vh) const { return transverseMomentum(vh) / (1. * sin(vh.theta())); } + float momentum(const VectorHit& vh) const { return transverseMomentum(vh) / (1. * sin(vh.theta())); } private: float intermediate; diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 7213cb57758e9..330a44eeb88f6 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -44,15 +44,15 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { TrajectorySeedCollection run(edm::Handle<VectorHitCollectionNew>); unsigned int checkLayer(unsigned int iidd); - std::vector<VectorHit> collectVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); - void printVHsOnLayer(edm::Handle<VectorHitCollectionNew>, unsigned int); - const TrajectoryStateOnSurface buildInitialTSOS(VectorHit&) const; + std::vector<VectorHit> collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); + void printVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); + const TrajectoryStateOnSurface buildInitialTSOS(const VectorHit&) const; AlgebraicSymMatrix assign44To55(AlgebraicSymMatrix) const; std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator&, const TrackingRecHit& hit) const; float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) const; - float computeInverseMomentumError(VectorHit& vh, + float computeInverseMomentumError(const VectorHit& vh, const float globalTheta, const double sigmaZ_beamSpot, const double transverseMomentum) const; @@ -165,9 +165,9 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio TrajectorySeedCollection result; //check if all the first three layers have VHs - std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(VHs, 1); - std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(VHs, 2); - std::vector<VectorHit> vhSeedsL3 = collectVHsOnLayer(VHs, 3); + std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(*(VHs.product()), 1); + std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(*(VHs.product()), 2); + std::vector<VectorHit> vhSeedsL3 = collectVHsOnLayer(*(VHs.product()), 3); if (vhSeedsL1.empty() || vhSeedsL2.empty() || vhSeedsL3.empty()) { return result; } @@ -180,7 +180,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio Propagator* buildingPropagator = &*propagator_->clone(); buildingPropagator->setPropagationDirection(alongMomentum); - for (auto hitL3 : vhSeedsL3) { + for (const auto& hitL3 : vhSeedsL3) { //building a tsos out of a VectorHit const TrajectoryStateOnSurface initialTSOS = buildInitialTSOS(hitL3); float signZ = copysign(1.0, initialTSOS.globalPosition().z()); @@ -196,11 +196,6 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio std::vector<TrajectoryMeasurement> measurementsL2 = layerMeasurements_->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator_); - //other options - //LayerMeasurements::SimpleHitContainer hits; - //layerMeasurements->recHits(hits, *barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); - //auto && measurementsL2G = layerMeasurements->groupedMeasurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator); - std::vector<TrajectoryMeasurement>::iterator measurementsL2end = std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid()); measurementsL2.erase(measurementsL2end, measurementsL2.end()); @@ -281,12 +276,11 @@ unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { return 0; } -std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<VectorHitCollectionNew> VHs, +std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>& input, unsigned int layerNumber) { - const VectorHitCollectionNew& input = *VHs; std::vector<VectorHit> VHsOnLayer; if (!input.empty()) { - for (auto DSViter : input) { + for (const auto& DSViter : input) { if (checkLayer(DSViter.id()) == layerNumber) { for (const auto& vh : DSViter) { VHsOnLayer.push_back(vh); @@ -298,21 +292,20 @@ std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(edm::Handle<Vector return VHsOnLayer; } -void SeedingOTEDProducer::printVHsOnLayer(edm::Handle<VectorHitCollectionNew> VHs, unsigned int layerNumber) { - const VectorHitCollectionNew& input = *VHs; +void SeedingOTEDProducer::printVHsOnLayer(const edmNew::DetSetVector<VectorHit>& input, unsigned int layerNumber) { if (!input.empty()) { - for (auto DSViter : input) { + for (const auto& DSViter : input) { for (const auto& vh : DSViter) { if (checkLayer(DSViter.id()) == layerNumber) - std::cout << " VH in layer " << layerNumber << " >> " << vh << std::endl; + LogTrace("SeedingOTEDProducer") << " VH in layer " << layerNumber << " >> " << vh; } } } else { - std::cout << " No VHs in layer " << layerNumber << "." << std::endl; + LogTrace("SeedingOTEDProducer") << " No VHs in layer " << layerNumber << "."; } } -const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(VectorHit& vHit) const { +const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const VectorHit& vHit) const { // having fun with theta Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); float theta = gv.theta(); @@ -378,7 +371,7 @@ float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const do return pow(derivative2 * vh.lowerGlobalPosErr().czz() + derivative2 * pow(sigmaZ_beamSpot, 2), 0.5); } -float SeedingOTEDProducer::computeInverseMomentumError(VectorHit& vh, +float SeedingOTEDProducer::computeInverseMomentumError(const VectorHit& vh, const float globalTheta, const double sigmaZ_beamSpot, const double transverseMomentum) const { From 754d08c0b093ced8aab9810ee8bb8f765694144e Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 8 Sep 2020 17:44:02 -0500 Subject: [PATCH 389/778] more improvements to SeedingOTEDProducer and Phase2OTBarrelRodBuilder --- .../plugins/TkStackMeasurementDet.cc | 3 --- .../TkDetLayers/src/Phase2OTBarrelRodBuilder.cc | 16 ++++++---------- .../plugins/SeedingOTEDProducer.cc | 10 +++------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index ed13d52d1e0de..176211395063c 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -39,8 +39,6 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj begin = &(data.phase2OTData().handle()->data().front()); } - //VectorHitBuilderAlgorithm* algo = theMatcher; - //VectorHitBuilderAlgorithm* vhalgo = dynamic_cast<VectorHitBuilderAlgorithm *>(algobase); LogTrace("MeasurementTracker") << "TkStackMeasurementDet::recHits algo has been set" << std::endl; const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); @@ -101,7 +99,6 @@ bool TkStackMeasurementDet::measurements(const TrajectoryStateOnSurface& stateOn for (auto&& hit : allHits) { std::pair<bool, double> diffEst = est.estimate(stateOnThisDet, *hit); - //LogTrace("MeasurementTracker")<< "State on this Det: " << stateOnThisDet ; LogDebug("MeasurementTracker") << "New vh added with chi2: " << diffEst.second; if (diffEst.first) result.add(std::move(hit), diffEst.second); diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc index 0153f2bab2861..6ac4e8c0248fb 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc @@ -23,7 +23,6 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 for (vector<const GeometricDet*>::const_iterator compGeometricDets = allGeometricDets.begin(); compGeometricDets != allGeometricDets.end(); compGeometricDets++) { - //LogTrace("TkDetLayers") << " compGeometricDets.positionBounds().perp() " << (*compGeometricDets)->positionBounds().perp() << std::endl; meanR = meanR + (*compGeometricDets)->positionBounds().perp(); } meanR = meanR / allGeometricDets.size(); @@ -64,14 +63,11 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 vector<const GeomDet*> outerGeomDetBrothers; double meanRBrothers = 0; - for (vector<const GeometricDet*>::const_iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); - it++) { - compGeometricDets = (*it)->components(); + for (auto& it : allGeometricDets) { + compGeometricDets = it->components(); if (compGeometricDets.size() != 2) { LogDebug("TkDetLayers") << " Stack not with two components but with " << compGeometricDets.size() << std::endl; } else { - //LogTrace("TkDetLayers") << " compGeometricDets[0]->positionBounds().perp() " << compGeometricDets[0]->positionBounds().perp() << std::endl; - //LogTrace("TkDetLayers") << " compGeometricDets[1]->positionBounds().perp() " << compGeometricDets[1]->positionBounds().perp() << std::endl; meanR = meanR + compGeometricDets[0]->positionBounds().perp(); meanRBrothers = meanRBrothers + compGeometricDets[1]->positionBounds().perp(); } @@ -81,10 +77,10 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; LogDebug("TkDetLayers") << " meanR Upper " << meanRBrothers << std::endl; - for (vector<const GeometricDet*>::iterator it = allGeometricDets.begin(); it != allGeometricDets.end(); it++) { - compGeometricDets = (*it)->components(); + for (auto& it : allGeometricDets) { + compGeometricDets = it->components(); const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalID()); - LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[0]->geographicalID().rawId() << std::endl; + LogTrace("TkDetLayers") << " inserting " << compGeometricDets[0]->geographicalID().rawId() << std::endl; if (compGeometricDets[0]->positionBounds().perp() < meanR) innerGeomDets.push_back(theGeomDet); @@ -93,7 +89,7 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 outerGeomDets.push_back(theGeomDet); const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalID()); - LogTrace("TkDetLayers") << " inserisco " << compGeometricDets[1]->geographicalID().rawId() << std::endl; + LogTrace("TkDetLayers") << " inserting " << compGeometricDets[1]->geographicalID().rawId() << std::endl; if (compGeometricDets[1]->positionBounds().perp() < meanRBrothers) innerGeomDetBrothers.push_back(theGeomDetBrother); diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 330a44eeb88f6..600bab3ea71c0 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -118,20 +118,16 @@ void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descr } void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { - std::unique_ptr<TrajectorySeedCollection> seedsWithVHs(new TrajectorySeedCollection()); + auto seedsWithVHs = std::make_unique<TrajectorySeedCollection>(); tkTopo_ = &es.getData(topoToken_); -/* edm::ESHandle<MeasurementTracker> measurementTrackerHandle; - measurementTrackerHandle = es.getHandle(measurementTrackerToken_); - measurementTracker_ = measurementTrackerHandel.product();*/ edm::ESHandle<MeasurementTracker> measurementTrackerHandle = es.getHandle(measurementTrackerToken_); measurementTracker_ = measurementTrackerHandle.product(); edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; event.getByToken(tkMeasEventToken_, measurementTrackerEvent); - //LayerMeasurements layerMeasurements_(*measurementTrackerHandle, *measurementTrackerEvent); layerMeasurements_ = std::make_unique<LayerMeasurements>(*measurementTrackerHandle, *measurementTrackerEvent); estimator_ = &es.getData(estToken_); @@ -153,8 +149,8 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) event.getByToken(vhProducerToken_, vhs); TrajectorySeedCollection const& tempSeeds = run(vhs); - for (TrajectorySeedCollection::const_iterator qIt = tempSeeds.begin(); qIt < tempSeeds.end(); ++qIt) { - seedsWithVHs->push_back(*qIt); + for (auto& qIt : tempSeeds) { + seedsWithVHs->push_back(qIt); } seedsWithVHs->shrink_to_fit(); From 403ac04cf093c516186d6b156246c199f26c788b Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 8 Sep 2020 19:22:14 -0500 Subject: [PATCH 390/778] Kevin's comments on a couple of files --- .../test/ClustersValidationTGraph.cc | 186 +++----- .../test/VectorHitsValidation.cc | 429 ++++++++---------- .../test/VectorHitsValidation.h | 18 +- .../src/TrackClusterRemoverPhase2.cc | 2 +- RecoTracker/CkfPattern/src/PrintoutHelper.cc | 5 +- RecoTracker/MeasurementDet/BuildFile.xml | 2 +- 6 files changed, 249 insertions(+), 393 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc index bdd97131c2c34..e55abd65260f7 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc @@ -3,7 +3,7 @@ #include <algorithm> #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -67,7 +67,7 @@ struct ClusterHistos { TH1F* otherSimHits; }; -class Phase2TrackerClusterizerValidationTGraph : public edm::EDAnalyzer { +class Phase2TrackerClusterizerValidationTGraph : public edm::one::EDAnalyzer<edm::one::SharedResources> { public: typedef std::map<unsigned int, std::vector<PSimHit> > SimHitsMap; typedef std::map<unsigned int, SimTrack> SimTracksMap; @@ -89,10 +89,10 @@ class Phase2TrackerClusterizerValidationTGraph : public edm::EDAnalyzer { edm::EDGetTokenT<edm::PSimHitContainer> simHitsToken_; edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; edm::EDGetTokenT<edm::SimVertexContainer> simVerticesToken_; - const TrackerGeometry* tkGeom; - const TrackerTopology* tkTopo; + const TrackerGeometry* tkGeom_; + const TrackerTopology* tkTopo_; - TTree* tree; + TTree* tree_; TGraph* trackerLayout_[3]; TGraph* trackerLayoutXY_[3]; TGraph* trackerLayoutXYBar_; @@ -117,26 +117,26 @@ void Phase2TrackerClusterizerValidationTGraph::beginJob() { fs->file().cd("/"); TFileDirectory td = fs->mkdir("Common"); //Create common ntuple - tree = td.make<TTree>("Phase2TrackerClusters", "Phase2TrackerClusters"); + tree_ = td.make<TTree>("Phase2TrackerClusters", "Phase2TrackerClusters"); // Create common histograms - trackerLayout_[0] = td.make<TGraph>(); //"RVsZ_Mixed", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[0] = td.make<TGraph>(); trackerLayout_[0]->SetName("RVsZ_Mixed"); - trackerLayout_[1] = td.make<TGraph>(); //"RVsZ_Pixel", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[1] = td.make<TGraph>(); trackerLayout_[1]->SetName("RVsZ_Pixel"); - trackerLayout_[2] = td.make<TGraph>(); //"RVsZ_Strip", "R vs. z position", 6000, -300.0, 300.0, 1200, 0.0, 120.0); + trackerLayout_[2] = td.make<TGraph>(); trackerLayout_[2]->SetName("RVsZ_Strip"); trackerLayoutXY_[0] = - td.make<TGraph>(); //"XVsY_Mixed", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); trackerLayoutXY_[0]->SetName("YVsX_Mixed"); trackerLayoutXY_[1] = - td.make<TGraph>(); //"XVsY_Pixel", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); trackerLayoutXY_[1]->SetName("YVsX_Pixel"); trackerLayoutXY_[2] = - td.make<TGraph>(); //"XVsY_Strip", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); trackerLayoutXY_[2]->SetName("YVsX_Strip"); - trackerLayoutXYBar_ = td.make<TGraph>(); //"XVsYBar", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXYBar_ = td.make<TGraph>(); trackerLayoutXYBar_->SetName("YVsXBar"); - trackerLayoutXYEC_ = td.make<TGraph>(); //"XVsYEC", "x vs. y position", 2400, -120.0, 120.0, 2400, -120.0, 120.0); + trackerLayoutXYEC_ = td.make<TGraph>(); trackerLayoutXYEC_->SetName("YVsXEC"); } @@ -156,8 +156,6 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, // Get the SimHits edm::Handle<edm::PSimHitContainer> simHitsRaw; event.getByToken(simHitsToken_, simHitsRaw); - // edm::Handle< edm::PSimHitContainer > simHitsRawEndcap; - // event.getByLabel("g4SimHits", "TrackerHitsPixelEndcapLowTof", simHitsRawEndcap); // Get the SimTracks edm::Handle<edm::SimTrackContainer> simTracksRaw; @@ -170,77 +168,73 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, // Get the geometry edm::ESHandle<TrackerGeometry> geomHandle; eventSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); - tkGeom = &(*geomHandle); + tkGeom_ = &(*geomHandle); edm::ESHandle<TrackerTopology> tTopoHandle; eventSetup.get<TrackerTopologyRcd>().get(tTopoHandle); - tkTopo = tTopoHandle.product(); + tkTopo_ = tTopoHandle.product(); //set up for tree int layer_number; - //int track_id; int module_id; int module_number; int module_type; //1: pixel, 2: strip float x_global, y_global, z_global; float x_local, y_local, z_local; - tree->Branch("layer_number", &layer_number, "layer_number/I"); - //tree -> Branch("track_id",&track_id,"track_id/I"); - tree->Branch("module_id", &module_id, "module_id/I"); - tree->Branch("module_type", &module_type, "module_type/I"); - tree->Branch("module_number", &module_number, "module_number/I"); - tree->Branch("x_global", &x_global, "x_global/F"); - tree->Branch("y_global", &y_global, "y_global/F"); - tree->Branch("z_global", &z_global, "z_global/F"); - tree->Branch("x_local", &x_local, "x_local/F"); - tree->Branch("y_local", &y_local, "y_local/F"); - tree->Branch("z_local", &z_local, "z_local/F"); + tree_->Branch("layer_number", &layer_number, "layer_number/I"); + tree_->Branch("module_id", &module_id, "module_id/I"); + tree_->Branch("module_type", &module_type, "module_type/I"); + tree_->Branch("module_number", &module_number, "module_number/I"); + tree_->Branch("x_global", &x_global, "x_global/F"); + tree_->Branch("y_global", &y_global, "y_global/F"); + tree_->Branch("z_global", &z_global, "z_global/F"); + tree_->Branch("x_local", &x_local, "x_local/F"); + tree_->Branch("y_local", &y_local, "y_local/F"); + tree_->Branch("z_local", &z_local, "z_local/F"); // Rearrange the simTracks for ease of use <simTrackID, simTrack> SimTracksMap simTracks; - for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end(); - ++simTrackIt) - simTracks.insert(std::pair<unsigned int, SimTrack>(simTrackIt->trackId(), *simTrackIt)); + for (const auto& simTrackIt : *simTracksRaw) + simTracks.emplace(std::pair<unsigned int, SimTrack>(simTrackIt.trackId(), simTrackIt)); // Rearrange the simHits by detUnit // Rearrange the simHits for ease of use SimHitsMap simHitsDetUnit; SimHitsMap simHitsTrackId; - for (edm::PSimHitContainer::const_iterator simHitIt(simHitsRaw->begin()); simHitIt != simHitsRaw->end(); ++simHitIt) { - SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt->detUnitId())); + for (const auto& simHitIt: *simHitsRaw) { + SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt.detUnitId())); if (simHitsDetUnitIt == simHitsDetUnit.end()) { std::pair<SimHitsMap::iterator, bool> newIt(simHitsDetUnit.insert( - std::pair<unsigned int, std::vector<PSimHit> >(simHitIt->detUnitId(), std::vector<PSimHit>()))); + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt.detUnitId(), std::vector<PSimHit>()))); simHitsDetUnitIt = newIt.first; } - simHitsDetUnitIt->second.push_back(*simHitIt); - SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt->trackId())); + simHitsDetUnitIt->second.push_back(simHitIt); + SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt.trackId())); if (simHitsTrackIdIt == simHitsTrackId.end()) { std::pair<SimHitsMap::iterator, bool> newIt(simHitsTrackId.insert( - std::pair<unsigned int, std::vector<PSimHit> >(simHitIt->trackId(), std::vector<PSimHit>()))); + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt.trackId(), std::vector<PSimHit>()))); simHitsTrackIdIt = newIt.first; } - simHitsTrackIdIt->second.push_back(*simHitIt); + simHitsTrackIdIt->second.push_back(simHitIt); } // ValidationTGraph unsigned int nClustersTot(0), nClustersPixelTot(0), nClustersStripTot(0); // Loop over modules - for (Phase2TrackerCluster1DCollectionNew::const_iterator DSViter = clusters->begin(); DSViter != clusters->end(); - ++DSViter) { + for (const auto& DSViter : *clusters) { // Get the detector unit's id - unsigned int rawid(DSViter->detId()); + unsigned int rawid(DSViter.detId()); module_id = rawid; DetId detId(rawid); - layer_number = getLayerNumber(detId, tkTopo); - module_number = getModuleNumber(detId, tkTopo); - unsigned int layer(getLayerNumber(detId, tkTopo)); + layer_number = getLayerNumber(detId, tkTopo_); + module_number = getModuleNumber(detId, tkTopo_); + unsigned int layer(getLayerNumber(detId, tkTopo_)); // Get the geometry of the tracker - const GeomDetUnit* geomDetUnit(tkGeom->idToDetUnit(detId)); + const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(detId)); const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); const PixelTopology& topol = theGeomDet->specificTopology(); @@ -256,10 +250,9 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, unsigned int nClustersPixel(0), nClustersStrip(0); // Loop over the clusters in the detector unit - for (edmNew::DetSet<Phase2TrackerCluster1D>::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); - ++clustIt) { + for (const auto& clustIt : DSViter) { // Cluster related variables - MeasurementPoint mpClu(clustIt->center(), clustIt->column() + 0.5); + MeasurementPoint mpClu(clustIt.center(), clustIt.column() + 0.5); Local3DPoint localPosClu = geomDetUnit->topology().localPosition(mpClu); x_local = localPosClu.x(); y_local = localPosClu.y(); @@ -290,7 +283,7 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, histogramLayer->second.localPosXY[1]->SetPoint(nClustersPixelTot, localPosClu.x(), localPosClu.y()); histogramLayer->second.globalPosXY[1]->SetPoint(nClustersPixelTot, globalPosClu.x(), globalPosClu.y()); - histogramLayer->second.clusterSizePixel->Fill(clustIt->size()); + histogramLayer->second.clusterSizePixel->Fill(clustIt.size()); ++nClustersPixel; ++nClustersPixelTot; } @@ -302,7 +295,7 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, histogramLayer->second.localPosXY[2]->SetPoint(nClustersStripTot, localPosClu.x(), localPosClu.y()); histogramLayer->second.globalPosXY[2]->SetPoint(nClustersStripTot, globalPosClu.x(), globalPosClu.y()); - histogramLayer->second.clusterSizeStrip->Fill(clustIt->size()); + histogramLayer->second.clusterSizeStrip->Fill(clustIt.size()); ++nClustersStrip; ++nClustersStripTot; } @@ -312,81 +305,22 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, std::vector<unsigned int> clusterSimTrackIds; // Get all the simTracks that form the cluster - for (unsigned int i(0); i < clustIt->size(); ++i) { + for (unsigned int i(0); i < clustIt.size(); ++i) { unsigned int channel(PixelDigi::pixelToChannel( - clustIt->firstRow() + i, - clustIt - ->column())); // Here we have to use the old pixelToChannel function (not Phase2TrackerDigi but PixelDigi), change this when using new Digis + clustIt.firstRow() + i, + clustIt.column())); // Here we have to use the old pixelToChannel function (not Phase2TrackerDigi but PixelDigi), change this when using new Digis unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detId, channel)); clusterSimTrackIds.push_back(simTrackId); } - /* - // SimHits related variables - - - - unsigned int primarySimHits(0); - unsigned int otherSimHits(0); - - for (edm::PSimHitContainer::const_iterator hitIt(simHitsRaw->begin()); hitIt != simHitsRaw->end(); ++hitIt) { - if (rawid == hitIt->detUnitId() and std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt->trackId()) != clusterSimTrackIds.end()) { - Local3DPoint localPosHit(hitIt->localPosition()); - - histogramLayer->second.deltaXClusterSimHits[0]->Fill(localPosClu.x() - localPosHit.x()); - histogramLayer->second.deltaYClusterSimHits[0]->Fill(localPosClu.y() - localPosHit.y()); - - // Pixel module - if (topol.ncolumns() == 32) { - histogramLayer->second.deltaXClusterSimHits[1]->Fill(localPosClu.x() - localPosHit.x()); - histogramLayer->second.deltaYClusterSimHits[1]->Fill(localPosClu.y() - localPosHit.y()); - } - // Strip module - else if (topol.ncolumns() == 2) { - histogramLayer->second.deltaXClusterSimHits[2]->Fill(localPosClu.x() - localPosHit.x()); - histogramLayer->second.deltaYClusterSimHits[2]->Fill(localPosClu.y() - localPosHit.y()); - } - - ++otherSimHits; - - std::map< unsigned int, SimTrack >::const_iterator simTrackIt(simTracks.find(hitIt->trackId())); - if (simTrackIt == simTracks.end()) continue; - - // Primary particles only - unsigned int processType(hitIt->processType()); - if (simTrackIt->second.vertIndex() == 0 and (processType == 2 || processType == 7 || processType == 9 || processType == 11 || processType == 13 || processType == 15)) { - histogramLayer->second.deltaXClusterSimHits_P[0]->Fill(localPosClu.x() - localPosHit.x()); - histogramLayer->second.deltaYClusterSimHits_P[0]->Fill(localPosClu.y() - localPosHit.y()); - - // Pixel module - if (topol.ncolumns() == 32) { - histogramLayer->second.deltaXClusterSimHits_P[1]->Fill(localPosClu.x() - localPosHit.x()); - histogramLayer->second.deltaYClusterSimHits_P[1]->Fill(localPosClu.y() - localPosHit.y()); - } - // Strip module - else if (topol.ncolumns() == 2) { - histogramLayer->second.deltaXClusterSimHits_P[2]->Fill(localPosClu.x() - localPosHit.x()); - histogramLayer->second.deltaYClusterSimHits_P[2]->Fill(localPosClu.y() - localPosHit.y()); - } - - ++primarySimHits; - } - } - } - - otherSimHits -= primarySimHits; - - histogramLayer->second.primarySimHits->Fill(primarySimHits); - histogramLayer->second.otherSimHits->Fill(otherSimHits); -*/ - } + } if (nClustersPixel) histogramLayer->second.numberClusterPixel->Fill(nClustersPixel); if (nClustersStrip) histogramLayer->second.numberClusterStrip->Fill(nClustersStrip); nClustersTot++; - tree->Fill(); + tree_->Fill(); } } @@ -467,37 +401,37 @@ std::map<unsigned int, ClusterHistos>::iterator Phase2TrackerClusterizerValidati histoName.str(""); histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; local_histos.localPosXY[0] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + td.make<TGraph>(); local_histos.localPosXY[0]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Local_Position_XY_Pixel" << tag.c_str() << id; local_histos.localPosXY[1] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + td.make<TGraph>(); local_histos.localPosXY[1]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Local_Position_XY_Strip" << tag.c_str() << id; local_histos.localPosXY[2] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + td.make<TGraph>(); local_histos.localPosXY[2]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; local_histos.globalPosXY[0] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_Pixel" << tag.c_str() << id; local_histos.globalPosXY[1] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_Strip" << tag.c_str() << id; local_histos.globalPosXY[2] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); /* @@ -585,8 +519,6 @@ unsigned int Phase2TrackerClusterizerValidationTGraph::getLayerNumber(const DetI return (topo->pxbLayer(detid)); else if (detid.subdetId() == PixelSubdetector::PixelEndcap) return (100 * topo->pxfSide(detid) + topo->pxfDisk(detid)); - else - return 999; } return 999; } @@ -611,9 +543,9 @@ unsigned int Phase2TrackerClusterizerValidationTGraph::getSimTrackId( edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter(siphase2SimLinks->find(detId)); if (DSViter == siphase2SimLinks->end()) return 0; - for (edm::DetSet<PixelDigiSimLink>::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { - if (channel == it->channel()) - return it->SimTrackId(); + for (const auto& it : DSViter->data) { + if (channel == it.channel()) + return it.SimTrackId(); } return 0; } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 73fe206403763..548bac202e449 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -30,7 +30,7 @@ void VectorHitsBuilderValidation::beginJob() { TFileDirectory td = fs->mkdir("Common"); //Create common ntuple - tree = td.make<TTree>("VectorHits", "VectorHits"); + tree_ = td.make<TTree>("VectorHits", "VectorHits"); // Create common graphs TFileDirectory tdGloPos = td.mkdir("GlobalPositions"); @@ -68,10 +68,6 @@ void VectorHitsBuilderValidation::beginJob() { //drawing VHs arrows TFileDirectory tdArr = td.mkdir("Directions"); - //VHXY_[0] = tdArr.make< TCanvas >(); VHXY_[0] -> SetName("YVsX_Mixed"); - //VHXY_[1] = tdArr.make< TCanvas >(); VHXY_[1] -> SetName("YVsX_Pixel"); - //VHXY_[2] = tdArr.make< TCanvas >(); VHXY_[2] -> SetName("YVsX_Strip"); - TFileDirectory tdWid = td.mkdir("CombinatorialStudies"); ParallaxCorrectionRZ_ = tdWid.make<TH2D>("ParallaxCorrectionRZ", "ParallaxCorrectionRZ", 100, 0., 300., 100., 0., 120.); @@ -89,10 +85,6 @@ void VectorHitsBuilderValidation::beginJob() { VHrejTrue_signal_Layer_ = tdWid.make<TH1F>("VHrejTrueSignalLayer", "VHrejTrueSignalLayer", 250, 0., 250.); VHrejTrue_signal_Layer_->SetName("VHrejected_true_signal"); - VHaccTrueLayer_ratio = tdWid.make<TH1F>("VHaccTrueLayer_ratio", "VHaccTrueLayer_ratio", 250, 0., 250.); - VHaccTrueLayer_ratio->SetName("VHaccepted_true_ratio"); - VHrejTrueLayer_ratio = tdWid.make<TH1F>("VHrejTrueLayer_ratio", "VHrejTrueLayer_ratio", 250, 0., 250.); - VHrejTrueLayer_ratio->SetName("VHrejected_true_ratio"); } void VectorHitsBuilderValidation::endJob() {} @@ -114,7 +106,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev // load the cpe via the eventsetup edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpeHandle; eventSetup.get<TkPhase2OTCPERecord>().get(cpeTag_, cpeHandle); - cpe = cpeHandle.product(); + cpe_ = cpeHandle.product(); // Get the Phase2 DigiSimLink edm::Handle<edm::DetSetVector<PixelDigiSimLink> > siphase2SimLinks; @@ -123,8 +115,6 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev // Get the SimHits edm::Handle<edm::PSimHitContainer> simHitsRaw; event.getByToken(simHitsToken_, simHitsRaw); - // edm::Handle< edm::PSimHitContainer > simHitsRawEndcap; - // event.getByLabel("g4SimHits", "TrackerHitsPixelEndcapLowTof", simHitsRawEndcap); // Get the SimTracks edm::Handle<edm::SimTrackContainer> simTracksRaw; @@ -137,16 +127,16 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev // Get the geometry edm::ESHandle<TrackerGeometry> geomHandle; eventSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); - tkGeom = &(*geomHandle); + tkGeom_ = &(*geomHandle); // Get the Topology edm::ESHandle<TrackerTopology> tTopoHandle; eventSetup.get<TrackerTopologyRcd>().get(tTopoHandle); - tkTopo = tTopoHandle.product(); + tkTopo_ = tTopoHandle.product(); edm::ESHandle<MagneticField> magFieldHandle; eventSetup.get<IdealMagneticFieldRecord>().get(magFieldHandle); - magField = magFieldHandle.product(); + magField_ = magFieldHandle.product(); //Tracking Particle collection edm::Handle<TrackingParticleCollection> TPCollectionH; @@ -200,109 +190,106 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev float width, deltaXlocal; unsigned int processType(99); - tree->Branch("event", &eventNum, "eventNum/I"); - tree->Branch("accepted", &VHacc, "VHacc/I"); - tree->Branch("rejected", &VHrej, "VHrej/I"); - tree->Branch("layer", &layer, "layer/I"); - tree->Branch("module_id", &module_id, "module_id/I"); - tree->Branch("module_type", &module_type, "module_type/I"); - tree->Branch("module_number", &module_number, "module_number/I"); - tree->Branch("vh_isTrue", &vh_isTrue, "vh_isTrue/I"); - tree->Branch("x_global", &x_global, "x_global/F"); - tree->Branch("y_global", &y_global, "y_global/F"); - tree->Branch("z_global", &z_global, "z_global/F"); - tree->Branch("vh_x_local", &vh_x_local, "vh_x_local/F"); - tree->Branch("vh_y_local", &vh_y_local, "vh_y_local/F"); - tree->Branch("vh_x_lError", &vh_x_le, "vh_x_le/F"); - tree->Branch("vh_y_lError", &vh_y_le, "vh_y_le/F"); - tree->Branch("curvature", &curvature, "curvature/F"); - tree->Branch("chi2", &chi2, "chi2/F"); - tree->Branch("phi", &phi, "phi/F"); - tree->Branch("QOverP", &QOverP, "QOverP/F"); - tree->Branch("QOverPT", &QOverPT, "QOverPT/F"); - tree->Branch("low_tp_id", &low_tp_id, "low_tp_id/I"); - tree->Branch("upp_tp_id", &upp_tp_id, "upp_tp_id/I"); - tree->Branch("vh_sim_trackPt", &vh_sim_trackPt, "vh_sim_trackPt/F"); - tree->Branch("sim_x_local", &sim_x_local, "sim_x_local/F"); - tree->Branch("sim_y_local", &sim_y_local, "sim_y_local/F"); - tree->Branch("sim_x_global", &sim_x_global, "sim_x_global/F"); - tree->Branch("sim_y_global", &sim_y_global, "sim_y_global/F"); - tree->Branch("sim_z_global", &sim_z_global, "sim_z_global/F"); - tree->Branch("low_x_global", &low_x_global, "low_x_global/F"); - tree->Branch("low_y_global", &low_y_global, "low_y_global/F"); - tree->Branch("low_z_global", &low_z_global, "low_z_global/F"); - tree->Branch("low_xx_global_err", &low_xx_global_err, "low_xx_global_err/F"); - tree->Branch("low_yy_global_err", &low_yy_global_err, "low_yy_global_err/F"); - tree->Branch("low_zz_global_err", &low_zz_global_err, "low_zz_global_err/F"); - tree->Branch("low_xy_global_err", &low_xy_global_err, "low_xy_global_err/F"); - tree->Branch("low_zx_global_err", &low_zx_global_err, "low_zx_global_err/F"); - tree->Branch("low_zy_global_err", &low_zy_global_err, "low_zy_global_err/F"); - tree->Branch("upp_x_global", &upp_x_global, "upp_x_global/F"); - tree->Branch("upp_y_global", &upp_y_global, "upp_y_global/F"); - tree->Branch("upp_z_global", &upp_z_global, "upp_z_global/F"); - tree->Branch("upp_xx_global_err", &upp_xx_global_err, "upp_xx_global_err/F"); - tree->Branch("upp_yy_global_err", &upp_yy_global_err, "upp_yy_global_err/F"); - tree->Branch("upp_zz_global_err", &upp_zz_global_err, "upp_zz_global_err/F"); - tree->Branch("upp_xy_global_err", &upp_xy_global_err, "upp_xy_global_err/F"); - tree->Branch("upp_zx_global_err", &upp_zx_global_err, "upp_zx_global_err/F"); - tree->Branch("upp_zy_global_err", &upp_zy_global_err, "upp_zy_global_err/F"); - tree->Branch("deltaXVHSimHits", &deltaXVHSimHits, "deltaXVHSimHits/F"); - tree->Branch("deltaYVHSimHits", &deltaYVHSimHits, "deltaYVHSimHits/F"); - tree->Branch("multiplicity", &multiplicity, "multiplicity/I"); - tree->Branch("width", &width, "width/F"); - tree->Branch("deltaXlocal", &deltaXlocal, "deltaXlocal/F"); - tree->Branch("processType", &processType, "processType/i"); + tree_->Branch("event", &eventNum, "eventNum/I"); + tree_->Branch("accepted", &VHacc, "VHacc/I"); + tree_->Branch("rejected", &VHrej, "VHrej/I"); + tree_->Branch("layer", &layer, "layer/I"); + tree_->Branch("module_id", &module_id, "module_id/I"); + tree_->Branch("module_type", &module_type, "module_type/I"); + tree_->Branch("module_number", &module_number, "module_number/I"); + tree_->Branch("vh_isTrue", &vh_isTrue, "vh_isTrue/I"); + tree_->Branch("x_global", &x_global, "x_global/F"); + tree_->Branch("y_global", &y_global, "y_global/F"); + tree_->Branch("z_global", &z_global, "z_global/F"); + tree_->Branch("vh_x_local", &vh_x_local, "vh_x_local/F"); + tree_->Branch("vh_y_local", &vh_y_local, "vh_y_local/F"); + tree_->Branch("vh_x_lError", &vh_x_le, "vh_x_le/F"); + tree_->Branch("vh_y_lError", &vh_y_le, "vh_y_le/F"); + tree_->Branch("curvature", &curvature, "curvature/F"); + tree_->Branch("chi2", &chi2, "chi2/F"); + tree_->Branch("phi", &phi, "phi/F"); + tree_->Branch("QOverP", &QOverP, "QOverP/F"); + tree_->Branch("QOverPT", &QOverPT, "QOverPT/F"); + tree_->Branch("low_tp_id", &low_tp_id, "low_tp_id/I"); + tree_->Branch("upp_tp_id", &upp_tp_id, "upp_tp_id/I"); + tree_->Branch("vh_sim_trackPt", &vh_sim_trackPt, "vh_sim_trackPt/F"); + tree_->Branch("sim_x_local", &sim_x_local, "sim_x_local/F"); + tree_->Branch("sim_y_local", &sim_y_local, "sim_y_local/F"); + tree_->Branch("sim_x_global", &sim_x_global, "sim_x_global/F"); + tree_->Branch("sim_y_global", &sim_y_global, "sim_y_global/F"); + tree_->Branch("sim_z_global", &sim_z_global, "sim_z_global/F"); + tree_->Branch("low_x_global", &low_x_global, "low_x_global/F"); + tree_->Branch("low_y_global", &low_y_global, "low_y_global/F"); + tree_->Branch("low_z_global", &low_z_global, "low_z_global/F"); + tree_->Branch("low_xx_global_err", &low_xx_global_err, "low_xx_global_err/F"); + tree_->Branch("low_yy_global_err", &low_yy_global_err, "low_yy_global_err/F"); + tree_->Branch("low_zz_global_err", &low_zz_global_err, "low_zz_global_err/F"); + tree_->Branch("low_xy_global_err", &low_xy_global_err, "low_xy_global_err/F"); + tree_->Branch("low_zx_global_err", &low_zx_global_err, "low_zx_global_err/F"); + tree_->Branch("low_zy_global_err", &low_zy_global_err, "low_zy_global_err/F"); + tree_->Branch("upp_x_global", &upp_x_global, "upp_x_global/F"); + tree_->Branch("upp_y_global", &upp_y_global, "upp_y_global/F"); + tree_->Branch("upp_z_global", &upp_z_global, "upp_z_global/F"); + tree_->Branch("upp_xx_global_err", &upp_xx_global_err, "upp_xx_global_err/F"); + tree_->Branch("upp_yy_global_err", &upp_yy_global_err, "upp_yy_global_err/F"); + tree_->Branch("upp_zz_global_err", &upp_zz_global_err, "upp_zz_global_err/F"); + tree_->Branch("upp_xy_global_err", &upp_xy_global_err, "upp_xy_global_err/F"); + tree_->Branch("upp_zx_global_err", &upp_zx_global_err, "upp_zx_global_err/F"); + tree_->Branch("upp_zy_global_err", &upp_zy_global_err, "upp_zy_global_err/F"); + tree_->Branch("deltaXVHSimHits", &deltaXVHSimHits, "deltaXVHSimHits/F"); + tree_->Branch("deltaYVHSimHits", &deltaYVHSimHits, "deltaYVHSimHits/F"); + tree_->Branch("multiplicity", &multiplicity, "multiplicity/I"); + tree_->Branch("width", &width, "width/F"); + tree_->Branch("deltaXlocal", &deltaXlocal, "deltaXlocal/F"); + tree_->Branch("processType", &processType, "processType/i"); // Rearrange the simTracks for ease of use <simTrackID, simTrack> SimTracksMap simTracks; - for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end(); - ++simTrackIt) - simTracks.insert(std::pair<unsigned int, SimTrack>(simTrackIt->trackId(), *simTrackIt)); + for (const auto& simTrackIt : *simTracksRaw.product()) + simTracks.emplace(std::pair<unsigned int, SimTrack>(simTrackIt.trackId(), simTrackIt)); // Rearrange the simHits by detUnit for ease of use SimHitsMap simHitsDetUnit; SimHitsMap simHitsTrackId; - for (edm::PSimHitContainer::const_iterator simHitIt(simHitsRaw->begin()); simHitIt != simHitsRaw->end(); ++simHitIt) { - SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt->detUnitId())); + for (const auto& simHitIt : *simHitsRaw.product()) { + SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt.detUnitId())); if (simHitsDetUnitIt == simHitsDetUnit.end()) { std::pair<SimHitsMap::iterator, bool> newIt(simHitsDetUnit.insert( - std::pair<unsigned int, std::vector<PSimHit> >(simHitIt->detUnitId(), std::vector<PSimHit>()))); + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt.detUnitId(), std::vector<PSimHit>()))); simHitsDetUnitIt = newIt.first; } - simHitsDetUnitIt->second.push_back(*simHitIt); + simHitsDetUnitIt->second.push_back(simHitIt); - SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt->trackId())); + SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt.trackId())); if (simHitsTrackIdIt == simHitsTrackId.end()) { std::pair<SimHitsMap::iterator, bool> newIt(simHitsTrackId.insert( - std::pair<unsigned int, std::vector<PSimHit> >(simHitIt->trackId(), std::vector<PSimHit>()))); + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt.trackId(), std::vector<PSimHit>()))); simHitsTrackIdIt = newIt.first; } - simHitsTrackIdIt->second.push_back(*simHitIt); + simHitsTrackIdIt->second.push_back(simHitIt); } //Printout outer tracker clusters in the event - for (Phase2TrackerCluster1DCollectionNew::const_iterator DSViter = clusters->begin(); DSViter != clusters->end(); - ++DSViter) { - unsigned int rawid(DSViter->detId()); + for (const auto& DSViter : *clusters) { + unsigned int rawid(DSViter.detId()); DetId detId(rawid); - const GeomDetUnit* geomDetUnit(tkGeom->idToDetUnit(detId)); + const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(detId)); const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); - for (edmNew::DetSet<Phase2TrackerCluster1D>::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); - ++clustIt) { - auto&& lparams = cpe->localParameters(*clustIt, *theGeomDet); + for (const auto& clustIt : DSViter) { + auto&& lparams = cpe_->localParameters(clustIt, *theGeomDet); Global3DPoint gparams = theGeomDet->surface().toGlobal(lparams.first); LogTrace("VectorHitsBuilderValidation") << "phase2 OT clusters: " << gparams << " DetId: " << rawid; } } - for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { - for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { - LogTrace("VectorHitsBuilderValidation") << "accepted VH: " << *vhIt; + for (const auto& DSViter : *vhsAcc) { + for (const auto& vhIt : DSViter) { + LogTrace("VectorHitsBuilderValidation") << "accepted VH: " << vhIt; } } - for (VectorHitCollectionNew::const_iterator DSViter = vhsRej->begin(); DSViter != vhsRej->end(); ++DSViter) { - for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { - LogTrace("VectorHitsBuilderValidation") << "rejected VH: " << *vhIt; + for (const auto& DSViter : *vhsRej) { + for (const auto& vhIt :DSViter) { + LogTrace("VectorHitsBuilderValidation") << "rejected VH: " << vhIt; } } // Validation @@ -314,9 +301,9 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev std::vector<int> detIds; // Loop over modules - for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { + for (const auto DSViter : *vhsAcc) { // Get the detector unit's id - unsigned int rawid(DSViter->detId()); + unsigned int rawid(DSViter.detId()); module_id = rawid; DetId detId(rawid); @@ -326,7 +313,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev LogDebug("VectorHitsBuilderValidation") << "Layer: " << layer << " det id" << rawid << std::endl; // Get the geometry of the tracker - const GeomDet* geomDet(tkGeom->idToDet(detId)); + const GeomDet* geomDet(tkGeom_->idToDet(detId)); if (!geomDet) break; @@ -337,22 +324,22 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev // Number of clusters unsigned int nVHsPS(0), nVHs2S(0); - LogDebug("VectorHitsBuilderValidation") << "DSViter size: " << DSViter->size(); + LogDebug("VectorHitsBuilderValidation") << "DSViter size: " << DSViter.size(); // Loop over the vhs in the detector unit - for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + for (const auto& vhIt : DSViter) { // vh variables - if (vhIt->isValid()) { + if (vhIt.isValid()) { LogDebug("VectorHitsBuilderValidation") << " vh analyzing ..."; - chi2 = vhIt->chi2(); + chi2 = vhIt.chi2(); LogTrace("VectorHitsBuilderValidation") << "VH chi2 " << chi2 << std::endl; - Local3DPoint localPosVH = vhIt->localPosition(); + Local3DPoint localPosVH = vhIt.localPosition(); vh_x_local = localPosVH.x(); vh_y_local = localPosVH.y(); LogTrace("VectorHitsBuilderValidation") << "local VH position " << localPosVH << std::endl; - LocalError localErrVH = vhIt->localPositionError(); + LocalError localErrVH = vhIt.localPositionError(); vh_x_le = localErrVH.xx(); vh_y_le = localErrVH.yy(); LogTrace("VectorHitsBuilderValidation") << "local VH error " << localErrVH << std::endl; @@ -364,10 +351,10 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev glVHs.push_back(globalPosVH); LogTrace("VectorHitsBuilderValidation") << " global VH position " << globalPosVH << std::endl; - Local3DVector localDirVH = vhIt->localDirection(); + Local3DVector localDirVH = vhIt.localDirection(); LogTrace("VectorHitsBuilderValidation") << "local VH direction " << localDirVH << std::endl; - VectorHit vh = *vhIt; + VectorHit vh = vhIt; Global3DVector globalDirVH = vh.globalDelta(); dirVHs.push_back(globalDirVH); LogTrace("VectorHitsBuilderValidation") << "global VH direction " << globalDirVH << std::endl; @@ -393,7 +380,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev DetId lowerDetId = stackDet->lowerDet()->geographicalId(); DetId upperDetId = stackDet->upperDet()->geographicalId(); - TrackerGeometry::ModuleType mType = tkGeom->getDetectorType(lowerDetId); + TrackerGeometry::ModuleType mType = tkGeom_->getDetectorType(lowerDetId); module_type = 0; if (mType == TrackerGeometry::ModuleType::Ph2PSP) { module_type = 1; @@ -430,50 +417,50 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev LogTrace("VectorHitsBuilderValidation") << "module type " << module_type << std::endl; // get the geomDetUnit of the clusters - low_x_global = vhIt->lowerGlobalPos().x(); - low_y_global = vhIt->lowerGlobalPos().y(); - low_z_global = vhIt->lowerGlobalPos().z(); - upp_x_global = vhIt->upperGlobalPos().x(); - upp_y_global = vhIt->upperGlobalPos().y(); - upp_z_global = vhIt->upperGlobalPos().z(); - - low_xx_global_err = vhIt->lowerGlobalPosErr().cxx(); - low_yy_global_err = vhIt->lowerGlobalPosErr().cyy(); - low_zz_global_err = vhIt->lowerGlobalPosErr().czz(); - low_xy_global_err = vhIt->lowerGlobalPosErr().cyx(); - low_zx_global_err = vhIt->lowerGlobalPosErr().czx(); - low_zy_global_err = vhIt->lowerGlobalPosErr().czy(); - - upp_xx_global_err = vhIt->upperGlobalPosErr().cxx(); - upp_yy_global_err = vhIt->upperGlobalPosErr().cyy(); - upp_zz_global_err = vhIt->upperGlobalPosErr().czz(); - upp_xy_global_err = vhIt->upperGlobalPosErr().cyx(); - upp_zx_global_err = vhIt->upperGlobalPosErr().czx(); - upp_zy_global_err = vhIt->upperGlobalPosErr().czy(); + low_x_global = vhIt.lowerGlobalPos().x(); + low_y_global = vhIt.lowerGlobalPos().y(); + low_z_global = vhIt.lowerGlobalPos().z(); + upp_x_global = vhIt.upperGlobalPos().x(); + upp_y_global = vhIt.upperGlobalPos().y(); + upp_z_global = vhIt.upperGlobalPos().z(); + + low_xx_global_err = vhIt.lowerGlobalPosErr().cxx(); + low_yy_global_err = vhIt.lowerGlobalPosErr().cyy(); + low_zz_global_err = vhIt.lowerGlobalPosErr().czz(); + low_xy_global_err = vhIt.lowerGlobalPosErr().cyx(); + low_zx_global_err = vhIt.lowerGlobalPosErr().czx(); + low_zy_global_err = vhIt.lowerGlobalPosErr().czy(); + + upp_xx_global_err = vhIt.upperGlobalPosErr().cxx(); + upp_yy_global_err = vhIt.upperGlobalPosErr().cyy(); + upp_zz_global_err = vhIt.upperGlobalPosErr().czz(); + upp_xy_global_err = vhIt.upperGlobalPosErr().cyx(); + upp_zx_global_err = vhIt.upperGlobalPosErr().czx(); + upp_zy_global_err = vhIt.upperGlobalPosErr().czy(); LogDebug("VectorHitsBuilderValidation") << "print Clusters into the VH:" << std::endl; - printCluster(geomDetLower, vhIt->lowerClusterRef()); - LogTrace("VectorHitsBuilderValidation") << "\t global pos lower " << vhIt->lowerGlobalPos() << std::endl; + printCluster(geomDetLower, vhIt.lowerClusterRef()); + LogTrace("VectorHitsBuilderValidation") << "\t global pos lower " << vhIt.lowerGlobalPos() << std::endl; LogTrace("VectorHitsBuilderValidation") - << "\t global posErr lower " << vhIt->lowerGlobalPosErr().cxx() << std::endl; + << "\t global posErr lower " << vhIt.lowerGlobalPosErr().cxx() << std::endl; const GeomDetUnit* geomDetUpper = stackDet->upperDet(); - printCluster(geomDetUpper, vhIt->upperClusterRef()); - LogTrace("VectorHitsBuilderValidation") << "\t global pos upper " << vhIt->upperGlobalPos() << std::endl; + printCluster(geomDetUpper, vhIt.upperClusterRef()); + LogTrace("VectorHitsBuilderValidation") << "\t global pos upper " << vhIt.upperGlobalPos() << std::endl; //comparison with SIM hits LogDebug("VectorHitsBuilderValidation") << "comparison Clusters with sim hits ... " << std::endl; std::vector<unsigned int> clusterSimTrackIds; std::vector<unsigned int> clusterSimTrackIdsUpp; std::set<std::pair<uint32_t, EncodedEventId> > simTkIds; - const GeomDetUnit* geomDetUnit_low(tkGeom->idToDetUnit(lowerDetId)); + const GeomDetUnit* geomDetUnit_low(tkGeom_->idToDetUnit(lowerDetId)); LogTrace("VectorHitsBuilderValidation") << " lowerDetID : " << lowerDetId.rawId(); - const GeomDetUnit* geomDetUnit_upp(tkGeom->idToDetUnit(upperDetId)); + const GeomDetUnit* geomDetUnit_upp(tkGeom_->idToDetUnit(upperDetId)); LogTrace("VectorHitsBuilderValidation") << " upperDetID : " << upperDetId.rawId(); - for (unsigned int istr(0); istr < (*(vhIt->lowerClusterRef().cluster_phase2OT())).size(); ++istr) { + for (unsigned int istr(0); istr < (*(vhIt.lowerClusterRef().cluster_phase2OT())).size(); ++istr) { uint32_t channel = - Phase2TrackerDigi::pixelToChannel((*(vhIt->lowerClusterRef().cluster_phase2OT())).firstRow() + istr, - (*(vhIt->lowerClusterRef().cluster_phase2OT())).column()); + Phase2TrackerDigi::pixelToChannel((*(vhIt.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vhIt.lowerClusterRef().cluster_phase2OT())).column()); unsigned int LowerSimTrackId(getSimTrackId(siphase2SimLinks, lowerDetId, channel)); std::vector<std::pair<uint32_t, EncodedEventId> > trkid( getSimTrackIds(siphase2SimLinks, lowerDetId, channel)); @@ -484,13 +471,11 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << LowerSimTrackId << std::endl; } // In the case of PU, we need the TPs to find the proper SimTrackID - for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin(); - iset != simTkIds.end(); - iset++) { - auto ipos = mapping.find(*iset); + for (const auto& iset : simTkIds) { + auto ipos = mapping.find(iset); if (ipos != mapping.end()) { LogTrace("VectorHitsBuilderValidation") << "lower cluster in detid: " << lowerDetId.rawId() - << " from tp: " << ipos->second.key() << " " << iset->first; + << " from tp: " << ipos->second.key() << " " << iset.first; LogTrace("VectorHitsBuilderValidation") << "with pt(): " << (*ipos->second).pt(); low_tp_id = ipos->second.key(); vh_sim_trackPt = (*ipos->second).pt(); @@ -498,10 +483,10 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } simTkIds.clear(); - for (unsigned int istr(0); istr < (*(vhIt->upperClusterRef().cluster_phase2OT())).size(); ++istr) { + for (unsigned int istr(0); istr < (*(vhIt.upperClusterRef().cluster_phase2OT())).size(); ++istr) { uint32_t channel = - Phase2TrackerDigi::pixelToChannel((*(vhIt->upperClusterRef().cluster_phase2OT())).firstRow() + istr, - (*(vhIt->upperClusterRef().cluster_phase2OT())).column()); + Phase2TrackerDigi::pixelToChannel((*(vhIt.upperClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vhIt.upperClusterRef().cluster_phase2OT())).column()); unsigned int UpperSimTrackId(getSimTrackId(siphase2SimLinks, upperDetId, channel)); std::vector<std::pair<uint32_t, EncodedEventId> > trkid( getSimTrackIds(siphase2SimLinks, upperDetId, channel)); @@ -512,19 +497,17 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << UpperSimTrackId << std::endl; } // In the case of PU, we need the TPs to find the proper SimTrackID - for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin(); - iset != simTkIds.end(); - iset++) { - auto ipos = mapping.find(*iset); + for (const auto& iset : simTkIds) { + auto ipos = mapping.find(iset); if (ipos != mapping.end()) { LogTrace("VectorHitsBuilderValidation") << "upper cluster in detid: " << upperDetId.rawId() << " from tp: " << ipos->second.key() << " " - << iset->first << std::endl; + << iset.first << std::endl; upp_tp_id = ipos->second.key(); } } //compute if the vhits is 'true' or 'false' and save sim pT - std::pair<bool, uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); vh_isTrue = 0; if (istrue.first) { vh_isTrue = 1; @@ -535,14 +518,14 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev unsigned int primarySimHits(0); unsigned int otherSimHits(0); - for (edm::PSimHitContainer::const_iterator hitIt(simHitsRaw->begin()); hitIt != simHitsRaw->end(); ++hitIt) { - if (hitIt->detUnitId() == - geomDetLower->geographicalId()) { // || hitIt->detUnitId() == geomDetUpper->geographicalId()){ + for (const auto hitIt : *simHitsRaw) { + if (hitIt.detUnitId() == + geomDetLower->geographicalId()) { //check clusters track id compatibility - if (std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt->trackId()) != + if (std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt.trackId()) != clusterSimTrackIds.end()) { - Local3DPoint localPosHit(hitIt->localPosition()); + Local3DPoint localPosHit(hitIt.localPosition()); sim_x_local = localPosHit.x(); sim_y_local = localPosHit.y(); @@ -570,13 +553,12 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev ++totalSimHits; - std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(hitIt->trackId())); + std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(hitIt.trackId())); if (simTrackIt == simTracks.end()) continue; - //LogTrace("VectorHitsBuilderValidation") << "--> with hitIt. The SimTrack has p: " << simTrackIt->second.momentum(); // Primary particles only - processType = hitIt->processType(); + processType = hitIt.processType(); if (simTrackIt->second.vertIndex() == 0 and (processType == 2 || processType == 7 || processType == 9 || processType == 11 || processType == 13 || @@ -608,21 +590,21 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } // loop simhits nVHsTot++; - //tree->Fill(); + //tree_->Fill(); //****************************** //combinatorial studies : not filling if more than 1 VH has been produced //****************************** - multiplicity = DSViter->size(); - if (DSViter->size() > 1) { + multiplicity = DSViter.size(); + if (DSViter.size() > 1) { LogTrace("VectorHitsBuilderValidation") << " not filling if more than 1 VH has been produced"; width = -100; deltaXlocal = -100; - tree->Fill(); + tree_->Fill(); continue; } - VectorHitMomentumHelper vhMomHelper(magField); + VectorHitMomentumHelper vhMomHelper(magField_); //curvature curvature = vh.curvatureORphi(VectorHit::curvatureMode).first; phi = vh.curvatureORphi(VectorHit::phiMode).first; @@ -632,18 +614,17 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev //stub width - auto&& lparamsUpp = cpe->localParameters(*vhIt->upperClusterRef().cluster_phase2OT(), *geomDetUnit_upp); + auto&& lparamsUpp = cpe_->localParameters(*vhIt.upperClusterRef().cluster_phase2OT(), *geomDetUnit_upp); LogTrace("VectorHitsBuilderValidation") << " upper local pos (in its sor):" << lparamsUpp.first; Global3DPoint gparamsUpp = geomDetUnit_upp->surface().toGlobal(lparamsUpp.first); LogTrace("VectorHitsBuilderValidation") << " upper global pos :" << gparamsUpp; Local3DPoint lparamsUppInLow = geomDetUnit_low->surface().toLocal(gparamsUpp); LogTrace("VectorHitsBuilderValidation") << " upper local pos (in low sor):" << lparamsUppInLow; - auto&& lparamsLow = cpe->localParameters(*vhIt->lowerClusterRef().cluster_phase2OT(), *geomDetUnit_low); + auto&& lparamsLow = cpe_->localParameters(*vhIt.lowerClusterRef().cluster_phase2OT(), *geomDetUnit_low); LogTrace("VectorHitsBuilderValidation") << " lower local pos (in its sor):" << lparamsLow.first; Global3DPoint gparamsLow = geomDetUnit_low->surface().toGlobal(lparamsLow.first); LogTrace("VectorHitsBuilderValidation") << " lower global pos :" << gparamsLow; - //width = difference of centroids in precise coordinate (in low sor) corrected with parallax correction deltaXlocal = lparamsUppInLow.x() - lparamsLow.first.x(); histogramLayer->second.deltaXlocal->Fill(deltaXlocal); LogTrace("VectorHitsBuilderValidation") << " deltaXlocal : " << deltaXlocal; @@ -652,11 +633,8 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev Global3DPoint origin(0, 0, 0); GlobalVector gV = gparamsLow - origin; - //LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV; LocalVector lV = geomDetUnit_low->surface().toLocal(gV); - //LogTrace("VectorHitsBuilderValidation") << " local vector passing to the origin (in low sor):" << lV; LocalVector lV_norm = lV / lV.z(); - //LogTrace("VectorHitsBuilderValidation") << " normalized local vector passing to the origin (in low sor):" << lV_norm; parallCorr = lV_norm.x() * lparamsUppInLow.z(); LogTrace("VectorHitsBuilderValidation") << " parallalex correction:" << parallCorr; @@ -698,7 +676,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev histogramLayer->second.width->Fill(width); LogTrace("VectorHitsBuilderValidation") << " width:" << width; - tree->Fill(); + tree_->Fill(); } // vh valid @@ -723,22 +701,21 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev int VHrejTrue_signal = 0.0; // Loop over modules - for (VectorHitCollectionNew::const_iterator DSViter = vhsAcc->begin(); DSViter != vhsAcc->end(); ++DSViter) { - unsigned int rawid(DSViter->detId()); + for (const auto& DSViter : *vhsAcc) { + unsigned int rawid(DSViter.detId()); DetId detId(rawid); int layerAcc = getLayerNumber(detId); LogTrace("VectorHitsBuilderValidation") << "acc Layer: " << layerAcc << " det id" << rawid << std::endl; - for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { - if (vhIt->isValid()) { + for (const auto& vhIt : DSViter) { + if (vhIt.isValid()) { VHaccLayer_->Fill(layerAcc); VHacc++; //compute if the vhits is 'true' or 'false' - std::pair<bool, uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); if (istrue.first) { LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; VHaccTrueLayer_->Fill(layerAcc); - //VHaccTrueLayer_ratio->Fill(layerAcc); VHaccTrue++; //saving info of 'signal' track @@ -761,24 +738,21 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } } - //it is not really working.. - //VHaccTrueLayer_ratio->Divide(VHaccLayer_); - for (VectorHitCollectionNew::const_iterator DSViter = vhsRej->begin(); DSViter != vhsRej->end(); ++DSViter) { - unsigned int rawid(DSViter->detId()); + for (const auto& DSViter : *vhsRej) { + unsigned int rawid(DSViter.detId()); DetId detId(rawid); int layerRej = getLayerNumber(detId); LogTrace("VectorHitsBuilderValidation") << "rej Layer: " << layerRej << " det id" << rawid << std::endl; - for (edmNew::DetSet<VectorHit>::const_iterator vhIt = DSViter->begin(); vhIt != DSViter->end(); ++vhIt) { + for (const auto& vhIt : DSViter) { VHrejLayer_->Fill(layerRej); VHrej++; //compute if the vhits is 'true' or 'false' - std::pair<bool, uint32_t> istrue = isTrue(*vhIt, siphase2SimLinks, detId); + std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); if (istrue.first) { LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; VHrejTrueLayer_->Fill(layerRej); - //VHrejTrueLayer_ratio->Fill(layerRej); VHrejTrue++; //saving info of 'signal' track @@ -800,8 +774,6 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } } - //it is not really working.. - //VHrejTrueLayer_ratio->Divide(VHrejLayer_); int VHtot = VHacc + VHrej; LogTrace("VectorHitsBuilderValidation") @@ -820,13 +792,12 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev // Check if the vector hit is true (both clusters are formed from the same SimTrack std::pair<bool, uint32_t> VectorHitsBuilderValidation::isTrue( const VectorHit vh, const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& siphase2SimLinks, DetId& detId) const { - const GeomDet* geomDet(tkGeom->idToDet(detId)); + const GeomDet* geomDet(tkGeom_->idToDet(detId)); const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); const GeomDetUnit* geomDetLower = stackDet->lowerDet(); const GeomDetUnit* geomDetUpper = stackDet->upperDet(); std::vector<unsigned int> lowClusterSimTrackIds; - //std::set<std::pair<uint32_t, EncodedEventId> > simTkIds; for (unsigned int istr(0); istr < (*(vh.lowerClusterRef().cluster_phase2OT())).size(); ++istr) { uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, @@ -838,7 +809,6 @@ std::pair<bool, uint32_t> VectorHitsBuilderValidation::isTrue( if (trkid.size() == 0) continue; lowClusterSimTrackIds.push_back(simTrackId); - //simTkIds.insert(trkid.begin(),trkid.end()); } std::vector<unsigned int>::iterator it_simTrackUpper; @@ -857,8 +827,6 @@ std::pair<bool, uint32_t> VectorHitsBuilderValidation::isTrue( LogTrace("VectorHitsBuilderValidation") << " UpperSimTrackId found in lowClusterSimTrackIds "; return std::make_pair(true, simTrackId); } - //clusterSimTrackIds.push_back(UpperSimTrackId); - //simTkIds.insert(trkid.begin(),trkid.end()); } return std::make_pair(false, 0); } @@ -919,37 +887,37 @@ std::map<unsigned int, VHHistos>::iterator VectorHitsBuilderValidation::createLa histoName.str(""); histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; local_histos.localPosXY[0] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + td.make<TGraph>(); local_histos.localPosXY[0]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Local_Position_XY_PS" << tag.c_str() << id; local_histos.localPosXY[1] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + td.make<TGraph>(); local_histos.localPosXY[1]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Local_Position_XY_2S" << tag.c_str() << id; local_histos.localPosXY[2] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2000, 0., 0., 2000, 0., 0.); + td.make<TGraph>(); local_histos.localPosXY[2]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; local_histos.globalPosXY[0] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_PS" << tag.c_str() << id; local_histos.globalPosXY[1] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_2S" << tag.c_str() << id; local_histos.globalPosXY[2] = - td.make<TGraph>(); //histoName.str().c_str(), histoName.str().c_str(), 2400, -120.0, 120.0, 2400, -120.0, 120.0); + td.make<TGraph>(); local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); /* @@ -1054,27 +1022,13 @@ void VectorHitsBuilderValidation::CreateVHsXYGraph(const std::vector<Global3DPoi // opening canvas and drawing XY TGraph - //TCanvas * VHXY_ = new TCanvas("RVsY_Mixed","RVsY_Mixed",800,600); - //VHXY_->cd(); - //trackerLayoutXY_[0]->Draw("AP"); - - // float finalposX, finalposY; - for (unsigned int nVH = 0; nVH < glVHs.size(); nVH++) { - // finalposX = glVHs.at(nVH).x() + dirVHs.at(nVH).x(); - // finalposY = glVHs.at(nVH).y() + dirVHs.at(nVH).y(); - //std::cout << glVHs.at(nVH) << " " << " \tr: " << glVHs.at(nVH).perp() << std::endl; - //std::cout << dirVHs.at(nVH).x() << "," << dirVHs.at(nVH).y() << std::endl; - - //same r + //same r if ((fabs(dirVHs.at(nVH).x()) < 10e-5) && (fabs(dirVHs.at(nVH).y()) < 10e-5)) { - //std::cout << "same pos!"; continue; } else { - // TArrow* vh_arrow = new TArrow(glVHs.at(nVH).x(), glVHs.at(nVH).y(), finalposX, finalposY, 0.05, ">"); - // vh_arrow->Draw("same"); - } + } } return; @@ -1087,31 +1041,6 @@ void VectorHitsBuilderValidation::CreateVHsRZGraph(const std::vector<Global3DPoi return; } - // opening canvas and drawing RZ TGraph - // - //TCanvas* VHRZ_ = new TCanvas("RVsZ_Mixed","RVsZ_Mixed",800,600); - //VHRZ_->cd(); - //trackerLayoutRZ_[0]->Draw("AP"); - - // float finalposX, finalposY, finalposR, finalposZ; - - // for(unsigned int nVH = 0; nVH < glVHs.size(); nVH++){ - - // finalposX = glVHs.at(nVH).x() + dirVHs.at(nVH).x(); - // finalposY = glVHs.at(nVH).y() + dirVHs.at(nVH).y(); - // finalposR = sqrt( pow(finalposX,2) + pow(finalposY,2) ); - // finalposZ = glVHs.at(nVH).z() + dirVHs.at(nVH).z(); - - //std::cout << dirVHs.at(nVH) " " << " \tr: " << dirVHs.at(nVH).perp() << std::endl; - //std::cout << finalposX << ", " << finalposY << " " << " \tr: " << finalposR << std::endl; - //std::cout << std::endl; - - // TArrow* vh_arrow = new TArrow(glVHs.at(nVH).z(), glVHs.at(nVH).perp(), finalposZ, finalposR, 0.05, "|>"); - // vh_arrow->SetLineWidth(2); - // vh_arrow->Draw("same"); - - // } - return; } @@ -1119,16 +1048,13 @@ void VectorHitsBuilderValidation::CreateWindowCorrGraph() { //FIXME: This function is not working properly, yet. //return if we are not using Phase2 OT - if (!tkGeom->isThere(GeomDetEnumerators::P2OTB) && !tkGeom->isThere(GeomDetEnumerators::P2OTEC)) + if (!tkGeom_->isThere(GeomDetEnumerators::P2OTB) && !tkGeom_->isThere(GeomDetEnumerators::P2OTEC)) return; - for (auto det : tkGeom->detsTOB()) { - // std::cout << det->geographicalId().rawId() << std::endl; - // std::cout << det->surface().bounds().thickness() << std::endl; + for (auto det : tkGeom_->detsTOB()) { ParallaxCorrectionRZ_->Fill(det->position().z(), det->position().perp(), 5.); } - for (auto det : tkGeom->detsTID()) { - //std::cout << det->geographicalId().rawId() << std::endl; + for (auto det : tkGeom_->detsTID()) { ParallaxCorrectionRZ_->Fill(det->position().z(), det->position().perp(), 10.); } ParallaxCorrectionRZ_->Fill(0., 0., 5.); @@ -1138,16 +1064,16 @@ void VectorHitsBuilderValidation::CreateWindowCorrGraph() { unsigned int VectorHitsBuilderValidation::getLayerNumber(const DetId& detid) { if (detid.det() == DetId::Tracker) { if (detid.subdetId() == StripSubdetector::TOB) - return (tkTopo->layer(detid)); + return (tkTopo_->layer(detid)); else if (detid.subdetId() == StripSubdetector::TID) - return (100 * tkTopo->side(detid) + tkTopo->layer(detid)); + return (100 * tkTopo_->side(detid) + tkTopo_->layer(detid)); else return 999; } return 999; } -unsigned int VectorHitsBuilderValidation::getModuleNumber(const DetId& detid) { return (tkTopo->module(detid)); } +unsigned int VectorHitsBuilderValidation::getModuleNumber(const DetId& detid) { return (tkTopo_->module(detid)); } std::vector<std::pair<uint32_t, EncodedEventId> > VectorHitsBuilderValidation::getSimTrackIds( const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& simLinks, const DetId& detId, uint32_t channel) const { @@ -1156,11 +1082,10 @@ std::vector<std::pair<uint32_t, EncodedEventId> > VectorHitsBuilderValidation::g if (isearch != simLinks->end()) { // Loop over DigiSimLink in this det unit edm::DetSet<PixelDigiSimLink> link_detset = (*isearch); - for (typename edm::DetSet<PixelDigiSimLink>::const_iterator it = link_detset.data.begin(); - it != link_detset.data.end(); - ++it) { - if (channel == it->channel()) - simTrkId.push_back(std::make_pair(it->SimTrackId(), it->eventId())); + //for (typename edm::DetSet<PixelDigiSimLink>::const_iterator it = link_detset.data.begin(); it != link_detset.data.end(); ++it) { + for (const auto& it : link_detset.data) { + if (channel == it.channel()) + simTrkId.push_back(std::make_pair(it.SimTrackId(), it.eventId())); } } return simTrkId; @@ -1173,9 +1098,10 @@ unsigned int VectorHitsBuilderValidation::getSimTrackId( edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter(pixelSimLinks->find(detId)); if (DSViter == pixelSimLinks->end()) return 0; - for (edm::DetSet<PixelDigiSimLink>::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { - if (channel == it->channel()) - return it->SimTrackId(); + //for (edm::DetSet<PixelDigiSimLink>::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { + for (const auto& it : DSViter->data) { + if (channel == it.channel()) + return it.SimTrackId(); } return 0; } @@ -1203,8 +1129,7 @@ void VectorHitsBuilderValidation::printCluster(const GeomDetUnit* geomDetUnit, c LogTrace("VectorHitsBuilderValidation") << " and width:" << theGeomDet->surface().bounds().width() << " , lenght:" << theGeomDet->surface().bounds().length() << std::endl; - auto&& lparams = cpe->localParameters(*cluster.cluster_phase2OT(), *theGeomDet); - //Global3DPoint gparams = theGeomDet->surface().toGlobal(lparams.first); + auto&& lparams = cpe_->localParameters(*cluster.cluster_phase2OT(), *theGeomDet); LogTrace("VectorHitsBuilderValidation") << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index 87b92e8054ef3..074433bf3a96c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -3,7 +3,7 @@ #include <algorithm> #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -76,7 +76,7 @@ struct VHHistos { TH1F* deltaXlocal; }; -class VectorHitsBuilderValidation : public edm::EDAnalyzer { +class VectorHitsBuilderValidation : public edm::one::EDAnalyzer<edm::one::SharedResources> { public: typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; @@ -114,7 +114,7 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { edm::EDGetTokenT<VectorHitCollectionNew> VHacc_; edm::EDGetTokenT<VectorHitCollectionNew> VHrej_; edm::ESInputTag cpeTag_; - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; edm::EDGetTokenT<edm::PSimHitContainer> simHitsToken_; @@ -123,11 +123,11 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { edm::EDGetTokenT<TrackingParticleCollection> trackingParticleToken_; //SiPixelVectorHitBuilderAlgorithmBase *algo; - const TrackerGeometry* tkGeom; - const TrackerTopology* tkTopo; - const MagneticField* magField; + const TrackerGeometry* tkGeom_; + const TrackerTopology* tkTopo_; + const MagneticField* magField_; - TTree* tree; + TTree* tree_; TGraph* trackerLayoutRZ_[3]; TGraph* trackerLayoutXY_[3]; TGraph* trackerLayoutXYBar_; @@ -136,7 +136,7 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { TGraph* localPosYvsDeltaY_[3]; TCanvas* VHXY_; TCanvas* VHRZ_; - std::vector<TArrow*> arrowVHs; + std::vector<TArrow*> arrowVHs_; TH2D* ParallaxCorrectionRZ_; TH1F* VHaccLayer_; @@ -145,8 +145,6 @@ class VectorHitsBuilderValidation : public edm::EDAnalyzer { TH1F* VHrejTrueLayer_; TH1F* VHaccTrue_signal_Layer_; TH1F* VHrejTrue_signal_Layer_; - TH1F* VHaccTrueLayer_ratio; - TH1F* VHrejTrueLayer_ratio; std::map<unsigned int, VHHistos> histograms_; }; diff --git a/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc b/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc index 4ca48e1308910..18e356a0520b8 100644 --- a/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc +++ b/RecoLocalTracker/SubCollectionProducers/src/TrackClusterRemoverPhase2.cc @@ -205,7 +205,7 @@ namespace { if (uppCluster.isPhase2()) collectedPhase2OTs[uppCluster.key()] = true; } else { - LogTrace("TrackClusterRemoverPhase2") << "it is not a VHits."; + LogTrace("TrackClusterRemoverPhase2") << "it is not a VHit."; } } } diff --git a/RecoTracker/CkfPattern/src/PrintoutHelper.cc b/RecoTracker/CkfPattern/src/PrintoutHelper.cc index 96a598b1354b2..82885a3dc03bc 100644 --- a/RecoTracker/CkfPattern/src/PrintoutHelper.cc +++ b/RecoTracker/CkfPattern/src/PrintoutHelper.cc @@ -103,8 +103,9 @@ std::string PrintoutHelper::regressionTest(const TrackerGeometry& tracker, std:: } buffer << "================================================="; buffer << "=========== Traj in details =====================\n"; - for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) { - for (const auto& hit : it->measurements()) { + //for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) { + for (const auto& it : unsmoothedResult) { + for (const auto& hit : it.measurements()) { buffer << "measurement : " << hit.recHit()->geographicalId().rawId() << std::endl; } buffer << "================\n"; diff --git a/RecoTracker/MeasurementDet/BuildFile.xml b/RecoTracker/MeasurementDet/BuildFile.xml index 2790eaf681a10..a7ea54e101d9b 100644 --- a/RecoTracker/MeasurementDet/BuildFile.xml +++ b/RecoTracker/MeasurementDet/BuildFile.xml @@ -22,4 +22,4 @@ <use name="RecoLocalTracker/Phase2TrackerRecHits"/> <use name="TrackingTools/DetLayers"/> <use name="TrackingTools/MeasurementDet"/> -<use name="RecoLocalTracker/SiPhase2VectorHitBuilder"/> +<use name="RecoLocalTracker/SiPhase2VectorHitBuilder"/> From 7c64d658ba0d7e7c58c138ee2810b45f05ca9937 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 8 Sep 2020 19:54:51 -0500 Subject: [PATCH 391/778] Kevin's comment to VectorHitBuilderAlgorithmBase --- .../src/VectorHitBuilderAlgorithmBase.cc | 58 ++++--------------- 1 file changed, 12 insertions(+), 46 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 6e5bc1ee39805..9575020313679 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -12,36 +12,13 @@ VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase( const TrackerGeometry* tkGeomProd, const TrackerTopology* tkTopoProd, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) - : nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), + : theTkGeom(tkGeomProd), + theTkTopo(tkTopoProd), + cpe(cpeProd), + nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), barrelCut(conf.getParameter<std::vector<double> >("BarrelCut")), endcapCut(conf.getParameter<std::vector<double> >("EndcapCut")), - cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { - initTkGeom(tkGeomProd); - initTkTopo(tkTopoProd); - initCpe(cpeProd); -} - -/*void VectorHitBuilderAlgorithmBase::initialize(const edm::EventSetup& es) { - // get the geometry and topology - edm::ESHandle<TrackerGeometry> geomHandle; - es.get<TrackerDigiGeometryRecord>().get(geomHandle); - initTkGeom(geomHandle); - - edm::ESHandle<TrackerTopology> tTopoHandle; - es.get<TrackerTopologyRcd>().get(tTopoHandle); - initTkTopo(tTopoHandle); - - // load the cpe via the eventsetup - edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpeHandle; - es.get<TkPhase2OTCPERecord>().get(cpeTag_, cpeHandle); - initCpe(cpeHandle.product()); -} -*/ -void VectorHitBuilderAlgorithmBase::initTkGeom(const TrackerGeometry* tkGeomProd) { theTkGeom = tkGeomProd; } -void VectorHitBuilderAlgorithmBase::initTkTopo(const TrackerTopology* tkTopoProd) { theTkTopo = tkTopoProd; } -void VectorHitBuilderAlgorithmBase::initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) { - cpe = cpeProd; -} + cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")){ } double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit*& geomDetUnit_low, const Point3DBase<float, LocalTag>& lPosClu_low, @@ -68,21 +45,16 @@ double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomD void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) const { int nCluster = 0; int numberOfDSV = 0; - edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator DSViter; - for (DSViter = clusters.begin(); DSViter != clusters.end(); DSViter++) { + for (const auto& DSViter : clusters){ ++numberOfDSV; - // Loop over the clusters in the detector unit - for (edmNew::DetSet<Phase2TrackerCluster1D>::const_iterator clustIt = DSViter->begin(); clustIt != DSViter->end(); - ++clustIt) { + for (const auto& clustIt :DSViter) { nCluster++; - // get the detector unit's id - const GeomDetUnit* geomDetUnit(theTkGeom->idToDetUnit(DSViter->detId())); + const GeomDetUnit* geomDetUnit(theTkGeom->idToDetUnit(DSViter.detId())); if (!geomDetUnit) return; - - printCluster(geomDetUnit, clustIt); + printCluster(geomDetUnit, &clustIt); } } LogDebug("VectorHitBuilder") << " Number of input clusters: " << nCluster << std::endl; @@ -124,14 +96,8 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, void VectorHitBuilderAlgorithmBase::loadDetSetVector(std::map<DetId, std::vector<VectorHit> >& theMap, edmNew::DetSetVector<VectorHit>& theCollection) const { - std::map<DetId, std::vector<VectorHit> >::const_iterator it = theMap.begin(); - std::map<DetId, std::vector<VectorHit> >::const_iterator lastDet = theMap.end(); - for (; it != lastDet; ++it) { - edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it->first); - std::vector<VectorHit>::const_iterator vh_it = it->second.begin(); - std::vector<VectorHit>::const_iterator vh_end = it->second.end(); - for (; vh_it != vh_end; ++vh_it) { - vh_col.push_back(*vh_it); - } + for (const auto& it : theMap) { + edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it.first); + for (const auto& vh_it: it.second) vh_col.push_back(vh_it); } } From 424df27fbed2af269e5a17625185f55d538aaa30 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 8 Sep 2020 23:45:07 -0500 Subject: [PATCH 392/778] most of Kevin's remaining comments --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 86 +++++++-------- .../Records/interface/TkPhase2OTCPERecord.h | 9 +- .../interface/VectorHitBuilderAlgorithm.h | 18 +--- .../interface/VectorHitBuilderAlgorithmBase.h | 9 +- .../plugins/VectorHitBuilderEDProducer.cc | 10 +- .../src/VectorHitBuilderAlgorithm.cc | 100 +++++++++--------- .../src/VectorHitBuilderAlgorithmBase.cc | 15 +-- .../test/ClustersValidationTGraph.cc | 35 +++--- .../VHs_SeedingOT_productionAndTesting.py | 26 ++--- .../test/VectorHitsValidation.cc | 31 ++---- .../TrackerRecoGeometryESProducer_cfi.py | 4 +- .../plugins/SeedingOTEDProducer.cc | 35 +++--- .../TkSeedingLayers/src/HitExtractorSTRP.cc | 4 +- 13 files changed, 167 insertions(+), 215 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index e01d9969999a6..b8e5d895e7c12 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -80,27 +80,28 @@ bool VectorHit::sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedI } void VectorHit::getKfComponents4D(KfComponentsHolder& holder) const { - AlgebraicVector4& pars = holder.params<4>(); + constexpr int four = 4; + AlgebraicVector4& pars = holder.params<four>(); pars[0] = theDirection.x(); pars[1] = theDirection.y(); pars[2] = thePosition.x(); pars[3] = thePosition.y(); - AlgebraicSymMatrix44& errs = holder.errors<4>(); - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { + AlgebraicSymMatrix44& errs = holder.errors<four>(); + for (int i = 0; i < four; i++) { + for (int j = 0; j < four; j++) { errs(i, j) = theCovMatrix[i][j]; } } - ProjectMatrix<double, 5, 4>& pf = holder.projFunc<4>(); + ProjectMatrix<double, 5, four>& pf = holder.projFunc<four>(); pf.index[0] = 1; pf.index[1] = 2; pf.index[2] = 3; pf.index[3] = 4; - holder.measuredParams<4>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), 4); - holder.measuredErrors<4>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); + holder.measuredParams<four>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), four); + holder.measuredErrors<four>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); } VectorHit::~VectorHit() {} @@ -153,7 +154,8 @@ GlobalError VectorHit::phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet const PixelTopology* topo = &geomDet->specificTopology(); float pitchX = topo->pitch().first; float pitchY = topo->pitch().second; - LocalError le(pow(pitchX, 2) / 12., 0, pow(pitchY, 2) / 12.); // e2_xx, e2_xy, e2_yy + constexpr float invTwelve = 1. / 12; + LocalError le(pow(pitchX, 2) * invTwelve, 0, pow(pitchY, 2) * invTwelve); // e2_xx, e2_xy, e2_yy GlobalError ge(ErrorFrameTransformer().transform(le, geomDet->surface())); return ge; } @@ -203,6 +205,7 @@ std::pair<float, float> VectorHit::curvatureORphi(curvatureOrPhi curvORphi) cons if (h1 != 0) { double h2 = 2 * h1; + double h2Inf = 1. / (2 * h1); double r12 = pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2); double r22 = pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2); double h3 = @@ -229,35 +232,25 @@ std::pair<float, float> VectorHit::curvatureORphi(curvatureOrPhi curvORphi) cons phi = atan2(ytg, xtg); AlgebraicROOTObject<4, 4>::Matrix jacobian; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - jacobian[i][j] = 0.0; - } - } + double denom1 = 1. / sqrt(r12 * r22 * h3); double denom2 = 1. / (pow(r12 * r22 * h3, 1.5)); jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 jacobian[2][0] = - (h1 * (2. * gPositionLower.x() * r22 * h3 + (2. * gPositionLower.x() - 2. * gPositionUpper.x()) * r12 * r22)) * - denom2 - - (2. * gPositionUpper.y()) * denom1; // dkappa/dx1 + -2. * ((h1 * (gPositionLower.x() * r22 * h3 + (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2 - + (gPositionUpper.y()) * denom1); // dkappa/dx1 jacobian[2][1] = - (2. * gPositionUpper.x()) * denom1 + - (h1 * (2. * gPositionLower.y() * r22 * h3 + r12 * r22 * (2. * gPositionLower.y() - 2. * gPositionUpper.y()))) * - denom2; // dkappa/dy1 + -2. * ((gPositionUpper.x()) * denom1 + + (h1 * (gPositionLower.y() * r22 * h3 + r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * + denom2); // dkappa/dy1 jacobian[2][2] = - (2. * gPositionLower.y()) * denom1 + - (h1 * (2. * gPositionUpper.x() * r12 * h3 - 2. * (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * - denom2; // dkappa/dx2 + -2. * ((gPositionLower.y()) * denom1 + + (h1 * (gPositionUpper.x() * r12 * h3 - (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * + denom2); // dkappa/dx2 jacobian[2][3] = - (h1 * (2. * gPositionUpper.y() * r12 * h3 - r12 * r22 * 2. * (gPositionLower.y() - gPositionUpper.y()))) * - denom2 - - (2. * gPositionLower.x()) * denom1; // dkappa/dy2 - - for (int i = 0; i < 4; i++) { - jacobian[2][i] = -jacobian[2][i]; - } + -2. * ((h1 * (gPositionUpper.y() * r12 * h3 - r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - + (gPositionLower.x()) * denom1); // dkappa/dy2 AlgebraicVector2 M; //to compute phi at the cluster points @@ -267,25 +260,25 @@ std::pair<float, float> VectorHit::curvatureORphi(curvatureOrPhi curvORphi) cons AlgebraicROOTObject<2, 4>::Matrix K; K[0][0] = - (2. * gPositionLower.x() * gPositionUpper.y()) / h2 - (2. * gPositionUpper.y() * h5) / pow(h2, 2); // dxm/dx1 + 2. * ((gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionUpper.y() * h5) / pow(h2, 2)); // dxm/dx1 K[0][1] = (2. * gPositionUpper.x() * h5) / pow(h2, 2) - - (pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y()) / - h2; // dxm/dy1 + (pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y()) * + h2Inf; // dxm/dy1 K[0][2] = - (2. * gPositionLower.y() * h5) / pow(h2, 2) - (2. * gPositionUpper.x() * gPositionLower.y()) / h2; // dxm/dx2 - K[0][3] = - (pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2) - 2. * gPositionUpper.y() * gPositionLower.y()) / h2 - - (2. * gPositionLower.x() * h5) / pow(h2, 2); // dxm/dy2 - K[1][0] = - (pow(gPositionUpper.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.y(), 2)) / h2 - - (2. * gPositionUpper.y() * h4) / pow(h2, 2); // dym/dx1 + 2. * ((gPositionLower.y() * h5) / pow(h2, 2) - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dxm/dx2 + K[0][3] = (pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2) - 2. * gPositionUpper.y() * gPositionLower.y()) * + h2Inf - + (2. * gPositionLower.x() * h5) / pow(h2, 2); // dxm/dy2 + K[1][0] = (pow(gPositionUpper.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.y(), 2)) * + h2Inf - + (2. * gPositionUpper.y() * h4) / pow(h2, 2); // dym/dx1 K[1][1] = - (2. * gPositionUpper.x() * h4) / pow(h2, 2) - (2. * gPositionUpper.x() * gPositionLower.y()) / h2; // dym/dy1 + 2. * ((gPositionUpper.x() * h4) / pow(h2, 2) - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dym/dy1 K[1][2] = (2. * gPositionLower.y() * h4) / pow(h2, 2) - - (pow(gPositionLower.x(), 2) - 2. * gPositionUpper.x() * gPositionLower.x() + pow(gPositionLower.y(), 2)) / - h2; // dym/dx2 + (pow(gPositionLower.x(), 2) - 2. * gPositionUpper.x() * gPositionLower.x() + pow(gPositionLower.y(), 2)) * + h2Inf; // dym/dx2 K[1][3] = - (2. * gPositionLower.x() * gPositionUpper.y()) / h2 - (2. * gPositionLower.x() * h4) / pow(h2, 2); // dym/dy2 + 2. * (gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionLower.x() * h4) / pow(h2, 2); // dym/dy2 AlgebraicVector4 N = M * K; jacobian[3][0] = N[0]; // dphi/(dx1,dy1,dx2,dy2) @@ -302,7 +295,7 @@ std::pair<float, float> VectorHit::curvatureORphi(curvatureOrPhi curvORphi) cons } // bring phi in the same quadrant as phi1 - if (abs(phi - phi1) > M_PI / 2.) { + if (deltaPhi(phi, phi1) > M_PI / 2.) { phi = phi + M_PI; if (phi > M_PI) phi = phi - 2. * M_PI; @@ -315,11 +308,6 @@ std::pair<float, float> VectorHit::curvatureORphi(curvatureOrPhi curvORphi) cons } AlgebraicROOTObject<4, 4>::Matrix gErrors; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - gErrors[i][j] = 0.0; - } - } gErrors[0][0] = gErrorLower.cxx(); gErrors[0][1] = gErrorLower.cyx(); diff --git a/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h b/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h index 3a6925080a227..44fea80269a6a 100644 --- a/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h +++ b/RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h @@ -10,10 +10,9 @@ #include "FWCore/Utilities/interface/mplVector.h" class TkPhase2OTCPERecord - : public edm::eventsetup::DependentRecordImplementation<TkPhase2OTCPERecord, - edm::mpl::Vector<TrackerDigiGeometryRecord, - //TrackerTopologyRcd, - IdealMagneticFieldRecord, - SiPhase2OuterTrackerLorentzAngleRcd> > {}; + : public edm::eventsetup::DependentRecordImplementation< + TkPhase2OTCPERecord, + edm::mpl::Vector<TrackerDigiGeometryRecord, IdealMagneticFieldRecord, SiPhase2OuterTrackerLorentzAngleRcd> > { +}; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 082293459902d..f8ec0ef0aa2f3 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -20,8 +20,8 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { const TrackerGeometry* tkGeomProd, const TrackerTopology* tkTopoProd, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) - : VectorHitBuilderAlgorithmBase(conf, tkGeomProd, tkTopoProd, cpeProd), theFitter(new LinearFit()){}; - ~VectorHitBuilderAlgorithm() override { delete theFitter; }; + : VectorHitBuilderAlgorithmBase(conf, tkGeomProd, tkTopoProd, cpeProd){}; + ~VectorHitBuilderAlgorithm() override{}; void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, VectorHitCollectionNew& vhAcc, @@ -63,10 +63,6 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper) const override; - // Full I/O in DetSet - //void buildDetUnit( const edm::DetSetVector<Phase2TrackerCluster1D> & input, - // output_t& output); - void fit2Dzx(const Local3DPoint lpCI, const Local3DPoint lpCO, const LocalError leCI, @@ -84,19 +80,15 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { AlgebraicSymMatrix22& covMatrix, double& chi2) const; - void fit(const std::vector<float>& x, - const std::vector<float>& y, - const std::vector<float>& sigy, + void fit(float x[2], + float y[2], + float sigy[2], Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, double& chi2) const; - // void build( const edm::DetSet<Phase2TrackerCluster1D> & input, - // output_t::FastFiller& output); - private: - LinearFit* theFitter; }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 9850c3a043095..129163541880d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -28,9 +28,6 @@ class VectorHitBuilderAlgorithmBase { const TrackerTopology*, const ClusterParameterEstimator<Phase2TrackerCluster1D>*); virtual ~VectorHitBuilderAlgorithmBase() {} - void initTkGeom(const TrackerGeometry* tkGeomProd); - void initTkTopo(const TrackerTopology* tkTopoProd); - void initCpe(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd); //FIXME::ERICA::this should be template, return different collection for different algo used!! virtual void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, @@ -58,20 +55,18 @@ class VectorHitBuilderAlgorithmBase { void printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) const; void printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* cluster) const; - void loadDetSetVector(std::map<DetId, std::vector<VectorHit>>& theMap, + void loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit>>& theMap, edmNew::DetSetVector<VectorHit>& theCollection) const; const TrackerGeometry* theTkGeom; const TrackerTopology* theTkTopo; - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* theCpe; unsigned int nMaxVHforeachStack; std::vector<double> barrelCut; std::vector<double> endcapCut; private: edm::ESInputTag cpeTag_; - - // typedef SiStripRecHit2DCollection::FastFiller Collector; }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index d313d4bc920c9..4df79a4761e60 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -35,7 +35,7 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { }; //VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } -VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { } +VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() {} VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")), @@ -74,12 +74,10 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu run(clustersHandle, *outputClustersAccepted, *outputClustersRejected, *outputVHAccepted, *outputVHRejected); unsigned int numberOfVectorHits = 0; - edmNew::DetSetVector<VectorHit>::const_iterator DSViter; - for (DSViter = (*outputVHAccepted).begin(); DSViter != (*outputVHAccepted).end(); DSViter++) { - edmNew::DetSet<VectorHit>::const_iterator vh; - for (vh = DSViter->begin(); vh != DSViter->end(); ++vh) { + for (const auto& DSViter : *outputVHAccepted) { + for (const auto& vh : DSViter) { numberOfVectorHits++; - LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << *vh << std::endl; + LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << vh << std::endl; } } // write output to file diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index c20a651520f9d..1c8c2c8de6205 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -19,8 +19,8 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track LogDebug("VectorHitBuilderAlgorithm") << "Run VectorHitBuilderAlgorithm ... \n"; const edmNew::DetSetVector<Phase2TrackerCluster1D>* ClustersPhase2Collection = clusters.product(); - std::map<DetId, std::vector<VectorHit>> tempVHAcc, tempVHRej; - std::map<DetId, std::vector<VectorHit>>::iterator it_temporary; + std::unordered_map<DetId, std::vector<VectorHit>> tempVHAcc, tempVHRej; + std::unordered_map<DetId, std::vector<VectorHit>>::iterator it_temporary; //loop over the DetSetVector LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << ClustersPhase2Collection->size() << std::endl; @@ -50,10 +50,8 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track const GeomDet* gd; const StackGeomDet* stackDet; - edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator it_detLower = - ClustersPhase2Collection->find(lowerDetId); - edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator it_detUpper = - ClustersPhase2Collection->find(upperDetId); + const auto& it_detLower = ClustersPhase2Collection->find(lowerDetId); + const auto& it_detUpper = ClustersPhase2Collection->find(upperDetId); if (it_detLower != ClustersPhase2Collection->end() && it_detUpper != ClustersPhase2Collection->end()) { gd = theTkGeom->idToDet(detIdStack); @@ -77,7 +75,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track tempVHAcc[detIdStack] = vhsInStack_Acc; tempVHRej[detIdStack] = vhsInStack_Rej; - +#ifdef EDM_ML_DEBUG LogTrace("VectorHitBuilderAlgorithm") << "For detId #" << detIdStack.rawId() << " the following VHits have been accepted:"; for (const auto& vhIt : vhsInStack_Acc) { @@ -88,6 +86,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track for (const auto& vhIt : vhsInStack_Rej) { LogTrace("VectorHitBuilderAlgorithm") << "rejected VH: " << vhIt; } +#endif } } @@ -152,19 +151,21 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi upperClusters.push_back(clusterUpper); } - std::sort_heap(lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->lowerDet())); - std::sort_heap(upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom, &*cpe, &*stack->upperDet())); + std::sort_heap( + lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom, &*theCpe, &*stack->lowerDet())); + std::sort_heap( + upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom, &*theCpe, &*stack->upperDet())); for (const auto& cluL : lowerClusters) { LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; printCluster(stack->lowerDet(), &*cluL); const PixelGeomDetUnit* gduLow = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); - auto&& lparamsLow = cpe->localParameters(*cluL, *gduLow); + auto&& lparamsLow = theCpe->localParameters(*cluL, *gduLow); for (const auto& cluU : upperClusters) { LogDebug("VectorHitBuilderAlgorithm") << "\t upper clusters " << std::endl; printCluster(stack->upperDet(), &*cluU); const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); - auto&& lparamsUpp = cpe->localParameters(*cluU, *gduUpp); + auto&& lparamsUpp = theCpe->localParameters(*cluU, *gduUpp); //applying the parallax correction double pC = computeParallaxCorrection(gduLow, lparamsLow.first, gduUpp, lparamsUpp.first); @@ -174,29 +175,26 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi if (lparamsUpp.first.x() > lparamsLow.first.x()) { if (lparamsUpp.first.x() > 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() - fabs(pC); - } - if (lparamsUpp.first.x() < 0) { - lpos_low_corr = lparamsLow.first.x() + fabs(pC); + lpos_upp_corr = lparamsUpp.first.x() - std::abs(pC); + } else if (lparamsUpp.first.x() < 0) { + lpos_low_corr = lparamsLow.first.x() + std::abs(pC); lpos_upp_corr = lparamsUpp.first.x(); } } else if (lparamsUpp.first.x() < lparamsLow.first.x()) { if (lparamsUpp.first.x() > 0) { - lpos_low_corr = lparamsLow.first.x() - fabs(pC); + lpos_low_corr = lparamsLow.first.x() - std::abs(pC); lpos_upp_corr = lparamsUpp.first.x(); - } - if (lparamsUpp.first.x() < 0) { + } else if (lparamsUpp.first.x() < 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() + fabs(pC); + lpos_upp_corr = lparamsUpp.first.x() + std::abs(pC); } } else { if (lparamsUpp.first.x() > 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() - fabs(pC); - } - if (lparamsUpp.first.x() < 0) { + lpos_upp_corr = lparamsUpp.first.x() - std::abs(pC); + } else if (lparamsUpp.first.x() < 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() + fabs(pC); + lpos_upp_corr = lparamsUpp.first.x() + std::abs(pC); } } @@ -228,19 +226,19 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi //if( (lpos_upp_corr < lpos_low_corr + delta) && // (lpos_upp_corr > lpos_low_corr - delta) ){ //new cut: dependent on layers - if (fabs(width) < cut) { + if (std::abs(width) < cut) { LogDebug("VectorHitBuilderAlgorithm") << " accepting VH! " << std::endl; VectorHit vh = buildVectorHit(stack, cluL, cluU); //protection: the VH can also be empty!! if (vh.isValid()) { - result.push_back(std::make_pair(vh, true)); + result.emplace_back(std::make_pair(vh, true)); } } else { LogDebug("VectorHitBuilderAlgorithm") << " rejecting VH: " << std::endl; //storing vh rejected for combinatiorial studies VectorHit vh = buildVectorHit(stack, cluL, cluU); - result.push_back(std::make_pair(vh, false)); + result.emplace_back(std::make_pair(vh, false)); } } } @@ -252,17 +250,16 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper) const { LogTrace("VectorHitBuilderAlgorithm") << "Build VH with: "; - //printCluster(stack->lowerDet(),&*lower); //printCluster(stack->upperDet(),&*upper); const PixelGeomDetUnit* geomDetLower = static_cast<const PixelGeomDetUnit*>(stack->lowerDet()); const PixelGeomDetUnit* geomDetUpper = static_cast<const PixelGeomDetUnit*>(stack->upperDet()); - auto&& lparamsLower = cpe->localParameters(*lower, *geomDetLower); // x, y, z, e2_xx, e2_xy, e2_yy + auto&& lparamsLower = theCpe->localParameters(*lower, *geomDetLower); // x, y, z, e2_xx, e2_xy, e2_yy Global3DPoint gparamsLower = geomDetLower->surface().toGlobal(lparamsLower.first); LogTrace("VectorHitBuilderAlgorithm") << "\t lower global pos: " << gparamsLower; - auto&& lparamsUpper = cpe->localParameters(*upper, *geomDetUpper); + auto&& lparamsUpper = theCpe->localParameters(*upper, *geomDetUpper); Global3DPoint gparamsUpper = geomDetUpper->surface().toGlobal(lparamsUpper.first); LogTrace("VectorHitBuilderAlgorithm") << "\t upper global pos: " << gparamsUpper; @@ -332,11 +329,11 @@ void VectorHitBuilderAlgorithm::fit2Dzx(const Local3DPoint lpCI, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, double& chi2) const { - std::vector<float> x = {lpCI.z(), lpCO.z()}; - std::vector<float> y = {lpCI.x(), lpCO.x()}; + float x[2] = {lpCI.z(), lpCO.z()}; + float y[2] = {lpCI.x(), lpCO.x()}; float sqCI = sqrt(leCI.xx()); float sqCO = sqrt(leCO.xx()); - std::vector<float> sigy = {sqCI, sqCO}; + float sigy[2] = {sqCI, sqCO}; fit(x, y, sigy, pos, dir, covMatrix, chi2); @@ -351,28 +348,28 @@ void VectorHitBuilderAlgorithm::fit2Dzy(const Local3DPoint lpCI, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, double& chi2) const { - std::vector<float> x = {lpCI.z(), lpCO.z()}; - std::vector<float> y = {lpCI.y(), lpCO.y()}; + float x[2] = {lpCI.z(), lpCO.z()}; + float y[2] = {lpCI.y(), lpCO.y()}; float sqCI = sqrt(leCI.yy()); float sqCO = sqrt(leCO.yy()); - std::vector<float> sigy = {sqCI, sqCO}; + float sigy[2] = {sqCI, sqCO}; fit(x, y, sigy, pos, dir, covMatrix, chi2); return; } -void VectorHitBuilderAlgorithm::fit(const std::vector<float>& x, - const std::vector<float>& y, - const std::vector<float>& sigy, +void VectorHitBuilderAlgorithm::fit(float x[2], + float y[2], + float sigy[2], Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, double& chi2) const { - if (x.size() != y.size() || x.size() != sigy.size()) { - edm::LogError("VectorHitBuilderAlgorithm") << "Different size for x,z !! No fit possible."; - return; - } + // if (x.size() != y.size() || x.size() != sigy.size()) { + // edm::LogError("VectorHitBuilderAlgorithm") << "Different size for x,z !! No fit possible."; + // return; + // } float slope = 0.; float intercept = 0.; @@ -380,24 +377,25 @@ void VectorHitBuilderAlgorithm::fit(const std::vector<float>& x, float covii = 0.; float covsi = 0.; - theFitter->fit(x, y, x.size(), sigy, slope, intercept, covss, covii, covsi); + //theFitter->linearFit(x, y, 2, sigy, slope, intercept, covss, covii, covsi); + linearFit(x, y, 2, sigy, slope, intercept, covss, covii, covsi); covMatrix[0][0] = covss; // this is var(dy/dz) covMatrix[1][1] = covii; // this is var(y) covMatrix[1][0] = covsi; // this is cov(dy/dz,y) - for (unsigned int j = 0; j < x.size(); j++) { + for (unsigned int j = 0; j < 2; j++) { const double ypred = intercept + slope * x[j]; const double dy = (y[j] - ypred) / sigy[j]; chi2 += dy * dy; } pos = Local3DPoint(intercept, 0., 0.); - if (x.size() == 2) { - //difference in z is the difference of the lowermost and the uppermost cluster z pos - float slopeZ = x.at(1) - x.at(0); - dir = LocalVector(slope, 0., slopeZ); - } else { - dir = LocalVector(slope, 0., -1.); - } + // if (x.size() == 2) { + //difference in z is the difference of the lowermost and the uppermost cluster z pos + float slopeZ = x[1] - x[0]; + dir = LocalVector(slope, 0., slopeZ); + // } else { + // dir = LocalVector(slope, 0., -1.); + // } } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 9575020313679..48d2864c7038c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -14,11 +14,11 @@ VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase( const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) : theTkGeom(tkGeomProd), theTkTopo(tkTopoProd), - cpe(cpeProd), + theCpe(cpeProd), nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), barrelCut(conf.getParameter<std::vector<double> >("BarrelCut")), endcapCut(conf.getParameter<std::vector<double> >("EndcapCut")), - cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")){ } + cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) {} double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit*& geomDetUnit_low, const Point3DBase<float, LocalTag>& lPosClu_low, @@ -45,10 +45,10 @@ double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomD void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) const { int nCluster = 0; int numberOfDSV = 0; - for (const auto& DSViter : clusters){ + for (const auto& DSViter : clusters) { ++numberOfDSV; // Loop over the clusters in the detector unit - for (const auto& clustIt :DSViter) { + for (const auto& clustIt : DSViter) { nCluster++; // get the detector unit's id const GeomDetUnit* geomDetUnit(theTkGeom->idToDetUnit(DSViter.detId())); @@ -84,7 +84,7 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, LogTrace("VectorHitBuilder") << " and width:" << pixelGeomDetUnit->surface().bounds().width() << " , lenght:" << pixelGeomDetUnit->surface().bounds().length() << std::endl; - auto&& lparams = cpe->localParameters(*clustIt, *pixelGeomDetUnit); + auto&& lparams = theCpe->localParameters(*clustIt, *pixelGeomDetUnit); Global3DPoint gparams = pixelGeomDetUnit->surface().toGlobal(lparams.first); LogTrace("VectorHitBuilder") << "\t global pos " << gparams << std::endl; @@ -94,10 +94,11 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, return; } -void VectorHitBuilderAlgorithmBase::loadDetSetVector(std::map<DetId, std::vector<VectorHit> >& theMap, +void VectorHitBuilderAlgorithmBase::loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit> >& theMap, edmNew::DetSetVector<VectorHit>& theCollection) const { for (const auto& it : theMap) { edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it.first); - for (const auto& vh_it: it.second) vh_col.push_back(vh_it); + for (const auto& vh_it : it.second) + vh_col.push_back(vh_it); } } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc index e55abd65260f7..bb12a15caee68 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/ClustersValidationTGraph.cc @@ -125,14 +125,11 @@ void Phase2TrackerClusterizerValidationTGraph::beginJob() { trackerLayout_[1]->SetName("RVsZ_Pixel"); trackerLayout_[2] = td.make<TGraph>(); trackerLayout_[2]->SetName("RVsZ_Strip"); - trackerLayoutXY_[0] = - td.make<TGraph>(); + trackerLayoutXY_[0] = td.make<TGraph>(); trackerLayoutXY_[0]->SetName("YVsX_Mixed"); - trackerLayoutXY_[1] = - td.make<TGraph>(); + trackerLayoutXY_[1] = td.make<TGraph>(); trackerLayoutXY_[1]->SetName("YVsX_Pixel"); - trackerLayoutXY_[2] = - td.make<TGraph>(); + trackerLayoutXY_[2] = td.make<TGraph>(); trackerLayoutXY_[2]->SetName("YVsX_Strip"); trackerLayoutXYBar_ = td.make<TGraph>(); trackerLayoutXYBar_->SetName("YVsXBar"); @@ -202,7 +199,7 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, // Rearrange the simHits for ease of use SimHitsMap simHitsDetUnit; SimHitsMap simHitsTrackId; - for (const auto& simHitIt: *simHitsRaw) { + for (const auto& simHitIt : *simHitsRaw) { SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt.detUnitId())); if (simHitsDetUnitIt == simHitsDetUnit.end()) { std::pair<SimHitsMap::iterator, bool> newIt(simHitsDetUnit.insert( @@ -308,12 +305,12 @@ void Phase2TrackerClusterizerValidationTGraph::analyze(const edm::Event& event, for (unsigned int i(0); i < clustIt.size(); ++i) { unsigned int channel(PixelDigi::pixelToChannel( clustIt.firstRow() + i, - clustIt.column())); // Here we have to use the old pixelToChannel function (not Phase2TrackerDigi but PixelDigi), change this when using new Digis + clustIt + .column())); // Here we have to use the old pixelToChannel function (not Phase2TrackerDigi but PixelDigi), change this when using new Digis unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detId, channel)); clusterSimTrackIds.push_back(simTrackId); } - - } + } if (nClustersPixel) histogramLayer->second.numberClusterPixel->Fill(nClustersPixel); @@ -400,38 +397,32 @@ std::map<unsigned int, ClusterHistos>::iterator Phase2TrackerClusterizerValidati histoName.str(""); histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; - local_histos.localPosXY[0] = - td.make<TGraph>(); + local_histos.localPosXY[0] = td.make<TGraph>(); local_histos.localPosXY[0]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Local_Position_XY_Pixel" << tag.c_str() << id; - local_histos.localPosXY[1] = - td.make<TGraph>(); + local_histos.localPosXY[1] = td.make<TGraph>(); local_histos.localPosXY[1]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Local_Position_XY_Strip" << tag.c_str() << id; - local_histos.localPosXY[2] = - td.make<TGraph>(); + local_histos.localPosXY[2] = td.make<TGraph>(); local_histos.localPosXY[2]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; - local_histos.globalPosXY[0] = - td.make<TGraph>(); + local_histos.globalPosXY[0] = td.make<TGraph>(); local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_Pixel" << tag.c_str() << id; - local_histos.globalPosXY[1] = - td.make<TGraph>(); + local_histos.globalPosXY[1] = td.make<TGraph>(); local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_Strip" << tag.c_str() << id; - local_histos.globalPosXY[2] = - td.make<TGraph>(); + local_histos.globalPosXY[2] = td.make<TGraph>(); local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); /* diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py index 2b8480df625d5..714dbb67c9ddc 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py @@ -91,19 +91,19 @@ # debug -process.MessageLogger = cms.Service("MessageLogger", - destinations = cms.untracked.vstring("debugVH_tilted"), - debugModules = cms.untracked.vstring("*"), - categories = cms.untracked.vstring("VectorHitBuilderEDProducer","VectorHitBuilderAlgorithm","VectorHitsBuilderValidation","CkfPattern"), - debugVH_tilted = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), - DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), - default = cms.untracked.PSet(limit = cms.untracked.int32(0)), - VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), - VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), - CkfPattern = cms.untracked.PSet(limit = cms.untracked.int32(-1)), - VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) - ) - ) +#process.MessageLogger = cms.Service("MessageLogger", +# destinations = cms.untracked.vstring("debugVH_tilted"), +# debugModules = cms.untracked.vstring("*"), +# categories = cms.untracked.vstring("VectorHitBuilderEDProducer","VectorHitBuilderAlgorithm","VectorHitsBuilderValidation","CkfPattern"), +# debugVH_tilted = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), +# DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), +# default = cms.untracked.PSet(limit = cms.untracked.int32(0)), +# VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# CkfPattern = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) +# ) +# ) # Path and EndPath definitions diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 548bac202e449..7a1d6fe06748e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -84,7 +84,6 @@ void VectorHitsBuilderValidation::beginJob() { VHaccTrue_signal_Layer_->SetName("VHaccepted_true_signal"); VHrejTrue_signal_Layer_ = tdWid.make<TH1F>("VHrejTrueSignalLayer", "VHrejTrueSignalLayer", 250, 0., 250.); VHrejTrue_signal_Layer_->SetName("VHrejected_true_signal"); - } void VectorHitsBuilderValidation::endJob() {} @@ -288,7 +287,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } } for (const auto& DSViter : *vhsRej) { - for (const auto& vhIt :DSViter) { + for (const auto& vhIt : DSViter) { LogTrace("VectorHitsBuilderValidation") << "rejected VH: " << vhIt; } } @@ -519,9 +518,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev unsigned int otherSimHits(0); for (const auto hitIt : *simHitsRaw) { - if (hitIt.detUnitId() == - geomDetLower->geographicalId()) { - + if (hitIt.detUnitId() == geomDetLower->geographicalId()) { //check clusters track id compatibility if (std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt.trackId()) != clusterSimTrackIds.end()) { @@ -738,7 +735,6 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } } - for (const auto& DSViter : *vhsRej) { unsigned int rawid(DSViter.detId()); DetId detId(rawid); @@ -774,7 +770,6 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } } - int VHtot = VHacc + VHrej; LogTrace("VectorHitsBuilderValidation") << "VH total: " << VHtot << " with " << VHacc << " VHs accepted and " << VHrej << " VHs rejected."; @@ -886,38 +881,32 @@ std::map<unsigned int, VHHistos>::iterator VectorHitsBuilderValidation::createLa histoName.str(""); histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; - local_histos.localPosXY[0] = - td.make<TGraph>(); + local_histos.localPosXY[0] = td.make<TGraph>(); local_histos.localPosXY[0]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Local_Position_XY_PS" << tag.c_str() << id; - local_histos.localPosXY[1] = - td.make<TGraph>(); + local_histos.localPosXY[1] = td.make<TGraph>(); local_histos.localPosXY[1]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Local_Position_XY_2S" << tag.c_str() << id; - local_histos.localPosXY[2] = - td.make<TGraph>(); + local_histos.localPosXY[2] = td.make<TGraph>(); local_histos.localPosXY[2]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; - local_histos.globalPosXY[0] = - td.make<TGraph>(); + local_histos.globalPosXY[0] = td.make<TGraph>(); local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_PS" << tag.c_str() << id; - local_histos.globalPosXY[1] = - td.make<TGraph>(); + local_histos.globalPosXY[1] = td.make<TGraph>(); local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); histoName.str(""); histoName << "Global_Position_XY_2S" << tag.c_str() << id; - local_histos.globalPosXY[2] = - td.make<TGraph>(); + local_histos.globalPosXY[2] = td.make<TGraph>(); local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); /* @@ -1023,12 +1012,12 @@ void VectorHitsBuilderValidation::CreateVHsXYGraph(const std::vector<Global3DPoi // opening canvas and drawing XY TGraph for (unsigned int nVH = 0; nVH < glVHs.size(); nVH++) { - //same r + //same r if ((fabs(dirVHs.at(nVH).x()) < 10e-5) && (fabs(dirVHs.at(nVH).y()) < 10e-5)) { continue; } else { - } + } } return; diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 9a87a93207ed2..22d95e29034d3 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(True) + usePhase2Stacks = cms.bool(False) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 600bab3ea71c0..fd8adebc9ccea 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -42,7 +42,7 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { static void fillDescriptions(edm::ConfigurationDescriptions&); - TrajectorySeedCollection run(edm::Handle<VectorHitCollectionNew>); + std::unique_ptr<TrajectorySeedCollection> run(edm::Handle<VectorHitCollectionNew>); unsigned int checkLayer(unsigned int iidd); std::vector<VectorHit> collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); void printVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); @@ -89,6 +89,7 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { edm::ESGetToken<TrajectoryStateUpdator, TrackingComponentsRecord> updatorToken_; edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> measurementTrackerToken_; edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> estToken_; + edm::EDPutTokenT<TrajectorySeedCollection> putToken_; }; SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) @@ -97,13 +98,13 @@ SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) topoToken_(esConsumes()), propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial"))), magFieldToken_(esConsumes()), - updatorToken_(esConsumes(edm::ESInputTag("","KFUpdator"))), + updatorToken_(esConsumes(edm::ESInputTag("", "KFUpdator"))), measurementTrackerToken_(esConsumes()), estToken_(esConsumes(edm::ESInputTag("", "Chi2"))) { vhProducerToken_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); beamSpotToken_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); updatorName_ = conf.getParameter<std::string>("updator"); - produces<TrajectorySeedCollection>(); + putToken_ = produces<TrajectorySeedCollection>(); } SeedingOTEDProducer::~SeedingOTEDProducer() {} @@ -118,7 +119,7 @@ void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descr } void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { - auto seedsWithVHs = std::make_unique<TrajectorySeedCollection>(); + //auto seedsWithVHs = std::make_unique<TrajectorySeedCollection>(); tkTopo_ = &es.getData(topoToken_); @@ -148,18 +149,20 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) edm::Handle<VectorHitCollectionNew> vhs; event.getByToken(vhProducerToken_, vhs); - TrajectorySeedCollection const& tempSeeds = run(vhs); + /* TrajectorySeedCollection const& tempSeeds = run(vhs); for (auto& qIt : tempSeeds) { seedsWithVHs->push_back(qIt); } seedsWithVHs->shrink_to_fit(); - event.put(std::move(seedsWithVHs)); + event.put(std::move(seedsWithVHs));*/ + //auto seedsWithVHs = std::make_unique<> + event.put(putToken_, run(vhs)); } -TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { - TrajectorySeedCollection result; - +std::unique_ptr<TrajectorySeedCollection> SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { + //TrajectorySeedCollection result; + auto result = std::make_unique<TrajectorySeedCollection>(); //check if all the first three layers have VHs std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(*(VHs.product()), 1); std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(*(VHs.product()), 2); @@ -245,21 +248,21 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio continue; std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final = propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2); - if (!updatedTSOSL2_final.first) + if (!updatedTSOSL2_final.first) continue; - std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = + std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); if (!updatedTSOSL3_final.first) continue; TrajectorySeed ts = createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(), *buildingPropagator); - result.push_back(ts); + result->push_back(ts); } } } } } - + result->shrink_to_fit(); return result; } @@ -293,7 +296,7 @@ void SeedingOTEDProducer::printVHsOnLayer(const edmNew::DetSetVector<VectorHit>& for (const auto& DSViter : input) { for (const auto& vh : DSViter) { if (checkLayer(DSViter.id()) == layerNumber) - LogTrace("SeedingOTEDProducer") << " VH in layer " << layerNumber << " >> " << vh; + LogTrace("SeedingOTEDProducer") << " VH in layer " << layerNumber << " >> " << vh; } } } else { @@ -336,7 +339,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto return tsos; } -AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) const{ +AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) const { if (mat44.num_row() != 4 || mat44.num_col() != 4) assert("Wrong dimension! This should be a 4x4 matrix!"); @@ -353,7 +356,7 @@ std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdat const TrajectoryStateOnSurface initialTSOS, const Propagator& prop, const TrackingRecHit& hit) const { TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface()); if UNLIKELY (!propTSOS.isValid()) - return std::make_pair(false, propTSOS); + return std::make_pair(false, propTSOS); TrajectoryStateOnSurface updatedTSOS = updator_->update(propTSOS, hit); if UNLIKELY (!updatedTSOS.isValid()) return std::make_pair(false, updatedTSOS); diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc index 09087a243275a..f93d4eedc55e7 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc @@ -129,9 +129,7 @@ void HitExtractorSTRP::cleanedOfClusters(const TkTransientTrackingRecHitBuilder& assert(hits[iH]->isValid()); auto id = hits[iH]->geographicalId(); if (matched) { - bool replace; - ProjectedSiStripRecHit2D* replaceMe; - std::tie(replace, replaceMe) = skipThis(ttrhBuilder, *hits[iH], stripClusterMask); + auto [replace, replaceMe] = skipThis(ttrhBuilder, *hits[iH], stripClusterMask); if (replace) { if (!replaceMe) { LogTrace("HitExtractorSTRP") << "skipping a matched hit on :" << hits[iH]->geographicalId().rawId(); From 9109e2ebc4c2b72966cf85cbc2bf8b1f4e5c4ccd Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 9 Sep 2020 08:00:43 -0500 Subject: [PATCH 393/778] fix clang compile error --- .../SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 7a1d6fe06748e..ce79785e8962b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -517,7 +517,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev unsigned int primarySimHits(0); unsigned int otherSimHits(0); - for (const auto hitIt : *simHitsRaw) { + for (const auto& hitIt : *simHitsRaw) { if (hitIt.detUnitId() == geomDetLower->geographicalId()) { //check clusters track id compatibility if (std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt.trackId()) != From 0aba3e5ad6cb082e8057b968ac2c9be8f1b67fd2 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 9 Sep 2020 09:59:52 -0500 Subject: [PATCH 394/778] move curvatureOrPhi function from VectorHit to VectorHitBuilderAlgorithm and move momentum and transverseMomentum function back to VectorHit --- .../TrackerRecHit2D/interface/VectorHit.h | 25 ++- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 195 ++---------------- .../TrackerRecHit2D/src/classes_def.xml | 4 +- .../interface/VectorHitBuilderAlgorithm.h | 4 + .../interface/VectorHitMomentumHelper.h | 26 --- .../src/VectorHitBuilderAlgorithm.cc | 193 ++++++++++++++++- .../test/VectorHitsValidation.cc | 10 +- .../test/VectorHitsValidation.h | 1 - .../plugins/SeedingOTEDProducer.cc | 8 +- 9 files changed, 238 insertions(+), 228 deletions(-) delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 7f726e4149533..454464035454b 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -39,13 +39,19 @@ class VectorHit final : public BaseTrackerRecHit { const AlgebraicSymMatrix& covMatrix, const float chi2, OmniClusterRef const& lower, - OmniClusterRef const& upper); + OmniClusterRef const& upper, + const float curvature, + const float curvatureError, + const float phi); VectorHit(const GeomDet& idet, const VectorHit2D& vh2Dzx, const VectorHit2D& vh2Dzy, OmniClusterRef const& lower, - OmniClusterRef const& upper); + OmniClusterRef const& upper, + const float curvature, + const float curvatureError, + const float phi); ~VectorHit() override; @@ -77,10 +83,12 @@ class VectorHit final : public BaseTrackerRecHit { virtual float chi2() const { return theChi2; } int dimension() const override { return theDimension; } + float curvature() const { return theCurvature; } + float curvatureError() const { return theCurvatureError; } + float phi() const { return thePhi; } - enum curvatureOrPhi { curvatureMode, phiMode }; - - std::pair<float, float> curvatureORphi(curvatureOrPhi curvatureMode) const; + float transverseMomentum(float magField) const; + float momentum(float magField) const; /// "lower" is logical, not geometrically lower; in pixel-strip modules the "lower" is always a pixel ClusterRef lowerCluster() const { return theLowerCluster.cluster_phase2OT(); } @@ -91,10 +99,10 @@ class VectorHit final : public BaseTrackerRecHit { //FIXME::to update with a proper CPE maybe... Global3DPoint lowerGlobalPos() const; Global3DPoint upperGlobalPos() const; - Global3DPoint phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) const; + static Global3DPoint phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster); GlobalError lowerGlobalPosErr() const; GlobalError upperGlobalPosErr() const; - GlobalError phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet) const; + static GlobalError phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet); bool isPhase2() const override { return true; } @@ -142,6 +150,9 @@ class VectorHit final : public BaseTrackerRecHit { int theDimension; OmniClusterRef theLowerCluster; OmniClusterRef theUpperCluster; + float theCurvature; + float theCurvatureError; + float thePhi; }; inline bool operator<(const VectorHit& one, const VectorHit& other) { return (one.chi2() < other.chi2()); } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index b8e5d895e7c12..3710a0d10718d 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -9,7 +9,10 @@ VectorHit::VectorHit(const VectorHit& vh) theChi2(vh.chi2()), theDimension(vh.dimension()), theLowerCluster(vh.lowerClusterRef()), - theUpperCluster(vh.upperClusterRef()) {} + theUpperCluster(vh.upperClusterRef()), + theCurvature(vh.curvature()), + theCurvatureError(vh.curvatureError()), + thePhi(vh.phi()) {} VectorHit::VectorHit(const GeomDet& idet, const LocalPoint& posLower, @@ -17,7 +20,10 @@ VectorHit::VectorHit(const GeomDet& idet, const AlgebraicSymMatrix& covMatrix, const float chi2, OmniClusterRef const& lower, - OmniClusterRef const& upper) + OmniClusterRef const& upper, + const float curvature, + const float curvatureError, + const float phi) : BaseTrackerRecHit(idet, trackerHitRTTI::vector), thePosition(posLower), theDirection(dir), @@ -25,14 +31,20 @@ VectorHit::VectorHit(const GeomDet& idet, theChi2(chi2), theDimension(4), theLowerCluster(lower), - theUpperCluster(upper) {} + theUpperCluster(upper), + theCurvature(curvature), + theCurvatureError(curvatureError), + thePhi(phi) {} VectorHit::VectorHit(const GeomDet& idet, const VectorHit2D& vh2Dzx, const VectorHit2D& vh2Dzy, OmniClusterRef const& lower, - OmniClusterRef const& upper) - : BaseTrackerRecHit(idet, trackerHitRTTI::vector), theDimension(4), theLowerCluster(lower), theUpperCluster(upper) { + OmniClusterRef const& upper, + const float curvature, + const float curvatureError, + const float phi) + : BaseTrackerRecHit(idet, trackerHitRTTI::vector), theDimension(4), theLowerCluster(lower), theUpperCluster(upper), theCurvature(curvature), theCurvatureError(curvatureError), thePhi(phi) { thePosition = LocalPoint(vh2Dzx.localPosition()->x(), vh2Dzy.localPosition()->x(), 0.); theDirection = LocalVector(vh2Dzx.localDirection()->x(), vh2Dzy.localDirection()->x(), 1.); @@ -129,7 +141,7 @@ Global3DPoint VectorHit::upperGlobalPos() const { return phase2clusterGlobalPos(geomDetUpper, upperCluster()); } -Global3DPoint VectorHit::phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) const { +Global3DPoint VectorHit::phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) { const PixelTopology* topo = &geomDet->specificTopology(); float ix = cluster->center(); float iy = cluster->column() + 0.5; // halfway the column @@ -150,7 +162,7 @@ GlobalError VectorHit::upperGlobalPosErr() const { return phase2clusterGlobalPosErr(geomDetUpper); } -GlobalError VectorHit::phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet) const { +GlobalError VectorHit::phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet) { const PixelTopology* topo = &geomDet->specificTopology(); float pitchX = topo->pitch().first; float pitchY = topo->pitch().second; @@ -169,174 +181,11 @@ Global3DVector VectorHit::globalDelta() const { Global3DVector VectorHit::globalDirection() const { return (det()->surface().toGlobal(localDirection())); } -std::pair<float, float> VectorHit::curvatureORphi(curvatureOrPhi curvORphi) const { - float curvature = -999.; - float errorCurvature = -999.; - float phi = -999.; - - //global pos and errors - Global3DPoint gPositionLower = lowerGlobalPos(); - Global3DPoint gPositionUpper = upperGlobalPos(); - - GlobalError gErrorLower = lowerGlobalPosErr(); - GlobalError gErrorUpper = upperGlobalPosErr(); - - //insert lower and upper in the global sor - if (gPositionLower.perp() > gPositionUpper.perp()) { - gPositionLower = upperGlobalPos(); - gPositionUpper = lowerGlobalPos(); - gErrorLower = upperGlobalPosErr(); - gErrorUpper = lowerGlobalPosErr(); - } - - float h1 = gPositionLower.x() * gPositionUpper.y() - gPositionUpper.x() * gPositionLower.y(); - - //determine sign of curvature - AlgebraicVector2 n1; - n1[0] = -gPositionLower.y(); - n1[1] = gPositionLower.x(); - AlgebraicVector2 n2; - n2[0] = gPositionUpper.x() - gPositionLower.x(); - n2[1] = gPositionUpper.y() - gPositionLower.y(); - - double n3 = n1[0] * n2[0] + n1[1] * n2[1]; - double signCurv = -copysign(1.0, n3); - double phi1 = atan2(gPositionUpper.y() - gPositionLower.y(), gPositionUpper.x() - gPositionLower.x()); - - if (h1 != 0) { - double h2 = 2 * h1; - double h2Inf = 1. / (2 * h1); - double r12 = pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2); - double r22 = pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2); - double h3 = - (pow(gPositionLower.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.x(), 2) + - pow(gPositionLower.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y() + pow(gPositionUpper.y(), 2)); - double h4 = -pow(gPositionLower.x(), 2) * gPositionUpper.x() + gPositionLower.x() * pow(gPositionUpper.x(), 2) + - gPositionLower.x() * pow(gPositionUpper.y(), 2) - gPositionUpper.x() * pow(gPositionLower.y(), 2); - double h5 = pow(gPositionLower.x(), 2) * gPositionUpper.y() - pow(gPositionUpper.x(), 2) * gPositionLower.y() + - pow(gPositionLower.y(), 2) * gPositionUpper.y() - gPositionLower.y() * pow(gPositionUpper.y(), 2); - - //radius of circle - double invRho2 = (4. * h1 * h1) / (r12 * r22 * h3); - curvature = sqrt(invRho2); - - //center of circle - double xcentre = h5 / h2; - double ycentre = h4 / h2; - - //to compute phi at the cluster points - double xtg = gPositionLower.y() - ycentre; - double ytg = -(gPositionLower.x() - xcentre); - - //to compute phi at the origin - phi = atan2(ytg, xtg); - - AlgebraicROOTObject<4, 4>::Matrix jacobian; - - double denom1 = 1. / sqrt(r12 * r22 * h3); - double denom2 = 1. / (pow(r12 * r22 * h3, 1.5)); - jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 - jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 - jacobian[2][0] = - -2. * ((h1 * (gPositionLower.x() * r22 * h3 + (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2 - - (gPositionUpper.y()) * denom1); // dkappa/dx1 - jacobian[2][1] = - -2. * ((gPositionUpper.x()) * denom1 + - (h1 * (gPositionLower.y() * r22 * h3 + r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * - denom2); // dkappa/dy1 - jacobian[2][2] = - -2. * ((gPositionLower.y()) * denom1 + - (h1 * (gPositionUpper.x() * r12 * h3 - (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * - denom2); // dkappa/dx2 - jacobian[2][3] = - -2. * ((h1 * (gPositionUpper.y() * r12 * h3 - r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - - (gPositionLower.x()) * denom1); // dkappa/dy2 - - AlgebraicVector2 M; - //to compute phi at the cluster points - M[0] = (gPositionLower.y() - ycentre) * invRho2; // dphi/dxcentre - M[1] = -(gPositionLower.x() - xcentre) * invRho2; // dphi/dycentre - //to compute phi at the origin - - AlgebraicROOTObject<2, 4>::Matrix K; - K[0][0] = - 2. * ((gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionUpper.y() * h5) / pow(h2, 2)); // dxm/dx1 - K[0][1] = (2. * gPositionUpper.x() * h5) / pow(h2, 2) - - (pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y()) * - h2Inf; // dxm/dy1 - K[0][2] = - 2. * ((gPositionLower.y() * h5) / pow(h2, 2) - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dxm/dx2 - K[0][3] = (pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2) - 2. * gPositionUpper.y() * gPositionLower.y()) * - h2Inf - - (2. * gPositionLower.x() * h5) / pow(h2, 2); // dxm/dy2 - K[1][0] = (pow(gPositionUpper.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.y(), 2)) * - h2Inf - - (2. * gPositionUpper.y() * h4) / pow(h2, 2); // dym/dx1 - K[1][1] = - 2. * ((gPositionUpper.x() * h4) / pow(h2, 2) - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dym/dy1 - K[1][2] = (2. * gPositionLower.y() * h4) / pow(h2, 2) - - (pow(gPositionLower.x(), 2) - 2. * gPositionUpper.x() * gPositionLower.x() + pow(gPositionLower.y(), 2)) * - h2Inf; // dym/dx2 - K[1][3] = - 2. * (gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionLower.x() * h4) / pow(h2, 2); // dym/dy2 - - AlgebraicVector4 N = M * K; - jacobian[3][0] = N[0]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][1] = N[1]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][2] = N[2]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][3] = N[3]; // dphi/(dx1,dy1,dx2,dy2) - - //assign correct sign to the curvature errors - if ((signCurv < 0 && curvature > 0) || (signCurv > 0 && curvature < 0)) { - curvature = -curvature; - for (int i = 0; i < 4; i++) { - jacobian[2][i] = -jacobian[2][i]; - } - } - - // bring phi in the same quadrant as phi1 - if (deltaPhi(phi, phi1) > M_PI / 2.) { - phi = phi + M_PI; - if (phi > M_PI) - phi = phi - 2. * M_PI; - } - - //computing the curvature error - AlgebraicVector4 curvatureJacobian; - for (int i = 0; i < 4; i++) { - curvatureJacobian[i] = jacobian[2][i]; - } - - AlgebraicROOTObject<4, 4>::Matrix gErrors; - - gErrors[0][0] = gErrorLower.cxx(); - gErrors[0][1] = gErrorLower.cyx(); - gErrors[1][0] = gErrorLower.cyx(); - gErrors[1][1] = gErrorLower.cyy(); - gErrors[2][2] = gErrorUpper.cxx(); - gErrors[2][3] = gErrorUpper.cyx(); - gErrors[3][2] = gErrorUpper.cyx(); - gErrors[3][3] = gErrorUpper.cyy(); - - AlgebraicVector4 temp = curvatureJacobian; - temp = temp * gErrors; - errorCurvature = temp[0] * curvatureJacobian[0] + temp[1] * curvatureJacobian[1] + temp[2] * curvatureJacobian[2] + - temp[3] * curvatureJacobian[3]; - - } else { - return std::make_pair(0.0, 0.0); - } - switch (curvORphi) { - case curvatureMode: - return std::make_pair(curvature, errorCurvature); - case phiMode: - return std::make_pair(phi, 0.0); - } - return std::make_pair(0.0, 0.0); -} - float VectorHit::theta() const { return globalDirection().theta(); } +float VectorHit::transverseMomentum(float magField) const { return magField * 2.99792458e-3F / theCurvature;} // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, thus using 2.99792458e-3F (precise value from speed of light) +float VectorHit::momentum(float magField) const { return transverseMomentum(magField) / (1. * sin(theta()));} + AlgebraicMatrix VectorHit::projectionMatrix() const { // obsolete (for what tracker is concerned...) interface static const AlgebraicMatrix the4DProjectionMatrix(4, 5, 0); diff --git a/DataFormats/TrackerRecHit2D/src/classes_def.xml b/DataFormats/TrackerRecHit2D/src/classes_def.xml index 569ec40801614..2175ee0e8f371 100644 --- a/DataFormats/TrackerRecHit2D/src/classes_def.xml +++ b/DataFormats/TrackerRecHit2D/src/classes_def.xml @@ -189,8 +189,8 @@ <class name="edm::Wrapper< MTDTrackingDetSetVector >"/> <class name="MTDTrackingOwnVector"/> <class name="edm::Wrapper< MTDTrackingOwnVector >"/> - <class name="VectorHit" ClassVersion="4"> - <version ClassVersion="4" checksum="3655344937"/> + <class name="VectorHit" ClassVersion="5"> + <version ClassVersion="5" checksum="3586519169"/> </class> <class name="VectorHit2D" ClassVersion="5"> <version ClassVersion="5" checksum="1341481267"/> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index f8ec0ef0aa2f3..f6c1e89ab4153 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -38,6 +38,10 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { LocalError& errinner, LocalError& errouter) const; + enum curvatureOrPhi { curvatureMode, phiMode }; + + std::pair<float, float> curvatureORphi(curvatureOrPhi curvatureMode, Global3DPoint gPositionLower, Global3DPoint gPositionUpper, GlobalError gErrorLower, GlobalError gErrorUpper ) const; + class LocalPositionSort { public: LocalPositionSort(const TrackerGeometry* geometry, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h deleted file mode 100644 index dbe8b1096fc2c..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef VectorHitMomentumHelper_H -#define VectorHitMomentumHelper_H - -#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" -#include "MagneticField/Engine/interface/MagneticField.h" - -class VectorHitMomentumHelper { -public: - VectorHitMomentumHelper(const MagneticField* magField) { - GlobalPoint center(0.0, 0.0, 0.0); - intermediate = magField->inTesla(center).mag() * 0.003; - //0.003 is because the curvature (rho) is in cm and not in m - } - ~VectorHitMomentumHelper() {} - - float transverseMomentum(const VectorHit& vh) const { - float rho = 1. / vh.curvatureORphi(VectorHit::curvatureMode).first; - return (intermediate * rho); - } - float momentum(const VectorHit& vh) const { return transverseMomentum(vh) / (1. * sin(vh.theta())); } - -private: - float intermediate; -}; - -#endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 1c8c2c8de6205..fa4de8f46494e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -314,7 +314,24 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, OmniClusterRef lowerOmni(lower); OmniClusterRef upperOmni(upper); - VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni); + + Global3DPoint gPositionLower = VectorHit::phase2clusterGlobalPos(geomDetLower, lower); + Global3DPoint gPositionUpper = VectorHit::phase2clusterGlobalPos(geomDetUpper, upper); + GlobalError gErrorLower = VectorHit::phase2clusterGlobalPosErr(geomDetLower); + GlobalError gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); + + + if (gPositionLower.perp() > gPositionUpper.perp()) { + gPositionLower = VectorHit::phase2clusterGlobalPos(geomDetUpper, upper); + gPositionUpper = VectorHit::phase2clusterGlobalPos(geomDetLower, lower); + gErrorLower = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); + gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetLower); + } + const float curvature = curvatureORphi(curvatureMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).first; + const float curvatureError = curvatureORphi(curvatureMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).second; + const float phi = curvatureORphi(phiMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).first; + + VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni, curvature, curvatureError, phi); return vh; } @@ -366,10 +383,6 @@ void VectorHitBuilderAlgorithm::fit(float x[2], Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, double& chi2) const { - // if (x.size() != y.size() || x.size() != sigy.size()) { - // edm::LogError("VectorHitBuilderAlgorithm") << "Different size for x,z !! No fit possible."; - // return; - // } float slope = 0.; float intercept = 0.; @@ -391,11 +404,173 @@ void VectorHitBuilderAlgorithm::fit(float x[2], } pos = Local3DPoint(intercept, 0., 0.); - // if (x.size() == 2) { //difference in z is the difference of the lowermost and the uppermost cluster z pos float slopeZ = x[1] - x[0]; dir = LocalVector(slope, 0., slopeZ); - // } else { - // dir = LocalVector(slope, 0., -1.); - // } } + +std::pair<float, float> VectorHitBuilderAlgorithm::curvatureORphi(curvatureOrPhi curvORphi, Global3DPoint gPositionLower, Global3DPoint gPositionUpper, GlobalError gErrorLower, GlobalError gErrorUpper) const { + float curvature = -999.; + float errorCurvature = -999.; + float phi = -999.; + + //global pos and errors +// Global3DPoint gPositionLower = lowerGlobalPos(); +// Global3DPoint gPositionUpper = upperGlobalPos(); + +// GlobalError gErrorLower = lowerGlobalPosErr(); +// GlobalError gErrorUpper = upperGlobalPosErr(); + + //insert lower and upper in the global sor +// if (gPositionLower.perp() > gPositionUpper.perp()) { +// gPositionLower = upperGlobalPos(); +// gPositionUpper = lowerGlobalPos(); +// gErrorLower = upperGlobalPosErr(); +// gErrorUpper = lowerGlobalPosErr(); +// } + + float h1 = gPositionLower.x() * gPositionUpper.y() - gPositionUpper.x() * gPositionLower.y(); + + //determine sign of curvature + AlgebraicVector2 n1; + n1[0] = -gPositionLower.y(); + n1[1] = gPositionLower.x(); + AlgebraicVector2 n2; + n2[0] = gPositionUpper.x() - gPositionLower.x(); + n2[1] = gPositionUpper.y() - gPositionLower.y(); + + double n3 = n1[0] * n2[0] + n1[1] * n2[1]; + double signCurv = -copysign(1.0, n3); + double phi1 = atan2(gPositionUpper.y() - gPositionLower.y(), gPositionUpper.x() - gPositionLower.x()); + + if (h1 != 0) { + double h2 = 2 * h1; + double h2Inf = 1. / (2 * h1); + double r12 = pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2); + double r22 = pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2); + double h3 = + (pow(gPositionLower.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.x(), 2) + + pow(gPositionLower.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y() + pow(gPositionUpper.y(), 2)); + double h4 = -pow(gPositionLower.x(), 2) * gPositionUpper.x() + gPositionLower.x() * pow(gPositionUpper.x(), 2) + + gPositionLower.x() * pow(gPositionUpper.y(), 2) - gPositionUpper.x() * pow(gPositionLower.y(), 2); + double h5 = pow(gPositionLower.x(), 2) * gPositionUpper.y() - pow(gPositionUpper.x(), 2) * gPositionLower.y() + + pow(gPositionLower.y(), 2) * gPositionUpper.y() - gPositionLower.y() * pow(gPositionUpper.y(), 2); + + //radius of circle + double invRho2 = (4. * h1 * h1) / (r12 * r22 * h3); + curvature = sqrt(invRho2); + + //center of circle + double xcentre = h5 / h2; + double ycentre = h4 / h2; + + //to compute phi at the cluster points + double xtg = gPositionLower.y() - ycentre; + double ytg = -(gPositionLower.x() - xcentre); + + //to compute phi at the origin + phi = atan2(ytg, xtg); + + AlgebraicROOTObject<4, 4>::Matrix jacobian; + + double denom1 = 1. / sqrt(r12 * r22 * h3); + double denom2 = 1. / (pow(r12 * r22 * h3, 1.5)); + jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 + jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 + jacobian[2][0] = + -2. * ((h1 * (gPositionLower.x() * r22 * h3 + (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2 - + (gPositionUpper.y()) * denom1); // dkappa/dx1 + jacobian[2][1] = + -2. * ((gPositionUpper.x()) * denom1 + + (h1 * (gPositionLower.y() * r22 * h3 + r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * + denom2); // dkappa/dy1 + jacobian[2][2] = + -2. * ((gPositionLower.y()) * denom1 + + (h1 * (gPositionUpper.x() * r12 * h3 - (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * + denom2); // dkappa/dx2 + jacobian[2][3] = + -2. * ((h1 * (gPositionUpper.y() * r12 * h3 - r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - + (gPositionLower.x()) * denom1); // dkappa/dy2 + AlgebraicVector2 M; + //to compute phi at the cluster points + M[0] = (gPositionLower.y() - ycentre) * invRho2; // dphi/dxcentre + M[1] = -(gPositionLower.x() - xcentre) * invRho2; // dphi/dycentre + //to compute phi at the origin + + AlgebraicROOTObject<2, 4>::Matrix K; + K[0][0] = + 2. * ((gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionUpper.y() * h5) / pow(h2, 2)); // dxm/dx1 + K[0][1] = (2. * gPositionUpper.x() * h5) / pow(h2, 2) - + (pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y()) * + h2Inf; // dxm/dy1 + K[0][2] = + 2. * ((gPositionLower.y() * h5) / pow(h2, 2) - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dxm/dx2 + K[0][3] = (pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2) - 2. * gPositionUpper.y() * gPositionLower.y()) * + h2Inf - + (2. * gPositionLower.x() * h5) / pow(h2, 2); // dxm/dy2 + K[1][0] = (pow(gPositionUpper.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.y(), 2)) * + h2Inf - + (2. * gPositionUpper.y() * h4) / pow(h2, 2); // dym/dx1 + K[1][1] = + 2. * ((gPositionUpper.x() * h4) / pow(h2, 2) - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dym/dy1 + K[1][2] = (2. * gPositionLower.y() * h4) / pow(h2, 2) - + (pow(gPositionLower.x(), 2) - 2. * gPositionUpper.x() * gPositionLower.x() + pow(gPositionLower.y(), 2)) * + h2Inf; // dym/dx2 + K[1][3] = + 2. * (gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionLower.x() * h4) / pow(h2, 2); // dym/dy2 + + AlgebraicVector4 N = M * K; + jacobian[3][0] = N[0]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][1] = N[1]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][2] = N[2]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][3] = N[3]; // dphi/(dx1,dy1,dx2,dy2) + + //assign correct sign to the curvature errors + if ((signCurv < 0 && curvature > 0) || (signCurv > 0 && curvature < 0)) { + curvature = -curvature; + for (int i = 0; i < 4; i++) { + jacobian[2][i] = -jacobian[2][i]; + } + } + + // bring phi in the same quadrant as phi1 + if (deltaPhi(phi, phi1) > M_PI / 2.) { + phi = phi + M_PI; + if (phi > M_PI) + phi = phi - 2. * M_PI; + } + + //computing the curvature error + AlgebraicVector4 curvatureJacobian; + for (int i = 0; i < 4; i++) { + curvatureJacobian[i] = jacobian[2][i]; + } + + AlgebraicROOTObject<4, 4>::Matrix gErrors; + + gErrors[0][0] = gErrorLower.cxx(); + gErrors[0][1] = gErrorLower.cyx(); + gErrors[1][0] = gErrorLower.cyx(); + gErrors[1][1] = gErrorLower.cyy(); + gErrors[2][2] = gErrorUpper.cxx(); + gErrors[2][3] = gErrorUpper.cyx(); + gErrors[3][2] = gErrorUpper.cyx(); + gErrors[3][3] = gErrorUpper.cyy(); + + AlgebraicVector4 temp = curvatureJacobian; + temp = temp * gErrors; + errorCurvature = temp[0] * curvatureJacobian[0] + temp[1] * curvatureJacobian[1] + temp[2] * curvatureJacobian[2] + + temp[3] * curvatureJacobian[3]; + + } else { + return std::make_pair(0.0, 0.0); + } + switch (curvORphi) { + case curvatureMode: + return std::make_pair(curvature, errorCurvature); + case phiMode: + return std::make_pair(phi, 0.0); + } + return std::make_pair(0.0, 0.0); +} + diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index ce79785e8962b..4195a2a85e149 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -601,12 +601,12 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev continue; } - VectorHitMomentumHelper vhMomHelper(magField_); //curvature - curvature = vh.curvatureORphi(VectorHit::curvatureMode).first; - phi = vh.curvatureORphi(VectorHit::phiMode).first; - QOverPT = vhMomHelper.transverseMomentum(vh); - QOverP = vhMomHelper.momentum(vh); + GlobalPoint center(0.0, 0.0, 0.0); + curvature = vh.curvature(); + phi = vh.phi(); + QOverPT = vh.transverseMomentum(magField_->inTesla(center).z()); + QOverP = vh.momentum(magField_->inTesla(center).z()); histogramLayer->second.curvature->Fill(curvature); //stub width diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index 074433bf3a96c..0bfcb55fb4602 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -30,7 +30,6 @@ #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" #include "DataFormats/SiPixelDigi/interface/PixelDigi.h" #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" #include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" #include "SimDataFormats/Track/interface/SimTrackContainer.h" diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index fd8adebc9ccea..8afbdb9763eff 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -9,7 +9,6 @@ #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitMomentumHelper.h" #include "RecoTracker/Record/interface/CkfComponentsRecord.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" @@ -311,12 +310,11 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto // gv transform to local (lv) const Local3DVector lv(vHit.det()->surface().toLocal(gv)); - //Helper class to access momentum of VH - VectorHitMomentumHelper vhMomHelper(magField_); //FIXME::charge is fine 1 every two times!! + GlobalPoint center(0.0, 0.0, 0.0); int charge = 1; - float p = vhMomHelper.momentum(vHit); + float p = vHit.momentum(magField_->inTesla(center).z()); float x = vHit.localPosition().x(); float y = vHit.localPosition().y(); float dx = vHit.localDirection().x(); @@ -330,7 +328,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p mat[0][0] = - pow(computeInverseMomentumError(vHit, theta, beamSpot_->sigmaZ(), vhMomHelper.transverseMomentum(vHit)), 2); + pow(computeInverseMomentumError(vHit, theta, beamSpot_->sigmaZ(), vHit.transverseMomentum(magField_->inTesla(center).z())), 2); //building tsos LocalTrajectoryError lterr(asSMatrix<5>(mat)); From 90cf48a7f0b1b27ad57b771d5b33a80a1828c791 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 9 Sep 2020 15:17:43 -0500 Subject: [PATCH 395/778] code checks, mostly --- .../TrackerRecHit2D/interface/VectorHit.h | 4 +- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 14 +++++-- .../interface/VectorHitBuilderAlgorithm.h | 6 ++- .../src/VectorHitBuilderAlgorithm.cc | 40 +++++++------------ .../test/VHs_productionAndTesting.py | 26 ++++++------ .../TrackerRecoGeometryESProducer_cfi.py | 4 +- .../plugins/SeedingOTEDProducer.cc | 29 +++++++------- .../TkSeedingLayers/src/HitExtractorSTRP.cc | 2 +- 8 files changed, 62 insertions(+), 63 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 454464035454b..5a75a770df641 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -40,7 +40,7 @@ class VectorHit final : public BaseTrackerRecHit { const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper, - const float curvature, + const float curvature, const float curvatureError, const float phi); @@ -49,7 +49,7 @@ class VectorHit final : public BaseTrackerRecHit { const VectorHit2D& vh2Dzy, OmniClusterRef const& lower, OmniClusterRef const& upper, - const float curvature, + const float curvature, const float curvatureError, const float phi); diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 3710a0d10718d..5e5aa727b750b 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -44,7 +44,13 @@ VectorHit::VectorHit(const GeomDet& idet, const float curvature, const float curvatureError, const float phi) - : BaseTrackerRecHit(idet, trackerHitRTTI::vector), theDimension(4), theLowerCluster(lower), theUpperCluster(upper), theCurvature(curvature), theCurvatureError(curvatureError), thePhi(phi) { + : BaseTrackerRecHit(idet, trackerHitRTTI::vector), + theDimension(4), + theLowerCluster(lower), + theUpperCluster(upper), + theCurvature(curvature), + theCurvatureError(curvatureError), + thePhi(phi) { thePosition = LocalPoint(vh2Dzx.localPosition()->x(), vh2Dzy.localPosition()->x(), 0.); theDirection = LocalVector(vh2Dzx.localDirection()->x(), vh2Dzy.localDirection()->x(), 1.); @@ -183,8 +189,10 @@ Global3DVector VectorHit::globalDirection() const { return (det()->surface().toG float VectorHit::theta() const { return globalDirection().theta(); } -float VectorHit::transverseMomentum(float magField) const { return magField * 2.99792458e-3F / theCurvature;} // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, thus using 2.99792458e-3F (precise value from speed of light) -float VectorHit::momentum(float magField) const { return transverseMomentum(magField) / (1. * sin(theta()));} +float VectorHit::transverseMomentum(float magField) const { + return magField * 2.99792458e-3F / theCurvature; +} // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, thus using 2.99792458e-3F (precise value from speed of light) +float VectorHit::momentum(float magField) const { return transverseMomentum(magField) / (1. * sin(theta())); } AlgebraicMatrix VectorHit::projectionMatrix() const { // obsolete (for what tracker is concerned...) interface diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index f6c1e89ab4153..93d1a7c28eac5 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -40,7 +40,11 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { enum curvatureOrPhi { curvatureMode, phiMode }; - std::pair<float, float> curvatureORphi(curvatureOrPhi curvatureMode, Global3DPoint gPositionLower, Global3DPoint gPositionUpper, GlobalError gErrorLower, GlobalError gErrorUpper ) const; + std::pair<float, float> curvatureORphi(curvatureOrPhi curvatureMode, + Global3DPoint gPositionLower, + Global3DPoint gPositionUpper, + GlobalError gErrorLower, + GlobalError gErrorUpper) const; class LocalPositionSort { public: diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index fa4de8f46494e..4b1a0a6e31a11 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -320,15 +320,16 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, GlobalError gErrorLower = VectorHit::phase2clusterGlobalPosErr(geomDetLower); GlobalError gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); - if (gPositionLower.perp() > gPositionUpper.perp()) { - gPositionLower = VectorHit::phase2clusterGlobalPos(geomDetUpper, upper); - gPositionUpper = VectorHit::phase2clusterGlobalPos(geomDetLower, lower); - gErrorLower = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); - gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetLower); + gPositionLower = VectorHit::phase2clusterGlobalPos(geomDetUpper, upper); + gPositionUpper = VectorHit::phase2clusterGlobalPos(geomDetLower, lower); + gErrorLower = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); + gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetLower); } - const float curvature = curvatureORphi(curvatureMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).first; - const float curvatureError = curvatureORphi(curvatureMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).second; + const float curvature = + curvatureORphi(curvatureMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).first; + const float curvatureError = + curvatureORphi(curvatureMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).second; const float phi = curvatureORphi(phiMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).first; VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni, curvature, curvatureError, phi); @@ -383,7 +384,6 @@ void VectorHitBuilderAlgorithm::fit(float x[2], Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, double& chi2) const { - float slope = 0.; float intercept = 0.; float covss = 0.; @@ -409,26 +409,15 @@ void VectorHitBuilderAlgorithm::fit(float x[2], dir = LocalVector(slope, 0., slopeZ); } -std::pair<float, float> VectorHitBuilderAlgorithm::curvatureORphi(curvatureOrPhi curvORphi, Global3DPoint gPositionLower, Global3DPoint gPositionUpper, GlobalError gErrorLower, GlobalError gErrorUpper) const { +std::pair<float, float> VectorHitBuilderAlgorithm::curvatureORphi(curvatureOrPhi curvORphi, + Global3DPoint gPositionLower, + Global3DPoint gPositionUpper, + GlobalError gErrorLower, + GlobalError gErrorUpper) const { float curvature = -999.; float errorCurvature = -999.; float phi = -999.; - //global pos and errors -// Global3DPoint gPositionLower = lowerGlobalPos(); -// Global3DPoint gPositionUpper = upperGlobalPos(); - -// GlobalError gErrorLower = lowerGlobalPosErr(); -// GlobalError gErrorUpper = upperGlobalPosErr(); - - //insert lower and upper in the global sor -// if (gPositionLower.perp() > gPositionUpper.perp()) { -// gPositionLower = upperGlobalPos(); -// gPositionUpper = lowerGlobalPos(); -// gErrorLower = upperGlobalPosErr(); -// gErrorUpper = lowerGlobalPosErr(); -// } - float h1 = gPositionLower.x() * gPositionUpper.y() - gPositionUpper.x() * gPositionLower.y(); //determine sign of curvature @@ -443,7 +432,7 @@ std::pair<float, float> VectorHitBuilderAlgorithm::curvatureORphi(curvatureOrPhi double signCurv = -copysign(1.0, n3); double phi1 = atan2(gPositionUpper.y() - gPositionLower.y(), gPositionUpper.x() - gPositionLower.x()); - if (h1 != 0) { + if (h1 != 0) { double h2 = 2 * h1; double h2Inf = 1. / (2 * h1); double r12 = pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2); @@ -573,4 +562,3 @@ std::pair<float, float> VectorHitBuilderAlgorithm::curvatureORphi(curvatureOrPhi } return std::make_pair(0.0, 0.0); } - diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py index 0618b7982446a..10d7b0fdc9191 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py @@ -70,19 +70,19 @@ ) # debug -process.MessageLogger = cms.Service("MessageLogger", - destinations = cms.untracked.vstring("debugVH_tilted"), - debugModules = cms.untracked.vstring("*"), - categories = cms.untracked.vstring("VectorHitBuilderEDProducer","VectorHitBuilderAlgorithm","VectorHitsBuilderValidation","VectorHitBuilder"), - debugVH_tilted = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), - DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), - default = cms.untracked.PSet(limit = cms.untracked.int32(0)), - VectorHitBuilder = cms.untracked.PSet(limit = cms.untracked.int32(-1)), - VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), - VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), - VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) - ) - ) +#process.MessageLogger = cms.Service("MessageLogger", +# destinations = cms.untracked.vstring("debugVH_tilted"), +# debugModules = cms.untracked.vstring("*"), +# categories = cms.untracked.vstring("VectorHitBuilderEDProducer","VectorHitBuilderAlgorithm","VectorHitsBuilderValidation","VectorHitBuilder"), +# debugVH_tilted = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"), +# DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), +# default = cms.untracked.PSet(limit = cms.untracked.int32(0)), +# VectorHitBuilder = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# VectorHitBuilderEDProducer = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# VectorHitBuilderAlgorithm = cms.untracked.PSet(limit = cms.untracked.int32(-1)), +# VectorHitsBuilderValidation = cms.untracked.PSet(limit = cms.untracked.int32(-1)) +# ) +# ) # Analyzer process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 22d95e29034d3..9a87a93207ed2 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(False) + usePhase2Stacks = cms.bool(True) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 8afbdb9763eff..58d8729ae33c3 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -9,6 +9,7 @@ #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h" +#include "MagneticField/Engine/interface/MagneticField.h" #include "RecoTracker/Record/interface/CkfComponentsRecord.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" @@ -41,7 +42,7 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { static void fillDescriptions(edm::ConfigurationDescriptions&); - std::unique_ptr<TrajectorySeedCollection> run(edm::Handle<VectorHitCollectionNew>); + TrajectorySeedCollection run(edm::Handle<VectorHitCollectionNew>); unsigned int checkLayer(unsigned int iidd); std::vector<VectorHit> collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); void printVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); @@ -118,7 +119,6 @@ void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descr } void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { - //auto seedsWithVHs = std::make_unique<TrajectorySeedCollection>(); tkTopo_ = &es.getData(topoToken_); @@ -156,16 +156,15 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) seedsWithVHs->shrink_to_fit(); event.put(std::move(seedsWithVHs));*/ //auto seedsWithVHs = std::make_unique<> - event.put(putToken_, run(vhs)); + event.emplace(putToken_, run(vhs)); } -std::unique_ptr<TrajectorySeedCollection> SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { - //TrajectorySeedCollection result; - auto result = std::make_unique<TrajectorySeedCollection>(); +TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { + TrajectorySeedCollection result; //check if all the first three layers have VHs - std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(*(VHs.product()), 1); - std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(*(VHs.product()), 2); - std::vector<VectorHit> vhSeedsL3 = collectVHsOnLayer(*(VHs.product()), 3); + std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(*VHs.product(), 1); + std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(*VHs.product(), 2); + std::vector<VectorHit> vhSeedsL3 = collectVHsOnLayer(*VHs.product(), 3); if (vhSeedsL1.empty() || vhSeedsL2.empty() || vhSeedsL3.empty()) { return result; } @@ -255,13 +254,13 @@ std::unique_ptr<TrajectorySeedCollection> SeedingOTEDProducer::run(edm::Handle<V continue; TrajectorySeed ts = createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(), *buildingPropagator); - result->push_back(ts); + result.push_back(ts); } } } } } - result->shrink_to_fit(); + result.shrink_to_fit(); return result; } @@ -274,7 +273,7 @@ unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { return 0; } -std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>& input, +std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(const edmNew::DetSetVector<VectorHit> &input, unsigned int layerNumber) { std::vector<VectorHit> VHsOnLayer; if (!input.empty()) { @@ -310,7 +309,6 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto // gv transform to local (lv) const Local3DVector lv(vHit.det()->surface().toLocal(gv)); - //FIXME::charge is fine 1 every two times!! GlobalPoint center(0.0, 0.0, 0.0); int charge = 1; @@ -327,8 +325,9 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); // set the error on 1/p - mat[0][0] = - pow(computeInverseMomentumError(vHit, theta, beamSpot_->sigmaZ(), vHit.transverseMomentum(magField_->inTesla(center).z())), 2); + mat[0][0] = pow(computeInverseMomentumError( + vHit, theta, beamSpot_->sigmaZ(), vHit.transverseMomentum(magField_->inTesla(center).z())), + 2); //building tsos LocalTrajectoryError lterr(asSMatrix<5>(mat)); diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc index f93d4eedc55e7..561a240bb230b 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc @@ -478,7 +478,7 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder if (!ringRange(ring)) continue; for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); + result.emplace_back(*hit); } } if (skipClusters) From 6b9b4f22fa3643430ef61efe37580771e09055c0 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Thu, 10 Sep 2020 00:34:53 -0500 Subject: [PATCH 396/778] minor updates --- .../SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc | 2 +- .../python/TrackerRecoGeometryESProducer_cfi.py | 4 ++-- RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc | 3 +-- RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 4b1a0a6e31a11..e693d19a5844c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -58,7 +58,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track stackDet = dynamic_cast<const StackGeomDet*>(gd); std::vector<VectorHit> vhsInStack_Acc; std::vector<VectorHit> vhsInStack_Rej; - const auto vhsInStack_AccRej = buildVectorHits(stackDet, clusters, *it_detLower, *it_detUpper); + const auto& vhsInStack_AccRej = buildVectorHits(stackDet, clusters, *it_detLower, *it_detUpper); //storing accepted and rejected VHs for (const auto& vh : vhsInStack_AccRej) { diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 9a87a93207ed2..22d95e29034d3 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(True) + usePhase2Stacks = cms.bool(False) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 58d8729ae33c3..32c6b78b8b678 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -119,7 +119,6 @@ void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descr } void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { - tkTopo_ = &es.getData(topoToken_); edm::ESHandle<MeasurementTracker> measurementTrackerHandle = es.getHandle(measurementTrackerToken_); @@ -273,7 +272,7 @@ unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { return 0; } -std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(const edmNew::DetSetVector<VectorHit> &input, +std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>& input, unsigned int layerNumber) { std::vector<VectorHit> VHsOnLayer; if (!input.empty()) { diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc index 561a240bb230b..f93d4eedc55e7 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc @@ -478,7 +478,7 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder if (!ringRange(ring)) continue; for (VectorHitCollection::DetSet::const_iterator hit = it->begin(), end = it->end(); hit != end; ++hit) { - result.emplace_back(*hit); + result.emplace_back(*hit); } } if (skipClusters) From 61599bc59a8b0f03b3843ea56a72a145a802838a Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Thu, 10 Sep 2020 10:35:27 -0500 Subject: [PATCH 397/778] cache position in LocalPositionSort --- .../src/VectorHitBuilderAlgorithm.cc | 10 ++++++++++ .../python/TrackerRecoGeometryESProducer_cfi.py | 4 ++-- .../TkDetLayers/src/Phase2OTBarrelRodBuilder.cc | 1 - 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index e693d19a5844c..994282ca29035 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -5,10 +5,20 @@ bool VectorHitBuilderAlgorithm::LocalPositionSort::operator()(Phase2TrackerCluster1DRef clus1, Phase2TrackerCluster1DRef clus2) const { + static std::map<std::pair<Phase2TrackerCluster1DRef, Phase2TrackerCluster1DRef>, bool> cache; + + if (cache.find(std::make_pair(clus1, clus2)) != cache.end()) + return cache[std::pair(clus1, clus2)]; + else if (cache.find(std::make_pair(clus2, clus1)) != cache.end()) + return !cache[std::pair(clus1, clus2)]; + const PixelGeomDetUnit* gdu1 = dynamic_cast<const PixelGeomDetUnit*>(geomDet_); auto&& lparams1 = cpe_->localParameters(*clus1, *gdu1); // x, y, z, e2_xx, e2_xy, e2_yy auto&& lparams2 = cpe_->localParameters(*clus2, *gdu1); // x, y, z, e2_xx, e2_xy, e2_yy + + cache[std::make_pair(clus1, clus2)] = lparams1.first.x() < lparams2.first.x(); return lparams1.first.x() < lparams2.first.x(); + ; } void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 22d95e29034d3..9a87a93207ed2 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(False) + usePhase2Stacks = cms.bool(True) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc index 6ac4e8c0248fb..e73c2f45c93fe 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc @@ -8,7 +8,6 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 const TrackerGeometry* theGeomDetGeometry, const bool useBrothers) { vector<const GeometricDet*> allGeometricDets = thePhase2OTBarrelRod->components(); - // vector<const GeometricDet*> compGeometricDets; LogDebug("TkDetLayers") << "Phase2OTBarrelRodBuilder with #Modules: " << allGeometricDets.size() << std::endl; LogDebug("TkDetLayers") << " useBrothers: " << useBrothers << std::endl; From 18a03b3e66378d74ed53ce4b97ab84a4b703cb93 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Thu, 10 Sep 2020 10:38:08 -0500 Subject: [PATCH 398/778] turn VHs off again --- .../python/TrackerRecoGeometryESProducer_cfi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 9a87a93207ed2..22d95e29034d3 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(True) + usePhase2Stacks = cms.bool(False) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) From 8bf7d15201f2de6b668c72eef3d61a5a5af69c3c Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Mon, 14 Sep 2020 09:55:52 -0500 Subject: [PATCH 399/778] clarify 'sor' and rebase to latest IB --- .../src/VectorHitBuilderAlgorithmBase.cc | 4 ++-- .../SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 48d2864c7038c..0758bab8e6451 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -31,9 +31,9 @@ double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomD LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV; LocalVector lV = geomDetUnit_low->surface().toLocal(gV); - LogTrace("VectorHitsBuilderValidation") << " local vector passing to the origin (in low sor):" << lV; + LogTrace("VectorHitsBuilderValidation") << " local vector passing to the origin (in the lower detector system of reference):" << lV; LocalVector lV_norm = lV / lV.z(); - LogTrace("VectorHitsBuilderValidation") << " normalized local vector passing to the origin (in low sor):" << lV_norm; + LogTrace("VectorHitsBuilderValidation") << " normalized local vector passing to the origin (in low the lower detector system of reference):" << lV_norm; Global3DPoint gPosClu_upp = geomDetUnit_upp->surface().toGlobal(lPosClu_upp); Local3DPoint lPosClu_uppInLow = geomDetUnit_low->surface().toLocal(gPosClu_upp); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 4195a2a85e149..3515d731c60ef 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -612,13 +612,13 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev //stub width auto&& lparamsUpp = cpe_->localParameters(*vhIt.upperClusterRef().cluster_phase2OT(), *geomDetUnit_upp); - LogTrace("VectorHitsBuilderValidation") << " upper local pos (in its sor):" << lparamsUpp.first; + LogTrace("VectorHitsBuilderValidation") << " upper local pos (in its system of reference):" << lparamsUpp.first; Global3DPoint gparamsUpp = geomDetUnit_upp->surface().toGlobal(lparamsUpp.first); LogTrace("VectorHitsBuilderValidation") << " upper global pos :" << gparamsUpp; Local3DPoint lparamsUppInLow = geomDetUnit_low->surface().toLocal(gparamsUpp); - LogTrace("VectorHitsBuilderValidation") << " upper local pos (in low sor):" << lparamsUppInLow; + LogTrace("VectorHitsBuilderValidation") << " upper local pos (in low system of reference):" << lparamsUppInLow; auto&& lparamsLow = cpe_->localParameters(*vhIt.lowerClusterRef().cluster_phase2OT(), *geomDetUnit_low); - LogTrace("VectorHitsBuilderValidation") << " lower local pos (in its sor):" << lparamsLow.first; + LogTrace("VectorHitsBuilderValidation") << " lower local pos (in its system of reference):" << lparamsLow.first; Global3DPoint gparamsLow = geomDetUnit_low->surface().toGlobal(lparamsLow.first); LogTrace("VectorHitsBuilderValidation") << " lower global pos :" << gparamsLow; From 45ec1f2047d3a71136b74b9dced5cf054841ea67 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Mon, 14 Sep 2020 10:05:31 -0500 Subject: [PATCH 400/778] code format --- .../src/VectorHitBuilderAlgorithmBase.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 0758bab8e6451..5b78682bcde01 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -31,9 +31,11 @@ double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomD LogTrace("VectorHitsBuilderValidation") << " global vector passing to the origin:" << gV; LocalVector lV = geomDetUnit_low->surface().toLocal(gV); - LogTrace("VectorHitsBuilderValidation") << " local vector passing to the origin (in the lower detector system of reference):" << lV; + LogTrace("VectorHitsBuilderValidation") + << " local vector passing to the origin (in the lower detector system of reference):" << lV; LocalVector lV_norm = lV / lV.z(); - LogTrace("VectorHitsBuilderValidation") << " normalized local vector passing to the origin (in low the lower detector system of reference):" << lV_norm; + LogTrace("VectorHitsBuilderValidation") + << " normalized local vector passing to the origin (in low the lower detector system of reference):" << lV_norm; Global3DPoint gPosClu_upp = geomDetUnit_upp->surface().toGlobal(lPosClu_upp); Local3DPoint lPosClu_uppInLow = geomDetUnit_low->surface().toLocal(gPosClu_upp); From 17a2e02182da8be78be8fac57f12d0119bc00414 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Mon, 14 Sep 2020 10:42:19 -0500 Subject: [PATCH 401/778] fix theDimension usage and add constepr nComponents --- .../TrackerRecHit2D/interface/VectorHit.h | 2 ++ .../TrackerRecHit2D/interface/VectorHit2D.h | 2 +- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 30 +++++++++---------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 5a75a770df641..35140ba1118ff 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -153,6 +153,8 @@ class VectorHit final : public BaseTrackerRecHit { float theCurvature; float theCurvatureError; float thePhi; + + static constexpr int nComponents = 4; }; inline bool operator<(const VectorHit& one, const VectorHit& other) { return (one.chi2() < other.chi2()); } diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index e7fd9bfb6f953..4e378b0ac58aa 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -28,7 +28,7 @@ class VectorHit2D { } const AlgebraicSymMatrix22* covMatrix() const { return &theCovMatrix; } float chi2() const { return theChi2; } - int dimension() const { return 2; } + int dimension() const { return theDimension; } private: LocalPoint thePosition; diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 5e5aa727b750b..651a6d8317df1 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -45,7 +45,7 @@ VectorHit::VectorHit(const GeomDet& idet, const float curvatureError, const float phi) : BaseTrackerRecHit(idet, trackerHitRTTI::vector), - theDimension(4), + theDimension(vh2Dzx.dimension() + vh2Dzy.dimension()), theLowerCluster(lower), theUpperCluster(upper), theCurvature(curvature), @@ -59,7 +59,7 @@ VectorHit::VectorHit(const GeomDet& idet, const AlgebraicSymMatrix22 covMatZX = *vh2Dzx.covMatrix(); const AlgebraicSymMatrix22 covMatZY = *vh2Dzy.covMatrix(); - theCovMatrix = AlgebraicSymMatrix(4); + theCovMatrix = AlgebraicSymMatrix(nComponents); theCovMatrix[0][0] = covMatZX[0][0]; // var(dx/dz) theCovMatrix[1][1] = covMatZY[0][0]; // var(dy/dz) theCovMatrix[2][2] = covMatZX[1][1]; // var(x) @@ -98,35 +98,35 @@ bool VectorHit::sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedI } void VectorHit::getKfComponents4D(KfComponentsHolder& holder) const { - constexpr int four = 4; - AlgebraicVector4& pars = holder.params<four>(); + + AlgebraicVector4& pars = holder.params<nComponents>(); pars[0] = theDirection.x(); pars[1] = theDirection.y(); pars[2] = thePosition.x(); pars[3] = thePosition.y(); - AlgebraicSymMatrix44& errs = holder.errors<four>(); - for (int i = 0; i < four; i++) { - for (int j = 0; j < four; j++) { + AlgebraicSymMatrix44& errs = holder.errors<nComponents>(); + for (int i = 0; i < nComponents; i++) { + for (int j = 0; j < nComponents; j++) { errs(i, j) = theCovMatrix[i][j]; } } - ProjectMatrix<double, 5, four>& pf = holder.projFunc<four>(); + ProjectMatrix<double, 5, nComponents>& pf = holder.projFunc<nComponents>(); pf.index[0] = 1; pf.index[1] = 2; pf.index[2] = 3; pf.index[3] = 4; - holder.measuredParams<four>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), four); - holder.measuredErrors<four>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); + holder.measuredParams<nComponents>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), nComponents); + holder.measuredErrors<nComponents>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); } VectorHit::~VectorHit() {} AlgebraicVector VectorHit::parameters() const { // (dx/dz,dy/dz,x,y) - AlgebraicVector result(4); + AlgebraicVector result(nComponents); result[0] = theDirection.x(); result[1] = theDirection.y(); @@ -196,7 +196,7 @@ float VectorHit::momentum(float magField) const { return transverseMomentum(magF AlgebraicMatrix VectorHit::projectionMatrix() const { // obsolete (for what tracker is concerned...) interface - static const AlgebraicMatrix the4DProjectionMatrix(4, 5, 0); + static const AlgebraicMatrix the4DProjectionMatrix(nComponents, 5, 0); return the4DProjectionMatrix; } @@ -210,9 +210,9 @@ LocalError VectorHit::localDirectionError() const { AlgebraicSymMatrix VectorHit::parametersError() const { //think about a more efficient method - AlgebraicSymMatrix result(4); - for (int i = 0; i < theDimension; i++) { - for (int j = 0; j < theDimension; j++) { + AlgebraicSymMatrix result(nComponents); + for (int i = 0; i < nComponents; i++) { + for (int j = 0; j < nComponents; j++) { result[i][j] = theCovMatrix[i][j]; } } From f149ea2f4f46b86a255665f22e3fcea8546cbc30 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Mon, 14 Sep 2020 12:33:15 -0500 Subject: [PATCH 402/778] Vincenzo's commnets on VectorHitBuilderAlgorirthm --- .../interface/VectorHitBuilderAlgorithm.h | 14 --- .../src/VectorHitBuilderAlgorithm.cc | 88 +++++++------------ .../TrackerRecoGeometryESProducer_cfi.py | 4 +- 3 files changed, 33 insertions(+), 73 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 93d1a7c28eac5..e5f36655cb2f9 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -46,20 +46,6 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { GlobalError gErrorLower, GlobalError gErrorUpper) const; - class LocalPositionSort { - public: - LocalPositionSort(const TrackerGeometry* geometry, - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe, - const GeomDet* geomDet) - : geom_(geometry), cpe_(cpe), geomDet_(geomDet) {} - bool operator()(Phase2TrackerCluster1DRef clus1, Phase2TrackerCluster1DRef clus2) const; - - private: - const TrackerGeometry* geom_; - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; - const GeomDet* geomDet_; - }; - std::vector<std::pair<VectorHit, bool>> buildVectorHits( const StackGeomDet* stack, edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 994282ca29035..949db88cdb752 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -1,25 +1,9 @@ #include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" +#include "RecoLocalTracker/ClusterParameterEstimator/interface/ClusterParameterEstimator.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" #include "DataFormats/TrackerRecHit2D/interface/VectorHit2D.h" -bool VectorHitBuilderAlgorithm::LocalPositionSort::operator()(Phase2TrackerCluster1DRef clus1, - Phase2TrackerCluster1DRef clus2) const { - static std::map<std::pair<Phase2TrackerCluster1DRef, Phase2TrackerCluster1DRef>, bool> cache; - - if (cache.find(std::make_pair(clus1, clus2)) != cache.end()) - return cache[std::pair(clus1, clus2)]; - else if (cache.find(std::make_pair(clus2, clus1)) != cache.end()) - return !cache[std::pair(clus1, clus2)]; - - const PixelGeomDetUnit* gdu1 = dynamic_cast<const PixelGeomDetUnit*>(geomDet_); - auto&& lparams1 = cpe_->localParameters(*clus1, *gdu1); // x, y, z, e2_xx, e2_xy, e2_yy - auto&& lparams2 = cpe_->localParameters(*clus2, *gdu1); // x, y, z, e2_xx, e2_xy, e2_yy - - cache[std::make_pair(clus1, clus2)] = lparams1.first.x() < lparams2.first.x(); - return lparams1.first.x() < lparams2.first.x(); - ; -} void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, VectorHitCollectionNew& vhAcc, @@ -30,7 +14,6 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track const edmNew::DetSetVector<Phase2TrackerCluster1D>* ClustersPhase2Collection = clusters.product(); std::unordered_map<DetId, std::vector<VectorHit>> tempVHAcc, tempVHRej; - std::unordered_map<DetId, std::vector<VectorHit>>::iterator it_temporary; //loop over the DetSetVector LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << ClustersPhase2Collection->size() << std::endl; @@ -42,8 +25,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track lowerDetId = detId1; upperDetId = theTkTopo->partnerDetId(detId1); } else if (theTkTopo->isUpper(detId1)) { - upperDetId = detId1; - lowerDetId = theTkTopo->partnerDetId(detId1); + continue; } DetId detIdStack = theTkTopo->stack(detId1); @@ -52,11 +34,6 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track LogDebug("VectorHitBuilderAlgorithm") << " DetId lower set of clusters : " << lowerDetId.rawId(); LogDebug("VectorHitBuilderAlgorithm") << " DetId upper set of clusters : " << upperDetId.rawId() << std::endl; - it_temporary = tempVHAcc.find(detIdStack); - if (it_temporary != tempVHAcc.end()) { - LogTrace("VectorHitBuilderAlgorithm") << " this stack has already been analyzed -> skip it "; - continue; - } const GeomDet* gd; const StackGeomDet* stackDet; @@ -149,62 +126,58 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi } else { LogTrace("VectorHitBuilderAlgorithm") << " not compatible, going to the next cluster"; } + //only cache local parameters for upper cluster as we loop over lower clusters only once anyway + std::vector<std::pair<LocalPoint, LocalError>> localParamsUpper; + std::vector<const PixelGeomDetUnit*> localGDUUpper; - std::vector<Phase2TrackerCluster1DRef> lowerClusters; - for (const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++cil) { - Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo(clusters, cil); - lowerClusters.push_back(clusterLower); - } std::vector<Phase2TrackerCluster1DRef> upperClusters; for (const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ciu) { Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo(clusters, ciu); - upperClusters.push_back(clusterUpper); + const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); + localGDUUpper.push_back(gduUpp); + localParamsUpper.push_back(theCpe->localParameters(*clusterUpper, *gduUpp)); } - - std::sort_heap( - lowerClusters.begin(), lowerClusters.end(), LocalPositionSort(&*theTkGeom, &*theCpe, &*stack->lowerDet())); - std::sort_heap( - upperClusters.begin(), upperClusters.end(), LocalPositionSort(&*theTkGeom, &*theCpe, &*stack->upperDet())); - - for (const auto& cluL : lowerClusters) { + int upperIterator = 0; + for (const_iterator cil = theUpperDetSet.begin(); cil != theUpperDetSet.end(); ++cil) { LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; + Phase2TrackerCluster1DRef cluL = edmNew::makeRefTo(clusters, cil); printCluster(stack->lowerDet(), &*cluL); const PixelGeomDetUnit* gduLow = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); auto&& lparamsLow = theCpe->localParameters(*cluL, *gduLow); - for (const auto& cluU : upperClusters) { + upperIterator = 0; + for (const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ciu) { LogDebug("VectorHitBuilderAlgorithm") << "\t upper clusters " << std::endl; + Phase2TrackerCluster1DRef cluU = edmNew::makeRefTo(clusters, ciu); printCluster(stack->upperDet(), &*cluU); - const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); - auto&& lparamsUpp = theCpe->localParameters(*cluU, *gduUpp); //applying the parallax correction - double pC = computeParallaxCorrection(gduLow, lparamsLow.first, gduUpp, lparamsUpp.first); + double pC = computeParallaxCorrection(gduLow, lparamsLow.first, localGDUUpper[upperIterator], localParamsUpper[upperIterator].first); LogDebug("VectorHitBuilderAlgorithm") << " \t parallax correction:" << pC << std::endl; double lpos_upp_corr = 0.0; double lpos_low_corr = 0.0; - if (lparamsUpp.first.x() > lparamsLow.first.x()) { - if (lparamsUpp.first.x() > 0) { + if (localParamsUpper[upperIterator].first.x() > lparamsLow.first.x()) { + if (localParamsUpper[upperIterator].first.x() > 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() - std::abs(pC); - } else if (lparamsUpp.first.x() < 0) { + lpos_upp_corr = localParamsUpper[upperIterator].first.x() - std::abs(pC); + } else if (localParamsUpper[upperIterator].first.x() < 0) { lpos_low_corr = lparamsLow.first.x() + std::abs(pC); - lpos_upp_corr = lparamsUpp.first.x(); + lpos_upp_corr = localParamsUpper[upperIterator].first.x(); } - } else if (lparamsUpp.first.x() < lparamsLow.first.x()) { - if (lparamsUpp.first.x() > 0) { + } else if (localParamsUpper[upperIterator].first.x() < lparamsLow.first.x()) { + if (localParamsUpper[upperIterator].first.x() > 0) { lpos_low_corr = lparamsLow.first.x() - std::abs(pC); - lpos_upp_corr = lparamsUpp.first.x(); - } else if (lparamsUpp.first.x() < 0) { + lpos_upp_corr = localParamsUpper[upperIterator].first.x(); + } else if (localParamsUpper[upperIterator].first.x() < 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() + std::abs(pC); + lpos_upp_corr = localParamsUpper[upperIterator].first.x() + std::abs(pC); } } else { - if (lparamsUpp.first.x() > 0) { + if (localParamsUpper[upperIterator].first.x() > 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() - std::abs(pC); - } else if (lparamsUpp.first.x() < 0) { + lpos_upp_corr = localParamsUpper[upperIterator].first.x() - std::abs(pC); + } else if (localParamsUpper[upperIterator].first.x() < 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() + std::abs(pC); + lpos_upp_corr = localParamsUpper[upperIterator].first.x() + std::abs(pC); } } @@ -212,7 +185,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi LogDebug("VectorHitBuilderAlgorithm") << " \t local pos lower corrected (x):" << lpos_low_corr << std::endl; //building my tolerance : 10*sigma - double delta = 10.0 * sqrt(lparamsLow.second.xx() + lparamsUpp.second.xx()); + double delta = 10.0 * sqrt(lparamsLow.second.xx() + localParamsUpper[upperIterator].second.xx()); LogDebug("VectorHitBuilderAlgorithm") << " \t delta: " << delta << std::endl; double width = lpos_low_corr - lpos_upp_corr; @@ -250,6 +223,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi VectorHit vh = buildVectorHit(stack, cluL, cluU); result.emplace_back(std::make_pair(vh, false)); } + upperIterator=+1; } } diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 22d95e29034d3..9a87a93207ed2 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(False) + usePhase2Stacks = cms.bool(True) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) From ccc74b6546f25a66b5be8ce839bf5c846706423b Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Mon, 14 Sep 2020 12:42:15 -0500 Subject: [PATCH 403/778] code checks --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 1 - .../src/VectorHitBuilderAlgorithm.cc | 9 ++++----- .../python/TrackerRecoGeometryESProducer_cfi.py | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 651a6d8317df1..9dc9a214479b0 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -98,7 +98,6 @@ bool VectorHit::sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedI } void VectorHit::getKfComponents4D(KfComponentsHolder& holder) const { - AlgebraicVector4& pars = holder.params<nComponents>(); pars[0] = theDirection.x(); pars[1] = theDirection.y(); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 949db88cdb752..a1ac88723aa2b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -4,7 +4,6 @@ #include "Geometry/CommonTopologies/interface/PixelTopology.h" #include "DataFormats/TrackerRecHit2D/interface/VectorHit2D.h" - void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, VectorHitCollectionNew& vhAcc, VectorHitCollectionNew& vhRej, @@ -25,7 +24,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track lowerDetId = detId1; upperDetId = theTkTopo->partnerDetId(detId1); } else if (theTkTopo->isUpper(detId1)) { - continue; + continue; } DetId detIdStack = theTkTopo->stack(detId1); @@ -34,7 +33,6 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track LogDebug("VectorHitBuilderAlgorithm") << " DetId lower set of clusters : " << lowerDetId.rawId(); LogDebug("VectorHitBuilderAlgorithm") << " DetId upper set of clusters : " << upperDetId.rawId() << std::endl; - const GeomDet* gd; const StackGeomDet* stackDet; const auto& it_detLower = ClustersPhase2Collection->find(lowerDetId); @@ -151,7 +149,8 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi printCluster(stack->upperDet(), &*cluU); //applying the parallax correction - double pC = computeParallaxCorrection(gduLow, lparamsLow.first, localGDUUpper[upperIterator], localParamsUpper[upperIterator].first); + double pC = computeParallaxCorrection( + gduLow, lparamsLow.first, localGDUUpper[upperIterator], localParamsUpper[upperIterator].first); LogDebug("VectorHitBuilderAlgorithm") << " \t parallax correction:" << pC << std::endl; double lpos_upp_corr = 0.0; double lpos_low_corr = 0.0; @@ -223,7 +222,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi VectorHit vh = buildVectorHit(stack, cluL, cluU); result.emplace_back(std::make_pair(vh, false)); } - upperIterator=+1; + upperIterator = +1; } } diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 9a87a93207ed2..22d95e29034d3 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -1,9 +1,9 @@ import FWCore.ParameterSet.Config as cms TrackerRecoGeometryESProducer = cms.ESProducer("TrackerRecoGeometryESProducer", - usePhase2Stacks = cms.bool(True) + usePhase2Stacks = cms.bool(False) ) from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) +trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) From 999d80bc6e94b3d37ae27a6d7e3c635a5b2e88b8 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Mon, 14 Sep 2020 13:30:14 -0500 Subject: [PATCH 404/778] add process modifier to switch on Vector Hits --- Configuration/ProcessModifiers/python/vectorHits_cff.py | 5 +++++ .../python/TrackerRecoGeometryESProducer_cfi.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 Configuration/ProcessModifiers/python/vectorHits_cff.py diff --git a/Configuration/ProcessModifiers/python/vectorHits_cff.py b/Configuration/ProcessModifiers/python/vectorHits_cff.py new file mode 100644 index 0000000000000..13c607fc1c922 --- /dev/null +++ b/Configuration/ProcessModifiers/python/vectorHits_cff.py @@ -0,0 +1,5 @@ +import FWCore.ParameterSet.Config as cms + +# This modifier is for activating Vector Hits reconstruction in the Phase II OT + +vectorHits = cms.Modifier() diff --git a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py index 22d95e29034d3..048fd49b6da54 100644 --- a/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py +++ b/RecoTracker/GeometryESProducer/python/TrackerRecoGeometryESProducer_cfi.py @@ -4,6 +4,6 @@ usePhase2Stacks = cms.bool(False) ) -from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = False) +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toModify(TrackerRecoGeometryESProducer, usePhase2Stacks = True) From 92f2c7e390080b173087e9762c532a396a25b23d Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 15 Sep 2020 15:25:51 -0500 Subject: [PATCH 405/778] remove need to run curvatureORPhi 3 times --- .../interface/VectorHitBuilderAlgorithm.h | 5 +---- .../src/VectorHitBuilderAlgorithm.cc | 19 +++++++------------ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index e5f36655cb2f9..a24b21ff2df69 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -38,10 +38,7 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { LocalError& errinner, LocalError& errouter) const; - enum curvatureOrPhi { curvatureMode, phiMode }; - - std::pair<float, float> curvatureORphi(curvatureOrPhi curvatureMode, - Global3DPoint gPositionLower, + std::pair<std::pair<float, float>,float> curvatureANDphi(Global3DPoint gPositionLower, Global3DPoint gPositionUpper, GlobalError gErrorLower, GlobalError gErrorUpper) const; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index a1ac88723aa2b..7ed9079b8eb30 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -309,13 +309,9 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, gErrorLower = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetLower); } - const float curvature = - curvatureORphi(curvatureMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).first; - const float curvatureError = - curvatureORphi(curvatureMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).second; - const float phi = curvatureORphi(phiMode, gPositionLower, gPositionUpper, gErrorLower, gErrorUpper).first; - VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni, curvature, curvatureError, phi); + const auto& curvatureAndPhi = curvatureANDphi(gPositionLower, gPositionUpper, gErrorLower, gErrorUpper); + VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni, curvatureAndPhi.first.first, curvatureAndPhi.first.second, curvatureAndPhi.second); return vh; } @@ -392,8 +388,7 @@ void VectorHitBuilderAlgorithm::fit(float x[2], dir = LocalVector(slope, 0., slopeZ); } -std::pair<float, float> VectorHitBuilderAlgorithm::curvatureORphi(curvatureOrPhi curvORphi, - Global3DPoint gPositionLower, +std::pair<std::pair<float, float>,float> VectorHitBuilderAlgorithm::curvatureANDphi(Global3DPoint gPositionLower, Global3DPoint gPositionUpper, GlobalError gErrorLower, GlobalError gErrorUpper) const { @@ -535,13 +530,13 @@ std::pair<float, float> VectorHitBuilderAlgorithm::curvatureORphi(curvatureOrPhi temp[3] * curvatureJacobian[3]; } else { - return std::make_pair(0.0, 0.0); + return std::make_pair(std::make_pair(0.,0.), 0.0); } - switch (curvORphi) { +/* switch (curvORphi) { case curvatureMode: return std::make_pair(curvature, errorCurvature); case phiMode: return std::make_pair(phi, 0.0); - } - return std::make_pair(0.0, 0.0); + }*/ + return std::make_pair(std::make_pair(curvature, errorCurvature), phi); } From 68ea0ce89bd8e17c3dfac69b4cc9fb72797be145 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 15 Sep 2020 20:25:42 -0500 Subject: [PATCH 406/778] put printClusters behind EDM_ML_DEBUG --- .../src/VectorHitBuilderAlgorithm.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 7ed9079b8eb30..53020ff332e68 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -139,15 +139,18 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi for (const_iterator cil = theUpperDetSet.begin(); cil != theUpperDetSet.end(); ++cil) { LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; Phase2TrackerCluster1DRef cluL = edmNew::makeRefTo(clusters, cil); +#ifdef EDM_ML_DEBUG printCluster(stack->lowerDet(), &*cluL); +#endif const PixelGeomDetUnit* gduLow = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); auto&& lparamsLow = theCpe->localParameters(*cluL, *gduLow); upperIterator = 0; for (const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ciu) { LogDebug("VectorHitBuilderAlgorithm") << "\t upper clusters " << std::endl; Phase2TrackerCluster1DRef cluU = edmNew::makeRefTo(clusters, ciu); +#ifdef EDM_ML_DEBUG printCluster(stack->upperDet(), &*cluU); - +#endif //applying the parallax correction double pC = computeParallaxCorrection( gduLow, lparamsLow.first, localGDUUpper[upperIterator], localParamsUpper[upperIterator].first); @@ -233,8 +236,9 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper) const { LogTrace("VectorHitBuilderAlgorithm") << "Build VH with: "; - //printCluster(stack->upperDet(),&*upper); - +#ifdef EDM_ML_DEBUG + printCluster(stack->upperDet(),&*upper); +#endif const PixelGeomDetUnit* geomDetLower = static_cast<const PixelGeomDetUnit*>(stack->lowerDet()); const PixelGeomDetUnit* geomDetUpper = static_cast<const PixelGeomDetUnit*>(stack->upperDet()); From ba5e5d40f594a311e907b6d4059db0ebed28e532 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 15 Sep 2020 20:57:16 -0500 Subject: [PATCH 407/778] add forgotten push_heap --- .../SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 53020ff332e68..b985ea5360e6b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -49,6 +49,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track for (const auto& vh : vhsInStack_AccRej) { if (vh.second == true) { vhsInStack_Acc.push_back(vh.first); + std::push_heap(vhsInStack_Acc.begin(),vhsInStack_Acc.end()); } else if (vh.second == false) { vhsInStack_Rej.push_back(vh.first); } From 2d15513a768860766a2f0a141b3a7e49aab62898 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Tue, 15 Sep 2020 23:29:46 -0500 Subject: [PATCH 408/778] code format --- .../interface/VectorHitBuilderAlgorithm.h | 8 +++--- .../src/VectorHitBuilderAlgorithm.cc | 25 ++++++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index a24b21ff2df69..376382eb04853 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -38,10 +38,10 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { LocalError& errinner, LocalError& errouter) const; - std::pair<std::pair<float, float>,float> curvatureANDphi(Global3DPoint gPositionLower, - Global3DPoint gPositionUpper, - GlobalError gErrorLower, - GlobalError gErrorUpper) const; + std::pair<std::pair<float, float>, float> curvatureANDphi(Global3DPoint gPositionLower, + Global3DPoint gPositionUpper, + GlobalError gErrorLower, + GlobalError gErrorUpper) const; std::vector<std::pair<VectorHit, bool>> buildVectorHits( const StackGeomDet* stack, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index b985ea5360e6b..1097537b086de 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -49,7 +49,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track for (const auto& vh : vhsInStack_AccRej) { if (vh.second == true) { vhsInStack_Acc.push_back(vh.first); - std::push_heap(vhsInStack_Acc.begin(),vhsInStack_Acc.end()); + std::push_heap(vhsInStack_Acc.begin(), vhsInStack_Acc.end()); } else if (vh.second == false) { vhsInStack_Rej.push_back(vh.first); } @@ -238,7 +238,7 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef upper) const { LogTrace("VectorHitBuilderAlgorithm") << "Build VH with: "; #ifdef EDM_ML_DEBUG - printCluster(stack->upperDet(),&*upper); + printCluster(stack->upperDet(), &*upper); #endif const PixelGeomDetUnit* geomDetLower = static_cast<const PixelGeomDetUnit*>(stack->lowerDet()); const PixelGeomDetUnit* geomDetUpper = static_cast<const PixelGeomDetUnit*>(stack->upperDet()); @@ -316,7 +316,14 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, } const auto& curvatureAndPhi = curvatureANDphi(gPositionLower, gPositionUpper, gErrorLower, gErrorUpper); - VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni, curvatureAndPhi.first.first, curvatureAndPhi.first.second, curvatureAndPhi.second); + VectorHit vh = VectorHit(*stack, + vh2Dzx, + vh2Dzy, + lowerOmni, + upperOmni, + curvatureAndPhi.first.first, + curvatureAndPhi.first.second, + curvatureAndPhi.second); return vh; } @@ -393,10 +400,10 @@ void VectorHitBuilderAlgorithm::fit(float x[2], dir = LocalVector(slope, 0., slopeZ); } -std::pair<std::pair<float, float>,float> VectorHitBuilderAlgorithm::curvatureANDphi(Global3DPoint gPositionLower, - Global3DPoint gPositionUpper, - GlobalError gErrorLower, - GlobalError gErrorUpper) const { +std::pair<std::pair<float, float>, float> VectorHitBuilderAlgorithm::curvatureANDphi(Global3DPoint gPositionLower, + Global3DPoint gPositionUpper, + GlobalError gErrorLower, + GlobalError gErrorUpper) const { float curvature = -999.; float errorCurvature = -999.; float phi = -999.; @@ -535,9 +542,9 @@ std::pair<std::pair<float, float>,float> VectorHitBuilderAlgorithm::curvatureAND temp[3] * curvatureJacobian[3]; } else { - return std::make_pair(std::make_pair(0.,0.), 0.0); + return std::make_pair(std::make_pair(0., 0.), 0.0); } -/* switch (curvORphi) { + /* switch (curvORphi) { case curvatureMode: return std::make_pair(curvature, errorCurvature); case phiMode: From 66e765d064c24cb45d8534daf03f09db7cf0e6fd Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 16 Sep 2020 13:36:48 -0500 Subject: [PATCH 409/778] adapt track selection for vector hits --- .../python/HighPtTripletStep_cff.py | 55 +++++++++++++++++++ .../python/LowPtTripletStep_cff.py | 47 ++++++++++++++++ .../python/PixelPairStep_cff.py | 46 ++++++++++++++++ 3 files changed, 148 insertions(+) diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index dad46627f08d7..326a45a8d5b18 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -318,6 +318,59 @@ ] #end of vpset ) #end of clone +highPtTripletStepSelector_vectorHits = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone( + src = 'highPtTripletStepTracks', + trackSelectors = [ + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone( + name = 'highPtTripletStepLoose', + chi2n_par = 2.0, + res_par = ( 0.003, 0.002 ), + minNumberLayers = 3, + maxNumberLostLayers = 3, + minNumber3DLayers = 3, + d0_par1 = ( 0.7, 4.0 ), + dz_par1 = ( 0.8, 4.0 ), + d0_par2 = ( 0.6, 4.0 ), + dz_par2 = ( 0.6, 4.0 ) + ), #end of pset + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone( + name = 'highPtTripletStepTight', + preFilterName = 'highPtTripletStepLoose', + chi2n_par = 1.0, + res_par = ( 0.003, 0.002 ), + minNumberLayers = 3, + maxNumberLostLayers = 2, + minNumber3DLayers = 3, + d0_par1 = ( 0.6, 4.0 ), + dz_par1 = ( 0.7, 4.0 ), + d0_par2 = ( 0.5, 4.0 ), + dz_par2 = ( 0.6, 4.0 ) + ), + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone( + name = 'highPtTripletStep', + preFilterName = 'highPtTripletStepTight', + min_eta = -4.1, + max_eta = 4.1, + chi2n_par = 0.8, + res_par = ( 0.003, 0.001 ), + min_nhits = 4, + minNumberLayers = 3, + maxNumberLostLayers = 2, + minNumber3DLayers = 3, + d0_par1 = ( 0.5, 4.0 ), + dz_par1 = ( 0.6, 4.0 ), + d0_par2 = ( 0.45, 4.0 ), + dz_par2 = ( 0.55, 4.0 ) + ), + ] #end of vpset +) #en + + +#vectorHits.toModify(highPtTripletStepSelector, minNumberLayers = 3) +#vectorHits.toModify(highPtTripletStepSelector, minNumber3DLayers = 3) +#vectorHits.toModify(highPtTripletStepSelector, d0_par1 = ( 0.5, 4.0 )) +#vectorHits.toModify(highPtTripletStepSelector, dz_par1 = ( 0.6, 4.0 )) + # Final sequence HighPtTripletStepTask = cms.Task(highPtTripletStepClusters, highPtTripletStepSeedLayers, @@ -335,6 +388,8 @@ _HighPtTripletStep_Phase2PU140 = cms.Sequence(_HighPtTripletStepTask_Phase2PU140) trackingPhase2PU140.toReplaceWith(HighPtTripletStepTask, _HighPtTripletStepTask_Phase2PU140) +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toReplaceWith(highPtTripletStepSelector, highPtTripletStepSelector_vectorHits) # fast tracking mask producer from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover highPtTripletStepMasks = maskProducerFromClusterRemover(highPtTripletStepClusters) diff --git a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py index fdd1f29f75afe..0f1d9aeb10c12 100644 --- a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py @@ -362,6 +362,53 @@ ), #end of vpset ) #end of clone +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toModify(lowPtTripletStepSelector, + trackSelectors= cms.VPSet( + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone( + name = 'lowPtTripletStepLoose', + chi2n_par = 1.2, + res_par = ( 0.003, 0.002 ), + minNumberLayers = 3, + maxNumberLostLayers = 2, + minNumber3DLayers = 3, + d0_par1 = ( 0.7, 4.0 ), + dz_par1 = ( 0.7, 4.0 ), + d0_par2 = ( 0.6, 4.0 ), + dz_par2 = ( 0.6, 4.0 ) + ), #end of pset + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone( + name = 'lowPtTripletStepTight', + preFilterName = 'lowPtTripletStepLoose', + chi2n_par = 0.7, + res_par = ( 0.003, 0.002 ), + minNumberLayers = 3, + maxNumberLostLayers = 2, + minNumber3DLayers = 3, + d0_par1 = ( 0.6, 4.0 ), + dz_par1 = ( 0.6, 4.0 ), + d0_par2 = ( 0.5, 4.0 ), + dz_par2 = ( 0.5, 4.0 ) + ), + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone( + name = 'lowPtTripletStep', + preFilterName = 'lowPtTripletStepTight', + min_eta = -4.0, + max_eta = 4.0, + chi2n_par = 0.4, + res_par = ( 0.003, 0.001 ), + min_nhits = 3, + minNumberLayers = 3, + maxNumberLostLayers = 2, + minNumber3DLayers = 3, + d0_par1 = ( 0.5, 4.0 ), + dz_par1 = ( 0.5, 4.0 ), + d0_par2 = ( 0.45, 4.0 ), + dz_par2 = ( 0.45, 4.0 ) + ), + ), #end of vpset +) #end of clone + # Final sequence diff --git a/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py b/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py index bdca6fd4af1e7..9570c259b6b6a 100644 --- a/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py @@ -419,6 +419,52 @@ vertices = 'firstStepPrimaryVertices' ) #end of clone +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toModify(pixelPairStepSelector, + trackSelectors = cms.VPSet( + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone( + name = 'pixelPairStepLoose', + chi2n_par = 0.7, + res_par = ( 0.003, 0.002 ), + minNumberLayers = 3, + maxNumberLostLayers = 2, + minNumber3DLayers = 3, + d0_par1 = ( 0.4, 4.0 ), + dz_par1 = ( 0.4, 4.0 ), + d0_par2 = ( 0.6, 4.0 ), + dz_par2 = ( 0.45, 4.0 ) + ), #end of pset + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone( + name = 'pixelPairStepTight', + preFilterName = 'pixelPairStepLoose', + chi2n_par = 0.6, + res_par = ( 0.003, 0.002 ), + minNumberLayers = 4, + maxNumberLostLayers = 2, + minNumber3DLayers = 3, + d0_par1 = ( 0.35, 4.0 ), + dz_par1 = ( 0.35, 4.0 ), + d0_par2 = ( 0.5, 4.0 ), + dz_par2 = ( 0.4, 4.0 ) + ), + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone( + name = 'pixelPairStep', + preFilterName = 'pixelPairStepTight', +# min_eta = -4.0, # useless, the eta distribution does not even reach |eta| = 3 (!) +# max_eta = 4.0, + chi2n_par = 0.5, + res_par = ( 0.003, 0.001 ), + minNumberLayers = 4, + maxNumberLostLayers = 2, + minNumber3DLayers = 3, + d0_par1 = ( 0.3, 4.0 ), + dz_par1 = ( 0.3, 4.0 ), + d0_par2 = ( 0.45, 4.0 ), + dz_par2 = ( 0.35, 4.0 ) + ), + ), #end of vpset + vertices = 'firstStepPrimaryVertices' +) #end of clone # Final sequence PixelPairStepTask = cms.Task(pixelPairStepClusters, From c3357eba33dd46809d405564aa73077631874c57 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 16 Sep 2020 16:17:07 -0500 Subject: [PATCH 410/778] add pixelLess iteration for vectorHits process modifier --- .../python/earlyGeneralTracks_cfi.py | 26 ++++ .../python/PixelLessStep_cff.py | 127 +++++++++++++++++- .../python/iterativeTkConfig.py | 2 + 3 files changed, 154 insertions(+), 1 deletion(-) diff --git a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py index 6ab340983ab9c..b0ac555769792 100644 --- a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py +++ b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py @@ -101,3 +101,29 @@ makeReKeyedSeeds = cms.untracked.bool(False) ) ) +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toReplaceWith(earlyGeneralTracks, _trackListMerger.clone( + TrackProducers =['initialStepTracks', + 'highPtTripletStepTracks', + 'lowPtQuadStepTracks', + 'lowPtTripletStepTracks', + 'detachedQuadStepTracks', + 'pixelPairStepTracks', + 'pixelLessStepTracks', + ], + hasSelector = [1,1,1,1,1,1,1], + indivShareFrac = [1.0,0.16,0.095,0.09,0.09,0.09,0.095], + selectedTrackQuals = ['initialStepSelector:initialStep', + 'highPtTripletStepSelector:highPtTripletStep', + 'lowPtQuadStepSelector:lowPtQuadStep', + 'lowPtTripletStepSelector:lowPtTripletStep', + 'detachedQuadStep', + 'pixelPairStepSelector:pixelPairStep', + 'pixelLessStepSelector:pixelLessStep', + ], + setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True) ) + ), + copyExtras = True, + makeReKeyedSeeds = cms.untracked.bool(False) + ) +) diff --git a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py index 4180e142dd8ff..2272535b4cf28 100644 --- a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py @@ -104,7 +104,34 @@ MTID = None, MTEC = None, ) - +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toModify(pixelLessStepSeedLayers, + layerList = [ + 'TOB1+TOB2', 'TOB2+TOB3', +# 'TOB3+TOB4', 'TOB4+TOB5', + 'TID1_pos+TID2_pos', 'TID1_neg+TID2_neg' + ], + TOB = cms.PSet( + TTRHBuilder = cms.string('WithTrackAngle'), + clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutNone')), + vectorRecHits = cms.InputTag("siPhase2VectorHits", 'vectorHitsAccepted'), + skipClusters = cms.InputTag('pixelLessStepClusters') + ), + TIB = None, + TID = cms.PSet( + TTRHBuilder = cms.string('WithTrackAngle'), + clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutNone')), + vectorRecHits = cms.InputTag("siPhase2VectorHits", 'vectorHitsAccepted'), + skipClusters = cms.InputTag('pixelLessStepClusters'), + useRingSlector = cms.bool(True), + minRing = cms.int32(1), + maxRing = cms.int32(8) + ), + TEC = None, + MTIB = None, + MTID = None, + MTEC = None, +) # TrackingRegion from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpotFixedZ_cfi import globalTrackingRegionFromBeamSpotFixedZ as _globalTrackingRegionFromBeamSpotFixedZ pixelLessStepTrackingRegions = _globalTrackingRegionFromBeamSpotFixedZ.clone(RegionPSet = dict( @@ -194,6 +221,28 @@ )) fastSim.toReplaceWith(pixelLessStepSeeds,_fastSim_pixelLessStepSeeds) +vectorHits.toModify(pixelLessStepHitDoublets, produceSeedingHitSets=True, produceIntermediateHitDoublets=False) +vectorHits.toModify(pixelLessStepSeeds, + seedingHitSets = "pixelLessStepHitDoublets", + SeedComparitorPSet = cms.PSet( + ClusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache"), + ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'), + ComponentName = cms.string('PixelClusterShapeSeedComparitor'), + FilterAtHelixStage = cms.bool(False), + FilterPixelHits = cms.bool(False), + FilterStripHits = cms.bool(False), +# comparitors = cms.VPSet(cms.PSet( +# ClusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache"), +# ClusterShapeHitFilterName = cms.string('pixelLessStepClusterShapeHitFilter'), +# ComponentName = cms.string('PixelClusterShapeSeedComparitor'), +# FilterAtHelixStage = cms.bool(False), +# FilterPixelHits = cms.bool(False), +# FilterStripHits = cms.bool(False) +# ), +# ) + ) +) + # QUALITY CUTS DURING TRACK BUILDING import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff _pixelLessStepTrajectoryFilterBase = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone( @@ -208,6 +257,9 @@ for e in [pp_on_XeXe_2017, pp_on_AA_2018]: e.toModify(pixelLessStepTrajectoryFilter, minPt=2.0) +vectorHits.toReplaceWith(pixelLessStepTrajectoryFilter, _pixelLessStepTrajectoryFilterBase) +vectorHits.toModify(pixelLessStepTrajectoryFilter, minimumNumberOfHits = 4, maxLostHits = 1) + import RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi pixelLessStepChi2Est = RecoTracker.MeasurementDet.Chi2ChargeMeasurementEstimator_cfi.Chi2ChargeMeasurementEstimator.clone( ComponentName = 'pixelLessStepChi2Est', @@ -219,6 +271,11 @@ clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutTiny') ) +vectorHits.toModify(pixelLessStepChi2Est, + clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutNone'), + MaxChi2 = cms.double(30.0) +) + # TRACK BUILDING import RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi pixelLessStepTrajectoryBuilder = RecoTracker.CkfPattern.GroupedCkfTrajectoryBuilder_cfi.GroupedCkfTrajectoryBuilder.clone( @@ -252,6 +309,11 @@ ) ) +vectorHits.toModify(pixelLessStepTrackCandidates, + phase2clustersToSkip = cms.InputTag('pixelLessStepClusters'), + clustersToSkip = None +) + from TrackingTools.TrajectoryCleaning.TrajectoryCleanerBySharedHits_cfi import trajectoryCleanerBySharedHits pixelLessStepTrajectoryCleanerBySharedHits = trajectoryCleanerBySharedHits.clone( ComponentName = 'pixelLessStepTrajectoryCleanerBySharedHits', @@ -358,6 +420,55 @@ vertices = 'pixelVertices'#end of vpset ) #end of clone +vectorHits.toModify(pixelLessStepSelector, + GBRForestLabel = None, + useAnyMVA = None, + trackSelectors= cms.VPSet( + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone( + name = 'pixelLessStepLoose', + chi2n_par = 1.0, + res_par = ( 0.003, 0.001 ), + minNumberLayers = 0, + maxNumberLostLayers = 1, + minNumber3DLayers = 0, + d0_par1 = ( 0.9, 4.0 ), + dz_par1 = ( 0.9, 4.0 ), + d0_par2 = ( 1.0, 4.0 ), + dz_par2 = ( 1.0, 4.0 ) + ), + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone( + name = 'pixelLessStepTight', + preFilterName = 'pixelLessStepLoose', + chi2n_par = 0.35, + res_par = ( 0.003, 0.001 ), + minNumberLayers = 4, + maxNumberLostLayers = 0, + minNumber3DLayers = 3, + d0_par1 = ( 1.1, 4.0 ), + dz_par1 = ( 1.1, 4.0 ), + d0_par2 = ( 1.1, 4.0 ), + dz_par2 = ( 1.1, 4.0 ) + ), + RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone( + name = 'QualityMasks', + preFilterName = 'pixelLessStepTight', + chi2n_par = 0.2, + res_par = ( 0.003, 0.001 ), + minNumberLayers = 1, + maxNumberLostLayers = 2, + minNumber3DLayers = 0, + d0_par1 = ( 100., 4.0 ), + dz_par1 = ( 100., 4.0 ), + d0_par2 = ( 100., 4.0 ), + dz_par2 = ( 100., 4.0 ) + ), + ), + vertices = 'firstStepPrimaryVertices' +) + +vectorHits.toModify(pixelLessStepSelector.trackSelectors[2], name = 'pixelLessStep') + + PixelLessStepTask = cms.Task(pixelLessStepClusters, pixelLessStepSeedLayers, pixelLessStepTrackingRegions, @@ -386,3 +497,17 @@ ,pixelLessStep ) ) +from RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2VectorHits_cfi import * +_PixelLessStepTask_vectorHits = cms.Task(siPhase2VectorHits, + pixelLessStepClusters, + pixelLessStepSeedLayers, + pixelLessStepTrackingRegions, + pixelLessStepHitDoublets, + pixelLessStepHitTriplets, + pixelLessStepSeeds, + pixelLessStepTrackCandidates, + pixelLessStepTracks, + pixelLessStepSelector) +_PixelLessStep_vectorHits = cms.Sequence(_PixelLessStepTask_vectorHits) +vectorHits.toReplaceWith(PixelLessStepTask, _PixelLessStepTask_vectorHits) +vectorHits.toReplaceWith(PixelLessStep, _PixelLessStep_vectorHits) diff --git a/RecoTracker/IterativeTracking/python/iterativeTkConfig.py b/RecoTracker/IterativeTracking/python/iterativeTkConfig.py index a34b00031488e..0f187dcf4184b 100644 --- a/RecoTracker/IterativeTracking/python/iterativeTkConfig.py +++ b/RecoTracker/IterativeTracking/python/iterativeTkConfig.py @@ -56,6 +56,8 @@ "DetachedQuadStep", "PixelPairStep", ] +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toModify(_iterations_trackingPhase2PU140, func=lambda x: x.append('PixelLessStep')) _iterations_muonSeeded = [ "MuonSeededStepInOut", "MuonSeededStepOutIn", From e9b6828514fc32e3a64a87660ed5f923e40c0b50 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 16 Sep 2020 18:54:55 -0500 Subject: [PATCH 411/778] add special workflows to test vector hits --- .../python/upgradeWorkflowComponents.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 348256ce9258b..6ca34a2531afd 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -298,6 +298,24 @@ def condition_(self, fragment, stepList, key, hasHarvest): '--procModifiers': 'trackingMkFit' } +# Vector Hits workflows +class UpgradeWorkflow_vectorHits(UpgradeWorkflow): + def setup_(self, step, stepName, stepDict, k, properties): + stepDict[stepName][k] = merge([{'--procModifiers': 'vectorHits'}, stepDict[step][k]]) + def condition(self, fragment, stepList, key, hasHarvest): + return fragment=="TTbar_14TeV" and '2026' in key +upgradeWFs['vectorHits'] = UpgradeWorkflow_vectorHits( + steps = [ + 'Reco', + ], + PU = [ + 'Reco', + ], + suffix = '_vectorHits', + offset = 0.9, +) + + # Patatrack workflows class UpgradeWorkflowPatatrack(UpgradeWorkflow): def condition(self, fragment, stepList, key, hasHarvest): From 580200d7dc6b27117649c3d11034e58780ff526f Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 16 Sep 2020 19:05:57 -0500 Subject: [PATCH 412/778] some cleanup --- .../IterativeTracking/python/HighPtTripletStep_cff.py | 6 ------ .../IterativeTracking/python/PixelLessStep_cff.py | 9 --------- 2 files changed, 15 deletions(-) diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index 326a45a8d5b18..867a57fde8806 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -366,11 +366,6 @@ ) #en -#vectorHits.toModify(highPtTripletStepSelector, minNumberLayers = 3) -#vectorHits.toModify(highPtTripletStepSelector, minNumber3DLayers = 3) -#vectorHits.toModify(highPtTripletStepSelector, d0_par1 = ( 0.5, 4.0 )) -#vectorHits.toModify(highPtTripletStepSelector, dz_par1 = ( 0.6, 4.0 )) - # Final sequence HighPtTripletStepTask = cms.Task(highPtTripletStepClusters, highPtTripletStepSeedLayers, @@ -380,7 +375,6 @@ highPtTripletStepSeeds, highPtTripletStepTrackCandidates, highPtTripletStepTracks, -# highPtTripletStepClassifier1,highPtTripletStepClassifier2,highPtTripletStepClassifier3* highPtTripletStep) HighPtTripletStep = cms.Sequence(HighPtTripletStepTask) _HighPtTripletStepTask_Phase2PU140 = HighPtTripletStepTask.copy() diff --git a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py index 2272535b4cf28..37c1276b64c44 100644 --- a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py @@ -231,15 +231,6 @@ FilterAtHelixStage = cms.bool(False), FilterPixelHits = cms.bool(False), FilterStripHits = cms.bool(False), -# comparitors = cms.VPSet(cms.PSet( -# ClusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache"), -# ClusterShapeHitFilterName = cms.string('pixelLessStepClusterShapeHitFilter'), -# ComponentName = cms.string('PixelClusterShapeSeedComparitor'), -# FilterAtHelixStage = cms.bool(False), -# FilterPixelHits = cms.bool(False), -# FilterStripHits = cms.bool(False) -# ), -# ) ) ) From 16e51bb1ca8db60423c50a74b85f159dc8ed2e95 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Wed, 16 Sep 2020 20:59:59 -0500 Subject: [PATCH 413/778] add wf 23234.9 to those available for PR validation --- Configuration/PyReleaseValidation/python/relval_2026.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index e023aaf2653d8..3d753c1ea6c79 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -19,6 +19,7 @@ numWFIB.extend([23434.99,23434.999]) #2026D49 premixing combined stage1+stage2 (ttbar+PU200, ttbar+PU50 for PR test) numWFIB.extend([23234.21,23434.21]) #2026D49 prodlike, prodlike PU numWFIB.extend([23234.103]) #2026D49 aging +numWFIB.extend([23234.9]) #2026D49 vector hits numWFIB.extend([28234.0]) #2026D60 numWFIB.extend([29834.0]) #2026D64 numWFIB.extend([30234.0]) #2026D65 From cfd6018cb0213f01ed116e8083ad92d3d321c148 Mon Sep 17 00:00:00 2001 From: JanFSchulte <jfschulte@hotmail.com> Date: Mon, 21 Sep 2020 13:09:53 -0500 Subject: [PATCH 414/778] add removed newline --- .../GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc index 5242ff422eef2..04f9f7fba6026 100644 --- a/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc +++ b/RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.cc @@ -46,6 +46,7 @@ TrackerRecoGeometryESProducer::TrackerRecoGeometryESProducer(const edm::Paramete tTopToken_ = c.consumes(); geomToken_ = c.consumes(edm::ESInputTag("", p.getUntrackedParameter<std::string>("trackerGeometryLabel"))); } + std::unique_ptr<GeometricSearchTracker> TrackerRecoGeometryESProducer::produce( const TrackerRecoGeometryRecord &iRecord) { TrackerGeometry const &tG = iRecord.get(geomToken_); From 74cf64c15e09058cf5a9aae55013e19836168ed0 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 22 Sep 2020 20:29:39 +0200 Subject: [PATCH 415/778] use seedingOT producer in pixelLess step --- .../IterativeTracking/python/PixelLessStep_cff.py | 14 ++++++++++---- .../TkSeedGenerator/plugins/SeedingOTEDProducer.cc | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py index 37c1276b64c44..359931be8c6cd 100644 --- a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py @@ -489,16 +489,22 @@ ) ) from RecoLocalTracker.SiPhase2VectorHitBuilder.siPhase2VectorHits_cfi import * +from RecoTracker.TkSeedGenerator.SeedingOTEDProducer_cfi import SeedingOTEDProducer as _SeedingOTEDProducer +pixelLessStepSeeds_vectorHits = _SeedingOTEDProducer.clone() + +#siPhase2VectorHits.Clusters = cms.string("pixelLessStepClusters") + _PixelLessStepTask_vectorHits = cms.Task(siPhase2VectorHits, pixelLessStepClusters, - pixelLessStepSeedLayers, - pixelLessStepTrackingRegions, - pixelLessStepHitDoublets, - pixelLessStepHitTriplets, + #pixelLessStepSeedLayers, + #pixelLessStepTrackingRegions, + #pixelLessStepHitDoublets, + #pixelLessStepHitTriplets, pixelLessStepSeeds, pixelLessStepTrackCandidates, pixelLessStepTracks, pixelLessStepSelector) _PixelLessStep_vectorHits = cms.Sequence(_PixelLessStepTask_vectorHits) +vectorHits.toReplaceWith(pixelLessStepSeeds,pixelLessStepSeeds_vectorHits) vectorHits.toReplaceWith(PixelLessStepTask, _PixelLessStepTask_vectorHits) vectorHits.toReplaceWith(PixelLessStep, _PixelLessStep_vectorHits) diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 32c6b78b8b678..392039375e749 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -260,6 +260,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio } } result.shrink_to_fit(); + std::cout << "n seeds: " << result.size() << std::endl; return result; } From f1ce21b437b404ba1d6ee10539a6f156949afe98 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 22 Sep 2020 20:29:57 +0200 Subject: [PATCH 416/778] bug fixes --- .../src/VectorHitBuilderAlgorithm.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 1097537b086de..12369a604c48d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -137,7 +137,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi localParamsUpper.push_back(theCpe->localParameters(*clusterUpper, *gduUpp)); } int upperIterator = 0; - for (const_iterator cil = theUpperDetSet.begin(); cil != theUpperDetSet.end(); ++cil) { + for (const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++cil) { LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; Phase2TrackerCluster1DRef cluL = edmNew::makeRefTo(clusters, cil); #ifdef EDM_ML_DEBUG @@ -342,9 +342,9 @@ void VectorHitBuilderAlgorithm::fit2Dzx(const Local3DPoint lpCI, float y[2] = {lpCI.x(), lpCO.x()}; float sqCI = sqrt(leCI.xx()); float sqCO = sqrt(leCO.xx()); - float sigy[2] = {sqCI, sqCO}; + float sigy2[2] = {sqCI*sqCI, sqCO*sqCO}; - fit(x, y, sigy, pos, dir, covMatrix, chi2); + fit(x, y, sigy2, pos, dir, covMatrix, chi2); return; } @@ -361,16 +361,16 @@ void VectorHitBuilderAlgorithm::fit2Dzy(const Local3DPoint lpCI, float y[2] = {lpCI.y(), lpCO.y()}; float sqCI = sqrt(leCI.yy()); float sqCO = sqrt(leCO.yy()); - float sigy[2] = {sqCI, sqCO}; + float sigy2[2] = {sqCI*sqCI, sqCO*sqCO}; - fit(x, y, sigy, pos, dir, covMatrix, chi2); + fit(x, y, sigy2, pos, dir, covMatrix, chi2); return; } void VectorHitBuilderAlgorithm::fit(float x[2], float y[2], - float sigy[2], + float sigy2[2], Local3DPoint& pos, Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, @@ -382,7 +382,7 @@ void VectorHitBuilderAlgorithm::fit(float x[2], float covsi = 0.; //theFitter->linearFit(x, y, 2, sigy, slope, intercept, covss, covii, covsi); - linearFit(x, y, 2, sigy, slope, intercept, covss, covii, covsi); + linearFit(x, y, 2, sigy2, slope, intercept, covss, covii, covsi); covMatrix[0][0] = covss; // this is var(dy/dz) covMatrix[1][1] = covii; // this is var(y) @@ -390,7 +390,7 @@ void VectorHitBuilderAlgorithm::fit(float x[2], for (unsigned int j = 0; j < 2; j++) { const double ypred = intercept + slope * x[j]; - const double dy = (y[j] - ypred) / sigy[j]; + const double dy = (y[j] - ypred) / sqrt(sigy2[j]); chi2 += dy * dy; } From ec1a12e1ca10b2a5fd39df2b14673b80e9e4425b Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 22 Sep 2020 20:40:12 +0200 Subject: [PATCH 417/778] code checks --- .../SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 12369a604c48d..8864c7e03613d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -342,7 +342,7 @@ void VectorHitBuilderAlgorithm::fit2Dzx(const Local3DPoint lpCI, float y[2] = {lpCI.x(), lpCO.x()}; float sqCI = sqrt(leCI.xx()); float sqCO = sqrt(leCO.xx()); - float sigy2[2] = {sqCI*sqCI, sqCO*sqCO}; + float sigy2[2] = {sqCI * sqCI, sqCO * sqCO}; fit(x, y, sigy2, pos, dir, covMatrix, chi2); @@ -361,7 +361,7 @@ void VectorHitBuilderAlgorithm::fit2Dzy(const Local3DPoint lpCI, float y[2] = {lpCI.y(), lpCO.y()}; float sqCI = sqrt(leCI.yy()); float sqCO = sqrt(leCO.yy()); - float sigy2[2] = {sqCI*sqCI, sqCO*sqCO}; + float sigy2[2] = {sqCI * sqCI, sqCO * sqCO}; fit(x, y, sigy2, pos, dir, covMatrix, chi2); From 2c876398ee155984bb225fec2ed1ec6d515f35ad Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 22 Sep 2020 20:44:23 +0200 Subject: [PATCH 418/778] cleanup --- RecoTracker/IterativeTracking/python/PixelLessStep_cff.py | 6 ------ RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc | 1 - 2 files changed, 7 deletions(-) diff --git a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py index 359931be8c6cd..de2e3fb74a343 100644 --- a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py @@ -492,14 +492,8 @@ from RecoTracker.TkSeedGenerator.SeedingOTEDProducer_cfi import SeedingOTEDProducer as _SeedingOTEDProducer pixelLessStepSeeds_vectorHits = _SeedingOTEDProducer.clone() -#siPhase2VectorHits.Clusters = cms.string("pixelLessStepClusters") - _PixelLessStepTask_vectorHits = cms.Task(siPhase2VectorHits, pixelLessStepClusters, - #pixelLessStepSeedLayers, - #pixelLessStepTrackingRegions, - #pixelLessStepHitDoublets, - #pixelLessStepHitTriplets, pixelLessStepSeeds, pixelLessStepTrackCandidates, pixelLessStepTracks, diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 392039375e749..32c6b78b8b678 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -260,7 +260,6 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio } } result.shrink_to_fit(); - std::cout << "n seeds: " << result.size() << std::endl; return result; } From 24d84b9d37c20aa41ee52c49efab915c5dbe05e6 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 23 Sep 2020 16:32:51 +0200 Subject: [PATCH 419/778] fix bug in incrementing loop counter --- .../SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 8864c7e03613d..8c37b6ae1e90d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -226,7 +226,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi VectorHit vh = buildVectorHit(stack, cluL, cluU); result.emplace_back(std::make_pair(vh, false)); } - upperIterator = +1; + upperIterator += 1; } } From 9ac1ebe7dfc2f84e861db43e117cd5e39c5deaa0 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Fri, 25 Sep 2020 00:51:06 +0200 Subject: [PATCH 420/778] use pre-created VectorHits in track building --- .../interface/MeasurementTracker.h | 1 + .../interface/MeasurementTrackerEvent.h | 5 ++++ .../MeasurementTrackerEventProducer.cc | 27 ++++++++++++++++++- .../plugins/MeasurementTrackerEventProducer.h | 2 ++ .../plugins/MeasurementTrackerImpl.cc | 20 +++++++------- .../plugins/MeasurementTrackerImpl.h | 4 +-- .../plugins/TkStackMeasurementDet.cc | 24 ++++++++++++++--- .../plugins/TkStackMeasurementDet.h | 4 ++- .../MeasurementTrackerEventProducer_cfi.py | 5 +++- .../src/MeasurementTrackerEvent.cc | 6 +++++ 10 files changed, 79 insertions(+), 19 deletions(-) diff --git a/RecoTracker/MeasurementDet/interface/MeasurementTracker.h b/RecoTracker/MeasurementDet/interface/MeasurementTracker.h index 8da9362f58258..f1cf8e59780bb 100644 --- a/RecoTracker/MeasurementDet/interface/MeasurementTracker.h +++ b/RecoTracker/MeasurementDet/interface/MeasurementTracker.h @@ -4,6 +4,7 @@ #include "TrackingTools/MeasurementDet/interface/MeasurementDetSystem.h" #include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" #include "FWCore/Framework/interface/Event.h" diff --git a/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h b/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h index c65203dba5624..ab5214206e9a2 100644 --- a/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h +++ b/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h @@ -8,6 +8,7 @@ class Phase2OTMeasurementDetSet; #include "DataFormats/SiStripCluster/interface/SiStripCluster.h" #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h" #include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "DataFormats/Common/interface/ContainerMask.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" @@ -25,6 +26,7 @@ class MeasurementTrackerEvent { const StMeasurementDetSet *strips, const PxMeasurementDetSet *pixels, const Phase2OTMeasurementDetSet *phase2OT, + const VectorHitCollectionNew *phase2OTVectorHits, const std::vector<bool> &stripClustersToSkip, const std::vector<bool> &pixelClustersToSkip, const std::vector<bool> &phase2OTClustersToSkip) @@ -32,6 +34,7 @@ class MeasurementTrackerEvent { theStripData(strips), thePixelData(pixels), thePhase2OTData(phase2OT), + thePhase2OTVectorHits(phase2OTVectorHits), theOwner(true), theStripClustersToSkip(stripClustersToSkip), thePixelClustersToSkip(pixelClustersToSkip), @@ -57,6 +60,7 @@ class MeasurementTrackerEvent { const StMeasurementDetSet &stripData() const { return *theStripData; } const PxMeasurementDetSet &pixelData() const { return *thePixelData; } const Phase2OTMeasurementDetSet &phase2OTData() const { return *thePhase2OTData; } + const VectorHitCollectionNew &phase2OTVectorHits() const { return *thePhase2OTVectorHits; } const std::vector<bool> &stripClustersToSkip() const { return theStripClustersToSkip; } const std::vector<bool> &pixelClustersToSkip() const { return thePixelClustersToSkip; } const std::vector<bool> &phase2OTClustersToSkip() const { return thePhase2OTClustersToSkip; } @@ -73,6 +77,7 @@ class MeasurementTrackerEvent { const StMeasurementDetSet *theStripData = nullptr; const PxMeasurementDetSet *thePixelData = nullptr; const Phase2OTMeasurementDetSet *thePhase2OTData = nullptr; + const VectorHitCollectionNew *thePhase2OTVectorHits = nullptr; bool theOwner = false; // do I own the tree above? // these could be const pointers as well, but ContainerMask doesn't expose the vector std::vector<bool> theStripClustersToSkip; diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index 364f91ee33896..f2d98ea16aedf 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -60,6 +60,11 @@ MeasurementTrackerEventProducer::MeasurementTrackerEventProducer(const edm::Para edm::InputTag(iConfig.getParameter<std::string>("Phase2TrackerCluster1DProducer"))); isPhase2 = true; } + if (!(iConfig.getParameter<edm::InputTag>("vectorHits") == edm::InputTag(""))) { + thePh2OTVectorHitsLabel = consumes<VectorHitCollectionNew>(iConfig.getParameter<edm::InputTag>("vectorHits")); + isPhase2 = true; + useVectorHits = true; + } produces<MeasurementTrackerEvent>(); } @@ -72,6 +77,7 @@ void MeasurementTrackerEventProducer::fillDescriptions(edm::ConfigurationDescrip desc.add<std::string>("pixelClusterProducer", "siPixelClusters"); desc.add<std::string>("stripClusterProducer", "siStripClusters"); desc.add<std::string>("Phase2TrackerCluster1DProducer", ""); + desc.add<edm::InputTag>("vectorHits",edm::InputTag("")); desc.add<std::vector<edm::InputTag>>("inactivePixelDetectorLabels", std::vector<edm::InputTag>{{edm::InputTag("siPixelDigis")}}) @@ -97,6 +103,7 @@ void MeasurementTrackerEventProducer::produce(edm::Event& iEvent, const edm::Eve auto stripData = std::make_unique<StMeasurementDetSet>(measurementTracker->stripDetConditions()); auto pixelData = std::make_unique<PxMeasurementDetSet>(measurementTracker->pixelDetConditions()); auto phase2OTData = std::make_unique<Phase2OTMeasurementDetSet>(measurementTracker->phase2DetConditions()); + std::vector<bool> stripClustersToSkip; std::vector<bool> pixelClustersToSkip; std::vector<bool> phase2ClustersToSkip; @@ -112,13 +119,31 @@ void MeasurementTrackerEventProducer::produce(edm::Event& iEvent, const edm::Eve // put into MTE // put into event - iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, + + edm::Handle<VectorHitCollectionNew> vectorHitsHandle; + if (useVectorHits) { + const VectorHitCollectionNew* phase2OTVectorHits = vectorHitsHandle.product(); + + iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, stripData.release(), pixelData.release(), phase2OTData.release(), + phase2OTVectorHits, stripClustersToSkip, pixelClustersToSkip, phase2ClustersToSkip)); + } + else{ + + iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, + stripData.release(), + pixelData.release(), + phase2OTData.release(), + nullptr, + stripClustersToSkip, + pixelClustersToSkip, + phase2ClustersToSkip)); + } } void MeasurementTrackerEventProducer::updatePixels(const edm::Event& event, diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h index c502477a8e3d8..ef16e4659a06c 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h @@ -40,6 +40,7 @@ class dso_hidden MeasurementTrackerEventProducer final : public edm::stream::EDP edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster>> thePixelClusterLabel; edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster>> theStripClusterLabel; edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D>> thePh2OTClusterLabel; + edm::EDGetTokenT<VectorHitCollectionNew> thePh2OTVectorHitsLabel; edm::EDGetTokenT<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster>>> thePixelClusterMask; edm::EDGetTokenT<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster>>> theStripClusterMask; @@ -51,6 +52,7 @@ class dso_hidden MeasurementTrackerEventProducer final : public edm::stream::EDP bool selfUpdateSkipClusters_; bool switchOffPixelsIfEmpty_; bool isPhase2; + bool useVectorHits; }; #endif diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index 337082baf5e7d..2ee029d9e17b1 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -111,13 +111,13 @@ void MeasurementTrackerImpl::initialize(const TrackerTopology* trackerTopology) if (!theTrackerGeom->detsPXB().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsPXB().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsPXB(), subIsPixel, subIsOT); + addDets(theTrackerGeom->detsPXB(), subIsPixel, subIsOT, trackerTopology); } if (!theTrackerGeom->detsPXF().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsPXF().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsPXF(), subIsPixel, subIsOT); + addDets(theTrackerGeom->detsPXF(), subIsPixel, subIsOT, trackerTopology); } subIsOT = true; @@ -125,25 +125,25 @@ void MeasurementTrackerImpl::initialize(const TrackerTopology* trackerTopology) if (!theTrackerGeom->detsTIB().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTIB().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsTIB(), subIsPixel, subIsOT); + addDets(theTrackerGeom->detsTIB(), subIsPixel, subIsOT, trackerTopology); } if (!theTrackerGeom->detsTID().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTID().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsTID(), subIsPixel, subIsOT); + addDets(theTrackerGeom->detsTID(), subIsPixel, subIsOT, trackerTopology); } if (!theTrackerGeom->detsTOB().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTOB().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsTOB(), subIsPixel, subIsOT); + addDets(theTrackerGeom->detsTOB(), subIsPixel, subIsOT, trackerTopology); } if (!theTrackerGeom->detsTEC().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTEC().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsTEC(), subIsPixel, subIsOT); + addDets(theTrackerGeom->detsTEC(), subIsPixel, subIsOT, trackerTopology); } // fist all stripdets @@ -217,7 +217,7 @@ void MeasurementTrackerImpl::initPhase2OTMeasurementConditionSet(std::vector<TkP } } -void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT) { +void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT, const TrackerTopology* trackerTopology) { //in phase2, we can have composed subDetector made by Pixel or Strip for (TrackerGeometry::DetContainer::const_iterator gd = dets.begin(); gd != dets.end(); gd++) { const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(*gd); @@ -244,7 +244,7 @@ void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, if (gluedDet != nullptr) addGluedDet(gluedDet); else - addStackDet(stackDet); + addStackDet(stackDet,trackerTopology); } } } @@ -283,10 +283,10 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { theGluedDets.push_back(TkGluedMeasurementDet(gd, theStDetConditions.matcher(), theStDetConditions.stripCPE())); } -void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) { +void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd, const TrackerTopology* trackerTopology) { //since the Stack will be composed by PS or 2S, //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. - theStackDets.push_back(TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE())); + theStackDets.push_back(TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE(),trackerTopology)); } void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) { diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h index 69c6a0e97d5ba..da44026df0c75 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h @@ -132,12 +132,12 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker { void addPhase2Det(const GeomDet* gd); void addGluedDet(const GluedGeomDet* gd); - void addStackDet(const StackGeomDet* gd); + void addStackDet(const StackGeomDet* gd, const TrackerTopology* trackerTopology); void initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology); void initStackDet(TkStackMeasurementDet& det); - void addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT); + void addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT, const TrackerTopology* trackerTopology); bool checkDets(); diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index 176211395063c..6186dacf5a9b7 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -7,8 +7,9 @@ using namespace std; TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet, const VectorHitBuilderAlgorithm* matcher, - const PixelClusterParameterEstimator* cpe) - : MeasurementDet(gdet), theMatcher(matcher), thePixelCPE(cpe), theLowerDet(nullptr), theUpperDet(nullptr) {} + const PixelClusterParameterEstimator* cpe, + const TrackerTopology* tkTopo) + : MeasurementDet(gdet), theMatcher(matcher), thePixelCPE(cpe), theTkTopo(tkTopo), theLowerDet(nullptr), theUpperDet(nullptr) {} void TkStackMeasurementDet::init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet) { theLowerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet); @@ -27,13 +28,13 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj HitCollectorForRecHits collector( &fastGeomDet(), theMatcher, theCPE, result ); collectRecHits(ts, collector); */ - if (isEmpty(data.phase2OTData())) + if (data.phase2OTVectorHits().size() == 0) return result; LogTrace("MeasurementTracker") << " is not empty"; if (!isActive(data)) return result; LogTrace("MeasurementTracker") << " and is active"; - +/* const Phase2TrackerCluster1D* begin = nullptr; if (!data.phase2OTData().handle()->data().empty()) { begin = &(data.phase2OTData().handle()->data().front()); @@ -77,7 +78,22 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj } } } + + +*/ + //unsigned int rawDetId1(lowerDet()->index()); + //DetId detId1(rawDetId1); + //DetId detIdStack = theTkTopo->stack(detId1); + //DetId detIdStack = theTkTopo->stack(specificGeomDet().geographicalId()); + DetId detIdStack = specificGeomDet().geographicalId(); + + //std::cout << "ID of current stack " << detIdStack << std::endl; + auto iterator = data.phase2OTVectorHits().find(detIdStack); + if (iterator == data.phase2OTVectorHits().end()) return result; + for (auto& vecHit : data.phase2OTVectorHits()[detIdStack]) + result.push_back(std::make_shared<VectorHit>(vecHit)); + //std::cout << result.size() << std::endl; return result; } diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index a5bbfde36414f..f675ff3a7f9ff 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -16,7 +16,8 @@ class TkStackMeasurementDet final : public MeasurementDet { public: TkStackMeasurementDet(const StackGeomDet* gdet, const VectorHitBuilderAlgorithm* matcher, - const PixelClusterParameterEstimator* cpe); + const PixelClusterParameterEstimator* cpe, + const TrackerTopology* tkTopo); void init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet); RecHitContainer recHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent& data) const override; @@ -51,6 +52,7 @@ class TkStackMeasurementDet final : public MeasurementDet { private: const VectorHitBuilderAlgorithm* theMatcher; const PixelClusterParameterEstimator* thePixelCPE; + const TrackerTopology* theTkTopo; const TkPhase2OTMeasurementDet* theLowerDet; const TkPhase2OTMeasurementDet* theUpperDet; }; diff --git a/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py b/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py index 6442eb1de605a..d4431bbfa3662 100644 --- a/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py +++ b/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py @@ -23,7 +23,10 @@ inactiveStripDetectorLabels = cms.VInputTag(), switchOffPixelsIfEmpty = False ) - +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toModify(MeasurementTrackerEvent, + vectorHits = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), +) MeasurementTrackerEventPreSplitting = MeasurementTrackerEvent.clone( pixelClusterProducer = 'siPixelClustersPreSplitting' diff --git a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc index 274a2f62cfbde..a3431fcee0dc7 100644 --- a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc +++ b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc @@ -10,6 +10,8 @@ MeasurementTrackerEvent::~MeasurementTrackerEvent() { thePixelData = nullptr; // to double-delete the same object (!!!) delete thePhase2OTData; thePhase2OTData = nullptr; // to double-delete the same object (!!!) +// delete thePhase2OTVectorHits; +// thePhase2OTVectorHits = nullptr; // to double-delete the same object (!!!) } } @@ -18,6 +20,7 @@ MeasurementTrackerEvent::MeasurementTrackerEvent(MeasurementTrackerEvent &&other theStripData = other.theStripData; thePixelData = other.thePixelData; thePhase2OTData = other.thePhase2OTData; + thePhase2OTVectorHits = other.thePhase2OTVectorHits; theOwner = other.theOwner; other.theOwner = false; // make sure to fully transfer the ownership theStripClustersToSkip = std::move(other.theStripClustersToSkip); @@ -28,6 +31,7 @@ MeasurementTrackerEvent &MeasurementTrackerEvent::operator=(MeasurementTrackerEv theStripData = other.theStripData; thePixelData = other.thePixelData; thePhase2OTData = other.thePhase2OTData; + thePhase2OTVectorHits = other.thePhase2OTVectorHits; theOwner = other.theOwner; other.theOwner = false; // make sure to fully transfer the ownership theStripClustersToSkip = std::move(other.theStripClustersToSkip); @@ -43,6 +47,7 @@ MeasurementTrackerEvent::MeasurementTrackerEvent( theStripData(trackerEvent.theStripData), thePixelData(trackerEvent.thePixelData), thePhase2OTData(nullptr), + thePhase2OTVectorHits(nullptr), theOwner(false) { //std::cout << "Creatign non-owned MT @ " << this << " from @ " << & trackerEvent << " (strip data @ " << trackerEvent.theStripData << ")" << std::endl; if (stripClustersToSkip.refProd().id() != theStripData->handle().id()) { @@ -77,6 +82,7 @@ MeasurementTrackerEvent::MeasurementTrackerEvent( theStripData(nullptr), thePixelData(trackerEvent.thePixelData), thePhase2OTData(trackerEvent.thePhase2OTData), + thePhase2OTVectorHits(trackerEvent.thePhase2OTVectorHits), theOwner(false) { if (pixelClustersToSkip.refProd().id() != thePixelData->handle().id()) { edm::LogError("ProductIdMismatch") << "The pixel masking does not point to the proper collection of clusters: " From 03f94959dba8a7fed7160efbef43ec39d3465a1d Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Fri, 25 Sep 2020 01:40:20 +0200 Subject: [PATCH 421/778] code checks and format --- .../MeasurementTrackerEventProducer.cc | 40 +++++++++---------- .../plugins/MeasurementTrackerImpl.cc | 10 +++-- .../plugins/MeasurementTrackerImpl.h | 5 ++- .../plugins/TkStackMeasurementDet.cc | 31 ++++++++------ .../plugins/TkStackMeasurementDet.h | 2 +- .../src/MeasurementTrackerEvent.cc | 4 +- 6 files changed, 51 insertions(+), 41 deletions(-) diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index f2d98ea16aedf..ed9dcfb9553d4 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -77,7 +77,7 @@ void MeasurementTrackerEventProducer::fillDescriptions(edm::ConfigurationDescrip desc.add<std::string>("pixelClusterProducer", "siPixelClusters"); desc.add<std::string>("stripClusterProducer", "siStripClusters"); desc.add<std::string>("Phase2TrackerCluster1DProducer", ""); - desc.add<edm::InputTag>("vectorHits",edm::InputTag("")); + desc.add<edm::InputTag>("vectorHits", edm::InputTag("")); desc.add<std::vector<edm::InputTag>>("inactivePixelDetectorLabels", std::vector<edm::InputTag>{{edm::InputTag("siPixelDigis")}}) @@ -122,27 +122,25 @@ void MeasurementTrackerEventProducer::produce(edm::Event& iEvent, const edm::Eve edm::Handle<VectorHitCollectionNew> vectorHitsHandle; if (useVectorHits) { - const VectorHitCollectionNew* phase2OTVectorHits = vectorHitsHandle.product(); - - iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, - stripData.release(), - pixelData.release(), - phase2OTData.release(), - phase2OTVectorHits, - stripClustersToSkip, - pixelClustersToSkip, - phase2ClustersToSkip)); - } - else{ - + iEvent.getByToken(thePh2OTVectorHitsLabel, vectorHitsHandle); + const VectorHitCollectionNew* phase2OTVectorHits = vectorHitsHandle.product(); + iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, + stripData.release(), + pixelData.release(), + phase2OTData.release(), + phase2OTVectorHits, + stripClustersToSkip, + pixelClustersToSkip, + phase2ClustersToSkip)); + } else { iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, - stripData.release(), - pixelData.release(), - phase2OTData.release(), - nullptr, - stripClustersToSkip, - pixelClustersToSkip, - phase2ClustersToSkip)); + stripData.release(), + pixelData.release(), + phase2OTData.release(), + nullptr, + stripClustersToSkip, + pixelClustersToSkip, + phase2ClustersToSkip)); } } diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index 2ee029d9e17b1..8030097d49a11 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -217,7 +217,10 @@ void MeasurementTrackerImpl::initPhase2OTMeasurementConditionSet(std::vector<TkP } } -void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT, const TrackerTopology* trackerTopology) { +void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, + bool subIsPixel, + bool subIsOT, + const TrackerTopology* trackerTopology) { //in phase2, we can have composed subDetector made by Pixel or Strip for (TrackerGeometry::DetContainer::const_iterator gd = dets.begin(); gd != dets.end(); gd++) { const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(*gd); @@ -244,7 +247,7 @@ void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, if (gluedDet != nullptr) addGluedDet(gluedDet); else - addStackDet(stackDet,trackerTopology); + addStackDet(stackDet, trackerTopology); } } } @@ -286,7 +289,8 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd, const TrackerTopology* trackerTopology) { //since the Stack will be composed by PS or 2S, //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. - theStackDets.push_back(TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE(),trackerTopology)); + theStackDets.push_back( + TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE(), trackerTopology)); } void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) { diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h index da44026df0c75..0cd595a08a3fc 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h @@ -137,7 +137,10 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker { void initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology); void initStackDet(TkStackMeasurementDet& det); - void addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT, const TrackerTopology* trackerTopology); + void addDets(const TrackingGeometry::DetContainer& dets, + bool subIsPixel, + bool subIsOT, + const TrackerTopology* trackerTopology); bool checkDets(); diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index 6186dacf5a9b7..01e633a5c576f 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -8,8 +8,13 @@ using namespace std; TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet, const VectorHitBuilderAlgorithm* matcher, const PixelClusterParameterEstimator* cpe, - const TrackerTopology* tkTopo) - : MeasurementDet(gdet), theMatcher(matcher), thePixelCPE(cpe), theTkTopo(tkTopo), theLowerDet(nullptr), theUpperDet(nullptr) {} + const TrackerTopology* tkTopo) + : MeasurementDet(gdet), + theMatcher(matcher), + thePixelCPE(cpe), + theTkTopo(tkTopo), + theLowerDet(nullptr), + theUpperDet(nullptr) {} void TkStackMeasurementDet::init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet) { theLowerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet); @@ -28,13 +33,13 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj HitCollectorForRecHits collector( &fastGeomDet(), theMatcher, theCPE, result ); collectRecHits(ts, collector); */ - if (data.phase2OTVectorHits().size() == 0) + if (data.phase2OTVectorHits().empty()) return result; LogTrace("MeasurementTracker") << " is not empty"; if (!isActive(data)) return result; LogTrace("MeasurementTracker") << " and is active"; -/* + /* const Phase2TrackerCluster1D* begin = nullptr; if (!data.phase2OTData().handle()->data().empty()) { begin = &(data.phase2OTData().handle()->data().front()); @@ -82,18 +87,18 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj */ - //unsigned int rawDetId1(lowerDet()->index()); - //DetId detId1(rawDetId1); - //DetId detIdStack = theTkTopo->stack(detId1); - //DetId detIdStack = theTkTopo->stack(specificGeomDet().geographicalId()); - DetId detIdStack = specificGeomDet().geographicalId(); + //unsigned int rawDetId1(lowerDet()->index()); + //DetId detId1(rawDetId1); + //DetId detIdStack = theTkTopo->stack(detId1); + //DetId detIdStack = theTkTopo->stack(specificGeomDet().geographicalId()); + DetId detIdStack = specificGeomDet().geographicalId(); //std::cout << "ID of current stack " << detIdStack << std::endl; - auto iterator = data.phase2OTVectorHits().find(detIdStack); - if (iterator == data.phase2OTVectorHits().end()) return result; + auto iterator = data.phase2OTVectorHits().find(detIdStack); + if (iterator == data.phase2OTVectorHits().end()) + return result; for (auto& vecHit : data.phase2OTVectorHits()[detIdStack]) - result.push_back(std::make_shared<VectorHit>(vecHit)); - //std::cout << result.size() << std::endl; + result.push_back(std::make_shared<VectorHit>(vecHit)); return result; } diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index f675ff3a7f9ff..a04f613751bf6 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -17,7 +17,7 @@ class TkStackMeasurementDet final : public MeasurementDet { TkStackMeasurementDet(const StackGeomDet* gdet, const VectorHitBuilderAlgorithm* matcher, const PixelClusterParameterEstimator* cpe, - const TrackerTopology* tkTopo); + const TrackerTopology* tkTopo); void init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet); RecHitContainer recHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent& data) const override; diff --git a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc index a3431fcee0dc7..d4b438630a58a 100644 --- a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc +++ b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc @@ -10,8 +10,8 @@ MeasurementTrackerEvent::~MeasurementTrackerEvent() { thePixelData = nullptr; // to double-delete the same object (!!!) delete thePhase2OTData; thePhase2OTData = nullptr; // to double-delete the same object (!!!) -// delete thePhase2OTVectorHits; -// thePhase2OTVectorHits = nullptr; // to double-delete the same object (!!!) + // delete thePhase2OTVectorHits; + // thePhase2OTVectorHits = nullptr; // to double-delete the same object (!!!) } } From 5c42b055d65519e73bea57f41abe0ea56b82605c Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Fri, 25 Sep 2020 16:08:41 +0200 Subject: [PATCH 422/778] some cleanup --- .../interface/MeasurementTracker.h | 1 - .../plugins/MeasurementTrackerImpl.cc | 23 ++++++++----------- .../plugins/MeasurementTrackerImpl.h | 7 ++---- .../plugins/TkStackMeasurementDet.cc | 22 ++++-------------- .../plugins/TkStackMeasurementDet.h | 4 +--- .../src/MeasurementTrackerEvent.cc | 2 -- .../plugins/SeedingOTEDProducer.cc | 8 ------- 7 files changed, 18 insertions(+), 49 deletions(-) diff --git a/RecoTracker/MeasurementDet/interface/MeasurementTracker.h b/RecoTracker/MeasurementDet/interface/MeasurementTracker.h index f1cf8e59780bb..8da9362f58258 100644 --- a/RecoTracker/MeasurementDet/interface/MeasurementTracker.h +++ b/RecoTracker/MeasurementDet/interface/MeasurementTracker.h @@ -4,7 +4,6 @@ #include "TrackingTools/MeasurementDet/interface/MeasurementDetSystem.h" #include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" #include "FWCore/Framework/interface/Event.h" diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index 8030097d49a11..a530bbe78d21f 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -111,13 +111,13 @@ void MeasurementTrackerImpl::initialize(const TrackerTopology* trackerTopology) if (!theTrackerGeom->detsPXB().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsPXB().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsPXB(), subIsPixel, subIsOT, trackerTopology); + addDets(theTrackerGeom->detsPXB(), subIsPixel, subIsOT); } if (!theTrackerGeom->detsPXF().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsPXF().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsPXF(), subIsPixel, subIsOT, trackerTopology); + addDets(theTrackerGeom->detsPXF(), subIsPixel, subIsOT); } subIsOT = true; @@ -125,25 +125,25 @@ void MeasurementTrackerImpl::initialize(const TrackerTopology* trackerTopology) if (!theTrackerGeom->detsTIB().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTIB().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsTIB(), subIsPixel, subIsOT, trackerTopology); + addDets(theTrackerGeom->detsTIB(), subIsPixel, subIsOT); } if (!theTrackerGeom->detsTID().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTID().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsTID(), subIsPixel, subIsOT, trackerTopology); + addDets(theTrackerGeom->detsTID(), subIsPixel, subIsOT); } if (!theTrackerGeom->detsTOB().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTOB().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsTOB(), subIsPixel, subIsOT, trackerTopology); + addDets(theTrackerGeom->detsTOB(), subIsPixel, subIsOT); } if (!theTrackerGeom->detsTEC().empty()) { subIsPixel = GeomDetEnumerators::isTrackerPixel( theTrackerGeom->geomDetSubDetector(theTrackerGeom->detsTEC().front()->geographicalId().subdetId())); - addDets(theTrackerGeom->detsTEC(), subIsPixel, subIsOT, trackerTopology); + addDets(theTrackerGeom->detsTEC(), subIsPixel, subIsOT); } // fist all stripdets @@ -217,10 +217,7 @@ void MeasurementTrackerImpl::initPhase2OTMeasurementConditionSet(std::vector<TkP } } -void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, - bool subIsPixel, - bool subIsOT, - const TrackerTopology* trackerTopology) { +void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT) { //in phase2, we can have composed subDetector made by Pixel or Strip for (TrackerGeometry::DetContainer::const_iterator gd = dets.begin(); gd != dets.end(); gd++) { const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(*gd); @@ -247,7 +244,7 @@ void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets, if (gluedDet != nullptr) addGluedDet(gluedDet); else - addStackDet(stackDet, trackerTopology); + addStackDet(stackDet); } } } @@ -286,11 +283,11 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { theGluedDets.push_back(TkGluedMeasurementDet(gd, theStDetConditions.matcher(), theStDetConditions.stripCPE())); } -void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd, const TrackerTopology* trackerTopology) { +void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) { //since the Stack will be composed by PS or 2S, //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. theStackDets.push_back( - TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE(), trackerTopology)); + TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE())); } void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) { diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h index 0cd595a08a3fc..69c6a0e97d5ba 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h @@ -132,15 +132,12 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker { void addPhase2Det(const GeomDet* gd); void addGluedDet(const GluedGeomDet* gd); - void addStackDet(const StackGeomDet* gd, const TrackerTopology* trackerTopology); + void addStackDet(const StackGeomDet* gd); void initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology); void initStackDet(TkStackMeasurementDet& det); - void addDets(const TrackingGeometry::DetContainer& dets, - bool subIsPixel, - bool subIsOT, - const TrackerTopology* trackerTopology); + void addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT); bool checkDets(); diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index 01e633a5c576f..09857880467b2 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -7,14 +7,8 @@ using namespace std; TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet, const VectorHitBuilderAlgorithm* matcher, - const PixelClusterParameterEstimator* cpe, - const TrackerTopology* tkTopo) - : MeasurementDet(gdet), - theMatcher(matcher), - thePixelCPE(cpe), - theTkTopo(tkTopo), - theLowerDet(nullptr), - theUpperDet(nullptr) {} + const PixelClusterParameterEstimator* cpe) + : MeasurementDet(gdet), theMatcher(matcher), thePixelCPE(cpe), theLowerDet(nullptr), theUpperDet(nullptr) {} void TkStackMeasurementDet::init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet) { theLowerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet); @@ -29,16 +23,15 @@ void TkStackMeasurementDet::init(const MeasurementDet* lowerDet, const Measureme TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const TrajectoryStateOnSurface& ts, const MeasurementTrackerEvent& data) const { RecHitContainer result; - /* - HitCollectorForRecHits collector( &fastGeomDet(), theMatcher, theCPE, result ); - collectRecHits(ts, collector); -*/ + if (data.phase2OTVectorHits().empty()) return result; LogTrace("MeasurementTracker") << " is not empty"; if (!isActive(data)) return result; LogTrace("MeasurementTracker") << " and is active"; + + // Old solution creating the VHs on the fly. Keep for now /* const Phase2TrackerCluster1D* begin = nullptr; if (!data.phase2OTData().handle()->data().empty()) { @@ -87,13 +80,8 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj */ - //unsigned int rawDetId1(lowerDet()->index()); - //DetId detId1(rawDetId1); - //DetId detIdStack = theTkTopo->stack(detId1); - //DetId detIdStack = theTkTopo->stack(specificGeomDet().geographicalId()); DetId detIdStack = specificGeomDet().geographicalId(); - //std::cout << "ID of current stack " << detIdStack << std::endl; auto iterator = data.phase2OTVectorHits().find(detIdStack); if (iterator == data.phase2OTVectorHits().end()) return result; diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index a04f613751bf6..a5bbfde36414f 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -16,8 +16,7 @@ class TkStackMeasurementDet final : public MeasurementDet { public: TkStackMeasurementDet(const StackGeomDet* gdet, const VectorHitBuilderAlgorithm* matcher, - const PixelClusterParameterEstimator* cpe, - const TrackerTopology* tkTopo); + const PixelClusterParameterEstimator* cpe); void init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet); RecHitContainer recHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent& data) const override; @@ -52,7 +51,6 @@ class TkStackMeasurementDet final : public MeasurementDet { private: const VectorHitBuilderAlgorithm* theMatcher; const PixelClusterParameterEstimator* thePixelCPE; - const TrackerTopology* theTkTopo; const TkPhase2OTMeasurementDet* theLowerDet; const TkPhase2OTMeasurementDet* theUpperDet; }; diff --git a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc index d4b438630a58a..fe2a1d361c85c 100644 --- a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc +++ b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc @@ -10,8 +10,6 @@ MeasurementTrackerEvent::~MeasurementTrackerEvent() { thePixelData = nullptr; // to double-delete the same object (!!!) delete thePhase2OTData; thePhase2OTData = nullptr; // to double-delete the same object (!!!) - // delete thePhase2OTVectorHits; - // thePhase2OTVectorHits = nullptr; // to double-delete the same object (!!!) } } diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 32c6b78b8b678..e4846baf28ba2 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -147,14 +147,6 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) edm::Handle<VectorHitCollectionNew> vhs; event.getByToken(vhProducerToken_, vhs); - /* TrajectorySeedCollection const& tempSeeds = run(vhs); - for (auto& qIt : tempSeeds) { - seedsWithVHs->push_back(qIt); - } - - seedsWithVHs->shrink_to_fit(); - event.put(std::move(seedsWithVHs));*/ - //auto seedsWithVHs = std::make_unique<> event.emplace(putToken_, run(vhs)); } From 867caf24a96de12e5a8ac2b1bba9f94dd7d02e61 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Fri, 25 Sep 2020 19:54:09 +0200 Subject: [PATCH 423/778] code comments from Kevin + Matti and implementation of cluster masking --- .../MeasurementTrackerEventProducer.cc | 28 +++-------- .../plugins/MeasurementTrackerEventProducer.h | 4 +- .../plugins/TkStackMeasurementDet.cc | 50 +++++++++++++++++-- 3 files changed, 57 insertions(+), 25 deletions(-) diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index ed9dcfb9553d4..54bdf53581abf 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -39,7 +39,7 @@ MeasurementTrackerEventProducer::MeasurementTrackerEventProducer(const edm::Para edm::InputTag skip = iConfig.getParameter<edm::InputTag>("skipClusters"); selfUpdateSkipClusters_ = !(skip == edm::InputTag("")); LogDebug("MeasurementTracker") << "skipping clusters: " << selfUpdateSkipClusters_; - isPhase2 = false; + isPhase2_ = false; if (!iConfig.getParameter<std::string>("stripClusterProducer").empty()) { theStripClusterLabel = consumes<edmNew::DetSetVector<SiStripCluster>>( @@ -58,12 +58,12 @@ MeasurementTrackerEventProducer::MeasurementTrackerEventProducer(const edm::Para if (!iConfig.getParameter<std::string>("Phase2TrackerCluster1DProducer").empty()) { thePh2OTClusterLabel = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>( edm::InputTag(iConfig.getParameter<std::string>("Phase2TrackerCluster1DProducer"))); - isPhase2 = true; + isPhase2_ = true; } if (!(iConfig.getParameter<edm::InputTag>("vectorHits") == edm::InputTag(""))) { thePh2OTVectorHitsLabel = consumes<VectorHitCollectionNew>(iConfig.getParameter<edm::InputTag>("vectorHits")); - isPhase2 = true; - useVectorHits = true; + isPhase2_ = true; + useVectorHits_ = true; } produces<MeasurementTrackerEvent>(); @@ -119,12 +119,10 @@ void MeasurementTrackerEventProducer::produce(edm::Event& iEvent, const edm::Eve // put into MTE // put into event + // - edm::Handle<VectorHitCollectionNew> vectorHitsHandle; - if (useVectorHits) { - iEvent.getByToken(thePh2OTVectorHitsLabel, vectorHitsHandle); - const VectorHitCollectionNew* phase2OTVectorHits = vectorHitsHandle.product(); - iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, + const VectorHitCollectionNew* phase2OTVectorHits = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsLabel) : nullptr; + iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, stripData.release(), pixelData.release(), phase2OTData.release(), @@ -132,16 +130,6 @@ void MeasurementTrackerEventProducer::produce(edm::Event& iEvent, const edm::Eve stripClustersToSkip, pixelClustersToSkip, phase2ClustersToSkip)); - } else { - iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, - stripData.release(), - pixelData.release(), - phase2OTData.release(), - nullptr, - stripClustersToSkip, - pixelClustersToSkip, - phase2ClustersToSkip)); - } } void MeasurementTrackerEventProducer::updatePixels(const edm::Event& event, @@ -376,7 +364,7 @@ void MeasurementTrackerEventProducer::updatePhase2OT(const edm::Event& event, thePh2OTDets.setEmpty(); // Phase2OT Clusters - if (isPhase2) { + if (isPhase2_) { if (thePh2OTClusterLabel.isUninitialized()) { //clusters have not been produced thePh2OTDets.setActiveThisEvent(false); } else { diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h index ef16e4659a06c..e6e123b360450 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h @@ -51,8 +51,8 @@ class dso_hidden MeasurementTrackerEventProducer final : public edm::stream::EDP bool selfUpdateSkipClusters_; bool switchOffPixelsIfEmpty_; - bool isPhase2; - bool useVectorHits; + bool isPhase2_; + bool useVectorHits_; }; #endif diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index 09857880467b2..b59f47c7ab903 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -80,13 +80,56 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj */ + + //find clusters to skip + std::vector<Phase2TrackerCluster1DRef> skipClustersLower; + std::vector<Phase2TrackerCluster1DRef> skipClustersUpper; + const Phase2TrackerCluster1D* begin = nullptr; + if (!data.phase2OTData().handle()->data().empty()) { + begin = &(data.phase2OTData().handle()->data().front()); + } + if (!data.phase2OTClustersToSkip().empty()){ + const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); + const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index()); + + if (lowerDetSet.size() > 0){ + for (const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++cil) { + if (cil < begin) { + edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; + return result; + } + unsigned int indexl = cil - begin; + if (data.phase2OTClustersToSkip()[indexl]){ + Phase2TrackerCluster1DRef clusterRef = edmNew::makeRefTo(data.phase2OTData().handle(), cil); + skipClustersLower.push_back(clusterRef); + } + + } + } + if (upperDetSet.size() > 0){ + for (const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ciu) { + if (ciu < begin) { + edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; + return result; + } + unsigned int indexu = ciu - begin; + if (data.phase2OTClustersToSkip()[indexu]){ + Phase2TrackerCluster1DRef clusterRef = edmNew::makeRefTo(data.phase2OTData().handle(), ciu); + skipClustersUpper.push_back(clusterRef); + } + } + } + } DetId detIdStack = specificGeomDet().geographicalId(); auto iterator = data.phase2OTVectorHits().find(detIdStack); if (iterator == data.phase2OTVectorHits().end()) return result; - for (auto& vecHit : data.phase2OTVectorHits()[detIdStack]) + for (const auto& vecHit : data.phase2OTVectorHits()[detIdStack]){ + if (std::find(skipClustersLower.begin(), skipClustersLower.end(), vecHit.lowerCluster()) != skipClustersLower.end()) continue; + if (std::find(skipClustersUpper.begin(), skipClustersUpper.end(), vecHit.upperCluster()) != skipClustersUpper.end()) continue; result.push_back(std::make_shared<VectorHit>(vecHit)); + } return result; } @@ -108,9 +151,10 @@ bool TkStackMeasurementDet::measurements(const TrajectoryStateOnSurface& stateOn for (auto&& hit : allHits) { std::pair<bool, double> diffEst = est.estimate(stateOnThisDet, *hit); - LogDebug("MeasurementTracker") << "New vh added with chi2: " << diffEst.second; - if (diffEst.first) + if (diffEst.first){ + LogDebug("MeasurementTracker") << "New vh added with chi2: " << diffEst.second; result.add(std::move(hit), diffEst.second); + } } if (result.size() > oldSize) From 1edd84dbc46a929e3dca2050da26a3b528ecfec1 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 26 Sep 2020 01:09:56 +0200 Subject: [PATCH 424/778] add second VH collection to TkStackMeasurementDet to recover low pT tracks --- .../interface/MeasurementTrackerEvent.h | 4 + .../MeasurementTrackerEventProducer.cc | 22 +++-- .../plugins/MeasurementTrackerEventProducer.h | 1 + .../plugins/MeasurementTrackerImpl.cc | 3 +- .../plugins/TkStackMeasurementDet.cc | 85 +++++++++++-------- .../MeasurementTrackerEventProducer_cfi.py | 1 + .../src/MeasurementTrackerEvent.cc | 4 + 7 files changed, 74 insertions(+), 46 deletions(-) diff --git a/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h b/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h index ab5214206e9a2..29f669f731b05 100644 --- a/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h +++ b/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h @@ -27,6 +27,7 @@ class MeasurementTrackerEvent { const PxMeasurementDetSet *pixels, const Phase2OTMeasurementDetSet *phase2OT, const VectorHitCollectionNew *phase2OTVectorHits, + const VectorHitCollectionNew *phase2OTVectorHitsRej, const std::vector<bool> &stripClustersToSkip, const std::vector<bool> &pixelClustersToSkip, const std::vector<bool> &phase2OTClustersToSkip) @@ -35,6 +36,7 @@ class MeasurementTrackerEvent { thePixelData(pixels), thePhase2OTData(phase2OT), thePhase2OTVectorHits(phase2OTVectorHits), + thePhase2OTVectorHitsRej(phase2OTVectorHitsRej), theOwner(true), theStripClustersToSkip(stripClustersToSkip), thePixelClustersToSkip(pixelClustersToSkip), @@ -61,6 +63,7 @@ class MeasurementTrackerEvent { const PxMeasurementDetSet &pixelData() const { return *thePixelData; } const Phase2OTMeasurementDetSet &phase2OTData() const { return *thePhase2OTData; } const VectorHitCollectionNew &phase2OTVectorHits() const { return *thePhase2OTVectorHits; } + const VectorHitCollectionNew &phase2OTVectorHitsRej() const { return *thePhase2OTVectorHitsRej; } const std::vector<bool> &stripClustersToSkip() const { return theStripClustersToSkip; } const std::vector<bool> &pixelClustersToSkip() const { return thePixelClustersToSkip; } const std::vector<bool> &phase2OTClustersToSkip() const { return thePhase2OTClustersToSkip; } @@ -78,6 +81,7 @@ class MeasurementTrackerEvent { const PxMeasurementDetSet *thePixelData = nullptr; const Phase2OTMeasurementDetSet *thePhase2OTData = nullptr; const VectorHitCollectionNew *thePhase2OTVectorHits = nullptr; + const VectorHitCollectionNew *thePhase2OTVectorHitsRej = nullptr; bool theOwner = false; // do I own the tree above? // these could be const pointers as well, but ContainerMask doesn't expose the vector std::vector<bool> theStripClustersToSkip; diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index 54bdf53581abf..91b938d0a7fad 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -60,8 +60,10 @@ MeasurementTrackerEventProducer::MeasurementTrackerEventProducer(const edm::Para edm::InputTag(iConfig.getParameter<std::string>("Phase2TrackerCluster1DProducer"))); isPhase2_ = true; } - if (!(iConfig.getParameter<edm::InputTag>("vectorHits") == edm::InputTag(""))) { + if (!(iConfig.getParameter<edm::InputTag>("vectorHits") == edm::InputTag("") || + iConfig.getParameter<edm::InputTag>("vectorHitsRej") == edm::InputTag(""))) { thePh2OTVectorHitsLabel = consumes<VectorHitCollectionNew>(iConfig.getParameter<edm::InputTag>("vectorHits")); + thePh2OTVectorHitsRejLabel = consumes<VectorHitCollectionNew>(iConfig.getParameter<edm::InputTag>("vectorHitsRej")); isPhase2_ = true; useVectorHits_ = true; } @@ -78,6 +80,7 @@ void MeasurementTrackerEventProducer::fillDescriptions(edm::ConfigurationDescrip desc.add<std::string>("stripClusterProducer", "siStripClusters"); desc.add<std::string>("Phase2TrackerCluster1DProducer", ""); desc.add<edm::InputTag>("vectorHits", edm::InputTag("")); + desc.add<edm::InputTag>("vectorHitsRej", edm::InputTag("")); desc.add<std::vector<edm::InputTag>>("inactivePixelDetectorLabels", std::vector<edm::InputTag>{{edm::InputTag("siPixelDigis")}}) @@ -122,14 +125,17 @@ void MeasurementTrackerEventProducer::produce(edm::Event& iEvent, const edm::Eve // const VectorHitCollectionNew* phase2OTVectorHits = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsLabel) : nullptr; + const VectorHitCollectionNew* phase2OTVectorHitsRej = + useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsRejLabel) : nullptr; iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, - stripData.release(), - pixelData.release(), - phase2OTData.release(), - phase2OTVectorHits, - stripClustersToSkip, - pixelClustersToSkip, - phase2ClustersToSkip)); + stripData.release(), + pixelData.release(), + phase2OTData.release(), + phase2OTVectorHits, + phase2OTVectorHitsRej, + stripClustersToSkip, + pixelClustersToSkip, + phase2ClustersToSkip)); } void MeasurementTrackerEventProducer::updatePixels(const edm::Event& event, diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h index e6e123b360450..13e7b125926bb 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h @@ -41,6 +41,7 @@ class dso_hidden MeasurementTrackerEventProducer final : public edm::stream::EDP edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster>> theStripClusterLabel; edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D>> thePh2OTClusterLabel; edm::EDGetTokenT<VectorHitCollectionNew> thePh2OTVectorHitsLabel; + edm::EDGetTokenT<VectorHitCollectionNew> thePh2OTVectorHitsRejLabel; edm::EDGetTokenT<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster>>> thePixelClusterMask; edm::EDGetTokenT<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster>>> theStripClusterMask; diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index a530bbe78d21f..337082baf5e7d 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -286,8 +286,7 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) { //since the Stack will be composed by PS or 2S, //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. - theStackDets.push_back( - TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE())); + theStackDets.push_back(TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE())); } void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) { diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index b59f47c7ab903..cdd1d400f9a7c 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -80,7 +80,6 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj */ - //find clusters to skip std::vector<Phase2TrackerCluster1DRef> skipClustersLower; std::vector<Phase2TrackerCluster1DRef> skipClustersUpper; @@ -88,48 +87,62 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj if (!data.phase2OTData().handle()->data().empty()) { begin = &(data.phase2OTData().handle()->data().front()); } - if (!data.phase2OTClustersToSkip().empty()){ - const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); - const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index()); - - if (lowerDetSet.size() > 0){ - for (const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++cil) { - if (cil < begin) { - edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; - return result; - } - unsigned int indexl = cil - begin; - if (data.phase2OTClustersToSkip()[indexl]){ - Phase2TrackerCluster1DRef clusterRef = edmNew::makeRefTo(data.phase2OTData().handle(), cil); - skipClustersLower.push_back(clusterRef); - } - - } - } - if (upperDetSet.size() > 0){ - for (const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ciu) { - if (ciu < begin) { - edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; - return result; - } - unsigned int indexu = ciu - begin; - if (data.phase2OTClustersToSkip()[indexu]){ - Phase2TrackerCluster1DRef clusterRef = edmNew::makeRefTo(data.phase2OTData().handle(), ciu); - skipClustersUpper.push_back(clusterRef); - } - } - } + if (!data.phase2OTClustersToSkip().empty()) { + const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); + const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index()); + + if (!lowerDetSet.empty()) { + for (const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++cil) { + if (cil < begin) { + edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; + return result; + } + unsigned int indexl = cil - begin; + if (data.phase2OTClustersToSkip()[indexl]) { + Phase2TrackerCluster1DRef clusterRef = edmNew::makeRefTo(data.phase2OTData().handle(), cil); + skipClustersLower.push_back(clusterRef); + } + } + } + if (!upperDetSet.empty()) { + for (const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ciu) { + if (ciu < begin) { + edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; + return result; + } + unsigned int indexu = ciu - begin; + if (data.phase2OTClustersToSkip()[indexu]) { + Phase2TrackerCluster1DRef clusterRef = edmNew::makeRefTo(data.phase2OTData().handle(), ciu); + skipClustersUpper.push_back(clusterRef); + } + } + } } + DetId detIdStack = specificGeomDet().geographicalId(); auto iterator = data.phase2OTVectorHits().find(detIdStack); if (iterator == data.phase2OTVectorHits().end()) return result; - for (const auto& vecHit : data.phase2OTVectorHits()[detIdStack]){ - if (std::find(skipClustersLower.begin(), skipClustersLower.end(), vecHit.lowerCluster()) != skipClustersLower.end()) continue; - if (std::find(skipClustersUpper.begin(), skipClustersUpper.end(), vecHit.upperCluster()) != skipClustersUpper.end()) continue; + for (const auto& vecHit : data.phase2OTVectorHits()[detIdStack]) { + if (std::find(skipClustersLower.begin(), skipClustersLower.end(), vecHit.lowerCluster()) != skipClustersLower.end()) + continue; + if (std::find(skipClustersUpper.begin(), skipClustersUpper.end(), vecHit.upperCluster()) != skipClustersUpper.end()) + continue; result.push_back(std::make_shared<VectorHit>(vecHit)); } + + iterator = data.phase2OTVectorHitsRej().find(detIdStack); + if (iterator == data.phase2OTVectorHitsRej().end()) + return result; + for (const auto& vecHit : data.phase2OTVectorHitsRej()[detIdStack]) { + if (std::find(skipClustersLower.begin(), skipClustersLower.end(), vecHit.lowerCluster()) != skipClustersLower.end()) + continue; + if (std::find(skipClustersUpper.begin(), skipClustersUpper.end(), vecHit.upperCluster()) != skipClustersUpper.end()) + continue; + result.push_back(std::make_shared<VectorHit>(vecHit)); + } + return result; } @@ -151,7 +164,7 @@ bool TkStackMeasurementDet::measurements(const TrajectoryStateOnSurface& stateOn for (auto&& hit : allHits) { std::pair<bool, double> diffEst = est.estimate(stateOnThisDet, *hit); - if (diffEst.first){ + if (diffEst.first) { LogDebug("MeasurementTracker") << "New vh added with chi2: " << diffEst.second; result.add(std::move(hit), diffEst.second); } diff --git a/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py b/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py index d4431bbfa3662..1cc806bac523f 100644 --- a/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py +++ b/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py @@ -26,6 +26,7 @@ from Configuration.ProcessModifiers.vectorHits_cff import vectorHits vectorHits.toModify(MeasurementTrackerEvent, vectorHits = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), + vectorHitsRej = cms.InputTag("siPhase2VectorHits", "vectorHitsRejected"), ) MeasurementTrackerEventPreSplitting = MeasurementTrackerEvent.clone( diff --git a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc index fe2a1d361c85c..e764ff3607fc7 100644 --- a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc +++ b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc @@ -19,6 +19,7 @@ MeasurementTrackerEvent::MeasurementTrackerEvent(MeasurementTrackerEvent &&other thePixelData = other.thePixelData; thePhase2OTData = other.thePhase2OTData; thePhase2OTVectorHits = other.thePhase2OTVectorHits; + thePhase2OTVectorHitsRej = other.thePhase2OTVectorHitsRej; theOwner = other.theOwner; other.theOwner = false; // make sure to fully transfer the ownership theStripClustersToSkip = std::move(other.theStripClustersToSkip); @@ -30,6 +31,7 @@ MeasurementTrackerEvent &MeasurementTrackerEvent::operator=(MeasurementTrackerEv thePixelData = other.thePixelData; thePhase2OTData = other.thePhase2OTData; thePhase2OTVectorHits = other.thePhase2OTVectorHits; + thePhase2OTVectorHitsRej = other.thePhase2OTVectorHitsRej; theOwner = other.theOwner; other.theOwner = false; // make sure to fully transfer the ownership theStripClustersToSkip = std::move(other.theStripClustersToSkip); @@ -46,6 +48,7 @@ MeasurementTrackerEvent::MeasurementTrackerEvent( thePixelData(trackerEvent.thePixelData), thePhase2OTData(nullptr), thePhase2OTVectorHits(nullptr), + thePhase2OTVectorHitsRej(nullptr), theOwner(false) { //std::cout << "Creatign non-owned MT @ " << this << " from @ " << & trackerEvent << " (strip data @ " << trackerEvent.theStripData << ")" << std::endl; if (stripClustersToSkip.refProd().id() != theStripData->handle().id()) { @@ -81,6 +84,7 @@ MeasurementTrackerEvent::MeasurementTrackerEvent( thePixelData(trackerEvent.thePixelData), thePhase2OTData(trackerEvent.thePhase2OTData), thePhase2OTVectorHits(trackerEvent.thePhase2OTVectorHits), + thePhase2OTVectorHitsRej(trackerEvent.thePhase2OTVectorHitsRej), theOwner(false) { if (pixelClustersToSkip.refProd().id() != thePixelData->handle().id()) { edm::LogError("ProductIdMismatch") << "The pixel masking does not point to the proper collection of clusters: " From d8b3b31a4f099fcb33f9bcb5ef1eedff70a85946 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 26 Sep 2020 14:33:35 +0200 Subject: [PATCH 425/778] initialize useVectorHits_ in MeasurementTrackerEventProducer --- .../MeasurementDet/plugins/MeasurementTrackerEventProducer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index 91b938d0a7fad..8d9f0343ee003 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -40,6 +40,7 @@ MeasurementTrackerEventProducer::MeasurementTrackerEventProducer(const edm::Para selfUpdateSkipClusters_ = !(skip == edm::InputTag("")); LogDebug("MeasurementTracker") << "skipping clusters: " << selfUpdateSkipClusters_; isPhase2_ = false; + useVectorHits_ = false; if (!iConfig.getParameter<std::string>("stripClusterProducer").empty()) { theStripClusterLabel = consumes<edmNew::DetSetVector<SiStripCluster>>( From 35d4bf778048f9060ad6ab9b6a8f3c5f4ff437d0 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 30 Sep 2020 00:32:51 +0200 Subject: [PATCH 426/778] cleanup --- .../TrackerRecHit2D/interface/VectorHit2D.h | 1 - DataFormats/TrackerRecHit2D/src/VectorHit.cc | 21 +++++-------------- .../plugins/VectorHitBuilderEDProducer.cc | 1 - .../src/VectorHitBuilderAlgorithm.cc | 9 +------- .../test/VectorHitsValidation.cc | 3 --- .../test/VectorHitsValidation.h | 1 - RecoTracker/CkfPattern/src/PrintoutHelper.cc | 15 ------------- .../plugins/SeedingOTEDProducer.cc | 1 - 8 files changed, 6 insertions(+), 46 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index 4e378b0ac58aa..62943d3fd1b51 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -23,7 +23,6 @@ class VectorHit2D { const LocalPoint* localPosition() const { return &thePosition; } const LocalVector* localDirection() const { return &theDirection; } const LocalError* localDirectionError() const { - //return &LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); return &theLocalError; } const AlgebraicSymMatrix22* covMatrix() const { return &theCovMatrix; } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 9dc9a214479b0..5ca72f5655cdb 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -1,5 +1,6 @@ #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "Geometry/CommonDetUnit/interface/StackGeomDet.h" +#include "CLHEP/Units/PhysicalConstants.h" VectorHit::VectorHit(const VectorHit& vh) : BaseTrackerRecHit(*vh.det(), trackerHitRTTI::vector), @@ -189,8 +190,8 @@ Global3DVector VectorHit::globalDirection() const { return (det()->surface().toG float VectorHit::theta() const { return globalDirection().theta(); } float VectorHit::transverseMomentum(float magField) const { - return magField * 2.99792458e-3F / theCurvature; -} // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, thus using 2.99792458e-3F (precise value from speed of light) + return magField * (CLHEP::c_light * 1e-11) / theCurvature; +} // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, using precise value from speed of light float VectorHit::momentum(float magField) const { return transverseMomentum(magField) / (1. * sin(theta())); } AlgebraicMatrix VectorHit::projectionMatrix() const { @@ -208,14 +209,7 @@ LocalError VectorHit::localDirectionError() const { } AlgebraicSymMatrix VectorHit::parametersError() const { - //think about a more efficient method - AlgebraicSymMatrix result(nComponents); - for (int i = 0; i < nComponents; i++) { - for (int j = 0; j < nComponents; j++) { - result[i][j] = theCovMatrix[i][j]; - } - } - return result; + return theCovMatrix; } std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { @@ -223,12 +217,7 @@ std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { << " Vectorhit local position : " << vh.localPosition() << "\n" << " Vectorhit local direction : " << vh.localDirection() << "\n" << " Vectorhit global direction : " << vh.globalDirection() << "\n" - << - //" Vectorhit theta : " << vh.theta() << "\n" << - //" Cov: " << vh.parametersError() << "\n" << - //" Dim: " << vh.dimension() << "\n" << - //" chi2: " << vh.chi2() << "\n" << - " Lower cluster global position : " << vh.lowerGlobalPos() << "\n" + << " Lower cluster global position : " << vh.lowerGlobalPos() << "\n" << " Upper cluster global position : " << vh.upperGlobalPos(); return os; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index 4df79a4761e60..97f89f85e14e8 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -34,7 +34,6 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusterProducer_; }; -//VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() { delete stubsBuilder_; } VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() {} VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 8c37b6ae1e90d..a8432ba24399e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -381,7 +381,6 @@ void VectorHitBuilderAlgorithm::fit(float x[2], float covii = 0.; float covsi = 0.; - //theFitter->linearFit(x, y, 2, sigy, slope, intercept, covss, covii, covsi); linearFit(x, y, 2, sigy2, slope, intercept, covss, covii, covsi); covMatrix[0][0] = covss; // this is var(dy/dz) @@ -544,11 +543,5 @@ std::pair<std::pair<float, float>, float> VectorHitBuilderAlgorithm::curvatureAN } else { return std::make_pair(std::make_pair(0., 0.), 0.0); } - /* switch (curvORphi) { - case curvatureMode: - return std::make_pair(curvature, errorCurvature); - case phiMode: - return std::make_pair(phi, 0.0); - }*/ - return std::make_pair(std::make_pair(curvature, errorCurvature), phi); + return std::make_pair(std::make_pair(curvature, errorCurvature), phi); } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 3515d731c60ef..47d53e0f82dda 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -587,7 +587,6 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev } // loop simhits nVHsTot++; - //tree_->Fill(); //****************************** //combinatorial studies : not filling if more than 1 VH has been produced @@ -1071,7 +1070,6 @@ std::vector<std::pair<uint32_t, EncodedEventId> > VectorHitsBuilderValidation::g if (isearch != simLinks->end()) { // Loop over DigiSimLink in this det unit edm::DetSet<PixelDigiSimLink> link_detset = (*isearch); - //for (typename edm::DetSet<PixelDigiSimLink>::const_iterator it = link_detset.data.begin(); it != link_detset.data.end(); ++it) { for (const auto& it : link_detset.data) { if (channel == it.channel()) simTrkId.push_back(std::make_pair(it.SimTrackId(), it.eventId())); @@ -1087,7 +1085,6 @@ unsigned int VectorHitsBuilderValidation::getSimTrackId( edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter(pixelSimLinks->find(detId)); if (DSViter == pixelSimLinks->end()) return 0; - //for (edm::DetSet<PixelDigiSimLink>::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) { for (const auto& it : DSViter->data) { if (channel == it.channel()) return it.SimTrackId(); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index 0bfcb55fb4602..3ce33868d1bdd 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -120,7 +120,6 @@ class VectorHitsBuilderValidation : public edm::one::EDAnalyzer<edm::one::Shared edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; edm::EDGetTokenT<edm::SimVertexContainer> simVerticesToken_; edm::EDGetTokenT<TrackingParticleCollection> trackingParticleToken_; - //SiPixelVectorHitBuilderAlgorithmBase *algo; const TrackerGeometry* tkGeom_; const TrackerTopology* tkTopo_; diff --git a/RecoTracker/CkfPattern/src/PrintoutHelper.cc b/RecoTracker/CkfPattern/src/PrintoutHelper.cc index 82885a3dc03bc..65f26d972ab42 100644 --- a/RecoTracker/CkfPattern/src/PrintoutHelper.cc +++ b/RecoTracker/CkfPattern/src/PrintoutHelper.cc @@ -57,7 +57,6 @@ std::string PrintoutHelper::dumpMeasurement(const TrajectoryMeasurement& tm) { else buffer << "no valid state\n"; buffer - // <<"geomdet pointer from rechit: "<<tm.recHit()->det()<<"\n" << "detId: " << tm.recHit()->geographicalId().rawId(); if (tm.recHit()->isValid()) { buffer << "\n hit global x: " << tm.recHit()->globalPosition() @@ -75,19 +74,6 @@ std::string PrintoutHelper::dumpMeasurement(const TrajectoryMeasurement& tm) { std::string PrintoutHelper::regressionTest(const TrackerGeometry& tracker, std::vector<Trajectory>& unsmoothedResult) { std::stringstream buffer; - /* - for(iseed=theSeedColl.begin();iseed!=theSeedColl.end();iseed++){ - DetId tmpId = DetId( iseed->startingState().detId()); - const GeomDet* tmpDet = tracker->idToDet( tmpId ); - GlobalVector gv = tmpDet->surface().toGlobal( iseed->startingState().parameters().momentum() ); - - LogTrace("TrackingRegressionTest") << "seed perp,phi,eta : " - << gv.perp() << " , " - << gv.phi() << " , " - << gv.eta() ; - } - */ - buffer << "number of finalTrajectories: " << unsmoothedResult.size() << std::endl; for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) { if (it->lastMeasurement().updatedState().isValid()) { @@ -103,7 +89,6 @@ std::string PrintoutHelper::regressionTest(const TrackerGeometry& tracker, std:: } buffer << "================================================="; buffer << "=========== Traj in details =====================\n"; - //for (std::vector<Trajectory>::const_iterator it = unsmoothedResult.begin(); it != unsmoothedResult.end(); it++) { for (const auto& it : unsmoothedResult) { for (const auto& hit : it.measurements()) { buffer << "measurement : " << hit.recHit()->geographicalId().rawId() << std::endl; diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index e4846baf28ba2..f63181ca281af 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -93,7 +93,6 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { }; SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) - //: updator_(nullptr), : tkMeasEventToken_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), topoToken_(esConsumes()), propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial"))), From b4fe5a6f21bcfb18b6396a658c61ae4a6e4321d6 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 30 Sep 2020 01:12:01 +0200 Subject: [PATCH 427/778] remove phase2 matcher from MeasurementTrackerEvent as it is no longer needed --- .../plugins/MeasurementTrackerESProducer.cc | 7 --- .../plugins/MeasurementTrackerEventProducer.h | 1 + .../plugins/MeasurementTrackerImpl.cc | 7 +-- .../plugins/MeasurementTrackerImpl.h | 2 - .../plugins/TkStackMeasurementDet.cc | 56 +------------------ .../plugins/TkStackMeasurementDet.h | 6 +- .../MeasurementTrackerESProducer_cfi.py | 5 +- .../MeasurementDet/src/TkMeasurementDetSet.h | 8 +-- 8 files changed, 9 insertions(+), 83 deletions(-) diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc index 36cca63a0fdce..8b689550b5fb8 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc @@ -56,7 +56,6 @@ class dso_hidden MeasurementTrackerESProducer : public edm::ESProducer { edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomToken_; edm::ESGetToken<GeometricSearchTracker, TrackerRecoGeometryRecord> geometricSearchTrackerToken_; edm::ESGetToken<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord> phase2TrackerCPEToken_; - edm::ESGetToken<VectorHitBuilderAlgorithm, TkPhase2OTCPERecord> phase2matcherToken_; MeasurementTrackerImpl::BadStripCutsDet badStripCuts_; @@ -158,11 +157,9 @@ MeasurementTrackerESProducer::MeasurementTrackerESProducer(const edm::ParameterS //FIXME:: just temporary solution for phase2! auto phase2 = p.getParameter<std::string>("Phase2StripCPE"); - auto phase2Matcher = p.getParameter<std::string>("Phase2HitMatcher"); if (not phase2.empty()) { usePhase2_ = true; phase2TrackerCPEToken_ = c.consumes(edm::ESInputTag("", phase2)); - phase2matcherToken_ = c.consumes(edm::ESInputTag("", phase2Matcher)); } } @@ -185,16 +182,13 @@ std::unique_ptr<MeasurementTracker> MeasurementTrackerESProducer::produce(const } const ClusterParameterEstimator<Phase2TrackerCluster1D> *ptr_phase2TrackerCPE = nullptr; - const VectorHitBuilderAlgorithm *ptr_phase2Matcher = nullptr; if (usePhase2_) { ptr_phase2TrackerCPE = &iRecord.get(phase2TrackerCPEToken_); - ptr_phase2Matcher = &iRecord.get(phase2matcherToken_); } return std::make_unique<MeasurementTrackerImpl>(badStripCuts_, &iRecord.get(pixelCPEToken_), &iRecord.get(stripCPEToken_), &iRecord.get(hitMatcherToken_), - ptr_phase2Matcher, &iRecord.get(trackerTopologyToken_), &iRecord.get(trackerGeomToken_), &iRecord.get(geometricSearchTrackerToken_), @@ -218,7 +212,6 @@ void MeasurementTrackerESProducer::fillDescriptions(edm::ConfigurationDescriptio desc.add<std::string>("HitMatcher", "StandardMatcher"); desc.add<std::string>("Phase2StripCPE", "")->setComment("empty string used to turn off Phase 2"); - desc.add<std::string>("Phase2HitMatcher", ""); desc.add<std::string>("SiStripQualityLabel", ""); desc.add<bool>("UseStripModuleQualityDB", true); diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h index 13e7b125926bb..02fd476d71092 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h @@ -12,6 +12,7 @@ #include "DataFormats/DetId/interface/DetIdCollection.h" #include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h" #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h" +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" class dso_hidden MeasurementTrackerEventProducer final : public edm::stream::EDProducer<> { public: diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index 337082baf5e7d..918f4473d65a1 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -78,7 +78,6 @@ MeasurementTrackerImpl::MeasurementTrackerImpl(const BadStripCutsDet& badStripCu const PixelClusterParameterEstimator* pixelCPE, const StripClusterParameterEstimator* stripCPE, const SiStripRecHitMatcher* hitMatcher, - const VectorHitBuilderAlgorithm* ph2hitMatcher, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeom, const GeometricSearchTracker* geometricSearchTracker, @@ -93,7 +92,7 @@ MeasurementTrackerImpl::MeasurementTrackerImpl(const BadStripCutsDet& badStripCu : MeasurementTracker(trackerGeom, geometricSearchTracker), theStDetConditions(hitMatcher, stripCPE), thePxDetConditions(pixelCPE), - thePhase2DetConditions(ph2hitMatcher, phase2OTCPE) { + thePhase2DetConditions(phase2OTCPE) { this->initialize(trackerTopology); this->initializeStripStatus(badStripCuts, stripQuality, stripQualityFlags, stripQualityDebugFlags); this->initializePixelStatus(pixelQuality, pixelCabling, pixelQualityFlags, pixelQualityDebugFlags); @@ -284,9 +283,7 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { } void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) { - //since the Stack will be composed by PS or 2S, - //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. - theStackDets.push_back(TkStackMeasurementDet(gd, thePhase2DetConditions.matcher(), thePxDetConditions.pixelCPE())); + theStackDets.push_back(TkStackMeasurementDet(gd)); } void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) { diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h index 69c6a0e97d5ba..7794f31e5fe94 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h @@ -9,7 +9,6 @@ #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -57,7 +56,6 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker { const PixelClusterParameterEstimator* pixelCPE, const StripClusterParameterEstimator* stripCPE, const SiStripRecHitMatcher* hitMatcher, - const VectorHitBuilderAlgorithm* ph2hitMatcher, const TrackerTopology* trackerTopology, const TrackerGeometry* trackerGeom, const GeometricSearchTracker* geometricSearchTracker, diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index cdd1d400f9a7c..276197c5c00ca 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -5,10 +5,8 @@ using namespace std; -TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet, - const VectorHitBuilderAlgorithm* matcher, - const PixelClusterParameterEstimator* cpe) - : MeasurementDet(gdet), theMatcher(matcher), thePixelCPE(cpe), theLowerDet(nullptr), theUpperDet(nullptr) {} +TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet) + : MeasurementDet(gdet), theLowerDet(nullptr), theUpperDet(nullptr) {} void TkStackMeasurementDet::init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet) { theLowerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet); @@ -31,54 +29,6 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj return result; LogTrace("MeasurementTracker") << " and is active"; - // Old solution creating the VHs on the fly. Keep for now - /* - const Phase2TrackerCluster1D* begin = nullptr; - if (!data.phase2OTData().handle()->data().empty()) { - begin = &(data.phase2OTData().handle()->data().front()); - } - - LogTrace("MeasurementTracker") << "TkStackMeasurementDet::recHits algo has been set" << std::endl; - - const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); - const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index()); - - LogTrace("MeasurementTracker") << " DetSets set with sizes:" << lowerDetSet.size() << " and " << upperDetSet.size() - << "!"; - result.reserve(lowerDetSet.size() > upperDetSet.size() ? lowerDetSet.size() : upperDetSet.size()); - - for (const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++cil) { - if (cil < begin) { - edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; - return result; - } - unsigned int indexl = cil - begin; - LogTrace("MeasurementTracker") << " index cluster lower" << indexl << " on detId " - << fastGeomDet().geographicalId().rawId(); - - for (const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ciu) { - unsigned int indexu = ciu - begin; - if (ciu < begin) { - edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch."; - return result; - } - LogTrace("VectorHitBuilderAlgorithm") << " index cluster upper " << indexu; - - if (data.phase2OTClustersToSkip().empty() or - ((not data.phase2OTClustersToSkip()[indexl]) and (not data.phase2OTClustersToSkip()[indexu]))) { - Phase2TrackerCluster1DRef clusterLower = edmNew::makeRefTo(data.phase2OTData().handle(), cil); - Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo(data.phase2OTData().handle(), ciu); - //ERICA:I would have prefer to keep buildVectorHits ... - VectorHit vh = theMatcher->buildVectorHit(&specificGeomDet(), clusterLower, clusterUpper); - LogTrace("MeasurementTracker") << "TkStackMeasurementDet::rechits adding VectorHits!" << std::endl; - LogTrace("MeasurementTracker") << vh << std::endl; - result.push_back(std::make_shared<VectorHit>(vh)); - } - } - } - - -*/ //find clusters to skip std::vector<Phase2TrackerCluster1DRef> skipClustersLower; @@ -103,7 +53,7 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj skipClustersLower.push_back(clusterRef); } } - } + } if (!upperDetSet.empty()) { for (const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ciu) { if (ciu < begin) { diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index a5bbfde36414f..100d6572b66d4 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -14,9 +14,7 @@ class TkStackMeasurementDet final : public MeasurementDet { public: - TkStackMeasurementDet(const StackGeomDet* gdet, - const VectorHitBuilderAlgorithm* matcher, - const PixelClusterParameterEstimator* cpe); + TkStackMeasurementDet(const StackGeomDet* gdet); void init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet); RecHitContainer recHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent& data) const override; @@ -49,8 +47,6 @@ class TkStackMeasurementDet final : public MeasurementDet { } private: - const VectorHitBuilderAlgorithm* theMatcher; - const PixelClusterParameterEstimator* thePixelCPE; const TkPhase2OTMeasurementDet* theLowerDet; const TkPhase2OTMeasurementDet* theUpperDet; }; diff --git a/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py b/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py index a09c7c51b6597..d5b0dcefdc434 100644 --- a/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py +++ b/RecoTracker/MeasurementDet/python/MeasurementTrackerESProducer_cfi.py @@ -5,7 +5,4 @@ MeasurementTracker = _MeasurementTrackerESProducer_default.clone() from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 -trackingPhase2PU140.toModify(MeasurementTracker, - Phase2StripCPE = 'Phase2StripCPE', - Phase2HitMatcher = 'SiPhase2VectorHitMatcher' -) +trackingPhase2PU140.toModify(MeasurementTracker, Phase2StripCPE = 'Phase2StripCPE') diff --git a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h index cfbfefbe3e471..6c5f3f89c317a 100644 --- a/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h +++ b/RecoTracker/MeasurementDet/src/TkMeasurementDetSet.h @@ -20,8 +20,6 @@ class Phase2StripCPE; #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h" #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" - #include <unordered_map> // #define VISTAT @@ -406,9 +404,7 @@ class PxMeasurementDetSet { //FIXME:just temporary solution for phase2 OT that works! class Phase2OTMeasurementConditionSet { public: - Phase2OTMeasurementConditionSet(const VectorHitBuilderAlgorithm* ph2matcher, - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe) - : thePhase2Matcher(ph2matcher), theCPE(cpe) {} + Phase2OTMeasurementConditionSet(const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe) : theCPE(cpe) {} void init(int size); @@ -417,7 +413,6 @@ class Phase2OTMeasurementConditionSet { int find(unsigned int jd, int i = 0) const { return std::lower_bound(id_.begin() + i, id_.end(), jd) - id_.begin(); } const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe() const { return theCPE; } - const VectorHitBuilderAlgorithm* matcher() const { return thePhase2Matcher; } bool isActiveThisPeriod(int i) const { return activeThisPeriod_[i]; } /** \brief Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). @@ -428,7 +423,6 @@ class Phase2OTMeasurementConditionSet { friend class MeasurementTrackerImpl; // Globals (not-per-event) - const VectorHitBuilderAlgorithm* thePhase2Matcher; const ClusterParameterEstimator<Phase2TrackerCluster1D>* theCPE; // Locals, per-event From 38225d683e15c41a77fa78bf401a6af38f49b1f6 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 30 Sep 2020 01:31:24 +0200 Subject: [PATCH 428/778] code format --- DataFormats/TrackerRecHit2D/interface/VectorHit2D.h | 4 +--- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 4 +--- .../src/VectorHitBuilderAlgorithm.cc | 2 +- RecoTracker/CkfPattern/src/PrintoutHelper.cc | 3 +-- .../MeasurementDet/plugins/MeasurementTrackerImpl.cc | 5 +++-- .../MeasurementDet/plugins/TkStackMeasurementDet.cc | 7 +++---- RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h | 3 ++- 7 files changed, 12 insertions(+), 16 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index 62943d3fd1b51..ec0ad38f22f6a 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -22,9 +22,7 @@ class VectorHit2D { const LocalPoint* localPosition() const { return &thePosition; } const LocalVector* localDirection() const { return &theDirection; } - const LocalError* localDirectionError() const { - return &theLocalError; - } + const LocalError* localDirectionError() const { return &theLocalError; } const AlgebraicSymMatrix22* covMatrix() const { return &theCovMatrix; } float chi2() const { return theChi2; } int dimension() const { return theDimension; } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 5ca72f5655cdb..75e0b6ee5c23c 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -208,9 +208,7 @@ LocalError VectorHit::localDirectionError() const { return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); } -AlgebraicSymMatrix VectorHit::parametersError() const { - return theCovMatrix; -} +AlgebraicSymMatrix VectorHit::parametersError() const { return theCovMatrix; } std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { os << " VectorHit create in the DetId#: " << vh.geographicalId() << "\n" diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index a8432ba24399e..b0b2842d7ba28 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -543,5 +543,5 @@ std::pair<std::pair<float, float>, float> VectorHitBuilderAlgorithm::curvatureAN } else { return std::make_pair(std::make_pair(0., 0.), 0.0); } - return std::make_pair(std::make_pair(curvature, errorCurvature), phi); + return std::make_pair(std::make_pair(curvature, errorCurvature), phi); } diff --git a/RecoTracker/CkfPattern/src/PrintoutHelper.cc b/RecoTracker/CkfPattern/src/PrintoutHelper.cc index 65f26d972ab42..bae0056c13a86 100644 --- a/RecoTracker/CkfPattern/src/PrintoutHelper.cc +++ b/RecoTracker/CkfPattern/src/PrintoutHelper.cc @@ -56,8 +56,7 @@ std::string PrintoutHelper::dumpMeasurement(const TrajectoryMeasurement& tm) { << "p: " << tm.predictedState().globalMomentum() << "\n"; else buffer << "no valid state\n"; - buffer - << "detId: " << tm.recHit()->geographicalId().rawId(); + buffer << "detId: " << tm.recHit()->geographicalId().rawId(); if (tm.recHit()->isValid()) { buffer << "\n hit global x: " << tm.recHit()->globalPosition() << "\n hit global error: " << tm.recHit()->globalPositionError().matrix() diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index 918f4473d65a1..dd263250a736e 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -25,7 +25,6 @@ #include "RecoLocalTracker/Records/interface/TrackerCPERecord.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPE.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" @@ -283,7 +282,9 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { } void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) { - theStackDets.push_back(TkStackMeasurementDet(gd)); + //since the Stack will be composed by PS or 2S, + // //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. + theStackDets.push_back(TkStackMeasurementDet(gd, thePxDetConditions.pixelCPE())); } void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) { diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index 276197c5c00ca..597dc27d64f74 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -5,8 +5,8 @@ using namespace std; -TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet) - : MeasurementDet(gdet), theLowerDet(nullptr), theUpperDet(nullptr) {} +TkStackMeasurementDet::TkStackMeasurementDet(const StackGeomDet* gdet, const PixelClusterParameterEstimator* cpe) + : MeasurementDet(gdet), thePixelCPE(cpe), theLowerDet(nullptr), theUpperDet(nullptr) {} void TkStackMeasurementDet::init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet) { theLowerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet); @@ -29,7 +29,6 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj return result; LogTrace("MeasurementTracker") << " and is active"; - //find clusters to skip std::vector<Phase2TrackerCluster1DRef> skipClustersLower; std::vector<Phase2TrackerCluster1DRef> skipClustersUpper; @@ -53,7 +52,7 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj skipClustersLower.push_back(clusterRef); } } - } + } if (!upperDetSet.empty()) { for (const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ciu) { if (ciu < begin) { diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h index 100d6572b66d4..7dc973344b529 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.h @@ -14,7 +14,7 @@ class TkStackMeasurementDet final : public MeasurementDet { public: - TkStackMeasurementDet(const StackGeomDet* gdet); + TkStackMeasurementDet(const StackGeomDet* gdet, const PixelClusterParameterEstimator* cpe); void init(const MeasurementDet* lowerDet, const MeasurementDet* upperDet); RecHitContainer recHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent& data) const override; @@ -47,6 +47,7 @@ class TkStackMeasurementDet final : public MeasurementDet { } private: + const PixelClusterParameterEstimator* thePixelCPE; const TkPhase2OTMeasurementDet* theLowerDet; const TkPhase2OTMeasurementDet* theUpperDet; }; From 47747108aaf3e6d7a7e6c71dbe124b179608bf31 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Wed, 30 Sep 2020 01:35:37 +0200 Subject: [PATCH 429/778] slightly reduce diff --- RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc index dd263250a736e..bd7c54e22fa4f 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc @@ -283,7 +283,7 @@ void MeasurementTrackerImpl::addGluedDet(const GluedGeomDet* gd) { void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) { //since the Stack will be composed by PS or 2S, - // //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. + //both cluster parameter estimators are needed? - right now just the thePixelCPE is used. theStackDets.push_back(TkStackMeasurementDet(gd, thePxDetConditions.pixelCPE())); } From b6b9e9e1341e9694e8d6a5fdab07430eead966b2 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Thu, 1 Oct 2020 01:26:50 +0200 Subject: [PATCH 430/778] get rid of AlgebraicSymMatrix as member of VectorHit clas --- .../TrackerRecHit2D/interface/VectorHit.h | 7 ++--- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 26 +++++++++++++++---- .../TrackerRecHit2D/src/classes_def.xml | 4 +-- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 35140ba1118ff..f630031c21c7b 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -36,7 +36,7 @@ class VectorHit final : public BaseTrackerRecHit { VectorHit(const GeomDet& idet, const LocalPoint& posInner, const LocalVector& dir, - const AlgebraicSymMatrix& covMatrix, + const std::array<std::array<float, 4>, 4> covMatrix, const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper, @@ -76,6 +76,7 @@ class VectorHit final : public BaseTrackerRecHit { // returning methods LocalPoint localPosition() const override { return thePosition; } virtual LocalVector localDirection() const { return theDirection; } + const std::array<std::array<float, 4>, 4> parametersErrorPlain() const; AlgebraicSymMatrix parametersError() const override; LocalError localPositionError() const override; virtual LocalError localDirectionError() const; @@ -124,7 +125,7 @@ class VectorHit final : public BaseTrackerRecHit { // setting methods void setPosition(LocalPoint pos) { thePosition = pos; } void setDirection(LocalVector dir) { theDirection = dir; } - void setCovMatrix(AlgebraicSymMatrix mat) { theCovMatrix = mat; } + void setCovMatrix(std::array<std::array<float, 4>, 4> mat) { theCovMatrix = mat; } private: // double dispatch @@ -145,7 +146,7 @@ class VectorHit final : public BaseTrackerRecHit { // mat[3][3]=var(y) // mat[0][2]=cov(dx/dz,x) // mat[1][3]=cov(dy/dz,y) - AlgebraicSymMatrix theCovMatrix; + std::array<std::array<float, 4>, 4> theCovMatrix; float theChi2; int theDimension; OmniClusterRef theLowerCluster; diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 75e0b6ee5c23c..de77a333393b1 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -6,7 +6,7 @@ VectorHit::VectorHit(const VectorHit& vh) : BaseTrackerRecHit(*vh.det(), trackerHitRTTI::vector), thePosition(vh.localPosition()), theDirection(vh.localDirection()), - theCovMatrix(vh.parametersError()), + theCovMatrix(vh.parametersErrorPlain()), theChi2(vh.chi2()), theDimension(vh.dimension()), theLowerCluster(vh.lowerClusterRef()), @@ -18,7 +18,7 @@ VectorHit::VectorHit(const VectorHit& vh) VectorHit::VectorHit(const GeomDet& idet, const LocalPoint& posLower, const LocalVector& dir, - const AlgebraicSymMatrix& covMatrix, + const std::array<std::array<float, 4>, 4> covMatrix, const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper, @@ -60,7 +60,13 @@ VectorHit::VectorHit(const GeomDet& idet, const AlgebraicSymMatrix22 covMatZX = *vh2Dzx.covMatrix(); const AlgebraicSymMatrix22 covMatZY = *vh2Dzy.covMatrix(); - theCovMatrix = AlgebraicSymMatrix(nComponents); + for (int i = 0; i < nComponents; i++) { + for (int j = 0; j < nComponents; j++) { + theCovMatrix[i][j] = 0.; + } + } + + //theCovMatrix = AlgebraicSymMatrix(nComponents); theCovMatrix[0][0] = covMatZX[0][0]; // var(dx/dz) theCovMatrix[1][1] = covMatZY[0][0]; // var(dy/dz) theCovMatrix[2][2] = covMatZX[1][1]; // var(x) @@ -190,7 +196,7 @@ Global3DVector VectorHit::globalDirection() const { return (det()->surface().toG float VectorHit::theta() const { return globalDirection().theta(); } float VectorHit::transverseMomentum(float magField) const { - return magField * (CLHEP::c_light * 1e-11) / theCurvature; + return magField * (CLHEP::c_light * 1e-5F) / theCurvature; } // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, using precise value from speed of light float VectorHit::momentum(float magField) const { return transverseMomentum(magField) / (1. * sin(theta())); } @@ -208,7 +214,17 @@ LocalError VectorHit::localDirectionError() const { return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); } -AlgebraicSymMatrix VectorHit::parametersError() const { return theCovMatrix; } +const std::array<std::array<float, 4>, 4> VectorHit::parametersErrorPlain() const { return theCovMatrix; } + +AlgebraicSymMatrix VectorHit::parametersError() const { + AlgebraicSymMatrix result(nComponents); + for (int i = 0; i < nComponents; i++) { + for (int j = 0; j < nComponents; j++) { + result[i][j] = theCovMatrix[i][j]; + } + } + return result; +} std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { os << " VectorHit create in the DetId#: " << vh.geographicalId() << "\n" diff --git a/DataFormats/TrackerRecHit2D/src/classes_def.xml b/DataFormats/TrackerRecHit2D/src/classes_def.xml index 2175ee0e8f371..bce22d6237c56 100644 --- a/DataFormats/TrackerRecHit2D/src/classes_def.xml +++ b/DataFormats/TrackerRecHit2D/src/classes_def.xml @@ -189,8 +189,8 @@ <class name="edm::Wrapper< MTDTrackingDetSetVector >"/> <class name="MTDTrackingOwnVector"/> <class name="edm::Wrapper< MTDTrackingOwnVector >"/> - <class name="VectorHit" ClassVersion="5"> - <version ClassVersion="5" checksum="3586519169"/> + <class name="VectorHit" ClassVersion="8"> + <version ClassVersion="8" checksum="4172043098"/> </class> <class name="VectorHit2D" ClassVersion="5"> <version ClassVersion="5" checksum="1341481267"/> From 1e9919f9d68c5cf9d00a9befdb8c5f771d23abfe Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Thu, 8 Oct 2020 16:06:46 +0200 Subject: [PATCH 431/778] restore change overwritten in rebase --- .../src/Phase2OTBarrelRodBuilder.cc | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc index e73c2f45c93fe..eb0647209b786 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc @@ -26,36 +26,25 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 } meanR = meanR / allGeometricDets.size(); LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; -<<<<<<< HEAD - - for(vector<const GeometricDet*>::const_iterator compGeometricDets=allGeometricDets.begin(); compGeometricDets!=allGeometricDets.end(); compGeometricDets++){ - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet( (*compGeometricDets)->geographicalId() ); - - if( (*compGeometricDets)->positionBounds().perp() < meanR) -======= for (vector<const GeometricDet*>::const_iterator compGeometricDets = allGeometricDets.begin(); compGeometricDets != allGeometricDets.end(); compGeometricDets++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*compGeometricDets)->geographicalID()); + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*compGeometricDets)->geographicalId()); if ((*compGeometricDets)->positionBounds().perp() < meanR) ->>>>>>> apply code checks innerGeomDets.push_back(theGeomDet); if ((*compGeometricDets)->positionBounds().perp() > meanR) outerGeomDets.push_back(theGeomDet); } -<<<<<<< HEAD -======= LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size(); LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size(); return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); } else { ->>>>>>> apply code checks vector<const GeometricDet*> compGeometricDets; vector<const GeomDet*> innerGeomDetBrothers; @@ -78,8 +67,8 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 for (auto& it : allGeometricDets) { compGeometricDets = it->components(); - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalID()); - LogTrace("TkDetLayers") << " inserting " << compGeometricDets[0]->geographicalID().rawId() << std::endl; + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets[0]->geographicalId()); + LogTrace("TkDetLayers") << " inserting " << compGeometricDets[0]->geographicalId().rawId() << std::endl; if (compGeometricDets[0]->positionBounds().perp() < meanR) innerGeomDets.push_back(theGeomDet); @@ -87,8 +76,8 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 if (compGeometricDets[0]->positionBounds().perp() > meanR) outerGeomDets.push_back(theGeomDet); - const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalID()); - LogTrace("TkDetLayers") << " inserting " << compGeometricDets[1]->geographicalID().rawId() << std::endl; + const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalId()); + LogTrace("TkDetLayers") << " inserting " << compGeometricDets[1]->geographicalId().rawId() << std::endl; if (compGeometricDets[1]->positionBounds().perp() < meanRBrothers) innerGeomDetBrothers.push_back(theGeomDetBrother); From 6ea5e3a58370f95e704a9161b4c0cf2e45e35641 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 7 Oct 2020 11:34:16 -0500 Subject: [PATCH 432/778] Fixed a corner case when constructing a EDGetTokenT Added an additional special constructor to avoid accidentally calling the constructor taking an adapter. --- FWCore/Utilities/interface/EDGetToken.h | 3 +- .../Utilities/test/test_catch2_EDGetToken.cc | 36 ++++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/FWCore/Utilities/interface/EDGetToken.h b/FWCore/Utilities/interface/EDGetToken.h index 2ebf9892a7980..49a0fced1bf66 100644 --- a/FWCore/Utilities/interface/EDGetToken.h +++ b/FWCore/Utilities/interface/EDGetToken.h @@ -88,7 +88,8 @@ namespace edm { //Needed to avoid EDGetTokenT(ADAPTER&&) from being called instead // when we can use C++20 concepts we can avoid the problem using a constraint - constexpr EDGetTokenT(EDGetTokenT& iOther) noexcept : m_value{iOther.m_value} {} + constexpr EDGetTokenT(EDGetTokenT<T>& iOther) noexcept : m_value{iOther.m_value} {} + constexpr EDGetTokenT(const EDGetTokenT<T>&& iOther) noexcept : m_value{iOther.m_value} {} constexpr EDGetTokenT& operator=(EDGetTokenT<T>& iOther) { return (*this = const_cast<const EDGetTokenT<T>&>(iOther)); diff --git a/FWCore/Utilities/test/test_catch2_EDGetToken.cc b/FWCore/Utilities/test/test_catch2_EDGetToken.cc index 79cf8ea7249db..7b92ac9a78499 100644 --- a/FWCore/Utilities/test/test_catch2_EDGetToken.cc +++ b/FWCore/Utilities/test/test_catch2_EDGetToken.cc @@ -2,7 +2,6 @@ #include "FWCore/Utilities/interface/EDGetToken.h" #include "catch.hpp" - namespace edm { class TestEDGetToken { public: @@ -15,12 +14,25 @@ namespace edm { static edm::EDGetTokenT<T> makeTokenT(Args&&... iArgs) { return edm::EDGetTokenT<T>(std::forward<Args>(iArgs)...); } + + template <typename T, typename... Args> + static const edm::EDGetTokenT<T> makeConstTokenT(Args&&... iArgs) { + return edm::EDGetTokenT<T>(std::forward<Args>(iArgs)...); + } }; } // namespace edm -#include <iostream> +namespace { + class Adapter { + public: + template <typename T> + edm::EDGetTokenT<T> consumes() const { + return edm::TestEDGetToken::makeTokenT<T>(11U); + } + }; +} // namespace -TEST_CASE("Test EDGetToken","[EDGetToken]") { +TEST_CASE("Test EDGetToken", "[EDGetToken]") { SECTION("EDGetTokenT") { SECTION("No argument ctr") { edm::EDGetTokenT<int> token1 = edm::TestEDGetToken::makeTokenT<int>(); @@ -39,14 +51,28 @@ TEST_CASE("Test EDGetToken","[EDGetToken]") { REQUIRE((token3.index() == 11)); } - SECTION("const arg copy ctr"){ + SECTION("const arg copy ctr") { const edm::EDGetTokenT<int> cToken2 = edm::TestEDGetToken::makeTokenT<int>(11U); edm::EDGetTokenT<int> token4(cToken2); REQUIRE(!token4.isUninitialized()); REQUIRE(token4.index() == 11); } + + SECTION("const arg copy ctr with move") { + auto const t = edm::TestEDGetToken::makeConstTokenT<int>(11U); + const edm::EDGetTokenT<int> cToken2{std::move(t)}; + REQUIRE(!cToken2.isUninitialized()); + REQUIRE(cToken2.index() == 11); + } + + SECTION("Use Adapter") { + Adapter a; + const edm::EDGetTokenT<int> cToken2{a}; + REQUIRE(!cToken2.isUninitialized()); + REQUIRE(cToken2.index() == 11); + } } - + SECTION("EDGetToken") { SECTION("No arg ctr") { edm::EDGetToken token10 = edm::TestEDGetToken::makeToken(); From 6e41cd293df4209db6a77bb41f2617c5d83fab4d Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Thu, 8 Oct 2020 09:16:20 -0500 Subject: [PATCH 433/778] Avoid accidentally calling wrong constructor in ESGetToken This mirrors a fix in EDGetTokenT. --- FWCore/Utilities/interface/ESGetToken.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FWCore/Utilities/interface/ESGetToken.h b/FWCore/Utilities/interface/ESGetToken.h index 4caa1e3346ac5..2a3f5a26602fd 100644 --- a/FWCore/Utilities/interface/ESGetToken.h +++ b/FWCore/Utilities/interface/ESGetToken.h @@ -63,6 +63,10 @@ namespace edm { constexpr ESGetToken<ESProduct, ESRecord>& operator=(ESGetToken<ESProduct, ESRecord>& iOther) noexcept { return (*this = const_cast<ESGetToken<ESProduct, ESRecord> const&>(iOther)); } + constexpr ESGetToken(ESGetToken<ESProduct, ESRecord> const&& iOther) : ESGetToken(iOther) {} + constexpr ESGetToken<ESProduct, ESRecord>& operator=(ESGetToken<ESProduct, ESRecord> const&& iOther) noexcept { + return (*this = iOther); + } constexpr unsigned int transitionID() const noexcept { return m_transitionID; } constexpr bool isInitialized() const noexcept { return transitionID() != std::numeric_limits<unsigned int>::max(); } From 65ba8680d20e8eb4f55d35836ae00dcd9fc30260 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Thu, 8 Oct 2020 16:47:45 +0200 Subject: [PATCH 434/778] introduce TrackingEffFromHitPatternClientConfigZeroBias and use it for the trackingZeroBias DQM Harvesting sequence --- .../python/TrackingClientConfig_Tier0_cff.py | 3 ++- ...ngEffFromHitPatternClientConfigZeroBias_cff.py | 15 +++++++++++++++ .../TrackingEffFromHitPatternClientConfig_cff.py | 3 --- .../python/DQMOffline_SecondStep_cff.py | 3 +++ DQMOffline/Configuration/python/autoDQM.py | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 DQM/TrackingMonitorClient/python/TrackingEffFromHitPatternClientConfigZeroBias_cff.py diff --git a/DQM/TrackingMonitorClient/python/TrackingClientConfig_Tier0_cff.py b/DQM/TrackingMonitorClient/python/TrackingClientConfig_Tier0_cff.py index 9be5acec385e3..4c21a1012da3f 100644 --- a/DQM/TrackingMonitorClient/python/TrackingClientConfig_Tier0_cff.py +++ b/DQM/TrackingMonitorClient/python/TrackingClientConfig_Tier0_cff.py @@ -73,6 +73,7 @@ ) from DQM.TrackingMonitorClient.TrackingEffFromHitPatternClientConfig_cff import trackingEffFromHitPattern +from DQM.TrackingMonitorClient.TrackingEffFromHitPatternClientConfigZeroBias_cff import trackingEffFromHitPatternZeroBias from DQM.TrackingMonitorClient.V0MonitoringClient_cff import * from DQM.TrackingMonitorClient.primaryVertexResolutionClient_cfi import * @@ -90,4 +91,4 @@ TrackingOfflineDQMClient = cms.Sequence(trackingQTester*trackingOfflineAnalyser*trackingEffFromHitPattern*voMonitoringClientSequence*primaryVertexResolutionClient*TrackEffClient) - +TrackingOfflineDQMClientZeroBias = cms.Sequence(trackingQTester*trackingOfflineAnalyser*trackingEffFromHitPatternZeroBias*voMonitoringClientSequence*primaryVertexResolutionClient*TrackEffClient) diff --git a/DQM/TrackingMonitorClient/python/TrackingEffFromHitPatternClientConfigZeroBias_cff.py b/DQM/TrackingMonitorClient/python/TrackingEffFromHitPatternClientConfigZeroBias_cff.py new file mode 100644 index 0000000000000..27beaaae2acb5 --- /dev/null +++ b/DQM/TrackingMonitorClient/python/TrackingEffFromHitPatternClientConfigZeroBias_cff.py @@ -0,0 +1,15 @@ +import FWCore.ParameterSet.Config as cms + +import DQM.TrackingMonitorClient.TrackingEffFromHitPatternClientConfig_cff +trackingEffFromHitPatternZeroBias = DQM.TrackingMonitorClient.TrackingEffFromHitPatternClientConfig_cff.trackingEffFromHitPattern.clone( + subDirs = cms.untracked.vstring( + "Tracking/TrackParameters/generalTracks/HitEffFromHitPattern*", + "Tracking/TrackParameters/highPurityTracks/pt_1/HitEffFromHitPattern*", + "Tracking/TrackParameters/highPurityTracks/dzPV0p1/HitEffFromHitPattern*", + "Tracking/TrackParameters/highPurityTracks/pt_1/HIP_OOT_noINpu/HitEffFromHitPattern*", + "Tracking/TrackParameters/highPurityTracks/pt_1/HIP_noOOT_INpu/HitEffFromHitPattern*", + "Tracking/TrackParameters/highPurityTracks/pt_1/noHIP_noOOT_INpu/HitEffFromHitPattern*", + "Muons/Tracking/innerTrack/HitEffFromHitPattern*", + "Muons/globalMuons/HitEffFromHitPattern*" + ) +) diff --git a/DQM/TrackingMonitorClient/python/TrackingEffFromHitPatternClientConfig_cff.py b/DQM/TrackingMonitorClient/python/TrackingEffFromHitPatternClientConfig_cff.py index 7e8ecdbce9423..859dc3a236c42 100644 --- a/DQM/TrackingMonitorClient/python/TrackingEffFromHitPatternClientConfig_cff.py +++ b/DQM/TrackingMonitorClient/python/TrackingEffFromHitPatternClientConfig_cff.py @@ -49,9 +49,6 @@ def _layers(suffix, quant, histoPostfix): "Tracking/TrackParameters/generalTracks/HitEffFromHitPattern*", "Tracking/TrackParameters/highPurityTracks/pt_1/HitEffFromHitPattern*", "Tracking/TrackParameters/highPurityTracks/dzPV0p1/HitEffFromHitPattern*", - "Tracking/TrackParameters/highPurityTracks/pt_1/HIP_OOT_noINpu/HitEffFromHitPattern*", - "Tracking/TrackParameters/highPurityTracks/pt_1/HIP_noOOT_INpu/HitEffFromHitPattern*", - "Tracking/TrackParameters/highPurityTracks/pt_1/noHIP_noOOT_INpu/HitEffFromHitPattern*", "Muons/Tracking/innerTrack/HitEffFromHitPattern*", "Muons/globalMuons/HitEffFromHitPattern*", ), diff --git a/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py b/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py index fdfc23ae61a91..a56febf9e35ec 100644 --- a/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py +++ b/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py @@ -170,6 +170,9 @@ DQMHarvestTracking = cms.Sequence( TrackingOfflineDQMClient * dqmFastTimerServiceClient ) +DQMHarvestTrackingZeroBias = cms.Sequence( TrackingOfflineDQMClientZeroBias * + dqmFastTimerServiceClient ) + DQMHarvestPixelTracking = cms.Sequence( pixelTrackingEffFromHitPattern ) DQMHarvestOuterTracker = cms.Sequence( diff --git a/DQMOffline/Configuration/python/autoDQM.py b/DQMOffline/Configuration/python/autoDQM.py index 11744cb352c13..26abf18730b3e 100644 --- a/DQMOffline/Configuration/python/autoDQM.py +++ b/DQMOffline/Configuration/python/autoDQM.py @@ -67,7 +67,7 @@ 'trackingZeroBias': ['DQMOfflineTrackingMinBias', 'PostDQMOffline', - 'DQMHarvestTracking+DQMCertTracking'], + 'DQMHarvestTrackingZeroBias+DQMCertTracking'], 'hlt': ['DQMOfflineTrigger', 'PostDQMOffline', From 50b0db7663467c45b742808bec2d038d3e839f1e Mon Sep 17 00:00:00 2001 From: Mikhail <Mikhail.Kirsanov@cern.ch> Date: Thu, 8 Oct 2020 17:28:14 +0200 Subject: [PATCH 435/778] remove inexistent pythia8 parameter from configuration file in EvtGenInterface --- GeneratorInterface/EvtGenInterface/test/Py8_bplus_evtgen1_cfg.py | 1 - 1 file changed, 1 deletion(-) diff --git a/GeneratorInterface/EvtGenInterface/test/Py8_bplus_evtgen1_cfg.py b/GeneratorInterface/EvtGenInterface/test/Py8_bplus_evtgen1_cfg.py index 59413dac1dc02..95e59233a6305 100644 --- a/GeneratorInterface/EvtGenInterface/test/Py8_bplus_evtgen1_cfg.py +++ b/GeneratorInterface/EvtGenInterface/test/Py8_bplus_evtgen1_cfg.py @@ -119,7 +119,6 @@ 'Main:timesAllowErrors = 10000', 'Check:epTolErr = 0.01', 'Beams:setProductionScalesFromLHEF = off', - 'SLHA:keepSM = on', 'SLHA:minMassSM = 1000.', 'ParticleDecays:limitTau0 = on', 'ParticleDecays:tau0Max = 10', From afa1434d99572f37a406c1c66a371ccf200831f0 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 8 Oct 2020 18:15:23 +0200 Subject: [PATCH 436/778] move from era to process modifier --- .../python/genJetSubEvent_cff.py} | 0 .../python/relval_steps.py | 22 ++++++++++--------- .../StandardSequences/python/Eras.py | 3 +-- .../producersHeavyIons/heavyIonJets_cff.py | 2 +- .../PatAlgos/python/slimming/miniAOD_tools.py | 2 +- .../python/slimming/slimmedGenJets_cfi.py | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) rename Configuration/{Eras/python/Modifier_genJetSubEvent_cff.py => ProcessModifiers/python/genJetSubEvent_cff.py} (100%) diff --git a/Configuration/Eras/python/Modifier_genJetSubEvent_cff.py b/Configuration/ProcessModifiers/python/genJetSubEvent_cff.py similarity index 100% rename from Configuration/Eras/python/Modifier_genJetSubEvent_cff.py rename to Configuration/ProcessModifiers/python/genJetSubEvent_cff.py diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 3d7c2b346a3d9..53421ffa77920 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -967,8 +967,6 @@ def genS(fragment,howMuch): hiAlca2018 = {'--conditions':'auto:phase1_2018_realistic', '--era':'Run2_2018'} hiAlca2018_ppReco = {'--conditions':'auto:phase1_2018_realistic_hi', '--era':'Run2_2018_pp_on_AA'} hiAlca2021_ppReco = {'--conditions':'auto:phase1_2021_realistic_hi', '--era':'Run3_pp_on_PbPb'} -hiAlca2018_ppReco_mb = {'--conditions':'auto:phase1_2018_realistic_hi', '--era':'Run2_2018_pp_on_AA,genJetSubEvent'} -hiAlca2021_ppReco_mb = {'--conditions':'auto:phase1_2021_realistic_hi', '--era':'Run3_pp_on_PbPb,genJetSubEvent'} hiDefaults2011=merge([hiAlca2011,{'--scenario':'HeavyIons','-n':2}]) @@ -977,8 +975,6 @@ def genS(fragment,howMuch): hiDefaults2018=merge([hiAlca2018,{'--scenario':'HeavyIons','-n':2}]) hiDefaults2018_ppReco=merge([hiAlca2018_ppReco,{'-n':2}]) hiDefaults2021_ppReco=merge([hiAlca2021_ppReco,{'-n':2}]) -hiDefaults2018_ppReco_mb=merge([hiAlca2018_ppReco_mb,{'-n':2}]) -hiDefaults2021_ppReco_mb=merge([hiAlca2021_ppReco_mb,{'-n':2}]) steps['HydjetQ_B12_5020GeV_2011']=merge([{'-n':1,'--beamspot':'RealisticHI2011Collision'},hiDefaults2011,genS('Hydjet_Quenched_B12_5020GeV_cfi',U2000by1)]) steps['HydjetQ_B12_5020GeV_2015']=merge([{'-n':1,'--beamspot':'RealisticHICollisionFixZ2015'},hiDefaults2015,genS('Hydjet_Quenched_B12_5020GeV_cfi',U2000by1)]) @@ -2478,9 +2474,11 @@ def gen2021HiMix(fragment,howMuch): '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO', '--eventcontent':'RECOSIM,MINIAODSIM,DQM', },step3Up2015Defaults]) -steps['RECOHI2021PPRECOMB']=merge([hiDefaults2021_ppReco_mb,{'-s':'RAW2DIGI,L1Reco,RECO,EI,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM', - '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO', - '--eventcontent':'RECOSIM,MINIAODSIM,DQM', +steps['RECOHI2021PPRECOMB']=merge([hiDefaults2021_ppReco,{'-s':'RAW2DIGI,L1Reco,RECO,EI,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM', + '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO', + '--eventcontent':'RECOSIM,MINIAODSIM,DQM', + '--era':'Run3_pp_on_PbPb', + '--procModifiers':'genJetSubEvent', },step3Up2015Defaults]) steps['ALCARECOHI2021PPRECO']=merge([hiDefaults2021_ppReco,{'-s':'ALCA:TkAlMinBias+SiStripCalMinBias', @@ -2492,10 +2490,12 @@ def gen2021HiMix(fragment,howMuch): '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO,ALCARECO', '--eventcontent':'RECOSIM,MINIAODSIM,DQM,ALCARECO', },step3Up2015Defaults]) -steps['RECOHI2018PPRECOMB']=merge([hiDefaults2018_ppReco_mb,{'-s':'RAW2DIGI,L1Reco,RECO,ALCA:SiStripCalZeroBias+SiPixelCalZeroBias,EI,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM', +steps['RECOHI2018PPRECOMB']=merge([hiDefaults2018_ppReco,{'-s':'RAW2DIGI,L1Reco,RECO,ALCA:SiStripCalZeroBias+SiPixelCalZeroBias,EI,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM', '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO,ALCARECO', '--eventcontent':'RECOSIM,MINIAODSIM,DQM,ALCARECO', - },step3Up2015Defaults]) + '--era':'Run2_2018_pp_on_AA', + '--procModifiers':'genJetSubEvent', + },step3Up2015Defaults]) steps['RECOHI2018PPRECOml']=merge([concurrentLumis,steps['RECOHI2018PPRECOMB']]) steps['REMINIAODHI2018PPRECO']=merge([{'-s':'PAT,VALIDATION:@miniAODValidation,DQM:@miniAODDQM', @@ -2507,7 +2507,9 @@ def gen2021HiMix(fragment,howMuch): '--datatier':'MINIAODSIM,DQMIO', '--eventcontent':'MINIAODSIM,DQM', '-n':100, - },hiDefaults2018_ppReco_mb,step3Up2015Defaults]) + '--era':'Run2_2018_pp_on_AA', + '--procModifiers':'genJetSubEvent', + },hiDefaults2018_ppReco,step3Up2015Defaults]) steps['ALCARECOHI2018PPRECO']=merge([hiDefaults2018_ppReco,{'-s':'ALCA:TkAlMinBias+SiStripCalMinBias', '--datatier':'ALCARECO', diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index 2b8f78edd8c01..5f5524eb6176a 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -66,8 +66,7 @@ def __init__(self): 'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', 'run2_nanoAOD_106Xv1', 'hcalHardcodeConditions', 'hcalSkipPacker', 'run2_HLTconditions_2016','run2_HLTconditions_2017','run2_HLTconditions_2018', - 'bParking', - 'genJetSubEvent'] + 'bParking'] internalUseModChains = ['run2_2017_noTrackingModifier'] self.pythonCfgLines = {} diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index b3b56fb0f3c13..b2404039c60b2 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -13,7 +13,7 @@ withLeptons = cms.bool(False), ) -from Configuration.Eras.Modifier_genJetSubEvent_cff import genJetSubEvent +from Configuration.ProcessModifiers.genJetSubEvent_cff import genJetSubEvent genJetSubEvent.toModify(allPartons,src = "genParticles") cleanedPartons = hiPartons.clone( diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index c1652955fc706..1b50953b0423d 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -589,7 +589,7 @@ def miniAOD_customizeMC(process): process.patJetPartons.particles = "genParticles" process.patJetPartonMatch.matched = "prunedGenParticles" _hiGeneral.toModify(process.patJetPartonMatch, matched = "hiSignalGenParticles") - from Configuration.Eras.Modifier_genJetSubEvent_cff import genJetSubEvent + from Configuration.ProcessModifiers.genJetSubEvent_cff import genJetSubEvent genJetSubEvent.toModify(process.patJetPartonMatch, matched = "cleanedPartons") process.patJetPartonMatch.mcStatus = [ 3, 23 ] process.patJetGenJetMatch.matched = "slimmedGenJets" diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py index afba82607a686..020c5e9f84196 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedGenJets_cfi.py @@ -24,5 +24,5 @@ from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(slimmedGenJets, src = "ak4HiSignalGenJets") (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(slimmedGenJetsAK8, cut = 'pt>9999', nLoose = 0) -from Configuration.Eras.Modifier_genJetSubEvent_cff import genJetSubEvent +from Configuration.ProcessModifiers.genJetSubEvent_cff import genJetSubEvent genJetSubEvent.toModify(slimmedGenJets, src = "ak4HiGenJetsCleaned") From 7e94e89f12303c98842f06ee953826782badefbc Mon Sep 17 00:00:00 2001 From: Fabio Cossutti <fabio.cossutti@ts.infn.it> Date: Thu, 8 Oct 2020 18:59:50 +0200 Subject: [PATCH 437/778] keep the original workflow numbering after D53 removal --- .../PyReleaseValidation/python/relval_2026.py | 18 +++++++++--------- .../python/upgradeWorkflowComponents.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index 11eadabf48d46..e023aaf2653d8 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -19,15 +19,15 @@ numWFIB.extend([23434.99,23434.999]) #2026D49 premixing combined stage1+stage2 (ttbar+PU200, ttbar+PU50 for PR test) numWFIB.extend([23234.21,23434.21]) #2026D49 prodlike, prodlike PU numWFIB.extend([23234.103]) #2026D49 aging -numWFIB.extend([24434.0]) #2026D60 -numWFIB.extend([28234.0]) #2026D64 -numWFIB.extend([29834.0]) #2026D65 -numWFIB.extend([30234.0]) #2026D66 -numWFIB.extend([30634.0]) #2026D67 -numWFIB.extend([31034.0]) #2026D68 -numWFIB.extend([31434.0]) #2026D69 -numWFIB.extend([31834.0]) #2026D70 -numWFIB.extend([32234.0]) #2026D71 +numWFIB.extend([28234.0]) #2026D60 +numWFIB.extend([29834.0]) #2026D64 +numWFIB.extend([30234.0]) #2026D65 +numWFIB.extend([30634.0]) #2026D66 +numWFIB.extend([31034.0]) #2026D67 +numWFIB.extend([31434.0]) #2026D68 +numWFIB.extend([31834.0]) #2026D69 +numWFIB.extend([32234.0]) #2026D70 +numWFIB.extend([32634.0]) #2026D71 for numWF in numWFIB: workflows[numWF] = _upgrade_workflows[numWF] diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index a05926b04ba72..4045768b15b10 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -61,7 +61,7 @@ } numWFSkip=200 # temporary measure to keep other WF numbers the same -numWFConflict = [[20000,23200],[23600,24400],[24800,28200],[28600,29800],[50000,51000]] +numWFConflict = [[20000,23200],[23600,28200],[28600,29800],[50000,51000]] numWFAll={ 2017: [], 2026: [] From 6681d1ecbb8677e722a3e821c00d34bc46e5a1b2 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Thu, 8 Oct 2020 22:15:37 +0200 Subject: [PATCH 438/778] replace 6 with a constant expression --- .../HGCalCommonData/src/HGCalWaferMask.cc | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc index 9fba3622dbcaa..abe5bf0d39294 100644 --- a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc +++ b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc @@ -1,3 +1,4 @@ + #include "Geometry/HGCalCommonData/interface/HGCalWaferMask.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" @@ -339,29 +340,29 @@ int HGCalWaferMask::getRotation(int zside, int type, int rotn) { int newrotn(rotn); if ((zside < 0) && (type != HGCalTypes::WaferFull)) { if (type == HGCalTypes::WaferFive) { //WaferFive - static const int rot1[6] = {HGCalTypes::WaferCorner4, - HGCalTypes::WaferCorner3, - HGCalTypes::WaferCorner2, - HGCalTypes::WaferCorner1, - HGCalTypes::WaferCorner0, - HGCalTypes::WaferCorner5}; + static const int rot1[HGCalTypes::WaferCornerMax] = {HGCalTypes::WaferCorner4, + HGCalTypes::WaferCorner3, + HGCalTypes::WaferCorner2, + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5}; newrotn = rot1[rotn]; } else if ((type == HGCalTypes::WaferThree) || (type == HGCalTypes::WaferSemi) || (type == HGCalTypes::WaferSemi2)) { //WaferThree/WaferSemi/WaferSemi2 - static const int rot2[6] = {HGCalTypes::WaferCorner2, - HGCalTypes::WaferCorner1, - HGCalTypes::WaferCorner0, - HGCalTypes::WaferCorner5, - HGCalTypes::WaferCorner4, - HGCalTypes::WaferCorner3}; + static const int rot2[HGCalTypes::WaferCornerMax] = {HGCalTypes::WaferCorner2, + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5, + HGCalTypes::WaferCorner4, + HGCalTypes::WaferCorner3}; newrotn = rot2[rotn]; } else { //WaferHalf/WaferChopTwo/WaferChopTwoM - static const int rot3[6] = {HGCalTypes::WaferCorner3, - HGCalTypes::WaferCorner2, - HGCalTypes::WaferCorner1, - HGCalTypes::WaferCorner0, - HGCalTypes::WaferCorner5, - HGCalTypes::WaferCorner4}; + static const int rot3[HGCalTypes::WaferCornerMax] = {HGCalTypes::WaferCorner3, + HGCalTypes::WaferCorner2, + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5, + HGCalTypes::WaferCorner4}; newrotn = rot3[rotn]; } } From 7eecf7dabb56c331a7b18f1f9cb37f62b7b65ac0 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Thu, 8 Oct 2020 22:17:25 +0200 Subject: [PATCH 439/778] Correct numbering scheme for ECAL --- .../CaloEventSetup/interface/CaloGeometryLoader.icc | 13 +++++++++---- Geometry/EcalAlgo/src/EcalPreshowerGeometry.cc | 12 ++++++++++++ Geometry/EcalCommonData/interface/EcalBaseNumber.h | 1 + Geometry/EcalCommonData/src/EcalBaseNumber.cc | 6 ++++++ .../Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py | 4 ++++ 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc b/Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc index 79a2c7fe4bf4e..90adaffb0d75d 100644 --- a/Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc +++ b/Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc @@ -5,6 +5,7 @@ #include "Geometry/CaloEventSetup/interface/CaloGeometryLoader.h" #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" #include "Geometry/CaloGeometry/interface/CaloGenericDetId.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DetectorDescription/Core/interface/DDCompactView.h" #include "DetectorDescription/Core/interface/DDCurrentNamespace.h" @@ -203,20 +204,24 @@ unsigned int CaloGeometryLoader<T>::getDetIdForDD4HepNode(const cms::DDFilteredV size_t n = path.find("/") + 1; edm::LogVerbatim("CaloGeometryBuilder") << path << " n " << n; - size_t start = n; + size_t start = n, startold = n; std::string det(""), num(""); + bool done (false); for (size_t i = n; i <= path.size(); ++i) { if (i == path.size() || path[i] == '/') { num = path.substr(start, i - start); - start = i + 1; + startold = start = i + 1; baseNumber.addLevel(det, std::stoi(num)); + done = true; } else if (path[i] == ':') { - start = i + 1; + startold = start = i + 1; } else if (path[i] == '_') { - det = path.substr(start, i - start); + det = done ? path.substr(start, i - start) : path.substr(startold, i - startold); start = i + 1; + done = false; } } + baseNumber.reverse(); return m_scheme.getUnitID(baseNumber); } diff --git a/Geometry/EcalAlgo/src/EcalPreshowerGeometry.cc b/Geometry/EcalAlgo/src/EcalPreshowerGeometry.cc index 58b779382accb..ff91933ca1200 100644 --- a/Geometry/EcalAlgo/src/EcalPreshowerGeometry.cc +++ b/Geometry/EcalAlgo/src/EcalPreshowerGeometry.cc @@ -2,6 +2,7 @@ #include "Geometry/CaloGeometry/interface/CaloGenericDetId.h" #include "Geometry/EcalAlgo/interface/EcalPreshowerGeometry.h" #include "DataFormats/EcalDetId/interface/ESDetId.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include <iostream> @@ -10,6 +11,8 @@ typedef CaloCellGeometry::Pt3D Pt3D; typedef CaloCellGeometry::Pt3DVec Pt3DVec; typedef HepGeom::Plane3D<CCGFloat> Pl3D; +//#define EDM_ML_DEBUG + EcalPreshowerGeometry::EcalPreshowerGeometry() : m_xWidWaf(6.3), m_xInterLadGap(0.05), // additional gap between wafers in adj ladders @@ -21,6 +24,9 @@ EcalPreshowerGeometry::EcalPreshowerGeometry() m_zplane[1] = 0.; m_zplane[2] = 0.; m_zplane[3] = 0.; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "EcalPreshowerGeometry::Creating an instance"; +#endif } EcalPreshowerGeometry::~EcalPreshowerGeometry() {} @@ -80,6 +86,9 @@ void EcalPreshowerGeometry::initializeParms() { CCGFloat z1plus(0); CCGFloat z2plus(0); const std::vector<DetId>& esDetIds(getValidDetIds()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "EcalPreshowerGeometry:: Get " << esDetIds.size() << " valid DetIds"; +#endif for (unsigned int i(0); i != esDetIds.size(); ++i) { const ESDetId esid(esDetIds[i]); @@ -193,6 +202,9 @@ void EcalPreshowerGeometry::newCell(const GlobalPoint& f1, const unsigned int cellIndex(ESDetId(detId).denseIndex()); m_cellVec[cellIndex] = PreshowerStrip(f1, cornersMgr(), parm); addValidID(detId); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "EcalPreshowerGeometry::Add a new DetId " << ESDetId(detId); +#endif } const CaloCellGeometry* EcalPreshowerGeometry::getGeometryRawPtr(uint32_t index) const { diff --git a/Geometry/EcalCommonData/interface/EcalBaseNumber.h b/Geometry/EcalCommonData/interface/EcalBaseNumber.h index 20ae1cf05c8df..344ccb05458b9 100644 --- a/Geometry/EcalCommonData/interface/EcalBaseNumber.h +++ b/Geometry/EcalCommonData/interface/EcalBaseNumber.h @@ -25,6 +25,7 @@ class EcalBaseNumber { int getCapacity(); void reset(); + void reverse(); protected: std::vector<std::string> _sortedName; diff --git a/Geometry/EcalCommonData/src/EcalBaseNumber.cc b/Geometry/EcalCommonData/src/EcalBaseNumber.cc index 43fb8c7391a65..8236ba7eedafd 100644 --- a/Geometry/EcalCommonData/src/EcalBaseNumber.cc +++ b/Geometry/EcalCommonData/src/EcalBaseNumber.cc @@ -1,4 +1,5 @@ #include "Geometry/EcalCommonData/interface/EcalBaseNumber.h" +#include <algorithm> EcalBaseNumber::EcalBaseNumber() : _theLevels(0) {} @@ -36,3 +37,8 @@ std::string const& EcalBaseNumber::getLevelName(int level) const { return _sorte int EcalBaseNumber::getCapacity() { return _sortedName.capacity(); } void EcalBaseNumber::reset() { _theLevels = 0; } + +void EcalBaseNumber::reverse() { + std::reverse(std::begin(_sortedName), std::end(_sortedName)); + std::reverse(std::begin(_sortedCopyNumber), std::end(_sortedCopyNumber)); +} diff --git a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py index 845c8d16ee8a0..b89bb9fa5c884 100644 --- a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py @@ -19,6 +19,10 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +if hasattr(process,'MessageLogger'): + process.MessageLogger.categories.append('EcalGeom') +# process.MessageLogger.categories.append('CaloGeometryBuilder') + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10), output = cms.optional.untracked.allowed(cms.int32,cms.PSet) From 11e0f59c19faee3d228577549943bfd7451b3c0c Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Thu, 8 Oct 2020 22:25:30 +0200 Subject: [PATCH 440/778] Code check --- .../HGCalCommonData/src/HGCalWaferMask.cc | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc index abe5bf0d39294..a275a8b786bc7 100644 --- a/Geometry/HGCalCommonData/src/HGCalWaferMask.cc +++ b/Geometry/HGCalCommonData/src/HGCalWaferMask.cc @@ -341,28 +341,28 @@ int HGCalWaferMask::getRotation(int zside, int type, int rotn) { if ((zside < 0) && (type != HGCalTypes::WaferFull)) { if (type == HGCalTypes::WaferFive) { //WaferFive static const int rot1[HGCalTypes::WaferCornerMax] = {HGCalTypes::WaferCorner4, - HGCalTypes::WaferCorner3, - HGCalTypes::WaferCorner2, - HGCalTypes::WaferCorner1, - HGCalTypes::WaferCorner0, - HGCalTypes::WaferCorner5}; + HGCalTypes::WaferCorner3, + HGCalTypes::WaferCorner2, + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5}; newrotn = rot1[rotn]; } else if ((type == HGCalTypes::WaferThree) || (type == HGCalTypes::WaferSemi) || (type == HGCalTypes::WaferSemi2)) { //WaferThree/WaferSemi/WaferSemi2 static const int rot2[HGCalTypes::WaferCornerMax] = {HGCalTypes::WaferCorner2, - HGCalTypes::WaferCorner1, - HGCalTypes::WaferCorner0, - HGCalTypes::WaferCorner5, - HGCalTypes::WaferCorner4, - HGCalTypes::WaferCorner3}; + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5, + HGCalTypes::WaferCorner4, + HGCalTypes::WaferCorner3}; newrotn = rot2[rotn]; } else { //WaferHalf/WaferChopTwo/WaferChopTwoM static const int rot3[HGCalTypes::WaferCornerMax] = {HGCalTypes::WaferCorner3, - HGCalTypes::WaferCorner2, - HGCalTypes::WaferCorner1, - HGCalTypes::WaferCorner0, - HGCalTypes::WaferCorner5, - HGCalTypes::WaferCorner4}; + HGCalTypes::WaferCorner2, + HGCalTypes::WaferCorner1, + HGCalTypes::WaferCorner0, + HGCalTypes::WaferCorner5, + HGCalTypes::WaferCorner4}; newrotn = rot3[rotn]; } } From 8f8716ca112246e03136fe8c9cb809787a006d09 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Thu, 8 Oct 2020 22:27:13 +0200 Subject: [PATCH 441/778] Code check --- Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc | 2 +- Geometry/EcalCommonData/src/EcalBaseNumber.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc b/Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc index 90adaffb0d75d..67596debe9b7e 100644 --- a/Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc +++ b/Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc @@ -206,7 +206,7 @@ unsigned int CaloGeometryLoader<T>::getDetIdForDD4HepNode(const cms::DDFilteredV edm::LogVerbatim("CaloGeometryBuilder") << path << " n " << n; size_t start = n, startold = n; std::string det(""), num(""); - bool done (false); + bool done(false); for (size_t i = n; i <= path.size(); ++i) { if (i == path.size() || path[i] == '/') { num = path.substr(start, i - start); diff --git a/Geometry/EcalCommonData/src/EcalBaseNumber.cc b/Geometry/EcalCommonData/src/EcalBaseNumber.cc index 8236ba7eedafd..80768c3344e02 100644 --- a/Geometry/EcalCommonData/src/EcalBaseNumber.cc +++ b/Geometry/EcalCommonData/src/EcalBaseNumber.cc @@ -38,7 +38,7 @@ int EcalBaseNumber::getCapacity() { return _sortedName.capacity(); } void EcalBaseNumber::reset() { _theLevels = 0; } -void EcalBaseNumber::reverse() { +void EcalBaseNumber::reverse() { std::reverse(std::begin(_sortedName), std::end(_sortedName)); std::reverse(std::begin(_sortedCopyNumber), std::end(_sortedCopyNumber)); } From e058e1abbf1db9f31e0adf9bc880064b40b4f76c Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Fri, 9 Oct 2020 09:24:23 +0200 Subject: [PATCH 442/778] Avoid a dead assignment in DDFilteredView.cc --- DetectorDescription/DDCMS/src/DDFilteredView.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index c5f808a299fc3..1ff5fcd6a1ffa 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -6,7 +6,6 @@ #include "DD4hep/Shapes.h" #include <TGeoBBox.h> #include <TGeoBoolNode.h> -#include <vector> #include <charconv> using namespace cms; @@ -758,7 +757,6 @@ bool DDFilteredView::matchPath(const std::string_view path) const { break; } else { refname.remove_suffix(refname.size() - pos); - result = true; } } if (!compareEqualName(refname, name)) { From 2c556d6edadb59da6c2ad2367f06ff9aa3963f76 Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Fri, 2 Oct 2020 01:48:41 +0200 Subject: [PATCH 443/778] adding phase2 IT rechit validation module --- .../interface/Phase2ValidationUtil.h | 71 ++++ .../SiTrackerPhase2V/plugins/BuildFile.xml | 22 +- .../plugins/Phase2ITValidateRecHit.cc | 379 ++++++++++++++++++ .../plugins/Phase2ITValidateRecHit.h | 89 ++++ .../python/Phase2ITValidateRecHit_cfi.py | 37 ++ ...idateRecHit_TrackerPhase2Standalone_cfg.py | 98 +++++ 6 files changed, 691 insertions(+), 5 deletions(-) create mode 100644 Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h create mode 100644 Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc create mode 100644 Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h create mode 100644 Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py create mode 100644 Validation/SiTrackerPhase2V/test/ValidateRecHit_TrackerPhase2Standalone_cfg.py diff --git a/Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h b/Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h new file mode 100644 index 0000000000000..9d0bbd599cab8 --- /dev/null +++ b/Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h @@ -0,0 +1,71 @@ +#ifndef _Validation_SiTrackerPhase2V_Phase2TrackierValidationUtil_h +#define _Validation_SiTrackerPhase2V_Phase2TrackierValidationUtil_h +#include "SimDataFormats/TrackingHit/interface/PSimHit.h" +#include "SimDataFormats/Track/interface/SimTrack.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include<string> +#include<sstream> + +namespace Phase2TkUtil { + +bool isPrimary(const SimTrack& simTrk, const PSimHit* simHit){ + bool retval = false; + unsigned int trkId = simTrk.trackId(); + if (trkId != simHit->trackId()) + return retval; + int vtxIndex = simTrk.vertIndex(); + int ptype = simHit->processType(); + if ((vtxIndex == 0) && (ptype == 0)) + return true; + return false; +} + +std::string getITHistoId(uint32_t det_id, const TrackerTopology* tTopo) { + std::string Disc; + std::ostringstream fname1; + int layer = tTopo->getITPixelLayerNumber(det_id); + + if(layer < 0) + return ""; + if (layer < 100) { + fname1 << "Barrel/"; + fname1 << "Layer" << layer; + fname1 << ""; + } else { + int side = tTopo->pxfSide(det_id); + fname1 << "EndCap_Side" << side << "/"; + int disc = tTopo->pxfDisk(det_id); + Disc = (disc < 9) ? "EPix" : "FPix";; + fname1 << Disc << "/"; + int ring = tTopo->pxfBlade(det_id); + fname1 << "Ring" << ring; + } + return fname1.str(); +} + +std::string getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo) { + std::string Disc; + std::ostringstream fname1; + int layer = tTopo->getOTLayerNumber(det_id); + + if(layer < 0) + return ""; + if (layer < 100) { + fname1 << "Barrel/"; + fname1 << "Layer" << layer; + fname1 << ""; + } else { + int side = layer / 100; + fname1 << "EndCap_Side" << side << "/"; + int disc = layer - side * 100; + Disc = (disc < 3) ? "TEDD_1" : "TEDD_2"; + fname1 << Disc << "/"; + int ring = tTopo->tidRing(det_id); + fname1 << "Ring" << ring; + } + return fname1.str(); +} + +} + +#endif diff --git a/Validation/SiTrackerPhase2V/plugins/BuildFile.xml b/Validation/SiTrackerPhase2V/plugins/BuildFile.xml index eff5680c0ac29..ef4098ba4d1f2 100644 --- a/Validation/SiTrackerPhase2V/plugins/BuildFile.xml +++ b/Validation/SiTrackerPhase2V/plugins/BuildFile.xml @@ -1,14 +1,26 @@ + <use name="FWCore/Framework"/> <use name="FWCore/ParameterSet"/> -<use name="SimDataFormats/TrackerDigiSimLink"/> -<use name="DataFormats/SiPixelDigi"/> +<use name="FWCore/ServiceRegistry"/> +<use name="FWCore/Utilities"/> <use name="DataFormats/DetId"/> +<use name="DataFormats/Common"/> +<use name="DataFormats/TrackerCommon"/> +<use name="DataFormats/Phase2TrackerCluster"/> +<use name="DataFormats/TrackerRecHit2D"/> +<use name="DataFormats/GeometrySurface"/> +<use name="DataFormats/GeometryVector"/> +<use name="DataFormats/SiPixelDigi"/> +<use name="SimDataFormats/Track"/> +<use name="SimDataFormats/TrackingHit"/> +<use name="SimDataFormats/Vertex"/> +<use name="SimDataFormats/TrackerDigiSimLink"/> +<use name="SimTracker/TrackerHitAssociation"/> <use name="Geometry/Records"/> -<use name="Geometry/CommonDetUnit"/> <use name="Geometry/TrackerGeometryBuilder"/> +<use name="Geometry/CommonDetUnit"/> <use name="DQMServices/Core"/> -<use name="DataFormats/Common"/> -<use name="SimDataFormats/Track"/> <use name="boost_system"/> <use name="rootcling"/> <flags EDM_PLUGIN="1"/> +<flags EDM_PLUGIN="1"/> diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc new file mode 100644 index 0000000000000..46d9284a8750c --- /dev/null +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc @@ -0,0 +1,379 @@ +// Package: Phase2ITValidateRecHit +// Class: Phase2ITValidateRecHit +// +/**\class Phase2ITValidateRecHit Phase2ITValidateRecHit.cc + Description: Plugin for Phase2 RecHit validation +*/ +// +// Author: Shubhi Parolia, Suvankar Roy Chowdhury +// Date: June 2020 +// +// system include files +#include <memory> +#include "Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h" +#include "Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Framework/interface/ESWatcher.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/CommonDetUnit/interface/TrackerGeomDet.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/GeometrySurface/interface/LocalError.h" +#include "DataFormats/GeometryVector/interface/LocalPoint.h" +//--- for SimHit association +#include "SimDataFormats/Track/interface/SimTrackContainer.h" +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" +#include "SimDataFormats/TrackingHit/interface/PSimHit.h" +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" +#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" +#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" +// DQM Histograming +#include "DQMServices/Core/interface/MonitorElement.h" +// +// constructors +// +Phase2ITValidateRecHit::Phase2ITValidateRecHit(const edm::ParameterSet& iConfig): + config_(iConfig), + trackerHitAssociatorConfig_(iConfig, consumesCollector()), + simtrackminpt_(iConfig.getParameter<double>("SimTrackMinPt")), + tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))), + simTracksToken_(consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("simTracksSrc"))) +{ + edm::LogInfo("Phase2ITValidateRecHit") << ">>> Construct Phase2ITValidateRecHit "; + for (const auto& itag : config_.getParameter<std::vector<edm::InputTag> >("PSimHitSource")) + simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag)); +} + +// +// destructor +// +Phase2ITValidateRecHit::~Phase2ITValidateRecHit() { + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + edm::LogInfo("Phase2ITValidateRecHit") << ">>> Destroy Phase2ITValidateRecHit "; +} +// +// -- DQM Begin Run +// +// -- Analyze +// +void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { + + // Get the geometry + edm::ESHandle<TrackerGeometry> geomHandle; + iSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); + const TrackerGeometry* tkGeom = &(*geomHandle); + + edm::ESHandle<TrackerTopology> tTopoHandle; + iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); + const TrackerTopology* tTopo = tTopoHandle.product(); + + std::vector<edm::Handle<edm::PSimHitContainer>> simHits; + for (const auto& itoken : simHitTokens_) { + edm::Handle<edm::PSimHitContainer> simHitHandle; + iEvent.getByToken(itoken, simHitHandle); + if (!simHitHandle.isValid()) + continue; + simHits.emplace_back(simHitHandle); + } + // Get the SimTracks and push them in a map of id, SimTrack + edm::Handle<edm::SimTrackContainer> simTracks; + iEvent.getByToken(simTracksToken_, simTracks); + + std::map<unsigned int, SimTrack> selectedSimTrackMap; + for (edm::SimTrackContainer::const_iterator simTrackIt(simTracks->begin()); simTrackIt != simTracks->end(); + ++simTrackIt) { + if (simTrackIt->momentum().pt() > simtrackminpt_) { + selectedSimTrackMap.insert(std::make_pair(simTrackIt->trackId(), *simTrackIt)); + } + } + TrackerHitAssociator associateRecHit(iEvent, trackerHitAssociatorConfig_); + fillITHistos(iEvent, tTopo, tkGeom, associateRecHit, simHits, selectedSimTrackMap); +} + +void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, + const TrackerTopology* tTopo, + const TrackerGeometry* tkGeom, + const TrackerHitAssociator& associateRecHit, + const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, + const std::map<unsigned int, SimTrack>& selectedSimTrackMap) { + // Get the RecHits + edm::Handle<SiPixelRecHitCollection> rechits; + iEvent.getByToken(tokenRecHitsIT_, rechits); + if(!rechits.isValid()) return; + std::map<std::string, unsigned int> nrechitLayerMap; + std::map<std::string, unsigned int> nrechitLayerMap_primary; + unsigned long int nTotrechitsinevt = 0; + // Loop over modules + SiPixelRecHitCollection::const_iterator DSViter; + for (DSViter = rechits->begin(); DSViter != rechits->end(); ++DSViter) { + // Get the detector unit's id + unsigned int rawid(DSViter->detId()); + DetId detId(rawid); + // Get the geomdet + const GeomDetUnit* geomDetunit(tkGeom->idToDetUnit(detId)); + if (!geomDetunit) + continue; + // determine the detector we are in + std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo); + nTotrechitsinevt += DSViter->size(); + if(nrechitLayerMap.find(key) == nrechitLayerMap.end()) { + nrechitLayerMap.insert(std::make_pair(key, DSViter->size())); + nrechitLayerMap_primary.insert(std::make_pair(key, DSViter->size())); + } else { + nrechitLayerMap[key] += DSViter->size(); + nrechitLayerMap_primary[key] += DSViter->size(); + } + + edmNew::DetSet<SiPixelRecHit>::const_iterator rechitIt; + //loop over rechits for a single detId + for(rechitIt = DSViter->begin(); rechitIt != DSViter->end(); ++rechitIt) { + LocalPoint lp = rechitIt->localPosition(); + Global3DPoint globalPos = geomDetunit->surface().toGlobal(lp); + //in mm + double gx = globalPos.x()*10.; + double gy = globalPos.y()*10.; + double gz = globalPos.z()*10.; + double gr = globalPos.perp()*10.; + //Fill global positions + globalXY_->Fill(gx, gy); + globalRZ_->Fill(gz, gr); + //layer wise histo + layerMEs_[key].clusterSize->Fill(rechitIt->cluster()->size()); + layerMEs_[key].globalPosXY->Fill(gx, gy); + layerMEs_[key].localPosXY->Fill(lp.x(), lp.y()); + + //GetSimHits + const std::vector<SimHitIdpr>& matchedId = associateRecHit.associateHitId(*rechitIt); + //std::cout << "Nmatched SimHits = " << matchedId.size() << ","; + const PSimHit* simhitClosest = 0; + float minx = 10000; + for (unsigned int si = 0; si < simHits.size(); ++si) { + for(edm::PSimHitContainer::const_iterator simhitIt = simHits.at(si)->begin(); + simhitIt != simHits.at(si)->end(); ++simhitIt) { + if(detId.rawId() != simhitIt->detUnitId()) continue; + for(auto& mId : matchedId) { + if(simhitIt->trackId() == mId.first) { + if (!simhitClosest || fabs(simhitIt->localPosition().x() - lp.x()) < minx) { + minx = fabs(simhitIt->localPosition().x() - lp.x()); + simhitClosest = &*simhitIt; + } + } + } + }//end loop over PSimhitcontainers + }//end loop over simHits + if(!simhitClosest) continue; + auto simTrackIt(selectedSimTrackMap.find(simhitClosest->trackId())); + bool isPrimary = false; + //check if simhit is primary + if(simTrackIt != selectedSimTrackMap.end()) isPrimary = Phase2TkUtil::isPrimary(simTrackIt->second, simhitClosest); + Local3DPoint simlp(simhitClosest->localPosition()); + const LocalError& lperr = rechitIt->localPositionError(); + double dx = lp.x() - simlp.x(); + double dy = lp.y() - simlp.y(); + double pullx = 999.; + double pully = 999.; + if (lperr.xx()) + pullx = (lp.x() - simlp.x()) / std::sqrt(lperr.xx()); + if (lperr.yy()) + pully = (lp.y() - simlp.y()) / std::sqrt(lperr.yy()); + float eta = globalPos.eta(); + layerMEs_[key].deltaX->Fill(dx); + layerMEs_[key].deltaY->Fill(dy); + layerMEs_[key].pullX->Fill(pullx); + layerMEs_[key].pullY->Fill(pully); + layerMEs_[key].deltaX_eta->Fill(eta,dx); + layerMEs_[key].deltaY_eta->Fill(eta,dy); + layerMEs_[key].pullX_eta->Fill(eta,pullx); + layerMEs_[key].pullY_eta->Fill(eta,pully); + if(isPrimary) { + layerMEs_[key].deltaX_primary->Fill(dx); + layerMEs_[key].deltaY_primary->Fill(dy); + layerMEs_[key].pullX_primary->Fill(pullx); + layerMEs_[key].pullY_primary->Fill(pully); + } else + nrechitLayerMap_primary[key]--; + }//end loop over rechits of a detId + } //End loop over DetSetVector + + //fill nRecHits per event + numberRecHits_->Fill(nTotrechitsinevt); + //fill nRecHit counter per layer + for(auto& lme : nrechitLayerMap) { + layerMEs_[lme.first].numberRecHits->Fill(lme.second); + layerMEs_[lme.first].numberRecHitsprimary->Fill(nrechitLayerMap_primary[lme.first]); + } +} +// +// -- Book Histograms +// +void Phase2ITValidateRecHit::bookHistograms(DQMStore::IBooker& ibooker, + edm::Run const& iRun, + edm::EventSetup const& iSetup) { + + std::string top_folder = config_.getParameter<std::string>("TopFolderName"); + //std::stringstream folder_name; + + ibooker.cd(); + //edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << folder_name.str(); + std::cout << "Booking Histograms in : " << top_folder << std::endl; + std::string dir = top_folder; + ibooker.setCurrentFolder(dir); + + std::stringstream HistoName; + //Global histos for OT + HistoName.str(""); + HistoName << "NumberRecHits"; + numberRecHits_ = ibooker.book1D(HistoName.str(), HistoName.str(), 50, 0., 0.); + HistoName.str(""); + HistoName << "Global_Position_XY_IT"; + globalXY_ = ibooker.book2D(HistoName.str(), HistoName.str(), 1250, -1250., 1250., 1250, -1250., 1250.); + HistoName.str(""); + HistoName << "Global_Position_RZ_IT"; + globalRZ_ = ibooker.book2D(HistoName.str(), HistoName.str(), 1500, -3000., 3000., 1250., 0., 1250); + + //Now book layer wise histos + + edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher; + edm::ESHandle<TrackerTopology> tTopoHandle; + iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); + + if (theTkDigiGeomWatcher.check(iSetup)) { + edm::ESHandle<TrackerGeometry> geom_handle; + iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geom_handle); + const TrackerGeometry* tGeom = geom_handle.product(); + + for (auto const& det_u : tGeom->detUnits()) { + //Always check TrackerNumberingBuilder before changing this part + if(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB + || det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC) + continue; + unsigned int detId_raw = det_u->geographicalId().rawId(); + std::cout << "Detid:" << detId_raw + <<"\tsubdet=" << det_u->subDetector() + << "\t key=" << Phase2TkUtil::getITHistoId(detId_raw, tTopo) + << std::endl; + bookLayerHistos(ibooker, detId_raw, tTopo, dir); + } + } + +} + +// +// -- Book Layer Histograms +// +void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, + unsigned int det_id, + const TrackerTopology* tTopo, + std::string& subdir) { + + int layer, side; + int idisc {0}; + layer = tTopo->getITPixelLayerNumber(det_id); + if (layer < 0) + return; + std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo); + + //std::map<std::string, RecHitME>::iterator pos = layerMEs_.find(key); + if (layerMEs_.find(key) == layerMEs_.end()) { + if (layer > 100) { + side = layer / 100; + idisc = layer - side * 100; + idisc = (idisc < 3) ? 12 : 345; + } + + bool forDisc12UptoRing10 = (idisc == 12 && tTopo->tidRing(det_id) <= 10) ? true : false; + bool forDisc345UptoRing7 = (idisc == 345 && tTopo->tidRing(det_id) <= 7) ? true : false; + //bool forS = (pixelFlag_) ? false : true; + //this handles the PSP + bool forP = (layer < 4 || (layer > 6 && (forDisc12UptoRing10 || forDisc345UptoRing7))) ? true : false; + + ibooker.cd(); + RecHitME local_histos; + std::ostringstream histoName; + ibooker.setCurrentFolder(subdir+"/"+key); + std::cout<< "Setting subfolder>>>" << subdir << "\t" << key << std::endl; + edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << key; + + histoName.str(""); + histoName << "Number_RecHits"; + local_histos.numberRecHits = ibooker.book1D(histoName.str(), histoName.str(), 50, 0., 0.); + + histoName.str(""); + histoName << "Cluster_Size"; + local_histos.clusterSize = ibooker.book1D(histoName.str(), histoName.str(), 21, -0.5, 20.5); + + histoName.str(""); + histoName << "Globalosition_XY"; + local_histos.globalPosXY = ibooker.book2D(histoName.str(), histoName.str(), 1250, -1250., 1250., 1250, -1250., 1250.); + + histoName.str(""); + histoName << "Local_Position_XY_P" ; + local_histos.localPosXY = ibooker.book2D(histoName.str(), histoName.str(), 500, 0., 0., 500, 0., 0.); + + histoName.str(""); + histoName << "Delta_X"; + local_histos.deltaX = ibooker.book1D(histoName.str(), histoName.str(), 100, -0.02, 0.02); + + histoName.str(""); + histoName << "Delta_Y"; + local_histos.deltaY = ibooker.book1D(histoName.str(), histoName.str(), 100, -0.02, 0.02); + + histoName.str(""); + histoName << "Pull_X"; + local_histos.pullX = ibooker.book1D(histoName.str(), histoName.str(), 100, -4., 4.); + + histoName.str(""); + histoName << "Pull_Y"; + local_histos.pullY = ibooker.book1D(histoName.str(), histoName.str(), 100, -4., 4.); + + histoName.str(""); + histoName << "Delta_X_vs_Eta"; + local_histos.deltaX_eta = ibooker.bookProfile(histoName.str(), histoName.str(), 82, -4.1, 4.1, 100, -0.02, 0.02); + + histoName.str(""); + histoName << "Delta_Y_vs_Eta"; + local_histos.deltaY_eta = ibooker.bookProfile(histoName.str(), histoName.str(), 82, -4.1, 4.1, 100, -0.02, 0.02); + + histoName.str(""); + histoName << "Pull_X_vs_Eta"; + local_histos.pullX_eta = ibooker.bookProfile(histoName.str(), histoName.str(), 82, -4.1, 4.1, 100, -4., 4.); + + histoName.str(""); + histoName << "Pull_Y_vs_Eta"; + local_histos.pullY_eta = ibooker.bookProfile(histoName.str(), histoName.str(), 82, -4.1, 4.1, 100, -4., 4.); + + ibooker.setCurrentFolder(subdir+"/"+key+"/PrimarySimHits"); + //all histos for Primary particles + histoName.str(""); + histoName << "Number_RecHits_matched_PrimarySimTrack_P"; + local_histos.numberRecHitsprimary = ibooker.book1D(histoName.str(), histoName.str(), 50, 0., 0.); + + histoName.str(""); + histoName << "Delta_X_SimHitPrimary"; + local_histos.deltaX_primary = ibooker.book1D(histoName.str(), histoName.str(), 100, -0.02, 0.02); + + histoName.str(""); + histoName << "Delta_Y_SimHitPrimary"; + local_histos.deltaY_primary = ibooker.book1D(histoName.str(), histoName.str(), 100, -0.02, 0.02); + + histoName.str(""); + histoName << "Pull_X_SimHitPrimary"; + local_histos.pullX_primary = ibooker.book1D(histoName.str(), histoName.str(), 100, -3., 3.); + + histoName.str(""); + histoName << "Pull_Y_SimHitPrimary"; + local_histos.pullY_primary = ibooker.book1D(histoName.str(), histoName.str(), 100, -3., 3.); + + layerMEs_.insert(std::make_pair(key, local_histos)); + } +} + +//define this as a plug-in +DEFINE_FWK_MODULE(Phase2ITValidateRecHit); + diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h new file mode 100644 index 0000000000000..f9b28cd9f17bb --- /dev/null +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h @@ -0,0 +1,89 @@ +#ifndef _Validation_SiTrackerPhase2V_Phase2ITValidateRecHit_h +#define _Validation_SiTrackerPhase2V_Phase2ITValidateRecHit_h +#include <iostream> +#include <map> +#include <vector> +#include <algorithm> +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" +#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" +#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" + + +// DQM Histograming +class PixelDigiSimLink; +class SimTrack; +class SimHit; +class TrackerTopology; +class TrackerGeometry; + +class Phase2ITValidateRecHit : public DQMEDAnalyzer { +public: + explicit Phase2ITValidateRecHit(const edm::ParameterSet&); + ~Phase2ITValidateRecHit() override; + void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; + + private: + void fillITHistos(const edm::Event& iEvent, + const TrackerTopology* tTopo, + const TrackerGeometry* tkGeom, + const TrackerHitAssociator& associateRecHit, + const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, + const std::map<unsigned int, SimTrack>& selectedSimTrackMap); + + + void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, const TrackerTopology* tTopo, std::string& subdir); + + edm::ParameterSet config_; + bool pixelFlag_; + TrackerHitAssociator::Config trackerHitAssociatorConfig_; + const double simtrackminpt_; + std::string geomType_; + const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; + const edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; + std::vector<edm::EDGetTokenT<edm::PSimHitContainer> > simHitTokens_; + + + MonitorElement* numberRecHits_; + MonitorElement* globalXY_; + MonitorElement* globalRZ_; + + struct RecHitME { + // use TH1D instead of TH1F to avoid stauration at 2^31 + // above this increments with +1 don't work for float, need double + MonitorElement* numberRecHits = nullptr; + MonitorElement* globalPosXY = nullptr; + MonitorElement* localPosXY = nullptr; + MonitorElement* deltaX = nullptr; + MonitorElement* clusterSize = nullptr; + MonitorElement* deltaY = nullptr; + MonitorElement* pullX = nullptr; + MonitorElement* pullY = nullptr; + MonitorElement* deltaX_eta = nullptr; + MonitorElement* deltaY_eta = nullptr; + MonitorElement* pullX_eta = nullptr; + MonitorElement* pullY_eta = nullptr; + //For rechits matched to simhits from highPT tracks + MonitorElement* numberRecHitsprimary = nullptr; + MonitorElement* pullX_primary; + MonitorElement* pullY_primary; + MonitorElement* deltaX_primary; + MonitorElement* deltaY_primary; + }; + std::map<std::string, RecHitME> layerMEs_; +}; +#endif diff --git a/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py b/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py new file mode 100644 index 0000000000000..2a174e54deffd --- /dev/null +++ b/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py @@ -0,0 +1,37 @@ +import FWCore.ParameterSet.Config as cms + +from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer +rechitValidIT = DQMEDAnalyzer('Phase2TrackerValidateRecHit', + Verbosity = cms.bool(False), + TopFolderName = cms.string("Phase2TrackerRecHitV"), + ITPlotFillingFlag = cms.bool(False), + rechitsIT = cms.InputTag("siPixelRecHits"), + InnerPixelDigiSource = cms.InputTag("simSiPixelDigis","Pixel"), + InnerPixelDigiSimLinkSource = cms.InputTag("simSiPixelDigis", "Pixel"), + PSimHitSource = cms.VInputTag('g4SimHits:TrackerHitsPixelBarrelLowTof', + 'g4SimHits:TrackerHitsPixelBarrelHighTof', + 'g4SimHits:TrackerHitsPixelEndcapLowTof', + 'g4SimHits:TrackerHitsPixelEndcapHighTof', + 'g4SimHits:TrackerHitsTIBLowTof', + 'g4SimHits:TrackerHitsTIBHighTof', + 'g4SimHits:TrackerHitsTIDLowTof', + 'g4SimHits:TrackerHitsTIDHighTof', + 'g4SimHits:TrackerHitsTOBLowTof', + 'g4SimHits:TrackerHitsTOBHighTof', + 'g4SimHits:TrackerHitsTECLowTof', + 'g4SimHits:TrackerHitsTECHighTof'), + SimTrackSource = cms.InputTag("g4SimHits"), + SimVertexSource = cms.InputTag("g4SimHits"), + usePhase2Tracker = cms.bool(True),#these are used by simHit assoc. + associatePixel = cms.bool(True), + associateRecoTracks = cms.bool(False), + associateStrip = cms.bool(False), + associateHitbySimTrack = cms.bool(True), + pixelSimLinkSrc = cms.InputTag("simSiPixelDigis","Pixel"), + ROUList = cms.vstring('g4SimHitsTrackerHitsPixelBarrelLowTof', + 'g4SimHitsTrackerHitsPixelBarrelHighTof', + 'g4SimHitsTrackerHitsPixelEndcapLowTof', + 'g4SimHitsTrackerHitsPixelEndcapHighTof', + ), + +) diff --git a/Validation/SiTrackerPhase2V/test/ValidateRecHit_TrackerPhase2Standalone_cfg.py b/Validation/SiTrackerPhase2V/test/ValidateRecHit_TrackerPhase2Standalone_cfg.py new file mode 100644 index 0000000000000..b8d0126e3a8b1 --- /dev/null +++ b/Validation/SiTrackerPhase2V/test/ValidateRecHit_TrackerPhase2Standalone_cfg.py @@ -0,0 +1,98 @@ +import FWCore.ParameterSet.Config as cms +from Configuration.Eras.Era_Phase2_cff import Phase2 +process = cms.Process('recHitTest',Phase2) + +#process.MessageLogger = cms.Service("MessageLogger", +# debugModules = cms.untracked.vstring('siPixelRawData'), +# destinations = cms.untracked.vstring("cout"), +# cout = cms.untracked.PSet( +# threshold = cms.untracked.string('ERROR') +# ) +#) +process.load('Configuration.StandardSequences.Services_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.RawToDigi_cff') +process.load('Configuration.StandardSequences.L1Reco_cff') +process.load('Configuration.StandardSequences.Reconstruction_cff') +process.load('Configuration.StandardSequences.RecoSim_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10) +) + +# Other statements +from Configuration.AlCa.GlobalTag import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T15', '') + +# list of files + +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( + 'file:/eos/cms/store/relval/CMSSW_11_2_0_pre5/RelValTTbar_14TeV/GEN-SIM-RECO/PU25ns_110X_mcRun4_realistic_v3_2026D49PU200-v1/20000/CA4DC8DF-AAEC-DA43-931B-BF234D979A9D.root' + ) +) +# Production Info +process.configurationMetadata = cms.untracked.PSet( + version = cms.untracked.string('$Revision: 1.19 $'), + annotation = cms.untracked.string('step1 nevts:1'), + name = cms.untracked.string('Applications') +) +# Output definition + +process.DQMoutput = cms.OutputModule("PoolOutputModule", + splitLevel = cms.untracked.int32(0), + outputCommands = process.DQMEventContent.outputCommands, + fileName = cms.untracked.string('step1_rechitTest.root'), + dataset = cms.untracked.PSet( + filterName = cms.untracked.string(''), + dataTier = cms.untracked.string('') + ) +) + +process.load('RecoLocalTracker.SiPhase2Clusterizer.phase2TrackerClusterizer_cfi') +process.load('RecoLocalTracker.Phase2TrackerRecHits.Phase2StripCPEESProducer_cfi') +process.load('RecoLocalTracker.Phase2TrackerRecHits.Phase2TrackerRecHits_cfi') +process.load('RecoLocalTracker.SiPixelRecHits.SiPixelRecHits_cfi') +#process.rechits_step = cms.Path(process.siPhase2RecHits * process.siPixelRecHits) +process.rechits_step = cms.Path(process.siPixelRecHits) + + +#Setup FWK for multithreaded +process.options.numberOfThreads=cms.untracked.uint32(8) +process.options.numberOfStreams=cms.untracked.uint32(0) +process.options.numberOfConcurrentLuminosityBlocks=cms.untracked.uint32(1) + +#process.load('Validation.SiTrackerPhase2V.Phase2OTValidateRecHit_cfi') +process.load('Validation.SiTrackerPhase2V.Phase2ITValidateRecHit_cfi') + +#process.rechitval_seq = cms.Sequence(process.rechitValidIT) + +process.load('DQMServices.Components.DQMEventInfo_cfi') +#process.dqmEnv.subSystemFolder = cms.untracked.string('Ph2Tk') +process.dqm_comm = cms.Sequence(process.dqmEnv) + +# Path and EndPath definitions +process.endjob_step = cms.EndPath(process.endOfProcess) +process.DQMoutput_step = cms.EndPath(process.DQMoutput) +''' +process.Timing = cms.Service("Timing", + summaryOnly = cms.untracked.bool(False), + useJobReport = cms.untracked.bool(True) +) + +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck", + ignoreTotal = cms.untracked.int32(1), + moduleMemorySummary = cms.untracked.bool(True) +) +''' +process.p = cms.Path(process.siPixelRecHits + #*process.siPhase2RecHits + #* process.rechitValidIT + #* process.rechitValidOT + * process.dqm_comm ) From 98177f2aa35e9b162123ac07c00aba1a668f8575 Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Mon, 5 Oct 2020 13:29:56 +0200 Subject: [PATCH 444/778] adding phase2 IT rechit dqm module --- DQM/SiTrackerPhase2/plugins/BuildFile.xml | 4 +- .../plugins/Phase2ITMonitorRecHit.cc | 266 +++++++++++++++ .../plugins/Phase2ITMonitorRecHit.h | 68 ++++ .../python/Phase2ITMonitorRecHit_cfi.py | 120 +++++++ .../python/Phase2TrackerDQMFirstStep_cff.py | 7 +- .../interface/Phase2ValidationUtil.h | 71 ---- .../plugins/Phase2ITValidateRecHit.cc | 314 ++++++------------ .../plugins/Phase2ITValidateRecHit.h | 34 +- .../python/Phase2ITValidateRecHit_cfi.py | 99 +++++- .../Phase2TrackerValidationFirstStep_cff.py | 7 +- ...idateRecHit_TrackerPhase2Standalone_cfg.py | 2 +- 11 files changed, 683 insertions(+), 309 deletions(-) create mode 100644 DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc create mode 100644 DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h create mode 100644 DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cfi.py delete mode 100644 Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h diff --git a/DQM/SiTrackerPhase2/plugins/BuildFile.xml b/DQM/SiTrackerPhase2/plugins/BuildFile.xml index 5d433e7811726..ffc0d608890b5 100644 --- a/DQM/SiTrackerPhase2/plugins/BuildFile.xml +++ b/DQM/SiTrackerPhase2/plugins/BuildFile.xml @@ -1,12 +1,14 @@ <use name="FWCore/Framework"/> <use name="FWCore/ParameterSet"/> <use name="DataFormats/SiPixelDigi"/> +<use name="DataFormats/Common"/> <use name="DataFormats/DetId"/> +<use name="DataFormats/TrackerRecHit2D"/> <use name="Geometry/Records"/> <use name="Geometry/CommonDetUnit"/> <use name="Geometry/TrackerGeometryBuilder"/> <use name="DQMServices/Core"/> -<use name="DataFormats/Common"/> <use name="boost_system"/> <use name="rootcling"/> <flags EDM_PLUGIN="1"/> +<flags CXXFLAGS="-g"/> diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc new file mode 100644 index 0000000000000..d69214993394b --- /dev/null +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc @@ -0,0 +1,266 @@ +// Package: Phase2ITMonitorRecHit +// Class: Phase2ITMonitorRecHit +// +/**\class Phase2ITMonitorRecHit Phase2ITMonitorRecHit.cc + Description: Plugin for Phase2 RecHit validation +*/ +// +// Author: Shubhi Parolia, Suvankar Roy Chowdhury +// Date: July 2020 +// +// system include files +#include <memory> +#include "DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h" +#include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Framework/interface/ESWatcher.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/CommonDetUnit/interface/TrackerGeomDet.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/GeometrySurface/interface/LocalError.h" +#include "DataFormats/GeometryVector/interface/LocalPoint.h" +// DQM Histograming +#include "DQMServices/Core/interface/MonitorElement.h" +// +// constructors +// +Phase2ITMonitorRecHit::Phase2ITMonitorRecHit(const edm::ParameterSet& iConfig): + config_(iConfig), + tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))) +{ + edm::LogInfo("Phase2ITMonitorRecHit") << ">>> Construct Phase2ITMonitorRecHit "; +} + +Phase2ITMonitorRecHit::~Phase2ITMonitorRecHit() { + edm::LogInfo("Phase2ITMonitorRecHit") << ">>> Destroy Phase2ITMonitorRecHit "; +} +// -- Analyze +void Phase2ITMonitorRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { + + // Get the geometry + edm::ESHandle<TrackerGeometry> geomHandle; + iSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); + const TrackerGeometry* tkGeom = &(*geomHandle); + + edm::ESHandle<TrackerTopology> tTopoHandle; + iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); + const TrackerTopology* tTopo = tTopoHandle.product(); + + fillITHistos(iEvent, tTopo, tkGeom); +} + +void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent, + const TrackerTopology* tTopo, + const TrackerGeometry* tkGeom) { + // Get the RecHits + edm::Handle<SiPixelRecHitCollection> rechits; + iEvent.getByToken(tokenRecHitsIT_, rechits); + if(!rechits.isValid()) return; + std::map<std::string, unsigned int> nrechitLayerMap; + unsigned long int nTotrechitsinevt = 0; + // Loop over modules + SiPixelRecHitCollection::const_iterator DSViter; + for (DSViter = rechits->begin(); DSViter != rechits->end(); ++DSViter) { + // Get the detector id + unsigned int rawid(DSViter->detId()); + DetId detId(rawid); + // Get the geomdet + const GeomDetUnit* geomDetunit(tkGeom->idToDetUnit(detId)); + if (!geomDetunit) + continue; + std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo); + nTotrechitsinevt += DSViter->size(); + if(nrechitLayerMap.find(key) == nrechitLayerMap.end()) { + nrechitLayerMap.insert(std::make_pair(key, DSViter->size())); + } else { + nrechitLayerMap[key] += DSViter->size(); + } + + edmNew::DetSet<SiPixelRecHit>::const_iterator rechitIt; + //loop over rechits for a single detId + for(rechitIt = DSViter->begin(); rechitIt != DSViter->end(); ++rechitIt) { + LocalPoint lp = rechitIt->localPosition(); + Global3DPoint globalPos = geomDetunit->surface().toGlobal(lp); + //in mm + double gx = globalPos.x()*10.; + double gy = globalPos.y()*10.; + double gz = globalPos.z()*10.; + double gr = globalPos.perp()*10.; + //Fill global positions + if(geomDetunit->subDetector() == GeomDetEnumerators::SubDetector::P2PXB) { + globalXY_barrel_->Fill(gx, gy); + globalRZ_barrel_->Fill(gz, gr); + } else if(geomDetunit->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC) { + globalXY_endcap_->Fill(gx, gy); + globalRZ_endcap_->Fill(gz, gr); + } + //layer wise histo + if(layerMEs_[key].clusterSizeX) layerMEs_[key].clusterSizeX->Fill(rechitIt->cluster()->sizeX()); + if(layerMEs_[key].clusterSizeY) layerMEs_[key].clusterSizeY->Fill(rechitIt->cluster()->sizeY()); + if(layerMEs_[key].globalPosXY) layerMEs_[key].globalPosXY->Fill(gx, gy); + if(layerMEs_[key].globalPosRZ) layerMEs_[key].globalPosRZ->Fill(gz, gr); + if(layerMEs_[key].localPosXY) layerMEs_[key].localPosXY->Fill(lp.x(), lp.y()); + if(layerMEs_[key].posX) layerMEs_[key].posX->Fill(lp.x()); + if(layerMEs_[key].posY) layerMEs_[key].posX->Fill(lp.y()); + if(layerMEs_[key].posX) layerMEs_[key].poserrX->Fill(rechitIt->localPositionError().xx()); + if(layerMEs_[key].posY) layerMEs_[key].poserrY->Fill(rechitIt->localPositionError().yy()); + }//end loop over rechits of a detId + } //End loop over DetSetVector + + //fill nRecHits per event + numberRecHits_->Fill(nTotrechitsinevt); + //fill nRecHit counter per layer + for(auto& lme : nrechitLayerMap) + if(layerMEs_[lme.first].numberRecHits) + layerMEs_[lme.first].numberRecHits->Fill(lme.second); +} +void Phase2ITMonitorRecHit::bookHistograms(DQMStore::IBooker& ibooker, + edm::Run const& iRun, + edm::EventSetup const& iSetup) { + + std::string top_folder = config_.getParameter<std::string>("TopFolderName"); + ibooker.cd(); + edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << top_folder; + std::string dir = top_folder; + ibooker.setCurrentFolder(dir); + std::stringstream HistoName; + //Global histos for IT + HistoName.str(""); + HistoName << "NumberRecHits"; + numberRecHits_ = Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalNumberRecHits"), + HistoName.str(), + ibooker); + HistoName.str(""); + HistoName << "Global_Position_XY_IT_barrel"; + globalXY_barrel_ = Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXB"), + HistoName.str(), + ibooker); + HistoName.str(""); + HistoName << "Global_Position_RZ_IT_barrel"; + globalRZ_barrel_ = Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXB"), + HistoName.str(), + ibooker); + HistoName.str(""); + HistoName << "Global_Position_XY_IT_endcap"; + globalXY_endcap_ = Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXEC"), + HistoName.str(), + ibooker); + HistoName.str(""); + HistoName << "Global_Position_RZ_IT_endcap"; + globalRZ_endcap_ = Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXEC"), + HistoName.str(), + ibooker); + + //Now book layer wise histos + edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher; + edm::ESHandle<TrackerTopology> tTopoHandle; + iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); + const TrackerTopology* const tTopo = tTopoHandle.product(); + if (theTkDigiGeomWatcher.check(iSetup)) { + edm::ESHandle<TrackerGeometry> geom_handle; + iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geom_handle); + const TrackerGeometry* tGeom = geom_handle.product(); + for (auto const& det_u : tGeom->detUnits()) { + //Always check TrackerNumberingBuilder before changing this part + if(!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB + || det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC)) + continue; + unsigned int detId_raw = det_u->geographicalId().rawId(); + edm::LogInfo("Phase2ITMonitorRecHit") << "Detid:" << detId_raw + <<"\tsubdet=" << det_u->subDetector() + << "\t key=" << Phase2TkUtil::getITHistoId(detId_raw, tTopo) + << std::endl; + bookLayerHistos(ibooker, detId_raw, tTopo, dir); + } + } +} +// -- Book Layer Histograms +void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, + unsigned int det_id, + const TrackerTopology* tTopo, + std::string& subdir) { + std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo); + if(key.empty()) return; + if (layerMEs_.find(key) == layerMEs_.end()) { + ibooker.cd(); + RecHitME local_histos; + std::ostringstream histoName; + ibooker.setCurrentFolder(subdir+"/"+key); + std::cout<< "Setting subfolder>>>" << subdir << "\t" << key << std::endl; + edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << (subdir+"/"+key); + histoName.str(""); + histoName << "Number_RecHits"; + local_histos.numberRecHits = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalNumberRecHits"), + histoName.str(), + ibooker); + histoName.str(""); + histoName << "RecHit_X"; + local_histos.posX = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosX"), + histoName.str(), + ibooker); + + histoName.str(""); + histoName << "RecHit_Y"; + local_histos.posY = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosY"), + histoName.str(), + ibooker); + + histoName.str(""); + histoName << "RecHit_X_error"; + local_histos.poserrX = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosErrorX"), + histoName.str(), + ibooker); + + histoName.str(""); + histoName << "RecHit_Y_error"; + local_histos.poserrY = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosErrorY"), + histoName.str(), + ibooker); + + histoName.str(""); + histoName << "Cluster_SizeX"; + local_histos.clusterSizeX = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalClusterSizeX"), + histoName.str(), + ibooker); + histoName.str(""); + histoName << "Cluster_SizeY"; + local_histos.clusterSizeY = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalClusterSizeY"), + histoName.str(), + ibooker); + + histoName.str(""); + histoName << "Global_Position_XY"; + local_histos.globalPosXY = + Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_perlayer"), + histoName.str(), + ibooker); + + histoName.str(""); + histoName << "Global_Position_RZ"; + local_histos.globalPosRZ = + Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_perlayer"), + histoName.str(), + ibooker); + histoName.str(""); + histoName << "Local_Position_XY" ; + local_histos.localPosXY = + Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("LocalPositionXY"), + histoName.str(), + ibooker); + layerMEs_.insert(std::make_pair(key, local_histos)); + } +} +//define this as a plug-in +DEFINE_FWK_MODULE(Phase2ITMonitorRecHit); diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h new file mode 100644 index 0000000000000..d1d709c68e4c0 --- /dev/null +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h @@ -0,0 +1,68 @@ +#ifndef _Validation_SiTrackerPhase2V_Phase2ITMonitorRecHit_h +#define _Validation_SiTrackerPhase2V_Phase2ITMonitorRecHit_h +#include <iostream> +#include <map> +#include <vector> +#include <algorithm> +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" +#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" + + +// DQM Histograming +class TrackerTopology; +class TrackerGeometry; + +class Phase2ITMonitorRecHit : public DQMEDAnalyzer { +public: + explicit Phase2ITMonitorRecHit(const edm::ParameterSet&); + ~Phase2ITMonitorRecHit() override; + void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; + + private: + void fillITHistos(const edm::Event& iEvent, + const TrackerTopology* tTopo, + const TrackerGeometry* tkGeom); + + void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, const TrackerTopology* tTopo, std::string& subdir); + + edm::ParameterSet config_; + std::string geomType_; + const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; + + MonitorElement* numberRecHits_; + MonitorElement* globalXY_barrel_; + MonitorElement* globalXY_endcap_; + MonitorElement* globalRZ_barrel_; + MonitorElement* globalRZ_endcap_; + + struct RecHitME { + MonitorElement* numberRecHits = nullptr; + MonitorElement* globalPosXY = nullptr; + MonitorElement* globalPosRZ = nullptr; + MonitorElement* localPosXY = nullptr; + MonitorElement* posX = nullptr; + MonitorElement* posY = nullptr; + MonitorElement* poserrX = nullptr; + MonitorElement* poserrY = nullptr; + MonitorElement* clusterSizeX = nullptr; + MonitorElement* clusterSizeY = nullptr; + + }; + std::map<std::string, RecHitME> layerMEs_; +}; +#endif diff --git a/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cfi.py b/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cfi.py new file mode 100644 index 0000000000000..44febc6bbf1d9 --- /dev/null +++ b/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cfi.py @@ -0,0 +1,120 @@ +import FWCore.ParameterSet.Config as cms + +from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer +rechitMonitorIT = DQMEDAnalyzer('Phase2ITMonitorRecHit', + Verbosity = cms.bool(False), + TopFolderName = cms.string("TrackerPhase2ITRecHit"), + rechitsSrc = cms.InputTag("siPixelRecHits"), + GlobalNumberRecHits = cms.PSet( + NxBins = cms.int32(50), + xmin = cms.double(0.), + xmax = cms.double(0.), + switch = cms.bool(True) + ), + GlobalPositionXY_PXB = cms.PSet( + NxBins = cms.int32(600), + xmin = cms.double(-300.), + xmax = cms.double(300.), + NyBins = cms.int32(600), + ymin = cms.double(-300.), + ymax = cms.double(300.), + switch = cms.bool(True) + ), + GlobalPositionXY_PXEC = cms.PSet( + NxBins = cms.int32(600), + xmin = cms.double(-300.), + xmax = cms.double(300.), + NyBins = cms.int32(600), + ymin = cms.double(-300.), + ymax = cms.double(300.), + switch = cms.bool(True) + ), + GlobalPositionRZ_PXB = cms.PSet( + NxBins = cms.int32(1500), + xmin = cms.double(-3000.), + xmax = cms.double(3000.), + NyBins = cms.int32(300), + ymin = cms.double(0.), + ymax = cms.double(300.), + switch = cms.bool(True) + ), + GlobalPositionRZ_PXEC = cms.PSet( + NxBins = cms.int32(1500), + xmin = cms.double(-3000.), + xmax = cms.double(3000.), + NyBins = cms.int32(300), + ymin = cms.double(0.), + ymax = cms.double(300.), + switch = cms.bool(True) + ), + LocalNumberRecHits = cms.PSet( + NxBins = cms.int32(50), + xmin = cms.double(0.), + xmax = cms.double(0.), + switch = cms.bool(True) + ), + RecHitPosX = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(-2.5), + xmax = cms.double(2.5), + switch = cms.bool(True) + ), + RecHitPosY = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(-2.5), + xmax = cms.double(2.5), + switch = cms.bool(True) + ), + RecHitPosErrorX = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(0.), + xmax = cms.double(0.2), + switch = cms.bool(True) + ), + RecHitPosErrorY = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(0.), + xmax = cms.double(0.2), + switch = cms.bool(True) + ), + LocalClusterSizeX = cms.PSet( + NxBins = cms.int32(21), + xmin = cms.double(-0.5), + xmax = cms.double(20.5), + switch = cms.bool(True) + ), + LocalClusterSizeY = cms.PSet( + NxBins = cms.int32(21), + xmin = cms.double(-0.5), + xmax = cms.double(20.5), + switch = cms.bool(True) + ), + GlobalPositionXY_perlayer = cms.PSet( + NxBins = cms.int32(600), + xmin = cms.double(-300.), + xmax = cms.double(300.), + NyBins = cms.int32(600), + ymin = cms.double(-300.), + ymax = cms.double(300.), + switch = cms.bool(True) + ), + GlobalPositionRZ_perlayer = cms.PSet( + NxBins = cms.int32(1500), + xmin = cms.double(-3000.), + xmax = cms.double(3000.), + NyBins = cms.int32(300), + ymin = cms.double(0.), + ymax = cms.double(300.), + switch = cms.bool(True) + ), + LocalPositionXY = cms.PSet( + NxBins = cms.int32(500), + xmin = cms.double(0.), + xmax = cms.double(0.), + NyBins = cms.int32(500), + ymin = cms.double(0.), + ymax = cms.double(0.), + switch = cms.bool(True) + ), + +) diff --git a/DQM/SiTrackerPhase2/python/Phase2TrackerDQMFirstStep_cff.py b/DQM/SiTrackerPhase2/python/Phase2TrackerDQMFirstStep_cff.py index 9e0540cdc71f0..9a5841d2e45ff 100644 --- a/DQM/SiTrackerPhase2/python/Phase2TrackerDQMFirstStep_cff.py +++ b/DQM/SiTrackerPhase2/python/Phase2TrackerDQMFirstStep_cff.py @@ -1,7 +1,8 @@ import FWCore.ParameterSet.Config as cms from DQM.SiTrackerPhase2.Phase2TrackerMonitorDigi_cff import * +from DQM.SiTrackerPhase2.Phase2ITMonitorRecHit_cfi import * -trackerphase2DQMSource = cms.Sequence( - pixDigiMon - + otDigiMon +trackerphase2DQMSource = cms.Sequence( pixDigiMon + + otDigiMon + +rechitMonitorIT ) diff --git a/Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h b/Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h deleted file mode 100644 index 9d0bbd599cab8..0000000000000 --- a/Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef _Validation_SiTrackerPhase2V_Phase2TrackierValidationUtil_h -#define _Validation_SiTrackerPhase2V_Phase2TrackierValidationUtil_h -#include "SimDataFormats/TrackingHit/interface/PSimHit.h" -#include "SimDataFormats/Track/interface/SimTrack.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include<string> -#include<sstream> - -namespace Phase2TkUtil { - -bool isPrimary(const SimTrack& simTrk, const PSimHit* simHit){ - bool retval = false; - unsigned int trkId = simTrk.trackId(); - if (trkId != simHit->trackId()) - return retval; - int vtxIndex = simTrk.vertIndex(); - int ptype = simHit->processType(); - if ((vtxIndex == 0) && (ptype == 0)) - return true; - return false; -} - -std::string getITHistoId(uint32_t det_id, const TrackerTopology* tTopo) { - std::string Disc; - std::ostringstream fname1; - int layer = tTopo->getITPixelLayerNumber(det_id); - - if(layer < 0) - return ""; - if (layer < 100) { - fname1 << "Barrel/"; - fname1 << "Layer" << layer; - fname1 << ""; - } else { - int side = tTopo->pxfSide(det_id); - fname1 << "EndCap_Side" << side << "/"; - int disc = tTopo->pxfDisk(det_id); - Disc = (disc < 9) ? "EPix" : "FPix";; - fname1 << Disc << "/"; - int ring = tTopo->pxfBlade(det_id); - fname1 << "Ring" << ring; - } - return fname1.str(); -} - -std::string getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo) { - std::string Disc; - std::ostringstream fname1; - int layer = tTopo->getOTLayerNumber(det_id); - - if(layer < 0) - return ""; - if (layer < 100) { - fname1 << "Barrel/"; - fname1 << "Layer" << layer; - fname1 << ""; - } else { - int side = layer / 100; - fname1 << "EndCap_Side" << side << "/"; - int disc = layer - side * 100; - Disc = (disc < 3) ? "TEDD_1" : "TEDD_2"; - fname1 << Disc << "/"; - int ring = tTopo->tidRing(det_id); - fname1 << "Ring" << ring; - } - return fname1.str(); -} - -} - -#endif diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc index 46d9284a8750c..6567d20512a30 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc @@ -11,7 +11,8 @@ // system include files #include <memory> #include "Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h" -#include "Validation/SiTrackerPhase2V/interface/Phase2ValidationUtil.h" +#include "Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h" +#include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Framework/interface/ESWatcher.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" @@ -33,36 +34,21 @@ #include "SimDataFormats/Vertex/interface/SimVertexContainer.h" // DQM Histograming #include "DQMServices/Core/interface/MonitorElement.h" -// -// constructors -// -Phase2ITValidateRecHit::Phase2ITValidateRecHit(const edm::ParameterSet& iConfig): - config_(iConfig), - trackerHitAssociatorConfig_(iConfig, consumesCollector()), - simtrackminpt_(iConfig.getParameter<double>("SimTrackMinPt")), - tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))), - simTracksToken_(consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("simTracksSrc"))) -{ +Phase2ITValidateRecHit::Phase2ITValidateRecHit(const edm::ParameterSet& iConfig) + : config_(iConfig), + trackerHitAssociatorConfig_(iConfig, consumesCollector()), + simtrackminpt_(iConfig.getParameter<double>("SimTrackMinPt")), + tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))), + simTracksToken_(consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("simTracksSrc"))) { edm::LogInfo("Phase2ITValidateRecHit") << ">>> Construct Phase2ITValidateRecHit "; - for (const auto& itag : config_.getParameter<std::vector<edm::InputTag> >("PSimHitSource")) + for (const auto& itag : config_.getParameter<std::vector<edm::InputTag>>("PSimHitSource")) simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag)); } - -// -// destructor // Phase2ITValidateRecHit::~Phase2ITValidateRecHit() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) edm::LogInfo("Phase2ITValidateRecHit") << ">>> Destroy Phase2ITValidateRecHit "; } -// -// -- DQM Begin Run -// -// -- Analyze -// void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - // Get the geometry edm::ESHandle<TrackerGeometry> geomHandle; iSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); @@ -95,21 +81,20 @@ void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventS fillITHistos(iEvent, tTopo, tkGeom, associateRecHit, simHits, selectedSimTrackMap); } -void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, - const TrackerTopology* tTopo, - const TrackerGeometry* tkGeom, - const TrackerHitAssociator& associateRecHit, - const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, - const std::map<unsigned int, SimTrack>& selectedSimTrackMap) { +void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, + const TrackerTopology* tTopo, + const TrackerGeometry* tkGeom, + const TrackerHitAssociator& associateRecHit, + const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, + const std::map<unsigned int, SimTrack>& selectedSimTrackMap) { // Get the RecHits edm::Handle<SiPixelRecHitCollection> rechits; iEvent.getByToken(tokenRecHitsIT_, rechits); - if(!rechits.isValid()) return; - std::map<std::string, unsigned int> nrechitLayerMap; - std::map<std::string, unsigned int> nrechitLayerMap_primary; - unsigned long int nTotrechitsinevt = 0; + if (!rechits.isValid()) + return; + std::map<std::string, unsigned int> nrechitLayerMap_primary; // Loop over modules - SiPixelRecHitCollection::const_iterator DSViter; + SiPixelRecHitCollection::const_iterator DSViter; for (DSViter = rechits->begin(); DSViter != rechits->end(); ++DSViter) { // Get the detector unit's id unsigned int rawid(DSViter->detId()); @@ -120,91 +105,74 @@ void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, continue; // determine the detector we are in std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo); - nTotrechitsinevt += DSViter->size(); - if(nrechitLayerMap.find(key) == nrechitLayerMap.end()) { - nrechitLayerMap.insert(std::make_pair(key, DSViter->size())); - nrechitLayerMap_primary.insert(std::make_pair(key, DSViter->size())); + if (nrechitLayerMap_primary.find(key) == nrechitLayerMap_primary.end()) { + nrechitLayerMap_primary.insert(std::make_pair(key, DSViter->size())); } else { - nrechitLayerMap[key] += DSViter->size(); nrechitLayerMap_primary[key] += DSViter->size(); } - + edmNew::DetSet<SiPixelRecHit>::const_iterator rechitIt; //loop over rechits for a single detId - for(rechitIt = DSViter->begin(); rechitIt != DSViter->end(); ++rechitIt) { - LocalPoint lp = rechitIt->localPosition(); - Global3DPoint globalPos = geomDetunit->surface().toGlobal(lp); - //in mm - double gx = globalPos.x()*10.; - double gy = globalPos.y()*10.; - double gz = globalPos.z()*10.; - double gr = globalPos.perp()*10.; - //Fill global positions - globalXY_->Fill(gx, gy); - globalRZ_->Fill(gz, gr); - //layer wise histo - layerMEs_[key].clusterSize->Fill(rechitIt->cluster()->size()); - layerMEs_[key].globalPosXY->Fill(gx, gy); - layerMEs_[key].localPosXY->Fill(lp.x(), lp.y()); - + for (rechitIt = DSViter->begin(); rechitIt != DSViter->end(); ++rechitIt) { //GetSimHits const std::vector<SimHitIdpr>& matchedId = associateRecHit.associateHitId(*rechitIt); - //std::cout << "Nmatched SimHits = " << matchedId.size() << ","; - const PSimHit* simhitClosest = 0; + const PSimHit* simhitClosest = nullptr; float minx = 10000; + LocalPoint lp = rechitIt->localPosition(); for (unsigned int si = 0; si < simHits.size(); ++si) { - for(edm::PSimHitContainer::const_iterator simhitIt = simHits.at(si)->begin(); - simhitIt != simHits.at(si)->end(); ++simhitIt) { - if(detId.rawId() != simhitIt->detUnitId()) continue; - for(auto& mId : matchedId) { - if(simhitIt->trackId() == mId.first) { - if (!simhitClosest || fabs(simhitIt->localPosition().x() - lp.x()) < minx) { - minx = fabs(simhitIt->localPosition().x() - lp.x()); - simhitClosest = &*simhitIt; - } - } - } - }//end loop over PSimhitcontainers - }//end loop over simHits - if(!simhitClosest) continue; + for (edm::PSimHitContainer::const_iterator simhitIt = simHits.at(si)->begin(); + simhitIt != simHits.at(si)->end(); + ++simhitIt) { + if (detId.rawId() != simhitIt->detUnitId()) + continue; + for (auto& mId : matchedId) { + if (simhitIt->trackId() == mId.first) { + if (!simhitClosest || fabs(simhitIt->localPosition().x() - lp.x()) < minx) { + minx = fabs(simhitIt->localPosition().x() - lp.x()); + simhitClosest = &*simhitIt; + } + } + } + } //end loop over PSimhitcontainers + } //end loop over simHits + if (!simhitClosest) + continue; auto simTrackIt(selectedSimTrackMap.find(simhitClosest->trackId())); bool isPrimary = false; //check if simhit is primary - if(simTrackIt != selectedSimTrackMap.end()) isPrimary = Phase2TkUtil::isPrimary(simTrackIt->second, simhitClosest); + if (simTrackIt != selectedSimTrackMap.end()) + isPrimary = Phase2TkUtil::isPrimary(simTrackIt->second, simhitClosest); Local3DPoint simlp(simhitClosest->localPosition()); const LocalError& lperr = rechitIt->localPositionError(); double dx = lp.x() - simlp.x(); double dy = lp.y() - simlp.y(); double pullx = 999.; double pully = 999.; - if (lperr.xx()) - pullx = (lp.x() - simlp.x()) / std::sqrt(lperr.xx()); - if (lperr.yy()) - pully = (lp.y() - simlp.y()) / std::sqrt(lperr.yy()); - float eta = globalPos.eta(); + if (lperr.xx()) + pullx = (lp.x() - simlp.x()) / std::sqrt(lperr.xx()); + if (lperr.yy()) + pully = (lp.y() - simlp.y()) / std::sqrt(lperr.yy()); + float eta = geomDetunit->surface().toGlobal(lp).eta(); layerMEs_[key].deltaX->Fill(dx); layerMEs_[key].deltaY->Fill(dy); layerMEs_[key].pullX->Fill(pullx); layerMEs_[key].pullY->Fill(pully); - layerMEs_[key].deltaX_eta->Fill(eta,dx); - layerMEs_[key].deltaY_eta->Fill(eta,dy); - layerMEs_[key].pullX_eta->Fill(eta,pullx); - layerMEs_[key].pullY_eta->Fill(eta,pully); - if(isPrimary) { - layerMEs_[key].deltaX_primary->Fill(dx); - layerMEs_[key].deltaY_primary->Fill(dy); - layerMEs_[key].pullX_primary->Fill(pullx); - layerMEs_[key].pullY_primary->Fill(pully); - } else - nrechitLayerMap_primary[key]--; - }//end loop over rechits of a detId - } //End loop over DetSetVector - - //fill nRecHits per event - numberRecHits_->Fill(nTotrechitsinevt); + layerMEs_[key].deltaX_eta->Fill(eta, dx); + layerMEs_[key].deltaY_eta->Fill(eta, dy); + layerMEs_[key].pullX_eta->Fill(eta, pullx); + layerMEs_[key].pullY_eta->Fill(eta, pully); + if (isPrimary) { + layerMEs_[key].deltaX_primary->Fill(dx); + layerMEs_[key].deltaY_primary->Fill(dy); + layerMEs_[key].pullX_primary->Fill(pullx); + layerMEs_[key].pullY_primary->Fill(pully); + } else + nrechitLayerMap_primary[key]--; + } //end loop over rechits of a detId + } //End loop over DetSetVector + //fill nRecHit counter per layer - for(auto& lme : nrechitLayerMap) { - layerMEs_[lme.first].numberRecHits->Fill(lme.second); + for (auto& lme : nrechitLayerMap_primary) { layerMEs_[lme.first].numberRecHitsprimary->Fill(nrechitLayerMap_primary[lme.first]); } } @@ -212,168 +180,102 @@ void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, // -- Book Histograms // void Phase2ITValidateRecHit::bookHistograms(DQMStore::IBooker& ibooker, - edm::Run const& iRun, - edm::EventSetup const& iSetup) { - + edm::Run const& iRun, + edm::EventSetup const& iSetup) { std::string top_folder = config_.getParameter<std::string>("TopFolderName"); - //std::stringstream folder_name; - - ibooker.cd(); - //edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << folder_name.str(); - std::cout << "Booking Histograms in : " << top_folder << std::endl; - std::string dir = top_folder; - ibooker.setCurrentFolder(dir); - - std::stringstream HistoName; - //Global histos for OT - HistoName.str(""); - HistoName << "NumberRecHits"; - numberRecHits_ = ibooker.book1D(HistoName.str(), HistoName.str(), 50, 0., 0.); - HistoName.str(""); - HistoName << "Global_Position_XY_IT"; - globalXY_ = ibooker.book2D(HistoName.str(), HistoName.str(), 1250, -1250., 1250., 1250, -1250., 1250.); - HistoName.str(""); - HistoName << "Global_Position_RZ_IT"; - globalRZ_ = ibooker.book2D(HistoName.str(), HistoName.str(), 1500, -3000., 3000., 1250., 0., 1250); - - //Now book layer wise histos - + edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << top_folder; edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher; edm::ESHandle<TrackerTopology> tTopoHandle; iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); const TrackerTopology* const tTopo = tTopoHandle.product(); - if (theTkDigiGeomWatcher.check(iSetup)) { edm::ESHandle<TrackerGeometry> geom_handle; iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geom_handle); const TrackerGeometry* tGeom = geom_handle.product(); - for (auto const& det_u : tGeom->detUnits()) { //Always check TrackerNumberingBuilder before changing this part - if(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB - || det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC) - continue; + if (!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB || + det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC)) + continue; unsigned int detId_raw = det_u->geographicalId().rawId(); - std::cout << "Detid:" << detId_raw - <<"\tsubdet=" << det_u->subDetector() - << "\t key=" << Phase2TkUtil::getITHistoId(detId_raw, tTopo) - << std::endl; - bookLayerHistos(ibooker, detId_raw, tTopo, dir); + bookLayerHistos(ibooker, detId_raw, tTopo, top_folder); } } - } - -// -// -- Book Layer Histograms // void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, - unsigned int det_id, - const TrackerTopology* tTopo, - std::string& subdir) { - - int layer, side; - int idisc {0}; - layer = tTopo->getITPixelLayerNumber(det_id); - if (layer < 0) - return; + unsigned int det_id, + const TrackerTopology* tTopo, + std::string& subdir) { + ibooker.cd(); std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo); - - //std::map<std::string, RecHitME>::iterator pos = layerMEs_.find(key); + if (key.empty()) + return; if (layerMEs_.find(key) == layerMEs_.end()) { - if (layer > 100) { - side = layer / 100; - idisc = layer - side * 100; - idisc = (idisc < 3) ? 12 : 345; - } - - bool forDisc12UptoRing10 = (idisc == 12 && tTopo->tidRing(det_id) <= 10) ? true : false; - bool forDisc345UptoRing7 = (idisc == 345 && tTopo->tidRing(det_id) <= 7) ? true : false; - //bool forS = (pixelFlag_) ? false : true; - //this handles the PSP - bool forP = (layer < 4 || (layer > 6 && (forDisc12UptoRing10 || forDisc345UptoRing7))) ? true : false; - ibooker.cd(); RecHitME local_histos; std::ostringstream histoName; - ibooker.setCurrentFolder(subdir+"/"+key); - std::cout<< "Setting subfolder>>>" << subdir << "\t" << key << std::endl; + ibooker.setCurrentFolder(subdir + "/" + key); + std::cout << "Setting subfolder>>>" << subdir << "\t" << key << std::endl; edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << key; - histoName.str(""); - histoName << "Number_RecHits"; - local_histos.numberRecHits = ibooker.book1D(histoName.str(), histoName.str(), 50, 0., 0.); - - histoName.str(""); - histoName << "Cluster_Size"; - local_histos.clusterSize = ibooker.book1D(histoName.str(), histoName.str(), 21, -0.5, 20.5); - - histoName.str(""); - histoName << "Globalosition_XY"; - local_histos.globalPosXY = ibooker.book2D(histoName.str(), histoName.str(), 1250, -1250., 1250., 1250, -1250., 1250.); - - histoName.str(""); - histoName << "Local_Position_XY_P" ; - local_histos.localPosXY = ibooker.book2D(histoName.str(), histoName.str(), 500, 0., 0., 500, 0., 0.); - histoName.str(""); histoName << "Delta_X"; - local_histos.deltaX = ibooker.book1D(histoName.str(), histoName.str(), 100, -0.02, 0.02); - + local_histos.deltaX = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_Y"; - local_histos.deltaY = ibooker.book1D(histoName.str(), histoName.str(), 100, -0.02, 0.02); - + local_histos.deltaY = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_X"; - local_histos.pullX = ibooker.book1D(histoName.str(), histoName.str(), 100, -4., 4.); - + local_histos.pullX = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullX"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_Y"; - local_histos.pullY = ibooker.book1D(histoName.str(), histoName.str(), 100, -4., 4.); - + local_histos.pullY = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullY"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_X_vs_Eta"; - local_histos.deltaX_eta = ibooker.bookProfile(histoName.str(), histoName.str(), 82, -4.1, 4.1, 100, -0.02, 0.02); - + local_histos.deltaX_eta = Phase2TkUtil::bookProfile1DFromPSet( + config_.getParameter<edm::ParameterSet>("DeltaX_eta"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_Y_vs_Eta"; - local_histos.deltaY_eta = ibooker.bookProfile(histoName.str(), histoName.str(), 82, -4.1, 4.1, 100, -0.02, 0.02); - + local_histos.deltaY_eta = Phase2TkUtil::bookProfile1DFromPSet( + config_.getParameter<edm::ParameterSet>("DeltaX_eta"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_X_vs_Eta"; - local_histos.pullX_eta = ibooker.bookProfile(histoName.str(), histoName.str(), 82, -4.1, 4.1, 100, -4., 4.); - + local_histos.pullX_eta = Phase2TkUtil::bookProfile1DFromPSet( + config_.getParameter<edm::ParameterSet>("PullX_eta"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_Y_vs_Eta"; - local_histos.pullY_eta = ibooker.bookProfile(histoName.str(), histoName.str(), 82, -4.1, 4.1, 100, -4., 4.); - - ibooker.setCurrentFolder(subdir+"/"+key+"/PrimarySimHits"); + local_histos.pullY_eta = Phase2TkUtil::bookProfile1DFromPSet( + config_.getParameter<edm::ParameterSet>("PullY_eta"), histoName.str(), ibooker); + ibooker.setCurrentFolder(subdir + "/" + key + "/PrimarySimHits"); //all histos for Primary particles histoName.str(""); - histoName << "Number_RecHits_matched_PrimarySimTrack_P"; - local_histos.numberRecHitsprimary = ibooker.book1D(histoName.str(), histoName.str(), 50, 0., 0.); - + histoName << "Number_RecHits_matched_PrimarySimTrack"; + local_histos.numberRecHitsprimary = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("nRecHits_primary"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_X_SimHitPrimary"; - local_histos.deltaX_primary = ibooker.book1D(histoName.str(), histoName.str(), 100, -0.02, 0.02); - + local_histos.deltaX_primary = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("DeltaX_primary"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_Y_SimHitPrimary"; - local_histos.deltaY_primary = ibooker.book1D(histoName.str(), histoName.str(), 100, -0.02, 0.02); - + local_histos.deltaY_primary = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("DeltaY_primary"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_X_SimHitPrimary"; - local_histos.pullX_primary = ibooker.book1D(histoName.str(), histoName.str(), 100, -3., 3.); - + local_histos.pullX_primary = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("PullX_primary"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_Y_SimHitPrimary"; - local_histos.pullY_primary = ibooker.book1D(histoName.str(), histoName.str(), 100, -3., 3.); - + local_histos.pullY_primary = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("PullY_primary"), histoName.str(), ibooker); layerMEs_.insert(std::make_pair(key, local_histos)); } } - + //define this as a plug-in DEFINE_FWK_MODULE(Phase2ITValidateRecHit); - diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h index f9b28cd9f17bb..691942933f42d 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h @@ -22,7 +22,6 @@ #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" - // DQM Histograming class PixelDigiSimLink; class SimTrack; @@ -36,17 +35,19 @@ class Phase2ITValidateRecHit : public DQMEDAnalyzer { ~Phase2ITValidateRecHit() override; void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; - - private: - void fillITHistos(const edm::Event& iEvent, - const TrackerTopology* tTopo, - const TrackerGeometry* tkGeom, - const TrackerHitAssociator& associateRecHit, - const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, - const std::map<unsigned int, SimTrack>& selectedSimTrackMap); +private: + void fillITHistos(const edm::Event& iEvent, + const TrackerTopology* tTopo, + const TrackerGeometry* tkGeom, + const TrackerHitAssociator& associateRecHit, + const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, + const std::map<unsigned int, SimTrack>& selectedSimTrackMap); - void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, const TrackerTopology* tTopo, std::string& subdir); + void bookLayerHistos(DQMStore::IBooker& ibooker, + unsigned int det_id, + const TrackerTopology* tTopo, + std::string& subdir); edm::ParameterSet config_; bool pixelFlag_; @@ -55,21 +56,12 @@ class Phase2ITValidateRecHit : public DQMEDAnalyzer { std::string geomType_; const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; const edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; - std::vector<edm::EDGetTokenT<edm::PSimHitContainer> > simHitTokens_; - - - MonitorElement* numberRecHits_; - MonitorElement* globalXY_; - MonitorElement* globalRZ_; + std::vector<edm::EDGetTokenT<edm::PSimHitContainer>> simHitTokens_; struct RecHitME { // use TH1D instead of TH1F to avoid stauration at 2^31 // above this increments with +1 don't work for float, need double - MonitorElement* numberRecHits = nullptr; - MonitorElement* globalPosXY = nullptr; - MonitorElement* localPosXY = nullptr; MonitorElement* deltaX = nullptr; - MonitorElement* clusterSize = nullptr; MonitorElement* deltaY = nullptr; MonitorElement* pullX = nullptr; MonitorElement* pullY = nullptr; @@ -84,6 +76,6 @@ class Phase2ITValidateRecHit : public DQMEDAnalyzer { MonitorElement* deltaX_primary; MonitorElement* deltaY_primary; }; - std::map<std::string, RecHitME> layerMEs_; + std::map<std::string, RecHitME> layerMEs_; }; #endif diff --git a/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py b/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py index 2a174e54deffd..4a0525db5f8b3 100644 --- a/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py +++ b/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py @@ -1,11 +1,11 @@ import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer -rechitValidIT = DQMEDAnalyzer('Phase2TrackerValidateRecHit', +rechitValidIT = DQMEDAnalyzer('Phase2ITValidateRecHit', Verbosity = cms.bool(False), - TopFolderName = cms.string("Phase2TrackerRecHitV"), + TopFolderName = cms.string("TrackerPhase2ITRecHitV"), ITPlotFillingFlag = cms.bool(False), - rechitsIT = cms.InputTag("siPixelRecHits"), + rechitsSrc = cms.InputTag("siPixelRecHits"), InnerPixelDigiSource = cms.InputTag("simSiPixelDigis","Pixel"), InnerPixelDigiSimLinkSource = cms.InputTag("simSiPixelDigis", "Pixel"), PSimHitSource = cms.VInputTag('g4SimHits:TrackerHitsPixelBarrelLowTof', @@ -20,6 +20,8 @@ 'g4SimHits:TrackerHitsTOBHighTof', 'g4SimHits:TrackerHitsTECLowTof', 'g4SimHits:TrackerHitsTECHighTof'), + simTracksSrc = cms.InputTag("g4SimHits"), + SimTrackMinPt = cms.double(2.), SimTrackSource = cms.InputTag("g4SimHits"), SimVertexSource = cms.InputTag("g4SimHits"), usePhase2Tracker = cms.bool(True),#these are used by simHit assoc. @@ -33,5 +35,94 @@ 'g4SimHitsTrackerHitsPixelEndcapLowTof', 'g4SimHitsTrackerHitsPixelEndcapHighTof', ), - + DeltaX = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(-0.2), + xmax = cms.double(0.2), + switch = cms.bool(True) + ), + DeltaY = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(-0.2), + xmax = cms.double(0.2), + switch = cms.bool(True) + ), + PullX = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(-4.), + xmax = cms.double(4.), + switch = cms.bool(True) + ), + PullY = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(-4.), + xmax = cms.double(4.), + switch = cms.bool(True) + ), + DeltaX_eta = cms.PSet( + NxBins = cms.int32(82), + xmin = cms.double(-4.1), + xmax = cms.double(4.1), + ymin = cms.double(-0.02), + ymax = cms.double(0.02), + switch = cms.bool(True) + ), + DeltaY_eta = cms.PSet( + NxBins = cms.int32(82), + xmin = cms.double(-4.1), + xmax = cms.double(4.1), + ymin = cms.double(-0.02), + ymax = cms.double(0.02), + switch = cms.bool(True) + ), + PullX_eta = cms.PSet( + NxBins = cms.int32(82), + xmin = cms.double(-4.1), + xmax = cms.double(4.1), + ymin = cms.double(-4.), + ymax = cms.double(4.), + switch = cms.bool(True) + ), + PullY_eta = cms.PSet( + NxBins = cms.int32(82), + xmin = cms.double(-4.1), + xmax = cms.double(4.1), + ymin = cms.double(-4.), + ymax = cms.double(4.), + switch = cms.bool(True) + ), + nRecHits_primary = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(0.), + xmax = cms.double(0.), + switch = cms.bool(True) + ), + DeltaX_primary = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(-0.2), + xmax = cms.double(0.2), + switch = cms.bool(True) + ), + DeltaY_primary = cms.PSet( + NxBins = cms.int32(100), + xmin = cms.double(-0.2), + xmax = cms.double(0.2), + switch = cms.bool(True) + ), + PullX_primary = cms.PSet( + NxBins = cms.int32(82), + xmin = cms.double(-4.1), + xmax = cms.double(4.1), + ymin = cms.double(-4.), + ymax = cms.double(4.), + switch = cms.bool(True) + ), + PullY_primary = cms.PSet( + NxBins = cms.int32(82), + xmin = cms.double(-4.1), + xmax = cms.double(4.1), + ymin = cms.double(-4.), + ymax = cms.double(4.), + switch = cms.bool(True) + ) ) diff --git a/Validation/SiTrackerPhase2V/python/Phase2TrackerValidationFirstStep_cff.py b/Validation/SiTrackerPhase2V/python/Phase2TrackerValidationFirstStep_cff.py index 47cfa29845a05..ae65faa17f373 100644 --- a/Validation/SiTrackerPhase2V/python/Phase2TrackerValidationFirstStep_cff.py +++ b/Validation/SiTrackerPhase2V/python/Phase2TrackerValidationFirstStep_cff.py @@ -1,4 +1,7 @@ import FWCore.ParameterSet.Config as cms from Validation.SiTrackerPhase2V.Phase2TrackerValidateDigi_cff import * - -trackerphase2ValidationSource = cms.Sequence(pixDigiValid + otDigiValid ) +from Validation.SiTrackerPhase2V.Phase2ITValidateRecHit_cfi import * +trackerphase2ValidationSource = cms.Sequence(pixDigiValid + + otDigiValid + + rechitValidIT +) diff --git a/Validation/SiTrackerPhase2V/test/ValidateRecHit_TrackerPhase2Standalone_cfg.py b/Validation/SiTrackerPhase2V/test/ValidateRecHit_TrackerPhase2Standalone_cfg.py index b8d0126e3a8b1..2eb196b01c90e 100644 --- a/Validation/SiTrackerPhase2V/test/ValidateRecHit_TrackerPhase2Standalone_cfg.py +++ b/Validation/SiTrackerPhase2V/test/ValidateRecHit_TrackerPhase2Standalone_cfg.py @@ -93,6 +93,6 @@ ''' process.p = cms.Path(process.siPixelRecHits #*process.siPhase2RecHits - #* process.rechitValidIT + * process.rechitValidIT #* process.rechitValidOT * process.dqm_comm ) From 5e2292a9f2ed8f4dd165568a4646ea33b95e51ed Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Mon, 5 Oct 2020 13:31:51 +0200 Subject: [PATCH 445/778] adding utility headers --- .../interface/TrackerPhase2DQMUtil.h | 102 ++++++++++++++++++ .../interface/TrackerPhase2ValidationUtil.h | 23 ++++ 2 files changed, 125 insertions(+) create mode 100644 DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h create mode 100644 Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h diff --git a/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h b/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h new file mode 100644 index 0000000000000..9d29fed3d004d --- /dev/null +++ b/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h @@ -0,0 +1,102 @@ +#ifndef _Validation_SiTrackerPhase2V_Phase2TrackierValidationUtil_h +#define _Validation_SiTrackerPhase2V_Phase2TrackierValidationUtil_h +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMStore.h" +#include<string> +#include<sstream> + +namespace Phase2TkUtil { + +std::string getITHistoId(uint32_t det_id, const TrackerTopology* tTopo) { + std::string Disc; + std::ostringstream fname1; + int layer = tTopo->getITPixelLayerNumber(det_id); + + if(layer < 0) + return ""; + if (layer < 100) { + fname1 << "Barrel/"; + fname1 << "Layer" << layer; + fname1 << ""; + } else { + int side = tTopo->pxfSide(det_id); + fname1 << "EndCap_Side" << side << "/"; + int disc = tTopo->pxfDisk(det_id); + Disc = (disc < 9) ? "EPix" : "FPix";; + fname1 << Disc << "/"; + int ring = tTopo->pxfBlade(det_id); + fname1 << "Ring" << ring; + } + return fname1.str(); +} + +std::string getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo) { + std::string Disc; + std::ostringstream fname1; + int layer = tTopo->getOTLayerNumber(det_id); + + if(layer < 0) + return ""; + if (layer < 100) { + fname1 << "Barrel/"; + fname1 << "Layer" << layer; + fname1 << ""; + } else { + int side = tTopo->tidSide(det_id); + fname1 << "EndCap_Side" << side << "/"; + int disc = tTopo->tidWheel(det_id); + Disc = (disc < 3) ? "TEDD_1" : "TEDD_2"; + fname1 << Disc << "/"; + int ring = tTopo->tidRing(det_id); + fname1 << "Ring" << ring; + } + return fname1.str(); +} + +typedef dqm::reco::MonitorElement MonitorElement; +typedef dqm::reco::DQMStore DQMStore; +MonitorElement* book1DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { + MonitorElement* temp = nullptr; + if(hpars.getParameter<bool>("switch")) { + temp = ibooker.book1D(hname, + hname, + hpars.getParameter<int32_t>("NxBins"), + hpars.getParameter<double>("xmin"), + hpars.getParameter<double>("xmax")); + } + return temp; +} + +MonitorElement* book2DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { + MonitorElement* temp = nullptr; + if(hpars.getParameter<bool>("switch")) { + temp = ibooker.book2D(hname, + hname, + hpars.getParameter<int32_t>("NxBins"), + hpars.getParameter<double>("xmin"), + hpars.getParameter<double>("xmax"), + hpars.getParameter<int32_t>("NyBins"), + hpars.getParameter<double>("ymin"), + hpars.getParameter<double>("ymax")); + } + return temp; +} + +MonitorElement* bookProfile1DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { + MonitorElement* temp = nullptr; + if(hpars.getParameter<bool>("switch")) { + temp = ibooker.bookProfile(hname, + hname, + hpars.getParameter<int32_t>("NxBins"), + hpars.getParameter<double>("xmin"), + hpars.getParameter<double>("xmax"), + hpars.getParameter<double>("ymin"), + hpars.getParameter<double>("ymax")); + } + return temp; +} +} + +#endif diff --git a/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h b/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h new file mode 100644 index 0000000000000..0b32f0408fe5c --- /dev/null +++ b/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h @@ -0,0 +1,23 @@ +#ifndef _Validation_SiTrackerPhase2V_TrackerPhase2ValidationUtil_h +#define _Validation_SiTrackerPhase2V_TrackerPhase2ValidationUtil_h +#include "SimDataFormats/TrackingHit/interface/PSimHit.h" +#include "SimDataFormats/Track/interface/SimTrack.h" +#include<string> +#include<sstream> + +namespace Phase2TkUtil { + +bool isPrimary(const SimTrack& simTrk, const PSimHit* simHit){ + bool retval = false; + unsigned int trkId = simTrk.trackId(); + if (trkId != simHit->trackId()) + return retval; + int vtxIndex = simTrk.vertIndex(); + int ptype = simHit->processType(); + if ((vtxIndex == 0) && (ptype == 0)) + return true; + return false; +} + +} +#endif From 66cc13528f720dbf444c9d7603151b232820e623 Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Mon, 5 Oct 2020 13:43:06 +0200 Subject: [PATCH 446/778] correcting code format --- .../interface/TrackerPhase2DQMUtil.h | 169 +++++++------- .../plugins/Phase2ITMonitorRecHit.cc | 213 ++++++++---------- .../plugins/Phase2ITMonitorRecHit.h | 17 +- .../interface/TrackerPhase2ValidationUtil.h | 28 +-- 4 files changed, 205 insertions(+), 222 deletions(-) diff --git a/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h b/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h index 9d29fed3d004d..bb32e0cb90f77 100644 --- a/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h +++ b/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h @@ -4,99 +4,102 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DQMServices/Core/interface/MonitorElement.h" #include "DQMServices/Core/interface/DQMStore.h" -#include<string> -#include<sstream> +#include <string> +#include <sstream> namespace Phase2TkUtil { -std::string getITHistoId(uint32_t det_id, const TrackerTopology* tTopo) { - std::string Disc; - std::ostringstream fname1; - int layer = tTopo->getITPixelLayerNumber(det_id); - - if(layer < 0) - return ""; - if (layer < 100) { - fname1 << "Barrel/"; - fname1 << "Layer" << layer; - fname1 << ""; - } else { - int side = tTopo->pxfSide(det_id); - fname1 << "EndCap_Side" << side << "/"; - int disc = tTopo->pxfDisk(det_id); - Disc = (disc < 9) ? "EPix" : "FPix";; - fname1 << Disc << "/"; - int ring = tTopo->pxfBlade(det_id); - fname1 << "Ring" << ring; + std::string getITHistoId(uint32_t det_id, const TrackerTopology* tTopo) { + std::string Disc; + std::ostringstream fname1; + int layer = tTopo->getITPixelLayerNumber(det_id); + + if (layer < 0) + return ""; + if (layer < 100) { + fname1 << "Barrel/"; + fname1 << "Layer" << layer; + fname1 << ""; + } else { + int side = tTopo->pxfSide(det_id); + fname1 << "EndCap_Side" << side << "/"; + int disc = tTopo->pxfDisk(det_id); + Disc = (disc < 9) ? "EPix" : "FPix"; + ; + fname1 << Disc << "/"; + int ring = tTopo->pxfBlade(det_id); + fname1 << "Ring" << ring; + } + return fname1.str(); } - return fname1.str(); -} -std::string getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo) { - std::string Disc; - std::ostringstream fname1; - int layer = tTopo->getOTLayerNumber(det_id); - - if(layer < 0) - return ""; - if (layer < 100) { - fname1 << "Barrel/"; - fname1 << "Layer" << layer; - fname1 << ""; - } else { - int side = tTopo->tidSide(det_id); - fname1 << "EndCap_Side" << side << "/"; - int disc = tTopo->tidWheel(det_id); - Disc = (disc < 3) ? "TEDD_1" : "TEDD_2"; - fname1 << Disc << "/"; - int ring = tTopo->tidRing(det_id); - fname1 << "Ring" << ring; + std::string getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo) { + std::string Disc; + std::ostringstream fname1; + int layer = tTopo->getOTLayerNumber(det_id); + + if (layer < 0) + return ""; + if (layer < 100) { + fname1 << "Barrel/"; + fname1 << "Layer" << layer; + fname1 << ""; + } else { + int side = tTopo->tidSide(det_id); + fname1 << "EndCap_Side" << side << "/"; + int disc = tTopo->tidWheel(det_id); + Disc = (disc < 3) ? "TEDD_1" : "TEDD_2"; + fname1 << Disc << "/"; + int ring = tTopo->tidRing(det_id); + fname1 << "Ring" << ring; + } + return fname1.str(); } - return fname1.str(); -} -typedef dqm::reco::MonitorElement MonitorElement; -typedef dqm::reco::DQMStore DQMStore; -MonitorElement* book1DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { - MonitorElement* temp = nullptr; - if(hpars.getParameter<bool>("switch")) { - temp = ibooker.book1D(hname, - hname, - hpars.getParameter<int32_t>("NxBins"), - hpars.getParameter<double>("xmin"), - hpars.getParameter<double>("xmax")); + typedef dqm::reco::MonitorElement MonitorElement; + typedef dqm::reco::DQMStore DQMStore; + MonitorElement* book1DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { + MonitorElement* temp = nullptr; + if (hpars.getParameter<bool>("switch")) { + temp = ibooker.book1D(hname, + hname, + hpars.getParameter<int32_t>("NxBins"), + hpars.getParameter<double>("xmin"), + hpars.getParameter<double>("xmax")); + } + return temp; } - return temp; -} -MonitorElement* book2DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { - MonitorElement* temp = nullptr; - if(hpars.getParameter<bool>("switch")) { - temp = ibooker.book2D(hname, - hname, - hpars.getParameter<int32_t>("NxBins"), - hpars.getParameter<double>("xmin"), - hpars.getParameter<double>("xmax"), - hpars.getParameter<int32_t>("NyBins"), - hpars.getParameter<double>("ymin"), - hpars.getParameter<double>("ymax")); + MonitorElement* book2DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { + MonitorElement* temp = nullptr; + if (hpars.getParameter<bool>("switch")) { + temp = ibooker.book2D(hname, + hname, + hpars.getParameter<int32_t>("NxBins"), + hpars.getParameter<double>("xmin"), + hpars.getParameter<double>("xmax"), + hpars.getParameter<int32_t>("NyBins"), + hpars.getParameter<double>("ymin"), + hpars.getParameter<double>("ymax")); + } + return temp; } - return temp; -} -MonitorElement* bookProfile1DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { - MonitorElement* temp = nullptr; - if(hpars.getParameter<bool>("switch")) { - temp = ibooker.bookProfile(hname, - hname, - hpars.getParameter<int32_t>("NxBins"), - hpars.getParameter<double>("xmin"), - hpars.getParameter<double>("xmax"), - hpars.getParameter<double>("ymin"), - hpars.getParameter<double>("ymax")); + MonitorElement* bookProfile1DFromPSet(const edm::ParameterSet& hpars, + const std::string& hname, + DQMStore::IBooker& ibooker) { + MonitorElement* temp = nullptr; + if (hpars.getParameter<bool>("switch")) { + temp = ibooker.bookProfile(hname, + hname, + hpars.getParameter<int32_t>("NxBins"), + hpars.getParameter<double>("xmin"), + hpars.getParameter<double>("xmax"), + hpars.getParameter<double>("ymin"), + hpars.getParameter<double>("ymax")); + } + return temp; } - return temp; -} -} - +} // namespace Phase2TkUtil + #endif diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc index d69214993394b..85a9405549d09 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc @@ -29,10 +29,9 @@ // // constructors // -Phase2ITMonitorRecHit::Phase2ITMonitorRecHit(const edm::ParameterSet& iConfig): - config_(iConfig), - tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))) -{ +Phase2ITMonitorRecHit::Phase2ITMonitorRecHit(const edm::ParameterSet& iConfig) + : config_(iConfig), + tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))) { edm::LogInfo("Phase2ITMonitorRecHit") << ">>> Construct Phase2ITMonitorRecHit "; } @@ -41,7 +40,6 @@ Phase2ITMonitorRecHit::~Phase2ITMonitorRecHit() { } // -- Analyze void Phase2ITMonitorRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - // Get the geometry edm::ESHandle<TrackerGeometry> geomHandle; iSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); @@ -54,17 +52,18 @@ void Phase2ITMonitorRecHit::analyze(const edm::Event& iEvent, const edm::EventSe fillITHistos(iEvent, tTopo, tkGeom); } -void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent, - const TrackerTopology* tTopo, - const TrackerGeometry* tkGeom) { +void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent, + const TrackerTopology* tTopo, + const TrackerGeometry* tkGeom) { // Get the RecHits edm::Handle<SiPixelRecHitCollection> rechits; iEvent.getByToken(tokenRecHitsIT_, rechits); - if(!rechits.isValid()) return; - std::map<std::string, unsigned int> nrechitLayerMap; + if (!rechits.isValid()) + return; + std::map<std::string, unsigned int> nrechitLayerMap; unsigned long int nTotrechitsinevt = 0; // Loop over modules - SiPixelRecHitCollection::const_iterator DSViter; + SiPixelRecHitCollection::const_iterator DSViter; for (DSViter = rechits->begin(); DSViter != rechits->end(); ++DSViter) { // Get the detector id unsigned int rawid(DSViter->detId()); @@ -75,54 +74,62 @@ void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent, continue; std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo); nTotrechitsinevt += DSViter->size(); - if(nrechitLayerMap.find(key) == nrechitLayerMap.end()) { - nrechitLayerMap.insert(std::make_pair(key, DSViter->size())); + if (nrechitLayerMap.find(key) == nrechitLayerMap.end()) { + nrechitLayerMap.insert(std::make_pair(key, DSViter->size())); } else { nrechitLayerMap[key] += DSViter->size(); } - + edmNew::DetSet<SiPixelRecHit>::const_iterator rechitIt; //loop over rechits for a single detId - for(rechitIt = DSViter->begin(); rechitIt != DSViter->end(); ++rechitIt) { + for (rechitIt = DSViter->begin(); rechitIt != DSViter->end(); ++rechitIt) { LocalPoint lp = rechitIt->localPosition(); Global3DPoint globalPos = geomDetunit->surface().toGlobal(lp); //in mm - double gx = globalPos.x()*10.; - double gy = globalPos.y()*10.; - double gz = globalPos.z()*10.; - double gr = globalPos.perp()*10.; + double gx = globalPos.x() * 10.; + double gy = globalPos.y() * 10.; + double gz = globalPos.z() * 10.; + double gr = globalPos.perp() * 10.; //Fill global positions - if(geomDetunit->subDetector() == GeomDetEnumerators::SubDetector::P2PXB) { - globalXY_barrel_->Fill(gx, gy); - globalRZ_barrel_->Fill(gz, gr); - } else if(geomDetunit->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC) { - globalXY_endcap_->Fill(gx, gy); - globalRZ_endcap_->Fill(gz, gr); + if (geomDetunit->subDetector() == GeomDetEnumerators::SubDetector::P2PXB) { + globalXY_barrel_->Fill(gx, gy); + globalRZ_barrel_->Fill(gz, gr); + } else if (geomDetunit->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC) { + globalXY_endcap_->Fill(gx, gy); + globalRZ_endcap_->Fill(gz, gr); } //layer wise histo - if(layerMEs_[key].clusterSizeX) layerMEs_[key].clusterSizeX->Fill(rechitIt->cluster()->sizeX()); - if(layerMEs_[key].clusterSizeY) layerMEs_[key].clusterSizeY->Fill(rechitIt->cluster()->sizeY()); - if(layerMEs_[key].globalPosXY) layerMEs_[key].globalPosXY->Fill(gx, gy); - if(layerMEs_[key].globalPosRZ) layerMEs_[key].globalPosRZ->Fill(gz, gr); - if(layerMEs_[key].localPosXY) layerMEs_[key].localPosXY->Fill(lp.x(), lp.y()); - if(layerMEs_[key].posX) layerMEs_[key].posX->Fill(lp.x()); - if(layerMEs_[key].posY) layerMEs_[key].posX->Fill(lp.y()); - if(layerMEs_[key].posX) layerMEs_[key].poserrX->Fill(rechitIt->localPositionError().xx()); - if(layerMEs_[key].posY) layerMEs_[key].poserrY->Fill(rechitIt->localPositionError().yy()); - }//end loop over rechits of a detId - } //End loop over DetSetVector - + if (layerMEs_[key].clusterSizeX) + layerMEs_[key].clusterSizeX->Fill(rechitIt->cluster()->sizeX()); + if (layerMEs_[key].clusterSizeY) + layerMEs_[key].clusterSizeY->Fill(rechitIt->cluster()->sizeY()); + if (layerMEs_[key].globalPosXY) + layerMEs_[key].globalPosXY->Fill(gx, gy); + if (layerMEs_[key].globalPosRZ) + layerMEs_[key].globalPosRZ->Fill(gz, gr); + if (layerMEs_[key].localPosXY) + layerMEs_[key].localPosXY->Fill(lp.x(), lp.y()); + if (layerMEs_[key].posX) + layerMEs_[key].posX->Fill(lp.x()); + if (layerMEs_[key].posY) + layerMEs_[key].posX->Fill(lp.y()); + if (layerMEs_[key].posX) + layerMEs_[key].poserrX->Fill(rechitIt->localPositionError().xx()); + if (layerMEs_[key].posY) + layerMEs_[key].poserrY->Fill(rechitIt->localPositionError().yy()); + } //end loop over rechits of a detId + } //End loop over DetSetVector + //fill nRecHits per event numberRecHits_->Fill(nTotrechitsinevt); //fill nRecHit counter per layer - for(auto& lme : nrechitLayerMap) - if(layerMEs_[lme.first].numberRecHits) + for (auto& lme : nrechitLayerMap) + if (layerMEs_[lme.first].numberRecHits) layerMEs_[lme.first].numberRecHits->Fill(lme.second); } void Phase2ITMonitorRecHit::bookHistograms(DQMStore::IBooker& ibooker, - edm::Run const& iRun, - edm::EventSetup const& iSetup) { - + edm::Run const& iRun, + edm::EventSetup const& iSetup) { std::string top_folder = config_.getParameter<std::string>("TopFolderName"); ibooker.cd(); edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << top_folder; @@ -132,29 +139,24 @@ void Phase2ITMonitorRecHit::bookHistograms(DQMStore::IBooker& ibooker, //Global histos for IT HistoName.str(""); HistoName << "NumberRecHits"; - numberRecHits_ = Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalNumberRecHits"), - HistoName.str(), - ibooker); + numberRecHits_ = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("GlobalNumberRecHits"), HistoName.str(), ibooker); HistoName.str(""); HistoName << "Global_Position_XY_IT_barrel"; - globalXY_barrel_ = Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXB"), - HistoName.str(), - ibooker); + globalXY_barrel_ = Phase2TkUtil::book2DFromPSet( + config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXB"), HistoName.str(), ibooker); HistoName.str(""); HistoName << "Global_Position_RZ_IT_barrel"; - globalRZ_barrel_ = Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXB"), - HistoName.str(), - ibooker); + globalRZ_barrel_ = Phase2TkUtil::book2DFromPSet( + config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXB"), HistoName.str(), ibooker); HistoName.str(""); HistoName << "Global_Position_XY_IT_endcap"; - globalXY_endcap_ = Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXEC"), - HistoName.str(), - ibooker); + globalXY_endcap_ = Phase2TkUtil::book2DFromPSet( + config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXEC"), HistoName.str(), ibooker); HistoName.str(""); HistoName << "Global_Position_RZ_IT_endcap"; - globalRZ_endcap_ = Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXEC"), - HistoName.str(), - ibooker); + globalRZ_endcap_ = Phase2TkUtil::book2DFromPSet( + config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXEC"), HistoName.str(), ibooker); //Now book layer wise histos edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher; @@ -167,100 +169,79 @@ void Phase2ITMonitorRecHit::bookHistograms(DQMStore::IBooker& ibooker, const TrackerGeometry* tGeom = geom_handle.product(); for (auto const& det_u : tGeom->detUnits()) { //Always check TrackerNumberingBuilder before changing this part - if(!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB - || det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC)) - continue; + if (!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB || + det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC)) + continue; unsigned int detId_raw = det_u->geographicalId().rawId(); - edm::LogInfo("Phase2ITMonitorRecHit") << "Detid:" << detId_raw - <<"\tsubdet=" << det_u->subDetector() - << "\t key=" << Phase2TkUtil::getITHistoId(detId_raw, tTopo) - << std::endl; + edm::LogInfo("Phase2ITMonitorRecHit") << "Detid:" << detId_raw << "\tsubdet=" << det_u->subDetector() + << "\t key=" << Phase2TkUtil::getITHistoId(detId_raw, tTopo) << std::endl; bookLayerHistos(ibooker, detId_raw, tTopo, dir); } } } // -- Book Layer Histograms void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, - unsigned int det_id, - const TrackerTopology* tTopo, - std::string& subdir) { + unsigned int det_id, + const TrackerTopology* tTopo, + std::string& subdir) { std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo); - if(key.empty()) return; + if (key.empty()) + return; if (layerMEs_.find(key) == layerMEs_.end()) { ibooker.cd(); RecHitME local_histos; std::ostringstream histoName; - ibooker.setCurrentFolder(subdir+"/"+key); - std::cout<< "Setting subfolder>>>" << subdir << "\t" << key << std::endl; - edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << (subdir+"/"+key); + ibooker.setCurrentFolder(subdir + "/" + key); + std::cout << "Setting subfolder>>>" << subdir << "\t" << key << std::endl; + edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << (subdir + "/" + key); histoName.str(""); histoName << "Number_RecHits"; - local_histos.numberRecHits = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalNumberRecHits"), - histoName.str(), - ibooker); + local_histos.numberRecHits = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("LocalNumberRecHits"), histoName.str(), ibooker); histoName.str(""); histoName << "RecHit_X"; - local_histos.posX = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosX"), - histoName.str(), - ibooker); + local_histos.posX = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosX"), histoName.str(), ibooker); histoName.str(""); histoName << "RecHit_Y"; - local_histos.posY = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosY"), - histoName.str(), - ibooker); + local_histos.posY = + Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosY"), histoName.str(), ibooker); histoName.str(""); histoName << "RecHit_X_error"; - local_histos.poserrX = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosErrorX"), - histoName.str(), - ibooker); + local_histos.poserrX = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("RecHitPosErrorX"), histoName.str(), ibooker); histoName.str(""); histoName << "RecHit_Y_error"; - local_histos.poserrY = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosErrorY"), - histoName.str(), - ibooker); + local_histos.poserrY = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("RecHitPosErrorY"), histoName.str(), ibooker); histoName.str(""); histoName << "Cluster_SizeX"; - local_histos.clusterSizeX = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalClusterSizeX"), - histoName.str(), - ibooker); + local_histos.clusterSizeX = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("LocalClusterSizeX"), histoName.str(), ibooker); histoName.str(""); histoName << "Cluster_SizeY"; - local_histos.clusterSizeY = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalClusterSizeY"), - histoName.str(), - ibooker); + local_histos.clusterSizeY = Phase2TkUtil::book1DFromPSet( + config_.getParameter<edm::ParameterSet>("LocalClusterSizeY"), histoName.str(), ibooker); histoName.str(""); - histoName << "Global_Position_XY"; - local_histos.globalPosXY = - Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_perlayer"), - histoName.str(), - ibooker); + histoName << "Global_Position_XY"; + local_histos.globalPosXY = Phase2TkUtil::book2DFromPSet( + config_.getParameter<edm::ParameterSet>("GlobalPositionXY_perlayer"), histoName.str(), ibooker); - histoName.str(""); - histoName << "Global_Position_RZ"; - local_histos.globalPosRZ = - Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_perlayer"), - histoName.str(), - ibooker); histoName.str(""); - histoName << "Local_Position_XY" ; - local_histos.localPosXY = - Phase2TkUtil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("LocalPositionXY"), - histoName.str(), - ibooker); + histoName << "Global_Position_RZ"; + local_histos.globalPosRZ = Phase2TkUtil::book2DFromPSet( + config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_perlayer"), histoName.str(), ibooker); + histoName.str(""); + histoName << "Local_Position_XY"; + local_histos.localPosXY = Phase2TkUtil::book2DFromPSet( + config_.getParameter<edm::ParameterSet>("LocalPositionXY"), histoName.str(), ibooker); layerMEs_.insert(std::make_pair(key, local_histos)); } -} +} //define this as a plug-in DEFINE_FWK_MODULE(Phase2ITMonitorRecHit); diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h index d1d709c68e4c0..9640153e7d3d1 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h @@ -21,7 +21,6 @@ #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" - // DQM Histograming class TrackerTopology; class TrackerGeometry; @@ -32,13 +31,14 @@ class Phase2ITMonitorRecHit : public DQMEDAnalyzer { ~Phase2ITMonitorRecHit() override; void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; - - private: - void fillITHistos(const edm::Event& iEvent, - const TrackerTopology* tTopo, - const TrackerGeometry* tkGeom); - void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, const TrackerTopology* tTopo, std::string& subdir); +private: + void fillITHistos(const edm::Event& iEvent, const TrackerTopology* tTopo, const TrackerGeometry* tkGeom); + + void bookLayerHistos(DQMStore::IBooker& ibooker, + unsigned int det_id, + const TrackerTopology* tTopo, + std::string& subdir); edm::ParameterSet config_; std::string geomType_; @@ -61,8 +61,7 @@ class Phase2ITMonitorRecHit : public DQMEDAnalyzer { MonitorElement* poserrY = nullptr; MonitorElement* clusterSizeX = nullptr; MonitorElement* clusterSizeY = nullptr; - }; - std::map<std::string, RecHitME> layerMEs_; + std::map<std::string, RecHitME> layerMEs_; }; #endif diff --git a/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h b/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h index 0b32f0408fe5c..0dc8bcf66f9c1 100644 --- a/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h +++ b/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h @@ -2,22 +2,22 @@ #define _Validation_SiTrackerPhase2V_TrackerPhase2ValidationUtil_h #include "SimDataFormats/TrackingHit/interface/PSimHit.h" #include "SimDataFormats/Track/interface/SimTrack.h" -#include<string> -#include<sstream> +#include <string> +#include <sstream> namespace Phase2TkUtil { -bool isPrimary(const SimTrack& simTrk, const PSimHit* simHit){ - bool retval = false; - unsigned int trkId = simTrk.trackId(); - if (trkId != simHit->trackId()) - return retval; - int vtxIndex = simTrk.vertIndex(); - int ptype = simHit->processType(); - if ((vtxIndex == 0) && (ptype == 0)) - return true; - return false; -} + bool isPrimary(const SimTrack& simTrk, const PSimHit* simHit) { + bool retval = false; + unsigned int trkId = simTrk.trackId(); + if (trkId != simHit->trackId()) + return retval; + int vtxIndex = simTrk.vertIndex(); + int ptype = simHit->processType(); + if ((vtxIndex == 0) && (ptype == 0)) + return true; + return false; + } -} +} // namespace Phase2TkUtil #endif From 14b04a8525855ff57e25670e85ce356bd3215b14 Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Mon, 5 Oct 2020 16:04:56 +0200 Subject: [PATCH 447/778] removing cout;using esconsume --- .../plugins/Phase2ITMonitorRecHit.cc | 56 ++++++++----------- .../plugins/Phase2ITMonitorRecHit.h | 15 +++-- .../plugins/Phase2ITValidateRecHit.cc | 52 +++++++++-------- .../plugins/Phase2ITValidateRecHit.h | 17 +++--- 4 files changed, 65 insertions(+), 75 deletions(-) diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc index 85a9405549d09..af63ab4cdcddb 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc @@ -20,6 +20,8 @@ #include "Geometry/CommonDetUnit/interface/TrackerGeomDet.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "DataFormats/Common/interface/DetSetVector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/GeometrySurface/interface/LocalError.h" @@ -31,7 +33,9 @@ // Phase2ITMonitorRecHit::Phase2ITMonitorRecHit(const edm::ParameterSet& iConfig) : config_(iConfig), - tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))) { + tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))), + geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()), + topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) { edm::LogInfo("Phase2ITMonitorRecHit") << ">>> Construct Phase2ITMonitorRecHit "; } @@ -39,22 +43,9 @@ Phase2ITMonitorRecHit::~Phase2ITMonitorRecHit() { edm::LogInfo("Phase2ITMonitorRecHit") << ">>> Destroy Phase2ITMonitorRecHit "; } // -- Analyze -void Phase2ITMonitorRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - // Get the geometry - edm::ESHandle<TrackerGeometry> geomHandle; - iSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); - const TrackerGeometry* tkGeom = &(*geomHandle); - - edm::ESHandle<TrackerTopology> tTopoHandle; - iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); - const TrackerTopology* tTopo = tTopoHandle.product(); - - fillITHistos(iEvent, tTopo, tkGeom); -} +void Phase2ITMonitorRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { fillITHistos(iEvent); } -void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent, - const TrackerTopology* tTopo, - const TrackerGeometry* tkGeom) { +void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent) { // Get the RecHits edm::Handle<SiPixelRecHitCollection> rechits; iEvent.getByToken(tokenRecHitsIT_, rechits); @@ -69,10 +60,10 @@ void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent, unsigned int rawid(DSViter->detId()); DetId detId(rawid); // Get the geomdet - const GeomDetUnit* geomDetunit(tkGeom->idToDetUnit(detId)); + const GeomDetUnit* geomDetunit(tkGeom_->idToDetUnit(detId)); if (!geomDetunit) continue; - std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo); + std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo_); nTotrechitsinevt += DSViter->size(); if (nrechitLayerMap.find(key) == nrechitLayerMap.end()) { nrechitLayerMap.insert(std::make_pair(key, DSViter->size())); @@ -127,6 +118,14 @@ void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent, if (layerMEs_[lme.first].numberRecHits) layerMEs_[lme.first].numberRecHits->Fill(lme.second); } + +void Phase2ITMonitorRecHit::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { + edm::ESHandle<TrackerGeometry> geomHandle = iSetup.getHandle(geomToken_); + tkGeom_ = &(*geomHandle); + edm::ESHandle<TrackerTopology> tTopoHandle = iSetup.getHandle(topoToken_); + tTopo_ = tTopoHandle.product(); +} + void Phase2ITMonitorRecHit::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) { @@ -160,31 +159,23 @@ void Phase2ITMonitorRecHit::bookHistograms(DQMStore::IBooker& ibooker, //Now book layer wise histos edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher; - edm::ESHandle<TrackerTopology> tTopoHandle; - iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); if (theTkDigiGeomWatcher.check(iSetup)) { - edm::ESHandle<TrackerGeometry> geom_handle; - iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geom_handle); - const TrackerGeometry* tGeom = geom_handle.product(); - for (auto const& det_u : tGeom->detUnits()) { + edm::ESHandle<TrackerGeometry> geomHandle = iSetup.getHandle(geomToken_); + for (auto const& det_u : tkGeom_->detUnits()) { //Always check TrackerNumberingBuilder before changing this part if (!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB || det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC)) continue; unsigned int detId_raw = det_u->geographicalId().rawId(); edm::LogInfo("Phase2ITMonitorRecHit") << "Detid:" << detId_raw << "\tsubdet=" << det_u->subDetector() - << "\t key=" << Phase2TkUtil::getITHistoId(detId_raw, tTopo) << std::endl; - bookLayerHistos(ibooker, detId_raw, tTopo, dir); + << "\t key=" << Phase2TkUtil::getITHistoId(detId_raw, tTopo_) << std::endl; + bookLayerHistos(ibooker, detId_raw, dir); } } } // -- Book Layer Histograms -void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, - unsigned int det_id, - const TrackerTopology* tTopo, - std::string& subdir) { - std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo); +void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir) { + std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo_); if (key.empty()) return; if (layerMEs_.find(key) == layerMEs_.end()) { @@ -192,7 +183,6 @@ void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, RecHitME local_histos; std::ostringstream histoName; ibooker.setCurrentFolder(subdir + "/" + key); - std::cout << "Setting subfolder>>>" << subdir << "\t" << key << std::endl; edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << (subdir + "/" + key); histoName.str(""); histoName << "Number_RecHits"; diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h index 9640153e7d3d1..da4deef8329b4 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h @@ -24,25 +24,28 @@ // DQM Histograming class TrackerTopology; class TrackerGeometry; - +class TrackerDigiGeometryRecord; +class TrackerTopologyRcd; class Phase2ITMonitorRecHit : public DQMEDAnalyzer { public: explicit Phase2ITMonitorRecHit(const edm::ParameterSet&); ~Phase2ITMonitorRecHit() override; void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; + void dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); private: - void fillITHistos(const edm::Event& iEvent, const TrackerTopology* tTopo, const TrackerGeometry* tkGeom); + void fillITHistos(const edm::Event& iEvent); - void bookLayerHistos(DQMStore::IBooker& ibooker, - unsigned int det_id, - const TrackerTopology* tTopo, - std::string& subdir); + void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir); edm::ParameterSet config_; std::string geomType_; const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; + const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; + const TrackerGeometry* tkGeom_ = nullptr; + const TrackerTopology* tTopo_ = nullptr; MonitorElement* numberRecHits_; MonitorElement* globalXY_barrel_; diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc index 6567d20512a30..5705f4905b087 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc @@ -21,6 +21,8 @@ #include "Geometry/CommonDetUnit/interface/TrackerGeomDet.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "DataFormats/Common/interface/DetSetVector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/GeometrySurface/interface/LocalError.h" @@ -39,7 +41,9 @@ Phase2ITValidateRecHit::Phase2ITValidateRecHit(const edm::ParameterSet& iConfig) trackerHitAssociatorConfig_(iConfig, consumesCollector()), simtrackminpt_(iConfig.getParameter<double>("SimTrackMinPt")), tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))), - simTracksToken_(consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("simTracksSrc"))) { + simTracksToken_(consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("simTracksSrc"))), + geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()), + topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) { edm::LogInfo("Phase2ITValidateRecHit") << ">>> Construct Phase2ITValidateRecHit "; for (const auto& itag : config_.getParameter<std::vector<edm::InputTag>>("PSimHitSource")) simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag)); @@ -50,14 +54,14 @@ Phase2ITValidateRecHit::~Phase2ITValidateRecHit() { } void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { // Get the geometry - edm::ESHandle<TrackerGeometry> geomHandle; - iSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); + /* edm::ESHandle<TrackerGeometry> geomHandle = iSetup.getHandle(geomToken_); + //iSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); const TrackerGeometry* tkGeom = &(*geomHandle); - edm::ESHandle<TrackerTopology> tTopoHandle; - iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); + edm::ESHandle<TrackerTopology> tTopoHandle = iSetup.getHandle(topoToken_); + //iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); const TrackerTopology* tTopo = tTopoHandle.product(); - + */ std::vector<edm::Handle<edm::PSimHitContainer>> simHits; for (const auto& itoken : simHitTokens_) { edm::Handle<edm::PSimHitContainer> simHitHandle; @@ -78,12 +82,10 @@ void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventS } } TrackerHitAssociator associateRecHit(iEvent, trackerHitAssociatorConfig_); - fillITHistos(iEvent, tTopo, tkGeom, associateRecHit, simHits, selectedSimTrackMap); + fillITHistos(iEvent, associateRecHit, simHits, selectedSimTrackMap); } void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, - const TrackerTopology* tTopo, - const TrackerGeometry* tkGeom, const TrackerHitAssociator& associateRecHit, const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, const std::map<unsigned int, SimTrack>& selectedSimTrackMap) { @@ -100,11 +102,11 @@ void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, unsigned int rawid(DSViter->detId()); DetId detId(rawid); // Get the geomdet - const GeomDetUnit* geomDetunit(tkGeom->idToDetUnit(detId)); + const GeomDetUnit* geomDetunit(tkGeom_->idToDetUnit(detId)); if (!geomDetunit) continue; // determine the detector we are in - std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo); + std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo_); if (nrechitLayerMap_primary.find(key) == nrechitLayerMap_primary.end()) { nrechitLayerMap_primary.insert(std::make_pair(key, DSViter->size())); } else { @@ -176,6 +178,13 @@ void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, layerMEs_[lme.first].numberRecHitsprimary->Fill(nrechitLayerMap_primary[lme.first]); } } + +void Phase2ITValidateRecHit::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { + edm::ESHandle<TrackerGeometry> geomHandle = iSetup.getHandle(geomToken_); + tkGeom_ = &(*geomHandle); + edm::ESHandle<TrackerTopology> tTopoHandle = iSetup.getHandle(topoToken_); + tTopo_ = tTopoHandle.product(); +} // // -- Book Histograms // @@ -185,30 +194,21 @@ void Phase2ITValidateRecHit::bookHistograms(DQMStore::IBooker& ibooker, std::string top_folder = config_.getParameter<std::string>("TopFolderName"); edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << top_folder; edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher; - edm::ESHandle<TrackerTopology> tTopoHandle; - iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); if (theTkDigiGeomWatcher.check(iSetup)) { - edm::ESHandle<TrackerGeometry> geom_handle; - iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geom_handle); - const TrackerGeometry* tGeom = geom_handle.product(); - for (auto const& det_u : tGeom->detUnits()) { + for (auto const& det_u : tkGeom_->detUnits()) { //Always check TrackerNumberingBuilder before changing this part if (!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB || det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC)) continue; unsigned int detId_raw = det_u->geographicalId().rawId(); - bookLayerHistos(ibooker, detId_raw, tTopo, top_folder); + bookLayerHistos(ibooker, detId_raw, top_folder); } } } // -void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, - unsigned int det_id, - const TrackerTopology* tTopo, - std::string& subdir) { +void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir) { ibooker.cd(); - std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo); + std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo_); if (key.empty()) return; if (layerMEs_.find(key) == layerMEs_.end()) { @@ -216,9 +216,7 @@ void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, RecHitME local_histos; std::ostringstream histoName; ibooker.setCurrentFolder(subdir + "/" + key); - std::cout << "Setting subfolder>>>" << subdir << "\t" << key << std::endl; - edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << key; - + edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << (subdir + "/" + key); histoName.str(""); histoName << "Delta_X"; local_histos.deltaX = diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h index 691942933f42d..3a4cbb6f3fb32 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h @@ -28,36 +28,35 @@ class SimTrack; class SimHit; class TrackerTopology; class TrackerGeometry; - +class TrackerDigiGeometryRecord; +class TrackerTopologyRcd; class Phase2ITValidateRecHit : public DQMEDAnalyzer { public: explicit Phase2ITValidateRecHit(const edm::ParameterSet&); ~Phase2ITValidateRecHit() override; void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; + void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override; private: void fillITHistos(const edm::Event& iEvent, - const TrackerTopology* tTopo, - const TrackerGeometry* tkGeom, const TrackerHitAssociator& associateRecHit, const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, const std::map<unsigned int, SimTrack>& selectedSimTrackMap); - void bookLayerHistos(DQMStore::IBooker& ibooker, - unsigned int det_id, - const TrackerTopology* tTopo, - std::string& subdir); + void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir); edm::ParameterSet config_; - bool pixelFlag_; TrackerHitAssociator::Config trackerHitAssociatorConfig_; const double simtrackminpt_; std::string geomType_; const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; const edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; std::vector<edm::EDGetTokenT<edm::PSimHitContainer>> simHitTokens_; - + const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; + const TrackerGeometry* tkGeom_ = nullptr; + const TrackerTopology* tTopo_ = nullptr; struct RecHitME { // use TH1D instead of TH1F to avoid stauration at 2^31 // above this increments with +1 don't work for float, need double From 182d4edaeba41b758d86b7297f6ff83176c7fcca Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Mon, 5 Oct 2020 21:02:07 +0200 Subject: [PATCH 448/778] code cleanups;adding fill descriptions;customize for premix wf --- .../plugins/Phase2ITMonitorRecHit.cc | 153 +++++++++++++++++ .../plugins/Phase2ITMonitorRecHit.h | 3 +- .../python/Phase2ITMonitorRecHit_cff.py | 5 + .../python/Phase2ITMonitorRecHit_cfi.py | 120 ------------- .../python/Phase2TrackerDQMFirstStep_cff.py | 2 +- .../plugins/Phase2ITValidateRecHit.cc | 157 ++++++++++++++++-- .../plugins/Phase2ITValidateRecHit.h | 1 + .../python/Phase2ITValidateRecHit_cff.py | 8 + .../python/Phase2ITValidateRecHit_cfi.py | 128 -------------- .../Phase2TrackerValidationFirstStep_cff.py | 2 +- 10 files changed, 316 insertions(+), 263 deletions(-) create mode 100644 DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cff.py delete mode 100644 DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cfi.py create mode 100644 Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cff.py delete mode 100644 Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc index af63ab4cdcddb..5d84526adb5e3 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc @@ -14,6 +14,10 @@ #include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Framework/interface/ESWatcher.h" +#include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> +#include <FWCore/ParameterSet/interface/ParameterSetDescription.h> +#include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> +#include <FWCore/ParameterSet/interface/ParameterSetDescription.h> #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" @@ -233,5 +237,154 @@ void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned layerMEs_.insert(std::make_pair(key, local_histos)); } } + +void Phase2ITMonitorRecHit::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + // rechitMonitorIT + edm::ParameterSetDescription desc; + desc.add<std::string>("TopFolderName", "TrackerPhase2ITRecHit"); + desc.add<edm::InputTag>("rechitsSrc", edm::InputTag("siPixelRecHits")); + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", 0.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.0); + psd0.add<int>("NxBins", 50); + desc.add<edm::ParameterSetDescription>("LocalNumberRecHits", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 300.0); + psd0.add<int>("NxBins", 1500); + psd0.add<int>("NyBins", 300); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 3000.0); + psd0.add<double>("xmin", -3000.0); + psd0.add<double>("ymin", 0.0); + desc.add<edm::ParameterSetDescription>("GlobalPositionRZ_perlayer", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 300.0); + psd0.add<int>("NxBins", 1500); + psd0.add<int>("NyBins", 300); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 3000.0); + psd0.add<double>("xmin", -3000.0); + psd0.add<double>("ymin", 0.0); + desc.add<edm::ParameterSetDescription>("GlobalPositionRZ_PXB", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 300.0); + psd0.add<int>("NxBins", 600); + psd0.add<int>("NyBins", 600); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 300.0); + psd0.add<double>("xmin", -300.0); + psd0.add<double>("ymin", -300.0); + desc.add<edm::ParameterSetDescription>("GlobalPositionXY_PXB", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 300.0); + psd0.add<int>("NxBins", 1500); + psd0.add<int>("NyBins", 300); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 3000.0); + psd0.add<double>("xmin", -3000.0); + psd0.add<double>("ymin", 0.0); + desc.add<edm::ParameterSetDescription>("GlobalPositionRZ_PXEC", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", 0.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.2); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("RecHitPosErrorX", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 300.0); + psd0.add<int>("NxBins", 600); + psd0.add<int>("NyBins", 600); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 300.0); + psd0.add<double>("xmin", -300.0); + psd0.add<double>("ymin", -300.0); + desc.add<edm::ParameterSetDescription>("GlobalPositionXY_perlayer", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", 0.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.0); + psd0.add<int>("NxBins", 50); + desc.add<edm::ParameterSetDescription>("GlobalNumberRecHits", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -0.5); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 20.5); + psd0.add<int>("NxBins", 21); + desc.add<edm::ParameterSetDescription>("LocalClusterSizeX", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -2.5); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 2.5); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("RecHitPosY", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", 0.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.2); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("RecHitPosErrorY", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 0.0); + psd0.add<int>("NxBins", 500); + psd0.add<int>("NyBins", 500); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.0); + psd0.add<double>("xmin", 0.0); + psd0.add<double>("ymin", 0.0); + desc.add<edm::ParameterSetDescription>("LocalPositionXY", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 300.0); + psd0.add<int>("NxBins", 600); + psd0.add<int>("NyBins", 600); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 300.0); + psd0.add<double>("xmin", -300.0); + psd0.add<double>("ymin", -300.0); + desc.add<edm::ParameterSetDescription>("GlobalPositionXY_PXEC", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -0.5); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 20.5); + psd0.add<int>("NxBins", 21); + desc.add<edm::ParameterSetDescription>("LocalClusterSizeY", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -2.5); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 2.5); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("RecHitPosX", psd0); + } + descriptions.add("Phase2ITMonitorRecHit", desc); +} //define this as a plug-in DEFINE_FWK_MODULE(Phase2ITMonitorRecHit); diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h index da4deef8329b4..c2c6ec8f43b2b 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h @@ -32,7 +32,8 @@ class Phase2ITMonitorRecHit : public DQMEDAnalyzer { ~Phase2ITMonitorRecHit() override; void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; - void dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup); + void dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void fillITHistos(const edm::Event& iEvent); diff --git a/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cff.py b/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cff.py new file mode 100644 index 0000000000000..a72ec04912847 --- /dev/null +++ b/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cff.py @@ -0,0 +1,5 @@ +import FWCore.ParameterSet.Config as cms +from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer +from DQM.SiTrackerPhase2.Phase2ITMonitorRecHit_cfi import Phase2ITMonitorRecHit + +rechitMonitorIT = Phase2ITMonitorRecHit.clone() diff --git a/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cfi.py b/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cfi.py deleted file mode 100644 index 44febc6bbf1d9..0000000000000 --- a/DQM/SiTrackerPhase2/python/Phase2ITMonitorRecHit_cfi.py +++ /dev/null @@ -1,120 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer -rechitMonitorIT = DQMEDAnalyzer('Phase2ITMonitorRecHit', - Verbosity = cms.bool(False), - TopFolderName = cms.string("TrackerPhase2ITRecHit"), - rechitsSrc = cms.InputTag("siPixelRecHits"), - GlobalNumberRecHits = cms.PSet( - NxBins = cms.int32(50), - xmin = cms.double(0.), - xmax = cms.double(0.), - switch = cms.bool(True) - ), - GlobalPositionXY_PXB = cms.PSet( - NxBins = cms.int32(600), - xmin = cms.double(-300.), - xmax = cms.double(300.), - NyBins = cms.int32(600), - ymin = cms.double(-300.), - ymax = cms.double(300.), - switch = cms.bool(True) - ), - GlobalPositionXY_PXEC = cms.PSet( - NxBins = cms.int32(600), - xmin = cms.double(-300.), - xmax = cms.double(300.), - NyBins = cms.int32(600), - ymin = cms.double(-300.), - ymax = cms.double(300.), - switch = cms.bool(True) - ), - GlobalPositionRZ_PXB = cms.PSet( - NxBins = cms.int32(1500), - xmin = cms.double(-3000.), - xmax = cms.double(3000.), - NyBins = cms.int32(300), - ymin = cms.double(0.), - ymax = cms.double(300.), - switch = cms.bool(True) - ), - GlobalPositionRZ_PXEC = cms.PSet( - NxBins = cms.int32(1500), - xmin = cms.double(-3000.), - xmax = cms.double(3000.), - NyBins = cms.int32(300), - ymin = cms.double(0.), - ymax = cms.double(300.), - switch = cms.bool(True) - ), - LocalNumberRecHits = cms.PSet( - NxBins = cms.int32(50), - xmin = cms.double(0.), - xmax = cms.double(0.), - switch = cms.bool(True) - ), - RecHitPosX = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(-2.5), - xmax = cms.double(2.5), - switch = cms.bool(True) - ), - RecHitPosY = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(-2.5), - xmax = cms.double(2.5), - switch = cms.bool(True) - ), - RecHitPosErrorX = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(0.), - xmax = cms.double(0.2), - switch = cms.bool(True) - ), - RecHitPosErrorY = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(0.), - xmax = cms.double(0.2), - switch = cms.bool(True) - ), - LocalClusterSizeX = cms.PSet( - NxBins = cms.int32(21), - xmin = cms.double(-0.5), - xmax = cms.double(20.5), - switch = cms.bool(True) - ), - LocalClusterSizeY = cms.PSet( - NxBins = cms.int32(21), - xmin = cms.double(-0.5), - xmax = cms.double(20.5), - switch = cms.bool(True) - ), - GlobalPositionXY_perlayer = cms.PSet( - NxBins = cms.int32(600), - xmin = cms.double(-300.), - xmax = cms.double(300.), - NyBins = cms.int32(600), - ymin = cms.double(-300.), - ymax = cms.double(300.), - switch = cms.bool(True) - ), - GlobalPositionRZ_perlayer = cms.PSet( - NxBins = cms.int32(1500), - xmin = cms.double(-3000.), - xmax = cms.double(3000.), - NyBins = cms.int32(300), - ymin = cms.double(0.), - ymax = cms.double(300.), - switch = cms.bool(True) - ), - LocalPositionXY = cms.PSet( - NxBins = cms.int32(500), - xmin = cms.double(0.), - xmax = cms.double(0.), - NyBins = cms.int32(500), - ymin = cms.double(0.), - ymax = cms.double(0.), - switch = cms.bool(True) - ), - -) diff --git a/DQM/SiTrackerPhase2/python/Phase2TrackerDQMFirstStep_cff.py b/DQM/SiTrackerPhase2/python/Phase2TrackerDQMFirstStep_cff.py index 9a5841d2e45ff..9ce8db692ceee 100644 --- a/DQM/SiTrackerPhase2/python/Phase2TrackerDQMFirstStep_cff.py +++ b/DQM/SiTrackerPhase2/python/Phase2TrackerDQMFirstStep_cff.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms from DQM.SiTrackerPhase2.Phase2TrackerMonitorDigi_cff import * -from DQM.SiTrackerPhase2.Phase2ITMonitorRecHit_cfi import * +from DQM.SiTrackerPhase2.Phase2ITMonitorRecHit_cff import * trackerphase2DQMSource = cms.Sequence( pixDigiMon + otDigiMon diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc index 5705f4905b087..94543f8e963bf 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc @@ -45,23 +45,15 @@ Phase2ITValidateRecHit::Phase2ITValidateRecHit(const edm::ParameterSet& iConfig) geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()), topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) { edm::LogInfo("Phase2ITValidateRecHit") << ">>> Construct Phase2ITValidateRecHit "; - for (const auto& itag : config_.getParameter<std::vector<edm::InputTag>>("PSimHitSource")) - simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag)); + for (const auto& itName : config_.getParameter<std::vector<std::string>>("ROUList")) { + simHitTokens_.push_back(consumes<std::vector<PSimHit>>(edm::InputTag("g4SimHits", itName))); + } } // Phase2ITValidateRecHit::~Phase2ITValidateRecHit() { edm::LogInfo("Phase2ITValidateRecHit") << ">>> Destroy Phase2ITValidateRecHit "; } void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - // Get the geometry - /* edm::ESHandle<TrackerGeometry> geomHandle = iSetup.getHandle(geomToken_); - //iSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); - const TrackerGeometry* tkGeom = &(*geomHandle); - - edm::ESHandle<TrackerTopology> tTopoHandle = iSetup.getHandle(topoToken_); - //iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); - const TrackerTopology* tTopo = tTopoHandle.product(); - */ std::vector<edm::Handle<edm::PSimHitContainer>> simHits; for (const auto& itoken : simHitTokens_) { edm::Handle<edm::PSimHitContainer> simHitHandle; @@ -274,6 +266,147 @@ void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigne layerMEs_.insert(std::make_pair(key, local_histos)); } } - +void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + // rechitValidIT + edm::ParameterSetDescription desc; + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 4.0); + psd0.add<int>("NxBins", 82); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymin", -4.0); + desc.add<edm::ParameterSetDescription>("PullY_primary", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -0.2); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.2); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("DeltaY_primary", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 0.02); + psd0.add<int>("NxBins", 82); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymin", -0.02); + desc.add<edm::ParameterSetDescription>("DeltaY_eta", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", 0.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.0); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("nRecHits_primary", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 4.0); + psd0.add<int>("NxBins", 82); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymin", -4.0); + desc.add<edm::ParameterSetDescription>("PullX_eta", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -0.2); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.2); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("DeltaX", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -0.2); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.2); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("DeltaY", psd0); + } + desc.add<bool>("Verbosity", false); + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 4.0); + psd0.add<int>("NxBins", 82); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymin", -4.0); + desc.add<edm::ParameterSetDescription>("PullY_eta", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -4.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.0); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("PullY", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 4.0); + psd0.add<int>("NxBins", 82); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymin", -4.0); + desc.add<edm::ParameterSetDescription>("PullX_primary", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("ymax", 0.02); + psd0.add<int>("NxBins", 82); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymin", -0.02); + desc.add<edm::ParameterSetDescription>("DeltaX_eta", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -4.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.0); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("PullX", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<double>("xmin", -0.2); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 0.2); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("DeltaX_primary", psd0); + } + //to be used in TrackerHitAssociator + desc.add<bool>("associatePixel", true); + desc.add<bool>("associateStrip", false); + desc.add<bool>("usePhase2Tracker", true); + desc.add<bool>("associateRecoTracks", false); + desc.add<bool>("associateHitbySimTrack", true); + desc.add<edm::InputTag>("pixelSimLinkSrc", edm::InputTag("simSiPixelDigis", "Pixel")); + desc.add<std::vector<std::string>>("ROUList", + { + "TrackerHitsPixelBarrelLowTof", + "TrackerHitsPixelBarrelHighTof", + "TrackerHitsPixelEndcapLowTof", + "TrackerHitsPixelEndcapHighTof", + }); + // + desc.add<edm::InputTag>("simTracksSrc", edm::InputTag("g4SimHits")); + desc.add<edm::InputTag>("SimVertexSource", edm::InputTag("g4SimHits")); + desc.add<double>("SimTrackMinPt", 2.0); + desc.add<edm::InputTag>("rechitsSrc", edm::InputTag("siPixelRecHits")); + desc.add<std::string>("TopFolderName", "TrackerPhase2ITRecHitV"); + descriptions.add("Phase2ITValidateRecHit", desc); +} //define this as a plug-in DEFINE_FWK_MODULE(Phase2ITValidateRecHit); diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h index 3a4cbb6f3fb32..05ddc936ed1fc 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h @@ -37,6 +37,7 @@ class Phase2ITValidateRecHit : public DQMEDAnalyzer { void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void fillITHistos(const edm::Event& iEvent, diff --git a/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cff.py b/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cff.py new file mode 100644 index 0000000000000..affc43237f52c --- /dev/null +++ b/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cff.py @@ -0,0 +1,8 @@ +import FWCore.ParameterSet.Config as cms +from Validation.SiTrackerPhase2V.Phase2ITValidateRecHit_cfi import Phase2ITValidateRecHit +rechitValidIT = Phase2ITValidateRecHit.clone() + +from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2 +premix_stage2.toModify(rechitValidIT, + pixelSimLinkSrc = "mixData:PixelDigiSimLink", +) diff --git a/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py b/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py deleted file mode 100644 index 4a0525db5f8b3..0000000000000 --- a/Validation/SiTrackerPhase2V/python/Phase2ITValidateRecHit_cfi.py +++ /dev/null @@ -1,128 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer -rechitValidIT = DQMEDAnalyzer('Phase2ITValidateRecHit', - Verbosity = cms.bool(False), - TopFolderName = cms.string("TrackerPhase2ITRecHitV"), - ITPlotFillingFlag = cms.bool(False), - rechitsSrc = cms.InputTag("siPixelRecHits"), - InnerPixelDigiSource = cms.InputTag("simSiPixelDigis","Pixel"), - InnerPixelDigiSimLinkSource = cms.InputTag("simSiPixelDigis", "Pixel"), - PSimHitSource = cms.VInputTag('g4SimHits:TrackerHitsPixelBarrelLowTof', - 'g4SimHits:TrackerHitsPixelBarrelHighTof', - 'g4SimHits:TrackerHitsPixelEndcapLowTof', - 'g4SimHits:TrackerHitsPixelEndcapHighTof', - 'g4SimHits:TrackerHitsTIBLowTof', - 'g4SimHits:TrackerHitsTIBHighTof', - 'g4SimHits:TrackerHitsTIDLowTof', - 'g4SimHits:TrackerHitsTIDHighTof', - 'g4SimHits:TrackerHitsTOBLowTof', - 'g4SimHits:TrackerHitsTOBHighTof', - 'g4SimHits:TrackerHitsTECLowTof', - 'g4SimHits:TrackerHitsTECHighTof'), - simTracksSrc = cms.InputTag("g4SimHits"), - SimTrackMinPt = cms.double(2.), - SimTrackSource = cms.InputTag("g4SimHits"), - SimVertexSource = cms.InputTag("g4SimHits"), - usePhase2Tracker = cms.bool(True),#these are used by simHit assoc. - associatePixel = cms.bool(True), - associateRecoTracks = cms.bool(False), - associateStrip = cms.bool(False), - associateHitbySimTrack = cms.bool(True), - pixelSimLinkSrc = cms.InputTag("simSiPixelDigis","Pixel"), - ROUList = cms.vstring('g4SimHitsTrackerHitsPixelBarrelLowTof', - 'g4SimHitsTrackerHitsPixelBarrelHighTof', - 'g4SimHitsTrackerHitsPixelEndcapLowTof', - 'g4SimHitsTrackerHitsPixelEndcapHighTof', - ), - DeltaX = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(-0.2), - xmax = cms.double(0.2), - switch = cms.bool(True) - ), - DeltaY = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(-0.2), - xmax = cms.double(0.2), - switch = cms.bool(True) - ), - PullX = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(-4.), - xmax = cms.double(4.), - switch = cms.bool(True) - ), - PullY = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(-4.), - xmax = cms.double(4.), - switch = cms.bool(True) - ), - DeltaX_eta = cms.PSet( - NxBins = cms.int32(82), - xmin = cms.double(-4.1), - xmax = cms.double(4.1), - ymin = cms.double(-0.02), - ymax = cms.double(0.02), - switch = cms.bool(True) - ), - DeltaY_eta = cms.PSet( - NxBins = cms.int32(82), - xmin = cms.double(-4.1), - xmax = cms.double(4.1), - ymin = cms.double(-0.02), - ymax = cms.double(0.02), - switch = cms.bool(True) - ), - PullX_eta = cms.PSet( - NxBins = cms.int32(82), - xmin = cms.double(-4.1), - xmax = cms.double(4.1), - ymin = cms.double(-4.), - ymax = cms.double(4.), - switch = cms.bool(True) - ), - PullY_eta = cms.PSet( - NxBins = cms.int32(82), - xmin = cms.double(-4.1), - xmax = cms.double(4.1), - ymin = cms.double(-4.), - ymax = cms.double(4.), - switch = cms.bool(True) - ), - nRecHits_primary = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(0.), - xmax = cms.double(0.), - switch = cms.bool(True) - ), - DeltaX_primary = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(-0.2), - xmax = cms.double(0.2), - switch = cms.bool(True) - ), - DeltaY_primary = cms.PSet( - NxBins = cms.int32(100), - xmin = cms.double(-0.2), - xmax = cms.double(0.2), - switch = cms.bool(True) - ), - PullX_primary = cms.PSet( - NxBins = cms.int32(82), - xmin = cms.double(-4.1), - xmax = cms.double(4.1), - ymin = cms.double(-4.), - ymax = cms.double(4.), - switch = cms.bool(True) - ), - PullY_primary = cms.PSet( - NxBins = cms.int32(82), - xmin = cms.double(-4.1), - xmax = cms.double(4.1), - ymin = cms.double(-4.), - ymax = cms.double(4.), - switch = cms.bool(True) - ) -) diff --git a/Validation/SiTrackerPhase2V/python/Phase2TrackerValidationFirstStep_cff.py b/Validation/SiTrackerPhase2V/python/Phase2TrackerValidationFirstStep_cff.py index ae65faa17f373..49948e6688d0d 100644 --- a/Validation/SiTrackerPhase2V/python/Phase2TrackerValidationFirstStep_cff.py +++ b/Validation/SiTrackerPhase2V/python/Phase2TrackerValidationFirstStep_cff.py @@ -1,6 +1,6 @@ import FWCore.ParameterSet.Config as cms from Validation.SiTrackerPhase2V.Phase2TrackerValidateDigi_cff import * -from Validation.SiTrackerPhase2V.Phase2ITValidateRecHit_cfi import * +from Validation.SiTrackerPhase2V.Phase2ITValidateRecHit_cff import * trackerphase2ValidationSource = cms.Sequence(pixDigiValid + otDigiValid + rechitValidIT From 516628c187ee930f302d640d45ebaf3b067c4e3e Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Wed, 7 Oct 2020 09:07:29 +0200 Subject: [PATCH 449/778] bug fixes;fill descriptions update; --- .../interface/TrackerPhase2DQMUtil.h | 16 +- .../plugins/Phase2ITMonitorRecHit.cc | 155 +++++++++++------- .../plugins/Phase2ITMonitorRecHit.h | 6 +- .../plugins/Phase2ITValidateRecHit.cc | 123 ++++++++------ 4 files changed, 183 insertions(+), 117 deletions(-) diff --git a/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h b/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h index bb32e0cb90f77..22585960d98e8 100644 --- a/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h +++ b/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h @@ -1,5 +1,5 @@ -#ifndef _Validation_SiTrackerPhase2V_Phase2TrackierValidationUtil_h -#define _Validation_SiTrackerPhase2V_Phase2TrackierValidationUtil_h +#ifndef _DQM_SiTrackerPhase2_Phase2TrackerValidationUtil_h +#define _DQM_SiTrackerPhase2_Phase2TrackerValidationUtil_h #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DQMServices/Core/interface/MonitorElement.h" @@ -61,8 +61,8 @@ namespace Phase2TkUtil { MonitorElement* book1DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { MonitorElement* temp = nullptr; if (hpars.getParameter<bool>("switch")) { - temp = ibooker.book1D(hname, - hname, + temp = ibooker.book1D(hpars.getParameter<std::string>("name"), + hpars.getParameter<std::string>("title"), hpars.getParameter<int32_t>("NxBins"), hpars.getParameter<double>("xmin"), hpars.getParameter<double>("xmax")); @@ -73,8 +73,8 @@ namespace Phase2TkUtil { MonitorElement* book2DFromPSet(const edm::ParameterSet& hpars, const std::string& hname, DQMStore::IBooker& ibooker) { MonitorElement* temp = nullptr; if (hpars.getParameter<bool>("switch")) { - temp = ibooker.book2D(hname, - hname, + temp = ibooker.book2D(hpars.getParameter<std::string>("name"), + hpars.getParameter<std::string>("title"), hpars.getParameter<int32_t>("NxBins"), hpars.getParameter<double>("xmin"), hpars.getParameter<double>("xmax"), @@ -90,8 +90,8 @@ namespace Phase2TkUtil { DQMStore::IBooker& ibooker) { MonitorElement* temp = nullptr; if (hpars.getParameter<bool>("switch")) { - temp = ibooker.bookProfile(hname, - hname, + temp = ibooker.bookProfile(hpars.getParameter<std::string>("name"), + hpars.getParameter<std::string>("title"), hpars.getParameter<int32_t>("NxBins"), hpars.getParameter<double>("xmin"), hpars.getParameter<double>("xmax"), diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc index 5d84526adb5e3..8fa54220378cd 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc @@ -107,11 +107,12 @@ void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent) { if (layerMEs_[key].posX) layerMEs_[key].posX->Fill(lp.x()); if (layerMEs_[key].posY) - layerMEs_[key].posX->Fill(lp.y()); - if (layerMEs_[key].posX) - layerMEs_[key].poserrX->Fill(rechitIt->localPositionError().xx()); - if (layerMEs_[key].posY) - layerMEs_[key].poserrY->Fill(rechitIt->localPositionError().yy()); + layerMEs_[key].posY->Fill(lp.y()); + float eta = geomDetunit->surface().toGlobal(lp).eta(); + if (layerMEs_[key].poserrX) + layerMEs_[key].poserrX->Fill(eta, million * rechitIt->localPositionError().xx()); + if (layerMEs_[key].poserrY) + layerMEs_[key].poserrY->Fill(eta, million * rechitIt->localPositionError().yy()); } //end loop over rechits of a detId } //End loop over DetSetVector @@ -192,6 +193,7 @@ void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned histoName << "Number_RecHits"; local_histos.numberRecHits = Phase2TkUtil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("LocalNumberRecHits"), histoName.str(), ibooker); + histoName.str(""); histoName << "RecHit_X"; local_histos.posX = @@ -203,19 +205,20 @@ void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosY"), histoName.str(), ibooker); histoName.str(""); - histoName << "RecHit_X_error"; - local_histos.poserrX = Phase2TkUtil::book1DFromPSet( - config_.getParameter<edm::ParameterSet>("RecHitPosErrorX"), histoName.str(), ibooker); + histoName << "RecHit_X_error_Vs_eta"; + local_histos.poserrX = Phase2TkUtil::bookProfile1DFromPSet( + config_.getParameter<edm::ParameterSet>("RecHitPosErrorX_Eta"), histoName.str(), ibooker); histoName.str(""); - histoName << "RecHit_Y_error"; - local_histos.poserrY = Phase2TkUtil::book1DFromPSet( - config_.getParameter<edm::ParameterSet>("RecHitPosErrorY"), histoName.str(), ibooker); + histoName << "RecHit_Y_error_Vs_eta"; + local_histos.poserrY = Phase2TkUtil::bookProfile1DFromPSet( + config_.getParameter<edm::ParameterSet>("RecHitPosErrorY_Eta"), histoName.str(), ibooker); histoName.str(""); histoName << "Cluster_SizeX"; local_histos.clusterSizeX = Phase2TkUtil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("LocalClusterSizeX"), histoName.str(), ibooker); + histoName.str(""); histoName << "Cluster_SizeY"; local_histos.clusterSizeY = Phase2TkUtil::book1DFromPSet( @@ -230,6 +233,7 @@ void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned histoName << "Global_Position_RZ"; local_histos.globalPosRZ = Phase2TkUtil::book2DFromPSet( config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_perlayer"), histoName.str(), ibooker); + histoName.str(""); histoName << "Local_Position_XY"; local_histos.localPosXY = Phase2TkUtil::book2DFromPSet( @@ -241,29 +245,20 @@ void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned void Phase2ITMonitorRecHit::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { // rechitMonitorIT edm::ParameterSetDescription desc; - desc.add<std::string>("TopFolderName", "TrackerPhase2ITRecHit"); - desc.add<edm::InputTag>("rechitsSrc", edm::InputTag("siPixelRecHits")); { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "NumberRecHits"); + psd0.add<std::string>("title", "NumberRecHits;Number of RecHits;"); psd0.add<double>("xmin", 0.0); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 0.0); psd0.add<int>("NxBins", 50); - desc.add<edm::ParameterSetDescription>("LocalNumberRecHits", psd0); - } - { - edm::ParameterSetDescription psd0; - psd0.add<double>("ymax", 300.0); - psd0.add<int>("NxBins", 1500); - psd0.add<int>("NyBins", 300); - psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 3000.0); - psd0.add<double>("xmin", -3000.0); - psd0.add<double>("ymin", 0.0); - desc.add<edm::ParameterSetDescription>("GlobalPositionRZ_perlayer", psd0); + desc.add<edm::ParameterSetDescription>("GlobalNumberRecHits", psd0); } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Global_Position_RZ_IT_barrel"); + psd0.add<std::string>("title", "Global_Position_RZ_IT_barrel;z [mm];r [mm]"); psd0.add<double>("ymax", 300.0); psd0.add<int>("NxBins", 1500); psd0.add<int>("NyBins", 300); @@ -275,6 +270,8 @@ void Phase2ITMonitorRecHit::fillDescriptions(edm::ConfigurationDescriptions& des } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Global_Position_XY_IT_barrel"); + psd0.add<std::string>("title", "Global_Position_XY_IT_barrel;x [mm];y [mm];"); psd0.add<double>("ymax", 300.0); psd0.add<int>("NxBins", 600); psd0.add<int>("NyBins", 600); @@ -286,6 +283,8 @@ void Phase2ITMonitorRecHit::fillDescriptions(edm::ConfigurationDescriptions& des } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Global_Position_RZ_IT_endcap"); + psd0.add<std::string>("title", "Global_Position_RZ_IT_endcap;z [mm];r [mm]"); psd0.add<double>("ymax", 300.0); psd0.add<int>("NxBins", 1500); psd0.add<int>("NyBins", 300); @@ -297,14 +296,8 @@ void Phase2ITMonitorRecHit::fillDescriptions(edm::ConfigurationDescriptions& des } { edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", 0.0); - psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 0.2); - psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("RecHitPosErrorX", psd0); - } - { - edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Global_Position_XY_IT_endcap"); + psd0.add<std::string>("title", "Global_Position_XY_IT_endcap; x [mm]; y [mm]"); psd0.add<double>("ymax", 300.0); psd0.add<int>("NxBins", 600); psd0.add<int>("NyBins", 600); @@ -312,42 +305,49 @@ void Phase2ITMonitorRecHit::fillDescriptions(edm::ConfigurationDescriptions& des psd0.add<double>("xmax", 300.0); psd0.add<double>("xmin", -300.0); psd0.add<double>("ymin", -300.0); - desc.add<edm::ParameterSetDescription>("GlobalPositionXY_perlayer", psd0); + desc.add<edm::ParameterSetDescription>("GlobalPositionXY_PXEC", psd0); } + //Per layer/ring histos { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "LocalNumberRecHits"); + psd0.add<std::string>("title", "NumberRecHits;Number of RecHits;"); psd0.add<double>("xmin", 0.0); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 0.0); psd0.add<int>("NxBins", 50); - desc.add<edm::ParameterSetDescription>("GlobalNumberRecHits", psd0); - } - { - edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", -0.5); - psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 20.5); - psd0.add<int>("NxBins", 21); - desc.add<edm::ParameterSetDescription>("LocalClusterSizeX", psd0); + desc.add<edm::ParameterSetDescription>("LocalNumberRecHits", psd0); } { edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", -2.5); + psd0.add<std::string>("name", "Global_Position_RZ"); + psd0.add<std::string>("title", "Global_Position_RZ;z [mm];r [mm]"); + psd0.add<double>("ymax", 300.0); + psd0.add<int>("NxBins", 1500); + psd0.add<int>("NyBins", 300); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 2.5); - psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("RecHitPosY", psd0); + psd0.add<double>("xmax", 3000.0); + psd0.add<double>("xmin", -3000.0); + psd0.add<double>("ymin", 0.0); + desc.add<edm::ParameterSetDescription>("GlobalPositionRZ_perlayer", psd0); } { edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", 0.0); + psd0.add<std::string>("name", "Global_Position_XY"); + psd0.add<std::string>("title", "Global_Position_XY;x [mm]; y[mm]"); + psd0.add<double>("ymax", 300.0); + psd0.add<int>("NxBins", 600); + psd0.add<int>("NyBins", 600); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 0.2); - psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("RecHitPosErrorY", psd0); + psd0.add<double>("xmax", 300.0); + psd0.add<double>("xmin", -300.0); + psd0.add<double>("ymin", -300.0); + desc.add<edm::ParameterSetDescription>("GlobalPositionXY_perlayer", psd0); } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Local_Position_XY"); + psd0.add<std::string>("title", "Local_Position_XY; x; y"); psd0.add<double>("ymax", 0.0); psd0.add<int>("NxBins", 500); psd0.add<int>("NyBins", 500); @@ -359,17 +359,18 @@ void Phase2ITMonitorRecHit::fillDescriptions(edm::ConfigurationDescriptions& des } { edm::ParameterSetDescription psd0; - psd0.add<double>("ymax", 300.0); - psd0.add<int>("NxBins", 600); - psd0.add<int>("NyBins", 600); + psd0.add<std::string>("name", "Cluster_SizeX"); + psd0.add<std::string>("title", "Cluster_SizeX; cluster size y;"); + psd0.add<double>("xmin", -0.5); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 300.0); - psd0.add<double>("xmin", -300.0); - psd0.add<double>("ymin", -300.0); - desc.add<edm::ParameterSetDescription>("GlobalPositionXY_PXEC", psd0); + psd0.add<double>("xmax", 20.5); + psd0.add<int>("NxBins", 21); + desc.add<edm::ParameterSetDescription>("LocalClusterSizeX", psd0); } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Cluster_SizeY"); + psd0.add<std::string>("title", "Cluster_SizeY;cluster size y;"); psd0.add<double>("xmin", -0.5); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 20.5); @@ -378,12 +379,50 @@ void Phase2ITMonitorRecHit::fillDescriptions(edm::ConfigurationDescriptions& des } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "RecHit_X"); + psd0.add<std::string>("title", "RecHit_X;RecHit position X dimension;"); psd0.add<double>("xmin", -2.5); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 2.5); psd0.add<int>("NxBins", 100); desc.add<edm::ParameterSetDescription>("RecHitPosX", psd0); } + { + edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "RecHit_Y"); + psd0.add<std::string>("title", "RecHit_Y;RecHit position X dimension;"); + psd0.add<double>("xmin", -2.5); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 2.5); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("RecHitPosY", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "RecHit_X_error_Vs_eta"); + psd0.add<std::string>("title", "RecHit_X_error_Vs_eta;#eta;x error #times 10^{6}"); + psd0.add<bool>("switch", true); + psd0.add<int>("NxBins", 82); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymax", 10.0); + psd0.add<double>("ymin", 0.); + desc.add<edm::ParameterSetDescription>("RecHitPosErrorX_Eta", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "RecHit_Y_error_Vs_eta"); + psd0.add<std::string>("title", "RecHit_Y_error_Vs_eta;#eta;y error #times 10^{6}"); + psd0.add<bool>("switch", true); + psd0.add<int>("NxBins", 82); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymax", 10.0); + psd0.add<double>("ymin", 0.); + desc.add<edm::ParameterSetDescription>("RecHitPosErrorY_Eta", psd0); + } + desc.add<std::string>("TopFolderName", "TrackerPhase2ITRecHit"); + desc.add<edm::InputTag>("rechitsSrc", edm::InputTag("siPixelRecHits")); descriptions.add("Phase2ITMonitorRecHit", desc); } //define this as a plug-in diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h index c2c6ec8f43b2b..9e4ac031e9b7b 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h @@ -1,5 +1,5 @@ -#ifndef _Validation_SiTrackerPhase2V_Phase2ITMonitorRecHit_h -#define _Validation_SiTrackerPhase2V_Phase2ITMonitorRecHit_h +#ifndef _DQM_SiTrackerPhase2_Phase2ITMonitorRecHit_h +#define _DQM_SiTrackerPhase2_Phase2ITMonitorRecHit_h #include <iostream> #include <map> #include <vector> @@ -47,7 +47,7 @@ class Phase2ITMonitorRecHit : public DQMEDAnalyzer { const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; const TrackerGeometry* tkGeom_ = nullptr; const TrackerTopology* tTopo_ = nullptr; - + static constexpr float million = 1e6; MonitorElement* numberRecHits_; MonitorElement* globalXY_barrel_; MonitorElement* globalXY_endcap_; diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc index 94543f8e963bf..eb5b525804d99 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc @@ -271,42 +271,72 @@ void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& de edm::ParameterSetDescription desc; { edm::ParameterSetDescription psd0; - psd0.add<double>("ymax", 4.0); - psd0.add<int>("NxBins", 82); + psd0.add<std::string>("name", "Delta_X"); + psd0.add<std::string>("title", "Delta_X;RecHit resolution X dimensiom"); + psd0.add<double>("xmin", -0.2); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 4.1); - psd0.add<double>("xmin", -4.1); - psd0.add<double>("ymin", -4.0); - desc.add<edm::ParameterSetDescription>("PullY_primary", psd0); + psd0.add<double>("xmax", 0.2); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("DeltaX", psd0); } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Delta_Y"); + psd0.add<std::string>("title", "Delta_Y;RecHit resolution Y dimensiom;"); psd0.add<double>("xmin", -0.2); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 0.2); psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("DeltaY_primary", psd0); + desc.add<edm::ParameterSetDescription>("DeltaY", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Pull_X"); + psd0.add<std::string>("title", "Pull_X;pull x;"); + psd0.add<double>("xmin", -4.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.0); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("PullX", psd0); + } + { + edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Pull_Y"); + psd0.add<std::string>("title", "Pull_Y;pull y;"); + psd0.add<double>("xmin", -4.0); + psd0.add<bool>("switch", true); + psd0.add<double>("xmax", 4.0); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("PullY", psd0); } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Delta_X_vs_Eta"); + psd0.add<std::string>("title", "Delta_X_vs_Eta;#eta;#Delta x"); psd0.add<double>("ymax", 0.02); psd0.add<int>("NxBins", 82); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 4.1); psd0.add<double>("xmin", -4.1); psd0.add<double>("ymin", -0.02); - desc.add<edm::ParameterSetDescription>("DeltaY_eta", psd0); + desc.add<edm::ParameterSetDescription>("DeltaX_eta", psd0); } { edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", 0.0); + psd0.add<std::string>("name", "Delta_Y_vs_Eta"); + psd0.add<std::string>("title", "Delta_Y_vs_Eta;#eta;#Delta y"); + psd0.add<double>("ymax", 0.02); + psd0.add<int>("NxBins", 82); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 0.0); - psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("nRecHits_primary", psd0); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymin", -0.02); + desc.add<edm::ParameterSetDescription>("DeltaY_eta", psd0); } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Pull_X_vs_Eta"); + psd0.add<std::string>("title", "Pull_X_vs_Eta;#eta;pull x"); psd0.add<double>("ymax", 4.0); psd0.add<int>("NxBins", 82); psd0.add<bool>("switch", true); @@ -317,41 +347,51 @@ void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& de } { edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", -0.2); + psd0.add<std::string>("name", "Pull_Y_vs_Eta"); + psd0.add<std::string>("title", "Pull_Y_vs_Eta;#eta;pull y"); + psd0.add<double>("ymax", 4.0); + psd0.add<int>("NxBins", 82); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 0.2); - psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("DeltaX", psd0); + psd0.add<double>("xmax", 4.1); + psd0.add<double>("xmin", -4.1); + psd0.add<double>("ymin", -4.0); + desc.add<edm::ParameterSetDescription>("PullY_eta", psd0); } + //simhits primary { edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", -0.2); + psd0.add<std::string>("name", "Number_RecHits_matched_PrimarySimTrack"); + psd0.add<std::string>("title", "Number of RecHits matched to primary SimTrack;;"); + psd0.add<double>("xmin", 0.0); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 0.2); + psd0.add<double>("xmax", 0.0); psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("DeltaY", psd0); + desc.add<edm::ParameterSetDescription>("nRecHits_primary", psd0); } - desc.add<bool>("Verbosity", false); { edm::ParameterSetDescription psd0; - psd0.add<double>("ymax", 4.0); - psd0.add<int>("NxBins", 82); + psd0.add<std::string>("name", "Delta_X_SimHitPrimary"); + psd0.add<std::string>("title", "Delta_X_SimHitPrimary;#delta x;"); + psd0.add<double>("xmin", -0.2); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 4.1); - psd0.add<double>("xmin", -4.1); - psd0.add<double>("ymin", -4.0); - desc.add<edm::ParameterSetDescription>("PullY_eta", psd0); + psd0.add<double>("xmax", 0.2); + psd0.add<int>("NxBins", 100); + desc.add<edm::ParameterSetDescription>("DeltaX_primary", psd0); } { edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", -4.0); + psd0.add<std::string>("name", "Delta_Y_SimHitPrimary"); + psd0.add<std::string>("title", "Delta_Y_SimHitPrimary;#Delta y;"); + psd0.add<double>("xmin", -0.2); psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 4.0); + psd0.add<double>("xmax", 0.2); psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("PullY", psd0); + desc.add<edm::ParameterSetDescription>("DeltaY_primary", psd0); } { edm::ParameterSetDescription psd0; + psd0.add<std::string>("name", "Pull_X_SimHitPrimary"); + psd0.add<std::string>("title", "Pull_X_SimHitPrimary;pull x;"); psd0.add<double>("ymax", 4.0); psd0.add<int>("NxBins", 82); psd0.add<bool>("switch", true); @@ -362,29 +402,15 @@ void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& de } { edm::ParameterSetDescription psd0; - psd0.add<double>("ymax", 0.02); + psd0.add<std::string>("name", "Pull_Y_SimHitPrimary"); + psd0.add<std::string>("title", "Pull_Y_SimHitPrimary;pull y;"); + psd0.add<double>("ymax", 4.0); psd0.add<int>("NxBins", 82); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 4.1); psd0.add<double>("xmin", -4.1); - psd0.add<double>("ymin", -0.02); - desc.add<edm::ParameterSetDescription>("DeltaX_eta", psd0); - } - { - edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", -4.0); - psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 4.0); - psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("PullX", psd0); - } - { - edm::ParameterSetDescription psd0; - psd0.add<double>("xmin", -0.2); - psd0.add<bool>("switch", true); - psd0.add<double>("xmax", 0.2); - psd0.add<int>("NxBins", 100); - desc.add<edm::ParameterSetDescription>("DeltaX_primary", psd0); + psd0.add<double>("ymin", -4.0); + desc.add<edm::ParameterSetDescription>("PullY_primary", psd0); } //to be used in TrackerHitAssociator desc.add<bool>("associatePixel", true); @@ -406,6 +432,7 @@ void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& de desc.add<double>("SimTrackMinPt", 2.0); desc.add<edm::InputTag>("rechitsSrc", edm::InputTag("siPixelRecHits")); desc.add<std::string>("TopFolderName", "TrackerPhase2ITRecHitV"); + desc.add<bool>("Verbosity", false); descriptions.add("Phase2ITValidateRecHit", desc); } //define this as a plug-in From c36609d05cb1ed4d4f7690b7197f0a6e58bc58cc Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Fri, 9 Oct 2020 09:21:04 +0200 Subject: [PATCH 450/778] address changes from review --- .../interface/TrackerPhase2DQMUtil.h | 53 +----- DQM/SiTrackerPhase2/plugins/BuildFile.xml | 1 + .../plugins/Phase2ITMonitorRecHit.cc | 148 ++++++++++----- .../plugins/Phase2ITMonitorRecHit.h | 71 -------- DQM/SiTrackerPhase2/src/BuildFile.xml | 5 + .../src/TrackerPhase2DQMUtil.cc | 47 +++++ .../interface/TrackerPhase2ValidationUtil.h | 18 +- .../SiTrackerPhase2V/plugins/BuildFile.xml | 3 +- .../plugins/Phase2ITValidateRecHit.cc | 168 ++++++++++++------ .../plugins/Phase2ITValidateRecHit.h | 81 --------- Validation/SiTrackerPhase2V/src/BuildFile.xml | 5 + .../src/TrackerPhase2ValidationUtil.cc | 12 ++ 12 files changed, 290 insertions(+), 322 deletions(-) delete mode 100644 DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h create mode 100644 DQM/SiTrackerPhase2/src/BuildFile.xml create mode 100644 DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc delete mode 100644 Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h create mode 100644 Validation/SiTrackerPhase2V/src/BuildFile.xml create mode 100644 Validation/SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc diff --git a/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h b/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h index 22585960d98e8..c6a73cd4bf54c 100644 --- a/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h +++ b/DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h @@ -7,54 +7,10 @@ #include <string> #include <sstream> -namespace Phase2TkUtil { +namespace phase2tkutil { - std::string getITHistoId(uint32_t det_id, const TrackerTopology* tTopo) { - std::string Disc; - std::ostringstream fname1; - int layer = tTopo->getITPixelLayerNumber(det_id); - - if (layer < 0) - return ""; - if (layer < 100) { - fname1 << "Barrel/"; - fname1 << "Layer" << layer; - fname1 << ""; - } else { - int side = tTopo->pxfSide(det_id); - fname1 << "EndCap_Side" << side << "/"; - int disc = tTopo->pxfDisk(det_id); - Disc = (disc < 9) ? "EPix" : "FPix"; - ; - fname1 << Disc << "/"; - int ring = tTopo->pxfBlade(det_id); - fname1 << "Ring" << ring; - } - return fname1.str(); - } - - std::string getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo) { - std::string Disc; - std::ostringstream fname1; - int layer = tTopo->getOTLayerNumber(det_id); - - if (layer < 0) - return ""; - if (layer < 100) { - fname1 << "Barrel/"; - fname1 << "Layer" << layer; - fname1 << ""; - } else { - int side = tTopo->tidSide(det_id); - fname1 << "EndCap_Side" << side << "/"; - int disc = tTopo->tidWheel(det_id); - Disc = (disc < 3) ? "TEDD_1" : "TEDD_2"; - fname1 << Disc << "/"; - int ring = tTopo->tidRing(det_id); - fname1 << "Ring" << ring; - } - return fname1.str(); - } + std::string getITHistoId(uint32_t det_id, const TrackerTopology* tTopo); + std::string getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo); typedef dqm::reco::MonitorElement MonitorElement; typedef dqm::reco::DQMStore DQMStore; @@ -100,6 +56,5 @@ namespace Phase2TkUtil { } return temp; } -} // namespace Phase2TkUtil - +} // namespace phase2tkutil #endif diff --git a/DQM/SiTrackerPhase2/plugins/BuildFile.xml b/DQM/SiTrackerPhase2/plugins/BuildFile.xml index ffc0d608890b5..b4d852597bbd3 100644 --- a/DQM/SiTrackerPhase2/plugins/BuildFile.xml +++ b/DQM/SiTrackerPhase2/plugins/BuildFile.xml @@ -8,6 +8,7 @@ <use name="Geometry/CommonDetUnit"/> <use name="Geometry/TrackerGeometryBuilder"/> <use name="DQMServices/Core"/> +<use name="DQM/SiTrackerPhase2"/> <use name="boost_system"/> <use name="rootcling"/> <flags EDM_PLUGIN="1"/> diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc index 8fa54220378cd..a75e7f7b8072c 100644 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc +++ b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.cc @@ -10,31 +10,83 @@ // // system include files #include <memory> -#include "DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h" -#include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include <map> +#include <vector> +#include <algorithm> #include "FWCore/Framework/interface/ESWatcher.h" -#include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> -#include <FWCore/ParameterSet/interface/ParameterSetDescription.h> -#include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> -#include <FWCore/ParameterSet/interface/ParameterSetDescription.h> -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/GeometrySurface/interface/LocalError.h" +#include "DataFormats/GeometryVector/interface/LocalPoint.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/TrackerGeomDet.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "DataFormats/GeometrySurface/interface/LocalError.h" -#include "DataFormats/GeometryVector/interface/LocalPoint.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" // DQM Histograming #include "DQMServices/Core/interface/MonitorElement.h" -// -// constructors -// +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" + +class Phase2ITMonitorRecHit : public DQMEDAnalyzer { +public: + explicit Phase2ITMonitorRecHit(const edm::ParameterSet&); + ~Phase2ITMonitorRecHit() override; + void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; + void dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void fillITHistos(const edm::Event& iEvent); + void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir); + + edm::ParameterSet config_; + std::string geomType_; + const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; + const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; + const TrackerGeometry* tkGeom_ = nullptr; + const TrackerTopology* tTopo_ = nullptr; + static constexpr float million = 1e6; + MonitorElement* numberRecHits_; + MonitorElement* globalXY_barrel_; + MonitorElement* globalXY_endcap_; + MonitorElement* globalRZ_barrel_; + MonitorElement* globalRZ_endcap_; + + struct RecHitME { + MonitorElement* numberRecHits = nullptr; + MonitorElement* globalPosXY = nullptr; + MonitorElement* globalPosRZ = nullptr; + MonitorElement* localPosXY = nullptr; + MonitorElement* posX = nullptr; + MonitorElement* posY = nullptr; + MonitorElement* poserrX = nullptr; + MonitorElement* poserrY = nullptr; + MonitorElement* clusterSizeX = nullptr; + MonitorElement* clusterSizeY = nullptr; + }; + std::map<std::string, RecHitME> layerMEs_; +}; + Phase2ITMonitorRecHit::Phase2ITMonitorRecHit(const edm::ParameterSet& iConfig) : config_(iConfig), tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))), @@ -58,27 +110,25 @@ void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent) { std::map<std::string, unsigned int> nrechitLayerMap; unsigned long int nTotrechitsinevt = 0; // Loop over modules - SiPixelRecHitCollection::const_iterator DSViter; - for (DSViter = rechits->begin(); DSViter != rechits->end(); ++DSViter) { + for (const auto& DSViter : *rechits) { // Get the detector id - unsigned int rawid(DSViter->detId()); + unsigned int rawid(DSViter.detId()); DetId detId(rawid); // Get the geomdet const GeomDetUnit* geomDetunit(tkGeom_->idToDetUnit(detId)); if (!geomDetunit) continue; - std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo_); - nTotrechitsinevt += DSViter->size(); + std::string key = phase2tkutil::getITHistoId(detId.rawId(), tTopo_); + nTotrechitsinevt += DSViter.size(); if (nrechitLayerMap.find(key) == nrechitLayerMap.end()) { - nrechitLayerMap.insert(std::make_pair(key, DSViter->size())); + nrechitLayerMap.emplace(key, DSViter.size()); } else { - nrechitLayerMap[key] += DSViter->size(); + nrechitLayerMap[key] += DSViter.size(); } - edmNew::DetSet<SiPixelRecHit>::const_iterator rechitIt; //loop over rechits for a single detId - for (rechitIt = DSViter->begin(); rechitIt != DSViter->end(); ++rechitIt) { - LocalPoint lp = rechitIt->localPosition(); + for (const auto& rechit : DSViter) { + LocalPoint lp = rechit.localPosition(); Global3DPoint globalPos = geomDetunit->surface().toGlobal(lp); //in mm double gx = globalPos.x() * 10.; @@ -95,9 +145,9 @@ void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent) { } //layer wise histo if (layerMEs_[key].clusterSizeX) - layerMEs_[key].clusterSizeX->Fill(rechitIt->cluster()->sizeX()); + layerMEs_[key].clusterSizeX->Fill(rechit.cluster()->sizeX()); if (layerMEs_[key].clusterSizeY) - layerMEs_[key].clusterSizeY->Fill(rechitIt->cluster()->sizeY()); + layerMEs_[key].clusterSizeY->Fill(rechit.cluster()->sizeY()); if (layerMEs_[key].globalPosXY) layerMEs_[key].globalPosXY->Fill(gx, gy); if (layerMEs_[key].globalPosRZ) @@ -110,16 +160,16 @@ void Phase2ITMonitorRecHit::fillITHistos(const edm::Event& iEvent) { layerMEs_[key].posY->Fill(lp.y()); float eta = geomDetunit->surface().toGlobal(lp).eta(); if (layerMEs_[key].poserrX) - layerMEs_[key].poserrX->Fill(eta, million * rechitIt->localPositionError().xx()); + layerMEs_[key].poserrX->Fill(eta, million * rechit.localPositionError().xx()); if (layerMEs_[key].poserrY) - layerMEs_[key].poserrY->Fill(eta, million * rechitIt->localPositionError().yy()); + layerMEs_[key].poserrY->Fill(eta, million * rechit.localPositionError().yy()); } //end loop over rechits of a detId } //End loop over DetSetVector //fill nRecHits per event numberRecHits_->Fill(nTotrechitsinevt); //fill nRecHit counter per layer - for (auto& lme : nrechitLayerMap) + for (const auto& lme : nrechitLayerMap) if (layerMEs_[lme.first].numberRecHits) layerMEs_[lme.first].numberRecHits->Fill(lme.second); } @@ -143,23 +193,23 @@ void Phase2ITMonitorRecHit::bookHistograms(DQMStore::IBooker& ibooker, //Global histos for IT HistoName.str(""); HistoName << "NumberRecHits"; - numberRecHits_ = Phase2TkUtil::book1DFromPSet( + numberRecHits_ = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("GlobalNumberRecHits"), HistoName.str(), ibooker); HistoName.str(""); HistoName << "Global_Position_XY_IT_barrel"; - globalXY_barrel_ = Phase2TkUtil::book2DFromPSet( + globalXY_barrel_ = phase2tkutil::book2DFromPSet( config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXB"), HistoName.str(), ibooker); HistoName.str(""); HistoName << "Global_Position_RZ_IT_barrel"; - globalRZ_barrel_ = Phase2TkUtil::book2DFromPSet( + globalRZ_barrel_ = phase2tkutil::book2DFromPSet( config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXB"), HistoName.str(), ibooker); HistoName.str(""); HistoName << "Global_Position_XY_IT_endcap"; - globalXY_endcap_ = Phase2TkUtil::book2DFromPSet( + globalXY_endcap_ = phase2tkutil::book2DFromPSet( config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXEC"), HistoName.str(), ibooker); HistoName.str(""); HistoName << "Global_Position_RZ_IT_endcap"; - globalRZ_endcap_ = Phase2TkUtil::book2DFromPSet( + globalRZ_endcap_ = phase2tkutil::book2DFromPSet( config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXEC"), HistoName.str(), ibooker); //Now book layer wise histos @@ -173,14 +223,14 @@ void Phase2ITMonitorRecHit::bookHistograms(DQMStore::IBooker& ibooker, continue; unsigned int detId_raw = det_u->geographicalId().rawId(); edm::LogInfo("Phase2ITMonitorRecHit") << "Detid:" << detId_raw << "\tsubdet=" << det_u->subDetector() - << "\t key=" << Phase2TkUtil::getITHistoId(detId_raw, tTopo_) << std::endl; + << "\t key=" << phase2tkutil::getITHistoId(detId_raw, tTopo_) << std::endl; bookLayerHistos(ibooker, detId_raw, dir); } } } // -- Book Layer Histograms void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir) { - std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo_); + std::string key = phase2tkutil::getITHistoId(det_id, tTopo_); if (key.empty()) return; if (layerMEs_.find(key) == layerMEs_.end()) { @@ -191,54 +241,54 @@ void Phase2ITMonitorRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << (subdir + "/" + key); histoName.str(""); histoName << "Number_RecHits"; - local_histos.numberRecHits = Phase2TkUtil::book1DFromPSet( + local_histos.numberRecHits = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("LocalNumberRecHits"), histoName.str(), ibooker); histoName.str(""); histoName << "RecHit_X"; local_histos.posX = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosX"), histoName.str(), ibooker); + phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosX"), histoName.str(), ibooker); histoName.str(""); histoName << "RecHit_Y"; local_histos.posY = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosY"), histoName.str(), ibooker); + phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosY"), histoName.str(), ibooker); histoName.str(""); histoName << "RecHit_X_error_Vs_eta"; - local_histos.poserrX = Phase2TkUtil::bookProfile1DFromPSet( + local_histos.poserrX = phase2tkutil::bookProfile1DFromPSet( config_.getParameter<edm::ParameterSet>("RecHitPosErrorX_Eta"), histoName.str(), ibooker); histoName.str(""); histoName << "RecHit_Y_error_Vs_eta"; - local_histos.poserrY = Phase2TkUtil::bookProfile1DFromPSet( + local_histos.poserrY = phase2tkutil::bookProfile1DFromPSet( config_.getParameter<edm::ParameterSet>("RecHitPosErrorY_Eta"), histoName.str(), ibooker); histoName.str(""); histoName << "Cluster_SizeX"; - local_histos.clusterSizeX = Phase2TkUtil::book1DFromPSet( + local_histos.clusterSizeX = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("LocalClusterSizeX"), histoName.str(), ibooker); histoName.str(""); histoName << "Cluster_SizeY"; - local_histos.clusterSizeY = Phase2TkUtil::book1DFromPSet( + local_histos.clusterSizeY = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("LocalClusterSizeY"), histoName.str(), ibooker); histoName.str(""); histoName << "Global_Position_XY"; - local_histos.globalPosXY = Phase2TkUtil::book2DFromPSet( + local_histos.globalPosXY = phase2tkutil::book2DFromPSet( config_.getParameter<edm::ParameterSet>("GlobalPositionXY_perlayer"), histoName.str(), ibooker); histoName.str(""); histoName << "Global_Position_RZ"; - local_histos.globalPosRZ = Phase2TkUtil::book2DFromPSet( + local_histos.globalPosRZ = phase2tkutil::book2DFromPSet( config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_perlayer"), histoName.str(), ibooker); histoName.str(""); histoName << "Local_Position_XY"; - local_histos.localPosXY = Phase2TkUtil::book2DFromPSet( + local_histos.localPosXY = phase2tkutil::book2DFromPSet( config_.getParameter<edm::ParameterSet>("LocalPositionXY"), histoName.str(), ibooker); - layerMEs_.insert(std::make_pair(key, local_histos)); + layerMEs_.emplace(key, local_histos); } } diff --git a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h b/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h deleted file mode 100644 index 9e4ac031e9b7b..0000000000000 --- a/DQM/SiTrackerPhase2/plugins/Phase2ITMonitorRecHit.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef _DQM_SiTrackerPhase2_Phase2ITMonitorRecHit_h -#define _DQM_SiTrackerPhase2_Phase2ITMonitorRecHit_h -#include <iostream> -#include <map> -#include <vector> -#include <algorithm> -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/Common/interface/DetSetVectorNew.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" -#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" -#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" - -// DQM Histograming -class TrackerTopology; -class TrackerGeometry; -class TrackerDigiGeometryRecord; -class TrackerTopologyRcd; -class Phase2ITMonitorRecHit : public DQMEDAnalyzer { -public: - explicit Phase2ITMonitorRecHit(const edm::ParameterSet&); - ~Phase2ITMonitorRecHit() override; - void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; - void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; - void dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) override; - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - -private: - void fillITHistos(const edm::Event& iEvent); - - void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir); - - edm::ParameterSet config_; - std::string geomType_; - const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; - const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; - const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; - const TrackerGeometry* tkGeom_ = nullptr; - const TrackerTopology* tTopo_ = nullptr; - static constexpr float million = 1e6; - MonitorElement* numberRecHits_; - MonitorElement* globalXY_barrel_; - MonitorElement* globalXY_endcap_; - MonitorElement* globalRZ_barrel_; - MonitorElement* globalRZ_endcap_; - - struct RecHitME { - MonitorElement* numberRecHits = nullptr; - MonitorElement* globalPosXY = nullptr; - MonitorElement* globalPosRZ = nullptr; - MonitorElement* localPosXY = nullptr; - MonitorElement* posX = nullptr; - MonitorElement* posY = nullptr; - MonitorElement* poserrX = nullptr; - MonitorElement* poserrY = nullptr; - MonitorElement* clusterSizeX = nullptr; - MonitorElement* clusterSizeY = nullptr; - }; - std::map<std::string, RecHitME> layerMEs_; -}; -#endif diff --git a/DQM/SiTrackerPhase2/src/BuildFile.xml b/DQM/SiTrackerPhase2/src/BuildFile.xml new file mode 100644 index 0000000000000..6e0fbf4cc057f --- /dev/null +++ b/DQM/SiTrackerPhase2/src/BuildFile.xml @@ -0,0 +1,5 @@ +<use name="DataFormats/TrackerCommon"/> +<use name="DQMServices/Core"/> +<export> + <lib name="1"/> +</export> diff --git a/DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc b/DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc new file mode 100644 index 0000000000000..2fe9fa5515825 --- /dev/null +++ b/DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc @@ -0,0 +1,47 @@ +#include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" +std::string phase2tkutil::getITHistoId(uint32_t det_id, const TrackerTopology* tTopo) { + std::string Disc; + std::ostringstream fname1; + int layer = tTopo->getITPixelLayerNumber(det_id); + + if (layer < 0) + return ""; + if (layer < 100) { + fname1 << "Barrel/"; + fname1 << "Layer" << layer; + fname1 << ""; + } else { + int side = tTopo->pxfSide(det_id); + fname1 << "EndCap_Side" << side << "/"; + int disc = tTopo->pxfDisk(det_id); + Disc = (disc < 9) ? "EPix" : "FPix"; + fname1 << Disc << "/"; + int ring = tTopo->pxfBlade(det_id); + fname1 << "Ring" << ring; + } + return fname1.str(); +} + +std::string phase2tkutil::getOTHistoId(uint32_t det_id, const TrackerTopology* tTopo) { + std::string Disc; + std::ostringstream fname1; + int layer = tTopo->getOTLayerNumber(det_id); + + if (layer < 0) + return ""; + if (layer < 100) { + fname1 << "Barrel/"; + fname1 << "Layer" << layer; + fname1 << ""; + } else { + int side = tTopo->tidSide(det_id); + fname1 << "EndCap_Side" << side << "/"; + int disc = tTopo->tidWheel(det_id); + Disc = (disc < 3) ? "TEDD_1" : "TEDD_2"; + fname1 << Disc << "/"; + int ring = tTopo->tidRing(det_id); + fname1 << "Ring" << ring; + } + return fname1.str(); +} + diff --git a/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h b/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h index 0dc8bcf66f9c1..a3b492be26e36 100644 --- a/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h +++ b/Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h @@ -2,22 +2,10 @@ #define _Validation_SiTrackerPhase2V_TrackerPhase2ValidationUtil_h #include "SimDataFormats/TrackingHit/interface/PSimHit.h" #include "SimDataFormats/Track/interface/SimTrack.h" -#include <string> -#include <sstream> -namespace Phase2TkUtil { +namespace phase2tkutil { - bool isPrimary(const SimTrack& simTrk, const PSimHit* simHit) { - bool retval = false; - unsigned int trkId = simTrk.trackId(); - if (trkId != simHit->trackId()) - return retval; - int vtxIndex = simTrk.vertIndex(); - int ptype = simHit->processType(); - if ((vtxIndex == 0) && (ptype == 0)) - return true; - return false; - } + bool isPrimary(const SimTrack& simTrk, const PSimHit* simHit); -} // namespace Phase2TkUtil +} // namespace phase2tkutil #endif diff --git a/Validation/SiTrackerPhase2V/plugins/BuildFile.xml b/Validation/SiTrackerPhase2V/plugins/BuildFile.xml index ef4098ba4d1f2..611a15d830f3f 100644 --- a/Validation/SiTrackerPhase2V/plugins/BuildFile.xml +++ b/Validation/SiTrackerPhase2V/plugins/BuildFile.xml @@ -20,7 +20,8 @@ <use name="Geometry/TrackerGeometryBuilder"/> <use name="Geometry/CommonDetUnit"/> <use name="DQMServices/Core"/> +<use name="DQM/SiTrackerPhase2"/> +<use name="Validation/SiTrackerPhase2V"/> <use name="boost_system"/> <use name="rootcling"/> <flags EDM_PLUGIN="1"/> -<flags EDM_PLUGIN="1"/> diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc index eb5b525804d99..cbfbd91b0c2bd 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc @@ -10,32 +10,93 @@ // // system include files #include <memory> -#include "Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h" -#include "Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h" -#include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" +#include <map> +#include <vector> +#include <algorithm> #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Framework/interface/ESWatcher.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/GeometrySurface/interface/LocalError.h" +#include "DataFormats/GeometryVector/interface/LocalPoint.h" +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" +#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/TrackerGeomDet.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "DataFormats/GeometrySurface/interface/LocalError.h" -#include "DataFormats/GeometryVector/interface/LocalPoint.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" //--- for SimHit association #include "SimDataFormats/Track/interface/SimTrackContainer.h" -#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" #include "SimDataFormats/TrackingHit/interface/PSimHit.h" #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" -#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" -#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" -// DQM Histograming +#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" +//DQM +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" +#include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h" +#include "DQM/SiTrackerPhase2/interface/TrackerPhase2DQMUtil.h" + +class Phase2ITValidateRecHit : public DQMEDAnalyzer { +public: + explicit Phase2ITValidateRecHit(const edm::ParameterSet&); + ~Phase2ITValidateRecHit() override; + void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; + void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; + void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void fillITHistos(const edm::Event& iEvent, + const TrackerHitAssociator& associateRecHit, + const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, + const std::map<unsigned int, SimTrack>& selectedSimTrackMap); + + void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir); + + edm::ParameterSet config_; + TrackerHitAssociator::Config trackerHitAssociatorConfig_; + const double simtrackminpt_; + std::string geomType_; + const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; + const edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; + std::vector<edm::EDGetTokenT<edm::PSimHitContainer>> simHitTokens_; + const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; + const TrackerGeometry* tkGeom_ = nullptr; + const TrackerTopology* tTopo_ = nullptr; + struct RecHitME { + MonitorElement* deltaX = nullptr; + MonitorElement* deltaY = nullptr; + MonitorElement* pullX = nullptr; + MonitorElement* pullY = nullptr; + MonitorElement* deltaX_eta = nullptr; + MonitorElement* deltaY_eta = nullptr; + MonitorElement* pullX_eta = nullptr; + MonitorElement* pullY_eta = nullptr; + //For rechits matched to primary simhits + MonitorElement* numberRecHitsprimary = nullptr; + MonitorElement* pullX_primary; + MonitorElement* pullY_primary; + MonitorElement* deltaX_primary; + MonitorElement* deltaY_primary; + }; + std::map<std::string, RecHitME> layerMEs_; +}; + Phase2ITValidateRecHit::Phase2ITValidateRecHit(const edm::ParameterSet& iConfig) : config_(iConfig), trackerHitAssociatorConfig_(iConfig, consumesCollector()), @@ -53,6 +114,7 @@ Phase2ITValidateRecHit::Phase2ITValidateRecHit(const edm::ParameterSet& iConfig) Phase2ITValidateRecHit::~Phase2ITValidateRecHit() { edm::LogInfo("Phase2ITValidateRecHit") << ">>> Destroy Phase2ITValidateRecHit "; } + void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { std::vector<edm::Handle<edm::PSimHitContainer>> simHits; for (const auto& itoken : simHitTokens_) { @@ -67,10 +129,9 @@ void Phase2ITValidateRecHit::analyze(const edm::Event& iEvent, const edm::EventS iEvent.getByToken(simTracksToken_, simTracks); std::map<unsigned int, SimTrack> selectedSimTrackMap; - for (edm::SimTrackContainer::const_iterator simTrackIt(simTracks->begin()); simTrackIt != simTracks->end(); - ++simTrackIt) { - if (simTrackIt->momentum().pt() > simtrackminpt_) { - selectedSimTrackMap.insert(std::make_pair(simTrackIt->trackId(), *simTrackIt)); + for (const auto& simTrackIt : *simTracks) { + if (simTrackIt.momentum().pt() > simtrackminpt_) { + selectedSimTrackMap.insert(std::make_pair(simTrackIt.trackId(), simTrackIt)); } } TrackerHitAssociator associateRecHit(iEvent, trackerHitAssociatorConfig_); @@ -88,42 +149,37 @@ void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, return; std::map<std::string, unsigned int> nrechitLayerMap_primary; // Loop over modules - SiPixelRecHitCollection::const_iterator DSViter; - for (DSViter = rechits->begin(); DSViter != rechits->end(); ++DSViter) { + for (const auto& DSViter : *rechits) { // Get the detector unit's id - unsigned int rawid(DSViter->detId()); + unsigned int rawid(DSViter.detId()); DetId detId(rawid); // Get the geomdet const GeomDetUnit* geomDetunit(tkGeom_->idToDetUnit(detId)); if (!geomDetunit) continue; // determine the detector we are in - std::string key = Phase2TkUtil::getITHistoId(detId.rawId(), tTopo_); + std::string key = phase2tkutil::getITHistoId(detId.rawId(), tTopo_); if (nrechitLayerMap_primary.find(key) == nrechitLayerMap_primary.end()) { - nrechitLayerMap_primary.insert(std::make_pair(key, DSViter->size())); + nrechitLayerMap_primary.emplace(key, DSViter.size()); } else { - nrechitLayerMap_primary[key] += DSViter->size(); + nrechitLayerMap_primary[key] += DSViter.size(); } - - edmNew::DetSet<SiPixelRecHit>::const_iterator rechitIt; //loop over rechits for a single detId - for (rechitIt = DSViter->begin(); rechitIt != DSViter->end(); ++rechitIt) { + for (const auto& rechit : DSViter) { //GetSimHits - const std::vector<SimHitIdpr>& matchedId = associateRecHit.associateHitId(*rechitIt); + const std::vector<SimHitIdpr>& matchedId = associateRecHit.associateHitId(rechit); const PSimHit* simhitClosest = nullptr; float minx = 10000; - LocalPoint lp = rechitIt->localPosition(); - for (unsigned int si = 0; si < simHits.size(); ++si) { - for (edm::PSimHitContainer::const_iterator simhitIt = simHits.at(si)->begin(); - simhitIt != simHits.at(si)->end(); - ++simhitIt) { - if (detId.rawId() != simhitIt->detUnitId()) + LocalPoint lp = rechit.localPosition(); + for (const auto& simHitCol : simHits) { + for (const auto& simhitIt : *simHitCol) { + if (detId.rawId() != simhitIt.detUnitId()) continue; - for (auto& mId : matchedId) { - if (simhitIt->trackId() == mId.first) { - if (!simhitClosest || fabs(simhitIt->localPosition().x() - lp.x()) < minx) { - minx = fabs(simhitIt->localPosition().x() - lp.x()); - simhitClosest = &*simhitIt; + for (const auto& mId : matchedId) { + if (simhitIt.trackId() == mId.first) { + if (!simhitClosest || abs(simhitIt.localPosition().x() - lp.x()) < minx) { + minx = abs(simhitIt.localPosition().x() - lp.x()); + simhitClosest = &simhitIt; } } } @@ -135,9 +191,9 @@ void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, bool isPrimary = false; //check if simhit is primary if (simTrackIt != selectedSimTrackMap.end()) - isPrimary = Phase2TkUtil::isPrimary(simTrackIt->second, simhitClosest); + isPrimary = phase2tkutil::isPrimary(simTrackIt->second, simhitClosest); Local3DPoint simlp(simhitClosest->localPosition()); - const LocalError& lperr = rechitIt->localPositionError(); + const LocalError& lperr = rechit.localPositionError(); double dx = lp.x() - simlp.x(); double dy = lp.y() - simlp.y(); double pullx = 999.; @@ -166,7 +222,7 @@ void Phase2ITValidateRecHit::fillITHistos(const edm::Event& iEvent, } //End loop over DetSetVector //fill nRecHit counter per layer - for (auto& lme : nrechitLayerMap_primary) { + for (const auto& lme : nrechitLayerMap_primary) { layerMEs_[lme.first].numberRecHitsprimary->Fill(nrechitLayerMap_primary[lme.first]); } } @@ -200,7 +256,7 @@ void Phase2ITValidateRecHit::bookHistograms(DQMStore::IBooker& ibooker, // void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir) { ibooker.cd(); - std::string key = Phase2TkUtil::getITHistoId(det_id, tTopo_); + std::string key = phase2tkutil::getITHistoId(det_id, tTopo_); if (key.empty()) return; if (layerMEs_.find(key) == layerMEs_.end()) { @@ -212,58 +268,58 @@ void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigne histoName.str(""); histoName << "Delta_X"; local_histos.deltaX = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), histoName.str(), ibooker); + phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_Y"; local_histos.deltaY = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), histoName.str(), ibooker); + phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_X"; local_histos.pullX = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullX"), histoName.str(), ibooker); + phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullX"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_Y"; local_histos.pullY = - Phase2TkUtil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullY"), histoName.str(), ibooker); + phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullY"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_X_vs_Eta"; - local_histos.deltaX_eta = Phase2TkUtil::bookProfile1DFromPSet( + local_histos.deltaX_eta = phase2tkutil::bookProfile1DFromPSet( config_.getParameter<edm::ParameterSet>("DeltaX_eta"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_Y_vs_Eta"; - local_histos.deltaY_eta = Phase2TkUtil::bookProfile1DFromPSet( + local_histos.deltaY_eta = phase2tkutil::bookProfile1DFromPSet( config_.getParameter<edm::ParameterSet>("DeltaX_eta"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_X_vs_Eta"; - local_histos.pullX_eta = Phase2TkUtil::bookProfile1DFromPSet( + local_histos.pullX_eta = phase2tkutil::bookProfile1DFromPSet( config_.getParameter<edm::ParameterSet>("PullX_eta"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_Y_vs_Eta"; - local_histos.pullY_eta = Phase2TkUtil::bookProfile1DFromPSet( + local_histos.pullY_eta = phase2tkutil::bookProfile1DFromPSet( config_.getParameter<edm::ParameterSet>("PullY_eta"), histoName.str(), ibooker); ibooker.setCurrentFolder(subdir + "/" + key + "/PrimarySimHits"); //all histos for Primary particles histoName.str(""); histoName << "Number_RecHits_matched_PrimarySimTrack"; - local_histos.numberRecHitsprimary = Phase2TkUtil::book1DFromPSet( + local_histos.numberRecHitsprimary = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("nRecHits_primary"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_X_SimHitPrimary"; - local_histos.deltaX_primary = Phase2TkUtil::book1DFromPSet( + local_histos.deltaX_primary = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("DeltaX_primary"), histoName.str(), ibooker); histoName.str(""); histoName << "Delta_Y_SimHitPrimary"; - local_histos.deltaY_primary = Phase2TkUtil::book1DFromPSet( + local_histos.deltaY_primary = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("DeltaY_primary"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_X_SimHitPrimary"; - local_histos.pullX_primary = Phase2TkUtil::book1DFromPSet( + local_histos.pullX_primary = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("PullX_primary"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_Y_SimHitPrimary"; - local_histos.pullY_primary = Phase2TkUtil::book1DFromPSet( + local_histos.pullY_primary = phase2tkutil::book1DFromPSet( config_.getParameter<edm::ParameterSet>("PullY_primary"), histoName.str(), ibooker); - layerMEs_.insert(std::make_pair(key, local_histos)); + layerMEs_.emplace(key, local_histos); } } void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h deleted file mode 100644 index 05ddc936ed1fc..0000000000000 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef _Validation_SiTrackerPhase2V_Phase2ITValidateRecHit_h -#define _Validation_SiTrackerPhase2V_Phase2ITValidateRecHit_h -#include <iostream> -#include <map> -#include <vector> -#include <algorithm> -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/Common/interface/DetSetVectorNew.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" -#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" -#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" -#include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/DQMStore.h" - -// DQM Histograming -class PixelDigiSimLink; -class SimTrack; -class SimHit; -class TrackerTopology; -class TrackerGeometry; -class TrackerDigiGeometryRecord; -class TrackerTopologyRcd; -class Phase2ITValidateRecHit : public DQMEDAnalyzer { -public: - explicit Phase2ITValidateRecHit(const edm::ParameterSet&); - ~Phase2ITValidateRecHit() override; - void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; - void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; - void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override; - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - -private: - void fillITHistos(const edm::Event& iEvent, - const TrackerHitAssociator& associateRecHit, - const std::vector<edm::Handle<edm::PSimHitContainer>>& simHits, - const std::map<unsigned int, SimTrack>& selectedSimTrackMap); - - void bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, std::string& subdir); - - edm::ParameterSet config_; - TrackerHitAssociator::Config trackerHitAssociatorConfig_; - const double simtrackminpt_; - std::string geomType_; - const edm::EDGetTokenT<SiPixelRecHitCollection> tokenRecHitsIT_; - const edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; - std::vector<edm::EDGetTokenT<edm::PSimHitContainer>> simHitTokens_; - const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; - const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; - const TrackerGeometry* tkGeom_ = nullptr; - const TrackerTopology* tTopo_ = nullptr; - struct RecHitME { - // use TH1D instead of TH1F to avoid stauration at 2^31 - // above this increments with +1 don't work for float, need double - MonitorElement* deltaX = nullptr; - MonitorElement* deltaY = nullptr; - MonitorElement* pullX = nullptr; - MonitorElement* pullY = nullptr; - MonitorElement* deltaX_eta = nullptr; - MonitorElement* deltaY_eta = nullptr; - MonitorElement* pullX_eta = nullptr; - MonitorElement* pullY_eta = nullptr; - //For rechits matched to simhits from highPT tracks - MonitorElement* numberRecHitsprimary = nullptr; - MonitorElement* pullX_primary; - MonitorElement* pullY_primary; - MonitorElement* deltaX_primary; - MonitorElement* deltaY_primary; - }; - std::map<std::string, RecHitME> layerMEs_; -}; -#endif diff --git a/Validation/SiTrackerPhase2V/src/BuildFile.xml b/Validation/SiTrackerPhase2V/src/BuildFile.xml new file mode 100644 index 0000000000000..f03a5a7df2841 --- /dev/null +++ b/Validation/SiTrackerPhase2V/src/BuildFile.xml @@ -0,0 +1,5 @@ +<use name="SimDataFormats/Track"/> +<use name="SimDataFormats/TrackingHit"/> +<export> + <lib name="1"/> +</export> diff --git a/Validation/SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc b/Validation/SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc new file mode 100644 index 0000000000000..e14f858372017 --- /dev/null +++ b/Validation/SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc @@ -0,0 +1,12 @@ +#include "Validation/SiTrackerPhase2V/interface/TrackerPhase2ValidationUtil.h" +bool phase2tkutil::isPrimary(const SimTrack& simTrk, const PSimHit* simHit) { + bool retval = false; + unsigned int trkId = simTrk.trackId(); + if (trkId != simHit->trackId()) + return retval; + int vtxIndex = simTrk.vertIndex(); + int ptype = simHit->processType(); + return ((vtxIndex == 0) && (ptype == 0)); +} + + From 73d5cca3df1e32fb0264cbaffa17d444ecb3083e Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Fri, 9 Oct 2020 09:24:30 +0200 Subject: [PATCH 451/778] typo fix --- Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc index cbfbd91b0c2bd..f0c221d3a6484 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc @@ -328,7 +328,7 @@ void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& de { edm::ParameterSetDescription psd0; psd0.add<std::string>("name", "Delta_X"); - psd0.add<std::string>("title", "Delta_X;RecHit resolution X dimensiom"); + psd0.add<std::string>("title", "Delta_X;RecHit resolution X dimension"); psd0.add<double>("xmin", -0.2); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 0.2); @@ -338,7 +338,7 @@ void Phase2ITValidateRecHit::fillDescriptions(edm::ConfigurationDescriptions& de { edm::ParameterSetDescription psd0; psd0.add<std::string>("name", "Delta_Y"); - psd0.add<std::string>("title", "Delta_Y;RecHit resolution Y dimensiom;"); + psd0.add<std::string>("title", "Delta_Y;RecHit resolution Y dimension;"); psd0.add<double>("xmin", -0.2); psd0.add<bool>("switch", true); psd0.add<double>("xmax", 0.2); From 5a416943131ab5b5ff31c7eb2aa57d1b4beb27ec Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Fri, 9 Oct 2020 09:27:40 +0200 Subject: [PATCH 452/778] buildfile fix --- DQM/SiTrackerPhase2/plugins/BuildFile.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/DQM/SiTrackerPhase2/plugins/BuildFile.xml b/DQM/SiTrackerPhase2/plugins/BuildFile.xml index b4d852597bbd3..546493369403a 100644 --- a/DQM/SiTrackerPhase2/plugins/BuildFile.xml +++ b/DQM/SiTrackerPhase2/plugins/BuildFile.xml @@ -12,4 +12,3 @@ <use name="boost_system"/> <use name="rootcling"/> <flags EDM_PLUGIN="1"/> -<flags CXXFLAGS="-g"/> From 10bea8a6a4db87693c078c377bc13f395e042aad Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Fri, 9 Oct 2020 09:38:07 +0200 Subject: [PATCH 453/778] resolve code format issues --- DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc | 5 ++--- .../SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc b/DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc index 2fe9fa5515825..77523e0f06501 100644 --- a/DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc +++ b/DQM/SiTrackerPhase2/src/TrackerPhase2DQMUtil.cc @@ -3,7 +3,7 @@ std::string phase2tkutil::getITHistoId(uint32_t det_id, const TrackerTopology* t std::string Disc; std::ostringstream fname1; int layer = tTopo->getITPixelLayerNumber(det_id); - + if (layer < 0) return ""; if (layer < 100) { @@ -26,7 +26,7 @@ std::string phase2tkutil::getOTHistoId(uint32_t det_id, const TrackerTopology* t std::string Disc; std::ostringstream fname1; int layer = tTopo->getOTLayerNumber(det_id); - + if (layer < 0) return ""; if (layer < 100) { @@ -44,4 +44,3 @@ std::string phase2tkutil::getOTHistoId(uint32_t det_id, const TrackerTopology* t } return fname1.str(); } - diff --git a/Validation/SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc b/Validation/SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc index e14f858372017..66d8867a57f4f 100644 --- a/Validation/SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc +++ b/Validation/SiTrackerPhase2V/src/TrackerPhase2ValidationUtil.cc @@ -8,5 +8,3 @@ bool phase2tkutil::isPrimary(const SimTrack& simTrk, const PSimHit* simHit) { int ptype = simHit->processType(); return ((vtxIndex == 0) && (ptype == 0)); } - - From f8afb44c11b183c7148d4b9a53d2667080c2c190 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Fri, 9 Oct 2020 15:23:02 +0200 Subject: [PATCH 454/778] Require highPurity for iso tracks in HI workflows --- PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc | 3 +++ PhysicsTools/PatAlgos/python/slimming/isolatedTracks_cfi.py | 6 ++++++ PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc b/PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc index 5aaabbaa3ceb6..c0cdd7a04a7a0 100644 --- a/PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc @@ -102,6 +102,7 @@ namespace pat { const float pcRefNearest_DR_; // radius for nearest charged packed candidate const float pcRefNearest_pTmin_; // min pT for nearest charged packed candidate const float pfneutralsum_DR_; // pf lepton overlap radius + const bool useHighPurity_; const bool saveDeDxHitInfo_; StringCutObjectSelector<pat::IsolatedTrack> saveDeDxHitInfoCut_; @@ -146,6 +147,7 @@ pat::PATIsolatedTrackProducer::PATIsolatedTrackProducer(const edm::ParameterSet& pcRefNearest_DR_(iConfig.getParameter<double>("pcRefNearest_DR")), pcRefNearest_pTmin_(iConfig.getParameter<double>("pcRefNearest_pTmin")), pfneutralsum_DR_(iConfig.getParameter<double>("pfneutralsum_DR")), + useHighPurity_(iConfig.getParameter<bool>("useHighPurity")), saveDeDxHitInfo_(iConfig.getParameter<bool>("saveDeDxHitInfo")), saveDeDxHitInfoCut_(iConfig.getParameter<std::string>("saveDeDxHitInfoCut")) { // TrackAssociator parameters @@ -237,6 +239,7 @@ void pat::PATIsolatedTrackProducer::produce(edm::Event& iEvent, const edm::Event //add general tracks for (unsigned int igt = 0; igt < generalTracks->size(); igt++) { const reco::Track& gentk = (*gt_h)[igt]; + if(useHighPurity_) if (!(gentk.quality(reco::TrackBase::qualityByName("highPurity")))) continue; reco::TrackRef tkref = reco::TrackRef(gt_h, igt); pat::PackedCandidateRef pcref = (*gt2pc)[tkref]; pat::PackedCandidateRef ltref = (*gt2lt)[tkref]; diff --git a/PhysicsTools/PatAlgos/python/slimming/isolatedTracks_cfi.py b/PhysicsTools/PatAlgos/python/slimming/isolatedTracks_cfi.py index b07862696dab1..fe6cd6f2b3fb0 100644 --- a/PhysicsTools/PatAlgos/python/slimming/isolatedTracks_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/isolatedTracks_cfi.py @@ -58,10 +58,16 @@ pfneutralsum_DR = cms.double(0.05), + useHighPurity = cms.bool(False), + saveDeDxHitInfo = cms.bool(True), saveDeDxHitInfoCut = cms.string("(%s) || (%s)" % (_susySoftDisappearingTrackCut,_exoHighPtTrackCut)), ) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(isolatedTracks, useHighPurity = True) + def miniAOD_customizeIsolatedTracksFastSim(process): """Switch off dE/dx hit info on fast sim, as it's not available""" process.isolatedTracks.saveDeDxHitInfo = False diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index b6981349253b1..2b13344f193a0 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -138,7 +138,7 @@ def _applySubstructure(process): from PhysicsTools.PatAlgos.slimming.applySubstructure_cff import applySubstructure applySubstructure( process ) - (~_hiGeneral).toModify(process, _applySubstructure) + #(~_hiGeneral).toModify(process, _applySubstructure) _hiGeneral.toModify(process, func = lambda p: addToProcessAndTask('slimmedJets', p.selectedPatJets.clone(), p, task)) _hiGeneral.toModify(process, func = lambda p: addToProcessAndTask('slimmedJetsAK8', _dummyPatJets.clone(), p, task)) From 552194ce54f0d792f788319742a13002059f8a2e Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Fri, 9 Oct 2020 15:30:27 +0200 Subject: [PATCH 455/778] revert accidentally modified file --- PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index 2b13344f193a0..b6981349253b1 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -138,7 +138,7 @@ def _applySubstructure(process): from PhysicsTools.PatAlgos.slimming.applySubstructure_cff import applySubstructure applySubstructure( process ) - #(~_hiGeneral).toModify(process, _applySubstructure) + (~_hiGeneral).toModify(process, _applySubstructure) _hiGeneral.toModify(process, func = lambda p: addToProcessAndTask('slimmedJets', p.selectedPatJets.clone(), p, task)) _hiGeneral.toModify(process, func = lambda p: addToProcessAndTask('slimmedJetsAK8', _dummyPatJets.clone(), p, task)) From e2cdd930c5375dae1a5ae740c47d264ceadacbe1 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Fri, 9 Oct 2020 15:46:09 +0200 Subject: [PATCH 456/778] code checks --- PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc b/PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc index c0cdd7a04a7a0..f4d5dbb0d709a 100644 --- a/PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATIsolatedTrackProducer.cc @@ -239,7 +239,9 @@ void pat::PATIsolatedTrackProducer::produce(edm::Event& iEvent, const edm::Event //add general tracks for (unsigned int igt = 0; igt < generalTracks->size(); igt++) { const reco::Track& gentk = (*gt_h)[igt]; - if(useHighPurity_) if (!(gentk.quality(reco::TrackBase::qualityByName("highPurity")))) continue; + if (useHighPurity_) + if (!(gentk.quality(reco::TrackBase::qualityByName("highPurity")))) + continue; reco::TrackRef tkref = reco::TrackRef(gt_h, igt); pat::PackedCandidateRef pcref = (*gt2pc)[tkref]; pat::PackedCandidateRef ltref = (*gt2lt)[tkref]; From 9dc8557d12cf0ce5f242781725525ce9e2504535 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Mon, 11 May 2020 15:05:09 +0200 Subject: [PATCH 457/778] updating clue with regional em factors --- .../plugins/HGCalCLUEAlgo.cc | 21 ++++++++++++------- .../HGCalRecProducers/plugins/HGCalCLUEAlgo.h | 6 ++++++ .../python/hgcalLayerClusters_cff.py | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc index 54a92afcf5cee..dafabc4b9d5c4 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc @@ -43,9 +43,15 @@ void HGCalCLUEAlgoT<T>::populate(const HGCRecHitCollection& hits) { float sigmaNoise = 1.f; if (dependSensor_) { int thickness_index = rhtools_.getSiThickIndex(detid); - if (thickness_index == -1) - thickness_index = 3; - double storedThreshold = thresholds_[layerOnSide][thickness_index]; + double storedThreshold = 9999.; + if ( detid.det() == DetId::HGCalEE || detid.subdetId() == HGCEE ){ + storedThreshold = thresholds_[layerOnSide][thickness_index]; + } else if ( detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF){ + storedThreshold = thresholds_[layerOnSide][thickness_index + deltasi_index_regemfac_]; + } else if ( thickness_index == -1 ){ + thickness_index = 6; + storedThreshold = thresholds_[layerOnSide][thickness_index]; + } sigmaNoise = v_sigmaNoise_[layerOnSide][thickness_index]; if (hgrh.energy() < storedThreshold) @@ -507,8 +513,9 @@ void HGCalCLUEAlgoT<T>::computeThreshold() { // To support the TDR geometry and also the post-TDR one (v9 onwards), we // need to change the logic of the vectors containing signal to noise and // thresholds. The first 3 indices will keep on addressing the different - // thicknesses of the Silicon detectors, while the last one, number 3 (the - // fourth) will address the Scintillators. This change will support both + // thicknesses of the Silicon detectors in CE_E , the next 3 indices will address + // the thicknesses of the Silicon detectors in CE_H, while the last one, number 6 (the + // seventh) will address the Scintillators. This change will support both // geometries at the same time. if (initialized_) @@ -517,7 +524,7 @@ void HGCalCLUEAlgoT<T>::computeThreshold() { initialized_ = true; std::vector<double> dummy; - const unsigned maxNumberOfThickIndices = 3; + const unsigned maxNumberOfThickIndices = 6; dummy.resize(maxNumberOfThickIndices + !isNose_, 0); // +1 to accomodate for the Scintillators thresholds_.resize(maxlayer_, dummy); v_sigmaNoise_.resize(maxlayer_, dummy); @@ -535,7 +542,7 @@ void HGCalCLUEAlgoT<T>::computeThreshold() { } if (!isNose_) { - float scintillators_sigmaNoise = 0.001f * noiseMip_ * dEdXweights_[ilayer]; + float scintillators_sigmaNoise = 0.001f * noiseMip_ * dEdXweights_[ilayer] / sciThicknessCorrection_; thresholds_[ilayer - 1][maxNumberOfThickIndices] = ecut_ * scintillators_sigmaNoise; v_sigmaNoise_[ilayer - 1][maxNumberOfThickIndices] = scintillators_sigmaNoise; LogDebug("HGCalCLUEAlgo") << "ilayer: " << ilayer << " noiseMip: " << noiseMip_ diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h index ee4dba9fb73ad..82f9e9d10aa1f 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h @@ -40,6 +40,8 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { dependSensor_(ps.getParameter<bool>("dependSensor")), dEdXweights_(ps.getParameter<std::vector<double>>("dEdXweights")), thicknessCorrection_(ps.getParameter<std::vector<double>>("thicknessCorrection")), + sciThicknessCorrection_(ps.getParameter<double>("sciThicknessCorrection")), + deltasi_index_regemfac_(ps.getParameter<int>("deltasi_index_regemfac")), fcPerMip_(ps.getParameter<std::vector<double>>("fcPerMip")), fcPerEle_(ps.getParameter<double>("fcPerEle")), nonAgedNoises_(ps.getParameter<edm::ParameterSet>("noises").getParameter<std::vector<double>>("values")), @@ -94,6 +96,8 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { iDesc.addUntracked<unsigned int>("verbosity", 3); iDesc.add<std::vector<double>>("dEdXweights", {}); iDesc.add<std::vector<double>>("thicknessCorrection", {}); + iDesc.add<double>("sciThicknessCorrection", 1.0); + iDesc.add<int>("deltasi_index_regemfac", 3); iDesc.add<std::vector<double>>("fcPerMip", {}); iDesc.add<double>("fcPerEle", 0.0); edm::ParameterSetDescription descNestedNoises; @@ -131,6 +135,8 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { bool dependSensor_; std::vector<double> dEdXweights_; std::vector<double> thicknessCorrection_; + double sciThicknessCorrection_; + int deltasi_index_regemfac_; std::vector<double> fcPerMip_; double fcPerEle_; std::vector<double> nonAgedNoises_; diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index 3f2ef8d3ca1aa..f1dca87a6a709 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -14,6 +14,8 @@ hgcalLayerClusters.plugin.dEdXweights = cms.vdouble(dEdX.weights) hgcalLayerClusters.plugin.fcPerMip = cms.vdouble(HGCalUncalibRecHit.HGCEEConfig.fCPerMIP) hgcalLayerClusters.plugin.thicknessCorrection = cms.vdouble(HGCalRecHit.thicknessCorrection) +hgcalLayerClusters.plugin.sciThicknessCorrection = cms.double(HGCalRecHit.sciThicknessCorrection) +hgcalLayerClusters.plugin.deltasi_index_regemfac = cms.int32(HGCalRecHit.deltasi_index_regemfac) hgcalLayerClusters.plugin.fcPerEle = cms.double(fC_per_ele) hgcalLayerClusters.plugin.noises = cms.PSet(refToPSet_ = cms.string('HGCAL_noises')) hgcalLayerClusters.plugin.noiseMip = hgchebackDigitizer.digiCfg.noise From b23cb55d06d05c567fd02bbacec50ceb7725187f Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Tue, 12 May 2020 13:11:01 +0200 Subject: [PATCH 458/778] correcting input from rechit cfi --- RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h | 2 +- .../HGCalRecProducers/python/hgcalLayerClusters_cff.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h index 82f9e9d10aa1f..9b63a63874b5d 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h @@ -96,7 +96,7 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { iDesc.addUntracked<unsigned int>("verbosity", 3); iDesc.add<std::vector<double>>("dEdXweights", {}); iDesc.add<std::vector<double>>("thicknessCorrection", {}); - iDesc.add<double>("sciThicknessCorrection", 1.0); + iDesc.add<double>("sciThicknessCorrection", 0.9); iDesc.add<int>("deltasi_index_regemfac", 3); iDesc.add<std::vector<double>>("fcPerMip", {}); iDesc.add<double>("fcPerEle", 0.0); diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index f1dca87a6a709..3ed0f8a60b099 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -14,8 +14,8 @@ hgcalLayerClusters.plugin.dEdXweights = cms.vdouble(dEdX.weights) hgcalLayerClusters.plugin.fcPerMip = cms.vdouble(HGCalUncalibRecHit.HGCEEConfig.fCPerMIP) hgcalLayerClusters.plugin.thicknessCorrection = cms.vdouble(HGCalRecHit.thicknessCorrection) -hgcalLayerClusters.plugin.sciThicknessCorrection = cms.double(HGCalRecHit.sciThicknessCorrection) -hgcalLayerClusters.plugin.deltasi_index_regemfac = cms.int32(HGCalRecHit.deltasi_index_regemfac) +hgcalLayerClusters.plugin.sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection +hgcalLayerClusters.plugin.deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac hgcalLayerClusters.plugin.fcPerEle = cms.double(fC_per_ele) hgcalLayerClusters.plugin.noises = cms.PSet(refToPSet_ = cms.string('HGCAL_noises')) hgcalLayerClusters.plugin.noiseMip = hgchebackDigitizer.digiCfg.noise From e23da4ec14e3b1728f2841dc3555ca2b3a7b77d8 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Tue, 12 May 2020 13:48:50 +0200 Subject: [PATCH 459/778] correcting sigmanoise in scint rechit --- .../HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc index cf461c5bb73d2..2f9307d7e0958 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc @@ -185,7 +185,7 @@ bool HGCalRecHitWorkerSimple::run(const edm::Event& evt, break; case hgcbh: rechitMaker_->setADCToGeVConstant(float(hgchebUncalib2GeV_)); - sigmaNoiseGeV = 1e-3 * hgcHEB_noise_MIP_ * weights_[layer]; + sigmaNoiseGeV = 1e-3 * hgcHEB_noise_MIP_ * weights_[layer] * rcorrscint_; break; case hgchfnose: rechitMaker_->setADCToGeVConstant(float(hgchfnoseUncalib2GeV_)); From 9f1290a2e06d3b937e24ab96c73e4d18336fa9f3 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Tue, 12 May 2020 15:21:18 +0200 Subject: [PATCH 460/778] correcting for HFNose --- RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc index dafabc4b9d5c4..31455d891b827 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc @@ -43,15 +43,14 @@ void HGCalCLUEAlgoT<T>::populate(const HGCRecHitCollection& hits) { float sigmaNoise = 1.f; if (dependSensor_) { int thickness_index = rhtools_.getSiThickIndex(detid); - double storedThreshold = 9999.; + if (thickness_index == -1) + thickness_index = 6; + double storedThreshold = thresholds_[layerOnSide][thickness_index]; if ( detid.det() == DetId::HGCalEE || detid.subdetId() == HGCEE ){ storedThreshold = thresholds_[layerOnSide][thickness_index]; } else if ( detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF){ storedThreshold = thresholds_[layerOnSide][thickness_index + deltasi_index_regemfac_]; - } else if ( thickness_index == -1 ){ - thickness_index = 6; - storedThreshold = thresholds_[layerOnSide][thickness_index]; - } + } sigmaNoise = v_sigmaNoise_[layerOnSide][thickness_index]; if (hgrh.energy() < storedThreshold) From 7edf314a67a8c48d544ba20fd19d7322863bdb8d Mon Sep 17 00:00:00 2001 From: Felice <felice.pantaleo@cern.ch> Date: Fri, 22 May 2020 17:39:02 +0200 Subject: [PATCH 461/778] propagate fCPerMIP from Hadronic section to CLUE --- .../HGCalRecProducers/python/hgcalLayerClusters_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py index 3ed0f8a60b099..1411009d483aa 100644 --- a/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py +++ b/RecoLocalCalo/HGCalRecProducers/python/hgcalLayerClusters_cff.py @@ -12,7 +12,7 @@ hgcalLayerClusters.timeOffset = hgceeDigitizer.tofDelay hgcalLayerClusters.plugin.dEdXweights = cms.vdouble(dEdX.weights) -hgcalLayerClusters.plugin.fcPerMip = cms.vdouble(HGCalUncalibRecHit.HGCEEConfig.fCPerMIP) +hgcalLayerClusters.plugin.fcPerMip = cms.vdouble(HGCalUncalibRecHit.HGCEEConfig.fCPerMIP + HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP) hgcalLayerClusters.plugin.thicknessCorrection = cms.vdouble(HGCalRecHit.thicknessCorrection) hgcalLayerClusters.plugin.sciThicknessCorrection = HGCalRecHit.sciThicknessCorrection hgcalLayerClusters.plugin.deltasi_index_regemfac = HGCalRecHit.deltasi_index_regemfac From ff1c64db06960a0fd70c3d4c28192cbe5d1e6a00 Mon Sep 17 00:00:00 2001 From: Felice <felice.pantaleo@cern.ch> Date: Fri, 22 May 2020 17:40:11 +0200 Subject: [PATCH 462/778] Increase the size of noises vector to accommodate Hadronic section noises --- RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h index 9b63a63874b5d..50e9a1fa1d16e 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h @@ -47,7 +47,12 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { nonAgedNoises_(ps.getParameter<edm::ParameterSet>("noises").getParameter<std::vector<double>>("values")), noiseMip_(ps.getParameter<edm::ParameterSet>("noiseMip").getParameter<double>("noise_MIP")), use2x2_(ps.getParameter<bool>("use2x2")), - initialized_(false) {} + initialized_(false) { + // repeat same noises for CE-H as well + if (!isNose_) { + nonAgedNoises_.insert(std::end(nonAgedNoises_), std::begin(nonAgedNoises_), std::end(nonAgedNoises_)); + } + } ~HGCalCLUEAlgoT() override {} From 3e334ca16c6aa1e2333a88b0545b0ad1671bd31b Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Wed, 30 Sep 2020 09:28:30 +0200 Subject: [PATCH 463/778] correcting the scint regional factor --- .../HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc index 2f9307d7e0958..ff4af9b75d4a3 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc @@ -59,7 +59,9 @@ HGCalRecHitWorkerSimple::HGCalRecHitWorkerSimple(const edm::ParameterSet& ps) : rcorr_.push_back(1.0 / corr); } // here for scintillator - rcorrscint_ = ps.getParameter<double>("sciThicknessCorrection"); + const auto& rcorrscint = ps.getParameter<double>("sciThicknessCorrection"); + rcorrscint_ = 1.0 / rcorrscint; + //This is for the index position in CE_H silicon thickness cases deltasi_index_regemfac_ = ps.getParameter<int>("deltasi_index_regemfac"); const auto& rcorrnose = ps.getParameter<std::vector<double> >("thicknessNoseCorrection"); From 362a900cf8cd0255d79a5159c92f754a3864c934 Mon Sep 17 00:00:00 2001 From: aravind sugunan <aravindsugunan@gmail.com> Date: Fri, 9 Oct 2020 16:41:44 +0200 Subject: [PATCH 464/778] adding direct assignment to data member --- .../PixelVertexFinding/src/PVClusterComparer.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc b/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc index cb398e94e57a3..a21b8861a42a7 100644 --- a/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc +++ b/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc @@ -76,13 +76,12 @@ double PVClusterComparer::pTSquaredSum(const reco::Vertex &v) { } void PVClusterComparer::setChisquareQuantile() { - std::vector<double> maxChi2(20, 0.); + maxChi2_.clear(); + maxChi2_.resize(20,0.0); if (track_prob_min_ >= 0. && track_prob_min_ <= 1.) - for (size_t ndof = 0; ndof < maxChi2.size(); ++ndof) + for (size_t ndof = 0; ndof < 20; ++ndof) // http://root.cern.ch/root/html/TMath.html#TMath:ChisquareQuantile - maxChi2[ndof] = TMath::ChisquareQuantile(1 - track_prob_min_, ndof); - - maxChi2_ = maxChi2; + maxChi2_[ndof]=TMath::ChisquareQuantile(1 - track_prob_min_, ndof); } void PVClusterComparer::updateChisquareQuantile(size_t ndof) { From 8be23f17eb230649088edaee7f629d27e442a0a5 Mon Sep 17 00:00:00 2001 From: aravind sugunan <aravindsugunan@gmail.com> Date: Fri, 9 Oct 2020 16:42:51 +0200 Subject: [PATCH 465/778] code format --- .../PixelVertexFinding/src/PVClusterComparer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc b/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc index a21b8861a42a7..e809401cba1e4 100644 --- a/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc +++ b/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc @@ -77,11 +77,11 @@ double PVClusterComparer::pTSquaredSum(const reco::Vertex &v) { void PVClusterComparer::setChisquareQuantile() { maxChi2_.clear(); - maxChi2_.resize(20,0.0); + maxChi2_.resize(20, 0.0); if (track_prob_min_ >= 0. && track_prob_min_ <= 1.) for (size_t ndof = 0; ndof < 20; ++ndof) // http://root.cern.ch/root/html/TMath.html#TMath:ChisquareQuantile - maxChi2_[ndof]=TMath::ChisquareQuantile(1 - track_prob_min_, ndof); + maxChi2_[ndof] = TMath::ChisquareQuantile(1 - track_prob_min_, ndof); } void PVClusterComparer::updateChisquareQuantile(size_t ndof) { From 232ce042b0758550891c6656004671fb72966032 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Fri, 9 Oct 2020 16:43:33 +0200 Subject: [PATCH 466/778] code checks --- .../HGCalRecProducers/plugins/HGCalCLUEAlgo.cc | 12 ++++++------ .../HGCalRecProducers/plugins/HGCalCLUEAlgo.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc index 31455d891b827..e8464f45431af 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc @@ -44,13 +44,13 @@ void HGCalCLUEAlgoT<T>::populate(const HGCRecHitCollection& hits) { if (dependSensor_) { int thickness_index = rhtools_.getSiThickIndex(detid); if (thickness_index == -1) - thickness_index = 6; + thickness_index = 6; double storedThreshold = thresholds_[layerOnSide][thickness_index]; - if ( detid.det() == DetId::HGCalEE || detid.subdetId() == HGCEE ){ - storedThreshold = thresholds_[layerOnSide][thickness_index]; - } else if ( detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF){ - storedThreshold = thresholds_[layerOnSide][thickness_index + deltasi_index_regemfac_]; - } + if (detid.det() == DetId::HGCalEE || detid.subdetId() == HGCEE) { + storedThreshold = thresholds_[layerOnSide][thickness_index]; + } else if (detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF) { + storedThreshold = thresholds_[layerOnSide][thickness_index + deltasi_index_regemfac_]; + } sigmaNoise = v_sigmaNoise_[layerOnSide][thickness_index]; if (hgrh.energy() < storedThreshold) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h index 50e9a1fa1d16e..5b3006c615d04 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h @@ -41,18 +41,18 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { dEdXweights_(ps.getParameter<std::vector<double>>("dEdXweights")), thicknessCorrection_(ps.getParameter<std::vector<double>>("thicknessCorrection")), sciThicknessCorrection_(ps.getParameter<double>("sciThicknessCorrection")), - deltasi_index_regemfac_(ps.getParameter<int>("deltasi_index_regemfac")), + deltasi_index_regemfac_(ps.getParameter<int>("deltasi_index_regemfac")), fcPerMip_(ps.getParameter<std::vector<double>>("fcPerMip")), fcPerEle_(ps.getParameter<double>("fcPerEle")), nonAgedNoises_(ps.getParameter<edm::ParameterSet>("noises").getParameter<std::vector<double>>("values")), noiseMip_(ps.getParameter<edm::ParameterSet>("noiseMip").getParameter<double>("noise_MIP")), use2x2_(ps.getParameter<bool>("use2x2")), initialized_(false) { - // repeat same noises for CE-H as well - if (!isNose_) { - nonAgedNoises_.insert(std::end(nonAgedNoises_), std::begin(nonAgedNoises_), std::end(nonAgedNoises_)); - } - } + // repeat same noises for CE-H as well + if (!isNose_) { + nonAgedNoises_.insert(std::end(nonAgedNoises_), std::begin(nonAgedNoises_), std::end(nonAgedNoises_)); + } + } ~HGCalCLUEAlgoT() override {} From 18000d8e2486060adaedecda82be4eaa37d4eae0 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Fri, 9 Oct 2020 10:38:44 -0500 Subject: [PATCH 467/778] Removed unnecessary dependency on sigc++ --- CondFormats/PhysicsToolsObjects/BuildFile.xml | 1 - GeneratorInterface/LHEInterface/BuildFile.xml | 1 - HLTrigger/Timer/BuildFile.xml | 1 - SimG4Core/Physics/BuildFile.xml | 1 - SimG4Core/Watcher/BuildFile.xml | 1 - SimMuon/DTDigitizer/test/BuildFile.xml | 1 - 6 files changed, 6 deletions(-) diff --git a/CondFormats/PhysicsToolsObjects/BuildFile.xml b/CondFormats/PhysicsToolsObjects/BuildFile.xml index 9f1b0ffdb921c..a5ccf5caa4033 100644 --- a/CondFormats/PhysicsToolsObjects/BuildFile.xml +++ b/CondFormats/PhysicsToolsObjects/BuildFile.xml @@ -4,7 +4,6 @@ <use name="boost_serialization"/> <use name="boost_iostreams"/> <use name="boost"/> -<use name="sigcpp"/> <use name="root"/> <export> <lib name="1"/> diff --git a/GeneratorInterface/LHEInterface/BuildFile.xml b/GeneratorInterface/LHEInterface/BuildFile.xml index 7ab4ad8f36739..6fcd808f731bd 100644 --- a/GeneratorInterface/LHEInterface/BuildFile.xml +++ b/GeneratorInterface/LHEInterface/BuildFile.xml @@ -6,7 +6,6 @@ <use name="Utilities/StorageFactory"/> <use name="hepmc"/> <use name="boost"/> -<use name="sigcpp"/> <use name="xerces-c"/> <use name="rootmath"/> <use name="fastjet"/> diff --git a/HLTrigger/Timer/BuildFile.xml b/HLTrigger/Timer/BuildFile.xml index 7d28a7ac17025..8ad3a7510d307 100644 --- a/HLTrigger/Timer/BuildFile.xml +++ b/HLTrigger/Timer/BuildFile.xml @@ -1,4 +1,3 @@ -<use name="sigcpp"/> <use name="boost_chrono"/> <use name="DataFormats/Provenance"/> <use name="FWCore/Framework"/> diff --git a/SimG4Core/Physics/BuildFile.xml b/SimG4Core/Physics/BuildFile.xml index 6a0611d1d8875..3f0dae0a4826b 100644 --- a/SimG4Core/Physics/BuildFile.xml +++ b/SimG4Core/Physics/BuildFile.xml @@ -5,5 +5,4 @@ <use name="geant4core"/> <use name="heppdt"/> <use name="boost"/> -<use name="sigcpp"/> <use name="expat"/> diff --git a/SimG4Core/Watcher/BuildFile.xml b/SimG4Core/Watcher/BuildFile.xml index 8039848a64bad..400c1707f6b5e 100644 --- a/SimG4Core/Watcher/BuildFile.xml +++ b/SimG4Core/Watcher/BuildFile.xml @@ -1,6 +1,5 @@ <use name="FWCore/Framework"/> <use name="boost"/> -<use name="sigcpp"/> <export> <lib name="1"/> </export> diff --git a/SimMuon/DTDigitizer/test/BuildFile.xml b/SimMuon/DTDigitizer/test/BuildFile.xml index bce826fdfc277..53127fafbc8ed 100644 --- a/SimMuon/DTDigitizer/test/BuildFile.xml +++ b/SimMuon/DTDigitizer/test/BuildFile.xml @@ -1,7 +1,6 @@ <use name="CLHEP"/> <use name="root"/> <use name="boost"/> -<use name="sigcpp"/> <bin name="testDriftTimeParam" file="testDriftTimeParam.cpp"> </bin> From 5d1f0d6d16dcd45a001f2597feefe4e3b44d2b3d Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Fri, 9 Oct 2020 19:52:30 +0200 Subject: [PATCH 468/778] Remove CASTOR geometry from Run3 scenario --- .../python/GeometryExtended2021Reco_cff.py | 20 ++++++++++++++++--- ...eometryExtended2021ZeroMaterialReco_cff.py | 20 ++++++++++++++++--- .../Geometry/python/dict2021Geometry.py | 20 ++++++++++++++++--- 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py index 5531e71ee2319..3e6709e27a6e2 100644 --- a/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py @@ -15,12 +15,26 @@ # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometry_cff import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "EcalEndcap", + "EcalPreshower", + "TOWER", + ) +) +from Geometry.EcalAlgo.EcalGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * # muon from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py b/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py index f43588820fa3d..4f24b269ace4c 100644 --- a/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py @@ -15,12 +15,26 @@ # calo from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometry_cff import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "EcalEndcap", + "EcalPreshower", + "TOWER", + ) +) +from Geometry.EcalAlgo.EcalGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * # muon from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * diff --git a/Configuration/Geometry/python/dict2021Geometry.py b/Configuration/Geometry/python/dict2021Geometry.py index 84e8899e81184..2c1a8129aa17a 100644 --- a/Configuration/Geometry/python/dict2021Geometry.py +++ b/Configuration/Geometry/python/dict2021Geometry.py @@ -983,12 +983,26 @@ ], "reco" : [ 'from Geometry.CaloEventSetup.CaloTopology_cfi import *', - 'from Geometry.CaloEventSetup.CaloGeometry_cff import *', + 'from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import *', + 'CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder",', + ' SelectedCalos = cms.vstring("HCAL",', + ' "ZDC",', + ' "EcalBarrel",', + ' "EcalEndcap",', + ' "EcalPreshower",', + ' "TOWER",', + ' )', + ')', + 'from Geometry.EcalAlgo.EcalGeometry_cfi import *', + 'from Geometry.HcalEventSetup.HcalGeometry_cfi import *', + 'from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import *', + 'from Geometry.HcalEventSetup.CaloTowerTopology_cfi import *', + 'from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import *', + 'from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import *', + 'from Geometry.ForwardGeometry.ForwardGeometry_cfi import *', 'from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import *', 'from Geometry.EcalMapping.EcalMapping_cfi import *', 'from Geometry.EcalMapping.EcalMappingRecord_cfi import *', - 'from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import *', - 'from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import *', ], "era" : "run3_HB", } From ccb350433036e48b8515dce0b8f9e26a3c7b31f5 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Fri, 9 Oct 2020 13:43:17 -0500 Subject: [PATCH 469/778] Removed vdt dependency on DataFormats/ParticleFlowReco PFCluster.cc had a templated anonymous function using the vdt but that function was never called. --- DataFormats/ParticleFlowReco/BuildFile.xml | 1 - DataFormats/ParticleFlowReco/src/PFCluster.cc | 29 ------------------- 2 files changed, 30 deletions(-) diff --git a/DataFormats/ParticleFlowReco/BuildFile.xml b/DataFormats/ParticleFlowReco/BuildFile.xml index ebd68aff657ea..70e9023625204 100644 --- a/DataFormats/ParticleFlowReco/BuildFile.xml +++ b/DataFormats/ParticleFlowReco/BuildFile.xml @@ -17,7 +17,6 @@ <use name="FWCore/MessageLogger"/> <use name="rootcore"/> <use name="rootmath"/> -<use name="vdt_headers"/> <flags LCG_DICT_HEADER="classes_1.h classes_2.h"/> <flags LCG_DICT_XML="classes_def_1.xml classes_def_2.xml"/> <export> diff --git a/DataFormats/ParticleFlowReco/src/PFCluster.cc b/DataFormats/ParticleFlowReco/src/PFCluster.cc index eeef11029f549..df1200f40d022 100644 --- a/DataFormats/ParticleFlowReco/src/PFCluster.cc +++ b/DataFormats/ParticleFlowReco/src/PFCluster.cc @@ -1,36 +1,7 @@ #include "DataFormats/ParticleFlowReco/interface/PFCluster.h" -#include "vdt/vdtMath.h" #include "Math/GenVector/etaMax.h" -namespace { - - // an implementation of Eta_FromRhoZ of root libraries using vdt - template <typename Scalar> - inline Scalar Eta_FromRhoZ_fast(Scalar rho, Scalar z) { - using namespace ROOT::Math; - // value to control Taylor expansion of sqrt - const Scalar big_z_scaled = std::pow(std::numeric_limits<Scalar>::epsilon(), static_cast<Scalar>(-.25)); - if (rho > 0) { - Scalar z_scaled = z / rho; - if (std::fabs(z_scaled) < big_z_scaled) { - return vdt::fast_log(z_scaled + std::sqrt(z_scaled * z_scaled + 1.0)); - } else { - // apply correction using first order Taylor expansion of sqrt - return z > 0 ? vdt::fast_log(2.0 * z_scaled + 0.5 / z_scaled) : -vdt::fast_log(-2.0 * z_scaled); - } - } - // case vector has rho = 0 - else if (z == 0) { - return 0; - } else if (z > 0) { - return z + etaMax<Scalar>(); - } else { - return z - etaMax<Scalar>(); - } - } -} // namespace - using namespace std; using namespace reco; From 3a72afdfcd243ec9230561e3a207a09c2c506239 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Fri, 9 Oct 2020 21:21:02 +0200 Subject: [PATCH 470/778] Fix a part of DDEcalBarrelNewAlgo to add the missing volumes in dd4hep --- .../data/dd4hep/cms-ecal-geometry.xml | 5 +- .../plugins/DDEcalBarrelNewAlgo.cc | 320 +++++++++++--- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 397 +++++++++++++++++- .../python/runEcalSimParameterDD4Hep_cfg.py | 4 +- 4 files changed, 649 insertions(+), 77 deletions(-) diff --git a/Geometry/EcalCommonData/data/dd4hep/cms-ecal-geometry.xml b/Geometry/EcalCommonData/data/dd4hep/cms-ecal-geometry.xml index e80259349c652..62fc9eeb2b3f9 100644 --- a/Geometry/EcalCommonData/data/dd4hep/cms-ecal-geometry.xml +++ b/Geometry/EcalCommonData/data/dd4hep/cms-ecal-geometry.xml @@ -1,6 +1,8 @@ <?xml version="1.0"?> <DDDefinition> + <debug> +<!-- <debug_shapes/> <debug_includes/> <debug_rotations/> @@ -10,10 +12,11 @@ <debug_materials/> <debug_namespaces/> <debug_placements/> - <debug_algorithms/> <debug_materials/> <debug_visattr/> <debug_specpars/> + <debug_algorithms/> +--> </debug> <open_geometry/> diff --git a/Geometry/EcalCommonData/plugins/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/DDEcalBarrelNewAlgo.cc index 3ba581f4140c3..4b03539329a93 100644 --- a/Geometry/EcalCommonData/plugins/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/DDEcalBarrelNewAlgo.cc @@ -1,4 +1,3 @@ - ////////////////////////////////////////////////////////////////////////////// // File: DDEcalBarrelNewAlgo.cc // Description: Geometry factory class for Ecal Barrel @@ -29,6 +28,8 @@ #include "Geometry/CaloGeometry/interface/EcalTrapezoidParameters.h" #include "CLHEP/Geometry/Transform3D.h" +//#define EDM_ML_DEBUG + class DDEcalBarrelNewAlgo : public DDAlgorithm { public: typedef EcalTrapezoidParameters Trap; @@ -1138,7 +1139,9 @@ DDEcalBarrelNewAlgo::DDEcalBarrelNewAlgo() m_PincerCutHeight(0) { - LogDebug("EcalGeom") << "DDEcalBarrelAlgo info: Creating an instance"; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: Creating an instance"; +#endif } DDEcalBarrelNewAlgo::~DDEcalBarrelNewAlgo() {} @@ -1148,7 +1151,9 @@ void DDEcalBarrelNewAlgo::initialize(const DDNumericArguments& nArgs, const DDMapArguments& /*mArgs*/, const DDStringArguments& sArgs, const DDStringVectorArguments& vsArgs) { - LogDebug("EcalGeom") << "DDEcalBarrelAlgo info: Initialize"; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: Initialize"; +#endif m_idNameSpace = DDCurrentNamespace::ns(); // TRICK! m_idNameSpace = parent().name().ns(); @@ -1506,7 +1511,9 @@ void DDEcalBarrelNewAlgo::initialize(const DDNumericArguments& nArgs, m_PincerCutWidth = nArgs["PincerCutWidth"]; m_PincerCutHeight = nArgs["PincerCutHeight"]; - LogDebug("EcalGeom") << "DDEcalBarrelAlgo info: end initialize"; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: end initialize"; +#endif } //////////////////////////////////////////////////////////////////// @@ -1514,8 +1521,9 @@ void DDEcalBarrelNewAlgo::initialize(const DDNumericArguments& nArgs, //////////////////////////////////////////////////////////////////// void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { - LogDebug("EcalGeom") << "******** DDEcalBarrelAlgo execute!" << std::endl; - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "******** DDEcalBarrelAlgo execute!" << std::endl; +#endif if (barHere() != 0) { const unsigned int copyOne(1); const unsigned int copyTwo(2); @@ -1532,6 +1540,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { Rota(Vec3(vecBarRota3()[0], vecBarRota3()[1], vecBarRota3()[2]), vecBarRota3()[3]) * Rota(Vec3(vecBarRota2()[0], vecBarRota2()[1], vecBarRota2()[2]), vecBarRota2()[3]) * Rota(Vec3(vecBarRota()[0], vecBarRota()[1], vecBarRota()[2]), vecBarRota()[3]))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << barName().name() << ":" << copyOne << " positioned in " << parent().name().name(); +#endif // End Barrel parent volume---------------------------------------------------------- // Supermodule parent------------------------------------------------------------ @@ -1607,10 +1618,15 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDTranslation sideddtra(sideRot.getTranslation()); cpv.position(sideLog, spmName(), icopy, sideddtra, sideddrot); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << sideLog.name().name() << ":" << icopy << " positioned in " << spmName().name(); +#endif if (0 != spmCutShow()) // do this if we are "showing" the boxes { cpv.position(spmCutLog, spmName(), icopy, ddtra, ddrot); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << spmCutLog.name().name() << ":" << icopy << " positioned in " << spmName().name(); +#endif } else // do this if we are subtracting the boxes { if (1 == icopy) { @@ -1653,6 +1669,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { // convert from CLHEP to DDTranslation & etc. -- Michael Case DDTranslation myTran(both.getTranslation().x(), both.getTranslation().y(), both.getTranslation().z()); cpv.position(spmLog, barName(), iphi + 1, myTran, rota); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << spmLog.name().name() << ":" << (iphi + 1) << " positioned in " << barName().name(); +#endif } } // End Supermodule parent------------------------------------------------------------ @@ -1669,7 +1688,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDSolidFactory::tubs(ilyDDName, ilyLength / 2, ilyRMin, ilyRMin + ilyThick, ilyPhiLow(), ilyDelPhi())); const DDLogicalPart ilyLog(ilyDDName, spmMat(), ilySolid); cpv.position(ilyLog, spmLog, copyOne, DDTranslation(0, 0, ilyLength / 2), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyDDName.name() << ":" << copyOne << " positioned in " << spmLog.name().name(); +#endif DDLogicalPart ilyPipeLog[200]; if (0 != ilyPipeHere()) { @@ -1686,6 +1707,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDLogicalPart ilyPipeWaLog(pWaName, backPipeWaterMat(), ilyPipeWaSolid); cpv.position(ilyPipeWaLog, pName, copyOne, DDTranslation(0, 0, 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << pWaName.name() << ":" << copyOne << " positioned in " << pName.name(); +#endif } } @@ -1713,12 +1737,17 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyDiffLength() / 2 + ilyDiffOff()), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyDiffName().name() << ":" << copyOne << " positioned in " << ilyFanOutName().name(); +#endif cpv.position(ilyBndlLog, ilyFanOutName(), copyOne, DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyBndlLength() / 2 + ilyBndlOff()), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyBndlName().name() << ":" << copyOne << " positioned in " << ilyFanOutName().name(); +#endif for (unsigned int ily(0); ily != vecIlyThick().size(); ++ily) { const double ilyRMax(ilyRMin + vecIlyThick()[ily]); const DDName xilyName(ddname(ilyName() + std::to_string(ily))); @@ -1729,7 +1758,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { if (0 != ilyHere()) { cpv.position(xilyLog, ilyLog, copyOne, DDTranslation(0, 0, 0), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << xilyName.name() << ":" << copyOne << " positioned in " << ilyName(); +#endif unsigned int copyNum[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (10 * mm < vecIlyThick()[ily] && vecIlyThick().size() != (ily + 1) && 0 != ilyPipeHere()) { @@ -1746,6 +1777,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { ptmCopy, DDTranslation(xx, yy, vecIlyPTMZ()[ilyPTM] - ilyLength / 2), myrot(ilyPTMLog.name().name() + "_rot" + std::to_string(ptmCopy), CLHEP::HepRotationZ(phi))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyPTMLog.name().name() << ":" << ptmCopy << " positioned in " << xilyLog.name().name(); +#endif } } if (0 != ilyFanOutHere()) { @@ -1762,6 +1796,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(xx, yy, vecIlyFanOutZ()[ilyFO] - ilyLength / 2), myrot(ilyFanOutLog.name().name() + "_rot" + std::to_string(fanOutCopy), CLHEP::HepRotationZ(phi) * CLHEP::HepRotationY(180 * deg))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyFanOutLog.name().name() << ":" << fanOutCopy << " positioned in " << xilyLog.name().name(); +#endif } unsigned int femCopy(0); for (unsigned int ilyFEM(0); ilyFEM != vecIlyFEMZ().size(); ++ilyFEM) { @@ -1775,6 +1812,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { femCopy, DDTranslation(xx, yy, vecIlyFEMZ()[ilyFEM] - ilyLength / 2), myrot(ilyFEMLog.name().name() + "_rot" + std::to_string(femCopy), CLHEP::HepRotationZ(phi))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyFEMLog.name().name() << ":" << femCopy << " positioned in " << xilyLog.name().name(); +#endif } } for (unsigned int iPipe(0); iPipe != vecIlyPipePhi().size(); ++iPipe) { @@ -1796,6 +1836,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { (9 > type ? DDRotation() : myrot(ilyPipeLog[type].name().name() + "_rot" + std::to_string(copyNum[type]), Rota(Vec3(xx, yy, 0), 90 * deg)))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyPipeLog[type].name().name() << ":" << copyNum[type] << " positioned in " << xilyLog.name().name(); +#endif } } } @@ -1817,7 +1860,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDSolid clyrSolid(DDSolidFactory::polycone(clyrName, -9.5 * deg, 19 * deg, czz, cri, cro)); const DDLogicalPart clyrLog(clyrName, ddmat(vecIlyMat()[4]), clyrSolid); cpv.position(clyrLog, spmLog, copyOne, DDTranslation(0, 0, 0), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << clyrLog.name().name() << ":" << copyOne << " positioned in " << spmLog.name().name(); +#endif // Begin Alveolar Wedge parent ------------------------------------------------------ //---------------- @@ -1957,7 +2002,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()), myrot(hawRName().name() + "R", hawRform.getRotation())); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << hawRLog.name().name() << ":" << copyOne << " positioned in " << fawLog.name().name(); +#endif cpv.position( hawRLog, fawLog, @@ -1966,7 +2013,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { myrot(hawRName().name() + "RotRefl", CLHEP::HepRotationY(180 * deg) * // rotate about Y after refl thru Z CLHEP::HepRep3x3(1, 0, 0, 0, 1, 0, 0, 0, -1))); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << hawRLog.name().name() << ":" << copyTwo << " positioned in " << fawLog.name().name(); +#endif /* this for display of haw cut box instead of subtraction cpv.position( hawCutLog, hawRName, @@ -1988,6 +2037,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { iPhi, DDTranslation(fawform.getTranslation().x(), fawform.getTranslation().y(), fawform.getTranslation().z()), myrot(fawName().name() + "_Rot" + std::to_string(iPhi), fawform.getRotation())); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << fawLog.name().name() << ":" << iPhi << " positioned in " << spmLog.name().name(); +#endif } // End Alveolar Wedge parent ------------------------------------------------------ @@ -2026,7 +2078,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()), myrot(gridName().name() + "R", gridForm.getRotation())); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << gridLog.name().name() << ":" << copyOne << " positioned in " << hawRLog.name().name(); +#endif // End Grid + Tablet insertion // begin filling Wedge with crystal plus supports -------------------------- @@ -2063,7 +2117,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { for (unsigned int cryType(1); cryType <= nCryTypes(); ++cryType) { const std::string sType("_" + std::string(10 > cryType ? "0" : "") + std::to_string(cryType)); - LogDebug("EcalGeom") << "Crytype=" << cryType; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "Crytype=" << cryType; +#endif const double ANom(vecNomCryDimAR()[cryType - 1]); const double BNom(vecNomCryDimCR()[cryType - 1]); const double bNom(vecNomCryDimCF()[cryType - 1]); @@ -2272,29 +2328,44 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(0, 0, (rClr - fClr) / 2), //SAME as cryToClr above. DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << cryLog.name().name() << ":" << copyOne << " positioned in " << clrLog.name().name(); +#endif if (0 != capHere()) { cpv.position(aglLog, bsiLog, copyAGL, DDTranslation(0, 0, -aglThick() / 2. + bsiThick() / 2.), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << aglLog.name().name() << ":" << copyAGL << " positioned in " << bsiLog.name().name(); +#endif cpv.position( andLog, bsiLog, copyAND, DDTranslation(0, 0, -andThick() / 2. - aglThick() + bsiThick() / 2.), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << andLog.name().name() << ":" << copyAND << " positioned in " << bsiLog.name().name(); +#endif cpv.position(apdLog, bsiLog, copyAPD, DDTranslation(0, 0, -apdThick() / 2. - andThick() - aglThick() + bsiThick() / 2.), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << apdLog.name().name() << ":" << copyAPD << " positioned in " << bsiLog.name().name(); +#endif cpv.position(atjLog, bsiLog, copyATJ, DDTranslation(0, 0, -atjThick() / 2. - apdThick() - andThick() - aglThick() + bsiThick() / 2.), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << atjLog.name().name() << ":" << copyATJ << " positioned in " << bsiLog.name().name(); +#endif cpv.position(bsiLog, cerLog, copyBSi, DDTranslation(0, 0, -bsiThick() / 2. + cerThick() / 2.), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << bsiLog.name().name() << ":" << copyBSi << " positioned in " << cerLog.name().name(); +#endif cpv.position(sglLog, capLog, copySGL, DDTranslation(0, 0, -sglThick() / 2. + capThick() / 2.), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << sglLog.name().name() << ":" << copySGL << " positioned in " << capLog.name().name(); +#endif for (unsigned int ijkl(0); ijkl != 2; ++ijkl) { cpv.position(cerLog, capLog, @@ -2303,13 +2374,18 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { trapCry.h1() - apdZ(), -sglThick() - cerThick() / 2. + capThick() / 2.), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << cerLog.name().name() << ":" << copyCER << " positioned in " << capLog.name().name(); +#endif } - cpv.position(capLog, clrLog, copyCap, DDTranslation(0, 0, -trapCry.dz() - capThick() / 2. + (rClr - fClr) / 2.), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << capLog.name().name() << ":" << copyCap << " positioned in " << clrLog.name().name(); +#endif } const Vec3 clrToWrap(0, 0, (rWrap - fWrap) / 2); @@ -2319,6 +2395,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(0, 0, (rWrap - fWrap) / 2), //SAME as cryToWrap DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << clrLog.name().name() << ":" << copyOne << " positioned in " << wrapLog.name().name(); +#endif // Now for placement of clr within wall const Vec3 wrapToWall1(0, 0, (rWall - fWall) / 2); @@ -2329,7 +2408,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(Vec3((cryType > 9 ? 0 : 0.005 * mm), 0, 0) + wrapToWall1), //SAME as wrapToWall DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << wrapLog.name().name() << ":" << copyOne << " positioned in " << wallLog.name().name(); +#endif const Trap::VertexList vWall(trapWall.vertexList()); const Trap::VertexList vCry(trapCry.vertexList()); @@ -2356,13 +2437,14 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { } for (unsigned int etaAlv(1); etaAlv <= nCryPerAlvEta(); ++etaAlv) { - LogDebug("EcalGeom") << "theta=" << theta / deg << ", sidePrime=" << sidePrime << ", frontPrime=" << frontPrime - << ", zeta=" << zeta << ", delta=" << delta << ", zee=" << zee; - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "theta=" << theta / deg << ", sidePrime=" << sidePrime << ", frontPrime=" << frontPrime << ", zeta=" << zeta << ", delta=" << delta << ", zee=" << zee; +#endif zee += 0.075 * mm + (side * cos(zeta) + trapWall.h() - sidePrime) / sin(theta); - LogDebug("EcalGeom") << "New zee=" << zee; - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "New zee=" << zee; +#endif // make transform for placing enclosed crystal const Pt3D trap2(vCry[2] + cryToClr + clrToWrap + wrapToWall); @@ -2385,7 +2467,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { etaAlv, DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()), myrot(wallLog.name().name() + "_" + std::to_string(etaAlv), tForm.getRotation())); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << wallLog.name().name() << ":" << etaAlv << " positioned in " << hawRLog.name().name(); +#endif theta -= delta; side = sidePrime; zeta = delta; @@ -2451,12 +2535,17 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDTranslation backPlate2Tra(0, -backPlateParms[1] + backPlate2Thick() / 2., 0); if (0 != backPlateHere()) { cpv.position(backPlate2Log, backPlateName(), copyOne, backPlate2Tra, DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backPlate2Log.name().name() << ":" << copyOne << " positioned in " << backPlateName().name(); +#endif cpv.position(backPlateLog, spmName(), copyOne, outtra + backPlateTra, myrot(backPlateName().name() + "Rot5", CLHEP::HepRotationZ(270 * deg))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backPlateLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); +#endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2492,13 +2581,18 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, outtra + backSideTra1, myrot(backSideName().name() + "Rot8", CLHEP::HepRotationX(180 * deg) * CLHEP::HepRotationZ(90 * deg))); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backSideLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); +#endif const DDTranslation backSideTra2(0 * mm, -backPlateWidth() / 2 + backSideYOff2(), 1 * mm); cpv.position(backSideLog, spmName(), copyTwo, outtra + backSideTra2, myrot(backSideName().name() + "Rot9", CLHEP::HepRotationZ(90 * deg))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backSideLog.name().name() << ":" << copyTwo << " positioned in " << spmName().name(); +#endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2526,7 +2620,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { mBManifWaName, backCoolWidth / 2. - manifCut, 0, mBManifInnDiam() / 2, 0 * deg, 360 * deg)); const DDLogicalPart mBManifWaLog(mBManifWaName, backPipeWaterMat(), mBManifWaSolid); cpv.position(mBManifWaLog, mBManifName(), copyOne, DDTranslation(0, 0, 0), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBManifWaLog.name().name() << ":" << copyOne << " positioned in " << mBManifName().name(); +#endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!! End Mother Board Cooling Manifold Setup !!!!!!!! @@ -2574,12 +2670,19 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation( vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., +grMidSlotXOff(), 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name().name() << ":" << midSlotCopy << " positioned in " << gName.name(); +#endif + cpv.position(grMidSlotLog[(iGr - 1) / 2], gName, ++midSlotCopy, DDTranslation( vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., -grMidSlotXOff(), 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name().name() << ":" << midSlotCopy << " positioned in " << gName.name(); +#endif } if (0 != grEdgeSlotHere() && 0 != iGr) { @@ -2590,6 +2693,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation( vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2., backCoolWidth / 2 - grEdgeSlotWidth() / 2., 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name().name() << ":" << edgeSlotCopy << " positioned in " << gName.name(); +#endif cpv.position(grEdgeSlotLog, gName, ++edgeSlotCopy, @@ -2597,10 +2703,16 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { -backCoolWidth / 2 + grEdgeSlotWidth() / 2., 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name().name() << ":" << edgeSlotCopy << " positioned in " << gName.name(); +#endif } - if (0 != grilleHere()) + if (0 != grilleHere()) { cpv.position(grilleLog, spmName(), iGr, gTra, DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grilleLog.name().name() << ":" << iGr << " positioned in " << spmName().name(); +#endif + } if ((0 != iGr % 2) && (0 != mBManifHere())) { cpv.position(mBManifLog, spmName(), @@ -2609,6 +2721,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { manifCut, grilleThick() / 2. + 3 * mBManifOutDiam() / 2.), myrot(mBManifName().name() + "R1", CLHEP::HepRotationX(90 * deg))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBManifLog.name().name() << ":" << iGr << " positioned in " << spmName().name(); +#endif cpv.position(mBManifLog, spmName(), iGr - 1, @@ -2616,6 +2731,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { manifCut, grilleThick() / 2 + 3 * mBManifOutDiam() / 2.), myrot(mBManifName().name() + "R2", CLHEP::HepRotationX(90 * deg))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBManifLog.name().name() << ":" << (iGr - 1) << " positioned in " << spmName().name(); +#endif } } @@ -2640,12 +2758,18 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDLogicalPart backCoolBarSSLog(backCoolBarSSName(), backCoolBarSSMat(), backCoolBarSSSolid); const DDTranslation backCoolBarSSTra(0, 0, 0); cpv.position(backCoolBarSSLog, backCoolBarName(), copyOne, backCoolBarSSTra, DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolBarSSLog.name().name() << ":" << copyOne << " positioned in " << backCoolBarName().name(); +#endif DDSolid backCoolBarWaSolid(DDSolidFactory::box( backCoolBarWaName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., backCoolBarWaThick() / 2.)); const DDLogicalPart backCoolBarWaLog(backCoolBarWaName(), backCoolBarWaMat(), backCoolBarWaSolid); const DDTranslation backCoolBarWaTra(0, 0, 0); cpv.position(backCoolBarWaLog, backCoolBarSSName(), copyOne, backCoolBarWaTra, DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolBarWaLog.name().name() << ":" << copyOne << " positioned in " << backCoolBarSSName().name(); +#endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2676,6 +2800,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { ddname(vecBackVFELyrName()[iLyr]), ddmat(vecBackVFELyrMat()[iLyr]), backVFELyrSolid); const DDTranslation backVFELyrTra(0, 0, vecBackVFELyrThick()[iLyr] / 2); cpv.position(backVFELyrLog, backVFEName(), copyOne, backVFELyrTra + offTra, DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backVFELyrLog.name().name() << ":" << copyOne << " positioned in " << backVFEName().name(); +#endif offTra += 2 * backVFELyrTra; } @@ -2695,20 +2822,30 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDSolid backCoolVFESolid( DDSolidFactory::box(backCoolVFEName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., halfZCoolVFE)); const DDLogicalPart backCoolVFELog(backCoolVFEName(), backCoolVFEMat(), backCoolVFESolid); - if (0 != backCoolBarHere()) + if (0 != backCoolBarHere()) { cpv.position(backCoolBarLog, backCoolVFEName(), copyOne, DDTranslation(), DDRotation()); - if (0 != backCoolVFEHere()) +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolBarLog.name().name() << ":" << copyOne << " positioned in " << backCoolVFEName().name(); +#endif + } + if (0 != backCoolVFEHere()) { cpv.position(backVFELog, backCoolVFEName(), copyOne, DDTranslation(0, 0, backCoolBarThick() / 2. + thickVFE / 2.), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backVFELog.name().name() << ":" << copyOne << " positioned in " << backCoolVFEName().name(); +#endif + } cpv.position(backVFELog, backCoolVFEName(), copyTwo, DDTranslation(0, 0, -backCoolBarThick() / 2. - thickVFE / 2.), myrot(backVFEName().name() + "Flip", CLHEP::HepRotationX(180 * deg))); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backVFELog.name().name() << ":" << copyTwo << " positioned in " << backCoolVFEName().name(); +#endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!! End Cooling Bar + VFE Setup !!!!!!!!!!!!!!!!!!! @@ -2750,9 +2887,12 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { -realBPthick / 2 + backCoolHeight / 2 - vecGrilleHeight()[2 * iMod], deltaY, vecGrilleZOff()[2 * iMod] + grilleThick() + grilleZSpace() + halfZBCool - backSideLength() / 2); - if (0 != backCoolHere()) + if (0 != backCoolHere()) { cpv.position(backCoolLog, spmName(), iMod + 1, outtra + backPlateTra + bCoolTra, DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolLog.name().name() << ":" << (iMod + 1) << " positioned in " << spmName().name(); +#endif + } //=== const double backCoolTankHeight(backCoolBarHeight()); // - backBracketHeight() ) ; @@ -2762,7 +2902,7 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDSolid backCoolTankSolid( DDSolidFactory::box(bTankName, backCoolTankHeight / 2., backCoolTankWidth() / 2., halfZTank)); const DDLogicalPart backCoolTankLog(bTankName, backCoolTankMat(), backCoolTankSolid); - if (0 != backCoolTankHere()) + if (0 != backCoolTankHere()) { cpv.position(backCoolTankLog, backCName, copyOne, @@ -2770,6 +2910,10 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { backCoolBarWidth() / 2. + backCoolTankWidth() / 2., 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolTankLog.name().name() << ":" << copyOne << " positioned in " << backCName.name(); +#endif + } DDName bTankWaName(ddname(backCoolTankWaName() + std::to_string(iMod + 1))); DDSolid backCoolTankWaSolid(DDSolidFactory::box(bTankWaName, @@ -2778,12 +2922,15 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { halfZTank - backCoolTankThick() / 2.)); const DDLogicalPart backCoolTankWaLog(bTankWaName, backCoolTankWaMat(), backCoolTankWaSolid); cpv.position(backCoolTankWaLog, bTankName, copyOne, DDTranslation(0, 0, 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolTankWaLog.name().name() << ":" << copyOne << " positioned in " << bTankName.name(); +#endif DDName bBracketName(ddname(backBracketName() + std::to_string(iMod + 1))); DDSolid backBracketSolid( DDSolidFactory::box(bBracketName, backBracketHeight() / 2., backCoolTankWidth() / 2., halfZTank)); const DDLogicalPart backBracketLog(bBracketName, backBracketMat(), backBracketSolid); - if (0 != backCoolTankHere()) + if (0 != backCoolTankHere()) { cpv.position(backBracketLog, backCName, copyOne, @@ -2791,6 +2938,10 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { -backCoolBarWidth() / 2. - backCoolTankWidth() / 2., 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backBracketLog.name().name() << ":" << copyOne << " positioned in " << backCName.name(); +#endif + } /* cpv.position( backBracketLog, backCName, @@ -2815,9 +2966,12 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDTranslation bTra(vecBackMiscThick()[iMod * nMisc + j] / 2, 0 * mm, 0 * mm); - if (0 != backMiscHere()) + if (0 != backMiscHere()) { cpv.position(bLog, backCName, copyOne, bSumTra + bTra, DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << bLog.name().name() << ":" << copyOne << " positioned in " << backCName.name(); +#endif + } bSumTra += 2 * bTra; } @@ -2835,6 +2989,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { mTra += DDTranslation(vecMBLyrThick()[j] / 2.0, 0 * mm, 0 * mm); cpv.position(mLog, backCName, copyOne, mTra, DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mLog.name().name() << ":" << copyOne << " positioned in " << backCName.name(); +#endif mTra += DDTranslation(vecMBLyrThick()[j] / 2.0, 0 * mm, 0 * mm); } } @@ -2851,7 +3008,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDSolidFactory::tubs(mBWaName, halfZBCool, 0, mBCoolTubeInnDiam() / 2, 0 * deg, 360 * deg)); const DDLogicalPart mBWaLog(mBWaName, backPipeWaterMat(), mBCoolTubeWaSolid); cpv.position(mBWaLog, mBName, copyOne, DDTranslation(0, 0, 0), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBWaLog.name().name() << ":" << copyOne << " positioned in " << mBName.name(); +#endif for (unsigned int j(0); j != mBCoolTubeNum(); ++j) // loop over all MB cooling circuits { cpv.position( @@ -2861,6 +3020,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation( -backCoolHeight / 2.0 + mBCoolTubeOutDiam() / 2., -bHalfWidth + (j + 1) * bHalfWidth / 5, 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBLog.name().name() << ":" << (2 * j + 1) << " positioned in " << backCName.name(); +#endif } } @@ -2893,14 +3055,22 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { pipeZPos); cpv.position(backPipeLog, spmName(), copyOne, bPipeTra1, DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backPipeLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); +#endif const DDTranslation bPipeTra2(bPipeTra1.x(), backYOff() - backPlateWidth() / 2 + backSideWidth() + vecBackPipeDiam()[iMod], bPipeTra1.z()); cpv.position(backPipeLog, spmName(), copyTwo, bPipeTra2, DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backPipeLog.name().name() << ":" << copyTwo << " positioned in " << spmName().name(); +#endif cpv.position(backInnerLog, bPipeName, copyOne, DDTranslation(), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backInnerLog.name().name() << ":" << copyOne << " positioned in " << bPipeName.name(); +#endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2924,6 +3094,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { pipeZPos); cpv.position(dryAirTubeLog, spmName(), copyOne, dryAirTubeTra1, DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); +#endif const DDTranslation dryAirTubeTra2( dryAirTubeTra1.x(), @@ -2931,6 +3104,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { dryAirTubeTra1.z()); cpv.position(dryAirTubeLog, spmName(), copyTwo, dryAirTubeTra2, DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name().name() << ":" << copyTwo << " positioned in " << spmName().name(); +#endif } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -2946,6 +3122,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const unsigned int nMax(static_cast<unsigned int>(vecBackCoolNPerSec()[iNSec++])); for (unsigned int iBar(0); iBar != nMax; ++iBar) { cpv.position(backCoolVFELog, backCName, iCVFECopy++, cTra, DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolVFELog.name().name() << ":" << iCVFECopy << " positioned in " << backCName.name(); +#endif cTra += DDTranslation(0, 0, backCBStdSep()); } cTra -= DDTranslation(0, 0, backCBStdSep()); // backspace to previous @@ -2986,9 +3165,12 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDLogicalPart patchLog(patchPanelName(), spmMat(), patchSolid); const DDTranslation patchTra(backXOff() + 4 * mm, 0 * mm, vecGrilleZOff().back() + grilleThick() + patchParms[2]); - if (0 != patchPanelHere()) + if (0 != patchPanelHere()) { cpv.position(patchLog, spmName(), copyOne, patchTra, DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << patchLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); +#endif + } DDTranslation pTra(-patchParms[0], 0, 0); for (unsigned int j(0); j != vecPatchPanelNames().size(); ++j) { @@ -3001,7 +3183,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { pTra += DDTranslation(vecPatchPanelThick()[j] / 2, 0 * mm, 0 * mm); cpv.position(pLog, patchPanelName(), copyOne, pTra, DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << pLog.name().name() << ":" << copyOne << " positioned in " << patchPanelName().name(); +#endif pTra += DDTranslation(vecPatchPanelThick()[j] / 2, 0 * mm, 0 * mm); } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -3037,6 +3221,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(0, 0, pincerEnvLength() / 2 - pincerBlkLength() / 2), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << blkLog.name().name() << ":" << copyOne << " positioned in " << pincerEnvName().name(); +#endif DDSolid cutSolid( DDSolidFactory::box(pincerCutName(), pincerCutWidth() / 2., pincerCutHeight() / 2., pincerBlkLength() / 2)); @@ -3049,6 +3236,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation( +blkParms[0] - cutParms[0] - pincerShim1Width() + pincerShim2Width(), -blkParms[1] + cutParms[1], 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << cutLog.name().name() << ":" << copyOne << " positioned in " << pincerBlkName().name(); +#endif DDSolid shim2Solid(DDSolidFactory::box( pincerShim2Name(), pincerShim2Width() / 2., pincerShimHeight() / 2., pincerBlkLength() / 2)); @@ -3059,6 +3249,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << shim2Log.name().name() << ":" << copyOne << " positioned in " << pincerCutName().name(); +#endif DDSolid shim1Solid(DDSolidFactory::box(pincerShim1Name(), pincerShim1Width() / 2., @@ -3073,13 +3266,18 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { copyOne, DDTranslation(+envParms[0] - shim1Parms[0], -envParms[1] + shim1Parms[1], -envParms[2] + shim1Parms[2]), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << shim1Log.name().name() << ":" << copyOne << " positioned in " << pincerEnvName().name(); +#endif for (unsigned int iEnv(0); iEnv != vecPincerEnvZOff().size(); ++iEnv) { cpv.position(envLog, pincerRodName(), 1 + iEnv, DDTranslation(0, 0, -ilyLength / 2. + vecPincerEnvZOff()[iEnv] - pincerEnvLength() / 2.), DDRotation()); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << envLog.name().name() << ":" << (1 + iEnv) << " positioned in " << pincerRodName().name(); +#endif } // Place the rods @@ -3098,6 +3296,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { rodTra, myrot(pincerRodName().name() + std::to_string(iRod), CLHEP::HepRotationZ(90 * deg + vecPincerRodAzimuth()[iRod]))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << rodLog.name().name() << ":" << (1 + iRod) << " positioned in " << xilyName.name(); +#endif } } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -3108,7 +3309,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { } } - LogDebug("EcalGeom") << "******** DDEcalBarrelAlgo test: end it..."; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "******** DDEcalBarrelAlgo test: end it..."; +#endif } ///Create a DDRotation from a string converted to DDName and CLHEP::HepRotation converted to DDRotationMatrix. -- Michael Case @@ -3186,7 +3389,9 @@ void DDEcalBarrelNewAlgo::web(unsigned int iWeb, copyOne, DDTranslation(0, 0, 0), DDRotation()); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webPlLog.name().name() << ":" << copyOne << " positioned in " << webClrDDName.name(); +#endif const Trap::VertexList vWeb(trapWebClr.vertexList()); zee += trapWebClr.h() / sin(theta); @@ -3200,18 +3405,23 @@ void DDEcalBarrelNewAlgo::web(unsigned int iWeb, const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta))); const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0)); - LogDebug("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3]; - - LogDebug("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3]; + edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3; +#endif const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3); - if (0 != webHere()) + if (0 != webHere()) { cpv.position(webClrLog, logPar, copyOne, DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()), myrot(webClrLog.name().name() + std::to_string(iWeb), tForm.getRotation())); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webClrLog.name().name() << ":" << copyOne << " positioned in " << logPar.name().name(); +#endif + } } #include "DetectorDescription/Core/interface/DDAlgorithmFactory.h" diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index 4ac5cee6ffc08..cebd37039138a 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -1,6 +1,7 @@ #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/Printout.h" #include "DataFormats/Math/interface/CMSUnits.h" +#include "DetectorDescription/Core/interface/DDSplit.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" #include "DetectorDescription/DDCMS/interface/BenchmarkGrd.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -10,6 +11,8 @@ #include "CLHEP/Geometry/Vector3D.h" #include "CLHEP/Geometry/Transform3D.h" +//#define EDM_ML_DEBUG + using namespace std; using namespace cms; using namespace dd4hep; @@ -881,6 +884,9 @@ static long algorithm(dd4hep::Detector& /* description */, Rota(Vec3(bar.vecRota[0], bar.vecRota[1], bar.vecRota[2]), bar.vecRota[3])); Volume barVolume = Volume(bar.name, barSolid, ns.material(bar.mat)); parentVolume.placeVolume(barVolume, copyOne, Transform3D(rotation, tran)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << barVolume.name() << ":" << copyOne << " positioned in " << parentVolume.name(); +#endif // End Barrel parent volume---------------------------------------------------------- // Supermodule parent------------------------------------------------------------ @@ -942,10 +948,22 @@ static long algorithm(dd4hep::Detector& /* description */, Volume spmLog = Volume(spm.name, ((0 != spm.cutShow) ? ddspm : temp2), ns.material(spm.mat)); if (0 != spm.cutShow) { spmLog.placeVolume(spmCutLog, 1, alltrot1); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << spmCutLog.name() << ":1 positioned in " << DDSplit(spmLog.name()).first; +#endif spmLog.placeVolume(spmCutLog, 1, alltrot2); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << spmCutLog.name() << ":1 positioned in " << DDSplit(spmLog.name()).first; +#endif } spmLog.placeVolume(sideLog, 1, Transform3D(ns.rotation(ns.prepend(spm.sideName + std::to_string(1))), sideddtra1)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << sideLog.name() << ":1 positioned in " << DDSplit(spmLog.name()).first; +#endif spmLog.placeVolume(sideLog, 2, Transform3D(ns.rotation(ns.prepend(spm.sideName + std::to_string(2))), sideddtra2)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << sideLog.name() << ":2 positioned in " << DDSplit(spmLog.name()).first; +#endif const double dphi(360._deg / (1. * spm.nPerHalf)); for (unsigned int iphi(0); iphi < 2 * spm.nPerHalf; ++iphi) { @@ -976,6 +994,9 @@ static long algorithm(dd4hep::Detector& /* description */, // convert from CLHEP to Position & etc. Position myTran(both.getTranslation().x(), both.getTranslation().y(), both.getTranslation().z()); barVolume.placeVolume(spmLog, iphi + 1, Transform3D(rota, myTran)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << DDSplit(spmLog.name()).first << ":" << (iphi + 1) << " positioned in " << barVolume.name(); +#endif } } // End Supermodule parent------------------------------------------------------------ @@ -995,6 +1016,9 @@ static long algorithm(dd4hep::Detector& /* description */, ily.phiLow + ily.delPhi); // startPhi + deltaPhi Volume ilyLog = Volume(ily.name, ilySolid, ns.material(spm.mat)); spmLog.placeVolume(ilyLog, copyOne, Position(0, 0, 0.5 * ilyLength)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; +#endif Volume ilyPipeLog[200]; if (0 != ily.pipeHere) { for (unsigned int iPipeType(0); iPipeType != ily.vecIlyPipeLength.size(); ++iPipeType) { @@ -1017,6 +1041,9 @@ static long algorithm(dd4hep::Detector& /* description */, 360_deg); // startPhi + deltaPhi Volume ilyPipeWaLog = Volume(pWaName, ilyPipeWaSolid, ns.material(backPipe.waterMat)); ilyPipeLog[iPipeType].placeVolume(ilyPipeWaLog, copyOne); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyPipeWaLog.name() << ":" << copyOne << " positioned in " << ilyPipeLog[iPipeType].name(); +#endif } } @@ -1037,8 +1064,15 @@ static long algorithm(dd4hep::Detector& /* description */, ilyFanOutLog.placeVolume( ilyDiffLog, copyOne, Position(0_mm, 0_mm, -ily.fanOutLength / 2 + ily.diffLength / 2 + ily.diffOff)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyDiffLog.name() << ":" << copyOne << " positioned in " << ilyFanOutLog.name(); +#endif ilyFanOutLog.placeVolume( ilyBndlLog, copyOne, Position(0_mm, 0_mm, -ily.fanOutLength / 2 + ily.bndlLength / 2 + ily.bndlOff)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyBndlLog.name() << ":" << copyOne << " positioned in " << ilyFanOutLog.name(); +#endif + Volume xilyLog; for (unsigned int iily(0); iily != ily.vecIlyThick.size(); ++iily) { const double ilyRMax(ilyRMin + ily.vecIlyThick[iily]); @@ -1047,7 +1081,9 @@ static long algorithm(dd4hep::Detector& /* description */, xilyLog = ns.addVolume(Volume(xilyName, xilySolid, ns.material(ily.vecIlyMat[iily]))); if (0 != ily.here) { ilyLog.placeVolume(xilyLog, copyOne); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << xilyLog.name() << ":" << copyOne << " positioned in " << ilyLog.name(); +#endif unsigned int copyNum[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (10_mm < ily.vecIlyThick[iily] && ily.vecIlyThick.size() != (iily + 1) && 0 != ily.pipeHere) { @@ -1063,6 +1099,9 @@ static long algorithm(dd4hep::Detector& /* description */, ilyPTMLog, ptmCopy, Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLength / 2))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name(); +#endif } } if (0 != ily.fanOutHere) { @@ -1077,6 +1116,9 @@ static long algorithm(dd4hep::Detector& /* description */, fanOutCopy, Transform3D(RotationZ(phi) * RotationY(180_deg), Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLength / 2))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name(); +#endif } unsigned int femCopy(0); for (unsigned int ilyFEM(0); ilyFEM != ily.vecIlyFEMZ.size(); ++ilyFEM) { @@ -1089,6 +1131,9 @@ static long algorithm(dd4hep::Detector& /* description */, ilyFEMLog, femCopy, Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLength / 2))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name(); +#endif } } for (unsigned int iPipe(0); iPipe != ily.vecIlyPipePhi.size(); ++iPipe) { @@ -1103,12 +1148,18 @@ static long algorithm(dd4hep::Detector& /* description */, ++copyNum[type]; if (9 > type) { xilyLog.placeVolume(ilyPipeLog[type], copyNum[type], Position(xx, yy, zz)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name(); +#endif } else { xilyLog.placeVolume( ilyPipeLog[type], copyNum[type], Transform3D(Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90_deg)), Position(xx, yy, zz))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name(); +#endif } } } @@ -1131,7 +1182,9 @@ static long algorithm(dd4hep::Detector& /* description */, Solid clyrSolid = Polycone(clyrName, -9.5_deg, 19_deg, cri, cro, czz); Volume clyrLog = Volume(clyrName, clyrSolid, ns.material(ily.vecIlyMat[4])); spmLog.placeVolume(clyrLog, copyOne); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << clyrLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; +#endif // Begin Alveolar Wedge parent ------------------------------------------------------ //---------------- @@ -1259,6 +1312,9 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D( myrot(ns, alvWedge.hawRName + "R", hawRform.getRotation()), Position(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << hawRLog.name() << ":" << copyOne << " positioned in " << fawLog.name(); +#endif // FIXME: extrusion when using placeVolume, // use TGeoCombiTrans instead @@ -1268,19 +1324,25 @@ static long algorithm(dd4hep::Detector& /* description */, createPlacement( Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(-M_PI), // rotate about Y after refl thru Z Position(-hawRform.getTranslation().x(), -hawRform.getTranslation().y(), -hawRform.getTranslation().z()))); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << hawRLog.name() << ":" << copyTwo << " positioned in " << fawLog.name(); +#endif for (unsigned int iPhi(1); iPhi <= alvWedge.nFawPerSupm; ++iPhi) { const double rPhi(alvWedge.fawPhiOff + (iPhi - 0.5) * alvWedge.fawDelPhi); const Tf3D fawform(RoZ3D(rPhi) * Tl3D(alvWedge.fawRadOff + (trapFAW.H() + trapFAW.h()) / 4, 0, trapFAW.L() / 2) * RoZ3D(-90_deg + alvWedge.fawPhiRot)); - if (alvWedge.fawHere) + if (alvWedge.fawHere) { spmLog.placeVolume( fawLog, iPhi, Transform3D( myrot(ns, alvWedge.fawName + "_Rot" + std::to_string(iPhi), fawform.getRotation()), Position(fawform.getTranslation().x(), fawform.getTranslation().y(), fawform.getTranslation().z()))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << fawLog.name() << ":" << iPhi << " positioned in " << DDSplit(spmLog.name()).first; +#endif + } } // End Alveolar Wedge parent ------------------------------------------------------ @@ -1312,13 +1374,17 @@ static long algorithm(dd4hep::Detector& /* description */, vHAW[5], vHAW[6]); - if (0 != grid.here) + if (0 != grid.here) { hawRLog.placeVolume( gridLog, copyOne, Transform3D( myrot(ns, grid.name + "R", gridForm.getRotation()), Position(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << gridLog.name() << ":" << copyOne << " positioned in " << hawRLog.name(); +#endif + } // End Grid + Tablet insertion // begin filling Wedge with crystal plus supports -------------------------- @@ -1354,7 +1420,9 @@ static long algorithm(dd4hep::Detector& /* description */, for (unsigned int cryType(1); cryType <= alv.nCryTypes; ++cryType) { const string sType("_" + std::string(10 > cryType ? "0" : "") + std::to_string(cryType)); - LogDebug("EcalGeom") << "Crytype=" << cryType; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "Crytype=" << cryType; +#endif const double ANom(cry.vecNomCryDimAR[cryType - 1]); const double BNom(cry.vecNomCryDimCR[cryType - 1]); const double bNom(cry.vecNomCryDimCF[cryType - 1]); @@ -1488,18 +1556,38 @@ static long algorithm(dd4hep::Detector& /* description */, // Now for placement of cry within clr const Vec3 cryToClr(0, 0, (rClr - fClr) / 2); clrLog.placeVolume(cryLog, copyOne, Position(0_mm, 0_mm, (rClr - fClr) / 2)); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << cryLog.name() << ":" << copyOne << " positioned in " << clrLog.name(); +#endif if (0 != cap.here) { bsiLog.placeVolume(aglLog, copyAGL, Position(0_mm, 0_mm, -apd.aglThick / 2. + bSi.thick / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << aglLog.name() << ":" << copyAGL << " positioned in " << bsiLog.name(); +#endif bsiLog.placeVolume(andLog, copyAND, Position(0_mm, 0_mm, -apd.andThick / 2. - apd.aglThick + bSi.thick / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << andLog.name() << ":" << copyAND << " positioned in " << bsiLog.name(); +#endif bsiLog.placeVolume( apdLog, copyAPD, Position(0_mm, 0_mm, -apd.thick / 2. - apd.andThick - apd.aglThick + bSi.thick / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << apdLog.name() << ":" << copyAPD << " positioned in " << bsiLog.name(); +#endif bsiLog.placeVolume( atjLog, copyATJ, Position(0_mm, 0_mm, -apd.atjThick / 2. - apd.thick - apd.andThick - apd.aglThick + bSi.thick / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << atjLog.name() << ":" << copyATJ << " positioned in " << bsiLog.name(); +#endif cerLog.placeVolume(bsiLog, copyBSi, Position(0_mm, 0_mm, -bSi.thick / 2. + cer.thick / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << bsiLog.name() << ":" << copyBSi << " positioned in " << cerLog.name(); +#endif capLog.placeVolume(sglLog, copySGL, Position(0_mm, 0_mm, -apd.sglThick / 2. + cap.thick / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << sglLog.name() << ":" << copySGL << " positioned in " << capLog.name(); +#endif for (unsigned int ijkl(0); ijkl != 2; ++ijkl) { capLog.placeVolume(cerLog, @@ -1507,12 +1595,21 @@ static long algorithm(dd4hep::Detector& /* description */, Position(trapCry.bl1() - (0 == ijkl ? apd.x1 : apd.x2), trapCry.h1() - apd.z, -apd.sglThick - cer.thick / 2. + cap.thick / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << cerLog.name() << ":" << copyCER << " positioned in " << capLog.name(); +#endif } clrLog.placeVolume(capLog, copyCap, Position(0_mm, 0_mm, -trapCry.dz() - cap.thick / 2. + (rClr - fClr) / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << capLog.name() << ":" << copyCap << " positioned in " << clrLog.name(); +#endif } const Vec3 clrToWrap(0, 0, (rWrap - fWrap) / 2); wrapLog.placeVolume(clrLog, copyOne, Position(0_mm, 0_mm, (rWrap - fWrap) / 2)); //SAME as cryToWrap +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << clrLog.name() << ":" << copyOne << " positioned in " << wrapLog.name(); +#endif // Now for placement of clr within wall const Vec3 wrapToWall1(0_mm, 0_mm, (rWall - fWall) / 2); @@ -1521,6 +1618,9 @@ static long algorithm(dd4hep::Detector& /* description */, wrapLog, copyOne, Position(Vec3((cryType > 9 ? 0_mm : 0.005_mm), 0_mm, 0_mm) + wrapToWall1)); //SAME as wrapToWall +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << wrapLog.name() << ":" << copyOne << " positioned in " << wallLog.name(); +#endif const EcalTrap::VertexList vWall(trapWall.vertexList()); const EcalTrap::VertexList vCry(trapCry.vertexList()); @@ -1532,13 +1632,76 @@ static long algorithm(dd4hep::Detector& /* description */, if (1 == cryType) // first web plate: inside clearance volume { + const unsigned int iWeb(0); + const Pt3D corner(vHAW[4] + Pt3D(0, alvWedge.hawYOffCry, 0)); + const unsigned int copyOne(1); + const double LWebx(web.vecWebLength[iWeb]); + const double BWebx(trapWall.b() + (trapWall.B() - trapWall.b()) * LWebx / trapWall.L()); + + const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); + const EcalTrap trapWebClr(BWebx / 2, // A/2 + trapWall.b() / 2, // a/2 + trapWall.b() / 2, // b/2 + thick / 2, // H/2 + thick / 2, // h/2 + LWebx / 2, // L/2 + 90_deg, // alfa1 + trapWall.b() - BWebx, // x15 + 0 // y15 + ); + std::string webClrName(web.clrName + std::to_string(iWeb)); + Solid webClrSolid = mytrap(webClrName, trapWebClr); + Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); + + const EcalTrap trapWebPl(trapWebClr.A() / 2, // A/2 + trapWebClr.a() / 2, // a/2 + trapWebClr.b() / 2, // b/2 + web.vecWebPlTh[iWeb] / 2, // H/2 + web.vecWebPlTh[iWeb] / 2, // h/2 + trapWebClr.L() / 2., // L/2 + 90._deg, // alfa1 + trapWebClr.b() - trapWebClr.B(), // x15 + 0 // y15 + ); + std::string webPlName(web.plName + std::to_string(iWeb)); + Solid webPlSolid = mytrap(webPlName, trapWebPl); + Volume webPlLog = Volume(webPlName, webPlSolid, ns.material(web.plMat)); + + webClrLog.placeVolume(webPlLog, copyOne); // place plate inside clearance volume +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webPlLog.name() << ":" << copyOne << " positioned in " << webClrName; +#endif + const EcalTrap::VertexList vWeb(trapWebClr.vertexList()); + + zee += trapWebClr.h() / sin(theta); + + const double beta(theta + delta); + + const double zWeb(zee - frontPrime * cos(beta) + sidePrime * sin(beta)); + const double yWeb(frontPrime * sin(beta) + sidePrime * cos(beta)); + + const Pt3D wedge3(corner + Pt3D(0, -yWeb, zWeb)); + const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta))); + const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3]; + edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3; +#endif + const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3); + + if (0 != web.here) { + hawRLog.placeVolume(webClrLog, copyOne, Transform3D(myrot(ns, webClrName + std::to_string(iWeb), tForm.getRotation()), Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webClrLog.name() << ":" << copyOne << " positioned in " << hawRLog.name(); +#endif + } zee += alv.vecGapAlvEta[0]; } for (unsigned int etaAlv(1); etaAlv <= alv.nCryPerAlvEta; ++etaAlv) { - LogDebug("EcalGeom") << "theta=" << convertRadToDeg(theta) << ", sidePrime=" << sidePrime - << ", frontPrime=" << frontPrime << ", zeta=" << zeta << ", delta=" << delta - << ", zee=" << zee; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "theta=" << convertRadToDeg(theta) << ", sidePrime=" << sidePrime << ", frontPrime=" << frontPrime << ", zeta=" << zeta << ", delta=" << delta << ", zee=" << zee; +#endif zee += 0.075_mm + (side * cos(zeta) + trapWall.h() - sidePrime) / sin(theta); @@ -1563,12 +1726,80 @@ static long algorithm(dd4hep::Detector& /* description */, etaAlv, Transform3D(myrot(ns, wallDDName + "_" + std::to_string(etaAlv), tForm.getRotation()), Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << wallLog.name() << ":" << etaAlv << " positioned in " << hawRLog.name(); +#endif theta -= delta; side = sidePrime; zeta = delta; } if (5 == cryType || 9 == cryType || 13 == cryType || 17 == cryType) { // web plates zee += 0.5 * alv.vecGapAlvEta[cryType] / sin(theta); + + const unsigned int iWeb(cryType / 4); + const Pt3D corner(vHAW[4] + Pt3D(0, alvWedge.hawYOffCry, 0)); + const unsigned int copyOne(1); + const double LWebx(web.vecWebLength[iWeb]); + const double BWebx(trapWall.a() + (trapWall.A() - trapWall.a()) * LWebx / trapWall.L()); + + const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); + const EcalTrap trapWebClr(BWebx / 2, // A/2 + trapWall.a() / 2, // a/2 + trapWall.a() / 2, // b/2 + thick / 2, // H/2 + thick / 2, // h/2 + LWebx / 2, // L/2 + 90_deg, // alfa1 + trapWall.a() - BWebx, // x15 + 0 // y15 + ); + std::string webClrName(web.clrName + std::to_string(iWeb)); + Solid webClrSolid = mytrap(webClrName, trapWebClr); + Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); + + const EcalTrap trapWebPl(trapWebClr.A() / 2, // A/2 + trapWebClr.a() / 2, // a/2 + trapWebClr.b() / 2, // b/2 + web.vecWebPlTh[iWeb] / 2, // H/2 + web.vecWebPlTh[iWeb] / 2, // h/2 + trapWebClr.L() / 2., // L/2 + 90._deg, // alfa1 + trapWebClr.b() - trapWebClr.B(), // x15 + 0 // y15 + ); + std::string webPlName(web.plName + std::to_string(iWeb)); + Solid webPlSolid = mytrap(webPlName, trapWebPl); + Volume webPlLog = Volume(webPlName, webPlSolid, ns.material(web.plMat)); + + webClrLog.placeVolume(webPlLog, copyOne); // place plate inside clearance volume +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webPlLog.name() << ":" << copyOne << " positioned in " << webClrName; +#endif + const EcalTrap::VertexList vWeb(trapWebClr.vertexList()); + + zee += trapWebClr.h() / sin(theta); + + const double beta(theta + delta); + + const double zWeb(zee - frontPrime * cos(beta) + sidePrime * sin(beta)); + const double yWeb(frontPrime * sin(beta) + sidePrime * cos(beta)); + + const Pt3D wedge3(corner + Pt3D(0, -yWeb, zWeb)); + const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta))); + const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3]; + edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3; +#endif + const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3); + + if (0 != web.here) { + hawRLog.placeVolume(webClrLog, copyOne, Transform3D(myrot(ns, webClrName + std::to_string(iWeb), tForm.getRotation()), Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webClrLog.name() << ":" << copyOne << " positioned in " << hawRLog.name(); +#endif + } + zee += 0.5 * alv.vecGapAlvEta[cryType] / sin(theta); } else { if (17 != cryType) @@ -1610,10 +1841,16 @@ static long algorithm(dd4hep::Detector& /* description */, const Position backPlate2Tra(0_mm, -backPlateParms[1] + back.plate2Thick / 2., 0_mm); if (0 != back.plateHere) { backPlateLog.placeVolume(backPlate2Log, copyOne, Transform3D(backPlate2Tra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backPlate2Log.name() << ":" << copyOne << " positioned in " << backPlateLog.name(); +#endif spmLog.placeVolume( backPlateLog, copyOne, Transform3D(myrot(ns, back.plateName + "Rot5", CLHEP::HepRotationZ(270_deg)), outtra + backPlateTra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backPlateLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; +#endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1648,11 +1885,17 @@ static long algorithm(dd4hep::Detector& /* description */, copyOne, Transform3D(myrot(ns, back.sideName + "Rot8", CLHEP::HepRotationX(180_deg) * CLHEP::HepRotationZ(90_deg)), outtra + backSideTra1)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backSideLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; +#endif const Position backSideTra2(0_mm, -back.plateWidth / 2 + back.sideYOff2, 1_mm); spmLog.placeVolume( backSideLog, copyTwo, Transform3D(myrot(ns, back.sideName + "Rot9", CLHEP::HepRotationZ(90_deg)), outtra + backSideTra2)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backSideLog.name() << ":" << copyTwo << " positioned in " << DDSplit(spmLog.name()).first; +#endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1678,6 +1921,9 @@ static long algorithm(dd4hep::Detector& /* description */, Solid mBManifWaSolid = Tube(0, mbManif.innDiam / 2, backCoolWidth / 2. - manifCut, 0_deg, 360_deg); Volume mBManifWaLog(mBManifWaName, mBManifWaSolid, ns.material(backPipe.waterMat)); mBManifLog.placeVolume(mBManifWaLog, copyOne); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBManifWaLog.name() << ":" << copyOne << " positioned in " << mBManifLog.name(); +#endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1723,11 +1969,17 @@ static long algorithm(dd4hep::Detector& /* description */, ++midSlotCopy, Transform3D(Position( grille.vecHeight[iGr] / 2. - grille.vecMidSlotHeight[(iGr - 1) / 2] / 2., +grille.midSlotXOff, 0))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in " << grilleLog.name(); +#endif grilleLog.placeVolume( grMidSlotLog[(iGr - 1) / 2], ++midSlotCopy, Transform3D(Position( grille.vecHeight[iGr] / 2. - grille.vecMidSlotHeight[(iGr - 1) / 2] / 2., -grille.midSlotXOff, 0))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in " << grilleLog.name(); +#endif } if (0 != grille.edgeSlotHere && 0 != iGr) { @@ -1736,14 +1988,24 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D(Position(grille.vecHeight[iGr] / 2. - grille.edgeSlotHeight / 2., backCoolWidth / 2 - grille.edgeSlotWidth / 2., 0))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " << grilleLog.name(); +#endif grilleLog.placeVolume(grEdgeSlotLog, ++edgeSlotCopy, Transform3D(Position(grille.vecHeight[iGr] / 2. - grille.edgeSlotHeight / 2., -backCoolWidth / 2 + grille.edgeSlotWidth / 2., 0))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " << grilleLog.name(); +#endif } - if (0 != grille.here) + if (0 != grille.here) { spmLog.placeVolume(grilleLog, iGr, Transform3D(gTra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << grilleLog.name() << ":" << iGr << " positioned in " << DDSplit(spmLog.name()).first; +#endif + } if ((0 != iGr % 2) && (0 != mbManif.here)) { spmLog.placeVolume(mBManifLog, @@ -1752,12 +2014,18 @@ static long algorithm(dd4hep::Detector& /* description */, gTra - Position(-mbManif.outDiam / 2. + grille.vecHeight[iGr] / 2., manifCut, grille.thick / 2. + 3 * mbManif.outDiam / 2.))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBManifLog.name() << ":" << iGr << " positioned in " << DDSplit(spmLog.name()).first; +#endif spmLog.placeVolume(mBManifLog, iGr - 1, Transform3D(myrot(ns, mbManif.name + "R2", CLHEP::HepRotationX(90_deg)), gTra - Position(-3 * mbManif.outDiam / 2. + grille.vecHeight[iGr] / 2., manifCut, grille.thick / 2 + 3 * mbManif.outDiam / 2.))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBManifLog.name() << ":" << (iGr - 1) << " positioned in " << DDSplit(spmLog.name()).first; +#endif } } @@ -1780,11 +2048,17 @@ static long algorithm(dd4hep::Detector& /* description */, Volume backCoolBarSSLog = Volume(backCool.barSSName, backCoolBarSSSolid, ns.material(backCool.barSSMat)); const Position backCoolBarSSTra(0, 0, 0); backCoolBarLog.placeVolume(backCoolBarSSLog, copyOne, Transform3D(backCoolBarSSTra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolBarSSLog.name() << ":" << copyOne << " positioned in " << backCoolBarLog.name(); +#endif Solid backCoolBarWaSolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., backCool.barWaThick / 2.); Volume backCoolBarWaLog = Volume(backCool.barWaName, backCoolBarWaSolid, ns.material(backCool.barWaMat)); const Position backCoolBarWaTra(0, 0, 0); backCoolBarSSLog.placeVolume(backCoolBarWaLog, copyOne, Transform3D(backCoolBarWaTra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolBarWaLog.name() << ":" << copyOne << " positioned in " << backCoolBarSSLog.name(); +#endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1812,6 +2086,9 @@ static long algorithm(dd4hep::Detector& /* description */, Volume(backCool.vecBackVFELyrName[iLyr], backVFELyrSolid, ns.material(backCool.vecBackVFELyrMat[iLyr])); const Position backVFELyrTra(0, 0, backCool.vecBackVFELyrThick[iLyr] / 2); backVFELog.placeVolume(backVFELyrLog, copyOne, Transform3D(backVFELyrTra + offTra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backVFELyrLog.name() << ":" << copyOne << " positioned in " << DDSplit(backVFELog.name()).first; +#endif offTra += 2 * backVFELyrTra; } @@ -1830,15 +2107,26 @@ static long algorithm(dd4hep::Detector& /* description */, const double halfZCoolVFE(thickVFE + backCool.barThick / 2.); Solid backCoolVFESolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., halfZCoolVFE); Volume backCoolVFELog = Volume(backCool.backVFEName, backCoolVFESolid, ns.material(backCool.backVFEMat)); - if (0 != backCool.barHere) + if (0 != backCool.barHere) { backCoolVFELog.placeVolume(backCoolBarLog, copyOne, Transform3D()); - if (0 != backCool.vFEHere) +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolBarLog.name() << ":" << copyOne << " positioned in " << backCoolVFELog.name(); +#endif + } + if (0 != backCool.vFEHere) { backCoolVFELog.placeVolume( backVFELog, copyOne, Transform3D(Position(0, 0, backCool.barThick / 2. + thickVFE / 2.))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << DDSplit(backVFELog.name()).first << ":" << copyOne << " positioned in " << backCoolVFELog.name(); +#endif + } backCoolVFELog.placeVolume(backVFELog, copyTwo, Transform3D(myrot(ns, backCool.backVFEName + "Flip", CLHEP::HepRotationX(180_deg)), Position(0, 0, -backCool.barThick / 2. - thickVFE / 2.))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << DDSplit(backVFELog.name()).first << ":" << copyTwo << " positioned in " << backCoolVFELog.name(); +#endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1879,8 +2167,12 @@ static long algorithm(dd4hep::Detector& /* description */, -realBPthick / 2 + backCoolHeight / 2 - grille.vecHeight[2 * iMod], deltaY, grille.vecZOff[2 * iMod] + grille.thick + grille.zSpace + halfZBCool - back.sideLength / 2); - if (0 != backCool.here) + if (0 != backCool.here) { spmLog.placeVolume(backCoolLog, iMod + 1, outtra + backPlateTra + bCoolTra); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolLog.name() << ":" << (iMod + 1) << " positioned in " << DDSplit(spmLog.name()).first; +#endif + } //=== const double backCoolTankHeight(backCool.barHeight); // - backBracketHeight() ) ; @@ -1889,13 +2181,17 @@ static long algorithm(dd4hep::Detector& /* description */, string bTankName(backCoolTank.name + std::to_string(iMod + 1)); Solid backCoolTankSolid = Box(backCoolTankHeight / 2., backCoolTank.width / 2., halfZTank); Volume backCoolTankLog = Volume(bTankName, backCoolTankSolid, ns.material(backCoolTank.mat)); - if (0 != backCoolTank.here) + if (0 != backCoolTank.here) { backCoolLog.placeVolume(backCoolTankLog, copyOne, Transform3D(Rotation3D(), Position(-backCoolHeight / 2 + backCoolTankHeight / 2. + bottomThick, backCool.barWidth / 2. + backCoolTank.width / 2., 0))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolTankLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); +#endif + } string bTankWaName(backCoolTank.waName + std::to_string(iMod + 1)); Solid backCoolTankWaSolid = Box(backCoolTankHeight / 2. - backCoolTank.thick / 2., @@ -1903,11 +2199,14 @@ static long algorithm(dd4hep::Detector& /* description */, halfZTank - backCoolTank.thick / 2.); Volume backCoolTankWaLog = Volume(bTankWaName, backCoolTankWaSolid, ns.material(backCoolTank.waMat)); backCoolTankLog.placeVolume(backCoolTankWaLog, copyOne, Transform3D(Rotation3D(), Position(0, 0, 0))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolTankWaLog.name() << ":" << copyOne << " positioned in " << backCoolTankLog.name(); +#endif string bBracketName(backCoolTank.backBracketName + std::to_string(iMod + 1)); Solid backBracketSolid = Box(backCoolTank.backBracketHeight / 2., backCoolTank.width / 2., halfZTank); Volume backBracketLog = Volume(bBracketName, backBracketSolid, ns.material(backCoolTank.backBracketMat)); - if (0 != backCoolTank.here) + if (0 != backCoolTank.here) { backCoolLog.placeVolume(backBracketLog, copyOne, Transform3D(Rotation3D(), @@ -1915,6 +2214,10 @@ static long algorithm(dd4hep::Detector& /* description */, backCoolTank.backBracketHeight / 2. + bottomThick, -backCool.barWidth / 2. - backCoolTank.width / 2., 0))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backBracketLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); +#endif + } //=== Position bSumTra(backCool.barHeight - backCoolHeight / 2. + bottomThick, 0, 0); @@ -1927,8 +2230,12 @@ static long algorithm(dd4hep::Detector& /* description */, const Position bTra(backMisc.vecThick[iMod * nMisc + j] / 2, 0_mm, 0_mm); - if (0 != backMisc.here) + if (0 != backMisc.here) { backCoolLog.placeVolume(bLog, copyOne, Transform3D(Rotation3D(), bSumTra + bTra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << bLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); +#endif + } bSumTra += 2 * bTra; } @@ -1945,6 +2252,9 @@ static long algorithm(dd4hep::Detector& /* description */, mTra += Position(mbLyr.vecMBLyrThick[j] / 2.0, 0_mm, 0_mm); backCoolLog.placeVolume(mLog, copyOne, Transform3D(Rotation3D(), mTra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); +#endif mTra += Position(mbLyr.vecMBLyrThick[j] / 2.0, 0_mm, 0_mm); } } @@ -1959,6 +2269,9 @@ static long algorithm(dd4hep::Detector& /* description */, Solid mBCoolTubeWaSolid = Tube(mBWaName, 0, mbCoolTube.innDiam / 2, halfZBCool, 0_deg, 360_deg); Volume mBWaLog = Volume(mBWaName, mBCoolTubeWaSolid, ns.material(backPipe.waterMat)); mBLog.placeVolume(mBWaLog, copyOne); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBWaLog.name() << ":" << copyOne << " positioned in " << mBLog.name(); +#endif for (unsigned int j(0); j != dryAirTube.mbCoolTubeNum; ++j) // loop over all MB cooling circuits { @@ -1968,6 +2281,9 @@ static long algorithm(dd4hep::Detector& /* description */, Position(-backCoolHeight / 2.0 + mbCoolTube.outDiam / 2., -bHalfWidth + (j + 1) * bHalfWidth / 5, 0))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << mBLog.name() << ":" << (2 * j + 1) << " positioned in " << backCoolLog.name(); +#endif } } @@ -1992,12 +2308,21 @@ static long algorithm(dd4hep::Detector& /* description */, pipeZPos); spmLog.placeVolume(backPipeLog, copyOne, Transform3D(Rotation3D(), bPipeTra1)); - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backPipeLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; +#endif const Position bPipeTra2( bPipeTra1.x(), back.yOff - back.plateWidth / 2 + back.sideWidth + backPipe.vecDiam[iMod], bPipeTra1.z()); spmLog.placeVolume(backPipeLog, copyTwo, Transform3D(Rotation3D(), bPipeTra2)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backPipeLog.name() << ":" << copyTwo << " positioned in " << DDSplit(spmLog.name()).first; +#endif + backPipeLog.placeVolume(backInnerLog, copyOne, Transform3D(Rotation3D(), Position())); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backInnerLog.name() << ":" << copyOne << " positioned in " << backPipeLog.name(); +#endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2019,12 +2344,18 @@ static long algorithm(dd4hep::Detector& /* description */, pipeZPos); spmLog.placeVolume(dryAirTubeLog, copyOne, Transform3D(Rotation3D(), dryAirTubeTra1)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; +#endif const Position dryAirTubeTra2(dryAirTubeTra1.x(), back.yOff - back.plateWidth / 2 + back.sideWidth + 0.7 * dryAirTube.outDiam, dryAirTubeTra1.z()); spmLog.placeVolume(dryAirTubeLog, copyTwo, Transform3D(Rotation3D(), dryAirTubeTra2)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name() << ":" << copyTwo << " positioned in " << DDSplit(spmLog.name()).first; +#endif } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -2040,6 +2371,9 @@ static long algorithm(dd4hep::Detector& /* description */, const unsigned int nMax(static_cast<unsigned int>(backCool.vecBackCoolNPerSec[iNSec++])); for (unsigned int iBar(0); iBar != nMax; ++iBar) { backCoolLog.placeVolume(backCoolVFELog, iCVFECopy++, cTra); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << backCoolVFELog.name() << ":" << iCVFECopy << " positioned in " << backCoolLog.name(); +#endif cTra += Position(0, 0, backMisc.backCBStdSep); } cTra -= Position(0, 0, backMisc.backCBStdSep); // backspace to previous @@ -2076,8 +2410,12 @@ static long algorithm(dd4hep::Detector& /* description */, Volume patchLog = Volume(patchPanel.name, patchSolid, ns.material(spm.mat)); const Position patchTra(back.xOff + 4_mm, 0_mm, grille.vecZOff.back() + grille.thick + patchParms[2]); - if (0 != patchPanel.here) + if (0 != patchPanel.here) { spmLog.placeVolume(patchLog, copyOne, patchTra); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << patchLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; +#endif + } Position pTra(-patchParms[0], 0, 0); @@ -2089,6 +2427,9 @@ static long algorithm(dd4hep::Detector& /* description */, pTra += Position(patchPanel.vecThick[j] / 2, 0_mm, 0_mm); patchLog.placeVolume(pLog, copyOne, pTra); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << pLog.name() << ":" << copyOne << " positioned in " << patchLog.name(); +#endif pTra += Position(patchPanel.vecThick[j] / 2, 0_mm, 0_mm); } @@ -2119,6 +2460,9 @@ static long algorithm(dd4hep::Detector& /* description */, Volume blkLog = Volume(pincer.blkName, blkSolid, ns.material(pincer.blkMat)); envLog.placeVolume(blkLog, copyOne, Position(0_mm, 0_mm, pincer.envLength / 2 - pincer.blkLength / 2)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << blkLog.name() << ":" << copyOne << " positioned in " << envLog.name(); +#endif array<double, 3> cutParms{{pincer.cutWidth / 2., pincer.cutHeight / 2., pincer.blkLength / 2}}; Solid cutSolid = Box(pincer.cutName, cutParms[0], cutParms[1], cutParms[2]); @@ -2128,11 +2472,17 @@ static long algorithm(dd4hep::Detector& /* description */, copyOne, Position( +blkParms[0] - cutParms[0] - pincer.shim1Width + pincer.shim2Width, -blkParms[1] + cutParms[1], 0_mm)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << cutLog.name() << ":" << copyOne << " positioned in " << blkLog.name(); +#endif array<double, 3> shim2Parms{{pincer.shim2Width / 2., pincer.shimHeight / 2., pincer.blkLength / 2}}; Solid shim2Solid = Box(pincer.shim2Name, shim2Parms[0], shim2Parms[1], shim2Parms[2]); Volume shim2Log = Volume(pincer.shim2Name, shim2Solid, ns.material(pincer.shimMat)); cutLog.placeVolume( shim2Log, copyOne, Position(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0_mm)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << shim2Log.name() << ":" << copyOne << " positioned in " << cutLog.name(); +#endif array<double, 3> shim1Parms{ {pincer.shim1Width / 2., pincer.shimHeight / 2., (pincer.envLength - pincer.blkLength) / 2}}; @@ -2142,11 +2492,17 @@ static long algorithm(dd4hep::Detector& /* description */, shim1Log, copyOne, Position(+envParms[0] - shim1Parms[0], -envParms[1] + shim1Parms[1], -envParms[2] + shim1Parms[2])); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << shim1Log.name() << ":" << copyOne << " positioned in " << envLog.name(); +#endif for (unsigned int iEnv(0); iEnv != pincer.vecEnvZOff.size(); ++iEnv) { rodLog.placeVolume(envLog, 1 + iEnv, Position(0_mm, 0_mm, -ilyLength / 2. + pincer.vecEnvZOff[iEnv] - pincer.envLength / 2.)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << envLog.name() << ":" << (1 + iEnv) << " positioned in " << rodLog.name(); +#endif } // Place the rods @@ -2162,6 +2518,9 @@ static long algorithm(dd4hep::Detector& /* description */, pincer.rodName + std::to_string(iRod), CLHEP::HepRotationZ(90_deg + pincer.vecRodAzimuth[iRod])), rodTra)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << rodLog.name() << ":" << (1 + iRod) << " positioned in " << xilyLog.name(); +#endif } } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/Geometry/EcalCommonData/test/python/runEcalSimParameterDD4Hep_cfg.py b/Geometry/EcalCommonData/test/python/runEcalSimParameterDD4Hep_cfg.py index 347810c952218..cf445b0341409 100644 --- a/Geometry/EcalCommonData/test/python/runEcalSimParameterDD4Hep_cfg.py +++ b/Geometry/EcalCommonData/test/python/runEcalSimParameterDD4Hep_cfg.py @@ -7,8 +7,8 @@ process.MessageLogger.cerr.FwkReport.reportEvery = 5 if hasattr(process,'MessageLogger'): - process.MessageLogger.categories.append('ECalGeom') - process.MessageLogger.categories.append('ECalSim') + process.MessageLogger.categories.append('EcalGeom') + process.MessageLogger.categories.append('EcalSim') process.MessageLogger.categories.append('Geometry') process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer", From 938df26df372fbe1bbfb808bba9b320083c62882 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Fri, 9 Oct 2020 21:46:19 +0200 Subject: [PATCH 471/778] Code check --- .../plugins/DDEcalBarrelNewAlgo.cc | 212 ++++++--- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 429 ++++++++++-------- 2 files changed, 378 insertions(+), 263 deletions(-) diff --git a/Geometry/EcalCommonData/plugins/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/DDEcalBarrelNewAlgo.cc index 4b03539329a93..e115e428e553b 100644 --- a/Geometry/EcalCommonData/plugins/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/DDEcalBarrelNewAlgo.cc @@ -1625,7 +1625,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { { cpv.position(spmCutLog, spmName(), icopy, ddtra, ddrot); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << spmCutLog.name().name() << ":" << icopy << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << spmCutLog.name().name() << ":" << icopy << " positioned in " + << spmName().name(); #endif } else // do this if we are subtracting the boxes { @@ -1670,7 +1671,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation myTran(both.getTranslation().x(), both.getTranslation().y(), both.getTranslation().z()); cpv.position(spmLog, barName(), iphi + 1, myTran, rota); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << spmLog.name().name() << ":" << (iphi + 1) << " positioned in " << barName().name(); + edm::LogVerbatim("EcalGeom") << spmLog.name().name() << ":" << (iphi + 1) << " positioned in " + << barName().name(); #endif } } @@ -1708,7 +1710,7 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { cpv.position(ilyPipeWaLog, pName, copyOne, DDTranslation(0, 0, 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << pWaName.name() << ":" << copyOne << " positioned in " << pName.name(); + edm::LogVerbatim("EcalGeom") << pWaName.name() << ":" << copyOne << " positioned in " << pName.name(); #endif } } @@ -1738,7 +1740,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyDiffLength() / 2 + ilyDiffOff()), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyDiffName().name() << ":" << copyOne << " positioned in " << ilyFanOutName().name(); + edm::LogVerbatim("EcalGeom") << ilyDiffName().name() << ":" << copyOne << " positioned in " + << ilyFanOutName().name(); #endif cpv.position(ilyBndlLog, ilyFanOutName(), @@ -1746,7 +1749,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyBndlLength() / 2 + ilyBndlOff()), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyBndlName().name() << ":" << copyOne << " positioned in " << ilyFanOutName().name(); + edm::LogVerbatim("EcalGeom") << ilyBndlName().name() << ":" << copyOne << " positioned in " + << ilyFanOutName().name(); #endif for (unsigned int ily(0); ily != vecIlyThick().size(); ++ily) { const double ilyRMax(ilyRMin + vecIlyThick()[ily]); @@ -1759,7 +1763,7 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { if (0 != ilyHere()) { cpv.position(xilyLog, ilyLog, copyOne, DDTranslation(0, 0, 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << xilyName.name() << ":" << copyOne << " positioned in " << ilyName(); + edm::LogVerbatim("EcalGeom") << xilyName.name() << ":" << copyOne << " positioned in " << ilyName(); #endif unsigned int copyNum[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -1778,7 +1782,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(xx, yy, vecIlyPTMZ()[ilyPTM] - ilyLength / 2), myrot(ilyPTMLog.name().name() + "_rot" + std::to_string(ptmCopy), CLHEP::HepRotationZ(phi))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyPTMLog.name().name() << ":" << ptmCopy << " positioned in " << xilyLog.name().name(); + edm::LogVerbatim("EcalGeom") + << ilyPTMLog.name().name() << ":" << ptmCopy << " positioned in " << xilyLog.name().name(); #endif } } @@ -1797,7 +1802,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { myrot(ilyFanOutLog.name().name() + "_rot" + std::to_string(fanOutCopy), CLHEP::HepRotationZ(phi) * CLHEP::HepRotationY(180 * deg))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyFanOutLog.name().name() << ":" << fanOutCopy << " positioned in " << xilyLog.name().name(); + edm::LogVerbatim("EcalGeom") + << ilyFanOutLog.name().name() << ":" << fanOutCopy << " positioned in " << xilyLog.name().name(); #endif } unsigned int femCopy(0); @@ -1813,7 +1819,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(xx, yy, vecIlyFEMZ()[ilyFEM] - ilyLength / 2), myrot(ilyFEMLog.name().name() + "_rot" + std::to_string(femCopy), CLHEP::HepRotationZ(phi))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyFEMLog.name().name() << ":" << femCopy << " positioned in " << xilyLog.name().name(); + edm::LogVerbatim("EcalGeom") + << ilyFEMLog.name().name() << ":" << femCopy << " positioned in " << xilyLog.name().name(); #endif } } @@ -1837,7 +1844,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { : myrot(ilyPipeLog[type].name().name() + "_rot" + std::to_string(copyNum[type]), Rota(Vec3(xx, yy, 0), 90 * deg)))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyPipeLog[type].name().name() << ":" << copyNum[type] << " positioned in " << xilyLog.name().name(); + edm::LogVerbatim("EcalGeom") << ilyPipeLog[type].name().name() << ":" << copyNum[type] + << " positioned in " << xilyLog.name().name(); #endif } } @@ -1861,7 +1869,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDLogicalPart clyrLog(clyrName, ddmat(vecIlyMat()[4]), clyrSolid); cpv.position(clyrLog, spmLog, copyOne, DDTranslation(0, 0, 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << clyrLog.name().name() << ":" << copyOne << " positioned in " << spmLog.name().name(); + edm::LogVerbatim("EcalGeom") << clyrLog.name().name() << ":" << copyOne << " positioned in " + << spmLog.name().name(); #endif // Begin Alveolar Wedge parent ------------------------------------------------------ //---------------- @@ -2003,7 +2012,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()), myrot(hawRName().name() + "R", hawRform.getRotation())); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << hawRLog.name().name() << ":" << copyOne << " positioned in " << fawLog.name().name(); + edm::LogVerbatim("EcalGeom") << hawRLog.name().name() << ":" << copyOne << " positioned in " + << fawLog.name().name(); #endif cpv.position( hawRLog, @@ -2014,7 +2024,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { CLHEP::HepRotationY(180 * deg) * // rotate about Y after refl thru Z CLHEP::HepRep3x3(1, 0, 0, 0, 1, 0, 0, 0, -1))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << hawRLog.name().name() << ":" << copyTwo << " positioned in " << fawLog.name().name(); + edm::LogVerbatim("EcalGeom") << hawRLog.name().name() << ":" << copyTwo << " positioned in " + << fawLog.name().name(); #endif /* this for display of haw cut box instead of subtraction cpv.position( hawCutLog, @@ -2079,7 +2090,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()), myrot(gridName().name() + "R", gridForm.getRotation())); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << gridLog.name().name() << ":" << copyOne << " positioned in " << hawRLog.name().name(); + edm::LogVerbatim("EcalGeom") << gridLog.name().name() << ":" << copyOne << " positioned in " + << hawRLog.name().name(); #endif // End Grid + Tablet insertion @@ -2329,18 +2341,21 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, (rClr - fClr) / 2), //SAME as cryToClr above. DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << cryLog.name().name() << ":" << copyOne << " positioned in " << clrLog.name().name(); + edm::LogVerbatim("EcalGeom") << cryLog.name().name() << ":" << copyOne << " positioned in " + << clrLog.name().name(); #endif if (0 != capHere()) { cpv.position(aglLog, bsiLog, copyAGL, DDTranslation(0, 0, -aglThick() / 2. + bsiThick() / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << aglLog.name().name() << ":" << copyAGL << " positioned in " << bsiLog.name().name(); + edm::LogVerbatim("EcalGeom") << aglLog.name().name() << ":" << copyAGL << " positioned in " + << bsiLog.name().name(); #endif cpv.position( andLog, bsiLog, copyAND, DDTranslation(0, 0, -andThick() / 2. - aglThick() + bsiThick() / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << andLog.name().name() << ":" << copyAND << " positioned in " << bsiLog.name().name(); + edm::LogVerbatim("EcalGeom") << andLog.name().name() << ":" << copyAND << " positioned in " + << bsiLog.name().name(); #endif cpv.position(apdLog, bsiLog, @@ -2348,7 +2363,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, -apdThick() / 2. - andThick() - aglThick() + bsiThick() / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << apdLog.name().name() << ":" << copyAPD << " positioned in " << bsiLog.name().name(); + edm::LogVerbatim("EcalGeom") << apdLog.name().name() << ":" << copyAPD << " positioned in " + << bsiLog.name().name(); #endif cpv.position(atjLog, bsiLog, @@ -2356,15 +2372,18 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, -atjThick() / 2. - apdThick() - andThick() - aglThick() + bsiThick() / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << atjLog.name().name() << ":" << copyATJ << " positioned in " << bsiLog.name().name(); + edm::LogVerbatim("EcalGeom") << atjLog.name().name() << ":" << copyATJ << " positioned in " + << bsiLog.name().name(); #endif cpv.position(bsiLog, cerLog, copyBSi, DDTranslation(0, 0, -bsiThick() / 2. + cerThick() / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << bsiLog.name().name() << ":" << copyBSi << " positioned in " << cerLog.name().name(); + edm::LogVerbatim("EcalGeom") << bsiLog.name().name() << ":" << copyBSi << " positioned in " + << cerLog.name().name(); #endif cpv.position(sglLog, capLog, copySGL, DDTranslation(0, 0, -sglThick() / 2. + capThick() / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << sglLog.name().name() << ":" << copySGL << " positioned in " << capLog.name().name(); + edm::LogVerbatim("EcalGeom") << sglLog.name().name() << ":" << copySGL << " positioned in " + << capLog.name().name(); #endif for (unsigned int ijkl(0); ijkl != 2; ++ijkl) { cpv.position(cerLog, @@ -2375,7 +2394,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { -sglThick() - cerThick() / 2. + capThick() / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << cerLog.name().name() << ":" << copyCER << " positioned in " << capLog.name().name(); + edm::LogVerbatim("EcalGeom") << cerLog.name().name() << ":" << copyCER << " positioned in " + << capLog.name().name(); #endif } cpv.position(capLog, @@ -2384,7 +2404,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, -trapCry.dz() - capThick() / 2. + (rClr - fClr) / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << capLog.name().name() << ":" << copyCap << " positioned in " << clrLog.name().name(); + edm::LogVerbatim("EcalGeom") << capLog.name().name() << ":" << copyCap << " positioned in " + << clrLog.name().name(); #endif } @@ -2396,7 +2417,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, (rWrap - fWrap) / 2), //SAME as cryToWrap DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << clrLog.name().name() << ":" << copyOne << " positioned in " << wrapLog.name().name(); + edm::LogVerbatim("EcalGeom") << clrLog.name().name() << ":" << copyOne << " positioned in " + << wrapLog.name().name(); #endif // Now for placement of clr within wall @@ -2409,7 +2431,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(Vec3((cryType > 9 ? 0 : 0.005 * mm), 0, 0) + wrapToWall1), //SAME as wrapToWall DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << wrapLog.name().name() << ":" << copyOne << " positioned in " << wallLog.name().name(); + edm::LogVerbatim("EcalGeom") << wrapLog.name().name() << ":" << copyOne << " positioned in " + << wallLog.name().name(); #endif const Trap::VertexList vWall(trapWall.vertexList()); const Trap::VertexList vCry(trapCry.vertexList()); @@ -2438,7 +2461,9 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { for (unsigned int etaAlv(1); etaAlv <= nCryPerAlvEta(); ++etaAlv) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "theta=" << theta / deg << ", sidePrime=" << sidePrime << ", frontPrime=" << frontPrime << ", zeta=" << zeta << ", delta=" << delta << ", zee=" << zee; + edm::LogVerbatim("EcalGeom") << "theta=" << theta / deg << ", sidePrime=" << sidePrime + << ", frontPrime=" << frontPrime << ", zeta=" << zeta << ", delta=" << delta + << ", zee=" << zee; #endif zee += 0.075 * mm + (side * cos(zeta) + trapWall.h() - sidePrime) / sin(theta); @@ -2468,7 +2493,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()), myrot(wallLog.name().name() + "_" + std::to_string(etaAlv), tForm.getRotation())); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << wallLog.name().name() << ":" << etaAlv << " positioned in " << hawRLog.name().name(); + edm::LogVerbatim("EcalGeom") << wallLog.name().name() << ":" << etaAlv << " positioned in " + << hawRLog.name().name(); #endif theta -= delta; side = sidePrime; @@ -2536,7 +2562,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { if (0 != backPlateHere()) { cpv.position(backPlate2Log, backPlateName(), copyOne, backPlate2Tra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backPlate2Log.name().name() << ":" << copyOne << " positioned in " << backPlateName().name(); + edm::LogVerbatim("EcalGeom") << backPlate2Log.name().name() << ":" << copyOne << " positioned in " + << backPlateName().name(); #endif cpv.position(backPlateLog, spmName(), @@ -2544,7 +2571,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { outtra + backPlateTra, myrot(backPlateName().name() + "Rot5", CLHEP::HepRotationZ(270 * deg))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backPlateLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << backPlateLog.name().name() << ":" << copyOne << " positioned in " + << spmName().name(); #endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2582,7 +2610,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { outtra + backSideTra1, myrot(backSideName().name() + "Rot8", CLHEP::HepRotationX(180 * deg) * CLHEP::HepRotationZ(90 * deg))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backSideLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << backSideLog.name().name() << ":" << copyOne << " positioned in " + << spmName().name(); #endif const DDTranslation backSideTra2(0 * mm, -backPlateWidth() / 2 + backSideYOff2(), 1 * mm); cpv.position(backSideLog, @@ -2591,7 +2620,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { outtra + backSideTra2, myrot(backSideName().name() + "Rot9", CLHEP::HepRotationZ(90 * deg))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backSideLog.name().name() << ":" << copyTwo << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << backSideLog.name().name() << ":" << copyTwo << " positioned in " + << spmName().name(); #endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2621,7 +2651,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDLogicalPart mBManifWaLog(mBManifWaName, backPipeWaterMat(), mBManifWaSolid); cpv.position(mBManifWaLog, mBManifName(), copyOne, DDTranslation(0, 0, 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBManifWaLog.name().name() << ":" << copyOne << " positioned in " << mBManifName().name(); + edm::LogVerbatim("EcalGeom") << mBManifWaLog.name().name() << ":" << copyOne << " positioned in " + << mBManifName().name(); #endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2671,7 +2702,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., +grMidSlotXOff(), 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name().name() << ":" << midSlotCopy << " positioned in " << gName.name(); + edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name().name() << ":" << midSlotCopy + << " positioned in " << gName.name(); #endif cpv.position(grMidSlotLog[(iGr - 1) / 2], @@ -2681,7 +2713,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., -grMidSlotXOff(), 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name().name() << ":" << midSlotCopy << " positioned in " << gName.name(); + edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name().name() << ":" << midSlotCopy + << " positioned in " << gName.name(); #endif } @@ -2694,7 +2727,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2., backCoolWidth / 2 - grEdgeSlotWidth() / 2., 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name().name() << ":" << edgeSlotCopy << " positioned in " << gName.name(); + edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name().name() << ":" << edgeSlotCopy << " positioned in " + << gName.name(); #endif cpv.position(grEdgeSlotLog, gName, @@ -2704,15 +2738,17 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name().name() << ":" << edgeSlotCopy << " positioned in " << gName.name(); + edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name().name() << ":" << edgeSlotCopy << " positioned in " + << gName.name(); #endif } if (0 != grilleHere()) { cpv.position(grilleLog, spmName(), iGr, gTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grilleLog.name().name() << ":" << iGr << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << grilleLog.name().name() << ":" << iGr << " positioned in " + << spmName().name(); #endif - } + } if ((0 != iGr % 2) && (0 != mBManifHere())) { cpv.position(mBManifLog, spmName(), @@ -2722,7 +2758,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { grilleThick() / 2. + 3 * mBManifOutDiam() / 2.), myrot(mBManifName().name() + "R1", CLHEP::HepRotationX(90 * deg))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBManifLog.name().name() << ":" << iGr << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << mBManifLog.name().name() << ":" << iGr << " positioned in " + << spmName().name(); #endif cpv.position(mBManifLog, spmName(), @@ -2732,7 +2769,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { grilleThick() / 2 + 3 * mBManifOutDiam() / 2.), myrot(mBManifName().name() + "R2", CLHEP::HepRotationX(90 * deg))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBManifLog.name().name() << ":" << (iGr - 1) << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << mBManifLog.name().name() << ":" << (iGr - 1) << " positioned in " + << spmName().name(); #endif } } @@ -2759,7 +2797,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDTranslation backCoolBarSSTra(0, 0, 0); cpv.position(backCoolBarSSLog, backCoolBarName(), copyOne, backCoolBarSSTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolBarSSLog.name().name() << ":" << copyOne << " positioned in " << backCoolBarName().name(); + edm::LogVerbatim("EcalGeom") << backCoolBarSSLog.name().name() << ":" << copyOne << " positioned in " + << backCoolBarName().name(); #endif DDSolid backCoolBarWaSolid(DDSolidFactory::box( @@ -2768,7 +2807,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDTranslation backCoolBarWaTra(0, 0, 0); cpv.position(backCoolBarWaLog, backCoolBarSSName(), copyOne, backCoolBarWaTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolBarWaLog.name().name() << ":" << copyOne << " positioned in " << backCoolBarSSName().name(); + edm::LogVerbatim("EcalGeom") << backCoolBarWaLog.name().name() << ":" << copyOne << " positioned in " + << backCoolBarSSName().name(); #endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2801,7 +2841,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDTranslation backVFELyrTra(0, 0, vecBackVFELyrThick()[iLyr] / 2); cpv.position(backVFELyrLog, backVFEName(), copyOne, backVFELyrTra + offTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backVFELyrLog.name().name() << ":" << copyOne << " positioned in " << backVFEName().name(); + edm::LogVerbatim("EcalGeom") << backVFELyrLog.name().name() << ":" << copyOne << " positioned in " + << backVFEName().name(); #endif offTra += 2 * backVFELyrTra; } @@ -2825,7 +2866,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { if (0 != backCoolBarHere()) { cpv.position(backCoolBarLog, backCoolVFEName(), copyOne, DDTranslation(), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolBarLog.name().name() << ":" << copyOne << " positioned in " << backCoolVFEName().name(); + edm::LogVerbatim("EcalGeom") << backCoolBarLog.name().name() << ":" << copyOne << " positioned in " + << backCoolVFEName().name(); #endif } if (0 != backCoolVFEHere()) { @@ -2835,7 +2877,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, backCoolBarThick() / 2. + thickVFE / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backVFELog.name().name() << ":" << copyOne << " positioned in " << backCoolVFEName().name(); + edm::LogVerbatim("EcalGeom") << backVFELog.name().name() << ":" << copyOne << " positioned in " + << backCoolVFEName().name(); #endif } cpv.position(backVFELog, @@ -2844,7 +2887,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, -backCoolBarThick() / 2. - thickVFE / 2.), myrot(backVFEName().name() + "Flip", CLHEP::HepRotationX(180 * deg))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backVFELog.name().name() << ":" << copyTwo << " positioned in " << backCoolVFEName().name(); + edm::LogVerbatim("EcalGeom") << backVFELog.name().name() << ":" << copyTwo << " positioned in " + << backCoolVFEName().name(); #endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2890,9 +2934,10 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { if (0 != backCoolHere()) { cpv.position(backCoolLog, spmName(), iMod + 1, outtra + backPlateTra + bCoolTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolLog.name().name() << ":" << (iMod + 1) << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << backCoolLog.name().name() << ":" << (iMod + 1) << " positioned in " + << spmName().name(); #endif - } + } //=== const double backCoolTankHeight(backCoolBarHeight()); // - backBracketHeight() ) ; @@ -2911,9 +2956,10 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolTankLog.name().name() << ":" << copyOne << " positioned in " << backCName.name(); + edm::LogVerbatim("EcalGeom") << backCoolTankLog.name().name() << ":" << copyOne << " positioned in " + << backCName.name(); #endif - } + } DDName bTankWaName(ddname(backCoolTankWaName() + std::to_string(iMod + 1))); DDSolid backCoolTankWaSolid(DDSolidFactory::box(bTankWaName, @@ -2923,7 +2969,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDLogicalPart backCoolTankWaLog(bTankWaName, backCoolTankWaMat(), backCoolTankWaSolid); cpv.position(backCoolTankWaLog, bTankName, copyOne, DDTranslation(0, 0, 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolTankWaLog.name().name() << ":" << copyOne << " positioned in " << bTankName.name(); + edm::LogVerbatim("EcalGeom") << backCoolTankWaLog.name().name() << ":" << copyOne << " positioned in " + << bTankName.name(); #endif DDName bBracketName(ddname(backBracketName() + std::to_string(iMod + 1))); @@ -2939,9 +2986,10 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backBracketLog.name().name() << ":" << copyOne << " positioned in " << backCName.name(); + edm::LogVerbatim("EcalGeom") << backBracketLog.name().name() << ":" << copyOne << " positioned in " + << backCName.name(); #endif - } + } /* cpv.position( backBracketLog, backCName, @@ -2969,9 +3017,10 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { if (0 != backMiscHere()) { cpv.position(bLog, backCName, copyOne, bSumTra + bTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << bLog.name().name() << ":" << copyOne << " positioned in " << backCName.name(); + edm::LogVerbatim("EcalGeom") << bLog.name().name() << ":" << copyOne << " positioned in " + << backCName.name(); #endif - } + } bSumTra += 2 * bTra; } @@ -2990,7 +3039,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { mTra += DDTranslation(vecMBLyrThick()[j] / 2.0, 0 * mm, 0 * mm); cpv.position(mLog, backCName, copyOne, mTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mLog.name().name() << ":" << copyOne << " positioned in " << backCName.name(); + edm::LogVerbatim("EcalGeom") << mLog.name().name() << ":" << copyOne << " positioned in " + << backCName.name(); #endif mTra += DDTranslation(vecMBLyrThick()[j] / 2.0, 0 * mm, 0 * mm); } @@ -3009,7 +3059,7 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { const DDLogicalPart mBWaLog(mBWaName, backPipeWaterMat(), mBCoolTubeWaSolid); cpv.position(mBWaLog, mBName, copyOne, DDTranslation(0, 0, 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBWaLog.name().name() << ":" << copyOne << " positioned in " << mBName.name(); + edm::LogVerbatim("EcalGeom") << mBWaLog.name().name() << ":" << copyOne << " positioned in " << mBName.name(); #endif for (unsigned int j(0); j != mBCoolTubeNum(); ++j) // loop over all MB cooling circuits { @@ -3021,7 +3071,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { -backCoolHeight / 2.0 + mBCoolTubeOutDiam() / 2., -bHalfWidth + (j + 1) * bHalfWidth / 5, 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBLog.name().name() << ":" << (2 * j + 1) << " positioned in " << backCName.name(); + edm::LogVerbatim("EcalGeom") << mBLog.name().name() << ":" << (2 * j + 1) << " positioned in " + << backCName.name(); #endif } } @@ -3056,7 +3107,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { cpv.position(backPipeLog, spmName(), copyOne, bPipeTra1, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backPipeLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << backPipeLog.name().name() << ":" << copyOne << " positioned in " + << spmName().name(); #endif const DDTranslation bPipeTra2(bPipeTra1.x(), @@ -3065,11 +3117,13 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { cpv.position(backPipeLog, spmName(), copyTwo, bPipeTra2, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backPipeLog.name().name() << ":" << copyTwo << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << backPipeLog.name().name() << ":" << copyTwo << " positioned in " + << spmName().name(); #endif cpv.position(backInnerLog, bPipeName, copyOne, DDTranslation(), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backInnerLog.name().name() << ":" << copyOne << " positioned in " << bPipeName.name(); + edm::LogVerbatim("EcalGeom") << backInnerLog.name().name() << ":" << copyOne << " positioned in " + << bPipeName.name(); #endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -3095,7 +3149,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { cpv.position(dryAirTubeLog, spmName(), copyOne, dryAirTubeTra1, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name().name() << ":" << copyOne << " positioned in " + << spmName().name(); #endif const DDTranslation dryAirTubeTra2( @@ -3105,7 +3160,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { cpv.position(dryAirTubeLog, spmName(), copyTwo, dryAirTubeTra2, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name().name() << ":" << copyTwo << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name().name() << ":" << copyTwo << " positioned in " + << spmName().name(); #endif } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -3123,7 +3179,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { for (unsigned int iBar(0); iBar != nMax; ++iBar) { cpv.position(backCoolVFELog, backCName, iCVFECopy++, cTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolVFELog.name().name() << ":" << iCVFECopy << " positioned in " << backCName.name(); + edm::LogVerbatim("EcalGeom") << backCoolVFELog.name().name() << ":" << iCVFECopy << " positioned in " + << backCName.name(); #endif cTra += DDTranslation(0, 0, backCBStdSep()); } @@ -3168,7 +3225,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { if (0 != patchPanelHere()) { cpv.position(patchLog, spmName(), copyOne, patchTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << patchLog.name().name() << ":" << copyOne << " positioned in " << spmName().name(); + edm::LogVerbatim("EcalGeom") << patchLog.name().name() << ":" << copyOne << " positioned in " + << spmName().name(); #endif } DDTranslation pTra(-patchParms[0], 0, 0); @@ -3184,7 +3242,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { cpv.position(pLog, patchPanelName(), copyOne, pTra, DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << pLog.name().name() << ":" << copyOne << " positioned in " << patchPanelName().name(); + edm::LogVerbatim("EcalGeom") << pLog.name().name() << ":" << copyOne << " positioned in " + << patchPanelName().name(); #endif pTra += DDTranslation(vecPatchPanelThick()[j] / 2, 0 * mm, 0 * mm); } @@ -3222,7 +3281,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, pincerEnvLength() / 2 - pincerBlkLength() / 2), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << blkLog.name().name() << ":" << copyOne << " positioned in " << pincerEnvName().name(); + edm::LogVerbatim("EcalGeom") << blkLog.name().name() << ":" << copyOne << " positioned in " + << pincerEnvName().name(); #endif DDSolid cutSolid( @@ -3237,7 +3297,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { +blkParms[0] - cutParms[0] - pincerShim1Width() + pincerShim2Width(), -blkParms[1] + cutParms[1], 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << cutLog.name().name() << ":" << copyOne << " positioned in " << pincerBlkName().name(); + edm::LogVerbatim("EcalGeom") << cutLog.name().name() << ":" << copyOne << " positioned in " + << pincerBlkName().name(); #endif DDSolid shim2Solid(DDSolidFactory::box( @@ -3250,7 +3311,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << shim2Log.name().name() << ":" << copyOne << " positioned in " << pincerCutName().name(); + edm::LogVerbatim("EcalGeom") << shim2Log.name().name() << ":" << copyOne << " positioned in " + << pincerCutName().name(); #endif DDSolid shim1Solid(DDSolidFactory::box(pincerShim1Name(), @@ -3267,7 +3329,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(+envParms[0] - shim1Parms[0], -envParms[1] + shim1Parms[1], -envParms[2] + shim1Parms[2]), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << shim1Log.name().name() << ":" << copyOne << " positioned in " << pincerEnvName().name(); + edm::LogVerbatim("EcalGeom") << shim1Log.name().name() << ":" << copyOne << " positioned in " + << pincerEnvName().name(); #endif for (unsigned int iEnv(0); iEnv != vecPincerEnvZOff().size(); ++iEnv) { cpv.position(envLog, @@ -3276,7 +3339,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { DDTranslation(0, 0, -ilyLength / 2. + vecPincerEnvZOff()[iEnv] - pincerEnvLength() / 2.), DDRotation()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << envLog.name().name() << ":" << (1 + iEnv) << " positioned in " << pincerRodName().name(); + edm::LogVerbatim("EcalGeom") << envLog.name().name() << ":" << (1 + iEnv) << " positioned in " + << pincerRodName().name(); #endif } @@ -3297,7 +3361,8 @@ void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) { myrot(pincerRodName().name() + std::to_string(iRod), CLHEP::HepRotationZ(90 * deg + vecPincerRodAzimuth()[iRod]))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << rodLog.name().name() << ":" << (1 + iRod) << " positioned in " << xilyName.name(); + edm::LogVerbatim("EcalGeom") << rodLog.name().name() << ":" << (1 + iRod) << " positioned in " + << xilyName.name(); #endif } } @@ -3419,7 +3484,8 @@ void DDEcalBarrelNewAlgo::web(unsigned int iWeb, DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()), myrot(webClrLog.name().name() + std::to_string(iWeb), tForm.getRotation())); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << webClrLog.name().name() << ":" << copyOne << " positioned in " << logPar.name().name(); + edm::LogVerbatim("EcalGeom") << webClrLog.name().name() << ":" << copyOne << " positioned in " + << logPar.name().name(); #endif } } diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index cebd37039138a..b81490afdc3b2 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -995,7 +995,8 @@ static long algorithm(dd4hep::Detector& /* description */, Position myTran(both.getTranslation().x(), both.getTranslation().y(), both.getTranslation().z()); barVolume.placeVolume(spmLog, iphi + 1, Transform3D(rota, myTran)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << DDSplit(spmLog.name()).first << ":" << (iphi + 1) << " positioned in " << barVolume.name(); + edm::LogVerbatim("EcalGeom") << DDSplit(spmLog.name()).first << ":" << (iphi + 1) << " positioned in " + << barVolume.name(); #endif } } @@ -1017,7 +1018,8 @@ static long algorithm(dd4hep::Detector& /* description */, Volume ilyLog = Volume(ily.name, ilySolid, ns.material(spm.mat)); spmLog.placeVolume(ilyLog, copyOne, Position(0, 0, 0.5 * ilyLength)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << ilyLog.name() << ":" << copyOne << " positioned in " + << DDSplit(spmLog.name()).first; #endif Volume ilyPipeLog[200]; if (0 != ily.pipeHere) { @@ -1042,7 +1044,8 @@ static long algorithm(dd4hep::Detector& /* description */, Volume ilyPipeWaLog = Volume(pWaName, ilyPipeWaSolid, ns.material(backPipe.waterMat)); ilyPipeLog[iPipeType].placeVolume(ilyPipeWaLog, copyOne); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyPipeWaLog.name() << ":" << copyOne << " positioned in " << ilyPipeLog[iPipeType].name(); + edm::LogVerbatim("EcalGeom") << ilyPipeWaLog.name() << ":" << copyOne << " positioned in " + << ilyPipeLog[iPipeType].name(); #endif } } @@ -1082,7 +1085,7 @@ static long algorithm(dd4hep::Detector& /* description */, if (0 != ily.here) { ilyLog.placeVolume(xilyLog, copyOne); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << xilyLog.name() << ":" << copyOne << " positioned in " << ilyLog.name(); + edm::LogVerbatim("EcalGeom") << xilyLog.name() << ":" << copyOne << " positioned in " << ilyLog.name(); #endif unsigned int copyNum[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -1100,7 +1103,7 @@ static long algorithm(dd4hep::Detector& /* description */, ptmCopy, Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLength / 2))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name(); + edm::LogVerbatim("EcalGeom") << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name(); #endif } } @@ -1117,7 +1120,8 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D(RotationZ(phi) * RotationY(180_deg), Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLength / 2))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name(); + edm::LogVerbatim("EcalGeom") + << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name(); #endif } unsigned int femCopy(0); @@ -1132,7 +1136,7 @@ static long algorithm(dd4hep::Detector& /* description */, femCopy, Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLength / 2))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name(); + edm::LogVerbatim("EcalGeom") << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name(); #endif } } @@ -1149,7 +1153,8 @@ static long algorithm(dd4hep::Detector& /* description */, if (9 > type) { xilyLog.placeVolume(ilyPipeLog[type], copyNum[type], Position(xx, yy, zz)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name(); + edm::LogVerbatim("EcalGeom") + << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name(); #endif } else { xilyLog.placeVolume( @@ -1158,7 +1163,8 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D(Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90_deg)), Position(xx, yy, zz))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name(); + edm::LogVerbatim("EcalGeom") + << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name(); #endif } } @@ -1183,7 +1189,8 @@ static long algorithm(dd4hep::Detector& /* description */, Volume clyrLog = Volume(clyrName, clyrSolid, ns.material(ily.vecIlyMat[4])); spmLog.placeVolume(clyrLog, copyOne); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << clyrLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << clyrLog.name() << ":" << copyOne << " positioned in " + << DDSplit(spmLog.name()).first; #endif // Begin Alveolar Wedge parent ------------------------------------------------------ //---------------- @@ -1340,7 +1347,8 @@ static long algorithm(dd4hep::Detector& /* description */, myrot(ns, alvWedge.fawName + "_Rot" + std::to_string(iPhi), fawform.getRotation()), Position(fawform.getTranslation().x(), fawform.getTranslation().y(), fawform.getTranslation().z()))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << fawLog.name() << ":" << iPhi << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << fawLog.name() << ":" << iPhi << " positioned in " + << DDSplit(spmLog.name()).first; #endif } } @@ -1562,31 +1570,31 @@ static long algorithm(dd4hep::Detector& /* description */, if (0 != cap.here) { bsiLog.placeVolume(aglLog, copyAGL, Position(0_mm, 0_mm, -apd.aglThick / 2. + bSi.thick / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << aglLog.name() << ":" << copyAGL << " positioned in " << bsiLog.name(); + edm::LogVerbatim("EcalGeom") << aglLog.name() << ":" << copyAGL << " positioned in " << bsiLog.name(); #endif bsiLog.placeVolume(andLog, copyAND, Position(0_mm, 0_mm, -apd.andThick / 2. - apd.aglThick + bSi.thick / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << andLog.name() << ":" << copyAND << " positioned in " << bsiLog.name(); + edm::LogVerbatim("EcalGeom") << andLog.name() << ":" << copyAND << " positioned in " << bsiLog.name(); #endif bsiLog.placeVolume( apdLog, copyAPD, Position(0_mm, 0_mm, -apd.thick / 2. - apd.andThick - apd.aglThick + bSi.thick / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << apdLog.name() << ":" << copyAPD << " positioned in " << bsiLog.name(); + edm::LogVerbatim("EcalGeom") << apdLog.name() << ":" << copyAPD << " positioned in " << bsiLog.name(); #endif bsiLog.placeVolume( atjLog, copyATJ, Position(0_mm, 0_mm, -apd.atjThick / 2. - apd.thick - apd.andThick - apd.aglThick + bSi.thick / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << atjLog.name() << ":" << copyATJ << " positioned in " << bsiLog.name(); + edm::LogVerbatim("EcalGeom") << atjLog.name() << ":" << copyATJ << " positioned in " << bsiLog.name(); #endif cerLog.placeVolume(bsiLog, copyBSi, Position(0_mm, 0_mm, -bSi.thick / 2. + cer.thick / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << bsiLog.name() << ":" << copyBSi << " positioned in " << cerLog.name(); + edm::LogVerbatim("EcalGeom") << bsiLog.name() << ":" << copyBSi << " positioned in " << cerLog.name(); #endif capLog.placeVolume(sglLog, copySGL, Position(0_mm, 0_mm, -apd.sglThick / 2. + cap.thick / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << sglLog.name() << ":" << copySGL << " positioned in " << capLog.name(); + edm::LogVerbatim("EcalGeom") << sglLog.name() << ":" << copySGL << " positioned in " << capLog.name(); #endif for (unsigned int ijkl(0); ijkl != 2; ++ijkl) { @@ -1596,12 +1604,12 @@ static long algorithm(dd4hep::Detector& /* description */, trapCry.h1() - apd.z, -apd.sglThick - cer.thick / 2. + cap.thick / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << cerLog.name() << ":" << copyCER << " positioned in " << capLog.name(); + edm::LogVerbatim("EcalGeom") << cerLog.name() << ":" << copyCER << " positioned in " << capLog.name(); #endif } clrLog.placeVolume(capLog, copyCap, Position(0_mm, 0_mm, -trapCry.dz() - cap.thick / 2. + (rClr - fClr) / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << capLog.name() << ":" << copyCap << " positioned in " << clrLog.name(); + edm::LogVerbatim("EcalGeom") << capLog.name() << ":" << copyCap << " positioned in " << clrLog.name(); #endif } @@ -1632,75 +1640,82 @@ static long algorithm(dd4hep::Detector& /* description */, if (1 == cryType) // first web plate: inside clearance volume { - const unsigned int iWeb(0); - const Pt3D corner(vHAW[4] + Pt3D(0, alvWedge.hawYOffCry, 0)); - const unsigned int copyOne(1); - const double LWebx(web.vecWebLength[iWeb]); - const double BWebx(trapWall.b() + (trapWall.B() - trapWall.b()) * LWebx / trapWall.L()); - - const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); - const EcalTrap trapWebClr(BWebx / 2, // A/2 - trapWall.b() / 2, // a/2 - trapWall.b() / 2, // b/2 - thick / 2, // H/2 - thick / 2, // h/2 - LWebx / 2, // L/2 - 90_deg, // alfa1 - trapWall.b() - BWebx, // x15 - 0 // y15 - ); - std::string webClrName(web.clrName + std::to_string(iWeb)); - Solid webClrSolid = mytrap(webClrName, trapWebClr); - Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); - - const EcalTrap trapWebPl(trapWebClr.A() / 2, // A/2 - trapWebClr.a() / 2, // a/2 - trapWebClr.b() / 2, // b/2 - web.vecWebPlTh[iWeb] / 2, // H/2 - web.vecWebPlTh[iWeb] / 2, // h/2 - trapWebClr.L() / 2., // L/2 - 90._deg, // alfa1 - trapWebClr.b() - trapWebClr.B(), // x15 - 0 // y15 - ); - std::string webPlName(web.plName + std::to_string(iWeb)); - Solid webPlSolid = mytrap(webPlName, trapWebPl); - Volume webPlLog = Volume(webPlName, webPlSolid, ns.material(web.plMat)); - - webClrLog.placeVolume(webPlLog, copyOne); // place plate inside clearance volume -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << webPlLog.name() << ":" << copyOne << " positioned in " << webClrName; -#endif - const EcalTrap::VertexList vWeb(trapWebClr.vertexList()); - - zee += trapWebClr.h() / sin(theta); - - const double beta(theta + delta); - - const double zWeb(zee - frontPrime * cos(beta) + sidePrime * sin(beta)); - const double yWeb(frontPrime * sin(beta) + sidePrime * cos(beta)); - - const Pt3D wedge3(corner + Pt3D(0, -yWeb, zWeb)); - const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta))); - const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0)); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3]; - edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3; -#endif - const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3); - - if (0 != web.here) { - hawRLog.placeVolume(webClrLog, copyOne, Transform3D(myrot(ns, webClrName + std::to_string(iWeb), tForm.getRotation()), Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()))); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << webClrLog.name() << ":" << copyOne << " positioned in " << hawRLog.name(); -#endif - } + const unsigned int iWeb(0); + const Pt3D corner(vHAW[4] + Pt3D(0, alvWedge.hawYOffCry, 0)); + const unsigned int copyOne(1); + const double LWebx(web.vecWebLength[iWeb]); + const double BWebx(trapWall.b() + (trapWall.B() - trapWall.b()) * LWebx / trapWall.L()); + + const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); + const EcalTrap trapWebClr(BWebx / 2, // A/2 + trapWall.b() / 2, // a/2 + trapWall.b() / 2, // b/2 + thick / 2, // H/2 + thick / 2, // h/2 + LWebx / 2, // L/2 + 90_deg, // alfa1 + trapWall.b() - BWebx, // x15 + 0 // y15 + ); + std::string webClrName(web.clrName + std::to_string(iWeb)); + Solid webClrSolid = mytrap(webClrName, trapWebClr); + Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); + + const EcalTrap trapWebPl(trapWebClr.A() / 2, // A/2 + trapWebClr.a() / 2, // a/2 + trapWebClr.b() / 2, // b/2 + web.vecWebPlTh[iWeb] / 2, // H/2 + web.vecWebPlTh[iWeb] / 2, // h/2 + trapWebClr.L() / 2., // L/2 + 90._deg, // alfa1 + trapWebClr.b() - trapWebClr.B(), // x15 + 0 // y15 + ); + std::string webPlName(web.plName + std::to_string(iWeb)); + Solid webPlSolid = mytrap(webPlName, trapWebPl); + Volume webPlLog = Volume(webPlName, webPlSolid, ns.material(web.plMat)); + + webClrLog.placeVolume(webPlLog, copyOne); // place plate inside clearance volume +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webPlLog.name() << ":" << copyOne << " positioned in " << webClrName; +#endif + const EcalTrap::VertexList vWeb(trapWebClr.vertexList()); + + zee += trapWebClr.h() / sin(theta); + + const double beta(theta + delta); + + const double zWeb(zee - frontPrime * cos(beta) + sidePrime * sin(beta)); + const double yWeb(frontPrime * sin(beta) + sidePrime * cos(beta)); + + const Pt3D wedge3(corner + Pt3D(0, -yWeb, zWeb)); + const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta))); + const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3]; + edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3; +#endif + const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3); + + if (0 != web.here) { + hawRLog.placeVolume( + webClrLog, + copyOne, + Transform3D( + myrot(ns, webClrName + std::to_string(iWeb), tForm.getRotation()), + Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webClrLog.name() << ":" << copyOne << " positioned in " << hawRLog.name(); +#endif + } zee += alv.vecGapAlvEta[0]; } for (unsigned int etaAlv(1); etaAlv <= alv.nCryPerAlvEta; ++etaAlv) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "theta=" << convertRadToDeg(theta) << ", sidePrime=" << sidePrime << ", frontPrime=" << frontPrime << ", zeta=" << zeta << ", delta=" << delta << ", zee=" << zee; + edm::LogVerbatim("EcalGeom") << "theta=" << convertRadToDeg(theta) << ", sidePrime=" << sidePrime + << ", frontPrime=" << frontPrime << ", zeta=" << zeta << ", delta=" << delta + << ", zee=" << zee; #endif zee += 0.075_mm + (side * cos(zeta) + trapWall.h() - sidePrime) / sin(theta); @@ -1727,7 +1742,7 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D(myrot(ns, wallDDName + "_" + std::to_string(etaAlv), tForm.getRotation()), Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << wallLog.name() << ":" << etaAlv << " positioned in " << hawRLog.name(); + edm::LogVerbatim("EcalGeom") << wallLog.name() << ":" << etaAlv << " positioned in " << hawRLog.name(); #endif theta -= delta; side = sidePrime; @@ -1736,69 +1751,74 @@ static long algorithm(dd4hep::Detector& /* description */, if (5 == cryType || 9 == cryType || 13 == cryType || 17 == cryType) { // web plates zee += 0.5 * alv.vecGapAlvEta[cryType] / sin(theta); - const unsigned int iWeb(cryType / 4); - const Pt3D corner(vHAW[4] + Pt3D(0, alvWedge.hawYOffCry, 0)); - const unsigned int copyOne(1); - const double LWebx(web.vecWebLength[iWeb]); - const double BWebx(trapWall.a() + (trapWall.A() - trapWall.a()) * LWebx / trapWall.L()); - - const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); - const EcalTrap trapWebClr(BWebx / 2, // A/2 - trapWall.a() / 2, // a/2 - trapWall.a() / 2, // b/2 - thick / 2, // H/2 - thick / 2, // h/2 - LWebx / 2, // L/2 - 90_deg, // alfa1 - trapWall.a() - BWebx, // x15 - 0 // y15 - ); - std::string webClrName(web.clrName + std::to_string(iWeb)); - Solid webClrSolid = mytrap(webClrName, trapWebClr); - Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); - - const EcalTrap trapWebPl(trapWebClr.A() / 2, // A/2 - trapWebClr.a() / 2, // a/2 - trapWebClr.b() / 2, // b/2 - web.vecWebPlTh[iWeb] / 2, // H/2 - web.vecWebPlTh[iWeb] / 2, // h/2 - trapWebClr.L() / 2., // L/2 - 90._deg, // alfa1 - trapWebClr.b() - trapWebClr.B(), // x15 - 0 // y15 - ); - std::string webPlName(web.plName + std::to_string(iWeb)); - Solid webPlSolid = mytrap(webPlName, trapWebPl); - Volume webPlLog = Volume(webPlName, webPlSolid, ns.material(web.plMat)); - - webClrLog.placeVolume(webPlLog, copyOne); // place plate inside clearance volume -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << webPlLog.name() << ":" << copyOne << " positioned in " << webClrName; + const unsigned int iWeb(cryType / 4); + const Pt3D corner(vHAW[4] + Pt3D(0, alvWedge.hawYOffCry, 0)); + const unsigned int copyOne(1); + const double LWebx(web.vecWebLength[iWeb]); + const double BWebx(trapWall.a() + (trapWall.A() - trapWall.a()) * LWebx / trapWall.L()); + + const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); + const EcalTrap trapWebClr(BWebx / 2, // A/2 + trapWall.a() / 2, // a/2 + trapWall.a() / 2, // b/2 + thick / 2, // H/2 + thick / 2, // h/2 + LWebx / 2, // L/2 + 90_deg, // alfa1 + trapWall.a() - BWebx, // x15 + 0 // y15 + ); + std::string webClrName(web.clrName + std::to_string(iWeb)); + Solid webClrSolid = mytrap(webClrName, trapWebClr); + Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); + + const EcalTrap trapWebPl(trapWebClr.A() / 2, // A/2 + trapWebClr.a() / 2, // a/2 + trapWebClr.b() / 2, // b/2 + web.vecWebPlTh[iWeb] / 2, // H/2 + web.vecWebPlTh[iWeb] / 2, // h/2 + trapWebClr.L() / 2., // L/2 + 90._deg, // alfa1 + trapWebClr.b() - trapWebClr.B(), // x15 + 0 // y15 + ); + std::string webPlName(web.plName + std::to_string(iWeb)); + Solid webPlSolid = mytrap(webPlName, trapWebPl); + Volume webPlLog = Volume(webPlName, webPlSolid, ns.material(web.plMat)); + + webClrLog.placeVolume(webPlLog, copyOne); // place plate inside clearance volume +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webPlLog.name() << ":" << copyOne << " positioned in " << webClrName; +#endif + const EcalTrap::VertexList vWeb(trapWebClr.vertexList()); + + zee += trapWebClr.h() / sin(theta); + + const double beta(theta + delta); + + const double zWeb(zee - frontPrime * cos(beta) + sidePrime * sin(beta)); + const double yWeb(frontPrime * sin(beta) + sidePrime * cos(beta)); + + const Pt3D wedge3(corner + Pt3D(0, -yWeb, zWeb)); + const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta))); + const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0)); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3]; + edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3; +#endif + const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3); + + if (0 != web.here) { + hawRLog.placeVolume( + webClrLog, + copyOne, + Transform3D( + myrot(ns, webClrName + std::to_string(iWeb), tForm.getRotation()), + Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()))); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << webClrLog.name() << ":" << copyOne << " positioned in " << hawRLog.name(); #endif - const EcalTrap::VertexList vWeb(trapWebClr.vertexList()); - - zee += trapWebClr.h() / sin(theta); - - const double beta(theta + delta); - - const double zWeb(zee - frontPrime * cos(beta) + sidePrime * sin(beta)); - const double yWeb(frontPrime * sin(beta) + sidePrime * cos(beta)); - - const Pt3D wedge3(corner + Pt3D(0, -yWeb, zWeb)); - const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta))); - const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0)); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3]; - edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3; -#endif - const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3); - - if (0 != web.here) { - hawRLog.placeVolume(webClrLog, copyOne, Transform3D(myrot(ns, webClrName + std::to_string(iWeb), tForm.getRotation()), Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()))); -#ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << webClrLog.name() << ":" << copyOne << " positioned in " << hawRLog.name(); -#endif - } + } zee += 0.5 * alv.vecGapAlvEta[cryType] / sin(theta); } else { @@ -1842,14 +1862,16 @@ static long algorithm(dd4hep::Detector& /* description */, if (0 != back.plateHere) { backPlateLog.placeVolume(backPlate2Log, copyOne, Transform3D(backPlate2Tra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backPlate2Log.name() << ":" << copyOne << " positioned in " << backPlateLog.name(); + edm::LogVerbatim("EcalGeom") << backPlate2Log.name() << ":" << copyOne << " positioned in " + << backPlateLog.name(); #endif spmLog.placeVolume( backPlateLog, copyOne, Transform3D(myrot(ns, back.plateName + "Rot5", CLHEP::HepRotationZ(270_deg)), outtra + backPlateTra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backPlateLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << backPlateLog.name() << ":" << copyOne << " positioned in " + << DDSplit(spmLog.name()).first; #endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1886,7 +1908,8 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D(myrot(ns, back.sideName + "Rot8", CLHEP::HepRotationX(180_deg) * CLHEP::HepRotationZ(90_deg)), outtra + backSideTra1)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backSideLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << backSideLog.name() << ":" << copyOne << " positioned in " + << DDSplit(spmLog.name()).first; #endif const Position backSideTra2(0_mm, -back.plateWidth / 2 + back.sideYOff2, 1_mm); spmLog.placeVolume( @@ -1894,7 +1917,8 @@ static long algorithm(dd4hep::Detector& /* description */, copyTwo, Transform3D(myrot(ns, back.sideName + "Rot9", CLHEP::HepRotationZ(90_deg)), outtra + backSideTra2)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backSideLog.name() << ":" << copyTwo << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << backSideLog.name() << ":" << copyTwo << " positioned in " + << DDSplit(spmLog.name()).first; #endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1970,7 +1994,8 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D(Position( grille.vecHeight[iGr] / 2. - grille.vecMidSlotHeight[(iGr - 1) / 2] / 2., +grille.midSlotXOff, 0))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in " << grilleLog.name(); + edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in " + << grilleLog.name(); #endif grilleLog.placeVolume( grMidSlotLog[(iGr - 1) / 2], @@ -1978,7 +2003,8 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D(Position( grille.vecHeight[iGr] / 2. - grille.vecMidSlotHeight[(iGr - 1) / 2] / 2., -grille.midSlotXOff, 0))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in " << grilleLog.name(); + edm::LogVerbatim("EcalGeom") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in " + << grilleLog.name(); #endif } @@ -1989,7 +2015,8 @@ static long algorithm(dd4hep::Detector& /* description */, backCoolWidth / 2 - grille.edgeSlotWidth / 2., 0))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " << grilleLog.name(); + edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " + << grilleLog.name(); #endif grilleLog.placeVolume(grEdgeSlotLog, ++edgeSlotCopy, @@ -1997,15 +2024,17 @@ static long algorithm(dd4hep::Detector& /* description */, -backCoolWidth / 2 + grille.edgeSlotWidth / 2., 0))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " << grilleLog.name(); + edm::LogVerbatim("EcalGeom") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " + << grilleLog.name(); #endif } if (0 != grille.here) { spmLog.placeVolume(grilleLog, iGr, Transform3D(gTra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << grilleLog.name() << ":" << iGr << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << grilleLog.name() << ":" << iGr << " positioned in " + << DDSplit(spmLog.name()).first; #endif - } + } if ((0 != iGr % 2) && (0 != mbManif.here)) { spmLog.placeVolume(mBManifLog, @@ -2015,7 +2044,8 @@ static long algorithm(dd4hep::Detector& /* description */, manifCut, grille.thick / 2. + 3 * mbManif.outDiam / 2.))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBManifLog.name() << ":" << iGr << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << mBManifLog.name() << ":" << iGr << " positioned in " + << DDSplit(spmLog.name()).first; #endif spmLog.placeVolume(mBManifLog, iGr - 1, @@ -2024,7 +2054,8 @@ static long algorithm(dd4hep::Detector& /* description */, manifCut, grille.thick / 2 + 3 * mbManif.outDiam / 2.))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBManifLog.name() << ":" << (iGr - 1) << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << mBManifLog.name() << ":" << (iGr - 1) << " positioned in " + << DDSplit(spmLog.name()).first; #endif } } @@ -2049,7 +2080,8 @@ static long algorithm(dd4hep::Detector& /* description */, const Position backCoolBarSSTra(0, 0, 0); backCoolBarLog.placeVolume(backCoolBarSSLog, copyOne, Transform3D(backCoolBarSSTra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolBarSSLog.name() << ":" << copyOne << " positioned in " << backCoolBarLog.name(); + edm::LogVerbatim("EcalGeom") << backCoolBarSSLog.name() << ":" << copyOne << " positioned in " + << backCoolBarLog.name(); #endif Solid backCoolBarWaSolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., backCool.barWaThick / 2.); @@ -2057,7 +2089,8 @@ static long algorithm(dd4hep::Detector& /* description */, const Position backCoolBarWaTra(0, 0, 0); backCoolBarSSLog.placeVolume(backCoolBarWaLog, copyOne, Transform3D(backCoolBarWaTra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolBarWaLog.name() << ":" << copyOne << " positioned in " << backCoolBarSSLog.name(); + edm::LogVerbatim("EcalGeom") << backCoolBarWaLog.name() << ":" << copyOne << " positioned in " + << backCoolBarSSLog.name(); #endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2087,7 +2120,8 @@ static long algorithm(dd4hep::Detector& /* description */, const Position backVFELyrTra(0, 0, backCool.vecBackVFELyrThick[iLyr] / 2); backVFELog.placeVolume(backVFELyrLog, copyOne, Transform3D(backVFELyrTra + offTra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backVFELyrLog.name() << ":" << copyOne << " positioned in " << DDSplit(backVFELog.name()).first; + edm::LogVerbatim("EcalGeom") << backVFELyrLog.name() << ":" << copyOne << " positioned in " + << DDSplit(backVFELog.name()).first; #endif offTra += 2 * backVFELyrTra; } @@ -2110,14 +2144,16 @@ static long algorithm(dd4hep::Detector& /* description */, if (0 != backCool.barHere) { backCoolVFELog.placeVolume(backCoolBarLog, copyOne, Transform3D()); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolBarLog.name() << ":" << copyOne << " positioned in " << backCoolVFELog.name(); + edm::LogVerbatim("EcalGeom") << backCoolBarLog.name() << ":" << copyOne << " positioned in " + << backCoolVFELog.name(); #endif } if (0 != backCool.vFEHere) { backCoolVFELog.placeVolume( backVFELog, copyOne, Transform3D(Position(0, 0, backCool.barThick / 2. + thickVFE / 2.))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << DDSplit(backVFELog.name()).first << ":" << copyOne << " positioned in " << backCoolVFELog.name(); + edm::LogVerbatim("EcalGeom") << DDSplit(backVFELog.name()).first << ":" << copyOne << " positioned in " + << backCoolVFELog.name(); #endif } backCoolVFELog.placeVolume(backVFELog, @@ -2125,7 +2161,8 @@ static long algorithm(dd4hep::Detector& /* description */, Transform3D(myrot(ns, backCool.backVFEName + "Flip", CLHEP::HepRotationX(180_deg)), Position(0, 0, -backCool.barThick / 2. - thickVFE / 2.))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << DDSplit(backVFELog.name()).first << ":" << copyTwo << " positioned in " << backCoolVFELog.name(); + edm::LogVerbatim("EcalGeom") << DDSplit(backVFELog.name()).first << ":" << copyTwo << " positioned in " + << backCoolVFELog.name(); #endif //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2170,9 +2207,10 @@ static long algorithm(dd4hep::Detector& /* description */, if (0 != backCool.here) { spmLog.placeVolume(backCoolLog, iMod + 1, outtra + backPlateTra + bCoolTra); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolLog.name() << ":" << (iMod + 1) << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << backCoolLog.name() << ":" << (iMod + 1) << " positioned in " + << DDSplit(spmLog.name()).first; #endif - } + } //=== const double backCoolTankHeight(backCool.barHeight); // - backBracketHeight() ) ; @@ -2189,9 +2227,10 @@ static long algorithm(dd4hep::Detector& /* description */, backCool.barWidth / 2. + backCoolTank.width / 2., 0))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolTankLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); + edm::LogVerbatim("EcalGeom") << backCoolTankLog.name() << ":" << copyOne << " positioned in " + << backCoolLog.name(); #endif - } + } string bTankWaName(backCoolTank.waName + std::to_string(iMod + 1)); Solid backCoolTankWaSolid = Box(backCoolTankHeight / 2. - backCoolTank.thick / 2., @@ -2200,7 +2239,8 @@ static long algorithm(dd4hep::Detector& /* description */, Volume backCoolTankWaLog = Volume(bTankWaName, backCoolTankWaSolid, ns.material(backCoolTank.waMat)); backCoolTankLog.placeVolume(backCoolTankWaLog, copyOne, Transform3D(Rotation3D(), Position(0, 0, 0))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolTankWaLog.name() << ":" << copyOne << " positioned in " << backCoolTankLog.name(); + edm::LogVerbatim("EcalGeom") << backCoolTankWaLog.name() << ":" << copyOne << " positioned in " + << backCoolTankLog.name(); #endif string bBracketName(backCoolTank.backBracketName + std::to_string(iMod + 1)); @@ -2215,9 +2255,10 @@ static long algorithm(dd4hep::Detector& /* description */, -backCool.barWidth / 2. - backCoolTank.width / 2., 0))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backBracketLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); + edm::LogVerbatim("EcalGeom") << backBracketLog.name() << ":" << copyOne << " positioned in " + << backCoolLog.name(); #endif - } + } //=== Position bSumTra(backCool.barHeight - backCoolHeight / 2. + bottomThick, 0, 0); @@ -2233,9 +2274,9 @@ static long algorithm(dd4hep::Detector& /* description */, if (0 != backMisc.here) { backCoolLog.placeVolume(bLog, copyOne, Transform3D(Rotation3D(), bSumTra + bTra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << bLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); + edm::LogVerbatim("EcalGeom") << bLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); #endif - } + } bSumTra += 2 * bTra; } @@ -2253,7 +2294,7 @@ static long algorithm(dd4hep::Detector& /* description */, mTra += Position(mbLyr.vecMBLyrThick[j] / 2.0, 0_mm, 0_mm); backCoolLog.placeVolume(mLog, copyOne, Transform3D(Rotation3D(), mTra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); + edm::LogVerbatim("EcalGeom") << mLog.name() << ":" << copyOne << " positioned in " << backCoolLog.name(); #endif mTra += Position(mbLyr.vecMBLyrThick[j] / 2.0, 0_mm, 0_mm); } @@ -2270,7 +2311,7 @@ static long algorithm(dd4hep::Detector& /* description */, Volume mBWaLog = Volume(mBWaName, mBCoolTubeWaSolid, ns.material(backPipe.waterMat)); mBLog.placeVolume(mBWaLog, copyOne); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBWaLog.name() << ":" << copyOne << " positioned in " << mBLog.name(); + edm::LogVerbatim("EcalGeom") << mBWaLog.name() << ":" << copyOne << " positioned in " << mBLog.name(); #endif for (unsigned int j(0); j != dryAirTube.mbCoolTubeNum; ++j) // loop over all MB cooling circuits @@ -2282,7 +2323,8 @@ static long algorithm(dd4hep::Detector& /* description */, -bHalfWidth + (j + 1) * bHalfWidth / 5, 0))); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << mBLog.name() << ":" << (2 * j + 1) << " positioned in " << backCoolLog.name(); + edm::LogVerbatim("EcalGeom") << mBLog.name() << ":" << (2 * j + 1) << " positioned in " + << backCoolLog.name(); #endif } } @@ -2309,19 +2351,22 @@ static long algorithm(dd4hep::Detector& /* description */, spmLog.placeVolume(backPipeLog, copyOne, Transform3D(Rotation3D(), bPipeTra1)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backPipeLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << backPipeLog.name() << ":" << copyOne << " positioned in " + << DDSplit(spmLog.name()).first; #endif const Position bPipeTra2( bPipeTra1.x(), back.yOff - back.plateWidth / 2 + back.sideWidth + backPipe.vecDiam[iMod], bPipeTra1.z()); spmLog.placeVolume(backPipeLog, copyTwo, Transform3D(Rotation3D(), bPipeTra2)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backPipeLog.name() << ":" << copyTwo << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << backPipeLog.name() << ":" << copyTwo << " positioned in " + << DDSplit(spmLog.name()).first; #endif backPipeLog.placeVolume(backInnerLog, copyOne, Transform3D(Rotation3D(), Position())); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backInnerLog.name() << ":" << copyOne << " positioned in " << backPipeLog.name(); + edm::LogVerbatim("EcalGeom") << backInnerLog.name() << ":" << copyOne << " positioned in " + << backPipeLog.name(); #endif } //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -2345,7 +2390,8 @@ static long algorithm(dd4hep::Detector& /* description */, spmLog.placeVolume(dryAirTubeLog, copyOne, Transform3D(Rotation3D(), dryAirTubeTra1)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name() << ":" << copyOne << " positioned in " + << DDSplit(spmLog.name()).first; #endif const Position dryAirTubeTra2(dryAirTubeTra1.x(), @@ -2354,7 +2400,8 @@ static long algorithm(dd4hep::Detector& /* description */, spmLog.placeVolume(dryAirTubeLog, copyTwo, Transform3D(Rotation3D(), dryAirTubeTra2)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name() << ":" << copyTwo << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << dryAirTubeLog.name() << ":" << copyTwo << " positioned in " + << DDSplit(spmLog.name()).first; #endif } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -2372,7 +2419,8 @@ static long algorithm(dd4hep::Detector& /* description */, for (unsigned int iBar(0); iBar != nMax; ++iBar) { backCoolLog.placeVolume(backCoolVFELog, iCVFECopy++, cTra); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << backCoolVFELog.name() << ":" << iCVFECopy << " positioned in " << backCoolLog.name(); + edm::LogVerbatim("EcalGeom") << backCoolVFELog.name() << ":" << iCVFECopy << " positioned in " + << backCoolLog.name(); #endif cTra += Position(0, 0, backMisc.backCBStdSep); } @@ -2413,7 +2461,8 @@ static long algorithm(dd4hep::Detector& /* description */, if (0 != patchPanel.here) { spmLog.placeVolume(patchLog, copyOne, patchTra); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << patchLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; + edm::LogVerbatim("EcalGeom") << patchLog.name() << ":" << copyOne << " positioned in " + << DDSplit(spmLog.name()).first; #endif } @@ -2428,7 +2477,7 @@ static long algorithm(dd4hep::Detector& /* description */, pTra += Position(patchPanel.vecThick[j] / 2, 0_mm, 0_mm); patchLog.placeVolume(pLog, copyOne, pTra); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << pLog.name() << ":" << copyOne << " positioned in " << patchLog.name(); + edm::LogVerbatim("EcalGeom") << pLog.name() << ":" << copyOne << " positioned in " << patchLog.name(); #endif pTra += Position(patchPanel.vecThick[j] / 2, 0_mm, 0_mm); @@ -2461,7 +2510,7 @@ static long algorithm(dd4hep::Detector& /* description */, envLog.placeVolume(blkLog, copyOne, Position(0_mm, 0_mm, pincer.envLength / 2 - pincer.blkLength / 2)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << blkLog.name() << ":" << copyOne << " positioned in " << envLog.name(); + edm::LogVerbatim("EcalGeom") << blkLog.name() << ":" << copyOne << " positioned in " << envLog.name(); #endif array<double, 3> cutParms{{pincer.cutWidth / 2., pincer.cutHeight / 2., pincer.blkLength / 2}}; @@ -2473,7 +2522,7 @@ static long algorithm(dd4hep::Detector& /* description */, Position( +blkParms[0] - cutParms[0] - pincer.shim1Width + pincer.shim2Width, -blkParms[1] + cutParms[1], 0_mm)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << cutLog.name() << ":" << copyOne << " positioned in " << blkLog.name(); + edm::LogVerbatim("EcalGeom") << cutLog.name() << ":" << copyOne << " positioned in " << blkLog.name(); #endif array<double, 3> shim2Parms{{pincer.shim2Width / 2., pincer.shimHeight / 2., pincer.blkLength / 2}}; Solid shim2Solid = Box(pincer.shim2Name, shim2Parms[0], shim2Parms[1], shim2Parms[2]); @@ -2481,7 +2530,7 @@ static long algorithm(dd4hep::Detector& /* description */, cutLog.placeVolume( shim2Log, copyOne, Position(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0_mm)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << shim2Log.name() << ":" << copyOne << " positioned in " << cutLog.name(); + edm::LogVerbatim("EcalGeom") << shim2Log.name() << ":" << copyOne << " positioned in " << cutLog.name(); #endif array<double, 3> shim1Parms{ @@ -2493,7 +2542,7 @@ static long algorithm(dd4hep::Detector& /* description */, copyOne, Position(+envParms[0] - shim1Parms[0], -envParms[1] + shim1Parms[1], -envParms[2] + shim1Parms[2])); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << shim1Log.name() << ":" << copyOne << " positioned in " << envLog.name(); + edm::LogVerbatim("EcalGeom") << shim1Log.name() << ":" << copyOne << " positioned in " << envLog.name(); #endif for (unsigned int iEnv(0); iEnv != pincer.vecEnvZOff.size(); ++iEnv) { @@ -2501,7 +2550,7 @@ static long algorithm(dd4hep::Detector& /* description */, 1 + iEnv, Position(0_mm, 0_mm, -ilyLength / 2. + pincer.vecEnvZOff[iEnv] - pincer.envLength / 2.)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << envLog.name() << ":" << (1 + iEnv) << " positioned in " << rodLog.name(); + edm::LogVerbatim("EcalGeom") << envLog.name() << ":" << (1 + iEnv) << " positioned in " << rodLog.name(); #endif } @@ -2519,7 +2568,7 @@ static long algorithm(dd4hep::Detector& /* description */, CLHEP::HepRotationZ(90_deg + pincer.vecRodAzimuth[iRod])), rodTra)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << rodLog.name() << ":" << (1 + iRod) << " positioned in " << xilyLog.name(); + edm::LogVerbatim("EcalGeom") << rodLog.name() << ":" << (1 + iRod) << " positioned in " << xilyLog.name(); #endif } } From 1fea02b95d21ad434657187542739d749d017054 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Fri, 9 Oct 2020 22:06:41 +0200 Subject: [PATCH 472/778] Slava's comments on DataFormats --- .../TrackerRecHit2D/interface/VectorHit.h | 43 +++---- .../TrackerRecHit2D/interface/VectorHit2D.h | 18 ++- .../TrackerRecHit2D/src/BaseTrackerRecHit.cc | 4 +- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 115 +++++------------- .../TrackerRecHit2D/src/classes_def.xml | 9 +- .../SiPhase2VectorHitBuilder/BuildFile.xml | 1 - .../interface/VectorHitBuilderAlgorithm.h | 17 ++- .../interface/VectorHitBuilderAlgorithmBase.h | 4 +- .../plugins/VectorHitBuilderEDProducer.cc | 16 +-- .../src/VectorHitBuilderAlgorithm.cc | 26 ++-- .../test/VectorHitsValidation.cc | 10 +- .../test/VectorHitsValidation.h | 4 +- .../interface/MeasurementTrackerEvent.h | 12 +- .../MeasurementTrackerEventProducer.cc | 8 +- .../plugins/MeasurementTrackerEventProducer.h | 4 +- .../plugins/SeedingOTEDProducer.cc | 24 ++-- .../TkSeedingLayers/src/HitExtractorSTRP.cc | 8 +- .../TkSeedingLayers/src/HitExtractorSTRP.h | 4 +- 18 files changed, 131 insertions(+), 196 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index f630031c21c7b..2ceebd2e5568a 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -29,14 +29,14 @@ class VectorHit final : public BaseTrackerRecHit { public: typedef OmniClusterRef::Phase2Cluster1DRef ClusterRef; - VectorHit() : thePosition(), theDirection(), theCovMatrix(), theDimension(0) { setType(bad); } + VectorHit() : thePosition(), theDirection(), theCovMatrix() { setType(bad); } - VectorHit(const VectorHit& vh); + //VectorHit(const VectorHit& vh); VectorHit(const GeomDet& idet, const LocalPoint& posInner, const LocalVector& dir, - const std::array<std::array<float, 4>, 4> covMatrix, + const AlgebraicSymMatrix44 covMatrix, const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper, @@ -53,36 +53,34 @@ class VectorHit final : public BaseTrackerRecHit { const float curvatureError, const float phi); - ~VectorHit() override; + ~VectorHit() override = default; VectorHit* clone() const override { return new VectorHit(*this); } RecHitPointer cloneSH() const override { return std::make_shared<VectorHit>(*this); } bool sharesInput(const TrackingRecHit* other, SharedInputType what) const override; - bool sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedInputType what) const; + bool sharesClusters(VectorHit const& other, SharedInputType what) const; // Parameters of the segment, for the track fit // For a 4D segment: (dx/dz,dy/dz,x,y) bool hasPositionAndError() const override { - //if det is present pose&err are available as well. - //if det() is not present (null) the hit ihas been read from file and not updated + //if det is present pos&err are available as well. + //if det() is not present (null) the hit has been read from file and not updated return det(); }; - AlgebraicVector parameters() const override; void getKfComponents(KfComponentsHolder& holder) const override { getKfComponents4D(holder); } void getKfComponents4D(KfComponentsHolder& holder) const; // returning methods LocalPoint localPosition() const override { return thePosition; } virtual LocalVector localDirection() const { return theDirection; } - const std::array<std::array<float, 4>, 4> parametersErrorPlain() const; - AlgebraicSymMatrix parametersError() const override; + AlgebraicSymMatrix44 covMatrix() const; LocalError localPositionError() const override; - virtual LocalError localDirectionError() const; - Global3DVector globalDirection() const; + LocalError localDirectionError() const; + Global3DVector globalDirectionVH() const; - virtual float chi2() const { return theChi2; } + float chi2() const { return theChi2; } int dimension() const override { return theDimension; } float curvature() const { return theCurvature; } float curvatureError() const { return theCurvatureError; } @@ -111,22 +109,14 @@ class VectorHit final : public BaseTrackerRecHit { OmniClusterRef const& firstClusterRef() const override { return theLowerCluster; } ClusterRef cluster() const { return theLowerCluster.cluster_phase2OT(); } - //This method returns the delta in global coordinates - Global3DVector globalDelta() const; + //This method returns the direction of the segment/stub in global coordinates + Global3DVector globalDirection() const; float theta() const; - /// The projection matrix relates the trajectory state parameters to the segment parameters(). - AlgebraicMatrix projectionMatrix() const override; - // Access to component RecHits (if any) std::vector<const TrackingRecHit*> recHits() const override; std::vector<TrackingRecHit*> recHits() override; - // setting methods - void setPosition(LocalPoint pos) { thePosition = pos; } - void setDirection(LocalVector dir) { theDirection = dir; } - void setCovMatrix(std::array<std::array<float, 4>, 4> mat) { theCovMatrix = mat; } - private: // double dispatch VectorHit* clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override { @@ -146,16 +136,15 @@ class VectorHit final : public BaseTrackerRecHit { // mat[3][3]=var(y) // mat[0][2]=cov(dx/dz,x) // mat[1][3]=cov(dy/dz,y) - std::array<std::array<float, 4>, 4> theCovMatrix; + AlgebraicSymMatrix44 theCovMatrix; float theChi2; - int theDimension; + static constexpr int theDimension = 4; OmniClusterRef theLowerCluster; OmniClusterRef theUpperCluster; float theCurvature; float theCurvatureError; float thePhi; - static constexpr int nComponents = 4; }; inline bool operator<(const VectorHit& one, const VectorHit& other) { return (one.chi2() < other.chi2()); } @@ -163,6 +152,6 @@ inline bool operator<(const VectorHit& one, const VectorHit& other) { return (on std::ostream& operator<<(std::ostream& os, const VectorHit& vh); typedef edmNew::DetSetVector<VectorHit> VectorHitCollection; -typedef VectorHitCollection VectorHitCollectionNew; +//typedef VectorHitCollection VectorHitCollectionNew; #endif diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index ec0ad38f22f6a..fac5297b52c15 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -10,20 +10,18 @@ class VectorHit2D { public: - VectorHit2D() : thePosition(), theDirection(), theCovMatrix(), theChi2(), theDimension(2) {} - VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& Chi2) + VectorHit2D() : thePosition(), theDirection(), theCovMatrix(), theChi2() {} + VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& chi2) : thePosition(pos), theDirection(dir), theCovMatrix(covMatrix), theLocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]), - theChi2(Chi2), - theDimension(2){}; - virtual ~VectorHit2D(){}; + theChi2(chi2){}; - const LocalPoint* localPosition() const { return &thePosition; } - const LocalVector* localDirection() const { return &theDirection; } - const LocalError* localDirectionError() const { return &theLocalError; } - const AlgebraicSymMatrix22* covMatrix() const { return &theCovMatrix; } + const LocalPoint localPosition() const { return thePosition; } + const LocalVector localDirection() const { return theDirection; } + const LocalError localDirectionError() const { return theLocalError; } + const AlgebraicSymMatrix22 covMatrix() const { return theCovMatrix; } float chi2() const { return theChi2; } int dimension() const { return theDimension; } @@ -33,6 +31,6 @@ class VectorHit2D { AlgebraicSymMatrix22 theCovMatrix; LocalError theLocalError; float theChi2; - int theDimension; + static constexpr int theDimension = 2; }; #endif diff --git a/DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc b/DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc index 672b3aeb55e6d..35aca8a3339c8 100644 --- a/DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc +++ b/DataFormats/TrackerRecHit2D/src/BaseTrackerRecHit.cc @@ -27,8 +27,8 @@ void BaseTrackerRecHit::check() const { #endif bool BaseTrackerRecHit::hasPositionAndError() const { - //if det is present pose&err are available as well. - // //if det() is not present (null) the hit ihas been read from file and not updated + //if det is present pos&err are available as well. + // //if det() is not present (null) the hit has been read from file and not updated return det(); } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index de77a333393b1..cab98d2f00909 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -2,23 +2,10 @@ #include "Geometry/CommonDetUnit/interface/StackGeomDet.h" #include "CLHEP/Units/PhysicalConstants.h" -VectorHit::VectorHit(const VectorHit& vh) - : BaseTrackerRecHit(*vh.det(), trackerHitRTTI::vector), - thePosition(vh.localPosition()), - theDirection(vh.localDirection()), - theCovMatrix(vh.parametersErrorPlain()), - theChi2(vh.chi2()), - theDimension(vh.dimension()), - theLowerCluster(vh.lowerClusterRef()), - theUpperCluster(vh.upperClusterRef()), - theCurvature(vh.curvature()), - theCurvatureError(vh.curvatureError()), - thePhi(vh.phi()) {} - VectorHit::VectorHit(const GeomDet& idet, const LocalPoint& posLower, const LocalVector& dir, - const std::array<std::array<float, 4>, 4> covMatrix, + const AlgebraicSymMatrix44 covMatrix, const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper, @@ -30,7 +17,6 @@ VectorHit::VectorHit(const GeomDet& idet, theDirection(dir), theCovMatrix(covMatrix), theChi2(chi2), - theDimension(4), theLowerCluster(lower), theUpperCluster(upper), theCurvature(curvature), @@ -46,27 +32,23 @@ VectorHit::VectorHit(const GeomDet& idet, const float curvatureError, const float phi) : BaseTrackerRecHit(idet, trackerHitRTTI::vector), - theDimension(vh2Dzx.dimension() + vh2Dzy.dimension()), + thePosition(LocalPoint(vh2Dzx.localPosition().x(), vh2Dzy.localPosition().x(), 0.)), + theDirection(LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), 1.)), theLowerCluster(lower), theUpperCluster(upper), theCurvature(curvature), theCurvatureError(curvatureError), thePhi(phi) { - thePosition = LocalPoint(vh2Dzx.localPosition()->x(), vh2Dzy.localPosition()->x(), 0.); +// thePosition = LocalPoint(vh2Dzx.localPosition().x(), vh2Dzy.localPosition().x(), 0.); - theDirection = LocalVector(vh2Dzx.localDirection()->x(), vh2Dzy.localDirection()->x(), 1.); +// theDirection = LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), 1.); //building the cov matrix 4x4 starting from the 2x2 - const AlgebraicSymMatrix22 covMatZX = *vh2Dzx.covMatrix(); - const AlgebraicSymMatrix22 covMatZY = *vh2Dzy.covMatrix(); + const AlgebraicSymMatrix22 covMatZX = vh2Dzx.covMatrix(); + const AlgebraicSymMatrix22 covMatZY = vh2Dzy.covMatrix(); - for (int i = 0; i < nComponents; i++) { - for (int j = 0; j < nComponents; j++) { - theCovMatrix[i][j] = 0.; - } - } + theCovMatrix = AlgebraicSymMatrix44(); - //theCovMatrix = AlgebraicSymMatrix(nComponents); theCovMatrix[0][0] = covMatZX[0][0]; // var(dx/dz) theCovMatrix[1][1] = covMatZY[0][0]; // var(dy/dz) theCovMatrix[2][2] = covMatZX[1][1]; // var(x) @@ -86,7 +68,7 @@ bool VectorHit::sharesInput(const TrackingRecHit* other, SharedInputType what) c if (trackerHitRTTI::isVector(*other)) { const VectorHit* otherVh = static_cast<const VectorHit*>(other); - return sharesClusters(*this, *otherVh, what); + return sharesClusters(*otherVh, what); } if (what == all) @@ -97,59 +79,41 @@ bool VectorHit::sharesInput(const TrackingRecHit* other, SharedInputType what) c return (otherClus == lowerClusterRef()) || (otherClus == upperClusterRef()); } -bool VectorHit::sharesClusters(VectorHit const& h1, VectorHit const& h2, SharedInputType what) const { - bool lower = h1.lowerClusterRef() == h2.lowerClusterRef(); - bool upper = h1.upperClusterRef() == h2.upperClusterRef(); +bool VectorHit::sharesClusters(VectorHit const& other, SharedInputType what) const { + bool lower = this->lowerClusterRef() == other.lowerClusterRef(); + bool upper = this->upperClusterRef() == other.upperClusterRef(); return (what == TrackingRecHit::all) ? (lower && upper) : (upper || lower); } void VectorHit::getKfComponents4D(KfComponentsHolder& holder) const { - AlgebraicVector4& pars = holder.params<nComponents>(); + AlgebraicVector4& pars = holder.params<theDimension>(); pars[0] = theDirection.x(); pars[1] = theDirection.y(); pars[2] = thePosition.x(); pars[3] = thePosition.y(); - AlgebraicSymMatrix44& errs = holder.errors<nComponents>(); - for (int i = 0; i < nComponents; i++) { - for (int j = 0; j < nComponents; j++) { - errs(i, j) = theCovMatrix[i][j]; - } - } + holder.errors<theDimension>() = theCovMatrix; - ProjectMatrix<double, 5, nComponents>& pf = holder.projFunc<nComponents>(); + ProjectMatrix<double, 5, theDimension>& pf = holder.projFunc<theDimension>(); pf.index[0] = 1; pf.index[1] = 2; pf.index[2] = 3; - pf.index[3] = 4; - - holder.measuredParams<nComponents>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), nComponents); - holder.measuredErrors<nComponents>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); -} - -VectorHit::~VectorHit() {} - -AlgebraicVector VectorHit::parameters() const { - // (dx/dz,dy/dz,x,y) - AlgebraicVector result(nComponents); + pf.index[3] = 4; - result[0] = theDirection.x(); - result[1] = theDirection.y(); - result[2] = thePosition.x(); - result[3] = thePosition.y(); - return result; + holder.measuredParams<theDimension>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), theDimension); + holder.measuredErrors<theDimension>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); } Global3DPoint VectorHit::lowerGlobalPos() const { - const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(det()); - const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); + const StackGeomDet* stackDet = static_cast<const StackGeomDet*>(det()); + const PixelGeomDetUnit* geomDetLower = static_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); return phase2clusterGlobalPos(geomDetLower, lowerCluster()); } Global3DPoint VectorHit::upperGlobalPos() const { - const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(det()); - const PixelGeomDetUnit* geomDetUpper = dynamic_cast<const PixelGeomDetUnit*>(stackDet->upperDet()); + const StackGeomDet* stackDet = static_cast<const StackGeomDet*>(det()); + const PixelGeomDetUnit* geomDetUpper = static_cast<const PixelGeomDetUnit*>(stackDet->upperDet()); return phase2clusterGlobalPos(geomDetUpper, upperCluster()); } @@ -163,14 +127,14 @@ Global3DPoint VectorHit::phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, } GlobalError VectorHit::lowerGlobalPosErr() const { - const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(det()); - const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); + const StackGeomDet* stackDet = static_cast<const StackGeomDet*>(det()); + const PixelGeomDetUnit* geomDetLower = static_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); return phase2clusterGlobalPosErr(geomDetLower); } GlobalError VectorHit::upperGlobalPosErr() const { - const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(det()); - const PixelGeomDetUnit* geomDetUpper = dynamic_cast<const PixelGeomDetUnit*>(stackDet->upperDet()); + const StackGeomDet* stackDet = static_cast<const StackGeomDet*>(det()); + const PixelGeomDetUnit* geomDetUpper = static_cast<const PixelGeomDetUnit*>(stackDet->upperDet()); return phase2clusterGlobalPosErr(geomDetUpper); } @@ -184,7 +148,7 @@ GlobalError VectorHit::phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet return ge; } -Global3DVector VectorHit::globalDelta() const { +Global3DVector VectorHit::globalDirectionVH() const { Local3DVector theLocalDelta = LocalVector(theDirection.x() * theDirection.z(), theDirection.y() * theDirection.z(), theDirection.z()); Global3DVector g = det()->surface().toGlobal(theLocalDelta); @@ -200,12 +164,6 @@ float VectorHit::transverseMomentum(float magField) const { } // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, using precise value from speed of light float VectorHit::momentum(float magField) const { return transverseMomentum(magField) / (1. * sin(theta())); } -AlgebraicMatrix VectorHit::projectionMatrix() const { - // obsolete (for what tracker is concerned...) interface - static const AlgebraicMatrix the4DProjectionMatrix(nComponents, 5, 0); - return the4DProjectionMatrix; -} - LocalError VectorHit::localPositionError() const { return LocalError(theCovMatrix[2][2], theCovMatrix[2][3], theCovMatrix[3][3]); } @@ -214,17 +172,7 @@ LocalError VectorHit::localDirectionError() const { return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); } -const std::array<std::array<float, 4>, 4> VectorHit::parametersErrorPlain() const { return theCovMatrix; } - -AlgebraicSymMatrix VectorHit::parametersError() const { - AlgebraicSymMatrix result(nComponents); - for (int i = 0; i < nComponents; i++) { - for (int j = 0; j < nComponents; j++) { - result[i][j] = theCovMatrix[i][j]; - } - } - return result; -} +AlgebraicSymMatrix44 VectorHit::covMatrix() const { return theCovMatrix; } std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { os << " VectorHit create in the DetId#: " << vh.geographicalId() << "\n" @@ -239,12 +187,11 @@ std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { /// Access to component RecHits (if any) std::vector<const TrackingRecHit*> VectorHit::recHits() const { - std::vector<const TrackingRecHit*> pointersOfRecHits; - return pointersOfRecHits; + return {}; } /// Non-const access to component RecHits (if any) std::vector<TrackingRecHit*> VectorHit::recHits() { - std::vector<TrackingRecHit*> pointersOfRecHits; - return pointersOfRecHits; + return {}; } + diff --git a/DataFormats/TrackerRecHit2D/src/classes_def.xml b/DataFormats/TrackerRecHit2D/src/classes_def.xml index bce22d6237c56..5de054ebdfa8f 100644 --- a/DataFormats/TrackerRecHit2D/src/classes_def.xml +++ b/DataFormats/TrackerRecHit2D/src/classes_def.xml @@ -189,18 +189,17 @@ <class name="edm::Wrapper< MTDTrackingDetSetVector >"/> <class name="MTDTrackingOwnVector"/> <class name="edm::Wrapper< MTDTrackingOwnVector >"/> - <class name="VectorHit" ClassVersion="8"> - <version ClassVersion="8" checksum="4172043098"/> + <class name="VectorHit" ClassVersion="3"> + <version ClassVersion="3" checksum="1631967306"/> </class> - <class name="VectorHit2D" ClassVersion="5"> - <version ClassVersion="5" checksum="1341481267"/> + <class name="VectorHit2D" ClassVersion="3"> + <version ClassVersion="3" checksum="86550371"/> </class> <class name="edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector> >"/> <class name="edm::Wrapper<edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>,Phase2TrackerCluster1D,edmNew::DetSetVector<Phase2TrackerCluster1D>::FindForDetSetVector> > >"/> <class name="edmNew::DetSetVector<VectorHit> "/> <class name="std::vector<VectorHit> "/> - <class name="edm::RefProd<VectorHitCollectionNew>"/> <class name="edm::Wrapper< edmNew::DetSetVector<VectorHit> >"/> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml index c5630c284bb8a..67dc8d580bb3d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/BuildFile.xml @@ -4,7 +4,6 @@ <use name="FWCore/Framework"/> <use name="FWCore/Utilities"/> <use name="DataFormats/SiPixelDetId"/> -<use name="DataFormats/SiPixelCluster"/> <use name="DataFormats/TrackerRecHit2D"/> <use name="Geometry/CommonDetUnit"/> <use name="Geometry/TrackerGeometryBuilder"/> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 376382eb04853..3333c29804915 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -21,11 +21,11 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { const TrackerTopology* tkTopoProd, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) : VectorHitBuilderAlgorithmBase(conf, tkGeomProd, tkTopoProd, cpeProd){}; - ~VectorHitBuilderAlgorithm() override{}; + ~VectorHitBuilderAlgorithm() override = default; void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - VectorHitCollectionNew& vhAcc, - VectorHitCollectionNew& vhRej, + VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const override; @@ -37,11 +37,11 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { Local3DPoint& posouter, LocalError& errinner, LocalError& errouter) const; - - std::pair<std::pair<float, float>, float> curvatureANDphi(Global3DPoint gPositionLower, - Global3DPoint gPositionUpper, - GlobalError gErrorLower, - GlobalError gErrorUpper) const; + struct CurvatureAndPhi { float curvature; float curvatureError; float phi; }; + CurvatureAndPhi curvatureANDphi(Global3DPoint gPositionLower, + Global3DPoint gPositionUpper, + GlobalError gErrorLower, + GlobalError gErrorUpper) const; std::vector<std::pair<VectorHit, bool>> buildVectorHits( const StackGeomDet* stack, @@ -79,7 +79,6 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { AlgebraicSymMatrix22& covMatrix, double& chi2) const; -private: }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 129163541880d..bd0e331e191ab 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -31,8 +31,8 @@ class VectorHitBuilderAlgorithmBase { //FIXME::ERICA::this should be template, return different collection for different algo used!! virtual void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - VectorHitCollectionNew& vhAcc, - VectorHitCollectionNew& vhRej, + VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const = 0; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index 97f89f85e14e8..35ecdb8ba418e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -21,8 +21,8 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, - VectorHitCollectionNew& outputAcc, - VectorHitCollectionNew& outputRej); + VectorHitCollection& outputAcc, + VectorHitCollection& outputRej); static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); const VectorHitBuilderAlgorithm* algo() const { return stubsBuilder_; }; @@ -45,8 +45,8 @@ VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersAccepted"); produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersRejected"); - produces<VectorHitCollectionNew>(offlinestubsTag_ + "Accepted"); - produces<VectorHitCollectionNew>(offlinestubsTag_ + "Rejected"); + produces<VectorHitCollection>(offlinestubsTag_ + "Accepted"); + produces<VectorHitCollection>(offlinestubsTag_ + "Rejected"); } void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { @@ -61,8 +61,8 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu new edmNew::DetSetVector<Phase2TrackerCluster1D>); std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersRejected( new edmNew::DetSetVector<Phase2TrackerCluster1D>); - std::unique_ptr<VectorHitCollectionNew> outputVHAccepted(new VectorHitCollectionNew()); - std::unique_ptr<VectorHitCollectionNew> outputVHRejected(new VectorHitCollectionNew()); + std::unique_ptr<VectorHitCollection> outputVHAccepted(new VectorHitCollection()); + std::unique_ptr<VectorHitCollection> outputVHRejected(new VectorHitCollection()); stubsBuilder_ = &es.getData(stubsBuilderToken_); // check on the input clusters @@ -91,8 +91,8 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej, - VectorHitCollectionNew& outputAcc, - VectorHitCollectionNew& outputRej) { + VectorHitCollection& outputAcc, + VectorHitCollection& outputRej) { stubsBuilder_->run(clusters, outputAcc, outputRej, clustersAcc, clustersRej); } void VectorHitBuilderEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index b0b2842d7ba28..86757833c3b5c 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -5,8 +5,8 @@ #include "DataFormats/TrackerRecHit2D/interface/VectorHit2D.h" void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - VectorHitCollectionNew& vhAcc, - VectorHitCollectionNew& vhRej, + VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const { LogDebug("VectorHitBuilderAlgorithm") << "Run VectorHitBuilderAlgorithm ... \n"; @@ -315,15 +315,15 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetLower); } - const auto& curvatureAndPhi = curvatureANDphi(gPositionLower, gPositionUpper, gErrorLower, gErrorUpper); + const CurvatureAndPhi curvatureAndPhi = curvatureANDphi(gPositionLower, gPositionUpper, gErrorLower, gErrorUpper); VectorHit vh = VectorHit(*stack, vh2Dzx, vh2Dzy, lowerOmni, upperOmni, - curvatureAndPhi.first.first, - curvatureAndPhi.first.second, - curvatureAndPhi.second); + curvatureAndPhi.curvature, + curvatureAndPhi.curvatureError, + curvatureAndPhi.phi); return vh; } @@ -399,10 +399,12 @@ void VectorHitBuilderAlgorithm::fit(float x[2], dir = LocalVector(slope, 0., slopeZ); } -std::pair<std::pair<float, float>, float> VectorHitBuilderAlgorithm::curvatureANDphi(Global3DPoint gPositionLower, +VectorHitBuilderAlgorithm::CurvatureAndPhi VectorHitBuilderAlgorithm::curvatureANDphi(Global3DPoint gPositionLower, Global3DPoint gPositionUpper, GlobalError gErrorLower, GlobalError gErrorUpper) const { + VectorHitBuilderAlgorithm::CurvatureAndPhi result; + float curvature = -999.; float errorCurvature = -999.; float phi = -999.; @@ -540,8 +542,10 @@ std::pair<std::pair<float, float>, float> VectorHitBuilderAlgorithm::curvatureAN errorCurvature = temp[0] * curvatureJacobian[0] + temp[1] * curvatureJacobian[1] + temp[2] * curvatureJacobian[2] + temp[3] * curvatureJacobian[3]; - } else { - return std::make_pair(std::make_pair(0., 0.), 0.0); - } - return std::make_pair(std::make_pair(curvature, errorCurvature), phi); + } + + result.curvature = curvature; + result.curvatureError = errorCurvature; + result.phi = phi; + return result; } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc index 47d53e0f82dda..18d0f87e7ece4 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc @@ -12,8 +12,8 @@ VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet : cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { srcClu_ = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); - VHacc_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_acc"))); - VHrej_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_rej"))); + VHacc_ = consumes<VectorHitCollection>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_acc"))); + VHrej_ = consumes<VectorHitCollection>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_rej"))); siphase2OTSimLinksToken_ = consumes<edm::DetSetVector<PixelDigiSimLink> >(conf.getParameter<edm::InputTag>("links")); simHitsToken_ = consumes<edm::PSimHitContainer>(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); simTracksToken_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits")); @@ -96,10 +96,10 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev event.getByToken(srcClu_, clusters); // Get the vector hits - edm::Handle<VectorHitCollectionNew> vhsAcc; + edm::Handle<VectorHitCollection> vhsAcc; event.getByToken(VHacc_, vhsAcc); - edm::Handle<VectorHitCollectionNew> vhsRej; + edm::Handle<VectorHitCollection> vhsRej; event.getByToken(VHrej_, vhsRej); // load the cpe via the eventsetup @@ -354,7 +354,7 @@ void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::Ev LogTrace("VectorHitsBuilderValidation") << "local VH direction " << localDirVH << std::endl; VectorHit vh = vhIt; - Global3DVector globalDirVH = vh.globalDelta(); + Global3DVector globalDirVH = vh.globalDirectionVH(); dirVHs.push_back(globalDirVH); LogTrace("VectorHitsBuilderValidation") << "global VH direction " << globalDirVH << std::endl; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h index 3ce33868d1bdd..66ca71f0d46a7 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h @@ -110,8 +110,8 @@ class VectorHitsBuilderValidation : public edm::one::EDAnalyzer<edm::one::Shared unsigned int channel) const; edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; - edm::EDGetTokenT<VectorHitCollectionNew> VHacc_; - edm::EDGetTokenT<VectorHitCollectionNew> VHrej_; + edm::EDGetTokenT<VectorHitCollection> VHacc_; + edm::EDGetTokenT<VectorHitCollection> VHrej_; edm::ESInputTag cpeTag_; const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; diff --git a/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h b/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h index 29f669f731b05..a7cf35cbab0cb 100644 --- a/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h +++ b/RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h @@ -26,8 +26,8 @@ class MeasurementTrackerEvent { const StMeasurementDetSet *strips, const PxMeasurementDetSet *pixels, const Phase2OTMeasurementDetSet *phase2OT, - const VectorHitCollectionNew *phase2OTVectorHits, - const VectorHitCollectionNew *phase2OTVectorHitsRej, + const VectorHitCollection *phase2OTVectorHits, + const VectorHitCollection *phase2OTVectorHitsRej, const std::vector<bool> &stripClustersToSkip, const std::vector<bool> &pixelClustersToSkip, const std::vector<bool> &phase2OTClustersToSkip) @@ -62,8 +62,8 @@ class MeasurementTrackerEvent { const StMeasurementDetSet &stripData() const { return *theStripData; } const PxMeasurementDetSet &pixelData() const { return *thePixelData; } const Phase2OTMeasurementDetSet &phase2OTData() const { return *thePhase2OTData; } - const VectorHitCollectionNew &phase2OTVectorHits() const { return *thePhase2OTVectorHits; } - const VectorHitCollectionNew &phase2OTVectorHitsRej() const { return *thePhase2OTVectorHitsRej; } + const VectorHitCollection &phase2OTVectorHits() const { return *thePhase2OTVectorHits; } + const VectorHitCollection &phase2OTVectorHitsRej() const { return *thePhase2OTVectorHitsRej; } const std::vector<bool> &stripClustersToSkip() const { return theStripClustersToSkip; } const std::vector<bool> &pixelClustersToSkip() const { return thePixelClustersToSkip; } const std::vector<bool> &phase2OTClustersToSkip() const { return thePhase2OTClustersToSkip; } @@ -80,8 +80,8 @@ class MeasurementTrackerEvent { const StMeasurementDetSet *theStripData = nullptr; const PxMeasurementDetSet *thePixelData = nullptr; const Phase2OTMeasurementDetSet *thePhase2OTData = nullptr; - const VectorHitCollectionNew *thePhase2OTVectorHits = nullptr; - const VectorHitCollectionNew *thePhase2OTVectorHitsRej = nullptr; + const VectorHitCollection *thePhase2OTVectorHits = nullptr; + const VectorHitCollection *thePhase2OTVectorHitsRej = nullptr; bool theOwner = false; // do I own the tree above? // these could be const pointers as well, but ContainerMask doesn't expose the vector std::vector<bool> theStripClustersToSkip; diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index 8d9f0343ee003..0b744c7733b3a 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -63,8 +63,8 @@ MeasurementTrackerEventProducer::MeasurementTrackerEventProducer(const edm::Para } if (!(iConfig.getParameter<edm::InputTag>("vectorHits") == edm::InputTag("") || iConfig.getParameter<edm::InputTag>("vectorHitsRej") == edm::InputTag(""))) { - thePh2OTVectorHitsLabel = consumes<VectorHitCollectionNew>(iConfig.getParameter<edm::InputTag>("vectorHits")); - thePh2OTVectorHitsRejLabel = consumes<VectorHitCollectionNew>(iConfig.getParameter<edm::InputTag>("vectorHitsRej")); + thePh2OTVectorHitsLabel = consumes<VectorHitCollection>(iConfig.getParameter<edm::InputTag>("vectorHits")); + thePh2OTVectorHitsRejLabel = consumes<VectorHitCollection>(iConfig.getParameter<edm::InputTag>("vectorHitsRej")); isPhase2_ = true; useVectorHits_ = true; } @@ -125,8 +125,8 @@ void MeasurementTrackerEventProducer::produce(edm::Event& iEvent, const edm::Eve // put into event // - const VectorHitCollectionNew* phase2OTVectorHits = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsLabel) : nullptr; - const VectorHitCollectionNew* phase2OTVectorHitsRej = + const VectorHitCollection* phase2OTVectorHits = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsLabel) : nullptr; + const VectorHitCollection* phase2OTVectorHitsRej = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsRejLabel) : nullptr; iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, stripData.release(), diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h index 02fd476d71092..53ee67905c456 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.h @@ -41,8 +41,8 @@ class dso_hidden MeasurementTrackerEventProducer final : public edm::stream::EDP edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster>> thePixelClusterLabel; edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster>> theStripClusterLabel; edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D>> thePh2OTClusterLabel; - edm::EDGetTokenT<VectorHitCollectionNew> thePh2OTVectorHitsLabel; - edm::EDGetTokenT<VectorHitCollectionNew> thePh2OTVectorHitsRejLabel; + edm::EDGetTokenT<VectorHitCollection> thePh2OTVectorHitsLabel; + edm::EDGetTokenT<VectorHitCollection> thePh2OTVectorHitsRejLabel; edm::EDGetTokenT<edm::ContainerMask<edmNew::DetSetVector<SiPixelCluster>>> thePixelClusterMask; edm::EDGetTokenT<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster>>> theStripClusterMask; diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index f63181ca281af..d9045290f30bb 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -42,12 +42,12 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { static void fillDescriptions(edm::ConfigurationDescriptions&); - TrajectorySeedCollection run(edm::Handle<VectorHitCollectionNew>); + TrajectorySeedCollection run(edm::Handle<VectorHitCollection>); unsigned int checkLayer(unsigned int iidd); std::vector<VectorHit> collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); void printVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); const TrajectoryStateOnSurface buildInitialTSOS(const VectorHit&) const; - AlgebraicSymMatrix assign44To55(AlgebraicSymMatrix) const; + AlgebraicSymMatrix55 assign44To55(AlgebraicSymMatrix44) const; std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator&, const TrackingRecHit& hit) const; @@ -70,7 +70,7 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { }; private: - edm::EDGetTokenT<VectorHitCollectionNew> vhProducerToken_; + edm::EDGetTokenT<VectorHitCollection> vhProducerToken_; const TrackerTopology* tkTopo_; const MeasurementTracker* measurementTracker_; std::unique_ptr<LayerMeasurements> layerMeasurements_; @@ -100,7 +100,7 @@ SeedingOTEDProducer::SeedingOTEDProducer(edm::ParameterSet const& conf) updatorToken_(esConsumes(edm::ESInputTag("", "KFUpdator"))), measurementTrackerToken_(esConsumes()), estToken_(esConsumes(edm::ESInputTag("", "Chi2"))) { - vhProducerToken_ = consumes<VectorHitCollectionNew>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); + vhProducerToken_ = consumes<VectorHitCollection>(edm::InputTag(conf.getParameter<edm::InputTag>("src"))); beamSpotToken_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel")); updatorName_ = conf.getParameter<std::string>("updator"); putToken_ = produces<TrajectorySeedCollection>(); @@ -143,13 +143,13 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) } // Get the vector hits - edm::Handle<VectorHitCollectionNew> vhs; + edm::Handle<VectorHitCollection> vhs; event.getByToken(vhProducerToken_, vhs); event.emplace(putToken_, run(vhs)); } -TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectionNew> VHs) { +TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollection> VHs) { TrajectorySeedCollection result; //check if all the first three layers have VHs std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(*VHs.product(), 1); @@ -313,24 +313,24 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto float signPz = copysign(1.0, vHit.globalPosition().z()); LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); - AlgebraicSymMatrix mat = assign44To55(vHit.parametersError()); + AlgebraicSymMatrix55 mat = assign44To55(vHit.covMatrix()); // set the error on 1/p mat[0][0] = pow(computeInverseMomentumError( vHit, theta, beamSpot_->sigmaZ(), vHit.transverseMomentum(magField_->inTesla(center).z())), 2); //building tsos - LocalTrajectoryError lterr(asSMatrix<5>(mat)); + LocalTrajectoryError lterr(mat); const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit.det()->surface(), magField_); return tsos; } -AlgebraicSymMatrix SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix mat44) const { - if (mat44.num_row() != 4 || mat44.num_col() != 4) - assert("Wrong dimension! This should be a 4x4 matrix!"); +AlgebraicSymMatrix55 SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix44 mat44) const { +// if (mat44.num_row() != 4 || mat44.num_col() != 4) +// assert("Wrong dimension! This should be a 4x4 matrix!"); - AlgebraicSymMatrix result(5, 0); + AlgebraicSymMatrix55 result; for (int i = 1; i < 5; i++) { for (int j = 1; j < 5; j++) { result[i][j] = mat44[i - 1][j - 1]; diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc index f93d4eedc55e7..65aac0eaa406e 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc @@ -239,7 +239,7 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder if (hasVectorHits) { LogError("HitExtractorSTRP") << "TIB is not supposed to be in Phase2 TRK detector configuration. What follows " "have never been checked before! "; - edm::Handle<VectorHitCollectionNew> vectorHits; + edm::Handle<VectorHitCollection> vectorHits; ev.getByToken(theVectorHits, vectorHits); if (skipClusters) cleanFrom = result.size(); @@ -314,7 +314,7 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder } if (hasVectorHits) { LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer; - edm::Handle<VectorHitCollectionNew> vectorHits; + edm::Handle<VectorHitCollection> vectorHits; ev.getByToken(theVectorHits, vectorHits); //FIXME: check the skipClusters with VHits if (skipClusters) @@ -390,7 +390,7 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder } if (hasVectorHits) { LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer; - edm::Handle<VectorHitCollectionNew> vectorHits; + edm::Handle<VectorHitCollection> vectorHits; ev.getByToken(theVectorHits, vectorHits); //FIXME: check the skipClusters with VHits if (skipClusters) @@ -467,7 +467,7 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder if (hasVectorHits) { LogError("HitExtractorSTRP") << "TEC is not supposed to be in Phase2 TRK detector configuration. What follows " "have never been checked before! "; - edm::Handle<VectorHitCollectionNew> vectorHits; + edm::Handle<VectorHitCollection> vectorHits; ev.getByToken(theVectorHits, vectorHits); if (skipClusters) cleanFrom = result.size(); diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h index 7d6852c30c53d..e92b2e3646fac 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.h @@ -48,7 +48,7 @@ namespace ctfseeding { void useVectorHits(const edm::InputTag& m, edm::ConsumesCollector& iC) { hasVectorHits = true; - theVectorHits = iC.consumes<VectorHitCollectionNew>(m); + theVectorHits = iC.consumes<VectorHitCollection>(m); } void useRingSelector(int minRing, int maxRing); void useSimpleRphiHitsCleaner(bool use) { hasSimpleRphiHitsCleaner = use; } @@ -92,7 +92,7 @@ namespace ctfseeding { edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> theMatchedHits; edm::EDGetTokenT<SiStripRecHit2DCollection> theRPhiHits; edm::EDGetTokenT<SiStripRecHit2DCollection> theStereoHits; - edm::EDGetTokenT<VectorHitCollectionNew> theVectorHits; + edm::EDGetTokenT<VectorHitCollection> theVectorHits; bool hasMatchedHits; bool hasRPhiHits; bool hasStereoHits; From 946eb905f7d036217cc6437eb23a534ab2d18240 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Fri, 9 Oct 2020 22:58:51 +0200 Subject: [PATCH 473/778] intermediate commit of Slava's comments --- .../interface/VectorHitBuilderAlgorithmBase.h | 13 ++--- .../plugins/VectorHitBuilderEDProducer.cc | 47 +++++++++---------- .../src/VectorHitBuilderAlgorithm.cc | 45 +++++++++--------- .../src/VectorHitBuilderAlgorithmBase.cc | 22 ++++----- .../test/VHs_combinatorialStudies_PU200.py | 4 +- .../test/VHs_productionAndTesting.py | 4 +- .../python/PixelLessStep_cff.py | 4 +- .../MeasurementTrackerEventProducer_cfi.py | 4 +- .../plugins/SeedingOTEDProducer.cc | 2 +- 9 files changed, 72 insertions(+), 73 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index bd0e331e191ab..8876fd85d95bc 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -58,12 +58,13 @@ class VectorHitBuilderAlgorithmBase { void loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit>>& theMap, edmNew::DetSetVector<VectorHit>& theCollection) const; - const TrackerGeometry* theTkGeom; - const TrackerTopology* theTkTopo; - const ClusterParameterEstimator<Phase2TrackerCluster1D>* theCpe; - unsigned int nMaxVHforeachStack; - std::vector<double> barrelCut; - std::vector<double> endcapCut; + const TrackerGeometry* tkGeom_; + const TrackerTopology* tkTopo_; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; + unsigned int nMaxVHforeachStack_; + std::vector<double> barrelCut_; + std::vector<double> endcapCut_; + private: edm::ESInputTag cpeTag_; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index 35ecdb8ba418e..59a065f834c8e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -10,13 +10,13 @@ #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" #include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" -#include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h> -#include <FWCore/ParameterSet/interface/ParameterSetDescription.h> +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { public: explicit VectorHitBuilderEDProducer(const edm::ParameterSet&); - ~VectorHitBuilderEDProducer() override; + ~VectorHitBuilderEDProducer() override = default; void produce(edm::Event&, const edm::EventSetup&) override; void run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, @@ -24,7 +24,7 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { VectorHitCollection& outputAcc, VectorHitCollection& outputRej); static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - const VectorHitBuilderAlgorithm* algo() const { return stubsBuilder_; }; + const VectorHitBuilderAlgorithm* algo() const { return stubsBuilder_; } private: const VectorHitBuilderAlgorithm* stubsBuilder_; @@ -34,8 +34,6 @@ class VectorHitBuilderEDProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusterProducer_; }; -VectorHitBuilderEDProducer::~VectorHitBuilderEDProducer() {} - VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& conf) : offlinestubsTag_(conf.getParameter<std::string>("offlinestubs")), maxOfflinestubs_(conf.getParameter<int>("maxVectorHits")), @@ -43,24 +41,20 @@ VectorHitBuilderEDProducer::VectorHitBuilderEDProducer(edm::ParameterSet const& clusterProducer_ = consumes<edmNew::DetSetVector<Phase2TrackerCluster1D>>(edm::InputTag(conf.getParameter<std::string>("Clusters"))); - produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersAccepted"); - produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("ClustersRejected"); - produces<VectorHitCollection>(offlinestubsTag_ + "Accepted"); - produces<VectorHitCollection>(offlinestubsTag_ + "Rejected"); + produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("accepted"); + produces<edmNew::DetSetVector<Phase2TrackerCluster1D>>("rejected"); + produces<VectorHitCollection>("accepted"); + produces<VectorHitCollection>("rejected"); } void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetup& es) { LogDebug("VectorHitBuilderEDProducer") << "VectorHitBuilderEDProducer::produce() begin"; // get input clusters data - edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clustersHandle; - event.getByToken(clusterProducer_, clustersHandle); - + auto clustersHandle = event.getHandle(clusterProducer_); // create the final output collection - std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersAccepted( - new edmNew::DetSetVector<Phase2TrackerCluster1D>); - std::unique_ptr<edmNew::DetSetVector<Phase2TrackerCluster1D>> outputClustersRejected( - new edmNew::DetSetVector<Phase2TrackerCluster1D>); + auto outputClustersAccepted = std::make_unique<edmNew::DetSetVector<Phase2TrackerCluster1D> >(); + auto outputClustersRejected = std::make_unique<edmNew::DetSetVector<Phase2TrackerCluster1D> >(); std::unique_ptr<VectorHitCollection> outputVHAccepted(new VectorHitCollection()); std::unique_ptr<VectorHitCollection> outputVHRejected(new VectorHitCollection()); @@ -71,21 +65,22 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu // running the stub building algorithm //ERICA::output should be moved in the different algo classes? run(clustersHandle, *outputClustersAccepted, *outputClustersRejected, *outputVHAccepted, *outputVHRejected); - +#ifdef EDM_ML_DEBUG unsigned int numberOfVectorHits = 0; - for (const auto& DSViter : *outputVHAccepted) { - for (const auto& vh : DSViter) { + for (const auto& dSViter : *outputVHAccepted) { + for (const auto& vh : dSViter) { numberOfVectorHits++; - LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << vh << std::endl; + LogDebug("VectorHitBuilderEDProducer") << "\t vectorhit in output " << vh; } } + LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n"; +#endif //EDM_ML_DEBUG // write output to file - event.put(std::move(outputClustersAccepted), "ClustersAccepted"); - event.put(std::move(outputClustersRejected), "ClustersRejected"); - event.put(std::move(outputVHAccepted), offlinestubsTag_ + "Accepted"); - event.put(std::move(outputVHRejected), offlinestubsTag_ + "Rejected"); + event.put(std::move(outputClustersAccepted), "accepted"); + event.put(std::move(outputClustersRejected), "rejected"); + event.put(std::move(outputVHAccepted), "accepted"); + event.put(std::move(outputVHRejected), "rejected"); - LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n"; } void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 86757833c3b5c..f34773a4e9fa2 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -10,23 +10,23 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const { LogDebug("VectorHitBuilderAlgorithm") << "Run VectorHitBuilderAlgorithm ... \n"; - const edmNew::DetSetVector<Phase2TrackerCluster1D>* ClustersPhase2Collection = clusters.product(); + const auto* clustersPhase2Collection = clusters.product(); std::unordered_map<DetId, std::vector<VectorHit>> tempVHAcc, tempVHRej; //loop over the DetSetVector - LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << ClustersPhase2Collection->size() << std::endl; - for (auto DSViter : *ClustersPhase2Collection) { - unsigned int rawDetId1(DSViter.detId()); + LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << clustersPhase2Collection->size() << std::endl; + for (auto dSViter : *clustersPhase2Collection) { + unsigned int rawDetId1(dSViter.detId()); DetId detId1(rawDetId1); DetId lowerDetId, upperDetId; - if (theTkTopo->isLower(detId1)) { + if (tkTopo_->isLower(detId1)) { lowerDetId = detId1; - upperDetId = theTkTopo->partnerDetId(detId1); - } else if (theTkTopo->isUpper(detId1)) { + upperDetId = tkTopo_->partnerDetId(detId1); + } else continue; - } - DetId detIdStack = theTkTopo->stack(detId1); + + DetId detIdStack = tkTopo_->stack(detId1); //debug LogDebug("VectorHitBuilderAlgorithm") << " DetId stack : " << detIdStack.rawId() << std::endl; @@ -35,15 +35,18 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track const GeomDet* gd; const StackGeomDet* stackDet; - const auto& it_detLower = ClustersPhase2Collection->find(lowerDetId); - const auto& it_detUpper = ClustersPhase2Collection->find(upperDetId); + //const auto& it_detLower = clustersPhase2Collection->find(lowerDetId); + const auto& it_detLower = dSViter; + const auto& it_detUpper = clustersPhase2Collection->find(upperDetId); - if (it_detLower != ClustersPhase2Collection->end() && it_detUpper != ClustersPhase2Collection->end()) { - gd = theTkGeom->idToDet(detIdStack); + //if (it_detLower != clustersPhase2Collection->end() && it_detUpper != clustersPhase2Collection->end()) { + if (it_detUpper != clustersPhase2Collection->end()) { + gd = tkGeom_->idToDet(detIdStack); stackDet = dynamic_cast<const StackGeomDet*>(gd); std::vector<VectorHit> vhsInStack_Acc; std::vector<VectorHit> vhsInStack_Rej; - const auto& vhsInStack_AccRej = buildVectorHits(stackDet, clusters, *it_detLower, *it_detUpper); + //const auto& vhsInStack_AccRej = buildVectorHits(stackDet, clusters, *it_detLower, *it_detUpper); + const auto& vhsInStack_AccRej = buildVectorHits(stackDet, clusters, it_detLower, *it_detUpper); //storing accepted and rejected VHs for (const auto& vh : vhsInStack_AccRej) { @@ -134,7 +137,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo(clusters, ciu); const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); localGDUUpper.push_back(gduUpp); - localParamsUpper.push_back(theCpe->localParameters(*clusterUpper, *gduUpp)); + localParamsUpper.push_back(cpe_->localParameters(*clusterUpper, *gduUpp)); } int upperIterator = 0; for (const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++cil) { @@ -144,7 +147,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi printCluster(stack->lowerDet(), &*cluL); #endif const PixelGeomDetUnit* gduLow = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); - auto&& lparamsLow = theCpe->localParameters(*cluL, *gduLow); + auto&& lparamsLow = cpe_->localParameters(*cluL, *gduLow); upperIterator = 0; for (const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ciu) { LogDebug("VectorHitBuilderAlgorithm") << "\t upper clusters " << std::endl; @@ -194,7 +197,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi double width = lpos_low_corr - lpos_upp_corr; LogDebug("VectorHitBuilderAlgorithm") << " \t width: " << width << std::endl; - unsigned int layerStack = theTkTopo->layer(stack->geographicalId()); + unsigned int layerStack = tkTopo_->layer(stack->geographicalId()); if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) LogDebug("VectorHitBuilderAlgorithm") << " \t is barrel. " << std::endl; if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) @@ -203,9 +206,9 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi float cut = 0.0; if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) - cut = barrelCut.at(layerStack); + cut = barrelCut_.at(layerStack); if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) - cut = endcapCut.at(layerStack); + cut = endcapCut_.at(layerStack); LogDebug("VectorHitBuilderAlgorithm") << " \t the cut is:" << cut << std::endl; //old cut: indipendent from layer @@ -243,11 +246,11 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, const PixelGeomDetUnit* geomDetLower = static_cast<const PixelGeomDetUnit*>(stack->lowerDet()); const PixelGeomDetUnit* geomDetUpper = static_cast<const PixelGeomDetUnit*>(stack->upperDet()); - auto&& lparamsLower = theCpe->localParameters(*lower, *geomDetLower); // x, y, z, e2_xx, e2_xy, e2_yy + auto&& lparamsLower = cpe_->localParameters(*lower, *geomDetLower); // x, y, z, e2_xx, e2_xy, e2_yy Global3DPoint gparamsLower = geomDetLower->surface().toGlobal(lparamsLower.first); LogTrace("VectorHitBuilderAlgorithm") << "\t lower global pos: " << gparamsLower; - auto&& lparamsUpper = theCpe->localParameters(*upper, *geomDetUpper); + auto&& lparamsUpper = cpe_->localParameters(*upper, *geomDetUpper); Global3DPoint gparamsUpper = geomDetUpper->surface().toGlobal(lparamsUpper.first); LogTrace("VectorHitBuilderAlgorithm") << "\t upper global pos: " << gparamsUpper; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 5b78682bcde01..f91cdede22a6e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -12,12 +12,12 @@ VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase( const TrackerGeometry* tkGeomProd, const TrackerTopology* tkTopoProd, const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpeProd) - : theTkGeom(tkGeomProd), - theTkTopo(tkTopoProd), - theCpe(cpeProd), - nMaxVHforeachStack(conf.getParameter<int>("maxVectorHitsInAStack")), - barrelCut(conf.getParameter<std::vector<double> >("BarrelCut")), - endcapCut(conf.getParameter<std::vector<double> >("EndcapCut")), + : tkGeom_(tkGeomProd), + tkTopo_(tkTopoProd), + cpe_(cpeProd), + nMaxVHforeachStack_(conf.getParameter<int>("maxVectorHitsInAStack")), + barrelCut_(conf.getParameter<std::vector<double> >("BarrelCut")), + endcapCut_(conf.getParameter<std::vector<double> >("EndcapCut")), cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) {} double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit*& geomDetUnit_low, @@ -53,7 +53,7 @@ void VectorHitBuilderAlgorithmBase::printClusters(const edmNew::DetSetVector<Pha for (const auto& clustIt : DSViter) { nCluster++; // get the detector unit's id - const GeomDetUnit* geomDetUnit(theTkGeom->idToDetUnit(DSViter.detId())); + const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(DSViter.detId())); if (!geomDetUnit) return; printCluster(geomDetUnit, &clustIt); @@ -71,11 +71,11 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, if (!pixelGeomDetUnit) return; - unsigned int layer = theTkTopo->layer(geomDetUnit->geographicalId()); - unsigned int module = theTkTopo->module(geomDetUnit->geographicalId()); + unsigned int layer = tkTopo_->layer(geomDetUnit->geographicalId()); + unsigned int module = tkTopo_->module(geomDetUnit->geographicalId()); LogTrace("VectorHitBuilder") << "Layer:" << layer << " and DetId: " << geomDetUnit->geographicalId().rawId() << std::endl; - TrackerGeometry::ModuleType mType = theTkGeom->getDetectorType(geomDetUnit->geographicalId()); + TrackerGeometry::ModuleType mType = tkGeom_->getDetectorType(geomDetUnit->geographicalId()); if (mType == TrackerGeometry::ModuleType::Ph2PSP) LogTrace("VectorHitBuilder") << "Pixel cluster (module:" << module << ") " << std::endl; else if (mType == TrackerGeometry::ModuleType::Ph2SS || mType == TrackerGeometry::ModuleType::Ph2PSS) @@ -86,7 +86,7 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, LogTrace("VectorHitBuilder") << " and width:" << pixelGeomDetUnit->surface().bounds().width() << " , lenght:" << pixelGeomDetUnit->surface().bounds().length() << std::endl; - auto&& lparams = theCpe->localParameters(*clustIt, *pixelGeomDetUnit); + auto&& lparams = cpe_->localParameters(*clustIt, *pixelGeomDetUnit); Global3DPoint gparams = pixelGeomDetUnit->surface().toGlobal(lparams.first); LogTrace("VectorHitBuilder") << "\t global pos " << gparams << std::endl; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py index 88e0af4c221fa..4a6c601fa2ecd 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_combinatorialStudies_PU200.py @@ -88,8 +88,8 @@ # Analyzer process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', src = cms.string("siPhase2Clusters"), - VH_acc = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), - VH_rej = cms.InputTag("siPhase2VectorHits", "vectorHitsRejected"), + VH_acc = cms.InputTag("siPhase2VectorHits", "accepted"), + VH_rej = cms.InputTag("siPhase2VectorHits", "rejected"), CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"), links = cms.InputTag("simSiPixelDigis", "Tracker"), trackingParticleSrc = cms.InputTag('mix', 'MergedTrackTruth'), diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py index 10d7b0fdc9191..cbb75e27d744a 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_productionAndTesting.py @@ -87,8 +87,8 @@ # Analyzer process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', src = cms.string("siPhase2Clusters"), - VH_acc = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), - VH_rej = cms.InputTag("siPhase2VectorHits", "vectorHitsRejected"), + VH_acc = cms.InputTag("siPhase2VectorHits", "accepted"), + VH_rej = cms.InputTag("siPhase2VectorHits", "rejected"), CPE = cms.ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE"), links = cms.InputTag("simSiPixelDigis", "Tracker"), trackingParticleSrc = cms.InputTag('mix', 'MergedTrackTruth'), diff --git a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py index de2e3fb74a343..c9d5cd19de4d8 100644 --- a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py @@ -114,14 +114,14 @@ TOB = cms.PSet( TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutNone')), - vectorRecHits = cms.InputTag("siPhase2VectorHits", 'vectorHitsAccepted'), + vectorRecHits = cms.InputTag("siPhase2VectorHits", 'accepted'), skipClusters = cms.InputTag('pixelLessStepClusters') ), TIB = None, TID = cms.PSet( TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutNone')), - vectorRecHits = cms.InputTag("siPhase2VectorHits", 'vectorHitsAccepted'), + vectorRecHits = cms.InputTag("siPhase2VectorHits", 'accepted'), skipClusters = cms.InputTag('pixelLessStepClusters'), useRingSlector = cms.bool(True), minRing = cms.int32(1), diff --git a/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py b/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py index 1cc806bac523f..9f7c08126f3b6 100644 --- a/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py +++ b/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py @@ -25,8 +25,8 @@ ) from Configuration.ProcessModifiers.vectorHits_cff import vectorHits vectorHits.toModify(MeasurementTrackerEvent, - vectorHits = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), - vectorHitsRej = cms.InputTag("siPhase2VectorHits", "vectorHitsRejected"), + vectorHits = cms.InputTag("siPhase2VectorHits", "accepted"), + vectorHitsRej = cms.InputTag("siPhase2VectorHits", "rejected"), ) MeasurementTrackerEventPreSplitting = MeasurementTrackerEvent.clone( diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index d9045290f30bb..cf55cd98cf4c4 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -110,7 +110,7 @@ SeedingOTEDProducer::~SeedingOTEDProducer() {} void SeedingOTEDProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.add<edm::InputTag>("src", edm::InputTag("siPhase2VectorHits", "vectorHitsAccepted")); + desc.add<edm::InputTag>("src", edm::InputTag("siPhase2VectorHits", "accepted")); desc.add<edm::InputTag>("trackerEvent", edm::InputTag("MeasurementTrackerEvent")); desc.add<edm::InputTag>("beamSpotLabel", edm::InputTag("offlineBeamSpot")); desc.add<std::string>("updator", std::string("KFUpdator")); From 00365327110ef047107558ee7b5b59476ba01a9a Mon Sep 17 00:00:00 2001 From: Slava Krutelyov <slava77@gmail.com> Date: Fri, 9 Oct 2020 15:06:51 -0700 Subject: [PATCH 474/778] static const -> const for thread safety --- RecoMET/METPUSubtraction/plugins/DeepMETProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoMET/METPUSubtraction/plugins/DeepMETProducer.cc b/RecoMET/METPUSubtraction/plugins/DeepMETProducer.cc index a5aed8ab2a4f4..fd5930b49d289 100644 --- a/RecoMET/METPUSubtraction/plugins/DeepMETProducer.cc +++ b/RecoMET/METPUSubtraction/plugins/DeepMETProducer.cc @@ -69,7 +69,7 @@ DeepMETProducer::DeepMETProducer(const edm::ParameterSet& cfg, const DeepMETCach void DeepMETProducer::produce(edm::Event& event, const edm::EventSetup& setup) { auto const& pfs = event.get(pf_token_); - static const tensorflow::NamedTensorList input_list = { + const tensorflow::NamedTensorList input_list = { {"input", input_}, {"input_cat0", input_cat0_}, {"input_cat1", input_cat1_}, {"input_cat2", input_cat2_}}; // Set all inputs to zero From 359a1bc658ee31989cf3b7b460f3ecc213982f1b Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 01:12:29 +0200 Subject: [PATCH 475/778] more comments from Slava --- .../src/VectorHitBuilderAlgorithm.cc | 4 - .../src/VectorHitBuilderAlgorithmBase.cc | 1 + .../test/BuildFile.xml | 2 +- .../VHs_SeedingOT_productionAndTesting.py | 9 +- .../test/VectorHitsValidation.cc | 1137 ----------------- .../test/VectorHitsValidation.h | 148 --- .../src/SeedClusterRemoverPhase2.cc | 4 - .../plugins/DuplicateTrackMerger.cc | 10 - .../python/earlyGeneralTracks_cfi.py | 32 +- .../python/HighPtTripletStep_cff.py | 51 +- .../python/LowPtTripletStep_cff.py | 48 +- .../python/PixelLessStep_cff.py | 17 +- .../python/PixelPairStep_cff.py | 46 +- 13 files changed, 22 insertions(+), 1487 deletions(-) delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc delete mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index f34773a4e9fa2..b8ff6c4d5cacf 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -35,17 +35,14 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track const GeomDet* gd; const StackGeomDet* stackDet; - //const auto& it_detLower = clustersPhase2Collection->find(lowerDetId); const auto& it_detLower = dSViter; const auto& it_detUpper = clustersPhase2Collection->find(upperDetId); - //if (it_detLower != clustersPhase2Collection->end() && it_detUpper != clustersPhase2Collection->end()) { if (it_detUpper != clustersPhase2Collection->end()) { gd = tkGeom_->idToDet(detIdStack); stackDet = dynamic_cast<const StackGeomDet*>(gd); std::vector<VectorHit> vhsInStack_Acc; std::vector<VectorHit> vhsInStack_Rej; - //const auto& vhsInStack_AccRej = buildVectorHits(stackDet, clusters, *it_detLower, *it_detUpper); const auto& vhsInStack_AccRej = buildVectorHits(stackDet, clusters, it_detLower, *it_detUpper); //storing accepted and rejected VHs @@ -83,7 +80,6 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track loadDetSetVector(tempVHRej, vhRej); LogDebug("VectorHitBuilderAlgorithm") << "End run VectorHitBuilderAlgorithm ... \n"; - return; } bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding( diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index f91cdede22a6e..cf24417c3741e 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -100,6 +100,7 @@ void VectorHitBuilderAlgorithmBase::loadDetSetVector(std::unordered_map<DetId, s edmNew::DetSetVector<VectorHit>& theCollection) const { for (const auto& it : theMap) { edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it.first); + //vh_col.reserve(it.second.size()); for (const auto& vh_it : it.second) vh_col.push_back(vh_it); } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml index 104d876b608e1..847e241c1ee43 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/BuildFile.xml @@ -22,7 +22,7 @@ <use name="DataFormats/ParticleFlowCandidate"/> <use name="DataFormats/ParticleFlowReco"/> <use name="RecoLocalTracker/SiPhase2VectorHitBuilder"/> -<library file="VectorHitsValidation.cc" name="VectorHitsBuilderValidation"> +<library file="VectorHitsBuilderValidation.cc" name="VectorHitsBuilderValidation"> <flags EDM_PLUGIN="1"/> </library> <library file="ClustersValidationTGraph.cc" name="ClustersValidationTGraph"> diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py index 714dbb67c9ddc..ac5fdd513eb95 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VHs_SeedingOT_productionAndTesting.py @@ -70,11 +70,8 @@ ) # Analyzer -process.analysis = cms.EDAnalyzer('VectorHitsBuilderValidation', - src = cms.string("siPhase2Clusters"), - VH_acc = cms.InputTag("siPhase2VectorHits", "vectorHitsAccepted"), - links = cms.InputTag("simSiPixelDigis", "Tracker") -) +process.load('RecoLocalTracker.SiPhase2VectorHitBuilder.vectorHitsBuilderValidation_cfi') + process.TFileService = cms.Service('TFileService', fileName = cms.string('file:vh_validation_tilted.root') ) @@ -111,7 +108,7 @@ process.L1Reco_step = cms.Path(process.L1Reco) process.trackerlocalreco_step = cms.Path(process.trackerlocalreco+process.siPixelClusters+process.siPhase2VectorHits) process.seedingOT_step = cms.Path(process.MeasurementTrackerEvent+process.offlineBeamSpot+process.phase2SeedingOTEDProducer) -process.analysis_step = cms.Path(process.analysis) +process.analysis_step = cms.Path(process.vectorHitsBuilderValidation) process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) # Schedule definition diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc deleted file mode 100644 index 18d0f87e7ece4..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.cc +++ /dev/null @@ -1,1137 +0,0 @@ -#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" -#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h" -#include "SimTracker/TrackerHitAssociation/interface/ClusterTPAssociation.h" -#include "RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h" -#include "Geometry/CommonDetUnit/interface/StackGeomDet.h" -#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" -#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" -#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" - -VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet& conf) - : cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { - srcClu_ = - consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); - VHacc_ = consumes<VectorHitCollection>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_acc"))); - VHrej_ = consumes<VectorHitCollection>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_rej"))); - siphase2OTSimLinksToken_ = consumes<edm::DetSetVector<PixelDigiSimLink> >(conf.getParameter<edm::InputTag>("links")); - simHitsToken_ = consumes<edm::PSimHitContainer>(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); - simTracksToken_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits")); - simVerticesToken_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits")); - trackingParticleToken_ = - consumes<TrackingParticleCollection>(conf.getParameter<edm::InputTag>("trackingParticleSrc")); -} - -VectorHitsBuilderValidation::~VectorHitsBuilderValidation() {} - -void VectorHitsBuilderValidation::beginJob() { - edm::Service<TFileService> fs; - fs->file().cd("/"); - TFileDirectory td = fs->mkdir("Common"); - - //Create common ntuple - tree_ = td.make<TTree>("VectorHits", "VectorHits"); - - // Create common graphs - TFileDirectory tdGloPos = td.mkdir("GlobalPositions"); - trackerLayoutRZ_[0] = tdGloPos.make<TGraph>(); - trackerLayoutRZ_[0]->SetName("RVsZ_Mixed"); - trackerLayoutRZ_[1] = tdGloPos.make<TGraph>(); - trackerLayoutRZ_[1]->SetName("RVsZ_Pixel"); - trackerLayoutRZ_[2] = tdGloPos.make<TGraph>(); - trackerLayoutRZ_[2]->SetName("RVsZ_Strip"); - trackerLayoutXY_[0] = tdGloPos.make<TGraph>(); - trackerLayoutXY_[0]->SetName("YVsX_Mixed"); - trackerLayoutXY_[1] = tdGloPos.make<TGraph>(); - trackerLayoutXY_[1]->SetName("YVsX_Pixel"); - trackerLayoutXY_[2] = tdGloPos.make<TGraph>(); - trackerLayoutXY_[2]->SetName("YVsX_Strip"); - trackerLayoutXYBar_ = tdGloPos.make<TGraph>(); - trackerLayoutXYBar_->SetName("YVsXBar"); - trackerLayoutXYEC_ = tdGloPos.make<TGraph>(); - trackerLayoutXYEC_->SetName("YVsXEC"); - - TFileDirectory tdLocPos = td.mkdir("LocalPositions"); - localPosXvsDeltaX_[0] = tdLocPos.make<TGraph>(); - localPosXvsDeltaX_[0]->SetName("localPosXvsDeltaX_Mixed"); - localPosXvsDeltaX_[1] = tdLocPos.make<TGraph>(); - localPosXvsDeltaX_[1]->SetName("localPosXvsDeltaX_Pixel"); - localPosXvsDeltaX_[2] = tdLocPos.make<TGraph>(); - localPosXvsDeltaX_[2]->SetName("localPosXvsDeltaX_Strip"); - localPosYvsDeltaY_[0] = tdLocPos.make<TGraph>(); - localPosYvsDeltaY_[0]->SetName("localPosYvsDeltaY_Mixed"); - localPosYvsDeltaY_[1] = tdLocPos.make<TGraph>(); - localPosYvsDeltaY_[1]->SetName("localPosYvsDeltaY_Pixel"); - localPosYvsDeltaY_[2] = tdLocPos.make<TGraph>(); - localPosYvsDeltaY_[2]->SetName("localPosYvsDeltaY_Strip"); - - //drawing VHs arrows - TFileDirectory tdArr = td.mkdir("Directions"); - - TFileDirectory tdWid = td.mkdir("CombinatorialStudies"); - ParallaxCorrectionRZ_ = - tdWid.make<TH2D>("ParallaxCorrectionRZ", "ParallaxCorrectionRZ", 100, 0., 300., 100., 0., 120.); - ParallaxCorrectionRZ_->SetName("ParallaxCorrectionFactor"); - VHaccLayer_ = tdWid.make<TH1F>("VHacceptedLayer", "VHacceptedLayer", 250, 0., 250.); - VHaccLayer_->SetName("VHaccepted"); - VHrejLayer_ = tdWid.make<TH1F>("VHrejectedLayer", "VHrejectedLayer", 250, 0., 250.); - VHrejLayer_->SetName("VHrejected"); - VHaccTrueLayer_ = tdWid.make<TH1F>("VHaccTrueLayer", "VHaccTrueLayer", 250, 0., 250.); - VHaccTrueLayer_->SetName("VHaccepted_true"); - VHrejTrueLayer_ = tdWid.make<TH1F>("VHrejTrueLayer", "VHrejTrueLayer", 250, 0., 250.); - VHrejTrueLayer_->SetName("VHrejected_true"); - VHaccTrue_signal_Layer_ = tdWid.make<TH1F>("VHaccTrueSignalLayer", "VHaccTrueSignalLayer", 250, 0., 250.); - VHaccTrue_signal_Layer_->SetName("VHaccepted_true_signal"); - VHrejTrue_signal_Layer_ = tdWid.make<TH1F>("VHrejTrueSignalLayer", "VHrejTrueSignalLayer", 250, 0., 250.); - VHrejTrue_signal_Layer_->SetName("VHrejected_true_signal"); -} - -void VectorHitsBuilderValidation::endJob() {} - -void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::EventSetup& eventSetup) { - // Get the needed objects - - // Get the clusters - edm::Handle<Phase2TrackerCluster1DCollectionNew> clusters; - event.getByToken(srcClu_, clusters); - - // Get the vector hits - edm::Handle<VectorHitCollection> vhsAcc; - event.getByToken(VHacc_, vhsAcc); - - edm::Handle<VectorHitCollection> vhsRej; - event.getByToken(VHrej_, vhsRej); - - // load the cpe via the eventsetup - edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpeHandle; - eventSetup.get<TkPhase2OTCPERecord>().get(cpeTag_, cpeHandle); - cpe_ = cpeHandle.product(); - - // Get the Phase2 DigiSimLink - edm::Handle<edm::DetSetVector<PixelDigiSimLink> > siphase2SimLinks; - event.getByToken(siphase2OTSimLinksToken_, siphase2SimLinks); - - // Get the SimHits - edm::Handle<edm::PSimHitContainer> simHitsRaw; - event.getByToken(simHitsToken_, simHitsRaw); - - // Get the SimTracks - edm::Handle<edm::SimTrackContainer> simTracksRaw; - event.getByToken(simTracksToken_, simTracksRaw); - - // Get the SimVertex - edm::Handle<edm::SimVertexContainer> simVertices; - event.getByToken(simVerticesToken_, simVertices); - - // Get the geometry - edm::ESHandle<TrackerGeometry> geomHandle; - eventSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); - tkGeom_ = &(*geomHandle); - - // Get the Topology - edm::ESHandle<TrackerTopology> tTopoHandle; - eventSetup.get<TrackerTopologyRcd>().get(tTopoHandle); - tkTopo_ = tTopoHandle.product(); - - edm::ESHandle<MagneticField> magFieldHandle; - eventSetup.get<IdealMagneticFieldRecord>().get(magFieldHandle); - magField_ = magFieldHandle.product(); - - //Tracking Particle collection - edm::Handle<TrackingParticleCollection> TPCollectionH; - event.getByToken(trackingParticleToken_, TPCollectionH); - - auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH); - std::map<std::pair<size_t, EncodedEventId>, TrackingParticleRef> mapping; - - for (TrackingParticleCollection::size_type itp = 0; itp < TPCollectionH.product()->size(); ++itp) { - TrackingParticleRef trackingParticle(TPCollectionH, itp); - EncodedEventId eid(trackingParticle->eventId()); - for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin(); - itrk != trackingParticle->g4Track_end(); - ++itrk) { - std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid); - LogTrace("VectorHitsBuilderValidation") - << "creating map for id: " << trkid.first << " with tp: " << trackingParticle.key(); - mapping.insert(std::make_pair(trkid, trackingParticle)); - } - } - - //set up for tree - int eventNum; - int layer; - int module_id; - int module_number; - int module_type; //1: pixel, 2: strip - int VHacc = 0.0; - int VHrej = 0.0; - int vh_isTrue; - - float x_global, y_global, z_global; - float vh_x_local, vh_y_local; - float vh_x_le, vh_y_le; - float curvature, phi; - float QOverPT, QOverP; - float chi2; - - int low_tp_id, upp_tp_id; - float vh_sim_trackPt; - float sim_x_local, sim_y_local; - float sim_x_global, sim_y_global, sim_z_global; - float low_x_global, low_y_global, low_z_global; - float upp_x_global, upp_y_global, upp_z_global; - float low_xx_global_err, low_yy_global_err, low_zz_global_err; - float low_xy_global_err, low_zx_global_err, low_zy_global_err; - float upp_xx_global_err, upp_yy_global_err, upp_zz_global_err; - float upp_xy_global_err, upp_zx_global_err, upp_zy_global_err; - float deltaXVHSimHits, deltaYVHSimHits; - int multiplicity; - float width, deltaXlocal; - unsigned int processType(99); - - tree_->Branch("event", &eventNum, "eventNum/I"); - tree_->Branch("accepted", &VHacc, "VHacc/I"); - tree_->Branch("rejected", &VHrej, "VHrej/I"); - tree_->Branch("layer", &layer, "layer/I"); - tree_->Branch("module_id", &module_id, "module_id/I"); - tree_->Branch("module_type", &module_type, "module_type/I"); - tree_->Branch("module_number", &module_number, "module_number/I"); - tree_->Branch("vh_isTrue", &vh_isTrue, "vh_isTrue/I"); - tree_->Branch("x_global", &x_global, "x_global/F"); - tree_->Branch("y_global", &y_global, "y_global/F"); - tree_->Branch("z_global", &z_global, "z_global/F"); - tree_->Branch("vh_x_local", &vh_x_local, "vh_x_local/F"); - tree_->Branch("vh_y_local", &vh_y_local, "vh_y_local/F"); - tree_->Branch("vh_x_lError", &vh_x_le, "vh_x_le/F"); - tree_->Branch("vh_y_lError", &vh_y_le, "vh_y_le/F"); - tree_->Branch("curvature", &curvature, "curvature/F"); - tree_->Branch("chi2", &chi2, "chi2/F"); - tree_->Branch("phi", &phi, "phi/F"); - tree_->Branch("QOverP", &QOverP, "QOverP/F"); - tree_->Branch("QOverPT", &QOverPT, "QOverPT/F"); - tree_->Branch("low_tp_id", &low_tp_id, "low_tp_id/I"); - tree_->Branch("upp_tp_id", &upp_tp_id, "upp_tp_id/I"); - tree_->Branch("vh_sim_trackPt", &vh_sim_trackPt, "vh_sim_trackPt/F"); - tree_->Branch("sim_x_local", &sim_x_local, "sim_x_local/F"); - tree_->Branch("sim_y_local", &sim_y_local, "sim_y_local/F"); - tree_->Branch("sim_x_global", &sim_x_global, "sim_x_global/F"); - tree_->Branch("sim_y_global", &sim_y_global, "sim_y_global/F"); - tree_->Branch("sim_z_global", &sim_z_global, "sim_z_global/F"); - tree_->Branch("low_x_global", &low_x_global, "low_x_global/F"); - tree_->Branch("low_y_global", &low_y_global, "low_y_global/F"); - tree_->Branch("low_z_global", &low_z_global, "low_z_global/F"); - tree_->Branch("low_xx_global_err", &low_xx_global_err, "low_xx_global_err/F"); - tree_->Branch("low_yy_global_err", &low_yy_global_err, "low_yy_global_err/F"); - tree_->Branch("low_zz_global_err", &low_zz_global_err, "low_zz_global_err/F"); - tree_->Branch("low_xy_global_err", &low_xy_global_err, "low_xy_global_err/F"); - tree_->Branch("low_zx_global_err", &low_zx_global_err, "low_zx_global_err/F"); - tree_->Branch("low_zy_global_err", &low_zy_global_err, "low_zy_global_err/F"); - tree_->Branch("upp_x_global", &upp_x_global, "upp_x_global/F"); - tree_->Branch("upp_y_global", &upp_y_global, "upp_y_global/F"); - tree_->Branch("upp_z_global", &upp_z_global, "upp_z_global/F"); - tree_->Branch("upp_xx_global_err", &upp_xx_global_err, "upp_xx_global_err/F"); - tree_->Branch("upp_yy_global_err", &upp_yy_global_err, "upp_yy_global_err/F"); - tree_->Branch("upp_zz_global_err", &upp_zz_global_err, "upp_zz_global_err/F"); - tree_->Branch("upp_xy_global_err", &upp_xy_global_err, "upp_xy_global_err/F"); - tree_->Branch("upp_zx_global_err", &upp_zx_global_err, "upp_zx_global_err/F"); - tree_->Branch("upp_zy_global_err", &upp_zy_global_err, "upp_zy_global_err/F"); - tree_->Branch("deltaXVHSimHits", &deltaXVHSimHits, "deltaXVHSimHits/F"); - tree_->Branch("deltaYVHSimHits", &deltaYVHSimHits, "deltaYVHSimHits/F"); - tree_->Branch("multiplicity", &multiplicity, "multiplicity/I"); - tree_->Branch("width", &width, "width/F"); - tree_->Branch("deltaXlocal", &deltaXlocal, "deltaXlocal/F"); - tree_->Branch("processType", &processType, "processType/i"); - - // Rearrange the simTracks for ease of use <simTrackID, simTrack> - SimTracksMap simTracks; - for (const auto& simTrackIt : *simTracksRaw.product()) - simTracks.emplace(std::pair<unsigned int, SimTrack>(simTrackIt.trackId(), simTrackIt)); - - // Rearrange the simHits by detUnit for ease of use - SimHitsMap simHitsDetUnit; - SimHitsMap simHitsTrackId; - for (const auto& simHitIt : *simHitsRaw.product()) { - SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt.detUnitId())); - if (simHitsDetUnitIt == simHitsDetUnit.end()) { - std::pair<SimHitsMap::iterator, bool> newIt(simHitsDetUnit.insert( - std::pair<unsigned int, std::vector<PSimHit> >(simHitIt.detUnitId(), std::vector<PSimHit>()))); - simHitsDetUnitIt = newIt.first; - } - simHitsDetUnitIt->second.push_back(simHitIt); - - SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt.trackId())); - if (simHitsTrackIdIt == simHitsTrackId.end()) { - std::pair<SimHitsMap::iterator, bool> newIt(simHitsTrackId.insert( - std::pair<unsigned int, std::vector<PSimHit> >(simHitIt.trackId(), std::vector<PSimHit>()))); - simHitsTrackIdIt = newIt.first; - } - simHitsTrackIdIt->second.push_back(simHitIt); - } - - //Printout outer tracker clusters in the event - for (const auto& DSViter : *clusters) { - unsigned int rawid(DSViter.detId()); - DetId detId(rawid); - const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(detId)); - const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); - for (const auto& clustIt : DSViter) { - auto&& lparams = cpe_->localParameters(clustIt, *theGeomDet); - Global3DPoint gparams = theGeomDet->surface().toGlobal(lparams.first); - LogTrace("VectorHitsBuilderValidation") << "phase2 OT clusters: " << gparams << " DetId: " << rawid; - } - } - - for (const auto& DSViter : *vhsAcc) { - for (const auto& vhIt : DSViter) { - LogTrace("VectorHitsBuilderValidation") << "accepted VH: " << vhIt; - } - } - for (const auto& DSViter : *vhsRej) { - for (const auto& vhIt : DSViter) { - LogTrace("VectorHitsBuilderValidation") << "rejected VH: " << vhIt; - } - } - // Validation - eventNum = event.id().event(); - - unsigned int nVHsTot(0), nVHsPSTot(0), nVHs2STot(0); - std::vector<Global3DPoint> glVHs; - std::vector<Global3DVector> dirVHs; - std::vector<int> detIds; - - // Loop over modules - for (const auto DSViter : *vhsAcc) { - // Get the detector unit's id - unsigned int rawid(DSViter.detId()); - module_id = rawid; - DetId detId(rawid); - - module_number = getModuleNumber(detId); - layer = getLayerNumber(detId); - - LogDebug("VectorHitsBuilderValidation") << "Layer: " << layer << " det id" << rawid << std::endl; - - // Get the geometry of the tracker - const GeomDet* geomDet(tkGeom_->idToDet(detId)); - if (!geomDet) - break; - - // Create histograms for the layer if they do not yet exist - std::map<unsigned int, VHHistos>::iterator histogramLayer(histograms_.find(layer)); - if (histogramLayer == histograms_.end()) - histogramLayer = createLayerHistograms(layer); - // Number of clusters - unsigned int nVHsPS(0), nVHs2S(0); - - LogDebug("VectorHitsBuilderValidation") << "DSViter size: " << DSViter.size(); - - // Loop over the vhs in the detector unit - for (const auto& vhIt : DSViter) { - // vh variables - if (vhIt.isValid()) { - LogDebug("VectorHitsBuilderValidation") << " vh analyzing ..."; - chi2 = vhIt.chi2(); - LogTrace("VectorHitsBuilderValidation") << "VH chi2 " << chi2 << std::endl; - - Local3DPoint localPosVH = vhIt.localPosition(); - vh_x_local = localPosVH.x(); - vh_y_local = localPosVH.y(); - LogTrace("VectorHitsBuilderValidation") << "local VH position " << localPosVH << std::endl; - - LocalError localErrVH = vhIt.localPositionError(); - vh_x_le = localErrVH.xx(); - vh_y_le = localErrVH.yy(); - LogTrace("VectorHitsBuilderValidation") << "local VH error " << localErrVH << std::endl; - - Global3DPoint globalPosVH = geomDet->surface().toGlobal(localPosVH); - x_global = globalPosVH.x(); - y_global = globalPosVH.y(); - z_global = globalPosVH.z(); - glVHs.push_back(globalPosVH); - LogTrace("VectorHitsBuilderValidation") << " global VH position " << globalPosVH << std::endl; - - Local3DVector localDirVH = vhIt.localDirection(); - LogTrace("VectorHitsBuilderValidation") << "local VH direction " << localDirVH << std::endl; - - VectorHit vh = vhIt; - Global3DVector globalDirVH = vh.globalDirectionVH(); - dirVHs.push_back(globalDirVH); - LogTrace("VectorHitsBuilderValidation") << "global VH direction " << globalDirVH << std::endl; - - // Fill the position histograms - trackerLayoutRZ_[0]->SetPoint(nVHsTot, globalPosVH.z(), globalPosVH.perp()); - trackerLayoutXY_[0]->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); - - if (layer < 100) - trackerLayoutXYBar_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); - else - trackerLayoutXYEC_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); - - histogramLayer->second.localPosXY[0]->SetPoint(nVHsTot, vh_x_local, vh_y_local); - histogramLayer->second.globalPosXY[0]->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); - - localPosXvsDeltaX_[0]->SetPoint(nVHsTot, vh_x_local, localDirVH.x()); - localPosYvsDeltaY_[0]->SetPoint(nVHsTot, vh_y_local, localDirVH.y()); - - // Pixel module - const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); - const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); - DetId lowerDetId = stackDet->lowerDet()->geographicalId(); - DetId upperDetId = stackDet->upperDet()->geographicalId(); - - TrackerGeometry::ModuleType mType = tkGeom_->getDetectorType(lowerDetId); - module_type = 0; - if (mType == TrackerGeometry::ModuleType::Ph2PSP) { - module_type = 1; - trackerLayoutRZ_[1]->SetPoint(nVHsPSTot, globalPosVH.z(), globalPosVH.perp()); - trackerLayoutXY_[1]->SetPoint(nVHsPSTot, globalPosVH.x(), globalPosVH.y()); - - histogramLayer->second.localPosXY[1]->SetPoint(nVHsPSTot, vh_x_local, vh_y_local); - histogramLayer->second.globalPosXY[1]->SetPoint(nVHsPSTot, globalPosVH.x(), globalPosVH.y()); - - localPosXvsDeltaX_[1]->SetPoint(nVHsPSTot, vh_x_local, localDirVH.x()); - localPosYvsDeltaY_[1]->SetPoint(nVHsPSTot, vh_y_local, localDirVH.y()); - - ++nVHsPS; - ++nVHsPSTot; - } - - // Strip module - else if (mType == TrackerGeometry::ModuleType::Ph2SS) { - module_type = 2; - trackerLayoutRZ_[2]->SetPoint(nVHs2STot, globalPosVH.z(), globalPosVH.perp()); - trackerLayoutXY_[2]->SetPoint(nVHs2STot, globalPosVH.x(), globalPosVH.y()); - - histogramLayer->second.localPosXY[2]->SetPoint(nVHs2STot, vh_x_local, vh_y_local); - histogramLayer->second.globalPosXY[2]->SetPoint(nVHs2STot, globalPosVH.x(), globalPosVH.y()); - - localPosXvsDeltaX_[2]->SetPoint(nVHs2STot, vh_x_local, localDirVH.x()); - localPosYvsDeltaY_[2]->SetPoint(nVHs2STot, vh_y_local, localDirVH.y()); - - ++nVHs2S; - ++nVHs2STot; - } else if (mType == TrackerGeometry::ModuleType::Ph2PSS) { - edm::LogError("VectorHitsBuilderValidation") << "module type " << module_type << " should never happen!"; - } - LogTrace("VectorHitsBuilderValidation") << "module type " << module_type << std::endl; - - // get the geomDetUnit of the clusters - low_x_global = vhIt.lowerGlobalPos().x(); - low_y_global = vhIt.lowerGlobalPos().y(); - low_z_global = vhIt.lowerGlobalPos().z(); - upp_x_global = vhIt.upperGlobalPos().x(); - upp_y_global = vhIt.upperGlobalPos().y(); - upp_z_global = vhIt.upperGlobalPos().z(); - - low_xx_global_err = vhIt.lowerGlobalPosErr().cxx(); - low_yy_global_err = vhIt.lowerGlobalPosErr().cyy(); - low_zz_global_err = vhIt.lowerGlobalPosErr().czz(); - low_xy_global_err = vhIt.lowerGlobalPosErr().cyx(); - low_zx_global_err = vhIt.lowerGlobalPosErr().czx(); - low_zy_global_err = vhIt.lowerGlobalPosErr().czy(); - - upp_xx_global_err = vhIt.upperGlobalPosErr().cxx(); - upp_yy_global_err = vhIt.upperGlobalPosErr().cyy(); - upp_zz_global_err = vhIt.upperGlobalPosErr().czz(); - upp_xy_global_err = vhIt.upperGlobalPosErr().cyx(); - upp_zx_global_err = vhIt.upperGlobalPosErr().czx(); - upp_zy_global_err = vhIt.upperGlobalPosErr().czy(); - - LogDebug("VectorHitsBuilderValidation") << "print Clusters into the VH:" << std::endl; - printCluster(geomDetLower, vhIt.lowerClusterRef()); - LogTrace("VectorHitsBuilderValidation") << "\t global pos lower " << vhIt.lowerGlobalPos() << std::endl; - LogTrace("VectorHitsBuilderValidation") - << "\t global posErr lower " << vhIt.lowerGlobalPosErr().cxx() << std::endl; - const GeomDetUnit* geomDetUpper = stackDet->upperDet(); - printCluster(geomDetUpper, vhIt.upperClusterRef()); - LogTrace("VectorHitsBuilderValidation") << "\t global pos upper " << vhIt.upperGlobalPos() << std::endl; - - //comparison with SIM hits - LogDebug("VectorHitsBuilderValidation") << "comparison Clusters with sim hits ... " << std::endl; - std::vector<unsigned int> clusterSimTrackIds; - std::vector<unsigned int> clusterSimTrackIdsUpp; - std::set<std::pair<uint32_t, EncodedEventId> > simTkIds; - const GeomDetUnit* geomDetUnit_low(tkGeom_->idToDetUnit(lowerDetId)); - LogTrace("VectorHitsBuilderValidation") << " lowerDetID : " << lowerDetId.rawId(); - const GeomDetUnit* geomDetUnit_upp(tkGeom_->idToDetUnit(upperDetId)); - LogTrace("VectorHitsBuilderValidation") << " upperDetID : " << upperDetId.rawId(); - - for (unsigned int istr(0); istr < (*(vhIt.lowerClusterRef().cluster_phase2OT())).size(); ++istr) { - uint32_t channel = - Phase2TrackerDigi::pixelToChannel((*(vhIt.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, - (*(vhIt.lowerClusterRef().cluster_phase2OT())).column()); - unsigned int LowerSimTrackId(getSimTrackId(siphase2SimLinks, lowerDetId, channel)); - std::vector<std::pair<uint32_t, EncodedEventId> > trkid( - getSimTrackIds(siphase2SimLinks, lowerDetId, channel)); - if (trkid.size() == 0) - continue; - clusterSimTrackIds.push_back(LowerSimTrackId); - simTkIds.insert(trkid.begin(), trkid.end()); - LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << LowerSimTrackId << std::endl; - } - // In the case of PU, we need the TPs to find the proper SimTrackID - for (const auto& iset : simTkIds) { - auto ipos = mapping.find(iset); - if (ipos != mapping.end()) { - LogTrace("VectorHitsBuilderValidation") << "lower cluster in detid: " << lowerDetId.rawId() - << " from tp: " << ipos->second.key() << " " << iset.first; - LogTrace("VectorHitsBuilderValidation") << "with pt(): " << (*ipos->second).pt(); - low_tp_id = ipos->second.key(); - vh_sim_trackPt = (*ipos->second).pt(); - } - } - - simTkIds.clear(); - for (unsigned int istr(0); istr < (*(vhIt.upperClusterRef().cluster_phase2OT())).size(); ++istr) { - uint32_t channel = - Phase2TrackerDigi::pixelToChannel((*(vhIt.upperClusterRef().cluster_phase2OT())).firstRow() + istr, - (*(vhIt.upperClusterRef().cluster_phase2OT())).column()); - unsigned int UpperSimTrackId(getSimTrackId(siphase2SimLinks, upperDetId, channel)); - std::vector<std::pair<uint32_t, EncodedEventId> > trkid( - getSimTrackIds(siphase2SimLinks, upperDetId, channel)); - if (trkid.size() == 0) - continue; - clusterSimTrackIdsUpp.push_back(UpperSimTrackId); - simTkIds.insert(trkid.begin(), trkid.end()); - LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << UpperSimTrackId << std::endl; - } - // In the case of PU, we need the TPs to find the proper SimTrackID - for (const auto& iset : simTkIds) { - auto ipos = mapping.find(iset); - if (ipos != mapping.end()) { - LogTrace("VectorHitsBuilderValidation") - << "upper cluster in detid: " << upperDetId.rawId() << " from tp: " << ipos->second.key() << " " - << iset.first << std::endl; - upp_tp_id = ipos->second.key(); - } - } - //compute if the vhits is 'true' or 'false' and save sim pT - std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); - vh_isTrue = 0; - if (istrue.first) { - vh_isTrue = 1; - } - - // loop over all simHits - unsigned int totalSimHits(0); - unsigned int primarySimHits(0); - unsigned int otherSimHits(0); - - for (const auto& hitIt : *simHitsRaw) { - if (hitIt.detUnitId() == geomDetLower->geographicalId()) { - //check clusters track id compatibility - if (std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt.trackId()) != - clusterSimTrackIds.end()) { - Local3DPoint localPosHit(hitIt.localPosition()); - sim_x_local = localPosHit.x(); - sim_y_local = localPosHit.y(); - - deltaXVHSimHits = vh_x_local - sim_x_local; - deltaYVHSimHits = vh_y_local - sim_y_local; - - Global3DPoint globalPosHit = geomDetLower->surface().toGlobal(localPosHit); - sim_x_global = globalPosHit.x(); - sim_y_global = globalPosHit.y(); - sim_z_global = globalPosHit.z(); - - histogramLayer->second.deltaXVHSimHits[0]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits[0]->Fill(vh_y_local - sim_y_local); - - // Pixel module - if (layer == 1 || layer == 2 || layer == 3) { - histogramLayer->second.deltaXVHSimHits[1]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits[1]->Fill(vh_y_local - sim_y_local); - } - // Strip module - else if (layer == 4 || layer == 5 || layer == 6) { - histogramLayer->second.deltaXVHSimHits[2]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits[2]->Fill(vh_y_local - sim_y_local); - } - - ++totalSimHits; - - std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(hitIt.trackId())); - if (simTrackIt == simTracks.end()) - continue; - - // Primary particles only - processType = hitIt.processType(); - - if (simTrackIt->second.vertIndex() == 0 and - (processType == 2 || processType == 7 || processType == 9 || processType == 11 || processType == 13 || - processType == 15)) { - histogramLayer->second.deltaXVHSimHits_P[0]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits_P[0]->Fill(vh_y_local - sim_y_local); - - // Pixel module - if (layer == 1 || layer == 2 || layer == 3) { - histogramLayer->second.deltaXVHSimHits_P[1]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits_P[1]->Fill(vh_y_local - sim_y_local); - } - // Strip module - else if (layer == 4 || layer == 5 || layer == 6) { - histogramLayer->second.deltaXVHSimHits_P[2]->Fill(vh_x_local - sim_x_local); - histogramLayer->second.deltaYVHSimHits_P[2]->Fill(vh_y_local - sim_y_local); - } - - ++primarySimHits; - } - - otherSimHits = totalSimHits - primarySimHits; - - histogramLayer->second.totalSimHits->Fill(totalSimHits); - histogramLayer->second.primarySimHits->Fill(primarySimHits); - histogramLayer->second.otherSimHits->Fill(otherSimHits); - } - } - } // loop simhits - - nVHsTot++; - - //****************************** - //combinatorial studies : not filling if more than 1 VH has been produced - //****************************** - multiplicity = DSViter.size(); - if (DSViter.size() > 1) { - LogTrace("VectorHitsBuilderValidation") << " not filling if more than 1 VH has been produced"; - width = -100; - deltaXlocal = -100; - tree_->Fill(); - continue; - } - - //curvature - GlobalPoint center(0.0, 0.0, 0.0); - curvature = vh.curvature(); - phi = vh.phi(); - QOverPT = vh.transverseMomentum(magField_->inTesla(center).z()); - QOverP = vh.momentum(magField_->inTesla(center).z()); - histogramLayer->second.curvature->Fill(curvature); - - //stub width - - auto&& lparamsUpp = cpe_->localParameters(*vhIt.upperClusterRef().cluster_phase2OT(), *geomDetUnit_upp); - LogTrace("VectorHitsBuilderValidation") << " upper local pos (in its system of reference):" << lparamsUpp.first; - Global3DPoint gparamsUpp = geomDetUnit_upp->surface().toGlobal(lparamsUpp.first); - LogTrace("VectorHitsBuilderValidation") << " upper global pos :" << gparamsUpp; - Local3DPoint lparamsUppInLow = geomDetUnit_low->surface().toLocal(gparamsUpp); - LogTrace("VectorHitsBuilderValidation") << " upper local pos (in low system of reference):" << lparamsUppInLow; - auto&& lparamsLow = cpe_->localParameters(*vhIt.lowerClusterRef().cluster_phase2OT(), *geomDetUnit_low); - LogTrace("VectorHitsBuilderValidation") << " lower local pos (in its system of reference):" << lparamsLow.first; - Global3DPoint gparamsLow = geomDetUnit_low->surface().toGlobal(lparamsLow.first); - LogTrace("VectorHitsBuilderValidation") << " lower global pos :" << gparamsLow; - - deltaXlocal = lparamsUppInLow.x() - lparamsLow.first.x(); - histogramLayer->second.deltaXlocal->Fill(deltaXlocal); - LogTrace("VectorHitsBuilderValidation") << " deltaXlocal : " << deltaXlocal; - - double parallCorr = 0.0; - - Global3DPoint origin(0, 0, 0); - GlobalVector gV = gparamsLow - origin; - LocalVector lV = geomDetUnit_low->surface().toLocal(gV); - LocalVector lV_norm = lV / lV.z(); - parallCorr = lV_norm.x() * lparamsUppInLow.z(); - LogTrace("VectorHitsBuilderValidation") << " parallalex correction:" << parallCorr; - - double lpos_upp_corr = 0.0; - double lpos_low_corr = 0.0; - if (lparamsUpp.first.x() > lparamsLow.first.x()) { - if (lparamsUpp.first.x() > 0) { - lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() - fabs(parallCorr); - } - if (lparamsUpp.first.x() < 0) { - lpos_low_corr = lparamsLow.first.x() + fabs(parallCorr); - lpos_upp_corr = lparamsUpp.first.x(); - } - } else if (lparamsUpp.first.x() < lparamsLow.first.x()) { - if (lparamsUpp.first.x() > 0) { - lpos_low_corr = lparamsLow.first.x() - fabs(parallCorr); - lpos_upp_corr = lparamsUpp.first.x(); - } - if (lparamsUpp.first.x() < 0) { - lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = lparamsUpp.first.x() + fabs(parallCorr); - } - } else { - if (lparamsUpp.first.x() > 0) { - lpos_upp_corr = lparamsUpp.first.x() - fabs(parallCorr); - lpos_low_corr = lparamsLow.first.x(); - } - if (lparamsUpp.first.x() < 0) { - lpos_upp_corr = lparamsUpp.first.x() + fabs(parallCorr); - lpos_low_corr = lparamsLow.first.x(); - } - } - - LogDebug("VectorHitsBuilderValidation") << " \t local pos upper corrected (x):" << lpos_upp_corr << std::endl; - LogDebug("VectorHitsBuilderValidation") << " \t local pos lower corrected (x):" << lpos_low_corr << std::endl; - - width = lpos_low_corr - lpos_upp_corr; - histogramLayer->second.width->Fill(width); - LogTrace("VectorHitsBuilderValidation") << " width:" << width; - - tree_->Fill(); - - } // vh valid - - } // loop vhs - - if (nVHsPS) - histogramLayer->second.numberVHsPS->Fill(nVHsPS); - if (nVHs2S) - histogramLayer->second.numberVHs2S->Fill(nVHs2S); - LogTrace("VectorHitsBuilderValidation") - << "nVHsPS for this layer : " << nVHsPS << ", nVHs2S for this layer : " << nVHs2S << std::endl; - } - - CreateVHsXYGraph(glVHs, dirVHs); - CreateVHsRZGraph(glVHs, dirVHs); - - int VHaccTrue = 0.0; - int VHaccFalse = 0.0; - int VHrejTrue = 0.0; - int VHrejFalse = 0.0; - int VHaccTrue_signal = 0.0; - int VHrejTrue_signal = 0.0; - - // Loop over modules - for (const auto& DSViter : *vhsAcc) { - unsigned int rawid(DSViter.detId()); - DetId detId(rawid); - int layerAcc = getLayerNumber(detId); - LogTrace("VectorHitsBuilderValidation") << "acc Layer: " << layerAcc << " det id" << rawid << std::endl; - for (const auto& vhIt : DSViter) { - if (vhIt.isValid()) { - VHaccLayer_->Fill(layerAcc); - VHacc++; - - //compute if the vhits is 'true' or 'false' - std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); - if (istrue.first) { - LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; - VHaccTrueLayer_->Fill(layerAcc); - VHaccTrue++; - - //saving info of 'signal' track - std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(istrue.second)); - if (simTrackIt == simTracks.end()) - continue; - LogTrace("VectorHitsBuilderValidation") << "this vectorhit is associated with SimTrackId: " << istrue.second; - LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); - if (simTrackIt->second.momentum().pt() > 1) { - VHaccTrue_signal_Layer_->Fill(layerAcc); - LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; - VHaccTrue_signal++; - } - - } else { - LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'false' vhit."; - VHaccFalse++; - } - } - } - } - - for (const auto& DSViter : *vhsRej) { - unsigned int rawid(DSViter.detId()); - DetId detId(rawid); - int layerRej = getLayerNumber(detId); - LogTrace("VectorHitsBuilderValidation") << "rej Layer: " << layerRej << " det id" << rawid << std::endl; - for (const auto& vhIt : DSViter) { - VHrejLayer_->Fill(layerRej); - VHrej++; - - //compute if the vhits is 'true' or 'false' - std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); - if (istrue.first) { - LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; - VHrejTrueLayer_->Fill(layerRej); - VHrejTrue++; - - //saving info of 'signal' track - std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(istrue.second)); - if (simTrackIt == simTracks.end()) - continue; - LogTrace("VectorHitsBuilderValidation") << "this vectorhit is associated with SimTrackId: " << istrue.second; - LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); - if (simTrackIt->second.momentum().pt() > 1) { - VHrejTrue_signal_Layer_->Fill(layerRej); - LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; - VHrejTrue_signal++; - } - - } else { - LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'false' vhit."; - VHrejFalse++; - } - } - } - - int VHtot = VHacc + VHrej; - LogTrace("VectorHitsBuilderValidation") - << "VH total: " << VHtot << " with " << VHacc << " VHs accepted and " << VHrej << " VHs rejected."; - LogTrace("VectorHitsBuilderValidation") - << "of the VH accepted, there are " << VHaccTrue << " true and " << VHaccFalse << " false."; - LogTrace("VectorHitsBuilderValidation") - << "of the VH rejected, there are " << VHrejTrue << " true and " << VHrejFalse << " false."; - LogTrace("VectorHitsBuilderValidation") - << "of the true VH , there are " << VHaccTrue_signal << " accepted belonging to signal and " - << VHrejTrue_signal << " rejected belonging to signal."; - - // CreateWindowCorrGraph(); -} - -// Check if the vector hit is true (both clusters are formed from the same SimTrack -std::pair<bool, uint32_t> VectorHitsBuilderValidation::isTrue( - const VectorHit vh, const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& siphase2SimLinks, DetId& detId) const { - const GeomDet* geomDet(tkGeom_->idToDet(detId)); - const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); - const GeomDetUnit* geomDetLower = stackDet->lowerDet(); - const GeomDetUnit* geomDetUpper = stackDet->upperDet(); - - std::vector<unsigned int> lowClusterSimTrackIds; - - for (unsigned int istr(0); istr < (*(vh.lowerClusterRef().cluster_phase2OT())).size(); ++istr) { - uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, - (*(vh.lowerClusterRef().cluster_phase2OT())).column()); - DetId detIdCluster = geomDetLower->geographicalId(); - unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detIdCluster, channel)); - LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << simTrackId << std::endl; - std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, detIdCluster, channel)); - if (trkid.size() == 0) - continue; - lowClusterSimTrackIds.push_back(simTrackId); - } - - std::vector<unsigned int>::iterator it_simTrackUpper; - - for (unsigned int istr(0); istr < (*(vh.upperClusterRef().cluster_phase2OT())).size(); ++istr) { - uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.upperClusterRef().cluster_phase2OT())).firstRow() + istr, - (*(vh.upperClusterRef().cluster_phase2OT())).column()); - DetId detIdCluster = geomDetUpper->geographicalId(); - unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detIdCluster, channel)); - LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << simTrackId << std::endl; - std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, detIdCluster, channel)); - if (trkid.size() == 0) - continue; - it_simTrackUpper = std::find(lowClusterSimTrackIds.begin(), lowClusterSimTrackIds.end(), simTrackId); - if (it_simTrackUpper != lowClusterSimTrackIds.end()) { - LogTrace("VectorHitsBuilderValidation") << " UpperSimTrackId found in lowClusterSimTrackIds "; - return std::make_pair(true, simTrackId); - } - } - return std::make_pair(false, 0); -} - -// Create the histograms -std::map<unsigned int, VHHistos>::iterator VectorHitsBuilderValidation::createLayerHistograms(unsigned int ival) { - std::ostringstream fname1, fname2; - - edm::Service<TFileService> fs; - fs->file().cd("/"); - - std::string tag; - unsigned int id; - if (ival < 100) { - id = ival; - fname1 << "Barrel"; - fname2 << "Layer_" << id; - tag = "_layer_"; - } else { - int side = ival / 100; - id = ival - side * 100; - fname1 << "EndCap_Side_" << side; - fname2 << "Disc_" << id; - tag = "_disc_"; - } - - TFileDirectory td1 = fs->mkdir(fname1.str().c_str()); - TFileDirectory td = td1.mkdir(fname2.str().c_str()); - - VHHistos local_histos; - - std::ostringstream histoName; - - /* - * Number of clusters - */ - - histoName.str(""); - histoName << "Number_VHs_PS" << tag.c_str() << id; - local_histos.numberVHsPS = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); - local_histos.numberVHsPS->SetFillColor(kAzure + 7); - - histoName.str(""); - histoName << "Number_VHs_2S" << tag.c_str() << id; - local_histos.numberVHs2S = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); - local_histos.numberVHs2S->SetFillColor(kOrange - 3); - - histoName.str(""); - histoName << "Number_VHs_Mixed" << tag.c_str() << id; - local_histos.numberVHsMixed = td.make<THStack>(histoName.str().c_str(), histoName.str().c_str()); - local_histos.numberVHsMixed->Add(local_histos.numberVHsPS); - local_histos.numberVHsMixed->Add(local_histos.numberVHs2S); - - /* - * Local and Global positions - */ - - histoName.str(""); - histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; - local_histos.localPosXY[0] = td.make<TGraph>(); - local_histos.localPosXY[0]->SetName(histoName.str().c_str()); - - histoName.str(""); - histoName << "Local_Position_XY_PS" << tag.c_str() << id; - local_histos.localPosXY[1] = td.make<TGraph>(); - local_histos.localPosXY[1]->SetName(histoName.str().c_str()); - - histoName.str(""); - histoName << "Local_Position_XY_2S" << tag.c_str() << id; - local_histos.localPosXY[2] = td.make<TGraph>(); - local_histos.localPosXY[2]->SetName(histoName.str().c_str()); - - histoName.str(""); - histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; - local_histos.globalPosXY[0] = td.make<TGraph>(); - local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); - - histoName.str(""); - histoName << "Global_Position_XY_PS" << tag.c_str() << id; - local_histos.globalPosXY[1] = td.make<TGraph>(); - local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); - - histoName.str(""); - histoName << "Global_Position_XY_2S" << tag.c_str() << id; - local_histos.globalPosXY[2] = td.make<TGraph>(); - local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); - - /* - * Delta positions with SimHits - */ - - histoName.str(""); - histoName << "Delta_X_VH_SimHits_Mixed" << tag.c_str() << id; - local_histos.deltaXVHSimHits[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_X_VH_SimHits_PS" << tag.c_str() << id; - local_histos.deltaXVHSimHits[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_X_VH_SimHits_2S" << tag.c_str() << id; - local_histos.deltaXVHSimHits[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_Y_VH_SimHits_Mixed" << tag.c_str() << id; - local_histos.deltaYVHSimHits[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_Y_VH_SimHits_PS" << tag.c_str() << id; - local_histos.deltaYVHSimHits[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_Y_VH_SimHits_2S" << tag.c_str() << id; - local_histos.deltaYVHSimHits[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - /* - * Delta position with simHits for primary tracks only - */ - - histoName.str(""); - histoName << "Delta_X_VH_SimHits_Mixed_P" << tag.c_str() << id; - local_histos.deltaXVHSimHits_P[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_X_VH_SimHits_PS_P" << tag.c_str() << id; - local_histos.deltaXVHSimHits_P[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_X_VH_SimHits_2S_P" << tag.c_str() << id; - local_histos.deltaXVHSimHits_P[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_Y_VH_SimHits_Mixed_P" << tag.c_str() << id; - local_histos.deltaYVHSimHits_P[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_Y_VH_SimHits_PS_P" << tag.c_str() << id; - local_histos.deltaYVHSimHits_P[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - histoName.str(""); - histoName << "Delta_Y_VH_SimHits_2S_P" << tag.c_str() << id; - local_histos.deltaYVHSimHits_P[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); - - /* - * Information on the Digis per cluster - */ - - histoName.str(""); - histoName << "Total_Digis" << tag.c_str() << id; - local_histos.totalSimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - - histoName.str(""); - histoName << "Primary_Digis" << tag.c_str() << id; - local_histos.primarySimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - - histoName.str(""); - histoName << "Other_Digis" << tag.c_str() << id; - local_histos.otherSimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); - - /* - * Study on the clusters combinatorial problem - */ - - histoName.str(""); - histoName << "DeltaXlocal_clusters" << tag.c_str() << id; - local_histos.deltaXlocal = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); - histoName.str(""); - histoName << "Width" << tag.c_str() << id; - local_histos.width = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); - histoName.str(""); - histoName << "Curvature" << tag.c_str() << id; - local_histos.curvature = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); - - std::pair<std::map<unsigned int, VHHistos>::iterator, bool> insertedIt( - histograms_.insert(std::make_pair(ival, local_histos))); - fs->file().cd("/"); - - return insertedIt.first; -} - -void VectorHitsBuilderValidation::CreateVHsXYGraph(const std::vector<Global3DPoint> glVHs, - const std::vector<Global3DVector> dirVHs) { - if (glVHs.size() != dirVHs.size()) { - std::cout << "Cannot fullfil the graphs for this event. Return." << std::endl; - return; - } - - // opening canvas and drawing XY TGraph - - for (unsigned int nVH = 0; nVH < glVHs.size(); nVH++) { - //same r - if ((fabs(dirVHs.at(nVH).x()) < 10e-5) && (fabs(dirVHs.at(nVH).y()) < 10e-5)) { - continue; - - } else { - } - } - - return; -} - -void VectorHitsBuilderValidation::CreateVHsRZGraph(const std::vector<Global3DPoint> glVHs, - const std::vector<Global3DVector> dirVHs) { - if (glVHs.size() != dirVHs.size()) { - std::cout << "Cannot fullfil the graphs for this event. Return." << std::endl; - return; - } - - return; -} - -void VectorHitsBuilderValidation::CreateWindowCorrGraph() { - //FIXME: This function is not working properly, yet. - - //return if we are not using Phase2 OT - if (!tkGeom_->isThere(GeomDetEnumerators::P2OTB) && !tkGeom_->isThere(GeomDetEnumerators::P2OTEC)) - return; - - for (auto det : tkGeom_->detsTOB()) { - ParallaxCorrectionRZ_->Fill(det->position().z(), det->position().perp(), 5.); - } - for (auto det : tkGeom_->detsTID()) { - ParallaxCorrectionRZ_->Fill(det->position().z(), det->position().perp(), 10.); - } - ParallaxCorrectionRZ_->Fill(0., 0., 5.); - return; -} - -unsigned int VectorHitsBuilderValidation::getLayerNumber(const DetId& detid) { - if (detid.det() == DetId::Tracker) { - if (detid.subdetId() == StripSubdetector::TOB) - return (tkTopo_->layer(detid)); - else if (detid.subdetId() == StripSubdetector::TID) - return (100 * tkTopo_->side(detid) + tkTopo_->layer(detid)); - else - return 999; - } - return 999; -} - -unsigned int VectorHitsBuilderValidation::getModuleNumber(const DetId& detid) { return (tkTopo_->module(detid)); } - -std::vector<std::pair<uint32_t, EncodedEventId> > VectorHitsBuilderValidation::getSimTrackIds( - const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& simLinks, const DetId& detId, uint32_t channel) const { - std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId; - auto isearch = simLinks->find(detId); - if (isearch != simLinks->end()) { - // Loop over DigiSimLink in this det unit - edm::DetSet<PixelDigiSimLink> link_detset = (*isearch); - for (const auto& it : link_detset.data) { - if (channel == it.channel()) - simTrkId.push_back(std::make_pair(it.SimTrackId(), it.eventId())); - } - } - return simTrkId; -} - -unsigned int VectorHitsBuilderValidation::getSimTrackId( - const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& pixelSimLinks, - const DetId& detId, - unsigned int channel) const { - edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter(pixelSimLinks->find(detId)); - if (DSViter == pixelSimLinks->end()) - return 0; - for (const auto& it : DSViter->data) { - if (channel == it.channel()) - return it.SimTrackId(); - } - return 0; -} - -void VectorHitsBuilderValidation::printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster) { - if (!geomDetUnit) - return; - - const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); - const PixelTopology& topol = theGeomDet->specificTopology(); - - unsigned int layer = getLayerNumber(geomDetUnit->geographicalId()); - unsigned int module = getModuleNumber(geomDetUnit->geographicalId()); - LogTrace("VectorHitsBuilderValidation") << "Layer:" << layer << std::endl; - if (topol.ncolumns() == 32) - LogTrace("VectorHitsBuilderValidation") << "Pixel cluster with detId:" << geomDetUnit->geographicalId().rawId() - << "(module:" << module << ") " << std::endl; - else if (topol.ncolumns() == 2) - LogTrace("VectorHitsBuilderValidation") << "Strip cluster with detId:" << geomDetUnit->geographicalId().rawId() - << "(module:" << module << ") " << std::endl; - else - std::cout << "no module?!" << std::endl; - LogTrace("VectorHitsBuilderValidation") - << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl; - LogTrace("VectorHitsBuilderValidation") << " and width:" << theGeomDet->surface().bounds().width() - << " , lenght:" << theGeomDet->surface().bounds().length() << std::endl; - - auto&& lparams = cpe_->localParameters(*cluster.cluster_phase2OT(), *theGeomDet); - - LogTrace("VectorHitsBuilderValidation") - << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl; - - return; -} - -void VectorHitsBuilderValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - edm::ParameterSetDescription desc; - desc.add<std::string>("src", "siPhase2Clusters"); - desc.add<edm::InputTag>("links", edm::InputTag("simSiPixelDigis", "Tracker")); - desc.add<edm::InputTag>("VH_acc", edm::InputTag("siPhase2VectorHits", "vectorHitsAccepted")); - desc.add<edm::InputTag>("VH_rej", edm::InputTag("siPhase2VectorHits", "vectorHitsRejected")); - desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); - desc.add<edm::InputTag>("trackingParticleSrc", edm::InputTag("mix", "MergedTrackTruth")); - descriptions.add("vectorHitsBuilderValidation", desc); -} - -DEFINE_FWK_MODULE(VectorHitsBuilderValidation); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h deleted file mode 100644 index 66ca71f0d46a7..0000000000000 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsValidation.h +++ /dev/null @@ -1,148 +0,0 @@ -#include <map> -#include <vector> -#include <algorithm> - -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/one/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/ServiceRegistry/interface/Service.h" - -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" - -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "Geometry/CommonDetUnit/interface/GeomDet.h" -#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" - -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" -#include "DataFormats/Common/interface/DetSetVectorNew.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/DetId/interface/DetId.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" -#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" -#include "DataFormats/SiPixelDigi/interface/PixelDigi.h" -#include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" - -#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" -#include "SimDataFormats/Track/interface/SimTrackContainer.h" -#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" -#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" - -#include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "CommonTools/Utils/interface/TFileDirectory.h" - -#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" -#include "DataFormats/TrackerRecHit2D/interface/OmniClusterRef.h" - -#include <TH1F.h> -#include <TH2D.h> -#include <TGraph.h> -#include <THStack.h> -#include <TCanvas.h> -#include <TTree.h> -#include <TArrow.h> - -struct VHHistos { - THStack* numberVHsMixed; - TH1F* numberVHsPS; - TH1F* numberVHs2S; - - TGraph* globalPosXY[3]; - TGraph* localPosXY[3]; - - TH1F* deltaXVHSimHits[3]; - TH1F* deltaYVHSimHits[3]; - - TH1F* deltaXVHSimHits_P[3]; - TH1F* deltaYVHSimHits_P[3]; - - TH1F* digiEfficiency[3]; - - TH1F* totalSimHits; - TH1F* primarySimHits; - TH1F* otherSimHits; - - TH1F* curvature; - TH1F* width; - TH1F* deltaXlocal; -}; - -class VectorHitsBuilderValidation : public edm::one::EDAnalyzer<edm::one::SharedResources> { -public: - typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; - - typedef std::map<unsigned int, std::vector<PSimHit> > SimHitsMap; - typedef std::map<unsigned int, SimTrack> SimTracksMap; - - explicit VectorHitsBuilderValidation(const edm::ParameterSet&); - ~VectorHitsBuilderValidation(); - void beginJob(); - void endJob(); - void analyze(const edm::Event&, const edm::EventSetup&); - - static void fillDescriptions(edm::ConfigurationDescriptions&); - -private: - std::map<unsigned int, VHHistos>::iterator createLayerHistograms(unsigned int); - void CreateVHsXYGraph(const std::vector<Global3DPoint>, const std::vector<Global3DVector>); - void CreateVHsRZGraph(const std::vector<Global3DPoint>, const std::vector<Global3DVector>); - void CreateWindowCorrGraph(); - - unsigned int getLayerNumber(const DetId&); - unsigned int getModuleNumber(const DetId& detid); - void printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster); - - std::pair<bool, uint32_t> isTrue(const VectorHit vh, - const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& siphase2SimLinks, - DetId& detId) const; - std::vector<std::pair<uint32_t, EncodedEventId> > getSimTrackIds( - const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >&, const DetId&, uint32_t) const; - unsigned int getSimTrackId(const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& pixelSimLinks, - const DetId& detId, - unsigned int channel) const; - - edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; - edm::EDGetTokenT<VectorHitCollection> VHacc_; - edm::EDGetTokenT<VectorHitCollection> VHrej_; - edm::ESInputTag cpeTag_; - const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; - - edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; - edm::EDGetTokenT<edm::PSimHitContainer> simHitsToken_; - edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; - edm::EDGetTokenT<edm::SimVertexContainer> simVerticesToken_; - edm::EDGetTokenT<TrackingParticleCollection> trackingParticleToken_; - - const TrackerGeometry* tkGeom_; - const TrackerTopology* tkTopo_; - const MagneticField* magField_; - - TTree* tree_; - TGraph* trackerLayoutRZ_[3]; - TGraph* trackerLayoutXY_[3]; - TGraph* trackerLayoutXYBar_; - TGraph* trackerLayoutXYEC_; - TGraph* localPosXvsDeltaX_[3]; - TGraph* localPosYvsDeltaY_[3]; - TCanvas* VHXY_; - TCanvas* VHRZ_; - std::vector<TArrow*> arrowVHs_; - - TH2D* ParallaxCorrectionRZ_; - TH1F* VHaccLayer_; - TH1F* VHrejLayer_; - TH1F* VHaccTrueLayer_; - TH1F* VHrejTrueLayer_; - TH1F* VHaccTrue_signal_Layer_; - TH1F* VHrejTrue_signal_Layer_; - - std::map<unsigned int, VHHistos> histograms_; -}; diff --git a/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc b/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc index c3946d8f19c8f..24df700d80ed4 100644 --- a/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc +++ b/RecoLocalTracker/SubCollectionProducers/src/SeedClusterRemoverPhase2.cc @@ -140,8 +140,6 @@ void SeedClusterRemoverPhase2::process(const TrackingRecHit *hit, float chi2, co << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n."; - assert(cluster.id() == outerTrackerSourceProdID); - OTs[cluster.key()] = false; assert(collectedOuterTrackers_.size() > cluster.key()); collectedOuterTrackers_[cluster.key()] = true; @@ -153,8 +151,6 @@ void SeedClusterRemoverPhase2::process(const TrackingRecHit *hit, float chi2, co << "SeedClusterRemoverPhase2: strip cluster ref from Product ID = " << cluster.id() << " does not match with source cluster collection (ID = " << outerTrackerSourceProdID << ")\n."; - assert(cluster.id() == outerTrackerSourceProdID); - OTs[cluster.key()] = false; assert(collectedOuterTrackers_.size() > cluster.key()); collectedOuterTrackers_[cluster.key()] = true; diff --git a/RecoTracker/FinalTrackSelectors/plugins/DuplicateTrackMerger.cc b/RecoTracker/FinalTrackSelectors/plugins/DuplicateTrackMerger.cc index 3a20b4671a9ad..0bd101844174c 100644 --- a/RecoTracker/FinalTrackSelectors/plugins/DuplicateTrackMerger.cc +++ b/RecoTracker/FinalTrackSelectors/plugins/DuplicateTrackMerger.cc @@ -488,16 +488,6 @@ namespace { gbrVals_[7] = tmva_outer_nMissingInner_; gbrVals_[8] = tmva_inner_nMissingOuter_; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_ddsz_ : gbrVals_[0] " << gbrVals_[0]; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_ddxy_ : gbrVals_[1] " << gbrVals_[1]; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_dphi_ : gbrVals_[2] " << gbrVals_[2]; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_dlambda_ : gbrVals_[3] " << gbrVals_[3]; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_dqoverp_ : gbrVals_[4] " << gbrVals_[4]; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_d3dr_ : gbrVals_[5] " << gbrVals_[5]; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_d3dz_ : gbrVals_[6] " << gbrVals_[6]; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_outer_nMissingInner_ : gbrVals_[7] " << gbrVals_[7]; - IfLogTrace(debug_, "DuplicateTrackMerger") << " tmva_inner_nMissingOuter_ : gbrVals_[8] " << gbrVals_[8]; - auto mvaBDTG = forest_->GetClassifier(gbrVals_); IfLogTrace(debug_, "DuplicateTrackMerger") << " mvaBDTG " << mvaBDTG; if (mvaBDTG < minBDTG_) diff --git a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py index b0ac555769792..9bc904b3ebd5e 100644 --- a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py +++ b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py @@ -102,28 +102,10 @@ ) ) from Configuration.ProcessModifiers.vectorHits_cff import vectorHits -vectorHits.toReplaceWith(earlyGeneralTracks, _trackListMerger.clone( - TrackProducers =['initialStepTracks', - 'highPtTripletStepTracks', - 'lowPtQuadStepTracks', - 'lowPtTripletStepTracks', - 'detachedQuadStepTracks', - 'pixelPairStepTracks', - 'pixelLessStepTracks', - ], - hasSelector = [1,1,1,1,1,1,1], - indivShareFrac = [1.0,0.16,0.095,0.09,0.09,0.09,0.095], - selectedTrackQuals = ['initialStepSelector:initialStep', - 'highPtTripletStepSelector:highPtTripletStep', - 'lowPtQuadStepSelector:lowPtQuadStep', - 'lowPtTripletStepSelector:lowPtTripletStep', - 'detachedQuadStep', - 'pixelPairStepSelector:pixelPairStep', - 'pixelLessStepSelector:pixelLessStep', - ], - setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True) ) - ), - copyExtras = True, - makeReKeyedSeeds = cms.untracked.bool(False) - ) -) + +(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, TrackProducers = earlyGeneralTracks.TrackProducers + ['pixelLessStepTracks']) +(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, hasSelector = earlyGeneralTracks.hasSelector + [1]) +(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, indivShareFrac = earlyGeneralTracks.indivShareFrac + [0.095]) +(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, selectedTrackQuals = earlyGeneralTracks.selectedTrackQuals + ['pixelLessStepSelector:pixelLessStep']) +(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True)))) + diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index 867a57fde8806..ad72a25b1959c 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -318,53 +318,8 @@ ] #end of vpset ) #end of clone -highPtTripletStepSelector_vectorHits = RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.multiTrackSelector.clone( - src = 'highPtTripletStepTracks', - trackSelectors = [ - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone( - name = 'highPtTripletStepLoose', - chi2n_par = 2.0, - res_par = ( 0.003, 0.002 ), - minNumberLayers = 3, - maxNumberLostLayers = 3, - minNumber3DLayers = 3, - d0_par1 = ( 0.7, 4.0 ), - dz_par1 = ( 0.8, 4.0 ), - d0_par2 = ( 0.6, 4.0 ), - dz_par2 = ( 0.6, 4.0 ) - ), #end of pset - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone( - name = 'highPtTripletStepTight', - preFilterName = 'highPtTripletStepLoose', - chi2n_par = 1.0, - res_par = ( 0.003, 0.002 ), - minNumberLayers = 3, - maxNumberLostLayers = 2, - minNumber3DLayers = 3, - d0_par1 = ( 0.6, 4.0 ), - dz_par1 = ( 0.7, 4.0 ), - d0_par2 = ( 0.5, 4.0 ), - dz_par2 = ( 0.6, 4.0 ) - ), - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone( - name = 'highPtTripletStep', - preFilterName = 'highPtTripletStepTight', - min_eta = -4.1, - max_eta = 4.1, - chi2n_par = 0.8, - res_par = ( 0.003, 0.001 ), - min_nhits = 4, - minNumberLayers = 3, - maxNumberLostLayers = 2, - minNumber3DLayers = 3, - d0_par1 = ( 0.5, 4.0 ), - dz_par1 = ( 0.6, 4.0 ), - d0_par2 = ( 0.45, 4.0 ), - dz_par2 = ( 0.55, 4.0 ) - ), - ] #end of vpset -) #en - +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toModify(highPtTripletStepSelector.trackSelectors[2], minNumberLayers = 3, minNumber3DLayers = 3, d0_par1 = ( 0.5, 4.0 ), dz_par1 = ( 0.6, 4.0 )) # Final sequence HighPtTripletStepTask = cms.Task(highPtTripletStepClusters, @@ -382,8 +337,6 @@ _HighPtTripletStep_Phase2PU140 = cms.Sequence(_HighPtTripletStepTask_Phase2PU140) trackingPhase2PU140.toReplaceWith(HighPtTripletStepTask, _HighPtTripletStepTask_Phase2PU140) -from Configuration.ProcessModifiers.vectorHits_cff import vectorHits -vectorHits.toReplaceWith(highPtTripletStepSelector, highPtTripletStepSelector_vectorHits) # fast tracking mask producer from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover highPtTripletStepMasks = maskProducerFromClusterRemover(highPtTripletStepClusters) diff --git a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py index 0f1d9aeb10c12..266a80b156123 100644 --- a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py @@ -362,53 +362,9 @@ ), #end of vpset ) #end of clone -from Configuration.ProcessModifiers.vectorHits_cff import vectorHits -vectorHits.toModify(lowPtTripletStepSelector, - trackSelectors= cms.VPSet( - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone( - name = 'lowPtTripletStepLoose', - chi2n_par = 1.2, - res_par = ( 0.003, 0.002 ), - minNumberLayers = 3, - maxNumberLostLayers = 2, - minNumber3DLayers = 3, - d0_par1 = ( 0.7, 4.0 ), - dz_par1 = ( 0.7, 4.0 ), - d0_par2 = ( 0.6, 4.0 ), - dz_par2 = ( 0.6, 4.0 ) - ), #end of pset - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone( - name = 'lowPtTripletStepTight', - preFilterName = 'lowPtTripletStepLoose', - chi2n_par = 0.7, - res_par = ( 0.003, 0.002 ), - minNumberLayers = 3, - maxNumberLostLayers = 2, - minNumber3DLayers = 3, - d0_par1 = ( 0.6, 4.0 ), - dz_par1 = ( 0.6, 4.0 ), - d0_par2 = ( 0.5, 4.0 ), - dz_par2 = ( 0.5, 4.0 ) - ), - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone( - name = 'lowPtTripletStep', - preFilterName = 'lowPtTripletStepTight', - min_eta = -4.0, - max_eta = 4.0, - chi2n_par = 0.4, - res_par = ( 0.003, 0.001 ), - min_nhits = 3, - minNumberLayers = 3, - maxNumberLostLayers = 2, - minNumber3DLayers = 3, - d0_par1 = ( 0.5, 4.0 ), - dz_par1 = ( 0.5, 4.0 ), - d0_par2 = ( 0.45, 4.0 ), - dz_par2 = ( 0.45, 4.0 ) - ), - ), #end of vpset -) #end of clone +from Configuration.ProcessModifiers.vectorHits_cff import vectorHits +vectorHits.toModify(lowPtTripletStepSelector.trackSelectors[2], minNumberLayers = 3, minNumber3DLayers = 3) # Final sequence diff --git a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py index c9d5cd19de4d8..904b1d81aedf0 100644 --- a/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelLessStep_cff.py @@ -114,17 +114,13 @@ TOB = cms.PSet( TTRHBuilder = cms.string('WithTrackAngle'), clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutNone')), - vectorRecHits = cms.InputTag("siPhase2VectorHits", 'accepted'), + vectorRecHits = cms.InputTag("siPhase2VectorHits", 'vectorHitsAccepted'), skipClusters = cms.InputTag('pixelLessStepClusters') ), TIB = None, - TID = cms.PSet( - TTRHBuilder = cms.string('WithTrackAngle'), - clusterChargeCut = cms.PSet(refToPSet_ = cms.string('SiStripClusterChargeCutNone')), + TID = dict( + clusterChargeCut = dict(refToPSet_ = cms.string('SiStripClusterChargeCutNone')), vectorRecHits = cms.InputTag("siPhase2VectorHits", 'accepted'), - skipClusters = cms.InputTag('pixelLessStepClusters'), - useRingSlector = cms.bool(True), - minRing = cms.int32(1), maxRing = cms.int32(8) ), TEC = None, @@ -224,12 +220,9 @@ vectorHits.toModify(pixelLessStepHitDoublets, produceSeedingHitSets=True, produceIntermediateHitDoublets=False) vectorHits.toModify(pixelLessStepSeeds, seedingHitSets = "pixelLessStepHitDoublets", - SeedComparitorPSet = cms.PSet( - ClusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache"), + SeedComparitorPSet = dict( ClusterShapeHitFilterName = cms.string('ClusterShapeHitFilter'), - ComponentName = cms.string('PixelClusterShapeSeedComparitor'), FilterAtHelixStage = cms.bool(False), - FilterPixelHits = cms.bool(False), FilterStripHits = cms.bool(False), ) ) @@ -264,7 +257,7 @@ vectorHits.toModify(pixelLessStepChi2Est, clusterChargeCut = dict(refToPSet_ = 'SiStripClusterChargeCutNone'), - MaxChi2 = cms.double(30.0) + MaxChi2 = 30.0 ) # TRACK BUILDING diff --git a/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py b/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py index 9570c259b6b6a..81eb716d6a39b 100644 --- a/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py @@ -420,51 +420,7 @@ ) #end of clone from Configuration.ProcessModifiers.vectorHits_cff import vectorHits -vectorHits.toModify(pixelPairStepSelector, - trackSelectors = cms.VPSet( - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.looseMTS.clone( - name = 'pixelPairStepLoose', - chi2n_par = 0.7, - res_par = ( 0.003, 0.002 ), - minNumberLayers = 3, - maxNumberLostLayers = 2, - minNumber3DLayers = 3, - d0_par1 = ( 0.4, 4.0 ), - dz_par1 = ( 0.4, 4.0 ), - d0_par2 = ( 0.6, 4.0 ), - dz_par2 = ( 0.45, 4.0 ) - ), #end of pset - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.tightMTS.clone( - name = 'pixelPairStepTight', - preFilterName = 'pixelPairStepLoose', - chi2n_par = 0.6, - res_par = ( 0.003, 0.002 ), - minNumberLayers = 4, - maxNumberLostLayers = 2, - minNumber3DLayers = 3, - d0_par1 = ( 0.35, 4.0 ), - dz_par1 = ( 0.35, 4.0 ), - d0_par2 = ( 0.5, 4.0 ), - dz_par2 = ( 0.4, 4.0 ) - ), - RecoTracker.FinalTrackSelectors.multiTrackSelector_cfi.highpurityMTS.clone( - name = 'pixelPairStep', - preFilterName = 'pixelPairStepTight', -# min_eta = -4.0, # useless, the eta distribution does not even reach |eta| = 3 (!) -# max_eta = 4.0, - chi2n_par = 0.5, - res_par = ( 0.003, 0.001 ), - minNumberLayers = 4, - maxNumberLostLayers = 2, - minNumber3DLayers = 3, - d0_par1 = ( 0.3, 4.0 ), - dz_par1 = ( 0.3, 4.0 ), - d0_par2 = ( 0.45, 4.0 ), - dz_par2 = ( 0.35, 4.0 ) - ), - ), #end of vpset - vertices = 'firstStepPrimaryVertices' -) #end of clone +vectorHits.toModify(pixelPairStepSelector.trackSelectors[2], minNumberLayers = 3, minNumber3DLayers = 3) # Final sequence PixelPairStepTask = cms.Task(pixelPairStepClusters, From 41ed2adb2ab1a0f7cf00a9ce996f2b6ec9b973aa Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 01:12:53 +0200 Subject: [PATCH 476/778] add renamed files --- .../test/VectorHitsBuilderValidation.cc | 1137 +++++++++++++++++ .../test/VectorHitsBuilderValidation.h | 152 +++ 2 files changed, 1289 insertions(+) create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.cc create mode 100644 RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.h diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.cc new file mode 100644 index 0000000000000..aac23a7052c51 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.cc @@ -0,0 +1,1137 @@ +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" +#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticleFwd.h" +#include "SimTracker/TrackerHitAssociation/interface/ClusterTPAssociation.h" +#include "RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.h" +#include "Geometry/CommonDetUnit/interface/StackGeomDet.h" +#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" + +VectorHitsBuilderValidation::VectorHitsBuilderValidation(const edm::ParameterSet& conf) + : cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) { + srcClu_ = + consumes<edmNew::DetSetVector<Phase2TrackerCluster1D> >(edm::InputTag(conf.getParameter<std::string>("src"))); + VHacc_ = consumes<VectorHitCollection>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_acc"))); + VHrej_ = consumes<VectorHitCollection>(edm::InputTag(conf.getParameter<edm::InputTag>("VH_rej"))); + siphase2OTSimLinksToken_ = consumes<edm::DetSetVector<PixelDigiSimLink> >(conf.getParameter<edm::InputTag>("links")); + simHitsToken_ = consumes<edm::PSimHitContainer>(edm::InputTag("g4SimHits", "TrackerHitsPixelBarrelLowTof")); + simTracksToken_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits")); + simVerticesToken_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits")); + trackingParticleToken_ = + consumes<TrackingParticleCollection>(conf.getParameter<edm::InputTag>("trackingParticleSrc")); +} + +VectorHitsBuilderValidation::~VectorHitsBuilderValidation() {} + +void VectorHitsBuilderValidation::beginJob() { + edm::Service<TFileService> fs; + fs->file().cd("/"); + TFileDirectory td = fs->mkdir("Common"); + + //Create common ntuple + tree_ = td.make<TTree>("VectorHits", "VectorHits"); + + // Create common graphs + TFileDirectory tdGloPos = td.mkdir("GlobalPositions"); + trackerLayoutRZ_[0] = tdGloPos.make<TGraph>(); + trackerLayoutRZ_[0]->SetName("RVsZ_Mixed"); + trackerLayoutRZ_[1] = tdGloPos.make<TGraph>(); + trackerLayoutRZ_[1]->SetName("RVsZ_Pixel"); + trackerLayoutRZ_[2] = tdGloPos.make<TGraph>(); + trackerLayoutRZ_[2]->SetName("RVsZ_Strip"); + trackerLayoutXY_[0] = tdGloPos.make<TGraph>(); + trackerLayoutXY_[0]->SetName("YVsX_Mixed"); + trackerLayoutXY_[1] = tdGloPos.make<TGraph>(); + trackerLayoutXY_[1]->SetName("YVsX_Pixel"); + trackerLayoutXY_[2] = tdGloPos.make<TGraph>(); + trackerLayoutXY_[2]->SetName("YVsX_Strip"); + trackerLayoutXYBar_ = tdGloPos.make<TGraph>(); + trackerLayoutXYBar_->SetName("YVsXBar"); + trackerLayoutXYEC_ = tdGloPos.make<TGraph>(); + trackerLayoutXYEC_->SetName("YVsXEC"); + + TFileDirectory tdLocPos = td.mkdir("LocalPositions"); + localPosXvsDeltaX_[0] = tdLocPos.make<TGraph>(); + localPosXvsDeltaX_[0]->SetName("localPosXvsDeltaX_Mixed"); + localPosXvsDeltaX_[1] = tdLocPos.make<TGraph>(); + localPosXvsDeltaX_[1]->SetName("localPosXvsDeltaX_Pixel"); + localPosXvsDeltaX_[2] = tdLocPos.make<TGraph>(); + localPosXvsDeltaX_[2]->SetName("localPosXvsDeltaX_Strip"); + localPosYvsDeltaY_[0] = tdLocPos.make<TGraph>(); + localPosYvsDeltaY_[0]->SetName("localPosYvsDeltaY_Mixed"); + localPosYvsDeltaY_[1] = tdLocPos.make<TGraph>(); + localPosYvsDeltaY_[1]->SetName("localPosYvsDeltaY_Pixel"); + localPosYvsDeltaY_[2] = tdLocPos.make<TGraph>(); + localPosYvsDeltaY_[2]->SetName("localPosYvsDeltaY_Strip"); + + //drawing VHs arrows + TFileDirectory tdArr = td.mkdir("Directions"); + + TFileDirectory tdWid = td.mkdir("CombinatorialStudies"); + ParallaxCorrectionRZ_ = + tdWid.make<TH2D>("ParallaxCorrectionRZ", "ParallaxCorrectionRZ", 100, 0., 300., 100., 0., 120.); + ParallaxCorrectionRZ_->SetName("ParallaxCorrectionFactor"); + VHaccLayer_ = tdWid.make<TH1F>("VHacceptedLayer", "VHacceptedLayer", 250, 0., 250.); + VHaccLayer_->SetName("VHaccepted"); + VHrejLayer_ = tdWid.make<TH1F>("VHrejectedLayer", "VHrejectedLayer", 250, 0., 250.); + VHrejLayer_->SetName("VHrejected"); + VHaccTrueLayer_ = tdWid.make<TH1F>("VHaccTrueLayer", "VHaccTrueLayer", 250, 0., 250.); + VHaccTrueLayer_->SetName("VHaccepted_true"); + VHrejTrueLayer_ = tdWid.make<TH1F>("VHrejTrueLayer", "VHrejTrueLayer", 250, 0., 250.); + VHrejTrueLayer_->SetName("VHrejected_true"); + VHaccTrue_signal_Layer_ = tdWid.make<TH1F>("VHaccTrueSignalLayer", "VHaccTrueSignalLayer", 250, 0., 250.); + VHaccTrue_signal_Layer_->SetName("VHaccepted_true_signal"); + VHrejTrue_signal_Layer_ = tdWid.make<TH1F>("VHrejTrueSignalLayer", "VHrejTrueSignalLayer", 250, 0., 250.); + VHrejTrue_signal_Layer_->SetName("VHrejected_true_signal"); +} + +void VectorHitsBuilderValidation::endJob() {} + +void VectorHitsBuilderValidation::analyze(const edm::Event& event, const edm::EventSetup& eventSetup) { + // Get the needed objects + + // Get the clusters + edm::Handle<Phase2TrackerCluster1DCollectionNew> clusters; + event.getByToken(srcClu_, clusters); + + // Get the vector hits + edm::Handle<VectorHitCollection> vhsAcc; + event.getByToken(VHacc_, vhsAcc); + + edm::Handle<VectorHitCollection> vhsRej; + event.getByToken(VHrej_, vhsRej); + + // load the cpe via the eventsetup + edm::ESHandle<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpeHandle; + eventSetup.get<TkPhase2OTCPERecord>().get(cpeTag_, cpeHandle); + cpe_ = cpeHandle.product(); + + // Get the Phase2 DigiSimLink + edm::Handle<edm::DetSetVector<PixelDigiSimLink> > siphase2SimLinks; + event.getByToken(siphase2OTSimLinksToken_, siphase2SimLinks); + + // Get the SimHits + edm::Handle<edm::PSimHitContainer> simHitsRaw; + event.getByToken(simHitsToken_, simHitsRaw); + + // Get the SimTracks + edm::Handle<edm::SimTrackContainer> simTracksRaw; + event.getByToken(simTracksToken_, simTracksRaw); + + // Get the SimVertex + edm::Handle<edm::SimVertexContainer> simVertices; + event.getByToken(simVerticesToken_, simVertices); + + // Get the geometry + edm::ESHandle<TrackerGeometry> geomHandle; + eventSetup.get<TrackerDigiGeometryRecord>().get(geomHandle); + tkGeom_ = &(*geomHandle); + + // Get the Topology + edm::ESHandle<TrackerTopology> tTopoHandle; + eventSetup.get<TrackerTopologyRcd>().get(tTopoHandle); + tkTopo_ = tTopoHandle.product(); + + edm::ESHandle<MagneticField> magFieldHandle; + eventSetup.get<IdealMagneticFieldRecord>().get(magFieldHandle); + magField_ = magFieldHandle.product(); + + //Tracking Particle collection + edm::Handle<TrackingParticleCollection> TPCollectionH; + event.getByToken(trackingParticleToken_, TPCollectionH); + + auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH); + std::map<std::pair<size_t, EncodedEventId>, TrackingParticleRef> mapping; + + for (TrackingParticleCollection::size_type itp = 0; itp < TPCollectionH.product()->size(); ++itp) { + TrackingParticleRef trackingParticle(TPCollectionH, itp); + EncodedEventId eid(trackingParticle->eventId()); + for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin(); + itrk != trackingParticle->g4Track_end(); + ++itrk) { + std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid); + LogTrace("VectorHitsBuilderValidation") + << "creating map for id: " << trkid.first << " with tp: " << trackingParticle.key(); + mapping.insert(std::make_pair(trkid, trackingParticle)); + } + } + + //set up for tree + int eventNum; + int layer; + int module_id; + int module_number; + int module_type; //1: pixel, 2: strip + int VHacc = 0.0; + int VHrej = 0.0; + int vh_isTrue; + + float x_global, y_global, z_global; + float vh_x_local, vh_y_local; + float vh_x_le, vh_y_le; + float curvature, phi; + float QOverPT, QOverP; + float chi2; + + int low_tp_id, upp_tp_id; + float vh_sim_trackPt; + float sim_x_local, sim_y_local; + float sim_x_global, sim_y_global, sim_z_global; + float low_x_global, low_y_global, low_z_global; + float upp_x_global, upp_y_global, upp_z_global; + float low_xx_global_err, low_yy_global_err, low_zz_global_err; + float low_xy_global_err, low_zx_global_err, low_zy_global_err; + float upp_xx_global_err, upp_yy_global_err, upp_zz_global_err; + float upp_xy_global_err, upp_zx_global_err, upp_zy_global_err; + float deltaXVHSimHits, deltaYVHSimHits; + int multiplicity; + float width, deltaXlocal; + unsigned int processType(99); + + tree_->Branch("event", &eventNum, "eventNum/I"); + tree_->Branch("accepted", &VHacc, "VHacc/I"); + tree_->Branch("rejected", &VHrej, "VHrej/I"); + tree_->Branch("layer", &layer, "layer/I"); + tree_->Branch("module_id", &module_id, "module_id/I"); + tree_->Branch("module_type", &module_type, "module_type/I"); + tree_->Branch("module_number", &module_number, "module_number/I"); + tree_->Branch("vh_isTrue", &vh_isTrue, "vh_isTrue/I"); + tree_->Branch("x_global", &x_global, "x_global/F"); + tree_->Branch("y_global", &y_global, "y_global/F"); + tree_->Branch("z_global", &z_global, "z_global/F"); + tree_->Branch("vh_x_local", &vh_x_local, "vh_x_local/F"); + tree_->Branch("vh_y_local", &vh_y_local, "vh_y_local/F"); + tree_->Branch("vh_x_lError", &vh_x_le, "vh_x_le/F"); + tree_->Branch("vh_y_lError", &vh_y_le, "vh_y_le/F"); + tree_->Branch("curvature", &curvature, "curvature/F"); + tree_->Branch("chi2", &chi2, "chi2/F"); + tree_->Branch("phi", &phi, "phi/F"); + tree_->Branch("QOverP", &QOverP, "QOverP/F"); + tree_->Branch("QOverPT", &QOverPT, "QOverPT/F"); + tree_->Branch("low_tp_id", &low_tp_id, "low_tp_id/I"); + tree_->Branch("upp_tp_id", &upp_tp_id, "upp_tp_id/I"); + tree_->Branch("vh_sim_trackPt", &vh_sim_trackPt, "vh_sim_trackPt/F"); + tree_->Branch("sim_x_local", &sim_x_local, "sim_x_local/F"); + tree_->Branch("sim_y_local", &sim_y_local, "sim_y_local/F"); + tree_->Branch("sim_x_global", &sim_x_global, "sim_x_global/F"); + tree_->Branch("sim_y_global", &sim_y_global, "sim_y_global/F"); + tree_->Branch("sim_z_global", &sim_z_global, "sim_z_global/F"); + tree_->Branch("low_x_global", &low_x_global, "low_x_global/F"); + tree_->Branch("low_y_global", &low_y_global, "low_y_global/F"); + tree_->Branch("low_z_global", &low_z_global, "low_z_global/F"); + tree_->Branch("low_xx_global_err", &low_xx_global_err, "low_xx_global_err/F"); + tree_->Branch("low_yy_global_err", &low_yy_global_err, "low_yy_global_err/F"); + tree_->Branch("low_zz_global_err", &low_zz_global_err, "low_zz_global_err/F"); + tree_->Branch("low_xy_global_err", &low_xy_global_err, "low_xy_global_err/F"); + tree_->Branch("low_zx_global_err", &low_zx_global_err, "low_zx_global_err/F"); + tree_->Branch("low_zy_global_err", &low_zy_global_err, "low_zy_global_err/F"); + tree_->Branch("upp_x_global", &upp_x_global, "upp_x_global/F"); + tree_->Branch("upp_y_global", &upp_y_global, "upp_y_global/F"); + tree_->Branch("upp_z_global", &upp_z_global, "upp_z_global/F"); + tree_->Branch("upp_xx_global_err", &upp_xx_global_err, "upp_xx_global_err/F"); + tree_->Branch("upp_yy_global_err", &upp_yy_global_err, "upp_yy_global_err/F"); + tree_->Branch("upp_zz_global_err", &upp_zz_global_err, "upp_zz_global_err/F"); + tree_->Branch("upp_xy_global_err", &upp_xy_global_err, "upp_xy_global_err/F"); + tree_->Branch("upp_zx_global_err", &upp_zx_global_err, "upp_zx_global_err/F"); + tree_->Branch("upp_zy_global_err", &upp_zy_global_err, "upp_zy_global_err/F"); + tree_->Branch("deltaXVHSimHits", &deltaXVHSimHits, "deltaXVHSimHits/F"); + tree_->Branch("deltaYVHSimHits", &deltaYVHSimHits, "deltaYVHSimHits/F"); + tree_->Branch("multiplicity", &multiplicity, "multiplicity/I"); + tree_->Branch("width", &width, "width/F"); + tree_->Branch("deltaXlocal", &deltaXlocal, "deltaXlocal/F"); + tree_->Branch("processType", &processType, "processType/i"); + + // Rearrange the simTracks for ease of use <simTrackID, simTrack> + SimTracksMap simTracks; + for (const auto& simTrackIt : *simTracksRaw.product()) + simTracks.emplace(std::pair<unsigned int, SimTrack>(simTrackIt.trackId(), simTrackIt)); + + // Rearrange the simHits by detUnit for ease of use + SimHitsMap simHitsDetUnit; + SimHitsMap simHitsTrackId; + for (const auto& simHitIt : *simHitsRaw.product()) { + SimHitsMap::iterator simHitsDetUnitIt(simHitsDetUnit.find(simHitIt.detUnitId())); + if (simHitsDetUnitIt == simHitsDetUnit.end()) { + std::pair<SimHitsMap::iterator, bool> newIt(simHitsDetUnit.insert( + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt.detUnitId(), std::vector<PSimHit>()))); + simHitsDetUnitIt = newIt.first; + } + simHitsDetUnitIt->second.push_back(simHitIt); + + SimHitsMap::iterator simHitsTrackIdIt(simHitsTrackId.find(simHitIt.trackId())); + if (simHitsTrackIdIt == simHitsTrackId.end()) { + std::pair<SimHitsMap::iterator, bool> newIt(simHitsTrackId.insert( + std::pair<unsigned int, std::vector<PSimHit> >(simHitIt.trackId(), std::vector<PSimHit>()))); + simHitsTrackIdIt = newIt.first; + } + simHitsTrackIdIt->second.push_back(simHitIt); + } + + //Printout outer tracker clusters in the event + for (const auto& DSViter : *clusters) { + unsigned int rawid(DSViter.detId()); + DetId detId(rawid); + const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(detId)); + const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); + for (const auto& clustIt : DSViter) { + auto&& lparams = cpe_->localParameters(clustIt, *theGeomDet); + Global3DPoint gparams = theGeomDet->surface().toGlobal(lparams.first); + LogTrace("VectorHitsBuilderValidation") << "phase2 OT clusters: " << gparams << " DetId: " << rawid; + } + } + + for (const auto& DSViter : *vhsAcc) { + for (const auto& vhIt : DSViter) { + LogTrace("VectorHitsBuilderValidation") << "accepted VH: " << vhIt; + } + } + for (const auto& DSViter : *vhsRej) { + for (const auto& vhIt : DSViter) { + LogTrace("VectorHitsBuilderValidation") << "rejected VH: " << vhIt; + } + } + // Validation + eventNum = event.id().event(); + + unsigned int nVHsTot(0), nVHsPSTot(0), nVHs2STot(0); + std::vector<Global3DPoint> glVHs; + std::vector<Global3DVector> dirVHs; + std::vector<int> detIds; + + // Loop over modules + for (const auto DSViter : *vhsAcc) { + // Get the detector unit's id + unsigned int rawid(DSViter.detId()); + module_id = rawid; + DetId detId(rawid); + + module_number = getModuleNumber(detId); + layer = getLayerNumber(detId); + + LogDebug("VectorHitsBuilderValidation") << "Layer: " << layer << " det id" << rawid << std::endl; + + // Get the geometry of the tracker + const GeomDet* geomDet(tkGeom_->idToDet(detId)); + if (!geomDet) + break; + + // Create histograms for the layer if they do not yet exist + std::map<unsigned int, VHHistos>::iterator histogramLayer(histograms_.find(layer)); + if (histogramLayer == histograms_.end()) + histogramLayer = createLayerHistograms(layer); + // Number of clusters + unsigned int nVHsPS(0), nVHs2S(0); + + LogDebug("VectorHitsBuilderValidation") << "DSViter size: " << DSViter.size(); + + // Loop over the vhs in the detector unit + for (const auto& vhIt : DSViter) { + // vh variables + if (vhIt.isValid()) { + LogDebug("VectorHitsBuilderValidation") << " vh analyzing ..."; + chi2 = vhIt.chi2(); + LogTrace("VectorHitsBuilderValidation") << "VH chi2 " << chi2 << std::endl; + + Local3DPoint localPosVH = vhIt.localPosition(); + vh_x_local = localPosVH.x(); + vh_y_local = localPosVH.y(); + LogTrace("VectorHitsBuilderValidation") << "local VH position " << localPosVH << std::endl; + + LocalError localErrVH = vhIt.localPositionError(); + vh_x_le = localErrVH.xx(); + vh_y_le = localErrVH.yy(); + LogTrace("VectorHitsBuilderValidation") << "local VH error " << localErrVH << std::endl; + + Global3DPoint globalPosVH = geomDet->surface().toGlobal(localPosVH); + x_global = globalPosVH.x(); + y_global = globalPosVH.y(); + z_global = globalPosVH.z(); + glVHs.push_back(globalPosVH); + LogTrace("VectorHitsBuilderValidation") << " global VH position " << globalPosVH << std::endl; + + Local3DVector localDirVH = vhIt.localDirection(); + LogTrace("VectorHitsBuilderValidation") << "local VH direction " << localDirVH << std::endl; + + VectorHit vh = vhIt; + Global3DVector globalDirVH = vh.globalDirectionVH(); + dirVHs.push_back(globalDirVH); + LogTrace("VectorHitsBuilderValidation") << "global VH direction " << globalDirVH << std::endl; + + // Fill the position histograms + trackerLayoutRZ_[0]->SetPoint(nVHsTot, globalPosVH.z(), globalPosVH.perp()); + trackerLayoutXY_[0]->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + + if (layer < 100) + trackerLayoutXYBar_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + else + trackerLayoutXYEC_->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + + histogramLayer->second.localPosXY[0]->SetPoint(nVHsTot, vh_x_local, vh_y_local); + histogramLayer->second.globalPosXY[0]->SetPoint(nVHsTot, globalPosVH.x(), globalPosVH.y()); + + localPosXvsDeltaX_[0]->SetPoint(nVHsTot, vh_x_local, localDirVH.x()); + localPosYvsDeltaY_[0]->SetPoint(nVHsTot, vh_y_local, localDirVH.y()); + + // Pixel module + const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); + const PixelGeomDetUnit* geomDetLower = dynamic_cast<const PixelGeomDetUnit*>(stackDet->lowerDet()); + DetId lowerDetId = stackDet->lowerDet()->geographicalId(); + DetId upperDetId = stackDet->upperDet()->geographicalId(); + + TrackerGeometry::ModuleType mType = tkGeom_->getDetectorType(lowerDetId); + module_type = 0; + if (mType == TrackerGeometry::ModuleType::Ph2PSP) { + module_type = 1; + trackerLayoutRZ_[1]->SetPoint(nVHsPSTot, globalPosVH.z(), globalPosVH.perp()); + trackerLayoutXY_[1]->SetPoint(nVHsPSTot, globalPosVH.x(), globalPosVH.y()); + + histogramLayer->second.localPosXY[1]->SetPoint(nVHsPSTot, vh_x_local, vh_y_local); + histogramLayer->second.globalPosXY[1]->SetPoint(nVHsPSTot, globalPosVH.x(), globalPosVH.y()); + + localPosXvsDeltaX_[1]->SetPoint(nVHsPSTot, vh_x_local, localDirVH.x()); + localPosYvsDeltaY_[1]->SetPoint(nVHsPSTot, vh_y_local, localDirVH.y()); + + ++nVHsPS; + ++nVHsPSTot; + } + + // Strip module + else if (mType == TrackerGeometry::ModuleType::Ph2SS) { + module_type = 2; + trackerLayoutRZ_[2]->SetPoint(nVHs2STot, globalPosVH.z(), globalPosVH.perp()); + trackerLayoutXY_[2]->SetPoint(nVHs2STot, globalPosVH.x(), globalPosVH.y()); + + histogramLayer->second.localPosXY[2]->SetPoint(nVHs2STot, vh_x_local, vh_y_local); + histogramLayer->second.globalPosXY[2]->SetPoint(nVHs2STot, globalPosVH.x(), globalPosVH.y()); + + localPosXvsDeltaX_[2]->SetPoint(nVHs2STot, vh_x_local, localDirVH.x()); + localPosYvsDeltaY_[2]->SetPoint(nVHs2STot, vh_y_local, localDirVH.y()); + + ++nVHs2S; + ++nVHs2STot; + } else if (mType == TrackerGeometry::ModuleType::Ph2PSS) { + edm::LogError("VectorHitsBuilderValidation") << "module type " << module_type << " should never happen!"; + } + LogTrace("VectorHitsBuilderValidation") << "module type " << module_type << std::endl; + + // get the geomDetUnit of the clusters + low_x_global = vhIt.lowerGlobalPos().x(); + low_y_global = vhIt.lowerGlobalPos().y(); + low_z_global = vhIt.lowerGlobalPos().z(); + upp_x_global = vhIt.upperGlobalPos().x(); + upp_y_global = vhIt.upperGlobalPos().y(); + upp_z_global = vhIt.upperGlobalPos().z(); + + low_xx_global_err = vhIt.lowerGlobalPosErr().cxx(); + low_yy_global_err = vhIt.lowerGlobalPosErr().cyy(); + low_zz_global_err = vhIt.lowerGlobalPosErr().czz(); + low_xy_global_err = vhIt.lowerGlobalPosErr().cyx(); + low_zx_global_err = vhIt.lowerGlobalPosErr().czx(); + low_zy_global_err = vhIt.lowerGlobalPosErr().czy(); + + upp_xx_global_err = vhIt.upperGlobalPosErr().cxx(); + upp_yy_global_err = vhIt.upperGlobalPosErr().cyy(); + upp_zz_global_err = vhIt.upperGlobalPosErr().czz(); + upp_xy_global_err = vhIt.upperGlobalPosErr().cyx(); + upp_zx_global_err = vhIt.upperGlobalPosErr().czx(); + upp_zy_global_err = vhIt.upperGlobalPosErr().czy(); + + LogDebug("VectorHitsBuilderValidation") << "print Clusters into the VH:" << std::endl; + printCluster(geomDetLower, vhIt.lowerClusterRef()); + LogTrace("VectorHitsBuilderValidation") << "\t global pos lower " << vhIt.lowerGlobalPos() << std::endl; + LogTrace("VectorHitsBuilderValidation") + << "\t global posErr lower " << vhIt.lowerGlobalPosErr().cxx() << std::endl; + const GeomDetUnit* geomDetUpper = stackDet->upperDet(); + printCluster(geomDetUpper, vhIt.upperClusterRef()); + LogTrace("VectorHitsBuilderValidation") << "\t global pos upper " << vhIt.upperGlobalPos() << std::endl; + + //comparison with SIM hits + LogDebug("VectorHitsBuilderValidation") << "comparison Clusters with sim hits ... " << std::endl; + std::vector<unsigned int> clusterSimTrackIds; + std::vector<unsigned int> clusterSimTrackIdsUpp; + std::set<std::pair<uint32_t, EncodedEventId> > simTkIds; + const GeomDetUnit* geomDetUnit_low(tkGeom_->idToDetUnit(lowerDetId)); + LogTrace("VectorHitsBuilderValidation") << " lowerDetID : " << lowerDetId.rawId(); + const GeomDetUnit* geomDetUnit_upp(tkGeom_->idToDetUnit(upperDetId)); + LogTrace("VectorHitsBuilderValidation") << " upperDetID : " << upperDetId.rawId(); + + for (unsigned int istr(0); istr < (*(vhIt.lowerClusterRef().cluster_phase2OT())).size(); ++istr) { + uint32_t channel = + Phase2TrackerDigi::pixelToChannel((*(vhIt.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vhIt.lowerClusterRef().cluster_phase2OT())).column()); + unsigned int LowerSimTrackId(getSimTrackId(siphase2SimLinks, lowerDetId, channel)); + std::vector<std::pair<uint32_t, EncodedEventId> > trkid( + getSimTrackIds(siphase2SimLinks, lowerDetId, channel)); + if (trkid.size() == 0) + continue; + clusterSimTrackIds.push_back(LowerSimTrackId); + simTkIds.insert(trkid.begin(), trkid.end()); + LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << LowerSimTrackId << std::endl; + } + // In the case of PU, we need the TPs to find the proper SimTrackID + for (const auto& iset : simTkIds) { + auto ipos = mapping.find(iset); + if (ipos != mapping.end()) { + LogTrace("VectorHitsBuilderValidation") << "lower cluster in detid: " << lowerDetId.rawId() + << " from tp: " << ipos->second.key() << " " << iset.first; + LogTrace("VectorHitsBuilderValidation") << "with pt(): " << (*ipos->second).pt(); + low_tp_id = ipos->second.key(); + vh_sim_trackPt = (*ipos->second).pt(); + } + } + + simTkIds.clear(); + for (unsigned int istr(0); istr < (*(vhIt.upperClusterRef().cluster_phase2OT())).size(); ++istr) { + uint32_t channel = + Phase2TrackerDigi::pixelToChannel((*(vhIt.upperClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vhIt.upperClusterRef().cluster_phase2OT())).column()); + unsigned int UpperSimTrackId(getSimTrackId(siphase2SimLinks, upperDetId, channel)); + std::vector<std::pair<uint32_t, EncodedEventId> > trkid( + getSimTrackIds(siphase2SimLinks, upperDetId, channel)); + if (trkid.size() == 0) + continue; + clusterSimTrackIdsUpp.push_back(UpperSimTrackId); + simTkIds.insert(trkid.begin(), trkid.end()); + LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << UpperSimTrackId << std::endl; + } + // In the case of PU, we need the TPs to find the proper SimTrackID + for (const auto& iset : simTkIds) { + auto ipos = mapping.find(iset); + if (ipos != mapping.end()) { + LogTrace("VectorHitsBuilderValidation") + << "upper cluster in detid: " << upperDetId.rawId() << " from tp: " << ipos->second.key() << " " + << iset.first << std::endl; + upp_tp_id = ipos->second.key(); + } + } + //compute if the vhits is 'true' or 'false' and save sim pT + std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); + vh_isTrue = 0; + if (istrue.first) { + vh_isTrue = 1; + } + + // loop over all simHits + unsigned int totalSimHits(0); + unsigned int primarySimHits(0); + unsigned int otherSimHits(0); + + for (const auto& hitIt : *simHitsRaw) { + if (hitIt.detUnitId() == geomDetLower->geographicalId()) { + //check clusters track id compatibility + if (std::find(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), hitIt.trackId()) != + clusterSimTrackIds.end()) { + Local3DPoint localPosHit(hitIt.localPosition()); + sim_x_local = localPosHit.x(); + sim_y_local = localPosHit.y(); + + deltaXVHSimHits = vh_x_local - sim_x_local; + deltaYVHSimHits = vh_y_local - sim_y_local; + + Global3DPoint globalPosHit = geomDetLower->surface().toGlobal(localPosHit); + sim_x_global = globalPosHit.x(); + sim_y_global = globalPosHit.y(); + sim_z_global = globalPosHit.z(); + + histogramLayer->second.deltaXVHSimHits[0]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits[0]->Fill(vh_y_local - sim_y_local); + + // Pixel module + if (layer == 1 || layer == 2 || layer == 3) { + histogramLayer->second.deltaXVHSimHits[1]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits[1]->Fill(vh_y_local - sim_y_local); + } + // Strip module + else if (layer == 4 || layer == 5 || layer == 6) { + histogramLayer->second.deltaXVHSimHits[2]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits[2]->Fill(vh_y_local - sim_y_local); + } + + ++totalSimHits; + + std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(hitIt.trackId())); + if (simTrackIt == simTracks.end()) + continue; + + // Primary particles only + processType = hitIt.processType(); + + if (simTrackIt->second.vertIndex() == 0 and + (processType == 2 || processType == 7 || processType == 9 || processType == 11 || processType == 13 || + processType == 15)) { + histogramLayer->second.deltaXVHSimHits_P[0]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[0]->Fill(vh_y_local - sim_y_local); + + // Pixel module + if (layer == 1 || layer == 2 || layer == 3) { + histogramLayer->second.deltaXVHSimHits_P[1]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[1]->Fill(vh_y_local - sim_y_local); + } + // Strip module + else if (layer == 4 || layer == 5 || layer == 6) { + histogramLayer->second.deltaXVHSimHits_P[2]->Fill(vh_x_local - sim_x_local); + histogramLayer->second.deltaYVHSimHits_P[2]->Fill(vh_y_local - sim_y_local); + } + + ++primarySimHits; + } + + otherSimHits = totalSimHits - primarySimHits; + + histogramLayer->second.totalSimHits->Fill(totalSimHits); + histogramLayer->second.primarySimHits->Fill(primarySimHits); + histogramLayer->second.otherSimHits->Fill(otherSimHits); + } + } + } // loop simhits + + nVHsTot++; + + //****************************** + //combinatorial studies : not filling if more than 1 VH has been produced + //****************************** + multiplicity = DSViter.size(); + if (DSViter.size() > 1) { + LogTrace("VectorHitsBuilderValidation") << " not filling if more than 1 VH has been produced"; + width = -100; + deltaXlocal = -100; + tree_->Fill(); + continue; + } + + //curvature + GlobalPoint center(0.0, 0.0, 0.0); + curvature = vh.curvature(); + phi = vh.phi(); + QOverPT = vh.transverseMomentum(magField_->inTesla(center).z()); + QOverP = vh.momentum(magField_->inTesla(center).z()); + histogramLayer->second.curvature->Fill(curvature); + + //stub width + + auto&& lparamsUpp = cpe_->localParameters(*vhIt.upperClusterRef().cluster_phase2OT(), *geomDetUnit_upp); + LogTrace("VectorHitsBuilderValidation") << " upper local pos (in its system of reference):" << lparamsUpp.first; + Global3DPoint gparamsUpp = geomDetUnit_upp->surface().toGlobal(lparamsUpp.first); + LogTrace("VectorHitsBuilderValidation") << " upper global pos :" << gparamsUpp; + Local3DPoint lparamsUppInLow = geomDetUnit_low->surface().toLocal(gparamsUpp); + LogTrace("VectorHitsBuilderValidation") << " upper local pos (in low system of reference):" << lparamsUppInLow; + auto&& lparamsLow = cpe_->localParameters(*vhIt.lowerClusterRef().cluster_phase2OT(), *geomDetUnit_low); + LogTrace("VectorHitsBuilderValidation") << " lower local pos (in its system of reference):" << lparamsLow.first; + Global3DPoint gparamsLow = geomDetUnit_low->surface().toGlobal(lparamsLow.first); + LogTrace("VectorHitsBuilderValidation") << " lower global pos :" << gparamsLow; + + deltaXlocal = lparamsUppInLow.x() - lparamsLow.first.x(); + histogramLayer->second.deltaXlocal->Fill(deltaXlocal); + LogTrace("VectorHitsBuilderValidation") << " deltaXlocal : " << deltaXlocal; + + double parallCorr = 0.0; + + Global3DPoint origin(0, 0, 0); + GlobalVector gV = gparamsLow - origin; + LocalVector lV = geomDetUnit_low->surface().toLocal(gV); + LocalVector lV_norm = lV / lV.z(); + parallCorr = lV_norm.x() * lparamsUppInLow.z(); + LogTrace("VectorHitsBuilderValidation") << " parallalex correction:" << parallCorr; + + double lpos_upp_corr = 0.0; + double lpos_low_corr = 0.0; + if (lparamsUpp.first.x() > lparamsLow.first.x()) { + if (lparamsUpp.first.x() > 0) { + lpos_low_corr = lparamsLow.first.x(); + lpos_upp_corr = lparamsUpp.first.x() - fabs(parallCorr); + } + if (lparamsUpp.first.x() < 0) { + lpos_low_corr = lparamsLow.first.x() + fabs(parallCorr); + lpos_upp_corr = lparamsUpp.first.x(); + } + } else if (lparamsUpp.first.x() < lparamsLow.first.x()) { + if (lparamsUpp.first.x() > 0) { + lpos_low_corr = lparamsLow.first.x() - fabs(parallCorr); + lpos_upp_corr = lparamsUpp.first.x(); + } + if (lparamsUpp.first.x() < 0) { + lpos_low_corr = lparamsLow.first.x(); + lpos_upp_corr = lparamsUpp.first.x() + fabs(parallCorr); + } + } else { + if (lparamsUpp.first.x() > 0) { + lpos_upp_corr = lparamsUpp.first.x() - fabs(parallCorr); + lpos_low_corr = lparamsLow.first.x(); + } + if (lparamsUpp.first.x() < 0) { + lpos_upp_corr = lparamsUpp.first.x() + fabs(parallCorr); + lpos_low_corr = lparamsLow.first.x(); + } + } + + LogDebug("VectorHitsBuilderValidation") << " \t local pos upper corrected (x):" << lpos_upp_corr << std::endl; + LogDebug("VectorHitsBuilderValidation") << " \t local pos lower corrected (x):" << lpos_low_corr << std::endl; + + width = lpos_low_corr - lpos_upp_corr; + histogramLayer->second.width->Fill(width); + LogTrace("VectorHitsBuilderValidation") << " width:" << width; + + tree_->Fill(); + + } // vh valid + + } // loop vhs + + if (nVHsPS) + histogramLayer->second.numberVHsPS->Fill(nVHsPS); + if (nVHs2S) + histogramLayer->second.numberVHs2S->Fill(nVHs2S); + LogTrace("VectorHitsBuilderValidation") + << "nVHsPS for this layer : " << nVHsPS << ", nVHs2S for this layer : " << nVHs2S << std::endl; + } + + CreateVHsXYGraph(glVHs, dirVHs); + CreateVHsRZGraph(glVHs, dirVHs); + + int VHaccTrue = 0.0; + int VHaccFalse = 0.0; + int VHrejTrue = 0.0; + int VHrejFalse = 0.0; + int VHaccTrue_signal = 0.0; + int VHrejTrue_signal = 0.0; + + // Loop over modules + for (const auto& DSViter : *vhsAcc) { + unsigned int rawid(DSViter.detId()); + DetId detId(rawid); + int layerAcc = getLayerNumber(detId); + LogTrace("VectorHitsBuilderValidation") << "acc Layer: " << layerAcc << " det id" << rawid << std::endl; + for (const auto& vhIt : DSViter) { + if (vhIt.isValid()) { + VHaccLayer_->Fill(layerAcc); + VHacc++; + + //compute if the vhits is 'true' or 'false' + std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); + if (istrue.first) { + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; + VHaccTrueLayer_->Fill(layerAcc); + VHaccTrue++; + + //saving info of 'signal' track + std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(istrue.second)); + if (simTrackIt == simTracks.end()) + continue; + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is associated with SimTrackId: " << istrue.second; + LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); + if (simTrackIt->second.momentum().pt() > 1) { + VHaccTrue_signal_Layer_->Fill(layerAcc); + LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; + VHaccTrue_signal++; + } + + } else { + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'false' vhit."; + VHaccFalse++; + } + } + } + } + + for (const auto& DSViter : *vhsRej) { + unsigned int rawid(DSViter.detId()); + DetId detId(rawid); + int layerRej = getLayerNumber(detId); + LogTrace("VectorHitsBuilderValidation") << "rej Layer: " << layerRej << " det id" << rawid << std::endl; + for (const auto& vhIt : DSViter) { + VHrejLayer_->Fill(layerRej); + VHrej++; + + //compute if the vhits is 'true' or 'false' + std::pair<bool, uint32_t> istrue = isTrue(vhIt, siphase2SimLinks, detId); + if (istrue.first) { + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'true' vhit."; + VHrejTrueLayer_->Fill(layerRej); + VHrejTrue++; + + //saving info of 'signal' track + std::map<unsigned int, SimTrack>::const_iterator simTrackIt(simTracks.find(istrue.second)); + if (simTrackIt == simTracks.end()) + continue; + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is associated with SimTrackId: " << istrue.second; + LogTrace("VectorHitsBuilderValidation") << "the SimTrack has pt: " << simTrackIt->second.momentum().pt(); + if (simTrackIt->second.momentum().pt() > 1) { + VHrejTrue_signal_Layer_->Fill(layerRej); + LogTrace("VectorHitsBuilderValidation") << "the vectorhit belongs to signal"; + VHrejTrue_signal++; + } + + } else { + LogTrace("VectorHitsBuilderValidation") << "this vectorhit is a 'false' vhit."; + VHrejFalse++; + } + } + } + + int VHtot = VHacc + VHrej; + LogTrace("VectorHitsBuilderValidation") + << "VH total: " << VHtot << " with " << VHacc << " VHs accepted and " << VHrej << " VHs rejected."; + LogTrace("VectorHitsBuilderValidation") + << "of the VH accepted, there are " << VHaccTrue << " true and " << VHaccFalse << " false."; + LogTrace("VectorHitsBuilderValidation") + << "of the VH rejected, there are " << VHrejTrue << " true and " << VHrejFalse << " false."; + LogTrace("VectorHitsBuilderValidation") + << "of the true VH , there are " << VHaccTrue_signal << " accepted belonging to signal and " + << VHrejTrue_signal << " rejected belonging to signal."; + + // CreateWindowCorrGraph(); +} + +// Check if the vector hit is true (both clusters are formed from the same SimTrack +std::pair<bool, uint32_t> VectorHitsBuilderValidation::isTrue( + const VectorHit vh, const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& siphase2SimLinks, DetId& detId) const { + const GeomDet* geomDet(tkGeom_->idToDet(detId)); + const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(geomDet); + const GeomDetUnit* geomDetLower = stackDet->lowerDet(); + const GeomDetUnit* geomDetUpper = stackDet->upperDet(); + + std::vector<unsigned int> lowClusterSimTrackIds; + + for (unsigned int istr(0); istr < (*(vh.lowerClusterRef().cluster_phase2OT())).size(); ++istr) { + uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.lowerClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vh.lowerClusterRef().cluster_phase2OT())).column()); + DetId detIdCluster = geomDetLower->geographicalId(); + unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detIdCluster, channel)); + LogTrace("VectorHitsBuilderValidation") << "LowerSimTrackId " << simTrackId << std::endl; + std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, detIdCluster, channel)); + if (trkid.size() == 0) + continue; + lowClusterSimTrackIds.push_back(simTrackId); + } + + std::vector<unsigned int>::iterator it_simTrackUpper; + + for (unsigned int istr(0); istr < (*(vh.upperClusterRef().cluster_phase2OT())).size(); ++istr) { + uint32_t channel = Phase2TrackerDigi::pixelToChannel((*(vh.upperClusterRef().cluster_phase2OT())).firstRow() + istr, + (*(vh.upperClusterRef().cluster_phase2OT())).column()); + DetId detIdCluster = geomDetUpper->geographicalId(); + unsigned int simTrackId(getSimTrackId(siphase2SimLinks, detIdCluster, channel)); + LogTrace("VectorHitsBuilderValidation") << "UpperSimTrackId " << simTrackId << std::endl; + std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackIds(siphase2SimLinks, detIdCluster, channel)); + if (trkid.size() == 0) + continue; + it_simTrackUpper = std::find(lowClusterSimTrackIds.begin(), lowClusterSimTrackIds.end(), simTrackId); + if (it_simTrackUpper != lowClusterSimTrackIds.end()) { + LogTrace("VectorHitsBuilderValidation") << " UpperSimTrackId found in lowClusterSimTrackIds "; + return std::make_pair(true, simTrackId); + } + } + return std::make_pair(false, 0); +} + +// Create the histograms +std::map<unsigned int, VHHistos>::iterator VectorHitsBuilderValidation::createLayerHistograms(unsigned int ival) { + std::ostringstream fname1, fname2; + + edm::Service<TFileService> fs; + fs->file().cd("/"); + + std::string tag; + unsigned int id; + if (ival < 100) { + id = ival; + fname1 << "Barrel"; + fname2 << "Layer_" << id; + tag = "_layer_"; + } else { + int side = ival / 100; + id = ival - side * 100; + fname1 << "EndCap_Side_" << side; + fname2 << "Disc_" << id; + tag = "_disc_"; + } + + TFileDirectory td1 = fs->mkdir(fname1.str().c_str()); + TFileDirectory td = td1.mkdir(fname2.str().c_str()); + + VHHistos local_histos; + + std::ostringstream histoName; + + /* + * Number of clusters + */ + + histoName.str(""); + histoName << "Number_VHs_PS" << tag.c_str() << id; + local_histos.numberVHsPS = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberVHsPS->SetFillColor(kAzure + 7); + + histoName.str(""); + histoName << "Number_VHs_2S" << tag.c_str() << id; + local_histos.numberVHs2S = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 20, 0., 20.); + local_histos.numberVHs2S->SetFillColor(kOrange - 3); + + histoName.str(""); + histoName << "Number_VHs_Mixed" << tag.c_str() << id; + local_histos.numberVHsMixed = td.make<THStack>(histoName.str().c_str(), histoName.str().c_str()); + local_histos.numberVHsMixed->Add(local_histos.numberVHsPS); + local_histos.numberVHsMixed->Add(local_histos.numberVHs2S); + + /* + * Local and Global positions + */ + + histoName.str(""); + histoName << "Local_Position_XY_Mixed" << tag.c_str() << id; + local_histos.localPosXY[0] = td.make<TGraph>(); + local_histos.localPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Local_Position_XY_PS" << tag.c_str() << id; + local_histos.localPosXY[1] = td.make<TGraph>(); + local_histos.localPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Local_Position_XY_2S" << tag.c_str() << id; + local_histos.localPosXY[2] = td.make<TGraph>(); + local_histos.localPosXY[2]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_Mixed" << tag.c_str() << id; + local_histos.globalPosXY[0] = td.make<TGraph>(); + local_histos.globalPosXY[0]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_PS" << tag.c_str() << id; + local_histos.globalPosXY[1] = td.make<TGraph>(); + local_histos.globalPosXY[1]->SetName(histoName.str().c_str()); + + histoName.str(""); + histoName << "Global_Position_XY_2S" << tag.c_str() << id; + local_histos.globalPosXY[2] = td.make<TGraph>(); + local_histos.globalPosXY[2]->SetName(histoName.str().c_str()); + + /* + * Delta positions with SimHits + */ + + histoName.str(""); + histoName << "Delta_X_VH_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaXVHSimHits[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_X_VH_SimHits_PS" << tag.c_str() << id; + local_histos.deltaXVHSimHits[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_X_VH_SimHits_2S" << tag.c_str() << id; + local_histos.deltaXVHSimHits[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_Mixed" << tag.c_str() << id; + local_histos.deltaYVHSimHits[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_PS" << tag.c_str() << id; + local_histos.deltaYVHSimHits[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_2S" << tag.c_str() << id; + local_histos.deltaYVHSimHits[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + /* + * Delta position with simHits for primary tracks only + */ + + histoName.str(""); + histoName << "Delta_X_VH_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_X_VH_SimHits_PS_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_X_VH_SimHits_2S_P" << tag.c_str() << id; + local_histos.deltaXVHSimHits_P[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_Mixed_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[0] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_PS_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[1] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + histoName.str(""); + histoName << "Delta_Y_VH_SimHits_2S_P" << tag.c_str() << id; + local_histos.deltaYVHSimHits_P[2] = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 100, 0., 0.); + + /* + * Information on the Digis per cluster + */ + + histoName.str(""); + histoName << "Total_Digis" << tag.c_str() << id; + local_histos.totalSimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + + histoName.str(""); + histoName << "Primary_Digis" << tag.c_str() << id; + local_histos.primarySimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + + histoName.str(""); + histoName << "Other_Digis" << tag.c_str() << id; + local_histos.otherSimHits = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 10, 0., 10.); + + /* + * Study on the clusters combinatorial problem + */ + + histoName.str(""); + histoName << "DeltaXlocal_clusters" << tag.c_str() << id; + local_histos.deltaXlocal = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + histoName.str(""); + histoName << "Width" << tag.c_str() << id; + local_histos.width = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + histoName.str(""); + histoName << "Curvature" << tag.c_str() << id; + local_histos.curvature = td.make<TH1F>(histoName.str().c_str(), histoName.str().c_str(), 200, -0.4, 0.4); + + std::pair<std::map<unsigned int, VHHistos>::iterator, bool> insertedIt( + histograms_.insert(std::make_pair(ival, local_histos))); + fs->file().cd("/"); + + return insertedIt.first; +} + +void VectorHitsBuilderValidation::CreateVHsXYGraph(const std::vector<Global3DPoint> glVHs, + const std::vector<Global3DVector> dirVHs) { + if (glVHs.size() != dirVHs.size()) { + std::cout << "Cannot fullfil the graphs for this event. Return." << std::endl; + return; + } + + // opening canvas and drawing XY TGraph + + for (unsigned int nVH = 0; nVH < glVHs.size(); nVH++) { + //same r + if ((fabs(dirVHs.at(nVH).x()) < 10e-5) && (fabs(dirVHs.at(nVH).y()) < 10e-5)) { + continue; + + } else { + } + } + + return; +} + +void VectorHitsBuilderValidation::CreateVHsRZGraph(const std::vector<Global3DPoint> glVHs, + const std::vector<Global3DVector> dirVHs) { + if (glVHs.size() != dirVHs.size()) { + std::cout << "Cannot fullfil the graphs for this event. Return." << std::endl; + return; + } + + return; +} + +void VectorHitsBuilderValidation::CreateWindowCorrGraph() { + //FIXME: This function is not working properly, yet. + + //return if we are not using Phase2 OT + if (!tkGeom_->isThere(GeomDetEnumerators::P2OTB) && !tkGeom_->isThere(GeomDetEnumerators::P2OTEC)) + return; + + for (auto det : tkGeom_->detsTOB()) { + ParallaxCorrectionRZ_->Fill(det->position().z(), det->position().perp(), 5.); + } + for (auto det : tkGeom_->detsTID()) { + ParallaxCorrectionRZ_->Fill(det->position().z(), det->position().perp(), 10.); + } + ParallaxCorrectionRZ_->Fill(0., 0., 5.); + return; +} + +unsigned int VectorHitsBuilderValidation::getLayerNumber(const DetId& detid) { + if (detid.det() == DetId::Tracker) { + if (detid.subdetId() == StripSubdetector::TOB) + return (tkTopo_->layer(detid)); + else if (detid.subdetId() == StripSubdetector::TID) + return (100 * tkTopo_->side(detid) + tkTopo_->layer(detid)); + else + return 999; + } + return 999; +} + +unsigned int VectorHitsBuilderValidation::getModuleNumber(const DetId& detid) { return (tkTopo_->module(detid)); } + +std::vector<std::pair<uint32_t, EncodedEventId> > VectorHitsBuilderValidation::getSimTrackIds( + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& simLinks, const DetId& detId, uint32_t channel) const { + std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId; + auto isearch = simLinks->find(detId); + if (isearch != simLinks->end()) { + // Loop over DigiSimLink in this det unit + edm::DetSet<PixelDigiSimLink> link_detset = (*isearch); + for (const auto& it : link_detset.data) { + if (channel == it.channel()) + simTrkId.push_back(std::make_pair(it.SimTrackId(), it.eventId())); + } + } + return simTrkId; +} + +unsigned int VectorHitsBuilderValidation::getSimTrackId( + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& pixelSimLinks, + const DetId& detId, + unsigned int channel) const { + edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter(pixelSimLinks->find(detId)); + if (DSViter == pixelSimLinks->end()) + return 0; + for (const auto& it : DSViter->data) { + if (channel == it.channel()) + return it.SimTrackId(); + } + return 0; +} + +void VectorHitsBuilderValidation::printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster) { + if (!geomDetUnit) + return; + + const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit); + const PixelTopology& topol = theGeomDet->specificTopology(); + + unsigned int layer = getLayerNumber(geomDetUnit->geographicalId()); + unsigned int module = getModuleNumber(geomDetUnit->geographicalId()); + LogTrace("VectorHitsBuilderValidation") << "Layer:" << layer << std::endl; + if (topol.ncolumns() == 32) + LogTrace("VectorHitsBuilderValidation") << "Pixel cluster with detId:" << geomDetUnit->geographicalId().rawId() + << "(module:" << module << ") " << std::endl; + else if (topol.ncolumns() == 2) + LogTrace("VectorHitsBuilderValidation") << "Strip cluster with detId:" << geomDetUnit->geographicalId().rawId() + << "(module:" << module << ") " << std::endl; + else + std::cout << "no module?!" << std::endl; + LogTrace("VectorHitsBuilderValidation") + << "with pitch:" << topol.pitch().first << " , " << topol.pitch().second << std::endl; + LogTrace("VectorHitsBuilderValidation") << " and width:" << theGeomDet->surface().bounds().width() + << " , lenght:" << theGeomDet->surface().bounds().length() << std::endl; + + auto&& lparams = cpe_->localParameters(*cluster.cluster_phase2OT(), *theGeomDet); + + LogTrace("VectorHitsBuilderValidation") + << "\t local pos " << lparams.first << "with err " << lparams.second << std::endl; + + return; +} + +void VectorHitsBuilderValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add<std::string>("src", "siPhase2Clusters"); + desc.add<edm::InputTag>("links", edm::InputTag("simSiPixelDigis", "Tracker")); + desc.add<edm::InputTag>("VH_acc", edm::InputTag("siPhase2VectorHits", "accepted")); + desc.add<edm::InputTag>("VH_rej", edm::InputTag("siPhase2VectorHits", "rejected")); + desc.add<edm::ESInputTag>("CPE", edm::ESInputTag("phase2StripCPEESProducer", "Phase2StripCPE")); + desc.add<edm::InputTag>("trackingParticleSrc", edm::InputTag("mix", "MergedTrackTruth")); + descriptions.add("vectorHitsBuilderValidation", desc); +} + +DEFINE_FWK_MODULE(VectorHitsBuilderValidation); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.h new file mode 100644 index 0000000000000..f0233dafe4a64 --- /dev/null +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/test/VectorHitsBuilderValidation.h @@ -0,0 +1,152 @@ +#ifndef RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitsBuilderValidation_H +#define RecoLocalTracker_SiPhase2VectorHitBuilder_VectorHitsBuilderValidation_H + +#include <map> +#include <vector> +#include <algorithm> + +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" + +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" +#include "DataFormats/Common/interface/DetSetVector.h" +#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" +#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" +#include "DataFormats/SiPixelDigi/interface/PixelDigi.h" +#include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPE.h" + +#include "SimDataFormats/TrackerDigiSimLink/interface/PixelDigiSimLink.h" +#include "SimDataFormats/Track/interface/SimTrackContainer.h" +#include "SimDataFormats/Vertex/interface/SimVertexContainer.h" +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" + +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "CommonTools/Utils/interface/TFileDirectory.h" + +#include "DataFormats/TrackerRecHit2D/interface/VectorHit.h" +#include "DataFormats/TrackerRecHit2D/interface/OmniClusterRef.h" + +#include <TH1F.h> +#include <TH2D.h> +#include <TGraph.h> +#include <THStack.h> +#include <TCanvas.h> +#include <TTree.h> +#include <TArrow.h> + +struct VHHistos { + THStack* numberVHsMixed; + TH1F* numberVHsPS; + TH1F* numberVHs2S; + + TGraph* globalPosXY[3]; + TGraph* localPosXY[3]; + + TH1F* deltaXVHSimHits[3]; + TH1F* deltaYVHSimHits[3]; + + TH1F* deltaXVHSimHits_P[3]; + TH1F* deltaYVHSimHits_P[3]; + + TH1F* digiEfficiency[3]; + + TH1F* totalSimHits; + TH1F* primarySimHits; + TH1F* otherSimHits; + + TH1F* curvature; + TH1F* width; + TH1F* deltaXlocal; +}; + +class VectorHitsBuilderValidation : public edm::one::EDAnalyzer<edm::one::SharedResources> { +public: + typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; + + typedef std::map<unsigned int, std::vector<PSimHit> > SimHitsMap; + typedef std::map<unsigned int, SimTrack> SimTracksMap; + + explicit VectorHitsBuilderValidation(const edm::ParameterSet&); + ~VectorHitsBuilderValidation(); + void beginJob(); + void endJob(); + void analyze(const edm::Event&, const edm::EventSetup&); + + static void fillDescriptions(edm::ConfigurationDescriptions&); + +private: + std::map<unsigned int, VHHistos>::iterator createLayerHistograms(unsigned int); + void CreateVHsXYGraph(const std::vector<Global3DPoint>, const std::vector<Global3DVector>); + void CreateVHsRZGraph(const std::vector<Global3DPoint>, const std::vector<Global3DVector>); + void CreateWindowCorrGraph(); + + unsigned int getLayerNumber(const DetId&); + unsigned int getModuleNumber(const DetId& detid); + void printCluster(const GeomDetUnit* geomDetUnit, const OmniClusterRef cluster); + + std::pair<bool, uint32_t> isTrue(const VectorHit vh, + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& siphase2SimLinks, + DetId& detId) const; + std::vector<std::pair<uint32_t, EncodedEventId> > getSimTrackIds( + const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >&, const DetId&, uint32_t) const; + unsigned int getSimTrackId(const edm::Handle<edm::DetSetVector<PixelDigiSimLink> >& pixelSimLinks, + const DetId& detId, + unsigned int channel) const; + + edm::EDGetTokenT<edmNew::DetSetVector<Phase2TrackerCluster1D> > srcClu_; + edm::EDGetTokenT<VectorHitCollection> VHacc_; + edm::EDGetTokenT<VectorHitCollection> VHrej_; + edm::ESInputTag cpeTag_; + const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; + + edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > siphase2OTSimLinksToken_; + edm::EDGetTokenT<edm::PSimHitContainer> simHitsToken_; + edm::EDGetTokenT<edm::SimTrackContainer> simTracksToken_; + edm::EDGetTokenT<edm::SimVertexContainer> simVerticesToken_; + edm::EDGetTokenT<TrackingParticleCollection> trackingParticleToken_; + + const TrackerGeometry* tkGeom_; + const TrackerTopology* tkTopo_; + const MagneticField* magField_; + + TTree* tree_; + TGraph* trackerLayoutRZ_[3]; + TGraph* trackerLayoutXY_[3]; + TGraph* trackerLayoutXYBar_; + TGraph* trackerLayoutXYEC_; + TGraph* localPosXvsDeltaX_[3]; + TGraph* localPosYvsDeltaY_[3]; + TCanvas* VHXY_; + TCanvas* VHRZ_; + std::vector<TArrow*> arrowVHs_; + + TH2D* ParallaxCorrectionRZ_; + TH1F* VHaccLayer_; + TH1F* VHrejLayer_; + TH1F* VHaccTrueLayer_; + TH1F* VHrejTrueLayer_; + TH1F* VHaccTrue_signal_Layer_; + TH1F* VHrejTrue_signal_Layer_; + + std::map<unsigned int, VHHistos> histograms_; +}; +#endif From e58adabf4b509b320bdc2fca75967f1aac8eac51 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 14:42:04 +0200 Subject: [PATCH 477/778] a few more comments --- .../plugins/MeasurementTrackerESProducer.cc | 2 +- .../MeasurementTrackerEventProducer_cfi.py | 4 +-- .../src/Phase2OTBarrelRodBuilder.cc | 26 ++++++------------- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc index 8b689550b5fb8..540532c0ad0ba 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc @@ -17,7 +17,7 @@ #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "RecoLocalTracker/Records/interface/TrackerCPERecord.h" -#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" +//#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" diff --git a/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py b/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py index 9f7c08126f3b6..2d4e807b21872 100644 --- a/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py +++ b/RecoTracker/MeasurementDet/python/MeasurementTrackerEventProducer_cfi.py @@ -25,8 +25,8 @@ ) from Configuration.ProcessModifiers.vectorHits_cff import vectorHits vectorHits.toModify(MeasurementTrackerEvent, - vectorHits = cms.InputTag("siPhase2VectorHits", "accepted"), - vectorHitsRej = cms.InputTag("siPhase2VectorHits", "rejected"), + vectorHits = ("siPhase2VectorHits", "accepted"), + vectorHitsRej = ("siPhase2VectorHits", "rejected"), ) MeasurementTrackerEventPreSplitting = MeasurementTrackerEvent.clone( diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc index eb0647209b786..b96c630d7e74e 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc @@ -19,37 +19,28 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 double meanR = 0; if (!useBrothers) { - for (vector<const GeometricDet*>::const_iterator compGeometricDets = allGeometricDets.begin(); - compGeometricDets != allGeometricDets.end(); - compGeometricDets++) { - meanR = meanR + (*compGeometricDets)->positionBounds().perp(); + for (auto const& compGeometricDets : allGeometricDets) { + meanR = meanR + compGeometricDets->positionBounds().perp(); } meanR = meanR / allGeometricDets.size(); LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; + for (auto const& compGeometricDets : allGeometricDets){ + const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets->geographicalId()); - for (vector<const GeometricDet*>::const_iterator compGeometricDets = allGeometricDets.begin(); - compGeometricDets != allGeometricDets.end(); - compGeometricDets++) { - const GeomDet* theGeomDet = theGeomDetGeometry->idToDet((*compGeometricDets)->geographicalId()); - - if ((*compGeometricDets)->positionBounds().perp() < meanR) + if (compGeometricDets->positionBounds().perp() < meanR) innerGeomDets.push_back(theGeomDet); - if ((*compGeometricDets)->positionBounds().perp() > meanR) + if (compGeometricDets->positionBounds().perp() > meanR) outerGeomDets.push_back(theGeomDet); } LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size(); LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size(); - return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); } else { vector<const GeometricDet*> compGeometricDets; - vector<const GeomDet*> innerGeomDetBrothers; - vector<const GeomDet*> outerGeomDetBrothers; - double meanRBrothers = 0; for (auto& it : allGeometricDets) { compGeometricDets = it->components(); @@ -73,7 +64,7 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 if (compGeometricDets[0]->positionBounds().perp() < meanR) innerGeomDets.push_back(theGeomDet); - if (compGeometricDets[0]->positionBounds().perp() > meanR) + else outerGeomDets.push_back(theGeomDet); const GeomDet* theGeomDetBrother = theGeomDetGeometry->idToDet(compGeometricDets[1]->geographicalId()); @@ -81,7 +72,7 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 if (compGeometricDets[1]->positionBounds().perp() < meanRBrothers) innerGeomDetBrothers.push_back(theGeomDetBrother); - if (compGeometricDets[1]->positionBounds().perp() > meanRBrothers) + else outerGeomDetBrothers.push_back(theGeomDetBrother); } @@ -90,7 +81,6 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 LogDebug("TkDetLayers") << "innerGeomDetsBro.size(): " << innerGeomDetBrothers.size(); LogDebug("TkDetLayers") << "outerGeomDetsBro.size(): " << outerGeomDetBrothers.size(); - return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); } return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); From 2689ca84b3e4a4fb1c03c7e242c71718b0e20659 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 16:41:35 +0200 Subject: [PATCH 478/778] finish first pass at Slava's comments --- .../src/VectorHitBuilderAlgorithm.cc | 170 ++++++++---------- .../plugins/SeedingOTEDProducer.cc | 93 +++++----- .../TkSeedingLayers/src/HitExtractorSTRP.cc | 10 +- ...ransientTrackingRecHitBuilderESProducer.cc | 2 +- .../plugins/QuickTrackAssociatorByHitsImpl.cc | 1 - 5 files changed, 126 insertions(+), 150 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index b8ff6c4d5cacf..d7c314bb93845 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -124,25 +124,40 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi } else { LogTrace("VectorHitBuilderAlgorithm") << " not compatible, going to the next cluster"; } + + unsigned int layerStack = tkTopo_->layer(stack->geographicalId()); + if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) + LogDebug("VectorHitBuilderAlgorithm") << " \t is barrel. " << std::endl; + if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) + LogDebug("VectorHitBuilderAlgorithm") << " \t is endcap. " << std::endl; + LogDebug("VectorHitBuilderAlgorithm") << " \t layer is : " << layerStack << std::endl; + + float cut = 0.0; + if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) + cut = barrelCut_.at(layerStack); + if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) + cut = endcapCut_.at(layerStack); + LogDebug("VectorHitBuilderAlgorithm") << " \t the cut is:" << cut << std::endl; + + //only cache local parameters for upper cluster as we loop over lower clusters only once anyway std::vector<std::pair<LocalPoint, LocalError>> localParamsUpper; std::vector<const PixelGeomDetUnit*> localGDUUpper; std::vector<Phase2TrackerCluster1DRef> upperClusters; - for (const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ciu) { - Phase2TrackerCluster1DRef clusterUpper = edmNew::makeRefTo(clusters, ciu); - const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); + const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); + for (auto const& clusterUpper : theUpperDetSet) { localGDUUpper.push_back(gduUpp); - localParamsUpper.push_back(cpe_->localParameters(*clusterUpper, *gduUpp)); + localParamsUpper.push_back(cpe_->localParameters(clusterUpper, *gduUpp)); } int upperIterator = 0; + const PixelGeomDetUnit* gduLow = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); for (const_iterator cil = theLowerDetSet.begin(); cil != theLowerDetSet.end(); ++cil) { LogDebug("VectorHitBuilderAlgorithm") << " lower clusters " << std::endl; Phase2TrackerCluster1DRef cluL = edmNew::makeRefTo(clusters, cil); #ifdef EDM_ML_DEBUG printCluster(stack->lowerDet(), &*cluL); #endif - const PixelGeomDetUnit* gduLow = dynamic_cast<const PixelGeomDetUnit*>(stack->lowerDet()); auto&& lparamsLow = cpe_->localParameters(*cluL, *gduLow); upperIterator = 0; for (const_iterator ciu = theUpperDetSet.begin(); ciu != theUpperDetSet.end(); ++ciu) { @@ -157,57 +172,44 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi LogDebug("VectorHitBuilderAlgorithm") << " \t parallax correction:" << pC << std::endl; double lpos_upp_corr = 0.0; double lpos_low_corr = 0.0; - if (localParamsUpper[upperIterator].first.x() > lparamsLow.first.x()) { - if (localParamsUpper[upperIterator].first.x() > 0) { + auto const localUpperX = localParamsUpper[upperIterator].first.x(); + if (localUpperX > lparamsLow.first.x()) { + if (localUpperX > 0) { lpos_low_corr = lparamsLow.first.x(); lpos_upp_corr = localParamsUpper[upperIterator].first.x() - std::abs(pC); - } else if (localParamsUpper[upperIterator].first.x() < 0) { + } else if (localUpperX < 0) { lpos_low_corr = lparamsLow.first.x() + std::abs(pC); - lpos_upp_corr = localParamsUpper[upperIterator].first.x(); + lpos_upp_corr = localUpperX; } - } else if (localParamsUpper[upperIterator].first.x() < lparamsLow.first.x()) { - if (localParamsUpper[upperIterator].first.x() > 0) { + } else if (localUpperX < lparamsLow.first.x()) { + if (localUpperX > 0) { lpos_low_corr = lparamsLow.first.x() - std::abs(pC); - lpos_upp_corr = localParamsUpper[upperIterator].first.x(); - } else if (localParamsUpper[upperIterator].first.x() < 0) { + lpos_upp_corr = localUpperX; + } else if (localUpperX < 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = localParamsUpper[upperIterator].first.x() + std::abs(pC); + lpos_upp_corr = localUpperX + std::abs(pC); } } else { - if (localParamsUpper[upperIterator].first.x() > 0) { + if (localUpperX > 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = localParamsUpper[upperIterator].first.x() - std::abs(pC); - } else if (localParamsUpper[upperIterator].first.x() < 0) { + lpos_upp_corr = localUpperX - std::abs(pC); + } else if (localUpperX < 0) { lpos_low_corr = lparamsLow.first.x(); - lpos_upp_corr = localParamsUpper[upperIterator].first.x() + std::abs(pC); + lpos_upp_corr = localUpperX + std::abs(pC); } } LogDebug("VectorHitBuilderAlgorithm") << " \t local pos upper corrected (x):" << lpos_upp_corr << std::endl; LogDebug("VectorHitBuilderAlgorithm") << " \t local pos lower corrected (x):" << lpos_low_corr << std::endl; - //building my tolerance : 10*sigma - double delta = 10.0 * sqrt(lparamsLow.second.xx() + localParamsUpper[upperIterator].second.xx()); - LogDebug("VectorHitBuilderAlgorithm") << " \t delta: " << delta << std::endl; - double width = lpos_low_corr - lpos_upp_corr; LogDebug("VectorHitBuilderAlgorithm") << " \t width: " << width << std::endl; - unsigned int layerStack = tkTopo_->layer(stack->geographicalId()); - if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) - LogDebug("VectorHitBuilderAlgorithm") << " \t is barrel. " << std::endl; - if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) - LogDebug("VectorHitBuilderAlgorithm") << " \t is endcap. " << std::endl; - LogDebug("VectorHitBuilderAlgorithm") << " \t layer is : " << layerStack << std::endl; - - float cut = 0.0; - if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) - cut = barrelCut_.at(layerStack); - if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) - cut = endcapCut_.at(layerStack); - LogDebug("VectorHitBuilderAlgorithm") << " \t the cut is:" << cut << std::endl; //old cut: indipendent from layer + //building my tolerance : 10*sigma + //double delta = 10.0 * sqrt(lparamsLow.second.xx() + localParamsUpper[upperIterator].second.xx()); + //LogDebug("VectorHitBuilderAlgorithm") << " \t delta: " << delta << std::endl; //if( (lpos_upp_corr < lpos_low_corr + delta) && // (lpos_upp_corr > lpos_low_corr - delta) ){ //new cut: dependent on layers @@ -223,7 +225,9 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi LogDebug("VectorHitBuilderAlgorithm") << " rejecting VH: " << std::endl; //storing vh rejected for combinatiorial studies VectorHit vh = buildVectorHit(stack, cluL, cluU); - result.emplace_back(std::make_pair(vh, false)); + if (vh.isValid()){ + result.emplace_back(std::make_pair(vh, false)); + } } upperIterator += 1; } @@ -308,10 +312,8 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, GlobalError gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); if (gPositionLower.perp() > gPositionUpper.perp()) { - gPositionLower = VectorHit::phase2clusterGlobalPos(geomDetUpper, upper); - gPositionUpper = VectorHit::phase2clusterGlobalPos(geomDetLower, lower); - gErrorLower = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); - gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetLower); + std::swap(gPositionLower,gPositionUpper); + std::swap(gErrorLower,gErrorUpper); } const CurvatureAndPhi curvatureAndPhi = curvatureANDphi(gPositionLower, gPositionUpper, gErrorLower, gErrorUpper); @@ -422,18 +424,20 @@ VectorHitBuilderAlgorithm::CurvatureAndPhi VectorHitBuilderAlgorithm::curvatureA double signCurv = -copysign(1.0, n3); double phi1 = atan2(gPositionUpper.y() - gPositionLower.y(), gPositionUpper.x() - gPositionLower.x()); + + double x2Low = pow(gPositionLower.x(), 2); + double y2Low = pow(gPositionLower.y(), 2); + double x2Up = pow(gPositionUpper.x(), 2); + double y2Up = pow(gPositionUpper.y(), 2); + if (h1 != 0) { double h2 = 2 * h1; double h2Inf = 1. / (2 * h1); - double r12 = pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2); - double r22 = pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2); - double h3 = - (pow(gPositionLower.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.x(), 2) + - pow(gPositionLower.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y() + pow(gPositionUpper.y(), 2)); - double h4 = -pow(gPositionLower.x(), 2) * gPositionUpper.x() + gPositionLower.x() * pow(gPositionUpper.x(), 2) + - gPositionLower.x() * pow(gPositionUpper.y(), 2) - gPositionUpper.x() * pow(gPositionLower.y(), 2); - double h5 = pow(gPositionLower.x(), 2) * gPositionUpper.y() - pow(gPositionUpper.x(), 2) * gPositionLower.y() + - pow(gPositionLower.y(), 2) * gPositionUpper.y() - gPositionLower.y() * pow(gPositionUpper.y(), 2); + double r12 = gPositionLower.perp2(); + double r22 = gPositionUpper.perp2(); + double h3 = pow(n2[0],2) + pow(n2[1],2); + double h4 = -x2Low * gPositionUpper.x() + gPositionLower.x() * x2Up + gPositionLower.x() *y2Up - gPositionUpper.x() * y2Low; + double h5 = x2Low * gPositionUpper.y() - x2Up * gPositionLower.y() + y2Low * gPositionUpper.y() - gPositionLower.y() * y2Up; //radius of circle double invRho2 = (4. * h1 * h1) / (r12 * r22 * h3); @@ -456,53 +460,33 @@ VectorHitBuilderAlgorithm::CurvatureAndPhi VectorHitBuilderAlgorithm::curvatureA double denom2 = 1. / (pow(r12 * r22 * h3, 1.5)); jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 - jacobian[2][0] = - -2. * ((h1 * (gPositionLower.x() * r22 * h3 + (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2 - - (gPositionUpper.y()) * denom1); // dkappa/dx1 - jacobian[2][1] = - -2. * ((gPositionUpper.x()) * denom1 + - (h1 * (gPositionLower.y() * r22 * h3 + r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * - denom2); // dkappa/dy1 - jacobian[2][2] = - -2. * ((gPositionLower.y()) * denom1 + - (h1 * (gPositionUpper.x() * r12 * h3 - (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * - denom2); // dkappa/dx2 - jacobian[2][3] = - -2. * ((h1 * (gPositionUpper.y() * r12 * h3 - r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - - (gPositionLower.x()) * denom1); // dkappa/dy2 - AlgebraicVector2 M; + jacobian[2][0] = -2. * ((h1 * (gPositionLower.x() * r22 * h3 + (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2 - (gPositionUpper.y()) * denom1); // dkappa/dx1 + jacobian[2][1] = -2. * ((gPositionUpper.x()) * denom1 + (h1 * (gPositionLower.y() * r22 * h3 + r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2); // dkappa/dy1 + jacobian[2][2] = -2. * ((gPositionLower.y()) * denom1 + (h1 * (gPositionUpper.x() * r12 * h3 - (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2); // dkappa/dx2 + jacobian[2][3] = -2. * ((h1 * (gPositionUpper.y() * r12 * h3 - r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - (gPositionLower.x()) * denom1); // dkappa/dy2 + AlgebraicVector2 mVector; //to compute phi at the cluster points - M[0] = (gPositionLower.y() - ycentre) * invRho2; // dphi/dxcentre - M[1] = -(gPositionLower.x() - xcentre) * invRho2; // dphi/dycentre + mVector[0] = (gPositionLower.y() - ycentre) * invRho2; // dphi/dxcentre + mVector[1] = -(gPositionLower.x() - xcentre) * invRho2; // dphi/dycentre //to compute phi at the origin - AlgebraicROOTObject<2, 4>::Matrix K; - K[0][0] = - 2. * ((gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionUpper.y() * h5) / pow(h2, 2)); // dxm/dx1 - K[0][1] = (2. * gPositionUpper.x() * h5) / pow(h2, 2) - - (pow(gPositionUpper.x(), 2) + pow(gPositionUpper.y(), 2) - 2. * gPositionLower.y() * gPositionUpper.y()) * - h2Inf; // dxm/dy1 - K[0][2] = - 2. * ((gPositionLower.y() * h5) / pow(h2, 2) - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dxm/dx2 - K[0][3] = (pow(gPositionLower.x(), 2) + pow(gPositionLower.y(), 2) - 2. * gPositionUpper.y() * gPositionLower.y()) * - h2Inf - - (2. * gPositionLower.x() * h5) / pow(h2, 2); // dxm/dy2 - K[1][0] = (pow(gPositionUpper.x(), 2) - 2. * gPositionLower.x() * gPositionUpper.x() + pow(gPositionUpper.y(), 2)) * - h2Inf - - (2. * gPositionUpper.y() * h4) / pow(h2, 2); // dym/dx1 - K[1][1] = - 2. * ((gPositionUpper.x() * h4) / pow(h2, 2) - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dym/dy1 - K[1][2] = (2. * gPositionLower.y() * h4) / pow(h2, 2) - - (pow(gPositionLower.x(), 2) - 2. * gPositionUpper.x() * gPositionLower.x() + pow(gPositionLower.y(), 2)) * - h2Inf; // dym/dx2 - K[1][3] = - 2. * (gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionLower.x() * h4) / pow(h2, 2); // dym/dy2 - - AlgebraicVector4 N = M * K; - jacobian[3][0] = N[0]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][1] = N[1]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][2] = N[2]; // dphi/(dx1,dy1,dx2,dy2) - jacobian[3][3] = N[3]; // dphi/(dx1,dy1,dx2,dy2) + double h22Inv = 1./pow(h2, 2); + + AlgebraicROOTObject<2, 4>::Matrix kMatrix; + kMatrix[0][0] = 2. * ((gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionUpper.y() * h5) * h22Inv); // dxm/dx1 + kMatrix[0][1] = (2. * gPositionUpper.x() * h5) * h22Inv - (x2Up + y2Up - 2. * gPositionLower.y() * gPositionUpper.y()) * h2Inf; // dxm/dy1 + kMatrix[0][2] = 2. * ((gPositionLower.y() * h5) * h22Inv - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dxm/dx2 + kMatrix[0][3] = (x2Low + y2Low - 2. * gPositionUpper.y() * gPositionLower.y()) * h2Inf - (2. * gPositionLower.x() * h5) * h22Inv; // dxm/dy2 + kMatrix[1][0] = (x2Up - 2. * gPositionLower.x() * gPositionUpper.x() + y2Up) * h2Inf - (2. * gPositionUpper.y() * h4) * h22Inv; // dym/dx1 + kMatrix[1][1] = 2. * ((gPositionUpper.x() * h4) * h22Inv - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dym/dy1 + kMatrix[1][2] = (2. * gPositionLower.y() * h4) * h22Inv - (x2Low - 2. * gPositionUpper.x() * gPositionLower.x() + y2Low) * h2Inf; // dym/dx2 + kMatrix[1][3] = 2. * (gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionLower.x() * h4) * h22Inv; // dym/dy2 + + AlgebraicVector4 nMatrix = mVector * kMatrix; + jacobian[3][0] = nMatrix[0]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][1] = nMatrix[1]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][2] = nMatrix[2]; // dphi/(dx1,dy1,dx2,dy2) + jacobian[3][3] = nMatrix[3]; // dphi/(dx1,dy1,dx2,dy2) //assign correct sign to the curvature errors if ((signCurv < 0 && curvature > 0) || (signCurv > 0 && curvature < 0)) { diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index cf55cd98cf4c4..ab8f80679dbdb 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -44,15 +44,15 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { TrajectorySeedCollection run(edm::Handle<VectorHitCollection>); unsigned int checkLayer(unsigned int iidd); - std::vector<VectorHit> collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); + std::vector<const VectorHit*> collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); void printVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); - const TrajectoryStateOnSurface buildInitialTSOS(const VectorHit&) const; + const TrajectoryStateOnSurface buildInitialTSOS(const VectorHit*) const; AlgebraicSymMatrix55 assign44To55(AlgebraicSymMatrix44) const; std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator&, const TrackingRecHit& hit) const; - float computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) const; - float computeInverseMomentumError(const VectorHit& vh, + float computeGlobalThetaError(const VectorHit* vh, const double sigmaZ_beamSpot) const; + float computeInverseMomentumError(const VectorHit* vh, const float globalTheta, const double sigmaZ_beamSpot, const double transverseMomentum) const; @@ -64,7 +64,7 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { struct isInvalid { bool operator()(const TrajectoryMeasurement& measurement) { - return (((measurement).recHit() == nullptr) || !((measurement).recHit()->isValid()) || + return ((measurement.recHit() == nullptr) || !(measurement.recHit()->isValid()) || !((measurement).updatedState().isValid())); } }; @@ -123,10 +123,9 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) edm::ESHandle<MeasurementTracker> measurementTrackerHandle = es.getHandle(measurementTrackerToken_); measurementTracker_ = measurementTrackerHandle.product(); - edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; - event.getByToken(tkMeasEventToken_, measurementTrackerEvent); + auto const& measurementTrackerEvent = event.get(tkMeasEventToken_); - layerMeasurements_ = std::make_unique<LayerMeasurements>(*measurementTrackerHandle, *measurementTrackerEvent); + layerMeasurements_ = std::make_unique<LayerMeasurements>(*measurementTrackerHandle, measurementTrackerEvent); estimator_ = &es.getData(estToken_); @@ -136,25 +135,20 @@ void SeedingOTEDProducer::produce(edm::Event& event, const edm::EventSetup& es) updator_ = &es.getData(updatorToken_); - edm::Handle<reco::BeamSpot> beamSpotH; - event.getByToken(beamSpotToken_, beamSpotH); - if (beamSpotH.isValid()) { - beamSpot_ = beamSpotH.product(); - } + beamSpot_ = &event.get(beamSpotToken_); // Get the vector hits - edm::Handle<VectorHitCollection> vhs; - event.getByToken(vhProducerToken_, vhs); + auto vhs = event.getHandle(vhProducerToken_); event.emplace(putToken_, run(vhs)); } -TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollection> VHs) { +TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollection> vHs) { TrajectorySeedCollection result; //check if all the first three layers have VHs - std::vector<VectorHit> vhSeedsL1 = collectVHsOnLayer(*VHs.product(), 1); - std::vector<VectorHit> vhSeedsL2 = collectVHsOnLayer(*VHs.product(), 2); - std::vector<VectorHit> vhSeedsL3 = collectVHsOnLayer(*VHs.product(), 3); + std::vector<const VectorHit*> vhSeedsL1 = collectVHsOnLayer(*vHs.product(), 1); + std::vector<const VectorHit*> vhSeedsL2 = collectVHsOnLayer(*vHs.product(), 2); + std::vector<const VectorHit*> vhSeedsL3 = collectVHsOnLayer(*vHs.product(), 3); if (vhSeedsL1.empty() || vhSeedsL2.empty() || vhSeedsL3.empty()) { return result; } @@ -176,7 +170,7 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio //set the direction of the propagator if (signZ * signPz > 0.0) searchingPropagator->setPropagationDirection(oppositeToMomentum); - if (signZ * signPz < 0.0) + else searchingPropagator->setPropagationDirection(alongMomentum); //find vHits in layer 2 @@ -217,15 +211,10 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio if (!updatedTSOSL1.first) continue; - edm::OwnVector<TrackingRecHit> container; - container.push_back(hitL1->clone()); - container.push_back(hitL2->clone()); - container.push_back(hitL3.clone()); - //building trajectory inside-out if (searchingPropagator->propagationDirection() == alongMomentum) { buildingPropagator->setPropagationDirection(oppositeToMomentum); - } else if (searchingPropagator->propagationDirection() == oppositeToMomentum) { + } else { buildingPropagator->setPropagationDirection(alongMomentum); } @@ -239,11 +228,17 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio if (!updatedTSOSL2_final.first) continue; std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final = - propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, hitL3); + propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, *hitL3); if (!updatedTSOSL3_final.first) continue; - TrajectorySeed ts = - createSeed(updatedTSOSL3_final.second, container, hitL3.geographicalId(), *buildingPropagator); + + edm::OwnVector<TrackingRecHit> container; + container.push_back(hitL1->clone()); + container.push_back(hitL2->clone()); + container.push_back(hitL3->clone()); + + TrajectorySeed ts = + createSeed(updatedTSOSL3_final.second, container, hitL3->geographicalId(), *buildingPropagator); result.push_back(ts); } } @@ -263,20 +258,20 @@ unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { return 0; } -std::vector<VectorHit> SeedingOTEDProducer::collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>& input, +std::vector<const VectorHit*> SeedingOTEDProducer::collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>& input, unsigned int layerNumber) { - std::vector<VectorHit> VHsOnLayer; + std::vector<const VectorHit*> vHsOnLayer; if (!input.empty()) { for (const auto& DSViter : input) { if (checkLayer(DSViter.id()) == layerNumber) { for (const auto& vh : DSViter) { - VHsOnLayer.push_back(vh); + vHsOnLayer.push_back(&vh); } } } } - return VHsOnLayer; + return vHsOnLayer; } void SeedingOTEDProducer::printVHsOnLayer(const edmNew::DetSetVector<VectorHit>& input, unsigned int layerNumber) { @@ -292,36 +287,36 @@ void SeedingOTEDProducer::printVHsOnLayer(const edmNew::DetSetVector<VectorHit>& } } -const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const VectorHit& vHit) const { +const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const VectorHit* vHit) const { // having fun with theta - Global3DVector gv(vHit.globalPosition().x(), vHit.globalPosition().y(), vHit.globalPosition().z()); + Global3DVector gv(vHit->globalPosition().x(), vHit->globalPosition().y(), vHit->globalPosition().z()); float theta = gv.theta(); // gv transform to local (lv) - const Local3DVector lv(vHit.det()->surface().toLocal(gv)); + const Local3DVector lv(vHit->det()->surface().toLocal(gv)); //FIXME::charge is fine 1 every two times!! GlobalPoint center(0.0, 0.0, 0.0); int charge = 1; - float p = vHit.momentum(magField_->inTesla(center).z()); - float x = vHit.localPosition().x(); - float y = vHit.localPosition().y(); - float dx = vHit.localDirection().x(); + float mom = vHit->momentum(magField_->inTesla(center).z()); + float xPos = vHit->localPosition().x(); + float yPos = vHit->localPosition().y(); + float dx = vHit->localDirection().x(); // for dy use second component of the lv renormalized to the z component float dy = lv.y() / lv.z(); // Pz and Dz should have the same sign - float signPz = copysign(1.0, vHit.globalPosition().z()); + float signPz = copysign(1.0, vHit->globalPosition().z()); - LocalTrajectoryParameters ltpar2(charge / p, dx, dy, x, y, signPz); - AlgebraicSymMatrix55 mat = assign44To55(vHit.covMatrix()); + LocalTrajectoryParameters ltpar2(charge / mom, dx, dy, xPos, yPos, signPz); + AlgebraicSymMatrix55 mat = assign44To55(vHit->covMatrix()); // set the error on 1/p mat[0][0] = pow(computeInverseMomentumError( - vHit, theta, beamSpot_->sigmaZ(), vHit.transverseMomentum(magField_->inTesla(center).z())), + vHit, theta, beamSpot_->sigmaZ(), vHit->transverseMomentum(magField_->inTesla(center).z())), 2); //building tsos LocalTrajectoryError lterr(mat); - const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit.det()->surface(), magField_); + const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit->det()->surface(), magField_); return tsos; } @@ -350,14 +345,14 @@ std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdat return std::make_pair(true, updatedTSOS); } -float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit& vh, const double sigmaZ_beamSpot) const { +float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit* vh, const double sigmaZ_beamSpot) const { double derivative = - vh.globalPosition().perp() / (pow(vh.globalPosition().z(), 2) + pow(vh.globalPosition().perp(), 2)); + vh->globalPosition().perp() / vh->globalPosition().mag2(); double derivative2 = pow(derivative, 2); - return pow(derivative2 * vh.lowerGlobalPosErr().czz() + derivative2 * pow(sigmaZ_beamSpot, 2), 0.5); + return pow(derivative2 * vh->lowerGlobalPosErr().czz() + derivative2 * pow(sigmaZ_beamSpot, 2), 0.5); } -float SeedingOTEDProducer::computeInverseMomentumError(const VectorHit& vh, +float SeedingOTEDProducer::computeInverseMomentumError(const VectorHit* vh, const float globalTheta, const double sigmaZ_beamSpot, const double transverseMomentum) const { diff --git a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc index 65aac0eaa406e..471c131a5f4c0 100644 --- a/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc +++ b/RecoTracker/TkSeedingLayers/src/HitExtractorSTRP.cc @@ -239,11 +239,10 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder if (hasVectorHits) { LogError("HitExtractorSTRP") << "TIB is not supposed to be in Phase2 TRK detector configuration. What follows " "have never been checked before! "; - edm::Handle<VectorHitCollection> vectorHits; - ev.getByToken(theVectorHits, vectorHits); + auto const& vectorHits = ev.get(theVectorHits); if (skipClusters) cleanFrom = result.size(); - range2SeedingHits(*vectorHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); + range2SeedingHits(vectorHits, result, tTopo->tibDetIdLayerComparator(theIdLayer)); if (skipClusters) cleanedOfClusters(ttrhBuilder, ev, result, false, cleanFrom); } @@ -314,13 +313,12 @@ HitExtractor::Hits HitExtractorSTRP::hits(const TkTransientTrackingRecHitBuilder } if (hasVectorHits) { LogTrace("HitExtractorSTRP") << "Getting vector hits for IdLayer " << theIdLayer; - edm::Handle<VectorHitCollection> vectorHits; - ev.getByToken(theVectorHits, vectorHits); + auto const& vectorHits = ev.get(theVectorHits); //FIXME: check the skipClusters with VHits if (skipClusters) cleanFrom = result.size(); auto getter = tTopo->tidDetIdWheelComparator(static_cast<unsigned int>(theSide), theIdLayer); - VectorHitCollection::Range range = vectorHits->equal_range(getter.first, getter.second); + VectorHitCollection::Range range = vectorHits.equal_range(getter.first, getter.second); for (VectorHitCollection::const_iterator it = range.first; it != range.second; ++it) { int ring = tTopo->tidRing(it->detId()); if (!ringRange(ring)) diff --git a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc index 9c19f5c63f05a..e23f3a66df3e7 100644 --- a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc +++ b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc @@ -5,7 +5,7 @@ #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" #include "RecoLocalTracker/Records/interface/TrackerCPERecord.h" -#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" +//#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h" diff --git a/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc b/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc index 3b49cff70bd7b..2b1f01b89c6f4 100644 --- a/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc +++ b/SimTracker/TrackAssociatorProducers/plugins/QuickTrackAssociatorByHitsImpl.cc @@ -800,7 +800,6 @@ double QuickTrackAssociatorByHitsImpl::weightedNumberOfTrackClusters(iter begin, weightedClusters += weight; } } - LogTrace("QuickTrackAssociatorByHitsImpl") << " total weighted clusters: " << weightedClusters; return weightedClusters; } From 3a96a7f2d0151abd3660cbc82d093ff605bad7ae Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Sat, 10 Oct 2020 16:48:16 +0200 Subject: [PATCH 479/778] Change input jet collection for b2g validation in HI wfs --- .../B2G/python/b2gHadronicHLTEventValidation_cfi.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/HLTriggerOffline/B2G/python/b2gHadronicHLTEventValidation_cfi.py b/HLTriggerOffline/B2G/python/b2gHadronicHLTEventValidation_cfi.py index 5cbea84a94d4b..2921613584a61 100644 --- a/HLTriggerOffline/B2G/python/b2gHadronicHLTEventValidation_cfi.py +++ b/HLTriggerOffline/B2G/python/b2gHadronicHLTEventValidation_cfi.py @@ -50,3 +50,9 @@ 'HLT_AK8PFHT650_TrimR0p1PT0p03Mass50', 'HLT_AK8PFHT600_TrimR0p1PT0p03Mass50_BTagCSV_p20']), ) + +# puppi jets don't exist in HI wfs, use Cs jets instead +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(b2gSingleJetHLTValidation, sJets = "akCs4PFJets") +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(b2gDiJetHLTValidation, sJets = "akCs4PFJets") From 671803fa5ebf5fff030018876262fc1dd28c1e24 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 17:34:59 +0200 Subject: [PATCH 480/778] add reserve statement in loadDetSetVector --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 8 +------- .../interface/VectorHitBuilderAlgorithmBase.h | 3 ++- .../src/VectorHitBuilderAlgorithm.cc | 8 ++++++-- .../src/VectorHitBuilderAlgorithmBase.cc | 8 +++++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index cab98d2f00909..0946507d17094 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -39,9 +39,6 @@ VectorHit::VectorHit(const GeomDet& idet, theCurvature(curvature), theCurvatureError(curvatureError), thePhi(phi) { -// thePosition = LocalPoint(vh2Dzx.localPosition().x(), vh2Dzy.localPosition().x(), 0.); - -// theDirection = LocalVector(vh2Dzx.localDirection().x(), vh2Dzy.localDirection().x(), 1.); //building the cov matrix 4x4 starting from the 2x2 const AlgebraicSymMatrix22 covMatZX = vh2Dzx.covMatrix(); @@ -96,10 +93,7 @@ void VectorHit::getKfComponents4D(KfComponentsHolder& holder) const { holder.errors<theDimension>() = theCovMatrix; ProjectMatrix<double, 5, theDimension>& pf = holder.projFunc<theDimension>(); - pf.index[0] = 1; - pf.index[1] = 2; - pf.index[2] = 3; - pf.index[3] = 4; + for (int i = 0; i<4; ++i) pf.index[i] = i+1; holder.measuredParams<theDimension>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), theDimension); holder.measuredErrors<theDimension>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 8876fd85d95bc..bbfdfd608fef7 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -56,7 +56,8 @@ class VectorHitBuilderAlgorithmBase { void printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* cluster) const; void loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit>>& theMap, - edmNew::DetSetVector<VectorHit>& theCollection) const; + edmNew::DetSetVector<VectorHit>& theCollection, + const int totalSize) const; const TrackerGeometry* tkGeom_; const TrackerTopology* tkTopo_; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index d7c314bb93845..e095f8798b941 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -13,6 +13,8 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track const auto* clustersPhase2Collection = clusters.product(); std::unordered_map<DetId, std::vector<VectorHit>> tempVHAcc, tempVHRej; + int totalAccepted = 0; + int totalRejected = 0; //loop over the DetSetVector LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << clustersPhase2Collection->size() << std::endl; @@ -50,8 +52,10 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track if (vh.second == true) { vhsInStack_Acc.push_back(vh.first); std::push_heap(vhsInStack_Acc.begin(), vhsInStack_Acc.end()); + totalAccepted += 1; } else if (vh.second == false) { vhsInStack_Rej.push_back(vh.first); + totalRejected += 1; } } @@ -76,8 +80,8 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track } } - loadDetSetVector(tempVHAcc, vhAcc); - loadDetSetVector(tempVHRej, vhRej); + loadDetSetVector(tempVHAcc, vhAcc, totalAccepted); + loadDetSetVector(tempVHRej, vhRej, totalRejected); LogDebug("VectorHitBuilderAlgorithm") << "End run VectorHitBuilderAlgorithm ... \n"; } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index cf24417c3741e..e7db9a0edf44d 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -97,10 +97,12 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, } void VectorHitBuilderAlgorithmBase::loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit> >& theMap, - edmNew::DetSetVector<VectorHit>& theCollection) const { - for (const auto& it : theMap) { + edmNew::DetSetVector<VectorHit>& theCollection, + const int totalSize) const { + +theCollection.reserve(theMap.size(), totalSize); +for (const auto& it : theMap) { edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it.first); - //vh_col.reserve(it.second.size()); for (const auto& vh_it : it.second) vh_col.push_back(vh_it); } From 7401e5867d83818d24a26b2a008247e59f23f24e Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Sat, 10 Oct 2020 17:40:57 +0200 Subject: [PATCH 481/778] avoid hardcoded value --- .../HGCalRecProducers/plugins/HGCalCLUEAlgo.cc | 13 +++++++------ .../HGCalRecProducers/plugins/HGCalCLUEAlgo.h | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc index e8464f45431af..70a378bfe5742 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc @@ -44,7 +44,8 @@ void HGCalCLUEAlgoT<T>::populate(const HGCRecHitCollection& hits) { if (dependSensor_) { int thickness_index = rhtools_.getSiThickIndex(detid); if (thickness_index == -1) - thickness_index = 6; + thickness_index = maxNumberOfThickIndices_; + double storedThreshold = thresholds_[layerOnSide][thickness_index]; if (detid.det() == DetId::HGCalEE || detid.subdetId() == HGCEE) { storedThreshold = thresholds_[layerOnSide][thickness_index]; @@ -523,13 +524,13 @@ void HGCalCLUEAlgoT<T>::computeThreshold() { initialized_ = true; std::vector<double> dummy; - const unsigned maxNumberOfThickIndices = 6; - dummy.resize(maxNumberOfThickIndices + !isNose_, 0); // +1 to accomodate for the Scintillators + + dummy.resize(maxNumberOfThickIndices_ + !isNose_, 0); // +1 to accomodate for the Scintillators thresholds_.resize(maxlayer_, dummy); v_sigmaNoise_.resize(maxlayer_, dummy); for (unsigned ilayer = 1; ilayer <= maxlayer_; ++ilayer) { - for (unsigned ithick = 0; ithick < maxNumberOfThickIndices; ++ithick) { + for (unsigned ithick = 0; ithick < maxNumberOfThickIndices_; ++ithick) { float sigmaNoise = 0.001f * fcPerEle_ * nonAgedNoises_[ithick] * dEdXweights_[ilayer] / (fcPerMip_[ithick] * thicknessCorrection_[ithick]); thresholds_[ilayer - 1][ithick] = sigmaNoise * ecut_; @@ -542,8 +543,8 @@ void HGCalCLUEAlgoT<T>::computeThreshold() { if (!isNose_) { float scintillators_sigmaNoise = 0.001f * noiseMip_ * dEdXweights_[ilayer] / sciThicknessCorrection_; - thresholds_[ilayer - 1][maxNumberOfThickIndices] = ecut_ * scintillators_sigmaNoise; - v_sigmaNoise_[ilayer - 1][maxNumberOfThickIndices] = scintillators_sigmaNoise; + thresholds_[ilayer - 1][maxNumberOfThickIndices_] = ecut_ * scintillators_sigmaNoise; + v_sigmaNoise_[ilayer - 1][maxNumberOfThickIndices_] = scintillators_sigmaNoise; LogDebug("HGCalCLUEAlgo") << "ilayer: " << ilayer << " noiseMip: " << noiseMip_ << " scintillators_sigmaNoise: " << scintillators_sigmaNoise << "\n"; } diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h index 5b3006c615d04..aa8814b8c7dfd 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.h @@ -42,6 +42,7 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { thicknessCorrection_(ps.getParameter<std::vector<double>>("thicknessCorrection")), sciThicknessCorrection_(ps.getParameter<double>("sciThicknessCorrection")), deltasi_index_regemfac_(ps.getParameter<int>("deltasi_index_regemfac")), + maxNumberOfThickIndices_(ps.getParameter<unsigned>("maxNumberOfThickIndices")), fcPerMip_(ps.getParameter<std::vector<double>>("fcPerMip")), fcPerEle_(ps.getParameter<double>("fcPerEle")), nonAgedNoises_(ps.getParameter<edm::ParameterSet>("noises").getParameter<std::vector<double>>("values")), @@ -103,6 +104,7 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { iDesc.add<std::vector<double>>("thicknessCorrection", {}); iDesc.add<double>("sciThicknessCorrection", 0.9); iDesc.add<int>("deltasi_index_regemfac", 3); + iDesc.add<unsigned>("maxNumberOfThickIndices", 6); iDesc.add<std::vector<double>>("fcPerMip", {}); iDesc.add<double>("fcPerEle", 0.0); edm::ParameterSetDescription descNestedNoises; @@ -142,6 +144,7 @@ class HGCalCLUEAlgoT : public HGCalClusteringAlgoBase { std::vector<double> thicknessCorrection_; double sciThicknessCorrection_; int deltasi_index_regemfac_; + unsigned maxNumberOfThickIndices_; std::vector<double> fcPerMip_; double fcPerEle_; std::vector<double> nonAgedNoises_; From 93a827a83c15041eca266633f2a4aad0c5ebfeab Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 19:30:19 +0200 Subject: [PATCH 482/778] speed up cluster masking --- .../src/VectorHitBuilderAlgorithm.cc | 1 - .../plugins/TkStackMeasurementDet.cc | 39 +++++++++++-------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index e095f8798b941..054ca671c6801 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -79,7 +79,6 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track #endif } } - loadDetSetVector(tempVHAcc, vhAcc, totalAccepted); loadDetSetVector(tempVHRej, vhRej, totalRejected); diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index 597dc27d64f74..e7ddb45169c28 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -30,15 +30,17 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj LogTrace("MeasurementTracker") << " and is active"; //find clusters to skip - std::vector<Phase2TrackerCluster1DRef> skipClustersLower; - std::vector<Phase2TrackerCluster1DRef> skipClustersUpper; + const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); + const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index()); + std::vector<bool> skipClustersUpper(data.phase2OTClustersToSkip().empty()? 0 : upperDetSet.size(), false); + std::vector<bool> skipClustersLower(data.phase2OTClustersToSkip().empty()? 0 : lowerDetSet.size(), false); + + const Phase2TrackerCluster1D* begin = nullptr; if (!data.phase2OTData().handle()->data().empty()) { begin = &(data.phase2OTData().handle()->data().front()); } if (!data.phase2OTClustersToSkip().empty()) { - const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); - const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index()); if (!lowerDetSet.empty()) { for (const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++cil) { @@ -48,8 +50,8 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj } unsigned int indexl = cil - begin; if (data.phase2OTClustersToSkip()[indexl]) { - Phase2TrackerCluster1DRef clusterRef = edmNew::makeRefTo(data.phase2OTData().handle(), cil); - skipClustersLower.push_back(clusterRef); + int iLocalL = std::distance(lowerDetSet.begin(),cil); + skipClustersLower[iLocalL] = true; } } } @@ -61,23 +63,24 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj } unsigned int indexu = ciu - begin; if (data.phase2OTClustersToSkip()[indexu]) { - Phase2TrackerCluster1DRef clusterRef = edmNew::makeRefTo(data.phase2OTData().handle(), ciu); - skipClustersUpper.push_back(clusterRef); + int iLocalU = std::distance(upperDetSet.begin(),ciu); + skipClustersUpper[iLocalU] = true; } } } } - DetId detIdStack = specificGeomDet().geographicalId(); auto iterator = data.phase2OTVectorHits().find(detIdStack); if (iterator == data.phase2OTVectorHits().end()) return result; for (const auto& vecHit : data.phase2OTVectorHits()[detIdStack]) { - if (std::find(skipClustersLower.begin(), skipClustersLower.end(), vecHit.lowerCluster()) != skipClustersLower.end()) - continue; - if (std::find(skipClustersUpper.begin(), skipClustersUpper.end(), vecHit.upperCluster()) != skipClustersUpper.end()) - continue; + if (!data.phase2OTClustersToSkip().empty()){ + if (skipClustersLower[vecHit.lowerCluster().key()-lowerDetSet.offset()]) + continue; + if (skipClustersUpper[vecHit.upperCluster().key()-upperDetSet.offset()]) + continue; + } result.push_back(std::make_shared<VectorHit>(vecHit)); } @@ -85,10 +88,12 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj if (iterator == data.phase2OTVectorHitsRej().end()) return result; for (const auto& vecHit : data.phase2OTVectorHitsRej()[detIdStack]) { - if (std::find(skipClustersLower.begin(), skipClustersLower.end(), vecHit.lowerCluster()) != skipClustersLower.end()) - continue; - if (std::find(skipClustersUpper.begin(), skipClustersUpper.end(), vecHit.upperCluster()) != skipClustersUpper.end()) - continue; + if (!data.phase2OTClustersToSkip().empty()){ + if (skipClustersLower[vecHit.lowerCluster().key()-lowerDetSet.offset()]) + continue; + if (skipClustersUpper[vecHit.upperCluster().key()-upperDetSet.offset()]) + continue; + } result.push_back(std::make_shared<VectorHit>(vecHit)); } From 3b4b4d248e76c100895cb2c5345f3597c162c5e7 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 19:40:07 +0200 Subject: [PATCH 483/778] code format --- .../TrackerRecHit2D/interface/VectorHit.h | 1 - DataFormats/TrackerRecHit2D/src/VectorHit.cc | 13 +-- .../interface/VectorHitBuilderAlgorithm.h | 13 +-- .../interface/VectorHitBuilderAlgorithmBase.h | 3 +- .../plugins/VectorHitBuilderEDProducer.cc | 7 +- .../src/VectorHitBuilderAlgorithm.cc | 80 +++++++++++-------- .../src/VectorHitBuilderAlgorithmBase.cc | 9 +-- .../MeasurementTrackerEventProducer.cc | 3 +- .../plugins/TkStackMeasurementDet.cc | 22 +++-- .../src/Phase2OTBarrelRodBuilder.cc | 4 +- .../plugins/SeedingOTEDProducer.cc | 13 ++- 11 files changed, 86 insertions(+), 82 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 2ceebd2e5568a..78e2862603ec3 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -144,7 +144,6 @@ class VectorHit final : public BaseTrackerRecHit { float theCurvature; float theCurvatureError; float thePhi; - }; inline bool operator<(const VectorHit& one, const VectorHit& other) { return (one.chi2() < other.chi2()); } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 0946507d17094..0b0d9fb33cbca 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -39,7 +39,6 @@ VectorHit::VectorHit(const GeomDet& idet, theCurvature(curvature), theCurvatureError(curvatureError), thePhi(phi) { - //building the cov matrix 4x4 starting from the 2x2 const AlgebraicSymMatrix22 covMatZX = vh2Dzx.covMatrix(); const AlgebraicSymMatrix22 covMatZY = vh2Dzy.covMatrix(); @@ -93,7 +92,8 @@ void VectorHit::getKfComponents4D(KfComponentsHolder& holder) const { holder.errors<theDimension>() = theCovMatrix; ProjectMatrix<double, 5, theDimension>& pf = holder.projFunc<theDimension>(); - for (int i = 0; i<4; ++i) pf.index[i] = i+1; + for (int i = 0; i < 4; ++i) + pf.index[i] = i + 1; holder.measuredParams<theDimension>() = AlgebraicVector4(&holder.tsosLocalParameters().At(1), theDimension); holder.measuredErrors<theDimension>() = holder.tsosLocalErrors().Sub<AlgebraicSymMatrix44>(1, 1); @@ -180,12 +180,7 @@ std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { } /// Access to component RecHits (if any) -std::vector<const TrackingRecHit*> VectorHit::recHits() const { - return {}; -} +std::vector<const TrackingRecHit*> VectorHit::recHits() const { return {}; } /// Non-const access to component RecHits (if any) -std::vector<TrackingRecHit*> VectorHit::recHits() { - return {}; -} - +std::vector<TrackingRecHit*> VectorHit::recHits() { return {}; } diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 3333c29804915..d70d8437b3bfc 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -37,11 +37,15 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { Local3DPoint& posouter, LocalError& errinner, LocalError& errouter) const; - struct CurvatureAndPhi { float curvature; float curvatureError; float phi; }; + struct CurvatureAndPhi { + float curvature; + float curvatureError; + float phi; + }; CurvatureAndPhi curvatureANDphi(Global3DPoint gPositionLower, - Global3DPoint gPositionUpper, - GlobalError gErrorLower, - GlobalError gErrorUpper) const; + Global3DPoint gPositionUpper, + GlobalError gErrorLower, + GlobalError gErrorUpper) const; std::vector<std::pair<VectorHit, bool>> buildVectorHits( const StackGeomDet* stack, @@ -78,7 +82,6 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { Local3DVector& dir, AlgebraicSymMatrix22& covMatrix, double& chi2) const; - }; #endif diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index bbfdfd608fef7..88649f4aab00a 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -57,7 +57,7 @@ class VectorHitBuilderAlgorithmBase { void loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit>>& theMap, edmNew::DetSetVector<VectorHit>& theCollection, - const int totalSize) const; + const int totalSize) const; const TrackerGeometry* tkGeom_; const TrackerTopology* tkTopo_; @@ -66,7 +66,6 @@ class VectorHitBuilderAlgorithmBase { std::vector<double> barrelCut_; std::vector<double> endcapCut_; - private: edm::ESInputTag cpeTag_; }; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index 59a065f834c8e..0cd4e95110aaa 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -53,8 +53,8 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu // get input clusters data auto clustersHandle = event.getHandle(clusterProducer_); // create the final output collection - auto outputClustersAccepted = std::make_unique<edmNew::DetSetVector<Phase2TrackerCluster1D> >(); - auto outputClustersRejected = std::make_unique<edmNew::DetSetVector<Phase2TrackerCluster1D> >(); + auto outputClustersAccepted = std::make_unique<edmNew::DetSetVector<Phase2TrackerCluster1D>>(); + auto outputClustersRejected = std::make_unique<edmNew::DetSetVector<Phase2TrackerCluster1D>>(); std::unique_ptr<VectorHitCollection> outputVHAccepted(new VectorHitCollection()); std::unique_ptr<VectorHitCollection> outputVHRejected(new VectorHitCollection()); @@ -74,13 +74,12 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu } } LogDebug("VectorHitBuilderEDProducer") << "found\n" << numberOfVectorHits << " .\n"; -#endif //EDM_ML_DEBUG +#endif //EDM_ML_DEBUG // write output to file event.put(std::move(outputClustersAccepted), "accepted"); event.put(std::move(outputClustersRejected), "rejected"); event.put(std::move(outputVHAccepted), "accepted"); event.put(std::move(outputVHRejected), "rejected"); - } void VectorHitBuilderEDProducer::run(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 054ca671c6801..205e32ec016c5 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -27,7 +27,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track upperDetId = tkTopo_->partnerDetId(detId1); } else continue; - + DetId detIdStack = tkTopo_->stack(detId1); //debug @@ -52,7 +52,7 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track if (vh.second == true) { vhsInStack_Acc.push_back(vh.first); std::push_heap(vhsInStack_Acc.begin(), vhsInStack_Acc.end()); - totalAccepted += 1; + totalAccepted += 1; } else if (vh.second == false) { vhsInStack_Rej.push_back(vh.first); totalRejected += 1; @@ -140,8 +140,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi cut = barrelCut_.at(layerStack); if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTEC) cut = endcapCut_.at(layerStack); - LogDebug("VectorHitBuilderAlgorithm") << " \t the cut is:" << cut << std::endl; - + LogDebug("VectorHitBuilderAlgorithm") << " \t the cut is:" << cut << std::endl; //only cache local parameters for upper cluster as we loop over lower clusters only once anyway std::vector<std::pair<LocalPoint, LocalError>> localParamsUpper; @@ -149,7 +148,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi std::vector<Phase2TrackerCluster1DRef> upperClusters; const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); - for (auto const& clusterUpper : theUpperDetSet) { + for (auto const& clusterUpper : theUpperDetSet) { localGDUUpper.push_back(gduUpp); localParamsUpper.push_back(cpe_->localParameters(clusterUpper, *gduUpp)); } @@ -208,7 +207,6 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi double width = lpos_low_corr - lpos_upp_corr; LogDebug("VectorHitBuilderAlgorithm") << " \t width: " << width << std::endl; - //old cut: indipendent from layer //building my tolerance : 10*sigma //double delta = 10.0 * sqrt(lparamsLow.second.xx() + localParamsUpper[upperIterator].second.xx()); @@ -228,8 +226,8 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi LogDebug("VectorHitBuilderAlgorithm") << " rejecting VH: " << std::endl; //storing vh rejected for combinatiorial studies VectorHit vh = buildVectorHit(stack, cluL, cluU); - if (vh.isValid()){ - result.emplace_back(std::make_pair(vh, false)); + if (vh.isValid()) { + result.emplace_back(std::make_pair(vh, false)); } } upperIterator += 1; @@ -315,8 +313,8 @@ VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, GlobalError gErrorUpper = VectorHit::phase2clusterGlobalPosErr(geomDetUpper); if (gPositionLower.perp() > gPositionUpper.perp()) { - std::swap(gPositionLower,gPositionUpper); - std::swap(gErrorLower,gErrorUpper); + std::swap(gPositionLower, gPositionUpper); + std::swap(gErrorLower, gErrorUpper); } const CurvatureAndPhi curvatureAndPhi = curvatureANDphi(gPositionLower, gPositionUpper, gErrorLower, gErrorUpper); @@ -404,9 +402,9 @@ void VectorHitBuilderAlgorithm::fit(float x[2], } VectorHitBuilderAlgorithm::CurvatureAndPhi VectorHitBuilderAlgorithm::curvatureANDphi(Global3DPoint gPositionLower, - Global3DPoint gPositionUpper, - GlobalError gErrorLower, - GlobalError gErrorUpper) const { + Global3DPoint gPositionUpper, + GlobalError gErrorLower, + GlobalError gErrorUpper) const { VectorHitBuilderAlgorithm::CurvatureAndPhi result; float curvature = -999.; @@ -427,7 +425,6 @@ VectorHitBuilderAlgorithm::CurvatureAndPhi VectorHitBuilderAlgorithm::curvatureA double signCurv = -copysign(1.0, n3); double phi1 = atan2(gPositionUpper.y() - gPositionLower.y(), gPositionUpper.x() - gPositionLower.x()); - double x2Low = pow(gPositionLower.x(), 2); double y2Low = pow(gPositionLower.y(), 2); double x2Up = pow(gPositionUpper.x(), 2); @@ -438,9 +435,11 @@ VectorHitBuilderAlgorithm::CurvatureAndPhi VectorHitBuilderAlgorithm::curvatureA double h2Inf = 1. / (2 * h1); double r12 = gPositionLower.perp2(); double r22 = gPositionUpper.perp2(); - double h3 = pow(n2[0],2) + pow(n2[1],2); - double h4 = -x2Low * gPositionUpper.x() + gPositionLower.x() * x2Up + gPositionLower.x() *y2Up - gPositionUpper.x() * y2Low; - double h5 = x2Low * gPositionUpper.y() - x2Up * gPositionLower.y() + y2Low * gPositionUpper.y() - gPositionLower.y() * y2Up; + double h3 = pow(n2[0], 2) + pow(n2[1], 2); + double h4 = -x2Low * gPositionUpper.x() + gPositionLower.x() * x2Up + gPositionLower.x() * y2Up - + gPositionUpper.x() * y2Low; + double h5 = + x2Low * gPositionUpper.y() - x2Up * gPositionLower.y() + y2Low * gPositionUpper.y() - gPositionLower.y() * y2Up; //radius of circle double invRho2 = (4. * h1 * h1) / (r12 * r22 * h3); @@ -463,27 +462,45 @@ VectorHitBuilderAlgorithm::CurvatureAndPhi VectorHitBuilderAlgorithm::curvatureA double denom2 = 1. / (pow(r12 * r22 * h3, 1.5)); jacobian[0][0] = 1.0; // dx1/dx1 dx1/dy1 dx2/dx1 dy2/dx1 jacobian[1][1] = 1.0; //dy1/dx1 dy1/dy1 dy2/dx1 dy2/dx1 - jacobian[2][0] = -2. * ((h1 * (gPositionLower.x() * r22 * h3 + (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2 - (gPositionUpper.y()) * denom1); // dkappa/dx1 - jacobian[2][1] = -2. * ((gPositionUpper.x()) * denom1 + (h1 * (gPositionLower.y() * r22 * h3 + r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2); // dkappa/dy1 - jacobian[2][2] = -2. * ((gPositionLower.y()) * denom1 + (h1 * (gPositionUpper.x() * r12 * h3 - (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2); // dkappa/dx2 - jacobian[2][3] = -2. * ((h1 * (gPositionUpper.y() * r12 * h3 - r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - (gPositionLower.x()) * denom1); // dkappa/dy2 + jacobian[2][0] = + -2. * ((h1 * (gPositionLower.x() * r22 * h3 + (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * denom2 - + (gPositionUpper.y()) * denom1); // dkappa/dx1 + jacobian[2][1] = + -2. * ((gPositionUpper.x()) * denom1 + + (h1 * (gPositionLower.y() * r22 * h3 + r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * + denom2); // dkappa/dy1 + jacobian[2][2] = + -2. * ((gPositionLower.y()) * denom1 + + (h1 * (gPositionUpper.x() * r12 * h3 - (gPositionLower.x() - gPositionUpper.x()) * r12 * r22)) * + denom2); // dkappa/dx2 + jacobian[2][3] = + -2. * ((h1 * (gPositionUpper.y() * r12 * h3 - r12 * r22 * (gPositionLower.y() - gPositionUpper.y()))) * denom2 - + (gPositionLower.x()) * denom1); // dkappa/dy2 AlgebraicVector2 mVector; //to compute phi at the cluster points mVector[0] = (gPositionLower.y() - ycentre) * invRho2; // dphi/dxcentre mVector[1] = -(gPositionLower.x() - xcentre) * invRho2; // dphi/dycentre //to compute phi at the origin - double h22Inv = 1./pow(h2, 2); + double h22Inv = 1. / pow(h2, 2); AlgebraicROOTObject<2, 4>::Matrix kMatrix; - kMatrix[0][0] = 2. * ((gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionUpper.y() * h5) * h22Inv); // dxm/dx1 - kMatrix[0][1] = (2. * gPositionUpper.x() * h5) * h22Inv - (x2Up + y2Up - 2. * gPositionLower.y() * gPositionUpper.y()) * h2Inf; // dxm/dy1 - kMatrix[0][2] = 2. * ((gPositionLower.y() * h5) * h22Inv - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dxm/dx2 - kMatrix[0][3] = (x2Low + y2Low - 2. * gPositionUpper.y() * gPositionLower.y()) * h2Inf - (2. * gPositionLower.x() * h5) * h22Inv; // dxm/dy2 - kMatrix[1][0] = (x2Up - 2. * gPositionLower.x() * gPositionUpper.x() + y2Up) * h2Inf - (2. * gPositionUpper.y() * h4) * h22Inv; // dym/dx1 - kMatrix[1][1] = 2. * ((gPositionUpper.x() * h4) * h22Inv - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dym/dy1 - kMatrix[1][2] = (2. * gPositionLower.y() * h4) * h22Inv - (x2Low - 2. * gPositionUpper.x() * gPositionLower.x() + y2Low) * h2Inf; // dym/dx2 - kMatrix[1][3] = 2. * (gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionLower.x() * h4) * h22Inv; // dym/dy2 + kMatrix[0][0] = + 2. * ((gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionUpper.y() * h5) * h22Inv); // dxm/dx1 + kMatrix[0][1] = (2. * gPositionUpper.x() * h5) * h22Inv - + (x2Up + y2Up - 2. * gPositionLower.y() * gPositionUpper.y()) * h2Inf; // dxm/dy1 + kMatrix[0][2] = + 2. * ((gPositionLower.y() * h5) * h22Inv - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dxm/dx2 + kMatrix[0][3] = (x2Low + y2Low - 2. * gPositionUpper.y() * gPositionLower.y()) * h2Inf - + (2. * gPositionLower.x() * h5) * h22Inv; // dxm/dy2 + kMatrix[1][0] = (x2Up - 2. * gPositionLower.x() * gPositionUpper.x() + y2Up) * h2Inf - + (2. * gPositionUpper.y() * h4) * h22Inv; // dym/dx1 + kMatrix[1][1] = + 2. * ((gPositionUpper.x() * h4) * h22Inv - (gPositionUpper.x() * gPositionLower.y()) * h2Inf); // dym/dy1 + kMatrix[1][2] = (2. * gPositionLower.y() * h4) * h22Inv - + (x2Low - 2. * gPositionUpper.x() * gPositionLower.x() + y2Low) * h2Inf; // dym/dx2 + kMatrix[1][3] = + 2. * (gPositionLower.x() * gPositionUpper.y()) * h2Inf - (gPositionLower.x() * h4) * h22Inv; // dym/dy2 AlgebraicVector4 nMatrix = mVector * kMatrix; jacobian[3][0] = nMatrix[0]; // dphi/(dx1,dy1,dx2,dy2) @@ -527,8 +544,7 @@ VectorHitBuilderAlgorithm::CurvatureAndPhi VectorHitBuilderAlgorithm::curvatureA temp = temp * gErrors; errorCurvature = temp[0] * curvatureJacobian[0] + temp[1] * curvatureJacobian[1] + temp[2] * curvatureJacobian[2] + temp[3] * curvatureJacobian[3]; - - } + } result.curvature = curvature; result.curvatureError = errorCurvature; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index e7db9a0edf44d..b9035a168e4fa 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -97,11 +97,10 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, } void VectorHitBuilderAlgorithmBase::loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit> >& theMap, - edmNew::DetSetVector<VectorHit>& theCollection, - const int totalSize) const { - -theCollection.reserve(theMap.size(), totalSize); -for (const auto& it : theMap) { + edmNew::DetSetVector<VectorHit>& theCollection, + const int totalSize) const { + theCollection.reserve(theMap.size(), totalSize); + for (const auto& it : theMap) { edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it.first); for (const auto& vh_it : it.second) vh_col.push_back(vh_it); diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc index 0b744c7733b3a..29b49c425832d 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerEventProducer.cc @@ -126,8 +126,7 @@ void MeasurementTrackerEventProducer::produce(edm::Event& iEvent, const edm::Eve // const VectorHitCollection* phase2OTVectorHits = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsLabel) : nullptr; - const VectorHitCollection* phase2OTVectorHitsRej = - useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsRejLabel) : nullptr; + const VectorHitCollection* phase2OTVectorHitsRej = useVectorHits_ ? &iEvent.get(thePh2OTVectorHitsRejLabel) : nullptr; iEvent.put(std::make_unique<MeasurementTrackerEvent>(*measurementTracker, stripData.release(), pixelData.release(), diff --git a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc index e7ddb45169c28..f284d0c56d30f 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStackMeasurementDet.cc @@ -32,16 +32,14 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj //find clusters to skip const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index()); const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index()); - std::vector<bool> skipClustersUpper(data.phase2OTClustersToSkip().empty()? 0 : upperDetSet.size(), false); - std::vector<bool> skipClustersLower(data.phase2OTClustersToSkip().empty()? 0 : lowerDetSet.size(), false); - + std::vector<bool> skipClustersUpper(data.phase2OTClustersToSkip().empty() ? 0 : upperDetSet.size(), false); + std::vector<bool> skipClustersLower(data.phase2OTClustersToSkip().empty() ? 0 : lowerDetSet.size(), false); const Phase2TrackerCluster1D* begin = nullptr; if (!data.phase2OTData().handle()->data().empty()) { begin = &(data.phase2OTData().handle()->data().front()); } if (!data.phase2OTClustersToSkip().empty()) { - if (!lowerDetSet.empty()) { for (const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++cil) { if (cil < begin) { @@ -50,7 +48,7 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj } unsigned int indexl = cil - begin; if (data.phase2OTClustersToSkip()[indexl]) { - int iLocalL = std::distance(lowerDetSet.begin(),cil); + int iLocalL = std::distance(lowerDetSet.begin(), cil); skipClustersLower[iLocalL] = true; } } @@ -63,7 +61,7 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj } unsigned int indexu = ciu - begin; if (data.phase2OTClustersToSkip()[indexu]) { - int iLocalU = std::distance(upperDetSet.begin(),ciu); + int iLocalU = std::distance(upperDetSet.begin(), ciu); skipClustersUpper[iLocalU] = true; } } @@ -75,10 +73,10 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj if (iterator == data.phase2OTVectorHits().end()) return result; for (const auto& vecHit : data.phase2OTVectorHits()[detIdStack]) { - if (!data.phase2OTClustersToSkip().empty()){ - if (skipClustersLower[vecHit.lowerCluster().key()-lowerDetSet.offset()]) + if (!data.phase2OTClustersToSkip().empty()) { + if (skipClustersLower[vecHit.lowerCluster().key() - lowerDetSet.offset()]) continue; - if (skipClustersUpper[vecHit.upperCluster().key()-upperDetSet.offset()]) + if (skipClustersUpper[vecHit.upperCluster().key() - upperDetSet.offset()]) continue; } result.push_back(std::make_shared<VectorHit>(vecHit)); @@ -88,10 +86,10 @@ TkStackMeasurementDet::RecHitContainer TkStackMeasurementDet::recHits(const Traj if (iterator == data.phase2OTVectorHitsRej().end()) return result; for (const auto& vecHit : data.phase2OTVectorHitsRej()[detIdStack]) { - if (!data.phase2OTClustersToSkip().empty()){ - if (skipClustersLower[vecHit.lowerCluster().key()-lowerDetSet.offset()]) + if (!data.phase2OTClustersToSkip().empty()) { + if (skipClustersLower[vecHit.lowerCluster().key() - lowerDetSet.offset()]) continue; - if (skipClustersUpper[vecHit.upperCluster().key()-upperDetSet.offset()]) + if (skipClustersUpper[vecHit.upperCluster().key() - upperDetSet.offset()]) continue; } result.push_back(std::make_shared<VectorHit>(vecHit)); diff --git a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc index b96c630d7e74e..71d3286bdb129 100644 --- a/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc +++ b/RecoTracker/TkDetLayers/src/Phase2OTBarrelRodBuilder.cc @@ -24,7 +24,7 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 } meanR = meanR / allGeometricDets.size(); LogDebug("TkDetLayers") << " meanR Lower " << meanR << std::endl; - for (auto const& compGeometricDets : allGeometricDets){ + for (auto const& compGeometricDets : allGeometricDets) { const GeomDet* theGeomDet = theGeomDetGeometry->idToDet(compGeometricDets->geographicalId()); if (compGeometricDets->positionBounds().perp() < meanR) @@ -37,7 +37,6 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 LogDebug("TkDetLayers") << "innerGeomDets.size(): " << innerGeomDets.size(); LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size(); - } else { vector<const GeometricDet*> compGeometricDets; @@ -80,7 +79,6 @@ Phase2OTBarrelRod* Phase2OTBarrelRodBuilder::build(const GeometricDet* thePhase2 LogDebug("TkDetLayers") << "outerGeomDets.size(): " << outerGeomDets.size(); LogDebug("TkDetLayers") << "innerGeomDetsBro.size(): " << innerGeomDetBrothers.size(); LogDebug("TkDetLayers") << "outerGeomDetsBro.size(): " << outerGeomDetBrothers.size(); - } return new Phase2OTBarrelRod(innerGeomDets, outerGeomDets, innerGeomDetBrothers, outerGeomDetBrothers); diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index ab8f80679dbdb..195d4f1bf1a7d 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -231,13 +231,13 @@ TrajectorySeedCollection SeedingOTEDProducer::run(edm::Handle<VectorHitCollectio propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, *hitL3); if (!updatedTSOSL3_final.first) continue; - + edm::OwnVector<TrackingRecHit> container; container.push_back(hitL1->clone()); container.push_back(hitL2->clone()); container.push_back(hitL3->clone()); - TrajectorySeed ts = + TrajectorySeed ts = createSeed(updatedTSOSL3_final.second, container, hitL3->geographicalId(), *buildingPropagator); result.push_back(ts); } @@ -259,7 +259,7 @@ unsigned int SeedingOTEDProducer::checkLayer(unsigned int iidd) { } std::vector<const VectorHit*> SeedingOTEDProducer::collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>& input, - unsigned int layerNumber) { + unsigned int layerNumber) { std::vector<const VectorHit*> vHsOnLayer; if (!input.empty()) { for (const auto& DSViter : input) { @@ -322,8 +322,8 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto } AlgebraicSymMatrix55 SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix44 mat44) const { -// if (mat44.num_row() != 4 || mat44.num_col() != 4) -// assert("Wrong dimension! This should be a 4x4 matrix!"); + // if (mat44.num_row() != 4 || mat44.num_col() != 4) + // assert("Wrong dimension! This should be a 4x4 matrix!"); AlgebraicSymMatrix55 result; for (int i = 1; i < 5; i++) { @@ -346,8 +346,7 @@ std::pair<bool, TrajectoryStateOnSurface> SeedingOTEDProducer::propagateAndUpdat } float SeedingOTEDProducer::computeGlobalThetaError(const VectorHit* vh, const double sigmaZ_beamSpot) const { - double derivative = - vh->globalPosition().perp() / vh->globalPosition().mag2(); + double derivative = vh->globalPosition().perp() / vh->globalPosition().mag2(); double derivative2 = pow(derivative, 2); return pow(derivative2 * vh->lowerGlobalPosErr().czz() + derivative2 * pow(sigmaZ_beamSpot, 2), 0.5); } From 224b3a9edfb591cca6f9df75549ac60d45714669 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 20:47:24 +0200 Subject: [PATCH 484/778] put printClusters behind debug statements --- .../plugins/VectorHitBuilderEDProducer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index 0cd4e95110aaa..c0f9816a0c2f5 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -59,8 +59,10 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu std::unique_ptr<VectorHitCollection> outputVHRejected(new VectorHitCollection()); stubsBuilder_ = &es.getData(stubsBuilderToken_); + #ifdef EDM_ML_DEBUG // check on the input clusters stubsBuilder_->printClusters(*clustersHandle); + #endif //EDM_ML_DEBUG // running the stub building algorithm //ERICA::output should be moved in the different algo classes? From 41ff72e81bfba5e203c0d6cbb033f1137640fe22 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 20:55:13 +0200 Subject: [PATCH 485/778] re-add mysteriously vanished float --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 0b0d9fb33cbca..b832f64f12ed0 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -114,7 +114,7 @@ Global3DPoint VectorHit::upperGlobalPos() const { Global3DPoint VectorHit::phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) { const PixelTopology* topo = &geomDet->specificTopology(); float ix = cluster->center(); - float iy = cluster->column() + 0.5; // halfway the column + float iy = cluster->column() + 0.5f; // halfway the column LocalPoint lp(topo->localX(ix), topo->localY(iy), 0); // x, y, z Global3DPoint gp = geomDet->surface().toGlobal(lp); return gp; From d952d3ae75d4f5a8fa6863d510a21897719bd91a Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sat, 10 Oct 2020 21:42:50 +0200 Subject: [PATCH 486/778] code format --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 2 +- .../plugins/VectorHitBuilderEDProducer.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index b832f64f12ed0..790b171a815ca 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -114,7 +114,7 @@ Global3DPoint VectorHit::upperGlobalPos() const { Global3DPoint VectorHit::phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster) { const PixelTopology* topo = &geomDet->specificTopology(); float ix = cluster->center(); - float iy = cluster->column() + 0.5f; // halfway the column + float iy = cluster->column() + 0.5f; // halfway the column LocalPoint lp(topo->localX(ix), topo->localY(iy), 0); // x, y, z Global3DPoint gp = geomDet->surface().toGlobal(lp); return gp; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc index c0f9816a0c2f5..404ce82f97004 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/plugins/VectorHitBuilderEDProducer.cc @@ -59,10 +59,10 @@ void VectorHitBuilderEDProducer::produce(edm::Event& event, const edm::EventSetu std::unique_ptr<VectorHitCollection> outputVHRejected(new VectorHitCollection()); stubsBuilder_ = &es.getData(stubsBuilderToken_); - #ifdef EDM_ML_DEBUG +#ifdef EDM_ML_DEBUG // check on the input clusters stubsBuilder_->printClusters(*clustersHandle); - #endif //EDM_ML_DEBUG +#endif //EDM_ML_DEBUG // running the stub building algorithm //ERICA::output should be moved in the different algo classes? From 62d6f717fbfe0f22ce5b6ac54ceb05076af44ce4 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <yana@cmsdev20.cern.ch> Date: Sat, 10 Oct 2020 21:45:59 +0200 Subject: [PATCH 487/778] replace tbb containers with std ones --- .../DDCMS/interface/DDNamespace.h | 3 +- .../DDCMS/interface/DDParsingContext.h | 71 +++++++---------- .../DDCMS/interface/DDXMLTags.h | 6 -- .../plugins/dd4hep/DDDefinitions2Objects.cc | 41 +++------- .../DDCMS/src/DDFilteredView.cc | 5 +- DetectorDescription/DDCMS/src/DDNamespace.cc | 78 ++++++++----------- .../DDCMS/test/python/testGeometry2021.py | 3 + 7 files changed, 81 insertions(+), 126 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDNamespace.h b/DetectorDescription/DDCMS/interface/DDNamespace.h index e3d61e17973cd..a7357e442e6cf 100644 --- a/DetectorDescription/DDCMS/interface/DDNamespace.h +++ b/DetectorDescription/DDCMS/interface/DDNamespace.h @@ -51,12 +51,13 @@ namespace cms { void addConstantNS(const std::string& name, const std::string& value, const std::string& type) const; dd4hep::Material material(const std::string& name) const; + dd4hep::Solid solid(const std::string& name) const; dd4hep::Solid addSolid(const std::string& name, dd4hep::Solid solid) const; dd4hep::Solid addSolidNS(const std::string& name, dd4hep::Solid solid) const; - dd4hep::Assembly addAssembly(dd4hep::Assembly asmb) const; dd4hep::Assembly assembly(const std::string& name) const; + dd4hep::Assembly addAssembly(dd4hep::Assembly asmb) const; dd4hep::Volume volume(const std::string& name, bool exc = true) const; dd4hep::Volume addVolume(dd4hep::Volume vol) const; diff --git a/DetectorDescription/DDCMS/interface/DDParsingContext.h b/DetectorDescription/DDCMS/interface/DDParsingContext.h index 36acc41e0b373..1b4673919e4aa 100644 --- a/DetectorDescription/DDCMS/interface/DDParsingContext.h +++ b/DetectorDescription/DDCMS/interface/DDParsingContext.h @@ -5,42 +5,28 @@ #include <string> #include <variant> -#include "tbb/concurrent_unordered_map.h" -#include "tbb/concurrent_vector.h" -#include "tbb/concurrent_queue.h" +#include <unordered_map> +#include <vector> namespace cms { class DDParsingContext { public: - DDParsingContext(dd4hep::Detector* det) : description(det) {} - - ~DDParsingContext() { - assemblies.clear(); - rotations.clear(); - shapes.clear(); - volumes.clear(); - disabledAlgs.clear(); - namespaces.clear(); - }; - - bool const ns(std::string& result) { - std::string res; - if (namespaces.try_pop(res)) { - result = res; - namespaces.emplace(res); - return true; - } - return false; + DDParsingContext(dd4hep::Detector* det) : description(det) { + assemblies.reserve(100); + rotations.reserve(3000); + shapes.reserve(4000); + volumes.reserve(3000); + unresolvedMaterials.reserve(300); + unresolvedVectors.reserve(300); + unresolvedShapes.reserve(1000); + + namespaces.emplace_back(""); } - std::atomic<dd4hep::Detector*> description; - tbb::concurrent_unordered_map<std::string, dd4hep::Assembly> assemblies; - tbb::concurrent_unordered_map<std::string, dd4hep::Rotation3D> rotations; - tbb::concurrent_unordered_map<std::string, dd4hep::Solid> shapes; - tbb::concurrent_unordered_map<std::string, dd4hep::Volume> volumes; - tbb::concurrent_vector<std::string> disabledAlgs; - tbb::concurrent_queue<std::string> namespaces; + ~DDParsingContext() = default; + + const std::string& ns() const { return namespaces.back(); } template <class TYPE> struct BooleanShape { @@ -56,12 +42,6 @@ namespace cms { } }; - std::map<std::string, - std::variant<BooleanShape<dd4hep::UnionSolid>, - BooleanShape<dd4hep::SubtractionSolid>, - BooleanShape<dd4hep::IntersectionSolid>>> - unresolvedShapes; - struct CompositeMaterial { CompositeMaterial(const std::string& n, double f) : name(n), fraction(f) {} @@ -69,11 +49,6 @@ namespace cms { double fraction; }; - std::map<std::string, std::vector<CompositeMaterial>> unresolvedMaterials; - std::map<std::string, std::vector<std::string>> unresolvedVectors; - - bool geo_inited = false; - // Debug flags bool debug_includes = false; bool debug_constants = false; @@ -83,9 +58,23 @@ namespace cms { bool debug_volumes = false; bool debug_placements = false; bool debug_namespaces = false; - bool debug_visattr = false; bool debug_algorithms = false; bool debug_specpars = false; + + std::atomic<dd4hep::Detector*> description; + std::unordered_map<std::string, dd4hep::Assembly> assemblies; + std::unordered_map<std::string, dd4hep::Rotation3D> rotations; + std::unordered_map<std::string, dd4hep::Solid> shapes; + std::unordered_map<std::string, dd4hep::Volume> volumes; + std::vector<std::string> namespaces; + + std::unordered_map<std::string, std::vector<CompositeMaterial>> unresolvedMaterials; + std::unordered_map<std::string, std::vector<std::string>> unresolvedVectors; + std::unordered_map<std::string, + std::variant<BooleanShape<dd4hep::UnionSolid>, + BooleanShape<dd4hep::SubtractionSolid>, + BooleanShape<dd4hep::IntersectionSolid>>> + unresolvedShapes; }; } // namespace cms diff --git a/DetectorDescription/DDCMS/interface/DDXMLTags.h b/DetectorDescription/DDCMS/interface/DDXMLTags.h index 66fa50451d625..855c1698151ce 100644 --- a/DetectorDescription/DDCMS/interface/DDXMLTags.h +++ b/DetectorDescription/DDCMS/interface/DDXMLTags.h @@ -158,10 +158,6 @@ namespace cms { UNICODE(Vector); UNICODE(nEntries); - UNICODE(VisSection); - UNICODE(vismaterial); - UNICODE(vis); - UNICODE(debug_constants); UNICODE(debug_materials); UNICODE(debug_shapes); @@ -169,7 +165,6 @@ namespace cms { UNICODE(debug_placements); UNICODE(debug_namespaces); UNICODE(debug_rotations); - UNICODE(debug_visattr); UNICODE(debug_includes); UNICODE(debug_algorithms); UNICODE(debug_specpars); @@ -179,7 +174,6 @@ namespace cms { UNICODE(close_geometry); UNICODE(IncludeSection); UNICODE(Include); - UNICODE(DisabledAlgo); } // namespace cms diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 5d7a1bb5a47b4..19ac9d585e378 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -40,7 +40,6 @@ namespace dd4hep { atomic<UInt_t> unique_mat_id = 0xAFFEFEED; - class disabled_algo; class include_constants; class include_load; class include_unload; @@ -51,7 +50,8 @@ namespace dd4hep { struct DDRegistry { std::vector<xml::Document> includes; - std::unordered_map<std::string, std::string> unresolvedConst, allConst, originalConst; + std::unordered_map<std::string, std::string> unresolvedConst; + std::unordered_map<std::string, std::string> originalConst; }; class MaterialSection; @@ -120,8 +120,6 @@ namespace dd4hep { void Converter<debug>::operator()(xml_h element) const; template <> void Converter<print_xml_doc>::operator()(xml_h element) const; - template <> - void Converter<disabled_algo>::operator()(xml_h element) const; /// Converter for <ConstantsSection/> tags template <> @@ -320,12 +318,6 @@ void Converter<LogicalPartSection>::operator()(xml_h element) const { xml_coll_t(element, DD_CMU(LogicalPart)).for_each(Converter<DDLLogicalPart>(description, ns.context(), optional)); } -template <> -void Converter<disabled_algo>::operator()(xml_h element) const { - cms::DDParsingContext* c = _param<cms::DDParsingContext>(); - c->disabledAlgs.emplace_back(element.attr<string>(_U(name))); -} - /// Generic converter for <SolidSection/> tags template <> void Converter<SolidSection>::operator()(xml_h element) const { @@ -421,7 +413,6 @@ void Converter<DDLConstant>::operator()(xml_h element) const { if (idx == string::npos || typ == "string") { try { ns.addConstant(nam, val, typ); - res->allConst[real] = val; res->originalConst[real] = val; } catch (const exception& e) { printout(INFO, @@ -447,7 +438,6 @@ void Converter<DDLConstant>::operator()(xml_h element) const { } printout( ns.context()->debug_constants ? ALWAYS : DEBUG, "Constant", "Unresolved: %s -> %s", real.c_str(), val.c_str()); - res->allConst[real] = val; res->originalConst[real] = val; res->unresolvedConst[real] = val; } @@ -1579,14 +1569,6 @@ void Converter<DDLAlgorithm>::operator()(xml_h element) const { cms::DDNamespace ns(_param<cms::DDParsingContext>()); xml_dim_t e(element); string name = e.nameStr(); - for (auto const& i : ns.context()->disabledAlgs) { - if (name == i) { - // if(ns.context()->disabledAlgs.find( name ) != ns.context()->disabledAlgs.end()) { - printout(INFO, "DD4CMS", "+++ Skip disabled algorithms: %s", name.c_str()); - return; - } - } - size_t idx; string type = "DDCMS_" + ns.realName(name); while ((idx = type.find(NAMESPACE_SEP)) != string::npos) @@ -1695,8 +1677,6 @@ void Converter<DDLVector>::operator()(xml_h element) const { template <> void Converter<debug>::operator()(xml_h dbg) const { cms::DDNamespace ns(_param<cms::DDParsingContext>()); - if (dbg.hasChild(DD_CMU(debug_visattr))) - ns.setContext()->debug_visattr = true; if (dbg.hasChild(DD_CMU(debug_constants))) ns.setContext()->debug_constants = true; if (dbg.hasChild(DD_CMU(debug_materials))) @@ -1728,11 +1708,12 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { printout(context->debug_constants ? ALWAYS : DEBUG, "DD4CMS", - "+++ RESOLVING %ld unknown constants.....", - res->unresolvedConst.size()); + "+++ RESOLVING %ld unknown constants..... (out of %ld)", + res->unresolvedConst.size(), + res->originalConst.size()); while (!res->unresolvedConst.empty()) { - for (auto i : res->unresolvedConst) { + for (auto& i : res->unresolvedConst) { const string& n = i.first; string rep; string& v = i.second; @@ -1740,8 +1721,8 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { for (idx = v.find('[', 0); idx != string::npos; idx = v.find('[', idx + 1)) { idq = v.find(']', idx + 1); rep = v.substr(idx + 1, idq - idx - 1); - auto r = res->allConst.find(rep); - if (r != res->allConst.end()) { + auto r = res->originalConst.find(rep); + if (r != res->originalConst.end()) { rep = "(" + (*r).second + ")"; v.replace(idx, idq - idx + 1, rep); } @@ -1774,7 +1755,6 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { } res->unresolvedConst.clear(); res->originalConst.clear(); - res->allConst.clear(); } template <> @@ -1815,8 +1795,9 @@ static long load_dddefinition(Detector& det, xml_h element) { Converter<print_xml_doc> print_doc(det, &context); try { DDRegistry res; + res.unresolvedConst.reserve(2000); + res.originalConst.reserve(6000); print_doc((doc = dddef.document()).root()); - xml_coll_t(dddef, DD_CMU(DisabledAlgo)).for_each(Converter<disabled_algo>(det, &context, &res)); xml_coll_t(dddef, DD_CMU(ConstantsSection)).for_each(Converter<ConstantsSection>(det, &context, &res)); xml_coll_t(dddef, DD_CMU(RotationSection)).for_each(Converter<RotationSection>(det, &context)); xml_coll_t(dddef, DD_CMU(MaterialSection)).for_each(Converter<MaterialSection>(det, &context)); @@ -1844,7 +1825,6 @@ static long load_dddefinition(Detector& det, xml_h element) { result.emplace_back(dd4hep::_toDouble(i)); } registry->insert({it->first, result}); - // tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(begin(result), end(result))}); // All components are resolved it = context.unresolvedVectors.erase(it); } @@ -1901,7 +1881,6 @@ static long load_dddefinition(Detector& det, xml_h element) { } } if (open_geometry) { - context.geo_inited = true; det.init(); ns.addVolume(det.worldVolume()); } diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 1a5e2411b7d23..ffa3225425552 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -703,9 +703,8 @@ const int DDFilteredView::nodeCopyNoAt(int level) const { // Compare if name matches a selection pattern that // may or may not be defined as a regular expression bool DDFilteredView::compareEqualName(const std::string_view selection, const std::string_view name) const { - return (!(dd4hep::dd::isRegex(selection)) - ? dd4hep::dd::compareEqual(name, selection) - : regex_match(std::string(name.data(), name.size()), regex(std::string(selection)))); + return (!(dd4hep::dd::isRegex(selection)) ? dd4hep::dd::compareEqual(name, selection) + : regex_match(name.begin(), name.end(), regex(std::string(selection)))); } // Check if both name and it's selection pattern diff --git a/DetectorDescription/DDCMS/src/DDNamespace.cc b/DetectorDescription/DDCMS/src/DDNamespace.cc index e8d7081c27f69..9c547cffc438e 100644 --- a/DetectorDescription/DDCMS/src/DDNamespace.cc +++ b/DetectorDescription/DDCMS/src/DDNamespace.cc @@ -5,8 +5,8 @@ #include "XML/XML.h" #include <TClass.h> -#include "tbb/concurrent_unordered_map.h" -#include "tbb/concurrent_vector.h" +#include <unordered_map> +#include <vector> using namespace std; using namespace cms; @@ -16,13 +16,12 @@ DDNamespace::DDNamespace(DDParsingContext* context, xml_h element) : m_context(c m_name = path.filename().substr(0, path.filename().rfind('.')); if (!m_name.empty()) m_name += NAMESPACE_SEP; - m_context->namespaces.emplace(m_name); + m_context->namespaces.emplace_back(m_name); m_pop = true; dd4hep::printout(m_context->debug_namespaces ? dd4hep::ALWAYS : dd4hep::DEBUG, "DD4CMS", "+++ Current namespace is now: %s", m_name.c_str()); - return; } DDNamespace::DDNamespace(DDParsingContext& ctx, xml_h element, bool) : m_context(&ctx) { @@ -30,36 +29,31 @@ DDNamespace::DDNamespace(DDParsingContext& ctx, xml_h element, bool) : m_context m_name = path.filename().substr(0, path.filename().rfind('.')); if (!m_name.empty()) m_name += NAMESPACE_SEP; - m_context->namespaces.emplace(m_name); + m_context->namespaces.emplace_back(m_name); m_pop = true; dd4hep::printout(m_context->debug_namespaces ? dd4hep::ALWAYS : dd4hep::DEBUG, "DD4CMS", "+++ Current namespace is now: %s", m_name.c_str()); - return; } DDNamespace::DDNamespace(DDParsingContext* ctx) : m_context(ctx) { - if (!m_context->ns(m_name)) - m_name.clear(); + if (!m_context->namespaces.empty()) + m_name = m_context->namespaces.back(); } DDNamespace::DDNamespace(DDParsingContext& ctx) : m_context(&ctx) { - if (!m_context->ns(m_name)) - m_name.clear(); + if (!m_context->namespaces.empty()) + m_name = m_context->namespaces.back(); } DDNamespace::~DDNamespace() { if (m_pop) { - string result(""); - if (m_context->namespaces.try_pop(result)) - m_name = result; - else - m_name.clear(); + m_context->namespaces.pop_back(); dd4hep::printout(m_context->debug_namespaces ? dd4hep::ALWAYS : dd4hep::DEBUG, "DD4CMS", "+++ Current namespace is now: %s", - m_name.c_str()); + m_context->ns().c_str()); } } @@ -86,35 +80,35 @@ string DDNamespace::realName(const string& v) const { return val; } -string DDNamespace::nsName(const string& nam) { +string DDNamespace::nsName(const string& name) { size_t idx; - if ((idx = nam.find(NAMESPACE_SEP)) != string::npos) - return nam.substr(0, idx); + if ((idx = name.find(NAMESPACE_SEP)) != string::npos) + return name.substr(0, idx); return ""; } -string DDNamespace::objName(const string& nam) { +string DDNamespace::objName(const string& name) { size_t idx; - if ((idx = nam.find(NAMESPACE_SEP)) != string::npos) - return nam.substr(idx + 1); + if ((idx = name.find(NAMESPACE_SEP)) != string::npos) + return name.substr(idx + 1); return ""; } -void DDNamespace::addConstant(const string& nam, const string& val, const string& typ) const { - addConstantNS(prepend(nam), val, typ); +void DDNamespace::addConstant(const string& name, const string& val, const string& type) const { + addConstantNS(prepend(name), val, type); } -void DDNamespace::addConstantNS(const string& nam, const string& val, const string& typ) const { +void DDNamespace::addConstantNS(const string& name, const string& val, const string& type) const { const string& v = val; - const string& n = nam; + const string& n = name; dd4hep::printout(m_context->debug_constants ? dd4hep::ALWAYS : dd4hep::DEBUG, "DD4CMS", "+++ Add constant object: %-40s = %s [type:%s]", n.c_str(), v.c_str(), - typ.c_str()); - dd4hep::_toDictionary(n, v, typ); - dd4hep::Constant c(n, v, typ); + type.c_str()); + dd4hep::_toDictionary(n, v, type); + dd4hep::Constant c(n, v, type); m_context->description.load()->addConstant(c); } @@ -127,24 +121,24 @@ void DDNamespace::addRotation(const string& name, const dd4hep::Rotation3D& rot) m_context->rotations[n] = rot; } -const dd4hep::Rotation3D& DDNamespace::rotation(const string& nam) const { +const dd4hep::Rotation3D& DDNamespace::rotation(const string& name) const { static const dd4hep::Rotation3D s_null; size_t idx; - auto i = m_context->rotations.find(nam); + auto i = m_context->rotations.find(name); if (i != m_context->rotations.end()) return (*i).second; - else if (nam == "NULL") + else if (name == "NULL") return s_null; - else if (nam.find(":NULL") == nam.length() - 5) + else if (name.find(":NULL") == name.length() - 5) return s_null; - string n = nam; - if ((idx = nam.find(NAMESPACE_SEP)) != string::npos) { + string n = name; + if ((idx = name.find(NAMESPACE_SEP)) != string::npos) { n[idx] = NAMESPACE_SEP; i = m_context->rotations.find(n); if (i != m_context->rotations.end()) return (*i).second; } - throw runtime_error("Unknown rotation identifier:" + nam); + throw runtime_error("Unknown rotation identifier:" + name); } dd4hep::Volume DDNamespace::addVolumeNS(dd4hep::Volume vol) const { @@ -171,7 +165,6 @@ dd4hep::Volume DDNamespace::addVolume(dd4hep::Volume vol) const { string n = prepend(vol.name()); dd4hep::Solid s = vol.solid(); dd4hep::Material m = vol.material(); - //vol->SetName(n.c_str()); m_context->volumes[n] = vol; const char* solidName = "Invalid solid"; if (s.isValid()) // Protect against seg fault @@ -191,7 +184,7 @@ dd4hep::Assembly DDNamespace::addAssembly(dd4hep::Assembly assembly) const { string n = assembly.name(); m_context->assemblies[n] = assembly; dd4hep::printout( - m_context->debug_volumes ? dd4hep::ALWAYS : dd4hep::DEBUG, "DD4CMS", "+++ Add assemblyNS:%-38s", assembly.name()); + m_context->debug_volumes ? dd4hep::ALWAYS : dd4hep::DEBUG, "DD4CMS", "+++ Add assembly:%-38s", assembly.name()); return assembly; } @@ -268,10 +261,7 @@ std::vector<double> DDNamespace::vecDbl(const std::string& name) const { cms::DDVectorsMap* registry = m_context->description.load()->extension<cms::DDVectorsMap>(); auto it = registry->find(name); if (it != registry->end()) { - std::vector<double> result; - for (auto in : it->second) - result.emplace_back(in); - return result; + return {begin(it->second), end(it->second)}; } else return std::vector<double>(); } @@ -281,8 +271,8 @@ std::vector<float> DDNamespace::vecFloat(const std::string& name) const { auto it = registry->find(name); if (it != registry->end()) { std::vector<float> result; - for (auto in : it->second) - result.emplace_back((float)in); + std::transform( + begin(it->second), end(it->second), std::back_inserter(result), [](double i) -> float { return (float)i; }); return result; } else return std::vector<float>(); diff --git a/DetectorDescription/DDCMS/test/python/testGeometry2021.py b/DetectorDescription/DDCMS/test/python/testGeometry2021.py index 30df4687a5da0..03704cf723105 100644 --- a/DetectorDescription/DDCMS/test/python/testGeometry2021.py +++ b/DetectorDescription/DDCMS/test/python/testGeometry2021.py @@ -32,6 +32,9 @@ DDDetector = cms.ESInputTag('','CMS') ) +process.Timing = cms.Service("Timing") +process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck") + process.p = cms.Path( process.test +process.testVectors From 5620af1bbb3dad415704b01b0a50eb65f90727a1 Mon Sep 17 00:00:00 2001 From: Jeongeun Lee <jeongeun.lee@cern.ch> Date: Sun, 11 Oct 2020 15:50:44 +0200 Subject: [PATCH 488/778] drop type specs in RecoTauTag --- .../Configuration/python/HPSPFTaus_cff.py | 126 +++++++++--------- .../Configuration/python/RecoPFTauTag_cff.py | 43 +++--- .../python/boostedHPSPFTaus_cff.py | 17 ++- .../loadRecoTauTagMVAsFromPrepDB_cfi.py | 2 +- ...didateSeededTrackingRegionsProducer_cff.py | 17 +-- .../python/PixelTracksL2Tau_cfi.py | 6 +- ...TPFRecoTauDiscriminationByIsolation_cfi.py | 22 +-- ...TauDiscriminationByMVAIsolationRun2_cff.py | 12 +- ...FRecoTauChargedHadronBuilderPlugins_cfi.py | 10 +- .../PFRecoTauChargedHadronProducer_cff.py | 2 +- ...FRecoTauChargedHadronQualityPlugins_cfi.py | 4 +- .../PFRecoTauDiscriminationByIsolation_cfi.py | 28 ++-- ...DiscriminationByLeadingTrackFinding_cfi.py | 6 +- ...ecoTauDiscriminationByMVAIsolation2_cff.py | 10 +- ...TauDiscriminationByMVAIsolationRun2_cff.py | 12 +- .../python/RecoTauPiZeroBuilderPlugins_cfi.py | 8 +- .../python/RecoTauPiZeroProducer_cff.py | 6 +- 17 files changed, 164 insertions(+), 167 deletions(-) diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index cf60d05231113..3f85e27e24715 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -30,7 +30,7 @@ from RecoTauTag.RecoTau.PFRecoTauDiscriminationByHPSSelection_cfi import hpsSelectionDiscriminator, decayMode_1Prong0Pi0, decayMode_1Prong1Pi0, decayMode_1Prong2Pi0, decayMode_2Prong0Pi0, decayMode_2Prong1Pi0, decayMode_3Prong0Pi0, decayMode_3Prong1Pi0 hpsPFTauDiscriminationByDecayModeFindingNewDMs = hpsSelectionDiscriminator.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', #---------------------------------------------------------------------------- # CV: disable 3Prong1Pi0 decay mode decayModes = cms.VPSet( @@ -45,14 +45,14 @@ #---------------------------------------------------------------------------- ) hpsPFTauDiscriminationByDecayModeFindingOldDMs = hpsSelectionDiscriminator.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', decayModes = cms.VPSet( decayMode_1Prong0Pi0, decayMode_1Prong1Pi0, decayMode_1Prong2Pi0, decayMode_3Prong0Pi0 ), - requireTauChargedHadronsToBeChargedPFCands = cms.bool(True) + requireTauChargedHadronsToBeChargedPFCands = True ) hpsPFTauDiscriminationByDecayModeFinding = hpsPFTauDiscriminationByDecayModeFindingOldDMs.clone() ## CV: kept for backwards compatibility @@ -67,7 +67,7 @@ ## Cut based isolations dR=0.5 hpsPFTauBasicDiscriminators = pfRecoTauDiscriminationByIsolation.clone( - PFTauProducer = cms.InputTag("hpsPFTauProducer"), + PFTauProducer = "hpsPFTauProducer", Prediscriminants = requireDecayMode.clone(), deltaBetaPUTrackPtCutOverride = True, # Set the boolean = True to override. deltaBetaPUTrackPtCutOverride_val = 0.5, # Set the value for new value. @@ -170,7 +170,7 @@ # define helper function to read indices of basic IDs or antimuon ## MuonRejection3 hpsPFTauDiscriminationByMuonRejection3 = pfRecoTauDiscriminationAgainstMuon2Container.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', Prediscriminants = noPrediscriminants, IDWPdefinitions = cms.VPSet( cms.PSet( @@ -195,50 +195,50 @@ ## ByLooseElectronRejection hpsPFTauDiscriminationByLooseElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', Prediscriminants = noPrediscriminants, - PFElectronMVA_maxValue = cms.double(0.6) + PFElectronMVA_maxValue = 0.6 ) ## ByMediumElectronRejection hpsPFTauDiscriminationByMediumElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', Prediscriminants = noPrediscriminants, - ApplyCut_EcalCrackCut = cms.bool(True) + ApplyCut_EcalCrackCut = True ) ## ByTightElectronRejection hpsPFTauDiscriminationByTightElectronRejection = pfRecoTauDiscriminationAgainstElectron.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', Prediscriminants = noPrediscriminants, - ApplyCut_EcalCrackCut = cms.bool(True), - ApplyCut_BremCombined = cms.bool(True) + ApplyCut_EcalCrackCut = True, + ApplyCut_BremCombined = True ) ## ByDeadECALElectronRejection hpsPFTauDiscriminationByDeadECALElectronRejection = pfRecoTauDiscriminationAgainstElectronDeadECAL.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', Prediscriminants = requireDecayMode.clone() ) ## ByMVA6rawElectronRejection hpsPFTauDiscriminationByMVA6rawElectronRejection = pfRecoTauDiscriminationAgainstElectronMVA6.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), - srcElectrons = cms.InputTag('gedGsfElectrons'), + PFTauProducer = 'hpsPFTauProducer', + srcElectrons = 'gedGsfElectrons', Prediscriminants = requireDecayMode.clone(), - loadMVAfromDB = cms.bool(True), - vetoEcalCracks = cms.bool(False), - mvaName_NoEleMatch_woGwoGSF_BL = cms.string("RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_BL"), - mvaName_NoEleMatch_wGwoGSF_BL = cms.string("RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_BL"), - mvaName_woGwGSF_BL = cms.string("RecoTauTag_antiElectronMVA_woGwGSF_BL"), - mvaName_wGwGSF_BL = cms.string("RecoTauTag_antiElectronMVA_wGwGSF_BL"), - mvaName_NoEleMatch_woGwoGSF_EC = cms.string("RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_EC"), - mvaName_NoEleMatch_wGwoGSF_EC = cms.string("RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_EC"), - mvaName_woGwGSF_EC = cms.string("RecoTauTag_antiElectronMVA_woGwGSF_EC"), - mvaName_wGwGSF_EC = cms.string("RecoTauTag_antiElectronMVA_wGwGSF_EC") + loadMVAfromDB = True, + vetoEcalCracks = False, + mvaName_NoEleMatch_woGwoGSF_BL = "RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_BL", + mvaName_NoEleMatch_wGwoGSF_BL = "RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_BL", + mvaName_woGwGSF_BL = "RecoTauTag_antiElectronMVA_woGwGSF_BL", + mvaName_wGwGSF_BL = "RecoTauTag_antiElectronMVA_wGwGSF_BL", + mvaName_NoEleMatch_woGwoGSF_EC = "RecoTauTag_antiElectronMVA_NoEleMatch_woGwoGSF_EC", + mvaName_NoEleMatch_wGwoGSF_EC = "RecoTauTag_antiElectronMVA_NoEleMatch_wGwoGSF_EC", + mvaName_woGwGSF_EC = "RecoTauTag_antiElectronMVA_woGwGSF_EC", + mvaName_wGwGSF_EC = "RecoTauTag_antiElectronMVA_wGwGSF_EC" ) ## ByMVA6ElectronRejection hpsPFTauDiscriminationByMVA6ElectronRejection = recoTauDiscriminantCutMultiplexerDefault.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', Prediscriminants = requireDecayMode.clone(), - toMultiplex = cms.InputTag('hpsPFTauDiscriminationByMVA6rawElectronRejection'), - loadMVAfromDB = cms.bool(True), + toMultiplex = 'hpsPFTauDiscriminationByMVA6rawElectronRejection', + loadMVAfromDB = True, mapping = cms.VPSet( cms.PSet( category = cms.uint32(0), # minMVANoEleMatchWOgWOgsfBL @@ -311,46 +311,46 @@ from RecoTauTag.RecoTau.RecoTauCleaner_cfi import RecoTauCleaner hpsPFTauProducerSansRefs = RecoTauCleaner.clone( - src = cms.InputTag("combinatoricRecoTaus") + src = "combinatoricRecoTaus", + cleaners = {1: dict(src = "hpsSelectionDiscriminator")} ) -hpsPFTauProducerSansRefs.cleaners[1].src = cms.InputTag("hpsSelectionDiscriminator") from RecoTauTag.RecoTau.RecoTauPiZeroUnembedder_cfi import RecoTauPiZeroUnembedder hpsPFTauProducer = RecoTauPiZeroUnembedder.clone( - src = cms.InputTag("hpsPFTauProducerSansRefs") + src = "hpsPFTauProducerSansRefs" ) from RecoTauTag.RecoTau.PFTauPrimaryVertexProducer_cfi import * from RecoTauTag.RecoTau.PFTauSecondaryVertexProducer_cfi import * from RecoTauTag.RecoTau.PFTauTransverseImpactParameters_cfi import * hpsPFTauPrimaryVertexProducer = PFTauPrimaryVertexProducer.clone( - PFTauTag = cms.InputTag("hpsPFTauProducer"), - ElectronTag = cms.InputTag(""), - MuonTag = cms.InputTag(""), - PVTag = cms.InputTag("offlinePrimaryVertices"), - beamSpot = cms.InputTag("offlineBeamSpot"), - Algorithm = cms.int32(0), - useBeamSpot = cms.bool(True), - RemoveMuonTracks = cms.bool(False), - RemoveElectronTracks = cms.bool(False), - useSelectedTaus = cms.bool(False), + PFTauTag = "hpsPFTauProducer", + ElectronTag = "", + MuonTag = "", + PVTag = "offlinePrimaryVertices", + beamSpot = "offlineBeamSpot", + Algorithm = 0, + useBeamSpot = True, + RemoveMuonTracks = False, + RemoveElectronTracks = False, + useSelectedTaus = False, discriminators = cms.VPSet( cms.PSet( discriminator = cms.InputTag('hpsPFTauDiscriminationByDecayModeFindingNewDMs'), selectionCut = cms.double(0.5) ) ), - cut = cms.string("pt > 18.0 & abs(eta) < 2.4") + cut = "pt > 18.0 & abs(eta) < 2.4" ) hpsPFTauSecondaryVertexProducer = PFTauSecondaryVertexProducer.clone( - PFTauTag = cms.InputTag("hpsPFTauProducer") + PFTauTag = "hpsPFTauProducer" ) hpsPFTauTransverseImpactParameters = PFTauTransverseImpactParameters.clone( - PFTauTag = cms.InputTag("hpsPFTauProducer"), - PFTauPVATag = cms.InputTag("hpsPFTauPrimaryVertexProducer"), - PFTauSVATag = cms.InputTag("hpsPFTauSecondaryVertexProducer"), - useFullCalculation = cms.bool(True) + PFTauTag = "hpsPFTauProducer", + PFTauPVATag = "hpsPFTauPrimaryVertexProducer", + PFTauSVATag = "hpsPFTauSecondaryVertexProducer", + useFullCalculation = True ) hpsPFTauVertexAndImpactParametersTask = cms.Task( hpsPFTauPrimaryVertexProducer, @@ -373,11 +373,11 @@ ) hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT = discriminationByIsolationMVArun2v1.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', Prediscriminants = requireDecayMode.clone(), - toMultiplex = cms.InputTag('hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw'), - loadMVAfromDB = cms.bool(True), - mvaOutput_normalization = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMwLT_mvaOutput_normalization"), + toMultiplex = 'hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw', + loadMVAfromDB = True, + mvaOutput_normalization = "RecoTauTag_tauIdMVAIsoDBoldDMwLT_mvaOutput_normalization", mapping = cms.VPSet( cms.PSet( category = cms.uint32(0), @@ -385,7 +385,7 @@ variable = cms.string("pt") ) ), - workingPoints = cms.vstring( + workingPoints = [ "_VVLoose", "_VLoose", "_Loose", @@ -393,19 +393,19 @@ "_Tight", "_VTight", "_VVTight" - ) + ] ) hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLTraw.clone( - mvaName = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT"), - mvaOpt = cms.string("DBnewDMwLTwGJ"), - verbosity = cms.int32(0) + mvaName = "RecoTauTag_tauIdMVAIsoDBnewDMwLT", + mvaOpt = "DBnewDMwLTwGJ", + verbosity = 0 ) hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLT = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT.clone( - toMultiplex = cms.InputTag('hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw'), - loadMVAfromDB = cms.bool(True), - mvaOutput_normalization = cms.string("RecoTauTag_tauIdMVAIsoDBnewDMwLT_mvaOutput_normalization"), + toMultiplex = 'hpsPFTauDiscriminationByIsolationMVArun2v1DBnewDMwLTraw', + loadMVAfromDB = True, + mvaOutput_normalization = "RecoTauTag_tauIdMVAIsoDBnewDMwLT_mvaOutput_normalization", mapping = cms.VPSet( cms.PSet( category = cms.uint32(0), @@ -423,11 +423,11 @@ verbosity = 0 ) hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLT = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT.clone( - PFTauProducer = cms.InputTag('hpsPFTauProducer'), + PFTauProducer = 'hpsPFTauProducer', Prediscriminants = requireDecayMode.clone(), - toMultiplex = cms.InputTag('hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw'), - loadMVAfromDB = cms.bool(True), - mvaOutput_normalization = cms.string("RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT_mvaOutput_normalization"), + toMultiplex = 'hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLTraw', + loadMVAfromDB = True, + mvaOutput_normalization = "RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT_mvaOutput_normalization", mapping = cms.VPSet( cms.PSet( category = cms.uint32(0), diff --git a/RecoTauTag/Configuration/python/RecoPFTauTag_cff.py b/RecoTauTag/Configuration/python/RecoPFTauTag_cff.py index 4bb9b0fd5a511..6f0daa60e09db 100644 --- a/RecoTauTag/Configuration/python/RecoPFTauTag_cff.py +++ b/RecoTauTag/Configuration/python/RecoPFTauTag_cff.py @@ -30,9 +30,9 @@ # Reconstruct the pi zeros in our pre-selected jets. from RecoTauTag.RecoTau.RecoTauPiZeroProducer_cff import ak4PFJetsLegacyHPSPiZeros -ak4PFJetsLegacyHPSPiZeros = ak4PFJetsLegacyHPSPiZeros.clone() -ak4PFJetsLegacyHPSPiZeros.jetSrc = PFRecoTauPFJetInputs.inputJetCollection - +ak4PFJetsLegacyHPSPiZeros = ak4PFJetsLegacyHPSPiZeros.clone( + jetSrc = PFRecoTauPFJetInputs.inputJetCollection +) # import charged hadrons from RecoTauTag.RecoTau.PFRecoTauChargedHadronProducer_cff import ak4PFJetsRecoTauChargedHadrons ak4PFJetsRecoTauChargedHadrons = ak4PFJetsRecoTauChargedHadrons.clone() @@ -45,11 +45,18 @@ # We split it into different collections for each different decay mode. from RecoTauTag.RecoTau.RecoTauCombinatoricProducer_cfi import combinatoricRecoTaus, combinatoricModifierConfigs -combinatoricRecoTaus = combinatoricRecoTaus.clone() -combinatoricRecoTaus.modifiers = cms.VPSet(combinatoricModifierConfigs) -combinatoricRecoTaus.jetRegionSrc = cms.InputTag("recoTauAK4PFJets08Region") -combinatoricRecoTaus.jetSrc = PFRecoTauPFJetInputs.inputJetCollection +#------------------------------------------------------------------------------- +#------------------ HPS Taus --------------------------------------------------- +#------------------------------------------------------------------------------- +from RecoTauTag.Configuration.HPSPFTaus_cff import * +combinatoricRecoTaus = combinatoricRecoTaus.clone( + modifiers = cms.VPSet(combinatoricModifierConfigs), + jetRegionSrc = "recoTauAK4PFJets08Region", + jetSrc = PFRecoTauPFJetInputs.inputJetCollection, + chargedHadronSrc = "ak4PFJetsRecoTauChargedHadrons", + piZeroSrc = "ak4PFJetsLegacyHPSPiZeros" +) for e in [pp_on_XeXe_2017, pp_on_AA_2018]: e.toModify(combinatoricRecoTaus, minJetPt = recoTauAK4PFJets08Region.minJetPt) @@ -60,28 +67,19 @@ plugin = cms.string("PFRecoTauMassPlugin"), verbosity = cms.int32(0) )) -#-------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -#------------------ HPS Taus --------------------------------------------------- -#------------------------------------------------------------------------------- - -from RecoTauTag.Configuration.HPSPFTaus_cff import * - -combinatoricRecoTaus.chargedHadronSrc = cms.InputTag("ak4PFJetsRecoTauChargedHadrons") -combinatoricRecoTaus.piZeroSrc = cms.InputTag("ak4PFJetsLegacyHPSPiZeros") #------------------------------------------------------------------------------- #------------------ PFTauTagInfo workaround ------------------------------------ #------------------------------------------------------------------------------- # Build the PFTauTagInfos separately, then relink them into the taus. from RecoTauTag.RecoTau.PFRecoTauTagInfoProducer_cfi import pfRecoTauTagInfoProducer -pfRecoTauTagInfoProducer = pfRecoTauTagInfoProducer.clone() -pfRecoTauTagInfoProducer.PFJetTracksAssociatorProducer = cms.InputTag("ak4PFJetTracksAssociatorAtVertex") - +pfRecoTauTagInfoProducer = pfRecoTauTagInfoProducer.clone( + PFJetTracksAssociatorProducer = "ak4PFJetTracksAssociatorAtVertex" +) from RecoJets.JetAssociationProducers.ak4JTA_cff import ak4JetTracksAssociatorAtVertexPF -ak4PFJetTracksAssociatorAtVertex = ak4JetTracksAssociatorAtVertexPF.clone() -ak4PFJetTracksAssociatorAtVertex.jets = PFRecoTauPFJetInputs.inputJetCollection +ak4PFJetTracksAssociatorAtVertex = ak4JetTracksAssociatorAtVertexPF.clone( + jets = PFRecoTauPFJetInputs.inputJetCollection +) tautagInfoModifer = cms.PSet( name = cms.string("TTIworkaround"), plugin = cms.string("RecoTauTagInfoWorkaroundModifer"), @@ -123,4 +121,3 @@ PFTau = cms.Sequence( PFTauTask ) - diff --git a/RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py b/RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py index cd9cda3f50474..0295e0530752d 100644 --- a/RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py @@ -1,5 +1,4 @@ import FWCore.ParameterSet.Config as cms -import copy ''' @@ -9,12 +8,12 @@ import CommonTools.ParticleFlow.pfNoPileUp_cff as boostedTaus pfPileUpForBoostedTaus = boostedTaus.pfPileUp.clone( - PFCandidates = cms.InputTag('particleFlow'), - checkClosestZVertex = cms.bool(False) + PFCandidates = 'particleFlow', + checkClosestZVertex = False ) pfNoPileUpForBoostedTaus = boostedTaus.pfNoPileUp.clone( - topCollection = cms.InputTag('pfPileUpForBoostedTaus'), - bottomCollection = cms.InputTag('particleFlow') + topCollection = 'pfPileUpForBoostedTaus', + bottomCollection = 'particleFlow' ) @@ -23,11 +22,11 @@ ca8PFJetsCHSprunedForBoostedTaus = boostedTaus2.ak4PFJets.clone( boostedTaus3.CMSBoostedTauSeedingParameters, #src = cms.InputTag('pfNoPileUpForBoostedTaus'), - jetPtMin = cms.double(100.0), - doAreaFastjet = cms.bool(True), + jetPtMin = 100.0, + doAreaFastjet = True, nFilt = cms.int32(100), - rParam = cms.double(0.8), - jetAlgorithm = cms.string("CambridgeAachen"), + rParam = 0.8, + jetAlgorithm = "CambridgeAachen", writeCompound = cms.bool(True), jetCollInstanceName = cms.string('subJetsForSeedingBoostedTaus') ) diff --git a/RecoTauTag/Configuration/python/loadRecoTauTagMVAsFromPrepDB_cfi.py b/RecoTauTag/Configuration/python/loadRecoTauTagMVAsFromPrepDB_cfi.py index 2e0dee1dd6ac2..bcf222462e0c8 100644 --- a/RecoTauTag/Configuration/python/loadRecoTauTagMVAsFromPrepDB_cfi.py +++ b/RecoTauTag/Configuration/python/loadRecoTauTagMVAsFromPrepDB_cfi.py @@ -2,7 +2,7 @@ from CondCore.CondDB.CondDB_cfi import * '''Helper procedure that loads mva inputs from database''' -CondDBTauConnection = CondDB.clone( connect = cms.string( 'frontier://FrontierProd/CMS_CONDITIONS' ) ) +CondDBTauConnection = CondDB.clone( connect = 'frontier://FrontierProd/CMS_CONDITIONS' ) loadRecoTauTagMVAsFromPrepDB = cms.ESSource( "PoolDBESSource", CondDBTauConnection, diff --git a/RecoTauTag/HLTProducers/python/CandidateSeededTrackingRegionsProducer_cff.py b/RecoTauTag/HLTProducers/python/CandidateSeededTrackingRegionsProducer_cff.py index ddf6520fe0b79..686a3b09f0651 100644 --- a/RecoTauTag/HLTProducers/python/CandidateSeededTrackingRegionsProducer_cff.py +++ b/RecoTauTag/HLTProducers/python/CandidateSeededTrackingRegionsProducer_cff.py @@ -28,11 +28,12 @@ ) ) -SeededTrackingRegionsFromBeamSpotSigmaZLength = SeededTrackingRegionsFromBeamSpotFixedZLength.clone() -SeededTrackingRegionsFromBeamSpotSigmaZLength.mode = "BeamSpotSigma" - -SeededTrackingRegionsFromVerticesFixedZLength = SeededTrackingRegionsFromBeamSpotFixedZLength.clone() -SeededTrackingRegionsFromVerticesFixedZLength.mode = "VerticesFixed" - -SeededTrackingRegionsFromVerticesSigmaZLength = SeededTrackingRegionsFromBeamSpotFixedZLength.clone() -SeededTrackingRegionsFromVerticesSigmaZLength.mode = "VerticesSigma" +SeededTrackingRegionsFromBeamSpotSigmaZLength = SeededTrackingRegionsFromBeamSpotFixedZLength.clone( + mode = "BeamSpotSigma" +) +SeededTrackingRegionsFromVerticesFixedZLength = SeededTrackingRegionsFromBeamSpotFixedZLength.clone( + mode = "VerticesFixed" +) +SeededTrackingRegionsFromVerticesSigmaZLength = SeededTrackingRegionsFromBeamSpotFixedZLength.clone( + mode = "VerticesSigma" +) diff --git a/RecoTauTag/HLTProducers/python/PixelTracksL2Tau_cfi.py b/RecoTauTag/HLTProducers/python/PixelTracksL2Tau_cfi.py index d512d0baf633d..e69782c9622e3 100644 --- a/RecoTauTag/HLTProducers/python/PixelTracksL2Tau_cfi.py +++ b/RecoTauTag/HLTProducers/python/PixelTracksL2Tau_cfi.py @@ -7,6 +7,6 @@ # Previously the TrackingRegion was set as a parameter of PixelTrackProducer # Now the TrackingRegion EDProducer must be inserted in a sequence, and set as an input to HitPairEDProducer -pixelTracksL2Tau = _pixelTracks.clone() -pixelTracksL2Tau.passLabel = cms.string('pixelTracksL2Tau') - +pixelTracksL2Tau = _pixelTracks.clone( + passLabel = 'pixelTracksL2Tau' +) diff --git a/RecoTauTag/RecoTau/python/HLTPFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/HLTPFRecoTauDiscriminationByIsolation_cfi.py index 13753bb13ff85..05a024faf3d77 100644 --- a/RecoTauTag/RecoTau/python/HLTPFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/HLTPFRecoTauDiscriminationByIsolation_cfi.py @@ -5,7 +5,7 @@ from RecoTauTag.RecoTau.PFRecoTauDiscriminationByIsolation_cfi import pfRecoTauDiscriminationByIsolation hltPFRecoTauDiscriminationByIsolation = pfRecoTauDiscriminationByIsolation.clone( - PFTauProducer = cms.InputTag('hltPFRecoTauProducer'), #tau collection to discriminate + PFTauProducer = 'hltPFRecoTauProducer', #tau collection to discriminate # Require leading pion ensures that: # 1) these is at least one track above threshold (0.5 GeV) in the signal cone @@ -15,29 +15,29 @@ qualityCuts = hltPFTauQualityCuts,# set the standard quality cuts # Delta-Beta corrections to remove Pileup - particleFlowSrc = cms.InputTag("hltParticleFlow"), + particleFlowSrc = "hltParticleFlow", vertexSrc = hltPFTauQualityCuts.primaryVertexSrc, - customOuterCone = cms.double( -1.0 ), + customOuterCone = -1.0, # This must correspond to the cone size of the algorithm which built the # tau. (or if customOuterCone option is used, the custom cone size) - isoConeSizeForDeltaBeta = cms.double(0.3), + isoConeSizeForDeltaBeta = 0.3, # The delta beta factor maps the expected neutral contribution in the # isolation cone from the observed PU charged contribution. This factor can # optionally be a function (use 'x') of the number of vertices in the event # (taken from the multiplicity of vertexSrc collection) - deltaBetaFactor = cms.string("0.38"), + deltaBetaFactor = "0.38", # By default, the pt threshold for tracks used to compute the DeltaBeta # correction is taken as the gamma Et threshold from the isolation quality # cuts. - deltaBetaPUTrackPtCutOverride = cms.bool(True), # Set the boolean = True to override. - deltaBetaPUTrackPtCutOverride_val = cms.double(0.5), # Set the value for new value. + deltaBetaPUTrackPtCutOverride = True, # Set the boolean = True to override. + deltaBetaPUTrackPtCutOverride_val = 0.5, # Set the value for new value. # Rho corrections - applyRhoCorrection = cms.bool(False), - rhoProducer = cms.InputTag("kt6PFJets", "rho"), - rhoConeSize = cms.double(0.5), - rhoUEOffsetCorrection = cms.double(1.0), + applyRhoCorrection = False, + rhoProducer = "kt6PFJets:rho", + rhoConeSize = 0.5, + rhoUEOffsetCorrection = 1.0, IDdefinitions = cms.VPSet(), IDWPdefinitions = cms.VPSet( diff --git a/RecoTauTag/RecoTau/python/PATTauDiscriminationByMVAIsolationRun2_cff.py b/RecoTauTag/RecoTau/python/PATTauDiscriminationByMVAIsolationRun2_cff.py index 9b961e84ba1dc..0574f9d1656e7 100644 --- a/RecoTauTag/RecoTau/python/PATTauDiscriminationByMVAIsolationRun2_cff.py +++ b/RecoTauTag/RecoTau/python/PATTauDiscriminationByMVAIsolationRun2_cff.py @@ -28,11 +28,11 @@ ) patDiscriminationByIsolationMVArun2v1 = patTauDiscriminantCutMultiplexer.clone( - PATTauProducer = cms.InputTag('replaceMeByTauCollectionToBeUsed'), # in MiniAOD: slimmedTaus + PATTauProducer = 'replaceMeByTauCollectionToBeUsed', # in MiniAOD: slimmedTaus Prediscriminants = noPrediscriminants, - toMultiplex = cms.InputTag('patDiscriminationByIsolationMVArun2v1raw'), - loadMVAfromDB = cms.bool(True), - mvaOutput_normalization = cms.string("replaceMeByNormalizationToBeUsedIfAny"), # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_mvaOutput_normalization + toMultiplex = 'patDiscriminationByIsolationMVArun2v1raw', + loadMVAfromDB = True, + mvaOutput_normalization = "replaceMeByNormalizationToBeUsedIfAny", # e.g. RecoTauTag_tauIdMVADBoldDMwLTv1_mvaOutput_normalization mapping = cms.VPSet( cms.PSet( category = cms.uint32(0), @@ -40,13 +40,13 @@ variable = cms.string("pt"), ) ), - workingPoints = cms.vstring( + workingPoints = [ "Eff80", "Eff70", "Eff60", "Eff50", "Eff40" - ) + ] ) mvaIsolation2TaskRun2 = cms.Task( diff --git a/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronBuilderPlugins_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronBuilderPlugins_cfi.py index d1e9dea93c42b..75404b750a436 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronBuilderPlugins_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronBuilderPlugins_cfi.py @@ -56,11 +56,11 @@ # Produce a ChargedHadron candidate for high Pt PFNeutralHadrons PFNeutralHadrons = chargedPFCandidates.clone( - name = cms.string("PFNeutralHadrons"), - plugin = cms.string("PFRecoTauChargedHadronFromPFCandidatePlugin"), + name = "PFNeutralHadrons", + plugin = "PFRecoTauChargedHadronFromPFCandidatePlugin", # process PFNeutralHadrons # (numbering scheme defined in DataFormats/ParticleFlowCandidate/interface/PFCandidate.h) - chargedHadronCandidatesParticleIds = cms.vint32(5), - minMergeChargedHadronPt = cms.double(0.), - verbosity = cms.int32(0) + chargedHadronCandidatesParticleIds = [5], + minMergeChargedHadronPt = 0., + verbosity = 0 ) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronProducer_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronProducer_cff.py index 6ea27b22657eb..bf7624f10429f 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronProducer_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronProducer_cff.py @@ -11,7 +11,7 @@ jetSrc = PFRecoTauPFJetInputs.inputJetCollection, minJetPt = PFRecoTauPFJetInputs.minJetPt, maxJetAbsEta = PFRecoTauPFJetInputs.maxJetAbsEta, - outputSelection = cms.string('pt > %1.1f' % PFTauQualityCuts.signalQualityCuts.minTrackPt.value()), # CV: apply minimum Pt cut as sanity check + outputSelection = 'pt > %1.1f' % PFTauQualityCuts.signalQualityCuts.minTrackPt.value(), # CV: apply minimum Pt cut as sanity check builders = cms.VPSet( builders.chargedPFCandidates, builders.tracks, diff --git a/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronQualityPlugins_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronQualityPlugins_cfi.py index 64fe49a95b204..1cf153d51123c 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronQualityPlugins_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauChargedHadronQualityPlugins_cfi.py @@ -18,9 +18,9 @@ ) isTrack = isChargedPFCandidate.clone( - selection = cms.string("algoIs('kTrack')") + selection = "algoIs('kTrack')" ) isPFNeutralHadron = isChargedPFCandidate.clone( - selection = cms.string("algoIs('kPFNeutralHadron')") + selection = "algoIs('kPFNeutralHadron')" ) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index 82fee809430f7..26a8bf78d61c6 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -11,32 +11,32 @@ Prediscriminants = requireLeadTrack, # Select which collections to use for isolation. You can select one or both - WeightECALIsolation = cms.double(1.), # apply a flat, overall weight to ECAL isolation. Useful to combine charged and neutral isolations with different relative weights. Default 1. + WeightECALIsolation = 1., # apply a flat, overall weight to ECAL isolation. Useful to combine charged and neutral isolations with different relative weights. Default 1. - minTauPtForNoIso = cms.double(-99.), # minimum tau pt at which the isolation is completely relaxed. If negative, this is disabled + minTauPtForNoIso = -99., # minimum tau pt at which the isolation is completely relaxed. If negative, this is disabled qualityCuts = PFTauQualityCuts, # set the standard quality cuts # Delta-Beta corrections to remove Pileup - particleFlowSrc = cms.InputTag("particleFlow"), + particleFlowSrc = "particleFlow", vertexSrc = PFTauQualityCuts.primaryVertexSrc, # This must correspond to the cone size of the algorithm which built the # tau. (or if customOuterCone option is used, the custom cone size) - customOuterCone = cms.double(-1.), # propagated this default from .cc, it probably corresponds to not using customOuterCone - isoConeSizeForDeltaBeta = cms.double(0.5), + customOuterCone = -1., # propagated this default from .cc, it probably corresponds to not using customOuterCone + isoConeSizeForDeltaBeta = 0.5, # The delta beta factor maps the expected neutral contribution in the # isolation cone from the observed PU charged contribution. This factor can # optionally be a function (use 'x') of the number of vertices in the event # (taken from the multiplicity of vertexSrc collection) - deltaBetaFactor = cms.string("0.38"), + deltaBetaFactor = "0.38", # By default, the pt threshold for tracks used to compute the DeltaBeta # correction is taken as the gamma Et threshold from the isolation quality # cuts. - deltaBetaPUTrackPtCutOverride = cms.bool(False), # Set the boolean = True to override. - deltaBetaPUTrackPtCutOverride_val = cms.double(-1.5), # Set the value for new value. + deltaBetaPUTrackPtCutOverride = False, # Set the boolean = True to override. + deltaBetaPUTrackPtCutOverride_val = -1.5, # Set the value for new value. # Tau footprint correction - applyFootprintCorrection = cms.bool(False), + applyFootprintCorrection = False, footprintCorrections = cms.VPSet( cms.PSet( selection = cms.string("decayMode() = 0"), @@ -61,10 +61,10 @@ ), # Rho corrections - applyRhoCorrection = cms.bool(False), - rhoProducer = cms.InputTag("fixedGridRhoFastjetAll"), - rhoConeSize = cms.double(0.5), - rhoUEOffsetCorrection = cms.double(1.0), + applyRhoCorrection = False, + rhoProducer = "fixedGridRhoFastjetAll", + rhoConeSize = 0.5, + rhoUEOffsetCorrection = 1.0, - verbosity = cms.int32(0), + verbosity = 0, ) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByLeadingTrackFinding_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByLeadingTrackFinding_cfi.py index 258a37bf5c3f4..77263a839a954 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByLeadingTrackFinding_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByLeadingTrackFinding_cfi.py @@ -4,16 +4,16 @@ pfRecoTauDiscriminationByLeadingTrackFinding = pfRecoTauDiscriminationByLeadingObjectPtCut.clone( # Tau collection to discriminate - PFTauProducer = cms.InputTag('pfRecoTauProducer'), + PFTauProducer = 'pfRecoTauProducer', # Only look for charged PFCandidates - UseOnlyChargedHadrons = cms.bool(True), + UseOnlyChargedHadrons = True, # no pre-reqs for this cut Prediscriminants = noPrediscriminants, # Any *existing* charged PFCandidate will meet this requirement - so it is # a test for existence, not pt - MinPtLeadingObject = cms.double(0.0) + MinPtLeadingObject = 0.0 ) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByMVAIsolation2_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByMVAIsolation2_cff.py index a652bfcc82a68..6c44709cd0532 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByMVAIsolation2_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByMVAIsolation2_cff.py @@ -29,10 +29,10 @@ ) discriminationByIsolationMVA2 = recoTauDiscriminantCutMultiplexerDefault.clone( - PFTauProducer = cms.InputTag('pfTauProducer'), + PFTauProducer = 'pfTauProducer', Prediscriminants = requireLeadTrack, - toMultiplex = cms.InputTag('discriminationByIsolationMVA2raw'), - loadMVAfromDB = cms.bool(True), + toMultiplex = 'discriminationByIsolationMVA2raw', + loadMVAfromDB = True, mapping = cms.VPSet( cms.PSet( category = cms.uint32(0), @@ -40,13 +40,13 @@ variable = cms.string("pt"), ) ), - workingPoints = cms.vstring( + workingPoints = [ "Eff80", "Eff70", "Eff60", "Eff50", "Eff40" - ) + ] ) mvaIsolation2Task = cms.Task( diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByMVAIsolationRun2_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByMVAIsolationRun2_cff.py index 8be240c473741..370f7115884da 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByMVAIsolationRun2_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByMVAIsolationRun2_cff.py @@ -8,22 +8,22 @@ discriminationByIsolationMVArun2v1raw = pfRecoTauDiscriminationByMVAIsolationRun2.clone( # tau collection to discriminate - PFTauProducer = cms.InputTag('pfTauProducer'), + PFTauProducer = 'pfTauProducer', # Require leading pion ensures that: # 1) these is at least one track above threshold (0.5 GeV) in the signal cone # 2) a track OR a pi-zero in the signal cone has pT > 5 GeV Prediscriminants = requireLeadTrack, - loadMVAfromDB = cms.bool(True), + loadMVAfromDB = True, - srcBasicTauDiscriminators = cms.InputTag('hpsPFTauBasicDiscriminators') + srcBasicTauDiscriminators = 'hpsPFTauBasicDiscriminators' ) discriminationByIsolationMVArun2v1 = recoTauDiscriminantCutMultiplexerDefault.clone( - PFTauProducer = cms.InputTag('pfTauProducer'), + PFTauProducer = 'pfTauProducer', Prediscriminants = requireLeadTrack, - toMultiplex = cms.InputTag('discriminationByIsolationMVArun2v1raw'), - loadMVAfromDB = cms.bool(True), + toMultiplex = 'discriminationByIsolationMVArun2v1raw', + loadMVAfromDB = True, mapping = cms.VPSet( cms.PSet( category = cms.uint32(0), diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py index fee2c92b23b92..a600e9baff6e3 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py @@ -44,9 +44,9 @@ ) comboStrips = strips.clone( - name = cms.string("cs"), - plugin = cms.string("RecoTauPiZeroStripPlugin"), - makeCombinatoricStrips = cms.bool(True), + name = "cs", + plugin = "RecoTauPiZeroStripPlugin", + makeCombinatoricStrips = True, maxInputStrips = cms.int32(5), stripMassWhenCombining = cms.double(0.0), # assume photon like ) @@ -68,7 +68,7 @@ # and eta x phi size of strip increasing for low pT photons modStrips2 = strips.clone( - plugin = cms.string('RecoTauPiZeroStripPlugin3'), + plugin = 'RecoTauPiZeroStripPlugin3', qualityCuts = PFTauQualityCuts, applyElecTrackQcuts = cms.bool(False), stripEtaAssociationDistanceFunc = cms.PSet( diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cff.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cff.py index 603a61e653f09..6f818508b70e4 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cff.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cff.py @@ -27,7 +27,7 @@ jetSrc = PFRecoTauPFJetInputs.inputJetCollection, minJetPt = PFRecoTauPFJetInputs.minJetPt, maxJetAbsEta = PFRecoTauPFJetInputs.maxJetAbsEta, - outputSelection = cms.string('pt > 1.5'), + outputSelection = 'pt > 1.5', builders = cms.VPSet( builders.comboStrips ), @@ -41,7 +41,7 @@ jetSrc = PFRecoTauPFJetInputs.inputJetCollection, minJetPt = PFRecoTauPFJetInputs.minJetPt, maxJetAbsEta = PFRecoTauPFJetInputs.maxJetAbsEta, - outputSelection = cms.string('pt > 1.5'), + outputSelection = 'pt > 1.5', builders = cms.VPSet( builders.combinatoricPhotonPairs, builders.modStrips2 @@ -58,7 +58,7 @@ jetSrc = PFRecoTauPFJetInputs.inputJetCollection, minJetPt = PFRecoTauPFJetInputs.minJetPt, maxJetAbsEta = PFRecoTauPFJetInputs.maxJetAbsEta, - outputSelection = cms.string('pt > 1.5'), + outputSelection = 'pt > 1.5', builders = cms.VPSet( builders.allSinglePhotons, builders.combinatoricPhotonPairs From 7d164dbe0db851519f85855bac83195ccac63d99 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Sun, 11 Oct 2020 16:00:34 +0200 Subject: [PATCH 489/778] fix earlyGeneralTracks config --- .../python/earlyGeneralTracks_cfi.py | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py index 9bc904b3ebd5e..bb76495d7438a 100644 --- a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py +++ b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py @@ -103,9 +103,22 @@ ) from Configuration.ProcessModifiers.vectorHits_cff import vectorHits -(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, TrackProducers = earlyGeneralTracks.TrackProducers + ['pixelLessStepTracks']) -(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, hasSelector = earlyGeneralTracks.hasSelector + [1]) -(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, indivShareFrac = earlyGeneralTracks.indivShareFrac + [0.095]) -(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, selectedTrackQuals = earlyGeneralTracks.selectedTrackQuals + ['pixelLessStepSelector:pixelLessStep']) -(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True)))) +(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, TrackProducers = ['initialStepTracks', + 'highPtTripletStepTracks', + 'lowPtQuadStepTracks', + 'lowPtTripletStepTracks', + 'detachedQuadStepTracks', + 'pixelPairStepTracks', + 'pixelLessStepTracks'], + hasSelector = [1,1,1,1,1,1,1], + indivShareFrac = [1.0,0.16,0.095,0.09,0.09,0.09,0.095], + selectedTrackQuals = ['initialStepSelector:initialStep', + 'highPtTripletStepSelector:highPtTripletStep', + 'lowPtQuadStepSelector:lowPtQuadStep', + 'lowPtTripletStepSelector:lowPtTripletStep', + 'detachedQuadStep', + 'pixelPairStepSelector:pixelPairStep', + 'pixelLessStepSelector:pixelLessStep'], + setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True))) +) From a7fdf00e9b78bb16311ae46d7a3f28a81490976e Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Sun, 11 Oct 2020 20:14:06 +0200 Subject: [PATCH 490/778] update the documentation --- Calibration/HcalCalibAlgos/macros/isotrackApplyRegressor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Calibration/HcalCalibAlgos/macros/isotrackApplyRegressor.py b/Calibration/HcalCalibAlgos/macros/isotrackApplyRegressor.py index 219beea89c2bc..737c30a549a4a 100644 --- a/Calibration/HcalCalibAlgos/macros/isotrackApplyRegressor.py +++ b/Calibration/HcalCalibAlgos/macros/isotrackApplyRegressor.py @@ -1,7 +1,7 @@ ###################################################################################### # Evaluates regressor from loaded model # Usage: -# python3 isotrackApplyRegressor.py -PU root://cmseos.fnal.gov//store/user/sghosh/ISOTRACK/DIPI_2021_PUpart.root -M ./models/model1.h5 -B barrel/endcap -O corrfac1.txt +# python3 isotrackApplyRegressor.py -PU root://cmseos.fnal.gov//store/user/sghosh/ISOTRACK/DIPI_2021_PUpart.root -M ./models/model1.h5 -B endcap -O corrfac1.txt # python3 isotrackApplyRegressor.py -PU root://cmseos.fnal.gov//store/user/sghosh/ISOTRACK/DIPI_2021_PUpart.root -M ./models/model2.h5 -B barrel -O corrfac2.txt ###################################################################################### # coding: utf-8 From 932f49d655515c2e6dd4918f085c575b87894958 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Sun, 11 Oct 2020 13:36:21 -0500 Subject: [PATCH 491/778] Moved ClusterRemovalRefSetter to TrackingTools/PatternTools ClusterRemovalRefSetter depends on FWCore/Framework which is not an allowed dependency for a class in DataFormats. --- DataFormats/TrackerRecHit2D/BuildFile.xml | 1 - .../FinalTrackSelectors/plugins/DuplicateListMerger.cc | 2 +- .../plugins/TrackCollectionFilterCloner.cc | 2 +- RecoTracker/FinalTrackSelectors/plugins/TrackListMerger.cc | 2 +- RecoTracker/TkSeedGenerator/plugins/SeedCombiner.cc | 2 +- RecoTracker/TrackProducer/src/KfTrackProducerBase.cc | 2 +- .../PatternTools}/interface/ClusterRemovalRefSetter.h | 4 ++-- .../PatternTools}/interface/ClusterRemovalRefSetter.icc | 0 8 files changed, 7 insertions(+), 8 deletions(-) rename {DataFormats/TrackerRecHit2D => TrackingTools/PatternTools}/interface/ClusterRemovalRefSetter.h (92%) rename {DataFormats/TrackerRecHit2D => TrackingTools/PatternTools}/interface/ClusterRemovalRefSetter.icc (100%) diff --git a/DataFormats/TrackerRecHit2D/BuildFile.xml b/DataFormats/TrackerRecHit2D/BuildFile.xml index 17ee9fb29a2e0..81627d076969b 100644 --- a/DataFormats/TrackerRecHit2D/BuildFile.xml +++ b/DataFormats/TrackerRecHit2D/BuildFile.xml @@ -5,7 +5,6 @@ <use name="DataFormats/TrajectorySeed"/> <use name="DataFormats/Phase2TrackerCluster"/> <use name="FWCore/MessageLogger"/> -<use name="FWCore/Framework"/> <use name="Geometry/CommonDetUnit"/> <export> <lib name="1"/> diff --git a/RecoTracker/FinalTrackSelectors/plugins/DuplicateListMerger.cc b/RecoTracker/FinalTrackSelectors/plugins/DuplicateListMerger.cc index d4c6700e717ca..5de9099de43a0 100644 --- a/RecoTracker/FinalTrackSelectors/plugins/DuplicateListMerger.cc +++ b/RecoTracker/FinalTrackSelectors/plugins/DuplicateListMerger.cc @@ -78,7 +78,7 @@ namespace { #include "TrackingTools/PatternTools/interface/Trajectory.h" #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" -#include "DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.h" +#include "TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.h" #include "FWCore/Framework/interface/Event.h" #include "CommonTools/Statistics/interface/ChiSquaredProbability.h" diff --git a/RecoTracker/FinalTrackSelectors/plugins/TrackCollectionFilterCloner.cc b/RecoTracker/FinalTrackSelectors/plugins/TrackCollectionFilterCloner.cc index 7b4c8cfd25a09..215d4763f883e 100644 --- a/RecoTracker/FinalTrackSelectors/plugins/TrackCollectionFilterCloner.cc +++ b/RecoTracker/FinalTrackSelectors/plugins/TrackCollectionFilterCloner.cc @@ -56,7 +56,7 @@ namespace { #include "TrackingTools/PatternTools/interface/Trajectory.h" #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" -#include "DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.h" +#include "TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.h" #include "FWCore/Framework/interface/Event.h" #include "CommonTools/Statistics/interface/ChiSquaredProbability.h" diff --git a/RecoTracker/FinalTrackSelectors/plugins/TrackListMerger.cc b/RecoTracker/FinalTrackSelectors/plugins/TrackListMerger.cc index c4a7c074f1c45..00f14892810ff 100644 --- a/RecoTracker/FinalTrackSelectors/plugins/TrackListMerger.cc +++ b/RecoTracker/FinalTrackSelectors/plugins/TrackListMerger.cc @@ -137,7 +137,7 @@ class dso_hidden TrackListMerger : public edm::stream::EDProducer<> { //#include "DataFormats/TrackReco/src/classes.h" -#include "DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.h" +#include "TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.h" #ifdef STAT_TSB #include <x86intrin.h> diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedCombiner.cc b/RecoTracker/TkSeedGenerator/plugins/SeedCombiner.cc index ac59b1af7430f..29ae13d181762 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedCombiner.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedCombiner.cc @@ -20,7 +20,7 @@ #include "RecoTracker/TkSeedGenerator/interface/SeedGeneratorFromRegionHits.h" -#include "DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.h" +#include "TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.h" #include "FWCore/Utilities/interface/transform.h" using namespace edm; diff --git a/RecoTracker/TrackProducer/src/KfTrackProducerBase.cc b/RecoTracker/TrackProducer/src/KfTrackProducerBase.cc index 282a1a177deac..2559eb191e508 100644 --- a/RecoTracker/TrackProducer/src/KfTrackProducerBase.cc +++ b/RecoTracker/TrackProducer/src/KfTrackProducerBase.cc @@ -13,7 +13,7 @@ #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.h" +#include "TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.h" #include "TrajectoryToResiduals.h" #include "RecoTracker/TransientTrackingRecHit/interface/Traj2TrackHits.h" diff --git a/DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.h b/TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.h similarity index 92% rename from DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.h rename to TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.h index a69a443563cc3..958037325c0e3 100644 --- a/DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.h +++ b/TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.h @@ -1,5 +1,5 @@ -#ifndef RecoTracker_TrackProducer_ClusterRemovalRefSetter_h -#define RecoTracker_TrackProducer_ClusterRemovalRefSetter_h +#ifndef TrackingTools_PatternTools_ClusterRemovalRefSetter_h +#define TrackingTools_PatternTools_ClusterRemovalRefSetter_h #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/Common/interface/DetSetVectorNew.h" diff --git a/DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.icc b/TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.icc similarity index 100% rename from DataFormats/TrackerRecHit2D/interface/ClusterRemovalRefSetter.icc rename to TrackingTools/PatternTools/interface/ClusterRemovalRefSetter.icc From 25fb3c5e0f679d47a64415ba5a4e247599a44e1c Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Sun, 11 Oct 2020 13:45:45 -0500 Subject: [PATCH 492/778] Removed Framework depencency from L1MuBMTrack The function triggerScale did not actually use the EventSetup nor does any code actually call the function. --- DataFormats/L1TMuon/interface/L1MuBMTrack.h | 5 ----- DataFormats/L1TMuon/src/L1MuBMTrack.cc | 14 -------------- 2 files changed, 19 deletions(-) diff --git a/DataFormats/L1TMuon/interface/L1MuBMTrack.h b/DataFormats/L1TMuon/interface/L1MuBMTrack.h index 2e7620535c3c3..e5a375e17f3ca 100644 --- a/DataFormats/L1TMuon/interface/L1MuBMTrack.h +++ b/DataFormats/L1TMuon/interface/L1MuBMTrack.h @@ -32,8 +32,6 @@ // Collaborating Class Declarations -- //------------------------------------ -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EventSetup.h" #include "DataFormats/L1TMuon/interface/BMTF/L1MuBMTrackAssParam.h" #include "DataFormats/L1TMuon/interface/BMTF/L1MuBMAddressArray.h" #include "DataFormats/L1TMuon/interface/BMTF/L1MuBMSecProcId.h" @@ -173,9 +171,6 @@ class L1MuBMTrack : public l1t::RegionalMuonCand { /// set eta track segments used to form the muon candidate void setTSeta(const std::vector<const L1MuBMTrackSegEta*>& tsList); - /// convert pt value in GeV to pt code - unsigned int triggerScale(float value, const edm::EventSetup& c) const; - /// assignment operator L1MuBMTrack& operator=(const L1MuBMTrack&); diff --git a/DataFormats/L1TMuon/src/L1MuBMTrack.cc b/DataFormats/L1TMuon/src/L1MuBMTrack.cc index a1d8626372fc7..d50d02ed6eb0a 100644 --- a/DataFormats/L1TMuon/src/L1MuBMTrack.cc +++ b/DataFormats/L1TMuon/src/L1MuBMTrack.cc @@ -167,20 +167,6 @@ void L1MuBMTrack::setTSeta(const vector<const L1MuBMTrackSegEta*>& tsList) { } } -// -// convert pt value in GeV to pt code -// -unsigned int L1MuBMTrack::triggerScale(float value, const edm::EventSetup& c) const { - /*const float eps = 1.e-5; // add an epsilon so that setting works with low edge value - - edm::ESHandle< L1MuTriggerPtScale > theTriggerScales; - c.get< L1MuTriggerPtScaleRcd >().get( theTriggerScales ); - unsigned int t_Scale = theTriggerScales->getPtScale()->getPacked( value + eps ); - - return t_Scale;*/ - return (unsigned int)0.5; -} - // // Assignment operator // From f46dea9eda4b85aeeed1b64bf3a86b01b3da78bb Mon Sep 17 00:00:00 2001 From: aravind sugunan <aravindsugunan@gmail.com> Date: Mon, 12 Oct 2020 05:32:51 +0200 Subject: [PATCH 493/778] upadte to maxChi2_.size() --- RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc b/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc index e809401cba1e4..56afb5d2dcdd4 100644 --- a/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc +++ b/RecoPixelVertexing/PixelVertexFinding/src/PVClusterComparer.cc @@ -79,7 +79,7 @@ void PVClusterComparer::setChisquareQuantile() { maxChi2_.clear(); maxChi2_.resize(20, 0.0); if (track_prob_min_ >= 0. && track_prob_min_ <= 1.) - for (size_t ndof = 0; ndof < 20; ++ndof) + for (size_t ndof = 0; ndof < maxChi2_.size(); ++ndof) // http://root.cern.ch/root/html/TMath.html#TMath:ChisquareQuantile maxChi2_[ndof] = TMath::ChisquareQuantile(1 - track_prob_min_, ndof); } From 72ba9dbfe6ed8a0e84c9e21e0051955e7a1916e1 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Mon, 12 Oct 2020 06:17:18 +0200 Subject: [PATCH 494/778] get rid of the sorting of the VH --- .../interface/VectorHitBuilderAlgorithm.h | 5 +- .../interface/VectorHitBuilderAlgorithmBase.h | 5 +- .../src/VectorHitBuilderAlgorithm.cc | 60 ++++--------------- 3 files changed, 20 insertions(+), 50 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index d70d8437b3bfc..05d9ff16e9226 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -47,7 +47,10 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { GlobalError gErrorLower, GlobalError gErrorUpper) const; - std::vector<std::pair<VectorHit, bool>> buildVectorHits( + void buildVectorHits( + VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, + DetId detIdStack, const StackGeomDet* stack, edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, const detset& DSVinner, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 88649f4aab00a..41bde36a9e863 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -36,7 +36,10 @@ class VectorHitBuilderAlgorithmBase { edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const = 0; - virtual std::vector<std::pair<VectorHit, bool>> buildVectorHits( + virtual void buildVectorHits( + VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, + DetId detIdStack, const StackGeomDet* stack, edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, const detset& DSVinner, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 205e32ec016c5..fb33fc9fb20c8 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -12,10 +12,6 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track LogDebug("VectorHitBuilderAlgorithm") << "Run VectorHitBuilderAlgorithm ... \n"; const auto* clustersPhase2Collection = clusters.product(); - std::unordered_map<DetId, std::vector<VectorHit>> tempVHAcc, tempVHRej; - int totalAccepted = 0; - int totalRejected = 0; - //loop over the DetSetVector LogDebug("VectorHitBuilderAlgorithm") << "with #clusters : " << clustersPhase2Collection->size() << std::endl; for (auto dSViter : *clustersPhase2Collection) { @@ -43,45 +39,9 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track if (it_detUpper != clustersPhase2Collection->end()) { gd = tkGeom_->idToDet(detIdStack); stackDet = dynamic_cast<const StackGeomDet*>(gd); - std::vector<VectorHit> vhsInStack_Acc; - std::vector<VectorHit> vhsInStack_Rej; - const auto& vhsInStack_AccRej = buildVectorHits(stackDet, clusters, it_detLower, *it_detUpper); - - //storing accepted and rejected VHs - for (const auto& vh : vhsInStack_AccRej) { - if (vh.second == true) { - vhsInStack_Acc.push_back(vh.first); - std::push_heap(vhsInStack_Acc.begin(), vhsInStack_Acc.end()); - totalAccepted += 1; - } else if (vh.second == false) { - vhsInStack_Rej.push_back(vh.first); - totalRejected += 1; - } - } - - //ERICA:: to be checked with map! - //sorting vhs for best chi2 - std::sort_heap(vhsInStack_Acc.begin(), vhsInStack_Acc.end()); - - tempVHAcc[detIdStack] = vhsInStack_Acc; - tempVHRej[detIdStack] = vhsInStack_Rej; -#ifdef EDM_ML_DEBUG - LogTrace("VectorHitBuilderAlgorithm") - << "For detId #" << detIdStack.rawId() << " the following VHits have been accepted:"; - for (const auto& vhIt : vhsInStack_Acc) { - LogTrace("VectorHitBuilderAlgorithm") << "accepted VH: " << vhIt; - } - LogTrace("VectorHitBuilderAlgorithm") - << "For detId #" << detIdStack.rawId() << " the following VHits have been rejected:"; - for (const auto& vhIt : vhsInStack_Rej) { - LogTrace("VectorHitBuilderAlgorithm") << "rejected VH: " << vhIt; - } -#endif + buildVectorHits(vhAcc, vhRej, detIdStack, stackDet, clusters, it_detLower, *it_detUpper); } } - loadDetSetVector(tempVHAcc, vhAcc, totalAccepted); - loadDetSetVector(tempVHRej, vhRej, totalRejected); - LogDebug("VectorHitBuilderAlgorithm") << "End run VectorHitBuilderAlgorithm ... \n"; } @@ -115,19 +75,26 @@ bool VectorHitBuilderAlgorithm::checkClustersCompatibility(Local3DPoint& poslowe //---------------------------------------------------------------------------- //ERICA::in the DT code the global position is used to compute the alpha angle and put a cut on that. -std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHits( +void VectorHitBuilderAlgorithm::buildVectorHits( + VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, + DetId detIdStack, const StackGeomDet* stack, edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, const detset& theLowerDetSet, const detset& theUpperDetSet, const std::vector<bool>& phase2OTClustersToSkip) const { - std::vector<std::pair<VectorHit, bool>> result; if (checkClustersCompatibilityBeforeBuilding(clusters, theLowerDetSet, theUpperDetSet)) { LogDebug("VectorHitBuilderAlgorithm") << " compatible -> continue ... " << std::endl; } else { LogTrace("VectorHitBuilderAlgorithm") << " not compatible, going to the next cluster"; } + + edmNew::DetSetVector<VectorHit>::FastFiller vh_colAcc(vhAcc, detIdStack); + edmNew::DetSetVector<VectorHit>::FastFiller vh_colRej(vhRej, detIdStack); + + unsigned int layerStack = tkTopo_->layer(stack->geographicalId()); if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) LogDebug("VectorHitBuilderAlgorithm") << " \t is barrel. " << std::endl; @@ -146,7 +113,6 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi std::vector<std::pair<LocalPoint, LocalError>> localParamsUpper; std::vector<const PixelGeomDetUnit*> localGDUUpper; - std::vector<Phase2TrackerCluster1DRef> upperClusters; const PixelGeomDetUnit* gduUpp = dynamic_cast<const PixelGeomDetUnit*>(stack->upperDet()); for (auto const& clusterUpper : theUpperDetSet) { localGDUUpper.push_back(gduUpp); @@ -219,7 +185,7 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi VectorHit vh = buildVectorHit(stack, cluL, cluU); //protection: the VH can also be empty!! if (vh.isValid()) { - result.emplace_back(std::make_pair(vh, true)); + vh_colAcc.push_back(vh); } } else { @@ -227,14 +193,12 @@ std::vector<std::pair<VectorHit, bool>> VectorHitBuilderAlgorithm::buildVectorHi //storing vh rejected for combinatiorial studies VectorHit vh = buildVectorHit(stack, cluL, cluU); if (vh.isValid()) { - result.emplace_back(std::make_pair(vh, false)); + vh_colRej.push_back(vh); } } upperIterator += 1; } } - - return result; } VectorHit VectorHitBuilderAlgorithm::buildVectorHit(const StackGeomDet* stack, From 6dcc8c4c0decd466ad4e8cf31de13cb6f6712109 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Mon, 12 Oct 2020 06:27:30 +0200 Subject: [PATCH 495/778] code format --- .../interface/VectorHitBuilderAlgorithm.h | 17 ++++++++--------- .../interface/VectorHitBuilderAlgorithmBase.h | 17 ++++++++--------- .../src/VectorHitBuilderAlgorithm.cc | 19 ++++++++----------- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 05d9ff16e9226..1cd6515c88378 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -47,15 +47,14 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { GlobalError gErrorLower, GlobalError gErrorUpper) const; - void buildVectorHits( - VectorHitCollection& vhAcc, - VectorHitCollection& vhRej, - DetId detIdStack, - const StackGeomDet* stack, - edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - const detset& DSVinner, - const detset& DSVouter, - const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) const override; + void buildVectorHits(VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, + DetId detIdStack, + const StackGeomDet* stack, + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + const detset& DSVinner, + const detset& DSVouter, + const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) const override; VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 41bde36a9e863..4ddb2dcb7ec6b 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -36,15 +36,14 @@ class VectorHitBuilderAlgorithmBase { edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersAcc, edmNew::DetSetVector<Phase2TrackerCluster1D>& clustersRej) const = 0; - virtual void buildVectorHits( - VectorHitCollection& vhAcc, - VectorHitCollection& vhRej, - DetId detIdStack, - const StackGeomDet* stack, - edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - const detset& DSVinner, - const detset& DSVouter, - const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) const = 0; + virtual void buildVectorHits(VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, + DetId detIdStack, + const StackGeomDet* stack, + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + const detset& DSVinner, + const detset& DSVouter, + const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) const = 0; virtual VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index fb33fc9fb20c8..1144086b29f58 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -75,26 +75,23 @@ bool VectorHitBuilderAlgorithm::checkClustersCompatibility(Local3DPoint& poslowe //---------------------------------------------------------------------------- //ERICA::in the DT code the global position is used to compute the alpha angle and put a cut on that. -void VectorHitBuilderAlgorithm::buildVectorHits( - VectorHitCollection& vhAcc, - VectorHitCollection& vhRej, - DetId detIdStack, - const StackGeomDet* stack, - edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - const detset& theLowerDetSet, - const detset& theUpperDetSet, - const std::vector<bool>& phase2OTClustersToSkip) const { +void VectorHitBuilderAlgorithm::buildVectorHits(VectorHitCollection& vhAcc, + VectorHitCollection& vhRej, + DetId detIdStack, + const StackGeomDet* stack, + edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, + const detset& theLowerDetSet, + const detset& theUpperDetSet, + const std::vector<bool>& phase2OTClustersToSkip) const { if (checkClustersCompatibilityBeforeBuilding(clusters, theLowerDetSet, theUpperDetSet)) { LogDebug("VectorHitBuilderAlgorithm") << " compatible -> continue ... " << std::endl; } else { LogTrace("VectorHitBuilderAlgorithm") << " not compatible, going to the next cluster"; } - edmNew::DetSetVector<VectorHit>::FastFiller vh_colAcc(vhAcc, detIdStack); edmNew::DetSetVector<VectorHit>::FastFiller vh_colRej(vhRej, detIdStack); - unsigned int layerStack = tkTopo_->layer(stack->geographicalId()); if (stack->subDetector() == GeomDetEnumerators::SubDetector::P2OTB) LogDebug("VectorHitBuilderAlgorithm") << " \t is barrel. " << std::endl; From 472700ca1bb7c36ad824c56780cabb145c62aecf Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama <kenichi.hatakeyama@cern.ch> Date: Sun, 11 Oct 2020 23:35:08 -0500 Subject: [PATCH 496/778] update --- Validation/RecoParticleFlow/test/crab/multicrab_phase2.py | 2 +- Validation/RecoParticleFlow/test/run_relval.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Validation/RecoParticleFlow/test/crab/multicrab_phase2.py b/Validation/RecoParticleFlow/test/crab/multicrab_phase2.py index 0bc754b27078d..68b04dfb08789 100644 --- a/Validation/RecoParticleFlow/test/crab/multicrab_phase2.py +++ b/Validation/RecoParticleFlow/test/crab/multicrab_phase2.py @@ -39,7 +39,7 @@ def submit(config): conf.Data.inputDataset = dataset conf.Data.splitting = 'LumiBased' - conf.Data.unitsPerJob = 10 + conf.Data.unitsPerJob = 1 #conf.Data.totalUnits = 50 conf.Data.publication = False conf.Data.outputDatasetTag = 'pfvalidation' diff --git a/Validation/RecoParticleFlow/test/run_relval.sh b/Validation/RecoParticleFlow/test/run_relval.sh index 274a40a213e22..0b11ebab93be5 100755 --- a/Validation/RecoParticleFlow/test/run_relval.sh +++ b/Validation/RecoParticleFlow/test/run_relval.sh @@ -108,7 +108,7 @@ if [ $STEP == "RECO" ]; then FILENAME=`sed -n "${NJOB}p" $INPUT_FILELIST` echo "FILENAME="$FILENAME - cmsDriver.py step3 --conditions $CONDITIONS -s RAW2DIGI,L1Reco,RECO,RECOSIM,PAT --datatier MINIAODSIM --nThreads $NTHREADS -n -1 --era $ERA --eventcontent MINIAODSIM --geometry=$GEOM --filein step2.root --fileout file:step3_inMINIAODSIM.root --no_exec --python_filename=step3.py + cmsDriver.py step3 --conditions $CONDITIONS -s RAW2DIGI,L1Reco,RECO,RECOSIM,EI,PAT --datatier MINIAODSIM --nThreads $NTHREADS -n -1 --era $ERA --eventcontent MINIAODSIM --geometry=$GEOM --filein step2.root --fileout file:step3_inMINIAODSIM.root --no_exec --python_filename=step3.py else @@ -127,7 +127,7 @@ if [ $STEP == "RECO" ]; then echo "FILENAME="$FILENAME #Run the actual CMS reco with particle flow. echo "Running step RECO" - cmsDriver.py step3 --conditions $CONDITIONS -s RAW2DIGI,L1Reco,RECO,RECOSIM,PAT --datatier MINIAODSIM --nThreads $NTHREADS -n -1 --era $ERA --eventcontent MINIAODSIM --geometry=$GEOM --filein $FILENAME --fileout file:step3_inMINIAODSIM.root | tee step3.log 2>&1 + cmsDriver.py step3 --conditions $CONDITIONS -s RAW2DIGI,L1Reco,RECO,RECOSIM,EI,PAT --datatier MINIAODSIM --nThreads $NTHREADS -n -1 --era $ERA --eventcontent MINIAODSIM --geometry=$GEOM --filein $FILENAME --fileout file:step3_inMINIAODSIM.root | tee step3.log 2>&1 #NanoAOD #On lxplus, this step takes about 1 minute / 1000 events From d5c340d36eb4b416c2008e61733c61d14f93b3fa Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama <kenichi.hatakeyama@cern.ch> Date: Mon, 12 Oct 2020 00:22:38 -0500 Subject: [PATCH 497/778] Cleanup. --- Validation/RecoParticleFlow/Makefile | 57 ++++++++++--------- Validation/RecoParticleFlow/README.md | 4 +- Validation/RecoParticleFlow/test/datasets.py | 2 +- .../RecoParticleFlow/test/run_relval.sh | 10 ++-- 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Validation/RecoParticleFlow/Makefile b/Validation/RecoParticleFlow/Makefile index f561e237f1c65..be9f3e878a40e 100644 --- a/Validation/RecoParticleFlow/Makefile +++ b/Validation/RecoParticleFlow/Makefile @@ -23,11 +23,14 @@ QCD_dumpconf: QCDPU_reco: cd ${TMPDIR} && ${RELVALCMD} QCDPU reco 0 -ZMM_reco: - cd ${TMPDIR} && ${RELVALCMD} ZMM reco 0 +ZMMPU_reco: + cd ${TMPDIR} && ${RELVALCMD} ZMMPU reco 0 -MinBias_reco: - cd ${TMPDIR} && ${RELVALCMD} MinBias reco 0 +ZEEPU_reco: + cd ${TMPDIR} && ${RELVALCMD} ZEEPU reco 0 + +TenTauPU_reco: + cd ${TMPDIR} && ${RELVALCMD} TenTauPU reco 0 NuGunPU_reco: cd ${TMPDIR} && ${RELVALCMD} NuGunPU reco 0 @@ -43,13 +46,17 @@ QCDPU_dqm: rm -f ${TMPDIR}/QCDPU/DQM*.root cd ${TMPDIR} && ${RELVALCMD} QCDPU dqm 0 -ZMM_dqm: - rm -f ${TMPDIR}/ZMM/DQM*.root - cd ${TMPDIR} && ${RELVALCMD} ZMM dqm 0 +ZMMPU_dqm: + rm -f ${TMPDIR}/ZMMPU/DQM*.root + cd ${TMPDIR} && ${RELVALCMD} ZMMPU dqm 0 + +ZEEPU_dqm: + rm -f ${TMPDIR}/ZEEPU/DQM*.root + cd ${TMPDIR} && ${RELVALCMD} ZEEPU dqm 0 -MinBias_dqm: - rm -f ${TMPDIR}/MinBias/DQM*.root - cd ${TMPDIR} && ${RELVALCMD} MinBias dqm 0 +TenTauPU_dqm: + rm -f ${TMPDIR}/TenTauPU/DQM*.root + cd ${TMPDIR} && ${RELVALCMD} TenTauPU dqm 0 NuGunPU_dqm: rm -f ${TMPDIR}/NuGunPU/DQM*.root @@ -58,41 +65,35 @@ NuGunPU_dqm: .PHONY: plots # Enable re-running plots plots: - rm -Rf plots + rm -Rf plots python test/compare.py \ --sample FlatQCD_noPU:${TMPDIR}/QCD/${DQM_MC}.root:${TMPDIR}/QCD/${DQM_MC}.root \ --sample FlatQCD_PU25ns:${TMPDIR}/QCDPU/${DQM_MC}.root:${TMPDIR}/QCDPU/${DQM_MC}.root \ --sample NuGunPU:${TMPDIR}/NuGunPU/${DQM_MC}.root:${TMPDIR}/NuGunPU/${DQM_MC}.root \ - --doResponsePlots --doOffsetPlots - + --doResponsePlots --doOffsetPlots --doMETPlots --doPFCandPlots + QCD_plots: - rm -Rf plots + rm -Rf plots python test/compare.py \ --sample FlatQCD_noPU:${TMPDIR}/QCD/${DQM_MC}.root:${TMPDIR}/QCD/${DQM_MC}.root \ - --doResponsePlots --doOffsetPlots + --doResponsePlots --doOffsetPlots --doMETPlots --doPFCandPlots QCDPU_plots: - rm -Rf plots + rm -Rf plots python test/compare.py \ --sample FlatQCD_PU25ns:${TMPDIR}/QCDPU/${DQM_MC}.root:${TMPDIR}/QCDPU/${DQM_MC}.root \ - --doResponsePlots --doOffsetPlots - + --doResponsePlots --doOffsetPlots --doMETPlots --doPFCandPlots + NuGunPU_plots: - rm -Rf plots + rm -Rf plots python test/compare.py \ --sample NuGunPU:${TMPDIR}/NuGunPU/${DQM_MC}.root:${TMPDIR}/NuGunPU/${DQM_MC}.root \ - --doResponsePlots --doOffsetPlots - + --doResponsePlots --doOffsetPlots --doMETPlots --doPFCandPlots plots_with_ref: - rm -Rf plots + rm -Rf plots python test/compare.py \ --sample FlatQCD_noPU:${TMPDIR}/QCD/${DQM_MC}.root:${TMPDIR}/QCD_ref/${DQM_MC}.root \ --sample FlatQCD_PU25ns:${TMPDIR}/QCDPU/${DQM_MC}.root:${TMPDIR}/QCDPU_ref/${DQM_MC}.root \ --sample NuGunPU:${TMPDIR}/NuGunPU/${DQM_MC}.root:${TMPDIR}/NuGunPU_ref/${DQM_MC}.root \ - --doResponsePlots --doOffsetPlots - -# --sample MinBias:${TMPDIR}/MinBias/${DQM_MC}.root:${TMPDIR}/MinBias/${DQM_MC}.root \ -# --sample ZMM:${TMPDIR}/ZMM/${DQM_MC}.root:${TMPDIR}/ZMM/${DQM_MC}.root \ -# --doResponsePlots --doOffsetPlots - + --doResponsePlots --doOffsetPlots --doMETPlots --doPFCandPlots diff --git a/Validation/RecoParticleFlow/README.md b/Validation/RecoParticleFlow/README.md index 4a2e4a1af00d1..02a7664474e8d 100644 --- a/Validation/RecoParticleFlow/README.md +++ b/Validation/RecoParticleFlow/README.md @@ -9,8 +9,8 @@ for lxplus with SLC7 (default since April 2019) ~~~ export SCRAM_ARCH=slc7_amd64_gcc820 -cmsrel CMSSW_11_0_0 -cd CMSSW_11_0_0 +cmsrel CMSSW_11_2_0_pre6 +cd CMSSW_11_2_0_pre6 cmsenv ~~~ diff --git a/Validation/RecoParticleFlow/test/datasets.py b/Validation/RecoParticleFlow/test/datasets.py index d2530dbbe4e76..afe55fec28d8c 100644 --- a/Validation/RecoParticleFlow/test/datasets.py +++ b/Validation/RecoParticleFlow/test/datasets.py @@ -133,7 +133,7 @@ def cache_das_filenames(self): Dataset("/RelValQCD_FlatPt_15_3000HS_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "QCD_PU", prefix, None, False, tmpdir), Dataset("/RelValZEE_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "ZEE_PU", prefix, None, False, tmpdir), Dataset("/RelValZMM_14/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "ZMM_PU", prefix, None, False, tmpdir), - Dataset("/RelValTenTau_15_500/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "TENTAU_PU", prefix, None, False, tmpdir), + Dataset("/RelValTenTau_15_500/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "TenTau_PU", prefix, None, False, tmpdir), Dataset("/RelValNuGun/CMSSW_11_2_0_pre6-PU_112X_mcRun3_2021_realistic_v7-v1/GEN-SIM-DIGI-RAW", "NuGun_PU", prefix, None, False, tmpdir)] for ds in datasets: ds.cache_das_filenames() diff --git a/Validation/RecoParticleFlow/test/run_relval.sh b/Validation/RecoParticleFlow/test/run_relval.sh index 0b11ebab93be5..38ec64e8a76b8 100755 --- a/Validation/RecoParticleFlow/test/run_relval.sh +++ b/Validation/RecoParticleFlow/test/run_relval.sh @@ -33,7 +33,7 @@ NTHREADS=2 #Argument parsing if [ "$#" -ne 3 ]; then - echo "Must pass exactly 3 arguments: run_relval.sh [QCD|QCDPU|ZEEPU|ZMMPU|TENTAUPU|NuGunPU] [reco|dqm] [njob]" + echo "Must pass exactly 3 arguments: run_relval.sh [QCD|QCDPU|ZEEPU|ZMMPU|TenTauPU|NuGunPU] [reco|dqm] [njob]" exit 0 fi @@ -68,9 +68,9 @@ elif [ "$1" == "ZEEPU" ]; then elif [ "$1" == "ZMMPU" ]; then INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/ZMM_PU.txt NAME=ZMM -elif [ "$1" == "TENTAUPU" ]; then - INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/TENTAU_PU.txt - NAME=TENTAU +elif [ "$1" == "TenTauPU" ]; then + INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/TenTau_PU.txt + NAME=TenTau elif [ "$1" == "NuGunPU" ]; then INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/NuGun_PU.txt NAME=NuGunPU @@ -78,7 +78,7 @@ elif [ "$1" == "conf" ]; then # special switch for creating conf file, INPUT_FILELIST=${CMSSW_BASE}/src/Validation/RecoParticleFlow/test/tmp/das_cache/NuGun_PU.txt # dummy NAME=conf else - echo "Argument 1 must be [QCD|QCDPU|ZEEPU|ZMMPU|TENTAUPU|NuGunPU|conf] but was $1" + echo "Argument 1 must be [QCD|QCDPU|ZEEPU|ZMMPU|TenTauPU|NuGunPU|conf] but was $1" exit 1 fi From 2600842cc5f9a84c49162b7d7cff6de5486fb7bd Mon Sep 17 00:00:00 2001 From: Kenichi Hatakeyama <kenichi.hatakeyama@cern.ch> Date: Mon, 12 Oct 2020 00:35:51 -0500 Subject: [PATCH 498/778] format --- Validation/RecoParticleFlow/plugins/PFClusterValidation.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Validation/RecoParticleFlow/plugins/PFClusterValidation.cc b/Validation/RecoParticleFlow/plugins/PFClusterValidation.cc index b41f06d350c44..8a9262a216f61 100644 --- a/Validation/RecoParticleFlow/plugins/PFClusterValidation.cc +++ b/Validation/RecoParticleFlow/plugins/PFClusterValidation.cc @@ -14,8 +14,7 @@ PFClusterValidation::PFClusterValidation(const edm::ParameterSet& conf) { pfClusterHCALTok_ = consumes<reco::PFClusterCollection>(conf.getUntrackedParameter<edm::InputTag>("pflowClusterHCAL")); pfClusterHOTok_ = consumes<reco::PFClusterCollection>(conf.getUntrackedParameter<edm::InputTag>("pflowClusterHO")); - pfClusterHFTok_ = consumes<reco::PFClusterCollection>( - conf.getUntrackedParameter<edm::InputTag>("pflowClusterHF")); + pfClusterHFTok_ = consumes<reco::PFClusterCollection>(conf.getUntrackedParameter<edm::InputTag>("pflowClusterHF")); } PFClusterValidation::~PFClusterValidation() {} From 4facfa99b8831904cd914b4f2b60392f988e56f2 Mon Sep 17 00:00:00 2001 From: Jeongeun Lee <jeongeun.lee@cern.ch> Date: Mon, 12 Oct 2020 07:51:29 +0200 Subject: [PATCH 499/778] drop type specs --- RecoTauTag/Configuration/python/HPSPFTaus_cff.py | 2 +- RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py | 2 +- RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 3f85e27e24715..4b606d71a5bde 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -419,7 +419,7 @@ mvaName = "RecoTauTag_tauIdMVAIsoDBoldDMdR0p3wLT", mvaOpt = "DBoldDMwLTwGJ", srcBasicTauDiscriminators = "hpsPFTauBasicDiscriminatorsdR03", - inputIDNameSuffix = cms.string("dR03"), + inputIDNameSuffix = "dR03", verbosity = 0 ) hpsPFTauDiscriminationByIsolationMVArun2v1DBdR03oldDMwLT = hpsPFTauDiscriminationByIsolationMVArun2v1DBoldDMwLT.clone( diff --git a/RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py b/RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py index 0295e0530752d..fc0a72531a0ea 100644 --- a/RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/boostedHPSPFTaus_cff.py @@ -21,7 +21,7 @@ import RecoJets.JetProducers.CMSBoostedTauSeedingParameters_cfi as boostedTaus3 ca8PFJetsCHSprunedForBoostedTaus = boostedTaus2.ak4PFJets.clone( boostedTaus3.CMSBoostedTauSeedingParameters, - #src = cms.InputTag('pfNoPileUpForBoostedTaus'), + #src = 'pfNoPileUpForBoostedTaus', jetPtMin = 100.0, doAreaFastjet = True, nFilt = cms.int32(100), diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py index a600e9baff6e3..00687f929cfda 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py @@ -54,7 +54,7 @@ # Produce a "strips" of photons # with no track quality cuts applied to PFElectrons modStrips = strips.clone( - plugin = cms.string('RecoTauPiZeroStripPlugin2'), + plugin = 'RecoTauPiZeroStripPlugin2', applyElecTrackQcuts = cms.bool(False), minGammaEtStripSeed = cms.double(1.0), minGammaEtStripAdd = cms.double(1.0), @@ -81,7 +81,7 @@ par0 = cms.double(3.52476e-01), par1 = cms.double(7.07716e-01) ), - makeCombinatoricStrips = cms.bool(False), + makeCombinatoricStrips = False, minGammaEtStripSeed = cms.double(1.0), minGammaEtStripAdd = cms.double(1.0), minStripEt = cms.double(1.0), From 142c9d837fa2737ab5efbe097dc6757b1f9008a7 Mon Sep 17 00:00:00 2001 From: Giacomo Govi <giacomo.govi@cern.ch> Date: Mon, 12 Oct 2020 09:17:18 +0200 Subject: [PATCH 500/778] Removed duplicated include --- CondCore/DBOutputService/src/PoolDBOutputService.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/CondCore/DBOutputService/src/PoolDBOutputService.cc b/CondCore/DBOutputService/src/PoolDBOutputService.cc index 420e5b6182bd2..f9e4d4c75a707 100644 --- a/CondCore/DBOutputService/src/PoolDBOutputService.cc +++ b/CondCore/DBOutputService/src/PoolDBOutputService.cc @@ -7,7 +7,6 @@ #include "FWCore/ServiceRegistry/interface/GlobalContext.h" #include "FWCore/ServiceRegistry/interface/SystemBounds.h" #include "CondCore/CondDB/interface/Exception.h" -#include "CondCore/CondDB/interface/Exception.h" // #include <vector> #include <memory> From 26422512212f62dc037e1dcce98c9689ec4cb3f8 Mon Sep 17 00:00:00 2001 From: David <David.Lange@cern.ch> Date: Mon, 12 Oct 2020 09:54:38 +0200 Subject: [PATCH 501/778] bugfix: missed reseting the track_volume to null_ptr when leaving volume --- .../plugins/TrackingMaterialProducer.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/TrackingMaterialProducer.cc b/SimTracker/TrackerMaterialAnalysis/plugins/TrackingMaterialProducer.cc index f53fdf3d1d19e..bed7c72d863e5 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/TrackingMaterialProducer.cc +++ b/SimTracker/TrackerMaterialAnalysis/plugins/TrackingMaterialProducer.cc @@ -285,7 +285,7 @@ void TrackingMaterialProducer::update(const G4Step* step) { // update track accounting if (enter_sensitive) { if (m_track_volume != nullptr) { - edm::LogWarning("TrackingMaterialProducer") << "Entering volume " << sensitive << "while inside volume " + edm::LogWarning("TrackingMaterialProducer") << "Entering volume " << sensitive << " while inside volume " << m_track_volume << ". Something is inconsistent"; m_track.reset(); } @@ -295,11 +295,12 @@ void TrackingMaterialProducer::update(const G4Step* step) { m_track.step(MaterialAccountingStep(length, radiationLengths, energyLoss, globalPositionIn, globalPositionOut)); if (leave_sensitive) { if (m_track_volume != sensitive) { - edm::LogWarning("TrackingMaterialProducer") << "Leaving volume " << sensitive << "while inside volume " + edm::LogWarning("TrackingMaterialProducer") << "Leaving volume " << sensitive << " while inside volume " << m_track_volume << ". Something is inconsistent"; m_track.reset(); } else m_track.leaveDetector(cosThetaPost); + m_track_volume = nullptr; } if (sensitive) LogInfo("TrackingMaterialProducer") << "Track was near sensitive volume " << sensitive->GetName() << std::endl; From 8287c9dcf89a36234ef4ff9b11bc2a7b68b83c5b Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Mon, 12 Oct 2020 10:51:44 +0200 Subject: [PATCH 502/778] no need for atomic --- .../DDCMS/interface/DDParsingContext.h | 8 ++++++-- .../plugins/dd4hep/DDDefinitions2Objects.cc | 18 +++++++++--------- .../DDCMS/src/DDAlgoArguments.cc | 4 ++-- DetectorDescription/DDCMS/src/DDNamespace.cc | 8 ++++---- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDParsingContext.h b/DetectorDescription/DDCMS/interface/DDParsingContext.h index 1b4673919e4aa..86a9fff85513d 100644 --- a/DetectorDescription/DDCMS/interface/DDParsingContext.h +++ b/DetectorDescription/DDCMS/interface/DDParsingContext.h @@ -12,7 +12,7 @@ namespace cms { class DDParsingContext { public: - DDParsingContext(dd4hep::Detector* det) : description(det) { + DDParsingContext(dd4hep::Detector& det) : description(det) { assemblies.reserve(100); rotations.reserve(3000); shapes.reserve(4000); @@ -24,6 +24,10 @@ namespace cms { namespaces.emplace_back(""); } + DDParsingContext() = delete; + DDParsingContext(const DDParsingContext&) = delete; + DDParsingContext& operator=(const DDParsingContext&) = delete; + ~DDParsingContext() = default; const std::string& ns() const { return namespaces.back(); } @@ -61,7 +65,7 @@ namespace cms { bool debug_algorithms = false; bool debug_specpars = false; - std::atomic<dd4hep::Detector*> description; + dd4hep::Detector& description; std::unordered_map<std::string, dd4hep::Assembly> assemblies; std::unordered_map<std::string, dd4hep::Rotation3D> rotations; std::unordered_map<std::string, dd4hep::Solid> shapes; diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 19ac9d585e378..8599cb0f3e6a8 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -858,7 +858,7 @@ template <> void Converter<PartSelector>::operator()(xml_h element) const { cms::DDNamespace ns(_param<cms::DDParsingContext>()); cms::DDParsingContext* const context = ns.context(); - dd4hep::SpecParRegistry& registry = *context->description.load()->extension<dd4hep::SpecParRegistry>(); + dd4hep::SpecParRegistry& registry = *context->description.extension<dd4hep::SpecParRegistry>(); xml_dim_t e(element); xml_dim_t specPar = e.parent(); string specParName = specPar.attr<string>(_U(name)); @@ -881,7 +881,7 @@ template <> void Converter<Parameter>::operator()(xml_h element) const { cms::DDNamespace ns(_param<cms::DDParsingContext>()); cms::DDParsingContext* const context = ns.context(); - dd4hep::SpecParRegistry& registry = *context->description.load()->extension<dd4hep::SpecParRegistry>(); + dd4hep::SpecParRegistry& registry = *context->description.extension<dd4hep::SpecParRegistry>(); xml_dim_t e(element); xml_dim_t specPar = e.parent(); xml_dim_t specParSect = specPar.parent(); @@ -923,8 +923,8 @@ void Converter<Parameter>::operator()(xml_h element) const { for (idx = v.find('[', 0); idx != string::npos; idx = v.find('[', idx + 1)) { idq = v.find(']', idx + 1); rep = v.substr(idx + 1, idq - idx - 1); - auto r = ns.context()->description.load()->constants().find(rep); - if (r != ns.context()->description.load()->constants().end()) { + auto r = ns.context()->description.constants().find(rep); + if (r != ns.context()->description.constants().end()) { rep = "(" + r->second->type + ")"; v.replace(idx, idq - idx + 1, rep); } @@ -967,12 +967,12 @@ static void convert_boolean(cms::DDParsingContext* context, xml_h element) { if (solids[0].isValid() && solids[1].isValid()) { Transform3D trafo; - Converter<DDLTransform3D>(*context->description, context, &trafo)(element); + Converter<DDLTransform3D>(context->description, context, &trafo)(element); boolean = TYPE(solids[0], solids[1], trafo); } else { // Register it for later processing Transform3D trafo; - Converter<DDLTransform3D>(*context->description, context, &trafo)(element); + Converter<DDLTransform3D>(context->description, context, &trafo)(element); ns.context()->unresolvedShapes.emplace(nam, DDParsingContext::BooleanShape<TYPE>(solidName[0], solidName[1], trafo)); } @@ -1639,7 +1639,7 @@ template <> void Converter<DDLVector>::operator()(xml_h element) const { cms::DDNamespace ns(_param<cms::DDParsingContext>()); cms::DDParsingContext* const context = ns.context(); - DDVectorsMap* registry = context->description.load()->extension<DDVectorsMap>(); + DDVectorsMap* registry = context->description.extension<DDVectorsMap>(); xml_dim_t e(element); string name = ns.prepend(e.nameStr()); string type = ns.attr<string>(e, _U(type)); @@ -1770,7 +1770,7 @@ void Converter<print_xml_doc>::operator()(xml_h element) const { static long load_dddefinition(Detector& det, xml_h element) { xml_elt_t dddef(element); if (dddef) { - cms::DDParsingContext context(&det); + cms::DDParsingContext context(det); cms::DDNamespace ns(context); ns.addConstantNS("world_x", "101*m", "number"); ns.addConstantNS("world_y", "101*m", "number"); @@ -1811,7 +1811,7 @@ static long load_dddefinition(Detector& det, xml_h element) { // Before we continue, we have to resolve all constants NOW! Converter<DDRegistry>(det, &context, &res)(dddef); { - DDVectorsMap* registry = context.description.load()->extension<DDVectorsMap>(); + DDVectorsMap* registry = context.description.extension<DDVectorsMap>(); printout(context.debug_constants ? ALWAYS : DEBUG, "DD4CMS", diff --git a/DetectorDescription/DDCMS/src/DDAlgoArguments.cc b/DetectorDescription/DDCMS/src/DDAlgoArguments.cc index 01b2f9bd80999..5b9e108990b30 100644 --- a/DetectorDescription/DDCMS/src/DDAlgoArguments.cc +++ b/DetectorDescription/DDCMS/src/DDAlgoArguments.cc @@ -170,8 +170,8 @@ string DDAlgoArguments::resolveValue(const std::string& aValue) const { for (idx = v.find('[', 0); idx != string::npos; idx = v.find('[', idx + 1)) { idq = v.find(']', idx + 1); rep = v.substr(idx + 1, idq - idx - 1); - auto r = ns.context()->description.load()->constants().find(rep); - if (r != ns.context()->description.load()->constants().end()) { + auto r = ns.context()->description.constants().find(rep); + if (r != ns.context()->description.constants().end()) { rep = "(" + r->second->type + ")"; v.replace(idx, idq - idx + 1, rep); } diff --git a/DetectorDescription/DDCMS/src/DDNamespace.cc b/DetectorDescription/DDCMS/src/DDNamespace.cc index 9c547cffc438e..4e5b453e7adfb 100644 --- a/DetectorDescription/DDCMS/src/DDNamespace.cc +++ b/DetectorDescription/DDCMS/src/DDNamespace.cc @@ -109,11 +109,11 @@ void DDNamespace::addConstantNS(const string& name, const string& val, const str type.c_str()); dd4hep::_toDictionary(n, v, type); dd4hep::Constant c(n, v, type); - m_context->description.load()->addConstant(c); + m_context->description.addConstant(c); } dd4hep::Material DDNamespace::material(const string& name) const { - return m_context->description.load()->material(realName(name)); + return m_context->description.material(realName(name)); } void DDNamespace::addRotation(const string& name, const dd4hep::Rotation3D& rot) const { @@ -258,7 +258,7 @@ dd4hep::Solid DDNamespace::solid(const string& nam) const { } std::vector<double> DDNamespace::vecDbl(const std::string& name) const { - cms::DDVectorsMap* registry = m_context->description.load()->extension<cms::DDVectorsMap>(); + cms::DDVectorsMap* registry = m_context->description.extension<cms::DDVectorsMap>(); auto it = registry->find(name); if (it != registry->end()) { return {begin(it->second), end(it->second)}; @@ -267,7 +267,7 @@ std::vector<double> DDNamespace::vecDbl(const std::string& name) const { } std::vector<float> DDNamespace::vecFloat(const std::string& name) const { - cms::DDVectorsMap* registry = m_context->description.load()->extension<cms::DDVectorsMap>(); + cms::DDVectorsMap* registry = m_context->description.extension<cms::DDVectorsMap>(); auto it = registry->find(name); if (it != registry->end()) { std::vector<float> result; From 9d4a9542fe983b6ed0fad0a2024c0ab27e377dbc Mon Sep 17 00:00:00 2001 From: Sebastien Wertz <sebastien.wertz@cern.ch> Date: Mon, 12 Oct 2020 11:04:05 +0200 Subject: [PATCH 503/778] clarify electron sequences, fix crash --- PhysicsTools/NanoAOD/python/electrons_cff.py | 33 ++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/electrons_cff.py b/PhysicsTools/NanoAOD/python/electrons_cff.py index 2c46fed98fb5c..1db916625e345 100644 --- a/PhysicsTools/NanoAOD/python/electrons_cff.py +++ b/PhysicsTools/NanoAOD/python/electrons_cff.py @@ -494,24 +494,25 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints): _updateTo106X_sequence =cms.Sequence(heepIDVarValueMaps + slimmedElectronsTo106X) heepIDVarValueMaps.dataFormat = 2 -_withUpdate_sequence = cms.Sequence(_updateTo106X_sequence + slimmedElectronsUpdated + electronSequence.copy()) +_withTo106XAndUpdate_sequence = cms.Sequence(_updateTo106X_sequence + slimmedElectronsUpdated + electronSequence.copy()) -_withUpdateAnd80XLegacyScale_sequence = _withUpdate_sequence.copy() -_withUpdateAnd80XLegacyScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons80XLegacy + bitmapVIDForEleSpring15 +bitmapVIDForEleSum16 + slimmedElectronsWithUserData) -run2_miniAOD_80XLegacy.toReplaceWith(electronSequence, _withUpdateAnd80XLegacyScale_sequence) +_withTo106XAndUpdateAnd80XLegacyScale_sequence = _withTo106XAndUpdate_sequence.copy() +_withTo106XAndUpdateAnd80XLegacyScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons80XLegacy + bitmapVIDForEleSpring15 +bitmapVIDForEleSum16 + slimmedElectronsWithUserData) +run2_miniAOD_80XLegacy.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd80XLegacyScale_sequence) -_withUpdateAnd94XScale_sequence = _withUpdate_sequence.copy() -_withUpdateAnd94XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons94X + slimmedElectronsWithUserData) -run2_nanoAOD_94XMiniAODv1.toReplaceWith(electronSequence, _withUpdateAnd94XScale_sequence) -run2_nanoAOD_94XMiniAODv2.toReplaceWith(electronSequence, _withUpdateAnd94XScale_sequence) +_withTo106XAndUpdateAnd94XScale_sequence = _withTo106XAndUpdate_sequence.copy() +_withTo106XAndUpdateAnd94XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons94X + slimmedElectronsWithUserData) +run2_nanoAOD_94XMiniAODv1.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd94XScale_sequence) +run2_nanoAOD_94XMiniAODv2.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd94XScale_sequence) -_withUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence = _withUpdate_sequence.copy() -_withUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence.replace(slimmedElectronsWithUserData, bitmapVIDForEleSpring15 + bitmapVIDForEleSum16 + slimmedElectronsWithUserData) -run2_nanoAOD_94X2016.toReplaceWith(electronSequence, _withUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence) +_withTo106XAndUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence = _withTo106XAndUpdate_sequence.copy() +_withTo106XAndUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence.replace(slimmedElectronsWithUserData, bitmapVIDForEleSpring15 + bitmapVIDForEleSum16 + slimmedElectronsWithUserData) +run2_nanoAOD_94X2016.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence) -_withUpdateAnd102XScale_sequence = _withUpdate_sequence.copy() -_withUpdateAnd102XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons102X + slimmedElectronsWithUserData) -run2_nanoAOD_102Xv1.toReplaceWith(electronSequence, _withUpdateAnd102XScale_sequence) +_withTo106XAndUpdateAnd102XScale_sequence = _withTo106XAndUpdate_sequence.copy() +_withTo106XAndUpdateAnd102XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons102X + slimmedElectronsWithUserData) +run2_nanoAOD_102Xv1.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd102XScale_sequence) -_withPATUpdate106X_sequence = cms.Sequence(slimmedElectronsUpdated + electronSequence.copy()) -run2_nanoAOD_106Xv1.toReplaceWith(electronSequence, _withPATUpdate106X_sequence) +_withUpdate_sequence = electronSequence.copy() +_withUpdate_sequence.replace(bitmapVIDForEle, slimmedElectronsUpdated + bitmapVIDForEle) +run2_nanoAOD_106Xv1.toReplaceWith(electronSequence, _withUpdate_sequence) From 49ac5cf617738adf0cd26338f9938461c49b69fc Mon Sep 17 00:00:00 2001 From: Suvankar Roy Chowdhury <suvankar.roy.chowdhury@cern.ch> Date: Mon, 12 Oct 2020 12:54:02 +0200 Subject: [PATCH 504/778] fix deltaY histo creation. --- Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc index f0c221d3a6484..e44f339b943c4 100644 --- a/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc +++ b/Validation/SiTrackerPhase2V/plugins/Phase2ITValidateRecHit.cc @@ -272,7 +272,7 @@ void Phase2ITValidateRecHit::bookLayerHistos(DQMStore::IBooker& ibooker, unsigne histoName.str(""); histoName << "Delta_Y"; local_histos.deltaY = - phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), histoName.str(), ibooker); + phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaY"), histoName.str(), ibooker); histoName.str(""); histoName << "Pull_X"; local_histos.pullX = From 8bc5717737d48adc25c38a01fd9a228b6e2fb010 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Mon, 12 Oct 2020 15:46:33 +0200 Subject: [PATCH 505/778] Take care of Static Analyzer Issues --- Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc | 2 +- Geometry/HGCalCommonData/src/HGCalGeomParameters.cc | 3 ++- .../test/python/dumpExtendedHGCalGeometryDDD_cfg.py | 5 ++++- Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc index 594b30efeb327..b117d2076be50 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc @@ -500,7 +500,7 @@ struct HGCalHEFileAlgo { if (corner.first > 0 && type >= 0) { int copy = HGCalTypes::packTypeUV(type, u, v); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << " DDHGCalHEFileAlgo: " << wafers_[type] << " number " << copy << " type " + edm::LogVerbatim("HGCalGeom") << " DDHGCalHEFileAlgo: " << waferNames_[type] << " number " << copy << " type " << type << " layer:u:v:indx " << (layer + firstLayer_) << ":" << u << ":" << v << ":" << indx; if (iu > ium) diff --git a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc index 50941059e7493..980872af37b45 100644 --- a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc +++ b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc @@ -1955,7 +1955,8 @@ void HGCalGeomParameters::rescale(std::vector<double>& v, const double s) { } void HGCalGeomParameters::resetZero(std::vector<double>& v) { - for (auto n : v) + for (auto& n : v) { if (std::abs(n) < tolmin) n = 0; + } } diff --git a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py index 87e3678f1f19d..3aad9bd70f892 100644 --- a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py +++ b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py @@ -1,7 +1,10 @@ import FWCore.ParameterSet.Config as cms +from Configuration.Eras.Era_Phase2C9_cff import Phase2C9 + +process = cms.Process('SIM',Phase2C9) process = cms.Process("GEODUMP") -process.load("Configuration.Geometry.GeometryExtended2026D46_cff") +process.load("Configuration.Geometry.GeometryExtended2026D49_cff") process.load('FWCore.MessageService.MessageLogger_cfi') if 'MessageLogger' in process.__dict__: diff --git a/Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py b/Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py index a445e9fe24ceb..0b9d9eccbb55e 100644 --- a/Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py +++ b/Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py @@ -4,7 +4,7 @@ process = cms.Process('SIM',Phase2C9) process.load("SimGeneral.HepPDTESSource.pdt_cfi") -#process.load("Configuration.Geometry.GeometryExtended2026D41_cff") +#process.load("Configuration.Geometry.GeometryExtended2026D49_cff") process.load("Geometry.HGCalCommonData.testHGCalV11XML_cfi") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") From 21b33374a064eb08d58ff3859ee47e327ce7db32 Mon Sep 17 00:00:00 2001 From: Jan Kaspar <jan.kaspar@cern.ch> Date: Mon, 12 Oct 2020 19:05:16 +0200 Subject: [PATCH 506/778] Added theta*_x and theta*_y histograms. --- DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc index df3a3fe5ff518..6e4e829618773 100644 --- a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc @@ -76,7 +76,8 @@ class CTPPSCommonDQMSource : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<s MonitorElement *h_numRPWithTrack_top = nullptr, *h_numRPWithTrack_hor = nullptr, *h_numRPWithTrack_bot = nullptr; MonitorElement *h_trackCorr = nullptr, *h_trackCorr_overlap = nullptr; - MonitorElement *h_proton_xi = nullptr, *h_proton_t = nullptr, *h_proton_time = nullptr; + MonitorElement *h_proton_xi = nullptr, *h_proton_th_x = nullptr, *h_proton_th_y = nullptr, *h_proton_t = nullptr, + *h_proton_time = nullptr; struct TrackingRPPlots { MonitorElement *h_x, *h_y; @@ -251,6 +252,8 @@ CTPPSCommonDQMSource::ArmPlots::ArmPlots(DQMStore::IBooker &ibooker, int _id, bo if (makeProtonRecoPlots) { h_proton_xi = ibooker.book1D("proton xi", title + ";xi", 100, 0., 0.3); + h_proton_th_x = ibooker.book1D("proton theta*_x", ";#theta_{x} (rad)", 250, -500E-6, +500E-6); + h_proton_th_y = ibooker.book1D("proton theta*_y", ";#theta_{y} (rad)", 250, -500E-6, +500E-6); h_proton_t = ibooker.book1D("proton t", title + ";|t| GeV^{2}", 100, 0., 5.); h_proton_time = ibooker.book1D("proton time", title + ";time (ns)", 100, -1., 1.); } @@ -523,6 +526,8 @@ void CTPPSCommonDQMSource::analyzeProtons(edm::Event const &event, edm::EventSet auto &plots = armPlots[armIndex]; plots.h_proton_xi->Fill(p.xi()); + plots.h_proton_th_x->Fill(p.thetaX()); + plots.h_proton_th_y->Fill(p.thetaY()); plots.h_proton_t->Fill(fabs(p.t())); plots.h_proton_time->Fill(p.time()); } From a82f98434fc67bca1c87aa3d68b4012b850102fc Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 13 Oct 2020 01:57:17 +0200 Subject: [PATCH 507/778] add comments --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 4 +++- RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index 790b171a815ca..dcc077e0a6702 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -155,7 +155,9 @@ float VectorHit::theta() const { return globalDirection().theta(); } float VectorHit::transverseMomentum(float magField) const { return magField * (CLHEP::c_light * 1e-5F) / theCurvature; -} // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, using precise value from speed of light + // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, using precise value from speed of light + // because curvature is a signed quantity this transverse momentum is also signed +} float VectorHit::momentum(float magField) const { return transverseMomentum(magField) / (1. * sin(theta())); } LocalError VectorHit::localPositionError() const { diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 195d4f1bf1a7d..334d2f384d69a 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -297,6 +297,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto //FIXME::charge is fine 1 every two times!! GlobalPoint center(0.0, 0.0, 0.0); int charge = 1; + // momentum is a signed quantity in this case float mom = vHit->momentum(magField_->inTesla(center).z()); float xPos = vHit->localPosition().x(); float yPos = vHit->localPosition().y(); From 60195712e2b4d2d66c40346df7d72958dff4107f Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Tue, 13 Oct 2020 03:00:40 +0200 Subject: [PATCH 508/778] code format --- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index dcc077e0a6702..b964ac88c3aaf 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -157,7 +157,7 @@ float VectorHit::transverseMomentum(float magField) const { return magField * (CLHEP::c_light * 1e-5F) / theCurvature; // pT [GeV] ~ 0.3 * B[T] * R [m], curvature is in cms, using precise value from speed of light // because curvature is a signed quantity this transverse momentum is also signed -} +} float VectorHit::momentum(float magField) const { return transverseMomentum(magField) / (1. * sin(theta())); } LocalError VectorHit::localPositionError() const { From df111f11e8d1010b31e1c2bd443aa54a2133cde2 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Mon, 12 Oct 2020 18:15:54 +0200 Subject: [PATCH 509/778] Migrate rest of L1T{Rate,Sync}{,_Offline} to EventSetup consumes --- DQM/L1TMonitor/interface/L1TMenuHelper.h | 21 +++++++++++----- DQM/L1TMonitor/interface/L1TRate.h | 8 +++--- DQM/L1TMonitor/interface/L1TSync.h | 6 ++--- DQM/L1TMonitor/src/L1TMenuHelper.cc | 12 +++------ DQM/L1TMonitor/src/L1TRate.cc | 25 ++++++++----------- DQM/L1TMonitor/src/L1TSync.cc | 18 ++++++------- .../L1Trigger/interface/L1TRate_Offline.h | 8 +++--- .../L1Trigger/interface/L1TSync_Offline.h | 6 ++--- DQMOffline/L1Trigger/src/L1TRate_Offline.cc | 25 ++++++++----------- DQMOffline/L1Trigger/src/L1TSync_Offline.cc | 16 ++++++------ 10 files changed, 73 insertions(+), 72 deletions(-) diff --git a/DQM/L1TMonitor/interface/L1TMenuHelper.h b/DQM/L1TMonitor/interface/L1TMenuHelper.h index f80c8db6ee9d8..3e1e19314c5a2 100644 --- a/DQM/L1TMonitor/interface/L1TMenuHelper.h +++ b/DQM/L1TMonitor/interface/L1TMenuHelper.h @@ -18,7 +18,6 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ServiceRegistry/interface/Service.h" @@ -78,8 +77,21 @@ struct SingleObjectTrigger { class L1TMenuHelper { public: - L1TMenuHelper(const edm::EventSetup& iSetup); // Constructor - ~L1TMenuHelper(); // Destructor + struct Tokens { + edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> menu; + edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd> l1GtPfAlgo; + }; + + template <edm::Transition Tr = edm::Transition::Event> + static Tokens consumes(edm::ConsumesCollector iC) { + Tokens tok; + tok.menu = iC.esConsumes<Tr>(); + tok.l1GtPfAlgo = iC.esConsumes<Tr>(); + return tok; + } + + L1TMenuHelper(const edm::EventSetup& iSetup, const Tokens& tokens); // Constructor + ~L1TMenuHelper(); // Destructor // Get Lowest Unprescaled Single Object Triggers std::map<std::string, std::string> getLUSOTrigger(const std::map<std::string, bool>& iCategories, @@ -98,9 +110,6 @@ class L1TMenuHelper { unsigned int getQualityAlias(const TString& iCategory, const TString& iAlias); private: - edm::ESHandle<L1GtTriggerMenu> menuRcd; - edm::ESHandle<L1GtPrescaleFactors> l1GtPfAlgo; - const L1GtTriggerMenu* m_l1GtMenu; const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig; diff --git a/DQM/L1TMonitor/interface/L1TRate.h b/DQM/L1TMonitor/interface/L1TRate.h index 2957953a9c049..634396fe9f6b8 100644 --- a/DQM/L1TMonitor/interface/L1TRate.h +++ b/DQM/L1TMonitor/interface/L1TRate.h @@ -14,8 +14,6 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/LuminosityBlock.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -23,7 +21,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DQMServices/Core/interface/DQMStore.h" -#include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/Scalers/interface/LumiScalers.h" @@ -35,6 +32,8 @@ #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h" +#include "DQM/L1TMonitor/interface/L1TMenuHelper.h" + #include <TString.h> #include <iostream> @@ -97,6 +96,9 @@ class L1TRate : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> { edm::EDGetTokenT<LumiScalersCollection> m_scalersSource_colLScal; // Where to get L1 Scalers edm::EDGetTokenT<Level1TriggerScalersCollection> m_scalersSource_triggerScalers; // Where to get L1 Scalers edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> m_l1GtDataDaqInputTag; // Where to get L1 GT Data DAQ + const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_menuToken; + const edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd> m_l1GtPfAlgoToken; + L1TMenuHelper::Tokens m_helperTokens; // ParameterSet edm::ParameterSet m_parameters; diff --git a/DQM/L1TMonitor/interface/L1TSync.h b/DQM/L1TMonitor/interface/L1TSync.h index 1676485863098..fe8ee07dfd001 100644 --- a/DQM/L1TMonitor/interface/L1TSync.h +++ b/DQM/L1TMonitor/interface/L1TSync.h @@ -14,8 +14,6 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/LuminosityBlock.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -23,9 +21,9 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DQMServices/Core/interface/DQMStore.h" -#include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DQM/L1TMonitor/interface/L1TMenuHelper.h" #include "DQM/L1TMonitor/interface/L1TOMDSHelper.h" //DataFormats @@ -135,6 +133,8 @@ class L1TSync : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> { // Input tags edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> m_l1GtEvmSource; edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> m_l1GtDataDaqInputTag; + const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_menuToken; + L1TMenuHelper::Tokens m_helperTokens; L1GtUtils m_l1GtUtils; }; diff --git a/DQM/L1TMonitor/src/L1TMenuHelper.cc b/DQM/L1TMonitor/src/L1TMenuHelper.cc index 69fadbfeddcec..65644378dba04 100644 --- a/DQM/L1TMonitor/src/L1TMenuHelper.cc +++ b/DQM/L1TMonitor/src/L1TMenuHelper.cc @@ -35,14 +35,10 @@ using namespace std; //------------------------------------------------------------------------------------- // //------------------------------------------------------------------------------------- -L1TMenuHelper::L1TMenuHelper(const edm::EventSetup& iSetup) { - iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd); - iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo); - - const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product(); - - m_l1GtMenu = menuRcd.product(); // Getting the menu - m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors()); // Retriving the list of prescale sets +L1TMenuHelper::L1TMenuHelper(const edm::EventSetup& iSetup, const Tokens& tokens) { + m_l1GtMenu = &iSetup.getData(tokens.menu); // Getting the menu + m_prescaleFactorsAlgoTrig = + &(iSetup.getData(tokens.l1GtPfAlgo).gtPrescaleFactors()); // Retriving the list of prescale sets } //------------------------------------------------------------------------------------- diff --git a/DQM/L1TMonitor/src/L1TRate.cc b/DQM/L1TMonitor/src/L1TRate.cc index 1f77997cf7757..459edccee0272 100644 --- a/DQM/L1TMonitor/src/L1TRate.cc +++ b/DQM/L1TMonitor/src/L1TRate.cc @@ -7,7 +7,6 @@ // L1TMonitor includes #include "DQM/L1TMonitor/interface/L1TRate.h" -#include "DQM/L1TMonitor/interface/L1TMenuHelper.h" #include "DQM/L1TMonitor/interface/L1TOMDSHelper.h" #include "DQMServices/Core/interface/DQMStore.h" @@ -30,7 +29,11 @@ using namespace edm; using namespace std; //_____________________________________________________________________ -L1TRate::L1TRate(const ParameterSet& ps) : m_l1GtUtils(ps, consumesCollector(), false, *this) { +L1TRate::L1TRate(const ParameterSet& ps) + : m_menuToken(esConsumes<edm::Transition::BeginRun>()), + m_l1GtPfAlgoToken(esConsumes<edm::Transition::BeginRun>()), + m_helperTokens(L1TMenuHelper::consumes<edm::Transition::BeginRun>(consumesCollector())), + m_l1GtUtils(ps, consumesCollector(), false, *this) { m_maxNbins = 2500; // Maximum LS for each run (for binning purposes) m_parameters = ps; @@ -79,14 +82,8 @@ L1TRate::~L1TRate() {} // BeginRun //_____________________________________________________________________ void L1TRate::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup& iSetup) { - ESHandle<L1GtTriggerMenu> menuRcd; - ESHandle<L1GtPrescaleFactors> l1GtPfAlgo; - - iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd); - iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo); - - const L1GtTriggerMenu* menu = menuRcd.product(); - const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product(); + const L1GtTriggerMenu& menu = iSetup.getData(m_menuToken); + const L1GtPrescaleFactors& l1GtPfAlgo = iSetup.getData(m_l1GtPfAlgoToken); // Initializing DQM Monitor Elements ibooker.setCurrentFolder("L1T/L1TRate"); @@ -98,10 +95,10 @@ void L1TRate::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const m_ErrorMonitor->setBinLabel(5, "UNKNOWN"); // Retriving the list of prescale sets - m_listsPrescaleFactors = &(m_l1GtPfAlgo->gtPrescaleFactors()); + m_listsPrescaleFactors = &(l1GtPfAlgo.gtPrescaleFactors()); // Getting Lowest Prescale Single Object Triggers from the menu - L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup); + L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup, m_helperTokens); m_l1GtUtils.retrieveL1EventSetup(iSetup); m_selectedTriggers = myMenuHelper.getLUSOTrigger(m_inputCategories, m_refPrescaleSet, m_l1GtUtils); @@ -113,8 +110,8 @@ void L1TRate::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const getXSexFitsPython(m_parameters); } - for (CItAlgo algo = menu->gtAlgorithmMap().begin(); algo != menu->gtAlgorithmMap().end(); ++algo) { - m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber(); + for (const auto& algo : menu.gtAlgorithmMap()) { + m_algoBit[algo.second.algoAlias()] = algo.second.algoBitNumber(); } double minInstantLuminosity = m_parameters.getParameter<double>("minInstantLuminosity"); diff --git a/DQM/L1TMonitor/src/L1TSync.cc b/DQM/L1TMonitor/src/L1TSync.cc index 0781ae880bcfa..27b5496f4e93c 100644 --- a/DQM/L1TMonitor/src/L1TSync.cc +++ b/DQM/L1TMonitor/src/L1TSync.cc @@ -27,9 +27,6 @@ //#include "DataFormats/Luminosity/interface/LumiDetails.h" //#include "DataFormats/Luminosity/interface/LumiSummary.h" -// L1TMonitor includes -#include "DQM/L1TMonitor/interface/L1TMenuHelper.h" - #include "TList.h" using namespace edm; @@ -37,7 +34,10 @@ using namespace std; //------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------- -L1TSync::L1TSync(const ParameterSet& pset) : m_l1GtUtils(pset, consumesCollector(), false, *this) { +L1TSync::L1TSync(const ParameterSet& pset) + : m_menuToken(esConsumes<edm::Transition::BeginRun>()), + m_helperTokens(L1TMenuHelper::consumes<edm::Transition::BeginRun>(consumesCollector())), + m_l1GtUtils(pset, consumesCollector(), false, *this) { m_parameters = pset; // Mapping parameter input variables @@ -319,13 +319,11 @@ void L1TSync::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const m_certLastLS.clear(); // Getting Trigger menu from GT - ESHandle<L1GtTriggerMenu> menuRcd; - iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd); - const L1GtTriggerMenu* menu = menuRcd.product(); + const L1GtTriggerMenu& menu = iSetup.getData(m_menuToken); // Filling Alias-Bit Map - for (CItAlgo algo = menu->gtAlgorithmAliasMap().begin(); algo != menu->gtAlgorithmAliasMap().end(); ++algo) { - m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber(); + for (const auto& algo : menu.gtAlgorithmAliasMap()) { + m_algoBit[algo.second.algoAlias()] = algo.second.algoBitNumber(); } // Getting fill number for this run @@ -337,7 +335,7 @@ void L1TSync::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const //iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo); //const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product(); - L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup); + L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup, m_helperTokens); m_selectedTriggers = myMenuHelper.testAlgos(m_selectedTriggers); diff --git a/DQMOffline/L1Trigger/interface/L1TRate_Offline.h b/DQMOffline/L1Trigger/interface/L1TRate_Offline.h index 9f31681c6edf7..65f18aaba0203 100644 --- a/DQMOffline/L1Trigger/interface/L1TRate_Offline.h +++ b/DQMOffline/L1Trigger/interface/L1TRate_Offline.h @@ -8,8 +8,6 @@ // user include files #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/LuminosityBlock.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -17,7 +15,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DQMServices/Core/interface/DQMStore.h" -#include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" //DataFormats @@ -31,6 +28,8 @@ #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h" +#include "DQM/L1TMonitor/interface/L1TMenuHelper.h" + #include <TString.h> #include <iostream> @@ -117,6 +116,9 @@ class L1TRate_Offline : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> // MonitorElement MonitorElement* m_ErrorMonitor; + const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_menuToken; + const edm::ESGetToken<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd> m_l1GtPfAlgoToken; + L1TMenuHelper::Tokens m_helperTokens; L1GtUtils m_l1GtUtils; }; diff --git a/DQMOffline/L1Trigger/interface/L1TSync_Offline.h b/DQMOffline/L1Trigger/interface/L1TSync_Offline.h index 4a8aa9ae9fae1..26c5547c24873 100644 --- a/DQMOffline/L1Trigger/interface/L1TSync_Offline.h +++ b/DQMOffline/L1Trigger/interface/L1TSync_Offline.h @@ -29,8 +29,6 @@ // User include files #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/LuminosityBlock.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -38,10 +36,10 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DQMServices/Core/interface/DQMStore.h" -#include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" //L1 includes and dataformats +#include "DQM/L1TMonitor/interface/L1TMenuHelper.h" #include "DQMOffline/L1Trigger/interface/L1TBeamConfiguration.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerEvmReadoutRecord.h" @@ -155,6 +153,8 @@ class L1TSync_Offline : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ltso:: // Input tags edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> m_l1GtEvmSource; edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> m_l1GtDataDaqInputTag; + const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_menuToken; + L1TMenuHelper::Tokens m_helperTokens; L1GtUtils m_l1GtUtils; }; diff --git a/DQMOffline/L1Trigger/src/L1TRate_Offline.cc b/DQMOffline/L1Trigger/src/L1TRate_Offline.cc index 777233615ad17..5e0bf1a9a0202 100644 --- a/DQMOffline/L1Trigger/src/L1TRate_Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TRate_Offline.cc @@ -1,6 +1,5 @@ // L1TMonitor includes #include "DQMOffline/L1Trigger/interface/L1TRate_Offline.h" -#include "DQM/L1TMonitor/interface/L1TMenuHelper.h" #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h" #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h" @@ -16,7 +15,11 @@ using namespace edm; using namespace std; //_____________________________________________________________________ -L1TRate_Offline::L1TRate_Offline(const ParameterSet& ps) : m_l1GtUtils(ps, consumesCollector(), false, *this) { +L1TRate_Offline::L1TRate_Offline(const ParameterSet& ps) + : m_menuToken(esConsumes<edm::Transition::BeginRun>()), + m_l1GtPfAlgoToken(esConsumes<edm::Transition::BeginRun>()), + m_helperTokens(L1TMenuHelper::consumes<edm::Transition::BeginRun>(consumesCollector())), + m_l1GtUtils(ps, consumesCollector(), false, *this) { m_maxNbins = 2500; // Maximum LS for each run (for binning purposes) m_parameters = ps; @@ -63,14 +66,8 @@ void L1TRate_Offline::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& cout << "[L1TRate_Offline:] Called beginRun." << endl; } - ESHandle<L1GtTriggerMenu> menuRcd; - ESHandle<L1GtPrescaleFactors> l1GtPfAlgo; - - iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd); - iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo); - - const L1GtTriggerMenu* menu = menuRcd.product(); - const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product(); + const L1GtTriggerMenu& menu = iSetup.getData(m_menuToken); + const L1GtPrescaleFactors& l1GtPfAlgo = iSetup.getData(m_l1GtPfAlgoToken); // Initializing DQM Monitor Elements ibooker.setCurrentFolder("L1T/L1TRate"); @@ -83,18 +80,18 @@ void L1TRate_Offline::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& } // Retriving the list of prescale sets - m_listsPrescaleFactors = &(m_l1GtPfAlgo->gtPrescaleFactors()); + m_listsPrescaleFactors = &(l1GtPfAlgo.gtPrescaleFactors()); // Getting Lowest Prescale Single Object Triggers from the menu - L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup); + L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup, m_helperTokens); m_l1GtUtils.retrieveL1EventSetup(iSetup); m_selectedTriggers = myMenuHelper.getLUSOTrigger(m_inputCategories, m_refPrescaleSet, m_l1GtUtils); //-> Getting template fits for the algLo cross sections getXSexFitsPython(m_parameters); - for (CItAlgo algo = menu->gtAlgorithmMap().begin(); algo != menu->gtAlgorithmMap().end(); ++algo) { - m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber(); + for (const auto& algo : menu.gtAlgorithmMap()) { + m_algoBit[(algo.second).algoAlias()] = (algo.second).algoBitNumber(); } double minInstantLuminosity = m_parameters.getParameter<double>("minInstantLuminosity"); diff --git a/DQMOffline/L1Trigger/src/L1TSync_Offline.cc b/DQMOffline/L1Trigger/src/L1TSync_Offline.cc index 77de48191a592..53d59d92b7766 100644 --- a/DQMOffline/L1Trigger/src/L1TSync_Offline.cc +++ b/DQMOffline/L1Trigger/src/L1TSync_Offline.cc @@ -48,7 +48,6 @@ //#include "DataFormats/Luminosity/interface/LumiSummary.h" // L1TMonitor includes -#include "DQM/L1TMonitor/interface/L1TMenuHelper.h" //#include "DQMOffline/L1Trigger/interface/L1TMenuHelper.h" #include "TList.h" @@ -58,7 +57,10 @@ using namespace std; //------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------- -L1TSync_Offline::L1TSync_Offline(const ParameterSet& pset) : m_l1GtUtils(pset, consumesCollector(), false, *this) { +L1TSync_Offline::L1TSync_Offline(const ParameterSet& pset) + : m_menuToken(esConsumes<edm::Transition::BeginRun>()), + m_helperTokens(L1TMenuHelper::consumes<edm::Transition::BeginRun>(consumesCollector())), + m_l1GtUtils(pset, consumesCollector(), false, *this) { m_parameters = pset; // Mapping parameter input variables @@ -329,13 +331,11 @@ void L1TSync_Offline::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& m_certLastLS.clear(); // Getting Trigger menu from GT - ESHandle<L1GtTriggerMenu> menuRcd; - iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd); - const L1GtTriggerMenu* menu = menuRcd.product(); + const L1GtTriggerMenu& menu = iSetup.getData(m_menuToken); // Filling Alias-Bit Map - for (CItAlgo algo = menu->gtAlgorithmAliasMap().begin(); algo != menu->gtAlgorithmAliasMap().end(); ++algo) { - m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber(); + for (const auto& algo : menu.gtAlgorithmAliasMap()) { + m_algoBit[algo.second.algoAlias()] = algo.second.algoBitNumber(); } // Getting fill number for this run @@ -347,7 +347,7 @@ void L1TSync_Offline::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& //iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo); //const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product(); - L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup); + L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup, m_helperTokens); m_selectedTriggers = myMenuHelper.testAlgos(m_selectedTriggers); From 02d11740d3c04381b19e9445a705f785c65f2edb Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Tue, 13 Oct 2020 00:06:06 +0200 Subject: [PATCH 510/778] Migrate rest of MuonIdProducer to EventSetup consumes --- .../interface/MuonShowerDigiFiller.h | 5 ++++- .../MuonIdentification/plugins/MuonIdProducer.cc | 13 +++++-------- .../MuonIdentification/plugins/MuonIdProducer.h | 3 +++ .../MuonIdentification/src/MuonShowerDigiFiller.cc | 10 +++++----- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h b/RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h index 2414dd42f4fad..99491ab78b6e8 100644 --- a/RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h +++ b/RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h @@ -26,7 +26,6 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ConsumesCollector.h" @@ -36,6 +35,7 @@ #include "Geometry/DTGeometry/interface/DTGeometry.h" #include "Geometry/CSCGeometry/interface/CSCGeometry.h" +#include "Geometry/Records/interface/MuonGeometryRecord.h" #include "DataFormats/MuonReco/interface/MuonChamberMatch.h" #include "TrackingTools/TrackAssociator/interface/TAMuonChamberMatch.h" @@ -60,6 +60,9 @@ class MuonShowerDigiFiller { edm::EDGetTokenT<DTDigiCollection> m_dtDigisToken; edm::EDGetTokenT<CSCStripDigiCollection> m_cscDigisToken; + edm::ESGetToken<DTGeometry, MuonGeometryRecord> m_dtGeometryToken; + edm::ESGetToken<CSCGeometry, MuonGeometryRecord> m_cscGeometryToken; + edm::ESHandle<DTGeometry> m_dtGeometry; edm::ESHandle<CSCGeometry> m_cscGeometry; diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc index 3c214cebc73f9..a3ffca69344d1 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc @@ -32,7 +32,9 @@ #include "RecoMuon/MuonIdentification/interface/MuonKinkFinder.h" -MuonIdProducer::MuonIdProducer(const edm::ParameterSet& iConfig) { +MuonIdProducer::MuonIdProducer(const edm::ParameterSet& iConfig) + : geomTokenRun_(esConsumes<edm::Transition::BeginRun>()), + propagatorToken_(esConsumes(edm::ESInputTag("", "SteppingHelixPropagatorAny"))) { LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: Constructor called"; produces<reco::MuonCollection>(); @@ -195,9 +197,7 @@ void MuonIdProducer::init(edm::Event& iEvent, const edm::EventSetup& iSetup) { pickyCollectionHandle_.clear(); dytCollectionHandle_.clear(); - edm::ESHandle<Propagator> propagator; - iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny", propagator); - trackAssociator_.setPropagator(propagator.product()); + trackAssociator_.setPropagator(&iSetup.getData(propagatorToken_)); if (fillTrackerKink_) trackerKinkFinder_->init(iSetup); @@ -411,10 +411,7 @@ int MuonIdProducer::overlap(const reco::Muon& muon, const reco::Track& track) { } void MuonIdProducer::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { - edm::ESHandle<CSCGeometry> geomHandle; - iSetup.get<MuonGeometryRecord>().get(geomHandle); - - meshAlgo_->setCSCGeometry(geomHandle.product()); + meshAlgo_->setCSCGeometry(&iSetup.getData(geomTokenRun_)); if (fillShowerDigis_ && fillMatching_) theShowerDigiFiller_->getES(iSetup); diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h index 373f18d6cf2e1..e4317cfd7aae9 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h @@ -246,6 +246,9 @@ class MuonIdProducer : public edm::stream::EDProducer<> { edm::Handle<RPCRecHitCollection> rpcHitHandle_; edm::Handle<edm::ValueMap<reco::MuonQuality> > glbQualHandle_; + const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> geomTokenRun_; + const edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; + MuonCaloCompatibility muonCaloCompatibility_; std::unique_ptr<reco::isodeposit::IsoDepositExtractor> muIsoExtractorCalo_; std::unique_ptr<reco::isodeposit::IsoDepositExtractor> muIsoExtractorTrack_; diff --git a/RecoMuon/MuonIdentification/src/MuonShowerDigiFiller.cc b/RecoMuon/MuonIdentification/src/MuonShowerDigiFiller.cc index 7bbba4eb020f7..8ad33f07de579 100644 --- a/RecoMuon/MuonIdentification/src/MuonShowerDigiFiller.cc +++ b/RecoMuon/MuonIdentification/src/MuonShowerDigiFiller.cc @@ -20,8 +20,6 @@ // user include files #include "RecoMuon/MuonIdentification/interface/MuonShowerDigiFiller.h" -#include "Geometry/Records/interface/MuonGeometryRecord.h" - // // constructors and destructor // @@ -30,15 +28,17 @@ MuonShowerDigiFiller::MuonShowerDigiFiller(const edm::ParameterSet& iConfig, edm : m_digiMaxDistanceX(iConfig.getParameter<double>("digiMaxDistanceX")), m_dtDigisToken(iC.consumes<DTDigiCollection>(iConfig.getParameter<edm::InputTag>("dtDigiCollectionLabel"))), m_cscDigisToken( - iC.consumes<CSCStripDigiCollection>(iConfig.getParameter<edm::InputTag>("cscDigiCollectionLabel"))) {} + iC.consumes<CSCStripDigiCollection>(iConfig.getParameter<edm::InputTag>("cscDigiCollectionLabel"))), + m_dtGeometryToken(iC.esConsumes<edm::Transition::BeginRun>()), + m_cscGeometryToken(iC.esConsumes<edm::Transition::BeginRun>()) {} // // member functions // void MuonShowerDigiFiller::getES(const edm::EventSetup& iSetup) { - iSetup.get<MuonGeometryRecord>().get(m_dtGeometry); - iSetup.get<MuonGeometryRecord>().get(m_cscGeometry); + m_dtGeometry = iSetup.getHandle(m_dtGeometryToken); + m_cscGeometry = iSetup.getHandle(m_cscGeometryToken); } void MuonShowerDigiFiller::getDigis(edm::Event& iEvent) { From cf24d64889a79890fad9ab93fd738944ca609aab Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Mon, 12 Oct 2020 03:10:17 +0200 Subject: [PATCH 511/778] Migrate L1GlobalTriggerGTL to EventSetup-consumes --- .../interface/L1GlobalTriggerGTL.h | 8 +++- .../GlobalTrigger/src/L1GlobalTriggerGTL.cc | 43 ++++++------------- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/L1Trigger/GlobalTrigger/interface/L1GlobalTriggerGTL.h b/L1Trigger/GlobalTrigger/interface/L1GlobalTriggerGTL.h index 93b319c937f54..1099a7cac8d35 100644 --- a/L1Trigger/GlobalTrigger/interface/L1GlobalTriggerGTL.h +++ b/L1Trigger/GlobalTrigger/interface/L1GlobalTriggerGTL.h @@ -21,6 +21,9 @@ #include <vector> // user include files +#include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h" +#include "CondFormats/DataRecord/interface/L1CaloGeometryRecord.h" +#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h" @@ -102,13 +105,14 @@ class L1GlobalTriggerGTL { // cached stuff // trigger menu - const L1GtTriggerMenu *m_l1GtMenu; - unsigned long long m_l1GtMenuCacheID; + const edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> m_l1GtMenuToken; // L1 scales (phi, eta) for Mu, Calo and EnergySum objects + const edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> m_l1CaloGeometryToken; const L1CaloGeometry *m_l1CaloGeometry; unsigned long long m_l1CaloGeometryCacheID; + const edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> m_l1MuTriggerScalesToken; const L1MuTriggerScales *m_l1MuTriggerScales; unsigned long long m_l1MuTriggerScalesCacheID; diff --git a/L1Trigger/GlobalTrigger/src/L1GlobalTriggerGTL.cc b/L1Trigger/GlobalTrigger/src/L1GlobalTriggerGTL.cc index f59213f17172e..a2c151be6d4ca 100644 --- a/L1Trigger/GlobalTrigger/src/L1GlobalTriggerGTL.cc +++ b/L1Trigger/GlobalTrigger/src/L1GlobalTriggerGTL.cc @@ -24,7 +24,6 @@ #include "CondFormats/L1TObjects/interface/L1GtFwd.h" -#include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h" #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h" #include "CondFormats/L1TObjects/interface/L1GtAlgorithm.h" @@ -41,8 +40,6 @@ #include "CondFormats/L1TObjects/interface/L1GtJetCountsTemplate.h" #include "CondFormats/L1TObjects/interface/L1GtMuonTemplate.h" -#include "CondFormats/DataRecord/interface/L1CaloGeometryRecord.h" -#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" #include "CondFormats/L1TObjects/interface/L1CaloGeometry.h" #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h" @@ -69,18 +66,19 @@ #include "FWCore/MessageLogger/interface/MessageDrop.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Framework/interface/ESHandle.h" - // forward declarations // constructor L1GlobalTriggerGTL::L1GlobalTriggerGTL(const edm::InputTag &m_muGmtInputTag, edm::ConsumesCollector &&iC) - : m_candL1Mu(new std::vector<const L1MuGMTCand *>), m_isDebugEnabled(edm::isDebugEnabled()) { + : m_l1GtMenuToken(iC.esConsumes()), + m_l1CaloGeometryToken(iC.esConsumes()), + m_l1MuTriggerScalesToken(iC.esConsumes()), + m_candL1Mu(new std::vector<const L1MuGMTCand *>), + m_isDebugEnabled(edm::isDebugEnabled()) { m_gtlAlgorithmOR.reset(); m_gtlDecisionWord.reset(); // initialize cached IDs - m_l1GtMenuCacheID = 0ULL; m_l1CaloGeometryCacheID = 0ULL; m_l1MuTriggerScalesCacheID = 0ULL; @@ -172,25 +170,16 @@ void L1GlobalTriggerGTL::run(edm::Event &iEvent, const int ifMuEtaNumberBits, const int ifCaloEtaNumberBits) { // get / update the trigger menu from the EventSetup - // local cache & check on cacheIdentifier + const auto &l1GtMenu = evSetup.getData(m_l1GtMenuToken); - unsigned long long l1GtMenuCacheID = evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier(); - - if (m_l1GtMenuCacheID != l1GtMenuCacheID) { - edm::ESHandle<L1GtTriggerMenu> l1GtMenu; - evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu); - m_l1GtMenu = l1GtMenu.product(); - m_l1GtMenuCacheID = l1GtMenuCacheID; - } + const std::vector<ConditionMap> &conditionMap = l1GtMenu.gtConditionMap(); + const AlgorithmMap &algorithmMap = l1GtMenu.gtAlgorithmMap(); - const std::vector<ConditionMap> &conditionMap = m_l1GtMenu->gtConditionMap(); - const AlgorithmMap &algorithmMap = m_l1GtMenu->gtAlgorithmMap(); + const std::vector<std::vector<L1GtMuonTemplate>> &corrMuon = l1GtMenu.corMuonTemplate(); - const std::vector<std::vector<L1GtMuonTemplate>> &corrMuon = m_l1GtMenu->corMuonTemplate(); + const std::vector<std::vector<L1GtCaloTemplate>> &corrCalo = l1GtMenu.corCaloTemplate(); - const std::vector<std::vector<L1GtCaloTemplate>> &corrCalo = m_l1GtMenu->corCaloTemplate(); - - const std::vector<std::vector<L1GtEnergySumTemplate>> &corrEnergySum = m_l1GtMenu->corEnergySumTemplate(); + const std::vector<std::vector<L1GtEnergySumTemplate>> &corrEnergySum = l1GtMenu.corEnergySumTemplate(); // conversion needed for correlation conditions // done in the condition loop when the first correlation template is in the @@ -202,10 +191,7 @@ void L1GlobalTriggerGTL::run(edm::Event &iEvent, unsigned long long l1CaloGeometryCacheID = evSetup.get<L1CaloGeometryRecord>().cacheIdentifier(); if (m_l1CaloGeometryCacheID != l1CaloGeometryCacheID) { - edm::ESHandle<L1CaloGeometry> l1CaloGeometry; - evSetup.get<L1CaloGeometryRecord>().get(l1CaloGeometry); - m_l1CaloGeometry = l1CaloGeometry.product(); - + m_l1CaloGeometry = &evSetup.getData(m_l1CaloGeometryToken); m_l1CaloGeometryCacheID = l1CaloGeometryCacheID; convertScale = true; } @@ -215,10 +201,7 @@ void L1GlobalTriggerGTL::run(edm::Event &iEvent, unsigned long long l1MuTriggerScalesCacheID = evSetup.get<L1MuTriggerScalesRcd>().cacheIdentifier(); if (m_l1MuTriggerScalesCacheID != l1MuTriggerScalesCacheID) { - edm::ESHandle<L1MuTriggerScales> l1MuTriggerScales; - evSetup.get<L1MuTriggerScalesRcd>().get(l1MuTriggerScales); - m_l1MuTriggerScales = l1MuTriggerScales.product(); - + m_l1MuTriggerScales = &evSetup.getData(m_l1MuTriggerScalesToken); m_l1MuTriggerScalesCacheID = l1MuTriggerScalesCacheID; convertScale = true; } From 72d11a181e7015e2231cdd96ec656de3bc85c9d2 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Mon, 12 Oct 2020 20:23:59 +0200 Subject: [PATCH 512/778] Remove unncessary get-without-ESGetToken from L1GtUtils --- L1Trigger/GlobalTriggerAnalyzer/src/L1GtUtils.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/L1Trigger/GlobalTriggerAnalyzer/src/L1GtUtils.cc b/L1Trigger/GlobalTriggerAnalyzer/src/L1GtUtils.cc index 5200285a76920..598313681470a 100644 --- a/L1Trigger/GlobalTriggerAnalyzer/src/L1GtUtils.cc +++ b/L1Trigger/GlobalTriggerAnalyzer/src/L1GtUtils.cc @@ -230,9 +230,6 @@ void L1GtUtils::retrieveL1EventSetup(const edm::EventSetup& evSetup, bool isRun) unsigned long long l1GtTmVetoAlgoCacheID = l1GtTriggerMaskVetoAlgoTrigRcd.cacheIdentifier(); if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) { - edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo; - evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo); - m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product(); if (isRun) { m_l1GtTmVetoAlgo = &l1GtTriggerMaskVetoAlgoTrigRcd.get(m_L1GtTriggerMaskVetoAlgoTrigRunToken); } else { @@ -266,9 +263,6 @@ void L1GtUtils::retrieveL1EventSetup(const edm::EventSetup& evSetup, bool isRun) unsigned long long l1GtMenuCacheID = l1GtTriggerMenuRcd.cacheIdentifier(); if (m_l1GtMenuCacheID != l1GtMenuCacheID) { - edm::ESHandle<L1GtTriggerMenu> l1GtMenu; - evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu); - m_l1GtMenu = l1GtMenu.product(); if (isRun) { m_l1GtMenu = &l1GtTriggerMenuRcd.get(m_L1GtTriggerMenuRunToken); } else { From 821f7627455fd8f6ceadc38336555dd84ac6d9f8 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Mon, 12 Oct 2020 23:16:12 +0200 Subject: [PATCH 513/778] Migrate rest of SiStripMonitorDigi to EventSetup consumes --- .../interface/SiStripMonitorDigi.h | 8 ++++- .../src/SiStripMonitorDigi.cc | 30 +++++++++---------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/DQM/SiStripMonitorDigi/interface/SiStripMonitorDigi.h b/DQM/SiStripMonitorDigi/interface/SiStripMonitorDigi.h index 798c2554c32a8..05f46a713d827 100644 --- a/DQM/SiStripMonitorDigi/interface/SiStripMonitorDigi.h +++ b/DQM/SiStripMonitorDigi/interface/SiStripMonitorDigi.h @@ -9,6 +9,7 @@ // Original Author: dkcira // Created: Sat Feb 4 20:49:51 CET 2006 #include <memory> +#include "CondFormats/RunInfo/interface/RunInfo.h" #include "FWCore/Utilities/interface/EDGetToken.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/LuminosityBlock.h" @@ -146,7 +147,7 @@ class SiStripMonitorDigi : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<boo std::vector<const edm::DetSetVector<SiStripDigi>*> digi_detset_handles; unsigned long long m_cacheID_; - edm::ESHandle<SiStripDetCabling> SiStripDetCabling_; + const SiStripDetCabling* SiStripDetCabling_; std::vector<uint32_t> ModulesToBeExcluded_; //Global MEs to monitor APV Shots properties @@ -227,6 +228,11 @@ class SiStripMonitorDigi : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<boo edm::EDGetTokenT<EventWithHistory> historyProducerToken_; edm::EDGetTokenT<APVCyclePhaseCollection> apvPhaseProducerToken_; edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> gtEvmToken_; + edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoTokenRun_; + edm::ESGetToken<TkDetMap, TrackerTopologyRcd> tkDetMapTokenRun_; + edm::ESGetToken<SiStripDetCabling, SiStripDetCablingRcd> SiStripDetCablingTokenRun_; + edm::ESGetToken<RunInfo, RunInfoRcd> runInfoTokenRun_; + edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_; SiStripDCSStatus* dcsStatus_; }; diff --git a/DQM/SiStripMonitorDigi/src/SiStripMonitorDigi.cc b/DQM/SiStripMonitorDigi/src/SiStripMonitorDigi.cc index 7be14fa0218dc..57d8ff6af31b4 100644 --- a/DQM/SiStripMonitorDigi/src/SiStripMonitorDigi.cc +++ b/DQM/SiStripMonitorDigi/src/SiStripMonitorDigi.cc @@ -37,7 +37,6 @@ #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerEvmReadoutRecord.h" #include "DataFormats/L1GlobalTrigger/interface/L1GtFdlWord.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" -#include "CondFormats/RunInfo/interface/RunInfo.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" /* mia: but is there not a smarter way ?!?!?! */ @@ -178,6 +177,16 @@ SiStripMonitorDigi::SiStripMonitorDigi(const edm::ParameterSet& iConfig) gtEvmToken_ = consumes<L1GlobalTriggerEvmReadoutRecord>(edm::InputTag("gtEvmDigis")); + if (show_mechanical_structure_view) { + tTopoTokenRun_ = esConsumes<edm::Transition::BeginRun>(); + tkDetMapTokenRun_ = esConsumes<edm::Transition::BeginRun>(); + SiStripDetCablingTokenRun_ = esConsumes<edm::Transition::BeginRun>(); + } + if (subdetswitchtotdigifailureon) { + runInfoTokenRun_ = esConsumes<edm::Transition::BeginRun>(); + } + tTopoToken_ = esConsumes(); + // Create DCS Status bool checkDCS = conf_.getParameter<bool>("UseDCSFiltering"); if (checkDCS) @@ -225,8 +234,6 @@ void SiStripMonitorDigi::dqmBeginRun(const edm::Run& run, const edm::EventSetup& if (m_cacheID_ != cacheID) { m_cacheID_ = cacheID; } - edm::ESHandle<SiStripDetCabling> detCabling_; - es.get<SiStripDetCablingRcd>().get(detCabling_); //nFEDConnected = 0; nFedTIB = 0; @@ -240,8 +247,7 @@ void SiStripMonitorDigi::dqmBeginRun(const edm::Run& run, const edm::EventSetup& //const int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID; if (auto runInfoRec = es.tryToGet<RunInfoRcd>()) { - edm::ESHandle<RunInfo> sumFED; - runInfoRec->get(sumFED); + edm::ESHandle<RunInfo> sumFED = runInfoRec->getHandle(runInfoTokenRun_); if (sumFED.isValid()) { std::vector<int> FedsInIds = sumFED->m_fed_in; @@ -312,15 +318,11 @@ void SiStripMonitorDigi::globalEndLuminosityBlock(const edm::LuminosityBlock& lb void SiStripMonitorDigi::createMEs(DQMStore::IBooker& ibooker, const edm::EventSetup& es) { if (show_mechanical_structure_view) { //Retrieve tracker topology from geometry - edm::ESHandle<TrackerTopology> tTopoHandle; - es.get<TrackerTopologyRcd>().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); - edm::ESHandle<TkDetMap> tkDetMapHandle; - es.get<TrackerTopologyRcd>().get(tkDetMapHandle); - const TkDetMap* tkDetMap = tkDetMapHandle.product(); + const TrackerTopology* const tTopo = &es.getData(tTopoTokenRun_); + const TkDetMap* tkDetMap = &es.getData(tkDetMapTokenRun_); // take from eventSetup the SiStripDetCabling object - here will use SiStripDetControl later on - es.get<SiStripDetCablingRcd>().get(SiStripDetCabling_); + SiStripDetCabling_ = &es.getData(SiStripDetCablingTokenRun_); // get list of active detectors from SiStripDetCabling std::vector<uint32_t> activeDets; @@ -576,9 +578,7 @@ void SiStripMonitorDigi::analyze(const edm::Event& iEvent, const edm::EventSetup return; //Retrieve tracker topology from geometry - edm::ESHandle<TrackerTopology> tTopoHandle; - iSetup.get<TrackerTopologyRcd>().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); + const TrackerTopology* const tTopo = &iSetup.getData(tTopoToken_); TotalNShots = 0; From 8084829044b459232e65a20e35ab794ab3e47601 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Tue, 13 Oct 2020 08:14:32 +0200 Subject: [PATCH 514/778] corrections from review --- RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc | 4 ++-- .../HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc index 70a378bfe5742..0c2d0b3f34004 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc @@ -47,9 +47,9 @@ void HGCalCLUEAlgoT<T>::populate(const HGCRecHitCollection& hits) { thickness_index = maxNumberOfThickIndices_; double storedThreshold = thresholds_[layerOnSide][thickness_index]; - if (detid.det() == DetId::HGCalEE || detid.subdetId() == HGCEE) { + if (detid.subdetId() == HGCEE) { storedThreshold = thresholds_[layerOnSide][thickness_index]; - } else if (detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF) { + } else if (detid.subdetId() == HGCHEF) { storedThreshold = thresholds_[layerOnSide][thickness_index + deltasi_index_regemfac_]; } sigmaNoise = v_sigmaNoise_[layerOnSide][thickness_index]; diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc index ff4af9b75d4a3..24c1139719d2b 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalRecHitWorkerSimple.cc @@ -59,8 +59,7 @@ HGCalRecHitWorkerSimple::HGCalRecHitWorkerSimple(const edm::ParameterSet& ps) : rcorr_.push_back(1.0 / corr); } // here for scintillator - const auto& rcorrscint = ps.getParameter<double>("sciThicknessCorrection"); - rcorrscint_ = 1.0 / rcorrscint; + rcorrscint_ = 1.0 / ps.getParameter<double>("sciThicknessCorrection"); //This is for the index position in CE_H silicon thickness cases deltasi_index_regemfac_ = ps.getParameter<int>("deltasi_index_regemfac"); From bec62d1fa867bf3ddf7dd6ca8754eea6e15b5937 Mon Sep 17 00:00:00 2001 From: Jan Kaspar <jan.kaspar@cern.ch> Date: Tue, 13 Oct 2020 10:34:07 +0200 Subject: [PATCH 515/778] Removed star and underscore from ME names. --- DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc index 6e4e829618773..7db4a49d9e33f 100644 --- a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc @@ -252,8 +252,8 @@ CTPPSCommonDQMSource::ArmPlots::ArmPlots(DQMStore::IBooker &ibooker, int _id, bo if (makeProtonRecoPlots) { h_proton_xi = ibooker.book1D("proton xi", title + ";xi", 100, 0., 0.3); - h_proton_th_x = ibooker.book1D("proton theta*_x", ";#theta_{x} (rad)", 250, -500E-6, +500E-6); - h_proton_th_y = ibooker.book1D("proton theta*_y", ";#theta_{y} (rad)", 250, -500E-6, +500E-6); + h_proton_th_x = ibooker.book1D("proton theta st x", ";#theta^{*}_{x} (rad)", 250, -500E-6, +500E-6); + h_proton_th_y = ibooker.book1D("proton theta st y", ";#theta^{*}_{y} (rad)", 250, -500E-6, +500E-6); h_proton_t = ibooker.book1D("proton t", title + ";|t| GeV^{2}", 100, 0., 5.); h_proton_time = ibooker.book1D("proton time", title + ";time (ns)", 100, -1., 1.); } From 5c5d37583b792a12bfafa7a133a6ea2a6d83afc1 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady <dinyar@cern.ch> Date: Thu, 1 Oct 2020 16:24:02 +0200 Subject: [PATCH 516/778] Log when we can't fill raw eta of uGMT output muons --- L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc index cbe5ab0ace5e9..02fbe67eb6bc5 100644 --- a/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc +++ b/L1Trigger/L1TMuon/src/MuonRawDigiTranslator.cc @@ -1,3 +1,4 @@ +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "TMath.h" #include "L1Trigger/L1TMuon/interface/MuonRawDigiTranslator.h" @@ -124,7 +125,7 @@ void l1t::MuonRawDigiTranslator::fillMuonQuantitiesRun3( } else if (muInBx == 2) { mu.setHwEta(calcHwEta(raw_data_spare, absEtaMu2Shift_, etaMu2SignShift_)); } else { - // TODO: Log an error? + edm::LogWarning("L1T") << "Received invalid muon id " << muInBx << ". Cannot fill eta value in the muon system."; } mu.setHwPhi((raw_data_32_63 >> phiShift_) & phiMask_); From 449b1038f2edecc4fb5e8dc6ae4d8cc14c5098e0 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady <dinyar@cern.ch> Date: Thu, 1 Oct 2020 16:29:05 +0200 Subject: [PATCH 517/778] Reverted regression in BMTF DQM that was introduced during merge --- DQM/L1TMonitor/interface/L1TStage2BMTF.h | 2 +- DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DQM/L1TMonitor/interface/L1TStage2BMTF.h b/DQM/L1TMonitor/interface/L1TStage2BMTF.h index a77c03b05cb55..038d38f11deab 100644 --- a/DQM/L1TMonitor/interface/L1TStage2BMTF.h +++ b/DQM/L1TMonitor/interface/L1TStage2BMTF.h @@ -33,7 +33,7 @@ #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" // dqm requirements -#include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Frameworkfwd.h" diff --git a/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h b/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h index d312f8b640ecf..f679c4d30a852 100644 --- a/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h +++ b/DQM/L1TMonitor/interface/L1TStage2RegionalMuonCandComp.h @@ -4,7 +4,7 @@ #include "DataFormats/L1TMuon/interface/RegionalMuonCand.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" -#include "DQMServices/Core/interface/MonitorElement.h" +#include "DQMServices/Core/interface/DQMStore.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" From acc2302071bf0d5f3c43763250bce639d69e2a92 Mon Sep 17 00:00:00 2001 From: Dinyar Rabady <dinyar@cern.ch> Date: Mon, 12 Oct 2020 13:20:51 +0200 Subject: [PATCH 518/778] Versioning RegionalMuonCand data format --- DataFormats/L1TMuon/src/classes_def.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/DataFormats/L1TMuon/src/classes_def.xml b/DataFormats/L1TMuon/src/classes_def.xml index 9b5fbe5ad5ea5..ba9b6271f7095 100644 --- a/DataFormats/L1TMuon/src/classes_def.xml +++ b/DataFormats/L1TMuon/src/classes_def.xml @@ -1,7 +1,14 @@ <lcgdict> <selection> - <class name="l1t::RegionalMuonCand"/> + <class name="l1t::RegionalMuonCand" ClassVersion="11"> + <version ClassVersion="11" checksum="2292293737"/> + <version ClassVersion="10" checksum="1070099328"/> + </class> + <ioread sourceClass="l1t::RegionalMuonCand" targetClass="l1t::RegionalMuonCand" version="[-10]" source="int m_hwPt2" target="m_hwPtUnconstrained"> + <![CDATA[ m_hwPtUnconstrained = onfile.m_hwPt2; ]]> + </ioread> + <class name="std::vector<l1t::RegionalMuonCand>"/> <class name="l1t::RegionalMuonCandBxCollection"/> <class name="edm::Wrapper<l1t::RegionalMuonCandBxCollection>"/> From 8ac453995e8d7a67a932f1ae54d023ca104165be Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Tue, 13 Oct 2020 13:47:13 +0200 Subject: [PATCH 519/778] cleanup from code review --- .../plugins/HiSignalGenJetProducer.cc | 41 +++++++------------ .../plugins/HiSignalParticleProducer.cc | 41 +++++++------------ .../plugins/SubEventGenJetProducer.cc | 1 - 3 files changed, 28 insertions(+), 55 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc index bd2b1f284bc79..14fc8be6ef056 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc @@ -22,7 +22,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -32,12 +32,8 @@ #include "DataFormats/Common/interface/View.h" #include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/GeometryVector/interface/VectorUtil.h" #include "DataFormats/HepMCCandidate/interface/GenParticle.h" -#include "DataFormats/Math/interface/Point3D.h" -#include "DataFormats/Math/interface/LorentzVector.h" - using namespace std; using namespace edm; @@ -45,13 +41,15 @@ using namespace edm; // class decleration // -class HiSignalGenJetProducer : public edm::EDProducer { +class HiSignalGenJetProducer : public edm::global::EDProducer<> { public: explicit HiSignalGenJetProducer(const edm::ParameterSet&); - ~HiSignalGenJetProducer() override; + ~HiSignalGenJetProducer() override = default; + + static void fillDescriptions(edm::ConfigurationDescriptions&); private: - void produce(edm::Event&, const edm::EventSetup&) override; + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; // ----------member data --------------------------- edm::EDGetTokenT<edm::View<reco::GenJet> > jetSrc_; @@ -75,18 +73,13 @@ HiSignalGenJetProducer::HiSignalGenJetProducer(const edm::ParameterSet& iConfig) produces<reco::GenJetCollection>().setBranchAlias(alias); } -HiSignalGenJetProducer::~HiSignalGenJetProducer() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} - // // member functions // // ------------ method called to produce the data ------------ -void HiSignalGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { +void HiSignalGenJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { using namespace edm; using namespace reco; @@ -97,15 +90,6 @@ void HiSignalGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& int jetsize = genjets->size(); - vector<int> selection; - selection.reserve(jetsize); - for (int ijet = 0; ijet < jetsize; ++ijet) { - selection.push_back(-1); - } - - vector<int> selectedIndices; - vector<int> removedIndices; - for (int ijet = 0; ijet < jetsize; ++ijet) { const GenJet* jet1 = &((*genjets)[ijet]); @@ -115,14 +99,17 @@ void HiSignalGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& throw cms::Exception("GenConstituent", "GenJet is missing its constituents"); else if (gencon->collisionId() == 0) { jets->push_back(*jet1); - selection[ijet] = 1; - } else { - selection[ijet] = 0; - removedIndices.push_back(ijet); } } iEvent.put(std::move(jets)); } +void HiSignalGenJetProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.setComment("Selects genJets from collision id = 0"); + desc.add<std::string>("src", "ak4HiGenJets"); + descriptions.add("HiSignalGenJetProducer", desc); +} + DEFINE_FWK_MODULE(HiSignalGenJetProducer); diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc index c007cc802048b..2fb650b5bb076 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc @@ -20,7 +20,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -30,13 +30,9 @@ #include "DataFormats/Common/interface/View.h" #include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/GeometryVector/interface/VectorUtil.h" #include "DataFormats/HepMCCandidate/interface/GenParticle.h" #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" -#include "DataFormats/Math/interface/Point3D.h" -#include "DataFormats/Math/interface/LorentzVector.h" - using namespace std; using namespace edm; @@ -44,13 +40,15 @@ using namespace edm; // class decleration // -class HiSignalParticleProducer : public edm::EDProducer { +class HiSignalParticleProducer : public edm::global::EDProducer<> { public: explicit HiSignalParticleProducer(const edm::ParameterSet&); - ~HiSignalParticleProducer() override; + ~HiSignalParticleProducer() override = default; + + static void fillDescriptions(edm::ConfigurationDescriptions&); private: - void produce(edm::Event&, const edm::EventSetup&) override; + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; // ----------member data --------------------------- edm::EDGetTokenT<edm::View<reco::GenParticle> > genParticleSrc_; @@ -74,18 +72,13 @@ HiSignalParticleProducer::HiSignalParticleProducer(const edm::ParameterSet& iCon produces<reco::GenParticleCollection>().setBranchAlias(alias); } -HiSignalParticleProducer::~HiSignalParticleProducer() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} - // // member functions // // ------------ method called to produce the data ------------ -void HiSignalParticleProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { +void HiSignalParticleProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { using namespace edm; using namespace reco; @@ -96,27 +89,21 @@ void HiSignalParticleProducer::produce(edm::Event& iEvent, const edm::EventSetup int genParticleSize = genParticles->size(); - vector<int> selection; - selection.reserve(genParticleSize); - for (int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle) { - selection.push_back(-1); - } - - vector<int> selectedIndices; - vector<int> removedIndices; - for (int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle) { const GenParticle* genParticle = &((*genParticles)[igenParticle]); if (genParticle->collisionId() == 0) { signalGenParticles->push_back(*genParticle); - selection[igenParticle] = 1; - } else { - selection[igenParticle] = 0; - removedIndices.push_back(igenParticle); } } iEvent.put(std::move(signalGenParticles)); } +void HiSignalParticleProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.setComment("Selects genParticles from collision id = 0"); + desc.add<std::string>("src", "genParticles"); + descriptions.add("HiSignalParticleProducer", desc); +} + DEFINE_FWK_MODULE(HiSignalParticleProducer); diff --git a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc index 23272547d3b4a..67e50e70c6026 100644 --- a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc +++ b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc @@ -36,7 +36,6 @@ namespace { } // namespace SubEventGenJetProducer::SubEventGenJetProducer(edm::ParameterSet const& conf) : VirtualJetProducer(conf) { - // mapSrc_ = conf.getParameter<edm::InputTag>( "srcMap"); ignoreHydro_ = conf.getUntrackedParameter<bool>("ignoreHydro", true); // the subjet collections are set through the config file in the "jetCollInstanceName" field. From 026246283c3affa741af82830047ed8fa69840ad Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Tue, 13 Oct 2020 13:52:45 +0200 Subject: [PATCH 520/778] remove unneeded memory include --- RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc index 67e50e70c6026..4289753cf43ce 100644 --- a/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc +++ b/RecoJets/JetProducers/plugins/SubEventGenJetProducer.cc @@ -2,8 +2,6 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "RecoJets/JetProducers/plugins/SubEventGenJetProducer.h" -#include <memory> - #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Utilities/interface/isFinite.h" #include "RecoJets/JetProducers/interface/JetSpecific.h" From 41834a90dfac62d8db06e1bcd4df9d93b0501cb1 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Tue, 13 Oct 2020 14:45:23 +0200 Subject: [PATCH 521/778] misunderstood review comment, now it should be better --- RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc index 0c2d0b3f34004..b3f6fd285c103 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc @@ -47,9 +47,7 @@ void HGCalCLUEAlgoT<T>::populate(const HGCRecHitCollection& hits) { thickness_index = maxNumberOfThickIndices_; double storedThreshold = thresholds_[layerOnSide][thickness_index]; - if (detid.subdetId() == HGCEE) { - storedThreshold = thresholds_[layerOnSide][thickness_index]; - } else if (detid.subdetId() == HGCHEF) { + if ( detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF ) { storedThreshold = thresholds_[layerOnSide][thickness_index + deltasi_index_regemfac_]; } sigmaNoise = v_sigmaNoise_[layerOnSide][thickness_index]; From 43ddba27eed3bec82555228b488da73a38919a51 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 13 Oct 2020 14:50:43 +0200 Subject: [PATCH 522/778] Changes in view of changed scenario numbering --- .../HGCalValidation/test/HGCalWaferStudy.cc | 23 +++++-- .../test/python/protoHGCalSimWatcher_cfg.py | 24 ++++---- .../test/python/protoSimValid_cfg.py | 36 +++++------ .../test/python/protoValid_cfg.py | 60 +++++++++---------- .../test/python/runHFNoseDigiStudy_cfg.py | 10 ++-- .../test/python/runHFNoseRecHitStudy_cfg.py | 10 ++-- .../test/python/runHFNoseSimHitStudy_cfg.py | 8 +-- .../test/python/runHGCGeomCheck_cfg.py | 24 +++----- .../test/python/runHGCHitAnalyzer_cfg.py | 24 +++----- .../test/python/runHGCalDigiStudy_cfg.py | 6 +- .../test/python/runHGCalHitCalibration_cfg.py | 6 +- .../test/python/runHGCalRecHitStudy_cfg.py | 6 +- .../test/python/runHGCalSimHitStudy_cfg.py | 6 +- .../test/python/runHGCalWaferHitCheck_cfg.py | 4 +- .../test/python/runHGCalWaferStudy_cfg.py | 24 +++----- .../test/python/testHFNoseSimHitStudy_cfg.py | 8 +-- .../test/python/testHGCalBHValid_cfg.py | 6 +- .../test/python/testHGCalSimHitStudy_cfg.py | 22 ++----- .../test/python/testHGCalSimWatcherV12_cfg.py | 4 +- .../test/python/testHGCalSimWatcherV13_cfg.py | 4 +- .../test/python/testHGCalSimWatcherV14_cfg.py | 4 +- 21 files changed, 145 insertions(+), 174 deletions(-) diff --git a/Validation/HGCalValidation/test/HGCalWaferStudy.cc b/Validation/HGCalValidation/test/HGCalWaferStudy.cc index 3b0db58ebfe7a..31a4d2aefaa95 100644 --- a/Validation/HGCalValidation/test/HGCalWaferStudy.cc +++ b/Validation/HGCalValidation/test/HGCalWaferStudy.cc @@ -25,6 +25,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/Utilities/interface/transform.h" #include "FWCore/Utilities/interface/InputTag.h" #include "Geometry/HcalCommonData/interface/HcalHitRelabeller.h" @@ -65,6 +66,8 @@ class HGCalWaferStudy : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::on // ----------member data --------------------------- const std::vector<std::string> nameDetectors_, caloHitSources_; const std::vector<edm::InputTag> digiSources_; + const std::vector<edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord>> ddTokens_; + const std::vector<edm::ESGetToken<HGCalGeometry, IdealGeometryRecord>> geomTokens_; const int verbosity_, nBinHit_, nBinDig_; const double xyMinHit_, xyMaxHit_; const double xyMinDig_, xyMaxDig_; @@ -87,6 +90,16 @@ HGCalWaferStudy::HGCalWaferStudy(const edm::ParameterSet& iConfig) : nameDetectors_(iConfig.getParameter<std::vector<std::string> >("detectorNames")), caloHitSources_(iConfig.getParameter<std::vector<std::string> >("caloHitSources")), digiSources_(iConfig.getParameter<std::vector<edm::InputTag> >("digiSources")), + ddTokens_{ + edm::vector_transform(nameDetectors_, + [this](const std::string& name) { + return esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}); + })}, + geomTokens_{ + edm::vector_transform(nameDetectors_, + [this](const std::string& name) { + return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}); + })}, verbosity_(iConfig.getUntrackedParameter<int>("verbosity", 0)), nBinHit_(iConfig.getUntrackedParameter<int>("nBinHit", 600)), nBinDig_(iConfig.getUntrackedParameter<int>("nBinDig", 600)), @@ -246,9 +259,8 @@ void HGCalWaferStudy::analyze(const edm::Event& iEvent, const edm::EventSetup& i // ------------ method called when starting to processes a run ------------ void HGCalWaferStudy::beginRun(const edm::Run&, const edm::EventSetup& iSetup) { for (unsigned int k = 0; k < nameDetectors_.size(); ++k) { - edm::ESHandle<HGCalDDDConstants> pHGDC; - iSetup.get<IdealGeometryRecord>().get(nameDetectors_[k], pHGDC); - hgcons_.emplace_back(&(*pHGDC)); + const auto& pHGDC = iSetup.getData(ddTokens_[k]); + hgcons_.emplace_back(&pHGDC); layerSim_.emplace_back(hgcons_.back()->layers(false)); layerDig_.emplace_back(hgcons_.back()->layers(true)); layerFront_.emplace_back(hgcons_.back()->firstLayer()); @@ -257,9 +269,8 @@ void HGCalWaferStudy::beginRun(const edm::Run&, const edm::EventSetup& iSetup) { layerMxSim_[k] = std::min((layerFront_[k] + layerSim_[k] - 1), layerMxSim_[k]); layerMxDig_[k] = std::min((layerFront_[k] + layerDig_[k] - 1), layerMxDig_[k]); - edm::ESHandle<HGCalGeometry> geom; - iSetup.get<IdealGeometryRecord>().get(nameDetectors_[k], geom); - hgeoms_.emplace_back(geom.product()); + const auto& geom = iSetup.getData(geomTokens_[k]); + hgeoms_.emplace_back(&geom); if (verbosity_ > 0) edm::LogVerbatim("HGCalValidation") << nameDetectors_[k] << " defined with " << layerFront_[k] << ":" << layerSim_[k] << ":" << layerDig_[k] diff --git a/Validation/HGCalValidation/test/python/protoHGCalSimWatcher_cfg.py b/Validation/HGCalValidation/test/python/protoHGCalSimWatcher_cfg.py index f82355bc07b5f..3e99e2e1fe9aa 100644 --- a/Validation/HGCalValidation/test/python/protoHGCalSimWatcher_cfg.py +++ b/Validation/HGCalValidation/test/python/protoHGCalSimWatcher_cfg.py @@ -1,8 +1,8 @@ ############################################################################### # Way to use this: -# cmsRun protoVHGCalSimWatcher_cfg.py geometry=D62 +# cmsRun protoVHGCalSimWatcher_cfg.py geometry=D71 # -# Options for geometry D49, D58, D59, D62 +# Options for geometry D49, D68, D70, D71 # ############################################################################### import FWCore.ParameterSet.Config as cms @@ -13,10 +13,10 @@ ### SETUP OPTIONS options = VarParsing.VarParsing('standard') options.register('geometry', - "D62", + "D71", VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, - "geometry of operations: D49, D58, D59, D62") + "geometry of operations: D49, D68, D70, D71") ### get and parse the command line arguments options.parseArguments() @@ -31,21 +31,21 @@ process = cms.Process('PROD',Phase2C9) process.load('Configuration.Geometry.GeometryExtended2026D49_cff') process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') -elif (options.geometry == "D58"): +elif (options.geometry == "D68"): from Configuration.Eras.Era_Phase2C12_cff import Phase2C12 process = cms.Process('PROD',Phase2C12) - process.load('Configuration.Geometry.GeometryExtended2026D58_cff') - process.load('Configuration.Geometry.GeometryExtended2026D58Reco_cff') -elif (options.geometry == "D59"): + process.load('Configuration.Geometry.GeometryExtended2026D68_cff') + process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') +elif (options.geometry == "D70"): from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('PROD',Phase2C11) - process.load('Configuration.Geometry.GeometryExtended2026D59_cff') - process.load('Configuration.Geometry.GeometryExtended2026D59Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D70_cff') + process.load('Configuration.Geometry.GeometryExtended2026D70Reco_cff') else: from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('PROD',Phase2C11) - process.load('Configuration.Geometry.GeometryExtended2026D62_cff') - process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D71_cff') + process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') diff --git a/Validation/HGCalValidation/test/python/protoSimValid_cfg.py b/Validation/HGCalValidation/test/python/protoSimValid_cfg.py index 6bb5a9866f6bc..5a0b0ce5fc9da 100644 --- a/Validation/HGCalValidation/test/python/protoSimValid_cfg.py +++ b/Validation/HGCalValidation/test/python/protoSimValid_cfg.py @@ -1,8 +1,8 @@ ############################################################################### # Way to use this: -# cmsRun protoSimValid_cfg.py geometry=D62 type=hgcalBHValidation +# cmsRun protoSimValid_cfg.py geometry=D71 type=hgcalBHValidation # -# Options for geometry D49, D58, D59, D62 +# Options for geometry D49, D68, D70, D71 # type hgcalBHValidation, hgcalSiliconValidation # ############################################################################### @@ -14,10 +14,10 @@ ### SETUP OPTIONS options = VarParsing.VarParsing('standard') options.register('geometry', - "D62", + "D71", VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, - "geometry of operations: D49, D58, D59, D62") + "geometry of operations: D49, D68, D70, D71") options.register ('type', "hgcalBHValidation", VarParsing.VarParsing.multiplicity.singleton, @@ -41,33 +41,33 @@ fileName = 'hgcSilValidD49.root' else: fileName = 'hgcBHValidD49.root' -elif (options.geometry == "D58"): +elif (options.geometry == "D68"): from Configuration.Eras.Era_Phase2C12_cff import Phase2C12 process = cms.Process('PROD',Phase2C12) - process.load('Configuration.Geometry.GeometryExtended2026D58_cff') - process.load('Configuration.Geometry.GeometryExtended2026D58Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D68_cff') + process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') if (options.type == "hgcalSiliconValidation"): - fileName = 'hgcSilValidD58.root' + fileName = 'hgcSilValidD68.root' else: - fileName = 'hgcBHValidD58.root' -elif (options.geometry == "D59"): + fileName = 'hgcBHValidD68.root' +elif (options.geometry == "D70"): from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('PROD',Phase2C11) - process.load('Configuration.Geometry.GeometryExtended2026D59_cff') - process.load('Configuration.Geometry.GeometryExtended2026D59Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D70_cff') + process.load('Configuration.Geometry.GeometryExtended2026D70Reco_cff') if (options.type == "hgcalSiliconValidation"): - fileName = 'hgcSilValidD59.root' + fileName = 'hgcSilValidD70.root' else: - fileName = 'hgcBHValidD59.root' + fileName = 'hgcBHValidD70.root' else: from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('PROD',Phase2C11) - process.load('Configuration.Geometry.GeometryExtended2026D62_cff') - process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D71_cff') + process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') if (options.type == "hgcalSiliconValidation"): - fileName = 'hgcSilValidD62.root' + fileName = 'hgcSilValidD71.root' else: - fileName = 'hgcBHValidD62.root' + fileName = 'hgcBHValidD71.root' # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') diff --git a/Validation/HGCalValidation/test/python/protoValid_cfg.py b/Validation/HGCalValidation/test/python/protoValid_cfg.py index f4684ca279134..5945a34d5f62d 100644 --- a/Validation/HGCalValidation/test/python/protoValid_cfg.py +++ b/Validation/HGCalValidation/test/python/protoValid_cfg.py @@ -1,8 +1,8 @@ ############################################################################### # Way to use this: -# cmsRun protoValid_cfg.py geometry=D62 type=hgcalSimHitStudy defaultInput=1 +# cmsRun protoValid_cfg.py geometry=D71 type=hgcalSimHitStudy defaultInput=1 # -# Options for geometry D49, D58, D59, D62 +# Options for geometry D49, D68, D70, D71 # type hgcalGeomCheck, hgcalSimHitStudy, hgcalDigiStudy, # hgcalRecHitStudy, hgcalSiliconValidation # defaultInput 1, 0 @@ -16,10 +16,10 @@ ### SETUP OPTIONS options = VarParsing.VarParsing('standard') options.register('geometry', - "D62", + "D71", VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, - "geometry of operations: D49, D58, D59, D62") + "geometry of operations: D49, D68, D70, D71") options.register('type', "hgcalGeomCheck", VarParsing.VarParsing.multiplicity.singleton, @@ -57,60 +57,60 @@ fileName = 'hgcSilValidD49.root' else: fileName = 'hgcGeomCheckD49.root' -elif (options.geometry == "D58"): +elif (options.geometry == "D68"): from Configuration.Eras.Era_Phase2C12_cff import Phase2C12 process = cms.Process('PROD',Phase2C12) - process.load('Configuration.Geometry.GeometryExtended2026D58_cff') - process.load('Configuration.Geometry.GeometryExtended2026D58Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D68_cff') + process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') if (options.type == "hgcalSimHitStudy"): - fileName = 'hgcSimHitD58.root' + fileName = 'hgcSimHitD68.root' elif (options.type == "hgcalDigiStudy"): - fileName = 'hgcDigiD58.root' + fileName = 'hgcDigiD68.root' elif (options.type == "hgcalRecHitStudy"): - fileName = 'hgcRecHitD58.root' + fileName = 'hgcRecHitD68.root' elif (options.type == "hgcalSiliconValidation"): if (options.defaultInput == 0): - fileName = 'hgcDigValidD58.root' + fileName = 'hgcDigValidD68.root' else: - fileName = 'hgcSilValidD58.root' + fileName = 'hgcSilValidD68.root' else: - fileName = 'hgcGeomCheckD58.root' -elif (options.geometry == "D59"): + fileName = 'hgcGeomCheckD68.root' +elif (options.geometry == "D70"): from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('PROD',Phase2C11) - process.load('Configuration.Geometry.GeometryExtended2026D59_cff') - process.load('Configuration.Geometry.GeometryExtended2026D59Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D70_cff') + process.load('Configuration.Geometry.GeometryExtended2026D70Reco_cff') if (options.type == "hgcalSimHitStudy"): - fileName = 'hgcSimHitD59.root' + fileName = 'hgcSimHitD70.root' elif (options.type == "hgcalDigiStudy"): - fileName = 'hgcDigiD59.root' + fileName = 'hgcDigiD70.root' elif (options.type == "hgcalRecHitStudy"): - fileName = 'hgcRecHitD59.root' + fileName = 'hgcRecHitD70.root' elif (options.type == "hgcalSiliconValidation"): if (options.defaultInput == 0): - fileName = 'hgcDigValidD59.root' + fileName = 'hgcDigValidD70.root' else: - fileName = 'hgcSilValidD59.root' + fileName = 'hgcSilValidD70.root' else: - fileName = 'hgcGeomCheckD59.root' + fileName = 'hgcGeomCheckD70.root' else: from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('PROD',Phase2C11) - process.load('Configuration.Geometry.GeometryExtended2026D62_cff') - process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') + process.load('Configuration.Geometry.GeometryExtended2026D71_cff') + process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') if (options.type == "hgcalSimHitStudy"): - fileName = 'hgcSimHitD62.root' + fileName = 'hgcSimHitD71.root' elif (options.type == "hgcalDigiStudy"): - fileName = 'hgcDigiD62.root' + fileName = 'hgcDigiD71.root' elif (options.type == "hgcalRecHitStudy"): - fileName = 'hgcRecHitD62.root' + fileName = 'hgcRecHitD71.root' elif (options.type == "hgcalSiliconValidation"): if (options.defaultInput == 0): - fileName = 'hgcDigValidD62.root' + fileName = 'hgcDigValidD71.root' else: - fileName = 'hgcSilValidD62.root' + fileName = 'hgcSilValidD71.root' else: - fileName = 'hgcGeomCheckD62.root' + fileName = 'hgcGeomCheckD71.root' process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") diff --git a/Validation/HGCalValidation/test/python/runHFNoseDigiStudy_cfg.py b/Validation/HGCalValidation/test/python/runHFNoseDigiStudy_cfg.py index 7c37aa53fb115..5150c9fd5cad5 100644 --- a/Validation/HGCalValidation/test/python/runHFNoseDigiStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHFNoseDigiStudy_cfg.py @@ -1,11 +1,11 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Phase2C6_cff import Phase2C6 -process = cms.Process('PROD',Phase2C6) +from Configuration.Eras.Era_Phase2C10_cff import Phase2C10 +process = cms.Process('PROD',Phase2C10) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") -process.load('Configuration.Geometry.GeometryExtended2026D44_cff') -process.load('Configuration.Geometry.GeometryExtended2026D44Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D60_cff') +process.load('Configuration.Geometry.GeometryExtended2026D60Reco_cff') process.load("Configuration.StandardSequences.MagneticField_cff") process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.StandardSequences.RawToDigi_cff') @@ -29,7 +29,7 @@ ) process.TFileService = cms.Service("TFileService", - fileName = cms.string('hfnDigiD44tt.root'), + fileName = cms.string('hfnDigiD60tt.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHFNoseRecHitStudy_cfg.py b/Validation/HGCalValidation/test/python/runHFNoseRecHitStudy_cfg.py index 5a73bb92ccb85..996c06ba80fc3 100644 --- a/Validation/HGCalValidation/test/python/runHFNoseRecHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHFNoseRecHitStudy_cfg.py @@ -1,11 +1,11 @@ import FWCore.ParameterSet.Config as cms import FWCore.Utilities.FileUtils as FileUtils -from Configuration.Eras.Era_Phase2C6_cff import Phase2C6 -process = cms.Process('PROD',Phase2C6) +from Configuration.Eras.Era_Phase2C10_cff import Phase2C10 +process = cms.Process('PROD',Phase2C10) -process.load('Configuration.Geometry.GeometryExtended2026D44_cff') -process.load('Configuration.Geometry.GeometryExtended2026D44Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D60_cff') +process.load('Configuration.Geometry.GeometryExtended2026D60Reco_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Services_cff') @@ -33,7 +33,7 @@ process.load('Validation.HGCalValidation.hfnoseRecHitStudy_cfi') process.TFileService = cms.Service("TFileService", - fileName = cms.string('hfnRecHitD44tt.root'), + fileName = cms.string('hfnRecHitD60tt.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHFNoseSimHitStudy_cfg.py b/Validation/HGCalValidation/test/python/runHFNoseSimHitStudy_cfg.py index 877a6d7d76881..2b3a3bc0c765f 100644 --- a/Validation/HGCalValidation/test/python/runHFNoseSimHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHFNoseSimHitStudy_cfg.py @@ -1,11 +1,11 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Phase2C6_cff import Phase2C6 -process = cms.Process('PROD',Phase2C6) +from Configuration.Eras.Era_Phase2C10_cff import Phase2C10 +process = cms.Process('PROD',Phase2C10) process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") -process.load('Configuration.Geometry.GeometryExtended2026D44_cff') +process.load('Configuration.Geometry.GeometryExtended2026D60_cff') process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load('FWCore.MessageService.MessageLogger_cfi') @@ -28,7 +28,7 @@ ) process.TFileService = cms.Service("TFileService", - fileName = cms.string('hfnSimHitD44tt.root'), + fileName = cms.string('hfnSimHitD60tt.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHGCGeomCheck_cfg.py b/Validation/HGCalValidation/test/python/runHGCGeomCheck_cfg.py index c7ffdf76f95f8..b4e879d28c357 100644 --- a/Validation/HGCalValidation/test/python/runHGCGeomCheck_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCGeomCheck_cfg.py @@ -1,15 +1,5 @@ import FWCore.ParameterSet.Config as cms -#from Configuration.Eras.Era_Phase2C4_cff import Phase2C4 -#process = cms.Process('HGCGeomAnalysis',Phase2C4) -#process.load('Configuration.Geometry.GeometryExtended2026D35_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D35Reco_cff') - -#from Configuration.Eras.Era_Phase2C8_cff import Phase2C8 -#process = cms.Process('HGCGeomAnalysis',Phase2C8) -#process.load('Configuration.Geometry.GeometryExtended2026D41_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff') - #from Configuration.Eras.Era_Phase2C9_cff import Phase2C9 #process = cms.Process('HGCGeomAnalysis',Phase2C9) #process.load('Configuration.Geometry.GeometryExtended2026D49_cff') @@ -17,18 +7,18 @@ #from Configuration.Eras.Era_Phase2C12_cff import Phase2C12 #process = cms.Process('HGCGeomAnalysis',Phase2C12) -#process.load('Configuration.Geometry.GeometryExtended2026D58_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D58Reco_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D68_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') #from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 #process = cms.Process('HGCGeomAnalysis',Phase2C11) -#process.load('Configuration.Geometry.GeometryExtended2026D59_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D59Reco_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D70_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D70Reco_cff') from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') @@ -54,7 +44,7 @@ process.load('Validation.HGCalValidation.hgcGeomCheck_cff') process.TFileService = cms.Service("TFileService", - fileName = cms.string('hgcGeomCheckD62.root'), + fileName = cms.string('hgcGeomCheckD71.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHGCHitAnalyzer_cfg.py b/Validation/HGCalValidation/test/python/runHGCHitAnalyzer_cfg.py index ed70cb7edb144..d659c1fa6b08f 100644 --- a/Validation/HGCalValidation/test/python/runHGCHitAnalyzer_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCHitAnalyzer_cfg.py @@ -1,15 +1,5 @@ import FWCore.ParameterSet.Config as cms -#from Configuration.Eras.Era_Phase2C4_cff import Phase2C4 -#process = cms.Process('HGCGeomAnalysis',Phase2C4) -#process.load('Configuration.Geometry.GeometryExtended2026D35_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D35Reco_cff') - -#from Configuration.Eras.Era_Phase2C8_cff import Phase2C8 -#process = cms.Process('HGCGeomAnalysis',Phase2C8) -#process.load('Configuration.Geometry.GeometryExtended2026D41_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff') - #from Configuration.Eras.Era_Phase2C9_cff import Phase2C9 #process = cms.Process('HGCGeomAnalysis',Phase2C9) #process.load('Configuration.Geometry.GeometryExtended2026D49_cff') @@ -17,18 +7,18 @@ #from Configuration.Eras.Era_Phase2C12_cff import Phase2C12 #process = cms.Process('HGCGeomAnalysis',Phase2C12) -#process.load('Configuration.Geometry.GeometryExtended2026D58_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D58Reco_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D68_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') #from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 #process = cms.Process('HGCGeomAnalysis',Phase2C11) -#process.load('Configuration.Geometry.GeometryExtended2026D59_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D59Reco_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D70_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D70Reco_cff') from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') @@ -56,7 +46,7 @@ process.load('Validation.HGCalValidation.hgcHitValidation_cfi') process.TFileService = cms.Service("TFileService", - fileName = cms.string('relValTTbarD62.root'), + fileName = cms.string('relValTTbarD71.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHGCalDigiStudy_cfg.py b/Validation/HGCalValidation/test/python/runHGCalDigiStudy_cfg.py index f1608a3b08923..0668df1c56b71 100644 --- a/Validation/HGCalValidation/test/python/runHGCalDigiStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalDigiStudy_cfg.py @@ -2,8 +2,8 @@ from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") @@ -28,7 +28,7 @@ ) process.TFileService = cms.Service("TFileService", - fileName = cms.string('hgcDigiD62tt.root'), + fileName = cms.string('hgcDigiD71tt.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHGCalHitCalibration_cfg.py b/Validation/HGCalValidation/test/python/runHGCalHitCalibration_cfg.py index ed5749ad85ea3..63ec432841df2 100644 --- a/Validation/HGCalValidation/test/python/runHGCalHitCalibration_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalHitCalibration_cfg.py @@ -3,8 +3,8 @@ from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') @@ -36,7 +36,7 @@ process.load('Validation.HGCalValidation.hgcalHitCalibration_cfi') process.TFileService = cms.Service("TFileService", - fileName = cms.string('relValD62.root'), + fileName = cms.string('relValD71.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHGCalRecHitStudy_cfg.py b/Validation/HGCalValidation/test/python/runHGCalRecHitStudy_cfg.py index 657d1a0394187..8e46b0c640f04 100644 --- a/Validation/HGCalValidation/test/python/runHGCalRecHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalRecHitStudy_cfg.py @@ -3,8 +3,8 @@ from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load('Configuration.StandardSequences.MagneticField_cff') @@ -31,7 +31,7 @@ process.load('Validation.HGCalValidation.hgcalRecHitStudy_cff') process.TFileService = cms.Service("TFileService", - fileName = cms.string('hgcRecHitD62tt.root'), + fileName = cms.string('hgcRecHitD71tt.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHGCalSimHitStudy_cfg.py b/Validation/HGCalValidation/test/python/runHGCalSimHitStudy_cfg.py index 7e95c09da09d1..64334d565a7ae 100644 --- a/Validation/HGCalValidation/test/python/runHGCalSimHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalSimHitStudy_cfg.py @@ -2,8 +2,8 @@ from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") @@ -23,7 +23,7 @@ ) process.TFileService = cms.Service("TFileService", - fileName = cms.string('hgcSimHitD62tt.root'), + fileName = cms.string('hgcSimHitD71tt.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/runHGCalWaferHitCheck_cfg.py b/Validation/HGCalValidation/test/python/runHGCalWaferHitCheck_cfg.py index bfd342f5a5593..e4e1f599f92bf 100644 --- a/Validation/HGCalValidation/test/python/runHGCalWaferHitCheck_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalWaferHitCheck_cfg.py @@ -2,8 +2,8 @@ from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") diff --git a/Validation/HGCalValidation/test/python/runHGCalWaferStudy_cfg.py b/Validation/HGCalValidation/test/python/runHGCalWaferStudy_cfg.py index 1d48a1734f8ff..f0f7681fd9c3a 100644 --- a/Validation/HGCalValidation/test/python/runHGCalWaferStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/runHGCalWaferStudy_cfg.py @@ -1,15 +1,5 @@ import FWCore.ParameterSet.Config as cms -#from Configuration.Eras.Era_Phase2C4_cff import Phase2C4 -#process = cms.Process('HGCGeomAnalysis',Phase2C4) -#process.load('Configuration.Geometry.GeometryExtended2026D35_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D35Reco_cff') - -#from Configuration.Eras.Era_Phase2C8_cff import Phase2C8 -#process = cms.Process('HGCGeomAnalysis',Phase2C8) -#process.load('Configuration.Geometry.GeometryExtended2026D41_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff') - #from Configuration.Eras.Era_Phase2C9_cff import Phase2C9 #process = cms.Process('HGCGeomAnalysis',Phase2C9) #process.load('Configuration.Geometry.GeometryExtended2026D49_cff') @@ -17,18 +7,18 @@ #from Configuration.Eras.Era_Phase2C12_cff import Phase2C12 #process = cms.Process('HGCGeomAnalysis',Phase2C12) -#process.load('Configuration.Geometry.GeometryExtended2026D58_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D58Reco_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D68_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') #from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 #process = cms.Process('HGCGeomAnalysis',Phase2C11) -#process.load('Configuration.Geometry.GeometryExtended2026D59_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D59Reco_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D70_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D70Reco_cff') from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") @@ -53,7 +43,7 @@ ) process.TFileService = cms.Service("TFileService", - fileName = cms.string('hgcWaferD62.root'), + fileName = cms.string('hgcWaferD71.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/testHFNoseSimHitStudy_cfg.py b/Validation/HGCalValidation/test/python/testHFNoseSimHitStudy_cfg.py index ca16933e46adf..06996384d367e 100644 --- a/Validation/HGCalValidation/test/python/testHFNoseSimHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/testHFNoseSimHitStudy_cfg.py @@ -1,8 +1,8 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Phase2C6_cff import Phase2C6 +from Configuration.Eras.Era_Phase2C10_cff import Phase2C10 -process = cms.Process('SIM',Phase2C6) +process = cms.Process('SIM',Phase2C10) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -10,8 +10,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2026D44Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2026D44_cff') +process.load('Configuration.Geometry.GeometryExtended2026D60Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D60_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedHLLHC14TeV_cfi') diff --git a/Validation/HGCalValidation/test/python/testHGCalBHValid_cfg.py b/Validation/HGCalValidation/test/python/testHGCalBHValid_cfg.py index f9cef70d08b26..463cf843cf16a 100644 --- a/Validation/HGCalValidation/test/python/testHGCalBHValid_cfg.py +++ b/Validation/HGCalValidation/test/python/testHGCalBHValid_cfg.py @@ -2,8 +2,8 @@ from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -56,7 +56,7 @@ process.load('Validation.HGCalValidation.hgcalBHValidation_cfi') process.TFileService = cms.Service("TFileService", - fileName = cms.string('hgcBHValidD62.root'), + fileName = cms.string('hgcBHValidD71.root'), closeFileFast = cms.untracked.bool(True) ) diff --git a/Validation/HGCalValidation/test/python/testHGCalSimHitStudy_cfg.py b/Validation/HGCalValidation/test/python/testHGCalSimHitStudy_cfg.py index 53b07f14cff4e..5ac84502f93bb 100644 --- a/Validation/HGCalValidation/test/python/testHGCalSimHitStudy_cfg.py +++ b/Validation/HGCalValidation/test/python/testHGCalSimHitStudy_cfg.py @@ -1,15 +1,5 @@ import FWCore.ParameterSet.Config as cms -#from Configuration.Eras.Era_Phase2C4_cff import Phase2C4 -#process = cms.Process('HGCGeomAnalysis',Phase2C4) -#process.load('Configuration.Geometry.GeometryExtended2026D35_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D35Reco_cff') - -#from Configuration.Eras.Era_Phase2C8_cff import Phase2C8 -#process = cms.Process('HGCGeomAnalysis',Phase2C8) -#process.load('Configuration.Geometry.GeometryExtended2026D41_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff') - #from Configuration.Eras.Era_Phase2C9_cff import Phase2C9 #process = cms.Process('HGCGeomAnalysis',Phase2C9) #process.load('Configuration.Geometry.GeometryExtended2026D49_cff') @@ -17,18 +7,18 @@ #from Configuration.Eras.Era_Phase2C12_cff import Phase2C12 #process = cms.Process('HGCGeomAnalysis',Phase2C12) -#process.load('Configuration.Geometry.GeometryExtended2026D58_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D58Reco_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D68_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') #from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 #process = cms.Process('HGCGeomAnalysis',Phase2C11) -#process.load('Configuration.Geometry.GeometryExtended2026D59_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D59Reco_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D70_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D70Reco_cff') from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 process = cms.Process('HGCGeomAnalysis',Phase2C11) -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") diff --git a/Validation/HGCalValidation/test/python/testHGCalSimWatcherV12_cfg.py b/Validation/HGCalValidation/test/python/testHGCalSimWatcherV12_cfg.py index 913a0780894be..93586d23b272a 100644 --- a/Validation/HGCalValidation/test/python/testHGCalSimWatcherV12_cfg.py +++ b/Validation/HGCalValidation/test/python/testHGCalSimWatcherV12_cfg.py @@ -9,8 +9,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2026D58Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2026D58_cff') +process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D68_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi') diff --git a/Validation/HGCalValidation/test/python/testHGCalSimWatcherV13_cfg.py b/Validation/HGCalValidation/test/python/testHGCalSimWatcherV13_cfg.py index 7bdc859c5a3e0..5af486c6a07f0 100644 --- a/Validation/HGCalValidation/test/python/testHGCalSimWatcherV13_cfg.py +++ b/Validation/HGCalValidation/test/python/testHGCalSimWatcherV13_cfg.py @@ -9,8 +9,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2026D59Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2026D59_cff') +process.load('Configuration.Geometry.GeometryExtended2026D70Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D70_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi') diff --git a/Validation/HGCalValidation/test/python/testHGCalSimWatcherV14_cfg.py b/Validation/HGCalValidation/test/python/testHGCalSimWatcherV14_cfg.py index 0c2a7db304b26..99fc245985e7b 100644 --- a/Validation/HGCalValidation/test/python/testHGCalSimWatcherV14_cfg.py +++ b/Validation/HGCalValidation/test/python/testHGCalSimWatcherV14_cfg.py @@ -9,8 +9,8 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryExtended2026D62Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2026D62_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic50ns13TeVCollision_cfi') From bcd15772113f3661a23bfd470be9d313619eddbd Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Tue, 13 Oct 2020 14:55:08 +0200 Subject: [PATCH 523/778] code format check --- RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc index b3f6fd285c103..ee7aeacbf1781 100644 --- a/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc +++ b/RecoLocalCalo/HGCalRecProducers/plugins/HGCalCLUEAlgo.cc @@ -47,7 +47,7 @@ void HGCalCLUEAlgoT<T>::populate(const HGCRecHitCollection& hits) { thickness_index = maxNumberOfThickIndices_; double storedThreshold = thresholds_[layerOnSide][thickness_index]; - if ( detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF ) { + if (detid.det() == DetId::HGCalHSi || detid.subdetId() == HGCHEF) { storedThreshold = thresholds_[layerOnSide][thickness_index + deltasi_index_regemfac_]; } sigmaNoise = v_sigmaNoise_[layerOnSide][thickness_index]; From db32170d852b73e182dd2aeee3ff910f8735158b Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Tue, 13 Oct 2020 15:15:00 +0200 Subject: [PATCH 524/778] Update validation plugins for the new ETL geometry --- .../plugins/EtlDigiHitsValidation.cc | 245 +++++++++---- .../plugins/EtlLocalRecoValidation.cc | 328 +++++++++++++----- .../plugins/EtlSimHitsValidation.cc | 252 +++++++++----- .../plugins/MtdGlobalRecoHarvester.cc | 229 +++++++++--- .../plugins/MtdGlobalRecoValidation.cc | 131 +++++-- 5 files changed, 858 insertions(+), 327 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc index f045f04ac5d0f..02d1d5d77a287 100644 --- a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc @@ -28,6 +28,8 @@ #include "Geometry/Records/interface/MTDDigiGeometryRecord.h" #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" +#include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h" +#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h" class EtlDigiHitsValidation : public DQMEDAnalyzer { public: @@ -49,24 +51,24 @@ class EtlDigiHitsValidation : public DQMEDAnalyzer { // --- histograms declaration - MonitorElement* meNhits_[2]; + MonitorElement* meNhits_[4]; - MonitorElement* meHitCharge_[2]; - MonitorElement* meHitTime_[2]; + MonitorElement* meHitCharge_[4]; + MonitorElement* meHitTime_[4]; - MonitorElement* meOccupancy_[2]; + MonitorElement* meOccupancy_[4]; - MonitorElement* meHitX_[2]; - MonitorElement* meHitY_[2]; - MonitorElement* meHitZ_[2]; - MonitorElement* meHitPhi_[2]; - MonitorElement* meHitEta_[2]; + MonitorElement* meHitX_[4]; + MonitorElement* meHitY_[4]; + MonitorElement* meHitZ_[4]; + MonitorElement* meHitPhi_[4]; + MonitorElement* meHitEta_[4]; - MonitorElement* meHitTvsQ_[2]; - MonitorElement* meHitQvsPhi_[2]; - MonitorElement* meHitQvsEta_[2]; - MonitorElement* meHitTvsPhi_[2]; - MonitorElement* meHitTvsEta_[2]; + MonitorElement* meHitTvsQ_[4]; + MonitorElement* meHitQvsPhi_[4]; + MonitorElement* meHitQvsEta_[4]; + MonitorElement* meHitTvsPhi_[4]; + MonitorElement* meHitTvsEta_[4]; }; // ------------ constructor and destructor -------------- @@ -81,24 +83,31 @@ EtlDigiHitsValidation::~EtlDigiHitsValidation() {} void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; + edm::ESHandle<MTDTopology> topologyHandle; + iSetup.get<MTDTopologyRcd>().get(topologyHandle); + const MTDTopology* topology = topologyHandle.product(); + + bool topo1Dis = false; + bool topo2Dis = false; + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo1Dis = true; + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo2Dis = true; + edm::ESHandle<MTDGeometry> geometryHandle; iSetup.get<MTDDigiGeometryRecord>().get(geometryHandle); const MTDGeometry* geom = geometryHandle.product(); auto etlDigiHitsHandle = makeValid(iEvent.getHandle(etlDigiHitsToken_)); - // --- Loop over the ELT DIGI hits + // --- Loop over the ETL DIGI hits - unsigned int n_digi_etl[2] = {0, 0}; + unsigned int n_digi_etl[4] = {0, 0, 0, 0}; for (const auto& dataFrame : *etlDigiHitsHandle) { // --- Get the on-time sample int isample = 2; const auto& sample = dataFrame.sample(isample); - ETLDetId detId = dataFrame.id(); - DetId geoId = detId.geographicalId(); const MTDGeomDet* thedet = geom->idToDet(geoId); @@ -112,7 +121,31 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe // --- Fill the histograms - int idet = (detId.zside() + 1) / 2; + int idet = 999; + + if (topo1Dis) { + if (detId.zside() == -1) { + idet = 0; + } else if (detId.zside() == 1) { + idet = 2; + } else { + continue; + } + } + + if (topo2Dis) { + if ((detId.zside() == -1) && (detId.nDisc() == 1)) { + idet = 0; + } else if ((detId.zside() == -1) && (detId.nDisc() == 2)) { + idet = 1; + } else if ((detId.zside() == 1) && (detId.nDisc() == 1)) { + idet = 2; + } else if ((detId.zside() == 1) && (detId.nDisc() == 2)) { + idet = 3; + } else { + continue; + } + } meHitCharge_[idet]->Fill(sample.data()); meHitTime_[idet]->Fill(sample.toa()); @@ -134,8 +167,16 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe } // dataFrame loop - meNhits_[0]->Fill(n_digi_etl[0]); - meNhits_[1]->Fill(n_digi_etl[1]); + if (topo1Dis) { + meNhits_[0]->Fill(n_digi_etl[0]); + meNhits_[2]->Fill(n_digi_etl[2]); + } + + if (topo2Dis) { + for (int i=0; i<4; i++) { + meNhits_[i]->Fill(n_digi_etl[i]); + } + } } // ------------ method for histogram booking ------------ @@ -146,24 +187,46 @@ void EtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook, // --- histograms booking - meNhits_[0] = ibook.book1D("EtlNhitsZneg", "Number of ETL DIGI hits (-Z);N_{DIGI}", 100, 0., 5000.); - meNhits_[1] = ibook.book1D("EtlNhitsZpos", "Number of ETL DIGI hits (+Z);N_{DIGI}", 100, 0., 5000.); - - meHitCharge_[0] = ibook.book1D("EtlHitChargeZneg", "ETL DIGI hits charge (-Z);Q_{DIGI} [ADC counts]", 100, 0., 256.); - meHitCharge_[1] = ibook.book1D("EtlHitChargeZpos", "ETL DIGI hits charge (+Z);Q_{DIGI} [ADC counts]", 100, 0., 256.); - meHitTime_[0] = ibook.book1D("EtlHitTimeZneg", "ETL DIGI hits ToA (-Z);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); - meHitTime_[1] = ibook.book1D("EtlHitTimeZpos", "ETL DIGI hits ToA (+Z);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); - - meOccupancy_[0] = ibook.book2D("EtlOccupancyZneg", - "ETL DIGI hits occupancy (-Z);X_{DIGI} [cm];Y_{DIGI} [cm]", + meNhits_[0] = ibook.book1D("EtlNhitsZnegD1", "Number of ETL DIGI hits (-Z, Single(topo1D)/First(topo2D) disk);log_{10}(N_{DIGI})", 100, 0., 5000.); + meNhits_[1] = ibook.book1D("EtlNhitsZnegD2", "Number of ETL DIGI hits (-Z, Second disk);log_{10}(N_{DIGI})", 100, 0., 5000.); + meNhits_[2] = ibook.book1D("EtlNhitsZposD1", "Number of ETL DIGI hits (+Z, Single(topo1D)/First(topo2D) disk);log_{10}(N_{DIGI})", 100, 0., 5000.); + meNhits_[3] = ibook.book1D("EtlNhitsZposD2", "Number of ETL DIGI hits (+Z, Second disk);log_{10}(N_{DIGI})", 100, 0., 5000.); + + meHitCharge_[0] = ibook.book1D("EtlHitChargeZnegD1", "ETL DIGI hits charge (-Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); + meHitCharge_[1] = ibook.book1D("EtlHitChargeZnegD2", "ETL DIGI hits charge (-Z, Second disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); + meHitCharge_[2] = ibook.book1D("EtlHitChargeZposD1", "ETL DIGI hits charge (+Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); + meHitCharge_[3] = ibook.book1D("EtlHitChargeZposD2", "ETL DIGI hits charge (+Z, Second disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); + meHitTime_[0] = ibook.book1D("EtlHitTimeZnegD1", "ETL DIGI hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); + meHitTime_[1] = ibook.book1D("EtlHitTimeZnegD2", "ETL DIGI hits ToA (-Z, Second disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); + meHitTime_[2] = ibook.book1D("EtlHitTimeZposD1", "ETL DIGI hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); + meHitTime_[3] = ibook.book1D("EtlHitTimeZposD2", "ETL DIGI hits ToA (+Z, Second disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); + + meOccupancy_[0] = ibook.book2D("EtlOccupancyZnegD1", + "ETL DIGI hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm];Y_{DIGI} [cm]", 135, -135., 135., 135, -135., 135.); - meOccupancy_[1] = ibook.book2D("EtlOccupancyZpos", - "ETL DIGI hits occupancy (+Z);X_{DIGI} [cm];Y_{DIGI} [cm]", + meOccupancy_[1] = ibook.book2D("EtlOccupancyZnegD2", + "ETL DIGI hits occupancy (-Z, Second disk);X_{DIGI} [cm];Y_{DIGI} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); + meOccupancy_[2] = ibook.book2D("EtlOccupancyZposD1", + "ETL DIGI hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm];Y_{DIGI} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); + meOccupancy_[3] = ibook.book2D("EtlOccupancyZposD2", + "ETL DIGI hits occupancy (+Z, Second disk);X_{DIGI} [cm];Y_{DIGI} [cm]", 135, -135., 135., @@ -171,68 +234,128 @@ void EtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook, -135., 135.); - meHitX_[0] = ibook.book1D("EtlHitXZneg", "ETL DIGI hits X (-Z);X_{DIGI} [cm]", 100, -130., 130.); - meHitX_[1] = ibook.book1D("EtlHitXZpos", "ETL DIGI hits X (+Z);X_{DIGI} [cm]", 100, -130., 130.); - meHitY_[0] = ibook.book1D("EtlHitYZneg", "ETL DIGI hits Y (-Z);Y_{DIGI} [cm]", 100, -130., 130.); - meHitY_[1] = ibook.book1D("EtlHitYZpos", "ETL DIGI hits Y (+Z);Y_{DIGI} [cm]", 100, -130., 130.); - meHitZ_[0] = ibook.book1D("EtlHitZZneg", "ETL DIGI hits Z (-Z);Z_{DIGI} [cm]", 100, -304.2, -303.4); - meHitZ_[1] = ibook.book1D("EtlHitZZpos", "ETL DIGI hits Z (+Z);Z_{DIGI} [cm]", 100, 303.4, 304.2); - - meHitPhi_[0] = ibook.book1D("EtlHitPhiZneg", "ETL DIGI hits #phi (-Z);#phi_{DIGI} [rad]", 100, -3.15, 3.15); - meHitPhi_[1] = ibook.book1D("EtlHitPhiZpos", "ETL DIGI hits #phi (+Z);#phi_{DIGI} [rad]", 100, -3.15, 3.15); - meHitEta_[0] = ibook.book1D("EtlHitEtaZneg", "ETL DIGI hits #eta (-Z);#eta_{DIGI}", 100, -3.2, -1.56); - meHitEta_[1] = ibook.book1D("EtlHitEtaZpos", "ETL DIGI hits #eta (+Z);#eta_{DIGI}", 100, 1.56, 3.2); - - meHitTvsQ_[0] = ibook.bookProfile("EtlHitTvsQZneg", - "ETL DIGI ToA vs charge (-Z);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", + meHitX_[0] = ibook.book1D("EtlHitXZnegD1", "ETL DIGI hits X (-Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm]", 100, -130., 130.); + meHitX_[1] = ibook.book1D("EtlHitXZnegD2", "ETL DIGI hits X (-Z, Second disk);X_{DIGI} [cm]", 100, -130., 130.); + meHitX_[2] = ibook.book1D("EtlHitXZposD1", "ETL DIGI hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm]", 100, -130., 130.); + meHitX_[3] = ibook.book1D("EtlHitXZposD2", "ETL DIGI hits X (+Z, Second disk);X_{DIGI} [cm]", 100, -130., 130.); + meHitY_[0] = ibook.book1D("EtlHitYZnegD1", "ETL DIGI hits Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{DIGI} [cm]", 100, -130., 130.); + meHitY_[1] = ibook.book1D("EtlHitYZnegD2", "ETL DIGI hits Y (-Z, Second disk);Y_{DIGI} [cm]", 100, -130., 130.); + meHitY_[2] = ibook.book1D("EtlHitYZposD1", "ETL DIGI hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{DIGI} [cm]", 100, -130., 130.); + meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL DIGI hits Y (+Z, Second disk);Y_{DIGI} [cm]", 100, -130., 130.); + meHitZ_[0] = ibook.book1D("EtlHitZZnegD1", "ETL DIGI hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, -310, -301); + meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL DIGI hits Z (-Z, Second disk);Z_{DIGI} [cm]", 100, -310, -301); + meHitZ_[2] = ibook.book1D("EtlHitZZposD1", "ETL DIGI hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, 301, 310); + meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL DIGI hits Z (+Z, Second disk);Z_{DIGI} [cm]", 100, 301, 310); + + meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1", "ETL DIGI hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); + meHitPhi_[1] = ibook.book1D("EtlHitPhiZnegD2", "ETL DIGI hits #phi (-Z, Second disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); + meHitPhi_[2] = ibook.book1D("EtlHitPhiZposD1", "ETL DIGI hits #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); + meHitPhi_[3] = ibook.book1D("EtlHitPhiZposD2", "ETL DIGI hits #phi (+Z, Second disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); + meHitEta_[0] = ibook.book1D("EtlHitEtaZnegD1", "ETL DIGI hits #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI}", 100, -3.2, -1.56); + meHitEta_[1] = ibook.book1D("EtlHitEtaZnegD2", "ETL DIGI hits #eta (-Z, Second disk);#eta_{DIGI}", 100, -3.2, -1.56); + meHitEta_[2] = ibook.book1D("EtlHitEtaZposD1", "ETL DIGI hits #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI}", 100, 1.56, 3.2); + meHitEta_[3] = ibook.book1D("EtlHitEtaZposD2", "ETL DIGI hits #eta (+Z, Second disk);#eta_{DIGI}", 100, 1.56, 3.2); + + meHitTvsQ_[0] = ibook.bookProfile("EtlHitTvsQZnegD1", + "ETL DIGI ToA vs charge (-Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", + 50, + 0., + 256., + 0., + 1024.); + meHitTvsQ_[1] = ibook.bookProfile("EtlHitTvsQZnegD2", + "ETL DIGI ToA vs charge (-Z, Second Disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", 50, 0., 256., 0., 1024.); - meHitTvsQ_[1] = ibook.bookProfile("EtlHitTvsQZpos", - "ETL DIGI ToA vs charge (+Z);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", + meHitTvsQ_[2] = ibook.bookProfile("EtlHitTvsQZposD1", + "ETL DIGI ToA vs charge (+Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", 50, 0., 256., 0., 1024.); - meHitQvsPhi_[0] = ibook.bookProfile("EtlHitQvsPhiZneg", - "ETL DIGI charge vs #phi (-Z);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", + meHitTvsQ_[3] = ibook.bookProfile("EtlHitTvsQZposD2", + "ETL DIGI ToA vs charge (+Z, Second disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", + 50, + 0., + 256., + 0., + 1024.); + meHitQvsPhi_[0] = ibook.bookProfile("EtlHitQvsPhiZnegD1", + "ETL DIGI charge vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", 50, -3.15, 3.15, 0., 1024.); - meHitQvsPhi_[1] = ibook.bookProfile("EtlHitQvsPhiZpos", - "ETL DIGI charge vs #phi (+Z);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", + meHitQvsPhi_[1] = ibook.bookProfile("EtlHitQvsPhiZnegD2", + "ETL DIGI charge vs #phi (-Z, Second disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitQvsPhi_[2] = ibook.bookProfile("EtlHitQvsPhiZposD1", + "ETL DIGI charge vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitQvsPhi_[3] = ibook.bookProfile("EtlHitQvsPhiZpos", + "ETL DIGI charge vs #phi (+Z, Second disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", 50, -3.15, 3.15, 0., 1024.); meHitQvsEta_[0] = ibook.bookProfile( - "EtlHitQvsEtaZneg", "ETL DIGI charge vs #eta (-Z);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, -3.2, -1.56, 0., 1024.); + "EtlHitQvsEtaZnegD1", "ETL DIGI charge vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, -3.2, -1.56, 0., 1024.); meHitQvsEta_[1] = ibook.bookProfile( - "EtlHitQvsEtaZpos", "ETL DIGI charge vs #eta (+Z);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, 1.56, 3.2, 0., 1024.); - meHitTvsPhi_[0] = ibook.bookProfile("EtlHitTvsPhiZneg", - "ETL DIGI ToA vs #phi (-Z);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + "EtlHitQvsEtaZnegD2", "ETL DIGI charge vs #eta (-Z, Second disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, -3.2, -1.56, 0., 1024.); + meHitQvsEta_[2] = ibook.bookProfile( + "EtlHitQvsEtaZposD1", "ETL DIGI charge vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, 1.56, 3.2, 0., 1024.); + meHitQvsEta_[3] = ibook.bookProfile( + "EtlHitQvsEtaZposD2", "ETL DIGI charge vs #eta (+Z, Second disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, 1.56, 3.2, 0., 1024.); + meHitTvsPhi_[0] = ibook.bookProfile("EtlHitTvsPhiZnegD1", + "ETL DIGI ToA vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitTvsPhi_[1] = ibook.bookProfile("EtlHitTvsPhiZnegD2", + "ETL DIGI ToA vs #phi (-Z, Second disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitTvsPhi_[2] = ibook.bookProfile("EtlHitTvsPhiZposD1", + "ETL DIGI ToA vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", 50, -3.15, 3.15, 0., 1024.); - meHitTvsPhi_[1] = ibook.bookProfile("EtlHitTvsPhiZpos", - "ETL DIGI ToA vs #phi (+Z);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + meHitTvsPhi_[3] = ibook.bookProfile("EtlHitTvsPhiZposD2", + "ETL DIGI ToA vs #phi (+Z, Second disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", 50, -3.15, 3.15, 0., 1024.); meHitTvsEta_[0] = ibook.bookProfile( - "EtlHitTvsEtaZneg", "ETL DIGI ToA vs #eta (-Z);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, -3.2, -1.56, 0., 1024.); + "EtlHitTvsEtaZnegD1", "ETL DIGI ToA vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, -3.2, -1.56, 0., 1024.); meHitTvsEta_[1] = ibook.bookProfile( - "EtlHitTvsEtaZpos", "ETL DIGI ToA vs #eta (+Z);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, 1.56, 3.2, 0., 1024.); + "EtlHitTvsEtaZnegD2", "ETL DIGI ToA vs #eta (-Z, Second disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, -3.2, -1.56, 0., 1024.); + meHitTvsEta_[2] = ibook.bookProfile( + "EtlHitTvsEtaZposD1", "ETL DIGI ToA vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, 1.56, 3.2, 0., 1024.); + meHitTvsEta_[3] = ibook.bookProfile( + "EtlHitTvsEtaZposD2", "ETL DIGI ToA vs #eta (+Z, Second disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, 1.56, 3.2, 0., 1024.); } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ diff --git a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc index 46b8038188253..885389e1d659c 100644 --- a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc @@ -29,6 +29,8 @@ #include "Geometry/Records/interface/MTDDigiGeometryRecord.h" #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" +#include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h" +#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h" class EtlLocalRecoValidation : public DQMEDAnalyzer { public: @@ -45,44 +47,46 @@ class EtlLocalRecoValidation : public DQMEDAnalyzer { // ------------ member data ------------ const std::string folder_; - const float hitMinEnergy_; + const float hitMinEnergy1Dis_; + const float hitMinEnergy2Dis_; edm::EDGetTokenT<FTLRecHitCollection> etlRecHitsToken_; edm::EDGetTokenT<FTLClusterCollection> etlRecCluToken_; // --- histograms declaration + + MonitorElement* meNhits_[4]; + MonitorElement* meHitEnergy_[4]; + MonitorElement* meHitTime_[4]; + + MonitorElement* meOccupancy_[4]; + + MonitorElement* meHitX_[4]; + MonitorElement* meHitY_[4]; + MonitorElement* meHitZ_[4]; + MonitorElement* meHitPhi_[4]; + MonitorElement* meHitEta_[4]; + + MonitorElement* meHitTvsE_[4]; + MonitorElement* meHitEvsPhi_[4]; + MonitorElement* meHitEvsEta_[4]; + MonitorElement* meHitTvsPhi_[4]; + MonitorElement* meHitTvsEta_[4]; + + MonitorElement* meCluTime_[4]; + MonitorElement* meCluEnergy_[4]; + MonitorElement* meCluPhi_[4]; + MonitorElement* meCluEta_[4]; + MonitorElement* meCluHits_[4]; + MonitorElement* meCluOccupancy_[4]; - MonitorElement* meNhits_[2]; - - MonitorElement* meHitEnergy_[2]; - MonitorElement* meHitTime_[2]; - - MonitorElement* meOccupancy_[2]; - - MonitorElement* meHitX_[2]; - MonitorElement* meHitY_[2]; - MonitorElement* meHitZ_[2]; - MonitorElement* meHitPhi_[2]; - MonitorElement* meHitEta_[2]; - - MonitorElement* meHitTvsE_[2]; - MonitorElement* meHitEvsPhi_[2]; - MonitorElement* meHitEvsEta_[2]; - MonitorElement* meHitTvsPhi_[2]; - MonitorElement* meHitTvsEta_[2]; - - MonitorElement* meCluTime_[2]; - MonitorElement* meCluEnergy_[2]; - MonitorElement* meCluPhi_[2]; - MonitorElement* meCluEta_[2]; - MonitorElement* meCluHits_[2]; - MonitorElement* meCluOccupancy_[2]; }; // ------------ constructor and destructor -------------- EtlLocalRecoValidation::EtlLocalRecoValidation(const edm::ParameterSet& iConfig) : folder_(iConfig.getParameter<std::string>("folder")), - hitMinEnergy_(iConfig.getParameter<double>("hitMinimumEnergy")) { + hitMinEnergy1Dis_(iConfig.getParameter<double>("hitMinimumEnergy1Dis")), + hitMinEnergy2Dis_(iConfig.getParameter<double>("hitMinimumEnergy2Dis")) { etlRecHitsToken_ = consumes<FTLRecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitsTag")); etlRecCluToken_ = consumes<FTLClusterCollection>(iConfig.getParameter<edm::InputTag>("recCluTag")); } @@ -92,7 +96,16 @@ EtlLocalRecoValidation::~EtlLocalRecoValidation() {} // ------------ method called for each event ------------ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; - + using namespace std; + edm::ESHandle<MTDTopology> topologyHandle; + iSetup.get<MTDTopologyRcd>().get(topologyHandle); + const MTDTopology* topology = topologyHandle.product(); + + bool topo1Dis = false; + bool topo2Dis = false; + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo1Dis = true; + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo2Dis = true; + edm::ESHandle<MTDGeometry> geometryHandle; iSetup.get<MTDDigiGeometryRecord>().get(geometryHandle); const MTDGeometry* geom = geometryHandle.product(); @@ -102,12 +115,12 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS // --- Loop over the ELT RECO hits - unsigned int n_reco_etl[2] = {0, 0}; - + unsigned int n_reco_etl[4]; for (const auto& recHit : *etlRecHitsHandle) { - ETLDetId detId = recHit.id(); + ETLDetId detId = recHit.id(); DetId geoId = detId.geographicalId(); + std::cout << "ETl Det Id: " << detId << std::endl; const MTDGeomDet* thedet = geom->idToDet(geoId); if (thedet == nullptr) throw cms::Exception("EtlLocalRecoValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " (" @@ -117,21 +130,43 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS Local3DPoint local_point(topo.localX(recHit.row()), topo.localY(recHit.column()), 0.); const auto& global_point = thedet->toGlobal(local_point); - // --- Fill the histograms + int idet = 999; - int idet = (detId.zside() + 1) / 2; + if (topo1Dis) { + if (detId.zside() == -1) { + idet = 0; + } else if (detId.zside() == 1) { + idet = 2; + } else { + continue; + } + } + if (topo2Dis) { + if ((detId.zside() == -1) && (detId.nDisc() == 1)) { + idet = 0; + } else if ((detId.zside() == -1) && (detId.nDisc() == 2)) { + idet = 1; + } else if ((detId.zside() == 1) && (detId.nDisc() == 1)) { + idet = 2; + } else if ((detId.zside() == 1) && (detId.nDisc() == 2)) { + idet = 3; + } else { + continue; + } + } + + // --- Fill the histograms + meHitEnergy_[idet]->Fill(recHit.energy()); meHitTime_[idet]->Fill(recHit.time()); meOccupancy_[idet]->Fill(global_point.x(), global_point.y()); - meHitX_[idet]->Fill(global_point.x()); meHitY_[idet]->Fill(global_point.y()); meHitZ_[idet]->Fill(global_point.z()); meHitPhi_[idet]->Fill(global_point.phi()); meHitEta_[idet]->Fill(global_point.eta()); - meHitTvsE_[idet]->Fill(recHit.energy(), recHit.time()); meHitEvsPhi_[idet]->Fill(global_point.phi(), recHit.energy()); meHitEvsEta_[idet]->Fill(global_point.eta(), recHit.energy()); @@ -139,17 +174,32 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS meHitTvsEta_[idet]->Fill(global_point.eta(), recHit.time()); n_reco_etl[idet]++; - } // recHit loop - meNhits_[0]->Fill(n_reco_etl[0]); - meNhits_[1]->Fill(n_reco_etl[1]); + if (topo1Dis) { + meNhits_[0]->Fill(n_reco_etl[0]); + meNhits_[2]->Fill(n_reco_etl[2]); + } + + if (topo2Dis) { + for (int i=0; i<4; i++) { + meNhits_[i]->Fill(n_reco_etl[i]); + } + } // --- Loop over the ETL RECO clusters --- + int i; for (const auto& DetSetClu : *etlRecCluHandle) { + i++; for (const auto& cluster : DetSetClu) { - if (cluster.energy() < hitMinEnergy_) - continue; + if (topo1Dis) { + if (cluster.energy() < hitMinEnergy1Dis_) + continue; + } + if (topo2Dis) { + if (cluster.energy() < hitMinEnergy2Dis_) + continue; + } ETLDetId cluId = cluster.id(); DetId detIdObject(cluId); const auto& genericDet = geom->idToDetUnit(detIdObject); @@ -158,15 +208,36 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS << "GeographicalID: " << std::hex << cluId << " is invalid!" << std::dec << std::endl; } - //const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(genericDet->topology()); - //const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology()); const PixelTopology& topo = static_cast<const PixelTopology&>(genericDet->topology()); Local3DPoint local_point(topo.localX(cluster.x()), topo.localY(cluster.y()), 0.); - //Local3DPoint local_point(topo.localX(cluster.x()), topo.localY(cluster.y()), 0.); const auto& global_point = genericDet->toGlobal(local_point); + + int idet=999; + + if (topo1Dis) { + if (cluId.zside() == -1) { + idet = 0; + } else if (cluId.zside() == 1) { + idet = 2; + } else { + continue; + } + } - int idet = (cluId.zside() + 1) / 2; + if (topo2Dis) { + if ((cluId.zside() == -1) && (cluId.nDisc() == 1)) { + idet = 0; + } else if ((cluId.zside() == -1) && (cluId.nDisc() == 2)) { + idet = 1; + } else if ((cluId.zside() == 1) && (cluId.nDisc() == 1)) { + idet = 2; + } else if ((cluId.zside() == 1) && (cluId.nDisc() == 2)) { + idet = 3; + } else { + continue; + } + } meCluEnergy_[idet]->Fill(cluster.energy()); meCluTime_[idet]->Fill(cluster.time()); @@ -186,25 +257,45 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, // --- histograms booking - meNhits_[0] = ibook.book1D("EtlNhitsZneg", "Number of ETL RECO hits (-Z);N_{RECO}", 100, 0., 5000.); - meNhits_[1] = ibook.book1D("EtlNhitsZpos", "Number of ETL RECO hits (+Z);N_{RECO}", 100, 0., 5000.); - - meHitEnergy_[0] = ibook.book1D("EtlHitEnergyZneg", "ETL RECO hits energy (-Z);E_{RECO} [MeV]", 100, 0., 3.); - meHitEnergy_[1] = ibook.book1D("EtlHitEnergyZpos", "ETL RECO hits energy (+Z);E_{RECO} [MeV]", 100, 0., 3.); - - meHitTime_[0] = ibook.book1D("EtlHitTimeZneg", "ETL RECO hits ToA (-Z);ToA_{RECO} [ns]", 100, 0., 25.); - meHitTime_[1] = ibook.book1D("EtlHitTimeZpos", "ETL RECO hits ToA (+Z);ToA_{RECO} [ns]", 100, 0., 25.); - - meOccupancy_[0] = ibook.book2D("EtlOccupancyZneg", - "ETL RECO hits occupancy (-Z);X_{RECO} [cm];Y_{RECO} [cm]", + meNhits_[0] = ibook.book1D("EtlNhitsZnegD1", "Number of ETL RECO hits (-Z, Single(topo1D)/First(topo2D) disk);N_{RECO}", 100, 0., 5000.); + meNhits_[1] = ibook.book1D("EtlNhitsZnegD2", "Number of ETL RECO hits (-Z, Second disk);N_{RECO}", 100, 0., 5000.); + meNhits_[2] = ibook.book1D("EtlNhitsZposD1", "Number of ETL RECO hits (+Z, Single(topo1D)/First(topo2D) disk);N_{RECO}", 100, 0., 5000.); + meNhits_[3] = ibook.book1D("EtlNhitsZposD2", "Number of ETL RECO hits (+Z, Second disk);N_{RECO}", 100, 0., 5000.); + meHitEnergy_[0] = ibook.book1D("EtlHitEnergyZnegD1", "ETL RECO hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{RECO} [MeV]", 100, 0., 3.); + meHitEnergy_[1] = ibook.book1D("EtlHitEnergyZnegD2", "ETL RECO hits energy (-Z, Second disk);E_{RECO} [MeV]", 100, 0., 3.); + meHitEnergy_[2] = ibook.book1D("EtlHitEnergyZposD1", "ETL RECO hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{RECO} [MeV]", 100, 0., 3.); + meHitEnergy_[3] = ibook.book1D("EtlHitEnergyZposD2", "ETL RECO hits energy (+Z, Second disk);E_{RECO} [MeV]", 100, 0., 3.); + meHitTime_[0] = ibook.book1D("EtlHitTimeZnegD1", "ETL RECO hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{RECO} [ns]", 100, 0., 25.); + meHitTime_[1] = ibook.book1D("EtlHitTimeZnegD2", "ETL RECO hits ToA (-Z, Second disk);ToA_{RECO} [ns]", 100, 0., 25.); + meHitTime_[2] = ibook.book1D("EtlHitTimeZposD1", "ETL RECO hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{RECO} [ns]", 100, 0., 25.); + meHitTime_[3] = ibook.book1D("EtlHitTimeZposD2", "ETL RECO hits ToA (+Z, Second disk);ToA_{RECO} [ns]", 100, 0., 25.); + + meOccupancy_[0] = ibook.book2D("EtlOccupancyZnegD1", + "ETL RECO hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{RECO} [cm];Y_{RECO} [cm]", 135, -135., 135., 135, -135., 135.); - meOccupancy_[1] = ibook.book2D("EtlOccupancyZpos", - "ETL DIGI hits occupancy (+Z);X_{RECO} [cm];Y_{RECO} [cm]", + meOccupancy_[1] = ibook.book2D("EtlOccupancyZnegD2", + "ETL RECO hits occupancy (-Z, Second disk);X_{RECO} [cm];Y_{RECO} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); + meOccupancy_[2] = ibook.book2D("EtlOccupancyZposD1", + "ETL RECO hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{RECO} [cm];Y_{RECO} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); + meOccupancy_[3] = ibook.book2D("EtlOccupancyZposD2", + "ETL RECO hits occupancy (+Z, Second disk);X_{RECO} [cm];Y_{RECO} [cm]", 135, -135., 135., @@ -212,52 +303,96 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, -135., 135.); - meHitX_[1] = ibook.book1D("EtlHitXZpos", "ETL RECO hits X (+Z);X_{RECO} [cm]", 100, -130., 130.); - meHitX_[0] = ibook.book1D("EtlHitXZneg", "ETL RECO hits X (-Z);X_{RECO} [cm]", 100, -130., 130.); - meHitY_[1] = ibook.book1D("EtlHitYZpos", "ETL RECO hits Y (+Z);Y_{RECO} [cm]", 100, -130., 130.); - meHitY_[0] = ibook.book1D("EtlHitYZneg", "ETL RECO hits Y (-Z);Y_{RECO} [cm]", 100, -130., 130.); - meHitZ_[1] = ibook.book1D("EtlHitZZpos", "ETL RECO hits Z (+Z);Z_{RECO} [cm]", 100, 303.4, 304.2); - meHitZ_[0] = ibook.book1D("EtlHitZZneg", "ETL RECO hits Z (-Z);Z_{RECO} [cm]", 100, -304.2, -303.4); - - meHitPhi_[1] = ibook.book1D("EtlHitPhiZpos", "ETL RECO hits #phi (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2); - meHitPhi_[0] = ibook.book1D("EtlHitPhiZneg", "ETL RECO hits #phi (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2); - meHitEta_[1] = ibook.book1D("EtlHitEtaZpos", "ETL RECO hits #eta (+Z);#eta_{RECO}", 100, 1.56, 3.2); - meHitEta_[0] = ibook.book1D("EtlHitEtaZneg", "ETL RECO hits #eta (-Z);#eta_{RECO}", 100, -3.2, -1.56); + meHitX_[0] = ibook.book1D("EtlHitXZnegD1", "ETL RECO hits X (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]", 100, -130., 130.); + meHitX_[1] = ibook.book1D("EtlHitXZnegD2", "ETL RECO hits X (-Z, Second Disk);X_{RECO} [cm]", 100, -130., 130.); + meHitX_[2] = ibook.book1D("EtlHitXZposD1", "ETL RECO hits X (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]", 100, -130., 130.); + meHitX_[3] = ibook.book1D("EtlHitXZposD2", "ETL RECO hits X (+Z, Second Disk);X_{RECO} [cm]", 100, -130., 130.); + meHitY_[0] = ibook.book1D("EtlHitYZnegD1", "ETL RECO hits Y (-Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.); + meHitY_[1] = ibook.book1D("EtlHitYZnegD2", "ETL RECO hits Y (-Z, Second Disk);Y_{RECO} [cm]", 100, -130., 130.); + meHitY_[2] = ibook.book1D("EtlHitYZposD1", "ETL RECO hits Y (+Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.); + meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL RECO hits Y (+Z, Second Disk);Y_{RECO} [cm]", 100, -130., 130.); + meHitZ_[0] = ibook.book1D("EtlHitZZnegD1", "ETL RECO hits Z (-Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, -304.2, -303.4); + meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL RECO hits Z (-Z, Second Disk);Z_{RECO} [cm]", 100, -304.2, -303.4); + meHitZ_[2] = ibook.book1D("EtlHitZZposD1", "ETL RECO hits Z (+Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, 303.4, 304.2); + meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL RECO hits Z (+Z, Second Disk);Z_{RECO} [cm]", 100, 303.4, 304.2); + meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1", "ETL RECO hits #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meHitPhi_[1] = ibook.book1D("EtlHitPhiZnegD2", "ETL RECO hits #phi (-Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meHitPhi_[2] = ibook.book1D("EtlHitPhiZposD1", "ETL RECO hits #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meHitPhi_[3] = ibook.book1D("EtlHitPhiZposD2", "ETL RECO hits #phi (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meHitEta_[0] = ibook.book1D("EtlHitEtaZnegD1", "ETL RECO hits #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.56); + meHitEta_[1] = ibook.book1D("EtlHitEtaZnegD2", "ETL RECO hits #eta (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.56); + meHitEta_[2] = ibook.book1D("EtlHitEtaZposD1", "ETL RECO hits #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.56, 3.2); + meHitEta_[3] = ibook.book1D("EtlHitEtaZposD2", "ETL RECO hits #eta (+Z, Second Disk);#eta_{RECO}", 100, 1.56, 3.2); - meHitTvsE_[1] = ibook.bookProfile( - "EtlHitTvsEZpos", "ETL RECO time vs energy (+Z);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); meHitTvsE_[0] = ibook.bookProfile( - "EtlHitTvsEZneg", "ETL RECO time vs energy (-Z);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); - meHitEvsPhi_[1] = ibook.bookProfile( - "EtlHitEvsPhiZpos", "ETL RECO energy vs #phi (+Z);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); + "EtlHitTvsEZnegD1", "ETL RECO time vs energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); + meHitTvsE_[1] = ibook.bookProfile( + "EtlHitTvsEZnegD2", "ETL RECO time vs energy (-Z, Second Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); + meHitTvsE_[2] = ibook.bookProfile( + "EtlHitTvsEZposD1", "ETL RECO time vs energy (+Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); + meHitTvsE_[3] = ibook.bookProfile( + "EtlHitTvsEZposD2", "ETL RECO time vs energy (+Z, Second Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); meHitEvsPhi_[0] = ibook.bookProfile( - "EtlHitEvsPhiZneg", "ETL RECO energy vs #phi (-Z);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); - meHitEvsEta_[1] = ibook.bookProfile( - "EtlHitEvsEtaZpos", "ETL RECO energy vs #eta (+Z);#eta_{RECO};E_{RECO} [MeV]", 50, 1.56, 3.2, 0., 100.); + "EtlHitEvsPhiZnegD1", "ETL RECO energy vs #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); + meHitEvsPhi_[1] = ibook.bookProfile( + "EtlHitEvsPhiZnegD2", "ETL RECO energy vs #phi (-Z, Second Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); + meHitEvsPhi_[2] = ibook.bookProfile( + "EtlHitEvsPhiZposD1", "ETL RECO energy vs #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); + meHitEvsPhi_[3] = ibook.bookProfile( + "EtlHitEvsPhiZposD2", "ETL RECO energy vs #phi (+Z, Second Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); meHitEvsEta_[0] = ibook.bookProfile( - "EtlHitEvsEtaZneg", "ETL RECO energy vs #eta (-Z);#eta_{RECO};E_{RECO} [MeV]", 50, -3.2, -1.56, 0., 100.); - meHitTvsPhi_[1] = ibook.bookProfile( - "EtlHitTvsPhiZpos", "ETL RECO time vs #phi (+Z);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); + "EtlHitEvsEtaZnegD1", "ETL RECO energy vs #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};E_{RECO} [MeV]", 50, -3.2, -1.56, 0., 100.); + meHitEvsEta_[1] = ibook.bookProfile( + "EtlHitEvsEtaZnegD2", "ETL RECO energy vs #eta (-Z, Second Disk);#eta_{RECO};E_{RECO} [MeV]", 50, -3.2, -1.56, 0., 100.); + meHitEvsEta_[2] = ibook.bookProfile( + "EtlHitEvsEtaZposD1", "ETL RECO energy vs #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};E_{RECO} [MeV]", 50, 1.56, 3.2, 0., 100.); + meHitEvsEta_[3] = ibook.bookProfile( + "EtlHitEvsEtaZposD2", "ETL RECO energy vs #eta (+Z, Second Disk);#eta_{RECO};E_{RECO} [MeV]", 50, 1.56, 3.2, 0., 100.); meHitTvsPhi_[0] = ibook.bookProfile( - "EtlHitTvsPhiZneg", "ETL RECO time vs #phi (-Z);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); - meHitTvsEta_[1] = ibook.bookProfile( - "EtlHitTvsEtaZpos", "ETL RECO time vs #eta (+Z);#eta_{RECO};ToA_{RECO} [ns]", 50, 1.56, 3.2, 0., 100.); + "EtlHitTvsPhiZnegD1", "ETL RECO time vs #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); + meHitTvsPhi_[1] = ibook.bookProfile( + "EtlHitTvsPhiZnegD2", "ETL RECO time vs #phi (-Z, Second Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); + meHitTvsPhi_[2] = ibook.bookProfile( + "EtlHitTvsPhiZposD1", "ETL RECO time vs #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); + meHitTvsPhi_[3] = ibook.bookProfile( + "EtlHitTvsPhiZposD2", "ETL RECO time vs #phi (+Z, Second Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); meHitTvsEta_[0] = ibook.bookProfile( - "EtlHitTvsEtaZneg", "ETL RECO time vs #eta (-Z);#eta_{RECO};ToA_{RECO} [ns]", 50, -3.2, -1.56, 0., 100.); - meCluTime_[0] = ibook.book1D("EtlCluTimeZneg", "ETL cluster ToA (-Z);ToA [ns]", 250, 0, 25); - meCluTime_[1] = ibook.book1D("EtlCluTimeZpos", "ETL cluster ToA (+Z);ToA [ns]", 250, 0, 25); - meCluEnergy_[0] = ibook.book1D("EtlCluEnergyZneg", "ETL cluster energy (-Z);E_{RECO} [MeV]", 100, 0, 10); - meCluEnergy_[1] = ibook.book1D("EtlCluEnergyZpos", "ETL cluster energy (+Z);E_{RECO} [MeV]", 100, 0, 10); - meCluPhi_[0] = ibook.book1D("EtlCluPhiZneg", "ETL cluster #phi (-Z);#phi_{RECO} [rad]", 126, -3.2, 3.2); - meCluPhi_[1] = ibook.book1D("EtlCluPhiZpos", "ETL cluster #phi (+Z);#phi_{RECO} [rad]", 126, -3.2, 3.2); - meCluEta_[0] = ibook.book1D("EtlCluEtaZneg", "ETL cluster #eta (-Z);#eta_{RECO}", 100, -3.2, -1.4); - meCluEta_[1] = ibook.book1D("EtlCluEtaZpos", "ETL cluster #eta (+Z);#eta_{RECO}", 100, 1.4, 3.2); - meCluHits_[0] = ibook.book1D("EtlCluHitNumberZneg", "ETL hits per cluster (-Z);Cluster size", 10, 0, 10); - meCluHits_[1] = ibook.book1D("EtlCluHitNumberZpos", "ETL hits per cluster (+Z);Cluster size", 10, 0, 10); + "EtlHitTvsEtaZnegD1", "ETL RECO time vs #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};ToA_{RECO} [ns]", 50, -3.2, -1.56, 0., 100.); + meHitTvsEta_[1] = ibook.bookProfile( + "EtlHitTvsEtaZnegD2", "ETL RECO time vs #eta (-Z, Second Disk);#eta_{RECO};ToA_{RECO} [ns]", 50, -3.2, -1.56, 0., 100.); + meHitTvsEta_[2] = ibook.bookProfile( + "EtlHitTvsEtaZposD1", "ETL RECO time vs #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};ToA_{RECO} [ns]", 50, 1.56, 3.2, 0., 100.); + meHitTvsEta_[3] = ibook.bookProfile( + "EtlHitTvsEtaZposD2", "ETL RECO time vs #eta (+Z, Second Disk);#eta_{RECO};ToA_{RECO} [ns]", 50, 1.56, 3.2, 0., 100.); + meCluTime_[0] = ibook.book1D("EtlCluTimeZnegD1", "ETL cluster ToA (-Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25); + meCluTime_[1] = ibook.book1D("EtlCluTimeZnegD2", "ETL cluster ToA (-Z, Second Disk);ToA [ns]", 250, 0, 25); + meCluTime_[2] = ibook.book1D("EtlCluTimeZposD1", "ETL cluster ToA (+Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25); + meCluTime_[3] = ibook.book1D("EtlCluTimeZposD2", "ETL cluster ToA (+Z, Second Disk);ToA [ns]", 250, 0, 25); + meCluEnergy_[0] = ibook.book1D("EtlCluEnergyZnegD1", "ETL cluster energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10); + meCluEnergy_[1] = ibook.book1D("EtlCluEnergyZnegD2", "ETL cluster energy (-Z, Second Disk);E_{RECO} [MeV]", 100, 0, 10); + meCluEnergy_[2] = ibook.book1D("EtlCluEnergyZposD1", "ETL cluster energy (+Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10); + meCluEnergy_[3] = ibook.book1D("EtlCluEnergyZposD2", "ETL cluster energy (+Z, Second Disk);E_{RECO} [MeV]", 100, 0, 10); + meCluPhi_[0] = ibook.book1D("EtlCluPhiZnegD1", "ETL cluster #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); + meCluPhi_[1] = ibook.book1D("EtlCluPhiZnegD2", "ETL cluster #phi (-Z, Second Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); + meCluPhi_[2] = ibook.book1D("EtlCluPhiZposD1", "ETL cluster #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); + meCluPhi_[3] = ibook.book1D("EtlCluPhiZposD2", "ETL cluster #phi (+Z, Second Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); + meCluEta_[0] = ibook.book1D("EtlCluEtaZnegD1", "ETL cluster #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.4); + meCluEta_[1] = ibook.book1D("EtlCluEtaZnegD2", "ETL cluster #eta (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.4); + meCluEta_[2] = ibook.book1D("EtlCluEtaZposD1", "ETL cluster #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.4, 3.2); + meCluEta_[3] = ibook.book1D("EtlCluEtaZposD2", "ETL cluster #eta (+Z, Second Disk);#eta_{RECO}", 100, 1.4, 3.2); + meCluHits_[0] = ibook.book1D("EtlCluHitNumberZnegD1", "ETL hits per cluster (-Z, Single(topo1D)/First(topo2D) Disk);Cluster size", 10, 0, 10); + meCluHits_[1] = ibook.book1D("EtlCluHitNumberZnegD2", "ETL hits per cluster (-Z, Second Disk);Cluster size", 10, 0, 10); + meCluHits_[2] = ibook.book1D("EtlCluHitNumberZposD1", "ETL hits per cluster (+Z, Single(topo1D)/First(topo2D) Disk);Cluster size", 10, 0, 10); + meCluHits_[3] = ibook.book1D("EtlCluHitNumberZposD2", "ETL hits per cluster (+Z, Second Disk);Cluster size", 10, 0, 10); meCluOccupancy_[0] = ibook.book2D( - "EtlOccupancyZneg", "ETL cluster X vs Y (-Z);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); + "EtlOccupancyZnegD1", "ETL cluster X vs Y (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); meCluOccupancy_[1] = ibook.book2D( - "EtlOccupancyZpos", "ETL cluster X vs Y (+Z);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); + "EtlOccupancyZnegD2", "ETL cluster X vs Y (-Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); + meCluOccupancy_[2] = ibook.book2D( + "EtlOccupancyZposD1", "ETL cluster X vs Y (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); + meCluOccupancy_[3] = ibook.book2D( + "EtlOccupancyZposD2", "ETL cluster X vs Y (+Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); + } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ @@ -267,7 +402,8 @@ void EtlLocalRecoValidation::fillDescriptions(edm::ConfigurationDescriptions& de desc.add<std::string>("folder", "MTD/ETL/LocalReco"); desc.add<edm::InputTag>("recHitsTag", edm::InputTag("mtdRecHits", "FTLEndcap")); desc.add<edm::InputTag>("recCluTag", edm::InputTag("mtdClusters", "FTLEndcap")); - desc.add<double>("hitMinimumEnergy", 1.); // [MeV] + desc.add<double>("hitMinimumEnergy1Dis", 0.01); // [MeV] + desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV] descriptions.add("etlLocalReco", desc); } diff --git a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc index e52f55d4e8ebd..1827eeb8f3acb 100644 --- a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc @@ -31,6 +31,8 @@ #include "Geometry/Records/interface/MTDDigiGeometryRecord.h" #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h" +#include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h" +#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h" struct MTDHit { float energy; @@ -55,41 +57,43 @@ class EtlSimHitsValidation : public DQMEDAnalyzer { // ------------ member data ------------ const std::string folder_; - const float hitMinEnergy_; + const float hitMinEnergy1Dis_; + const float hitMinEnergy2Dis_; edm::EDGetTokenT<CrossingFrame<PSimHit> > etlSimHitsToken_; // --- histograms declaration - MonitorElement* meNhits_[2]; - MonitorElement* meNtrkPerCell_[2]; + MonitorElement* meNhits_[4]; + MonitorElement* meNtrkPerCell_[4]; - MonitorElement* meHitEnergy_[2]; - MonitorElement* meHitTime_[2]; + MonitorElement* meHitEnergy_[4]; + MonitorElement* meHitTime_[4]; - MonitorElement* meHitXlocal_[2]; - MonitorElement* meHitYlocal_[2]; - MonitorElement* meHitZlocal_[2]; + MonitorElement* meHitXlocal_[4]; + MonitorElement* meHitYlocal_[4]; + MonitorElement* meHitZlocal_[4]; - MonitorElement* meOccupancy_[2]; + MonitorElement* meOccupancy_[4]; - MonitorElement* meHitX_[2]; - MonitorElement* meHitY_[2]; - MonitorElement* meHitZ_[2]; - MonitorElement* meHitPhi_[2]; - MonitorElement* meHitEta_[2]; + MonitorElement* meHitX_[4]; + MonitorElement* meHitY_[4]; + MonitorElement* meHitZ_[4]; + MonitorElement* meHitPhi_[4]; + MonitorElement* meHitEta_[4]; - MonitorElement* meHitTvsE_[2]; - MonitorElement* meHitEvsPhi_[2]; - MonitorElement* meHitEvsEta_[2]; - MonitorElement* meHitTvsPhi_[2]; - MonitorElement* meHitTvsEta_[2]; + MonitorElement* meHitTvsE_[4]; + MonitorElement* meHitEvsPhi_[4]; + MonitorElement* meHitEvsEta_[4]; + MonitorElement* meHitTvsPhi_[4]; + MonitorElement* meHitTvsEta_[4]; }; // ------------ constructor and destructor -------------- EtlSimHitsValidation::EtlSimHitsValidation(const edm::ParameterSet& iConfig) : folder_(iConfig.getParameter<std::string>("folder")), - hitMinEnergy_(iConfig.getParameter<double>("hitMinimumEnergy")) { + hitMinEnergy1Dis_(iConfig.getParameter<double>("hitMinimumEnergy1Dis")), + hitMinEnergy2Dis_(iConfig.getParameter<double>("hitMinimumEnergy2Dis")) { etlSimHitsToken_ = consumes<CrossingFrame<PSimHit> >(iConfig.getParameter<edm::InputTag>("inputTag")); } @@ -104,21 +108,54 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet iSetup.get<MTDDigiGeometryRecord>().get(geometryHandle); const MTDGeometry* geom = geometryHandle.product(); + edm::ESHandle<MTDTopology> topologyHandle; + iSetup.get<MTDTopologyRcd>().get(topologyHandle); + const MTDTopology* topology = topologyHandle.product(); + + bool topo1Dis = false; + bool topo2Dis = false; + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo1Dis = true; + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo2Dis = true; + auto etlSimHitsHandle = makeValid(iEvent.getHandle(etlSimHitsToken_)); MixCollection<PSimHit> etlSimHits(etlSimHitsHandle.product()); - std::unordered_map<uint32_t, MTDHit> m_etlHits[2]; - std::unordered_map<uint32_t, std::set<int> > m_etlTrkPerCell[2]; + std::unordered_map<uint32_t, MTDHit> m_etlHits[4]; + std::unordered_map<uint32_t, std::set<int> > m_etlTrkPerCell[4]; + + // --- Loop over the ETL SIM hits + + int idet = 999; - // --- Loop over the BLT SIM hits for (auto const& simHit : etlSimHits) { // --- Use only hits compatible with the in-time bunch-crossing if (simHit.tof() < 0 || simHit.tof() > 25.) continue; ETLDetId id = simHit.detUnitId(); + if (topo1Dis) { + if (id.zside() == -1) { + idet = 0; + } else if (id.zside() == 1) { + idet = 2; + } else { + continue; + } + } - int idet = (id.zside() + 1) / 2; + if (topo2Dis) { + if ((id.zside() == -1) && (id.nDisc() == 1)) { + idet = 0; + } else if ((id.zside() == -1) && (id.nDisc() == 2)) { + idet = 1; + } else if ((id.zside() == 1) && (id.nDisc() == 1)) { + idet = 2; + } else if ((id.zside() == 1) && (id.nDisc() == 2)) { + idet = 3; + } else { + continue; + } + } m_etlTrkPerCell[idet][id.rawId()].insert(simHit.trackId()); @@ -143,19 +180,25 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet // Histogram filling // ============================================================================== - for (int idet = 0; idet < 2; ++idet) { + for (int idet = 0; idet < 4; ++idet) { //two disks per side + if ( ((idet == 1) || (idet == 3)) && (topo1Dis == true) ) continue; meNhits_[idet]->Fill(m_etlHits[idet].size()); - for (auto const& hit : m_etlTrkPerCell[idet]) + for (auto const& hit : m_etlTrkPerCell[idet]) { meNtrkPerCell_[idet]->Fill((hit.second).size()); + } for (auto const& hit : m_etlHits[idet]) { - if ((hit.second).energy < hitMinEnergy_) - continue; - + if (topo1Dis) { + if ((hit.second).energy < hitMinEnergy1Dis_) + continue; + } + if (topo2Dis) { + if ((hit.second).energy < hitMinEnergy2Dis_) + continue; + } // --- Get the SIM hit global position ETLDetId detId(hit.first); - DetId geoId = detId.geographicalId(); const MTDGeomDet* thedet = geom->idToDet(geoId); if (thedet == nullptr) @@ -167,22 +210,17 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet const auto& global_point = thedet->toGlobal(local_point); // --- Fill the histograms - meHitEnergy_[idet]->Fill((hit.second).energy); meHitTime_[idet]->Fill((hit.second).time); - meHitXlocal_[idet]->Fill((hit.second).x); meHitYlocal_[idet]->Fill((hit.second).y); meHitZlocal_[idet]->Fill((hit.second).z); - meOccupancy_[idet]->Fill(global_point.x(), global_point.y()); - meHitX_[idet]->Fill(global_point.x()); meHitY_[idet]->Fill(global_point.y()); meHitZ_[idet]->Fill(global_point.z()); meHitPhi_[idet]->Fill(global_point.phi()); meHitEta_[idet]->Fill(global_point.eta()); - meHitTvsE_[idet]->Fill((hit.second).energy, (hit.second).time); meHitEvsPhi_[idet]->Fill(global_point.phi(), (hit.second).energy); meHitEvsEta_[idet]->Fill(global_point.eta(), (hit.second).energy); @@ -202,60 +240,109 @@ void EtlSimHitsValidation::bookHistograms(DQMStore::IBooker& ibook, // --- histograms booking - meNhits_[1] = ibook.book1D("EtlNhitsZpos", "Number of ETL cells with SIM hits (+Z);N_{ETL cells}", 100, 0., 5000.); - meNhits_[0] = ibook.book1D("EtlNhitsZneg", "Number of ETL cells with SIM hits (-Z);N_{ETL cells}", 100, 0., 5000.); - meNtrkPerCell_[1] = ibook.book1D("EtlNtrkPerCellZpos", "Number of tracks per ETL sensor (+Z);N_{trk}", 10, 0., 10.); - meNtrkPerCell_[0] = ibook.book1D("EtlNtrkPerCellZneg", "Number of tracks per ETL sensor (-Z);N_{trk}", 10, 0., 10.); + meNhits_[0] = ibook.book1D("EtlNhitsZnegD1", "Number of ETL cells with SIM hits (-Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}", 100, 0., 5000.); + meNhits_[1] = ibook.book1D("EtlNhitsZnegD2", "Number of ETL cells with SIM hits (-Z, Second disk);N_{ETL cells}", 100, 0., 5000.); + meNhits_[2] = ibook.book1D("EtlNhitsZposD1", "Number of ETL cells with SIM hits (+Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}", 100, 0., 5000.); + meNhits_[3] = ibook.book1D("EtlNhitsZposD2", "Number of ETL cells with SIM hits (+Z, Second Disk);N_{ETL cells}", 100, 0., 5000.); + meNtrkPerCell_[0] = ibook.book1D("EtlNtrkPerCellZnegD1", "Number of tracks per ETL sensor (-Z, Single(topo1D)/First(topo2D) disk);N_{trk}", 10, 0., 10.); + meNtrkPerCell_[1] = ibook.book1D("EtlNtrkPerCellZneg", "Number of tracks per ETL sensor (-Z, Second disk);N_{trk}", 10, 0., 10.); + meNtrkPerCell_[2] = ibook.book1D("EtlNtrkPerCellZpos", "Number of tracks per ETL sensor (+Z, Single(topo1D)/First(topo2D) disk);N_{trk}", 10, 0., 10.); + meNtrkPerCell_[3] = ibook.book1D("EtlNtrkPerCellZpos", "Number of tracks per ETL sensor (+Z, Second disk);N_{trk}", 10, 0., 10.); + + meHitEnergy_[0] = ibook.book1D("EtlHitEnergyZnegD1", "ETL SIM hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.); + meHitEnergy_[1] = ibook.book1D("EtlHitEnergyZnegD2", "ETL SIM hits energy (-Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.); + meHitEnergy_[2] = ibook.book1D("EtlHitEnergyZposD1", "ETL SIM hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.); + meHitEnergy_[3] = ibook.book1D("EtlHitEnergyZposD2", "ETL SIM hits energy (+Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.); + meHitTime_[0] = ibook.book1D("EtlHitTimeZnegD1", "ETL SIM hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.); + meHitTime_[1] = ibook.book1D("EtlHitTimeZnegD2", "ETL SIM hits ToA (-Z, Second disk);ToA_{SIM} [ns]", 100, 0., 25.); + meHitTime_[2] = ibook.book1D("EtlHitTimeZposD1", "ETL SIM hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.); + meHitTime_[3] = ibook.book1D("EtlHitTimeZposD2", "ETL SIM hits ToA (+Z, Second disk);ToA_{SIM} [ns]", 100, 0., 25.); + + meHitXlocal_[0] = ibook.book1D("EtlHitXlocalZnegD1", "ETL SIM local X (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); + meHitXlocal_[1] = ibook.book1D("EtlHitXlocalZnegD2", "ETL SIM local X (-Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); + meHitXlocal_[2] = ibook.book1D("EtlHitXlocalZposD1", "ETL SIM local X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); + meHitXlocal_[3] = ibook.book1D("EtlHitXlocalZposD2", "ETL SIM local X (+Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); + + meHitYlocal_[0] = ibook.book1D("EtlHitYlocalZnegD1", "ETL SIM local Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); + meHitYlocal_[1] = ibook.book1D("EtlHitYlocalZnegD2", "ETL SIM local Y (-Z, Second Disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); + meHitYlocal_[2] = ibook.book1D("EtlHitYlocalZposD1", "ETL SIM local Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); + meHitYlocal_[3] = ibook.book1D("EtlHitYlocalZposD2", "ETL SIM local Y (+Z, Second disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); + meHitZlocal_[0] = ibook.book1D("EtlHitZlocalZnegD1", "ETL SIM local Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); + meHitZlocal_[1] = ibook.book1D("EtlHitZlocalZnegD2", "ETL SIM local Z (-Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); + meHitZlocal_[2] = ibook.book1D("EtlHitZlocalZposD1", "ETL SIM local Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); + meHitZlocal_[3] = ibook.book1D("EtlHitZlocalZposD2", "ETL SIM local Z (+Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); - meHitEnergy_[1] = ibook.book1D("EtlHitEnergyZpos", "ETL SIM hits energy (+Z);E_{SIM} [MeV]", 100, 0., 3.); - meHitEnergy_[0] = ibook.book1D("EtlHitEnergyZneg", "ETL SIM hits energy (-Z);E_{SIM} [MeV]", 100, 0., 3.); - meHitTime_[1] = ibook.book1D("EtlHitTimeZpos", "ETL SIM hits ToA (+Z);ToA_{SIM} [ns]", 100, 0., 25.); - meHitTime_[0] = ibook.book1D("EtlHitTimeZneg", "ETL SIM hits ToA (-Z);ToA_{SIM} [ns]", 100, 0., 25.); - - meHitXlocal_[1] = ibook.book1D("EtlHitXlocalZpos", "ETL SIM local X (+Z);X_{SIM}^{LOC} [mm]", 100, -25., 25.); - meHitXlocal_[0] = ibook.book1D("EtlHitXlocalZneg", "ETL SIM local X (-Z);X_{SIM}^{LOC} [mm]", 100, -25., 25.); - meHitYlocal_[1] = ibook.book1D("EtlHitYlocalZpos", "ETL SIM local Y (+Z);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); - meHitYlocal_[0] = ibook.book1D("EtlHitYlocalZneg", "ETL SIM local Y (-Z);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); - meHitZlocal_[1] = ibook.book1D("EtlHitZlocalZpos", "ETL SIM local Z (+Z);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); - meHitZlocal_[0] = ibook.book1D("EtlHitZlocalZneg", "ETL SIM local Z (-Z);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); - - meOccupancy_[1] = ibook.book2D( - "EtlOccupancyZpos", "ETL SIM hits occupancy (+Z);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); meOccupancy_[0] = ibook.book2D( - "EtlOccupancyZneg", "ETL SIM hits occupancy (-Z);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); - - meHitX_[1] = ibook.book1D("EtlHitXZpos", "ETL SIM hits X (+Z);X_{SIM} [cm]", 100, -130., 130.); - meHitX_[0] = ibook.book1D("EtlHitXZneg", "ETL SIM hits X (-Z);X_{SIM} [cm]", 100, -130., 130.); - meHitY_[1] = ibook.book1D("EtlHitYZpos", "ETL SIM hits Y (+Z);Y_{SIM} [cm]", 100, -130., 130.); - meHitY_[0] = ibook.book1D("EtlHitYZneg", "ETL SIM hits Y (-Z);Y_{SIM} [cm]", 100, -130., 130.); - meHitZ_[1] = ibook.book1D("EtlHitZZpos", "ETL SIM hits Z (+Z);Z_{SIM} [cm]", 100, 303.4, 304.2); - meHitZ_[0] = ibook.book1D("EtlHitZZneg", "ETL SIM hits Z (-Z);Z_{SIM} [cm]", 100, -304.2, -303.4); - - meHitPhi_[1] = ibook.book1D("EtlHitPhiZpos", "ETL SIM hits #phi (+Z);#phi_{SIM} [rad]", 100, -3.15, 3.15); - meHitPhi_[0] = ibook.book1D("EtlHitPhiZneg", "ETL SIM hits #phi (-Z);#phi_{SIM} [rad]", 100, -3.15, 3.15); - meHitEta_[1] = ibook.book1D("EtlHitEtaZpos", "ETL SIM hits #eta (+Z);#eta_{SIM}", 100, 1.56, 3.2); - meHitEta_[0] = ibook.book1D("EtlHitEtaZneg", "ETL SIM hits #eta (-Z);#eta_{SIM}", 100, -3.2, -1.56); + "EtlOccupancyZnegD1", "ETL SIM hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); + meOccupancy_[1] = ibook.book2D( + "EtlOccupancyZnegD2", "ETL SIM hits occupancy (-Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); + meOccupancy_[2] = ibook.book2D( + "EtlOccupancyZposD1", "ETL SIM hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); + meOccupancy_[3] = ibook.book2D( + "EtlOccupancyZposD2", "ETL SIM hits occupancy (+Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); + + meHitX_[0] = ibook.book1D("EtlHitXZnegD1", "ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.); + meHitX_[1] = ibook.book1D("EtlHitXZnegD2", "ETL SIM hits X (-Z, Second disk);X_{SIM} [cm]", 100, -130., 130.); + meHitX_[2] = ibook.book1D("EtlHitXZposD1", "ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.); + meHitX_[3] = ibook.book1D("EtlHitXZposD2", "ETL SIM hits X (+Z, Second disk);X_{SIM} [cm]", 100, -130., 130.); + meHitY_[0] = ibook.book1D("EtlHitYZnegD1", "ETL SIM hits Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.); + meHitY_[1] = ibook.book1D("EtlHitYZnegD2", "ETL SIM hits Y (-Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.); + meHitY_[2] = ibook.book1D("EtlHitYZposD1", "ETL SIM hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.); + meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL SIM hits Y (+Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.); + meHitZ_[0] = ibook.book1D("EtlHitZZnegD1", "ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -305, -301); + meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL SIM hits Z (-Z, Second disk);Z_{SIM} [cm]", 100, -305, -301); + meHitZ_[2] = ibook.book1D("EtlHitZZposD1", "ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 301, 305); + meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 301, 305); + + meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1", "ETL SIM hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); + meHitPhi_[1] = ibook.book1D("EtlHitPhiZnegD2", "ETL SIM hits #phi (-Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); + meHitPhi_[2] = ibook.book1D("EtlHitPhiZposD1", "ETL SIM hits #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); + meHitPhi_[3] = ibook.book1D("EtlHitPhiZposD2", "ETL SIM hits #phi (+Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); + meHitEta_[0] = ibook.book1D("EtlHitEtaZnegD1", "ETL SIM hits #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, -3.2, -1.56); + meHitEta_[1] = ibook.book1D("EtlHitEtaZnegD2", "ETL SIM hits #eta (-Z, Second disk);#eta_{SIM}", 100, -3.2, -1.56); + meHitEta_[2] = ibook.book1D("EtlHitEtaZposD1", "ETL SIM hits #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, 1.56, 3.2); + meHitEta_[3] = ibook.book1D("EtlHitEtaZposD2", "ETL SIM hits #eta (+Z, Second disk);#eta_{SIM}", 100, 1.56, 3.2); - meHitTvsE_[1] = ibook.bookProfile( - "EtlHitTvsEZpos", "ETL SIM time vs energy (+Z);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); meHitTvsE_[0] = ibook.bookProfile( - "EtlHitTvsEZneg", "ETL SIM time vs energy (-Z);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); - meHitEvsPhi_[1] = ibook.bookProfile( - "EtlHitEvsPhiZpos", "ETL SIM energy vs #phi (+Z);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); + "EtlHitTvsEZnegD1", "ETL SIM time vs energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); + meHitTvsE_[1] = ibook.bookProfile( + "EtlHitTvsEZnegD2", "ETL SIM time vs energy (-Z, Second disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); + meHitTvsE_[2] = ibook.bookProfile( + "EtlHitTvsEZposD1", "ETL SIM time vs energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); + meHitTvsE_[3] = ibook.bookProfile( + "EtlHitTvsEZposD2", "ETL SIM time vs energy (+Z, Second disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); meHitEvsPhi_[0] = ibook.bookProfile( - "EtlHitEvsPhiZneg", "ETL SIM energy vs #phi (-Z);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); - meHitEvsEta_[1] = ibook.bookProfile( - "EtlHitEvsEtaZpos", "ETL SIM energy vs #eta (+Z);#eta_{SIM};E_{SIM} [MeV]", 50, 1.56, 3.2, 0., 100.); + "EtlHitEvsPhiZnegD1", "ETL SIM energy vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); + meHitEvsPhi_[1] = ibook.bookProfile( + "EtlHitEvsPhiZnegD2", "ETL SIM energy vs #phi (-Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); + meHitEvsPhi_[2] = ibook.bookProfile( + "EtlHitEvsPhiZposD1", "ETL SIM energy vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); + meHitEvsPhi_[3] = ibook.bookProfile( + "EtlHitEvsPhiZposD2", "ETL SIM energy vs #phi (+Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); meHitEvsEta_[0] = ibook.bookProfile( - "EtlHitEvsEtaZneg", "ETL SIM energy vs #eta (-Z);#eta_{SIM};E_{SIM} [MeV]", 50, -3.2, -1.56, 0., 100.); - meHitTvsPhi_[1] = ibook.bookProfile( - "EtlHitTvsPhiZpos", "ETL SIM time vs #phi (+Z);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); + "EtlHitEvsEtaZnegD1", "ETL SIM energy vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]", 50, -3.2, -1.56, 0., 100.); + meHitEvsEta_[1] = ibook.bookProfile( + "EtlHitEvsEtaZnegD2", "ETL SIM energy vs #eta (-Z, Second disk);#eta_{SIM};E_{SIM} [MeV]", 50, -3.2, -1.56, 0., 100.); + meHitEvsEta_[2] = ibook.bookProfile( + "EtlHitEvsEtaZposD1", "ETL SIM energy vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]", 50, 1.56, 3.2, 0., 100.); + meHitEvsEta_[3] = ibook.bookProfile( + "EtlHitEvsEtaZposD2", "ETL SIM energy vs #eta (+Z, Second disk);#eta_{SIM};E_{SIM} [MeV]", 50, 1.56, 3.2, 0., 100.); meHitTvsPhi_[0] = ibook.bookProfile( - "EtlHitTvsPhiZneg", "ETL SIM time vs #phi (-Z);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); - meHitTvsEta_[1] = ibook.bookProfile( - "EtlHitTvsEtaZpos", "ETL SIM time vs #eta (+Z);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, 3.2, 0., 100.); + "EtlHitTvsPhiZnegD1", "ETL SIM time vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); + meHitTvsPhi_[1] = ibook.bookProfile( + "EtlHitTvsPhiZnegD2", "ETL SIM time vs #phi (-Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); + meHitTvsPhi_[2] = ibook.bookProfile( + "EtlHitTvsPhiZposD1", "ETL SIM time vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); + meHitTvsPhi_[3] = ibook.bookProfile( + "EtlHitTvsPhiZposD2", "ETL SIM time vs #phi (+Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); meHitTvsEta_[0] = ibook.bookProfile( - "EtlHitTvsEtaZneg", "ETL SIM time vs #eta (-Z);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.); + "EtlHitTvsEtaZnegD1", "ETL SIM time vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.); + meHitTvsEta_[1] = ibook.bookProfile( + "EtlHitTvsEtaZnegD2", "ETL SIM time vs #eta (-Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.); + meHitTvsEta_[2] = ibook.bookProfile( + "EtlHitTvsEtaZposD2", "ETL SIM time vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, 3.2, 0., 100.); + meHitTvsEta_[3] = ibook.bookProfile( + "EtlHitTvsEtaZposD2", "ETL SIM time vs #eta (+Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, 3.2, 0., 100.); } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ @@ -264,7 +351,8 @@ void EtlSimHitsValidation::fillDescriptions(edm::ConfigurationDescriptions& desc desc.add<std::string>("folder", "MTD/ETL/SimHits"); desc.add<edm::InputTag>("inputTag", edm::InputTag("mix", "g4SimHitsFastTimerHitsEndcap")); - desc.add<double>("hitMinimumEnergy", 0.1); // [MeV] + desc.add<double>("hitMinimumEnergy1Dis", 0.01); // [MeV] + desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV] descriptions.add("etlSimHits", desc); } diff --git a/Validation/MtdValidation/plugins/MtdGlobalRecoHarvester.cc b/Validation/MtdValidation/plugins/MtdGlobalRecoHarvester.cc index d0e2b4c244dab..4a5c125fe0c07 100644 --- a/Validation/MtdValidation/plugins/MtdGlobalRecoHarvester.cc +++ b/Validation/MtdValidation/plugins/MtdGlobalRecoHarvester.cc @@ -27,9 +27,9 @@ class MtdGlobalRecoHarvester : public DQMEDHarvester { MonitorElement* meBtlEtaEff_; MonitorElement* meBtlPhiEff_; MonitorElement* meBtlPtEff_; - MonitorElement* meEtlEtaEff_[2]; - MonitorElement* meEtlPhiEff_[2]; - MonitorElement* meEtlPtEff_[2]; + MonitorElement* meEtlEtaEff_[4]; + MonitorElement* meEtlPhiEff_[4]; + MonitorElement* meEtlPtEff_[4]; }; // ------------ constructor and destructor -------------- @@ -50,21 +50,28 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett MonitorElement* meETLTrackEffEtaTotZneg = igetter.get(folder_ + "TrackETLEffEtaTotZneg"); MonitorElement* meETLTrackEffPhiTotZneg = igetter.get(folder_ + "TrackETLEffPhiTotZneg"); MonitorElement* meETLTrackEffPtTotZneg = igetter.get(folder_ + "TrackETLEffPtTotZneg"); - MonitorElement* meETLTrackEffEtaMtdZneg = igetter.get(folder_ + "TrackETLEffEtaMtdZneg"); - MonitorElement* meETLTrackEffPhiMtdZneg = igetter.get(folder_ + "TrackETLEffPhiMtdZneg"); - MonitorElement* meETLTrackEffPtMtdZneg = igetter.get(folder_ + "TrackETLEffPtMtdZneg"); + MonitorElement* meETLTrackEffEtaMtdZnegD1 = igetter.get(folder_ + "TrackETLEffEtaMtdZnegD1"); + MonitorElement* meETLTrackEffEtaMtdZnegD2 = igetter.get(folder_ + "TrackETLEffEtaMtdZnegD2"); + MonitorElement* meETLTrackEffPhiMtdZnegD1 = igetter.get(folder_ + "TrackETLEffPhiMtdZnegD1"); + MonitorElement* meETLTrackEffPhiMtdZnegD2 = igetter.get(folder_ + "TrackETLEffPhiMtdZnegD2"); + MonitorElement* meETLTrackEffPtMtdZnegD1 = igetter.get(folder_ + "TrackETLEffPtMtdZnegD1"); + MonitorElement* meETLTrackEffPtMtdZnegD2 = igetter.get(folder_ + "TrackETLEffPtMtdZnegD2"); MonitorElement* meETLTrackEffEtaTotZpos = igetter.get(folder_ + "TrackETLEffEtaTotZpos"); MonitorElement* meETLTrackEffPhiTotZpos = igetter.get(folder_ + "TrackETLEffPhiTotZpos"); MonitorElement* meETLTrackEffPtTotZpos = igetter.get(folder_ + "TrackETLEffPtTotZpos"); - MonitorElement* meETLTrackEffEtaMtdZpos = igetter.get(folder_ + "TrackETLEffEtaMtdZpos"); - MonitorElement* meETLTrackEffPhiMtdZpos = igetter.get(folder_ + "TrackETLEffPhiMtdZpos"); - MonitorElement* meETLTrackEffPtMtdZpos = igetter.get(folder_ + "TrackETLEffPtMtdZpos"); + MonitorElement* meETLTrackEffEtaMtdZposD1 = igetter.get(folder_ + "TrackETLEffEtaMtdZposD1"); + MonitorElement* meETLTrackEffEtaMtdZposD2 = igetter.get(folder_ + "TrackETLEffEtaMtdZposD2"); + MonitorElement* meETLTrackEffPhiMtdZposD1 = igetter.get(folder_ + "TrackETLEffPhiMtdZposD1"); + MonitorElement* meETLTrackEffPhiMtdZposD2 = igetter.get(folder_ + "TrackETLEffPhiMtdZposD2"); + MonitorElement* meETLTrackEffPtMtdZposD1 = igetter.get(folder_ + "TrackETLEffPtMtdZposD1"); + MonitorElement* meETLTrackEffPtMtdZposD2 = igetter.get(folder_ + "TrackETLEffPtMtdZposD2"); if (!meBTLTrackEffEtaTot || !meBTLTrackEffPhiTot || !meBTLTrackEffPtTot || !meBTLTrackEffEtaMtd || !meBTLTrackEffPhiMtd || !meBTLTrackEffPtMtd || !meETLTrackEffEtaTotZneg || !meETLTrackEffPhiTotZneg || - !meETLTrackEffPtTotZneg || !meETLTrackEffEtaMtdZneg || !meETLTrackEffPhiMtdZneg || !meETLTrackEffPtMtdZneg || - !meETLTrackEffEtaTotZpos || !meETLTrackEffPhiTotZpos || !meETLTrackEffPtTotZpos || !meETLTrackEffEtaMtdZpos || - !meETLTrackEffPhiMtdZpos || !meETLTrackEffPtMtdZpos) { + !meETLTrackEffPtTotZneg || !meETLTrackEffEtaMtdZnegD1 || !meETLTrackEffPhiMtdZnegD1 || !meETLTrackEffPtMtdZnegD1 || + !meETLTrackEffEtaTotZpos || !meETLTrackEffPhiTotZpos || !meETLTrackEffPtTotZpos || !meETLTrackEffEtaMtdZposD1 || + !meETLTrackEffPhiMtdZposD1 || !meETLTrackEffPtMtdZposD1 || !meETLTrackEffEtaMtdZnegD2 || !meETLTrackEffPhiMtdZnegD2 || + !meETLTrackEffPtMtdZnegD2 || !meETLTrackEffEtaMtdZposD2 || !meETLTrackEffPhiMtdZposD2 || !meETLTrackEffPtMtdZposD2) { edm::LogError("MtdGlobalRecoHarvester") << "Monitoring histograms not found!" << std::endl; return; } @@ -86,45 +93,74 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meBTLTrackEffPtTot->getNbinsX(), meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmin(), meBTLTrackEffPtTot->getTH1()->GetXaxis()->GetXmax()); - meEtlEtaEff_[0] = ibook.book1D("EtlEtaEffZneg", - " Track Efficiency VS Eta (-Z);#eta;Efficiency", + meEtlEtaEff_[0] = ibook.book1D("EtlEtaEffZnegD1", + " Track Efficiency VS Eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta;Efficiency", meETLTrackEffEtaTotZneg->getNbinsX(), meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(), meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax()); - meEtlPhiEff_[0] = ibook.book1D("EtlPhiEffZneg", - "Track Efficiency VS Phi (-Z);#phi [rad];Efficiency", + meEtlEtaEff_[1] = ibook.book1D("EtlEtaEffZnegD2", + " Track Efficiency VS Eta (-Z, Second Disk);#eta;Efficiency", + meETLTrackEffEtaTotZneg->getNbinsX(), + meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(), + meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax()); + meEtlPhiEff_[0] = ibook.book1D("EtlPhiEffZnegD1", + "Track Efficiency VS Phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi [rad];Efficiency", + meETLTrackEffPhiTotZneg->getNbinsX(), + meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(), + meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax()); + meEtlPhiEff_[1] = ibook.book1D("EtlPhiEffZnegD2", + "Track Efficiency VS Phi (-Z, Second Disk);#phi [rad];Efficiency", meETLTrackEffPhiTotZneg->getNbinsX(), meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(), meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax()); - meEtlPtEff_[0] = ibook.book1D("EtlPtEffZneg", - "Track Efficiency VS Pt (-Z);Pt [GeV];Efficiency", + meEtlPtEff_[0] = ibook.book1D("EtlPtEffZnegD1", + "Track Efficiency VS Pt (-Z, Single(topo1D)/First(topo2D) Disk);Pt [GeV];Efficiency", meETLTrackEffPtTotZneg->getNbinsX(), meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(), meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax()); - meEtlEtaEff_[1] = ibook.book1D("EtlEtaEffZpos", - " Track Efficiency VS Eta (+Z);#eta;Efficiency", + meEtlPtEff_[1] = ibook.book1D("EtlPtEffZnegD2", + "Track Efficiency VS Pt (-Z, Second Disk);Pt [GeV];Efficiency", + meETLTrackEffPtTotZneg->getNbinsX(), + meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmin(), + meETLTrackEffPtTotZneg->getTH1()->GetXaxis()->GetXmax()); + meEtlEtaEff_[2] = ibook.book1D("EtlEtaEffZposD1", + " Track Efficiency VS Eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta;Efficiency", meETLTrackEffEtaTotZpos->getNbinsX(), meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(), meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax()); - meEtlPhiEff_[1] = ibook.book1D("EtlPhiEffZpos", - "Track Efficiency VS Phi (+Z);#phi [rad];Efficiency", + meEtlEtaEff_[3] = ibook.book1D("EtlEtaEffZposD2", + " Track Efficiency VS Eta (+Z, Second Disk);#eta;Efficiency", + meETLTrackEffEtaTotZpos->getNbinsX(), + meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(), + meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax()); + meEtlPhiEff_[2] = ibook.book1D("EtlPhiEffZposD1", + "Track Efficiency VS Phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi [rad];Efficiency", meETLTrackEffPhiTotZpos->getNbinsX(), meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(), meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax()); - meEtlPtEff_[1] = ibook.book1D("EtlPtEffZpos", - "Track Efficiency VS Pt (+Z);Pt [GeV];Efficiency", + meEtlPhiEff_[3] = ibook.book1D("EtlPhiEffZposD2", + "Track Efficiency VS Phi (+Z, Second Disk);#phi [rad];Efficiency", + meETLTrackEffPhiTotZpos->getNbinsX(), + meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(), + meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax()); + meEtlPtEff_[2] = ibook.book1D("EtlPtEffZposD1", + "Track Efficiency VS Pt (+Z, Single(topo1D)/First(topo2D) Disk);Pt [GeV];Efficiency", + meETLTrackEffPtTotZpos->getNbinsX(), + meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(), + meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax()); + meEtlPtEff_[3] = ibook.book1D("EtlPtEffZposD2", + "Track Efficiency VS Pt (+Z, Second Disk);Pt [GeV];Efficiency", meETLTrackEffPtTotZpos->getNbinsX(), meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmin(), meETLTrackEffPtTotZpos->getTH1()->GetXaxis()->GetXmax()); meBtlEtaEff_->getTH1()->SetMinimum(0.); meBtlPhiEff_->getTH1()->SetMinimum(0.); meBtlPtEff_->getTH1()->SetMinimum(0.); - meEtlEtaEff_[0]->getTH1()->SetMinimum(0.); - meEtlPhiEff_[0]->getTH1()->SetMinimum(0.); - meEtlPtEff_[0]->getTH1()->SetMinimum(0.); - meEtlEtaEff_[1]->getTH1()->SetMinimum(0.); - meEtlPhiEff_[1]->getTH1()->SetMinimum(0.); - meEtlPtEff_[1]->getTH1()->SetMinimum(0.); + for (int i=0; i<4; i++) { + meEtlEtaEff_[i]->getTH1()->SetMinimum(0.); + meEtlPhiEff_[i]->getTH1()->SetMinimum(0.); + meEtlPtEff_[i]->getTH1()->SetMinimum(0.); + } // --- Calculate efficiency BTL for (int ibin = 1; ibin <= meBTLTrackEffEtaTot->getNbinsX(); ibin++) { @@ -165,10 +201,10 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett } // --- Calculate efficiency ETL for (int ibin = 1; ibin <= meETLTrackEffEtaTotZneg->getNbinsX(); ibin++) { - double eff = meETLTrackEffEtaMtdZneg->getBinContent(ibin) / meETLTrackEffEtaTotZneg->getBinContent(ibin); + double eff = meETLTrackEffEtaMtdZnegD1->getBinContent(ibin) / meETLTrackEffEtaTotZneg->getBinContent(ibin); double bin_err = - sqrt((meETLTrackEffEtaMtdZneg->getBinContent(ibin) * - (meETLTrackEffEtaTotZneg->getBinContent(ibin) - meETLTrackEffEtaMtdZneg->getBinContent(ibin))) / + sqrt((meETLTrackEffEtaMtdZnegD1->getBinContent(ibin) * + (meETLTrackEffEtaTotZneg->getBinContent(ibin) - meETLTrackEffEtaMtdZnegD1->getBinContent(ibin))) / pow(meETLTrackEffEtaTotZneg->getBinContent(ibin), 3)); if (meETLTrackEffEtaTotZneg->getBinContent(ibin) == 0) { eff = 0; @@ -178,25 +214,53 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meEtlEtaEff_[0]->setBinError(ibin, bin_err); } + for (int ibin = 1; ibin <= meETLTrackEffEtaTotZneg->getNbinsX(); ibin++) { + double eff = meETLTrackEffEtaMtdZnegD2->getBinContent(ibin) / meETLTrackEffEtaTotZneg->getBinContent(ibin); + double bin_err = + sqrt((meETLTrackEffEtaMtdZnegD2->getBinContent(ibin) * + (meETLTrackEffEtaTotZneg->getBinContent(ibin) - meETLTrackEffEtaMtdZnegD2->getBinContent(ibin))) / + pow(meETLTrackEffEtaTotZneg->getBinContent(ibin), 3)); + if (meETLTrackEffEtaTotZneg->getBinContent(ibin) == 0) { + eff = 0; + bin_err = 0; + } + meEtlEtaEff_[1]->setBinContent(ibin, eff); + meEtlEtaEff_[1]->setBinError(ibin, bin_err); + } + for (int ibin = 1; ibin <= meETLTrackEffEtaTotZpos->getNbinsX(); ibin++) { - double eff = meETLTrackEffEtaMtdZpos->getBinContent(ibin) / meETLTrackEffEtaTotZpos->getBinContent(ibin); + double eff = meETLTrackEffEtaMtdZposD1->getBinContent(ibin) / meETLTrackEffEtaTotZpos->getBinContent(ibin); double bin_err = - sqrt((meETLTrackEffEtaMtdZpos->getBinContent(ibin) * - (meETLTrackEffEtaTotZpos->getBinContent(ibin) - meETLTrackEffEtaMtdZpos->getBinContent(ibin))) / + sqrt((meETLTrackEffEtaMtdZposD1->getBinContent(ibin) * + (meETLTrackEffEtaTotZpos->getBinContent(ibin) - meETLTrackEffEtaMtdZposD1->getBinContent(ibin))) / pow(meETLTrackEffEtaTotZpos->getBinContent(ibin), 3)); if (meETLTrackEffEtaTotZpos->getBinContent(ibin) == 0) { eff = 0; bin_err = 0; } - meEtlEtaEff_[1]->setBinContent(ibin, eff); - meEtlEtaEff_[1]->setBinError(ibin, bin_err); + meEtlEtaEff_[2]->setBinContent(ibin, eff); + meEtlEtaEff_[2]->setBinError(ibin, bin_err); + } + + for (int ibin = 1; ibin <= meETLTrackEffEtaTotZpos->getNbinsX(); ibin++) { + double eff = meETLTrackEffEtaMtdZposD2->getBinContent(ibin) / meETLTrackEffEtaTotZpos->getBinContent(ibin); + double bin_err = + sqrt((meETLTrackEffEtaMtdZposD2->getBinContent(ibin) * + (meETLTrackEffEtaTotZpos->getBinContent(ibin) - meETLTrackEffEtaMtdZposD2->getBinContent(ibin))) / + pow(meETLTrackEffEtaTotZpos->getBinContent(ibin), 3)); + if (meETLTrackEffEtaTotZpos->getBinContent(ibin) == 0) { + eff = 0; + bin_err = 0; + } + meEtlEtaEff_[3]->setBinContent(ibin, eff); + meEtlEtaEff_[3]->setBinError(ibin, bin_err); } for (int ibin = 1; ibin <= meETLTrackEffPhiTotZneg->getNbinsX(); ibin++) { - double eff = meETLTrackEffPhiMtdZneg->getBinContent(ibin) / meETLTrackEffPhiTotZneg->getBinContent(ibin); + double eff = meETLTrackEffPhiMtdZnegD1->getBinContent(ibin) / meETLTrackEffPhiTotZneg->getBinContent(ibin); double bin_err = - sqrt((meETLTrackEffPhiMtdZneg->getBinContent(ibin) * - (meETLTrackEffPhiTotZneg->getBinContent(ibin) - meETLTrackEffPhiMtdZneg->getBinContent(ibin))) / + sqrt((meETLTrackEffPhiMtdZnegD1->getBinContent(ibin) * + (meETLTrackEffPhiTotZneg->getBinContent(ibin) - meETLTrackEffPhiMtdZnegD1->getBinContent(ibin))) / pow(meETLTrackEffPhiTotZneg->getBinContent(ibin), 3)); if (meETLTrackEffPhiTotZneg->getBinContent(ibin) == 0) { eff = 0; @@ -205,26 +269,55 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meEtlPhiEff_[0]->setBinContent(ibin, eff); meEtlPhiEff_[0]->setBinError(ibin, bin_err); } + + for (int ibin = 1; ibin <= meETLTrackEffPhiTotZneg->getNbinsX(); ibin++) { + double eff = meETLTrackEffPhiMtdZnegD2->getBinContent(ibin) / meETLTrackEffPhiTotZneg->getBinContent(ibin); + double bin_err = + sqrt((meETLTrackEffPhiMtdZnegD2->getBinContent(ibin) * + (meETLTrackEffPhiTotZneg->getBinContent(ibin) - meETLTrackEffPhiMtdZnegD2->getBinContent(ibin))) / + pow(meETLTrackEffPhiTotZneg->getBinContent(ibin), 3)); + if (meETLTrackEffPhiTotZneg->getBinContent(ibin) == 0) { + eff = 0; + bin_err = 0; + } + meEtlPhiEff_[1]->setBinContent(ibin, eff); + meEtlPhiEff_[1]->setBinError(ibin, bin_err); + + } + + for (int ibin = 1; ibin <= meETLTrackEffPhiTotZpos->getNbinsX(); ibin++) { + double eff = meETLTrackEffPhiMtdZposD1->getBinContent(ibin) / meETLTrackEffPhiTotZpos->getBinContent(ibin); + double bin_err = + sqrt((meETLTrackEffPhiMtdZposD1->getBinContent(ibin) * + (meETLTrackEffPhiTotZpos->getBinContent(ibin) - meETLTrackEffPhiMtdZposD1->getBinContent(ibin))) / + pow(meETLTrackEffPhiTotZpos->getBinContent(ibin), 3)); + if (meETLTrackEffPhiTotZpos->getBinContent(ibin) == 0) { + eff = 0; + bin_err = 0; + } + meEtlPhiEff_[2]->setBinContent(ibin, eff); + meEtlPhiEff_[2]->setBinError(ibin, bin_err); + } for (int ibin = 1; ibin <= meETLTrackEffPhiTotZpos->getNbinsX(); ibin++) { - double eff = meETLTrackEffPhiMtdZpos->getBinContent(ibin) / meETLTrackEffPhiTotZpos->getBinContent(ibin); + double eff = meETLTrackEffPhiMtdZposD2->getBinContent(ibin) / meETLTrackEffPhiTotZpos->getBinContent(ibin); double bin_err = - sqrt((meETLTrackEffPhiMtdZpos->getBinContent(ibin) * - (meETLTrackEffPhiTotZpos->getBinContent(ibin) - meETLTrackEffPhiMtdZpos->getBinContent(ibin))) / + sqrt((meETLTrackEffPhiMtdZposD2->getBinContent(ibin) * + (meETLTrackEffPhiTotZpos->getBinContent(ibin) - meETLTrackEffPhiMtdZposD2->getBinContent(ibin))) / pow(meETLTrackEffPhiTotZpos->getBinContent(ibin), 3)); if (meETLTrackEffPhiTotZpos->getBinContent(ibin) == 0) { eff = 0; bin_err = 0; } - meEtlPhiEff_[1]->setBinContent(ibin, eff); - meEtlPhiEff_[1]->setBinError(ibin, bin_err); + meEtlPhiEff_[3]->setBinContent(ibin, eff); + meEtlPhiEff_[3]->setBinError(ibin, bin_err); } for (int ibin = 1; ibin <= meETLTrackEffPtTotZneg->getNbinsX(); ibin++) { - double eff = meETLTrackEffPtMtdZneg->getBinContent(ibin) / meETLTrackEffPtTotZneg->getBinContent(ibin); + double eff = meETLTrackEffPtMtdZnegD1->getBinContent(ibin) / meETLTrackEffPtTotZneg->getBinContent(ibin); double bin_err = - sqrt((meETLTrackEffPtMtdZneg->getBinContent(ibin) * - (meETLTrackEffPtTotZneg->getBinContent(ibin) - meETLTrackEffPtMtdZneg->getBinContent(ibin))) / + sqrt((meETLTrackEffPtMtdZnegD1->getBinContent(ibin) * + (meETLTrackEffPtTotZneg->getBinContent(ibin) - meETLTrackEffPtMtdZnegD1->getBinContent(ibin))) / pow(meETLTrackEffPtTotZneg->getBinContent(ibin), 3)); if (meETLTrackEffPtTotZneg->getBinContent(ibin) == 0) { eff = 0; @@ -234,18 +327,46 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meEtlPtEff_[0]->setBinError(ibin, bin_err); } + for (int ibin = 1; ibin <= meETLTrackEffPtTotZneg->getNbinsX(); ibin++) { + double eff = meETLTrackEffPtMtdZnegD2->getBinContent(ibin) / meETLTrackEffPtTotZneg->getBinContent(ibin); + double bin_err = + sqrt((meETLTrackEffPtMtdZnegD2->getBinContent(ibin) * + (meETLTrackEffPtTotZneg->getBinContent(ibin) - meETLTrackEffPtMtdZnegD2->getBinContent(ibin))) / + pow(meETLTrackEffPtTotZneg->getBinContent(ibin), 3)); + if (meETLTrackEffPtTotZneg->getBinContent(ibin) == 0) { + eff = 0; + bin_err = 0; + } + meEtlPtEff_[1]->setBinContent(ibin, eff); + meEtlPtEff_[1]->setBinError(ibin, bin_err); + } + for (int ibin = 1; ibin <= meETLTrackEffPtTotZpos->getNbinsX(); ibin++) { - double eff = meETLTrackEffPtMtdZpos->getBinContent(ibin) / meETLTrackEffPtTotZpos->getBinContent(ibin); + double eff = meETLTrackEffPtMtdZposD1->getBinContent(ibin) / meETLTrackEffPtTotZpos->getBinContent(ibin); double bin_err = - sqrt((meETLTrackEffPtMtdZpos->getBinContent(ibin) * - (meETLTrackEffPtTotZpos->getBinContent(ibin) - meETLTrackEffPtMtdZpos->getBinContent(ibin))) / + sqrt((meETLTrackEffPtMtdZposD1->getBinContent(ibin) * + (meETLTrackEffPtTotZpos->getBinContent(ibin) - meETLTrackEffPtMtdZposD1->getBinContent(ibin))) / pow(meETLTrackEffPtTotZpos->getBinContent(ibin), 3)); if (meETLTrackEffPtTotZpos->getBinContent(ibin) == 0) { eff = 0; bin_err = 0; } - meEtlPtEff_[1]->setBinContent(ibin, eff); - meEtlPtEff_[1]->setBinError(ibin, bin_err); + meEtlPtEff_[2]->setBinContent(ibin, eff); + meEtlPtEff_[2]->setBinError(ibin, bin_err); + } + + for (int ibin = 1; ibin <= meETLTrackEffPtTotZpos->getNbinsX(); ibin++) { + double eff = meETLTrackEffPtMtdZposD2->getBinContent(ibin) / meETLTrackEffPtTotZpos->getBinContent(ibin); + double bin_err = + sqrt((meETLTrackEffPtMtdZposD2->getBinContent(ibin) * + (meETLTrackEffPtTotZpos->getBinContent(ibin) - meETLTrackEffPtMtdZposD2->getBinContent(ibin))) / + pow(meETLTrackEffPtTotZpos->getBinContent(ibin), 3)); + if (meETLTrackEffPtTotZpos->getBinContent(ibin) == 0) { + eff = 0; + bin_err = 0; + } + meEtlPtEff_[3]->setBinContent(ibin, eff); + meEtlPtEff_[3]->setBinError(ibin, bin_err); } } diff --git a/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc b/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc index c9b89535ef0c7..a0d7c7306a7c9 100644 --- a/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc @@ -20,16 +20,17 @@ #include "DataFormats/Common/interface/RefVector.h" #include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" -#include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h" +//#include "DataFormats/TrackReco/interface/TrackFwd.h" +//#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" +//#include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h" #include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/TrackerRecHit2D/interface/MTDTrackingRecHit.h" +//#include "DataFormats/VertexReco/interface/VertexFwd.h" +//#include "DataFormats/TrackerRecHit2D/interface/MTDTrackingRecHit.h" #include "Geometry/Records/interface/MTDDigiGeometryRecord.h" #include "Geometry/Records/interface/MTDTopologyRcd.h" #include "Geometry/MTDNumberingBuilder/interface/MTDTopology.h" +#include "Geometry/MTDCommonData/interface/MTDTopologyMode.h" #include "Geometry/MTDGeometryBuilder/interface/MTDGeometry.h" #include "Geometry/MTDGeometryBuilder/interface/ProxyMTDTopology.h" #include "Geometry/MTDGeometryBuilder/interface/RectangularMTDTopology.h" @@ -64,14 +65,14 @@ class MtdGlobalRecoValidation : public DQMEDAnalyzer { MonitorElement* meBTLTrackEffPhiMtd_; MonitorElement* meBTLTrackEffPtMtd_; - MonitorElement* meETLTrackRPTime_[2]; - MonitorElement* meETLTrackNumHits_[2]; - MonitorElement* meETLTrackEffEtaTot_[2]; - MonitorElement* meETLTrackEffPhiTot_[2]; - MonitorElement* meETLTrackEffPtTot_[2]; - MonitorElement* meETLTrackEffEtaMtd_[2]; - MonitorElement* meETLTrackEffPhiMtd_[2]; - MonitorElement* meETLTrackEffPtMtd_[2]; + MonitorElement* meETLTrackRPTime_[4]; + MonitorElement* meETLTrackNumHits_[4]; + MonitorElement* meETLTrackEffEtaTot_[4]; + MonitorElement* meETLTrackEffPhiTot_[4]; + MonitorElement* meETLTrackEffPtTot_[4]; + MonitorElement* meETLTrackEffEtaMtd_[4]; + MonitorElement* meETLTrackEffPhiMtd_[4]; + MonitorElement* meETLTrackEffPtMtd_[4]; MonitorElement* meTrackNumHits_; @@ -98,6 +99,15 @@ void MtdGlobalRecoValidation::analyze(const edm::Event& iEvent, const edm::Event using namespace geant_units::operators; using namespace std; + edm::ESHandle<MTDTopology> topologyHandle; + iSetup.get<MTDTopologyRcd>().get(topologyHandle); + const MTDTopology* topology = topologyHandle.product(); + + bool topo1Dis = false; + bool topo2Dis = false; + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo1Dis = true; + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo2Dis = true; + auto RecTrackHandle = makeValid(iEvent.getHandle(RecTrackToken_)); auto RecVertexHandle = makeValid(iEvent.getHandle(RecVertexToken_)); @@ -148,41 +158,80 @@ void MtdGlobalRecoValidation::analyze(const edm::Event& iEvent, const edm::Event meETLTrackEffPtTot_[1]->Fill(track.pt()); } - bool MTDEtlZneg = false; - bool MTDEtlZpos = false; + bool MTDEtlZnegD1 = false; + bool MTDEtlZnegD2 = false; + bool MTDEtlZposD1 = false; + bool MTDEtlZposD2 = false; int numMTDEtlvalidhits = 0; for (const auto hit : track.recHits()) { if (hit->isValid() == false) continue; MTDDetId Hit = hit->geographicalId(); - if ((Hit.det() == 6) && (Hit.subdetId() == 1) && (Hit.mtdSubDetector() == 2) && (Hit.zside() == -1)) { - MTDEtlZneg = true; - numMTDEtlvalidhits++; - } - if ((Hit.det() == 6) && (Hit.subdetId() == 1) && (Hit.mtdSubDetector() == 2) && (Hit.zside() == 1)) { - MTDEtlZpos = true; - numMTDEtlvalidhits++; + if ((Hit.det() == 6) && (Hit.subdetId() == 1) && (Hit.mtdSubDetector() == 2)) { + ETLDetId ETLHit = hit->geographicalId(); + + if (topo2Dis) { + if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 1 ) ) { + MTDEtlZnegD1 = true; + numMTDEtlvalidhits++; + } + if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 2 ) ) { + MTDEtlZnegD2 = true; + numMTDEtlvalidhits++; + } + if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 1 ) ) { + MTDEtlZposD1 = true; + numMTDEtlvalidhits++; + } + if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 2 ) ) { + MTDEtlZposD2 = true; + numMTDEtlvalidhits++; + } + } + + if (topo1Dis) { + if (ETLHit.zside() == -1) { + MTDEtlZnegD1 = true; + numMTDEtlvalidhits++; + } + if (ETLHit.zside() == 1) { + MTDEtlZposD1 = true; + numMTDEtlvalidhits++; + } + } } } meTrackNumHits_->Fill(-numMTDEtlvalidhits); // --- keeping only tracks with last hit in MTD --- if ((track.eta() < -trackMinEta_) && (track.eta() > -trackMaxEta_)) { - if (MTDEtlZneg == true) { + if (MTDEtlZnegD1 == true) { meETLTrackEffEtaMtd_[0]->Fill(track.eta()); meETLTrackEffPhiMtd_[0]->Fill(track.phi()); meETLTrackEffPtMtd_[0]->Fill(track.pt()); meETLTrackRPTime_[0]->Fill(track.t0()); } - } - if ((track.eta() > trackMinEta_) && (track.eta() < trackMaxEta_)) { - if (MTDEtlZpos == true) { + if (MTDEtlZnegD2 == true) { meETLTrackEffEtaMtd_[1]->Fill(track.eta()); meETLTrackEffPhiMtd_[1]->Fill(track.phi()); meETLTrackEffPtMtd_[1]->Fill(track.pt()); meETLTrackRPTime_[1]->Fill(track.t0()); } } + if ((track.eta() > trackMinEta_) && (track.eta() < trackMaxEta_)) { + if (MTDEtlZposD1 == true) { + meETLTrackEffEtaMtd_[2]->Fill(track.eta()); + meETLTrackEffPhiMtd_[2]->Fill(track.phi()); + meETLTrackEffPtMtd_[2]->Fill(track.pt()); + meETLTrackRPTime_[2]->Fill(track.t0()); + } + if (MTDEtlZposD2 == true) { + meETLTrackEffEtaMtd_[3]->Fill(track.eta()); + meETLTrackEffPhiMtd_[3]->Fill(track.phi()); + meETLTrackEffPtMtd_[3]->Fill(track.pt()); + meETLTrackRPTime_[3]->Fill(track.t0()); + } + } } } //RECO tracks loop @@ -215,8 +264,10 @@ void MtdGlobalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, meBTLTrackEffPhiMtd_ = ibook.book1D("TrackBTLEffPhiMtd", "Track efficiency vs phi (Mtd);#phi_{RECO} [rad]", 100, -3.2, 3.2); meBTLTrackEffPtMtd_ = ibook.book1D("TrackBTLEffPtMtd", "Track efficiency vs pt (Mtd);pt_{RECO} [GeV]", 50, 0, 10); - meETLTrackRPTime_[0] = ibook.book1D("TrackETLRPTimeZneg", "Track t0 with respect to R.P. (-Z);t0 [ns]", 100, -1, 3); - meETLTrackRPTime_[1] = ibook.book1D("TrackETLRPTimeZpos", "Track t0 with respect to R.P. (+Z);t0 [ns]", 100, -1, 3); + meETLTrackRPTime_[0] = ibook.book1D("TrackETLRPTimeZnegD1", "Track t0 with respect to R.P. (-Z, Firstl Disk);t0 [ns]", 100, -1, 3); + meETLTrackRPTime_[1] = ibook.book1D("TrackETLRPTimeZnegD2", "Track t0 with respect to R.P. (-Z, Second Disk);t0 [ns]", 100, -1, 3); + meETLTrackRPTime_[2] = ibook.book1D("TrackETLRPTimeZposD1", "Track t0 with respect to R.P. (+Z, First Disk);t0 [ns]", 100, -1, 3); + meETLTrackRPTime_[3] = ibook.book1D("TrackETLRPTimeZposD2", "Track t0 with respect to R.P. (+Z, Second Disk);t0 [ns]", 100, -1, 3); meETLTrackEffEtaTot_[0] = ibook.book1D("TrackETLEffEtaTotZneg", "Track efficiency vs eta (Tot) (-Z);#eta_{RECO}", 100, -3.2, -1.4); meETLTrackEffEtaTot_[1] = @@ -230,17 +281,29 @@ void MtdGlobalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, meETLTrackEffPtTot_[1] = ibook.book1D("TrackETLEffPtTotZpos", "Track efficiency vs pt (Tot) (+Z);pt_{RECO} [GeV]", 50, 0, 10); meETLTrackEffEtaMtd_[0] = - ibook.book1D("TrackETLEffEtaMtdZneg", "Track efficiency vs eta (Mtd) (-Z);#eta_{RECO}", 100, -3.2, -1.4); + ibook.book1D("TrackETLEffEtaMtdZnegD1", "Track efficiency vs eta (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.4); meETLTrackEffEtaMtd_[1] = - ibook.book1D("TrackETLEffEtaMtdZpos", "Track efficiency vs eta (Mtd) (+Z);#eta_{RECO}", 100, 1.4, 3.2); + ibook.book1D("TrackETLEffEtaMtdZnegD2", "Track efficiency vs eta (Mtd) (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.4); + meETLTrackEffEtaMtd_[2] = + ibook.book1D("TrackETLEffEtaMtdZposD1", "Track efficiency vs eta (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.4, 3.2); + meETLTrackEffEtaMtd_[3] = + ibook.book1D("TrackETLEffEtaMtdZposD2", "Track efficiency vs eta (Mtd) (+Z, Second Disk);#eta_{RECO}", 100, 1.4, 3.2); meETLTrackEffPhiMtd_[0] = - ibook.book1D("TrackETLEffPhiMtdZneg", "Track efficiency vs phi (Mtd) (-Z);#phi_{RECO} [rad]", 100, -3.2, 3.2); + ibook.book1D("TrackETLEffPhiMtdZnegD1", "Track efficiency vs phi (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); meETLTrackEffPhiMtd_[1] = - ibook.book1D("TrackETLEffPhiMtdZpos", "Track efficiency vs phi (Mtd) (+Z);#phi_{RECO} [rad]", 100, -3.2, 3.2); + ibook.book1D("TrackETLEffPhiMtdZnegD2", "Track efficiency vs phi (Mtd) (-Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meETLTrackEffPhiMtd_[2] = + ibook.book1D("TrackETLEffPhiMtdZposD2", "Track efficiency vs phi (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meETLTrackEffPhiMtd_[3] = + ibook.book1D("TrackETLEffPhiMtdZposD1", "Track efficiency vs phi (Mtd) (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); meETLTrackEffPtMtd_[0] = - ibook.book1D("TrackETLEffPtMtdZneg", "Track efficiency vs pt (Mtd) (-Z);pt_{RECO} [GeV]", 50, 0, 10); + ibook.book1D("TrackETLEffPtMtdZnegD1", "Track efficiency vs pt (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);pt_{RECO} [GeV]", 50, 0, 10); meETLTrackEffPtMtd_[1] = - ibook.book1D("TrackETLEffPtMtdZpos", "Track efficiency vs pt (Mtd) (+Z);pt_{RECO} [GeV]", 50, 0, 10); + ibook.book1D("TrackETLEffPtMtdZnegD2", "Track efficiency vs pt (Mtd) (-Z, Second Disk);pt_{RECO} [GeV]", 50, 0, 10); + meETLTrackEffPtMtd_[2] = + ibook.book1D("TrackETLEffPtMtdZposD1", "Track efficiency vs pt (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);pt_{RECO} [GeV]", 50, 0, 10); + meETLTrackEffPtMtd_[3] = + ibook.book1D("TrackETLEffPtMtdZposD2", "Track efficiency vs pt (Mtd) (+Z, Second Disk);pt_{RECO} [GeV]", 50, 0, 10); meTrackNumHits_ = ibook.book1D("TrackNumHits", "Number of valid MTD hits per track ; Number of hits", 10, -5, 5); meVerZ_ = ibook.book1D("VerZ", "RECO Vertex Z;Z_{RECO} [cm]", 180, -18, 18); meVerTime_ = ibook.book1D("VerTime", "RECO Vertex Time;t0 [ns]", 100, -1, 1); From 1ed8050f8d61af38994942e510a20a238328ca97 Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Tue, 13 Oct 2020 15:24:05 +0200 Subject: [PATCH 525/778] Removing printouts and minor fixes --- .../plugins/EtlDigiHitsValidation.cc | 376 +++++++++++------ .../plugins/EtlLocalRecoValidation.cc | 390 +++++++++++++----- .../plugins/EtlSimHitsValidation.cc | 369 +++++++++++++---- .../plugins/MtdGlobalRecoHarvester.cc | 42 +- .../plugins/MtdGlobalRecoValidation.cc | 95 +++-- 5 files changed, 883 insertions(+), 389 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc index 02d1d5d77a287..a6ef86aa7af0a 100644 --- a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc @@ -89,8 +89,10 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe bool topo1Dis = false; bool topo2Dis = false; - if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo1Dis = true; - if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo2Dis = true; + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + topo1Dis = true; + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + topo2Dis = true; edm::ESHandle<MTDGeometry> geometryHandle; iSetup.get<MTDDigiGeometryRecord>().get(geometryHandle); @@ -122,7 +124,7 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe // --- Fill the histograms int idet = 999; - + if (topo1Dis) { if (detId.zside() == -1) { idet = 0; @@ -173,10 +175,10 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe } if (topo2Dis) { - for (int i=0; i<4; i++) { + for (int i = 0; i < 4; i++) { meNhits_[i]->Fill(n_digi_etl[i]); } - } + } } // ------------ method for histogram booking ------------ @@ -187,28 +189,59 @@ void EtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook, // --- histograms booking - meNhits_[0] = ibook.book1D("EtlNhitsZnegD1", "Number of ETL DIGI hits (-Z, Single(topo1D)/First(topo2D) disk);log_{10}(N_{DIGI})", 100, 0., 5000.); - meNhits_[1] = ibook.book1D("EtlNhitsZnegD2", "Number of ETL DIGI hits (-Z, Second disk);log_{10}(N_{DIGI})", 100, 0., 5000.); - meNhits_[2] = ibook.book1D("EtlNhitsZposD1", "Number of ETL DIGI hits (+Z, Single(topo1D)/First(topo2D) disk);log_{10}(N_{DIGI})", 100, 0., 5000.); - meNhits_[3] = ibook.book1D("EtlNhitsZposD2", "Number of ETL DIGI hits (+Z, Second disk);log_{10}(N_{DIGI})", 100, 0., 5000.); - - meHitCharge_[0] = ibook.book1D("EtlHitChargeZnegD1", "ETL DIGI hits charge (-Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); - meHitCharge_[1] = ibook.book1D("EtlHitChargeZnegD2", "ETL DIGI hits charge (-Z, Second disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); - meHitCharge_[2] = ibook.book1D("EtlHitChargeZposD1", "ETL DIGI hits charge (+Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); - meHitCharge_[3] = ibook.book1D("EtlHitChargeZposD2", "ETL DIGI hits charge (+Z, Second disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); - meHitTime_[0] = ibook.book1D("EtlHitTimeZnegD1", "ETL DIGI hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); - meHitTime_[1] = ibook.book1D("EtlHitTimeZnegD2", "ETL DIGI hits ToA (-Z, Second disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); - meHitTime_[2] = ibook.book1D("EtlHitTimeZposD1", "ETL DIGI hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); - meHitTime_[3] = ibook.book1D("EtlHitTimeZposD2", "ETL DIGI hits ToA (+Z, Second disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); - - meOccupancy_[0] = ibook.book2D("EtlOccupancyZnegD1", - "ETL DIGI hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm];Y_{DIGI} [cm]", - 135, - -135., - 135., - 135, - -135., - 135.); + meNhits_[0] = ibook.book1D("EtlNhitsZnegD1", + "Number of ETL DIGI hits (-Z, Single(topo1D)/First(topo2D) disk);log_{10}(N_{DIGI})", + 100, + 0., + 5000.); + meNhits_[1] = + ibook.book1D("EtlNhitsZnegD2", "Number of ETL DIGI hits (-Z, Second disk);log_{10}(N_{DIGI})", 100, 0., 5000.); + meNhits_[2] = ibook.book1D("EtlNhitsZposD1", + "Number of ETL DIGI hits (+Z, Single(topo1D)/First(topo2D) disk);log_{10}(N_{DIGI})", + 100, + 0., + 5000.); + meNhits_[3] = + ibook.book1D("EtlNhitsZposD2", "Number of ETL DIGI hits (+Z, Second disk);log_{10}(N_{DIGI})", 100, 0., 5000.); + + meHitCharge_[0] = ibook.book1D("EtlHitChargeZnegD1", + "ETL DIGI hits charge (-Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts]", + 100, + 0., + 256.); + meHitCharge_[1] = + ibook.book1D("EtlHitChargeZnegD2", "ETL DIGI hits charge (-Z, Second disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); + meHitCharge_[2] = ibook.book1D("EtlHitChargeZposD1", + "ETL DIGI hits charge (+Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts]", + 100, + 0., + 256.); + meHitCharge_[3] = + ibook.book1D("EtlHitChargeZposD2", "ETL DIGI hits charge (+Z, Second disk);Q_{DIGI} [ADC counts]", 100, 0., 256.); + meHitTime_[0] = ibook.book1D("EtlHitTimeZnegD1", + "ETL DIGI hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{DIGI} [TDC counts]", + 100, + 0., + 2000.); + meHitTime_[1] = + ibook.book1D("EtlHitTimeZnegD2", "ETL DIGI hits ToA (-Z, Second disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); + meHitTime_[2] = ibook.book1D("EtlHitTimeZposD1", + "ETL DIGI hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{DIGI} [TDC counts]", + 100, + 0., + 2000.); + meHitTime_[3] = + ibook.book1D("EtlHitTimeZposD2", "ETL DIGI hits ToA (+Z, Second disk);ToA_{DIGI} [TDC counts]", 100, 0., 2000.); + + meOccupancy_[0] = + ibook.book2D("EtlOccupancyZnegD1", + "ETL DIGI hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm];Y_{DIGI} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); meOccupancy_[1] = ibook.book2D("EtlOccupancyZnegD2", "ETL DIGI hits occupancy (-Z, Second disk);X_{DIGI} [cm];Y_{DIGI} [cm]", 135, @@ -217,14 +250,15 @@ void EtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook, 135, -135., 135.); - meOccupancy_[2] = ibook.book2D("EtlOccupancyZposD1", - "ETL DIGI hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm];Y_{DIGI} [cm]", - 135, - -135., - 135., - 135, - -135., - 135.); + meOccupancy_[2] = + ibook.book2D("EtlOccupancyZposD1", + "ETL DIGI hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm];Y_{DIGI} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); meOccupancy_[3] = ibook.book2D("EtlOccupancyZposD2", "ETL DIGI hits occupancy (+Z, Second disk);X_{DIGI} [cm];Y_{DIGI} [cm]", 135, @@ -234,128 +268,202 @@ void EtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook, -135., 135.); - meHitX_[0] = ibook.book1D("EtlHitXZnegD1", "ETL DIGI hits X (-Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm]", 100, -130., 130.); + meHitX_[0] = ibook.book1D( + "EtlHitXZnegD1", "ETL DIGI hits X (-Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm]", 100, -130., 130.); meHitX_[1] = ibook.book1D("EtlHitXZnegD2", "ETL DIGI hits X (-Z, Second disk);X_{DIGI} [cm]", 100, -130., 130.); - meHitX_[2] = ibook.book1D("EtlHitXZposD1", "ETL DIGI hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm]", 100, -130., 130.); + meHitX_[2] = ibook.book1D( + "EtlHitXZposD1", "ETL DIGI hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{DIGI} [cm]", 100, -130., 130.); meHitX_[3] = ibook.book1D("EtlHitXZposD2", "ETL DIGI hits X (+Z, Second disk);X_{DIGI} [cm]", 100, -130., 130.); - meHitY_[0] = ibook.book1D("EtlHitYZnegD1", "ETL DIGI hits Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{DIGI} [cm]", 100, -130., 130.); + meHitY_[0] = ibook.book1D( + "EtlHitYZnegD1", "ETL DIGI hits Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{DIGI} [cm]", 100, -130., 130.); meHitY_[1] = ibook.book1D("EtlHitYZnegD2", "ETL DIGI hits Y (-Z, Second disk);Y_{DIGI} [cm]", 100, -130., 130.); - meHitY_[2] = ibook.book1D("EtlHitYZposD1", "ETL DIGI hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{DIGI} [cm]", 100, -130., 130.); + meHitY_[2] = ibook.book1D( + "EtlHitYZposD1", "ETL DIGI hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{DIGI} [cm]", 100, -130., 130.); meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL DIGI hits Y (+Z, Second disk);Y_{DIGI} [cm]", 100, -130., 130.); - meHitZ_[0] = ibook.book1D("EtlHitZZnegD1", "ETL DIGI hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, -310, -301); + meHitZ_[0] = ibook.book1D( + "EtlHitZZnegD1", "ETL DIGI hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, -310, -301); meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL DIGI hits Z (-Z, Second disk);Z_{DIGI} [cm]", 100, -310, -301); - meHitZ_[2] = ibook.book1D("EtlHitZZposD1", "ETL DIGI hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, 301, 310); + meHitZ_[2] = ibook.book1D( + "EtlHitZZposD1", "ETL DIGI hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, 301, 310); meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL DIGI hits Z (+Z, Second disk);Z_{DIGI} [cm]", 100, 301, 310); - meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1", "ETL DIGI hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); - meHitPhi_[1] = ibook.book1D("EtlHitPhiZnegD2", "ETL DIGI hits #phi (-Z, Second disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); - meHitPhi_[2] = ibook.book1D("EtlHitPhiZposD1", "ETL DIGI hits #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); - meHitPhi_[3] = ibook.book1D("EtlHitPhiZposD2", "ETL DIGI hits #phi (+Z, Second disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); - meHitEta_[0] = ibook.book1D("EtlHitEtaZnegD1", "ETL DIGI hits #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI}", 100, -3.2, -1.56); + meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1", + "ETL DIGI hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad]", + 100, + -3.15, + 3.15); + meHitPhi_[1] = + ibook.book1D("EtlHitPhiZnegD2", "ETL DIGI hits #phi (-Z, Second disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); + meHitPhi_[2] = ibook.book1D("EtlHitPhiZposD1", + "ETL DIGI hits #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad]", + 100, + -3.15, + 3.15); + meHitPhi_[3] = + ibook.book1D("EtlHitPhiZposD2", "ETL DIGI hits #phi (+Z, Second disk);#phi_{DIGI} [rad]", 100, -3.15, 3.15); + meHitEta_[0] = ibook.book1D( + "EtlHitEtaZnegD1", "ETL DIGI hits #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI}", 100, -3.2, -1.56); meHitEta_[1] = ibook.book1D("EtlHitEtaZnegD2", "ETL DIGI hits #eta (-Z, Second disk);#eta_{DIGI}", 100, -3.2, -1.56); - meHitEta_[2] = ibook.book1D("EtlHitEtaZposD1", "ETL DIGI hits #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI}", 100, 1.56, 3.2); + meHitEta_[2] = ibook.book1D( + "EtlHitEtaZposD1", "ETL DIGI hits #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI}", 100, 1.56, 3.2); meHitEta_[3] = ibook.book1D("EtlHitEtaZposD2", "ETL DIGI hits #eta (+Z, Second disk);#eta_{DIGI}", 100, 1.56, 3.2); - meHitTvsQ_[0] = ibook.bookProfile("EtlHitTvsQZnegD1", - "ETL DIGI ToA vs charge (-Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", - 50, - 0., - 256., - 0., - 1024.); - meHitTvsQ_[1] = ibook.bookProfile("EtlHitTvsQZnegD2", - "ETL DIGI ToA vs charge (-Z, Second Disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", - 50, - 0., - 256., - 0., - 1024.); - meHitTvsQ_[2] = ibook.bookProfile("EtlHitTvsQZposD1", - "ETL DIGI ToA vs charge (+Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", - 50, - 0., - 256., - 0., - 1024.); - meHitTvsQ_[3] = ibook.bookProfile("EtlHitTvsQZposD2", - "ETL DIGI ToA vs charge (+Z, Second disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", - 50, - 0., - 256., - 0., - 1024.); - meHitQvsPhi_[0] = ibook.bookProfile("EtlHitQvsPhiZnegD1", - "ETL DIGI charge vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", - 50, - -3.15, - 3.15, - 0., - 1024.); - meHitQvsPhi_[1] = ibook.bookProfile("EtlHitQvsPhiZnegD2", - "ETL DIGI charge vs #phi (-Z, Second disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", - 50, - -3.15, - 3.15, - 0., - 1024.); - meHitQvsPhi_[2] = ibook.bookProfile("EtlHitQvsPhiZposD1", - "ETL DIGI charge vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", - 50, - -3.15, - 3.15, - 0., - 1024.); - meHitQvsPhi_[3] = ibook.bookProfile("EtlHitQvsPhiZpos", - "ETL DIGI charge vs #phi (+Z, Second disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", - 50, - -3.15, - 3.15, - 0., - 1024.); + meHitTvsQ_[0] = ibook.bookProfile( + "EtlHitTvsQZnegD1", + "ETL DIGI ToA vs charge (-Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", + 50, + 0., + 256., + 0., + 1024.); + meHitTvsQ_[1] = + ibook.bookProfile("EtlHitTvsQZnegD2", + "ETL DIGI ToA vs charge (-Z, Second Disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", + 50, + 0., + 256., + 0., + 1024.); + meHitTvsQ_[2] = ibook.bookProfile( + "EtlHitTvsQZposD1", + "ETL DIGI ToA vs charge (+Z, Single(topo1D)/First(topo2D) disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", + 50, + 0., + 256., + 0., + 1024.); + meHitTvsQ_[3] = + ibook.bookProfile("EtlHitTvsQZposD2", + "ETL DIGI ToA vs charge (+Z, Second disk);Q_{DIGI} [ADC counts];ToA_{DIGI} [TDC counts]", + 50, + 0., + 256., + 0., + 1024.); + meHitQvsPhi_[0] = ibook.bookProfile( + "EtlHitQvsPhiZnegD1", + "ETL DIGI charge vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitQvsPhi_[1] = + ibook.bookProfile("EtlHitQvsPhiZnegD2", + "ETL DIGI charge vs #phi (-Z, Second disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitQvsPhi_[2] = ibook.bookProfile( + "EtlHitQvsPhiZposD1", + "ETL DIGI charge vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitQvsPhi_[3] = + ibook.bookProfile("EtlHitQvsPhiZpos", + "ETL DIGI charge vs #phi (+Z, Second disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); meHitQvsEta_[0] = ibook.bookProfile( - "EtlHitQvsEtaZnegD1", "ETL DIGI charge vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, -3.2, -1.56, 0., 1024.); - meHitQvsEta_[1] = ibook.bookProfile( - "EtlHitQvsEtaZnegD2", "ETL DIGI charge vs #eta (-Z, Second disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, -3.2, -1.56, 0., 1024.); - meHitQvsEta_[2] = ibook.bookProfile( - "EtlHitQvsEtaZposD1", "ETL DIGI charge vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, 1.56, 3.2, 0., 1024.); - meHitQvsEta_[3] = ibook.bookProfile( - "EtlHitQvsEtaZposD2", "ETL DIGI charge vs #eta (+Z, Second disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, 1.56, 3.2, 0., 1024.); - meHitTvsPhi_[0] = ibook.bookProfile("EtlHitTvsPhiZnegD1", - "ETL DIGI ToA vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + "EtlHitQvsEtaZnegD1", + "ETL DIGI charge vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", + 50, + -3.2, + -1.56, + 0., + 1024.); + meHitQvsEta_[1] = ibook.bookProfile("EtlHitQvsEtaZnegD2", + "ETL DIGI charge vs #eta (-Z, Second disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, - -3.15, - 3.15, + -3.2, + -1.56, 0., 1024.); - meHitTvsPhi_[1] = ibook.bookProfile("EtlHitTvsPhiZnegD2", - "ETL DIGI ToA vs #phi (-Z, Second disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + meHitQvsEta_[2] = ibook.bookProfile( + "EtlHitQvsEtaZposD1", + "ETL DIGI charge vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", + 50, + 1.56, + 3.2, + 0., + 1024.); + meHitQvsEta_[3] = ibook.bookProfile("EtlHitQvsEtaZposD2", + "ETL DIGI charge vs #eta (+Z, Second disk);#eta_{DIGI};Q_{DIGI} [ADC counts]", 50, - -3.15, - 3.15, + 1.56, + 3.2, 0., 1024.); - meHitTvsPhi_[2] = ibook.bookProfile("EtlHitTvsPhiZposD1", - "ETL DIGI ToA vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + meHitTvsPhi_[0] = ibook.bookProfile( + "EtlHitTvsPhiZnegD1", + "ETL DIGI ToA vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitTvsPhi_[1] = + ibook.bookProfile("EtlHitTvsPhiZnegD2", + "ETL DIGI ToA vs #phi (-Z, Second disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitTvsPhi_[2] = ibook.bookProfile( + "EtlHitTvsPhiZposD1", + "ETL DIGI ToA vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitTvsPhi_[3] = + ibook.bookProfile("EtlHitTvsPhiZposD2", + "ETL DIGI ToA vs #phi (+Z, Second disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + 50, + -3.15, + 3.15, + 0., + 1024.); + meHitTvsEta_[0] = ibook.bookProfile( + "EtlHitTvsEtaZnegD1", + "ETL DIGI ToA vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", + 50, + -3.2, + -1.56, + 0., + 1024.); + meHitTvsEta_[1] = ibook.bookProfile("EtlHitTvsEtaZnegD2", + "ETL DIGI ToA vs #eta (-Z, Second disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, - -3.15, - 3.15, + -3.2, + -1.56, 0., 1024.); - meHitTvsPhi_[3] = ibook.bookProfile("EtlHitTvsPhiZposD2", - "ETL DIGI ToA vs #phi (+Z, Second disk);#phi_{DIGI} [rad];ToA_{DIGI} [TDC counts]", + meHitTvsEta_[2] = ibook.bookProfile( + "EtlHitTvsEtaZposD1", + "ETL DIGI ToA vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", + 50, + 1.56, + 3.2, + 0., + 1024.); + meHitTvsEta_[3] = ibook.bookProfile("EtlHitTvsEtaZposD2", + "ETL DIGI ToA vs #eta (+Z, Second disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, - -3.15, - 3.15, + 1.56, + 3.2, 0., 1024.); - meHitTvsEta_[0] = ibook.bookProfile( - "EtlHitTvsEtaZnegD1", "ETL DIGI ToA vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, -3.2, -1.56, 0., 1024.); - meHitTvsEta_[1] = ibook.bookProfile( - "EtlHitTvsEtaZnegD2", "ETL DIGI ToA vs #eta (-Z, Second disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, -3.2, -1.56, 0., 1024.); - meHitTvsEta_[2] = ibook.bookProfile( - "EtlHitTvsEtaZposD1", "ETL DIGI ToA vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, 1.56, 3.2, 0., 1024.); - meHitTvsEta_[3] = ibook.bookProfile( - "EtlHitTvsEtaZposD2", "ETL DIGI ToA vs #eta (+Z, Second disk);#eta_{DIGI};ToA_{DIGI} [TDC counts]", 50, 1.56, 3.2, 0., 1024.); } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ diff --git a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc index 885389e1d659c..35e695dc4ed91 100644 --- a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc @@ -54,7 +54,7 @@ class EtlLocalRecoValidation : public DQMEDAnalyzer { edm::EDGetTokenT<FTLClusterCollection> etlRecCluToken_; // --- histograms declaration - + MonitorElement* meNhits_[4]; MonitorElement* meHitEnergy_[4]; MonitorElement* meHitTime_[4]; @@ -79,7 +79,6 @@ class EtlLocalRecoValidation : public DQMEDAnalyzer { MonitorElement* meCluEta_[4]; MonitorElement* meCluHits_[4]; MonitorElement* meCluOccupancy_[4]; - }; // ------------ constructor and destructor -------------- @@ -103,9 +102,11 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS bool topo1Dis = false; bool topo2Dis = false; - if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo1Dis = true; - if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo2Dis = true; - + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + topo1Dis = true; + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + topo2Dis = true; + edm::ESHandle<MTDGeometry> geometryHandle; iSetup.get<MTDDigiGeometryRecord>().get(geometryHandle); const MTDGeometry* geom = geometryHandle.product(); @@ -117,10 +118,8 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS unsigned int n_reco_etl[4]; for (const auto& recHit : *etlRecHitsHandle) { - ETLDetId detId = recHit.id(); DetId geoId = detId.geographicalId(); - std::cout << "ETl Det Id: " << detId << std::endl; const MTDGeomDet* thedet = geom->idToDet(geoId); if (thedet == nullptr) throw cms::Exception("EtlLocalRecoValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " (" @@ -157,7 +156,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS } // --- Fill the histograms - + meHitEnergy_[idet]->Fill(recHit.energy()); meHitTime_[idet]->Fill(recHit.time()); @@ -182,7 +181,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS } if (topo2Dis) { - for (int i=0; i<4; i++) { + for (int i = 0; i < 4; i++) { meNhits_[i]->Fill(n_reco_etl[i]); } } @@ -193,11 +192,11 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS i++; for (const auto& cluster : DetSetClu) { if (topo1Dis) { - if (cluster.energy() < hitMinEnergy1Dis_) + if (cluster.energy() < hitMinEnergy1Dis_) continue; } if (topo2Dis) { - if (cluster.energy() < hitMinEnergy2Dis_) + if (cluster.energy() < hitMinEnergy2Dis_) continue; } ETLDetId cluId = cluster.id(); @@ -212,8 +211,8 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS Local3DPoint local_point(topo.localX(cluster.x()), topo.localY(cluster.y()), 0.); const auto& global_point = genericDet->toGlobal(local_point); - - int idet=999; + + int idet = 999; if (topo1Dis) { if (cluId.zside() == -1) { @@ -257,27 +256,36 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, // --- histograms booking - meNhits_[0] = ibook.book1D("EtlNhitsZnegD1", "Number of ETL RECO hits (-Z, Single(topo1D)/First(topo2D) disk);N_{RECO}", 100, 0., 5000.); + meNhits_[0] = ibook.book1D( + "EtlNhitsZnegD1", "Number of ETL RECO hits (-Z, Single(topo1D)/First(topo2D) disk);N_{RECO}", 100, 0., 5000.); meNhits_[1] = ibook.book1D("EtlNhitsZnegD2", "Number of ETL RECO hits (-Z, Second disk);N_{RECO}", 100, 0., 5000.); - meNhits_[2] = ibook.book1D("EtlNhitsZposD1", "Number of ETL RECO hits (+Z, Single(topo1D)/First(topo2D) disk);N_{RECO}", 100, 0., 5000.); + meNhits_[2] = ibook.book1D( + "EtlNhitsZposD1", "Number of ETL RECO hits (+Z, Single(topo1D)/First(topo2D) disk);N_{RECO}", 100, 0., 5000.); meNhits_[3] = ibook.book1D("EtlNhitsZposD2", "Number of ETL RECO hits (+Z, Second disk);N_{RECO}", 100, 0., 5000.); - meHitEnergy_[0] = ibook.book1D("EtlHitEnergyZnegD1", "ETL RECO hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{RECO} [MeV]", 100, 0., 3.); - meHitEnergy_[1] = ibook.book1D("EtlHitEnergyZnegD2", "ETL RECO hits energy (-Z, Second disk);E_{RECO} [MeV]", 100, 0., 3.); - meHitEnergy_[2] = ibook.book1D("EtlHitEnergyZposD1", "ETL RECO hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{RECO} [MeV]", 100, 0., 3.); - meHitEnergy_[3] = ibook.book1D("EtlHitEnergyZposD2", "ETL RECO hits energy (+Z, Second disk);E_{RECO} [MeV]", 100, 0., 3.); - meHitTime_[0] = ibook.book1D("EtlHitTimeZnegD1", "ETL RECO hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{RECO} [ns]", 100, 0., 25.); + meHitEnergy_[0] = ibook.book1D( + "EtlHitEnergyZnegD1", "ETL RECO hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{RECO} [MeV]", 100, 0., 3.); + meHitEnergy_[1] = + ibook.book1D("EtlHitEnergyZnegD2", "ETL RECO hits energy (-Z, Second disk);E_{RECO} [MeV]", 100, 0., 3.); + meHitEnergy_[2] = ibook.book1D( + "EtlHitEnergyZposD1", "ETL RECO hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{RECO} [MeV]", 100, 0., 3.); + meHitEnergy_[3] = + ibook.book1D("EtlHitEnergyZposD2", "ETL RECO hits energy (+Z, Second disk);E_{RECO} [MeV]", 100, 0., 3.); + meHitTime_[0] = ibook.book1D( + "EtlHitTimeZnegD1", "ETL RECO hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{RECO} [ns]", 100, 0., 25.); meHitTime_[1] = ibook.book1D("EtlHitTimeZnegD2", "ETL RECO hits ToA (-Z, Second disk);ToA_{RECO} [ns]", 100, 0., 25.); - meHitTime_[2] = ibook.book1D("EtlHitTimeZposD1", "ETL RECO hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{RECO} [ns]", 100, 0., 25.); + meHitTime_[2] = ibook.book1D( + "EtlHitTimeZposD1", "ETL RECO hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{RECO} [ns]", 100, 0., 25.); meHitTime_[3] = ibook.book1D("EtlHitTimeZposD2", "ETL RECO hits ToA (+Z, Second disk);ToA_{RECO} [ns]", 100, 0., 25.); - meOccupancy_[0] = ibook.book2D("EtlOccupancyZnegD1", - "ETL RECO hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{RECO} [cm];Y_{RECO} [cm]", - 135, - -135., - 135., - 135, - -135., - 135.); + meOccupancy_[0] = + ibook.book2D("EtlOccupancyZnegD1", + "ETL RECO hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{RECO} [cm];Y_{RECO} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); meOccupancy_[1] = ibook.book2D("EtlOccupancyZnegD2", "ETL RECO hits occupancy (-Z, Second disk);X_{RECO} [cm];Y_{RECO} [cm]", 135, @@ -286,14 +294,15 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, 135, -135., 135.); - meOccupancy_[2] = ibook.book2D("EtlOccupancyZposD1", - "ETL RECO hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{RECO} [cm];Y_{RECO} [cm]", - 135, - -135., - 135., - 135, - -135., - 135.); + meOccupancy_[2] = + ibook.book2D("EtlOccupancyZposD1", + "ETL RECO hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{RECO} [cm];Y_{RECO} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); meOccupancy_[3] = ibook.book2D("EtlOccupancyZposD2", "ETL RECO hits occupancy (+Z, Second disk);X_{RECO} [cm];Y_{RECO} [cm]", 135, @@ -303,96 +312,259 @@ void EtlLocalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, -135., 135.); - meHitX_[0] = ibook.book1D("EtlHitXZnegD1", "ETL RECO hits X (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]", 100, -130., 130.); + meHitX_[0] = ibook.book1D( + "EtlHitXZnegD1", "ETL RECO hits X (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]", 100, -130., 130.); meHitX_[1] = ibook.book1D("EtlHitXZnegD2", "ETL RECO hits X (-Z, Second Disk);X_{RECO} [cm]", 100, -130., 130.); - meHitX_[2] = ibook.book1D("EtlHitXZposD1", "ETL RECO hits X (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]", 100, -130., 130.); + meHitX_[2] = ibook.book1D( + "EtlHitXZposD1", "ETL RECO hits X (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]", 100, -130., 130.); meHitX_[3] = ibook.book1D("EtlHitXZposD2", "ETL RECO hits X (+Z, Second Disk);X_{RECO} [cm]", 100, -130., 130.); - meHitY_[0] = ibook.book1D("EtlHitYZnegD1", "ETL RECO hits Y (-Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.); + meHitY_[0] = ibook.book1D( + "EtlHitYZnegD1", "ETL RECO hits Y (-Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.); meHitY_[1] = ibook.book1D("EtlHitYZnegD2", "ETL RECO hits Y (-Z, Second Disk);Y_{RECO} [cm]", 100, -130., 130.); - meHitY_[2] = ibook.book1D("EtlHitYZposD1", "ETL RECO hits Y (+Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.); + meHitY_[2] = ibook.book1D( + "EtlHitYZposD1", "ETL RECO hits Y (+Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.); meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL RECO hits Y (+Z, Second Disk);Y_{RECO} [cm]", 100, -130., 130.); - meHitZ_[0] = ibook.book1D("EtlHitZZnegD1", "ETL RECO hits Z (-Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, -304.2, -303.4); + meHitZ_[0] = ibook.book1D( + "EtlHitZZnegD1", "ETL RECO hits Z (-Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, -304.2, -303.4); meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL RECO hits Z (-Z, Second Disk);Z_{RECO} [cm]", 100, -304.2, -303.4); - meHitZ_[2] = ibook.book1D("EtlHitZZposD1", "ETL RECO hits Z (+Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, 303.4, 304.2); + meHitZ_[2] = ibook.book1D( + "EtlHitZZposD1", "ETL RECO hits Z (+Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, 303.4, 304.2); meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL RECO hits Z (+Z, Second Disk);Z_{RECO} [cm]", 100, 303.4, 304.2); - meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1", "ETL RECO hits #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); - meHitPhi_[1] = ibook.book1D("EtlHitPhiZnegD2", "ETL RECO hits #phi (-Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); - meHitPhi_[2] = ibook.book1D("EtlHitPhiZposD1", "ETL RECO hits #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); - meHitPhi_[3] = ibook.book1D("EtlHitPhiZposD2", "ETL RECO hits #phi (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); - meHitEta_[0] = ibook.book1D("EtlHitEtaZnegD1", "ETL RECO hits #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.56); + meHitPhi_[0] = ibook.book1D( + "EtlHitPhiZnegD1", "ETL RECO hits #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meHitPhi_[1] = + ibook.book1D("EtlHitPhiZnegD2", "ETL RECO hits #phi (-Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meHitPhi_[2] = ibook.book1D( + "EtlHitPhiZposD1", "ETL RECO hits #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meHitPhi_[3] = + ibook.book1D("EtlHitPhiZposD2", "ETL RECO hits #phi (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + meHitEta_[0] = ibook.book1D( + "EtlHitEtaZnegD1", "ETL RECO hits #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.56); meHitEta_[1] = ibook.book1D("EtlHitEtaZnegD2", "ETL RECO hits #eta (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.56); - meHitEta_[2] = ibook.book1D("EtlHitEtaZposD1", "ETL RECO hits #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.56, 3.2); + meHitEta_[2] = ibook.book1D( + "EtlHitEtaZposD1", "ETL RECO hits #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.56, 3.2); meHitEta_[3] = ibook.book1D("EtlHitEtaZposD2", "ETL RECO hits #eta (+Z, Second Disk);#eta_{RECO}", 100, 1.56, 3.2); meHitTvsE_[0] = ibook.bookProfile( - "EtlHitTvsEZnegD1", "ETL RECO time vs energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); - meHitTvsE_[1] = ibook.bookProfile( - "EtlHitTvsEZnegD2", "ETL RECO time vs energy (-Z, Second Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); + "EtlHitTvsEZnegD1", + "ETL RECO time vs energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", + 50, + 0., + 2., + 0., + 100.); + meHitTvsE_[1] = ibook.bookProfile("EtlHitTvsEZnegD2", + "ETL RECO time vs energy (-Z, Second Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", + 50, + 0., + 2., + 0., + 100.); meHitTvsE_[2] = ibook.bookProfile( - "EtlHitTvsEZposD1", "ETL RECO time vs energy (+Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); - meHitTvsE_[3] = ibook.bookProfile( - "EtlHitTvsEZposD2", "ETL RECO time vs energy (+Z, Second Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 2., 0., 100.); + "EtlHitTvsEZposD1", + "ETL RECO time vs energy (+Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", + 50, + 0., + 2., + 0., + 100.); + meHitTvsE_[3] = ibook.bookProfile("EtlHitTvsEZposD2", + "ETL RECO time vs energy (+Z, Second Disk);E_{RECO} [MeV];ToA_{RECO} [ns]", + 50, + 0., + 2., + 0., + 100.); meHitEvsPhi_[0] = ibook.bookProfile( - "EtlHitEvsPhiZnegD1", "ETL RECO energy vs #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); - meHitEvsPhi_[1] = ibook.bookProfile( - "EtlHitEvsPhiZnegD2", "ETL RECO energy vs #phi (-Z, Second Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); + "EtlHitEvsPhiZnegD1", + "ETL RECO energy vs #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", + 50, + -3.2, + 3.2, + 0., + 100.); + meHitEvsPhi_[1] = ibook.bookProfile("EtlHitEvsPhiZnegD2", + "ETL RECO energy vs #phi (-Z, Second Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", + 50, + -3.2, + 3.2, + 0., + 100.); meHitEvsPhi_[2] = ibook.bookProfile( - "EtlHitEvsPhiZposD1", "ETL RECO energy vs #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); - meHitEvsPhi_[3] = ibook.bookProfile( - "EtlHitEvsPhiZposD2", "ETL RECO energy vs #phi (+Z, Second Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.); - meHitEvsEta_[0] = ibook.bookProfile( - "EtlHitEvsEtaZnegD1", "ETL RECO energy vs #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};E_{RECO} [MeV]", 50, -3.2, -1.56, 0., 100.); - meHitEvsEta_[1] = ibook.bookProfile( - "EtlHitEvsEtaZnegD2", "ETL RECO energy vs #eta (-Z, Second Disk);#eta_{RECO};E_{RECO} [MeV]", 50, -3.2, -1.56, 0., 100.); - meHitEvsEta_[2] = ibook.bookProfile( - "EtlHitEvsEtaZposD1", "ETL RECO energy vs #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};E_{RECO} [MeV]", 50, 1.56, 3.2, 0., 100.); - meHitEvsEta_[3] = ibook.bookProfile( - "EtlHitEvsEtaZposD2", "ETL RECO energy vs #eta (+Z, Second Disk);#eta_{RECO};E_{RECO} [MeV]", 50, 1.56, 3.2, 0., 100.); + "EtlHitEvsPhiZposD1", + "ETL RECO energy vs #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", + 50, + -3.2, + 3.2, + 0., + 100.); + meHitEvsPhi_[3] = ibook.bookProfile("EtlHitEvsPhiZposD2", + "ETL RECO energy vs #phi (+Z, Second Disk);#phi_{RECO} [rad];E_{RECO} [MeV]", + 50, + -3.2, + 3.2, + 0., + 100.); + meHitEvsEta_[0] = + ibook.bookProfile("EtlHitEvsEtaZnegD1", + "ETL RECO energy vs #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};E_{RECO} [MeV]", + 50, + -3.2, + -1.56, + 0., + 100.); + meHitEvsEta_[1] = ibook.bookProfile("EtlHitEvsEtaZnegD2", + "ETL RECO energy vs #eta (-Z, Second Disk);#eta_{RECO};E_{RECO} [MeV]", + 50, + -3.2, + -1.56, + 0., + 100.); + meHitEvsEta_[2] = + ibook.bookProfile("EtlHitEvsEtaZposD1", + "ETL RECO energy vs #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};E_{RECO} [MeV]", + 50, + 1.56, + 3.2, + 0., + 100.); + meHitEvsEta_[3] = ibook.bookProfile("EtlHitEvsEtaZposD2", + "ETL RECO energy vs #eta (+Z, Second Disk);#eta_{RECO};E_{RECO} [MeV]", + 50, + 1.56, + 3.2, + 0., + 100.); meHitTvsPhi_[0] = ibook.bookProfile( - "EtlHitTvsPhiZnegD1", "ETL RECO time vs #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); - meHitTvsPhi_[1] = ibook.bookProfile( - "EtlHitTvsPhiZnegD2", "ETL RECO time vs #phi (-Z, Second Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); + "EtlHitTvsPhiZnegD1", + "ETL RECO time vs #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", + 50, + -3.2, + 3.2, + 0., + 100.); + meHitTvsPhi_[1] = ibook.bookProfile("EtlHitTvsPhiZnegD2", + "ETL RECO time vs #phi (-Z, Second Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", + 50, + -3.2, + 3.2, + 0., + 100.); meHitTvsPhi_[2] = ibook.bookProfile( - "EtlHitTvsPhiZposD1", "ETL RECO time vs #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); - meHitTvsPhi_[3] = ibook.bookProfile( - "EtlHitTvsPhiZposD2", "ETL RECO time vs #phi (+Z, Second Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.); - meHitTvsEta_[0] = ibook.bookProfile( - "EtlHitTvsEtaZnegD1", "ETL RECO time vs #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};ToA_{RECO} [ns]", 50, -3.2, -1.56, 0., 100.); - meHitTvsEta_[1] = ibook.bookProfile( - "EtlHitTvsEtaZnegD2", "ETL RECO time vs #eta (-Z, Second Disk);#eta_{RECO};ToA_{RECO} [ns]", 50, -3.2, -1.56, 0., 100.); - meHitTvsEta_[2] = ibook.bookProfile( - "EtlHitTvsEtaZposD1", "ETL RECO time vs #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};ToA_{RECO} [ns]", 50, 1.56, 3.2, 0., 100.); - meHitTvsEta_[3] = ibook.bookProfile( - "EtlHitTvsEtaZposD2", "ETL RECO time vs #eta (+Z, Second Disk);#eta_{RECO};ToA_{RECO} [ns]", 50, 1.56, 3.2, 0., 100.); - meCluTime_[0] = ibook.book1D("EtlCluTimeZnegD1", "ETL cluster ToA (-Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25); + "EtlHitTvsPhiZposD1", + "ETL RECO time vs #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", + 50, + -3.2, + 3.2, + 0., + 100.); + meHitTvsPhi_[3] = ibook.bookProfile("EtlHitTvsPhiZposD2", + "ETL RECO time vs #phi (+Z, Second Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]", + 50, + -3.2, + 3.2, + 0., + 100.); + meHitTvsEta_[0] = + ibook.bookProfile("EtlHitTvsEtaZnegD1", + "ETL RECO time vs #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};ToA_{RECO} [ns]", + 50, + -3.2, + -1.56, + 0., + 100.); + meHitTvsEta_[1] = ibook.bookProfile("EtlHitTvsEtaZnegD2", + "ETL RECO time vs #eta (-Z, Second Disk);#eta_{RECO};ToA_{RECO} [ns]", + 50, + -3.2, + -1.56, + 0., + 100.); + meHitTvsEta_[2] = + ibook.bookProfile("EtlHitTvsEtaZposD1", + "ETL RECO time vs #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};ToA_{RECO} [ns]", + 50, + 1.56, + 3.2, + 0., + 100.); + meHitTvsEta_[3] = ibook.bookProfile("EtlHitTvsEtaZposD2", + "ETL RECO time vs #eta (+Z, Second Disk);#eta_{RECO};ToA_{RECO} [ns]", + 50, + 1.56, + 3.2, + 0., + 100.); + meCluTime_[0] = + ibook.book1D("EtlCluTimeZnegD1", "ETL cluster ToA (-Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25); meCluTime_[1] = ibook.book1D("EtlCluTimeZnegD2", "ETL cluster ToA (-Z, Second Disk);ToA [ns]", 250, 0, 25); - meCluTime_[2] = ibook.book1D("EtlCluTimeZposD1", "ETL cluster ToA (+Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25); + meCluTime_[2] = + ibook.book1D("EtlCluTimeZposD1", "ETL cluster ToA (+Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25); meCluTime_[3] = ibook.book1D("EtlCluTimeZposD2", "ETL cluster ToA (+Z, Second Disk);ToA [ns]", 250, 0, 25); - meCluEnergy_[0] = ibook.book1D("EtlCluEnergyZnegD1", "ETL cluster energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10); - meCluEnergy_[1] = ibook.book1D("EtlCluEnergyZnegD2", "ETL cluster energy (-Z, Second Disk);E_{RECO} [MeV]", 100, 0, 10); - meCluEnergy_[2] = ibook.book1D("EtlCluEnergyZposD1", "ETL cluster energy (+Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10); - meCluEnergy_[3] = ibook.book1D("EtlCluEnergyZposD2", "ETL cluster energy (+Z, Second Disk);E_{RECO} [MeV]", 100, 0, 10); - meCluPhi_[0] = ibook.book1D("EtlCluPhiZnegD1", "ETL cluster #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); - meCluPhi_[1] = ibook.book1D("EtlCluPhiZnegD2", "ETL cluster #phi (-Z, Second Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); - meCluPhi_[2] = ibook.book1D("EtlCluPhiZposD1", "ETL cluster #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); - meCluPhi_[3] = ibook.book1D("EtlCluPhiZposD2", "ETL cluster #phi (+Z, Second Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); - meCluEta_[0] = ibook.book1D("EtlCluEtaZnegD1", "ETL cluster #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.4); + meCluEnergy_[0] = ibook.book1D( + "EtlCluEnergyZnegD1", "ETL cluster energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10); + meCluEnergy_[1] = + ibook.book1D("EtlCluEnergyZnegD2", "ETL cluster energy (-Z, Second Disk);E_{RECO} [MeV]", 100, 0, 10); + meCluEnergy_[2] = ibook.book1D( + "EtlCluEnergyZposD1", "ETL cluster energy (+Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10); + meCluEnergy_[3] = + ibook.book1D("EtlCluEnergyZposD2", "ETL cluster energy (+Z, Second Disk);E_{RECO} [MeV]", 100, 0, 10); + meCluPhi_[0] = ibook.book1D( + "EtlCluPhiZnegD1", "ETL cluster #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); + meCluPhi_[1] = + ibook.book1D("EtlCluPhiZnegD2", "ETL cluster #phi (-Z, Second Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); + meCluPhi_[2] = ibook.book1D( + "EtlCluPhiZposD1", "ETL cluster #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); + meCluPhi_[3] = + ibook.book1D("EtlCluPhiZposD2", "ETL cluster #phi (+Z, Second Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2); + meCluEta_[0] = ibook.book1D( + "EtlCluEtaZnegD1", "ETL cluster #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.4); meCluEta_[1] = ibook.book1D("EtlCluEtaZnegD2", "ETL cluster #eta (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.4); - meCluEta_[2] = ibook.book1D("EtlCluEtaZposD1", "ETL cluster #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.4, 3.2); + meCluEta_[2] = ibook.book1D( + "EtlCluEtaZposD1", "ETL cluster #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.4, 3.2); meCluEta_[3] = ibook.book1D("EtlCluEtaZposD2", "ETL cluster #eta (+Z, Second Disk);#eta_{RECO}", 100, 1.4, 3.2); - meCluHits_[0] = ibook.book1D("EtlCluHitNumberZnegD1", "ETL hits per cluster (-Z, Single(topo1D)/First(topo2D) Disk);Cluster size", 10, 0, 10); - meCluHits_[1] = ibook.book1D("EtlCluHitNumberZnegD2", "ETL hits per cluster (-Z, Second Disk);Cluster size", 10, 0, 10); - meCluHits_[2] = ibook.book1D("EtlCluHitNumberZposD1", "ETL hits per cluster (+Z, Single(topo1D)/First(topo2D) Disk);Cluster size", 10, 0, 10); - meCluHits_[3] = ibook.book1D("EtlCluHitNumberZposD2", "ETL hits per cluster (+Z, Second Disk);Cluster size", 10, 0, 10); - meCluOccupancy_[0] = ibook.book2D( - "EtlOccupancyZnegD1", "ETL cluster X vs Y (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); - meCluOccupancy_[1] = ibook.book2D( - "EtlOccupancyZnegD2", "ETL cluster X vs Y (-Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); - meCluOccupancy_[2] = ibook.book2D( - "EtlOccupancyZposD1", "ETL cluster X vs Y (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); - meCluOccupancy_[3] = ibook.book2D( - "EtlOccupancyZposD2", "ETL cluster X vs Y (+Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]", 100, -150., 150., 100, -150, 150); - + meCluHits_[0] = ibook.book1D( + "EtlCluHitNumberZnegD1", "ETL hits per cluster (-Z, Single(topo1D)/First(topo2D) Disk);Cluster size", 10, 0, 10); + meCluHits_[1] = + ibook.book1D("EtlCluHitNumberZnegD2", "ETL hits per cluster (-Z, Second Disk);Cluster size", 10, 0, 10); + meCluHits_[2] = ibook.book1D( + "EtlCluHitNumberZposD1", "ETL hits per cluster (+Z, Single(topo1D)/First(topo2D) Disk);Cluster size", 10, 0, 10); + meCluHits_[3] = + ibook.book1D("EtlCluHitNumberZposD2", "ETL hits per cluster (+Z, Second Disk);Cluster size", 10, 0, 10); + meCluOccupancy_[0] = + ibook.book2D("EtlOccupancyZnegD1", + "ETL cluster X vs Y (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]", + 100, + -150., + 150., + 100, + -150, + 150); + meCluOccupancy_[1] = ibook.book2D("EtlOccupancyZnegD2", + "ETL cluster X vs Y (-Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]", + 100, + -150., + 150., + 100, + -150, + 150); + meCluOccupancy_[2] = + ibook.book2D("EtlOccupancyZposD1", + "ETL cluster X vs Y (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]", + 100, + -150., + 150., + 100, + -150, + 150); + meCluOccupancy_[3] = ibook.book2D("EtlOccupancyZposD2", + "ETL cluster X vs Y (+Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]", + 100, + -150., + 150., + 100, + -150, + 150); } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ @@ -402,7 +574,7 @@ void EtlLocalRecoValidation::fillDescriptions(edm::ConfigurationDescriptions& de desc.add<std::string>("folder", "MTD/ETL/LocalReco"); desc.add<edm::InputTag>("recHitsTag", edm::InputTag("mtdRecHits", "FTLEndcap")); desc.add<edm::InputTag>("recCluTag", edm::InputTag("mtdClusters", "FTLEndcap")); - desc.add<double>("hitMinimumEnergy1Dis", 0.01); // [MeV] + desc.add<double>("hitMinimumEnergy1Dis", 0.01); // [MeV] desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV] descriptions.add("etlLocalReco", desc); diff --git a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc index 1827eeb8f3acb..417b41f4e68df 100644 --- a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc @@ -114,8 +114,10 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet bool topo1Dis = false; bool topo2Dis = false; - if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo1Dis = true; - if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo2Dis = true; + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + topo1Dis = true; + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + topo2Dis = true; auto etlSimHitsHandle = makeValid(iEvent.getHandle(etlSimHitsToken_)); MixCollection<PSimHit> etlSimHits(etlSimHitsHandle.product()); @@ -180,8 +182,9 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet // Histogram filling // ============================================================================== - for (int idet = 0; idet < 4; ++idet) { //two disks per side - if ( ((idet == 1) || (idet == 3)) && (topo1Dis == true) ) continue; + for (int idet = 0; idet < 4; ++idet) { //two disks per side + if (((idet == 1) || (idet == 3)) && (topo1Dis == true)) + continue; meNhits_[idet]->Fill(m_etlHits[idet].size()); for (auto const& hit : m_etlTrkPerCell[idet]) { @@ -191,11 +194,11 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet for (auto const& hit : m_etlHits[idet]) { if (topo1Dis) { if ((hit.second).energy < hitMinEnergy1Dis_) - continue; + continue; } if (topo2Dis) { if ((hit.second).energy < hitMinEnergy2Dis_) - continue; + continue; } // --- Get the SIM hit global position ETLDetId detId(hit.first); @@ -240,107 +243,291 @@ void EtlSimHitsValidation::bookHistograms(DQMStore::IBooker& ibook, // --- histograms booking - meNhits_[0] = ibook.book1D("EtlNhitsZnegD1", "Number of ETL cells with SIM hits (-Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}", 100, 0., 5000.); - meNhits_[1] = ibook.book1D("EtlNhitsZnegD2", "Number of ETL cells with SIM hits (-Z, Second disk);N_{ETL cells}", 100, 0., 5000.); - meNhits_[2] = ibook.book1D("EtlNhitsZposD1", "Number of ETL cells with SIM hits (+Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}", 100, 0., 5000.); - meNhits_[3] = ibook.book1D("EtlNhitsZposD2", "Number of ETL cells with SIM hits (+Z, Second Disk);N_{ETL cells}", 100, 0., 5000.); - meNtrkPerCell_[0] = ibook.book1D("EtlNtrkPerCellZnegD1", "Number of tracks per ETL sensor (-Z, Single(topo1D)/First(topo2D) disk);N_{trk}", 10, 0., 10.); - meNtrkPerCell_[1] = ibook.book1D("EtlNtrkPerCellZneg", "Number of tracks per ETL sensor (-Z, Second disk);N_{trk}", 10, 0., 10.); - meNtrkPerCell_[2] = ibook.book1D("EtlNtrkPerCellZpos", "Number of tracks per ETL sensor (+Z, Single(topo1D)/First(topo2D) disk);N_{trk}", 10, 0., 10.); - meNtrkPerCell_[3] = ibook.book1D("EtlNtrkPerCellZpos", "Number of tracks per ETL sensor (+Z, Second disk);N_{trk}", 10, 0., 10.); - - meHitEnergy_[0] = ibook.book1D("EtlHitEnergyZnegD1", "ETL SIM hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.); - meHitEnergy_[1] = ibook.book1D("EtlHitEnergyZnegD2", "ETL SIM hits energy (-Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.); - meHitEnergy_[2] = ibook.book1D("EtlHitEnergyZposD1", "ETL SIM hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.); - meHitEnergy_[3] = ibook.book1D("EtlHitEnergyZposD2", "ETL SIM hits energy (+Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.); - meHitTime_[0] = ibook.book1D("EtlHitTimeZnegD1", "ETL SIM hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.); + meNhits_[0] = ibook.book1D("EtlNhitsZnegD1", + "Number of ETL cells with SIM hits (-Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}", + 100, + 0., + 5000.); + meNhits_[1] = ibook.book1D( + "EtlNhitsZnegD2", "Number of ETL cells with SIM hits (-Z, Second disk);N_{ETL cells}", 100, 0., 5000.); + meNhits_[2] = ibook.book1D("EtlNhitsZposD1", + "Number of ETL cells with SIM hits (+Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}", + 100, + 0., + 5000.); + meNhits_[3] = ibook.book1D( + "EtlNhitsZposD2", "Number of ETL cells with SIM hits (+Z, Second Disk);N_{ETL cells}", 100, 0., 5000.); + meNtrkPerCell_[0] = ibook.book1D("EtlNtrkPerCellZnegD1", + "Number of tracks per ETL sensor (-Z, Single(topo1D)/First(topo2D) disk);N_{trk}", + 10, + 0., + 10.); + meNtrkPerCell_[1] = + ibook.book1D("EtlNtrkPerCellZneg", "Number of tracks per ETL sensor (-Z, Second disk);N_{trk}", 10, 0., 10.); + meNtrkPerCell_[2] = ibook.book1D("EtlNtrkPerCellZpos", + "Number of tracks per ETL sensor (+Z, Single(topo1D)/First(topo2D) disk);N_{trk}", + 10, + 0., + 10.); + meNtrkPerCell_[3] = + ibook.book1D("EtlNtrkPerCellZpos", "Number of tracks per ETL sensor (+Z, Second disk);N_{trk}", 10, 0., 10.); + + meHitEnergy_[0] = ibook.book1D( + "EtlHitEnergyZnegD1", "ETL SIM hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.); + meHitEnergy_[1] = + ibook.book1D("EtlHitEnergyZnegD2", "ETL SIM hits energy (-Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.); + meHitEnergy_[2] = ibook.book1D( + "EtlHitEnergyZposD1", "ETL SIM hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.); + meHitEnergy_[3] = + ibook.book1D("EtlHitEnergyZposD2", "ETL SIM hits energy (+Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.); + meHitTime_[0] = ibook.book1D( + "EtlHitTimeZnegD1", "ETL SIM hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.); meHitTime_[1] = ibook.book1D("EtlHitTimeZnegD2", "ETL SIM hits ToA (-Z, Second disk);ToA_{SIM} [ns]", 100, 0., 25.); - meHitTime_[2] = ibook.book1D("EtlHitTimeZposD1", "ETL SIM hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.); + meHitTime_[2] = ibook.book1D( + "EtlHitTimeZposD1", "ETL SIM hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.); meHitTime_[3] = ibook.book1D("EtlHitTimeZposD2", "ETL SIM hits ToA (+Z, Second disk);ToA_{SIM} [ns]", 100, 0., 25.); - meHitXlocal_[0] = ibook.book1D("EtlHitXlocalZnegD1", "ETL SIM local X (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); - meHitXlocal_[1] = ibook.book1D("EtlHitXlocalZnegD2", "ETL SIM local X (-Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); - meHitXlocal_[2] = ibook.book1D("EtlHitXlocalZposD1", "ETL SIM local X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); - meHitXlocal_[3] = ibook.book1D("EtlHitXlocalZposD2", "ETL SIM local X (+Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); - - meHitYlocal_[0] = ibook.book1D("EtlHitYlocalZnegD1", "ETL SIM local Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); - meHitYlocal_[1] = ibook.book1D("EtlHitYlocalZnegD2", "ETL SIM local Y (-Z, Second Disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); - meHitYlocal_[2] = ibook.book1D("EtlHitYlocalZposD1", "ETL SIM local Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); - meHitYlocal_[3] = ibook.book1D("EtlHitYlocalZposD2", "ETL SIM local Y (+Z, Second disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); - meHitZlocal_[0] = ibook.book1D("EtlHitZlocalZnegD1", "ETL SIM local Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); - meHitZlocal_[1] = ibook.book1D("EtlHitZlocalZnegD2", "ETL SIM local Z (-Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); - meHitZlocal_[2] = ibook.book1D("EtlHitZlocalZposD1", "ETL SIM local Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); - meHitZlocal_[3] = ibook.book1D("EtlHitZlocalZposD2", "ETL SIM local Z (+Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); - - meOccupancy_[0] = ibook.book2D( - "EtlOccupancyZnegD1", "ETL SIM hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); - meOccupancy_[1] = ibook.book2D( - "EtlOccupancyZnegD2", "ETL SIM hits occupancy (-Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); - meOccupancy_[2] = ibook.book2D( - "EtlOccupancyZposD1", "ETL SIM hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); - meOccupancy_[3] = ibook.book2D( - "EtlOccupancyZposD2", "ETL SIM hits occupancy (+Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.); - - meHitX_[0] = ibook.book1D("EtlHitXZnegD1", "ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.); + meHitXlocal_[0] = ibook.book1D("EtlHitXlocalZnegD1", + "ETL SIM local X (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]", + 100, + -25., + 25.); + meHitXlocal_[1] = + ibook.book1D("EtlHitXlocalZnegD2", "ETL SIM local X (-Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); + meHitXlocal_[2] = ibook.book1D("EtlHitXlocalZposD1", + "ETL SIM local X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]", + 100, + -25., + 25.); + meHitXlocal_[3] = + ibook.book1D("EtlHitXlocalZposD2", "ETL SIM local X (+Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.); + + meHitYlocal_[0] = ibook.book1D("EtlHitYlocalZnegD1", + "ETL SIM local Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]", + 100, + -48., + 48.); + meHitYlocal_[1] = + ibook.book1D("EtlHitYlocalZnegD2", "ETL SIM local Y (-Z, Second Disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); + meHitYlocal_[2] = ibook.book1D("EtlHitYlocalZposD1", + "ETL SIM local Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]", + 100, + -48., + 48.); + meHitYlocal_[3] = + ibook.book1D("EtlHitYlocalZposD2", "ETL SIM local Y (+Z, Second disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.); + meHitZlocal_[0] = ibook.book1D("EtlHitZlocalZnegD1", + "ETL SIM local Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]", + 80, + -0.16, + 0.16); + meHitZlocal_[1] = + ibook.book1D("EtlHitZlocalZnegD2", "ETL SIM local Z (-Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); + meHitZlocal_[2] = ibook.book1D("EtlHitZlocalZposD1", + "ETL SIM local Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]", + 80, + -0.16, + 0.16); + meHitZlocal_[3] = + ibook.book1D("EtlHitZlocalZposD2", "ETL SIM local Z (+Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16); + + meOccupancy_[0] = + ibook.book2D("EtlOccupancyZnegD1", + "ETL SIM hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); + meOccupancy_[1] = ibook.book2D("EtlOccupancyZnegD2", + "ETL SIM hits occupancy (-Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); + meOccupancy_[2] = + ibook.book2D("EtlOccupancyZposD1", + "ETL SIM hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); + meOccupancy_[3] = ibook.book2D("EtlOccupancyZposD2", + "ETL SIM hits occupancy (+Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]", + 135, + -135., + 135., + 135, + -135., + 135.); + + meHitX_[0] = ibook.book1D( + "EtlHitXZnegD1", "ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.); meHitX_[1] = ibook.book1D("EtlHitXZnegD2", "ETL SIM hits X (-Z, Second disk);X_{SIM} [cm]", 100, -130., 130.); - meHitX_[2] = ibook.book1D("EtlHitXZposD1", "ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.); + meHitX_[2] = ibook.book1D( + "EtlHitXZposD1", "ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.); meHitX_[3] = ibook.book1D("EtlHitXZposD2", "ETL SIM hits X (+Z, Second disk);X_{SIM} [cm]", 100, -130., 130.); - meHitY_[0] = ibook.book1D("EtlHitYZnegD1", "ETL SIM hits Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.); + meHitY_[0] = ibook.book1D( + "EtlHitYZnegD1", "ETL SIM hits Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.); meHitY_[1] = ibook.book1D("EtlHitYZnegD2", "ETL SIM hits Y (-Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.); - meHitY_[2] = ibook.book1D("EtlHitYZposD1", "ETL SIM hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.); + meHitY_[2] = ibook.book1D( + "EtlHitYZposD1", "ETL SIM hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.); meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL SIM hits Y (+Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.); - meHitZ_[0] = ibook.book1D("EtlHitZZnegD1", "ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -305, -301); + meHitZ_[0] = ibook.book1D( + "EtlHitZZnegD1", "ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -305, -301); meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL SIM hits Z (-Z, Second disk);Z_{SIM} [cm]", 100, -305, -301); - meHitZ_[2] = ibook.book1D("EtlHitZZposD1", "ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 301, 305); - meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 301, 305); - - meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1", "ETL SIM hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); - meHitPhi_[1] = ibook.book1D("EtlHitPhiZnegD2", "ETL SIM hits #phi (-Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); - meHitPhi_[2] = ibook.book1D("EtlHitPhiZposD1", "ETL SIM hits #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); - meHitPhi_[3] = ibook.book1D("EtlHitPhiZposD2", "ETL SIM hits #phi (+Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); - meHitEta_[0] = ibook.book1D("EtlHitEtaZnegD1", "ETL SIM hits #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, -3.2, -1.56); + meHitZ_[2] = ibook.book1D( + "EtlHitZZposD1", "ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 301, 305); + meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 301, 305); + + meHitPhi_[0] = ibook.book1D( + "EtlHitPhiZnegD1", "ETL SIM hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); + meHitPhi_[1] = + ibook.book1D("EtlHitPhiZnegD2", "ETL SIM hits #phi (-Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); + meHitPhi_[2] = ibook.book1D( + "EtlHitPhiZposD1", "ETL SIM hits #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); + meHitPhi_[3] = + ibook.book1D("EtlHitPhiZposD2", "ETL SIM hits #phi (+Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); + meHitEta_[0] = ibook.book1D( + "EtlHitEtaZnegD1", "ETL SIM hits #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, -3.2, -1.56); meHitEta_[1] = ibook.book1D("EtlHitEtaZnegD2", "ETL SIM hits #eta (-Z, Second disk);#eta_{SIM}", 100, -3.2, -1.56); - meHitEta_[2] = ibook.book1D("EtlHitEtaZposD1", "ETL SIM hits #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, 1.56, 3.2); + meHitEta_[2] = ibook.book1D( + "EtlHitEtaZposD1", "ETL SIM hits #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, 1.56, 3.2); meHitEta_[3] = ibook.book1D("EtlHitEtaZposD2", "ETL SIM hits #eta (+Z, Second disk);#eta_{SIM}", 100, 1.56, 3.2); - meHitTvsE_[0] = ibook.bookProfile( - "EtlHitTvsEZnegD1", "ETL SIM time vs energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); + meHitTvsE_[0] = + ibook.bookProfile("EtlHitTvsEZnegD1", + "ETL SIM time vs energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]", + 50, + 0., + 2., + 0., + 100.); meHitTvsE_[1] = ibook.bookProfile( "EtlHitTvsEZnegD2", "ETL SIM time vs energy (-Z, Second disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); - meHitTvsE_[2] = ibook.bookProfile( - "EtlHitTvsEZposD1", "ETL SIM time vs energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); + meHitTvsE_[2] = + ibook.bookProfile("EtlHitTvsEZposD1", + "ETL SIM time vs energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]", + 50, + 0., + 2., + 0., + 100.); meHitTvsE_[3] = ibook.bookProfile( "EtlHitTvsEZposD2", "ETL SIM time vs energy (+Z, Second disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.); - meHitEvsPhi_[0] = ibook.bookProfile( - "EtlHitEvsPhiZnegD1", "ETL SIM energy vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); - meHitEvsPhi_[1] = ibook.bookProfile( - "EtlHitEvsPhiZnegD2", "ETL SIM energy vs #phi (-Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); - meHitEvsPhi_[2] = ibook.bookProfile( - "EtlHitEvsPhiZposD1", "ETL SIM energy vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); - meHitEvsPhi_[3] = ibook.bookProfile( - "EtlHitEvsPhiZposD2", "ETL SIM energy vs #phi (+Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.); - meHitEvsEta_[0] = ibook.bookProfile( - "EtlHitEvsEtaZnegD1", "ETL SIM energy vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]", 50, -3.2, -1.56, 0., 100.); - meHitEvsEta_[1] = ibook.bookProfile( - "EtlHitEvsEtaZnegD2", "ETL SIM energy vs #eta (-Z, Second disk);#eta_{SIM};E_{SIM} [MeV]", 50, -3.2, -1.56, 0., 100.); - meHitEvsEta_[2] = ibook.bookProfile( - "EtlHitEvsEtaZposD1", "ETL SIM energy vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]", 50, 1.56, 3.2, 0., 100.); - meHitEvsEta_[3] = ibook.bookProfile( - "EtlHitEvsEtaZposD2", "ETL SIM energy vs #eta (+Z, Second disk);#eta_{SIM};E_{SIM} [MeV]", 50, 1.56, 3.2, 0., 100.); - meHitTvsPhi_[0] = ibook.bookProfile( - "EtlHitTvsPhiZnegD1", "ETL SIM time vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); - meHitTvsPhi_[1] = ibook.bookProfile( - "EtlHitTvsPhiZnegD2", "ETL SIM time vs #phi (-Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); - meHitTvsPhi_[2] = ibook.bookProfile( - "EtlHitTvsPhiZposD1", "ETL SIM time vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); - meHitTvsPhi_[3] = ibook.bookProfile( - "EtlHitTvsPhiZposD2", "ETL SIM time vs #phi (+Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.); - meHitTvsEta_[0] = ibook.bookProfile( - "EtlHitTvsEtaZnegD1", "ETL SIM time vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.); + meHitEvsPhi_[0] = + ibook.bookProfile("EtlHitEvsPhiZnegD1", + "ETL SIM energy vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]", + 50, + -3.15, + 3.15, + 0., + 100.); + meHitEvsPhi_[1] = ibook.bookProfile("EtlHitEvsPhiZnegD2", + "ETL SIM energy vs #phi (-Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]", + 50, + -3.15, + 3.15, + 0., + 100.); + meHitEvsPhi_[2] = + ibook.bookProfile("EtlHitEvsPhiZposD1", + "ETL SIM energy vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]", + 50, + -3.15, + 3.15, + 0., + 100.); + meHitEvsPhi_[3] = ibook.bookProfile("EtlHitEvsPhiZposD2", + "ETL SIM energy vs #phi (+Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]", + 50, + -3.15, + 3.15, + 0., + 100.); + meHitEvsEta_[0] = + ibook.bookProfile("EtlHitEvsEtaZnegD1", + "ETL SIM energy vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]", + 50, + -3.2, + -1.56, + 0., + 100.); + meHitEvsEta_[1] = ibook.bookProfile("EtlHitEvsEtaZnegD2", + "ETL SIM energy vs #eta (-Z, Second disk);#eta_{SIM};E_{SIM} [MeV]", + 50, + -3.2, + -1.56, + 0., + 100.); + meHitEvsEta_[2] = + ibook.bookProfile("EtlHitEvsEtaZposD1", + "ETL SIM energy vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]", + 50, + 1.56, + 3.2, + 0., + 100.); + meHitEvsEta_[3] = ibook.bookProfile("EtlHitEvsEtaZposD2", + "ETL SIM energy vs #eta (+Z, Second disk);#eta_{SIM};E_{SIM} [MeV]", + 50, + 1.56, + 3.2, + 0., + 100.); + meHitTvsPhi_[0] = + ibook.bookProfile("EtlHitTvsPhiZnegD1", + "ETL SIM time vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]", + 50, + -3.15, + 3.15, + 0., + 100.); + meHitTvsPhi_[1] = ibook.bookProfile("EtlHitTvsPhiZnegD2", + "ETL SIM time vs #phi (-Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]", + 50, + -3.15, + 3.15, + 0., + 100.); + meHitTvsPhi_[2] = + ibook.bookProfile("EtlHitTvsPhiZposD1", + "ETL SIM time vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]", + 50, + -3.15, + 3.15, + 0., + 100.); + meHitTvsPhi_[3] = ibook.bookProfile("EtlHitTvsPhiZposD2", + "ETL SIM time vs #phi (+Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]", + 50, + -3.15, + 3.15, + 0., + 100.); + meHitTvsEta_[0] = + ibook.bookProfile("EtlHitTvsEtaZnegD1", + "ETL SIM time vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]", + 50, + -3.2, + -1.56, + 0., + 100.); meHitTvsEta_[1] = ibook.bookProfile( "EtlHitTvsEtaZnegD2", "ETL SIM time vs #eta (-Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.); - meHitTvsEta_[2] = ibook.bookProfile( - "EtlHitTvsEtaZposD2", "ETL SIM time vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, 3.2, 0., 100.); + meHitTvsEta_[2] = + ibook.bookProfile("EtlHitTvsEtaZposD2", + "ETL SIM time vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]", + 50, + 1.56, + 3.2, + 0., + 100.); meHitTvsEta_[3] = ibook.bookProfile( "EtlHitTvsEtaZposD2", "ETL SIM time vs #eta (+Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, 3.2, 0., 100.); } @@ -351,7 +538,7 @@ void EtlSimHitsValidation::fillDescriptions(edm::ConfigurationDescriptions& desc desc.add<std::string>("folder", "MTD/ETL/SimHits"); desc.add<edm::InputTag>("inputTag", edm::InputTag("mix", "g4SimHitsFastTimerHitsEndcap")); - desc.add<double>("hitMinimumEnergy1Dis", 0.01); // [MeV] + desc.add<double>("hitMinimumEnergy1Dis", 0.01); // [MeV] desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV] descriptions.add("etlSimHits", desc); diff --git a/Validation/MtdValidation/plugins/MtdGlobalRecoHarvester.cc b/Validation/MtdValidation/plugins/MtdGlobalRecoHarvester.cc index 4a5c125fe0c07..b2450a7412837 100644 --- a/Validation/MtdValidation/plugins/MtdGlobalRecoHarvester.cc +++ b/Validation/MtdValidation/plugins/MtdGlobalRecoHarvester.cc @@ -68,10 +68,11 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett if (!meBTLTrackEffEtaTot || !meBTLTrackEffPhiTot || !meBTLTrackEffPtTot || !meBTLTrackEffEtaMtd || !meBTLTrackEffPhiMtd || !meBTLTrackEffPtMtd || !meETLTrackEffEtaTotZneg || !meETLTrackEffPhiTotZneg || - !meETLTrackEffPtTotZneg || !meETLTrackEffEtaMtdZnegD1 || !meETLTrackEffPhiMtdZnegD1 || !meETLTrackEffPtMtdZnegD1 || - !meETLTrackEffEtaTotZpos || !meETLTrackEffPhiTotZpos || !meETLTrackEffPtTotZpos || !meETLTrackEffEtaMtdZposD1 || - !meETLTrackEffPhiMtdZposD1 || !meETLTrackEffPtMtdZposD1 || !meETLTrackEffEtaMtdZnegD2 || !meETLTrackEffPhiMtdZnegD2 || - !meETLTrackEffPtMtdZnegD2 || !meETLTrackEffEtaMtdZposD2 || !meETLTrackEffPhiMtdZposD2 || !meETLTrackEffPtMtdZposD2) { + !meETLTrackEffPtTotZneg || !meETLTrackEffEtaMtdZnegD1 || !meETLTrackEffPhiMtdZnegD1 || + !meETLTrackEffPtMtdZnegD1 || !meETLTrackEffEtaTotZpos || !meETLTrackEffPhiTotZpos || !meETLTrackEffPtTotZpos || + !meETLTrackEffEtaMtdZposD1 || !meETLTrackEffPhiMtdZposD1 || !meETLTrackEffPtMtdZposD1 || + !meETLTrackEffEtaMtdZnegD2 || !meETLTrackEffPhiMtdZnegD2 || !meETLTrackEffPtMtdZnegD2 || + !meETLTrackEffEtaMtdZposD2 || !meETLTrackEffPhiMtdZposD2 || !meETLTrackEffPtMtdZposD2) { edm::LogError("MtdGlobalRecoHarvester") << "Monitoring histograms not found!" << std::endl; return; } @@ -103,11 +104,12 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meETLTrackEffEtaTotZneg->getNbinsX(), meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmin(), meETLTrackEffEtaTotZneg->getTH1()->GetXaxis()->GetXmax()); - meEtlPhiEff_[0] = ibook.book1D("EtlPhiEffZnegD1", - "Track Efficiency VS Phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi [rad];Efficiency", - meETLTrackEffPhiTotZneg->getNbinsX(), - meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(), - meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax()); + meEtlPhiEff_[0] = + ibook.book1D("EtlPhiEffZnegD1", + "Track Efficiency VS Phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi [rad];Efficiency", + meETLTrackEffPhiTotZneg->getNbinsX(), + meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmin(), + meETLTrackEffPhiTotZneg->getTH1()->GetXaxis()->GetXmax()); meEtlPhiEff_[1] = ibook.book1D("EtlPhiEffZnegD2", "Track Efficiency VS Phi (-Z, Second Disk);#phi [rad];Efficiency", meETLTrackEffPhiTotZneg->getNbinsX(), @@ -133,11 +135,12 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meETLTrackEffEtaTotZpos->getNbinsX(), meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmin(), meETLTrackEffEtaTotZpos->getTH1()->GetXaxis()->GetXmax()); - meEtlPhiEff_[2] = ibook.book1D("EtlPhiEffZposD1", - "Track Efficiency VS Phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi [rad];Efficiency", - meETLTrackEffPhiTotZpos->getNbinsX(), - meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(), - meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax()); + meEtlPhiEff_[2] = + ibook.book1D("EtlPhiEffZposD1", + "Track Efficiency VS Phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi [rad];Efficiency", + meETLTrackEffPhiTotZpos->getNbinsX(), + meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmin(), + meETLTrackEffPhiTotZpos->getTH1()->GetXaxis()->GetXmax()); meEtlPhiEff_[3] = ibook.book1D("EtlPhiEffZposD2", "Track Efficiency VS Phi (+Z, Second Disk);#phi [rad];Efficiency", meETLTrackEffPhiTotZpos->getNbinsX(), @@ -156,7 +159,7 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meBtlEtaEff_->getTH1()->SetMinimum(0.); meBtlPhiEff_->getTH1()->SetMinimum(0.); meBtlPtEff_->getTH1()->SetMinimum(0.); - for (int i=0; i<4; i++) { + for (int i = 0; i < 4; i++) { meEtlEtaEff_[i]->getTH1()->SetMinimum(0.); meEtlPhiEff_[i]->getTH1()->SetMinimum(0.); meEtlPtEff_[i]->getTH1()->SetMinimum(0.); @@ -226,7 +229,7 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett } meEtlEtaEff_[1]->setBinContent(ibin, eff); meEtlEtaEff_[1]->setBinError(ibin, bin_err); - } + } for (int ibin = 1; ibin <= meETLTrackEffEtaTotZpos->getNbinsX(); ibin++) { double eff = meETLTrackEffEtaMtdZposD1->getBinContent(ibin) / meETLTrackEffEtaTotZpos->getBinContent(ibin); @@ -269,7 +272,7 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meEtlPhiEff_[0]->setBinContent(ibin, eff); meEtlPhiEff_[0]->setBinError(ibin, bin_err); } - + for (int ibin = 1; ibin <= meETLTrackEffPhiTotZneg->getNbinsX(); ibin++) { double eff = meETLTrackEffPhiMtdZnegD2->getBinContent(ibin) / meETLTrackEffPhiTotZneg->getBinContent(ibin); double bin_err = @@ -282,8 +285,7 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett } meEtlPhiEff_[1]->setBinContent(ibin, eff); meEtlPhiEff_[1]->setBinError(ibin, bin_err); - - } + } for (int ibin = 1; ibin <= meETLTrackEffPhiTotZpos->getNbinsX(); ibin++) { double eff = meETLTrackEffPhiMtdZposD1->getBinContent(ibin) / meETLTrackEffPhiTotZpos->getBinContent(ibin); @@ -354,7 +356,7 @@ void MtdGlobalRecoHarvester::dqmEndJob(DQMStore::IBooker& ibook, DQMStore::IGett meEtlPtEff_[2]->setBinContent(ibin, eff); meEtlPtEff_[2]->setBinError(ibin, bin_err); } - + for (int ibin = 1; ibin <= meETLTrackEffPtTotZpos->getNbinsX(); ibin++) { double eff = meETLTrackEffPtMtdZposD2->getBinContent(ibin) / meETLTrackEffPtTotZpos->getBinContent(ibin); double bin_err = diff --git a/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc b/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc index a0d7c7306a7c9..6b3ff43c366da 100644 --- a/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc @@ -20,12 +20,7 @@ #include "DataFormats/Common/interface/RefVector.h" #include "DataFormats/TrackReco/interface/Track.h" -//#include "DataFormats/TrackReco/interface/TrackFwd.h" -//#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" -//#include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h" #include "DataFormats/VertexReco/interface/Vertex.h" -//#include "DataFormats/VertexReco/interface/VertexFwd.h" -//#include "DataFormats/TrackerRecHit2D/interface/MTDTrackingRecHit.h" #include "Geometry/Records/interface/MTDDigiGeometryRecord.h" #include "Geometry/Records/interface/MTDTopologyRcd.h" @@ -105,8 +100,10 @@ void MtdGlobalRecoValidation::analyze(const edm::Event& iEvent, const edm::Event bool topo1Dis = false; bool topo2Dis = false; - if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo1Dis = true; - if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) topo2Dis = true; + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + topo1Dis = true; + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + topo2Dis = true; auto RecTrackHandle = makeValid(iEvent.getHandle(RecTrackToken_)); auto RecVertexHandle = makeValid(iEvent.getHandle(RecVertexToken_)); @@ -171,30 +168,30 @@ void MtdGlobalRecoValidation::analyze(const edm::Event& iEvent, const edm::Event ETLDetId ETLHit = hit->geographicalId(); if (topo2Dis) { - if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 1 ) ) { + if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 1)) { MTDEtlZnegD1 = true; numMTDEtlvalidhits++; } - if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 2 ) ) { + if ((ETLHit.zside() == -1) && (ETLHit.nDisc() == 2)) { MTDEtlZnegD2 = true; numMTDEtlvalidhits++; } - if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 1 ) ) { + if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 1)) { MTDEtlZposD1 = true; numMTDEtlvalidhits++; } - if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 2 ) ) { + if ((ETLHit.zside() == 1) && (ETLHit.nDisc() == 2)) { MTDEtlZposD2 = true; numMTDEtlvalidhits++; } } if (topo1Dis) { - if (ETLHit.zside() == -1) { + if (ETLHit.zside() == -1) { MTDEtlZnegD1 = true; numMTDEtlvalidhits++; } - if (ETLHit.zside() == 1) { + if (ETLHit.zside() == 1) { MTDEtlZposD1 = true; numMTDEtlvalidhits++; } @@ -264,10 +261,14 @@ void MtdGlobalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, meBTLTrackEffPhiMtd_ = ibook.book1D("TrackBTLEffPhiMtd", "Track efficiency vs phi (Mtd);#phi_{RECO} [rad]", 100, -3.2, 3.2); meBTLTrackEffPtMtd_ = ibook.book1D("TrackBTLEffPtMtd", "Track efficiency vs pt (Mtd);pt_{RECO} [GeV]", 50, 0, 10); - meETLTrackRPTime_[0] = ibook.book1D("TrackETLRPTimeZnegD1", "Track t0 with respect to R.P. (-Z, Firstl Disk);t0 [ns]", 100, -1, 3); - meETLTrackRPTime_[1] = ibook.book1D("TrackETLRPTimeZnegD2", "Track t0 with respect to R.P. (-Z, Second Disk);t0 [ns]", 100, -1, 3); - meETLTrackRPTime_[2] = ibook.book1D("TrackETLRPTimeZposD1", "Track t0 with respect to R.P. (+Z, First Disk);t0 [ns]", 100, -1, 3); - meETLTrackRPTime_[3] = ibook.book1D("TrackETLRPTimeZposD2", "Track t0 with respect to R.P. (+Z, Second Disk);t0 [ns]", 100, -1, 3); + meETLTrackRPTime_[0] = + ibook.book1D("TrackETLRPTimeZnegD1", "Track t0 with respect to R.P. (-Z, Firstl Disk);t0 [ns]", 100, -1, 3); + meETLTrackRPTime_[1] = + ibook.book1D("TrackETLRPTimeZnegD2", "Track t0 with respect to R.P. (-Z, Second Disk);t0 [ns]", 100, -1, 3); + meETLTrackRPTime_[2] = + ibook.book1D("TrackETLRPTimeZposD1", "Track t0 with respect to R.P. (+Z, First Disk);t0 [ns]", 100, -1, 3); + meETLTrackRPTime_[3] = + ibook.book1D("TrackETLRPTimeZposD2", "Track t0 with respect to R.P. (+Z, Second Disk);t0 [ns]", 100, -1, 3); meETLTrackEffEtaTot_[0] = ibook.book1D("TrackETLEffEtaTotZneg", "Track efficiency vs eta (Tot) (-Z);#eta_{RECO}", 100, -3.2, -1.4); meETLTrackEffEtaTot_[1] = @@ -281,29 +282,53 @@ void MtdGlobalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, meETLTrackEffPtTot_[1] = ibook.book1D("TrackETLEffPtTotZpos", "Track efficiency vs pt (Tot) (+Z);pt_{RECO} [GeV]", 50, 0, 10); meETLTrackEffEtaMtd_[0] = - ibook.book1D("TrackETLEffEtaMtdZnegD1", "Track efficiency vs eta (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.4); - meETLTrackEffEtaMtd_[1] = - ibook.book1D("TrackETLEffEtaMtdZnegD2", "Track efficiency vs eta (Mtd) (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.4); + ibook.book1D("TrackETLEffEtaMtdZnegD1", + "Track efficiency vs eta (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", + 100, + -3.2, + -1.4); + meETLTrackEffEtaMtd_[1] = ibook.book1D( + "TrackETLEffEtaMtdZnegD2", "Track efficiency vs eta (Mtd) (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.4); meETLTrackEffEtaMtd_[2] = - ibook.book1D("TrackETLEffEtaMtdZposD1", "Track efficiency vs eta (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.4, 3.2); - meETLTrackEffEtaMtd_[3] = - ibook.book1D("TrackETLEffEtaMtdZposD2", "Track efficiency vs eta (Mtd) (+Z, Second Disk);#eta_{RECO}", 100, 1.4, 3.2); + ibook.book1D("TrackETLEffEtaMtdZposD1", + "Track efficiency vs eta (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", + 100, + 1.4, + 3.2); + meETLTrackEffEtaMtd_[3] = ibook.book1D( + "TrackETLEffEtaMtdZposD2", "Track efficiency vs eta (Mtd) (+Z, Second Disk);#eta_{RECO}", 100, 1.4, 3.2); meETLTrackEffPhiMtd_[0] = - ibook.book1D("TrackETLEffPhiMtdZnegD1", "Track efficiency vs phi (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); - meETLTrackEffPhiMtd_[1] = - ibook.book1D("TrackETLEffPhiMtdZnegD2", "Track efficiency vs phi (Mtd) (-Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + ibook.book1D("TrackETLEffPhiMtdZnegD1", + "Track efficiency vs phi (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", + 100, + -3.2, + 3.2); + meETLTrackEffPhiMtd_[1] = ibook.book1D( + "TrackETLEffPhiMtdZnegD2", "Track efficiency vs phi (Mtd) (-Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); meETLTrackEffPhiMtd_[2] = - ibook.book1D("TrackETLEffPhiMtdZposD2", "Track efficiency vs phi (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); - meETLTrackEffPhiMtd_[3] = - ibook.book1D("TrackETLEffPhiMtdZposD1", "Track efficiency vs phi (Mtd) (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + ibook.book1D("TrackETLEffPhiMtdZposD2", + "Track efficiency vs phi (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", + 100, + -3.2, + 3.2); + meETLTrackEffPhiMtd_[3] = ibook.book1D( + "TrackETLEffPhiMtdZposD1", "Track efficiency vs phi (Mtd) (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); meETLTrackEffPtMtd_[0] = - ibook.book1D("TrackETLEffPtMtdZnegD1", "Track efficiency vs pt (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);pt_{RECO} [GeV]", 50, 0, 10); - meETLTrackEffPtMtd_[1] = - ibook.book1D("TrackETLEffPtMtdZnegD2", "Track efficiency vs pt (Mtd) (-Z, Second Disk);pt_{RECO} [GeV]", 50, 0, 10); + ibook.book1D("TrackETLEffPtMtdZnegD1", + "Track efficiency vs pt (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);pt_{RECO} [GeV]", + 50, + 0, + 10); + meETLTrackEffPtMtd_[1] = ibook.book1D( + "TrackETLEffPtMtdZnegD2", "Track efficiency vs pt (Mtd) (-Z, Second Disk);pt_{RECO} [GeV]", 50, 0, 10); meETLTrackEffPtMtd_[2] = - ibook.book1D("TrackETLEffPtMtdZposD1", "Track efficiency vs pt (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);pt_{RECO} [GeV]", 50, 0, 10); - meETLTrackEffPtMtd_[3] = - ibook.book1D("TrackETLEffPtMtdZposD2", "Track efficiency vs pt (Mtd) (+Z, Second Disk);pt_{RECO} [GeV]", 50, 0, 10); + ibook.book1D("TrackETLEffPtMtdZposD1", + "Track efficiency vs pt (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);pt_{RECO} [GeV]", + 50, + 0, + 10); + meETLTrackEffPtMtd_[3] = ibook.book1D( + "TrackETLEffPtMtdZposD2", "Track efficiency vs pt (Mtd) (+Z, Second Disk);pt_{RECO} [GeV]", 50, 0, 10); meTrackNumHits_ = ibook.book1D("TrackNumHits", "Number of valid MTD hits per track ; Number of hits", 10, -5, 5); meVerZ_ = ibook.book1D("VerZ", "RECO Vertex Z;Z_{RECO} [cm]", 180, -18, 18); meVerTime_ = ibook.book1D("VerTime", "RECO Vertex Time;t0 [ns]", 100, -1, 1); From 0c3fe8014f87aaeafff94d883a779d443844c440 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Mon, 12 Oct 2020 15:44:48 +0200 Subject: [PATCH 526/778] migrate HitEff to use esconsumes --- .../SiStripHitEfficiency/interface/HitEff.h | 13 +++++ .../SiStripHitEfficiency/src/HitEff.cc | 50 +++++++------------ 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/CalibTracker/SiStripHitEfficiency/interface/HitEff.h b/CalibTracker/SiStripHitEfficiency/interface/HitEff.h index 380bbb271d71f..78e7dbb1fbe0f 100644 --- a/CalibTracker/SiStripHitEfficiency/interface/HitEff.h +++ b/CalibTracker/SiStripHitEfficiency/interface/HitEff.h @@ -12,6 +12,8 @@ #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h" #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h" +#include "RecoTracker/Record/interface/CkfComponentsRecord.h" +#include "RecoLocalTracker/Records/interface/TkStripCPERecord.h" #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h" #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" @@ -82,6 +84,17 @@ class HitEff : public edm::EDAnalyzer { const edm::EDGetTokenT<DetIdCollection> digis_token_; const edm::EDGetTokenT<MeasurementTrackerEvent> trackerEvent_token_; + // ES tokens + + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_; + const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomToken_; + const edm::ESGetToken<StripClusterParameterEstimator, TkStripCPERecord> cpeToken_; + const edm::ESGetToken<SiStripQuality, SiStripQualityRcd> siStripQualityToken_; + const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_; + const edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> measurementTkToken_; + const edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> chi2MeasurementEstimatorToken_; + const edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; + edm::ParameterSet conf_; TTree* traj; diff --git a/CalibTracker/SiStripHitEfficiency/src/HitEff.cc b/CalibTracker/SiStripHitEfficiency/src/HitEff.cc index 6f9e3755738c9..3c46552092184 100644 --- a/CalibTracker/SiStripHitEfficiency/src/HitEff.cc +++ b/CalibTracker/SiStripHitEfficiency/src/HitEff.cc @@ -47,8 +47,6 @@ #include "TrackingTools/DetLayers/interface/DetLayer.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h" - -#include "RecoTracker/Record/interface/CkfComponentsRecord.h" #include "CalibTracker/Records/interface/SiStripDetCablingRcd.h" #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" #include "CalibTracker/Records/interface/SiStripQualityRcd.h" @@ -81,6 +79,14 @@ HitEff::HitEff(const edm::ParameterSet& conf) consumes<edmNew::DetSetVector<SiStripCluster> >(conf.getParameter<edm::InputTag>("siStripClusters"))), digis_token_(consumes<DetIdCollection>(conf.getParameter<edm::InputTag>("siStripDigis"))), trackerEvent_token_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))), + topoToken_(esConsumes()), + geomToken_(esConsumes()), + cpeToken_(esConsumes(edm::ESInputTag("", "StripCPEfromTrackAngle"))), + siStripQualityToken_(esConsumes()), + magFieldToken_(esConsumes()), + measurementTkToken_(esConsumes()), + chi2MeasurementEstimatorToken_(esConsumes(edm::ESInputTag("", "Chi2"))), + propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial"))), conf_(conf) { compSettings = conf_.getUntrackedParameter<int>("CompressionSettings", -1); layers = conf_.getParameter<int>("Layer"); @@ -159,10 +165,7 @@ void HitEff::beginJob() { void HitEff::analyze(const edm::Event& e, const edm::EventSetup& es) { //Retrieve tracker topology from geometry - edm::ESHandle<TrackerTopology> tTopoHandle; - es.get<TrackerTopologyRcd>().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); - + const TrackerTopology* tTopo = &es.getData(topoToken_); siStripClusterInfo_.initEvent(es); // bool DEBUG = false; @@ -213,48 +216,32 @@ void HitEff::analyze(const edm::Event& e, const edm::EventSetup& es) { e.getByToken(clusters_token_, theClusters); //get tracker geometry - edm::ESHandle<TrackerGeometry> tracker; - es.get<TrackerDigiGeometryRecord>().get(tracker); + edm::ESHandle<TrackerGeometry> tracker = es.getHandle(geomToken_); const TrackerGeometry* tkgeom = &(*tracker); //get Cluster Parameter Estimator //std::string cpe = conf_.getParameter<std::string>("StripCPE"); - edm::ESHandle<StripClusterParameterEstimator> parameterestimator; - es.get<TkStripCPERecord>().get("StripCPEfromTrackAngle", parameterestimator); + edm::ESHandle<StripClusterParameterEstimator> parameterestimator = es.getHandle(cpeToken_); const StripClusterParameterEstimator& stripcpe(*parameterestimator); // get the SiStripQuality records - edm::ESHandle<SiStripQuality> SiStripQuality_; - //LQ commenting the try/catch that causes problem in 74X calibTree production - // try { - // es.get<SiStripQualityRcd>().get("forCluster",SiStripQuality_); - // } - // catch (...) { - es.get<SiStripQualityRcd>().get(SiStripQuality_); - // } - - edm::ESHandle<MagneticField> magFieldHandle; - es.get<IdealMagneticFieldRecord>().get(magFieldHandle); - const MagneticField* magField_ = magFieldHandle.product(); + edm::ESHandle<SiStripQuality> SiStripQuality_ = es.getHandle(siStripQualityToken_); + + const MagneticField* magField_ = &es.getData(magFieldToken_); // get the list of module IDs with FED-detected errors edm::Handle<DetIdCollection> fedErrorIds; //e.getByLabel("siStripDigis", fedErrorIds ); e.getByToken(digis_token_, fedErrorIds); - ESHandle<MeasurementTracker> measurementTrackerHandle; - es.get<CkfComponentsRecord>().get(measurementTrackerHandle); + ESHandle<MeasurementTracker> measurementTrackerHandle = es.getHandle(measurementTkToken_); edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent; //e.getByLabel("MeasurementTrackerEvent", measurementTrackerEvent); e.getByToken(trackerEvent_token_, measurementTrackerEvent); - edm::ESHandle<Chi2MeasurementEstimatorBase> est; - es.get<TrackingComponentsRecord>().get("Chi2", est); - - edm::ESHandle<Propagator> prop; - es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial", prop); - const Propagator* thePropagator = prop.product(); + const MeasurementEstimator* estimator = &es.getData(chi2MeasurementEstimatorToken_); + const Propagator* thePropagator = &es.getData(propagatorToken_); events++; @@ -462,7 +449,6 @@ void HitEff::analyze(const edm::Event& e, const edm::EventSetup& es) { std::vector<BarrelDetLayer const*> barrelTOBLayers = measurementTrackerHandle->geometricSearchTracker()->tobLayers(); const DetLayer* tob6 = barrelTOBLayers[barrelTOBLayers.size() - 1]; - const MeasurementEstimator* estimator = est.product(); const LayerMeasurements layerMeasurements{*measurementTrackerHandle, *measurementTrackerEvent}; const TrajectoryStateOnSurface tsosTOB5 = itm->updatedState(); auto tmp = layerMeasurements.measurements(*tob6, tsosTOB5, *thePropagator, *estimator); @@ -499,8 +485,6 @@ void HitEff::analyze(const edm::Event& e, const edm::EventSetup& es) { std::vector<const ForwardDetLayer*> negTecLayers = measurementTrackerHandle->geometricSearchTracker()->negTecLayers(); const DetLayer* tec9neg = negTecLayers[negTecLayers.size() - 1]; - - const MeasurementEstimator* estimator = est.product(); const LayerMeasurements layerMeasurements{*measurementTrackerHandle, *measurementTrackerEvent}; const TrajectoryStateOnSurface tsosTEC9 = itm->updatedState(); From a924ec8157c3207eff0fbe39b87b2c25baf88727 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 13 Oct 2020 15:34:49 +0200 Subject: [PATCH 527/778] Code check --- .../HGCalValidation/test/HGCalWaferStudy.cc | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/Validation/HGCalValidation/test/HGCalWaferStudy.cc b/Validation/HGCalValidation/test/HGCalWaferStudy.cc index 31a4d2aefaa95..de5444779f13a 100644 --- a/Validation/HGCalValidation/test/HGCalWaferStudy.cc +++ b/Validation/HGCalValidation/test/HGCalWaferStudy.cc @@ -77,7 +77,7 @@ class HGCalWaferStudy : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::on std::vector<int> layerSim_, layerDig_, layerFront_; std::vector<const HGCalDDDConstants*> hgcons_; std::vector<const HGCalGeometry*> hgeoms_; - std::vector<edm::EDGetTokenT<edm::PCaloHitContainer> > tok_hits_; + std::vector<edm::EDGetTokenT<edm::PCaloHitContainer>> tok_hits_; std::vector<edm::EDGetToken> tok_digi_; //histogram related stuff @@ -87,19 +87,20 @@ class HGCalWaferStudy : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::on }; HGCalWaferStudy::HGCalWaferStudy(const edm::ParameterSet& iConfig) - : nameDetectors_(iConfig.getParameter<std::vector<std::string> >("detectorNames")), - caloHitSources_(iConfig.getParameter<std::vector<std::string> >("caloHitSources")), - digiSources_(iConfig.getParameter<std::vector<edm::InputTag> >("digiSources")), + : nameDetectors_(iConfig.getParameter<std::vector<std::string>>("detectorNames")), + caloHitSources_(iConfig.getParameter<std::vector<std::string>>("caloHitSources")), + digiSources_(iConfig.getParameter<std::vector<edm::InputTag>>("digiSources")), ddTokens_{ - edm::vector_transform(nameDetectors_, - [this](const std::string& name) { - return esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}); - })}, - geomTokens_{ - edm::vector_transform(nameDetectors_, - [this](const std::string& name) { - return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}); - })}, + edm::vector_transform(nameDetectors_, + [this](const std::string& name) { + return esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>( + edm::ESInputTag{"", name}); + })}, + geomTokens_{edm::vector_transform( + nameDetectors_, + [this](const std::string& name) { + return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}); + })}, verbosity_(iConfig.getUntrackedParameter<int>("verbosity", 0)), nBinHit_(iConfig.getUntrackedParameter<int>("nBinHit", 600)), nBinDig_(iConfig.getUntrackedParameter<int>("nBinDig", 600)), @@ -108,10 +109,10 @@ HGCalWaferStudy::HGCalWaferStudy(const edm::ParameterSet& iConfig) xyMinDig_(iConfig.getUntrackedParameter<double>("xyMinDig", -300.0)), xyMaxDig_(iConfig.getUntrackedParameter<double>("xyMaxDig", 300.0)), ifNose_(iConfig.getUntrackedParameter<bool>("ifNose", false)), - layerMnSim_(iConfig.getUntrackedParameter<std::vector<int> >("layerMinSim")), - layerMxSim_(iConfig.getUntrackedParameter<std::vector<int> >("layerMaxSim")), - layerMnDig_(iConfig.getUntrackedParameter<std::vector<int> >("layerMinDig")), - layerMxDig_(iConfig.getUntrackedParameter<std::vector<int> >("layerMaxDig")) { + layerMnSim_(iConfig.getUntrackedParameter<std::vector<int>>("layerMinSim")), + layerMxSim_(iConfig.getUntrackedParameter<std::vector<int>>("layerMaxSim")), + layerMnDig_(iConfig.getUntrackedParameter<std::vector<int>>("layerMinDig")), + layerMxDig_(iConfig.getUntrackedParameter<std::vector<int>>("layerMaxDig")) { usesResource(TFileService::kSharedResource); for (auto const& source : caloHitSources_) { @@ -132,9 +133,9 @@ void HGCalWaferStudy::fillDescriptions(edm::ConfigurationDescriptions& descripti edm::InputTag("simHGCalUnsuppressedDigis", "HEfront")}; std::vector<int> layers = {28, 24}; std::vector<int> layerMin = {1, 1}; - desc.add<std::vector<std::string> >("detectorNames", names); - desc.add<std::vector<std::string> >("caloHitSources", simSources); - desc.add<std::vector<edm::InputTag> >("digiSources", digSources); + desc.add<std::vector<std::string>>("detectorNames", names); + desc.add<std::vector<std::string>>("caloHitSources", simSources); + desc.add<std::vector<edm::InputTag>>("digiSources", digSources); desc.addUntracked<int>("verbosity", 0); desc.addUntracked<int>("nBinHit", 600); desc.addUntracked<int>("nBinDig", 600); @@ -143,10 +144,10 @@ void HGCalWaferStudy::fillDescriptions(edm::ConfigurationDescriptions& descripti desc.addUntracked<double>("xyMinDig", -300.0); desc.addUntracked<double>("xyMaxDig", 300.0); desc.addUntracked<bool>("ifNose", false); - desc.addUntracked<std::vector<int> >("layerMaxSim", layers); - desc.addUntracked<std::vector<int> >("layerMaxDig", layers); - desc.addUntracked<std::vector<int> >("layerMinSim", layerMin); - desc.addUntracked<std::vector<int> >("layerMinDig", layerMin); + desc.addUntracked<std::vector<int>>("layerMaxSim", layers); + desc.addUntracked<std::vector<int>>("layerMaxDig", layers); + desc.addUntracked<std::vector<int>>("layerMinSim", layerMin); + desc.addUntracked<std::vector<int>>("layerMinDig", layerMin); descriptions.add("hgcalWaferStudy", desc); } From 2a2cdc559fa35dce8014dfa3c13f898362f83645 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 13 Oct 2020 16:23:11 +0200 Subject: [PATCH 528/778] Try to resolve the issue of Rmax for the HE section of HGCal --- .../data/hfnoseLayer/v1/hfnoseLayer.xml | 1 + .../data/hfnoseLayer/v2/hfnoseLayer.xml | 1 + .../data/hgcalEE/v10/hgcalEE.xml | 1 + .../data/hgcalEE/v12/hgcalEE.xml | 1 + .../data/hgcalEE/v14/hgcalEE.xml | 1 + .../data/hgcalEE/v9/hgcalEE.xml | 1 + .../data/hgcalEE/v9a/hgcalEE.xml | 1 + .../data/hgcalHEmix/v10/hgcalHEmix.xml | 1 + .../data/hgcalHEmix/v11/hgcalHEmix.xml | 1 + .../data/hgcalHEmix/v12/hgcalHEmix.xml | 1 + .../data/hgcalHEmix/v14/hgcalHEmix.xml | 1 + .../data/hgcalHEmix/v9/hgcalHEmix.xml | 1 + .../data/hgcalHEmix/v9a/hgcalHEmix.xml | 1 + .../data/hgcalHEsil/v10/hgcalHEsil.xml | 1 + .../data/hgcalHEsil/v11/hgcalHEsil.xml | 1 + .../data/hgcalHEsil/v12/hgcalHEsil.xml | 1 + .../data/hgcalHEsil/v14/hgcalHEsil.xml | 1 + .../data/hgcalHEsil/v9/hgcalHEsil.xml | 1 + .../data/hgcalHEsil/v9a/hgcalHEsil.xml | 1 + .../HGCalCommonData/plugins/DDHGCalEEAlgo.cc | 19 ++++++++++-------- .../plugins/DDHGCalEEFileAlgo.cc | 15 +++++++------- .../plugins/dd4hep/DDHGCalEEAlgo.cc | 20 ++++++++++--------- .../plugins/dd4hep/DDHGCalEEFileAlgo.cc | 15 +++++++------- 23 files changed, 57 insertions(+), 31 deletions(-) diff --git a/Geometry/ForwardCommonData/data/hfnoseLayer/v1/hfnoseLayer.xml b/Geometry/ForwardCommonData/data/hfnoseLayer/v1/hfnoseLayer.xml index 81c3415885a05..2aef86910b27e 100644 --- a/Geometry/ForwardCommonData/data/hfnoseLayer/v1/hfnoseLayer.xml +++ b/Geometry/ForwardCommonData/data/hfnoseLayer/v1/hfnoseLayer.xml @@ -38,6 +38,7 @@ 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="WaferCentering" value="0"/> <Numeric name="zMinBlock" value="[hfnose:HFNoseZ1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> diff --git a/Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml b/Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml index 000de1de0eb3b..f0d2353061722 100644 --- a/Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml +++ b/Geometry/ForwardCommonData/data/hfnoseLayer/v2/hfnoseLayer.xml @@ -48,6 +48,7 @@ 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="WaferCentering" value="0"/> <Numeric name="zMinBlock" value="[hfnose:HFNoseZ1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> diff --git a/Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml b/Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml index 9fd2bb585eba7..9c6dab450d121 100644 --- a/Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml +++ b/Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml @@ -66,6 +66,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zHGCalEE1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml b/Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml index 9fd2bb585eba7..9c6dab450d121 100644 --- a/Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml +++ b/Geometry/HGCalCommonData/data/hgcalEE/v12/hgcalEE.xml @@ -66,6 +66,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zHGCalEE1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml b/Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml index ceda98528c788..6a7527e75f506 100644 --- a/Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml +++ b/Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml @@ -66,6 +66,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zHGCalEE1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalEE/v9/hgcalEE.xml b/Geometry/HGCalCommonData/data/hgcalEE/v9/hgcalEE.xml index c53c5dd1fc592..36fcaa35ee86c 100644 --- a/Geometry/HGCalCommonData/data/hgcalEE/v9/hgcalEE.xml +++ b/Geometry/HGCalCommonData/data/hgcalEE/v9/hgcalEE.xml @@ -61,6 +61,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zMinEE]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalEE/v9a/hgcalEE.xml b/Geometry/HGCalCommonData/data/hgcalEE/v9a/hgcalEE.xml index a07bc1ae8c596..8d1c33dbf1098 100644 --- a/Geometry/HGCalCommonData/data/hgcalEE/v9a/hgcalEE.xml +++ b/Geometry/HGCalCommonData/data/hgcalEE/v9a/hgcalEE.xml @@ -61,6 +61,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zMinEE]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalHEmix/v10/hgcalHEmix.xml b/Geometry/HGCalCommonData/data/hgcalHEmix/v10/hgcalHEmix.xml index 2a9db9db34c38..7bb8cb53a9ddf 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEmix/v10/hgcalHEmix.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEmix/v10/hgcalHEmix.xml @@ -44,6 +44,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="[hgcal:FirstMixedLayer]"/> <Numeric name="AbsorberMode" value="1"/> + <Numeric name="SensitiveMode" value="0"/> <Vector name="TopMaterialNames" type="string" nEntries="6"> materials:Air, materials:Cables, materials:Air, materials:H_Scintillator, materials:Epoxy, diff --git a/Geometry/HGCalCommonData/data/hgcalHEmix/v11/hgcalHEmix.xml b/Geometry/HGCalCommonData/data/hgcalHEmix/v11/hgcalHEmix.xml index 21763da300a63..05bdb988ec3b2 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEmix/v11/hgcalHEmix.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEmix/v11/hgcalHEmix.xml @@ -44,6 +44,7 @@ 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2</Vector> <Numeric name="FirstLayer" value="[hgcal:FirstMixedLayer]"/> <Numeric name="AbsorberMode" value="1"/> + <Numeric name="SensitiveMode" value="0"/> <Vector name="TopMaterialNames" type="string" nEntries="6"> materials:Air, materials:Cables, materials:Air, materials:H_Scintillator, materials:Epoxy, diff --git a/Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml b/Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml index 21763da300a63..519425f1c6029 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEmix/v12/hgcalHEmix.xml @@ -44,6 +44,7 @@ 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2</Vector> <Numeric name="FirstLayer" value="[hgcal:FirstMixedLayer]"/> <Numeric name="AbsorberMode" value="1"/> + <Numeric name="SensitiveMode" value="1"/> <Vector name="TopMaterialNames" type="string" nEntries="6"> materials:Air, materials:Cables, materials:Air, materials:H_Scintillator, materials:Epoxy, diff --git a/Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml b/Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml index 9957803070140..5a2074d9b3ae3 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml @@ -44,6 +44,7 @@ 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2</Vector> <Numeric name="FirstLayer" value="[hgcal:FirstMixedLayer]"/> <Numeric name="AbsorberMode" value="1"/> + <Numeric name="SensitiveMode" value="1"/> <Vector name="TopMaterialNames" type="string" nEntries="6"> materials:Air, materials:Cables, materials:Air, materials:H_Scintillator, materials:Epoxy, diff --git a/Geometry/HGCalCommonData/data/hgcalHEmix/v9/hgcalHEmix.xml b/Geometry/HGCalCommonData/data/hgcalHEmix/v9/hgcalHEmix.xml index dca850909fc39..8440b81c572c4 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEmix/v9/hgcalHEmix.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEmix/v9/hgcalHEmix.xml @@ -47,6 +47,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="[hgcal:FirstMixedLayer]"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Vector name="TopMaterialNames" type="string" nEntries="3"> materials:Cables, materials:H_Scintillator, hgcalMaterial:HGC_G10-FR4</Vector> diff --git a/Geometry/HGCalCommonData/data/hgcalHEmix/v9a/hgcalHEmix.xml b/Geometry/HGCalCommonData/data/hgcalHEmix/v9a/hgcalHEmix.xml index 2b68d44bdd116..1ce2d184c93ef 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEmix/v9a/hgcalHEmix.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEmix/v9a/hgcalHEmix.xml @@ -68,6 +68,7 @@ 0, 0, 0, 0, 1, 0</Vector> <Numeric name="FirstLayer" value="[hgcal:FirstMixedLayer]"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zMinHEmix]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalHEsil/v10/hgcalHEsil.xml b/Geometry/HGCalCommonData/data/hgcalHEsil/v10/hgcalHEsil.xml index d60272905bb0a..d7542c2a8676c 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEsil/v10/hgcalHEsil.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEsil/v10/hgcalHEsil.xml @@ -48,6 +48,7 @@ 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="1"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zHGCalHEsil1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalHEsil/v11/hgcalHEsil.xml b/Geometry/HGCalCommonData/data/hgcalHEsil/v11/hgcalHEsil.xml index d00444a5cf5d3..6baa0c379881e 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEsil/v11/hgcalHEsil.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEsil/v11/hgcalHEsil.xml @@ -48,6 +48,7 @@ 1, 2, 1, 2, 1, 2, 1, 2</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="1"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zHGCalHEsil1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml b/Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml index d00444a5cf5d3..a099bcadb12c2 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEsil/v12/hgcalHEsil.xml @@ -48,6 +48,7 @@ 1, 2, 1, 2, 1, 2, 1, 2</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="1"/> + <Numeric name="SensitiveMode" value="1"/> <Numeric name="zMinBlock" value="[hgcal:zHGCalHEsil1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml b/Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml index 34b6b974dca3f..202c58423d053 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml @@ -47,6 +47,7 @@ <Vector name="LayerCenter" type="numeric" nEntries="8"> 1, 2, 1, 2, 1, 2, 1, 2</Vector> <Numeric name="FirstLayer" value="1"/> + <Numeric name="SensitiveMode" value="1"/> <Numeric name="AbsorberMode" value="1"/> <Numeric name="zMinBlock" value="[hgcal:zHGCalHEsil1]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> diff --git a/Geometry/HGCalCommonData/data/hgcalHEsil/v9/hgcalHEsil.xml b/Geometry/HGCalCommonData/data/hgcalHEsil/v9/hgcalHEsil.xml index 0ac084561b128..a27246a7ae140 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEsil/v9/hgcalHEsil.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEsil/v9/hgcalHEsil.xml @@ -46,6 +46,7 @@ 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zMinHEsil]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/data/hgcalHEsil/v9a/hgcalHEsil.xml b/Geometry/HGCalCommonData/data/hgcalHEsil/v9a/hgcalHEsil.xml index 81c5cce998a97..26589f142e4f9 100644 --- a/Geometry/HGCalCommonData/data/hgcalHEsil/v9a/hgcalHEsil.xml +++ b/Geometry/HGCalCommonData/data/hgcalHEsil/v9a/hgcalHEsil.xml @@ -46,6 +46,7 @@ 0, 0, 0, 0, 0, 0, 0, 0</Vector> <Numeric name="FirstLayer" value="1"/> <Numeric name="AbsorberMode" value="0"/> + <Numeric name="SensitiveMode" value="0"/> <Numeric name="zMinBlock" value="[hgcal:zMinHEsil]"/> <Vector name="rad100to200" type="numeric" nEntries="5"> [hgcal:rad100200P0], [hgcal:rad100200P1], [hgcal:rad100200P2], diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc b/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc index 07be811588f90..2e452eeed6f32 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc @@ -71,6 +71,7 @@ class DDHGCalEEAlgo : public DDAlgorithm { std::vector<int> layerCenter_; // Centering of the wafers int firstLayer_; // Copy # of the first sensitive layer int absorbMode_; // Absorber mode + int sensitiveMode_; // Sensitive mode double zMinBlock_; // Starting z-value of the block std::vector<double> rad100to200_; // Parameters for 120-200mum trans. std::vector<double> rad200to300_; // Parameters for 200-300mum trans. @@ -133,9 +134,10 @@ void DDHGCalEEAlgo::initialize(const DDNumericArguments& nArgs, layerSense_ = dbl_to_int(vArgs["LayerSense"]); firstLayer_ = (int)(nArgs["FirstLayer"]); absorbMode_ = (int)(nArgs["AbsorberMode"]); + sensitiveMode_ = (int)(nArgs["SensitiveMode"]); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "First Layere " << firstLayer_ << " and " - << "Absober mode " << absorbMode_; + edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and " + << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_; #endif layerCenter_ = dbl_to_int(vArgs["LayerCenter"]); #ifdef EDM_ML_DEBUG @@ -154,6 +156,8 @@ void DDHGCalEEAlgo::initialize(const DDNumericArguments& nArgs, break; } } + } else { + firstLayer_ = 1; } #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers"; @@ -301,15 +305,14 @@ void DDHGCalEEAlgo::constructLayers(const DDLogicalPart& module, DDCompactView& edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k]; #endif } else { - DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rinB, routF, 0.0, 2._pi); + double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); + double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); + DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi); glog = DDLogicalPart(solid.ddname(), matter, solid); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << solid.name() << " Tubs made of " << matName << ":" - << &matter << " of dimensions " << rinB << ", " << routF << ", " << hthick - << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" - << layerCenter_[copy - 1]; + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matName << ":" << &matter << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif - positionSensitive(glog, rinB, routF, zz, layerSense_[ly], layerCenter_[copy - 1], cpv); + positionSensitive(glog, rins, routs, zz, layerSense_[ly], layerCenter_[copy - firstLayer_], cpv); } DDTranslation r1(0, 0, zz); DDRotation rot; diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc index 832a89af8e043..a9d39c1af209f 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc @@ -65,6 +65,7 @@ class DDHGCalEEFileAlgo : public DDAlgorithm { std::vector<int> layerCenter_; // Centering of the wafers int firstLayer_; // Copy # of the first sensitive layer int absorbMode_; // Absorber mode + int sensitiveMode_; // Sensitive mode double zMinBlock_; // Starting z-value of the block std::vector<double> rad100to200_; // Parameters for 120-200mum trans. std::vector<double> rad200to300_; // Parameters for 200-300mum trans. @@ -127,9 +128,10 @@ void DDHGCalEEFileAlgo::initialize(const DDNumericArguments& nArgs, layerSense_ = dbl_to_int(vArgs["LayerSense"]); firstLayer_ = (int)(nArgs["FirstLayer"]); absorbMode_ = (int)(nArgs["AbsorberMode"]); + sensitiveMode_ = (int)(nArgs["SensitiveMode"]); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and " - << "Absober mode " << absorbMode_; + << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_; #endif layerCenter_ = dbl_to_int(vArgs["LayerCenter"]); #ifdef EDM_ML_DEBUG @@ -305,15 +307,14 @@ void DDHGCalEEFileAlgo::constructLayers(const DDLogicalPart& module, DDCompactVi edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k]; #endif } else { - DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rinB, routF, 0.0, 2._pi); + double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); + double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); + DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi); glog = DDLogicalPart(solid.ddname(), matter, solid); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matName << ":" - << &matter << " of dimensions " << rinB << ", " << routF << ", " << hthick - << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" - << layerCenter_[copy - firstLayer_]; + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matName << ":" << &matter << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif - positionSensitive(glog, rinB, routF, zz, layerSense_[ly], (copy - firstLayer_), cpv); + positionSensitive(glog, rins, routs, zz, layerSense_[ly], (copy - firstLayer_), cpv); } DDTranslation r1(0, 0, zz); DDRotation rot; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc index b30553e2155be..07ac3f5f772cc 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc @@ -42,6 +42,7 @@ struct HGCalEEAlgo { std::vector<int> layerCenter_; // Centering of the wafers int firstLayer_; // Copy # of the first sensitive layer int absorbMode_; // Absorber mode + int sensitiveMode_; // Sensitive mode double zMinBlock_; // Starting z-value of the block std::vector<double> rad100to200_; // Parameters for 120-200mum trans. std::vector<double> rad200to300_; // Parameters for 200-300mum trans. @@ -99,10 +100,10 @@ struct HGCalEEAlgo { layerSense_ = args.value<std::vector<int>>("LayerSense"); firstLayer_ = args.value<int>("FirstLayer"); absorbMode_ = args.value<int>("AbsorberMode"); - + sensitiveMode_ = args.value<int>("SensitiveMode"); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "First Layere " << firstLayer_ << " and " - << "Absober mode " << absorbMode_; + edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and " + << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_; #endif layerCenter_ = args.value<std::vector<int>>("LayerCenter"); #ifdef EDM_ML_DEBUG @@ -121,6 +122,8 @@ struct HGCalEEAlgo { break; } } + } else { + firstLayer_ = 1; } #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "There are " << layerType_.size() << " layers"; @@ -281,18 +284,17 @@ struct HGCalEEAlgo { << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k]; #endif } else { - dd4hep::Solid solid = dd4hep::Tube(rinB, routF, hthick, 0.0, 2. * cms_units::piRadians); + double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); + double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); + dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi); ns.addSolidNS(ns.prepend(name), solid); glog = dd4hep::Volume(solid.name(), solid, matter); ns.addVolumeNS(glog); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << solid.name() << " Tubs made of " << matName - << " of dimensions " << rinB << ", " << routF << ", " << hthick - << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" - << layerCenter_[copy - 1]; + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif - PositionSensitive(ctxt, e, glog, rinB, routF, zz, layerSense_[ly], layerCenter_[copy - 1]); //, cpv); + PositionSensitive(ctxt, e, glog, rins, routs, zz, layerSense_[ly], layerCenter_[copy - firstLayer_]); //, cpv); } dd4hep::Position r1(0, 0, zz); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc index 64888112e560f..d7519f2dc26a5 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc @@ -63,9 +63,10 @@ struct HGCalEEFileAlgo { layerSense_ = args.value<std::vector<int>>("LayerSense"); firstLayer_ = args.value<int>("FirstLayer"); absorbMode_ = args.value<int>("AbsorberMode"); + sensitiveMode_ = args.value<int>("SensitiveMode"); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and " - << "Absober mode " << absorbMode_; + << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_; #endif layerCenter_ = args.value<std::vector<int>>("LayerCenter"); #ifdef EDM_ML_DEBUG @@ -220,18 +221,17 @@ struct HGCalEEFileAlgo { << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k]; #endif } else { - dd4hep::Solid solid = dd4hep::Tube(rinB, routF, hthick, 0.0, 2._pi); + double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); + double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); + dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi); ns.addSolidNS(ns.prepend(name), solid); glog = dd4hep::Volume(solid.name(), solid, matter); ns.addVolumeNS(glog); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << rinB << ", " << routF << ", " << hthick - << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" - << layerCenter_[copy - firstLayer_]; + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif - positionSensitive(ctxt, e, glog, rinB, routF, zz, layerSense_[ly], (copy - firstLayer_)); + positionSensitive(ctxt, e, glog, rins, routs, zz, layerSense_[ly], (copy - firstLayer_)); } dd4hep::Position r1(0, 0, zz); @@ -374,6 +374,7 @@ struct HGCalEEFileAlgo { std::vector<int> layerCenter_; // Centering of the wafers int firstLayer_; // Copy # of the first sensitive layer int absorbMode_; // Absorber mode + int sensitiveMode_; // Sensitive mode double zMinBlock_; // Starting z-value of the block std::vector<double> rad100to200_; // Parameters for 120-200mum trans. std::vector<double> rad200to300_; // Parameters for 200-300mum trans. From adf2d590ae5384240895f4e93b0ba0214c39a637 Mon Sep 17 00:00:00 2001 From: Juliette <juliette.alimena@cern.ch> Date: Tue, 13 Oct 2020 16:30:07 +0200 Subject: [PATCH 529/778] fix for displaced susy relval production --- ...0_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py | 788 ++++++++++++++++++ .../python/relval_standard.py | 2 +- .../python/relval_steps.py | 6 +- 3 files changed, 792 insertions(+), 4 deletions(-) create mode 100644 Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py diff --git a/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py new file mode 100644 index 0000000000000..064453f26450b --- /dev/null +++ b/Configuration/Generator/python/DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff.py @@ -0,0 +1,788 @@ +FLAVOR = 'stop' +COM_ENERGY = 13000. # GeV +MASS_POINT = 300 # GeV +CROSS_SECTION = 8.51615 # pb +CTAU_POINT = 1000 # mm +SLHA_TABLE = """## Important note! +## This file has been modified by hand to give the gluino and the +## stop_1 a very narrow width, such that it can be used to try out +## the R-hadron machinery. It is not a realistic SUSY scenario. +## +##****************************************************************** +## MadGraph/MadEvent * +##****************************************************************** +## * +## param_card corresponding the SPS point 1a (by SoftSusy 2.0.5) * +## * +##****************************************************************** +## Les Houches friendly file for the (MS)SM parameters of MadGraph * +## SM parameter set and decay widths produced by MSSMCalc * +##****************************************************************** +##*Please note the following IMPORTANT issues: * +## * +##0. REFRAIN from editing this file by hand! Some of the parame- * +## ters are not independent. Always use a calculator. * +## * +##1. alpha_S(MZ) has been used in the calculation of the parameters* +## This value is KEPT by madgraph when no pdf are used lpp(i)=0, * +## but, for consistency, it will be reset by madgraph to the * +## value expected IF the pdfs for collisions with hadrons are * +## used. * +## * +##2. Values of the charm and bottom kinematic (pole) masses are * +## those used in the matrix elements and phase space UNLESS they * +## are set to ZERO from the start in the model (particles.dat) * +## This happens, for example, when using 5-flavor QCD where * +## charm and bottom are treated as partons in the initial state * +## and a zero mass might be hardwired in the model definition. * +## * +## The SUSY decays have calculated using SDECAY 1.1a * +## * +##****************************************************************** +BLOCK DCINFO # Decay Program information + 1 SDECAY # decay calculator + 2 1.1a # version number +BLOCK SPINFO # Spectrum calculator information + 1 SOFTSUSY # spectrum calculator + 2 2.0.5 # version number +BLOCK MODSEL # Model selection + 1 1 sugra +BLOCK SMINPUTS # Standard Model inputs + 1 1.27934000E+02 # alpha_em^-1(M_Z)^MSbar + 2 1.16637000E-05 # G_F [GeV^-2] + 3 1.18000000E-01 # alpha_S(M_Z)^MSbar + 4 9.11876000E+01 # M_Z pole mass + 5 4.25000000E+00 # mb(mb)^MSbar + 6 1.75000000E+02 # mt pole mass + 7 1.77700000E+00 # mtau pole mass +BLOCK MINPAR # Input parameters - minimal models + 1 1.00000000E+02 # m0 + 2 2.50000000E+02 # m12 + 3 1.00000000E+01 # tanb + 4 1.00000000E+00 # sign(mu) + 5 -1.00000000E+02 # A0 +BLOCK MASS # Mass Spectrum +# PDG code mass particle + 5 4.88991651E+00 # b-quark pole mass calculated from mb(mb)_Msbar + 6 1.75000000E+02 # mt pole mass (not read by ME) + 24 7.98290131E+01 # W+ + 25 1.10899057E+02 # h + 35 3.99960116E+05 # H + 36 3.99583917E+05 # A + 37 4.07879012E+05 # H+ + 1000001 5.68441109E+05 # ~d_L + 2000001 5.45228462E+05 # ~d_R + 1000002 5.61119014E+05 # ~u_L + 2000002 5.49259265E+05 # ~u_R + 1000003 5.68441109E+05 # ~s_L + 2000003 5.45228462E+05 # ~s_R + 1000004 5.61119014E+05 # ~c_L + 2000004 5.49259265E+05 # ~c_R + 1000005 5.13065179E+05 # ~b_1 + 2000005 5.43726676E+05 # ~b_2 + 1000006 300.00 # ~t_1 + 2000006 5.85785818E+05 # ~t_2 + 1000011 2.02915690E+05 # ~e_L + 2000011 1.44102799E+05 # ~e_R + 1000012 1.85258326E+05 # ~nu_eL + 1000013 2.02915690E+05 # ~mu_L + 2000013 1.44102799E+05 # ~mu_R + 1000014 1.85258326E+05 # ~nu_muL + 1000015 1.34490864E+05 # ~tau_1 + 2000015 2.06867805E+05 # ~tau_2 + 1000016 1.84708464E+05 # ~nu_tauL + 1000021 5.0E+05 # ~g + 1000022 9.66880686E+05 # ~chi_10 + 1000023 1.81088157E+05 # ~chi_20 + 1000025 -3.63756027E+05 # ~chi_30 + 1000035 3.81729382E+05 # ~chi_40 + 1000024 1.81696474E+05 # ~chi_1+ + 1000037 3.79939320E+05 # ~chi_2+ +BLOCK NMIX # Neutralino Mixing Matrix + 1 1 9.86364430E-01 # N_11 + 1 2 -5.31103553E-02 # N_12 + 1 3 1.46433995E-01 # N_13 + 1 4 -5.31186117E-02 # N_14 + 2 1 9.93505358E-02 # N_21 + 2 2 9.44949299E-01 # N_22 + 2 3 -2.69846720E-01 # N_23 + 2 4 1.56150698E-01 # N_24 + 3 1 -6.03388002E-02 # N_31 + 3 2 8.77004854E-02 # N_32 + 3 3 6.95877493E-01 # N_33 + 3 4 7.10226984E-01 # N_34 + 4 1 -1.16507132E-01 # N_41 + 4 2 3.10739017E-01 # N_42 + 4 3 6.49225960E-01 # N_43 + 4 4 -6.84377823E-01 # N_44 +BLOCK UMIX # Chargino Mixing Matrix U + 1 1 9.16834859E-01 # U_11 + 1 2 -3.99266629E-01 # U_12 + 2 1 3.99266629E-01 # U_21 + 2 2 9.16834859E-01 # U_22 +BLOCK VMIX # Chargino Mixing Matrix V + 1 1 9.72557835E-01 # V_11 + 1 2 -2.32661249E-01 # V_12 + 2 1 2.32661249E-01 # V_21 + 2 2 9.72557835E-01 # V_22 +BLOCK STOPMIX # Stop Mixing Matrix + 1 1 5.53644960E-01 # O_{11} + 1 2 8.32752820E-01 # O_{12} + 2 1 8.32752820E-01 # O_{21} + 2 2 -5.53644960E-01 # O_{22} +BLOCK SBOTMIX # Sbottom Mixing Matrix + 1 1 9.38737896E-01 # O_{11} + 1 2 3.44631925E-01 # O_{12} + 2 1 -3.44631925E-01 # O_{21} + 2 2 9.38737896E-01 # O_{22} +BLOCK STAUMIX # Stau Mixing Matrix + 1 1 2.82487190E-01 # O_{11} + 1 2 9.59271071E-01 # O_{12} + 2 1 9.59271071E-01 # O_{21} + 2 2 -2.82487190E-01 # O_{22} +BLOCK ALPHA # Higgs mixing + -1.13825210E-01 # Mixing angle in the neutral Higgs boson sector +BLOCK HMIX Q= 4.67034192E+02 # DRbar Higgs Parameters + 1 3.57680977E+02 # mu(Q)MSSM DRbar + 2 9.74862403E+00 # tan beta(Q)MSSM DRba + 3 2.44894549E+02 # higgs vev(Q)MSSM DRb + 4 1.66439065E+05 # mA^2(Q)MSSM DRbar +BLOCK GAUGE Q= 4.67034192E+02 # The gauge couplings + 3 1.10178679E+00 # g3(Q) MSbar +BLOCK AU Q= 4.67034192E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_u(Q) DRbar + 2 2 0.00000000E+00 # A_c(Q) DRbar + 3 3 -4.98129778E+02 # A_t(Q) DRbar +BLOCK AD Q= 4.67034192E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_d(Q) DRbar + 2 2 0.00000000E+00 # A_s(Q) DRbar + 3 3 -7.97274397E+02 # A_b(Q) DRbar +BLOCK AE Q= 4.67034192E+02 # The trilinear couplings + 1 1 0.00000000E+00 # A_e(Q) DRbar + 2 2 0.00000000E+00 # A_mu(Q) DRbar + 3 3 -2.51776873E+02 # A_tau(Q) DRbar +BLOCK YU Q= 4.67034192E+02 # The Yukawa couplings + 3 3 8.92844550E-01 # y_t(Q) DRbar +BLOCK YD Q= 4.67034192E+02 # The Yukawa couplings + 3 3 1.38840206E-01 # y_b(Q) DRbar +BLOCK YE Q= 4.67034192E+02 # The Yukawa couplings + 3 3 1.00890810E-01 # y_tau(Q) DRbar +BLOCK MSOFT Q= 4.67034192E+02 # The soft SUSY breaking masses at the scale Q + 1 1.01396534E+02 # M_1(Q) + 2 1.91504241E+02 # M_2(Q) + 3 5.88263031E+02 # M_3(Q) + 21 3.23374943E+04 # mH1^2(Q) + 22 -1.28800134E+05 # mH2^2(Q) + 31 1.95334764E+02 # meL(Q) + 32 1.95334764E+02 # mmuL(Q) + 33 1.94495956E+02 # mtauL(Q) + 34 1.36494061E+02 # meR(Q) + 35 1.36494061E+02 # mmuR(Q) + 36 1.34043428E+02 # mtauR(Q) + 41 5.47573466E+02 # mqL1(Q) + 42 5.47573466E+02 # mqL2(Q) + 43 4.98763839E+02 # mqL3(Q) + 44 5.29511195E+02 # muR(Q) + 45 5.29511195E+02 # mcR(Q) + 46 4.23245877E+02 # mtR(Q) + 47 5.23148807E+02 # mdR(Q) + 48 5.23148807E+02 # msR(Q) + 49 5.19867261E+02 # mbR(Q) +# ================= +# |The decay table| +# ================= +# - The multi-body decays for the inos, stops and sbottoms are included. +# PDG Width +DECAY 25 1.98610799E-03 # h decays +# BR NDA ID1 ID2 + 1.45642955E-01 2 15 -15 # BR(H1 -> tau- tau+) + 8.19070713E-01 2 5 -5 # BR(H1 -> b bb) + 3.36338173E-02 2 24 -24 # BR(H1 -> W+ W-) + 1.65251528E-03 2 23 23 # BR(H1 -> Z Z) +# PDG Width +DECAY 35 5.74801389E-01 # H decays +# BR NDA ID1 ID2 + 1.39072676E-01 2 15 -15 # BR(H -> tau- tau+) + 4.84110879E-02 2 6 -6 # BR(H -> t tb) + 7.89500067E-01 2 5 -5 # BR(H -> b bb) + 3.87681171E-03 2 24 -24 # BR(H -> W+ W-) + 1.80454752E-03 2 23 23 # BR(H -> Z Z) + 0.00000000E+00 2 24 -37 # BR(H -> W+ H-) + 0.00000000E+00 2 -24 37 # BR(H -> W- H+) + 0.00000000E+00 2 37 -37 # BR(H -> H+ H-) + 1.73348101E-02 2 25 25 # BR(H -> h h) + 0.00000000E+00 2 36 36 # BR(H -> A A) +# PDG Width +DECAY 36 6.32178488E-01 # A decays +# BR NDA ID1 ID2 + 1.26659725E-01 2 15 -15 # BR(A -> tau- tau+) + 1.51081526E-01 2 6 -6 # BR(A -> t tb) + 7.19406137E-01 2 5 -5 # BR(A -> b bb) + 2.85261228E-03 2 23 25 # BR(A -> Z h) + 0.00000000E+00 2 23 35 # BR(A -> Z H) + 0.00000000E+00 2 24 -37 # BR(A -> W+ H-) + 0.00000000E+00 2 -24 37 # BR(A -> W- H+) +# PDG Width +DECAY 37 5.46962813E-01 # H+ decays +# BR NDA ID1 ID2 + 1.49435135E-01 2 -15 16 # BR(H+ -> tau+ nu_tau) + 8.46811711E-01 2 6 -5 # BR(H+ -> t bb) + 3.75315387E-03 2 24 25 # BR(H+ -> W+ h) + 0.00000000E+00 2 24 35 # BR(H+ -> W+ H) + 0.00000000E+00 2 24 36 # BR(H+ -> W+ A) +# PDG Width +DECAY 1000021 0.00E+00 # gluino decays +# BR NDA ID1 ID2 + 2.08454202E-02 2 1000001 -1 # BR(~g -> ~d_L db) + 2.08454202E-02 2 -1000001 1 # BR(~g -> ~d_L* d ) + 5.07075274E-02 2 2000001 -1 # BR(~g -> ~d_R db) + 5.07075274E-02 2 -2000001 1 # BR(~g -> ~d_R* d ) + 2.89787767E-02 2 1000002 -2 # BR(~g -> ~u_L ub) + 2.89787767E-02 2 -1000002 2 # BR(~g -> ~u_L* u ) + 4.46872773E-02 2 2000002 -2 # BR(~g -> ~u_R ub) + 4.46872773E-02 2 -2000002 2 # BR(~g -> ~u_R* u ) + 2.08454202E-02 2 1000003 -3 # BR(~g -> ~s_L sb) + 2.08454202E-02 2 -1000003 3 # BR(~g -> ~s_L* s ) + 5.07075274E-02 2 2000003 -3 # BR(~g -> ~s_R sb) + 5.07075274E-02 2 -2000003 3 # BR(~g -> ~s_R* s ) + 2.89787767E-02 2 1000004 -4 # BR(~g -> ~c_L cb) + 2.89787767E-02 2 -1000004 4 # BR(~g -> ~c_L* c ) + 4.46872773E-02 2 2000004 -4 # BR(~g -> ~c_R cb) + 4.46872773E-02 2 -2000004 4 # BR(~g -> ~c_R* c ) + 1.05840237E-01 2 1000005 -5 # BR(~g -> ~b_1 bb) + 1.05840237E-01 2 -1000005 5 # BR(~g -> ~b_1* b ) + 5.56574805E-02 2 2000005 -5 # BR(~g -> ~b_2 bb) + 5.56574805E-02 2 -2000005 5 # BR(~g -> ~b_2* b ) + 4.80642793E-02 2 1000006 -6 # BR(~g -> ~t_1 tb) + 4.80642793E-02 2 -1000006 6 # BR(~g -> ~t_1* t ) + 0.00000000E+00 2 2000006 -6 # BR(~g -> ~t_2 tb) + 0.00000000E+00 2 -2000006 6 # BR(~g -> ~t_2* t ) +# PDG Width +DECAY 1000006 1.97326971684839e-16 # stop1 decays +# BR NDA ID1 ID2 + 3.33333333E-01 2 5 -11 + 3.33333333E-01 2 5 -13 + 3.33333333E-01 2 5 -15 +# 1.92947616E-01 2 1000022 6 # BR(~t_1 -> ~chi_10 t ) +# 1.17469211E-01 2 1000023 6 # BR(~t_1 -> ~chi_20 t ) +# 0.00000000E+00 2 1000025 6 # BR(~t_1 -> ~chi_30 t ) +# 0.00000000E+00 2 1000035 6 # BR(~t_1 -> ~chi_40 t ) +# 6.75747693E-01 2 1000024 5 # BR(~t_1 -> ~chi_1+ b ) +# 1.38354802E-02 2 1000037 5 # BR(~t_1 -> ~chi_2+ b ) +# 0.00000000E+00 2 1000021 6 # BR(~t_1 -> ~g t ) +# 0.00000000E+00 2 1000005 37 # BR(~t_1 -> ~b_1 H+) +# 0.00000000E+00 2 2000005 37 # BR(~t_1 -> ~b_2 H+) +# 0.00000000E+00 2 1000005 24 # BR(~t_1 -> ~b_1 W+) +# 0.00000000E+00 2 2000005 24 # BR(~t_1 -> ~b_2 W+) +# PDG Width +DECAY 2000006 7.37313275E+00 # stop2 decays +# BR NDA ID1 ID2 + 2.96825635E-02 2 1000022 6 # BR(~t_2 -> ~chi_10 t ) + 8.68035358E-02 2 1000023 6 # BR(~t_2 -> ~chi_20 t ) + 4.18408351E-02 2 1000025 6 # BR(~t_2 -> ~chi_30 t ) + 1.93281647E-01 2 1000035 6 # BR(~t_2 -> ~chi_40 t ) + 2.19632356E-01 2 1000024 5 # BR(~t_2 -> ~chi_1+ b ) + 2.02206148E-01 2 1000037 5 # BR(~t_2 -> ~chi_2+ b ) + 0.00000000E+00 2 1000021 6 # BR(~t_2 -> ~g t ) + 3.66397706E-02 2 1000006 25 # BR(~t_2 -> ~t_1 h ) + 0.00000000E+00 2 1000006 35 # BR(~t_2 -> ~t_1 H ) + 0.00000000E+00 2 1000006 36 # BR(~t_2 -> ~t_1 A ) + 0.00000000E+00 2 1000005 37 # BR(~t_2 -> ~b_1 H+) + 0.00000000E+00 2 2000005 37 # BR(~t_2 -> ~b_2 H+) + 1.89913144E-01 2 1000006 23 # BR(~t_2 -> ~t_1 Z ) + 0.00000000E+00 2 1000005 24 # BR(~t_2 -> ~b_1 W+) + 0.00000000E+00 2 2000005 24 # BR(~t_2 -> ~b_2 W+) +# PDG Width +DECAY 1000005 3.73627601E+00 # sbottom1 decays +# BR NDA ID1 ID2 + 4.43307074E-02 2 1000022 5 # BR(~b_1 -> ~chi_10 b ) + 3.56319904E-01 2 1000023 5 # BR(~b_1 -> ~chi_20 b ) + 5.16083795E-03 2 1000025 5 # BR(~b_1 -> ~chi_30 b ) + 1.04105080E-02 2 1000035 5 # BR(~b_1 -> ~chi_40 b ) + 4.45830064E-01 2 -1000024 6 # BR(~b_1 -> ~chi_1- t ) + 0.00000000E+00 2 -1000037 6 # BR(~b_1 -> ~chi_2- t ) + 0.00000000E+00 2 1000021 5 # BR(~b_1 -> ~g b ) + 0.00000000E+00 2 1000006 -37 # BR(~b_1 -> ~t_1 H-) + 0.00000000E+00 2 2000006 -37 # BR(~b_1 -> ~t_2 H-) + 1.37947979E-01 2 1000006 -24 # BR(~b_1 -> ~t_1 W-) + 0.00000000E+00 2 2000006 -24 # BR(~b_1 -> ~t_2 W-) +# PDG Width +DECAY 2000005 8.01566294E-01 # sbottom2 decays +# BR NDA ID1 ID2 + 2.86200590E-01 2 1000022 5 # BR(~b_2 -> ~chi_10 b ) + 1.40315912E-01 2 1000023 5 # BR(~b_2 -> ~chi_20 b ) + 5.32635592E-02 2 1000025 5 # BR(~b_2 -> ~chi_30 b ) + 7.48748121E-02 2 1000035 5 # BR(~b_2 -> ~chi_40 b ) + 1.79734294E-01 2 -1000024 6 # BR(~b_2 -> ~chi_1- t ) + 0.00000000E+00 2 -1000037 6 # BR(~b_2 -> ~chi_2- t ) + 0.00000000E+00 2 1000021 5 # BR(~b_2 -> ~g b ) + 0.00000000E+00 2 1000005 25 # BR(~b_2 -> ~b_1 h ) + 0.00000000E+00 2 1000005 35 # BR(~b_2 -> ~b_1 H ) + 0.00000000E+00 2 1000005 36 # BR(~b_2 -> ~b_1 A ) + 0.00000000E+00 2 1000006 -37 # BR(~b_2 -> ~t_1 H-) + 0.00000000E+00 2 2000006 -37 # BR(~b_2 -> ~t_2 H-) + 0.00000000E+00 2 1000005 23 # BR(~b_2 -> ~b_1 Z ) + 2.65610832E-01 2 1000006 -24 # BR(~b_2 -> ~t_1 W-) + 0.00000000E+00 2 2000006 -24 # BR(~b_2 -> ~t_2 W-) +# PDG Width +DECAY 1000002 5.47719539E+00 # sup_L decays +# BR NDA ID1 ID2 + 6.65240987E-03 2 1000022 2 # BR(~u_L -> ~chi_10 u) + 3.19051458E-01 2 1000023 2 # BR(~u_L -> ~chi_20 u) + 8.44929059E-04 2 1000025 2 # BR(~u_L -> ~chi_30 u) + 1.03485173E-02 2 1000035 2 # BR(~u_L -> ~chi_40 u) + 6.49499518E-01 2 1000024 1 # BR(~u_L -> ~chi_1+ d) + 1.36031676E-02 2 1000037 1 # BR(~u_L -> ~chi_2+ d) + 0.00000000E+00 2 1000021 2 # BR(~u_L -> ~g u) +# PDG Width +DECAY 2000002 1.15297292E+00 # sup_R decays +# BR NDA ID1 ID2 + 9.86377420E-01 2 1000022 2 # BR(~u_R -> ~chi_10 u) + 8.46640647E-03 2 1000023 2 # BR(~u_R -> ~chi_20 u) + 1.23894695E-03 2 1000025 2 # BR(~u_R -> ~chi_30 u) + 3.91722611E-03 2 1000035 2 # BR(~u_R -> ~chi_40 u) + 0.00000000E+00 2 1000024 1 # BR(~u_R -> ~chi_1+ d) + 0.00000000E+00 2 1000037 1 # BR(~u_R -> ~chi_2+ d) + 0.00000000E+00 2 1000021 2 # BR(~u_R -> ~g u) +# PDG Width +DECAY 1000001 5.31278772E+00 # sdown_L decays +# BR NDA ID1 ID2 + 2.32317969E-02 2 1000022 1 # BR(~d_L -> ~chi_10 d) + 3.10235077E-01 2 1000023 1 # BR(~d_L -> ~chi_20 d) + 1.52334771E-03 2 1000025 1 # BR(~d_L -> ~chi_30 d) + 1.48849798E-02 2 1000035 1 # BR(~d_L -> ~chi_40 d) + 6.06452481E-01 2 -1000024 2 # BR(~d_L -> ~chi_1- u) + 4.36723179E-02 2 -1000037 2 # BR(~d_L -> ~chi_2- u) + 0.00000000E+00 2 1000021 1 # BR(~d_L -> ~g d) +# PDG Width +DECAY 2000001 2.85812308E-01 # sdown_R decays +# BR NDA ID1 ID2 + 9.86529614E-01 2 1000022 1 # BR(~d_R -> ~chi_10 d) + 8.44510350E-03 2 1000023 1 # BR(~d_R -> ~chi_20 d) + 1.21172119E-03 2 1000025 1 # BR(~d_R -> ~chi_30 d) + 3.81356102E-03 2 1000035 1 # BR(~d_R -> ~chi_40 d) + 0.00000000E+00 2 -1000024 2 # BR(~d_R -> ~chi_1- u) + 0.00000000E+00 2 -1000037 2 # BR(~d_R -> ~chi_2- u) + 0.00000000E+00 2 1000021 1 # BR(~d_R -> ~g d) +# PDG Width +DECAY 1000004 5.47719539E+00 # scharm_L decays +# BR NDA ID1 ID2 + 6.65240987E-03 2 1000022 4 # BR(~c_L -> ~chi_10 c) + 3.19051458E-01 2 1000023 4 # BR(~c_L -> ~chi_20 c) + 8.44929059E-04 2 1000025 4 # BR(~c_L -> ~chi_30 c) + 1.03485173E-02 2 1000035 4 # BR(~c_L -> ~chi_40 c) + 6.49499518E-01 2 1000024 3 # BR(~c_L -> ~chi_1+ s) + 1.36031676E-02 2 1000037 3 # BR(~c_L -> ~chi_2+ s) + 0.00000000E+00 2 1000021 4 # BR(~c_L -> ~g c) +# PDG Width +DECAY 2000004 1.15297292E+00 # scharm_R decays +# BR NDA ID1 ID2 + 9.86377420E-01 2 1000022 4 # BR(~c_R -> ~chi_10 c) + 8.46640647E-03 2 1000023 4 # BR(~c_R -> ~chi_20 c) + 1.23894695E-03 2 1000025 4 # BR(~c_R -> ~chi_30 c) + 3.91722611E-03 2 1000035 4 # BR(~c_R -> ~chi_40 c) + 0.00000000E+00 2 1000024 3 # BR(~c_R -> ~chi_1+ s) + 0.00000000E+00 2 1000037 3 # BR(~c_R -> ~chi_2+ s) + 0.00000000E+00 2 1000021 4 # BR(~c_R -> ~g c) +# PDG Width +DECAY 1000003 5.31278772E+00 # sstrange_L decays +# BR NDA ID1 ID2 + 2.32317969E-02 2 1000022 3 # BR(~s_L -> ~chi_10 s) + 3.10235077E-01 2 1000023 3 # BR(~s_L -> ~chi_20 s) + 1.52334771E-03 2 1000025 3 # BR(~s_L -> ~chi_30 s) + 1.48849798E-02 2 1000035 3 # BR(~s_L -> ~chi_40 s) + 6.06452481E-01 2 -1000024 4 # BR(~s_L -> ~chi_1- c) + 4.36723179E-02 2 -1000037 4 # BR(~s_L -> ~chi_2- c) + 0.00000000E+00 2 1000021 3 # BR(~s_L -> ~g s) +# PDG Width +DECAY 2000003 2.85812308E-01 # sstrange_R decays +# BR NDA ID1 ID2 + 9.86529614E-01 2 1000022 3 # BR(~s_R -> ~chi_10 s) + 8.44510350E-03 2 1000023 3 # BR(~s_R -> ~chi_20 s) + 1.21172119E-03 2 1000025 3 # BR(~s_R -> ~chi_30 s) + 3.81356102E-03 2 1000035 3 # BR(~s_R -> ~chi_40 s) + 0.00000000E+00 2 -1000024 4 # BR(~s_R -> ~chi_1- c) + 0.00000000E+00 2 -1000037 4 # BR(~s_R -> ~chi_2- c) + 0.00000000E+00 2 1000021 3 # BR(~s_R -> ~g s) +# PDG Width +DECAY 1000011 2.13682161E-01 # selectron_L decays +# BR NDA ID1 ID2 + 5.73155386E-01 2 1000022 11 # BR(~e_L -> ~chi_10 e-) + 1.64522579E-01 2 1000023 11 # BR(~e_L -> ~chi_20 e-) + 0.00000000E+00 2 1000025 11 # BR(~e_L -> ~chi_30 e-) + 0.00000000E+00 2 1000035 11 # BR(~e_L -> ~chi_40 e-) + 2.62322035E-01 2 -1000024 12 # BR(~e_L -> ~chi_1- nu_e) + 0.00000000E+00 2 -1000037 12 # BR(~e_L -> ~chi_2- nu_e) +# PDG Width +DECAY 2000011 2.16121626E-01 # selectron_R decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 11 # BR(~e_R -> ~chi_10 e-) + 0.00000000E+00 2 1000023 11 # BR(~e_R -> ~chi_20 e-) + 0.00000000E+00 2 1000025 11 # BR(~e_R -> ~chi_30 e-) + 0.00000000E+00 2 1000035 11 # BR(~e_R -> ~chi_40 e-) + 0.00000000E+00 2 -1000024 12 # BR(~e_R -> ~chi_1- nu_e) + 0.00000000E+00 2 -1000037 12 # BR(~e_R -> ~chi_2- nu_e) +# PDG Width +DECAY 1000013 2.13682161E-01 # smuon_L decays +# BR NDA ID1 ID2 + 5.73155386E-01 2 1000022 13 # BR(~mu_L -> ~chi_10 mu-) + 1.64522579E-01 2 1000023 13 # BR(~mu_L -> ~chi_20 mu-) + 0.00000000E+00 2 1000025 13 # BR(~mu_L -> ~chi_30 mu-) + 0.00000000E+00 2 1000035 13 # BR(~mu_L -> ~chi_40 mu-) + 2.62322035E-01 2 -1000024 14 # BR(~mu_L -> ~chi_1- nu_mu) + 0.00000000E+00 2 -1000037 14 # BR(~mu_L -> ~chi_2- nu_mu) +# PDG Width +DECAY 2000013 2.16121626E-01 # smuon_R decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 13 # BR(~mu_R -> ~chi_10 mu-) + 0.00000000E+00 2 1000023 13 # BR(~mu_R -> ~chi_20 mu-) + 0.00000000E+00 2 1000025 13 # BR(~mu_R -> ~chi_30 mu-) + 0.00000000E+00 2 1000035 13 # BR(~mu_R -> ~chi_40 mu-) + 0.00000000E+00 2 -1000024 14 # BR(~mu_R -> ~chi_1- nu_mu) + 0.00000000E+00 2 -1000037 14 # BR(~mu_R -> ~chi_2- nu_mu) +# PDG Width +DECAY 1000015 1.48327268E-01 # stau_1 decays +# BR NDA ID1 ID2 + 1.00000000E+00 2 1000022 15 # BR(~tau_1 -> ~chi_10 tau-) + 0.00000000E+00 2 1000023 15 # BR(~tau_1 -> ~chi_20 tau-) + 0.00000000E+00 2 1000025 15 # BR(~tau_1 -> ~chi_30 tau-) + 0.00000000E+00 2 1000035 15 # BR(~tau_1 -> ~chi_40 tau-) + 0.00000000E+00 2 -1000024 16 # BR(~tau_1 -> ~chi_1- nu_tau) + 0.00000000E+00 2 -1000037 16 # BR(~tau_1 -> ~chi_2- nu_tau) + 0.00000000E+00 2 1000016 -37 # BR(~tau_1 -> ~nu_tauL H-) + 0.00000000E+00 2 1000016 -24 # BR(~tau_1 -> ~nu_tauL W-) +# PDG Width +DECAY 2000015 2.69906096E-01 # stau_2 decays +# BR NDA ID1 ID2 + 5.96653046E-01 2 1000022 15 # BR(~tau_2 -> ~chi_10 tau-) + 1.54536760E-01 2 1000023 15 # BR(~tau_2 -> ~chi_20 tau-) + 0.00000000E+00 2 1000025 15 # BR(~tau_2 -> ~chi_30 tau-) + 0.00000000E+00 2 1000035 15 # BR(~tau_2 -> ~chi_40 tau-) + 2.48810195E-01 2 -1000024 16 # BR(~tau_2 -> ~chi_1- nu_tau) + 0.00000000E+00 2 -1000037 16 # BR(~tau_2 -> ~chi_2- nu_tau) + 0.00000000E+00 2 1000016 -37 # BR(~tau_2 -> ~nu_tauL H-) + 0.00000000E+00 2 1000016 -24 # BR(~tau_2 -> ~nu_tauL W-) + 0.00000000E+00 2 1000015 25 # BR(~tau_2 -> ~tau_1 h) + 0.00000000E+00 2 1000015 35 # BR(~tau_2 -> ~tau_1 H) + 0.00000000E+00 2 1000015 36 # BR(~tau_2 -> ~tau_1 A) + 0.00000000E+00 2 1000015 23 # BR(~tau_2 -> ~tau_1 Z) +# PDG Width +DECAY 1000012 1.49881634E-01 # snu_eL decays +# BR NDA ID1 ID2 + 9.77700764E-01 2 1000022 12 # BR(~nu_eL -> ~chi_10 nu_e) + 8.11554922E-03 2 1000023 12 # BR(~nu_eL -> ~chi_20 nu_e) + 0.00000000E+00 2 1000025 12 # BR(~nu_eL -> ~chi_30 nu_e) + 0.00000000E+00 2 1000035 12 # BR(~nu_eL -> ~chi_40 nu_e) + 1.41836867E-02 2 1000024 11 # BR(~nu_eL -> ~chi_1+ e-) + 0.00000000E+00 2 1000037 11 # BR(~nu_eL -> ~chi_2+ e-) +# PDG Width +DECAY 1000014 1.49881634E-01 # snu_muL decays +# BR NDA ID1 ID2 + 9.77700764E-01 2 1000022 14 # BR(~nu_muL -> ~chi_10 nu_mu) + 8.11554922E-03 2 1000023 14 # BR(~nu_muL -> ~chi_20 nu_mu) + 0.00000000E+00 2 1000025 14 # BR(~nu_muL -> ~chi_30 nu_mu) + 0.00000000E+00 2 1000035 14 # BR(~nu_muL -> ~chi_40 nu_mu) + 1.41836867E-02 2 1000024 13 # BR(~nu_muL -> ~chi_1+ mu-) + 0.00000000E+00 2 1000037 13 # BR(~nu_muL -> ~chi_2+ mu-) +# PDG Width +DECAY 1000016 1.47518977E-01 # snu_tauL decays +# BR NDA ID1 ID2 + 9.85994529E-01 2 1000022 16 # BR(~nu_tauL -> ~chi_10 nu_tau) + 6.25129612E-03 2 1000023 16 # BR(~nu_tauL -> ~chi_20 nu_tau) + 0.00000000E+00 2 1000025 16 # BR(~nu_tauL -> ~chi_30 nu_tau) + 0.00000000E+00 2 1000035 16 # BR(~nu_tauL -> ~chi_40 nu_tau) + 7.75417479E-03 2 1000024 15 # BR(~nu_tauL -> ~chi_1+ tau-) + 0.00000000E+00 2 1000037 15 # BR(~nu_tauL -> ~chi_2+ tau-) + 0.00000000E+00 2 -1000015 -37 # BR(~nu_tauL -> ~tau_1+ H-) + 0.00000000E+00 2 -2000015 -37 # BR(~nu_tauL -> ~tau_2+ H-) + 0.00000000E+00 2 -1000015 -24 # BR(~nu_tauL -> ~tau_1+ W-) + 0.00000000E+00 2 -2000015 -24 # BR(~nu_tauL -> ~tau_2+ W-) +# PDG Width +DECAY 1000024 1.70414503E-02 # chargino1+ decays +# BR NDA ID1 ID2 + 0.00000000E+00 2 1000002 -1 # BR(~chi_1+ -> ~u_L db) + 0.00000000E+00 2 2000002 -1 # BR(~chi_1+ -> ~u_R db) + 0.00000000E+00 2 -1000001 2 # BR(~chi_1+ -> ~d_L* u ) + 0.00000000E+00 2 -2000001 2 # BR(~chi_1+ -> ~d_R* u ) + 0.00000000E+00 2 1000004 -3 # BR(~chi_1+ -> ~c_L sb) + 0.00000000E+00 2 2000004 -3 # BR(~chi_1+ -> ~c_R sb) + 0.00000000E+00 2 -1000003 4 # BR(~chi_1+ -> ~s_L* c ) + 0.00000000E+00 2 -2000003 4 # BR(~chi_1+ -> ~s_R* c ) + 0.00000000E+00 2 1000006 -5 # BR(~chi_1+ -> ~t_1 bb) + 0.00000000E+00 2 2000006 -5 # BR(~chi_1+ -> ~t_2 bb) + 0.00000000E+00 2 -1000005 6 # BR(~chi_1+ -> ~b_1* t ) + 0.00000000E+00 2 -2000005 6 # BR(~chi_1+ -> ~b_2* t ) + 0.00000000E+00 2 1000012 -11 # BR(~chi_1+ -> ~nu_eL e+ ) + 0.00000000E+00 2 1000014 -13 # BR(~chi_1+ -> ~nu_muL mu+ ) + 0.00000000E+00 2 1000016 -15 # BR(~chi_1+ -> ~nu_tau1 tau+) + 0.00000000E+00 2 -1000011 12 # BR(~chi_1+ -> ~e_L+ nu_e) + 0.00000000E+00 2 -2000011 12 # BR(~chi_1+ -> ~e_R+ nu_e) + 0.00000000E+00 2 -1000013 14 # BR(~chi_1+ -> ~mu_L+ nu_mu) + 0.00000000E+00 2 -2000013 14 # BR(~chi_1+ -> ~mu_R+ nu_mu) + 9.25161117E-01 2 -1000015 16 # BR(~chi_1+ -> ~tau_1+ nu_tau) + 0.00000000E+00 2 -2000015 16 # BR(~chi_1+ -> ~tau_2+ nu_tau) + 7.48388828E-02 2 1000022 24 # BR(~chi_1+ -> ~chi_10 W+) + 0.00000000E+00 2 1000023 24 # BR(~chi_1+ -> ~chi_20 W+) + 0.00000000E+00 2 1000025 24 # BR(~chi_1+ -> ~chi_30 W+) + 0.00000000E+00 2 1000035 24 # BR(~chi_1+ -> ~chi_40 W+) + 0.00000000E+00 2 1000022 37 # BR(~chi_1+ -> ~chi_10 H+) + 0.00000000E+00 2 1000023 37 # BR(~chi_1+ -> ~chi_20 H+) + 0.00000000E+00 2 1000025 37 # BR(~chi_1+ -> ~chi_30 H+) + 0.00000000E+00 2 1000035 37 # BR(~chi_1+ -> ~chi_40 H+) +# PDG Width +DECAY 1000037 2.48689510E+00 # chargino2+ decays +# BR NDA ID1 ID2 + 0.00000000E+00 2 1000002 -1 # BR(~chi_2+ -> ~u_L db) + 0.00000000E+00 2 2000002 -1 # BR(~chi_2+ -> ~u_R db) + 0.00000000E+00 2 -1000001 2 # BR(~chi_2+ -> ~d_L* u ) + 0.00000000E+00 2 -2000001 2 # BR(~chi_2+ -> ~d_R* u ) + 0.00000000E+00 2 1000004 -3 # BR(~chi_2+ -> ~c_L sb) + 0.00000000E+00 2 2000004 -3 # BR(~chi_2+ -> ~c_R sb) + 0.00000000E+00 2 -1000003 4 # BR(~chi_2+ -> ~s_L* c ) + 0.00000000E+00 2 -2000003 4 # BR(~chi_2+ -> ~s_R* c ) + 0.00000000E+00 2 1000006 -5 # BR(~chi_2+ -> ~t_1 bb) + 0.00000000E+00 2 2000006 -5 # BR(~chi_2+ -> ~t_2 bb) + 0.00000000E+00 2 -1000005 6 # BR(~chi_2+ -> ~b_1* t ) + 0.00000000E+00 2 -2000005 6 # BR(~chi_2+ -> ~b_2* t ) + 2.00968837E-02 2 1000012 -11 # BR(~chi_2+ -> ~nu_eL e+ ) + 2.00968837E-02 2 1000014 -13 # BR(~chi_2+ -> ~nu_muL mu+ ) + 2.74507395E-02 2 1000016 -15 # BR(~chi_2+ -> ~nu_tau1 tau+) + 5.20406111E-02 2 -1000011 12 # BR(~chi_2+ -> ~e_L+ nu_e) + 0.00000000E+00 2 -2000011 12 # BR(~chi_2+ -> ~e_R+ nu_e) + 5.20406111E-02 2 -1000013 14 # BR(~chi_2+ -> ~mu_L+ nu_mu) + 0.00000000E+00 2 -2000013 14 # BR(~chi_2+ -> ~mu_R+ nu_mu) + 2.82859898E-04 2 -1000015 16 # BR(~chi_2+ -> ~tau_1+ nu_tau) + 5.66729336E-02 2 -2000015 16 # BR(~chi_2+ -> ~tau_2+ nu_tau) + 2.31513269E-01 2 1000024 23 # BR(~chi_2+ -> ~chi_1+ Z ) + 6.76715120E-02 2 1000022 24 # BR(~chi_2+ -> ~chi_10 W+) + 2.93654849E-01 2 1000023 24 # BR(~chi_2+ -> ~chi_20 W+) + 0.00000000E+00 2 1000025 24 # BR(~chi_2+ -> ~chi_30 W+) + 0.00000000E+00 2 1000035 24 # BR(~chi_2+ -> ~chi_40 W+) + 1.78478848E-01 2 1000024 25 # BR(~chi_2+ -> ~chi_1+ h ) + 0.00000000E+00 2 1000024 35 # BR(~chi_2+ -> ~chi_1+ H ) + 0.00000000E+00 2 1000024 36 # BR(~chi_2+ -> ~chi_1+ A ) + 0.00000000E+00 2 1000022 37 # BR(~chi_2+ -> ~chi_10 H+) + 0.00000000E+00 2 1000023 37 # BR(~chi_2+ -> ~chi_20 H+) + 0.00000000E+00 2 1000025 37 # BR(~chi_2+ -> ~chi_30 H+) + 0.00000000E+00 2 1000035 37 # BR(~chi_2+ -> ~chi_40 H+) +# PDG Width +DECAY 1000022 0.00000000E+00 # neutralino1 decays +# PDG Width +DECAY 1000023 2.07770048E-02 # neutralino2 decays +# BR NDA ID1 ID2 + 0.00000000E+00 2 1000022 23 # BR(~chi_20 -> ~chi_10 Z ) + 0.00000000E+00 2 1000024 -24 # BR(~chi_20 -> ~chi_1+ W-) + 0.00000000E+00 2 -1000024 24 # BR(~chi_20 -> ~chi_1- W+) + 0.00000000E+00 2 1000037 -24 # BR(~chi_20 -> ~chi_2+ W-) + 0.00000000E+00 2 -1000037 24 # BR(~chi_20 -> ~chi_2- W+) + 0.00000000E+00 2 1000022 25 # BR(~chi_20 -> ~chi_10 h ) + 0.00000000E+00 2 1000022 35 # BR(~chi_20 -> ~chi_10 H ) + 0.00000000E+00 2 1000022 36 # BR(~chi_20 -> ~chi_10 A ) + 0.00000000E+00 2 1000024 -37 # BR(~chi_20 -> ~chi_1+ H-) + 0.00000000E+00 2 -1000024 37 # BR(~chi_20 -> ~chi_1- H+) + 0.00000000E+00 2 1000037 -37 # BR(~chi_20 -> ~chi_2+ H-) + 0.00000000E+00 2 -1000037 37 # BR(~chi_20 -> ~chi_2- H+) + 0.00000000E+00 2 1000002 -2 # BR(~chi_20 -> ~u_L ub) + 0.00000000E+00 2 -1000002 2 # BR(~chi_20 -> ~u_L* u ) + 0.00000000E+00 2 2000002 -2 # BR(~chi_20 -> ~u_R ub) + 0.00000000E+00 2 -2000002 2 # BR(~chi_20 -> ~u_R* u ) + 0.00000000E+00 2 1000001 -1 # BR(~chi_20 -> ~d_L db) + 0.00000000E+00 2 -1000001 1 # BR(~chi_20 -> ~d_L* d ) + 0.00000000E+00 2 2000001 -1 # BR(~chi_20 -> ~d_R db) + 0.00000000E+00 2 -2000001 1 # BR(~chi_20 -> ~d_R* d ) + 0.00000000E+00 2 1000004 -4 # BR(~chi_20 -> ~c_L cb) + 0.00000000E+00 2 -1000004 4 # BR(~chi_20 -> ~c_L* c ) + 0.00000000E+00 2 2000004 -4 # BR(~chi_20 -> ~c_R cb) + 0.00000000E+00 2 -2000004 4 # BR(~chi_20 -> ~c_R* c ) + 0.00000000E+00 2 1000003 -3 # BR(~chi_20 -> ~s_L sb) + 0.00000000E+00 2 -1000003 3 # BR(~chi_20 -> ~s_L* s ) + 0.00000000E+00 2 2000003 -3 # BR(~chi_20 -> ~s_R sb) + 0.00000000E+00 2 -2000003 3 # BR(~chi_20 -> ~s_R* s ) + 0.00000000E+00 2 1000006 -6 # BR(~chi_20 -> ~t_1 tb) + 0.00000000E+00 2 -1000006 6 # BR(~chi_20 -> ~t_1* t ) + 0.00000000E+00 2 2000006 -6 # BR(~chi_20 -> ~t_2 tb) + 0.00000000E+00 2 -2000006 6 # BR(~chi_20 -> ~t_2* t ) + 0.00000000E+00 2 1000005 -5 # BR(~chi_20 -> ~b_1 bb) + 0.00000000E+00 2 -1000005 5 # BR(~chi_20 -> ~b_1* b ) + 0.00000000E+00 2 2000005 -5 # BR(~chi_20 -> ~b_2 bb) + 0.00000000E+00 2 -2000005 5 # BR(~chi_20 -> ~b_2* b ) + 0.00000000E+00 2 1000011 -11 # BR(~chi_20 -> ~e_L- e+) + 0.00000000E+00 2 -1000011 11 # BR(~chi_20 -> ~e_L+ e-) + 2.95071995E-02 2 2000011 -11 # BR(~chi_20 -> ~e_R- e+) + 2.95071995E-02 2 -2000011 11 # BR(~chi_20 -> ~e_R+ e-) + 0.00000000E+00 2 1000013 -13 # BR(~chi_20 -> ~mu_L- mu+) + 0.00000000E+00 2 -1000013 13 # BR(~chi_20 -> ~mu_L+ mu-) + 2.95071995E-02 2 2000013 -13 # BR(~chi_20 -> ~mu_R- mu+) + 2.95071995E-02 2 -2000013 13 # BR(~chi_20 -> ~mu_R+ mu-) + 4.40985601E-01 2 1000015 -15 # BR(~chi_20 -> ~tau_1- tau+) + 4.40985601E-01 2 -1000015 15 # BR(~chi_20 -> ~tau_1+ tau-) + 0.00000000E+00 2 2000015 -15 # BR(~chi_20 -> ~tau_2- tau+) + 0.00000000E+00 2 -2000015 15 # BR(~chi_20 -> ~tau_2+ tau-) + 0.00000000E+00 2 1000012 -12 # BR(~chi_20 -> ~nu_eL nu_eb) + 0.00000000E+00 2 -1000012 12 # BR(~chi_20 -> ~nu_eL* nu_e ) + 0.00000000E+00 2 1000014 -14 # BR(~chi_20 -> ~nu_muL nu_mub) + 0.00000000E+00 2 -1000014 14 # BR(~chi_20 -> ~nu_muL* nu_mu ) + 0.00000000E+00 2 1000016 -16 # BR(~chi_20 -> ~nu_tau1 nu_taub) + 0.00000000E+00 2 -1000016 16 # BR(~chi_20 -> ~nu_tau1* nu_tau ) +# PDG Width +DECAY 1000025 1.91598495E+00 # neutralino3 decays +# BR NDA ID1 ID2 + 1.13226601E-01 2 1000022 23 # BR(~chi_30 -> ~chi_10 Z ) + 2.11969194E-01 2 1000023 23 # BR(~chi_30 -> ~chi_20 Z ) + 2.95329778E-01 2 1000024 -24 # BR(~chi_30 -> ~chi_1+ W-) + 2.95329778E-01 2 -1000024 24 # BR(~chi_30 -> ~chi_1- W+) + 0.00000000E+00 2 1000037 -24 # BR(~chi_30 -> ~chi_2+ W-) + 0.00000000E+00 2 -1000037 24 # BR(~chi_30 -> ~chi_2- W+) + 2.13076490E-02 2 1000022 25 # BR(~chi_30 -> ~chi_10 h ) + 0.00000000E+00 2 1000022 35 # BR(~chi_30 -> ~chi_10 H ) + 0.00000000E+00 2 1000022 36 # BR(~chi_30 -> ~chi_10 A ) + 1.24538329E-02 2 1000023 25 # BR(~chi_30 -> ~chi_20 h ) + 0.00000000E+00 2 1000023 35 # BR(~chi_30 -> ~chi_20 H ) + 0.00000000E+00 2 1000023 36 # BR(~chi_30 -> ~chi_20 A ) + 0.00000000E+00 2 1000024 -37 # BR(~chi_30 -> ~chi_1+ H-) + 0.00000000E+00 2 -1000024 37 # BR(~chi_30 -> ~chi_1- H+) + 0.00000000E+00 2 1000037 -37 # BR(~chi_30 -> ~chi_2+ H-) + 0.00000000E+00 2 -1000037 37 # BR(~chi_30 -> ~chi_2- H+) + 0.00000000E+00 2 1000002 -2 # BR(~chi_30 -> ~u_L ub) + 0.00000000E+00 2 -1000002 2 # BR(~chi_30 -> ~u_L* u ) + 0.00000000E+00 2 2000002 -2 # BR(~chi_30 -> ~u_R ub) + 0.00000000E+00 2 -2000002 2 # BR(~chi_30 -> ~u_R* u ) + 0.00000000E+00 2 1000001 -1 # BR(~chi_30 -> ~d_L db) + 0.00000000E+00 2 -1000001 1 # BR(~chi_30 -> ~d_L* d ) + 0.00000000E+00 2 2000001 -1 # BR(~chi_30 -> ~d_R db) + 0.00000000E+00 2 -2000001 1 # BR(~chi_30 -> ~d_R* d ) + 0.00000000E+00 2 1000004 -4 # BR(~chi_30 -> ~c_L cb) + 0.00000000E+00 2 -1000004 4 # BR(~chi_30 -> ~c_L* c ) + 0.00000000E+00 2 2000004 -4 # BR(~chi_30 -> ~c_R cb) + 0.00000000E+00 2 -2000004 4 # BR(~chi_30 -> ~c_R* c ) + 0.00000000E+00 2 1000003 -3 # BR(~chi_30 -> ~s_L sb) + 0.00000000E+00 2 -1000003 3 # BR(~chi_30 -> ~s_L* s ) + 0.00000000E+00 2 2000003 -3 # BR(~chi_30 -> ~s_R sb) + 0.00000000E+00 2 -2000003 3 # BR(~chi_30 -> ~s_R* s ) + 0.00000000E+00 2 1000006 -6 # BR(~chi_30 -> ~t_1 tb) + 0.00000000E+00 2 -1000006 6 # BR(~chi_30 -> ~t_1* t ) + 0.00000000E+00 2 2000006 -6 # BR(~chi_30 -> ~t_2 tb) + 0.00000000E+00 2 -2000006 6 # BR(~chi_30 -> ~t_2* t ) + 0.00000000E+00 2 1000005 -5 # BR(~chi_30 -> ~b_1 bb) + 0.00000000E+00 2 -1000005 5 # BR(~chi_30 -> ~b_1* b ) + 0.00000000E+00 2 2000005 -5 # BR(~chi_30 -> ~b_2 bb) + 0.00000000E+00 2 -2000005 5 # BR(~chi_30 -> ~b_2* b ) + 5.57220455E-04 2 1000011 -11 # BR(~chi_30 -> ~e_L- e+) + 5.57220455E-04 2 -1000011 11 # BR(~chi_30 -> ~e_L+ e-) + 1.25266782E-03 2 2000011 -11 # BR(~chi_30 -> ~e_R- e+) + 1.25266782E-03 2 -2000011 11 # BR(~chi_30 -> ~e_R+ e-) + 5.57220455E-04 2 1000013 -13 # BR(~chi_30 -> ~mu_L- mu+) + 5.57220455E-04 2 -1000013 13 # BR(~chi_30 -> ~mu_L+ mu-) + 1.25266782E-03 2 2000013 -13 # BR(~chi_30 -> ~mu_R- mu+) + 1.25266782E-03 2 -2000013 13 # BR(~chi_30 -> ~mu_R+ mu-) + 5.26279239E-03 2 1000015 -15 # BR(~chi_30 -> ~tau_1- tau+) + 5.26279239E-03 2 -1000015 15 # BR(~chi_30 -> ~tau_1+ tau-) + 6.72814564E-03 2 2000015 -15 # BR(~chi_30 -> ~tau_2- tau+) + 6.72814564E-03 2 -2000015 15 # BR(~chi_30 -> ~tau_2+ tau-) + 3.18920485E-03 2 1000012 -12 # BR(~chi_30 -> ~nu_eL nu_eb) + 3.18920485E-03 2 -1000012 12 # BR(~chi_30 -> ~nu_eL* nu_e ) + 3.18920485E-03 2 1000014 -14 # BR(~chi_30 -> ~nu_muL nu_mub) + 3.18920485E-03 2 -1000014 14 # BR(~chi_30 -> ~nu_muL* nu_mu ) + 3.20245934E-03 2 1000016 -16 # BR(~chi_30 -> ~nu_tau1 nu_taub) + 3.20245934E-03 2 -1000016 16 # BR(~chi_30 -> ~nu_tau1* nu_tau ) +# PDG Width +DECAY 1000035 2.58585079E+00 # neutralino4 decays +# BR NDA ID1 ID2 + 2.15369294E-02 2 1000022 23 # BR(~chi_40 -> ~chi_10 Z ) + 1.85499971E-02 2 1000023 23 # BR(~chi_40 -> ~chi_20 Z ) + 0.00000000E+00 2 1000025 23 # BR(~chi_40 -> ~chi_30 Z ) + 2.49541430E-01 2 1000024 -24 # BR(~chi_40 -> ~chi_1+ W-) + 2.49541430E-01 2 -1000024 24 # BR(~chi_40 -> ~chi_1- W+) + 0.00000000E+00 2 1000037 -24 # BR(~chi_40 -> ~chi_2+ W-) + 0.00000000E+00 2 -1000037 24 # BR(~chi_40 -> ~chi_2- W+) + 6.93213268E-02 2 1000022 25 # BR(~chi_40 -> ~chi_10 h ) + 0.00000000E+00 2 1000022 35 # BR(~chi_40 -> ~chi_10 H ) + 0.00000000E+00 2 1000022 36 # BR(~chi_40 -> ~chi_10 A ) + 1.47602336E-01 2 1000023 25 # BR(~chi_40 -> ~chi_20 h ) + 0.00000000E+00 2 1000023 35 # BR(~chi_40 -> ~chi_20 H ) + 0.00000000E+00 2 1000023 36 # BR(~chi_40 -> ~chi_20 A ) + 0.00000000E+00 2 1000025 25 # BR(~chi_40 -> ~chi_30 h ) + 0.00000000E+00 2 1000025 35 # BR(~chi_40 -> ~chi_30 H ) + 0.00000000E+00 2 1000025 36 # BR(~chi_40 -> ~chi_30 A ) + 0.00000000E+00 2 1000024 -37 # BR(~chi_40 -> ~chi_1+ H-) + 0.00000000E+00 2 -1000024 37 # BR(~chi_40 -> ~chi_1- H+) + 0.00000000E+00 2 1000037 -37 # BR(~chi_40 -> ~chi_2+ H-) + 0.00000000E+00 2 -1000037 37 # BR(~chi_40 -> ~chi_2- H+) + 0.00000000E+00 2 1000002 -2 # BR(~chi_40 -> ~u_L ub) + 0.00000000E+00 2 -1000002 2 # BR(~chi_40 -> ~u_L* u ) + 0.00000000E+00 2 2000002 -2 # BR(~chi_40 -> ~u_R ub) + 0.00000000E+00 2 -2000002 2 # BR(~chi_40 -> ~u_R* u ) + 0.00000000E+00 2 1000001 -1 # BR(~chi_40 -> ~d_L db) + 0.00000000E+00 2 -1000001 1 # BR(~chi_40 -> ~d_L* d ) + 0.00000000E+00 2 2000001 -1 # BR(~chi_40 -> ~d_R db) + 0.00000000E+00 2 -2000001 1 # BR(~chi_40 -> ~d_R* d ) + 0.00000000E+00 2 1000004 -4 # BR(~chi_40 -> ~c_L cb) + 0.00000000E+00 2 -1000004 4 # BR(~chi_40 -> ~c_L* c ) + 0.00000000E+00 2 2000004 -4 # BR(~chi_40 -> ~c_R cb) + 0.00000000E+00 2 -2000004 4 # BR(~chi_40 -> ~c_R* c ) + 0.00000000E+00 2 1000003 -3 # BR(~chi_40 -> ~s_L sb) + 0.00000000E+00 2 -1000003 3 # BR(~chi_40 -> ~s_L* s ) + 0.00000000E+00 2 2000003 -3 # BR(~chi_40 -> ~s_R sb) + 0.00000000E+00 2 -2000003 3 # BR(~chi_40 -> ~s_R* s ) + 0.00000000E+00 2 1000006 -6 # BR(~chi_40 -> ~t_1 tb) + 0.00000000E+00 2 -1000006 6 # BR(~chi_40 -> ~t_1* t ) + 0.00000000E+00 2 2000006 -6 # BR(~chi_40 -> ~t_2 tb) + 0.00000000E+00 2 -2000006 6 # BR(~chi_40 -> ~t_2* t ) + 0.00000000E+00 2 1000005 -5 # BR(~chi_40 -> ~b_1 bb) + 0.00000000E+00 2 -1000005 5 # BR(~chi_40 -> ~b_1* b ) + 0.00000000E+00 2 2000005 -5 # BR(~chi_40 -> ~b_2 bb) + 0.00000000E+00 2 -2000005 5 # BR(~chi_40 -> ~b_2* b ) + 9.64835418E-03 2 1000011 -11 # BR(~chi_40 -> ~e_L- e+) + 9.64835418E-03 2 -1000011 11 # BR(~chi_40 -> ~e_L+ e-) + 3.75684470E-03 2 2000011 -11 # BR(~chi_40 -> ~e_R- e+) + 3.75684470E-03 2 -2000011 11 # BR(~chi_40 -> ~e_R+ e-) + 9.64835418E-03 2 1000013 -13 # BR(~chi_40 -> ~mu_L- mu+) + 9.64835418E-03 2 -1000013 13 # BR(~chi_40 -> ~mu_L+ mu-) + 3.75684470E-03 2 2000013 -13 # BR(~chi_40 -> ~mu_R- mu+) + 3.75684470E-03 2 -2000013 13 # BR(~chi_40 -> ~mu_R+ mu-) + 2.68215241E-03 2 1000015 -15 # BR(~chi_40 -> ~tau_1- tau+) + 2.68215241E-03 2 -1000015 15 # BR(~chi_40 -> ~tau_1+ tau-) + 1.62289809E-02 2 2000015 -15 # BR(~chi_40 -> ~tau_2- tau+) + 1.62289809E-02 2 -2000015 15 # BR(~chi_40 -> ~tau_2+ tau-) + 2.53796547E-02 2 1000012 -12 # BR(~chi_40 -> ~nu_eL nu_eb) + 2.53796547E-02 2 -1000012 12 # BR(~chi_40 -> ~nu_eL* nu_e ) + 2.53796547E-02 2 1000014 -14 # BR(~chi_40 -> ~nu_muL nu_mub) + 2.53796547E-02 2 -1000014 14 # BR(~chi_40 -> ~nu_muL* nu_mu ) + 2.54724352E-02 2 1000016 -16 # BR(~chi_40 -> ~nu_tau1 nu_taub) + 2.54724352E-02 2 -1000016 16 # BR(~chi_40 -> ~nu_tau1* nu_tau ) +""" + +import FWCore.ParameterSet.Config as cms + +from Configuration.Generator.Pythia8CommonSettings_cfi import * +from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import * + +generator = cms.EDFilter("Pythia8GeneratorFilter", + pythiaPylistVerbosity = cms.untracked.int32(0), + filterEfficiency = cms.untracked.double(1), + pythiaHepMCVerbosity = cms.untracked.bool(False), + comEnergy = cms.double(COM_ENERGY), + crossSection = cms.untracked.double(CROSS_SECTION), + maxEventsToPrint = cms.untracked.int32(0), + SLHATableForPythia8 = cms.string('%s' % SLHA_TABLE), + PythiaParameters = cms.PSet( + pythia8CommonSettingsBlock, + pythia8CUEP8M1SettingsBlock, + processParameters = cms.vstring( + 'SUSY:all = off', + 'SUSY:gg2squarkantisquark = on', + 'SUSY:qqbar2squarkantisquark= on', + 'RHadrons:allow = on', + 'RHadrons:allowDecay = on', + 'RHadrons:setMasses = on', + '1000006:tau0 = %.1f' % CTAU_POINT, + ), + parameterSets = cms.vstring( + 'pythia8CommonSettings', + 'pythia8CUEP8M1Settings', + 'processParameters' + ) + ) +) + +ProductionFilterSequence = cms.Sequence(generator) diff --git a/Configuration/PyReleaseValidation/python/relval_standard.py b/Configuration/PyReleaseValidation/python/relval_standard.py index 1249cbc4d167f..4c0ddec48d777 100644 --- a/Configuration/PyReleaseValidation/python/relval_standard.py +++ b/Configuration/PyReleaseValidation/python/relval_standard.py @@ -660,7 +660,7 @@ workflows[1352] = ['', ['HSCPstop_M_200_13','DIGIUP15','RECOUP15','HARVESTUP15']] workflows[1353] = ['', ['RSGravitonToGaGa_13','DIGIUP15','RECOUP15','HARVESTUP15']] workflows[1354] = ['', ['WpToENu_M-2000_13','DIGIUP15','RECOUP15','HARVESTUP15']] -workflows[1355] = ['', ['DisplacedSUSY_stopToBottom_M_800_500mm_13','DIGIUP15','RECOUP15','HARVESTUP15']] +workflows[1355] = ['', ['DisplacedSUSY_stopToBottom_M_300_1000mm_13','DIGIUP15','RECOUP15','HARVESTUP15']] # fullSim 13TeV normal workflows starting from gridpacks LHE generation workflows[1360] = ['', ['TTbar012Jets_NLO_Mad_py8_Evt_13','DIGIUP15','RECOUP15','HARVESTUP15']] diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index a13345b14aab0..0e46f23fddcbe 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -602,7 +602,7 @@ def gen2021hiprod(fragment,howMuch): steps['HSCPstop_M_200_13']=gen2015('HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_cff',Kby(9,100)) steps['RSGravitonToGaGa_13']=gen2015('RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_cfi',Kby(9,100)) steps['WpToENu_M-2000_13']=gen2015('WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_cff',Kby(9,100)) -steps['DisplacedSUSY_stopToBottom_M_800_500mm_13']=gen2015('DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_cff',Kby(9,100)) +steps['DisplacedSUSY_stopToBottom_M_300_1000mm_13']=gen2015('DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_cff',Kby(9,100)) ### 2017 wf: only the ones for premixing (for the moment) steps['NuGun_UP17']=gen2017('SingleNuE10_cfi.py',Kby(9,50)) @@ -779,7 +779,7 @@ def identitySim(wf): steps['HSCPstop_M_200_13INPUT']={'INPUT':InputInfo(dataSet='/RelValHSCPstop_M_200_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} steps['RSGravitonToGaGa_13INPUT']={'INPUT':InputInfo(dataSet='/RelValRSGravitonToGaGa_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} steps['WpToENu_M-2000_13INPUT']={'INPUT':InputInfo(dataSet='/RelValWpToENu_M-2000_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} -steps['DisplacedSUSY_stopToBottom_M_800_500mm_13INPUT']={'INPUT':InputInfo(dataSet='/RelValDisplacedSUSY_stopToBottom_M_800_500mm_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} +steps['DisplacedSUSY_stopToBottom_M_300_1000mm_13INPUT']={'INPUT':InputInfo(dataSet='/RelValDisplacedSUSY_stopToBottom_M_300_1000mm_13/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} # particle guns with postLS1 geometry recycle GEN-SIM input steps['SingleElectronPt10_UP15INPUT']={'INPUT':InputInfo(dataSet='/RelValSingleElectronPt10_UP15/%s/GEN-SIM'%(baseDataSetRelease[3],),location='STD')} @@ -3219,7 +3219,7 @@ def gen2021HiMix(fragment,howMuch): defaultDataSets.update(puDataSets) # sometimes v1 won't be used - override it here - the dictionary key is gen fragment + '_' + geometry -versionOverrides={'BuMixing_BMuonFilter_forSTEAM_13TeV_TuneCUETP8M1_2017':'2','HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_2017':'2','RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_2017':'2','WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_2017':'2','DisplacedSUSY_stopToBottom_M_800_500mm_TuneCP5_13TeV_pythia8_2017':'2','TenE_E_0_200_pythia8_2017':'2','TenE_E_0_200_pythia8_2017PU':'2', 'TenTau_E_15_500_pythia8_2018':'2','PhotonJet_Pt_10_13TeV_TuneCUETP8M1_2018':'2','Wjet_Pt_80_120_13TeV_TuneCUETP8M1_2018':'2'} +versionOverrides={'BuMixing_BMuonFilter_forSTEAM_13TeV_TuneCUETP8M1_2017':'2','HSCPstop_M_200_TuneCUETP8M1_13TeV_pythia8_2017':'2','RSGravitonToGammaGamma_kMpl01_M_3000_TuneCUETP8M1_13TeV_pythia8_2017':'2','WprimeToENu_M-2000_TuneCUETP8M1_13TeV-pythia8_2017':'2','DisplacedSUSY_stopToBottom_M_300_1000mm_TuneCUETP8M1_13TeV_pythia8_2017':'2','TenE_E_0_200_pythia8_2017':'2','TenE_E_0_200_pythia8_2017PU':'2', 'TenTau_E_15_500_pythia8_2018':'2','PhotonJet_Pt_10_13TeV_TuneCUETP8M1_2018':'2','Wjet_Pt_80_120_13TeV_TuneCUETP8M1_2018':'2'} baseDataSetReleaseBetter={} for gen in upgradeFragments: From d621f13770a65286e160c65f3197bebf5af18179 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 13 Oct 2020 16:37:45 +0200 Subject: [PATCH 530/778] Code check --- .../HGCalCommonData/plugins/DDHGCalEEAlgo.cc | 10 +++++++--- .../HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc | 10 +++++++--- .../plugins/dd4hep/DDHGCalEEAlgo.cc | 16 +++++++++++----- .../plugins/dd4hep/DDHGCalEEFileAlgo.cc | 13 +++++++++---- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc b/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc index 2e452eeed6f32..3809e2da84f33 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc @@ -305,12 +305,16 @@ void DDHGCalEEAlgo::constructLayers(const DDLogicalPart& module, DDCompactView& edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k]; #endif } else { - double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); - double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); + double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); + double routs = + (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi); glog = DDLogicalPart(solid.ddname(), matter, solid); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matName << ":" << &matter << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matName << ":" + << &matter << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" + << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() + << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif positionSensitive(glog, rins, routs, zz, layerSense_[ly], layerCenter_[copy - firstLayer_], cpv); } diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc index a9d39c1af209f..43c5c7a24ff64 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalEEFileAlgo.cc @@ -307,12 +307,16 @@ void DDHGCalEEFileAlgo::constructLayers(const DDLogicalPart& module, DDCompactVi edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k]; #endif } else { - double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); - double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); + double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); + double routs = + (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi); glog = DDLogicalPart(solid.ddname(), matter, solid); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matName << ":" << &matter << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matName << ":" + << &matter << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" + << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() + << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif positionSensitive(glog, rins, routs, zz, layerSense_[ly], (copy - firstLayer_), cpv); } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc index 07ac3f5f772cc..bc1ca8a70fcdd 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc @@ -103,7 +103,7 @@ struct HGCalEEAlgo { sensitiveMode_ = args.value<int>("SensitiveMode"); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and " - << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_; + << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_; #endif layerCenter_ = args.value<std::vector<int>>("LayerCenter"); #ifdef EDM_ML_DEBUG @@ -284,17 +284,23 @@ struct HGCalEEAlgo { << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k]; #endif } else { - double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); - double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); + double rins = + (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); + double routs = + (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi); ns.addSolidNS(ns.prepend(name), solid); glog = dd4hep::Volume(solid.name(), solid, matter); ns.addVolumeNS(glog); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() + << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs + << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " + << copy << ":" << layerCenter_[copy - firstLayer_]; #endif - PositionSensitive(ctxt, e, glog, rins, routs, zz, layerSense_[ly], layerCenter_[copy - firstLayer_]); //, cpv); + PositionSensitive( + ctxt, e, glog, rins, routs, zz, layerSense_[ly], layerCenter_[copy - firstLayer_]); //, cpv); } dd4hep::Position r1(0, 0, zz); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc index d7519f2dc26a5..2ef338f2995d9 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc @@ -66,7 +66,7 @@ struct HGCalEEFileAlgo { sensitiveMode_ = args.value<int>("SensitiveMode"); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "First Layer " << firstLayer_ << " and " - << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_; + << "Absober:Sensitive mode " << absorbMode_ << ":" << sensitiveMode_; #endif layerCenter_ = args.value<std::vector<int>>("LayerCenter"); #ifdef EDM_ML_DEBUG @@ -221,15 +221,20 @@ struct HGCalEEFileAlgo { << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k]; #endif } else { - double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); - double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); + double rins = + (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_); + double routs = + (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_); dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi); ns.addSolidNS(ns.prepend(name), solid); glog = dd4hep::Volume(solid.name(), solid, matter); ns.addVolumeNS(glog); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() + << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs + << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " + << copy << ":" << layerCenter_[copy - firstLayer_]; #endif positionSensitive(ctxt, e, glog, rins, routs, zz, layerSense_[ly], (copy - firstLayer_)); } From f523a6949f5aeb1caff187f49e396ceb9b2638c2 Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Tue, 13 Oct 2020 16:55:32 +0200 Subject: [PATCH 531/778] fixing clang error --- Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc index 35e695dc4ed91..03c000f2e57bb 100644 --- a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc @@ -187,9 +187,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS } // --- Loop over the ETL RECO clusters --- - int i; for (const auto& DetSetClu : *etlRecCluHandle) { - i++; for (const auto& cluster : DetSetClu) { if (topo1Dis) { if (cluster.energy() < hitMinEnergy1Dis_) From 51310b5fdad08de13be2c204aaf845edac2d2557 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Mon, 12 Oct 2020 12:46:39 +0200 Subject: [PATCH 532/778] split monitoring of TEC (in thick and thin sensors) --- .../interface/APVGainHelpers.h | 10 +++- .../interface/APVGainStruct.h | 7 +-- .../plugins/SiStripGainFromCalibTree.cc | 23 ++++---- .../python/SiStripGainsPCLHarvester_cfi.py | 2 +- .../python/SiStripGainsPCLWorker_cfi.py | 2 +- .../SiStripChannelGain/src/APVGainHelpers.cc | 53 ++++++++++++++++++- .../src/SiStripGainsPCLHarvester.cc | 3 +- .../src/SiStripGainsPCLWorker.cc | 3 +- 8 files changed, 83 insertions(+), 20 deletions(-) diff --git a/CalibTracker/SiStripChannelGain/interface/APVGainHelpers.h b/CalibTracker/SiStripChannelGain/interface/APVGainHelpers.h index c642b3f2ca537..de6dfb0b3b91a 100644 --- a/CalibTracker/SiStripChannelGain/interface/APVGainHelpers.h +++ b/CalibTracker/SiStripChannelGain/interface/APVGainHelpers.h @@ -19,6 +19,8 @@ namespace APVGain { int subdetectorId(uint32_t); int subdetectorId(const std::string&); int subdetectorSide(uint32_t, const TrackerTopology*); + int thickness(uint32_t); + int thickness(const std::string& tag); int subdetectorSide(const std::string&); int subdetectorPlane(uint32_t, const TrackerTopology*); int subdetectorPlane(const std::string&); @@ -27,8 +29,8 @@ namespace APVGain { struct APVmon { public: - APVmon(int v1, int v2, int v3, MonitorElement* v4) - : m_subdetectorId(v1), m_subdetectorSide(v2), m_subdetectorPlane(v3), m_monitor(v4) {} + APVmon(int v0, int v1, int v2, int v3, MonitorElement* v4) + : m_thickness(v0), m_subdetectorId(v1), m_subdetectorSide(v2), m_subdetectorPlane(v3), m_monitor(v4) {} int getSubdetectorId() { return m_subdetectorId; } @@ -36,17 +38,21 @@ namespace APVGain { int getSubdetectorPlane() { return m_subdetectorPlane; } + int getThickness() { return m_thickness; } + MonitorElement* getMonitor() { return m_monitor; } void printAll() { LogDebug("APVGainHelpers") << "subDetectorID:" << m_subdetectorId << std::endl; LogDebug("APVGainHelpers") << "subDetectorSide:" << m_subdetectorSide << std::endl; LogDebug("APVGainHelpers") << "subDetectorPlane:" << m_subdetectorPlane << std::endl; + LogDebug("APVGainHelpers") << "thickness:" << m_thickness << std::endl; LogDebug("APVGainHelpers") << "histoName:" << m_monitor->getName() << std::endl; return; } private: + int m_thickness; int m_subdetectorId; int m_subdetectorSide; int m_subdetectorPlane; diff --git a/CalibTracker/SiStripChannelGain/interface/APVGainStruct.h b/CalibTracker/SiStripChannelGain/interface/APVGainStruct.h index fd126d1030114..d3c2e7f19c8df 100644 --- a/CalibTracker/SiStripChannelGain/interface/APVGainStruct.h +++ b/CalibTracker/SiStripChannelGain/interface/APVGainStruct.h @@ -35,9 +35,10 @@ struct stAPVGain { struct APVloc { public: - APVloc(int v1, int v2, int v3, const std::string& s) - : m_subdetectorId(v1), m_subdetectorSide(v2), m_subdetectorPlane(v3), m_string(s) {} + APVloc(int v0, int v1, int v2, int v3, const std::string& s) + : m_thickness(v0), m_subdetectorId(v1), m_subdetectorSide(v2), m_subdetectorPlane(v3), m_string(s) {} + int m_thickness; int m_subdetectorId; int m_subdetectorSide; int m_subdetectorPlane; @@ -45,7 +46,7 @@ struct APVloc { bool operator==(const APVloc& a) const { return (m_subdetectorId == a.m_subdetectorId && m_subdetectorSide == a.m_subdetectorSide && - m_subdetectorPlane == a.m_subdetectorPlane); + m_subdetectorPlane == a.m_subdetectorPlane && m_thickness == a.m_thickness); } }; diff --git a/CalibTracker/SiStripChannelGain/plugins/SiStripGainFromCalibTree.cc b/CalibTracker/SiStripChannelGain/plugins/SiStripGainFromCalibTree.cc index a2a16507f0c66..57a6560a5c360 100644 --- a/CalibTracker/SiStripChannelGain/plugins/SiStripGainFromCalibTree.cc +++ b/CalibTracker/SiStripChannelGain/plugins/SiStripGainFromCalibTree.cc @@ -539,40 +539,44 @@ void SiStripGainFromCalibTree::bookDQMHistos(const char* dqm_dir, const char* ta for (unsigned int i = 0; i < hnames.size(); i++) { std::string htag = (hnames[i]).first + stag; MonitorElement* monitor = dbe->book1DD(htag.c_str(), (hnames[i]).second.c_str(), 100, 0., 1000.); + int thick = APVGain::thickness((hnames[i]).first); int id = APVGain::subdetectorId((hnames[i]).first); int side = APVGain::subdetectorSide((hnames[i]).first); int plane = APVGain::subdetectorPlane((hnames[i]).first); - Charge_1[elepos].push_back(APVGain::APVmon(id, side, plane, monitor)); + Charge_1[elepos].push_back(APVGain::APVmon(thick, id, side, plane, monitor)); } hnames = APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, "woG2"); for (unsigned int i = 0; i < hnames.size(); i++) { std::string htag = (hnames[i]).first + stag; MonitorElement* monitor = dbe->book1DD(htag.c_str(), (hnames[i]).second.c_str(), 100, 0., 1000.); + int thick = APVGain::thickness((hnames[i]).first); int id = APVGain::subdetectorId((hnames[i]).first); int side = APVGain::subdetectorSide((hnames[i]).first); int plane = APVGain::subdetectorPlane((hnames[i]).first); - Charge_2[elepos].push_back(APVGain::APVmon(id, side, plane, monitor)); + Charge_2[elepos].push_back(APVGain::APVmon(thick, id, side, plane, monitor)); } hnames = APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, "woG1"); for (unsigned int i = 0; i < hnames.size(); i++) { std::string htag = (hnames[i]).first + stag; MonitorElement* monitor = dbe->book1DD(htag.c_str(), (hnames[i]).second.c_str(), 100, 0., 1000.); + int thick = APVGain::thickness((hnames[i]).first); int id = APVGain::subdetectorId((hnames[i]).first); int side = APVGain::subdetectorSide((hnames[i]).first); int plane = APVGain::subdetectorPlane((hnames[i]).first); - Charge_3[elepos].push_back(APVGain::APVmon(id, side, plane, monitor)); + Charge_3[elepos].push_back(APVGain::APVmon(thick, id, side, plane, monitor)); } hnames = APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, "woG1G2"); for (unsigned int i = 0; i < hnames.size(); i++) { std::string htag = (hnames[i]).first + stag; MonitorElement* monitor = dbe->book1DD(htag.c_str(), (hnames[i]).second.c_str(), 100, 0., 1000.); + int thick = APVGain::thickness((hnames[i]).first); int id = APVGain::subdetectorId((hnames[i]).first); int side = APVGain::subdetectorSide((hnames[i]).first); int plane = APVGain::subdetectorPlane((hnames[i]).first); - Charge_4[elepos].push_back(APVGain::APVmon(id, side, plane, monitor)); + Charge_4[elepos].push_back(APVGain::APVmon(thick, id, side, plane, monitor)); } //Book validation histograms @@ -637,10 +641,11 @@ void SiStripGainFromCalibTree::bookDQMHistos(const char* dqm_dir, const char* ta APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, "newG2"); for (unsigned int i = 0; i < hnames.size(); i++) { MonitorElement* monitor = dbe->book1DD((hnames[i]).first.c_str(), (hnames[i]).second.c_str(), 100, 0., 1000.); + int thick = APVGain::thickness((hnames[i]).first); int id = APVGain::subdetectorId((hnames[i]).first); int side = APVGain::subdetectorSide((hnames[i]).first); int plane = APVGain::subdetectorPlane((hnames[i]).first); - newCharge.push_back(APVGain::APVmon(id, side, plane, monitor)); + newCharge.push_back(APVGain::APVmon(thick, id, side, plane, monitor)); } } } @@ -977,7 +982,7 @@ void SiStripGainFromCalibTree::algoEndRun(const edm::Run& run, const edm::EventS APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, ""); for (unsigned int i = 0; i < tags.size(); i++) { std::string tag = DQM_dir + "/" + (tags[i]).first + stag; - Charge_1[elepos].push_back(APVGain::APVmon(0, 0, 0, dbe->get(tag))); + Charge_1[elepos].push_back(APVGain::APVmon(0, 0, 0, 0, dbe->get(tag))); if ((Charge_1[elepos][i]).getMonitor() == nullptr) { edm::LogError("SiStripGainFromCalibTree") << "Harvesting: could not retrieve " << tag.c_str() << ", statistics will not be summed!" << std::endl; @@ -988,7 +993,7 @@ void SiStripGainFromCalibTree::algoEndRun(const edm::Run& run, const edm::EventS tags = APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, "woG2"); for (unsigned int i = 0; i < tags.size(); i++) { std::string tag = DQM_dir + "/" + (tags[i]).first + stag; - Charge_2[elepos].push_back(APVGain::APVmon(0, 0, 0, dbe->get(tag))); + Charge_2[elepos].push_back(APVGain::APVmon(0, 0, 0, 0, dbe->get(tag))); if ((Charge_2[elepos][i]).getMonitor() == nullptr) { edm::LogError("SiStripGainFromCalibTree") << "Harvesting: could not retrieve " << tag.c_str() << ", statistics will not be summed!" << std::endl; @@ -999,7 +1004,7 @@ void SiStripGainFromCalibTree::algoEndRun(const edm::Run& run, const edm::EventS tags = APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, "woG1"); for (unsigned int i = 0; i < tags.size(); i++) { std::string tag = DQM_dir + "/" + (tags[i]).first + stag; - Charge_3[elepos].push_back(APVGain::APVmon(0, 0, 0, dbe->get(tag))); + Charge_3[elepos].push_back(APVGain::APVmon(0, 0, 0, 0, dbe->get(tag))); if ((Charge_3[elepos][i]).getMonitor() == nullptr) { edm::LogError("SiStripGainFromCalibTree") << "Harvesting: could not retrieve " << tag.c_str() << ", statistics will not be summed!" << std::endl; @@ -1010,7 +1015,7 @@ void SiStripGainFromCalibTree::algoEndRun(const edm::Run& run, const edm::EventS tags = APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, "woG1G2"); for (unsigned int i = 0; i < tags.size(); i++) { std::string tag = DQM_dir + "/" + (tags[i]).first + stag; - Charge_4[elepos].push_back(APVGain::APVmon(0, 0, 0, dbe->get(tag))); + Charge_4[elepos].push_back(APVGain::APVmon(0, 0, 0, 0, dbe->get(tag))); if ((Charge_4[elepos][i]).getMonitor() == nullptr) { edm::LogError("SiStripGainFromCalibTree") << "Harvesting: could not retrieve " << tag.c_str() << ", statistics will not be summed!" << std::endl; diff --git a/CalibTracker/SiStripChannelGain/python/SiStripGainsPCLHarvester_cfi.py b/CalibTracker/SiStripChannelGain/python/SiStripGainsPCLHarvester_cfi.py index 97cd20a05f82a..9717b85fc7a16 100644 --- a/CalibTracker/SiStripChannelGain/python/SiStripGainsPCLHarvester_cfi.py +++ b/CalibTracker/SiStripChannelGain/python/SiStripGainsPCLHarvester_cfi.py @@ -10,5 +10,5 @@ minNrEntries = cms.untracked.double(25), GoodFracForTagProd = cms.untracked.double(0.98), NClustersForTagProd = cms.untracked.double(8E8), - ChargeHisto = cms.untracked.vstring('TIB','TIB_layer_1','TOB','TOB_layer_1','TIDminus','TIDplus','TECminus','TECplus') + ChargeHisto = cms.untracked.vstring('TIB','TIB_layer_1','TOB','TOB_layer_1','TIDminus','TIDplus','TECminus','TECplus','TEC_thin','TEC_thick') ) diff --git a/CalibTracker/SiStripChannelGain/python/SiStripGainsPCLWorker_cfi.py b/CalibTracker/SiStripChannelGain/python/SiStripGainsPCLWorker_cfi.py index b715ae6081dbb..cf71afd80c963 100644 --- a/CalibTracker/SiStripChannelGain/python/SiStripGainsPCLWorker_cfi.py +++ b/CalibTracker/SiStripChannelGain/python/SiStripGainsPCLWorker_cfi.py @@ -11,7 +11,7 @@ UseCalibration = cms.untracked.bool(False), DQMdir = cms.untracked.string('AlCaReco/SiStripGains'), calibrationMode = cms.untracked.string('StdBunch'), - ChargeHisto = cms.untracked.vstring('TIB','TIB_layer_1','TOB','TOB_layer_1','TIDminus','TIDplus','TECminus','TECplus'), + ChargeHisto = cms.untracked.vstring('TIB','TIB_layer_1','TOB','TOB_layer_1','TIDminus','TIDplus','TECminus','TECplus','TEC_thin','TEC_thick'), gain = cms.untracked.PSet(label = cms.untracked.string('shallowGainCalibration'), prefix = cms.untracked.string("GainCalibration"), suffix = cms.untracked.string('') diff --git a/CalibTracker/SiStripChannelGain/src/APVGainHelpers.cc b/CalibTracker/SiStripChannelGain/src/APVGainHelpers.cc index 467748cfe3e50..a55b005b304bb 100644 --- a/CalibTracker/SiStripChannelGain/src/APVGainHelpers.cc +++ b/CalibTracker/SiStripChannelGain/src/APVGainHelpers.cc @@ -2,6 +2,7 @@ #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +#include "DataFormats/SiStripDetId/interface/SiStripDetId.h" /** Brief Extract from the DetId the subdetector type. * Return an integer which is associated to the subdetector type. The integer @@ -66,6 +67,48 @@ int APVGain::subdetectorSide(const std::string& tag) { return 0; } +/** Brief Extract the sensor thickness from the Det Id + * Return and integer whose coding is + * 0 - no thickness can be determined + * 1 - for thin sensors + * 2 - for thick sensors + */ +int APVGain::thickness(uint32_t det_id) { + if (APVGain::subdetectorId(det_id) >= SiStripDetId::TIB) { + SiStripDetId siStripDetId(det_id); + if (siStripDetId.subdetId() == SiStripDetId::TOB) { + return 2; // so it is TOB (thick) + } + if (siStripDetId.moduleGeometry() == SiStripModuleGeometry::W5 || + siStripDetId.moduleGeometry() == SiStripModuleGeometry::W6 || + siStripDetId.moduleGeometry() == SiStripModuleGeometry::W7) { + return 2; // so it is TEC ring 5-7 (thick) + } + return 1; // so it is TEC ring 1-4 or TIB or TID (thin) + } else { + return 0; + } +} + +/** Brief Extract the thickness from a char * descriptor + * Return and integer whose coding is + * 0 - no thicnkness can be determined + * 1 - for thin sensors + * 2 - for thick sensors + * + * The char * descriptor is expected to have either "thin" or "thick" + * string to specify the thickness. If no sign spec is found 0 is returned. + */ +int APVGain::thickness(const std::string& tag) { + std::size_t thin = tag.find("thin"); + std::size_t thick = tag.find("thick"); + if (thin != std::string::npos) + return 1; + if (thick != std::string::npos) + return 2; + return 0; +} + /** Brief Extract the detector plane position from a DetId. * Return an integer that represent the detector plane where the module sits. * For the barrel detectors (TIB and TOB) the detector plane is the layer, e.g. @@ -109,6 +152,7 @@ std::vector<APVGain::MonitorElement*> APVGain::FetchMonitor(std::vector<APVGain: uint32_t det_id, const TrackerTopology* topo) { std::vector<MonitorElement*> found = std::vector<MonitorElement*>(); + int sThick = APVGain::thickness(det_id); int sId = APVGain::subdetectorId(det_id); int sPlane = APVGain::subdetectorPlane(det_id, topo); int sSide = APVGain::subdetectorSide(det_id, topo); @@ -118,13 +162,15 @@ std::vector<APVGain::MonitorElement*> APVGain::FetchMonitor(std::vector<APVGain: while (it != histos.end()) { std::string tag = (*it).getMonitor()->getName(); + int subdetectorThickness = (*it).getThickness(); int subdetectorId = (*it).getSubdetectorId(); int subdetectorSide = (*it).getSubdetectorSide(); int subdetectorPlane = (*it).getSubdetectorPlane(); bool match = (subdetectorId == 0 || subdetectorId == sId) && (subdetectorPlane == 0 || subdetectorPlane == sPlane) && - (subdetectorSide == 0 || subdetectorSide == sSide); + (subdetectorSide == 0 || subdetectorSide == sSide) && + (subdetectorThickness == 0 || subdetectorThickness == sThick); if (match) { found.emplace_back((*it).getMonitor()); @@ -143,18 +189,21 @@ std::vector<unsigned int> APVGain::FetchIndices(std::map<unsigned int, APVloc> t const TrackerTopology* topo) { std::vector<unsigned int> found_indices = std::vector<unsigned int>(); + int sThick = APVGain::thickness(det_id); int sId = APVGain::subdetectorId(det_id); int sPlane = APVGain::subdetectorPlane(det_id, topo); int sSide = APVGain::subdetectorSide(det_id, topo); for (auto& element : theMap) { + int subdetectorThickness = element.second.m_thickness; int subdetectorId = element.second.m_subdetectorId; int subdetectorSide = element.second.m_subdetectorSide; int subdetectorPlane = element.second.m_subdetectorPlane; bool match = (subdetectorId == 0 || subdetectorId == sId) && (subdetectorPlane == 0 || subdetectorPlane == sPlane) && - (subdetectorSide == 0 || subdetectorSide == sSide); + (subdetectorSide == 0 || subdetectorSide == sSide) && + (subdetectorThickness == 0 || subdetectorThickness == sThick); if (match) { found_indices.push_back(element.first); diff --git a/CalibTracker/SiStripChannelGain/src/SiStripGainsPCLHarvester.cc b/CalibTracker/SiStripChannelGain/src/SiStripGainsPCLHarvester.cc index 01a533c2cbd2a..ad52b7a87aab6 100644 --- a/CalibTracker/SiStripChannelGain/src/SiStripGainsPCLHarvester.cc +++ b/CalibTracker/SiStripChannelGain/src/SiStripGainsPCLHarvester.cc @@ -167,10 +167,11 @@ void SiStripGainsPCLHarvester::gainQualityMonitor(DQMStore::IBooker& ibooker_, APVGain::monHnames(VChargeHisto, doChargeMonitorPerPlane, "newG2"); for (unsigned int i = 0; i < cnames.size(); i++) { MonitorElement* monitor = ibooker_.book1DD((cnames[i]).first, (cnames[i]).second.c_str(), 100, 0., 1000.); + int thick = APVGain::thickness((cnames[i]).first); int id = APVGain::subdetectorId((cnames[i]).first); int side = APVGain::subdetectorSide((cnames[i]).first); int plane = APVGain::subdetectorPlane((cnames[i]).first); - new_charge_histos.push_back(APVGain::APVmon(id, side, plane, monitor)); + new_charge_histos.push_back(APVGain::APVmon(thick, id, side, plane, monitor)); } int MPVbin = 300; diff --git a/CalibTracker/SiStripChannelGain/src/SiStripGainsPCLWorker.cc b/CalibTracker/SiStripChannelGain/src/SiStripGainsPCLWorker.cc index 989668e292a33..f4d73a987de2a 100644 --- a/CalibTracker/SiStripChannelGain/src/SiStripGainsPCLWorker.cc +++ b/CalibTracker/SiStripChannelGain/src/SiStripGainsPCLWorker.cc @@ -32,9 +32,10 @@ SiStripGainsPCLWorker::SiStripGainsPCLWorker(const edm::ParameterSet& iConfig) { int id = APVGain::subdetectorId((hnames[i]).first); int side = APVGain::subdetectorSide((hnames[i]).first); int plane = APVGain::subdetectorPlane((hnames[i]).first); + int thick = APVGain::thickness((hnames[i]).first); std::string s = hnames[i].first; - auto loc = APVloc(id, side, plane, s); + auto loc = APVloc(thick, id, side, plane, s); theTopologyMap.insert(std::make_pair(i, loc)); } From 74022515f306d695008388f139be502985f7f704 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 13 Oct 2020 18:19:42 +0200 Subject: [PATCH 533/778] Change in view of changed scenario names --- .../test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py | 4 ++-- .../test/python/dumpExtendedHGCalGeometryDDD_cfg.py | 4 ++-- Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py | 2 +- .../HGCalCommonData/test/python/testHGCGeometry_cfg.py | 8 ++++---- .../test/python/testHGCalNumbering_cfg.py | 9 +++------ .../test/python/testHGCalParametersDDD_cfg.py | 2 +- .../HGCalCommonData/test/python/testHGCalValidHex_cfg.py | 9 ++++----- .../HGCalCommonData/test/python/testHGCalWafer_cfg.py | 9 ++++----- 8 files changed, 21 insertions(+), 26 deletions(-) diff --git a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py index cf141e984931d..4782bb3a34303 100644 --- a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py +++ b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py @@ -13,12 +13,12 @@ process.MessageLogger.categories.append('HGCalGeom') process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer", - confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D46.xml'), + confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D67.xml'), appendToDataLabel = cms.string('DDHGCal') ) process.testDump = cms.EDAnalyzer("DDTestDumpFile", - outputFileName = cms.untracked.string('CMS2026D46DD4Hep.root'), + outputFileName = cms.untracked.string('CMS2026D67DD4Hep.root'), DDDetector = cms.ESInputTag('','DDHGCal') ) diff --git a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py index 87e3678f1f19d..5b1ea75c2a365 100644 --- a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py +++ b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms process = cms.Process("GEODUMP") -process.load("Configuration.Geometry.GeometryExtended2026D46_cff") +process.load("Configuration.Geometry.GeometryExtended2026D67_cff") process.load('FWCore.MessageService.MessageLogger_cfi') if 'MessageLogger' in process.__dict__: @@ -19,6 +19,6 @@ )) process.dump = cms.EDAnalyzer("DumpSimGeometry", - outputFileName = cms.untracked.string('CMS2026D46DDD.root')) + outputFileName = cms.untracked.string('CMS2026D67DDD.root')) process.p = cms.Path(process.dump) diff --git a/Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py b/Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py index a445e9fe24ceb..0b9d9eccbb55e 100644 --- a/Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py +++ b/Geometry/HGCalCommonData/test/python/hgcalV11_cfg.py @@ -4,7 +4,7 @@ process = cms.Process('SIM',Phase2C9) process.load("SimGeneral.HepPDTESSource.pdt_cfi") -#process.load("Configuration.Geometry.GeometryExtended2026D41_cff") +#process.load("Configuration.Geometry.GeometryExtended2026D49_cff") process.load("Geometry.HGCalCommonData.testHGCalV11XML_cfi") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") diff --git a/Geometry/HGCalCommonData/test/python/testHGCGeometry_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCGeometry_cfg.py index db3ed0ff775ca..b86828e78f5f6 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCGeometry_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCGeometry_cfg.py @@ -3,10 +3,10 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -#process.load("Geometry.HGCalCommonData.testHGCV8XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D35XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D41XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D46XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D49XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D68XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D70XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D71XML_cfi") process.load("Geometry.HGCalCommonData.testHGCXML_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") process.load("Geometry.MuonNumbering.muonNumberingInitialization_cfi") diff --git a/Geometry/HGCalCommonData/test/python/testHGCalNumbering_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalNumbering_cfg.py index 0261190ff07d7..32a12e56dbc21 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalNumbering_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalNumbering_cfg.py @@ -2,15 +2,12 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -#process.load("Geometry.HGCalCommonData.testHGCV8XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D35XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D41XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D46XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D49XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D68XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D70XML_cfi") process.load("Geometry.HGCalCommonData.testHGCalV14XML_cfi") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") -#process.load("Geometry.HGCalCommonData.hgcalV6ParametersInitialization_cfi") -#process.load("Geometry.HGCalCommonData.hgcalV6NumberingInitialization_cfi") process.load("Geometry.EcalCommonData.ecalSimulationParameters_cff") process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff") process.load('FWCore.MessageService.MessageLogger_cfi') diff --git a/Geometry/HGCalCommonData/test/python/testHGCalParametersDDD_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalParametersDDD_cfg.py index f303aadd9c6b1..8265cecd9a220 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalParametersDDD_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalParametersDDD_cfg.py @@ -2,7 +2,7 @@ process = cms.Process("HGCalParametersTest") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D62XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D71XML_cfi") process.load("Geometry.HGCalCommonData.testHGCalV14XML_cfi") #process.load("Geometry.HGCalCommonData.testHGCXML_cfi") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") diff --git a/Geometry/HGCalCommonData/test/python/testHGCalValidHex_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalValidHex_cfg.py index abf34461c969b..6d30731f086d2 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalValidHex_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalValidHex_cfg.py @@ -2,11 +2,10 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -#process.load("Geometry.HGCalCommonData.testHGCV8XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D35XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D41XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D46XML_cfi") -process.load("Geometry.HGCalCommonData.testHGCV11XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D49XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D68XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D70XML_cfi") +process.load("Geometry.HGCalCommonData.testHGCalV14XML_cfi") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") process.load("Geometry.EcalCommonData.ecalSimulationParameters_cff") diff --git a/Geometry/HGCalCommonData/test/python/testHGCalWafer_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalWafer_cfg.py index 8e0a1194bbbb7..7e0820c9800a7 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalWafer_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalWafer_cfg.py @@ -2,11 +2,10 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -#process.load("Geometry.HGCalCommonData.testHGCV8XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D35XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D41XML_cfi") -#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D46XML_cfi") -process.load("Geometry.HGCalCommonData.testHGCXML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D49XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D68XML_cfi") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D70XML_cfi") +process.load("Geometry.HGCalCommonData.testHGCalV14XML_cfi") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") process.load("Geometry.EcalCommonData.ecalSimulationParameters_cff") From be67fc5f1f757c48f65050db86e173982c0fcb8d Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Tue, 13 Oct 2020 18:25:11 +0200 Subject: [PATCH 534/778] adding braces in if statements --- Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc | 6 ++++-- Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc | 6 ++++-- Validation/MtdValidation/plugins/EtlSimHitsValidation.cc | 6 ++++-- Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc index a6ef86aa7af0a..876396495c628 100644 --- a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc @@ -89,10 +89,12 @@ void EtlDigiHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSe bool topo1Dis = false; bool topo2Dis = false; - if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) { topo1Dis = true; - if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + } + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) { topo2Dis = true; + } edm::ESHandle<MTDGeometry> geometryHandle; iSetup.get<MTDDigiGeometryRecord>().get(geometryHandle); diff --git a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc index 03c000f2e57bb..81f67272aa3aa 100644 --- a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc @@ -102,10 +102,12 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS bool topo1Dis = false; bool topo2Dis = false; - if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) { topo1Dis = true; - if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + } + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) { topo2Dis = true; + } edm::ESHandle<MTDGeometry> geometryHandle; iSetup.get<MTDDigiGeometryRecord>().get(geometryHandle); diff --git a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc index 417b41f4e68df..bd31a55ae09ac 100644 --- a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc @@ -114,10 +114,12 @@ void EtlSimHitsValidation::analyze(const edm::Event& iEvent, const edm::EventSet bool topo1Dis = false; bool topo2Dis = false; - if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) { topo1Dis = true; - if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + } + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) { topo2Dis = true; + } auto etlSimHitsHandle = makeValid(iEvent.getHandle(etlSimHitsToken_)); MixCollection<PSimHit> etlSimHits(etlSimHitsHandle.product()); diff --git a/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc b/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc index 6b3ff43c366da..f6ac8a510ec4f 100644 --- a/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc @@ -100,10 +100,12 @@ void MtdGlobalRecoValidation::analyze(const edm::Event& iEvent, const edm::Event bool topo1Dis = false; bool topo2Dis = false; - if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + if (topology->getMTDTopologyMode() <= static_cast<int>(MTDTopologyMode::Mode::barphiflat)) { topo1Dis = true; - if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) + } + if (topology->getMTDTopologyMode() > static_cast<int>(MTDTopologyMode::Mode::barphiflat)) { topo2Dis = true; + } auto RecTrackHandle = makeValid(iEvent.getHandle(RecTrackToken_)); auto RecVertexHandle = makeValid(iEvent.getHandle(RecVertexToken_)); From f23b58d9bd755de8e275db93e112921c6ef555e2 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 13 Oct 2020 18:26:47 +0200 Subject: [PATCH 535/778] Avoid conflicts --- .../test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py | 4 ++-- .../test/python/dumpExtendedHGCalGeometryDDD_cfg.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py index 4782bb3a34303..cf141e984931d 100644 --- a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py +++ b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDD4Hep_cfg.py @@ -13,12 +13,12 @@ process.MessageLogger.categories.append('HGCalGeom') process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer", - confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D67.xml'), + confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D46.xml'), appendToDataLabel = cms.string('DDHGCal') ) process.testDump = cms.EDAnalyzer("DDTestDumpFile", - outputFileName = cms.untracked.string('CMS2026D67DD4Hep.root'), + outputFileName = cms.untracked.string('CMS2026D46DD4Hep.root'), DDDetector = cms.ESInputTag('','DDHGCal') ) diff --git a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py index 5b1ea75c2a365..87e3678f1f19d 100644 --- a/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py +++ b/Geometry/HGCalCommonData/test/python/dumpExtendedHGCalGeometryDDD_cfg.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms process = cms.Process("GEODUMP") -process.load("Configuration.Geometry.GeometryExtended2026D67_cff") +process.load("Configuration.Geometry.GeometryExtended2026D46_cff") process.load('FWCore.MessageService.MessageLogger_cfi') if 'MessageLogger' in process.__dict__: @@ -19,6 +19,6 @@ )) process.dump = cms.EDAnalyzer("DumpSimGeometry", - outputFileName = cms.untracked.string('CMS2026D67DDD.root')) + outputFileName = cms.untracked.string('CMS2026D46DDD.root')) process.p = cms.Path(process.dump) From 871ff48fbfe82ba35638628f021c112b6c4a23e5 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 13 Oct 2020 19:15:33 +0200 Subject: [PATCH 536/778] Correct a small issue in HGCalGeometry and update some test codes --- Geometry/CaloTopology/src/HGCalTopology.cc | 8 ++++---- Geometry/HGCalGeometry/src/HGCalGeometry.cc | 4 +++- .../HGCalGeometry/test/HGCalGeometryCheck.cc | 6 ++++-- .../test/HGCalWaferInFileCheck.cc | 8 +++++--- .../HGCalGeometry/test/HGCalWaferInFileTest.cc | 16 +++++++++++----- .../test/python/hgcGeomAnalyzer_cfg.py | 14 +++++++++----- .../test/python/runCaloCellGeometryTest_cfg.py | 8 +++++--- .../test/python/testHGCalCellDumpDD4Hep_cfg.py | 2 +- .../test/python/testHGCalCellDumpDDD_cfg.py | 2 +- .../test/python/testHGCalCorner_cfg.py | 7 +------ .../test/python/testHGCalGeometryCheck_cfg.py | 18 +++++++++--------- .../python/testHGCalGeometryMouseBite_cfg.py | 2 +- .../test/python/testHGCalGeometry_cfg.py | 8 ++------ .../test/python/testHGCalNeighbor_cfg.py | 6 +++--- .../test/python/testHGCalRecHitTool_cfg.py | 4 ++-- .../test/python/testHGCalSize_cfg.py | 6 +----- .../test/python/testHGCalWafer_cfg.py | 2 +- 17 files changed, 63 insertions(+), 58 deletions(-) diff --git a/Geometry/CaloTopology/src/HGCalTopology.cc b/Geometry/CaloTopology/src/HGCalTopology.cc index c8706f86f7016..bb514d0f17906 100644 --- a/Geometry/CaloTopology/src/HGCalTopology.cc +++ b/Geometry/CaloTopology/src/HGCalTopology.cc @@ -42,10 +42,7 @@ HGCalTopology::HGCalTopology(const HGCalDDDConstants& hdcons, int det) : hdcons_ } kSizeForDenseIndexing = (unsigned int)(2 * kHGhalf_); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "HGCalTopology initialized for detector " << det_ << ":" << subdet_ << " having " - << sectors_ << " Sectors, " << layers_ << " Layers from " << firstLay_ << ", " << cells_ - << " cells and total channels " << kSizeForDenseIndexing << ":" << (2 * kHGeomHalf_) - << std::endl; + edm::LogVerbatim("HGCalGeom") << "HGCalTopology initialized for detector " << det << ":" << det_ << ":" << subdet_ << " having " << sectors_ << " Sectors, " << layers_ << " Layers from " << firstLay_ << ", " << cells_ << " cells and total channels " << kSizeForDenseIndexing << ":" << (2 * kHGeomHalf_); #endif } @@ -633,6 +630,9 @@ HGCalTopology::DecodedDetId HGCalTopology::decode(const DetId& startId) const { DetId HGCalTopology::encode(const HGCalTopology::DecodedDetId& idx) const { DetId id; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HGCalGeom") << "Encode " << idx.det << ":" << idx.zSide << ":" << idx.iType << ":" << idx.iLay << ":" << idx.iSec1 << ":" << idx.iSec2 << ":" << idx.iCell1 << ":" << idx.iCell2; +#endif if (waferHexagon6()) { id = HGCalDetId((ForwardSubdetector)(idx.det), idx.zSide, idx.iLay, ((idx.iType > 0) ? 1 : 0), idx.iSec1, idx.iCell1) diff --git a/Geometry/HGCalGeometry/src/HGCalGeometry.cc b/Geometry/HGCalGeometry/src/HGCalGeometry.cc index bb00fde63fc96..94e16ff2c43bf 100644 --- a/Geometry/HGCalGeometry/src/HGCalGeometry.cc +++ b/Geometry/HGCalGeometry/src/HGCalGeometry.cc @@ -465,6 +465,8 @@ DetId HGCalGeometry::getClosestCell(const GlobalPoint& r) const { if ((cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) || (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc)) { HGCalTopology::DecodedDetId id = m_topology.decode(m_validGeomIds[cellIndex]); + if (id.det == 0) + id.det = static_cast<int>(m_topology.detector()); HepGeom::Point3D<float> local; if (r.z() > 0) { local = HepGeom::Point3D<float>(r.x(), r.y(), 0); @@ -496,7 +498,7 @@ DetId HGCalGeometry::getClosestCell(const GlobalPoint& r) const { id.iCell2 = kxy[4]; } #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local << " Id " << id.zSide << ":" << id.iLay << ":" + edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local << " Id " << id.det << ":" << id.zSide << ":" << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":" << id.iType << ":" << id.iCell1 << ":" << id.iCell2; #endif diff --git a/Geometry/HGCalGeometry/test/HGCalGeometryCheck.cc b/Geometry/HGCalGeometry/test/HGCalGeometryCheck.cc index 6fb2158a8a24d..cdb12701bb37f 100644 --- a/Geometry/HGCalGeometry/test/HGCalGeometryCheck.cc +++ b/Geometry/HGCalGeometry/test/HGCalGeometryCheck.cc @@ -57,7 +57,7 @@ HGCalGeometryCheck::HGCalGeometryCheck(const edm::ParameterSet& iC) geomTokens_{ edm::vector_transform(nameDetectors_, [this](const std::string& name) { - return esConsumes<HGCalGeometry, IdealGeometryRecord>(edm::ESInputTag{"", name}); + return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}); })}, rmin_(iC.getUntrackedParameter<double>("rMin", 0.0)), rmax_(iC.getUntrackedParameter<double>("rMax", 300.0)), @@ -111,7 +111,8 @@ void HGCalGeometryCheck::beginRun(const edm::Run&, const edm::EventSetup& iSetup auto zz = geom->topology().dddConstants().waferZ(lay, true); auto rr = geom->topology().dddConstants().rangeR(zz, true); - edm::LogVerbatim("HGCalGeom") << "Layer " << lay << " R " << rr.first << ":" << rr.second << " Z " << zz; + auto rr0 = geom->topology().dddConstants().rangeRLayer(lay, true); + edm::LogVerbatim("HGCalGeom") << "Layer " << lay << " R " << rr.first << ":" << rr.second << " (" << rr0.first << ":" << rr0.second << ") Z " << zz; double r = rr.first; while (r <= rr.second) { h_RZ_[0]->Fill(zz, r); @@ -120,6 +121,7 @@ void HGCalGeometryCheck::beginRun(const edm::Run&, const edm::EventSetup& iSetup double phi = 2 * k * M_PI / 100.0; GlobalPoint global1(r * cos(phi), r * sin(phi), zz); DetId id = geom->getClosestCell(global1); + if (ifNose_) { HFNoseDetId detId = HFNoseDetId(id); h_Mod_.back()->Fill(detId.waferU()); diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc index 1602811877504..30bb82f513bb7 100644 --- a/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc @@ -126,7 +126,7 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe << " extra ones\n\n"; // Now cross check the content - int allG(0), badT(0), badP(0), badR(0), badG(0), badT1(0), badT2(0); + int allG(0), badT(0), badP(0), badP2(0), badR(0), badG(0), badT1(0), badT2(0); for (unsigned int k = 0; k < hgdc.waferFileSize(); ++k) { int indx = hgdc.waferFileIndex(k); int type1 = std::get<0>(hgdc.waferFileInfo(k)); @@ -144,6 +144,8 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe bool typeOK = (type1 == type2); bool partOK = ((part1 == part2) || ((part1 == HGCalTypes::WaferFull) && (part2 == HGCalTypes::WaferOut))); bool rotnOK = ((rotn1 == rotn2) || (part1 == HGCalTypes::WaferFull) || (part2 == HGCalTypes::WaferFull)); + if (part1 < part2) + ++badP2; if (!typeOK) { ++badT; if (type1 == 0) @@ -164,11 +166,11 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe << ", " << type1 << ":" << type2 << ", " << partx1 << ":" << partx2 << ", " << rotn1 << ":" << rotn2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " << hgdc.waferZ(layer, true) << ") failure flag " << typeOK << ":" << partOK << ":" << rotnOK - << std::endl; + << ":" << (part1 >= part2) << std::endl; } } } - std::cout << "\n\nFinds " << badG << " (" << badT << "[" << badT1 << ":" << badT2 << "]:" << badP << ":" << badR + std::cout << "\n\nFinds " << badG << " (" << badT << "[" << badT1 << ":" << badT2 << "]:" << badP << ":" << badP2 << ":" << badR << ") mismatch among " << allG << " wafers with the same indices\n\n"; } } diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc index facb9283e4ab1..5af22b166f1a8 100644 --- a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc @@ -152,8 +152,8 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet << " wafers with the same indices\n\n"; // Now cross check the content (partial and orientation) - int allX(0), badG(0), badP(0), badR(0); - std::vector<int> wrongP(layers, 0), wrongR(layers, 0); + int allX(0), badG(0), badP(0), badP2(0), badR(0); + std::vector<int> wrongP(layers, 0), wrongP2(layers, 0), wrongR(layers, 0); for (unsigned int k = 0; k < hgdc.waferFileSize(); ++k) { int indx = hgdc.waferFileIndex(k); int part1 = std::get<1>(hgdc.waferFileInfo(k)); @@ -169,11 +169,17 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet int rotn2 = hgdc.waferTypeRotation(id.layer(), id.waferU(), id.waferV(), false, false).second; bool partOK = ((part1 == part2) || ((part1 == HGCalTypes::WaferFull) && (part2 == HGCalTypes::WaferOut))); bool rotnOK = ((rotn1 == rotn2) || (part1 == HGCalTypes::WaferFull) || (part2 == HGCalTypes::WaferFull)); + bool partOK2 = ((part1 > part2) || partOK); if (!partOK) { ++badP; if ((layer - layerf) < layers) ++wrongP[layer - layerf]; } + if (!partOK2) { + ++badP2; + if ((layer - layerf) < layers) + ++wrongP2[layer - layerf]; + } if (!rotnOK) { ++badR; if ((layer - layerf) < layers) @@ -188,7 +194,7 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << "," << type2 << ", " << partx1 << ":" << partx2 << ":" << part1 << ":" << part2 << ", " << rotn1 - << ":" << rotn2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " + << ":" << rotn2 << ", " << partOK2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " << hgdc.waferZ(layer, true) << ") failure flag " << partOK << ":" << rotnOK << " with " << points.size() << " points:"; for (auto point : points) @@ -197,11 +203,11 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet } } } - std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badR << ") mismatch in partial|orientation among " + std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR << ") mismatch in partial|orientation among " << allX << " wafers with the same indices" << std::endl; for (int k = 0; k < layers; ++k) { if ((wrongP[k] > 0) || (wrongR[k] > 0)) - std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongR[k] << std::endl; + std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] << ":" << wrongR[k] << std::endl; } std::cout << std::endl; } diff --git a/Geometry/HGCalGeometry/test/python/hgcGeomAnalyzer_cfg.py b/Geometry/HGCalGeometry/test/python/hgcGeomAnalyzer_cfg.py index b76787b2d8702..8a993f97d7956 100644 --- a/Geometry/HGCalGeometry/test/python/hgcGeomAnalyzer_cfg.py +++ b/Geometry/HGCalGeometry/test/python/hgcGeomAnalyzer_cfg.py @@ -10,13 +10,17 @@ fileName = "geom_output_"+options.geom -process = cms.Process("demo",eras.Phase2C8) +process = cms.Process("demo",eras.Phase2C11) process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -if options.geom == 'v10': - process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff') -elif options.geom == 'v11': - process.load('Configuration.Geometry.GeometryExtended2026D46Reco_cff') +if options.geom == 'v11': + process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') +elif options.geom == 'v12': + process.load('Configuration.Geometry.GeometryExtended2026D68Reco_cff') +elif options.geom == 'v13': + process.load('Configuration.Geometry.GeometryExtended202670Reco_cff') +elif options.geom == 'v14': + process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') else: raise Exception('UNKNOWN GEOMETRY!') diff --git a/Geometry/HGCalGeometry/test/python/runCaloCellGeometryTest_cfg.py b/Geometry/HGCalGeometry/test/python/runCaloCellGeometryTest_cfg.py index e3dd89d43afe9..a3ed3494a1904 100644 --- a/Geometry/HGCalGeometry/test/python/runCaloCellGeometryTest_cfg.py +++ b/Geometry/HGCalGeometry/test/python/runCaloCellGeometryTest_cfg.py @@ -1,9 +1,11 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process("CaloCellGeometryTest") +from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 -process.load("Configuration.Geometry.GeometryExtended2026D35_cff") -process.load("Configuration.Geometry.GeometryExtended2026D35Reco_cff") +process = cms.Process("CaloCellGeometryTest",Phase2C11) + +process.load("Configuration.Geometry.GeometryExtended2026D71_cff") +process.load("Configuration.Geometry.GeometryExtended2026D71Reco_cff") process.load('FWCore.MessageService.MessageLogger_cfi') if hasattr(process,'MessageLogger'): diff --git a/Geometry/HGCalGeometry/test/python/testHGCalCellDumpDD4Hep_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalCellDumpDD4Hep_cfg.py index b790c1d2c3e4f..d479b20de3706 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalCellDumpDD4Hep_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalCellDumpDD4Hep_cfg.py @@ -18,7 +18,7 @@ process.load("Geometry.HGCalGeometry.hgcalGeometryDump_cfi") process.DDDetectorESProducer = cms.ESSource("DDDetectorESProducer", - confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D41.xml'), + confGeomXMLFiles = cms.FileInPath('Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D71.xml'), appendToDataLabel = cms.string('') ) diff --git a/Geometry/HGCalGeometry/test/python/testHGCalCellDumpDDD_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalCellDumpDDD_cfg.py index c2dd9ebe8d5fd..75f5e8038fa67 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalCellDumpDDD_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalCellDumpDDD_cfg.py @@ -2,7 +2,7 @@ process = cms.Process("HcalGeometryTest") -process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D41XML_cfi") +process.load("Geometry.CMSCommonData.cmsExtendedGeometry2026D71XML_cfi") process.load("Geometry.EcalCommonData.ecalSimulationParameters_cff") process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") diff --git a/Geometry/HGCalGeometry/test/python/testHGCalCorner_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalCorner_cfg.py index 5e17f74ba1b6d..3f9d95bd6cef0 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalCorner_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalCorner_cfg.py @@ -2,12 +2,7 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") - -#process.load("Geometry.HGCalCommonData.testHGCV8XML_cfi") -#process.load("Geometry.HGCalCommonData.hgcalV6NumberingInitialization_cfi") -#process.load("Geometry.HGCalCommonData.hgcalV6ParametersInitialization_cfi") -#process.load("Geometry.CaloEventSetup.HGCalV6Topology_cfi") -process.load("Geometry.HGCalCommonData.testHGCV10XML_cfi") +process.load("Geometry.HGCalCommonData.testHGCalV14XML_cfi") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") process.load("Geometry.CaloEventSetup.HGCalV9Topology_cfi") diff --git a/Geometry/HGCalGeometry/test/python/testHGCalGeometryCheck_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalGeometryCheck_cfg.py index 31f3b4abe189c..517c20a699404 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalGeometryCheck_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalGeometryCheck_cfg.py @@ -1,14 +1,14 @@ import FWCore.ParameterSet.Config as cms -#from Configuration.Eras.Era_Phase2C4_cff import Phase2C4 -#process = cms.Process('PROD',Phase2C4) -#process.load('Configuration.Geometry.GeometryExtended2026D35_cff') -#process.load('Configuration.Geometry.GeometryExtended2026D35Reco_cff') - -from Configuration.Eras.Era_Phase2C4_cff import Phase2C4 -process = cms.Process('PROD',Phase2C4) -process.load('Configuration.Geometry.GeometryExtended2026D41_cff') -process.load('Configuration.Geometry.GeometryExtended2026D41Reco_cff') +#from Configuration.Eras.Era_Phase2C9_cff import Phase2C9 +#process = cms.Process('PROD',Phase2C9) +#process.load('Configuration.Geometry.GeometryExtended2026D49_cff') +#process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') + +from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 +process = cms.Process('PROD',Phase2C11) +process.load('Configuration.Geometry.GeometryExtended2026D71_cff') +process.load('Configuration.Geometry.GeometryExtended2026D71Reco_cff') process.load("SimGeneral.HepPDTESSource.pdt_cfi") process.load('Geometry.HGCalGeometry.hgcalGeometryCheck_cfi') diff --git a/Geometry/HGCalGeometry/test/python/testHGCalGeometryMouseBite_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalGeometryMouseBite_cfg.py index 128275087eee3..aa1ce8766410e 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalGeometryMouseBite_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalGeometryMouseBite_cfg.py @@ -3,7 +3,7 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -process.load("Configuration.Geometry.GeometryExtended2026D47Reco_cff") +process.load("Configuration.Geometry.GeometryExtended2026D60Reco_cff") process.load('FWCore.MessageService.MessageLogger_cfi') if hasattr(process,'MessageLogger'): diff --git a/Geometry/HGCalGeometry/test/python/testHGCalGeometry_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalGeometry_cfg.py index 54980035ebf55..89e7f514949ad 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalGeometry_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalGeometry_cfg.py @@ -3,12 +3,8 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -process.load("Configuration.Geometry.GeometryExtended2026D41Reco_cff") -#process.load("Geometry.HGCalCommonData.testHGCV8XML_cfi") -#process.load("Geometry.HGCalCommonData.hgcalV6NumberingInitialization_cfi") -#process.load("Geometry.HGCalCommonData.hgcalV6ParametersInitialization_cfi") -#process.load("Geometry.CaloEventSetup.HGCalV6Topology_cfi") -#process.load("Geometry.HGCalCommonData.testHGCV10XML_cfi") +process.load("Configuration.Geometry.GeometryExtended2026D71Reco_cff") +#process.load("Geometry.HGCalCommonData.testHGCalV14XML_cfi") #process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") #process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") #process.load("Geometry.CaloEventSetup.HGCalV9Topology_cfi") diff --git a/Geometry/HGCalGeometry/test/python/testHGCalNeighbor_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalNeighbor_cfg.py index 72324c3a0fb8c..75d83e0257ea7 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalNeighbor_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalNeighbor_cfg.py @@ -1,10 +1,10 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Phase2C4_cff import Phase2C4 -process = cms.Process("PROD",Phase2C4) +from Configuration.Eras.Era_Phase2C11_cff import Phase2C11 +process = cms.Process("PROD",Phase2C11) process.load("SimGeneral.HepPDTESSource.pdt_cfi") -process.load("Configuration.Geometry.GeometryExtended2026D35Reco_cff") +process.load("Configuration.Geometry.GeometryExtended2026D71Reco_cff") process.load('Configuration.StandardSequences.MagneticField_cff') process.load('TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff') process.load('FWCore.MessageService.MessageLogger_cfi') diff --git a/Geometry/HGCalGeometry/test/python/testHGCalRecHitTool_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalRecHitTool_cfg.py index 507169ad6d702..0f1f13eb1f886 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalRecHitTool_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalRecHitTool_cfg.py @@ -4,8 +4,8 @@ process.load("SimGeneral.HepPDTESSource.pdt_cfi") process.load("Configuration.Geometry.GeometryExtended2026D49Reco_cff") -#process.load("Configuration.Geometry.GeometryExtended2026D35Reco_cff") -#process.load("Configuration.Geometry.GeometryExtended2026D41Reco_cff") +#process.load("Configuration.Geometry.GeometryExtended2026D67Reco_cff") +#process.load("Configuration.Geometry.GeometryExtended2026D71Reco_cff") process.load('FWCore.MessageService.MessageLogger_cfi') if hasattr(process,'MessageLogger'): diff --git a/Geometry/HGCalGeometry/test/python/testHGCalSize_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalSize_cfg.py index e3eb0165dbf61..8e494b2b49700 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalSize_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalSize_cfg.py @@ -3,11 +3,7 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -#process.load("Geometry.HGCalCommonData.testHGCV8XML_cfi") -#process.load("Geometry.HGCalCommonData.hgcalV6NumberingInitialization_cfi") -#process.load("Geometry.HGCalCommonData.hgcalV6ParametersInitialization_cfi") -#process.load("Geometry.CaloEventSetup.HGCalV6Topology_cfi") -process.load("Geometry.HGCalCommonData.testHGCXML_cfi") +process.load("Geometry.HGCalCommonData.testHGCalV14XML_cfi") process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") process.load("Geometry.CaloEventSetup.HGCalV9Topology_cfi") diff --git a/Geometry/HGCalGeometry/test/python/testHGCalWafer_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalWafer_cfg.py index e7f466118d71f..604351681143c 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalWafer_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalWafer_cfg.py @@ -2,7 +2,7 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pdt_cfi") -process.load("Configuration.Geometry.GeometryExtended2026D46Reco_cff") +process.load("Configuration.Geometry.GeometryExtended2026D71Reco_cff") process.load('FWCore.MessageService.MessageLogger_cfi') if hasattr(process,'MessageLogger'): From 9494d94565d6c025f93cf83dca20bcef66bdc339 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 13 Oct 2020 19:29:12 +0200 Subject: [PATCH 537/778] Code Check --- Geometry/CaloTopology/src/HGCalTopology.cc | 8 +++++-- Geometry/HGCalGeometry/src/HGCalGeometry.cc | 8 +++---- .../HGCalGeometry/test/HGCalGeometryCheck.cc | 13 ++++++------ .../test/HGCalWaferInFileCheck.cc | 12 +++++------ .../test/HGCalWaferInFileTest.cc | 21 ++++++++++--------- 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/Geometry/CaloTopology/src/HGCalTopology.cc b/Geometry/CaloTopology/src/HGCalTopology.cc index bb514d0f17906..2e1ab87e9b968 100644 --- a/Geometry/CaloTopology/src/HGCalTopology.cc +++ b/Geometry/CaloTopology/src/HGCalTopology.cc @@ -42,7 +42,10 @@ HGCalTopology::HGCalTopology(const HGCalDDDConstants& hdcons, int det) : hdcons_ } kSizeForDenseIndexing = (unsigned int)(2 * kHGhalf_); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "HGCalTopology initialized for detector " << det << ":" << det_ << ":" << subdet_ << " having " << sectors_ << " Sectors, " << layers_ << " Layers from " << firstLay_ << ", " << cells_ << " cells and total channels " << kSizeForDenseIndexing << ":" << (2 * kHGeomHalf_); + edm::LogVerbatim("HGCalGeom") << "HGCalTopology initialized for detector " << det << ":" << det_ << ":" << subdet_ + << " having " << sectors_ << " Sectors, " << layers_ << " Layers from " << firstLay_ + << ", " << cells_ << " cells and total channels " << kSizeForDenseIndexing << ":" + << (2 * kHGeomHalf_); #endif } @@ -631,7 +634,8 @@ HGCalTopology::DecodedDetId HGCalTopology::decode(const DetId& startId) const { DetId HGCalTopology::encode(const HGCalTopology::DecodedDetId& idx) const { DetId id; #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "Encode " << idx.det << ":" << idx.zSide << ":" << idx.iType << ":" << idx.iLay << ":" << idx.iSec1 << ":" << idx.iSec2 << ":" << idx.iCell1 << ":" << idx.iCell2; + edm::LogVerbatim("HGCalGeom") << "Encode " << idx.det << ":" << idx.zSide << ":" << idx.iType << ":" << idx.iLay + << ":" << idx.iSec1 << ":" << idx.iSec2 << ":" << idx.iCell1 << ":" << idx.iCell2; #endif if (waferHexagon6()) { id = diff --git a/Geometry/HGCalGeometry/src/HGCalGeometry.cc b/Geometry/HGCalGeometry/src/HGCalGeometry.cc index 94e16ff2c43bf..8ea61829d841e 100644 --- a/Geometry/HGCalGeometry/src/HGCalGeometry.cc +++ b/Geometry/HGCalGeometry/src/HGCalGeometry.cc @@ -465,7 +465,7 @@ DetId HGCalGeometry::getClosestCell(const GlobalPoint& r) const { if ((cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) || (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc)) { HGCalTopology::DecodedDetId id = m_topology.decode(m_validGeomIds[cellIndex]); - if (id.det == 0) + if (id.det == 0) id.det = static_cast<int>(m_topology.detector()); HepGeom::Point3D<float> local; if (r.z() > 0) { @@ -498,9 +498,9 @@ DetId HGCalGeometry::getClosestCell(const GlobalPoint& r) const { id.iCell2 = kxy[4]; } #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local << " Id " << id.det << ":" << id.zSide << ":" << id.iLay << ":" - << id.iSec1 << ":" << id.iSec2 << ":" << id.iType << ":" << id.iCell1 << ":" - << id.iCell2; + edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local << " Id " << id.det << ":" << id.zSide << ":" + << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":" << id.iType << ":" + << id.iCell1 << ":" << id.iCell2; #endif //check if returned cell is valid diff --git a/Geometry/HGCalGeometry/test/HGCalGeometryCheck.cc b/Geometry/HGCalGeometry/test/HGCalGeometryCheck.cc index cdb12701bb37f..46fb49aca828b 100644 --- a/Geometry/HGCalGeometry/test/HGCalGeometryCheck.cc +++ b/Geometry/HGCalGeometry/test/HGCalGeometryCheck.cc @@ -54,11 +54,11 @@ class HGCalGeometryCheck : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm: HGCalGeometryCheck::HGCalGeometryCheck(const edm::ParameterSet& iC) : nameDetectors_(iC.getParameter<std::vector<std::string>>("detectorNames")), - geomTokens_{ - edm::vector_transform(nameDetectors_, - [this](const std::string& name) { - return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}); - })}, + geomTokens_{edm::vector_transform( + nameDetectors_, + [this](const std::string& name) { + return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}); + })}, rmin_(iC.getUntrackedParameter<double>("rMin", 0.0)), rmax_(iC.getUntrackedParameter<double>("rMax", 300.0)), zmin_(iC.getUntrackedParameter<double>("zMin", 300.0)), @@ -112,7 +112,8 @@ void HGCalGeometryCheck::beginRun(const edm::Run&, const edm::EventSetup& iSetup auto zz = geom->topology().dddConstants().waferZ(lay, true); auto rr = geom->topology().dddConstants().rangeR(zz, true); auto rr0 = geom->topology().dddConstants().rangeRLayer(lay, true); - edm::LogVerbatim("HGCalGeom") << "Layer " << lay << " R " << rr.first << ":" << rr.second << " (" << rr0.first << ":" << rr0.second << ") Z " << zz; + edm::LogVerbatim("HGCalGeom") << "Layer " << lay << " R " << rr.first << ":" << rr.second << " (" << rr0.first + << ":" << rr0.second << ") Z " << zz; double r = rr.first; while (r <= rr.second) { h_RZ_[0]->Fill(zz, r); diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc index 30bb82f513bb7..5c72924125001 100644 --- a/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc @@ -144,8 +144,8 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe bool typeOK = (type1 == type2); bool partOK = ((part1 == part2) || ((part1 == HGCalTypes::WaferFull) && (part2 == HGCalTypes::WaferOut))); bool rotnOK = ((rotn1 == rotn2) || (part1 == HGCalTypes::WaferFull) || (part2 == HGCalTypes::WaferFull)); - if (part1 < part2) - ++badP2; + if (part1 < part2) + ++badP2; if (!typeOK) { ++badT; if (type1 == 0) @@ -165,13 +165,13 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << ", " << type1 << ":" << type2 << ", " << partx1 << ":" << partx2 << ", " << rotn1 << ":" << rotn2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " - << hgdc.waferZ(layer, true) << ") failure flag " << typeOK << ":" << partOK << ":" << rotnOK - << ":" << (part1 >= part2) << std::endl; + << hgdc.waferZ(layer, true) << ") failure flag " << typeOK << ":" << partOK << ":" << rotnOK << ":" + << (part1 >= part2) << std::endl; } } } - std::cout << "\n\nFinds " << badG << " (" << badT << "[" << badT1 << ":" << badT2 << "]:" << badP << ":" << badP2 << ":" << badR - << ") mismatch among " << allG << " wafers with the same indices\n\n"; + std::cout << "\n\nFinds " << badG << " (" << badT << "[" << badT1 << ":" << badT2 << "]:" << badP << ":" << badP2 + << ":" << badR << ") mismatch among " << allG << " wafers with the same indices\n\n"; } } diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc index 5af22b166f1a8..042d859f99d77 100644 --- a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc @@ -169,17 +169,17 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet int rotn2 = hgdc.waferTypeRotation(id.layer(), id.waferU(), id.waferV(), false, false).second; bool partOK = ((part1 == part2) || ((part1 == HGCalTypes::WaferFull) && (part2 == HGCalTypes::WaferOut))); bool rotnOK = ((rotn1 == rotn2) || (part1 == HGCalTypes::WaferFull) || (part2 == HGCalTypes::WaferFull)); - bool partOK2 = ((part1 > part2) || partOK); + bool partOK2 = ((part1 > part2) || partOK); if (!partOK) { ++badP; if ((layer - layerf) < layers) ++wrongP[layer - layerf]; } - if (!partOK2) { - ++badP2; + if (!partOK2) { + ++badP2; if ((layer - layerf) < layers) ++wrongP2[layer - layerf]; - } + } if (!rotnOK) { ++badR; if ((layer - layerf) < layers) @@ -194,20 +194,21 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << "," << type2 << ", " << partx1 << ":" << partx2 << ":" << part1 << ":" << part2 << ", " << rotn1 - << ":" << rotn2 << ", " << partOK2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " - << hgdc.waferZ(layer, true) << ") failure flag " << partOK << ":" << rotnOK << " with " - << points.size() << " points:"; + << ":" << rotn2 << ", " << partOK2 << ") at (" << std::setprecision(4) << xy.first << ", " + << xy.second << ", " << hgdc.waferZ(layer, true) << ") failure flag " << partOK << ":" << rotnOK + << " with " << points.size() << " points:"; for (auto point : points) std::cout << " " << point; std::cout << " in the region " << rr.first << ":" << rr.second << std::endl; } } } - std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR << ") mismatch in partial|orientation among " - << allX << " wafers with the same indices" << std::endl; + std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR + << ") mismatch in partial|orientation among " << allX << " wafers with the same indices" << std::endl; for (int k = 0; k < layers; ++k) { if ((wrongP[k] > 0) || (wrongR[k] > 0)) - std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] << ":" << wrongR[k] << std::endl; + std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] << ":" << wrongR[k] + << std::endl; } std::cout << std::endl; } From 9873e80c9654920f1aecbbadc31ce63f5c6609ac Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Wed, 14 Oct 2020 04:18:25 +0900 Subject: [PATCH 538/778] bug in counting fed data size --- .../plugins/GEMDigiToRawModule.cc | 13 ++++++++---- .../plugins/GEMRawToDigiModule.cc | 20 +++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 83f3f33299d62..8c25e3366b5ec 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -122,8 +122,8 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } } - uint32_t amc13EvtLength = 0; for (unsigned int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXGEMFEDID; ++fedId) { + uint32_t amc13EvtLength = 0; std::unique_ptr<AMC13Event> amc13Event = std::make_unique<AMC13Event>(); for (auto const& gemBx : gemBxMap) { @@ -222,6 +222,8 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve amc13Event->setAMC13Trailer(BX_id, LV1_id, BX_id); //CDF trailer uint32_t EvtLength = amc13EvtLength + 4; // 2 header and 2 trailer + LogDebug("GEMDigiToRawModule") << " EvtLength: " << int(EvtLength); + amc13Event->setCDFTrailer(EvtLength); amc13Events.emplace_back(std::move(amc13Event)); } // finished making amc13Event data @@ -266,10 +268,13 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve fedRawData.resize(dataSize); uint64_t* w = reinterpret_cast<uint64_t*>(fedRawData.data()); - for (const auto& word : words) + for (const auto& word : words) { +#ifdef EDM_ML_DEBUG + std::cout << std::bitset<64>(word) << std::endl; +#endif *(w++) = word; - - LogDebug("GEMDigiToRawModule") << " words " << words.size(); + } + LogDebug("GEMDigiToRawModule") << " words " << words.size(); } iEvent.put(std::move(fedRawDataCol)); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index 9f54323149ce1..bc80c5930822c 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -113,13 +113,21 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve const FEDRawData& fedData = fed_buffers->FEDData(fedId); int nWords = fedData.size() / sizeof(uint64_t); - LogDebug("GEMRawToDigiModule") << " words " << nWords; - + LogDebug("GEMRawToDigiModule") << "fedId:" << fedId << " words: " << nWords; + if (nWords < 5) continue; const unsigned char* data = fedData.data(); const uint64_t* word = reinterpret_cast<const uint64_t*>(data); + +#ifdef EDM_ML_DEBUG + const uint64_t* w = word; + for (int i =0; i< nWords;i++) { + std::cout << std::bitset<64>(*(w++)) << std::endl; + } +#endif + auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); if (amc13Event == nullptr) @@ -133,7 +141,6 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve for (auto gebData : *amcData.gebs()) { uint8_t gebId = gebData.inputID(); GEMROMapping::chamEC geb_ec = {fedId, amcNum, gebId}; - LogDebug("GEMRawToDigiModule") << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId); GEMROMapping::chamDC geb_dc = gemROMap->chamberPos(geb_ec); GEMDetId gemChId = geb_dc.detId; @@ -142,7 +149,6 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve vfatData.setVersion(geb_dc.vfatVer); uint16_t vfatId = vfatData.vfatId(); GEMROMapping::vfatEC vfat_ec = {vfatId, gemChId}; - LogDebug("GEMRawToDigiModule") << " vfatId: " << vfatId << " gemChId:" << gemChId; // check if ChipID exists. if (!gemROMap->isValidChipID(vfat_ec)) { @@ -167,7 +173,6 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve vfatData.setPhi(vfat_dc.localPhi); GEMDetId gemId = vfat_dc.detId; int bx(vfatData.bc()); - LogDebug("GEMRawToDigiModule") << " gemId: " << gemId << " bx:" << bx; for (int chan = 0; chan < VFATdata::nChannels; ++chan) { uint8_t chan0xf = 0; @@ -187,7 +192,10 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve GEMDigi digi(stripId, bx); - LogDebug("GEMRawToDigiModule") << stripId << " "; + LogDebug("GEMRawToDigiModule") + << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) + << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId + << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); outGEMDigis.get()->insertDigi(gemId, digi); From d7eefac24a359ea64fa55f54501be3bdaec2aaa2 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Wed, 14 Oct 2020 04:33:39 +0900 Subject: [PATCH 539/778] code-format --- .../GEMRawToDigi/plugins/GEMDigiToRawModule.cc | 6 +++--- .../GEMRawToDigi/plugins/GEMRawToDigiModule.cc | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 8c25e3366b5ec..9baee3ef5a305 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -223,7 +223,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve //CDF trailer uint32_t EvtLength = amc13EvtLength + 4; // 2 header and 2 trailer LogDebug("GEMDigiToRawModule") << " EvtLength: " << int(EvtLength); - + amc13Event->setCDFTrailer(EvtLength); amc13Events.emplace_back(std::move(amc13Event)); } // finished making amc13Event data @@ -273,8 +273,8 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve std::cout << std::bitset<64>(word) << std::endl; #endif *(w++) = word; - } - LogDebug("GEMDigiToRawModule") << " words " << words.size(); + } + LogDebug("GEMDigiToRawModule") << " words " << words.size(); } iEvent.put(std::move(fedRawDataCol)); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index bc80c5930822c..e66cc3b9b05cc 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -114,7 +114,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve int nWords = fedData.size() / sizeof(uint64_t); LogDebug("GEMRawToDigiModule") << "fedId:" << fedId << " words: " << nWords; - + if (nWords < 5) continue; const unsigned char* data = fedData.data(); @@ -123,11 +123,11 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve #ifdef EDM_ML_DEBUG const uint64_t* w = word; - for (int i =0; i< nWords;i++) { + for (int i = 0; i < nWords; i++) { std::cout << std::bitset<64>(*(w++)) << std::endl; } #endif - + auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); if (amc13Event == nullptr) @@ -193,9 +193,9 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve GEMDigi digi(stripId, bx); LogDebug("GEMRawToDigiModule") - << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) - << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId - << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); + << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) << " vfat:" << vfat_dc.localPhi + << ",type: " << vfat_dc.vfatType << " id:" << gemId << " ch:" << chMap.chNum << " st:" << digi.strip() + << " bx:" << digi.bx(); outGEMDigis.get()->insertDigi(gemId, digi); From 96a3519d517dc48cbd8ae10f8dfb9feb76a4205e Mon Sep 17 00:00:00 2001 From: Kevin Pedro <kpedro88@gmail.com> Date: Tue, 13 Oct 2020 14:50:31 -0500 Subject: [PATCH 540/778] better use of span (avoid UB) --- HeterogeneousCore/SonicTriton/interface/TritonData.h | 11 ++++++----- .../SonicTriton/interface/triton_utils.h | 3 ++- HeterogeneousCore/SonicTriton/src/TritonData.cc | 4 ++-- HeterogeneousCore/SonicTriton/src/triton_utils.cc | 3 ++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/HeterogeneousCore/SonicTriton/interface/TritonData.h b/HeterogeneousCore/SonicTriton/interface/TritonData.h index e8b678703665f..50808de4a1216 100644 --- a/HeterogeneousCore/SonicTriton/interface/TritonData.h +++ b/HeterogeneousCore/SonicTriton/interface/TritonData.h @@ -30,13 +30,14 @@ class TritonData { public: using Result = nvidia::inferenceserver::client::InferResult; using TensorMetadata = inference::ModelMetadataResponse_TensorMetadata; - using ShapeView = edm::Span<const int64_t*>; + using ShapeType = std::vector<int64_t>; + using ShapeView = edm::Span<ShapeType::const_iterator>; //constructor TritonData(const std::string& name, const TensorMetadata& model_info, bool noBatch); //some members can be modified - bool setShape(const std::vector<int64_t>& newShape) { return setShape(newShape, true); } + bool setShape(const ShapeType& newShape) { return setShape(newShape, true); } bool setShape(unsigned loc, int64_t val) { return setShape(loc, val, true); } //io accessors @@ -61,7 +62,7 @@ class TritonData { friend class TritonClient; //private accessors only used by client - bool setShape(const std::vector<int64_t>& newShape, bool canThrow); + bool setShape(const ShapeType& newShape, bool canThrow); bool setShape(unsigned loc, int64_t val, bool canThrow); void setBatchSize(unsigned bsize); void reset(); @@ -80,10 +81,10 @@ class TritonData { //members std::string name_; std::shared_ptr<IO> data_; - const std::vector<int64_t> dims_; + const ShapeType dims_; bool noBatch_; unsigned batchSize_; - std::vector<int64_t> fullShape_; + ShapeType fullShape_; ShapeView shape_; bool variableDims_; int64_t productDims_; diff --git a/HeterogeneousCore/SonicTriton/interface/triton_utils.h b/HeterogeneousCore/SonicTriton/interface/triton_utils.h index 361334dd1df26..1be6bea4e18eb 100644 --- a/HeterogeneousCore/SonicTriton/interface/triton_utils.h +++ b/HeterogeneousCore/SonicTriton/interface/triton_utils.h @@ -25,7 +25,8 @@ namespace triton_utils { } // namespace triton_utils -extern template std::string triton_utils::printColl(const edm::Span<const int64_t*>& coll, const std::string& delim); +extern template std::string triton_utils::printColl(const edm::Span<std::vector<int64_t>::const_iterator>& coll, + const std::string& delim); extern template std::string triton_utils::printColl(const std::vector<uint8_t>& coll, const std::string& delim); extern template std::string triton_utils::printColl(const std::vector<float>& coll, const std::string& delim); extern template std::string triton_utils::printColl(const std::unordered_set<std::string>& coll, diff --git a/HeterogeneousCore/SonicTriton/src/TritonData.cc b/HeterogeneousCore/SonicTriton/src/TritonData.cc index dd289726daa7c..258671be07691 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonData.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonData.cc @@ -28,7 +28,7 @@ TritonData<IO>::TritonData(const std::string& name, const TritonData<IO>::Tensor noBatch_(noBatch), batchSize_(0), fullShape_(dims_), - shape_(&*(fullShape_.begin() + (noBatch_ ? 0 : 1)), &*(fullShape_.end())), + shape_(fullShape_.begin() + (noBatch_ ? 0 : 1), fullShape_.end()), variableDims_(anyNeg(shape_)), productDims_(variableDims_ ? -1 : dimProduct(shape_)), dname_(model_info.datatype()), @@ -52,7 +52,7 @@ void TritonOutputData::createObject(nic::InferRequestedOutput** ioptr) const { //setters template <typename IO> -bool TritonData<IO>::setShape(const std::vector<int64_t>& newShape, bool canThrow) { +bool TritonData<IO>::setShape(const TritonData<IO>::ShapeType& newShape, bool canThrow) { bool result = true; for (unsigned i = 0; i < newShape.size(); ++i) { result &= setShape(i, newShape[i], canThrow); diff --git a/HeterogeneousCore/SonicTriton/src/triton_utils.cc b/HeterogeneousCore/SonicTriton/src/triton_utils.cc index 6bf180da6f0e5..eeb56a6b8895f 100644 --- a/HeterogeneousCore/SonicTriton/src/triton_utils.cc +++ b/HeterogeneousCore/SonicTriton/src/triton_utils.cc @@ -30,7 +30,8 @@ namespace triton_utils { } // namespace triton_utils -template std::string triton_utils::printColl(const edm::Span<const int64_t*>& coll, const std::string& delim); +template std::string triton_utils::printColl(const edm::Span<std::vector<int64_t>::const_iterator>& coll, + const std::string& delim); template std::string triton_utils::printColl(const std::vector<uint8_t>& coll, const std::string& delim); template std::string triton_utils::printColl(const std::vector<float>& coll, const std::string& delim); template std::string triton_utils::printColl(const std::unordered_set<std::string>& coll, const std::string& delim); From 83336a057066d4ad10874802888ea310b6eabb42 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Tue, 13 Oct 2020 15:36:43 -0500 Subject: [PATCH 541/778] Fix code-checks errors in FWCore and DataFormats/Common --- DataFormats/Common/interface/Wrapper.h | 7 +--- .../Concurrency/interface/LimitedTaskQueue.h | 5 +-- .../Concurrency/interface/SerialTaskQueue.h | 6 +-- .../Concurrency/interface/WaitingTaskList.h | 5 +-- FWCore/Framework/interface/ComponentMaker.h | 7 +--- FWCore/Framework/interface/ModuleChanger.h | 6 +-- .../interface/ProcessingController.h | 7 +--- .../interface/stream/EDAnalyzerAdaptor.h | 6 +-- .../interface/stream/EDAnalyzerAdaptorBase.h | 6 +-- .../interface/stream/EDAnalyzerBase.h | 6 +-- .../interface/stream/EDFilterAdaptorBase.h | 6 +-- .../Framework/interface/stream/EDFilterBase.h | 6 +-- .../interface/stream/EDProducerAdaptorBase.h | 6 +-- .../interface/stream/EDProducerBase.h | 6 +-- .../interface/stream/ProducingModuleAdaptor.h | 6 +-- .../stream/ProducingModuleAdaptorBase.h | 6 +-- .../Framework/src/SharedResourcesRegistry.h | 7 ++-- .../Framework/src/UnscheduledConfigurator.h | 7 ++-- FWCore/MessageLogger/interface/MessageDrop.h | 4 +- .../MessageLogger/interface/MessageLogger.h | 41 ++++++++++--------- .../MessageLogger/interface/MessageLoggerQ.h | 7 ++-- .../interface/ParameterSetDescriptionFiller.h | 18 +++----- .../ParameterSetDescriptionFillerBase.h | 8 ++-- .../PluginManager/interface/PluginFactory.h | 6 +-- .../interface/PluginFactoryBase.h | 6 +-- .../PluginManager/interface/PluginManager.h | 5 +-- .../PluginManager/interface/SharedLibrary.h | 6 +-- .../interface/PythonEventProcessor.h | 6 +-- .../interface/ServiceMakerBase.h | 6 +-- .../interface/ServiceRegistry.h | 9 ++-- .../interface/ServiceWrapper.h | 7 +--- .../interface/ServiceWrapperBase.h | 6 +-- .../interface/ServicesManager.h | 6 +-- .../Utilities/interface/ProcessBlockIndex.h | 3 +- .../interface/RandomNumberGenerator.h | 6 +-- .../Utilities/interface/TimingServiceBase.h | 6 +-- 36 files changed, 102 insertions(+), 165 deletions(-) diff --git a/DataFormats/Common/interface/Wrapper.h b/DataFormats/Common/interface/Wrapper.h index 3d4cc9125abfb..2f6031bce6e98 100644 --- a/DataFormats/Common/interface/Wrapper.h +++ b/DataFormats/Common/interface/Wrapper.h @@ -27,6 +27,8 @@ namespace edm { typedef T wrapped_type; // used with the dictionary to identify Wrappers Wrapper() : WrapperBase(), present(false), obj() {} explicit Wrapper(std::unique_ptr<T> ptr); + Wrapper(Wrapper<T> const& rh) = delete; // disallow copy construction + Wrapper<T>& operator=(Wrapper<T> const&) = delete; // disallow assignment template <typename... Args> explicit Wrapper(Emplace, Args&&...); @@ -71,11 +73,6 @@ namespace edm { std::shared_ptr<soa::TableExaminerBase> tableExaminer_() const override; private: - // We wish to disallow copy construction and assignment. - // We make the copy constructor and assignment operator private. - Wrapper(Wrapper<T> const& rh) = delete; // disallow copy construction - Wrapper<T>& operator=(Wrapper<T> const&) = delete; // disallow assignment - bool present; T obj; }; diff --git a/FWCore/Concurrency/interface/LimitedTaskQueue.h b/FWCore/Concurrency/interface/LimitedTaskQueue.h index cc4af4eaaa3a5..a95e76188c513 100644 --- a/FWCore/Concurrency/interface/LimitedTaskQueue.h +++ b/FWCore/Concurrency/interface/LimitedTaskQueue.h @@ -39,6 +39,8 @@ namespace edm { class LimitedTaskQueue { public: LimitedTaskQueue(unsigned int iLimit) : m_queues{iLimit} {} + LimitedTaskQueue(const LimitedTaskQueue&) = delete; + const LimitedTaskQueue& operator=(const LimitedTaskQueue&) = delete; // ---------- member functions --------------------------- @@ -116,9 +118,6 @@ namespace edm { unsigned int concurrencyLimit() const { return m_queues.size(); } private: - LimitedTaskQueue(const LimitedTaskQueue&) = delete; - const LimitedTaskQueue& operator=(const LimitedTaskQueue&) = delete; - // ---------- member data -------------------------------- std::vector<SerialTaskQueue> m_queues; }; diff --git a/FWCore/Concurrency/interface/SerialTaskQueue.h b/FWCore/Concurrency/interface/SerialTaskQueue.h index b771c8ef51a34..d72686a50ade0 100644 --- a/FWCore/Concurrency/interface/SerialTaskQueue.h +++ b/FWCore/Concurrency/interface/SerialTaskQueue.h @@ -74,6 +74,9 @@ namespace edm { m_pauseCount(iOther.m_pauseCount.exchange(0)) { assert(m_tasks.empty() and m_taskChosen == false); } + SerialTaskQueue(const SerialTaskQueue&) = delete; + const SerialTaskQueue& operator=(const SerialTaskQueue&) = delete; + ~SerialTaskQueue(); // ---------- const member functions --------------------- @@ -139,9 +142,6 @@ namespace edm { tbb::task* pushAndGetNextTaskToRun(const T& iAction); private: - SerialTaskQueue(const SerialTaskQueue&) = delete; - const SerialTaskQueue& operator=(const SerialTaskQueue&) = delete; - /** Base class for all tasks held by the SerialTaskQueue */ class TaskBase : public tbb::task { friend class SerialTaskQueue; diff --git a/FWCore/Concurrency/interface/WaitingTaskList.h b/FWCore/Concurrency/interface/WaitingTaskList.h index 7a78f65b7beb4..58eb1ba4081a0 100644 --- a/FWCore/Concurrency/interface/WaitingTaskList.h +++ b/FWCore/Concurrency/interface/WaitingTaskList.h @@ -106,6 +106,8 @@ namespace edm { * The value is only useful for optimization as the object can resize itself. */ explicit WaitingTaskList(unsigned int iInitialSize = 2); + WaitingTaskList(const WaitingTaskList&) = delete; // stop default + const WaitingTaskList& operator=(const WaitingTaskList&) = delete; // stop default ~WaitingTaskList() = default; // ---------- member functions --------------------------- @@ -143,9 +145,6 @@ namespace edm { void reset(); private: - WaitingTaskList(const WaitingTaskList&) = delete; // stop default - const WaitingTaskList& operator=(const WaitingTaskList&) = delete; // stop default - /**Handles spawning the tasks, * safe to call from multiple threads */ diff --git a/FWCore/Framework/interface/ComponentMaker.h b/FWCore/Framework/interface/ComponentMaker.h index ac154b7c441ba..2d3263a47f654 100644 --- a/FWCore/Framework/interface/ComponentMaker.h +++ b/FWCore/Framework/interface/ComponentMaker.h @@ -57,7 +57,8 @@ namespace edm { class ComponentMaker : public ComponentMakerBase<T> { public: ComponentMaker() {} - //virtual ~ComponentMaker(); + ComponentMaker(const ComponentMaker&) = delete; // stop default + const ComponentMaker& operator=(const ComponentMaker&) = delete; // stop default typedef typename T::base_type base_type; // ---------- const member functions --------------------- @@ -70,10 +71,6 @@ namespace edm { // ---------- member functions --------------------------- private: - ComponentMaker(const ComponentMaker&) = delete; // stop default - - const ComponentMaker& operator=(const ComponentMaker&) = delete; // stop default - void setDescription(DataProxyProvider* iProv, const ComponentDescription& iDesc) const { iProv->setDescription(iDesc); } diff --git a/FWCore/Framework/interface/ModuleChanger.h b/FWCore/Framework/interface/ModuleChanger.h index f4b3368ba95ee..633856af6d903 100644 --- a/FWCore/Framework/interface/ModuleChanger.h +++ b/FWCore/Framework/interface/ModuleChanger.h @@ -36,6 +36,8 @@ namespace edm { class ModuleChanger { public: ModuleChanger(Schedule*, ProductRegistry const* iReg, eventsetup::ESRecordsToProxyIndices); + ModuleChanger(const ModuleChanger&) = delete; // stop default + const ModuleChanger& operator=(const ModuleChanger&) = delete; // stop default virtual ~ModuleChanger(); // ---------- const member functions --------------------- @@ -46,10 +48,6 @@ namespace edm { bool changeModule(const std::string& iLabel, const ParameterSet& iPSet); private: - ModuleChanger(const ModuleChanger&) = delete; // stop default - - const ModuleChanger& operator=(const ModuleChanger&) = delete; // stop default - // ---------- member data -------------------------------- edm::propagate_const<Schedule*> schedule_; ProductRegistry const* registry_; diff --git a/FWCore/Framework/interface/ProcessingController.h b/FWCore/Framework/interface/ProcessingController.h index d0ed2876fa36a..cd1cdbd399d73 100644 --- a/FWCore/Framework/interface/ProcessingController.h +++ b/FWCore/Framework/interface/ProcessingController.h @@ -43,7 +43,8 @@ namespace edm { }; ProcessingController(ForwardState forwardState, ReverseState reverseState, bool iCanRandomAccess); - //virtual ~ProcessingController(); + ProcessingController(const ProcessingController&) = delete; // stop default + const ProcessingController& operator=(const ProcessingController&) = delete; // stop default // ---------- const member functions --------------------- @@ -86,10 +87,6 @@ namespace edm { void setLastOperationSucceeded(bool value); private: - ProcessingController(const ProcessingController&) = delete; // stop default - - const ProcessingController& operator=(const ProcessingController&) = delete; // stop default - // ---------- member data -------------------------------- ForwardState forwardState_; ReverseState reverseState_; diff --git a/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h b/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h index 93d62865ef563..72c4ccdc0a1bf 100644 --- a/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h +++ b/FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h @@ -60,6 +60,8 @@ namespace edm { typename T::GlobalCache const* dummy = nullptr; m_global = impl::makeGlobal<T>(iPSet, dummy); } + EDAnalyzerAdaptor(const EDAnalyzerAdaptor&) = delete; // stop default + const EDAnalyzerAdaptor& operator=(const EDAnalyzerAdaptor&) = delete; // stop default ~EDAnalyzerAdaptor() override {} static void fillDescriptions(ConfigurationDescriptions& descriptions) { T::fillDescriptions(descriptions); } @@ -211,10 +213,6 @@ namespace edm { } } - EDAnalyzerAdaptor(const EDAnalyzerAdaptor&) = delete; // stop default - - const EDAnalyzerAdaptor& operator=(const EDAnalyzerAdaptor&) = delete; // stop default - // ---------- member data -------------------------------- typename impl::choose_unique_ptr<typename T::GlobalCache>::type m_global; typename impl::choose_shared_vec<typename T::RunCache const>::type m_runs; diff --git a/FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h b/FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h index f5ac6157da996..7f9b08bb07bcf 100644 --- a/FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h +++ b/FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h @@ -68,6 +68,8 @@ namespace edm { friend class edm::maker::ModuleHolderT; EDAnalyzerAdaptorBase(); + EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&) = delete; // stop default + const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&) = delete; // stop default virtual ~EDAnalyzerAdaptorBase(); // ---------- const member functions --------------------- @@ -119,10 +121,6 @@ namespace edm { std::vector<ConsumesInfo> consumesInfo() const; private: - EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&) = delete; // stop default - - const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&) = delete; // stop default - bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*); void doPreallocate(PreallocationConfiguration const&); virtual void preallocLumis(unsigned int) {} diff --git a/FWCore/Framework/interface/stream/EDAnalyzerBase.h b/FWCore/Framework/interface/stream/EDAnalyzerBase.h index 5d92375f8a9f8..890568b052f15 100644 --- a/FWCore/Framework/interface/stream/EDAnalyzerBase.h +++ b/FWCore/Framework/interface/stream/EDAnalyzerBase.h @@ -40,6 +40,8 @@ namespace edm { typedef EDAnalyzerAdaptorBase ModuleType; EDAnalyzerBase(); + EDAnalyzerBase(const EDAnalyzerBase&) = delete; // stop default + const EDAnalyzerBase& operator=(const EDAnalyzerBase&) = delete; // stop default ~EDAnalyzerBase() override; static void fillDescriptions(ConfigurationDescriptions& descriptions); @@ -52,10 +54,6 @@ namespace edm { void callWhenNewProductsRegistered(std::function<void(BranchDescription const&)> const& func); private: - EDAnalyzerBase(const EDAnalyzerBase&) = delete; // stop default - - const EDAnalyzerBase& operator=(const EDAnalyzerBase&) = delete; // stop default - void registerProductsAndCallbacks(EDAnalyzerBase const*, ProductRegistry* reg); virtual void beginStream(StreamID) {} diff --git a/FWCore/Framework/interface/stream/EDFilterAdaptorBase.h b/FWCore/Framework/interface/stream/EDFilterAdaptorBase.h index e626b83949068..200234d1f9550 100644 --- a/FWCore/Framework/interface/stream/EDFilterAdaptorBase.h +++ b/FWCore/Framework/interface/stream/EDFilterAdaptorBase.h @@ -53,6 +53,8 @@ namespace edm { friend class edm::WorkerT; EDFilterAdaptorBase(); + EDFilterAdaptorBase(const EDFilterAdaptorBase&) = delete; // stop default + const EDFilterAdaptorBase& operator=(const EDFilterAdaptorBase&) = delete; // stop default // ---------- const member functions --------------------- @@ -66,10 +68,6 @@ namespace edm { using ProducingModuleAdaptorBase<EDFilterBase>::commit; private: - EDFilterAdaptorBase(const EDFilterAdaptorBase&) = delete; // stop default - - const EDFilterAdaptorBase& operator=(const EDFilterAdaptorBase&) = delete; // stop default - bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*); void doAcquire(EventTransitionInfo const&, diff --git a/FWCore/Framework/interface/stream/EDFilterBase.h b/FWCore/Framework/interface/stream/EDFilterBase.h index 94f4f61f74dfb..325676c83ef3e 100644 --- a/FWCore/Framework/interface/stream/EDFilterBase.h +++ b/FWCore/Framework/interface/stream/EDFilterBase.h @@ -49,6 +49,8 @@ namespace edm { typedef EDFilterAdaptorBase ModuleType; EDFilterBase(); + EDFilterBase(const EDFilterBase&) = delete; // stop default + const EDFilterBase& operator=(const EDFilterBase&) = delete; // stop default ~EDFilterBase() override; static void fillDescriptions(ConfigurationDescriptions& descriptions); @@ -59,10 +61,6 @@ namespace edm { ModuleDescription const& moduleDescription() const { return *moduleDescriptionPtr_; } private: - EDFilterBase(const EDFilterBase&) = delete; // stop default - - const EDFilterBase& operator=(const EDFilterBase&) = delete; // stop default - virtual void beginStream(StreamID) {} virtual void beginRun(edm::Run const&, edm::EventSetup const&) {} virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {} diff --git a/FWCore/Framework/interface/stream/EDProducerAdaptorBase.h b/FWCore/Framework/interface/stream/EDProducerAdaptorBase.h index d6ed39853ad29..23d8b59c756be 100644 --- a/FWCore/Framework/interface/stream/EDProducerAdaptorBase.h +++ b/FWCore/Framework/interface/stream/EDProducerAdaptorBase.h @@ -53,6 +53,8 @@ namespace edm { friend class edm::WorkerT; EDProducerAdaptorBase(); + EDProducerAdaptorBase(const EDProducerAdaptorBase&) = delete; // stop default + const EDProducerAdaptorBase& operator=(const EDProducerAdaptorBase&) = delete; // stop default // ---------- const member functions --------------------- @@ -66,10 +68,6 @@ namespace edm { using ProducingModuleAdaptorBase<EDProducerBase>::commit; private: - EDProducerAdaptorBase(const EDProducerAdaptorBase&) = delete; // stop default - - const EDProducerAdaptorBase& operator=(const EDProducerAdaptorBase&) = delete; // stop default - bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*); void doAcquire(EventTransitionInfo const&, diff --git a/FWCore/Framework/interface/stream/EDProducerBase.h b/FWCore/Framework/interface/stream/EDProducerBase.h index 8ddf6d0cb121d..cfea5f2b79f6d 100644 --- a/FWCore/Framework/interface/stream/EDProducerBase.h +++ b/FWCore/Framework/interface/stream/EDProducerBase.h @@ -50,6 +50,8 @@ namespace edm { typedef EDProducerAdaptorBase ModuleType; EDProducerBase(); + EDProducerBase(const EDProducerBase&) = delete; // stop default + const EDProducerBase& operator=(const EDProducerBase&) = delete; // stop default ~EDProducerBase() override; static void fillDescriptions(ConfigurationDescriptions& descriptions); @@ -60,10 +62,6 @@ namespace edm { ModuleDescription const& moduleDescription() const { return *moduleDescriptionPtr_; } private: - EDProducerBase(const EDProducerBase&) = delete; // stop default - - const EDProducerBase& operator=(const EDProducerBase&) = delete; // stop default - virtual void beginStream(StreamID) {} virtual void beginRun(edm::Run const&, edm::EventSetup const&) {} virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {} diff --git a/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h b/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h index c8cb2af13bd27..0ac1b73dab3ca 100644 --- a/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h +++ b/FWCore/Framework/interface/stream/ProducingModuleAdaptor.h @@ -48,6 +48,8 @@ namespace edm { typename T::GlobalCache const* dummy = nullptr; m_global = impl::makeGlobal<T>(iPSet, dummy); } + ProducingModuleAdaptor(const ProducingModuleAdaptor&) = delete; // stop default + const ProducingModuleAdaptor& operator=(const ProducingModuleAdaptor&) = delete; // stop default ~ProducingModuleAdaptor() override {} static void fillDescriptions(ConfigurationDescriptions& descriptions) { T::fillDescriptions(descriptions); } @@ -249,10 +251,6 @@ namespace edm { } } - ProducingModuleAdaptor(const ProducingModuleAdaptor&) = delete; // stop default - - const ProducingModuleAdaptor& operator=(const ProducingModuleAdaptor&) = delete; // stop default - // ---------- member data -------------------------------- typename impl::choose_unique_ptr<typename T::GlobalCache>::type m_global; typename impl::choose_shared_vec<typename T::RunCache const>::type m_runs; diff --git a/FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h b/FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h index bca7bee2433fb..3da643c0518b6 100644 --- a/FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h +++ b/FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h @@ -70,6 +70,8 @@ namespace edm { friend class edm::maker::ModuleHolderT; ProducingModuleAdaptorBase(); + ProducingModuleAdaptorBase(const ProducingModuleAdaptorBase&) = delete; // stop default + const ProducingModuleAdaptorBase& operator=(const ProducingModuleAdaptorBase&) = delete; // stop default virtual ~ProducingModuleAdaptorBase(); // ---------- const member functions --------------------- @@ -142,10 +144,6 @@ namespace edm { const ProducerBase* producer() { return m_streamModules[0]; } private: - ProducingModuleAdaptorBase(const ProducingModuleAdaptorBase&) = delete; // stop default - - const ProducingModuleAdaptorBase& operator=(const ProducingModuleAdaptorBase&) = delete; // stop default - void doPreallocate(PreallocationConfiguration const&); virtual void preallocLumis(unsigned int) {} virtual void setupStreamModules() = 0; diff --git a/FWCore/Framework/src/SharedResourcesRegistry.h b/FWCore/Framework/src/SharedResourcesRegistry.h index cd2c24c7618b6..79d3222055472 100644 --- a/FWCore/Framework/src/SharedResourcesRegistry.h +++ b/FWCore/Framework/src/SharedResourcesRegistry.h @@ -41,6 +41,9 @@ namespace edm { //needed for testing friend class ::testSharedResourcesRegistry; + SharedResourcesRegistry(const SharedResourcesRegistry&) = delete; // stop default + const SharedResourcesRegistry& operator=(const SharedResourcesRegistry&) = delete; // stop default + // ---------- const member functions --------------------- SharedResourcesAcquirer createAcquirer(std::vector<std::string> const&) const; @@ -67,10 +70,6 @@ namespace edm { SharedResourcesRegistry(); ~SharedResourcesRegistry() = default; - SharedResourcesRegistry(const SharedResourcesRegistry&) = delete; // stop default - - const SharedResourcesRegistry& operator=(const SharedResourcesRegistry&) = delete; // stop default - // ---------- member data -------------------------------- std::map<std::string, std::pair<std::shared_ptr<SerialTaskQueue>, unsigned int>> resourceMap_; diff --git a/FWCore/Framework/src/UnscheduledConfigurator.h b/FWCore/Framework/src/UnscheduledConfigurator.h index bc75404270a10..e3a103c704e62 100644 --- a/FWCore/Framework/src/UnscheduledConfigurator.h +++ b/FWCore/Framework/src/UnscheduledConfigurator.h @@ -38,6 +38,9 @@ namespace edm { } } + UnscheduledConfigurator(const UnscheduledConfigurator&) = delete; // stop default + const UnscheduledConfigurator& operator=(const UnscheduledConfigurator&) = delete; // stop default + // ---------- const member functions --------------------- Worker* findWorker(std::string const& iLabel) const { auto itFound = m_labelToWorker.find(iLabel); @@ -50,10 +53,6 @@ namespace edm { UnscheduledAuxiliary const* auxiliary() const { return m_aux; } private: - UnscheduledConfigurator(const UnscheduledConfigurator&) = delete; // stop default - - const UnscheduledConfigurator& operator=(const UnscheduledConfigurator&) = delete; // stop default - // ---------- member data -------------------------------- std::unordered_map<std::string, Worker*> m_labelToWorker; UnscheduledAuxiliary const* m_aux; diff --git a/FWCore/MessageLogger/interface/MessageDrop.h b/FWCore/MessageLogger/interface/MessageDrop.h index a7a9655100ff8..489c2e766cfa6 100644 --- a/FWCore/MessageLogger/interface/MessageDrop.h +++ b/FWCore/MessageLogger/interface/MessageDrop.h @@ -85,11 +85,11 @@ namespace edm { struct MessageDrop { private: MessageDrop(); // change log 10: - // moved to cc file + + public: MessageDrop(MessageDrop const&) = delete; MessageDrop& operator=(MessageDrop const&) = delete; - public: ~MessageDrop(); // change log 10 static MessageDrop* instance(); std::string moduleContext(); diff --git a/FWCore/MessageLogger/interface/MessageLogger.h b/FWCore/MessageLogger/interface/MessageLogger.h index 0f221c5039ee6..fba76ea7568a1 100644 --- a/FWCore/MessageLogger/interface/MessageLogger.h +++ b/FWCore/MessageLogger/interface/MessageLogger.h @@ -146,6 +146,8 @@ namespace edm { false, (MessageDrop::warningAlwaysSuppressed || !MessageDrop::instance()->warningEnabled)) // Change log 21 {} + LogWarning(LogWarning const&) = delete; // Change log 9 + LogWarning& operator=(LogWarning const&) = delete; ~LogWarning(); // Change log 13 template <class T> @@ -182,8 +184,6 @@ namespace edm { private: MessageSender ap; - LogWarning(LogWarning const&) = delete; // Change log 9 - LogWarning& operator=(LogWarning const&) = delete; }; // LogWarning @@ -192,6 +192,8 @@ namespace edm { explicit LogError(std::string_view id) : ap(ELerror, id, false, !MessageDrop::instance()->errorEnabled) // Change log 24 {} + LogError(LogError const&) = delete; // Change log 9 + LogError& operator=(LogError const&) = delete; ~LogError(); // Change log 13 template <class T> @@ -228,14 +230,14 @@ namespace edm { private: MessageSender ap; - LogError(LogError const&) = delete; // Change log 9 - LogError& operator=(LogError const&) = delete; }; // LogError class LogSystem { public: explicit LogSystem(std::string_view id) : ap(ELsevere, id) {} + LogSystem(LogSystem const&) = delete; // Change log 9 + LogSystem& operator=(LogSystem const&) = delete; ~LogSystem(); // Change log 13 template <class T> @@ -267,8 +269,6 @@ namespace edm { private: MessageSender ap; - LogSystem(LogSystem const&) = delete; // Change log 9 - LogSystem& operator=(LogSystem const&) = delete; }; // LogSystem @@ -280,6 +280,9 @@ namespace edm { false, (MessageDrop::infoAlwaysSuppressed || !MessageDrop::instance()->infoEnabled)) // Change log 21 {} + LogInfo(LogInfo const&) = delete; // Change log 9 + LogInfo& operator=(LogInfo const&) = delete; + ~LogInfo(); // Change log 13 template <class T> @@ -316,8 +319,6 @@ namespace edm { private: MessageSender ap; - LogInfo(LogInfo const&) = delete; // Change log 9 - LogInfo& operator=(LogInfo const&) = delete; }; // LogInfo @@ -331,6 +332,8 @@ namespace edm { true, (MessageDrop::infoAlwaysSuppressed || !MessageDrop::instance()->infoEnabled)) // Change log 21 {} + LogVerbatim(LogVerbatim const&) = delete; // Change log 9 + LogVerbatim& operator=(LogVerbatim const&) = delete; ~LogVerbatim(); // Change log 13 template <class T> @@ -368,8 +371,6 @@ namespace edm { private: MessageSender ap; - LogVerbatim(LogVerbatim const&) = delete; // Change log 9 - LogVerbatim& operator=(LogVerbatim const&) = delete; }; // LogVerbatim @@ -383,6 +384,8 @@ namespace edm { true, (MessageDrop::warningAlwaysSuppressed || !MessageDrop::instance()->warningEnabled)) // Change log 21 {} + LogPrint(LogPrint const&) = delete; // Change log 9 + LogPrint& operator=(LogPrint const&) = delete; ~LogPrint(); // Change log 13 template <class T> @@ -420,8 +423,6 @@ namespace edm { private: MessageSender ap; - LogPrint(LogPrint const&) = delete; // Change log 9 - LogPrint& operator=(LogPrint const&) = delete; }; // LogPrint @@ -432,6 +433,8 @@ namespace edm { explicit LogProblem(std::string_view id) : ap(ELerror, id, true, !MessageDrop::instance()->errorEnabled) // Change log 24 {} + LogProblem(LogProblem const&) = delete; // Change log 9 + LogProblem& operator=(LogProblem const&) = delete; ~LogProblem(); // Change log 13 template <class T> @@ -468,8 +471,6 @@ namespace edm { private: MessageSender ap; - LogProblem(LogProblem const&) = delete; // Change log 9 - LogProblem& operator=(LogProblem const&) = delete; }; // LogProblem @@ -480,6 +481,8 @@ namespace edm { explicit LogImportant(std::string_view id) : ap(ELerror, id, true, !MessageDrop::instance()->errorEnabled) // Change log 24 {} + LogImportant(LogImportant const&) = delete; // Change log 9 + LogImportant& operator=(LogImportant const&) = delete; ~LogImportant(); // Change log 13 template <class T> @@ -516,8 +519,6 @@ namespace edm { private: MessageSender ap; - LogImportant(LogImportant const&) = delete; // Change log 9 - LogImportant& operator=(LogImportant const&) = delete; }; // LogImportant @@ -528,6 +529,8 @@ namespace edm { explicit LogAbsolute(std::string_view id) : ap(ELsevere, id, true) // true for verbatim {} + LogAbsolute(LogAbsolute const&) = delete; // Change log 9 + LogAbsolute& operator=(LogAbsolute const&) = delete; ~LogAbsolute(); // Change log 13 template <class T> @@ -559,8 +562,6 @@ namespace edm { private: MessageSender ap; - LogAbsolute(LogAbsolute const&) = delete; // Change log 9 - LogAbsolute& operator=(LogAbsolute const&) = delete; }; // LogAbsolute @@ -667,6 +668,8 @@ namespace edm { false, (MessageDrop::infoAlwaysSuppressed || !MessageDrop::instance()->warningEnabled)) // Change log 22 {} + LogWarningThatSuppressesLikeLogInfo(LogWarningThatSuppressesLikeLogInfo const&) = delete; // Change log 9 + LogWarningThatSuppressesLikeLogInfo& operator=(LogWarningThatSuppressesLikeLogInfo const&) = delete; ~LogWarningThatSuppressesLikeLogInfo(); template <class T> LogWarningThatSuppressesLikeLogInfo& operator<<(T const& t) { @@ -702,8 +705,6 @@ namespace edm { private: MessageSender ap; - LogWarningThatSuppressesLikeLogInfo(LogWarningThatSuppressesLikeLogInfo const&) = delete; // Change log 9 - LogWarningThatSuppressesLikeLogInfo& operator=(LogWarningThatSuppressesLikeLogInfo const&) = delete; }; // LogWarningThatSuppressesLikeLogInfo } // end namespace edmmltest diff --git a/FWCore/MessageLogger/interface/MessageLoggerQ.h b/FWCore/MessageLogger/interface/MessageLoggerQ.h index 80d1cc1cb0ae9..5d87b8aea48df 100644 --- a/FWCore/MessageLogger/interface/MessageLoggerQ.h +++ b/FWCore/MessageLogger/interface/MessageLoggerQ.h @@ -22,6 +22,9 @@ namespace edm { class MessageLoggerQ { public: + MessageLoggerQ(MessageLoggerQ const&) = delete; + void operator=(MessageLoggerQ const&) = delete; + // --- enumerate types of messages that can be enqueued: enum OpCode // abbrev's used hereinafter { END_THREAD // END @@ -79,10 +82,6 @@ namespace edm { static void simpleCommand(OpCode opcode, void* operand); static void handshakedCommand(OpCode opcode, void* operand, std::string const& commandMnemonic); - // --- no copying: - MessageLoggerQ(MessageLoggerQ const&) = delete; - void operator=(MessageLoggerQ const&) = delete; - // --- data: CMS_THREAD_SAFE static std::shared_ptr<edm::service::AbstractMLscribe> mlscribe_ptr; CMS_THREAD_SAFE static edm::ELseverityLevel threshold; diff --git a/FWCore/ParameterSet/interface/ParameterSetDescriptionFiller.h b/FWCore/ParameterSet/interface/ParameterSetDescriptionFiller.h index 199de1857833f..980be433769c6 100644 --- a/FWCore/ParameterSet/interface/ParameterSetDescriptionFiller.h +++ b/FWCore/ParameterSet/interface/ParameterSetDescriptionFiller.h @@ -33,6 +33,8 @@ namespace edm { class ParameterSetDescriptionFiller : public ParameterSetDescriptionFillerBase { public: ParameterSetDescriptionFiller() {} + ParameterSetDescriptionFiller(const ParameterSetDescriptionFiller&) = delete; // stop default + const ParameterSetDescriptionFiller& operator=(const ParameterSetDescriptionFiller&) = delete; // stop default void fill(ConfigurationDescriptions& descriptions) const override { T::fillDescriptions(descriptions); @@ -45,10 +47,6 @@ namespace edm { const T* type = nullptr; return ParameterSetDescriptionFillerBase::extendedBaseType(type); } - - private: - ParameterSetDescriptionFiller(const ParameterSetDescriptionFiller&) = delete; // stop default - const ParameterSetDescriptionFiller& operator=(const ParameterSetDescriptionFiller&) = delete; // stop default }; // We need a special version of this class for Services because there is @@ -149,6 +147,8 @@ namespace edm { class DescriptionFillerForESSources : public ParameterSetDescriptionFillerBase { public: DescriptionFillerForESSources() {} + DescriptionFillerForESSources(const DescriptionFillerForESSources&) = delete; // stop default + const DescriptionFillerForESSources& operator=(const DescriptionFillerForESSources&) = delete; // stop default // If T has a fillDescriptions function then just call that, otherwise // put in an "unknown description" as a default. @@ -169,16 +169,14 @@ namespace edm { const std::string& baseType() const override { return kBaseForESSource; } const std::string& extendedBaseType() const override { return kEmpty; } - - private: - DescriptionFillerForESSources(const DescriptionFillerForESSources&) = delete; // stop default - const DescriptionFillerForESSources& operator=(const DescriptionFillerForESSources&) = delete; // stop default }; template <typename T> class DescriptionFillerForESProducers : public ParameterSetDescriptionFillerBase { public: DescriptionFillerForESProducers() {} + DescriptionFillerForESProducers(const DescriptionFillerForESProducers&) = delete; // stop default + const DescriptionFillerForESProducers& operator=(const DescriptionFillerForESProducers&) = delete; // stop default // If T has a fillDescriptions function then just call that, otherwise // put in an "unknown description" as a default. @@ -199,10 +197,6 @@ namespace edm { const std::string& baseType() const override { return kBaseForESProducer; } const std::string& extendedBaseType() const override { return kEmpty; } - - private: - DescriptionFillerForESProducers(const DescriptionFillerForESProducers&) = delete; // stop default - const DescriptionFillerForESProducers& operator=(const DescriptionFillerForESProducers&) = delete; // stop default }; } // namespace edm #endif diff --git a/FWCore/ParameterSet/interface/ParameterSetDescriptionFillerBase.h b/FWCore/ParameterSet/interface/ParameterSetDescriptionFillerBase.h index 34fa9315214ed..d518d4e382ff0 100644 --- a/FWCore/ParameterSet/interface/ParameterSetDescriptionFillerBase.h +++ b/FWCore/ParameterSet/interface/ParameterSetDescriptionFillerBase.h @@ -64,6 +64,9 @@ namespace edm { class ParameterSetDescriptionFillerBase { public: ParameterSetDescriptionFillerBase() {} + ParameterSetDescriptionFillerBase(const ParameterSetDescriptionFillerBase&) = delete; // stop default + const ParameterSetDescriptionFillerBase& operator=(const ParameterSetDescriptionFillerBase&) = + delete; // stop default virtual ~ParameterSetDescriptionFillerBase(); // ---------- const member functions --------------------- @@ -136,11 +139,6 @@ namespace edm { static const std::string& extendedBaseType(void const*) { return kEmpty; } private: - ParameterSetDescriptionFillerBase(const ParameterSetDescriptionFillerBase&) = delete; // stop default - - const ParameterSetDescriptionFillerBase& operator=(const ParameterSetDescriptionFillerBase&) = - delete; // stop default - // ---------- member data -------------------------------- }; diff --git a/FWCore/PluginManager/interface/PluginFactory.h b/FWCore/PluginManager/interface/PluginFactory.h index cb98ed04425ad..95f8b90dc29ba 100644 --- a/FWCore/PluginManager/interface/PluginFactory.h +++ b/FWCore/PluginManager/interface/PluginFactory.h @@ -42,6 +42,9 @@ namespace edmplugin { using TemplateArgType = R*(Args...); using CreatedType = R; + PluginFactory(const PluginFactory&) = delete; // stop default + const PluginFactory& operator=(const PluginFactory&) = delete; // stop default + struct PMakerBase { virtual std::unique_ptr<R> create(Args...) const = 0; virtual ~PMakerBase() {} @@ -79,9 +82,6 @@ namespace edmplugin { private: PluginFactory() { finishedConstruction(); } - PluginFactory(const PluginFactory&) = delete; // stop default - - const PluginFactory& operator=(const PluginFactory&) = delete; // stop default }; } // namespace edmplugin #define FWCORE_CONCATENATE_HIDDEN(a, b) a##b diff --git a/FWCore/PluginManager/interface/PluginFactoryBase.h b/FWCore/PluginManager/interface/PluginFactoryBase.h index c123f7335ac8f..2542e7d20a91f 100644 --- a/FWCore/PluginManager/interface/PluginFactoryBase.h +++ b/FWCore/PluginManager/interface/PluginFactoryBase.h @@ -37,6 +37,8 @@ namespace edmplugin { class PluginFactoryBase { public: PluginFactoryBase() {} + PluginFactoryBase(const PluginFactoryBase&) = delete; // stop default + const PluginFactoryBase& operator=(const PluginFactoryBase&) = delete; // stop default virtual ~PluginFactoryBase(); struct PluginMakerInfo { @@ -102,10 +104,6 @@ namespace edmplugin { void registerPMaker(void* iPMaker, const std::string& iName); private: - PluginFactoryBase(const PluginFactoryBase&) = delete; // stop default - - const PluginFactoryBase& operator=(const PluginFactoryBase&) = delete; // stop default - void checkProperLoadable(const std::string& iName, const std::string& iLoadedFrom) const; // ---------- member data -------------------------------- Plugins m_plugins; diff --git a/FWCore/PluginManager/interface/PluginManager.h b/FWCore/PluginManager/interface/PluginManager.h index 44ae030f0be2e..e44731024395e 100644 --- a/FWCore/PluginManager/interface/PluginManager.h +++ b/FWCore/PluginManager/interface/PluginManager.h @@ -67,6 +67,8 @@ namespace edmplugin { bool m_mustHaveCache = true; }; + PluginManager(const PluginManager&) = delete; // stop default + const PluginManager& operator=(const PluginManager&) = delete; // stop default ~PluginManager(); // ---------- const member functions --------------------- @@ -101,9 +103,6 @@ namespace edmplugin { private: PluginManager(const Config&); - PluginManager(const PluginManager&) = delete; // stop default - - const PluginManager& operator=(const PluginManager&) = delete; // stop default void newFactory(const PluginFactoryBase*); static std::string& loadingLibraryNamed_(); diff --git a/FWCore/PluginManager/interface/SharedLibrary.h b/FWCore/PluginManager/interface/SharedLibrary.h index 66bd0f9f7f389..9a2cdd74cf3d2 100644 --- a/FWCore/PluginManager/interface/SharedLibrary.h +++ b/FWCore/PluginManager/interface/SharedLibrary.h @@ -29,6 +29,8 @@ namespace edmplugin { class SharedLibrary { public: SharedLibrary(const std::filesystem::path& iName); + SharedLibrary(const SharedLibrary&) = delete; // stop default + const SharedLibrary& operator=(const SharedLibrary&) = delete; // stop default ~SharedLibrary(); // ---------- const member functions --------------------- @@ -40,10 +42,6 @@ namespace edmplugin { // ---------- member functions --------------------------- private: - SharedLibrary(const SharedLibrary&) = delete; // stop default - - const SharedLibrary& operator=(const SharedLibrary&) = delete; // stop default - // ---------- member data -------------------------------- void* libraryHandle_; std::filesystem::path path_; diff --git a/FWCore/PythonFramework/interface/PythonEventProcessor.h b/FWCore/PythonFramework/interface/PythonEventProcessor.h index 78fb97da06058..56a22fb3376eb 100644 --- a/FWCore/PythonFramework/interface/PythonEventProcessor.h +++ b/FWCore/PythonFramework/interface/PythonEventProcessor.h @@ -30,6 +30,8 @@ class PythonProcessDesc; class PythonEventProcessor { public: PythonEventProcessor(PyBind11ProcessDesc const&); + PythonEventProcessor(const PythonEventProcessor&) = delete; // stop default + const PythonEventProcessor& operator=(const PythonEventProcessor&) = delete; // stop default ~PythonEventProcessor(); // ---------- const member functions --------------------- /// Return the number of events this EventProcessor has tried to process @@ -51,10 +53,6 @@ class PythonEventProcessor { void run(); private: - PythonEventProcessor(const PythonEventProcessor&) = delete; // stop default - - const PythonEventProcessor& operator=(const PythonEventProcessor&) = delete; // stop default - // ---------- member data -------------------------------- int forcePluginSetupFirst_; edm::EventProcessor processor_; diff --git a/FWCore/ServiceRegistry/interface/ServiceMakerBase.h b/FWCore/ServiceRegistry/interface/ServiceMakerBase.h index 49c7e1ceeb248..c842c830904cb 100644 --- a/FWCore/ServiceRegistry/interface/ServiceMakerBase.h +++ b/FWCore/ServiceRegistry/interface/ServiceMakerBase.h @@ -37,6 +37,8 @@ namespace edm { class ServiceMakerBase { public: ServiceMakerBase(); + ServiceMakerBase(ServiceMakerBase const&) = delete; // stop default + ServiceMakerBase const& operator=(ServiceMakerBase const&) = delete; // stop default virtual ~ServiceMakerBase(); // ---------- const member functions --------------------- @@ -57,10 +59,6 @@ namespace edm { bool testSaveConfiguration(void const*) const { return false; } private: - ServiceMakerBase(ServiceMakerBase const&) = delete; // stop default - - ServiceMakerBase const& operator=(ServiceMakerBase const&) = delete; // stop default - // ---------- member data -------------------------------- }; } // namespace serviceregistry diff --git a/FWCore/ServiceRegistry/interface/ServiceRegistry.h b/FWCore/ServiceRegistry/interface/ServiceRegistry.h index 6ae7ee09d5a8d..819d6e2ce0a80 100644 --- a/FWCore/ServiceRegistry/interface/ServiceRegistry.h +++ b/FWCore/ServiceRegistry/interface/ServiceRegistry.h @@ -40,12 +40,12 @@ namespace edm { class Operate { public: Operate(ServiceToken const& iToken) : oldToken_(ServiceRegistry::instance().setContext(iToken)) {} + Operate(Operate const&) = delete; //stop default + Operate const& operator=(Operate const&) = delete; //stop default ~Operate() { ServiceRegistry::instance().unsetContext(oldToken_); } //override operator new to stop use on heap? private: - Operate(Operate const&) = delete; //stop default - Operate const& operator=(Operate const&) = delete; //stop default ServiceToken oldToken_; }; @@ -53,6 +53,8 @@ namespace edm { friend int main(int argc, char* argv[]); friend class Operate; + ServiceRegistry(ServiceRegistry const&) = delete; // stop default + ServiceRegistry const& operator=(ServiceRegistry const&) = delete; // stop default virtual ~ServiceRegistry(); // ---------- const member functions --------------------- @@ -135,9 +137,6 @@ namespace edm { void unsetContext(ServiceToken const& iOldToken); ServiceRegistry(); - ServiceRegistry(ServiceRegistry const&) = delete; // stop default - - ServiceRegistry const& operator=(ServiceRegistry const&) = delete; // stop default // ---------- member data -------------------------------- std::shared_ptr<serviceregistry::ServicesManager> manager_; diff --git a/FWCore/ServiceRegistry/interface/ServiceWrapper.h b/FWCore/ServiceRegistry/interface/ServiceWrapper.h index 09f3489711046..e7c3d50f2b701 100644 --- a/FWCore/ServiceRegistry/interface/ServiceWrapper.h +++ b/FWCore/ServiceRegistry/interface/ServiceWrapper.h @@ -36,7 +36,8 @@ namespace edm { class ServiceWrapper : public ServiceWrapperBase { public: ServiceWrapper(std::unique_ptr<T> iService) : service_(std::move(iService)) {} - //virtual ~ServiceWrapper(); + ServiceWrapper(const ServiceWrapper&) = delete; // stop default + const ServiceWrapper& operator=(const ServiceWrapper&) = delete; // stop default // ---------- const member functions --------------------- T const& get() const { return *service_; } @@ -47,10 +48,6 @@ namespace edm { T& get() { return *service_; } private: - ServiceWrapper(const ServiceWrapper&) = delete; // stop default - - const ServiceWrapper& operator=(const ServiceWrapper&) = delete; // stop default - // ---------- member data -------------------------------- edm::propagate_const<std::unique_ptr<T>> service_; }; diff --git a/FWCore/ServiceRegistry/interface/ServiceWrapperBase.h b/FWCore/ServiceRegistry/interface/ServiceWrapperBase.h index 17599b863dc2c..468ac911e14fd 100644 --- a/FWCore/ServiceRegistry/interface/ServiceWrapperBase.h +++ b/FWCore/ServiceRegistry/interface/ServiceWrapperBase.h @@ -29,6 +29,8 @@ namespace edm { class ServiceWrapperBase { public: ServiceWrapperBase(); + ServiceWrapperBase(const ServiceWrapperBase&) = delete; // stop default + const ServiceWrapperBase& operator=(const ServiceWrapperBase&) = delete; // stop default virtual ~ServiceWrapperBase(); // ---------- const member functions --------------------- @@ -38,10 +40,6 @@ namespace edm { // ---------- member functions --------------------------- private: - ServiceWrapperBase(const ServiceWrapperBase&) = delete; // stop default - - const ServiceWrapperBase& operator=(const ServiceWrapperBase&) = delete; // stop default - // ---------- member data -------------------------------- }; } // namespace serviceregistry diff --git a/FWCore/ServiceRegistry/interface/ServicesManager.h b/FWCore/ServiceRegistry/interface/ServicesManager.h index f8050626324b2..6a42eed76db7c 100644 --- a/FWCore/ServiceRegistry/interface/ServicesManager.h +++ b/FWCore/ServiceRegistry/interface/ServicesManager.h @@ -67,6 +67,8 @@ namespace edm { std::vector<ParameterSet>& iConfiguration, bool associate = true); + ServicesManager(ServicesManager const&) = delete; // stop default + ServicesManager const& operator=(ServicesManager const&) = delete; // stop default ~ServicesManager(); // ---------- const member functions --------------------- @@ -144,10 +146,6 @@ namespace edm { void copySlotsFrom(ActivityRegistry&); private: - ServicesManager(ServicesManager const&) = delete; // stop default - - ServicesManager const& operator=(ServicesManager const&) = delete; // stop default - void fillListOfMakers(std::vector<ParameterSet>&); void createServices(); void createServiceFor(MakerHolder const&); diff --git a/FWCore/Utilities/interface/ProcessBlockIndex.h b/FWCore/Utilities/interface/ProcessBlockIndex.h index 1da23104a2cb9..181c24c585f09 100644 --- a/FWCore/Utilities/interface/ProcessBlockIndex.h +++ b/FWCore/Utilities/interface/ProcessBlockIndex.h @@ -20,6 +20,7 @@ namespace edm { class ProcessBlockIndex { public: + ProcessBlockIndex() = delete; ~ProcessBlockIndex() = default; ProcessBlockIndex(const ProcessBlockIndex&) = default; ProcessBlockIndex& operator=(const ProcessBlockIndex&) = default; @@ -36,8 +37,6 @@ namespace edm { friend class ProcessBlockPrincipal; explicit ProcessBlockIndex(unsigned int iIndex) : value_(iIndex) {} - ProcessBlockIndex() = delete; - unsigned int value_; static const unsigned int invalidValue_; diff --git a/FWCore/Utilities/interface/RandomNumberGenerator.h b/FWCore/Utilities/interface/RandomNumberGenerator.h index 5e385680a87da..ddd377b8612ac 100644 --- a/FWCore/Utilities/interface/RandomNumberGenerator.h +++ b/FWCore/Utilities/interface/RandomNumberGenerator.h @@ -147,6 +147,8 @@ namespace edm { class RandomNumberGenerator { public: RandomNumberGenerator() {} + RandomNumberGenerator(RandomNumberGenerator const&) = delete; + RandomNumberGenerator const& operator=(RandomNumberGenerator const&) = delete; virtual ~RandomNumberGenerator(); /// Use the next 2 functions to get the random number engine. @@ -203,10 +205,6 @@ namespace edm { /// For debugging purposes only. virtual void print(std::ostream& os) const = 0; - - private: - RandomNumberGenerator(RandomNumberGenerator const&) = delete; - RandomNumberGenerator const& operator=(RandomNumberGenerator const&) = delete; }; } // namespace edm #endif diff --git a/FWCore/Utilities/interface/TimingServiceBase.h b/FWCore/Utilities/interface/TimingServiceBase.h index 2f50f59f869af..c510163c46d57 100644 --- a/FWCore/Utilities/interface/TimingServiceBase.h +++ b/FWCore/Utilities/interface/TimingServiceBase.h @@ -28,6 +28,8 @@ namespace edm { class TimingServiceBase { public: TimingServiceBase(); + TimingServiceBase(const TimingServiceBase&) = delete; // stop default + const TimingServiceBase& operator=(const TimingServiceBase&) = delete; // stop default virtual ~TimingServiceBase(); // ---------- member functions --------------------------- @@ -45,10 +47,6 @@ namespace edm { static double jobStartTime() { return s_jobStartTime; } private: - TimingServiceBase(const TimingServiceBase&) = delete; // stop default - - const TimingServiceBase& operator=(const TimingServiceBase&) = delete; // stop default - static double s_jobStartTime; }; } // namespace edm From 51563cd380ba2cfdd9c5696a90652094f627c695 Mon Sep 17 00:00:00 2001 From: Kenneth Long <kdlong@hep.wisc.edu> Date: Tue, 13 Oct 2020 21:37:25 +0200 Subject: [PATCH 542/778] Add lhe and weights plots to main nano dqm Update generator configs --- ...eCP5_13TeV_MLM_5f_max4j_LHE_pythia8_cff.py | 3 ++ ..._13TeV_powhegEmissionVeto2p_pythia8_cff.py | 3 ++ .../python/relval_generator.py | 1 + PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 31 ++++++++++++++++ PhysicsTools/NanoAOD/python/nanogenDQM_cff.py | 35 +++---------------- 5 files changed, 42 insertions(+), 31 deletions(-) diff --git a/Configuration/Generator/python/Hadronizer_TuneCP5_13TeV_MLM_5f_max4j_LHE_pythia8_cff.py b/Configuration/Generator/python/Hadronizer_TuneCP5_13TeV_MLM_5f_max4j_LHE_pythia8_cff.py index 3c71590a6d19d..c14b48312c6e1 100644 --- a/Configuration/Generator/python/Hadronizer_TuneCP5_13TeV_MLM_5f_max4j_LHE_pythia8_cff.py +++ b/Configuration/Generator/python/Hadronizer_TuneCP5_13TeV_MLM_5f_max4j_LHE_pythia8_cff.py @@ -3,6 +3,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * +from Configuration.Generator.PSweightsPythia.PythiaPSweightsSettings_cfi import * generator = cms.EDFilter("Pythia8ConcurrentHadronizerFilter", maxEventsToPrint = cms.untracked.int32(1), @@ -13,6 +14,7 @@ PythiaParameters = cms.PSet( pythia8CommonSettingsBlock, pythia8CP5SettingsBlock, + pythia8PSweightsSettingsBlock, JetMatchingParameters = cms.vstring( 'JetMatching:setMad = off', 'JetMatching:scheme = 1', @@ -28,6 +30,7 @@ ), parameterSets = cms.vstring('pythia8CommonSettings', 'pythia8CP5Settings', + 'pythia8PSweightsSettings', 'JetMatchingParameters' ) diff --git a/Configuration/Generator/python/Hadronizer_TuneCP5_13TeV_powhegEmissionVeto2p_pythia8_cff.py b/Configuration/Generator/python/Hadronizer_TuneCP5_13TeV_powhegEmissionVeto2p_pythia8_cff.py index 36492389bbf99..020c25e857e2a 100644 --- a/Configuration/Generator/python/Hadronizer_TuneCP5_13TeV_powhegEmissionVeto2p_pythia8_cff.py +++ b/Configuration/Generator/python/Hadronizer_TuneCP5_13TeV_powhegEmissionVeto2p_pythia8_cff.py @@ -2,6 +2,7 @@ from Configuration.Generator.Pythia8CommonSettings_cfi import * from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import * from Configuration.Generator.Pythia8PowhegEmissionVetoSettings_cfi import * +from Configuration.Generator.PSweightsPythia.PythiaPSweightsSettings_cfi import * generator = cms.EDFilter("Pythia8ConcurrentHadronizerFilter", maxEventsToPrint = cms.untracked.int32(1), @@ -12,6 +13,7 @@ PythiaParameters = cms.PSet( pythia8CommonSettingsBlock, pythia8CP5SettingsBlock, + pythia8PSweightsSettingsBlock, pythia8PowhegEmissionVetoSettingsBlock, processParameters = cms.vstring( 'POWHEG:nFinal = 2', ## Number of final state particles @@ -21,6 +23,7 @@ ), parameterSets = cms.vstring('pythia8CommonSettings', 'pythia8CP5Settings', + 'pythia8PSweightsSettings', 'pythia8PowhegEmissionVetoSettings', 'processParameters' ) diff --git a/Configuration/PyReleaseValidation/python/relval_generator.py b/Configuration/PyReleaseValidation/python/relval_generator.py index d9b4681d7b083..27c92c690d119 100644 --- a/Configuration/PyReleaseValidation/python/relval_generator.py +++ b/Configuration/PyReleaseValidation/python/relval_generator.py @@ -42,3 +42,4 @@ # Miscellaneous workflows[546]=['',['DYToLL_M-50_13TeV_pythia8','NANOGENFromGen']] workflows[547]=['',['DYToll01234Jets_5f_LO_MLM_Madgraph_LHE_13TeV','Hadronizer_TuneCP5_13TeV_MLM_5f_max4j_LHE_pythia8','NANOGENFromGen']] +workflows[548]=['',['TTbar_Pow_LHE_13TeV','Hadronizer_TuneCP5_13TeV_powhegEmissionVeto2p_pythia8','NANOGENFromGen']] diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 33a6b8ea6633c..03e183c151efd 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -661,5 +661,36 @@ Plot1D('pt', 'pt', 40, 0, 400, 'pt'), ) ), + LHEPart = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 20, 0, 20, 'LHE particles'), + Plot1D('eta', 'eta', 20, -30000, 30000, 'eta'), + Plot1D('pdgId', 'pdgId', 20, -6000, 6000, 'PDG id'), + Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'), + Plot1D('pt', 'pt', 20, 0, 200, 'pt'), + ) + ), + LHEScaleWeight = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 20, 0, 20, 'LHE scale weights'), + Plot1D('', '', 100, 0, 2, 'all weights'), + ) + ), + LHEPdfWeight = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 1000, 0, 2000, 'LHE PDF weights'), + Plot1D('', '', 100, 0, 2, 'all weights'), + ) + ), + PSWeight = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 50, 0, 50, 'LHE PDF weights'), + Plot1D('', '', 100, 0, 2, 'all weights'), + ) + ), ) ) diff --git a/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py b/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py index ace11206e4426..b7f8b408df4c2 100644 --- a/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py +++ b/PhysicsTools/NanoAOD/python/nanogenDQM_cff.py @@ -13,37 +13,10 @@ GenMET = nanoDQM.vplots.GenMET, GenPart = nanoDQM.vplots.GenPart, GenVisTau = nanoDQM.vplots.GenVisTau, - LHEPart = cms.PSet( - sels = cms.PSet(), - plots = cms.VPSet( - Count1D('_size', 20, 0, 20, 'LHE particles'), - Plot1D('eta', 'eta', 20, -30000, 30000, 'eta'), - Plot1D('pdgId', 'pdgId', 20, -6000, 6000, 'PDG id'), - Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'), - Plot1D('pt', 'pt', 20, 0, 200, 'pt'), - ) - ), - LHEScaleWeight = cms.PSet( - sels = cms.PSet(), - plots = cms.VPSet( - Count1D('_size', 20, 0, 20, 'LHE scale weights'), - Plot1D('', '', 100, 0, 2, 'all weights'), - ) - ), - LHEPdfWeight = cms.PSet( - sels = cms.PSet(), - plots = cms.VPSet( - Count1D('_size', 1000, 0, 2000, 'LHE PDF weights'), - Plot1D('', '', 100, 0, 2, 'all weights'), - ) - ), - PSWeight = cms.PSet( - sels = cms.PSet(), - plots = cms.VPSet( - Count1D('_size', 50, 0, 50, 'LHE PDF weights'), - Plot1D('', '', 100, 0, 2, 'all weights'), - ) - ), + LHEPart = nanoDQM.vplots.LHEPart, + LHEScaleWeight = nanoDQM.vplots.LHEScaleWeight, + LHEPdfWeight = nanoDQM.vplots.LHEPdfWeight, + PSWeight = nanoDQM.vplots.PSWeight, ) ) From fa3e79a433b08c5d82f0b01102991dd62ccd9a6b Mon Sep 17 00:00:00 2001 From: Kenneth Long <kdlong@hep.wisc.edu> Date: Wed, 14 Oct 2020 00:23:06 +0200 Subject: [PATCH 543/778] Minimize changes to nanoDQM fix duplicates --- PhysicsTools/NanoAOD/python/nanoDQM_cfi.py | 56 ++++++++++------------ 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py index 03e183c151efd..85dc60079f0a0 100644 --- a/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py +++ b/PhysicsTools/NanoAOD/python/nanoDQM_cfi.py @@ -351,6 +351,31 @@ Plot1D('rawFactor', 'rawFactor', 20, -0.5, 0.5, '1 - Factor to get back to raw pT'), ) ), + LHEPart = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 20, 0, 20, 'LHE particles'), + Plot1D('eta', 'eta', 20, -30000, 30000, 'eta'), + Plot1D('pdgId', 'pdgId', 20, -6000, 6000, 'PDG id'), + Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'), + Plot1D('pt', 'pt', 20, 0, 200, 'pt'), + ) + ), + LHEPdfWeight = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 1000, 0, 2000, 'LHE PDF weights'), + Plot1D('', '', 100, 0, 2, 'all weights'), + ) + ), + LHEScaleWeight = cms.PSet( + sels = cms.PSet(), + plots = cms.VPSet( + Count1D('_size', 20, 0, 20, 'LHE scale weights'), + Plot1D('', '', 100, 0, 2, 'all weights'), + ) + ), + MET = cms.PSet( sels = cms.PSet(), plots = cms.VPSet( @@ -661,36 +686,5 @@ Plot1D('pt', 'pt', 40, 0, 400, 'pt'), ) ), - LHEPart = cms.PSet( - sels = cms.PSet(), - plots = cms.VPSet( - Count1D('_size', 20, 0, 20, 'LHE particles'), - Plot1D('eta', 'eta', 20, -30000, 30000, 'eta'), - Plot1D('pdgId', 'pdgId', 20, -6000, 6000, 'PDG id'), - Plot1D('phi', 'phi', 20, -3.14159, 3.14159, 'phi'), - Plot1D('pt', 'pt', 20, 0, 200, 'pt'), - ) - ), - LHEScaleWeight = cms.PSet( - sels = cms.PSet(), - plots = cms.VPSet( - Count1D('_size', 20, 0, 20, 'LHE scale weights'), - Plot1D('', '', 100, 0, 2, 'all weights'), - ) - ), - LHEPdfWeight = cms.PSet( - sels = cms.PSet(), - plots = cms.VPSet( - Count1D('_size', 1000, 0, 2000, 'LHE PDF weights'), - Plot1D('', '', 100, 0, 2, 'all weights'), - ) - ), - PSWeight = cms.PSet( - sels = cms.PSet(), - plots = cms.VPSet( - Count1D('_size', 50, 0, 50, 'LHE PDF weights'), - Plot1D('', '', 100, 0, 2, 'all weights'), - ) - ), ) ) From b77ed1d1732b0c4fc34a8041db9a1cb14ab77b96 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Tue, 13 Oct 2020 03:20:54 +0200 Subject: [PATCH 544/778] Migrate rest of {HBHEPhase1,HcalHit,HcalSimple}Reconstructor to EventSetup consumes --- .../interface/HcalPulseContainmentManager.h | 6 ++++- .../HcalAlgos/interface/HcalPulseShapes.h | 4 ++++ .../src/HcalPulseContainmentManager.cc | 13 ++++++---- .../HcalAlgos/src/HcalPulseShapes.cc | 13 +++++----- .../interface/HcalSimpleRecAlgo.h | 3 ++- .../interface/SimpleHBHEPhase1Algo.h | 4 +++- .../parseHBHEPhase1AlgoDescription.h | 8 +++---- .../HcalRecAlgos/src/HcalSimpleRecAlgo.cc | 14 ++++++----- .../HcalRecAlgos/src/SimpleHBHEPhase1Algo.cc | 20 +++++++++------- .../src/parseHBHEPhase1AlgoDescription.cc | 24 ++++++++++--------- .../src/HBHEPhase1Reconstructor.cc | 3 ++- .../src/HcalHitReconstructor.cc | 4 +++- .../src/HcalSimpleReconstructor.cc | 4 +++- 13 files changed, 71 insertions(+), 49 deletions(-) diff --git a/CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentManager.h b/CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentManager.h index 4f4640ac977e8..8d557a9beddfb 100644 --- a/CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentManager.h +++ b/CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentManager.h @@ -5,11 +5,14 @@ #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalTimeSlew.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "CondFormats/DataRecord/interface/HcalTimeSlewRecord.h" class HcalPulseContainmentManager { public: + // for callers not calling beginRun(EventSetup) HcalPulseContainmentManager(float max_fracerror); + // for callers calling beginRun(EventSetup) + HcalPulseContainmentManager(float max_fracerror, edm::ConsumesCollector iC); double correction(const HcalDetId& detId, int toAdd, float fixedphase_ns, double fc_ampl); const HcalPulseContainmentCorrection* get(const HcalDetId& detId, int toAdd, float fixedphase_ns); @@ -35,6 +38,7 @@ class HcalPulseContainmentManager { HcalPulseShapes shapes_; float fixedphase_ns_; float max_fracerror_; + const edm::ESGetToken<HcalTimeSlew, HcalTimeSlewRecord> delayToken_; const HcalTimeSlew* hcalTimeSlew_delay_; }; diff --git a/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h b/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h index 0efca1cb3ad6d..b8c45afaa5545 100644 --- a/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h +++ b/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h @@ -8,6 +8,7 @@ #include "DataFormats/HcalDetId/interface/HcalDetId.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "CalibFormats/HcalObjects/interface/HcalDbService.h" +#include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" /** \class HcalPulseShapes * @@ -21,7 +22,9 @@ namespace CLHEP { class HcalPulseShapes { public: typedef HcalPulseShape Shape; + // Default constructor is for callers that do not call beginRun(EventSetup) HcalPulseShapes(); + explicit HcalPulseShapes(edm::ConsumesCollector iC); ~HcalPulseShapes(); // only needed if you'll be getting shapes by DetId void beginRun(edm::EventSetup const& es); @@ -112,6 +115,7 @@ class HcalPulseShapes { Shape hpdShape_v2, hpdShapeMC_v2; Shape hpdShape_v3, hpdShapeMC_v3; Shape hpdBV30Shape_v2, hpdBV30ShapeMC_v2; + edm::ESGetToken<HcalDbService, HcalDbRecord> theDbServiceToken; const HcalDbService* theDbService; typedef std::map<int, const Shape*> ShapeMap; ShapeMap theShapes; diff --git a/CalibCalorimetry/HcalAlgos/src/HcalPulseContainmentManager.cc b/CalibCalorimetry/HcalAlgos/src/HcalPulseContainmentManager.cc index 480c27066458f..a3bb99bf29f92 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalPulseContainmentManager.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalPulseContainmentManager.cc @@ -1,7 +1,6 @@ #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentManager.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "CondFormats/DataRecord/interface/HcalTimeSlewRecord.h" #include <iostream> HcalPulseContainmentManager::HcalPulseContainmentManager(float max_fracerror) @@ -9,10 +8,14 @@ HcalPulseContainmentManager::HcalPulseContainmentManager(float max_fracerror) hcalTimeSlew_delay_ = nullptr; } +HcalPulseContainmentManager::HcalPulseContainmentManager(float max_fracerror, edm::ConsumesCollector iC) + : entries_(), + shapes_(iC), + max_fracerror_(max_fracerror), + delayToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "HBHE"))) {} + void HcalPulseContainmentManager::beginRun(edm::EventSetup const& es) { - edm::ESHandle<HcalTimeSlew> delay; - es.get<HcalTimeSlewRecord>().get("HBHE", delay); - hcalTimeSlew_delay_ = &*delay; + hcalTimeSlew_delay_ = &es.getData(delayToken_); shapes_.beginRun(es); } diff --git a/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc b/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc index 79c23c43a0198..eea5258177f16 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc @@ -1,10 +1,9 @@ #include "CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h" #include "FWCore/Utilities/interface/Exception.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "CLHEP/Random/RandFlat.h" -#include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" // #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" #include <cmath> @@ -138,13 +137,13 @@ Reco MC //theShapes[401] = new CaloCachedShapeIntegrator(&theZDCShape); } +HcalPulseShapes::HcalPulseShapes(edm::ConsumesCollector iC) : HcalPulseShapes() { + theDbServiceToken = iC.esConsumes<edm::Transition::BeginRun>(); +} + HcalPulseShapes::~HcalPulseShapes() {} -void HcalPulseShapes::beginRun(edm::EventSetup const& es) { - edm::ESHandle<HcalDbService> conditions; - es.get<HcalDbRecord>().get(conditions); - theDbService = conditions.product(); -} +void HcalPulseShapes::beginRun(edm::EventSetup const& es) { theDbService = &es.getData(theDbServiceToken); } void HcalPulseShapes::beginRun(const HcalDbService* conditions) { theDbService = conditions; } diff --git a/RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h b/RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h index 49525a47455ed..1c5b77926212a 100644 --- a/RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h +++ b/RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h @@ -34,7 +34,7 @@ class HcalSimpleRecAlgo { public: /** Full featured constructor for HB/HE and HO (HPD-based detectors) */ - HcalSimpleRecAlgo(bool correctForTimeslew, bool correctForContainment, float fixedPhaseNs); + HcalSimpleRecAlgo(bool correctForTimeslew, bool correctForContainment, float fixedPhaseNs, edm::ConsumesCollector iC); void beginRun(edm::EventSetup const& es); void endRun(); @@ -73,6 +73,7 @@ class HcalSimpleRecAlgo { bool correctForTimeslew_; bool correctForPulse_; float phaseNS_; + const edm::ESGetToken<HcalTimeSlew, HcalTimeSlewRecord> delayToken_; std::unique_ptr<HcalPulseContainmentManager> pulseCorr_; int runnum_; // data run numer bool setLeakCorrection_; diff --git a/RecoLocalCalo/HcalRecAlgos/interface/SimpleHBHEPhase1Algo.h b/RecoLocalCalo/HcalRecAlgos/interface/SimpleHBHEPhase1Algo.h index 20b0c8f057f8a..203b5dfb945dc 100644 --- a/RecoLocalCalo/HcalRecAlgos/interface/SimpleHBHEPhase1Algo.h +++ b/RecoLocalCalo/HcalRecAlgos/interface/SimpleHBHEPhase1Algo.h @@ -47,7 +47,8 @@ class SimpleHBHEPhase1Algo : public AbsHBHEPhase1Algo { bool applyLegacyHBMCorrection, std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2, std::unique_ptr<HcalDeterministicFit> detFit, - std::unique_ptr<MahiFit> mahi); + std::unique_ptr<MahiFit> mahi, + edm::ConsumesCollector iC); inline ~SimpleHBHEPhase1Algo() override {} @@ -69,6 +70,7 @@ class SimpleHBHEPhase1Algo : public AbsHBHEPhase1Algo { inline bool isCorrectingForPhaseContainment() const { return corrFPC_; } inline int getRunNumber() const { return runnum_; } + edm::ESGetToken<HcalTimeSlew, HcalTimeSlewRecord> delayToken_; const HcalTimeSlew* hcalTimeSlew_delay_; protected: diff --git a/RecoLocalCalo/HcalRecAlgos/interface/parseHBHEPhase1AlgoDescription.h b/RecoLocalCalo/HcalRecAlgos/interface/parseHBHEPhase1AlgoDescription.h index 852cb9399de50..7ba17813b5fd4 100644 --- a/RecoLocalCalo/HcalRecAlgos/interface/parseHBHEPhase1AlgoDescription.h +++ b/RecoLocalCalo/HcalRecAlgos/interface/parseHBHEPhase1AlgoDescription.h @@ -3,12 +3,9 @@ #include <memory> #include "RecoLocalCalo/HcalRecAlgos/interface/AbsHBHEPhase1Algo.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" -namespace edm { - class ParameterSet; -} - // // Factory function for creating objects of types // inheriting from AbsHBHEPhase1Algo out of parameter sets. @@ -16,7 +13,8 @@ namespace edm { // Update the implementation of this function if you need // to add a new algorithm to HBHEPhase1Reconstructor. // -std::unique_ptr<AbsHBHEPhase1Algo> parseHBHEPhase1AlgoDescription(const edm::ParameterSet& ps); +std::unique_ptr<AbsHBHEPhase1Algo> parseHBHEPhase1AlgoDescription(const edm::ParameterSet& ps, + edm::ConsumesCollector iC); // // Parameter descriptions for "parseHBHEPhase1AlgoDescription". diff --git a/RecoLocalCalo/HcalRecAlgos/src/HcalSimpleRecAlgo.cc b/RecoLocalCalo/HcalRecAlgos/src/HcalSimpleRecAlgo.cc index aaa56226510f5..aee1991e5ecd2 100644 --- a/RecoLocalCalo/HcalRecAlgos/src/HcalSimpleRecAlgo.cc +++ b/RecoLocalCalo/HcalRecAlgos/src/HcalSimpleRecAlgo.cc @@ -1,4 +1,5 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSimpleRecAlgo.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalTimeSlew.h" #include "RecoLocalCalo/HcalRecAlgos/src/HcalTDCReco.h" @@ -6,7 +7,6 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/HcalCorrectionFunctions.h" #include "DataFormats/METReco/interface/HcalCaloFlagLabels.h" #include "CondFormats/DataRecord/interface/HcalTimeSlewRecord.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" #include <algorithm> @@ -17,21 +17,23 @@ constexpr double MaximumFractionalError = 0.002; // 0.2% error allowed from this source -HcalSimpleRecAlgo::HcalSimpleRecAlgo(bool correctForTimeslew, bool correctForPulse, float phaseNS) +HcalSimpleRecAlgo::HcalSimpleRecAlgo(bool correctForTimeslew, + bool correctForPulse, + float phaseNS, + edm::ConsumesCollector iC) : correctForTimeslew_(correctForTimeslew), correctForPulse_(correctForPulse), phaseNS_(phaseNS), + delayToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "HBHE"))), runnum_(0), setLeakCorrection_(false), puCorrMethod_(0) { hcalTimeSlew_delay_ = nullptr; - pulseCorr_ = std::make_unique<HcalPulseContainmentManager>(MaximumFractionalError); + pulseCorr_ = std::make_unique<HcalPulseContainmentManager>(MaximumFractionalError, iC); } void HcalSimpleRecAlgo::beginRun(edm::EventSetup const& es) { - edm::ESHandle<HcalTimeSlew> delay; - es.get<HcalTimeSlewRecord>().get("HBHE", delay); - hcalTimeSlew_delay_ = &*delay; + hcalTimeSlew_delay_ = &es.getData(delayToken_); pulseCorr_->beginRun(es); } diff --git a/RecoLocalCalo/HcalRecAlgos/src/SimpleHBHEPhase1Algo.cc b/RecoLocalCalo/HcalRecAlgos/src/SimpleHBHEPhase1Algo.cc index f755a5b89864c..0f6bc9d34f343 100644 --- a/RecoLocalCalo/HcalRecAlgos/src/SimpleHBHEPhase1Algo.cc +++ b/RecoLocalCalo/HcalRecAlgos/src/SimpleHBHEPhase1Algo.cc @@ -5,17 +5,19 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/SimpleHBHEPhase1Algo.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalCorrectionFunctions.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Run.h" #include "DataFormats/HcalRecHit/interface/HBHERecHitAuxSetter.h" #include "DataFormats/METReco/interface/HcalPhase1FlagLabels.h" #include "CondFormats/DataRecord/interface/HcalTimeSlewRecord.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -// Maximum fractional error for calculating Method 0 -// pulse containment correction -constexpr float PulseContainmentFractionalError = 0.002f; +namespace { + // Maximum fractional error for calculating Method 0 + // pulse containment correction + constexpr float PulseContainmentFractionalError = 0.002f; +} // namespace SimpleHBHEPhase1Algo::SimpleHBHEPhase1Algo(const int firstSampleShift, const int samplesToAdd, @@ -25,8 +27,10 @@ SimpleHBHEPhase1Algo::SimpleHBHEPhase1Algo(const int firstSampleShift, const bool applyLegacyHBMCorrection, std::unique_ptr<PulseShapeFitOOTPileupCorrection> m2, std::unique_ptr<HcalDeterministicFit> detFit, - std::unique_ptr<MahiFit> mahi) - : pulseCorr_(PulseContainmentFractionalError), + std::unique_ptr<MahiFit> mahi, + edm::ConsumesCollector iC) + : delayToken_(iC.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", "HBHE"))), + pulseCorr_(PulseContainmentFractionalError, iC), firstSampleShift_(firstSampleShift), samplesToAdd_(samplesToAdd), phaseNS_(phaseNS), @@ -41,9 +45,7 @@ SimpleHBHEPhase1Algo::SimpleHBHEPhase1Algo(const int firstSampleShift, } void SimpleHBHEPhase1Algo::beginRun(const edm::Run& r, const edm::EventSetup& es) { - edm::ESHandle<HcalTimeSlew> delay; - es.get<HcalTimeSlewRecord>().get("HBHE", delay); - hcalTimeSlew_delay_ = &*delay; + hcalTimeSlew_delay_ = &es.getData(delayToken_); runnum_ = r.run(); pulseCorr_.beginRun(es); diff --git a/RecoLocalCalo/HcalRecAlgos/src/parseHBHEPhase1AlgoDescription.cc b/RecoLocalCalo/HcalRecAlgos/src/parseHBHEPhase1AlgoDescription.cc index d7edfe269f6e9..3e3ccd97fee2b 100644 --- a/RecoLocalCalo/HcalRecAlgos/src/parseHBHEPhase1AlgoDescription.cc +++ b/RecoLocalCalo/HcalRecAlgos/src/parseHBHEPhase1AlgoDescription.cc @@ -1,6 +1,7 @@ #include <cassert> #include "RecoLocalCalo/HcalRecAlgos/interface/parseHBHEPhase1AlgoDescription.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -104,7 +105,8 @@ static std::unique_ptr<HcalDeterministicFit> parseHBHEMethod3Description(const e return fit; } -std::unique_ptr<AbsHBHEPhase1Algo> parseHBHEPhase1AlgoDescription(const edm::ParameterSet& ps) { +std::unique_ptr<AbsHBHEPhase1Algo> parseHBHEPhase1AlgoDescription(const edm::ParameterSet& ps, + edm::ConsumesCollector iC) { std::unique_ptr<AbsHBHEPhase1Algo> algo; const std::string& className = ps.getParameter<std::string>("Class"); @@ -126,16 +128,16 @@ std::unique_ptr<AbsHBHEPhase1Algo> parseHBHEPhase1AlgoDescription(const edm::Par if (ps.getParameter<bool>("useM3")) detFit = parseHBHEMethod3Description(ps); - algo = - std::unique_ptr<AbsHBHEPhase1Algo>(new SimpleHBHEPhase1Algo(ps.getParameter<int>("firstSampleShift"), - ps.getParameter<int>("samplesToAdd"), - ps.getParameter<double>("correctionPhaseNS"), - ps.getParameter<double>("tdcTimeShift"), - ps.getParameter<bool>("correctForPhaseContainment"), - ps.getParameter<bool>("applyLegacyHBMCorrection"), - std::move(m2), - std::move(detFit), - std::move(mahi))); + algo = std::make_unique<SimpleHBHEPhase1Algo>(ps.getParameter<int>("firstSampleShift"), + ps.getParameter<int>("samplesToAdd"), + ps.getParameter<double>("correctionPhaseNS"), + ps.getParameter<double>("tdcTimeShift"), + ps.getParameter<bool>("correctForPhaseContainment"), + ps.getParameter<bool>("applyLegacyHBMCorrection"), + std::move(m2), + std::move(detFit), + std::move(mahi), + iC); } return algo; diff --git a/RecoLocalCalo/HcalRecProducers/src/HBHEPhase1Reconstructor.cc b/RecoLocalCalo/HcalRecProducers/src/HBHEPhase1Reconstructor.cc index 3074f7d401e49..faead2e68eae1 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HBHEPhase1Reconstructor.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HBHEPhase1Reconstructor.cc @@ -23,6 +23,7 @@ #include <algorithm> // user include files +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Utilities/interface/ESGetToken.h" @@ -389,7 +390,7 @@ HBHEPhase1Reconstructor::HBHEPhase1Reconstructor(const edm::ParameterSet& conf) setNoiseFlagsQIE11_(conf.getParameter<bool>("setNoiseFlagsQIE11")), setPulseShapeFlagsQIE8_(conf.getParameter<bool>("setPulseShapeFlagsQIE8")), setPulseShapeFlagsQIE11_(conf.getParameter<bool>("setPulseShapeFlagsQIE11")), - reco_(parseHBHEPhase1AlgoDescription(conf.getParameter<edm::ParameterSet>("algorithm"))), + reco_(parseHBHEPhase1AlgoDescription(conf.getParameter<edm::ParameterSet>("algorithm"), consumesCollector())), negEFilter_(nullptr) { // Check that the reco algorithm has been successfully configured if (!reco_.get()) diff --git a/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc b/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc index 9b26e300b1a40..dcceefd8ffcf2 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc @@ -2,6 +2,7 @@ #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "DataFormats/Common/interface/EDCollection.h" #include "DataFormats/Common/interface/Handle.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" #include "CalibFormats/HcalObjects/interface/HcalCoderDb.h" #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" @@ -25,7 +26,8 @@ HcalHitReconstructor::HcalHitReconstructor(edm::ParameterSet const& conf) : reco_(conf.getParameter<bool>("correctForTimeslew"), conf.getParameter<bool>("correctForPhaseContainment"), - conf.getParameter<double>("correctionPhaseNS")), + conf.getParameter<double>("correctionPhaseNS"), + consumesCollector()), det_(DetId::Hcal), inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")), correctTiming_(conf.getParameter<bool>("correctTiming")), diff --git a/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc b/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc index 89f98600ac94f..23dc7a3093d2e 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc @@ -1,6 +1,7 @@ #include "HcalSimpleReconstructor.h" #include "DataFormats/Common/interface/EDCollection.h" #include "DataFormats/Common/interface/Handle.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" @@ -15,7 +16,8 @@ HcalSimpleReconstructor::HcalSimpleReconstructor(edm::ParameterSet const& conf) : reco_(conf.getParameter<bool>("correctForTimeslew"), conf.getParameter<bool>("correctForPhaseContainment"), - conf.getParameter<double>("correctionPhaseNS")), + conf.getParameter<double>("correctionPhaseNS"), + consumesCollector()), det_(DetId::Hcal), inputLabel_(conf.getParameter<edm::InputTag>("digiLabel")), dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")), From 3db7b403ec962c679318a1a1e370492fef5cd9af Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Wed, 14 Oct 2020 00:27:03 +0200 Subject: [PATCH 545/778] Migrate rest of {Cosmic,GlobalCosmic,Global,L2,L3,Standalone}MuonProducer to EventSetup consumes --- .../src/CosmicMuonProducer.cc | 4 +-- .../src/GlobalCosmicMuonProducer.cc | 4 +-- .../src/GlobalMuonProducer.cc | 4 +-- .../src/GlobalMuonProducer.h | 2 +- RecoMuon/L2MuonProducer/src/L2MuonProducer.cc | 3 ++- RecoMuon/L3MuonProducer/src/L3MuonProducer.cc | 2 +- .../src/StandAloneMuonProducer.cc | 2 +- .../TrackingTools/interface/MuonTrackFinder.h | 18 +++++++------ RecoMuon/TrackingTools/src/MuonTrackFinder.cc | 26 ++++++++++--------- 9 files changed, 34 insertions(+), 31 deletions(-) diff --git a/RecoMuon/CosmicMuonProducer/src/CosmicMuonProducer.cc b/RecoMuon/CosmicMuonProducer/src/CosmicMuonProducer.cc index 9c09f91c3e36b..c976b8de89c59 100644 --- a/RecoMuon/CosmicMuonProducer/src/CosmicMuonProducer.cc +++ b/RecoMuon/CosmicMuonProducer/src/CosmicMuonProducer.cc @@ -23,7 +23,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/TrackReco/interface/Track.h" @@ -59,7 +58,8 @@ CosmicMuonProducer::CosmicMuonProducer(const ParameterSet& iConfig) { theService = std::make_unique<MuonServiceProxy>(serviceParameters, consumesCollector()); theTrackFinder = std::make_unique<MuonTrackFinder>(std::make_unique<CosmicMuonTrajectoryBuilder>(tbpar, theService.get(), iC), - std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get())); + std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get()), + iC); produces<reco::TrackCollection>(); produces<TrackingRecHitCollection>(); diff --git a/RecoMuon/CosmicMuonProducer/src/GlobalCosmicMuonProducer.cc b/RecoMuon/CosmicMuonProducer/src/GlobalCosmicMuonProducer.cc index f594ad77dba3b..cc4c515b7b0d0 100644 --- a/RecoMuon/CosmicMuonProducer/src/GlobalCosmicMuonProducer.cc +++ b/RecoMuon/CosmicMuonProducer/src/GlobalCosmicMuonProducer.cc @@ -21,7 +21,6 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/MuonReco/interface/MuonTrackLinks.h" @@ -51,7 +50,8 @@ GlobalCosmicMuonProducer::GlobalCosmicMuonProducer(const edm::ParameterSet& iCon edm::ConsumesCollector iC = consumesCollector(); theTrackFinder = std::make_unique<MuonTrackFinder>( std::make_unique<GlobalCosmicMuonTrajectoryBuilder>(tbpar, theService.get(), iC), - std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get())); + std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get()), + iC); produces<reco::TrackCollection>(); produces<TrackingRecHitCollection>(); diff --git a/RecoMuon/GlobalMuonProducer/src/GlobalMuonProducer.cc b/RecoMuon/GlobalMuonProducer/src/GlobalMuonProducer.cc index d4659320972fd..c75f7c2f1007a 100644 --- a/RecoMuon/GlobalMuonProducer/src/GlobalMuonProducer.cc +++ b/RecoMuon/GlobalMuonProducer/src/GlobalMuonProducer.cc @@ -64,7 +64,7 @@ GlobalMuonProducer::GlobalMuonProducer(const ParameterSet& parameterSet) { auto mtl = std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService); auto gmtb = std::make_unique<GlobalMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService, iC); - theTrackFinder = new MuonTrackFinder(std::move(gmtb), std::move(mtl)); + theTrackFinder = std::make_unique<MuonTrackFinder>(std::move(gmtb), std::move(mtl), iC); setAlias(parameterSet.getParameter<std::string>("@module_label")); produces<reco::TrackCollection>().setBranchAlias(theAlias + "Tracks"); @@ -82,8 +82,6 @@ GlobalMuonProducer::~GlobalMuonProducer() { LogTrace("Muon|RecoMuon|GlobalMuonProducer") << "destructor called" << endl; if (theService) delete theService; - if (theTrackFinder) - delete theTrackFinder; } // diff --git a/RecoMuon/GlobalMuonProducer/src/GlobalMuonProducer.h b/RecoMuon/GlobalMuonProducer/src/GlobalMuonProducer.h index 0e025aae8eece..d85b1a8212bea 100644 --- a/RecoMuon/GlobalMuonProducer/src/GlobalMuonProducer.h +++ b/RecoMuon/GlobalMuonProducer/src/GlobalMuonProducer.h @@ -52,7 +52,7 @@ class GlobalMuonProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT<TrajTrackAssociationCollection> staAssoMapToken; edm::EDGetTokenT<reco::TrackToTrackMap> updatedStaAssoMapToken; - MuonTrackFinder* theTrackFinder; + std::unique_ptr<MuonTrackFinder> theTrackFinder; /// the event setup proxy, it takes care the services update MuonServiceProxy* theService; diff --git a/RecoMuon/L2MuonProducer/src/L2MuonProducer.cc b/RecoMuon/L2MuonProducer/src/L2MuonProducer.cc index 462727bbb7bbe..8d17c298bcea0 100644 --- a/RecoMuon/L2MuonProducer/src/L2MuonProducer.cc +++ b/RecoMuon/L2MuonProducer/src/L2MuonProducer.cc @@ -88,7 +88,8 @@ L2MuonProducer::L2MuonProducer(const ParameterSet& parameterSet) { theTrackFinder = std::make_unique<MuonTrackFinder>(std::move(trajectoryBuilder), std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get()), - std::make_unique<MuonTrajectoryCleaner>(true)); + std::make_unique<MuonTrajectoryCleaner>(true), + iC); produces<reco::TrackCollection>(); produces<reco::TrackCollection>("UpdatedAtVtx"); diff --git a/RecoMuon/L3MuonProducer/src/L3MuonProducer.cc b/RecoMuon/L3MuonProducer/src/L3MuonProducer.cc index b1e21b59d3c2e..8a32ac1828428 100644 --- a/RecoMuon/L3MuonProducer/src/L3MuonProducer.cc +++ b/RecoMuon/L3MuonProducer/src/L3MuonProducer.cc @@ -58,7 +58,7 @@ L3MuonProducer::L3MuonProducer(const ParameterSet& parameterSet) { // instantiate the concrete trajectory builder in the Track Finder auto mtl = std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get()); auto l3mtb = std::make_unique<L3MuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC); - theTrackFinder = std::make_unique<MuonTrackFinder>(std::move(l3mtb), std::move(mtl)); + theTrackFinder = std::make_unique<MuonTrackFinder>(std::move(l3mtb), std::move(mtl), iC); theL2SeededTkLabel = trackLoaderParameters.getUntrackedParameter<std::string>("MuonSeededTracksInstance", std::string()); diff --git a/RecoMuon/StandAloneMuonProducer/src/StandAloneMuonProducer.cc b/RecoMuon/StandAloneMuonProducer/src/StandAloneMuonProducer.cc index ca8fee965d758..f0d44e4ee3f4d 100644 --- a/RecoMuon/StandAloneMuonProducer/src/StandAloneMuonProducer.cc +++ b/RecoMuon/StandAloneMuonProducer/src/StandAloneMuonProducer.cc @@ -80,7 +80,7 @@ StandAloneMuonProducer::StandAloneMuonProducer(const ParameterSet& parameterSet) trajectoryBuilder = std::make_unique<StandAloneMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC); } - theTrackFinder = std::make_unique<MuonTrackFinder>(std::move(trajectoryBuilder), std::move(trackLoader)); + theTrackFinder = std::make_unique<MuonTrackFinder>(std::move(trajectoryBuilder), std::move(trackLoader), iC); setAlias(parameterSet.getParameter<std::string>("@module_label")); diff --git a/RecoMuon/TrackingTools/interface/MuonTrackFinder.h b/RecoMuon/TrackingTools/interface/MuonTrackFinder.h index dd599cf2ebe24..260a0cf3930cd 100644 --- a/RecoMuon/TrackingTools/interface/MuonTrackFinder.h +++ b/RecoMuon/TrackingTools/interface/MuonTrackFinder.h @@ -12,17 +12,15 @@ #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" #include "TrackingTools/PatternTools/interface/Trajectory.h" #include "RecoMuon/TrackingTools/interface/MuonCandidate.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" -#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include <vector> -namespace edm { - class ParameterSet; - class Event; - class EventSetup; -} // namespace edm class TrackerTopology; +class TrackerTopologyRcd; class MuonTrajectoryBuilder; class MuonTrajectoryCleaner; @@ -37,12 +35,14 @@ class MuonTrackFinder { public: /// Constructor, with default cleaner. For the STA reconstruction the trackLoader must have the propagator. MuonTrackFinder(std::unique_ptr<MuonTrajectoryBuilder> ConcreteMuonTrajectoryBuilder, - std::unique_ptr<MuonTrackLoader> trackLoader); + std::unique_ptr<MuonTrackLoader> trackLoader, + edm::ConsumesCollector iC); /// Constructor, with user-defined cleaner. For the STA reconstruction the trackLoader must have the propagator. MuonTrackFinder(std::unique_ptr<MuonTrajectoryBuilder> ConcreteMuonTrajectoryBuilder, std::unique_ptr<MuonTrackLoader> trackLoader, - std::unique_ptr<MuonTrajectoryCleaner> cleaner); + std::unique_ptr<MuonTrajectoryCleaner> cleaner, + edm::ConsumesCollector iC); /// destructor virtual ~MuonTrackFinder(); @@ -68,6 +68,8 @@ class MuonTrackFinder { void load(CandidateContainer&, edm::Event&, const TrackerTopology& ttopo); private: + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTtopoToken; + std::unique_ptr<MuonTrajectoryBuilder> theTrajBuilder; std::unique_ptr<MuonTrajectoryCleaner> theTrajCleaner; diff --git a/RecoMuon/TrackingTools/src/MuonTrackFinder.cc b/RecoMuon/TrackingTools/src/MuonTrackFinder.cc index 7bc1c91e8d889..20590ae1c5a8b 100644 --- a/RecoMuon/TrackingTools/src/MuonTrackFinder.cc +++ b/RecoMuon/TrackingTools/src/MuonTrackFinder.cc @@ -30,16 +30,20 @@ using namespace edm; // Constructor, with default cleaner. For the STA reconstruction the trackLoader must have the propagator. MuonTrackFinder::MuonTrackFinder(std::unique_ptr<MuonTrajectoryBuilder> ConcreteMuonTrajectoryBuilder, - std::unique_ptr<MuonTrackLoader> trackLoader) - : theTrajBuilder(std::move(ConcreteMuonTrajectoryBuilder)), - theTrajCleaner(new MuonTrajectoryCleaner()), - theTrackLoader(std::move(trackLoader)) {} + std::unique_ptr<MuonTrackLoader> trackLoader, + edm::ConsumesCollector iC) + : MuonTrackFinder(std::move(ConcreteMuonTrajectoryBuilder), + std::move(trackLoader), + std::make_unique<MuonTrajectoryCleaner>(), + iC) {} // Constructor, with user-defined cleaner. For the STA reconstruction the trackLoader must have the propagator. MuonTrackFinder::MuonTrackFinder(std::unique_ptr<MuonTrajectoryBuilder> ConcreteMuonTrajectoryBuilder, std::unique_ptr<MuonTrackLoader> trackLoader, - std::unique_ptr<MuonTrajectoryCleaner> cleaner) - : theTrajBuilder(std::move(ConcreteMuonTrajectoryBuilder)), + std::unique_ptr<MuonTrajectoryCleaner> cleaner, + edm::ConsumesCollector iC) + : theTtopoToken(iC.esConsumes()), + theTrajBuilder(std::move(ConcreteMuonTrajectoryBuilder)), theTrajCleaner(std::move(cleaner)), theTrackLoader(std::move(trackLoader)) {} @@ -72,8 +76,7 @@ edm::OrphanHandle<reco::TrackCollection> MuonTrackFinder::reconstruct( // Percolate the event setEvent(event); - edm::ESHandle<TrackerTopology> httopo; - es.get<TrackerTopologyRcd>().get(httopo); + const auto& ttopo = es.getData(theTtopoToken); // Trajectory container TrajectoryContainer muonTrajectories; @@ -96,7 +99,7 @@ edm::OrphanHandle<reco::TrackCollection> MuonTrackFinder::reconstruct( // convert the trajectories into tracks and load them in to the event LogTrace(metname) << "Convert the trajectories into tracks and load them in to the event" << endl; - return load(muonTrajectories, event, *httopo); + return load(muonTrajectories, event, ttopo); } // reconstruct trajectories @@ -106,8 +109,7 @@ void MuonTrackFinder::reconstruct(const std::vector<TrackCand>& staCandColl, Eve // percolate the event setEvent(event); - edm::ESHandle<TrackerTopology> httopo; - es.get<TrackerTopologyRcd>().get(httopo); + const auto& ttopo = es.getData(theTtopoToken); // Muon Candidate container CandidateContainer muonCandidates; @@ -126,5 +128,5 @@ void MuonTrackFinder::reconstruct(const std::vector<TrackCand>& staCandColl, Eve // convert the trajectories into staTracks and load them into the event LogTrace(metname) << "Load Muon Candidates into the event" << endl; - load(muonCandidates, event, *httopo); + load(muonCandidates, event, ttopo); } From 32b91acd007f51c4688596f26058f76ae24615bc Mon Sep 17 00:00:00 2001 From: Chris West <christopher.alan.west@gmail.com> Date: Wed, 14 Oct 2020 04:09:36 +0200 Subject: [PATCH 546/778] Remove obsolete records --- Configuration/AlCa/python/autoCond.py | 82 +++++++++++++-------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Configuration/AlCa/python/autoCond.py b/Configuration/AlCa/python/autoCond.py index 354dd197deb84..59978e8f4dd2a 100644 --- a/Configuration/AlCa/python/autoCond.py +++ b/Configuration/AlCa/python/autoCond.py @@ -2,86 +2,86 @@ ### NEW KEYS ### # GlobalTag for MC production with perfectly aligned and calibrated detector for Run1 - 'run1_design' : '110X_mcRun1_design_v2', + 'run1_design' : '112X_mcRun1_design_v1', # GlobalTag for MC production (pp collisions) with realistic alignment and calibrations for Run1 - 'run1_mc' : '110X_mcRun1_realistic_v2', + 'run1_mc' : '112X_mcRun1_realistic_v1', # GlobalTag for MC production (Heavy Ions collisions) with realistic alignment and calibrations for Run1 - 'run1_mc_hi' : '110X_mcRun1_HeavyIon_v2', + 'run1_mc_hi' : '112X_mcRun1_HeavyIon_v1', # GlobalTag for MC production (p-Pb collisions) with realistic alignment and calibrations for Run1 - 'run1_mc_pa' : '110X_mcRun1_pA_v2', + 'run1_mc_pa' : '112X_mcRun1_pA_v1', # GlobalTag for MC production with pessimistic alignment and calibrations for Run2 - 'run2_mc_50ns' : '110X_mcRun2_startup_v2', + 'run2_mc_50ns' : '112X_mcRun2_startup_v1', # GlobalTag for MC production (L1 Trigger Stage1) with starup-like alignment and calibrations for Run2, L1 trigger in Stage1 mode - 'run2_mc_l1stage1' : '110X_mcRun2_asymptotic_l1stage1_v2', + 'run2_mc_l1stage1' : '112X_mcRun2_asymptotic_l1stage1_v1', # GlobalTag for MC production with perfectly aligned and calibrated detector for Run2 - 'run2_design' : '110X_mcRun2_design_v5', + 'run2_design' : '112X_mcRun2_design_v1', #GlobalTag for MC production with optimistic alignment and calibrations for 2016, prior to VFP change - 'run2_mc_pre_vfp' : '111X_mcRun2_asymptotic_preVFP_v1', + 'run2_mc_pre_vfp' : '112X_mcRun2_asymptotic_preVFP_v1', #GlobalTag for MC production with optimistic alignment and calibrations for 2016, after VFP change - 'run2_mc' : '111X_mcRun2_asymptotic_v1', + 'run2_mc' : '112X_mcRun2_asymptotic_v1', # GlobalTag for MC production (cosmics) with starup-like alignment and calibrations for Run2, Strip tracker in peak mode - 'run2_mc_cosmics' : '111X_mcRun2cosmics_startup_deco_v1', + 'run2_mc_cosmics' : '112X_mcRun2cosmics_startup_deco_v1', # GlobalTag for MC production (Heavy Ions collisions) with optimistic alignment and calibrations for Run2 - 'run2_mc_hi' : '110X_mcRun2_HeavyIon_v2', + 'run2_mc_hi' : '112X_mcRun2_HeavyIon_v1', # GlobalTag for MC production (p-Pb collisions) with realistic alignment and calibrations for Run2 - 'run2_mc_pa' : '110X_mcRun2_pA_v3', + 'run2_mc_pa' : '112X_mcRun2_pA_v1', # GlobalTag for Run1 data reprocessing - 'run1_data' : '112X_dataRun2_v4', + 'run1_data' : '112X_dataRun2_v5', # GlobalTag for Run2 data reprocessing - 'run2_data' : '112X_dataRun2_v4', + 'run2_data' : '112X_dataRun2_v5', # GlobalTag for Run2 data 2018B relvals only: HEM-15-16 fail - 'run2_data_HEfail' : '112X_dataRun2_HEfail_v4', + 'run2_data_HEfail' : '112X_dataRun2_HEfail_v5', # GlobalTag for Run2 data relvals: allows customization to run with fixed L1 menu - 'run2_data_relval' : '112X_dataRun2_relval_v4', + 'run2_data_relval' : '112X_dataRun2_relval_v5', # GlobalTag for Run2 HI data - 'run2_data_promptlike_hi' : '112X_dataRun2_PromptLike_HI_v1', + 'run2_data_promptlike_hi' : '112X_dataRun2_PromptLike_HI_v2', # GlobalTag for Run1 HLT: it points to the online GT - 'run1_hlt' : '101X_dataRun2_HLT_frozen_v9', + 'run1_hlt' : '101X_dataRun2_HLT_frozen_v10', # GlobalTag for Run2 HLT: it points to the online GT - 'run2_hlt' : '101X_dataRun2_HLT_frozen_v9', + 'run2_hlt' : '101X_dataRun2_HLT_frozen_v10', # GlobalTag for Run2 HLT RelVals: customizations to run with fixed L1 Menu - 'run2_hlt_relval' : '103X_dataRun2_HLT_relval_v8', - 'run2_hlt_relval_hi' : '103X_dataRun2_HLT_relval_HI_v4', + 'run2_hlt_relval' : '103X_dataRun2_HLT_relval_v9', + 'run2_hlt_relval_hi' : '103X_dataRun2_HLT_relval_HI_v5', # GlobalTag for Run2 HLT for HI (not 2018 HI): it points to the online GT - 'run2_hlt_hi' : '101X_dataRun2_HLTHI_frozen_v9', + 'run2_hlt_hi' : '101X_dataRun2_HLTHI_frozen_v10', # GlobalTag for Run3 data relvals (express GT) - 'run3_data_express' : '111X_dataRun3_Express_v2', + 'run3_data_express' : '111X_dataRun3_Express_v4', # GlobalTag for Run3 data relvals - 'run3_data_promptlike' : '111X_dataRun3_Prompt_v2', + 'run3_data_promptlike' : '111X_dataRun3_Prompt_v4', # GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2017 (and 0,0,~0-centred beamspot) - 'phase1_2017_design' : '111X_mc2017_design_v2', + 'phase1_2017_design' : '112X_mc2017_design_v1', # GlobalTag for MC production with realistic conditions for Phase1 2017 detector - 'phase1_2017_realistic' : '112X_mc2017_realistic_v2', + 'phase1_2017_realistic' : '112X_mc2017_realistic_v3', # GlobalTag for MC production (cosmics) with realistic alignment and calibrations for Phase1 2017 detector, Strip tracker in DECO mode - 'phase1_2017_cosmics' : '112X_mc2017cosmics_realistic_deco_v2', + 'phase1_2017_cosmics' : '112X_mc2017cosmics_realistic_deco_v3', # GlobalTag for MC production (cosmics) with realistic alignment and calibrations for Phase1 2017 detector, Strip tracker in PEAK mode - 'phase1_2017_cosmics_peak' : '112X_mc2017cosmics_realistic_peak_v2', + 'phase1_2017_cosmics_peak' : '112X_mc2017cosmics_realistic_peak_v3', # GlobalTag for MC production with perfectly aligned and calibrated detector for full Phase1 2018 (and 0,0,0-centred beamspot) - 'phase1_2018_design' : '112X_upgrade2018_design_v2', + 'phase1_2018_design' : '112X_upgrade2018_design_v3', # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector - 'phase1_2018_realistic' : '112X_upgrade2018_realistic_v3', + 'phase1_2018_realistic' : '112X_upgrade2018_realistic_v4', # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector for Heavy Ion - 'phase1_2018_realistic_hi' : '112X_upgrade2018_realistic_HI_v4', + 'phase1_2018_realistic_hi' : '112X_upgrade2018_realistic_HI_v5', # GlobalTag for MC production with realistic conditions for full Phase1 2018 detector: HEM-15-16 fail - 'phase1_2018_realistic_HEfail' : '112X_upgrade2018_realistic_HEfail_v3', + 'phase1_2018_realistic_HEfail' : '112X_upgrade2018_realistic_HEfail_v4', # GlobalTag for MC production (cosmics) with realistic conditions for full Phase1 2018 detector, Strip tracker in DECO mode - 'phase1_2018_cosmics' : '112X_upgrade2018cosmics_realistic_deco_v3', + 'phase1_2018_cosmics' : '112X_upgrade2018cosmics_realistic_deco_v4', # GlobalTag for MC production (cosmics) with realistic conditions for full Phase1 2018 detector, Strip tracker in PEAK mode - 'phase1_2018_cosmics_peak' : '112X_upgrade2018cosmics_realistic_peak_v3', + 'phase1_2018_cosmics_peak' : '112X_upgrade2018cosmics_realistic_peak_v4', # GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2021 - 'phase1_2021_design' : '112X_mcRun3_2021_design_v8', # GT containing design conditions for Phase1 2021 + 'phase1_2021_design' : '112X_mcRun3_2021_design_v9', # GT containing design conditions for Phase1 2021 # GlobalTag for MC production with realistic conditions for Phase1 2021 - 'phase1_2021_realistic' : '112X_mcRun3_2021_realistic_v8', # GT containing realistic conditions for Phase1 2021 + 'phase1_2021_realistic' : '112X_mcRun3_2021_realistic_v9', # GT containing realistic conditions for Phase1 2021 # GlobalTag for MC production (cosmics) with realistic conditions for Phase1 2021, Strip tracker in DECO mode - 'phase1_2021_cosmics' : '112X_mcRun3_2021cosmics_realistic_deco_v8', + 'phase1_2021_cosmics' : '112X_mcRun3_2021cosmics_realistic_deco_v9', # GlobalTag for MC production with realistic conditions for Phase1 2021 detector for Heavy Ion - 'phase1_2021_realistic_hi' : '112X_mcRun3_2021_realistic_HI_v9', + 'phase1_2021_realistic_hi' : '112X_mcRun3_2021_realistic_HI_v10', # GlobalTag for MC production with realistic conditions for Phase1 2023 - 'phase1_2023_realistic' : '112X_mcRun3_2023_realistic_v8', # GT containing realistic conditions for Phase1 2023 + 'phase1_2023_realistic' : '112X_mcRun3_2023_realistic_v9', # GT containing realistic conditions for Phase1 2023 # GlobalTag for MC production with realistic conditions for Phase1 2024 - 'phase1_2024_realistic' : '112X_mcRun3_2024_realistic_v8', # GT containing realistic conditions for Phase1 2024 + 'phase1_2024_realistic' : '112X_mcRun3_2024_realistic_v9', # GT containing realistic conditions for Phase1 2024 # GlobalTag for MC production with realistic conditions for Phase2 - 'phase2_realistic' : '112X_mcRun4_realistic_v2' + 'phase2_realistic' : '112X_mcRun4_realistic_v3' } aliases = { From 182f74d96f1361841374e37d602df17f01e4180a Mon Sep 17 00:00:00 2001 From: Luiz Mundim <luiz.mundim@cern.ch> Date: Wed, 14 Oct 2020 04:45:57 +0200 Subject: [PATCH 547/778] Removing a bug in HECTOR propagator (PPSProtonTransport) which was producing only negative Pz --- SimTransport/PPSProtonTransport/src/HectorTransport.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SimTransport/PPSProtonTransport/src/HectorTransport.cc b/SimTransport/PPSProtonTransport/src/HectorTransport.cc index d4fcd49ef7e3d..5077c5fbe197f 100644 --- a/SimTransport/PPSProtonTransport/src/HectorTransport.cc +++ b/SimTransport/PPSProtonTransport/src/HectorTransport.cc @@ -153,11 +153,10 @@ bool HectorTransport::transportProton(const HepMC::GenParticle* gpart) { double partP = sqrt(pow(h_p.getE(), 2) - ProtonMassSQ); double theta = sqrt(thx * thx + thy * thy) * urad; + // copy the kinematic changing to CMS ref. frame, only the negative Pz needs to be changed TLorentzVector p_out( - tan(thx * urad) * partP * cos(theta), tan(thy * urad) * partP * cos(theta), partP * cos(theta), h_p.getE()); + -tan(thx * urad) * partP * cos(theta), tan(thy * urad) * partP * cos(theta), direction*partP * cos(theta), h_p.getE()); - // get variables in CMS ref frame - p_out.RotateY(TMath::Pi()); m_beamPart[line] = p_out; m_xAtTrPoint[line] = -x1_ctpps * um_to_mm; // move to CMS ref. frame m_yAtTrPoint[line] = y1_ctpps * um_to_mm; From d2467cd916333ad46b8bce7222f25c6fcb4ae780 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Wed, 14 Oct 2020 15:16:43 +0900 Subject: [PATCH 548/778] added MessageLogger.h --- EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc | 5 ++--- EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc | 8 +------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 9baee3ef5a305..f9160ca142dcf 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -24,6 +24,7 @@ #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/ESGetToken.h" #include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" class GEMDigiToRawModule : public edm::global::EDProducer<edm::RunCache<GEMROMapping>> { public: @@ -269,9 +270,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve uint64_t* w = reinterpret_cast<uint64_t*>(fedRawData.data()); for (const auto& word : words) { -#ifdef EDM_ML_DEBUG - std::cout << std::bitset<64>(word) << std::endl; -#endif + LogDebug("GEMDigiToRawModule") << std::bitset<64>(word); *(w++) = word; } LogDebug("GEMDigiToRawModule") << " words " << words.size(); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index e66cc3b9b05cc..1b5cedabe0e3a 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -28,6 +28,7 @@ #include "FWCore/Utilities/interface/ESGetToken.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Utilities/interface/Transition.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" class GEMRawToDigiModule : public edm::global::EDProducer<edm::RunCache<GEMROMapping> > { public: @@ -121,13 +122,6 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve const uint64_t* word = reinterpret_cast<const uint64_t*>(data); -#ifdef EDM_ML_DEBUG - const uint64_t* w = word; - for (int i = 0; i < nWords; i++) { - std::cout << std::bitset<64>(*(w++)) << std::endl; - } -#endif - auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); if (amc13Event == nullptr) From 8859bd0e1129f40398db620dc71d2ae47ffdd42f Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 14 Oct 2020 09:18:14 +0200 Subject: [PATCH 549/778] fix fill descriptions, range-based loop, comments cleanup --- .../plugins/HiSignalGenJetProducer.cc | 65 ++---------------- .../plugins/HiSignalParticleProducer.cc | 67 +++---------------- 2 files changed, 16 insertions(+), 116 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc index 14fc8be6ef056..b466e7f425029 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc @@ -1,26 +1,6 @@ -// -*- C++ -*- -// -// Package: HiSignalGenJetProducer -// Class: HiSignalGenJetProducer -// -/**\class HiSignalGenJetProducer HiSignalGenJetProducer.cc yetkin/HiSignalGenJetProducer/src/HiSignalGenJetProducer.cc - - Description: <one line class summary> - - Implementation: - <Notes on implementation> -*/ -// -// Original Author: Yetkin Yilmaz -// Created: Tue Jul 21 04:26:01 EDT 2009 -// -// - -// system include files #include <memory> #include <vector> -// user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/global/EDProducer.h" @@ -34,13 +14,6 @@ #include "DataFormats/JetReco/interface/GenJetCollection.h" #include "DataFormats/HepMCCandidate/interface/GenParticle.h" -using namespace std; -using namespace edm; - -// -// class decleration -// - class HiSignalGenJetProducer : public edm::global::EDProducer<> { public: explicit HiSignalGenJetProducer(const edm::ParameterSet&); @@ -50,55 +23,31 @@ class HiSignalGenJetProducer : public edm::global::EDProducer<> { private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; - // ----------member data --------------------------- edm::EDGetTokenT<edm::View<reco::GenJet> > jetSrc_; }; -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - -// -// constructors and destructor -// - HiSignalGenJetProducer::HiSignalGenJetProducer(const edm::ParameterSet& iConfig) : jetSrc_(consumes<edm::View<reco::GenJet> >(iConfig.getParameter<edm::InputTag>("src"))) { - std::string alias = (iConfig.getParameter<InputTag>("src")).label(); + std::string alias = (iConfig.getParameter<edm::InputTag>("src")).label(); produces<reco::GenJetCollection>().setBranchAlias(alias); } -// -// member functions -// - -// ------------ method called to produce the data ------------ - void HiSignalGenJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { - using namespace edm; - using namespace reco; - auto jets = std::make_unique<GenJetCollection>(); + auto jets = std::make_unique<reco::GenJetCollection>(); - edm::Handle<edm::View<GenJet> > genjets; + edm::Handle<edm::View<reco::GenJet> > genjets; iEvent.getByToken(jetSrc_, genjets); - int jetsize = genjets->size(); - - for (int ijet = 0; ijet < jetsize; ++ijet) { - const GenJet* jet1 = &((*genjets)[ijet]); + for (const reco::GenJet &jet1 : *genjets){ - const GenParticle* gencon = jet1->getGenConstituent(0); + const reco::GenParticle* gencon = jet1.getGenConstituent(0); if (gencon == nullptr) throw cms::Exception("GenConstituent", "GenJet is missing its constituents"); else if (gencon->collisionId() == 0) { - jets->push_back(*jet1); + jets->push_back(jet1); } } @@ -108,7 +57,7 @@ void HiSignalGenJetProducer::produce(edm::StreamID, edm::Event& iEvent, const ed void HiSignalGenJetProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.setComment("Selects genJets from collision id = 0"); - desc.add<std::string>("src", "ak4HiGenJets"); + desc.add<edm::InputTag>("src", edm::InputTag("akHiGenJets")); descriptions.add("HiSignalGenJetProducer", desc); } diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc index 2fb650b5bb076..72865ddc63c10 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc @@ -1,24 +1,6 @@ -// -*- C++ -*- -// -// Package: HiSignalParticleProducer -// Class: HiSignalParticleProducer -// -/**\class HiSignalParticleProducer HiSignalParticleProducer.cc yetkin/HiSignalParticleProducer/src/HiSignalParticleProducer.cc - Description: <one line class summary> - Implementation: - <Notes on implementation> -*/ -// -// Original Author: Yetkin Yilmaz -// Created: Tue Jul 21 04:26:01 EDT 2009 -// -// - -// system include files #include <memory> #include <vector> -// user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/global/EDProducer.h" @@ -33,13 +15,6 @@ #include "DataFormats/HepMCCandidate/interface/GenParticle.h" #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" -using namespace std; -using namespace edm; - -// -// class decleration -// - class HiSignalParticleProducer : public edm::global::EDProducer<> { public: explicit HiSignalParticleProducer(const edm::ParameterSet&); @@ -49,50 +24,26 @@ class HiSignalParticleProducer : public edm::global::EDProducer<> { private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; - // ----------member data --------------------------- edm::EDGetTokenT<edm::View<reco::GenParticle> > genParticleSrc_; }; -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - -// -// constructors and destructor -// - HiSignalParticleProducer::HiSignalParticleProducer(const edm::ParameterSet& iConfig) : genParticleSrc_(consumes<edm::View<reco::GenParticle> >(iConfig.getParameter<edm::InputTag>("src"))) { - std::string alias = (iConfig.getParameter<InputTag>("src")).label(); + std::string alias = (iConfig.getParameter<edm::InputTag>("src")).label(); produces<reco::GenParticleCollection>().setBranchAlias(alias); } -// -// member functions -// - -// ------------ method called to produce the data ------------ - void HiSignalParticleProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { - using namespace edm; - using namespace reco; - - auto signalGenParticles = std::make_unique<GenParticleCollection>(); - edm::Handle<edm::View<GenParticle> > genParticles; + auto signalGenParticles = std::make_unique<reco::GenParticleCollection>(); + + edm::Handle<edm::View<reco::GenParticle> > genParticles; iEvent.getByToken(genParticleSrc_, genParticles); - - int genParticleSize = genParticles->size(); - - for (int igenParticle = 0; igenParticle < genParticleSize; ++igenParticle) { - const GenParticle* genParticle = &((*genParticles)[igenParticle]); - if (genParticle->collisionId() == 0) { - signalGenParticles->push_back(*genParticle); + + for (const reco::GenParticle &genParticle : *genParticles){ + if (genParticle.collisionId() == 0) { + signalGenParticles->push_back(genParticle); } } @@ -102,7 +53,7 @@ void HiSignalParticleProducer::produce(edm::StreamID, edm::Event& iEvent, const void HiSignalParticleProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.setComment("Selects genParticles from collision id = 0"); - desc.add<std::string>("src", "genParticles"); + desc.add<edm::InputTag>("src", edm::InputTag("genParticles")); descriptions.add("HiSignalParticleProducer", desc); } From aea9e1cce12349bb96840c92fc1149ca59b6516f Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Wed, 14 Oct 2020 09:22:24 +0200 Subject: [PATCH 550/778] Clean up from dead assignments in CalibCalorimetry/HcalAlgos --- CalibCalorimetry/HcalAlgos/src/HcalLogicalMapGenerator.cc | 2 +- CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CalibCalorimetry/HcalAlgos/src/HcalLogicalMapGenerator.cc b/CalibCalorimetry/HcalAlgos/src/HcalLogicalMapGenerator.cc index 25b483cd2da7a..2891fe5e5075a 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalLogicalMapGenerator.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalLogicalMapGenerator.cc @@ -2021,7 +2021,7 @@ void HcalLogicalMapGenerator::buildHOXMap(const HcalTopology* topo, ihtr_fi = HO_htr_fi_eta1234_sipm[phmod6][4][(irm - 1) / 2][sidear]; itb = 0; fpga = "top"; - mytype = 3; + // mytype = 3; ih = 2; ihtr = ihslotho[php2mod18ov6][ih]; ispigot = ihtr < 9 ? (ihtr - 2) * 2 + itb : (ihtr - 13) * 2 + itb; diff --git a/CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc b/CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc index f8b619e9574a4..b41382f02175e 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalPedestalAnalysis.cc @@ -803,7 +803,6 @@ void HcalPedestalAnalysis::Trendings(map<HcalDetId, map<int, PEDBUNCH> >& toolT, _meot->second[i].second.second[4]->GetYaxis()->SetTitle("Distant correlation"); _meot->second[i].second.second[4]->Write(); */ // chi2 - j = 0; for (sample_it = _meot->second[i].second.first[4].begin(); sample_it != _meot->second[i].second.first[4].end(); ++sample_it) { Chi2->Fill(*sample_it); From ab1d3e405d5982061bf61db0f404d2628f3a20b4 Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Wed, 14 Oct 2020 09:22:55 +0200 Subject: [PATCH 551/778] Clean up from dead assignments in RecoMuon/TrackingTools --- RecoMuon/TrackingTools/src/MuonErrorMatrix.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/RecoMuon/TrackingTools/src/MuonErrorMatrix.cc b/RecoMuon/TrackingTools/src/MuonErrorMatrix.cc index 0a2d8da9d9e04..e4dd8d866a01d 100644 --- a/RecoMuon/TrackingTools/src/MuonErrorMatrix.cc +++ b/RecoMuon/TrackingTools/src/MuonErrorMatrix.cc @@ -428,19 +428,15 @@ double MuonErrorMatrix::Term(const AlgebraicSymMatrix55 &curv, int i, int j) { } else { double si = curv(i, i); double sj = curv(j, j); - if (si <= 0 || sj <= 0) { + //check validity edm::LogError("MuonErrorMatrix") << "invalid term in the error matrix.\n si: " << si << " sj: " << sj << ". result will be corrupted\n" << curv; return 0; } - - si = sqrt(si); - sj = sqrt(sj); - //check validity - - return result = curv(i, j) / (si * sj); + result = curv(i, j) / sqrt(si * sj); + return result; } //by default return 0; From f189a5687421732bfb25613efd52d00058f4c329 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 14 Oct 2020 09:25:46 +0200 Subject: [PATCH 552/778] code checks --- RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc | 4 +--- RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc index b466e7f425029..a79be7043cc70 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc @@ -34,14 +34,12 @@ HiSignalGenJetProducer::HiSignalGenJetProducer(const edm::ParameterSet& iConfig) } void HiSignalGenJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { - auto jets = std::make_unique<reco::GenJetCollection>(); edm::Handle<edm::View<reco::GenJet> > genjets; iEvent.getByToken(jetSrc_, genjets); - for (const reco::GenJet &jet1 : *genjets){ - + for (const reco::GenJet& jet1 : *genjets) { const reco::GenParticle* gencon = jet1.getGenConstituent(0); if (gencon == nullptr) diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc index 72865ddc63c10..c392eaea3f5b1 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc @@ -35,13 +35,12 @@ HiSignalParticleProducer::HiSignalParticleProducer(const edm::ParameterSet& iCon } void HiSignalParticleProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { - auto signalGenParticles = std::make_unique<reco::GenParticleCollection>(); - + edm::Handle<edm::View<reco::GenParticle> > genParticles; iEvent.getByToken(genParticleSrc_, genParticles); - - for (const reco::GenParticle &genParticle : *genParticles){ + + for (const reco::GenParticle& genParticle : *genParticles) { if (genParticle.collisionId() == 0) { signalGenParticles->push_back(genParticle); } From a7578066427c9f41827d1ed125c17eb80a33556a Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Fri, 9 Oct 2020 19:04:22 +0200 Subject: [PATCH 553/778] fix more warnings in Tracking Validation --- .../python/PostProcessorTracker_cfi.py | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Validation/RecoTrack/python/PostProcessorTracker_cfi.py b/Validation/RecoTrack/python/PostProcessorTracker_cfi.py index 9bccb66b4b155..3049641697866 100644 --- a/Validation/RecoTrack/python/PostProcessorTracker_cfi.py +++ b/Validation/RecoTrack/python/PostProcessorTracker_cfi.py @@ -15,8 +15,10 @@ def _addNoFlow(module): if not tmp[ind-1] in _noflowSeen: module.noFlowDists.append(tmp[ind-1]) +_defaultSubdirs = ["Tracking/Track/*", "Tracking/TrackTPPtLess09/*", "Tracking/TrackFromPV/*", "Tracking/TrackFromPVAllTP/*", "Tracking/TrackAllTPEffic/*", "Tracking/TrackBuilding/*","Tracking/TrackConversion/*", "Tracking/TrackGsf/*"] + postProcessorTrack = DQMEDHarvester("DQMGenericClient", - subDirs = cms.untracked.vstring("Tracking/Track/*", "Tracking/TrackTPPtLess09/*", "Tracking/TrackFromPV/*", "Tracking/TrackFromPVAllTP/*", "Tracking/TrackAllTPEffic/*", "Tracking/TrackBuilding/*", "Tracking/TrackConversion/*", "Tracking/TrackGsf/*", "Tracking/TrackBHadron/*"), + subDirs = cms.untracked.vstring(_defaultSubdirs), efficiency = cms.vstring( "effic 'Efficiency vs #eta' num_assoc(simToReco)_eta num_simul_eta", "efficPt 'Efficiency vs p_{T}' num_assoc(simToReco)_pT num_simul_pT", @@ -252,7 +254,7 @@ def _addNoFlow(module): postProcessorTrack2D = DQMEDHarvester("DQMGenericClient", makeGlobalEffienciesPlot = cms.untracked.bool(False), - subDirs = cms.untracked.vstring("Tracking/Track/*", "Tracking/TrackTPPtLess09/*", "Tracking/TrackFromPV/*", "Tracking/TrackFromPVAllTP/*", "Tracking/TrackAllTPEffic/*", "Tracking/TrackBuilding/*", "Tracking/TrackConversion/*", "Tracking/TrackGsf/*", "Tracking/TrackBHadron/*"), + subDirs = cms.untracked.vstring(_defaultSubdirs), efficiency = cms.vstring( "efficPtvseta 'Efficiency in p_{T}-#eta plane' num_assoc(simToReco)_pTvseta num_simul_pTvseta", "duplicatesRate_Ptvseta 'Duplicates Rate in (p_{T}-#eta) plane' num_duplicate_pTvseta num_reco_pTvseta", @@ -294,7 +296,7 @@ def _addNoFlow(module): postProcessorTrackSummary = DQMEDHarvester("DQMGenericClient", - subDirs = cms.untracked.vstring("Tracking/Track", "Tracking/TrackTPPtLess09", "Tracking/TrackFromPV", "Tracking/TrackFromPVAllTP", "Tracking/TrackAllTPEffic", "Tracking/TrackBuilding", "Tracking/TrackConversion", "Tracking/TrackGsf", "Tracking/TrackBHadron"), + subDirs = cms.untracked.vstring(_defaultSubdirs), efficiency = cms.vstring( "effic_vs_coll 'Efficiency vs track collection' num_assoc(simToReco)_coll num_simul_coll", "effic_vs_coll_allPt 'Efficiency vs track collection' num_assoc(simToReco)_coll_allPt num_simul_coll_allPt", @@ -313,6 +315,24 @@ def _addNoFlow(module): postProcessorTrackSummary ) +####### +# Define a standalone seuquence to support the Standalone harvesting mode +# see https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideMultiTrackValidator#cmsDriver_MTV_alone_i_e_standalone for more information +######## + +postProcessorTrackStandalone = postProcessorTrack.clone( + subDirs = _defaultSubdirs.append("Tracking/TrackBHadron/*"), +) +postProcessorTrackSummaryStandalone = postProcessorTrackSummary.clone( + subDirs = _defaultSubdirs.append("Tracking/TrackBHadron/*"), +) + +postProcessorTrackSequenceStandalone = cms.Sequence( + postProcessorTrackStandalone+ + postProcessorTrackNrecVsNsim+ + postProcessorTrackSummaryStandalone +) + postProcessorTrackPhase2 = postProcessorTrack.clone() postProcessorTrackPhase2.subDirs.extend(["Tracking/TrackTPEtaGreater2p7/*"]) postProcessorTrackSummaryPhase2 = postProcessorTrackSummary.clone() @@ -323,9 +343,9 @@ def _addNoFlow(module): phase2_tracker.toReplaceWith(postProcessorTrackSummary,postProcessorTrackSummaryPhase2) postProcessorTrackTrackingOnly = postProcessorTrack.clone() -postProcessorTrackTrackingOnly.subDirs.extend(["Tracking/TrackSeeding/*", "Tracking/PixelTrack/*"]) +postProcessorTrackTrackingOnly.subDirs.extend(["Tracking/TrackBHadron/*","Tracking/TrackSeeding/*", "Tracking/PixelTrack/*"]) postProcessorTrackSummaryTrackingOnly = postProcessorTrackSummary.clone() -postProcessorTrackSummaryTrackingOnly.subDirs.extend(["Tracking/TrackSeeding", "Tracking/PixelTrack"]) +postProcessorTrackSummaryTrackingOnly.subDirs.extend(["Tracking/TrackBHadron/*","Tracking/TrackSeeding", "Tracking/PixelTrack"]) postProcessorTrackSequenceTrackingOnly = cms.Sequence( postProcessorTrackTrackingOnly+ From 389a60db0aed5985230ae23fa6291312da24632a Mon Sep 17 00:00:00 2001 From: Vladimir <Vladimir.Ivantchenko@cern.ch> Date: Wed, 14 Oct 2020 11:02:03 +0200 Subject: [PATCH 554/778] more clean-up --- SimG4Core/Application/python/g4SimHits_cfi.py | 6 ++--- .../MagneticField/interface/CMSFieldManager.h | 2 +- .../MagneticField/src/CMSFieldManager.cc | 27 ++++++++++++------- .../src/MonopoleTransportation.cc | 4 +-- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/SimG4Core/Application/python/g4SimHits_cfi.py b/SimG4Core/Application/python/g4SimHits_cfi.py index 4a674660c9d34..e9da557de09a6 100644 --- a/SimG4Core/Application/python/g4SimHits_cfi.py +++ b/SimG4Core/Application/python/g4SimHits_cfi.py @@ -100,9 +100,9 @@ StepperParam = cms.PSet( VacRegions = cms.vstring(), # VacRegions = cms.vstring('DefaultRegionForTheWorld','BeamPipeVacuum','BeamPipeOutside'), - EnergyThTracker = cms.double(10000), ## in GeV - RmaxTracker = cms.double(1233), ## in mm - ZmaxTracker = cms.double(1948), ## in mm + EnergyThTracker = cms.double(100000), ## in GeV + RmaxTracker = cms.double(8000), ## in mm + ZmaxTracker = cms.double(11000), ## in mm MaximumEpsilonStep = cms.untracked.double(0.01), DeltaOneStep = cms.double(0.001), ## in mm DeltaOneStepTracker = cms.double(1e-4),## in mm diff --git a/SimG4Core/MagneticField/interface/CMSFieldManager.h b/SimG4Core/MagneticField/interface/CMSFieldManager.h index 32a47ebf9628c..b56ac0389ae6b 100644 --- a/SimG4Core/MagneticField/interface/CMSFieldManager.h +++ b/SimG4Core/MagneticField/interface/CMSFieldManager.h @@ -39,7 +39,7 @@ class CMSFieldManager : public G4FieldManager { double delta, G4PropagatorInField *); - void SetMonopoleTracking(G4bool); + void setMonopoleTracking(G4bool); CMSFieldManager(const CMSFieldManager &) = delete; CMSFieldManager &operator=(const CMSFieldManager &) = delete; diff --git a/SimG4Core/MagneticField/src/CMSFieldManager.cc b/SimG4Core/MagneticField/src/CMSFieldManager.cc index 0dca37bbff60d..2b6bbfa7afb2b 100644 --- a/SimG4Core/MagneticField/src/CMSFieldManager.cc +++ b/SimG4Core/MagneticField/src/CMSFieldManager.cc @@ -103,7 +103,6 @@ void CMSFieldManager::InitialiseForVolume(const edm::ParameterSet &p, m_chordFinder = cf; m_chordFinderMonopole = cfmon; - // m_chordFinder->SetDeltaChord(dChord); m_chordFinderMonopole->SetDeltaChord(m_dChord); // initialisation of field manager @@ -118,8 +117,8 @@ void CMSFieldManager::InitialiseForVolume(const edm::ParameterSet &p, pf->SetMinimumEpsilonStep(minEpsStep); pf->SetMaximumEpsilonStep(maxEpsStep); - // initial initialisation the default chord finder is defined - SetMonopoleTracking(false); + // initial initialisation the default chord finder + setMonopoleTracking(false); // define regions std::vector<std::string> rnames = p.getParameter<std::vector<std::string>>("VacRegions"); @@ -140,7 +139,7 @@ void CMSFieldManager::InitialiseForVolume(const edm::ParameterSet &p, void CMSFieldManager::ConfigureForTrack(const G4Track *track) { // run time parameters per track - if ((track->GetKineticEnergy() > m_energyThTracker) && isInsideTracker(track)) { + if (track->GetKineticEnergy() > m_energyThTracker && isInsideTracker(track)) { if (!m_cfTracker) { setChordFinderForTracker(); } @@ -156,10 +155,10 @@ void CMSFieldManager::ConfigureForTrack(const G4Track *track) { } } -void CMSFieldManager::SetMonopoleTracking(G4bool flag) { +void CMSFieldManager::setMonopoleTracking(G4bool flag) { if (flag) { if (m_currChordFinder != m_chordFinderMonopole) { - if (m_cfVacuum) { + if (m_cfTracker || m_cfVacuum) { setDefaultChordFinder(); } m_currChordFinder = m_chordFinderMonopole; @@ -192,9 +191,11 @@ bool CMSFieldManager::isInsideTracker(const G4Track *track) { } void CMSFieldManager::setDefaultChordFinder() { - m_currChordFinder = m_chordFinder; + if (m_currChordFinder != m_chordFinder) { + m_currChordFinder = m_chordFinder; + SetChordFinder(m_currChordFinder); + } m_currChordFinder->SetDeltaChord(m_dChord); - SetChordFinder(m_currChordFinder); SetDeltaOneStep(m_dOneStep); SetDeltaIntersection(m_dIntersection); m_propagator->SetLargestAcceptableStep(m_stepMax); @@ -202,9 +203,11 @@ void CMSFieldManager::setDefaultChordFinder() { } void CMSFieldManager::setChordFinderForTracker() { - m_currChordFinder = m_chordFinder; + if (m_currChordFinder != m_chordFinder) { + m_currChordFinder = m_chordFinder; + SetChordFinder(m_currChordFinder); + } m_currChordFinder->SetDeltaChord(m_dChordTracker); - SetChordFinder(m_currChordFinder); SetDeltaOneStep(m_dOneStepTracker); SetDeltaIntersection(m_dInterTracker); m_propagator->SetLargestAcceptableStep(m_stepMax); @@ -213,6 +216,10 @@ void CMSFieldManager::setChordFinderForTracker() { } void CMSFieldManager::setChordFinderForVacuum() { + if (m_currChordFinder != m_chordFinder) { + m_currChordFinder = m_chordFinder; + SetChordFinder(m_currChordFinder); + } m_currChordFinder->SetDeltaChord(m_dChordSimple); SetDeltaOneStep(m_dOneStepSimple); SetDeltaIntersection(m_dIntersectionSimple); diff --git a/SimG4Core/PhysicsLists/src/MonopoleTransportation.cc b/SimG4Core/PhysicsLists/src/MonopoleTransportation.cc index 50b7377fe456e..afb832020ee07 100644 --- a/SimG4Core/PhysicsLists/src/MonopoleTransportation.cc +++ b/SimG4Core/PhysicsLists/src/MonopoleTransportation.cc @@ -104,7 +104,7 @@ G4double MonopoleTransportation::AlongStepGetPhysicalInteractionLength(const G4T G4double& currentSafety, G4GPILSelection* selection) { // change to monopole equation - fieldMgrCMS->SetMonopoleTracking(true); + fieldMgrCMS->setMonopoleTracking(true); G4double geometryStepLength, newSafety; fParticleIsLooping = false; @@ -515,7 +515,7 @@ G4VParticleChange* MonopoleTransportation::PostStepDoIt(const G4Track& track, co fParticleChange.SetTouchableHandle(retCurrentTouchable); // change to normal equation - fieldMgrCMS->SetMonopoleTracking(false); + fieldMgrCMS->setMonopoleTracking(false); return &fParticleChange; } From d89060dffcf8c7f0e86ec6c29f65016c6bf3edb1 Mon Sep 17 00:00:00 2001 From: Vladimir <Vladimir.Ivantchenko@cern.ch> Date: Wed, 14 Oct 2020 11:20:37 +0200 Subject: [PATCH 555/778] return old condition --- SimG4Core/MagneticField/src/CMSFieldManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimG4Core/MagneticField/src/CMSFieldManager.cc b/SimG4Core/MagneticField/src/CMSFieldManager.cc index 2b6bbfa7afb2b..2c07ab83a256f 100644 --- a/SimG4Core/MagneticField/src/CMSFieldManager.cc +++ b/SimG4Core/MagneticField/src/CMSFieldManager.cc @@ -144,7 +144,7 @@ void CMSFieldManager::ConfigureForTrack(const G4Track *track) { setChordFinderForTracker(); } - } else if ((track->GetKineticEnergy() <= m_energyThreshold) || isInsideVacuum(track)) { + } else if ((track->GetKineticEnergy() <= m_energyThreshold && track->GetParentID() > 0) || isInsideVacuum(track)) { if (!m_cfVacuum) { setChordFinderForVacuum(); } From d7c861bfe009322e6bc4e5ad119bfa0e638ddf8e Mon Sep 17 00:00:00 2001 From: Jeongeun Lee <jeongeun.lee@cern.ch> Date: Wed, 14 Oct 2020 11:39:11 +0200 Subject: [PATCH 556/778] drop type specs in RecoVertex --- .../Configuration/python/RecoVertex_cff.py | 18 ++- .../python/RecoVertex_phase2_timing_cff.py | 107 +++++++++++------- 2 files changed, 80 insertions(+), 45 deletions(-) diff --git a/RecoVertex/Configuration/python/RecoVertex_cff.py b/RecoVertex/Configuration/python/RecoVertex_cff.py index 429d720de76c8..2bbba3b2aab00 100644 --- a/RecoVertex/Configuration/python/RecoVertex_cff.py +++ b/RecoVertex/Configuration/python/RecoVertex_cff.py @@ -14,11 +14,19 @@ from RecoJets.JetProducers.caloJetsForTrk_cff import * unsortedOfflinePrimaryVertices=offlinePrimaryVertices.clone() -offlinePrimaryVertices=sortedPrimaryVertices.clone(vertices="unsortedOfflinePrimaryVertices", particles="trackRefsForJetsBeforeSorting") -offlinePrimaryVerticesWithBS=sortedPrimaryVertices.clone(vertices=cms.InputTag("unsortedOfflinePrimaryVertices","WithBS"), particles="trackRefsForJetsBeforeSorting") -trackWithVertexRefSelectorBeforeSorting = trackWithVertexRefSelector.clone(vertexTag="unsortedOfflinePrimaryVertices") -trackWithVertexRefSelectorBeforeSorting.ptMax=9e99 -trackWithVertexRefSelectorBeforeSorting.ptErrorCut=9e99 +offlinePrimaryVertices=sortedPrimaryVertices.clone( + vertices="unsortedOfflinePrimaryVertices", + particles="trackRefsForJetsBeforeSorting" +) +offlinePrimaryVerticesWithBS=sortedPrimaryVertices.clone( + vertices="unsortedOfflinePrimaryVertices:WithBS", + particles="trackRefsForJetsBeforeSorting" +) +trackWithVertexRefSelectorBeforeSorting = trackWithVertexRefSelector.clone( + vertexTag="unsortedOfflinePrimaryVertices", + ptMax=9e99, + ptErrorCut=9e99 +) trackRefsForJetsBeforeSorting = trackRefsForJets.clone(src="trackWithVertexRefSelectorBeforeSorting") diff --git a/RecoVertex/Configuration/python/RecoVertex_phase2_timing_cff.py b/RecoVertex/Configuration/python/RecoVertex_phase2_timing_cff.py index b39ee5438bf4a..1ca0af44b269e 100644 --- a/RecoVertex/Configuration/python/RecoVertex_phase2_timing_cff.py +++ b/RecoVertex/Configuration/python/RecoVertex_phase2_timing_cff.py @@ -3,46 +3,73 @@ from RecoVertex.PrimaryVertexProducer.TkClusParameters_cff import DA2D_vectParameters -unsortedOfflinePrimaryVertices4D = unsortedOfflinePrimaryVertices.clone(TkClusParameters = DA2D_vectParameters, - TrackTimesLabel = cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModel"), - TrackTimeResosLabel = cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModelResolution"), - ) -trackWithVertexRefSelectorBeforeSorting4D = trackWithVertexRefSelector.clone(vertexTag="unsortedOfflinePrimaryVertices4D", - ptMax=9e99, - ptErrorCut=9e99) -trackRefsForJetsBeforeSorting4D = trackRefsForJets.clone(src="trackWithVertexRefSelectorBeforeSorting4D") -offlinePrimaryVertices4D=sortedPrimaryVertices.clone(vertices="unsortedOfflinePrimaryVertices4D", - particles="trackRefsForJetsBeforeSorting4D", - trackTimeTag=cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModel"), - trackTimeResoTag=cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModelResolution"), - assignment=dict(useTiming=True)) -offlinePrimaryVertices4DWithBS=offlinePrimaryVertices4D.clone(vertices="unsortedOfflinePrimaryVertices4D:WithBS") - -unsortedOfflinePrimaryVertices4DnoPID = unsortedOfflinePrimaryVertices4D.clone(TrackTimesLabel = "trackExtenderWithMTD:generalTrackt0", - TrackTimeResosLabel = "trackExtenderWithMTD:generalTracksigmat0", - ) -trackWithVertexRefSelectorBeforeSorting4DnoPID = trackWithVertexRefSelector.clone(vertexTag="unsortedOfflinePrimaryVertices4DnoPID", - ptMax=9e99, - ptErrorCut=9e99) -trackRefsForJetsBeforeSorting4DnoPID = trackRefsForJets.clone(src="trackWithVertexRefSelectorBeforeSorting4DnoPID") -offlinePrimaryVertices4DnoPID=offlinePrimaryVertices4D.clone(vertices="unsortedOfflinePrimaryVertices4DnoPID", - particles="trackRefsForJetsBeforeSorting4DnoPID", - trackTimeTag="trackExtenderWithMTD:generalTrackt0", - trackTimeResoTag="trackExtenderWithMTD:generalTracksigmat0") -offlinePrimaryVertices4DnoPIDWithBS=offlinePrimaryVertices4DnoPID.clone(vertices="unsortedOfflinePrimaryVertices4DnoPID:WithBS") - -unsortedOfflinePrimaryVertices4DwithPID = unsortedOfflinePrimaryVertices4D.clone(TrackTimesLabel = "tofPID4DnoPID:t0safe", - TrackTimeResosLabel = "tofPID4DnoPID:sigmat0safe", - ) -trackWithVertexRefSelectorBeforeSorting4DwithPID = trackWithVertexRefSelector.clone(vertexTag="unsortedOfflinePrimaryVertices4DwithPID", - ptMax=9e99, - ptErrorCut=9e99) -trackRefsForJetsBeforeSorting4DwithPID = trackRefsForJets.clone(src="trackWithVertexRefSelectorBeforeSorting4DwithPID") -offlinePrimaryVertices4DwithPID=offlinePrimaryVertices4D.clone(vertices="unsortedOfflinePrimaryVertices4DwithPID", - particles="trackRefsForJetsBeforeSorting4DwithPID", - trackTimeTag="tofPID4DnoPID:t0safe", - trackTimeResoTag="tofPID4DnoPID:sigmat0safe") -offlinePrimaryVertices4DwithPIDWithBS=offlinePrimaryVertices4DwithPID.clone(vertices="unsortedOfflinePrimaryVertices4DwithPID:WithBS") +unsortedOfflinePrimaryVertices4D = unsortedOfflinePrimaryVertices.clone( + TkClusParameters = DA2D_vectParameters, + TrackTimesLabel = cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModel"), + TrackTimeResosLabel = cms.InputTag("trackTimeValueMapProducer","generalTracksConfigurableFlatResolutionModelResolution"), +) +trackWithVertexRefSelectorBeforeSorting4D = trackWithVertexRefSelector.clone( + vertexTag = "unsortedOfflinePrimaryVertices4D", + ptMax = 9e99, + ptErrorCut = 9e99 +) +trackRefsForJetsBeforeSorting4D = trackRefsForJets.clone( + src = "trackWithVertexRefSelectorBeforeSorting4D" +) +offlinePrimaryVertices4D = sortedPrimaryVertices.clone( + vertices = "unsortedOfflinePrimaryVertices4D", + particles = "trackRefsForJetsBeforeSorting4D", + trackTimeTag = "trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel", + trackTimeResoTag = "trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution", + assignment = dict(useTiming = True) +) +offlinePrimaryVertices4DWithBS = offlinePrimaryVertices4D.clone( + vertices = "unsortedOfflinePrimaryVertices4D:WithBS" +) + +unsortedOfflinePrimaryVertices4DnoPID = unsortedOfflinePrimaryVertices4D.clone( + TrackTimesLabel = "trackExtenderWithMTD:generalTrackt0", + TrackTimeResosLabel = "trackExtenderWithMTD:generalTracksigmat0" +) +trackWithVertexRefSelectorBeforeSorting4DnoPID = trackWithVertexRefSelector.clone( + vertexTag = "unsortedOfflinePrimaryVertices4DnoPID", + ptMax = 9e99, + ptErrorCut = 9e99 +) +trackRefsForJetsBeforeSorting4DnoPID = trackRefsForJets.clone( + src = "trackWithVertexRefSelectorBeforeSorting4DnoPID" +) +offlinePrimaryVertices4DnoPID = offlinePrimaryVertices4D.clone( + vertices = "unsortedOfflinePrimaryVertices4DnoPID", + particles = "trackRefsForJetsBeforeSorting4DnoPID", + trackTimeTag = "trackExtenderWithMTD:generalTrackt0", + trackTimeResoTag = "trackExtenderWithMTD:generalTracksigmat0" +) +offlinePrimaryVertices4DnoPIDWithBS=offlinePrimaryVertices4DnoPID.clone( + vertices = "unsortedOfflinePrimaryVertices4DnoPID:WithBS" +) + +unsortedOfflinePrimaryVertices4DwithPID = unsortedOfflinePrimaryVertices4D.clone( + TrackTimesLabel = "tofPID4DnoPID:t0safe", + TrackTimeResosLabel = "tofPID4DnoPID:sigmat0safe" +) +trackWithVertexRefSelectorBeforeSorting4DwithPID = trackWithVertexRefSelector.clone( + vertexTag = "unsortedOfflinePrimaryVertices4DwithPID", + ptMax = 9e99, + ptErrorCut = 9e99 +) +trackRefsForJetsBeforeSorting4DwithPID = trackRefsForJets.clone( + src = "trackWithVertexRefSelectorBeforeSorting4DwithPID" +) +offlinePrimaryVertices4DwithPID=offlinePrimaryVertices4D.clone( + vertices = "unsortedOfflinePrimaryVertices4DwithPID", + particles = "trackRefsForJetsBeforeSorting4DwithPID", + trackTimeTag = "tofPID4DnoPID:t0safe", + trackTimeResoTag = "tofPID4DnoPID:sigmat0safe" +) +offlinePrimaryVertices4DwithPIDWithBS = offlinePrimaryVertices4DwithPID.clone( + vertices = "unsortedOfflinePrimaryVertices4DwithPID:WithBS" +) from SimTracker.TrackerHitAssociation.tpClusterProducer_cfi import tpClusterProducer from SimTracker.TrackAssociatorProducers.quickTrackAssociatorByHits_cfi import quickTrackAssociatorByHits From 0ca3101182fe68fc344039dc5297f94afee9057b Mon Sep 17 00:00:00 2001 From: Jeongeun Lee <jeongeun.lee@cern.ch> Date: Wed, 14 Oct 2020 11:50:18 +0200 Subject: [PATCH 557/778] drop type specs in RecoPixelVertexing --- .../python/ClusterShapeExtractor_cfi.py | 2 +- .../python/MinBiasCkfTrajectoryFilter_cfi.py | 11 +++++------ .../python/PixelTripletHLTGenerator_cfi.py | 10 +++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/RecoPixelVertexing/PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py b/RecoPixelVertexing/PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py index 20d4b32087229..fa2570d521552 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py +++ b/RecoPixelVertexing/PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py @@ -20,5 +20,5 @@ from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker phase2_tracker.toModify(clusterShapeExtractor, - pixelSimLinkSrc = cms.InputTag('simSiPixelDigis', 'Pixel'), + pixelSimLinkSrc = 'simSiPixelDigis:Pixel'), ) diff --git a/RecoPixelVertexing/PixelLowPtUtilities/python/MinBiasCkfTrajectoryFilter_cfi.py b/RecoPixelVertexing/PixelLowPtUtilities/python/MinBiasCkfTrajectoryFilter_cfi.py index e452b7cd44a97..53fdfaf69e4ea 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/python/MinBiasCkfTrajectoryFilter_cfi.py +++ b/RecoPixelVertexing/PixelLowPtUtilities/python/MinBiasCkfTrajectoryFilter_cfi.py @@ -2,11 +2,10 @@ # Trajectory filter for min bias import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff -ckfBaseTrajectoryFilterForMinBias = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone() - -ckfBaseTrajectoryFilterForMinBias.minimumNumberOfHits = 3 -ckfBaseTrajectoryFilterForMinBias.minPt = 0.075 - +ckfBaseTrajectoryFilterForMinBias = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone( + minimumNumberOfHits = 3, + minPt = 0.075 +) from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import * from RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeTrajectoryFilter_cfi import * @@ -14,5 +13,5 @@ MinBiasCkfTrajectoryFilter = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CompositeTrajectoryFilter_block.clone( filters = [cms.PSet(refToPSet_ = cms.string('ckfBaseTrajectoryFilterForMinBias')), cms.PSet(refToPSet_ = cms.string('ClusterShapeTrajectoryFilter'))] - ) +) diff --git a/RecoPixelVertexing/PixelTriplets/python/PixelTripletHLTGenerator_cfi.py b/RecoPixelVertexing/PixelTriplets/python/PixelTripletHLTGenerator_cfi.py index e01199d54ab9f..6cae2150b0ed4 100644 --- a/RecoPixelVertexing/PixelTriplets/python/PixelTripletHLTGenerator_cfi.py +++ b/RecoPixelVertexing/PixelTriplets/python/PixelTripletHLTGenerator_cfi.py @@ -19,12 +19,12 @@ # do thy make any difference anywhere? trackingPhase2PU140.toModify(PixelTripletHLTGenerator, - extraHitRPhitolerance = cms.double(0.016), - extraHitRZtolerance = cms.double(0.020) + extraHitRPhitolerance = 0.016, + extraHitRZtolerance = 0.020 ) import RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi -PixelTripletHLTGeneratorWithFilter = PixelTripletHLTGenerator.clone() -PixelTripletHLTGeneratorWithFilter.SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() - +PixelTripletHLTGeneratorWithFilter = PixelTripletHLTGenerator.clone( + SeedComparitorPSet = RecoPixelVertexing.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone() +) From 0f96a9f65f7137bb39bee418398428aae55f6f50 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Wed, 14 Oct 2020 13:09:47 +0200 Subject: [PATCH 558/778] remove some more warnings due to fast simulation era modifiers --- Validation/RecoTrack/python/PostProcessorTracker_cfi.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Validation/RecoTrack/python/PostProcessorTracker_cfi.py b/Validation/RecoTrack/python/PostProcessorTracker_cfi.py index 3049641697866..9f5f0c00f3821 100644 --- a/Validation/RecoTrack/python/PostProcessorTracker_cfi.py +++ b/Validation/RecoTrack/python/PostProcessorTracker_cfi.py @@ -1,5 +1,6 @@ import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDHarvester import DQMEDHarvester +from Configuration.Eras.Modifier_fastSim_cff import fastSim def _addNoFlow(module): _noflowSeen = set() @@ -315,6 +316,9 @@ def _addNoFlow(module): postProcessorTrackSummary ) +fastSim.toModify(postProcessorTrack, subDirs = [e for e in _defaultSubdirs if e not in ["Tracking/TrackGsf/*","Tracking/TrackConversion/*"]]) +fastSim.toModify(postProcessorTrackSummary, subDirs = [e for e in _defaultSubdirs if e not in ["Tracking/TrackGsf/*","Tracking/TrackConversion/*"]]) + ####### # Define a standalone seuquence to support the Standalone harvesting mode # see https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideMultiTrackValidator#cmsDriver_MTV_alone_i_e_standalone for more information @@ -345,10 +349,13 @@ def _addNoFlow(module): postProcessorTrackTrackingOnly = postProcessorTrack.clone() postProcessorTrackTrackingOnly.subDirs.extend(["Tracking/TrackBHadron/*","Tracking/TrackSeeding/*", "Tracking/PixelTrack/*"]) postProcessorTrackSummaryTrackingOnly = postProcessorTrackSummary.clone() -postProcessorTrackSummaryTrackingOnly.subDirs.extend(["Tracking/TrackBHadron/*","Tracking/TrackSeeding", "Tracking/PixelTrack"]) +postProcessorTrackSummaryTrackingOnly.subDirs.extend(["Tracking/TrackBHadron/*","Tracking/TrackSeeding/*", "Tracking/PixelTrack/*"]) postProcessorTrackSequenceTrackingOnly = cms.Sequence( postProcessorTrackTrackingOnly+ postProcessorTrackNrecVsNsim+ postProcessorTrackSummaryTrackingOnly ) + +fastSim.toModify(postProcessorTrackTrackingOnly,subDirs = [e for e in _defaultSubdirs if e not in ["Tracking/TrackGsf/*","Tracking/TrackConversion/*","Tracking/TrackBHadron/*"]]) +fastSim.toModify(postProcessorTrackSummaryTrackingOnly,subDirs = [e for e in _defaultSubdirs if e not in ["Tracking/TrackGsf/*","Tracking/TrackConversion/*","Tracking/TrackBHadron/*"]]) From 1eed6c03821f44e95cf610fa2a3f8f79bcf237cb Mon Sep 17 00:00:00 2001 From: Luiz Mundim <luiz.mundim@cern.ch> Date: Wed, 14 Oct 2020 13:33:26 +0200 Subject: [PATCH 559/778] Fixing the bug fix in Hector --- SimTransport/PPSProtonTransport/src/HectorTransport.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimTransport/PPSProtonTransport/src/HectorTransport.cc b/SimTransport/PPSProtonTransport/src/HectorTransport.cc index 5077c5fbe197f..fd7d41e8adf1d 100644 --- a/SimTransport/PPSProtonTransport/src/HectorTransport.cc +++ b/SimTransport/PPSProtonTransport/src/HectorTransport.cc @@ -155,7 +155,7 @@ bool HectorTransport::transportProton(const HepMC::GenParticle* gpart) { // copy the kinematic changing to CMS ref. frame, only the negative Pz needs to be changed TLorentzVector p_out( - -tan(thx * urad) * partP * cos(theta), tan(thy * urad) * partP * cos(theta), direction*partP * cos(theta), h_p.getE()); + -tan(thx * urad) * partP * cos(theta), tan(thy * urad) * partP * cos(theta), -direction*partP * cos(theta), h_p.getE()); m_beamPart[line] = p_out; m_xAtTrPoint[line] = -x1_ctpps * um_to_mm; // move to CMS ref. frame From 7a351e2ac341f167872eddf99365ea49120076b9 Mon Sep 17 00:00:00 2001 From: Andrzej <novak@physik.rwth-aachen.de> Date: Wed, 14 Oct 2020 13:34:48 +0200 Subject: [PATCH 560/778] fix: adjust jme_nano cff for changes in #31618 --- PhysicsTools/NanoAOD/python/custom_jme_cff.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/custom_jme_cff.py b/PhysicsTools/NanoAOD/python/custom_jme_cff.py index f00cfc3fd275c..1829e4c538466 100644 --- a/PhysicsTools/NanoAOD/python/custom_jme_cff.py +++ b/PhysicsTools/NanoAOD/python/custom_jme_cff.py @@ -19,13 +19,12 @@ import copy bTagCSVV2 = ['pfDeepCSVJetTags:probb','pfDeepCSVJetTags:probbb','pfDeepCSVJetTags:probc'] -bTagCMVAV2 = ['pfCombinedMVAV2BJetTags'] bTagDeepCSV = ['pfCombinedInclusiveSecondaryVertexV2BJetTags'] bTagDeepJet = [ 'pfDeepFlavourJetTags:probb','pfDeepFlavourJetTags:probbb','pfDeepFlavourJetTags:problepb', 'pfDeepFlavourJetTags:probc','pfDeepFlavourJetTags:probuds','pfDeepFlavourJetTags:probg' ] -bTagDiscriminatorsForAK4 = bTagCSVV2+bTagCMVAV2+bTagDeepCSV+bTagDeepJet +bTagDiscriminatorsForAK4 = bTagCSVV2+bTagDeepCSV+bTagDeepJet # # By default, these collections are saved in NanoAODs: @@ -170,14 +169,13 @@ qgl_mult = Var("userInt('qgl_mult')", int,doc="PF candidates multiplicity (Quark vs Gluon likelihood input variable)"), ) BTAGVARS = cms.PSet( - btagCMVA = jetTable.variables.btagCMVA, btagDeepB = jetTable.variables.btagDeepB, btagCSVV2 = jetTable.variables.btagCSVV2, - btagDeepC = jetTable.variables.btagDeepC, + btagDeepCvL = jetTable.variables.btagDeepCvL, ) DEEPJETVARS = cms.PSet( btagDeepFlavB = jetTable.variables.btagDeepFlavB, - btagDeepFlavC = jetTable.variables.btagDeepFlavC, + btagDeepFlavC = Var("bDiscriminator('pfDeepFlavourJetTags:probc')",float,doc="DeepFlavour charm tag raw score",precision=10), btagDeepFlavG = Var("bDiscriminator('pfDeepFlavourJetTags:probg')",float,doc="DeepFlavour gluon tag raw score",precision=10), btagDeepFlavUDS = Var("bDiscriminator('pfDeepFlavourJetTags:probuds')",float,doc="DeepFlavour uds tag raw score",precision=10) ) @@ -361,12 +359,11 @@ def AddBTaggingScores(proc, jetTableName=""): Store b-tagging scores from various algortihm """ - getattr(proc, jetTableName).variables.btagCMVA = jetTable.variables.btagCMVA getattr(proc, jetTableName).variables.btagDeepB = jetTable.variables.btagDeepB getattr(proc, jetTableName).variables.btagCSVV2 = jetTable.variables.btagCSVV2 - getattr(proc, jetTableName).variables.btagDeepC = jetTable.variables.btagDeepC + getattr(proc, jetTableName).variables.btagDeepCvL = jetTable.variables.btagDeepCvL getattr(proc, jetTableName).variables.btagDeepFlavB = jetTable.variables.btagDeepFlavB - getattr(proc, jetTableName).variables.btagDeepFlavC = jetTable.variables.btagDeepFlavC + getattr(proc, jetTableName).variables.btagDeepFlavCvL = jetTable.variables.btagDeepFlavCvL return proc From 4f9c2a00c9a60caa9dcb0dd855257a7dca2f3581 Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Wed, 14 Oct 2020 15:05:36 +0200 Subject: [PATCH 561/778] fixing energy thresholds --- Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc | 2 +- Validation/MtdValidation/plugins/EtlSimHitsValidation.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc index 81f67272aa3aa..867153479ece6 100644 --- a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc @@ -574,7 +574,7 @@ void EtlLocalRecoValidation::fillDescriptions(edm::ConfigurationDescriptions& de desc.add<std::string>("folder", "MTD/ETL/LocalReco"); desc.add<edm::InputTag>("recHitsTag", edm::InputTag("mtdRecHits", "FTLEndcap")); desc.add<edm::InputTag>("recCluTag", edm::InputTag("mtdClusters", "FTLEndcap")); - desc.add<double>("hitMinimumEnergy1Dis", 0.01); // [MeV] + desc.add<double>("hitMinimumEnergy1Dis", 1.); // [MeV] desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV] descriptions.add("etlLocalReco", desc); diff --git a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc index bd31a55ae09ac..cebc15462064c 100644 --- a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc @@ -540,7 +540,7 @@ void EtlSimHitsValidation::fillDescriptions(edm::ConfigurationDescriptions& desc desc.add<std::string>("folder", "MTD/ETL/SimHits"); desc.add<edm::InputTag>("inputTag", edm::InputTag("mix", "g4SimHitsFastTimerHitsEndcap")); - desc.add<double>("hitMinimumEnergy1Dis", 0.01); // [MeV] + desc.add<double>("hitMinimumEnergy1Dis", 0.1); // [MeV] desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV] descriptions.add("etlSimHits", desc); From 3425812ad28bb05d9ad49231d73370b6c18f8cf6 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Wed, 14 Oct 2020 15:05:55 +0200 Subject: [PATCH 562/778] Fix issue at step 2, in TrackerDigiGeometryESModule::produce. Parameters from trackerParameters.xml were not stored properly, resulting in empty vPars vector. This vector is unsafely accessed at step 2 for obtaining BIG_PIX_PER_ROC, etc. Would be nice that every dev is tested before a PR + to not access elements in a vector without checking its size... --- .../src/TrackerGeomBuilderFromGeometricDet.cc | 10 ++++++++-- .../src/TrackerParametersFromDD.cc | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc index 8b75397ba05b3..e630ac1662f1e 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc @@ -43,8 +43,14 @@ namespace { TrackerGeometry* TrackerGeomBuilderFromGeometricDet::build(const GeometricDet* gd, const PTrackerParameters& ptp, const TrackerTopology* tTopo) { - int BIG_PIX_PER_ROC_X = ptp.vpars[2]; - int BIG_PIX_PER_ROC_Y = ptp.vpars[3]; + if (ptp.vpars.size() != 6) { + edm::LogError("TrackerGeomBuilderFromGeometricDet") + << "Tracker parameters block from XMLs called vPars is expected to have 6 entries, but has " + << ptp.vpars.size() << " entries."; + } + + const int BIG_PIX_PER_ROC_X = ptp.vpars.at(2); + const int BIG_PIX_PER_ROC_Y = ptp.vpars.at(3); thePixelDetTypeMap.clear(); theStripDetTypeMap.clear(); diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc b/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc index a404354aede4d..62cb8d45ecc81 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc @@ -39,12 +39,19 @@ bool TrackerParametersFromDD::build(const cms::DDCompactView* cvp, PTrackerParam } } - auto it = vmap.find("vPars"); - if (it != end(vmap)) { - std::vector<int> tmpVec; - for (const auto& i : it->second) - tmpVec.emplace_back(std::round(i)); - ptp.vpars = tmpVec; + // get "vPars" parameter block from XMLs. + const std::string& vPars = "trackerParameters:vPars"; + for (auto const& parameterXMLBlock : vmap) { + const std::string& parameterName = parameterXMLBlock.first; + // Look for vPars parameter XML block. + // Same logic as old DD: it should be found only once. + if (dd4hep::dd::compareEqual(vPars, parameterName)) { + const std::vector<double>& parameterValues = parameterXMLBlock.second; + for (const auto& value : parameterValues) { + ptp.vpars.emplace_back(std::round(value)); + } + break; + } } return true; From 14be00722d12c21b0d96c218ea4fe554d7a43cb7 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Fri, 9 Oct 2020 09:37:26 +0200 Subject: [PATCH 563/778] move from MagneticField_AutoFromDBCurrent_cff to MagneticField_cff in all Tracker DPG-owned configurations --- Alignment/MillePedeAlignmentAlgorithm/test/alignment_cfg.py | 1 - .../MillePedeAlignmentAlgorithm/test/alignment_survey_cfg.py | 1 - Alignment/OfflineValidation/test/PVValidation_T_cfg.py | 2 +- .../OfflineValidation/test/PrimaryVertexResolution_cfg.py | 2 +- .../test/PrimaryVertexResolution_templ_cfg.py | 2 +- Alignment/OfflineValidation/test/inspectData_cfg.py | 2 +- Alignment/OfflineValidation/test/test_all_cfg.py | 2 +- .../SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py | 3 +-- .../test/step3_SiPixelCalZeroBias_RAW2DIGI_RECO_ALCA.py | 2 +- CalibTracker/SiPixelQuality/test/step4_harvest_ALCAHARVEST.py | 2 +- CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py | 2 +- .../test/UsefullCode/MakeMap/MakeMap_Merge_cfg.py | 2 +- .../SiStripChannelGain/test/testSSTGain_HARVEST_FromRECO.py | 2 +- .../test/testSSTGain_MultiRun_ALCAHARVEST.py | 2 +- CalibTracker/SiStripCommon/python/shallowTree_test_template.py | 2 +- CondTools/SiPixel/test/SiPixelGenErrorDBObjectReader_cfg.py | 1 - DPGAnalysis/SiStripTools/test/APVShot_Selector_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/BigEventsDebugger_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/MultiplicityMonitor_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_cfg.py | 2 +- .../test/MultiplicityProducerTest_pixelphase1_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/OccupancyPlotsTest_cfg.py | 2 +- .../SiStripTools/test/apvcyclephaseproducer_test_db_cfg.py | 2 +- .../SiStripTools/test/apvcyclephaseproducer_test_dbfile_cfg.py | 2 +- .../test/apvcyclephaseproducer_test_fakesource_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/apvshotanalyzer_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/detidselectortest_cfg.py | 2 +- .../SiStripTools/test/eventwithhistoryfiltertest_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/manyfederrors_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/overlapproblem_ALCAZmumu_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/overlapproblem_SingleMu_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/overlapproblem_cfg.py | 2 +- .../SiStripTools/test/overlapproblem_pixelphase1_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/seedmultiplicity_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/seedmultiplicity_highmult_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/seedmultiplicity_test_cfg.py | 2 +- DPGAnalysis/SiStripTools/test/trackerdpganalysis_cfg.py | 2 +- .../test/pixel_dqm_sourceclient-file_cfg.py | 2 +- .../python/sipixel_dqm_source_example_cfg.py | 2 +- DQM/SiPixelMonitorDigi/test/sipixel_dqm_source_example_cfg.py | 2 +- .../test/pixelphase1_dqm_sourceclient-live_cfg.py | 2 +- .../pixelphase1_for_timing_scan_dqm_sourceclient-live_cfg.py | 2 +- .../test/finedelayAnalysis_cfg.template | 2 +- .../test/SiStripDQM_RealData_Online_cfg.py | 2 +- DQM/SiStripMonitorClient/test/SiStripDQM_Tier0GlobalRun_cfg.py | 2 +- DQM/SiStripMonitorCluster/test/MonitorCluster_RealData_cfg.py | 2 +- DQM/SiTrackerPhase2/test/DigiTest_Harvest_cfg.py | 2 +- .../test/Tracker_DataMCValidation_Harvest_cfg.py | 2 +- DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_cfg.py | 2 +- EventFilter/SiPixelRawToDigi/test/runRawToClus_cfg.py | 2 +- EventFilter/SiPixelRawToDigi/test/runRawToDigi_cfg.py | 2 +- EventFilter/SiPixelRawToDigi/test/runRawToTracks_cfg.py | 2 +- .../SiStripClusterizer/test/shotTest_withReClustering_cfg.py | 2 +- .../SiStripClusterizer/test/testClusterToDigi_cfg.py | 2 +- Validation/SiTrackerPhase2V/test/DigiTest_Harvest_cfg.py | 2 +- 56 files changed, 53 insertions(+), 57 deletions(-) diff --git a/Alignment/MillePedeAlignmentAlgorithm/test/alignment_cfg.py b/Alignment/MillePedeAlignmentAlgorithm/test/alignment_cfg.py index 6c2640db453d6..44025f23223e5 100644 --- a/Alignment/MillePedeAlignmentAlgorithm/test/alignment_cfg.py +++ b/Alignment/MillePedeAlignmentAlgorithm/test/alignment_cfg.py @@ -36,7 +36,6 @@ # initialize magnetic field -#process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") process.load("Configuration.StandardSequences.MagneticField_cff") #process.load("Configuration.StandardSequences.MagneticField_0T_cff") diff --git a/Alignment/MillePedeAlignmentAlgorithm/test/alignment_survey_cfg.py b/Alignment/MillePedeAlignmentAlgorithm/test/alignment_survey_cfg.py index de64910f656d9..bcad153ee6a8e 100644 --- a/Alignment/MillePedeAlignmentAlgorithm/test/alignment_survey_cfg.py +++ b/Alignment/MillePedeAlignmentAlgorithm/test/alignment_survey_cfg.py @@ -36,7 +36,6 @@ # initialize magnetic field -#process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") process.load("Configuration.StandardSequences.MagneticField_cff") #process.load("Configuration.StandardSequences.MagneticField_0T_cff") diff --git a/Alignment/OfflineValidation/test/PVValidation_T_cfg.py b/Alignment/OfflineValidation/test/PVValidation_T_cfg.py index f3e3a77380d85..ea5551384b46f 100644 --- a/Alignment/OfflineValidation/test/PVValidation_T_cfg.py +++ b/Alignment/OfflineValidation/test/PVValidation_T_cfg.py @@ -85,7 +85,7 @@ def customiseKinksAndBows(process): #################################################################### # Get the Magnetic Field #################################################################### -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') ################################################################### # Standard loads diff --git a/Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py b/Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py index 16c4fda532ff5..85d6d2598e807 100644 --- a/Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py +++ b/Alignment/OfflineValidation/test/PrimaryVertexResolution_cfg.py @@ -68,7 +68,7 @@ def best_match(rcd): process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) ) process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load('Configuration.Geometry.GeometryRecoDB_cff') process.load('Configuration/StandardSequences/Services_cff') diff --git a/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py b/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py index 0afd22e6acc63..ddc27498c6f58 100644 --- a/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py +++ b/Alignment/OfflineValidation/test/PrimaryVertexResolution_templ_cfg.py @@ -74,7 +74,7 @@ def best_match(rcd): process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load('Configuration.Geometry.GeometryRecoDB_cff') process.load('Configuration/StandardSequences/Services_cff') diff --git a/Alignment/OfflineValidation/test/inspectData_cfg.py b/Alignment/OfflineValidation/test/inspectData_cfg.py index ebb15336d3038..9c6fac1ab2a84 100644 --- a/Alignment/OfflineValidation/test/inspectData_cfg.py +++ b/Alignment/OfflineValidation/test/inspectData_cfg.py @@ -51,7 +51,7 @@ process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff") process.load("Configuration.StandardSequences.Services_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') #process.load("Configuration.StandardSequences.MagneticField_0T_cff") process.load("CondCore.CondDB.CondDB_cfi") diff --git a/Alignment/OfflineValidation/test/test_all_cfg.py b/Alignment/OfflineValidation/test/test_all_cfg.py index 798068b33f731..b9578e75f02ed 100644 --- a/Alignment/OfflineValidation/test/test_all_cfg.py +++ b/Alignment/OfflineValidation/test/test_all_cfg.py @@ -68,7 +68,7 @@ class RefitType(Enum): #################################################################### # Get the Magnetic Field #################################################################### -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') ################################################################### # Standard loads diff --git a/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py b/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py index e5ca30949c18e..16e32ca352e1a 100644 --- a/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py +++ b/CalibTracker/SiPixelLorentzAngle/test/SiPixelLorentzAngle_cfg.py @@ -7,8 +7,7 @@ #process.load("Configuration.StandardSequences.Geometry_cff") process.load('Configuration/StandardSequences/GeometryExtended_cff') -#process.load("Configuration.StandardSequences.MagneticField_cff") -process.load('Configuration/StandardSequences/MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') # process.load("Configuration.StandardSequences.FakeConditions_cff") diff --git a/CalibTracker/SiPixelQuality/test/step3_SiPixelCalZeroBias_RAW2DIGI_RECO_ALCA.py b/CalibTracker/SiPixelQuality/test/step3_SiPixelCalZeroBias_RAW2DIGI_RECO_ALCA.py index 78a910f6eac9e..b582940534be1 100644 --- a/CalibTracker/SiPixelQuality/test/step3_SiPixelCalZeroBias_RAW2DIGI_RECO_ALCA.py +++ b/CalibTracker/SiPixelQuality/test/step3_SiPixelCalZeroBias_RAW2DIGI_RECO_ALCA.py @@ -14,7 +14,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.RawToDigi_Data_cff') process.load('Configuration.StandardSequences.Reconstruction_Data_cff') process.load('Configuration.StandardSequences.AlCaRecoStreams_cff') diff --git a/CalibTracker/SiPixelQuality/test/step4_harvest_ALCAHARVEST.py b/CalibTracker/SiPixelQuality/test/step4_harvest_ALCAHARVEST.py index 7b8b21a77846f..d963b94b50d79 100644 --- a/CalibTracker/SiPixelQuality/test/step4_harvest_ALCAHARVEST.py +++ b/CalibTracker/SiPixelQuality/test/step4_harvest_ALCAHARVEST.py @@ -15,7 +15,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.AlCaHarvesting_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') diff --git a/CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py b/CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py index 9b001ed8610d9..d67f208006f2d 100644 --- a/CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py +++ b/CalibTracker/SiStripChannelGain/test/SSTGain_PCL_Config_cfg.py @@ -3,7 +3,7 @@ process = cms.Process("APVGAIN") process.load('Configuration.StandardSequences.Geometry_cff') -process.load('Configuration/StandardSequences/MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi") process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") diff --git a/CalibTracker/SiStripChannelGain/test/UsefullCode/MakeMap/MakeMap_Merge_cfg.py b/CalibTracker/SiStripChannelGain/test/UsefullCode/MakeMap/MakeMap_Merge_cfg.py index ffd8314a6eeb3..2d1e2377ab8ec 100644 --- a/CalibTracker/SiStripChannelGain/test/UsefullCode/MakeMap/MakeMap_Merge_cfg.py +++ b/CalibTracker/SiStripChannelGain/test/UsefullCode/MakeMap/MakeMap_Merge_cfg.py @@ -11,7 +11,7 @@ #process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") #process.GlobalTag.globaltag = 'GR09_R_35X_V2::All' -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration/StandardSequences/GeometryExtended_cff') process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi") diff --git a/CalibTracker/SiStripChannelGain/test/testSSTGain_HARVEST_FromRECO.py b/CalibTracker/SiStripChannelGain/test/testSSTGain_HARVEST_FromRECO.py index 68cf1572c925e..af541d297910b 100644 --- a/CalibTracker/SiStripChannelGain/test/testSSTGain_HARVEST_FromRECO.py +++ b/CalibTracker/SiStripChannelGain/test/testSSTGain_HARVEST_FromRECO.py @@ -13,7 +13,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.AlCaHarvesting_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') diff --git a/CalibTracker/SiStripChannelGain/test/testSSTGain_MultiRun_ALCAHARVEST.py b/CalibTracker/SiStripChannelGain/test/testSSTGain_MultiRun_ALCAHARVEST.py index acdbd3fc09dd7..2a5872ab148ed 100644 --- a/CalibTracker/SiStripChannelGain/test/testSSTGain_MultiRun_ALCAHARVEST.py +++ b/CalibTracker/SiStripChannelGain/test/testSSTGain_MultiRun_ALCAHARVEST.py @@ -32,7 +32,7 @@ process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.AlCaHarvesting_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') diff --git a/CalibTracker/SiStripCommon/python/shallowTree_test_template.py b/CalibTracker/SiStripCommon/python/shallowTree_test_template.py index 1f91b30723828..73eddf77b47cf 100644 --- a/CalibTracker/SiStripCommon/python/shallowTree_test_template.py +++ b/CalibTracker/SiStripCommon/python/shallowTree_test_template.py @@ -39,7 +39,7 @@ def add_rawRelVals(process): return process process = cms.Process('JustATest') -process.load('Configuration/StandardSequences/MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Configuration.Geometry.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag diff --git a/CondTools/SiPixel/test/SiPixelGenErrorDBObjectReader_cfg.py b/CondTools/SiPixel/test/SiPixelGenErrorDBObjectReader_cfg.py index 8fbbbe7752783..be8537d8ad129 100644 --- a/CondTools/SiPixel/test/SiPixelGenErrorDBObjectReader_cfg.py +++ b/CondTools/SiPixel/test/SiPixelGenErrorDBObjectReader_cfg.py @@ -5,7 +5,6 @@ process.load("CondCore.DBCommon.CondDBSetup_cfi") process.load("FWCore.MessageService.MessageLogger_cfi") process.load("Configuration.StandardSequences.MagneticField_cff") -# process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") # process.load("Configuration.StandardSequences.MagneticField_38T_cff") process.source = cms.Source("EmptySource") diff --git a/DPGAnalysis/SiStripTools/test/APVShot_Selector_cfg.py b/DPGAnalysis/SiStripTools/test/APVShot_Selector_cfg.py index cd973678b4302..374b24b5443c5 100644 --- a/DPGAnalysis/SiStripTools/test/APVShot_Selector_cfg.py +++ b/DPGAnalysis/SiStripTools/test/APVShot_Selector_cfg.py @@ -47,7 +47,7 @@ #-------------------------------------- process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.Reconstruction_Data_cff") process.load('Configuration.StandardSequences.L1Reco_cff') diff --git a/DPGAnalysis/SiStripTools/test/BigEventsDebugger_cfg.py b/DPGAnalysis/SiStripTools/test/BigEventsDebugger_cfg.py index 2fee83c465c25..5d456624591cb 100644 --- a/DPGAnalysis/SiStripTools/test/BigEventsDebugger_cfg.py +++ b/DPGAnalysis/SiStripTools/test/BigEventsDebugger_cfg.py @@ -71,7 +71,7 @@ #-------------------------------------- process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/MultiplicityMonitor_cfg.py b/DPGAnalysis/SiStripTools/test/MultiplicityMonitor_cfg.py index a12acde44f512..620fbff3f47be 100644 --- a/DPGAnalysis/SiStripTools/test/MultiplicityMonitor_cfg.py +++ b/DPGAnalysis/SiStripTools/test/MultiplicityMonitor_cfg.py @@ -68,7 +68,7 @@ if options.fromRAW == 1: process.load("Configuration.StandardSequences.RawToDigi_Data_cff") - process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") + process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") process.load("Configuration.StandardSequences.L1Reco_cff") diff --git a/DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_cfg.py b/DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_cfg.py index 3fce6d6a6e28b..901352a89f2ae 100644 --- a/DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_cfg.py +++ b/DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_cfg.py @@ -86,7 +86,7 @@ if options.fromRAW == 1: process.load("Configuration.StandardSequences.RawToDigi_Data_cff") - process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") + process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") process.load("Configuration.StandardSequences.L1Reco_cff") diff --git a/DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_pixelphase1_cfg.py b/DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_pixelphase1_cfg.py index c9fef01538e2b..2d44208c5e09f 100644 --- a/DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_pixelphase1_cfg.py +++ b/DPGAnalysis/SiStripTools/test/MultiplicityProducerTest_pixelphase1_cfg.py @@ -86,7 +86,7 @@ if options.fromRAW == 1: process.load("Configuration.StandardSequences.RawToDigi_Data_cff") - process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") + process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") process.load("Configuration.StandardSequences.L1Reco_cff") diff --git a/DPGAnalysis/SiStripTools/test/OccupancyPlotsTest_cfg.py b/DPGAnalysis/SiStripTools/test/OccupancyPlotsTest_cfg.py index 68927b781fc49..48adf59ca5172 100644 --- a/DPGAnalysis/SiStripTools/test/OccupancyPlotsTest_cfg.py +++ b/DPGAnalysis/SiStripTools/test/OccupancyPlotsTest_cfg.py @@ -139,7 +139,7 @@ #-------------------------------------- process.load('Configuration.Geometry.GeometryExtended2015Reco_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Configuration.StandardSequences.Reconstruction_cff") process.seqRECO = cms.Sequence() diff --git a/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_db_cfg.py b/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_db_cfg.py index 1dc0a119788ea..ec4ca3c176161 100644 --- a/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_db_cfg.py +++ b/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_db_cfg.py @@ -66,7 +66,7 @@ #------------------------------------------------------------------------- process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_dbfile_cfg.py b/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_dbfile_cfg.py index 55f221342305c..c0ef6e2f61aa0 100644 --- a/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_dbfile_cfg.py +++ b/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_dbfile_cfg.py @@ -59,7 +59,7 @@ #------------------------------------------------------------------------- process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_fakesource_cfg.py b/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_fakesource_cfg.py index ab54376930906..df217cf45dc48 100644 --- a/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_fakesource_cfg.py +++ b/DPGAnalysis/SiStripTools/test/apvcyclephaseproducer_test_fakesource_cfg.py @@ -37,7 +37,7 @@ #------------------------------------------------------------------------- process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/apvshotanalyzer_cfg.py b/DPGAnalysis/SiStripTools/test/apvshotanalyzer_cfg.py index 1c874ac23d1c9..45fa482f3db0f 100644 --- a/DPGAnalysis/SiStripTools/test/apvshotanalyzer_cfg.py +++ b/DPGAnalysis/SiStripTools/test/apvshotanalyzer_cfg.py @@ -55,7 +55,7 @@ #-------------------------------------- process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py b/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py index 13e56100a3462..ae6fe2e52336a 100644 --- a/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py +++ b/DPGAnalysis/SiStripTools/test/commonmodeanalyzer_cfg.py @@ -55,7 +55,7 @@ #-------------------------------------- process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/detidselectortest_cfg.py b/DPGAnalysis/SiStripTools/test/detidselectortest_cfg.py index cacfd3cb1617e..45e6c0a2a27bb 100644 --- a/DPGAnalysis/SiStripTools/test/detidselectortest_cfg.py +++ b/DPGAnalysis/SiStripTools/test/detidselectortest_cfg.py @@ -20,7 +20,7 @@ numberEventsInRun = cms.untracked.uint32(1) ) -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/eventwithhistoryfiltertest_cfg.py b/DPGAnalysis/SiStripTools/test/eventwithhistoryfiltertest_cfg.py index 98d59ce97eab7..f6da7a1f065c7 100644 --- a/DPGAnalysis/SiStripTools/test/eventwithhistoryfiltertest_cfg.py +++ b/DPGAnalysis/SiStripTools/test/eventwithhistoryfiltertest_cfg.py @@ -75,7 +75,7 @@ process.source.fileNames = cms.untracked.vstring(options.inputFiles) process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/manyfederrors_cfg.py b/DPGAnalysis/SiStripTools/test/manyfederrors_cfg.py index 52be321e92ca6..73de7d5586bc5 100644 --- a/DPGAnalysis/SiStripTools/test/manyfederrors_cfg.py +++ b/DPGAnalysis/SiStripTools/test/manyfederrors_cfg.py @@ -55,7 +55,7 @@ #-------------------------------------- process.load("Configuration.StandardSequences.RawToDigi_Data_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/overlapproblem_ALCAZmumu_cfg.py b/DPGAnalysis/SiStripTools/test/overlapproblem_ALCAZmumu_cfg.py index dc833a633164c..f6cf58f4f8f3c 100644 --- a/DPGAnalysis/SiStripTools/test/overlapproblem_ALCAZmumu_cfg.py +++ b/DPGAnalysis/SiStripTools/test/overlapproblem_ALCAZmumu_cfg.py @@ -32,7 +32,7 @@ # "rfio:/castor/cern.ch/user/v/venturia/SingleMuPt15_tec5_GEN_SIM_RECODEBUG_1500um.root") "rfio:/castor/cern.ch/cms/store/mc/Fall10/DYToMuMu_M-20_TuneZ2_7TeV-pythia6/ALCARECO/START38_V12_TkAlZMuMu-v1/0001/86BB9127-E5D9-DF11-A995-00215E2222E0.root") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("SimTracker.TrackAssociatorProducers.trackAssociatorByHits_cfi") diff --git a/DPGAnalysis/SiStripTools/test/overlapproblem_SingleMu_cfg.py b/DPGAnalysis/SiStripTools/test/overlapproblem_SingleMu_cfg.py index 3dd26e32efcaa..9d6513a1d9881 100644 --- a/DPGAnalysis/SiStripTools/test/overlapproblem_SingleMu_cfg.py +++ b/DPGAnalysis/SiStripTools/test/overlapproblem_SingleMu_cfg.py @@ -31,7 +31,7 @@ "rfio:/castor/cern.ch/user/v/venturia/SingleMuPt15_tec5_GEN_SIM_RECODEBUG_default.root") # "rfio:/castor/cern.ch/user/v/venturia/SingleMuPt15_tec5_GEN_SIM_RECODEBUG_1500um.root") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("SimTracker.TrackAssociatorProducers.trackAssociatorByHits_cfi") diff --git a/DPGAnalysis/SiStripTools/test/overlapproblem_cfg.py b/DPGAnalysis/SiStripTools/test/overlapproblem_cfg.py index 459bad36ad017..652d21fa73274 100644 --- a/DPGAnalysis/SiStripTools/test/overlapproblem_cfg.py +++ b/DPGAnalysis/SiStripTools/test/overlapproblem_cfg.py @@ -31,7 +31,7 @@ inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*") ) -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("SimTracker.TrackAssociatorProducers.trackAssociatorByHits_cfi") diff --git a/DPGAnalysis/SiStripTools/test/overlapproblem_pixelphase1_cfg.py b/DPGAnalysis/SiStripTools/test/overlapproblem_pixelphase1_cfg.py index 21a2574654302..ec30da5f5da48 100644 --- a/DPGAnalysis/SiStripTools/test/overlapproblem_pixelphase1_cfg.py +++ b/DPGAnalysis/SiStripTools/test/overlapproblem_pixelphase1_cfg.py @@ -31,7 +31,7 @@ inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*") ) -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") #process.load("Configuration.StandardSequences.GeometryDB_cff") process.load("Configuration.Geometry.GeometryExtended2017Reco_cff") #process.load("Configuration.Geometry.GeometryExtendedPhaseIPixelReco_cff") diff --git a/DPGAnalysis/SiStripTools/test/seedmultiplicity_cfg.py b/DPGAnalysis/SiStripTools/test/seedmultiplicity_cfg.py index 27b72b67cdb49..11ed01ba01524 100644 --- a/DPGAnalysis/SiStripTools/test/seedmultiplicity_cfg.py +++ b/DPGAnalysis/SiStripTools/test/seedmultiplicity_cfg.py @@ -71,7 +71,7 @@ ) -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/seedmultiplicity_highmult_cfg.py b/DPGAnalysis/SiStripTools/test/seedmultiplicity_highmult_cfg.py index 0d54a6195a4a4..1b8f04d45d6a4 100644 --- a/DPGAnalysis/SiStripTools/test/seedmultiplicity_highmult_cfg.py +++ b/DPGAnalysis/SiStripTools/test/seedmultiplicity_highmult_cfg.py @@ -71,7 +71,7 @@ ) -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/seedmultiplicity_test_cfg.py b/DPGAnalysis/SiStripTools/test/seedmultiplicity_test_cfg.py index d14bf0a308de8..16500382bbdc4 100644 --- a/DPGAnalysis/SiStripTools/test/seedmultiplicity_test_cfg.py +++ b/DPGAnalysis/SiStripTools/test/seedmultiplicity_test_cfg.py @@ -72,7 +72,7 @@ ) -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration.StandardSequences.Reconstruction_cff") diff --git a/DPGAnalysis/SiStripTools/test/trackerdpganalysis_cfg.py b/DPGAnalysis/SiStripTools/test/trackerdpganalysis_cfg.py index 19d3470435906..2edf93949b052 100644 --- a/DPGAnalysis/SiStripTools/test/trackerdpganalysis_cfg.py +++ b/DPGAnalysis/SiStripTools/test/trackerdpganalysis_cfg.py @@ -259,7 +259,7 @@ #Geometry and field process.load("Configuration.StandardSequences.GeometryRecoDB_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Geometry.CommonTopologies.globalTrackingGeometry_cfi") process.load("TrackingTools.RecoGeometry.RecoGeometries_cff") diff --git a/DQM/SiPixelMonitorClient/test/pixel_dqm_sourceclient-file_cfg.py b/DQM/SiPixelMonitorClient/test/pixel_dqm_sourceclient-file_cfg.py index 23d49e5363da7..62425d368a371 100644 --- a/DQM/SiPixelMonitorClient/test/pixel_dqm_sourceclient-file_cfg.py +++ b/DQM/SiPixelMonitorClient/test/pixel_dqm_sourceclient-file_cfg.py @@ -4,7 +4,7 @@ ##----## Geometry and other global parameters: process.load("Configuration.StandardSequences.GeometryRecoDB_cff") -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') ###process.load("DQM.Integration.test.FrontierCondition_GT_cfi") ##----## Reco: diff --git a/DQM/SiPixelMonitorDigi/python/sipixel_dqm_source_example_cfg.py b/DQM/SiPixelMonitorDigi/python/sipixel_dqm_source_example_cfg.py index 2db6074dd59f8..f4283eb504111 100644 --- a/DQM/SiPixelMonitorDigi/python/sipixel_dqm_source_example_cfg.py +++ b/DQM/SiPixelMonitorDigi/python/sipixel_dqm_source_example_cfg.py @@ -2,7 +2,7 @@ process = cms.Process("SiPixelMonitorDigiProcess") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("DQMServices.Core.DQM_cfg") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") diff --git a/DQM/SiPixelMonitorDigi/test/sipixel_dqm_source_example_cfg.py b/DQM/SiPixelMonitorDigi/test/sipixel_dqm_source_example_cfg.py index 2b168134849a8..17bd5ebd1b247 100644 --- a/DQM/SiPixelMonitorDigi/test/sipixel_dqm_source_example_cfg.py +++ b/DQM/SiPixelMonitorDigi/test/sipixel_dqm_source_example_cfg.py @@ -3,7 +3,7 @@ process = cms.Process("SiPixelMonitorDigiProcess") ##----## Geometry and other global parameters: process.load("Configuration.StandardSequences.GeometryRecoDB_cff") -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("DQM.SiPixelMonitorDigi.SiPixelMonitorDigi_cfi") process.load("DQMServices.Core.DQM_cfg") process.load("EventFilter.SiPixelRawToDigi.SiPixelRawToDigi_cfi") diff --git a/DQM/SiPixelPhase1Config/test/pixelphase1_dqm_sourceclient-live_cfg.py b/DQM/SiPixelPhase1Config/test/pixelphase1_dqm_sourceclient-live_cfg.py index 54f6fb6859059..8a3232a8e0757 100644 --- a/DQM/SiPixelPhase1Config/test/pixelphase1_dqm_sourceclient-live_cfg.py +++ b/DQM/SiPixelPhase1Config/test/pixelphase1_dqm_sourceclient-live_cfg.py @@ -94,7 +94,7 @@ # Magnetic Field #----------------------------- # 3.8T field -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') #------------------------------------------------- # GEOMETRY diff --git a/DQM/SiPixelPhase1Config/test/pixelphase1_for_timing_scan_dqm_sourceclient-live_cfg.py b/DQM/SiPixelPhase1Config/test/pixelphase1_for_timing_scan_dqm_sourceclient-live_cfg.py index a20ee053c7a6c..7f9a650a90cad 100644 --- a/DQM/SiPixelPhase1Config/test/pixelphase1_for_timing_scan_dqm_sourceclient-live_cfg.py +++ b/DQM/SiPixelPhase1Config/test/pixelphase1_for_timing_scan_dqm_sourceclient-live_cfg.py @@ -94,7 +94,7 @@ # Magnetic Field #----------------------------- # 3.8T field -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') #------------------------------------------------- # GEOMETRY diff --git a/DQM/SiStripCommissioningAnalysis/test/finedelayAnalysis_cfg.template b/DQM/SiStripCommissioningAnalysis/test/finedelayAnalysis_cfg.template index f87c5a983657b..b5ffa2ffdd280 100644 --- a/DQM/SiStripCommissioningAnalysis/test/finedelayAnalysis_cfg.template +++ b/DQM/SiStripCommissioningAnalysis/test/finedelayAnalysis_cfg.template @@ -22,7 +22,7 @@ process.source = cms.Source("PoolSource", #----------------------------- # Magnetic Field #----------------------------- -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') #------------------------------------------------- # GEOMETRY diff --git a/DQM/SiStripMonitorClient/test/SiStripDQM_RealData_Online_cfg.py b/DQM/SiStripMonitorClient/test/SiStripDQM_RealData_Online_cfg.py index ef3746cd5ea63..4185948ae5082 100644 --- a/DQM/SiStripMonitorClient/test/SiStripDQM_RealData_Online_cfg.py +++ b/DQM/SiStripMonitorClient/test/SiStripDQM_RealData_Online_cfg.py @@ -29,7 +29,7 @@ #process.load("Configuration.StandardSequences.MagneticField_0T_cff") # 3.8T field #process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff") +process.load("Configuration.StandardSequences.MagneticField_cff") #process.prefer("VolumeBasedMagneticFieldESProducer") #------------------------------------------------- diff --git a/DQM/SiStripMonitorClient/test/SiStripDQM_Tier0GlobalRun_cfg.py b/DQM/SiStripMonitorClient/test/SiStripDQM_Tier0GlobalRun_cfg.py index 0af6ee18a1a6a..553b8ccdd8df1 100644 --- a/DQM/SiStripMonitorClient/test/SiStripDQM_Tier0GlobalRun_cfg.py +++ b/DQM/SiStripMonitorClient/test/SiStripDQM_Tier0GlobalRun_cfg.py @@ -46,7 +46,7 @@ # Magnetic Field #----------------------------- -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') #------------------------------------------------- # GEOMETRY diff --git a/DQM/SiStripMonitorCluster/test/MonitorCluster_RealData_cfg.py b/DQM/SiStripMonitorCluster/test/MonitorCluster_RealData_cfg.py index 1426a937c77a1..38f555db64b02 100644 --- a/DQM/SiStripMonitorCluster/test/MonitorCluster_RealData_cfg.py +++ b/DQM/SiStripMonitorCluster/test/MonitorCluster_RealData_cfg.py @@ -30,7 +30,7 @@ #----------------------------- # Magnetic Field #----------------------------- -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') #------------------------------------------------- # Geometry diff --git a/DQM/SiTrackerPhase2/test/DigiTest_Harvest_cfg.py b/DQM/SiTrackerPhase2/test/DigiTest_Harvest_cfg.py index 0f82305ab3002..97517b067396a 100644 --- a/DQM/SiTrackerPhase2/test/DigiTest_Harvest_cfg.py +++ b/DQM/SiTrackerPhase2/test/DigiTest_Harvest_cfg.py @@ -8,7 +8,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.EDMtoMEAtRunEnd_cff') process.load('Configuration.StandardSequences.Harvesting_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') diff --git a/DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_Harvest_cfg.py b/DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_Harvest_cfg.py index 991311634cd00..6c3516199b7ba 100644 --- a/DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_Harvest_cfg.py +++ b/DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_Harvest_cfg.py @@ -13,7 +13,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.EDMtoMEAtRunEnd_cff') process.load('Configuration.StandardSequences.Harvesting_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') diff --git a/DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_cfg.py b/DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_cfg.py index 520b417f18b91..235db46ee7693 100644 --- a/DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_cfg.py +++ b/DQM/TrackingMonitorSource/test/Tracker_DataMCValidation_cfg.py @@ -13,7 +13,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('DQMOffline.Configuration.DQMOffline_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') diff --git a/EventFilter/SiPixelRawToDigi/test/runRawToClus_cfg.py b/EventFilter/SiPixelRawToDigi/test/runRawToClus_cfg.py index 0e7cbbbbebfb4..ede1639c32115 100644 --- a/EventFilter/SiPixelRawToDigi/test/runRawToClus_cfg.py +++ b/EventFilter/SiPixelRawToDigi/test/runRawToClus_cfg.py @@ -5,7 +5,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.load('Configuration.StandardSequences.GeometryRecoDB_cff') #process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.load("Configuration.StandardSequences.Services_cff") process.load('Configuration.EventContent.EventContent_cff') diff --git a/EventFilter/SiPixelRawToDigi/test/runRawToDigi_cfg.py b/EventFilter/SiPixelRawToDigi/test/runRawToDigi_cfg.py index 3b45466db64e9..1c2f77808aaa6 100644 --- a/EventFilter/SiPixelRawToDigi/test/runRawToDigi_cfg.py +++ b/EventFilter/SiPixelRawToDigi/test/runRawToDigi_cfg.py @@ -5,7 +5,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.load('Configuration.StandardSequences.GeometryRecoDB_cff') #process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.load("Configuration.StandardSequences.Services_cff") diff --git a/EventFilter/SiPixelRawToDigi/test/runRawToTracks_cfg.py b/EventFilter/SiPixelRawToDigi/test/runRawToTracks_cfg.py index 1caff19b7ad2a..affddf2c25d11 100644 --- a/EventFilter/SiPixelRawToDigi/test/runRawToTracks_cfg.py +++ b/EventFilter/SiPixelRawToDigi/test/runRawToTracks_cfg.py @@ -5,7 +5,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.load('Configuration.StandardSequences.GeometryRecoDB_cff') #process.load("Configuration.StandardSequences.MagneticField_38T_cff") -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.load("Configuration.StandardSequences.Services_cff") process.load('Configuration.EventContent.EventContent_cff') diff --git a/RecoLocalTracker/SiStripClusterizer/test/shotTest_withReClustering_cfg.py b/RecoLocalTracker/SiStripClusterizer/test/shotTest_withReClustering_cfg.py index 875b4f4cb7b47..4f3455655a44c 100644 --- a/RecoLocalTracker/SiStripClusterizer/test/shotTest_withReClustering_cfg.py +++ b/RecoLocalTracker/SiStripClusterizer/test/shotTest_withReClustering_cfg.py @@ -26,7 +26,7 @@ #------------------------------------------ process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.load("Configuration.StandardSequences.RawToDigi_Data_cff") diff --git a/RecoLocalTracker/SiStripClusterizer/test/testClusterToDigi_cfg.py b/RecoLocalTracker/SiStripClusterizer/test/testClusterToDigi_cfg.py index a68ef0bc69f75..4ba655b703c03 100644 --- a/RecoLocalTracker/SiStripClusterizer/test/testClusterToDigi_cfg.py +++ b/RecoLocalTracker/SiStripClusterizer/test/testClusterToDigi_cfg.py @@ -20,7 +20,7 @@ #------------------------------------------ process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.load("Configuration.StandardSequences.RawToDigi_Data_cff") diff --git a/Validation/SiTrackerPhase2V/test/DigiTest_Harvest_cfg.py b/Validation/SiTrackerPhase2V/test/DigiTest_Harvest_cfg.py index 0f82305ab3002..97517b067396a 100644 --- a/Validation/SiTrackerPhase2V/test/DigiTest_Harvest_cfg.py +++ b/Validation/SiTrackerPhase2V/test/DigiTest_Harvest_cfg.py @@ -8,7 +8,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.EDMtoMEAtRunEnd_cff') process.load('Configuration.StandardSequences.Harvesting_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') From 155e13c0e5df135c760f43823bfb9b35eba04598 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Wed, 14 Oct 2020 15:08:49 +0200 Subject: [PATCH 564/778] scram b code-format --- .../src/TrackerGeomBuilderFromGeometricDet.cc | 4 ++-- .../TrackerGeometryBuilder/src/TrackerParametersFromDD.cc | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc index e630ac1662f1e..c1fba9f883950 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc @@ -45,8 +45,8 @@ TrackerGeometry* TrackerGeomBuilderFromGeometricDet::build(const GeometricDet* g const TrackerTopology* tTopo) { if (ptp.vpars.size() != 6) { edm::LogError("TrackerGeomBuilderFromGeometricDet") - << "Tracker parameters block from XMLs called vPars is expected to have 6 entries, but has " - << ptp.vpars.size() << " entries."; + << "Tracker parameters block from XMLs called vPars is expected to have 6 entries, but has " << ptp.vpars.size() + << " entrie(s)."; } const int BIG_PIX_PER_ROC_X = ptp.vpars.at(2); diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc b/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc index 62cb8d45ecc81..6f9e66bb91c35 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerParametersFromDD.cc @@ -44,13 +44,12 @@ bool TrackerParametersFromDD::build(const cms::DDCompactView* cvp, PTrackerParam for (auto const& parameterXMLBlock : vmap) { const std::string& parameterName = parameterXMLBlock.first; // Look for vPars parameter XML block. - // Same logic as old DD: it should be found only once. if (dd4hep::dd::compareEqual(vPars, parameterName)) { const std::vector<double>& parameterValues = parameterXMLBlock.second; for (const auto& value : parameterValues) { - ptp.vpars.emplace_back(std::round(value)); + ptp.vpars.emplace_back(std::round(value)); } - break; + break; // Same logic as old DD: it should be found only once. } } From eb6dd4c1fde4c96eec8cf77efb5d598c620622b7 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Wed, 14 Oct 2020 15:09:45 +0200 Subject: [PATCH 565/778] address comment during review: actually increase the list of subDirs to be used for postProcessorTrackStandalone* --- Validation/RecoTrack/python/PostProcessorTracker_cfi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Validation/RecoTrack/python/PostProcessorTracker_cfi.py b/Validation/RecoTrack/python/PostProcessorTracker_cfi.py index 9f5f0c00f3821..965b67abd168a 100644 --- a/Validation/RecoTrack/python/PostProcessorTracker_cfi.py +++ b/Validation/RecoTrack/python/PostProcessorTracker_cfi.py @@ -325,10 +325,10 @@ def _addNoFlow(module): ######## postProcessorTrackStandalone = postProcessorTrack.clone( - subDirs = _defaultSubdirs.append("Tracking/TrackBHadron/*"), + subDirs = _defaultSubdirs+["Tracking/TrackBHadron/*"] ) postProcessorTrackSummaryStandalone = postProcessorTrackSummary.clone( - subDirs = _defaultSubdirs.append("Tracking/TrackBHadron/*"), + subDirs = _defaultSubdirs+["Tracking/TrackBHadron/*"] ) postProcessorTrackSequenceStandalone = cms.Sequence( From ecf9430c69a862732714a5b195dc4dc74379f1fc Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Wed, 14 Oct 2020 15:20:47 +0200 Subject: [PATCH 566/778] code-checks and code-format updates --- Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc | 2 +- Validation/MtdValidation/plugins/EtlSimHitsValidation.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc index 867153479ece6..5e2010f3cd1f7 100644 --- a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc @@ -574,7 +574,7 @@ void EtlLocalRecoValidation::fillDescriptions(edm::ConfigurationDescriptions& de desc.add<std::string>("folder", "MTD/ETL/LocalReco"); desc.add<edm::InputTag>("recHitsTag", edm::InputTag("mtdRecHits", "FTLEndcap")); desc.add<edm::InputTag>("recCluTag", edm::InputTag("mtdClusters", "FTLEndcap")); - desc.add<double>("hitMinimumEnergy1Dis", 1.); // [MeV] + desc.add<double>("hitMinimumEnergy1Dis", 1.); // [MeV] desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV] descriptions.add("etlLocalReco", desc); diff --git a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc index cebc15462064c..fb78f23cd2fb5 100644 --- a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc @@ -540,7 +540,7 @@ void EtlSimHitsValidation::fillDescriptions(edm::ConfigurationDescriptions& desc desc.add<std::string>("folder", "MTD/ETL/SimHits"); desc.add<edm::InputTag>("inputTag", edm::InputTag("mix", "g4SimHitsFastTimerHitsEndcap")); - desc.add<double>("hitMinimumEnergy1Dis", 0.1); // [MeV] + desc.add<double>("hitMinimumEnergy1Dis", 0.1); // [MeV] desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV] descriptions.add("etlSimHits", desc); From 59e3e8fa3a9c4dc665c6b375ff501f23b50799cf Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Wed, 14 Oct 2020 16:20:41 +0200 Subject: [PATCH 567/778] Some cleanup in DataFormat/MuonReco/Muon --- DataFormats/MuonReco/interface/Muon.h | 9 +- DataFormats/MuonReco/src/Muon.cc | 310 +++++++++++--------------- 2 files changed, 132 insertions(+), 187 deletions(-) diff --git a/DataFormats/MuonReco/interface/Muon.h b/DataFormats/MuonReco/interface/Muon.h index 71900df91bc07..77f7ea29697c2 100644 --- a/DataFormats/MuonReco/interface/Muon.h +++ b/DataFormats/MuonReco/interface/Muon.h @@ -419,13 +419,10 @@ namespace reco { float t0(int n = 0) { int i = 0; - for (std::vector<MuonChamberMatch>::const_iterator chamber = muMatches_.begin(); chamber != muMatches_.end(); - ++chamber) - for (std::vector<reco::MuonSegmentMatch>::const_iterator segment = chamber->segmentMatches.begin(); - segment != chamber->segmentMatches.end(); - ++segment) { + for (auto& chamber : muMatches_) + for (auto& segment : chamber.segmentMatches) { if (i == n) - return segment->t0; + return segment.t0; ++i; } return 0; diff --git a/DataFormats/MuonReco/src/Muon.cc b/DataFormats/MuonReco/src/Muon.cc index cc5f14776c6d3..a9749572d6c47 100644 --- a/DataFormats/MuonReco/src/Muon.cc +++ b/DataFormats/MuonReco/src/Muon.cc @@ -54,53 +54,49 @@ int Muon::numberOfChambersCSCorDT() const { int Muon::numberOfMatches(ArbitrationType type) const { int matches(0); - for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin(); - chamberMatch != muMatches_.end(); - chamberMatch++) { + for (auto& chamberMatch : muMatches_) { if (type == RPCHitAndTrackArbitration) { - if (chamberMatch->rpcMatches.empty()) + if (chamberMatch.rpcMatches.empty()) continue; - matches += chamberMatch->rpcMatches.size(); + matches += chamberMatch.rpcMatches.size(); continue; } if (type == ME0SegmentAndTrackArbitration) { - if (chamberMatch->me0Matches.empty()) + if (chamberMatch.me0Matches.empty()) continue; - matches += chamberMatch->me0Matches.size(); + matches += chamberMatch.me0Matches.size(); continue; } if (type == GEMSegmentAndTrackArbitration) { - if (chamberMatch->gemMatches.empty()) + if (chamberMatch.gemMatches.empty()) continue; - matches += chamberMatch->gemMatches.size(); + matches += chamberMatch.gemMatches.size(); continue; } - if (chamberMatch->segmentMatches.empty()) + if (chamberMatch.segmentMatches.empty()) continue; if (type == NoArbitration) { matches++; continue; } - for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin(); - segmentMatch != chamberMatch->segmentMatches.end(); - segmentMatch++) { + for (auto& segmentMatch : chamberMatch.segmentMatches) { if (type == SegmentArbitration) - if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) { + if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR)) { matches++; break; } if (type == SegmentAndTrackArbitration) - if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) { + if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) { matches++; break; } if (type == SegmentAndTrackArbitrationCleaned) - if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) { + if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) { matches++; break; } @@ -124,13 +120,14 @@ int Muon::numberOfMatchedStations(ArbitrationType type) const { unsigned int Muon::expectedNnumberOfMatchedStations(float minDistanceFromEdge) const { unsigned int stationMask = 0; + minDistanceFromEdge = std::abs(minDistanceFromEdge); for (auto& chamberMatch : muMatches_) { if (chamberMatch.detector() != MuonSubdetId::DT && chamberMatch.detector() != MuonSubdetId::CSC) continue; float edgeX = chamberMatch.edgeX; float edgeY = chamberMatch.edgeY; // check we if the trajectory is well within the acceptance - if (edgeX < 0 && fabs(edgeX) > fabs(minDistanceFromEdge) && edgeY < 0 && fabs(edgeY) > fabs(minDistanceFromEdge)) + if (edgeX < 0 && -edgeX > minDistanceFromEdge && edgeY < 0 && -edgeY > minDistanceFromEdge) stationMask |= 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1)); } unsigned int n = 0; @@ -144,23 +141,16 @@ unsigned int Muon::stationMask(ArbitrationType type) const { unsigned int totMask(0); unsigned int curMask(0); - for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin(); - chamberMatch != muMatches_.end(); - chamberMatch++) { + for (auto& chamberMatch : muMatches_) { if (type == RPCHitAndTrackArbitration) { - if (chamberMatch->rpcMatches.empty()) + if (chamberMatch.rpcMatches.empty()) continue; - RPCDetId rollId = chamberMatch->id.rawId(); - const int region = rollId.region(); - int rpcIndex = 1; - if (region != 0) - rpcIndex = 2; + RPCDetId rollId = chamberMatch.id.rawId(); + int rpcIndex = rollId.region() == 0 ? 1 : 2; - for (std::vector<MuonRPCHitMatch>::const_iterator rpcMatch = chamberMatch->rpcMatches.begin(); - rpcMatch != chamberMatch->rpcMatches.end(); - rpcMatch++) { - curMask = 1 << ((chamberMatch->station() - 1) + 4 * (rpcIndex - 1)); + for (auto& rpcMatch : chamberMatch.rpcMatches) { + curMask = 1 << ((chamberMatch.station() - 1) + 4 * (rpcIndex - 1)); // do not double count if (!(totMask & curMask)) @@ -169,41 +159,39 @@ unsigned int Muon::stationMask(ArbitrationType type) const { continue; } - if (chamberMatch->segmentMatches.empty()) + if (chamberMatch.segmentMatches.empty()) continue; if (type == NoArbitration) { - curMask = 1 << ((chamberMatch->station() - 1) + 4 * (chamberMatch->detector() - 1)); + curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1)); // do not double count if (!(totMask & curMask)) totMask += curMask; continue; } - for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin(); - segmentMatch != chamberMatch->segmentMatches.end(); - segmentMatch++) { + for (auto& segmentMatch : chamberMatch.segmentMatches) { if (type == SegmentArbitration) - if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR)) { - curMask = 1 << ((chamberMatch->station() - 1) + 4 * (chamberMatch->detector() - 1)); + if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR)) { + curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1)); // do not double count if (!(totMask & curMask)) totMask += curMask; break; } if (type == SegmentAndTrackArbitration) - if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) { - curMask = 1 << ((chamberMatch->station() - 1) + 4 * (chamberMatch->detector() - 1)); + if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) { + curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1)); // do not double count if (!(totMask & curMask)) totMask += curMask; break; } if (type == SegmentAndTrackArbitrationCleaned) - if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) { - curMask = 1 << ((chamberMatch->station() - 1) + 4 * (chamberMatch->detector() - 1)); + if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) { + curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1)); // do not double count if (!(totMask & curMask)) totMask += curMask; @@ -230,27 +218,23 @@ int Muon::numberOfMatchedRPCLayers(ArbitrationType type) const { unsigned int Muon::RPClayerMask(ArbitrationType type) const { unsigned int totMask(0); unsigned int curMask(0); - for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin(); - chamberMatch != muMatches_.end(); - chamberMatch++) { - if (chamberMatch->rpcMatches.empty()) + for (auto& chamberMatch : muMatches_) { + if (chamberMatch.rpcMatches.empty()) continue; - RPCDetId rollId = chamberMatch->id.rawId(); + RPCDetId rollId = chamberMatch.id.rawId(); const int region = rollId.region(); - const int layer = rollId.layer(); - int rpcLayer = chamberMatch->station(); + int rpcLayer = chamberMatch.station(); if (region == 0) { - rpcLayer = chamberMatch->station() - 1 + chamberMatch->station() * layer; - if ((chamberMatch->station() == 2 && layer == 2) || (chamberMatch->station() == 4 && layer == 1)) + const int layer = rollId.layer(); + rpcLayer = chamberMatch.station() - 1 + chamberMatch.station() * layer; + if ((chamberMatch.station() == 2 && layer == 2) || (chamberMatch.station() == 4 && layer == 1)) rpcLayer -= 1; } else rpcLayer += 6; - for (std::vector<MuonRPCHitMatch>::const_iterator rpcMatch = chamberMatch->rpcMatches.begin(); - rpcMatch != chamberMatch->rpcMatches.end(); - rpcMatch++) { + for (auto& rpcMatch : chamberMatch.rpcMatches) { // There is clearly something odd here curMask = 1 << (rpcLayer - 1); // do not double count @@ -264,63 +248,55 @@ unsigned int Muon::RPClayerMask(ArbitrationType type) const { unsigned int Muon::stationGapMaskDistance(float distanceCut) const { unsigned int totMask(0); - for (int stationIndex = 1; stationIndex < 5; stationIndex++) { - for (int detectorIndex = 1; detectorIndex < 4; detectorIndex++) { - unsigned int curMask(0); - for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin(); - chamberMatch != muMatches_.end(); - chamberMatch++) { - if (!(chamberMatch->station() == stationIndex && chamberMatch->detector() == detectorIndex)) - continue; - - float edgeX = chamberMatch->edgeX; - float edgeY = chamberMatch->edgeY; - if (edgeX < 0 && fabs(edgeX) > fabs(distanceCut) && edgeY < 0 && - fabs(edgeY) > fabs(distanceCut)) // inside the chamber so negates all gaps for this station - { - curMask = 0; - break; - } - if ((fabs(edgeX) < fabs(distanceCut) && edgeY < fabs(distanceCut)) || - (fabs(edgeY) < fabs(distanceCut) && edgeX < fabs(distanceCut))) // inside gap - curMask = 1 << ((stationIndex - 1) + 4 * (detectorIndex - 1)); - } + distanceCut = std::abs(distanceCut); + for (auto& chamberMatch : muMatches_) { + unsigned int curMask(0); + int stationIndex = chamberMatch.station(); + if (stationIndex < 1 || stationIndex >= 5) + continue; + int detectorIndex = chamberMatch.detector(); + if (detectorIndex < 1 || detectorIndex >= 4) + continue; - totMask += curMask; // add to total mask - } + float edgeX = chamberMatch.edgeX; + float edgeY = chamberMatch.edgeY; + if (edgeX < 0 && -edgeX > distanceCut && edgeY < 0 && + -edgeY > distanceCut) // inside the chamber so negates all gaps for this station + continue; + + if ((std::abs(edgeX) < distanceCut && edgeY < distanceCut) || + (std::abs(edgeY) < distanceCut && edgeX < distanceCut)) // inside gap + curMask = 1 << ((stationIndex - 1) + 4 * (detectorIndex - 1)); + totMask += curMask; // add to total mask } return totMask; } unsigned int Muon::stationGapMaskPull(float sigmaCut) const { + sigmaCut = std::abs(sigmaCut); unsigned int totMask(0); - for (int stationIndex = 1; stationIndex < 5; stationIndex++) { - for (int detectorIndex = 1; detectorIndex < 4; detectorIndex++) { - unsigned int curMask(0); - for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin(); - chamberMatch != muMatches_.end(); - chamberMatch++) { - if (!(chamberMatch->station() == stationIndex && chamberMatch->detector() == detectorIndex)) - continue; - - float edgeX = chamberMatch->edgeX; - float edgeY = chamberMatch->edgeY; - float xErr = chamberMatch->xErr + 0.000001; // protect against division by zero later - float yErr = chamberMatch->yErr + 0.000001; // protect against division by zero later - if (edgeX < 0 && fabs(edgeX / xErr) > fabs(sigmaCut) && edgeY < 0 && - fabs(edgeY / yErr) > fabs(sigmaCut)) // inside the chamber so negates all gaps for this station - { - curMask = 0; - break; - } - if ((fabs(edgeX / xErr) < fabs(sigmaCut) && edgeY / yErr < fabs(sigmaCut)) || - (fabs(edgeY / yErr) < fabs(sigmaCut) && edgeX / xErr < fabs(sigmaCut))) // inside gap - curMask = 1 << ((stationIndex - 1) + 4 * (detectorIndex - 1)); - } + for (auto& chamberMatch : muMatches_) { + unsigned int curMask(0); + int stationIndex = chamberMatch.station(); + if (stationIndex < 1 || stationIndex >= 5) + continue; + int detectorIndex = chamberMatch.detector(); + if (detectorIndex < 1 || detectorIndex >= 4) + continue; - totMask += curMask; // add to total mask - } + float edgeX = chamberMatch.edgeX; + float edgeY = chamberMatch.edgeY; + float xErr = chamberMatch.xErr + 0.000001; // protect against division by zero later + float yErr = chamberMatch.yErr + 0.000001; // protect against division by zero later + if (edgeX < 0 && std::abs(edgeX / xErr) > sigmaCut && edgeY < 0 && + std::abs(edgeY / yErr) > sigmaCut) // inside the chamber so negates all gaps for this station + continue; + + if ((std::abs(edgeX / xErr) < sigmaCut && edgeY / yErr < sigmaCut) || + (std::abs(edgeY / yErr) < sigmaCut && edgeX / xErr < sigmaCut)) // inside gap + curMask = 1 << ((stationIndex - 1) + 4 * (detectorIndex - 1)); + totMask += curMask; // add to total mask } return totMask; @@ -391,37 +367,33 @@ int Muon::numberOfShowers(int nDtDigisCut, int nCscDigisCut) const { int Muon::numberOfSegments(int station, int muonSubdetId, ArbitrationType type) const { int segments(0); - for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin(); - chamberMatch != muMatches_.end(); - chamberMatch++) { - if (chamberMatch->segmentMatches.empty()) + for (auto& chamberMatch : muMatches_) { + if (chamberMatch.segmentMatches.empty()) continue; - if (!(chamberMatch->station() == station && chamberMatch->detector() == muonSubdetId)) + if (!(chamberMatch.station() == station && chamberMatch.detector() == muonSubdetId)) continue; if (type == NoArbitration) { - segments += chamberMatch->segmentMatches.size(); + segments += chamberMatch.segmentMatches.size(); continue; } - for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin(); - segmentMatch != chamberMatch->segmentMatches.end(); - segmentMatch++) { + for (auto& segmentMatch : chamberMatch.segmentMatches) { if (type == SegmentArbitration) - if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR)) { + if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR)) { segments++; break; } if (type == SegmentAndTrackArbitration) - if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR)) { + if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) { segments++; break; } if (type == SegmentAndTrackArbitrationCleaned) - if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) && - segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) { + if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) && + segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) { segments++; break; } @@ -675,13 +647,11 @@ float Muon::trackEdgeX(int station, int muonSubdetId, ArbitrationType type) cons if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->edgeX; + supVar = muonChamber->edgeX; } } return supVar; @@ -698,13 +668,11 @@ float Muon::trackEdgeY(int station, int muonSubdetId, ArbitrationType type) cons if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->edgeY; + supVar = muonChamber->edgeY; } } return supVar; @@ -721,13 +689,11 @@ float Muon::trackX(int station, int muonSubdetId, ArbitrationType type) const { if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->x; + supVar = muonChamber->x; } } return supVar; @@ -744,13 +710,11 @@ float Muon::trackY(int station, int muonSubdetId, ArbitrationType type) const { if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->y; + supVar = muonChamber->y; } } return supVar; @@ -767,13 +731,11 @@ float Muon::trackDxDz(int station, int muonSubdetId, ArbitrationType type) const if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->dXdZ; + supVar = muonChamber->dXdZ; } } return supVar; @@ -790,13 +752,11 @@ float Muon::trackDyDz(int station, int muonSubdetId, ArbitrationType type) const if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->dYdZ; + supVar = muonChamber->dYdZ; } } return supVar; @@ -813,13 +773,11 @@ float Muon::trackXErr(int station, int muonSubdetId, ArbitrationType type) const if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->xErr; + supVar = muonChamber->xErr; } } return supVar; @@ -836,13 +794,11 @@ float Muon::trackYErr(int station, int muonSubdetId, ArbitrationType type) const if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->yErr; + supVar = muonChamber->yErr; } } return supVar; @@ -859,13 +815,11 @@ float Muon::trackDxDzErr(int station, int muonSubdetId, ArbitrationType type) co if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->dXdZErr; + supVar = muonChamber->dXdZErr; } } return supVar; @@ -882,13 +836,11 @@ float Muon::trackDyDzErr(int station, int muonSubdetId, ArbitrationType type) co if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->dYdZErr; + supVar = muonChamber->dYdZErr; } } return supVar; @@ -904,10 +856,8 @@ float Muon::trackDist(int station, int muonSubdetId, ArbitrationType type) const std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers, type); if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) dist = currDist; } @@ -925,13 +875,11 @@ float Muon::trackDistErr(int station, int muonSubdetId, ArbitrationType type) co if (chamberSegmentPair.first == nullptr || chamberSegmentPair.second == nullptr) { float dist = 999999; float supVar = 999999; - for (std::vector<const MuonChamberMatch*>::const_iterator muonChamber = muonChambers.begin(); - muonChamber != muonChambers.end(); - ++muonChamber) { - float currDist = (*muonChamber)->dist(); + for (const MuonChamberMatch* muonChamber : muonChambers) { + float currDist = muonChamber->dist(); if (currDist < dist) { dist = currDist; - supVar = (*muonChamber)->distErr(); + supVar = muonChamber->distErr(); } } return supVar; From a7a3422e2d574c986b1b2ef52aedd9adb76e767c Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Wed, 14 Oct 2020 16:45:47 +0200 Subject: [PATCH 568/778] Remove unnecessary forward declarations and includes --- RecoMuon/TrackingTools/interface/MuonTrackFinder.h | 3 --- RecoMuon/TrackingTools/src/MuonTrackFinder.cc | 3 --- 2 files changed, 6 deletions(-) diff --git a/RecoMuon/TrackingTools/interface/MuonTrackFinder.h b/RecoMuon/TrackingTools/interface/MuonTrackFinder.h index 260a0cf3930cd..45bc28edca76e 100644 --- a/RecoMuon/TrackingTools/interface/MuonTrackFinder.h +++ b/RecoMuon/TrackingTools/interface/MuonTrackFinder.h @@ -19,9 +19,6 @@ #include <vector> -class TrackerTopology; -class TrackerTopologyRcd; - class MuonTrajectoryBuilder; class MuonTrajectoryCleaner; class MuonTrackLoader; diff --git a/RecoMuon/TrackingTools/src/MuonTrackFinder.cc b/RecoMuon/TrackingTools/src/MuonTrackFinder.cc index 20590ae1c5a8b..66677f586e192 100644 --- a/RecoMuon/TrackingTools/src/MuonTrackFinder.cc +++ b/RecoMuon/TrackingTools/src/MuonTrackFinder.cc @@ -22,9 +22,6 @@ #include "TrackingTools/GeomPropagators/interface/Propagator.h" #include "TrackingTools/PatternTools/interface/Trajectory.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" - using namespace std; using namespace edm; From 04720215dcb389d64e9af35287886dfdf4b2dabe Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Wed, 14 Oct 2020 16:50:39 +0200 Subject: [PATCH 569/778] Some cleanup in DataFormat/MuonReco/MuonSelectors --- DataFormats/MuonReco/src/MuonSelectors.cc | 34 ++++++++++++----------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/DataFormats/MuonReco/src/MuonSelectors.cc b/DataFormats/MuonReco/src/MuonSelectors.cc index a27c203e94397..341fbbc870ece 100644 --- a/DataFormats/MuonReco/src/MuonSelectors.cc +++ b/DataFormats/MuonReco/src/MuonSelectors.cc @@ -43,14 +43,14 @@ unsigned int muon::RequiredStationMask(const reco::Muon& muon, reco::Muon::ArbitrationType arbitrationType) { unsigned int theMask = 0; - for (int stationIdx = 1; stationIdx < 5; ++stationIdx) - for (int detectorIdx = 1; detectorIdx < 3; ++detectorIdx) - if (muon.trackDist(stationIdx, detectorIdx, arbitrationType) < maxChamberDist && - muon.trackDist(stationIdx, detectorIdx, arbitrationType) / - muon.trackDistErr(stationIdx, detectorIdx, arbitrationType) < - maxChamberDistPull) + for (int stationIdx = 1; stationIdx < 5; ++stationIdx) { + for (int detectorIdx = 1; detectorIdx < 3; ++detectorIdx) { + float dist = muon.trackDist(stationIdx, detectorIdx, arbitrationType); + if (dist < maxChamberDist && + dist / muon.trackDistErr(stationIdx, detectorIdx, arbitrationType) < maxChamberDistPull) theMask += 1 << ((stationIdx - 1) + 4 * (detectorIdx - 1)); - + } + } return theMask; } @@ -76,12 +76,13 @@ float muon::segmentCompatibility(const reco::Muon& muon, reco::Muon::Arbitration // ********************************************************; // *** fill local info for this muon (do some counting) ***; // ************** begin ***********************************; - if (i <= 4) { // this is the section for the DTs - if (muon.trackDist(i, 1, arbitrationType) < 999999) { //current "raw" info that a track is close to a chamber + if (i <= 4) { // this is the section for the DTs + float thisTrackDist = muon.trackDist(i, 1, arbitrationType); + if (thisTrackDist < 999999) { //current "raw" info that a track is close to a chamber ++nr_of_stations_crossed; station_was_crossed[i - 1] = 1; - if (muon.trackDist(i, 1, arbitrationType) > -10.) - stations_w_track_at_boundary[i - 1] = muon.trackDist(i, 1, arbitrationType); + if (thisTrackDist > -10.) + stations_w_track_at_boundary[i - 1] = thisTrackDist; else stations_w_track_at_boundary[i - 1] = 0.; } @@ -90,12 +91,13 @@ float muon::segmentCompatibility(const reco::Muon& muon, reco::Muon::Arbitration ++nr_of_stations_with_segment; station_has_segmentmatch[i - 1] = 1; } - } else { // this is the section for the CSCs - if (muon.trackDist(i - 4, 2, arbitrationType) < 999999) { //current "raw" info that a track is close to a chamber + } else { // this is the section for the CSCs + float thisTrackDist = muon.trackDist(i - 4, 2, arbitrationType); + if (thisTrackDist < 999999) { //current "raw" info that a track is close to a chamber ++nr_of_stations_crossed; station_was_crossed[i - 1] = 1; - if (muon.trackDist(i - 4, 2, arbitrationType) > -10.) - stations_w_track_at_boundary[i - 1] = muon.trackDist(i - 4, 2, arbitrationType); + if (thisTrackDist > -10.) + stations_w_track_at_boundary[i - 1] = thisTrackDist; else stations_w_track_at_boundary[i - 1] = 0.; } @@ -834,7 +836,7 @@ bool muon::overlap( continue; if (id1.ring() != id2.ring()) continue; - if (abs(id1.chamber() - id2.chamber()) > 1) + if (std::abs(id1.chamber() - id2.chamber()) > 1) continue; // FIXME: we don't handle 18->1; 36->1 transitions since // I don't know how to check for sure how many chambers From 26c731f00a648eaefd7e21cb21411a482abf35d3 Mon Sep 17 00:00:00 2001 From: Jeongeun Lee <jeongeun.lee@cern.ch> Date: Wed, 14 Oct 2020 16:58:09 +0200 Subject: [PATCH 570/778] fix typo --- .../PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoPixelVertexing/PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py b/RecoPixelVertexing/PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py index fa2570d521552..d41eb01f7d858 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py +++ b/RecoPixelVertexing/PixelLowPtUtilities/python/ClusterShapeExtractor_cfi.py @@ -20,5 +20,5 @@ from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker phase2_tracker.toModify(clusterShapeExtractor, - pixelSimLinkSrc = 'simSiPixelDigis:Pixel'), + pixelSimLinkSrc = 'simSiPixelDigis:Pixel' ) From 56cd1d6a16f97c0893bc1aec26b00cbf7866481b Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Wed, 14 Oct 2020 16:58:43 +0200 Subject: [PATCH 571/778] Some cleanup in MuonIdProducer --- RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc | 6 +++--- RecoMuon/MuonIdentification/plugins/MuonIdProducer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc index a3ffca69344d1..d473ce155ac28 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc @@ -564,7 +564,7 @@ void MuonIdProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) for (auto& muon : *outputMuons) { if (muon.innerTrack().get() == trackerMuon.innerTrack().get() && - cos(phiOfMuonIneteractionRegion(muon) - phiOfMuonIneteractionRegion(trackerMuon)) > 0) { + cos(phiOfMuonInteractionRegion(muon) - phiOfMuonInteractionRegion(trackerMuon)) > 0) { newMuon = false; muon.setMatches(trackerMuon.matches()); if (trackerMuon.isTimeValid()) @@ -665,7 +665,7 @@ void MuonIdProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) // predict direction based on the muon interaction region location // if it's available if (muon.isStandAloneMuon()) { - if (cos(phiOfMuonIneteractionRegion(muon) - muon.phi()) > 0) { + if (cos(phiOfMuonInteractionRegion(muon) - muon.phi()) > 0) { fillMuonId(iEvent, iSetup, muon, TrackDetectorAssociator::InsideOut); } else { fillMuonId(iEvent, iSetup, muon, TrackDetectorAssociator::OutsideIn); @@ -1322,7 +1322,7 @@ double MuonIdProducer::sectorPhi(const DetId& id) { return phi; } -double MuonIdProducer::phiOfMuonIneteractionRegion(const reco::Muon& muon) const { +double MuonIdProducer::phiOfMuonInteractionRegion(const reco::Muon& muon) const { if (muon.isStandAloneMuon()) return muon.standAloneMuon()->innerPosition().phi(); // the rest is tracker muon only diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h index e4317cfd7aae9..c2fae4090cf56 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h @@ -122,7 +122,7 @@ class MuonIdProducer : public edm::stream::EDProducer<> { unsigned int chamberId(const DetId&); - double phiOfMuonIneteractionRegion(const reco::Muon& muon) const; + double phiOfMuonInteractionRegion(const reco::Muon& muon) const; bool checkLinks(const reco::MuonTrackLinks*) const; inline bool approxEqual(const double a, const double b, const double tol = 1E-3) const { From 16656b7a7080d996be36664449e84fcdb4d8f49e Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Wed, 14 Oct 2020 17:19:08 +0200 Subject: [PATCH 572/778] fixing histograms names --- Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc | 2 +- Validation/MtdValidation/plugins/EtlSimHitsValidation.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc index 876396495c628..fdd91764fc14c 100644 --- a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc @@ -367,7 +367,7 @@ void EtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook, 0., 1024.); meHitQvsPhi_[3] = - ibook.bookProfile("EtlHitQvsPhiZpos", + ibook.bookProfile("EtlHitQvsPhiZposD2", "ETL DIGI charge vs #phi (+Z, Second disk);#phi_{DIGI} [rad];Q_{DIGI} [ADC counts]", 50, -3.15, diff --git a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc index fb78f23cd2fb5..e5f1f030e02ec 100644 --- a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc @@ -265,14 +265,14 @@ void EtlSimHitsValidation::bookHistograms(DQMStore::IBooker& ibook, 0., 10.); meNtrkPerCell_[1] = - ibook.book1D("EtlNtrkPerCellZneg", "Number of tracks per ETL sensor (-Z, Second disk);N_{trk}", 10, 0., 10.); - meNtrkPerCell_[2] = ibook.book1D("EtlNtrkPerCellZpos", + ibook.book1D("EtlNtrkPerCellZnegD2", "Number of tracks per ETL sensor (-Z, Second disk);N_{trk}", 10, 0., 10.); + meNtrkPerCell_[2] = ibook.book1D("EtlNtrkPerCellZposD1", "Number of tracks per ETL sensor (+Z, Single(topo1D)/First(topo2D) disk);N_{trk}", 10, 0., 10.); meNtrkPerCell_[3] = - ibook.book1D("EtlNtrkPerCellZpos", "Number of tracks per ETL sensor (+Z, Second disk);N_{trk}", 10, 0., 10.); + ibook.book1D("EtlNtrkPerCellZposD2", "Number of tracks per ETL sensor (+Z, Second disk);N_{trk}", 10, 0., 10.); meHitEnergy_[0] = ibook.book1D( "EtlHitEnergyZnegD1", "ETL SIM hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.); From 9397ec3c69e61032a056e67d94addd32c5273a87 Mon Sep 17 00:00:00 2001 From: Gabrielle Hugo <gabrielle.hugo83@gmail.com> Date: Wed, 14 Oct 2020 18:03:52 +0200 Subject: [PATCH 573/778] use throw and [] instead of Errror and at. I personally prefer using the Error and at, because it tends to save a lot of developer time: instead of being blocked, we have results which might be helpful or here, even interesting. --- .../src/TrackerGeomBuilderFromGeometricDet.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc index c1fba9f883950..a58bc1841e0af 100644 --- a/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc +++ b/Geometry/TrackerGeometryBuilder/src/TrackerGeomBuilderFromGeometricDet.cc @@ -44,13 +44,13 @@ TrackerGeometry* TrackerGeomBuilderFromGeometricDet::build(const GeometricDet* g const PTrackerParameters& ptp, const TrackerTopology* tTopo) { if (ptp.vpars.size() != 6) { - edm::LogError("TrackerGeomBuilderFromGeometricDet") + throw cms::Exception("TrackerGeomBuilderFromGeometricDet") << "Tracker parameters block from XMLs called vPars is expected to have 6 entries, but has " << ptp.vpars.size() << " entrie(s)."; } - const int BIG_PIX_PER_ROC_X = ptp.vpars.at(2); - const int BIG_PIX_PER_ROC_Y = ptp.vpars.at(3); + const int BIG_PIX_PER_ROC_X = ptp.vpars[2]; + const int BIG_PIX_PER_ROC_Y = ptp.vpars[3]; thePixelDetTypeMap.clear(); theStripDetTypeMap.clear(); From 139d53332e1a2632e385d2ea53bd53072c2f9885 Mon Sep 17 00:00:00 2001 From: Javier <Javier.Fernandez@cern.ch> Date: Wed, 14 Oct 2020 18:20:04 +0200 Subject: [PATCH 574/778] Removed unused headers --- DQM/HcalCommon/interface/ContainerD.h | 44 ------- DQM/HcalTasks/interface/TestTask.h | 59 --------- DQMOffline/JetMET/interface/GlobalVariables.h | 10 -- .../JetMET/interface/SusyDQM/GenericPlotter.h | 46 ------- DQMOffline/JetMET/interface/SusyDQM/Indexed.h | 15 --- .../JetMET/interface/SusyDQM/Overlayer.h | 119 ------------------ .../JetMET/interface/SusyDQM/round_string.h | 38 ------ 7 files changed, 331 deletions(-) delete mode 100644 DQM/HcalCommon/interface/ContainerD.h delete mode 100644 DQM/HcalTasks/interface/TestTask.h delete mode 100644 DQMOffline/JetMET/interface/GlobalVariables.h delete mode 100644 DQMOffline/JetMET/interface/SusyDQM/GenericPlotter.h delete mode 100644 DQMOffline/JetMET/interface/SusyDQM/Indexed.h delete mode 100644 DQMOffline/JetMET/interface/SusyDQM/Overlayer.h delete mode 100644 DQMOffline/JetMET/interface/SusyDQM/round_string.h diff --git a/DQM/HcalCommon/interface/ContainerD.h b/DQM/HcalCommon/interface/ContainerD.h deleted file mode 100644 index f7c7e6fbc2f09..0000000000000 --- a/DQM/HcalCommon/interface/ContainerD.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef ContainerD_h -#define ContainerD_h - -#include "DQM/HcalCommon/interface/Container.h" - -namespace hcaldqm -{ - class ContainerD : public Container - { - public: - ContainerD(): - Container() - {} - ContainerD(std::string const& folder, std::string const& name): - Container(folder, name) - {} - virtual ~ContainerD() {} - - virtual void initialize(std::string const& folder, - std::string const& name, int debug=0) - { - _folder = folder; - _qname = name; - _logger.set(_qname, debug); - } - - virtual void fill(double x) - { - _me->Fill(x); - } - - virtual void book(DQMStore::IBooker &ib, - std::string subsystem="Hcal", std::string aux="") - { - ib.setCurrentFolder(subsystem+"/"+_folder+aux); - _me = ib.bookFloat(_qname); - } - - protected: - MonitorElement* _me; - }; -} - -#endif diff --git a/DQM/HcalTasks/interface/TestTask.h b/DQM/HcalTasks/interface/TestTask.h deleted file mode 100644 index 39126a14de38e..0000000000000 --- a/DQM/HcalTasks/interface/TestTask.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef TestTask_h -#define TestTask_h - -/* - * file: TestTask.h - * Author: Viktor KHristenko - * Description: - */ - -#include "DQM/HcalCommon/interface/DQTask.h" -#include "DQM/HcalCommon/interface/Utilities.h" -#include "DQM/HcalCommon/interface/Container1D.h" -#include "DQM/HcalCommon/interface/Container2D.h" -#include "DQM/HcalCommon/interface/ContainerProf1D.h" -#include "DQM/HcalCommon/interface/ContainerProf2D.h" -#include "DQM/HcalCommon/interface/ContainerSingle2D.h" -#include "DQM/HcalCommon/interface/ContainerSingleProf1D.h" - -class TestTask : public hcaldqm::DQTask { -public: - TestTask(edm::ParameterSet const&); - virtual ~TestTask() {} - - virtual void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&); - virtual void dqmEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&); - -protected: - virtual void _process(edm::Event const&, edm::EventSetup const&); - virtual void _resetMonitors(hcaldqm::UpdateFreq); - - // tags - edm::InputTag _tagHF; - - // Hcal Filters - hcaldqm::filter::HashFilter filter_Electronics; - - // Electronics Map - - // hcaldqm::Containers - hcaldqm::Container1D _cEnergy_Subdet; - hcaldqm::Container1D _cTiming_SubdetPMiphi; - hcaldqm::ContainerProf1D _cEnergyvsiphi_Subdetieta; - hcaldqm::Container2D _cEnergy_depth; - hcaldqm::ContainerProf2D _cTiming_depth; - hcaldqm::Container1D _cTiming_FEDSlot; - hcaldqm::Container1D _cEnergy_CrateSpigot; - hcaldqm::Container1D _cEnergy_FED; - hcaldqm::Container1D _cEt_TTSubdetPM; - hcaldqm::Container1D _cEt_TTSubdetPMiphi; - hcaldqm::Container1D _cEt_TTSubdetieta; - hcaldqm::Container2D _cTiming_FEDuTCA; - hcaldqm::ContainerSingle2D _cSummary; - hcaldqm::ContainerSingleProf1D _cPerformance; - - // hcaldqm::ContainerProf1D _cTiming_fCrateSlot; - // hcaldqm::ContainerProf1D _cEt_TTSubdetPMiphi; -}; - -#endif diff --git a/DQMOffline/JetMET/interface/GlobalVariables.h b/DQMOffline/JetMET/interface/GlobalVariables.h deleted file mode 100644 index 15e44931f41c6..0000000000000 --- a/DQMOffline/JetMET/interface/GlobalVariables.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GlobalVariables_H -#define GlobalVariables_H - - -const int nbinsPV = 50; -const double PVlow = 0; -const double PVup = 50; - - -#endif diff --git a/DQMOffline/JetMET/interface/SusyDQM/GenericPlotter.h b/DQMOffline/JetMET/interface/SusyDQM/GenericPlotter.h deleted file mode 100644 index 8be5e4fb8cde1..0000000000000 --- a/DQMOffline/JetMET/interface/SusyDQM/GenericPlotter.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef SUSYCAF_GENERIC_PLOTTER_H -#define SUSYCAF_GENERIC_PLOTTER_H - -#include <vector> -#include <string> -#include <TLegend.h> -namespace edm { class ParameterSet;} -class Book; -class TH1; -class TCanvas; - -class GenericPlotter { - public: - GenericPlotter(const edm::ParameterSet&); - const std::string printSuffix_, plotDocument_, drawOption2D_; - const bool normalize_,legend_; - const unsigned canvasWidth_,canvasHeight_; - const std::vector<std::string> replace_text_; - const double maxRatioUncertainty_; - const double fixRatioYAxis_; - - void plot_all(std::vector<Book*>&, int reference = -1) const; - void plot1D(std::string, std::vector<std::string>&, std::vector<TH1*>&, int reference = -1) const; - void plot2D(std::string, std::vector<std::string>&, std::vector<TH1*>&) const; - void plotRatio(bool, std::vector<std::string>&, std::vector<TH1*>&, int reference, TCanvas& c) const; - - TLegend* make_legend2D(const std::string, TH1*) const; - TLegend make_legend(const std::vector<std::string>&, const std::vector<TH1*>&) const; - void normalize(std::vector<TH1*>&) const; - void setLabels(std::vector<TH1*>&) const; - void setBounds(std::vector<TH1*>&, bool, bool) const; - double hist_maximum(TH1*) const; - double hist_minimum(TH1*) const; - - void plotDocumentOpen() const; - void plotDocumentClose() const; - void plotDocumentAdd(const TCanvas&) const; - void printFile(const std::string&, const TCanvas&) const; - - // User must clean up the created ratio histograms. - static void make_rebinned_ratios(std::vector<TH1*>& ratios, const std::vector<TH1*>& hist, int reference, double maxUncertainty, const std::string& refName, const std::string postfix = "_ratio"); - static double ratioError2(double numerator, double numeratorError2, double denominator, double denominatorError2); - -}; - -#endif diff --git a/DQMOffline/JetMET/interface/SusyDQM/Indexed.h b/DQMOffline/JetMET/interface/SusyDQM/Indexed.h deleted file mode 100644 index 279bc8ff2f4a7..0000000000000 --- a/DQMOffline/JetMET/interface/SusyDQM/Indexed.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef INDEXED_H -#define INDEXED_H - -template<class T> -class Indexed : public T { - private: - unsigned index_; - public: - Indexed() : T(), index_(0) {} - Indexed(T t, unsigned i) : T(t), index_(i) {} - unsigned index() const {return index_;} - Indexed operator+(const Indexed& rhs) const {return Indexed(this->T::operator+(rhs),0);} -}; - -#endif diff --git a/DQMOffline/JetMET/interface/SusyDQM/Overlayer.h b/DQMOffline/JetMET/interface/SusyDQM/Overlayer.h deleted file mode 100644 index bf3b6d0251e30..0000000000000 --- a/DQMOffline/JetMET/interface/SusyDQM/Overlayer.h +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef OVERLAYER_H -#define OVERLAYER_H - -#include "TFile.h" -#include "TH1.h" -#include "TCanvas.h" -#include "TLegend.h" -#include <iostream> -#include <sstream> -#include "round_string.h" - -class Overlayer { -public: - Overlayer(std::string filename, std::string datadir, std::string simdir, Color_t color) - : file_(new TFile(filename.c_str(),"READ")), - dataLocation_(datadir), - simLocation_(simdir), - color_(color) -{ clear(); } - - Overlayer& clear(); - Overlayer& find(std::string); - Overlayer& xlabel(std::string s) { xlabel_=s; return *this;} - Overlayer& ylabel(std::string s) { ylabel_=s; return *this;} - Overlayer& logy(bool state=true) { logy_=state; return *this;} - Overlayer& withLegend(bool state=true); - Overlayer& legendLeft(bool state=true) { left_=state; return *this;} - void print(std::string); -private: - std::string getStats(const TH1* const) const; - - TFile* const file_; - const std::string dataLocation_,simLocation_; - const Color_t color_; - std::string histName_,xlabel_,ylabel_,title_; - TH1* data_; - TH1* sim_; - bool logy_,left_; - TLegend* legend_; -}; - -Overlayer& Overlayer:: -clear() { - std::cout << "clear" << std::endl; - data_=sim_=0; - xlabel_=ylabel_=histName_=title_=""; - logy_=false; - legend_=0; - left_=false; - return *this; -} - -Overlayer& Overlayer:: -find(std::string name) { - std::cout << "find " << name << "\t" << std::flush; - histName_=name; - data_ = (TH1*) file_->GetDirectory(dataLocation_.c_str())->FindObjectAny(name.c_str()); - sim_ = (TH1*) file_->GetDirectory(simLocation_.c_str())->FindObjectAny(name.c_str()); - return *this; -} - -Overlayer& Overlayer::withLegend(bool state) { - std::cout << "legend: " << (state?"true\t":"false\t") << std::flush; - if(!state) {legend_=0; return *this;} - - std::string data_stats = getStats(data_); - std::string sim_stats = getStats(sim_); - unsigned maxlength = std::max( std::max( dataLocation_.size(), simLocation_.size()), - std::max( data_stats.size(), sim_stats.size()) ); - - if(left_) legend_ = new TLegend(0,0.75,maxlength*0.015,1.0); - else legend_ = new TLegend(1.0-maxlength*0.015,0.75,1.0,1.0); - - legend_->SetFillColor(kWhite); - legend_->AddEntry(data_,("#splitline{"+dataLocation_+"}{"+ data_stats + "}").c_str() ); - legend_->AddEntry(sim_,("#splitline{"+simLocation_+"}{"+ sim_stats + "}").c_str() ); - return *this; -} - -std::string Overlayer:: -getStats(const TH1* const hist) const { - stringstream ss; - ss << "N: " << hist->GetEntries() << ", " - << "#mu: " << round_string()(std::make_pair(hist->GetMean(),hist->GetMeanError())) << ", " - << "#sigma: " << round_string()(std::make_pair(hist->GetRMS(),hist->GetRMSError())); - return ss.str().c_str(); -} - -void Overlayer:: -print(std::string suffix) { - std::cout << "print\t" << std::flush; - - sim_->GetXaxis()->SetLabelSize(0.05); sim_->GetXaxis()->SetTitleSize(0.05); - sim_->GetYaxis()->SetLabelSize(0.05); sim_->GetYaxis()->SetTitleSize(0.05); - sim_->SetTitle((title_+";"+xlabel_+";"+ylabel_).c_str()); - sim_->Scale(data_->Integral()/sim_->Integral()); - sim_->SetMinimum( (logy_?0.1:0) ); - sim_->SetMaximum( (logy_?2:1.1) * std::max( sim_->GetBinContent(sim_->GetMaximumBin()) + sim_->GetBinError(sim_->GetMaximumBin()) , - data_->GetBinContent(data_->GetMaximumBin()) + data_->GetBinError(data_->GetMaximumBin()) ) ); - - sim_->SetFillColor(color_); - TH1* sim_errors = (TH1*) sim_->Clone((histName_+"_clone").c_str()); - sim_->SetLineColor(kRed); - sim_errors->SetFillColor(kRed); - sim_errors->SetFillStyle(3244); - data_->SetMarkerStyle(20); - - TCanvas c("c","",800,600); - if(logy_) c.SetLogy(); - - sim_->Draw("hist"); - sim_errors->Draw("e2same"); - data_->Draw("same"); - if(legend_) legend_->Draw(); - - c.Print((histName_+suffix).c_str()); -} - -#endif diff --git a/DQMOffline/JetMET/interface/SusyDQM/round_string.h b/DQMOffline/JetMET/interface/SusyDQM/round_string.h deleted file mode 100644 index 1f388c5be0e0a..0000000000000 --- a/DQMOffline/JetMET/interface/SusyDQM/round_string.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ROUND_STRING_H -#define ROUND_STRING_H - -#include <iomanip> -#include <sstream> -#include <string> -#include <sstream> -#include <cmath> - -struct round_string { - template<class T> - std::string operator()(const std::pair<T,T> x) const { - int val_digit(0), err_digit(0); - - if(x.first != 0) { - while( fabs(x.first) / pow(10, val_digit) < 1 ) val_digit--; - while( fabs(x.first) / pow(10, val_digit) > 10 )val_digit++; - } - if(x.second != 0 ) { - while( x.second / pow(10,err_digit) < 0.95 ) err_digit--; - while( x.second / pow(10,err_digit) > 9.50 ) err_digit++; - } - - if(val_digit<err_digit) val_digit=err_digit; - const bool scinot = (val_digit<-1 || err_digit>0); - - std::stringstream s; - s << std::fixed << std::setprecision( scinot? val_digit-err_digit : -err_digit) - << ( scinot? x.first/pow(10,val_digit) : x.first ) - << "(" - << unsigned(x.second / pow(10,err_digit) + 0.5) << ")"; - if(scinot) s<< "e" << (val_digit>0 ? "+" : "") << val_digit; - - return s.str(); - } -}; - -#endif From d4aa77b360b89ebf713bb9f883bbcef3248fc94a Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 14 Oct 2020 18:43:43 +0200 Subject: [PATCH 575/778] Make the ECAL numbering scheme compatible between DDD and DD4Hep --- .../src/EcalBarrelNumberingScheme.cc | 44 +++++++++---------- .../src/EcalEndcapNumberingScheme.cc | 14 +++--- .../src/EcalPreshowerNumberingScheme.cc | 16 +++---- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc index 0d99fb09ae3fd..bfbce64d552c4 100644 --- a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc @@ -12,13 +12,13 @@ EcalBarrelNumberingScheme::EcalBarrelNumberingScheme() : EcalNumberingScheme() { } EcalBarrelNumberingScheme::~EcalBarrelNumberingScheme() { - edm::LogInfo("EcalGeom") << "Deleting EcalBarrelNumberingScheme"; + edm::LogVerbatim("EcalGeom") << "Deleting EcalBarrelNumberingScheme"; } uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const { const uint32_t nLevels(baseNumber.getLevels()); - // LogDebug("EcalGeom") << "ECalBarrelNumberingScheme geometry levels = " << nLevels; + edm::LogVerbatim("EcalGeom") << "ECalBarrelNumberingScheme geometry levels = " << nLevels; if (12 > nLevels) { edm::LogWarning("EcalGeom") << "ECalBarrelNumberingScheme::getUnitID(): " @@ -36,16 +36,16 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const uint32_t hawCopy(baseNumber.getCopyNumber(4 + off)); const uint32_t fawCopy(baseNumber.getCopyNumber(5 + off)); const uint32_t supmCopy(baseNumber.getCopyNumber(6 + off)); - - // LogDebug("EcalGeom") << baseNumber.getLevelName(0) << ", " - // << baseNumber.getLevelName(1) << ", " - // << baseNumber.getLevelName(2) << ", " - // << baseNumber.getLevelName(3) << ", " - // << baseNumber.getLevelName(4) << ", " - // << baseNumber.getLevelName(5) << ", " - // << baseNumber.getLevelName(6) << ", " - // << baseNumber.getLevelName(7) ; - + /* + edm::LogVerbatim("EcalGeom") << baseNumber.getLevelName(0) << ", " + << baseNumber.getLevelName(1) << ", " + << baseNumber.getLevelName(2) << ", " + << baseNumber.getLevelName(3) << ", " + << baseNumber.getLevelName(4) << ", " + << baseNumber.getLevelName(5) << ", " + << baseNumber.getLevelName(6) << ", " + << baseNumber.getLevelName(7) ; + */ // error checking if (1 > cryType || 17 < cryType) { @@ -103,16 +103,16 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) } ++count; */ - // LogDebug("EcalGeom") << "EcalBarrelNumberingScheme: " - // << "supmCopy = " << supmCopy - // << ", fawCopy = " << fawCopy - // << ", hawCopy = " << hawCopy - // << ", wallCopy = " << wallCopy - // << ", cryType = " << cryType - // << "\n zsign = " << zsign - // << ", eta = " << eta - // << ", phi = " << phi - // << ", packed index = 0x" << std::hex << intindex << std::dec ; + edm::LogVerbatim("EcalGeom") << "EcalBarrelNumberingScheme: " + << "supmCopy = " << supmCopy + << ", fawCopy = " << fawCopy + << ", hawCopy = " << hawCopy + << ", wallCopy = " << wallCopy + << ", cryType = " << cryType + << "\n zsign = " << zsign + << ", eta = " << eta + << ", phi = " << phi + << ", packed index = 0x" << std::hex << intindex << std::dec ; return intindex; } diff --git a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc index fdf060aa08500..52a7455526a71 100644 --- a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc @@ -9,16 +9,16 @@ #include <iomanip> EcalEndcapNumberingScheme::EcalEndcapNumberingScheme() : EcalNumberingScheme() { - edm::LogInfo("EcalGeom") << "Creating EcalEndcapNumberingScheme"; + edm::LogVerbatim("EcalGeom") << "Creating EcalEndcapNumberingScheme"; } EcalEndcapNumberingScheme::~EcalEndcapNumberingScheme() { - edm::LogInfo("EcalGeom") << "Deleting EcalEndcapNumberingScheme"; + edm::LogVerbatim("EcalGeom") << "Deleting EcalEndcapNumberingScheme"; } uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const { const uint32_t nLevels(baseNumber.getLevels()); - //LogDebug("EcalGeom") << "ECalEndcapNumberingScheme geometry levels = " << nLevels; + edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme geometry levels = " << nLevels; if (7 > nLevels) { edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " @@ -50,10 +50,10 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) uint32_t intindex = EEDetId(module_number, crystal_number, zside, EEDetId::SCCRYSTALMODE).rawId(); - //LogDebug("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside - // << " super crystal = " << module_number << " crystal = " - // << crystal_number << " packed index = 0x" << std::hex - // << intindex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside + << " super crystal = " << module_number << " crystal = " + << crystal_number << " packed index = 0x" << std::hex + << intindex << std::dec; return intindex; } else { diff --git a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc index a4dd3abeb43a1..a5472d0ffa78e 100644 --- a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc @@ -84,11 +84,11 @@ EcalPreshowerNumberingScheme::EcalPreshowerNumberingScheme() : EcalNumberingSche L1ay[i] = vL1ay[i]; } - edm::LogInfo("EcalGeom") << "Creating EcalPreshowerNumberingScheme"; + edm::LogVerbatim("EcalGeom") << "Creating EcalPreshowerNumberingScheme"; } EcalPreshowerNumberingScheme::~EcalPreshowerNumberingScheme() { - edm::LogInfo("EcalGeom") << "Deleting EcalPreshowerNumberingScheme"; + edm::LogVerbatim("EcalGeom") << "Deleting EcalPreshowerNumberingScheme"; } uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const { @@ -97,9 +97,9 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe if (level > 0) { // depth index - silicon layer 1-st or 2-nd int layer = 0; - if (baseNumber.getLevelName(0) == "SFSX") { + if (baseNumber.getLevelName(0).find("SFSX") != std::string::npos) { layer = 1; - } else if (baseNumber.getLevelName(0) == "SFSY") { + } else if (baseNumber.getLevelName(0).find("SFSY") != std::string::npos) { layer = 2; } else { edm::LogWarning("EcalGeom") << "EcalPreshowerNumberingScheme: Wrong name" @@ -116,7 +116,7 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe int x = 0, y = 0, ix, iy, id; int mapX[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int mapY[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - const std::string& ladd = baseNumber.getLevelName(3); + const std::string& ladd = baseNumber.getLevelName(3).substr(0, 6); int ladd_copy = baseNumber.getCopyNumber(3); if (ladd == "SFLX0a" || ladd == "SFLY0a") { @@ -414,12 +414,10 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe intIndex = ESDetId(strip, x, y, layer, zside).rawId(); - LogDebug("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd - << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y << " layer " - << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex << std::dec; for (int ich = 0; ich < level; ich++) { - LogDebug("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) << " copy = " << baseNumber.getCopyNumber(ich); + edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) << " copy = " << baseNumber.getCopyNumber(ich); } } From 8ad39d4de537827f0b6ccae9884ddd25f6f1cf51 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 14 Oct 2020 11:56:59 -0500 Subject: [PATCH 576/778] Removed use of std::any in edmNew::DetSetVector The type being used is known at compile time so a static_cast is sufficient. --- DataFormats/Common/interface/DetSetVectorNew.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/DataFormats/Common/interface/DetSetVectorNew.h b/DataFormats/Common/interface/DetSetVectorNew.h index a0bbdb16e0dc0..f9b95cb45f5d7 100644 --- a/DataFormats/Common/interface/DetSetVectorNew.h +++ b/DataFormats/Common/interface/DetSetVectorNew.h @@ -6,7 +6,6 @@ #include "DataFormats/Common/interface/traits.h" #include <boost/iterator/transform_iterator.hpp> -#include <boost/any.hpp> #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Utilities/interface/thread_safety_macros.h" @@ -86,7 +85,7 @@ namespace edmNew { return *this; } mutable std::atomic<bool> m_filling; - boost::any m_getter; + std::shared_ptr<void> m_getter; mutable std::atomic<size_type> m_dataSize; void swap(DetSetVectorTrans& rh) { @@ -413,7 +412,7 @@ namespace edmNew { DetSetVector(DetSetVector&&) = default; DetSetVector& operator=(DetSetVector&&) = default; - bool onDemand() const { return !m_getter.empty(); } + bool onDemand() const { return static_cast<bool>(m_getter); } void swap(DetSetVector& rh) { DetSetVectorTrans::swap(rh); @@ -620,7 +619,7 @@ namespace edmNew { template <typename T> inline void DetSetVector<T>::update(const Item& item) const { // no m_getter or already updated - if (m_getter.empty()) { + if (!m_getter) { assert(item.isValid()); return; } @@ -628,7 +627,7 @@ namespace edmNew { assert(item.initializing()); { TSFastFiller ff(*this, item); - (*boost::any_cast<std::shared_ptr<Getter>>(&m_getter))->fill(ff); + static_cast<Getter*>(m_getter.get())->fill(ff); } assert(item.isValid()); } From 9623b6a83204553419cc0a990898e3bfd397af9e Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 14 Oct 2020 18:57:36 +0200 Subject: [PATCH 577/778] Code check --- .../EcalCommonData/src/EcalBarrelNumberingScheme.cc | 13 ++++--------- .../EcalCommonData/src/EcalEndcapNumberingScheme.cc | 7 +++---- .../src/EcalPreshowerNumberingScheme.cc | 8 ++++++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc index bfbce64d552c4..0f112aac1ae23 100644 --- a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc @@ -104,15 +104,10 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) ++count; */ edm::LogVerbatim("EcalGeom") << "EcalBarrelNumberingScheme: " - << "supmCopy = " << supmCopy - << ", fawCopy = " << fawCopy - << ", hawCopy = " << hawCopy - << ", wallCopy = " << wallCopy - << ", cryType = " << cryType - << "\n zsign = " << zsign - << ", eta = " << eta - << ", phi = " << phi - << ", packed index = 0x" << std::hex << intindex << std::dec ; + << "supmCopy = " << supmCopy << ", fawCopy = " << fawCopy << ", hawCopy = " << hawCopy + << ", wallCopy = " << wallCopy << ", cryType = " << cryType + << "\n zsign = " << zsign << ", eta = " << eta << ", phi = " << phi + << ", packed index = 0x" << std::hex << intindex << std::dec; return intindex; } diff --git a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc index 52a7455526a71..5fbb2ffbca1fe 100644 --- a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc @@ -50,10 +50,9 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) uint32_t intindex = EEDetId(module_number, crystal_number, zside, EEDetId::SCCRYSTALMODE).rawId(); - edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside - << " super crystal = " << module_number << " crystal = " - << crystal_number << " packed index = 0x" << std::hex - << intindex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside + << " super crystal = " << module_number << " crystal = " << crystal_number + << " packed index = 0x" << std::hex << intindex << std::dec; return intindex; } else { diff --git a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc index a5472d0ffa78e..5df76c5ea9e06 100644 --- a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc @@ -414,10 +414,14 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe intIndex = ESDetId(strip, x, y, layer, zside).rawId(); - edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd + << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y + << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex + << std::dec; for (int ich = 0; ich < level; ich++) { - edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) << " copy = " << baseNumber.getCopyNumber(ich); + edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) + << " copy = " << baseNumber.getCopyNumber(ich); } } From 5db41b85afda232211dd1e2c19f117644d41ad1b Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Wed, 14 Oct 2020 19:38:14 +0200 Subject: [PATCH 578/778] indent relval_steps.py --- .../python/relval_steps.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 53421ffa77920..d3adea883c45d 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -2491,25 +2491,25 @@ def gen2021HiMix(fragment,howMuch): '--eventcontent':'RECOSIM,MINIAODSIM,DQM,ALCARECO', },step3Up2015Defaults]) steps['RECOHI2018PPRECOMB']=merge([hiDefaults2018_ppReco,{'-s':'RAW2DIGI,L1Reco,RECO,ALCA:SiStripCalZeroBias+SiPixelCalZeroBias,EI,PAT,VALIDATION:@standardValidationNoHLT+@miniAODValidation,DQM:@standardDQMFakeHLT+@miniAODDQM', - '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO,ALCARECO', - '--eventcontent':'RECOSIM,MINIAODSIM,DQM,ALCARECO', + '--datatier':'GEN-SIM-RECO,MINIAODSIM,DQMIO,ALCARECO', + '--eventcontent':'RECOSIM,MINIAODSIM,DQM,ALCARECO', '--era':'Run2_2018_pp_on_AA', '--procModifiers':'genJetSubEvent', - },step3Up2015Defaults]) + },step3Up2015Defaults]) steps['RECOHI2018PPRECOml']=merge([concurrentLumis,steps['RECOHI2018PPRECOMB']]) steps['REMINIAODHI2018PPRECO']=merge([{'-s':'PAT,VALIDATION:@miniAODValidation,DQM:@miniAODDQM', - '--datatier':'MINIAODSIM,DQMIO', - '--eventcontent':'MINIAODSIM,DQM', - '-n':100, - },hiDefaults2018_ppReco,step3Up2015Defaults]) + '--datatier':'MINIAODSIM,DQMIO', + '--eventcontent':'MINIAODSIM,DQM', + '-n':100, + },hiDefaults2018_ppReco,step3Up2015Defaults]) steps['REMINIAODHI2018PPRECOMB']=merge([{'-s':'PAT,VALIDATION:@miniAODValidation,DQM:@miniAODDQM', - '--datatier':'MINIAODSIM,DQMIO', - '--eventcontent':'MINIAODSIM,DQM', - '-n':100, + '--datatier':'MINIAODSIM,DQMIO', + '--eventcontent':'MINIAODSIM,DQM', + '-n':100, '--era':'Run2_2018_pp_on_AA', '--procModifiers':'genJetSubEvent', - },hiDefaults2018_ppReco,step3Up2015Defaults]) + },hiDefaults2018_ppReco,step3Up2015Defaults]) steps['ALCARECOHI2018PPRECO']=merge([hiDefaults2018_ppReco,{'-s':'ALCA:TkAlMinBias+SiStripCalMinBias', '--datatier':'ALCARECO', From 04eab356f23ad458880f9559af4c4e1c57b3717f Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Wed, 14 Oct 2020 19:45:16 +0200 Subject: [PATCH 579/778] remove unused headers --- Geometry/CaloGeometry/interface/EZMgrVL.h | 56 ------------------- .../CommonDetUnit/interface/DetPositioner.h | 1 - .../interface/ModifiedSurfaceGenerator.h | 1 - .../CommonDetUnit/interface/MuonGeomDet.h | 1 - 4 files changed, 59 deletions(-) delete mode 100644 Geometry/CaloGeometry/interface/EZMgrVL.h delete mode 100644 Geometry/CommonDetUnit/interface/DetPositioner.h delete mode 100644 Geometry/CommonDetUnit/interface/ModifiedSurfaceGenerator.h delete mode 100644 Geometry/CommonDetUnit/interface/MuonGeomDet.h diff --git a/Geometry/CaloGeometry/interface/EZMgrVL.h b/Geometry/CaloGeometry/interface/EZMgrVL.h deleted file mode 100644 index 2989b07c6eba3..0000000000000 --- a/Geometry/CaloGeometry/interface/EZMgrVL.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef GEOMETRY_CALOGEOMETRY_EZMGRVL_H -#define GEOMETRY_CALOGEOMETRY_EZMGRVL_H 1 - -#include <vector> -#include <assert.h> - -template < class T > -class EZMgrVL -{ - public: - - typedef std::vector<T> VecType ; - typedef typename VecType::iterator iterator ; - typedef typename VecType::const_iterator const_iterator ; - typedef typename VecType::reference reference ; - typedef typename VecType::const_reference const_reference ; - typedef typename VecType::value_type value_type ; - typedef typename VecType::size_type size_type ; - - EZMgrVL< T >( size_type vecSize ) : m_vecSize ( vecSize ) - { - m_vec.resize(0); - assert( m_vec.capacity() == 0 ) ; - } - - virtual ~EZMgrVL< T >() {} - - iterator reserve( size_type size ) const { return assign( size ) ; } - iterator resize( size_type size ) const { return assign( size ) ; } - - iterator assign( size_type size, const T& t = T() ) const - { - assert( ( m_vec.size() + size ) <= m_vecSize ) ; - if( 0 == m_vec.capacity() ) - { - m_vec.reserve( m_vecSize ) ; - assert( m_vecSize == m_vec.capacity() ) ; - } - for( size_type i ( 0 ) ; i != size ; ++i ) - { - m_vec.emplace_back( t ) ; - } - return ( m_vec.end() - size ) ; - } - - private: - - EZMgrVL() ; //stop - EZMgrVL( const EZMgrVL& ) ; //stop - EZMgrVL& operator=( const EZMgrVL& ) ; //stop - - const size_type m_vecSize ; - mutable VecType m_vec ; -}; - -#endif diff --git a/Geometry/CommonDetUnit/interface/DetPositioner.h b/Geometry/CommonDetUnit/interface/DetPositioner.h deleted file mode 100644 index c8c1ccbfcbded..0000000000000 --- a/Geometry/CommonDetUnit/interface/DetPositioner.h +++ /dev/null @@ -1 +0,0 @@ -#include "Geometry/CommonTopologies/interface/DetPositioner.h" diff --git a/Geometry/CommonDetUnit/interface/ModifiedSurfaceGenerator.h b/Geometry/CommonDetUnit/interface/ModifiedSurfaceGenerator.h deleted file mode 100644 index 1e75792a720f8..0000000000000 --- a/Geometry/CommonDetUnit/interface/ModifiedSurfaceGenerator.h +++ /dev/null @@ -1 +0,0 @@ -#include "Geometry/CommonTopologies/interface/ModifiedSurfaceGenerator.h" diff --git a/Geometry/CommonDetUnit/interface/MuonGeomDet.h b/Geometry/CommonDetUnit/interface/MuonGeomDet.h deleted file mode 100644 index fe7e63de27f79..0000000000000 --- a/Geometry/CommonDetUnit/interface/MuonGeomDet.h +++ /dev/null @@ -1 +0,0 @@ -#include "Geometry/CommonTopologies/interface/MuonGeomDet.h" From 8d542c219e7179cbbb2efee14b6db081d62738d5 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 14 Oct 2020 19:47:53 +0200 Subject: [PATCH 580/778] Take care of dd4hep flag to initiate GEM geometry in RECO+dd4hep context --- .../Geometry/python/GeometryExtended2021Reco_cff.py | 2 +- .../python/GeometryExtended2021ZeroMaterialReco_cff.py | 2 +- Configuration/Geometry/python/dict2021Geometry.py | 2 +- .../GEMGeometryBuilder/plugins/GEMGeometryESModule.cc | 4 ++++ .../GEMGeometryBuilder/plugins/ME0GeometryESModule.cc | 10 +++++----- Geometry/GEMGeometryBuilder/python/gemGeometry_cff.py | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py index 3e6709e27a6e2..db2635433a24a 100644 --- a/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021Reco_cff.py @@ -39,7 +39,7 @@ # muon from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cff import * from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py b/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py index 4f24b269ace4c..b140d3e3843d2 100644 --- a/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021ZeroMaterialReco_cff.py @@ -39,7 +39,7 @@ # muon from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cff import * from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * diff --git a/Configuration/Geometry/python/dict2021Geometry.py b/Configuration/Geometry/python/dict2021Geometry.py index 2c1a8129aa17a..f08e8b479cc33 100644 --- a/Configuration/Geometry/python/dict2021Geometry.py +++ b/Configuration/Geometry/python/dict2021Geometry.py @@ -1049,7 +1049,7 @@ "reco" : [ 'from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *', 'from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *', - 'from Geometry.GEMGeometryBuilder.gemGeometry_cfi import *', + 'from Geometry.GEMGeometryBuilder.gemGeometry_cff import *', 'from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *', 'from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *', ], diff --git a/Geometry/GEMGeometryBuilder/plugins/GEMGeometryESModule.cc b/Geometry/GEMGeometryBuilder/plugins/GEMGeometryESModule.cc index 74c9e5edd5af8..06ff7003cf968 100644 --- a/Geometry/GEMGeometryBuilder/plugins/GEMGeometryESModule.cc +++ b/Geometry/GEMGeometryBuilder/plugins/GEMGeometryESModule.cc @@ -84,6 +84,7 @@ GEMGeometryESModule::GEMGeometryESModule(const edm::ParameterSet& p) alignmentsToken_ = cc.consumes(edm::ESInputTag{"", alignmentsLabel_}); alignmentErrorsToken_ = cc.consumes(edm::ESInputTag{"", alignmentsLabel_}); } + edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::initailized with flags " << fromDDD_ << ":" << fromDD4hep_; } void GEMGeometryESModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -99,16 +100,19 @@ std::unique_ptr<GEMGeometry> GEMGeometryESModule::produce(const MuonGeometryReco auto gemGeometry = std::make_unique<GEMGeometry>(); if (fromDDD_) { + edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder ddd"; auto cpv = record.getTransientHandle(cpvToken_); const auto& mdc = record.get(mdcToken_); GEMGeometryBuilder builder; builder.build(*gemGeometry, cpv.product(), mdc); } else if (fromDD4hep_) { + edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder dd4hep"; edm::ESTransientHandle<cms::DDCompactView> cpv = record.getTransientHandle(dd4hepcpvToken_); const auto& mdc = record.get(mdcToken_); GEMGeometryBuilder builder; builder.build(*gemGeometry, cpv.product(), mdc); } else { + edm::LogVerbatim("GEMGeometry") << "GEMGeometryESModule::produce :: GEMGeometryBuilder builder db"; const auto& riggem = record.get(riggemToken_); GEMGeometryBuilderFromCondDB builder; builder.build(*gemGeometry, riggem); diff --git a/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc b/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc index 65c32536cb867..d31dcefd24fd3 100644 --- a/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc +++ b/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc @@ -62,6 +62,7 @@ ME0GeometryESModule::ME0GeometryESModule(const edm::ParameterSet& p) { } else { rigme0Token_ = cc.consumes(); } + edm::LogVerbatim("GEMGeometry") << "ME0GeometryESModule::initailized with flags " << fromDDD_ << ":" << fromDD4hep_; } void ME0GeometryESModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -72,22 +73,21 @@ void ME0GeometryESModule::fillDescriptions(edm::ConfigurationDescriptions& descr } std::unique_ptr<ME0Geometry> ME0GeometryESModule::produce(const MuonGeometryRecord& record) { - edm::LogVerbatim("ME0Geometry") << "ME0GeometryESModule::produce with fromDDD = " << fromDDD_ << " fromDD4hep " - << fromDD4hep_; + edm::LogVerbatim("GEMGeometry") << "ME0GeometryESModule::produce with fromDDD = " << fromDDD_ << " fromDD4hep " << fromDD4hep_; if (fromDDD_) { - edm::LogVerbatim("ME0Geometry") << "ME0GeometryESModule::produce :: ME0GeometryBuilder builder"; + edm::LogVerbatim("GEMGeometry") << "ME0GeometryESModule::produce :: ME0GeometryBuilder builder"; auto cpv = record.getTransientHandle(cpvToken_); const auto& mdc = record.get(mdcToken_); ME0GeometryBuilder builder; return std::unique_ptr<ME0Geometry>(builder.build(cpv.product(), mdc)); } else if (fromDD4hep_) { - edm::LogVerbatim("ME0Geometry") << "ME0GeometryESModule::produce :: ME0GeometryBuilder builder DD4hep"; + edm::LogVerbatim("GEMGeometry") << "ME0GeometryESModule::produce :: ME0GeometryBuilder builder DD4hep"; auto cpv = record.getTransientHandle(dd4hepcpvToken_); const auto& mdc = record.get(mdcToken_); ME0GeometryBuilder builder; return std::unique_ptr<ME0Geometry>(builder.build(cpv.product(), mdc)); } else { - edm::LogVerbatim("ME0Geometry") << "ME0GeometryESModule::produce :: ME0GeometryBuilderFromCondDB builder"; + edm::LogVerbatim("GEMGeometry") << "ME0GeometryESModule::produce :: ME0GeometryBuilderFromCondDB builder"; const auto& rigme0 = record.get(rigme0Token_); ME0GeometryBuilderFromCondDB builder; return std::unique_ptr<ME0Geometry>(builder.build(rigme0)); diff --git a/Geometry/GEMGeometryBuilder/python/gemGeometry_cff.py b/Geometry/GEMGeometryBuilder/python/gemGeometry_cff.py index 48ca00b76e161..c8b02c08b82be 100644 --- a/Geometry/GEMGeometryBuilder/python/gemGeometry_cff.py +++ b/Geometry/GEMGeometryBuilder/python/gemGeometry_cff.py @@ -2,4 +2,4 @@ from Configuration.ProcessModifiers.dd4hep_cff import dd4hep -dd4hep.toModify(gemGeometry, fromDDD = False, fromDD4hep = True) +dd4hep.toModify(gemGeometry, fromDDD = False, fromDD4Hep = True) From 1301a4600e7be000b5ac674eff25a5316258d3a8 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Tue, 13 Oct 2020 13:48:17 -0500 Subject: [PATCH 581/778] EventSetupRecord::doGet uses prefetching Changed EventSetupRecord::doGet to work with prefetching. This required the introduction of ESGetTokenGeneric and a new esConsumes method. Added the EDConsumerBase::registerLateConsumes to be able to safely call esConsumes based on the contents of the EventSetup. --- FWCore/Framework/interface/DataProxy.h | 5 - FWCore/Framework/interface/EDConsumerBase.h | 10 + .../interface/ESRecordsToProxyIndices.h | 6 + FWCore/Framework/interface/EventSetupRecord.h | 3 +- .../interface/EventSetupRecordImpl.h | 4 - FWCore/Framework/src/DataProxy.cc | 8 - FWCore/Framework/src/EDConsumerBase.cc | 2 + .../Framework/src/ESRecordsToProxyIndices.cc | 15 +- FWCore/Framework/src/EventSetupRecord.cc | 24 +- FWCore/Framework/src/EventSetupRecordImpl.cc | 43 --- .../test/eventsetuprecord_t.cppunit.cc | 103 +++++-- .../testSubProcess.grep2.txt | 288 +++++++++--------- .../Modules/src/EventSetupRecordDataGetter.cc | 177 ++++++----- .../Utilities/interface/ESGetTokenGeneric.h | 65 ++++ FWCore/Utilities/interface/TypeIDBase.h | 8 +- 15 files changed, 440 insertions(+), 321 deletions(-) create mode 100644 FWCore/Utilities/interface/ESGetTokenGeneric.h diff --git a/FWCore/Framework/interface/DataProxy.h b/FWCore/Framework/interface/DataProxy.h index 91ec762019f40..b63ec30764aae 100644 --- a/FWCore/Framework/interface/DataProxy.h +++ b/FWCore/Framework/interface/DataProxy.h @@ -51,11 +51,6 @@ namespace edm { void prefetchAsync( WaitingTask*, EventSetupRecordImpl const&, DataKey const&, EventSetupImpl const*, ServiceToken const&) const; - void doGet(EventSetupRecordImpl const&, - DataKey const&, - bool iTransiently, - ActivityRegistry const*, - EventSetupImpl const*) const; void const* get(EventSetupRecordImpl const&, DataKey const&, bool iTransiently, diff --git a/FWCore/Framework/interface/EDConsumerBase.h b/FWCore/Framework/interface/EDConsumerBase.h index 040c5ab67a767..e0304ebc5e17e 100644 --- a/FWCore/Framework/interface/EDConsumerBase.h +++ b/FWCore/Framework/interface/EDConsumerBase.h @@ -39,6 +39,7 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Utilities/interface/EDGetToken.h" #include "FWCore/Utilities/interface/ESGetToken.h" +#include "FWCore/Utilities/interface/ESGetTokenGeneric.h" #include "FWCore/Utilities/interface/ESInputTag.h" #include "FWCore/Utilities/interface/SoATuple.h" #include "FWCore/Utilities/interface/Transition.h" @@ -222,7 +223,16 @@ namespace edm { return EDConsumerBaseWithTagESAdaptor<Tr>(this, std::move(tag)); } + ///Used with EventSetupRecord::doGet + template <Transition Tr = Transition::Event> + ESGetTokenGeneric esConsumes(eventsetup::EventSetupRecordKey const& iRecord, eventsetup::DataKey const& iKey) { + return ESGetTokenGeneric(static_cast<unsigned int>(Tr), + recordESConsumes(Tr, iRecord, iKey.type(), ESInputTag("", iKey.name().value())), + iRecord.type()); + } + private: + virtual void registerLateConsumes(eventsetup::ESRecordsToProxyIndices const&) {} unsigned int recordConsumes(BranchType iBranch, TypeToGet const& iType, edm::InputTag const& iTag, bool iAlwaysGets); ESTokenIndex recordESConsumes(Transition, eventsetup::EventSetupRecordKey const&, diff --git a/FWCore/Framework/interface/ESRecordsToProxyIndices.h b/FWCore/Framework/interface/ESRecordsToProxyIndices.h index f13ebd6fac342..b99edc9275a3e 100644 --- a/FWCore/Framework/interface/ESRecordsToProxyIndices.h +++ b/FWCore/Framework/interface/ESRecordsToProxyIndices.h @@ -51,6 +51,12 @@ namespace edm::eventsetup { } ESRecordIndex recordIndexFor(EventSetupRecordKey const& iRK) const noexcept; + + std::pair<std::vector<DataKey>::const_iterator, std::vector<DataKey>::const_iterator> keysForRecord( + EventSetupRecordKey const& iRK) const noexcept; + ///The sorted list of keys + std::vector<EventSetupRecordKey> recordKeys() const noexcept { return recordKeys_; } + // ---------- member functions --------------------------- ///This should be called for all records in the list passed to the constructor and /// in the same order as the list. diff --git a/FWCore/Framework/interface/EventSetupRecord.h b/FWCore/Framework/interface/EventSetupRecord.h index 29f1349a3abf4..b1f4aec4ac81c 100644 --- a/FWCore/Framework/interface/EventSetupRecord.h +++ b/FWCore/Framework/interface/EventSetupRecord.h @@ -45,6 +45,7 @@ #include "FWCore/Framework/interface/ValidityInterval.h" #include "FWCore/Framework/interface/EventSetupRecordImpl.h" #include "FWCore/Utilities/interface/ESGetToken.h" +#include "FWCore/Utilities/interface/ESGetTokenGeneric.h" #include "FWCore/Utilities/interface/ESInputTag.h" #include "FWCore/Utilities/interface/ESIndices.h" #include "FWCore/Utilities/interface/Likely.h" @@ -155,7 +156,7 @@ namespace edm { } ///returns false if no data available for key - bool doGet(DataKey const& aKey, bool aGetTransiently = false) const; + bool doGet(ESGetTokenGeneric const&, bool aGetTransiently = false) const; /**returns true only if someone has already requested data for this key and the data was retrieved diff --git a/FWCore/Framework/interface/EventSetupRecordImpl.h b/FWCore/Framework/interface/EventSetupRecordImpl.h index 5900159cca620..97823f4d18521 100644 --- a/FWCore/Framework/interface/EventSetupRecordImpl.h +++ b/FWCore/Framework/interface/EventSetupRecordImpl.h @@ -85,10 +85,6 @@ namespace edm { ValidityInterval validityInterval() const; - ///returns false if no data available for key - bool doGet(DataKey const& aKey, EventSetupImpl const*, bool aGetTransiently = false) const; - bool doGet(ESProxyIndex iProxyIndex, EventSetupImpl const*, bool aGetTransiently = false) const; - ///prefetch the data to setup for subsequent calls to getImplementation void prefetchAsync(WaitingTask* iTask, ESProxyIndex iProxyIndex, EventSetupImpl const*, ServiceToken const&) const; diff --git a/FWCore/Framework/src/DataProxy.cc b/FWCore/Framework/src/DataProxy.cc index 73fbbd318c0bf..30d265babfc36 100644 --- a/FWCore/Framework/src/DataProxy.cc +++ b/FWCore/Framework/src/DataProxy.cc @@ -115,13 +115,5 @@ namespace edm { return getAfterPrefetch(iRecord, iKey, iTransiently); } - void DataProxy::doGet(const EventSetupRecordImpl& iRecord, - const DataKey& iKey, - bool iTransiently, - ActivityRegistry const* activityRegistry, - EventSetupImpl const* iEventSetupImpl) const { - get(iRecord, iKey, iTransiently, activityRegistry, iEventSetupImpl); - } - } // namespace eventsetup } // namespace edm diff --git a/FWCore/Framework/src/EDConsumerBase.cc b/FWCore/Framework/src/EDConsumerBase.cc index fcf4d53f0f31f..c5f6a4a77424a 100644 --- a/FWCore/Framework/src/EDConsumerBase.cc +++ b/FWCore/Framework/src/EDConsumerBase.cc @@ -193,6 +193,8 @@ void EDConsumerBase::updateLookup(BranchType iBranchType, } void EDConsumerBase::updateLookup(eventsetup::ESRecordsToProxyIndices const& iPI) { + registerLateConsumes(iPI); + unsigned int index = 0; for (auto it = m_esTokenInfo.begin<kESLookupInfo>(); it != m_esTokenInfo.end<kESLookupInfo>(); ++it, ++index) { auto indexInRecord = iPI.indexInRecord(it->m_record, it->m_key); diff --git a/FWCore/Framework/src/ESRecordsToProxyIndices.cc b/FWCore/Framework/src/ESRecordsToProxyIndices.cc index 358a2711f87b9..8fc73aaff6203 100644 --- a/FWCore/Framework/src/ESRecordsToProxyIndices.cc +++ b/FWCore/Framework/src/ESRecordsToProxyIndices.cc @@ -47,8 +47,8 @@ namespace edm::eventsetup { // // const member functions // - ESProxyIndex ESRecordsToProxyIndices::indexInRecord(EventSetupRecordKey const& iRK, DataKey const& iDK) const - noexcept { + ESProxyIndex ESRecordsToProxyIndices::indexInRecord(EventSetupRecordKey const& iRK, + DataKey const& iDK) const noexcept { auto it = std::lower_bound(recordKeys_.begin(), recordKeys_.end(), iRK); if (it == recordKeys_.end() or *it != iRK) { return missingProxyIndex(); @@ -123,4 +123,15 @@ namespace edm::eventsetup { return returnValue; } + std::pair<std::vector<DataKey>::const_iterator, std::vector<DataKey>::const_iterator> + ESRecordsToProxyIndices::keysForRecord(EventSetupRecordKey const& iRK) const noexcept { + auto recIndex = recordIndexFor(iRK); + if (recIndex == missingRecordIndex()) { + return std::make_pair(dataKeys_.end(), dataKeys_.end()); + } + auto const beginIndex = recordOffsets_[recIndex.value()]; + auto const endIndex = recordOffsets_[recIndex.value() + 1]; + return std::make_pair(dataKeys_.begin() + beginIndex, dataKeys_.begin() + endIndex); + } + } // namespace edm::eventsetup diff --git a/FWCore/Framework/src/EventSetupRecord.cc b/FWCore/Framework/src/EventSetupRecord.cc index 1c1b2e3f48797..f4cc3a9ad1eb4 100644 --- a/FWCore/Framework/src/EventSetupRecord.cc +++ b/FWCore/Framework/src/EventSetupRecord.cc @@ -20,6 +20,13 @@ #include "FWCore/Utilities/interface/Exception.h" +namespace { + void throwWrongRecordType(const edm::TypeIDBase& aFromToken, const edm::eventsetup::EventSetupRecordKey& aRecord) { + throw cms::Exception("WrongRecordType") << "A ESGetTokenGeneric token using the record " << aFromToken.name() + << " was passed to record " << aRecord.type().name(); + } +} // namespace + namespace edm { namespace eventsetup { @@ -29,8 +36,21 @@ namespace edm { EventSetupRecord::~EventSetupRecord() {} - bool EventSetupRecord::doGet(const DataKey& aKey, bool aGetTransiently) const { - return impl_->doGet(aKey, eventSetupImpl_, aGetTransiently); + bool EventSetupRecord::doGet(const ESGetTokenGeneric& aToken, bool aGetTransiently) const { + if UNLIKELY (aToken.transitionID() != transitionID()) { + throwWrongTransitionID(); + } + if UNLIKELY (aToken.recordType() != key().type()) { + throwWrongRecordType(aToken.recordType(), key()); + } + auto proxyIndex = getTokenIndices_[aToken.index().value()]; + if UNLIKELY (proxyIndex.value() == std::numeric_limits<int>::max()) { + return false; + } + + const ComponentDescription* cd = nullptr; + DataKey const* dk = nullptr; + return nullptr != impl_->getFromProxyAfterPrefetch(proxyIndex, aGetTransiently, cd, dk); } bool EventSetupRecord::wasGotten(const DataKey& aKey) const { return impl_->wasGotten(aKey); } diff --git a/FWCore/Framework/src/EventSetupRecordImpl.cc b/FWCore/Framework/src/EventSetupRecordImpl.cc index ca3b85b201855..f182dfe547d70 100644 --- a/FWCore/Framework/src/EventSetupRecordImpl.cc +++ b/FWCore/Framework/src/EventSetupRecordImpl.cc @@ -257,49 +257,6 @@ namespace edm { return proxies_[std::distance(keysForProxies_.begin(), lb)].get(); } - bool EventSetupRecordImpl::doGet(const DataKey& aKey, - EventSetupImpl const* iEventSetupImpl, - bool aGetTransiently) const { - const DataProxy* proxy = find(aKey); - if (nullptr != proxy) { - try { - convertException::wrap( - [&]() { proxy->doGet(*this, aKey, aGetTransiently, activityRegistry_, iEventSetupImpl); }); - } catch (cms::Exception& e) { - addTraceInfoToCmsException(e, aKey.name().value(), proxy->providerDescription(), aKey); - //NOTE: the above function can't do the 'throw' since it causes the C++ class type - // of the throw to be changed, a 'rethrow' does not have that problem - throw; - } - } - return nullptr != proxy; - } - - bool EventSetupRecordImpl::doGet(ESProxyIndex iProxyIndex, - EventSetupImpl const* iEventSetupImpl, - bool aGetTransiently) const { - if UNLIKELY (iProxyIndex.value() == std::numeric_limits<int>::max()) { - return false; - } - - const DataProxy* proxy = proxies_[iProxyIndex.value()]; - if (nullptr != proxy) { - try { - convertException::wrap([&]() { - auto const& key = keysForProxies_[iProxyIndex.value()]; - proxy->doGet(*this, key, aGetTransiently, activityRegistry_, iEventSetupImpl); - }); - } catch (cms::Exception& e) { - auto const& key = keysForProxies_[iProxyIndex.value()]; - addTraceInfoToCmsException(e, key.name().value(), proxy->providerDescription(), key); - //NOTE: the above function can't do the 'throw' since it causes the C++ class type - // of the throw to be changed, a 'rethrow' does not have that problem - throw; - } - } - return nullptr != proxy; - } - void EventSetupRecordImpl::prefetchAsync(WaitingTask* iTask, ESProxyIndex iProxyIndex, EventSetupImpl const* iEventSetupImpl, diff --git a/FWCore/Framework/test/eventsetuprecord_t.cppunit.cc b/FWCore/Framework/test/eventsetuprecord_t.cppunit.cc index c212b9ec5f675..e1e76086c439f 100644 --- a/FWCore/Framework/test/eventsetuprecord_t.cppunit.cc +++ b/FWCore/Framework/test/eventsetuprecord_t.cppunit.cc @@ -265,19 +265,42 @@ namespace { ESGetToken<Dummy, DummyRecord> m_token; }; + + struct DummyDataConsumerGeneric : public EDConsumerBase { + explicit DummyDataConsumerGeneric(DataKey const& iKey) + : m_token{esConsumes<>(eventsetup::EventSetupRecordKey::makeKey<DummyRecord>(), iKey)} {} + + void prefetch(eventsetup::EventSetupRecordImpl const& iRec) const { + auto const& proxies = this->esGetTokenIndicesVector(edm::Transition::Event); + for (size_t i = 0; i != proxies.size(); ++i) { + auto waitTask = edm::make_empty_waiting_task(); + waitTask->set_ref_count(2); + iRec.prefetchAsync(waitTask.get(), proxies[i], nullptr, edm::ServiceToken{}); + waitTask->decrement_ref_count(); + waitTask->wait_for_all(); + if (waitTask->exceptionPtr()) { + std::rethrow_exception(*waitTask->exceptionPtr()); + } + } + } + + ESGetTokenGeneric m_token; + }; + } // namespace namespace { - struct SetupRecord { + template <typename CONSUMER> + struct SetupRecordT { eventsetup::EventSetupRecordImpl dummyRecordImpl; - DummyDataConsumer& consumer; + CONSUMER& consumer; //we need the DataKeys to stick around since references are being kept to them std::vector<std::pair<edm::eventsetup::DataKey, edm::eventsetup::DataProxy*>> proxies; - SetupRecord(DummyDataConsumer& iConsumer, - EventSetupRecordKey const& iKey, - ActivityRegistry* iRegistry, - std::vector<std::pair<edm::eventsetup::DataKey, edm::eventsetup::DataProxy*>> iProxies) + SetupRecordT(CONSUMER& iConsumer, + EventSetupRecordKey const& iKey, + ActivityRegistry* iRegistry, + std::vector<std::pair<edm::eventsetup::DataKey, edm::eventsetup::DataProxy*>> iProxies) : dummyRecordImpl(iKey, iRegistry), consumer(iConsumer), proxies(std::move(iProxies)) { for (auto const& d : proxies) { dummyRecordImpl.add(d.first, d.second); @@ -299,6 +322,8 @@ namespace { return ret; } }; + using SetupRecord = SetupRecordT<DummyDataConsumer>; + using SetupGenericRecord = SetupRecordT<DummyDataConsumerGeneric>; } // namespace void testEventsetupRecord::getHandleTest() { @@ -504,29 +529,42 @@ void testEventsetupRecord::getExepTest() { } void testEventsetupRecord::doGetTest() { - eventsetup::EventSetupRecordImpl dummyRecordImpl{dummyRecordKey_, &activityRegistry}; + const DataKey dummyDataKey(DataKey::makeTypeTag<FailingDummyProxy::value_type>(), ""); - FailingDummyProxy dummyProxy; + { + DummyDataConsumerGeneric consumer{dummyDataKey}; - const DataKey dummyDataKey(DataKey::makeTypeTag<FailingDummyProxy::value_type>(), ""); + SetupGenericRecord sr{consumer, dummyRecordKey_, &activityRegistry, {}}; - DummyRecord dummyRecord; - dummyRecord.setImpl(&dummyRecordImpl, 0, nullptr, nullptr, false); - CPPUNIT_ASSERT(!dummyRecord.doGet(dummyDataKey)); + DummyRecord dummyRecord = sr.makeRecord(); - dummyRecordImpl.add(dummyDataKey, &dummyProxy); + CPPUNIT_ASSERT(!dummyRecord.doGet(consumer.m_token)); + } + + FailingDummyProxy dummyProxy; + + { + DummyDataConsumerGeneric consumer{dummyDataKey}; - //dummyRecord.doGet(dummyDataKey); - CPPUNIT_ASSERT_THROW(dummyRecord.doGet(dummyDataKey), ExceptionType); + SetupGenericRecord sr{consumer, dummyRecordKey_, &activityRegistry, {{dummyDataKey, &dummyProxy}}}; + DummyRecord dummyRecord = sr.makeRecord(); + CPPUNIT_ASSERT_THROW(dummyRecord.doGet(consumer.m_token), ExceptionType); + } Dummy myDummy; WorkingDummyProxy workingProxy(&myDummy); const DataKey workingDataKey(DataKey::makeTypeTag<WorkingDummyProxy::value_type>(), "working"); - dummyRecordImpl.add(workingDataKey, &workingProxy); + { + DummyDataConsumerGeneric consumer{workingDataKey}; - CPPUNIT_ASSERT(dummyRecord.doGet(workingDataKey)); + SetupGenericRecord sr{ + consumer, dummyRecordKey_, &activityRegistry, {{dummyDataKey, &dummyProxy}, {workingDataKey, &workingProxy}}}; + + DummyRecord dummyRecord = sr.makeRecord(); + CPPUNIT_ASSERT(dummyRecord.doGet(consumer.m_token)); + } } namespace { @@ -662,21 +700,30 @@ void testEventsetupRecord::introspectionTest() { } void testEventsetupRecord::doGetExepTest() { - eventsetup::EventSetupRecordImpl dummyRecordImpl{dummyRecordKey_, &activityRegistry}; + const DataKey dummyDataKey(DataKey::makeTypeTag<FailingDummyProxy::value_type>(), ""); + { + DummyDataConsumerGeneric consumer{dummyDataKey}; - FailingDummyProxy dummyProxy; + SetupGenericRecord sr{consumer, dummyRecordKey_, &activityRegistry, {}}; - const DataKey dummyDataKey(DataKey::makeTypeTag<FailingDummyProxy::value_type>(), ""); + DummyRecord dummyRecord = sr.makeRecord(); - DummyRecord dummyRecord; - dummyRecord.setImpl(&dummyRecordImpl, 0, nullptr, nullptr, false); - CPPUNIT_ASSERT(!dummyRecord.doGet(dummyDataKey)); + CPPUNIT_ASSERT(!dummyRecord.doGet(consumer.m_token)); + } - dummyRecordImpl.add(dummyDataKey, &dummyProxy); + { + FailingDummyProxy dummyProxy; - //typedef edm::eventsetup::MakeDataException<DummyRecord,Dummy> ExceptionType; - dummyRecord.doGet(dummyDataKey); - //CPPUNIT_ASSERT_THROW(dummyRecord.doGet(dummyDataKey), ExceptionType); + const DataKey dummyDataKey(DataKey::makeTypeTag<FailingDummyProxy::value_type>(), ""); + + DummyDataConsumerGeneric consumer{dummyDataKey}; + + SetupGenericRecord sr{consumer, dummyRecordKey_, &activityRegistry, {{dummyDataKey, &dummyProxy}}}; + + DummyRecord dummyRecord = sr.makeRecord(); + + CPPUNIT_ASSERT(dummyRecord.doGet(consumer.m_token)); + } } void testEventsetupRecord::proxyResetTest() { @@ -703,8 +750,6 @@ void testEventsetupRecord::proxyResetTest() { edm::eventsetup::EventSetupRecordProvider::DataToPreferredProviderMap pref; dummyProvider->usePreferred(pref); - CPPUNIT_ASSERT(dummyRecord.doGet(workingDataKey)); - edm::ESHandle<Dummy> hDummy; dummyRecord.get(hDummy); diff --git a/FWCore/Integration/test/unit_test_outputs/testSubProcess.grep2.txt b/FWCore/Integration/test/unit_test_outputs/testSubProcess.grep2.txt index 2069347e3a3ce..d6b3cc04461c2 100644 --- a/FWCore/Integration/test/unit_test_outputs/testSubProcess.grep2.txt +++ b/FWCore/Integration/test/unit_test_outputs/testSubProcess.grep2.txt @@ -257,6 +257,8 @@ ++++ starting: global begin run 1 : time = 1 ++++++ starting: global begin run for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin run for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin run for module: label = 'get' id = 6 +++++++ finished: global begin run for module: label = 'get' id = 6 ++++++ starting: global begin run for module: label = 'getInt' id = 10 ++++++ finished: global begin run for module: label = 'getInt' id = 10 ++++++ starting: global begin run for module: label = 'noPut' id = 11 @@ -272,6 +274,8 @@ ++++++ finished: global begin run for module: label = 'test' id = 32 ++++++ starting: global begin run for module: label = 'testmerge' id = 33 ++++++ finished: global begin run for module: label = 'testmerge' id = 33 +++++++ starting: global begin run for module: label = 'get' id = 34 +++++++ finished: global begin run for module: label = 'get' id = 34 ++++++ starting: global begin run for module: label = 'getInt' id = 35 ++++++ finished: global begin run for module: label = 'getInt' id = 35 ++++++ starting: global begin run for module: label = 'dependsOnNoPut' id = 36 @@ -283,6 +287,8 @@ ++++++ finished: global begin run for module: label = 'test' id = 19 ++++++ starting: global begin run for module: label = 'testmerge' id = 20 ++++++ finished: global begin run for module: label = 'testmerge' id = 20 +++++++ starting: global begin run for module: label = 'get' id = 21 +++++++ finished: global begin run for module: label = 'get' id = 21 ++++++ starting: global begin run for module: label = 'getInt' id = 22 ++++++ finished: global begin run for module: label = 'getInt' id = 22 ++++++ starting: global begin run for module: label = 'dependsOnNoPut' id = 23 @@ -299,18 +305,12 @@ ++++++ finished: begin run for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin run for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin run for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 6 ++++ finished: begin run: stream = 0 run = 1 time = 1 ++++ starting: begin run: stream = 0 run = 1 time = 1 ++++ finished: begin run: stream = 0 run = 1 time = 1 ++++ starting: begin run: stream = 0 run = 1 time = 1 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 34 ++++ finished: begin run: stream = 0 run = 1 time = 1 ++++ starting: begin run: stream = 0 run = 1 time = 1 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 21 ++++ finished: begin run: stream = 0 run = 1 time = 1 ++++ starting: source lumi ++++ finished: source lumi @@ -321,6 +321,8 @@ ++++ starting: global begin lumi: run = 1 lumi = 1 time = 1 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -336,6 +338,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -347,6 +351,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -363,18 +369,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 1 time = 1 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 1 time = 1 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 1 time = 1 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 1 time = 1 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 1 time = 1 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 1 time = 1 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 1 time = 1 ++++ starting: source event ++++ finished: source event @@ -1035,18 +1035,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 1 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 1 time = 0 ++++ finished: end lumi: stream = 0 run = 1 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 1 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 1 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 1 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 1 lumi = 1 time = 0 ++++ starting: global end lumi: run = 1 lumi = 1 time = 1 ++++ finished: global end lumi: run = 1 lumi = 1 time = 1 @@ -1055,6 +1049,8 @@ ++++ starting: global end lumi: run = 1 lumi = 1 time = 1 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -1070,6 +1066,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -1081,6 +1079,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -1111,6 +1111,8 @@ ++++ starting: global begin lumi: run = 1 lumi = 2 time = 25000001 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -1126,6 +1128,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -1137,6 +1141,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -1153,18 +1159,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 2 time = 25000001 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 2 time = 25000001 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 2 time = 25000001 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 2 time = 25000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 2 time = 25000001 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 2 time = 25000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 2 time = 25000001 ++++ starting: source event ++++ finished: source event @@ -1825,18 +1825,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 1 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 2 time = 0 ++++ finished: end lumi: stream = 0 run = 1 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 2 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 1 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 2 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 1 lumi = 2 time = 0 ++++ starting: global end lumi: run = 1 lumi = 2 time = 25000001 ++++ finished: global end lumi: run = 1 lumi = 2 time = 25000001 @@ -1845,6 +1839,8 @@ ++++ starting: global end lumi: run = 1 lumi = 2 time = 25000001 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -1860,6 +1856,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -1871,6 +1869,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -1901,6 +1901,8 @@ ++++ starting: global begin lumi: run = 1 lumi = 3 time = 45000001 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -1916,6 +1918,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -1927,6 +1931,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -1943,18 +1949,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 3 time = 45000001 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 3 time = 45000001 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 3 time = 45000001 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 3 time = 45000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 3 time = 45000001 ++++ starting: begin lumi: stream = 0 run = 1 lumi = 3 time = 45000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 1 lumi = 3 time = 45000001 ++++ starting: source event ++++ finished: source event @@ -2291,18 +2291,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 1 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 3 time = 0 ++++ finished: end lumi: stream = 0 run = 1 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 3 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 1 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 1 lumi = 3 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 1 lumi = 3 time = 0 ++++ starting: global end lumi: run = 1 lumi = 3 time = 45000001 ++++ finished: global end lumi: run = 1 lumi = 3 time = 45000001 @@ -2311,6 +2305,8 @@ ++++ starting: global end lumi: run = 1 lumi = 3 time = 45000001 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -2326,6 +2322,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -2337,6 +2335,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -2369,18 +2369,12 @@ ++++++ finished: end run for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end run for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end run for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end run for module: stream = 0 label = 'get' id = 6 -++++++ finished: end run for module: stream = 0 label = 'get' id = 6 ++++ finished: end run: stream = 0 run = 1 time = 0 ++++ starting: end run: stream = 0 run = 1 time = 0 ++++ finished: end run: stream = 0 run = 1 time = 0 ++++ starting: end run: stream = 0 run = 1 time = 0 -++++++ starting: end run for module: stream = 0 label = 'get' id = 34 -++++++ finished: end run for module: stream = 0 label = 'get' id = 34 ++++ finished: end run: stream = 0 run = 1 time = 0 ++++ starting: end run: stream = 0 run = 1 time = 0 -++++++ starting: end run for module: stream = 0 label = 'get' id = 21 -++++++ finished: end run for module: stream = 0 label = 'get' id = 21 ++++ finished: end run: stream = 0 run = 1 time = 0 ++++ starting: global end run 1 : time = 50000001 ++++ finished: global end run 1 : time = 50000001 @@ -2389,6 +2383,8 @@ ++++ starting: global end run 1 : time = 0 ++++++ starting: global end run for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end run for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end run for module: label = 'get' id = 6 +++++++ finished: global end run for module: label = 'get' id = 6 ++++++ starting: global end run for module: label = 'getInt' id = 10 ++++++ finished: global end run for module: label = 'getInt' id = 10 ++++++ starting: global end run for module: label = 'noPut' id = 11 @@ -2404,6 +2400,8 @@ ++++++ finished: global end run for module: label = 'testmerge' id = 33 ++++++ starting: global end run for module: label = 'test' id = 32 ++++++ finished: global end run for module: label = 'test' id = 32 +++++++ starting: global end run for module: label = 'get' id = 34 +++++++ finished: global end run for module: label = 'get' id = 34 ++++++ starting: global end run for module: label = 'getInt' id = 35 ++++++ finished: global end run for module: label = 'getInt' id = 35 ++++++ starting: global end run for module: label = 'dependsOnNoPut' id = 36 @@ -2415,6 +2413,8 @@ ++++++ finished: global end run for module: label = 'testmerge' id = 20 ++++++ starting: global end run for module: label = 'test' id = 19 ++++++ finished: global end run for module: label = 'test' id = 19 +++++++ starting: global end run for module: label = 'get' id = 21 +++++++ finished: global end run for module: label = 'get' id = 21 ++++++ starting: global end run for module: label = 'getInt' id = 22 ++++++ finished: global end run for module: label = 'getInt' id = 22 ++++++ starting: global end run for module: label = 'dependsOnNoPut' id = 23 @@ -2445,6 +2445,8 @@ ++++ starting: global begin run 2 : time = 55000001 ++++++ starting: global begin run for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin run for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin run for module: label = 'get' id = 6 +++++++ finished: global begin run for module: label = 'get' id = 6 ++++++ starting: global begin run for module: label = 'getInt' id = 10 ++++++ finished: global begin run for module: label = 'getInt' id = 10 ++++++ starting: global begin run for module: label = 'noPut' id = 11 @@ -2460,6 +2462,8 @@ ++++++ finished: global begin run for module: label = 'test' id = 32 ++++++ starting: global begin run for module: label = 'testmerge' id = 33 ++++++ finished: global begin run for module: label = 'testmerge' id = 33 +++++++ starting: global begin run for module: label = 'get' id = 34 +++++++ finished: global begin run for module: label = 'get' id = 34 ++++++ starting: global begin run for module: label = 'getInt' id = 35 ++++++ finished: global begin run for module: label = 'getInt' id = 35 ++++++ starting: global begin run for module: label = 'dependsOnNoPut' id = 36 @@ -2471,6 +2475,8 @@ ++++++ finished: global begin run for module: label = 'test' id = 19 ++++++ starting: global begin run for module: label = 'testmerge' id = 20 ++++++ finished: global begin run for module: label = 'testmerge' id = 20 +++++++ starting: global begin run for module: label = 'get' id = 21 +++++++ finished: global begin run for module: label = 'get' id = 21 ++++++ starting: global begin run for module: label = 'getInt' id = 22 ++++++ finished: global begin run for module: label = 'getInt' id = 22 ++++++ starting: global begin run for module: label = 'dependsOnNoPut' id = 23 @@ -2487,18 +2493,12 @@ ++++++ finished: begin run for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin run for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin run for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 6 ++++ finished: begin run: stream = 0 run = 2 time = 55000001 ++++ starting: begin run: stream = 0 run = 2 time = 55000001 ++++ finished: begin run: stream = 0 run = 2 time = 55000001 ++++ starting: begin run: stream = 0 run = 2 time = 55000001 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 34 ++++ finished: begin run: stream = 0 run = 2 time = 55000001 ++++ starting: begin run: stream = 0 run = 2 time = 55000001 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 21 ++++ finished: begin run: stream = 0 run = 2 time = 55000001 ++++ starting: source lumi ++++ finished: source lumi @@ -2509,6 +2509,8 @@ ++++ starting: global begin lumi: run = 2 lumi = 1 time = 55000001 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -2524,6 +2526,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -2535,6 +2539,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -2551,18 +2557,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 1 time = 55000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 1 time = 55000001 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 1 time = 55000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 1 time = 55000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 1 time = 55000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 1 time = 55000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 1 time = 55000001 ++++ starting: source event ++++ finished: source event @@ -3223,18 +3223,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 2 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 1 time = 0 ++++ finished: end lumi: stream = 0 run = 2 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 1 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 2 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 1 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 2 lumi = 1 time = 0 ++++ starting: global end lumi: run = 2 lumi = 1 time = 55000001 ++++ finished: global end lumi: run = 2 lumi = 1 time = 55000001 @@ -3243,6 +3237,8 @@ ++++ starting: global end lumi: run = 2 lumi = 1 time = 55000001 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -3258,6 +3254,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -3269,6 +3267,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -3299,6 +3299,8 @@ ++++ starting: global begin lumi: run = 2 lumi = 2 time = 75000001 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -3314,6 +3316,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -3325,6 +3329,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -3341,18 +3347,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 2 time = 75000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 2 time = 75000001 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 2 time = 75000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 2 time = 75000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 2 time = 75000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 2 time = 75000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 2 time = 75000001 ++++ starting: source event ++++ finished: source event @@ -4013,18 +4013,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 2 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 2 time = 0 ++++ finished: end lumi: stream = 0 run = 2 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 2 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 2 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 2 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 2 lumi = 2 time = 0 ++++ starting: global end lumi: run = 2 lumi = 2 time = 75000001 ++++ finished: global end lumi: run = 2 lumi = 2 time = 75000001 @@ -4033,6 +4027,8 @@ ++++ starting: global end lumi: run = 2 lumi = 2 time = 75000001 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -4048,6 +4044,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -4059,6 +4057,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -4089,6 +4089,8 @@ ++++ starting: global begin lumi: run = 2 lumi = 3 time = 95000001 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -4104,6 +4106,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -4115,6 +4119,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -4131,18 +4137,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 3 time = 95000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 3 time = 95000001 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 3 time = 95000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 3 time = 95000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 3 time = 95000001 ++++ starting: begin lumi: stream = 0 run = 2 lumi = 3 time = 95000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 2 lumi = 3 time = 95000001 ++++ starting: source event ++++ finished: source event @@ -4479,18 +4479,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 2 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 3 time = 0 ++++ finished: end lumi: stream = 0 run = 2 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 3 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 2 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 2 lumi = 3 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 2 lumi = 3 time = 0 ++++ starting: global end lumi: run = 2 lumi = 3 time = 95000001 ++++ finished: global end lumi: run = 2 lumi = 3 time = 95000001 @@ -4499,6 +4493,8 @@ ++++ starting: global end lumi: run = 2 lumi = 3 time = 95000001 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -4514,6 +4510,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -4525,6 +4523,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -4557,18 +4557,12 @@ ++++++ finished: end run for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end run for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end run for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end run for module: stream = 0 label = 'get' id = 6 -++++++ finished: end run for module: stream = 0 label = 'get' id = 6 ++++ finished: end run: stream = 0 run = 2 time = 0 ++++ starting: end run: stream = 0 run = 2 time = 0 ++++ finished: end run: stream = 0 run = 2 time = 0 ++++ starting: end run: stream = 0 run = 2 time = 0 -++++++ starting: end run for module: stream = 0 label = 'get' id = 34 -++++++ finished: end run for module: stream = 0 label = 'get' id = 34 ++++ finished: end run: stream = 0 run = 2 time = 0 ++++ starting: end run: stream = 0 run = 2 time = 0 -++++++ starting: end run for module: stream = 0 label = 'get' id = 21 -++++++ finished: end run for module: stream = 0 label = 'get' id = 21 ++++ finished: end run: stream = 0 run = 2 time = 0 ++++ starting: global end run 2 : time = 100000001 ++++ finished: global end run 2 : time = 100000001 @@ -4577,6 +4571,8 @@ ++++ starting: global end run 2 : time = 0 ++++++ starting: global end run for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end run for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end run for module: label = 'get' id = 6 +++++++ finished: global end run for module: label = 'get' id = 6 ++++++ starting: global end run for module: label = 'getInt' id = 10 ++++++ finished: global end run for module: label = 'getInt' id = 10 ++++++ starting: global end run for module: label = 'noPut' id = 11 @@ -4592,6 +4588,8 @@ ++++++ finished: global end run for module: label = 'testmerge' id = 33 ++++++ starting: global end run for module: label = 'test' id = 32 ++++++ finished: global end run for module: label = 'test' id = 32 +++++++ starting: global end run for module: label = 'get' id = 34 +++++++ finished: global end run for module: label = 'get' id = 34 ++++++ starting: global end run for module: label = 'getInt' id = 35 ++++++ finished: global end run for module: label = 'getInt' id = 35 ++++++ starting: global end run for module: label = 'dependsOnNoPut' id = 36 @@ -4603,6 +4601,8 @@ ++++++ finished: global end run for module: label = 'testmerge' id = 20 ++++++ starting: global end run for module: label = 'test' id = 19 ++++++ finished: global end run for module: label = 'test' id = 19 +++++++ starting: global end run for module: label = 'get' id = 21 +++++++ finished: global end run for module: label = 'get' id = 21 ++++++ starting: global end run for module: label = 'getInt' id = 22 ++++++ finished: global end run for module: label = 'getInt' id = 22 ++++++ starting: global end run for module: label = 'dependsOnNoPut' id = 23 @@ -4633,6 +4633,8 @@ ++++ starting: global begin run 3 : time = 105000001 ++++++ starting: global begin run for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin run for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin run for module: label = 'get' id = 6 +++++++ finished: global begin run for module: label = 'get' id = 6 ++++++ starting: global begin run for module: label = 'getInt' id = 10 ++++++ finished: global begin run for module: label = 'getInt' id = 10 ++++++ starting: global begin run for module: label = 'noPut' id = 11 @@ -4648,6 +4650,8 @@ ++++++ finished: global begin run for module: label = 'test' id = 32 ++++++ starting: global begin run for module: label = 'testmerge' id = 33 ++++++ finished: global begin run for module: label = 'testmerge' id = 33 +++++++ starting: global begin run for module: label = 'get' id = 34 +++++++ finished: global begin run for module: label = 'get' id = 34 ++++++ starting: global begin run for module: label = 'getInt' id = 35 ++++++ finished: global begin run for module: label = 'getInt' id = 35 ++++++ starting: global begin run for module: label = 'dependsOnNoPut' id = 36 @@ -4659,6 +4663,8 @@ ++++++ finished: global begin run for module: label = 'test' id = 19 ++++++ starting: global begin run for module: label = 'testmerge' id = 20 ++++++ finished: global begin run for module: label = 'testmerge' id = 20 +++++++ starting: global begin run for module: label = 'get' id = 21 +++++++ finished: global begin run for module: label = 'get' id = 21 ++++++ starting: global begin run for module: label = 'getInt' id = 22 ++++++ finished: global begin run for module: label = 'getInt' id = 22 ++++++ starting: global begin run for module: label = 'dependsOnNoPut' id = 23 @@ -4675,18 +4681,12 @@ ++++++ finished: begin run for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin run for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin run for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 6 ++++ finished: begin run: stream = 0 run = 3 time = 105000001 ++++ starting: begin run: stream = 0 run = 3 time = 105000001 ++++ finished: begin run: stream = 0 run = 3 time = 105000001 ++++ starting: begin run: stream = 0 run = 3 time = 105000001 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 34 ++++ finished: begin run: stream = 0 run = 3 time = 105000001 ++++ starting: begin run: stream = 0 run = 3 time = 105000001 -++++++ starting: begin run for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin run for module: stream = 0 label = 'get' id = 21 ++++ finished: begin run: stream = 0 run = 3 time = 105000001 ++++ starting: source lumi ++++ finished: source lumi @@ -4697,6 +4697,8 @@ ++++ starting: global begin lumi: run = 3 lumi = 1 time = 105000001 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -4712,6 +4714,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -4723,6 +4727,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -4739,18 +4745,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 1 time = 105000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 1 time = 105000001 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 1 time = 105000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 1 time = 105000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 1 time = 105000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 1 time = 105000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 1 time = 105000001 ++++ starting: source event ++++ finished: source event @@ -5411,18 +5411,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 3 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 1 time = 0 ++++ finished: end lumi: stream = 0 run = 3 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 1 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 3 lumi = 1 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 1 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 3 lumi = 1 time = 0 ++++ starting: global end lumi: run = 3 lumi = 1 time = 105000001 ++++ finished: global end lumi: run = 3 lumi = 1 time = 105000001 @@ -5431,6 +5425,8 @@ ++++ starting: global end lumi: run = 3 lumi = 1 time = 105000001 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -5446,6 +5442,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -5457,6 +5455,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -5487,6 +5487,8 @@ ++++ starting: global begin lumi: run = 3 lumi = 2 time = 125000001 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -5502,6 +5504,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -5513,6 +5517,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -5529,18 +5535,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 2 time = 125000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 2 time = 125000001 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 2 time = 125000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 2 time = 125000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 2 time = 125000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 2 time = 125000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 2 time = 125000001 ++++ starting: source event ++++ finished: source event @@ -6201,18 +6201,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 3 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 2 time = 0 ++++ finished: end lumi: stream = 0 run = 3 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 2 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 3 lumi = 2 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 2 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 3 lumi = 2 time = 0 ++++ starting: global end lumi: run = 3 lumi = 2 time = 125000001 ++++ finished: global end lumi: run = 3 lumi = 2 time = 125000001 @@ -6221,6 +6215,8 @@ ++++ starting: global end lumi: run = 3 lumi = 2 time = 125000001 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -6236,6 +6232,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -6247,6 +6245,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -6277,6 +6277,8 @@ ++++ starting: global begin lumi: run = 3 lumi = 3 time = 145000001 ++++++ starting: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global begin lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global begin lumi for module: label = 'get' id = 6 +++++++ finished: global begin lumi for module: label = 'get' id = 6 ++++++ starting: global begin lumi for module: label = 'getInt' id = 10 ++++++ finished: global begin lumi for module: label = 'getInt' id = 10 ++++++ starting: global begin lumi for module: label = 'noPut' id = 11 @@ -6292,6 +6294,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 32 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 33 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 33 +++++++ starting: global begin lumi for module: label = 'get' id = 34 +++++++ finished: global begin lumi for module: label = 'get' id = 34 ++++++ starting: global begin lumi for module: label = 'getInt' id = 35 ++++++ finished: global begin lumi for module: label = 'getInt' id = 35 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 36 @@ -6303,6 +6307,8 @@ ++++++ finished: global begin lumi for module: label = 'test' id = 19 ++++++ starting: global begin lumi for module: label = 'testmerge' id = 20 ++++++ finished: global begin lumi for module: label = 'testmerge' id = 20 +++++++ starting: global begin lumi for module: label = 'get' id = 21 +++++++ finished: global begin lumi for module: label = 'get' id = 21 ++++++ starting: global begin lumi for module: label = 'getInt' id = 22 ++++++ finished: global begin lumi for module: label = 'getInt' id = 22 ++++++ starting: global begin lumi for module: label = 'dependsOnNoPut' id = 23 @@ -6319,18 +6325,12 @@ ++++++ finished: begin lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: begin lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: begin lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 3 time = 145000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 3 time = 145000001 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 3 time = 145000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 3 time = 145000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 3 time = 145000001 ++++ starting: begin lumi: stream = 0 run = 3 lumi = 3 time = 145000001 -++++++ starting: begin lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: begin lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: begin lumi: stream = 0 run = 3 lumi = 3 time = 145000001 ++++ starting: source event ++++ finished: source event @@ -6667,18 +6667,12 @@ ++++++ finished: end lumi for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end lumi for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end lumi for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 6 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 6 ++++ finished: end lumi: stream = 0 run = 3 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 3 time = 0 ++++ finished: end lumi: stream = 0 run = 3 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 3 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 34 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 34 ++++ finished: end lumi: stream = 0 run = 3 lumi = 3 time = 0 ++++ starting: end lumi: stream = 0 run = 3 lumi = 3 time = 0 -++++++ starting: end lumi for module: stream = 0 label = 'get' id = 21 -++++++ finished: end lumi for module: stream = 0 label = 'get' id = 21 ++++ finished: end lumi: stream = 0 run = 3 lumi = 3 time = 0 ++++ starting: global end lumi: run = 3 lumi = 3 time = 145000001 ++++ finished: global end lumi: run = 3 lumi = 3 time = 145000001 @@ -6687,6 +6681,8 @@ ++++ starting: global end lumi: run = 3 lumi = 3 time = 145000001 ++++++ starting: global end lumi for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end lumi for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end lumi for module: label = 'get' id = 6 +++++++ finished: global end lumi for module: label = 'get' id = 6 ++++++ starting: global end lumi for module: label = 'getInt' id = 10 ++++++ finished: global end lumi for module: label = 'getInt' id = 10 ++++++ starting: global end lumi for module: label = 'noPut' id = 11 @@ -6702,6 +6698,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 33 ++++++ starting: global end lumi for module: label = 'test' id = 32 ++++++ finished: global end lumi for module: label = 'test' id = 32 +++++++ starting: global end lumi for module: label = 'get' id = 34 +++++++ finished: global end lumi for module: label = 'get' id = 34 ++++++ starting: global end lumi for module: label = 'getInt' id = 35 ++++++ finished: global end lumi for module: label = 'getInt' id = 35 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 36 @@ -6713,6 +6711,8 @@ ++++++ finished: global end lumi for module: label = 'testmerge' id = 20 ++++++ starting: global end lumi for module: label = 'test' id = 19 ++++++ finished: global end lumi for module: label = 'test' id = 19 +++++++ starting: global end lumi for module: label = 'get' id = 21 +++++++ finished: global end lumi for module: label = 'get' id = 21 ++++++ starting: global end lumi for module: label = 'getInt' id = 22 ++++++ finished: global end lumi for module: label = 'getInt' id = 22 ++++++ starting: global end lumi for module: label = 'dependsOnNoPut' id = 23 @@ -6745,18 +6745,12 @@ ++++++ finished: end run for module: stream = 0 label = 'putInt2' id = 8 ++++++ starting: end run for module: stream = 0 label = 'putInt' id = 7 ++++++ finished: end run for module: stream = 0 label = 'putInt' id = 7 -++++++ starting: end run for module: stream = 0 label = 'get' id = 6 -++++++ finished: end run for module: stream = 0 label = 'get' id = 6 ++++ finished: end run: stream = 0 run = 3 time = 0 ++++ starting: end run: stream = 0 run = 3 time = 0 ++++ finished: end run: stream = 0 run = 3 time = 0 ++++ starting: end run: stream = 0 run = 3 time = 0 -++++++ starting: end run for module: stream = 0 label = 'get' id = 34 -++++++ finished: end run for module: stream = 0 label = 'get' id = 34 ++++ finished: end run: stream = 0 run = 3 time = 0 ++++ starting: end run: stream = 0 run = 3 time = 0 -++++++ starting: end run for module: stream = 0 label = 'get' id = 21 -++++++ finished: end run for module: stream = 0 label = 'get' id = 21 ++++ finished: end run: stream = 0 run = 3 time = 0 ++++ starting: global end run 3 : time = 150000001 ++++ finished: global end run 3 : time = 150000001 @@ -6765,6 +6759,8 @@ ++++ starting: global end run 3 : time = 0 ++++++ starting: global end run for module: label = 'thingWithMergeProducer' id = 5 ++++++ finished: global end run for module: label = 'thingWithMergeProducer' id = 5 +++++++ starting: global end run for module: label = 'get' id = 6 +++++++ finished: global end run for module: label = 'get' id = 6 ++++++ starting: global end run for module: label = 'getInt' id = 10 ++++++ finished: global end run for module: label = 'getInt' id = 10 ++++++ starting: global end run for module: label = 'noPut' id = 11 @@ -6780,6 +6776,8 @@ ++++++ finished: global end run for module: label = 'testmerge' id = 33 ++++++ starting: global end run for module: label = 'test' id = 32 ++++++ finished: global end run for module: label = 'test' id = 32 +++++++ starting: global end run for module: label = 'get' id = 34 +++++++ finished: global end run for module: label = 'get' id = 34 ++++++ starting: global end run for module: label = 'getInt' id = 35 ++++++ finished: global end run for module: label = 'getInt' id = 35 ++++++ starting: global end run for module: label = 'dependsOnNoPut' id = 36 @@ -6791,6 +6789,8 @@ ++++++ finished: global end run for module: label = 'testmerge' id = 20 ++++++ starting: global end run for module: label = 'test' id = 19 ++++++ finished: global end run for module: label = 'test' id = 19 +++++++ starting: global end run for module: label = 'get' id = 21 +++++++ finished: global end run for module: label = 'get' id = 21 ++++++ starting: global end run for module: label = 'getInt' id = 22 ++++++ finished: global end run for module: label = 'getInt' id = 22 ++++++ starting: global end run for module: label = 'dependsOnNoPut' id = 23 diff --git a/FWCore/Modules/src/EventSetupRecordDataGetter.cc b/FWCore/Modules/src/EventSetupRecordDataGetter.cc index fb6f799a781ae..555564b7d3f08 100644 --- a/FWCore/Modules/src/EventSetupRecordDataGetter.cc +++ b/FWCore/Modules/src/EventSetupRecordDataGetter.cc @@ -24,38 +24,50 @@ #include <iostream> // user include files -#include "FWCore/Framework/interface/stream/EDAnalyzer.h" +#include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Framework/interface/EventSetupRecord.h" +#include "FWCore/Framework/interface/ESRecordsToProxyIndices.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Utilities/interface/ESGetTokenGeneric.h" // // class decleration // namespace edm { - class EventSetupRecordDataGetter : public edm::stream::EDAnalyzer<> { + class EventSetupRecordDataGetter + : public edm::global::EDAnalyzer<edm::RunCache<std::nullptr_t>, edm::LuminosityBlockCache<std::nullptr_t>> { public: explicit EventSetupRecordDataGetter(ParameterSet const&); ~EventSetupRecordDataGetter() override; - void analyze(Event const&, EventSetup const&) override; - void beginRun(Run const&, EventSetup const&) override; - void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&) override; + void analyze(edm::StreamID, Event const&, EventSetup const&) const final; + std::shared_ptr<std::nullptr_t> globalBeginRun(edm::Run const&, edm::EventSetup const&) const final; + void globalEndRun(edm::Run const&, edm::EventSetup const&) const final {} + + std::shared_ptr<std::nullptr_t> globalBeginLuminosityBlock(edm::LuminosityBlock const&, + edm::EventSetup const&) const final; + void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) const final {} static void fillDescriptions(ConfigurationDescriptions& descriptions); private: - void doGet(EventSetup const&); + void registerLateConsumes(eventsetup::ESRecordsToProxyIndices const&) final; + + using RecordToTokens = std::map<eventsetup::EventSetupRecordKey, std::vector<ESGetTokenGeneric>>; + void doGet(EventSetup const&, RecordToTokens const&) const; // ----------member data --------------------------- const ParameterSet pSet_; - typedef std::map<eventsetup::EventSetupRecordKey, std::vector<eventsetup::DataKey> > RecordToDataKeys; + typedef std::map<eventsetup::EventSetupRecordKey, std::vector<eventsetup::DataKey>> RecordToDataKeys; RecordToDataKeys recordToDataKeys_; - std::map<eventsetup::EventSetupRecordKey, unsigned long long> recordToCacheIdentifier_; + RecordToTokens recordToTokensRuns_; + RecordToTokens recordToTokensLumis_; + mutable std::map<eventsetup::EventSetupRecordKey, std::atomic<unsigned long long>> recordToCacheIdentifier_; const bool verbose_; }; @@ -88,7 +100,7 @@ namespace edm { ParameterSetDescription toGet; toGet.add<std::string>("record")->setComment( "The name of an EventSetup record holding the data you want obtained."); - toGet.add<std::vector<std::string> >("data")->setComment( + toGet.add<std::vector<std::string>>("data")->setComment( "The identifier for the data you wish to retrieve. " "The identifier is in two parts separated by a backslash '/'. " "The first part is the C++ class name of the data and the " @@ -110,103 +122,110 @@ namespace edm { descriptions.add("getEventSetupData", desc); } - void EventSetupRecordDataGetter::beginRun(Run const&, EventSetup const& iSetup) { doGet(iSetup); } - - void EventSetupRecordDataGetter::beginLuminosityBlock(LuminosityBlock const&, EventSetup const& iSetup) { - doGet(iSetup); + std::shared_ptr<std::nullptr_t> EventSetupRecordDataGetter::globalBeginRun(Run const&, + EventSetup const& iSetup) const { + doGet(iSetup, recordToTokensRuns_); + return {}; } - void EventSetupRecordDataGetter::analyze(edm::Event const& /*iEvent*/, edm::EventSetup const& iSetup) { - doGet(iSetup); + std::shared_ptr<std::nullptr_t> EventSetupRecordDataGetter::globalBeginLuminosityBlock( + LuminosityBlock const&, EventSetup const& iSetup) const { + doGet(iSetup, recordToTokensLumis_); + return {}; } - void EventSetupRecordDataGetter::doGet(EventSetup const& iSetup) { - if (recordToDataKeys_.empty()) { - typedef std::vector<ParameterSet> Parameters; - Parameters const& toGet = pSet_.getParameterSetVector("toGet"); + void EventSetupRecordDataGetter::analyze(edm::StreamID, + edm::Event const& /*iEvent*/, + edm::EventSetup const& iSetup) const {} - for (Parameters::const_iterator itToGet = toGet.begin(), itToGetEnd = toGet.end(); itToGet != itToGetEnd; - ++itToGet) { - std::string recordName = itToGet->getParameter<std::string>("record"); + void EventSetupRecordDataGetter::registerLateConsumes(eventsetup::ESRecordsToProxyIndices const& iInfo) { + auto const& toGet = pSet_.getParameterSetVector("toGet"); - eventsetup::EventSetupRecordKey recordKey(eventsetup::EventSetupRecordKey::TypeTag::findType(recordName)); - if (recordKey.type() == eventsetup::EventSetupRecordKey::TypeTag()) { - //record not found - edm::LogWarning("DataGetter") << "Record \"" << recordName << "\" does not exist " << std::endl; + for (auto const& iGet : toGet) { + std::string recordName = iGet.getParameter<std::string>("record"); - continue; + eventsetup::EventSetupRecordKey recordKey(eventsetup::EventSetupRecordKey::TypeTag::findType(recordName)); + if (recordKey.type() == eventsetup::EventSetupRecordKey::TypeTag()) { + //record not found + edm::LogWarning("DataGetter") << "Record \"" << recordName << "\" does not exist " << std::endl; + + continue; + } + auto dataNames = iGet.getParameter<std::vector<std::string>>("data"); + std::vector<eventsetup::DataKey> dataKeys; + for (auto const& datum : dataNames) { + std::string datumName(datum, 0, datum.find_first_of('/')); + std::string labelName; + if (datum.size() != datumName.size()) { + labelName = std::string(datum, datumName.size() + 1); } - typedef std::vector<std::string> Strings; - Strings dataNames = itToGet->getParameter<Strings>("data"); - std::vector<eventsetup::DataKey> dataKeys; - for (Strings::iterator itDatum = dataNames.begin(), itDatumEnd = dataNames.end(); itDatum != itDatumEnd; - ++itDatum) { - std::string datumName(*itDatum, 0, itDatum->find_first_of("/")); - std::string labelName; - if (itDatum->size() != datumName.size()) { - labelName = std::string(*itDatum, datumName.size() + 1); - } - eventsetup::TypeTag datumType = eventsetup::TypeTag::findType(datumName); - if (datumType == eventsetup::TypeTag()) { - //not found - edm::LogWarning("DataGetter") << "data item of type \"" << datumName << "\" does not exist" << std::endl; + eventsetup::TypeTag datumType = eventsetup::TypeTag::findType(datumName); + if (datumType == eventsetup::TypeTag()) { + //not found + edm::LogWarning("DataGetter") << "data item of type \"" << datumName << "\" does not exist" << std::endl; - continue; - } - eventsetup::DataKey datumKey(datumType, labelName.c_str()); - dataKeys.push_back(datumKey); + continue; } - recordToDataKeys_.insert(std::make_pair(recordKey, dataKeys)); - recordToCacheIdentifier_.insert(std::make_pair(recordKey, 0)); + eventsetup::DataKey datumKey(datumType, labelName.c_str()); + dataKeys.push_back(datumKey); } - if (toGet.empty()) { - //This means we should get everything in the EventSetup - std::vector<eventsetup::EventSetupRecordKey> recordKeys; - iSetup.fillAvailableRecordKeys(recordKeys); - std::vector<eventsetup::DataKey> dataKeys; - - for (std::vector<eventsetup::EventSetupRecordKey>::iterator itRKey = recordKeys.begin(), - itRKeyEnd = recordKeys.end(); - itRKey != itRKeyEnd; - ++itRKey) { - auto record = iSetup.find(*itRKey); - assert(record); - dataKeys.clear(); - record->fillRegisteredDataKeys(dataKeys); - recordToDataKeys_.insert(std::make_pair(*itRKey, dataKeys)); - recordToCacheIdentifier_.insert(std::make_pair(*itRKey, 0)); - } + recordToDataKeys_.insert(std::make_pair(recordKey, dataKeys)); + recordToCacheIdentifier_.insert(std::make_pair(recordKey, 0)); + } + if (toGet.empty()) { + //This means we should get everything in the EventSetup + std::vector<eventsetup::EventSetupRecordKey> recordKeys = iInfo.recordKeys(); + + for (auto const& rKey : recordKeys) { + auto range = iInfo.keysForRecord(rKey); + recordToDataKeys_.insert(std::make_pair(rKey, std::vector<eventsetup::DataKey>(range.first, range.second))); + recordToCacheIdentifier_.insert(std::make_pair(rKey, 0)); } } + for (auto const& r : recordToDataKeys_) { + auto& runs = recordToTokensRuns_[r.first]; + auto& lumis = recordToTokensLumis_[r.first]; + runs.reserve(r.second.size()); + lumis.reserve(r.second.size()); + for (auto const& dk : r.second) { + runs.push_back(esConsumes<edm::Transition::BeginRun>(r.first, dk)); + lumis.push_back(esConsumes<edm::Transition::BeginLuminosityBlock>(r.first, dk)); + } + } + } + void EventSetupRecordDataGetter::doGet(EventSetup const& iSetup, RecordToTokens const& iRecordToTokens) const { using namespace edm::eventsetup; //For each requested Record get the requested data only if the Record is in a new IOV - for (RecordToDataKeys::iterator itRecord = recordToDataKeys_.begin(), itRecordEnd = recordToDataKeys_.end(); - itRecord != itRecordEnd; - ++itRecord) { - auto pRecord = iSetup.find(itRecord->first); + for (auto const& record : recordToDataKeys_) { + auto pRecord = iSetup.find(record.first); if (not pRecord) { edm::LogWarning("RecordNotInIOV") - << "The EventSetup Record '" << itRecord->first.name() << "' is not available for this IOV."; + << "The EventSetup Record '" << record.first.name() << "' is not available for this IOV."; } - if (pRecord.has_value() && pRecord->cacheIdentifier() != recordToCacheIdentifier_[itRecord->first]) { - recordToCacheIdentifier_[itRecord->first] = pRecord->cacheIdentifier(); - typedef std::vector<DataKey> Keys; - Keys const& keys = itRecord->second; - for (Keys::const_iterator itKey = keys.begin(), itKeyEnd = keys.end(); itKey != itKeyEnd; ++itKey) { - if (!pRecord->doGet(*itKey)) { + auto const& tokens = iRecordToTokens.find(record.first)->second; + auto ci = recordToCacheIdentifier_[record.first].load(); + if (pRecord.has_value() && pRecord->cacheIdentifier() != ci) { + recordToCacheIdentifier_[record.first].compare_exchange_strong(ci, pRecord->cacheIdentifier()); + auto const& keys = record.second; + size_t i = 0; + for (auto const& token : tokens) { + if (!pRecord->doGet(token)) { + auto const& key = keys[i]; edm::LogWarning("DataGetter") - << "No data of type \"" << itKey->type().name() << "\" with name \"" << itKey->name().value() - << "\" in record " << itRecord->first.type().name() << " found " << std::endl; + << "No data of type \"" << key.type().name() << "\" with name \"" << key.name().value() + << "\" in record " << record.first.type().name() << " found " << std::endl; } else { if (verbose_) { + auto const& key = keys[i]; edm::LogSystem("DataGetter") - << "got data of type \"" << itKey->type().name() << "\" with name \"" << itKey->name().value() - << "\" in record " << itRecord->first.type().name() << std::endl; + << "got data of type \"" << key.type().name() << "\" with name \"" << key.name().value() + << "\" in record " << record.first.type().name() << std::endl; } } + ++i; } } } diff --git a/FWCore/Utilities/interface/ESGetTokenGeneric.h b/FWCore/Utilities/interface/ESGetTokenGeneric.h new file mode 100644 index 0000000000000..83642996f9988 --- /dev/null +++ b/FWCore/Utilities/interface/ESGetTokenGeneric.h @@ -0,0 +1,65 @@ +#ifndef FWCore_Utilities_ESGetTokenGeneric_h +#define FWCore_Utilities_ESGetTokenGeneric_h +// -*- C++ -*- +// +// Package: FWCore/Utilities +// Class : ESGetTokenGeneric +// +/**\class ESGetTokenGeneric ESGetTokenGeneric.h "FWCore/Utilities/interface/ESGetTokenGeneric.h" + + Description: A token used call EventSetupRecord::doGet + + Usage: + An ESGetTokenGeneric is created by calls to 'esConsumes' from an ED module. +*/ + +#include "FWCore/Utilities/interface/ESIndices.h" +#include "FWCore/Utilities/interface/TypeIDBase.h" +#include <limits> + +namespace edm { + class EDConsumerBase; + class EventSetup; + class EventSetupImpl; + namespace eventsetup { + class EventSetupRecord; + } + + // A ESGetTokenGeneric is created by calls to 'esConsumes' from an EDM + // module. + class ESGetTokenGeneric { + friend class EDConsumerBase; + friend class EventSetup; + friend class EventSetupImpl; + friend class eventsetup::EventSetupRecord; + + public: + constexpr ESGetTokenGeneric() noexcept = default; + + constexpr ESGetTokenGeneric(ESGetTokenGeneric const&) noexcept = default; + constexpr ESGetTokenGeneric(ESGetTokenGeneric&&) noexcept = default; + + constexpr ESGetTokenGeneric& operator=(ESGetTokenGeneric&&) noexcept = default; + constexpr ESGetTokenGeneric& operator=(ESGetTokenGeneric const&) noexcept = default; + + constexpr unsigned int transitionID() const noexcept { return m_transitionID; } + constexpr TypeIDBase const& recordType() const noexcept { return m_recordType; } + constexpr bool isInitialized() const noexcept { return transitionID() != std::numeric_limits<unsigned int>::max(); } + constexpr ESTokenIndex index() const noexcept { return m_index; } + constexpr bool hasValidIndex() const noexcept { return index() != invalidIndex(); } + static constexpr ESTokenIndex invalidIndex() noexcept { return ESTokenIndex{std::numeric_limits<int>::max()}; } + + private: + explicit constexpr ESGetTokenGeneric(unsigned int transitionID, + ESTokenIndex index, + TypeIDBase const& recordType) noexcept + : m_recordType{recordType}, m_transitionID{transitionID}, m_index{index} {} + + TypeIDBase m_recordType{}; + unsigned int m_transitionID{std::numeric_limits<unsigned int>::max()}; + ESTokenIndex m_index{std::numeric_limits<int>::max()}; + }; + +} // namespace edm + +#endif diff --git a/FWCore/Utilities/interface/TypeIDBase.h b/FWCore/Utilities/interface/TypeIDBase.h index fd728d8edbc93..b2c282237e6dc 100644 --- a/FWCore/Utilities/interface/TypeIDBase.h +++ b/FWCore/Utilities/interface/TypeIDBase.h @@ -30,11 +30,11 @@ namespace edm { public: struct Def {}; - TypeIDBase() : t_(&(typeid(Def))) {} + constexpr TypeIDBase() noexcept : t_(&(typeid(Def))) {} - explicit TypeIDBase(const std::type_info& t) : t_(&t) {} + constexpr explicit TypeIDBase(const std::type_info& t) noexcept : t_(&t) {} - explicit TypeIDBase(const std::type_info* t) : t_(t == nullptr ? &(typeid(Def)) : t) {} + constexpr explicit TypeIDBase(const std::type_info* t) noexcept : t_(t == nullptr ? &(typeid(Def)) : t) {} // ---------- const member functions --------------------- @@ -47,7 +47,7 @@ namespace edm { bool operator==(const TypeIDBase& b) const { return (*t_) == *(b.t_); } protected: - const std::type_info& typeInfo() const { return *t_; } + constexpr const std::type_info& typeInfo() const { return *t_; } private: //const TypeIDBase& operator=(const TypeIDBase&); // stop default From 5a61615116ebf70926032810ef06597ff96762d1 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 14 Oct 2020 20:00:56 +0200 Subject: [PATCH 582/778] Code check --- Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc b/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc index d31dcefd24fd3..d9483a1dc00f9 100644 --- a/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc +++ b/Geometry/GEMGeometryBuilder/plugins/ME0GeometryESModule.cc @@ -73,7 +73,8 @@ void ME0GeometryESModule::fillDescriptions(edm::ConfigurationDescriptions& descr } std::unique_ptr<ME0Geometry> ME0GeometryESModule::produce(const MuonGeometryRecord& record) { - edm::LogVerbatim("GEMGeometry") << "ME0GeometryESModule::produce with fromDDD = " << fromDDD_ << " fromDD4hep " << fromDD4hep_; + edm::LogVerbatim("GEMGeometry") << "ME0GeometryESModule::produce with fromDDD = " << fromDDD_ << " fromDD4hep " + << fromDD4hep_; if (fromDDD_) { edm::LogVerbatim("GEMGeometry") << "ME0GeometryESModule::produce :: ME0GeometryBuilder builder"; auto cpv = record.getTransientHandle(cpvToken_); From ebb037f742519620f01f02853ca76e30595138cf Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 14 Oct 2020 14:42:13 -0500 Subject: [PATCH 583/778] Removed unnecessary use of openmp compiler directive for test --- DataFormats/Common/test/BuildFile.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/DataFormats/Common/test/BuildFile.xml b/DataFormats/Common/test/BuildFile.xml index 4d5948b944282..d8cede3486326 100644 --- a/DataFormats/Common/test/BuildFile.xml +++ b/DataFormats/Common/test/BuildFile.xml @@ -39,7 +39,6 @@ </bin> <bin file="DetSetNewTS_t.cpp"> - <flags CXXFLAGS="-fopenmp"/> </bin> <bin file="MapOfVectors_t.cpp"> From ed129d8f97e6ba52d6936cbb5c58f5c8165e8f5e Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar <tkmudholkar@gmail.com> Date: Thu, 15 Oct 2020 01:29:31 +0200 Subject: [PATCH 584/778] Fixes to allow concurrent processing online (and pass unit test). --- DQM/EcalCommon/interface/EcalDQMonitor.h | 7 +++-- DQM/EcalMonitorTasks/interface/ClusterTask.h | 2 +- DQM/EcalMonitorTasks/interface/DQWorkerTask.h | 2 +- .../interface/EcalDQMonitorTask.h | 6 ++-- DQM/EcalMonitorTasks/interface/EnergyTask.h | 3 +- .../interface/IntegrityTask.h | 2 +- DQM/EcalMonitorTasks/interface/LaserTask.h | 2 +- DQM/EcalMonitorTasks/interface/LedTask.h | 2 +- .../interface/OccupancyTask.h | 2 +- .../interface/PresampleTask.h | 2 +- DQM/EcalMonitorTasks/interface/RawDataTask.h | 3 +- .../interface/SelectiveReadoutTask.h | 2 +- DQM/EcalMonitorTasks/interface/TimingTask.h | 3 +- DQM/EcalMonitorTasks/interface/TrigPrimTask.h | 4 +-- .../plugins/EcalDQMonitorTask.cc | 26 +++++++++++++---- DQM/EcalMonitorTasks/src/ClusterTask.cc | 2 +- DQM/EcalMonitorTasks/src/EnergyTask.cc | 7 +++-- DQM/EcalMonitorTasks/src/IntegrityTask.cc | 12 +++++--- DQM/EcalMonitorTasks/src/LaserTask.cc | 2 +- DQM/EcalMonitorTasks/src/LedTask.cc | 2 +- DQM/EcalMonitorTasks/src/OccupancyTask.cc | 14 ++++++---- DQM/EcalMonitorTasks/src/PresampleTask.cc | 19 ++++++++----- DQM/EcalMonitorTasks/src/RawDataTask.cc | 14 ++++------ .../src/SelectiveReadoutTask.cc | 2 +- DQM/EcalMonitorTasks/src/TimingTask.cc | 16 ++++------- DQM/EcalMonitorTasks/src/TrigPrimTask.cc | 28 +++++++++---------- 26 files changed, 102 insertions(+), 84 deletions(-) diff --git a/DQM/EcalCommon/interface/EcalDQMonitor.h b/DQM/EcalCommon/interface/EcalDQMonitor.h index d014edad453f0..0bb3cbde3b3d8 100644 --- a/DQM/EcalCommon/interface/EcalDQMonitor.h +++ b/DQM/EcalCommon/interface/EcalDQMonitor.h @@ -17,7 +17,10 @@ namespace edm { } // namespace edm namespace ecaldqm { - struct NoCache {}; + struct EcalLSCache { + std::map<std::string, bool> ByLumiPlotsResetSwitches; + bool lhcStatusSet_; + }; class EcalDQMonitor { public: @@ -41,7 +44,7 @@ namespace ecaldqm { std::vector<DQWorker *> workers_; std::string const moduleName_; - int const verbosity_; + const int verbosity_; }; template <typename FuncOnWorker> diff --git a/DQM/EcalMonitorTasks/interface/ClusterTask.h b/DQM/EcalMonitorTasks/interface/ClusterTask.h index 9783f072d107b..f7f2ccd017666 100644 --- a/DQM/EcalMonitorTasks/interface/ClusterTask.h +++ b/DQM/EcalMonitorTasks/interface/ClusterTask.h @@ -26,7 +26,7 @@ namespace ecaldqm { void addDependencies(DependencySet&) override; - void beginEvent(edm::Event const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; void endEvent(edm::Event const&, edm::EventSetup const&) override; bool analyze(void const*, Collections) override; diff --git a/DQM/EcalMonitorTasks/interface/DQWorkerTask.h b/DQM/EcalMonitorTasks/interface/DQWorkerTask.h index 17eeb697205e5..baee9090c5468 100644 --- a/DQM/EcalMonitorTasks/interface/DQWorkerTask.h +++ b/DQM/EcalMonitorTasks/interface/DQWorkerTask.h @@ -77,7 +77,7 @@ namespace ecaldqm { static void fillDescriptions(edm::ParameterSetDescription&); - virtual void beginEvent(edm::Event const&, edm::EventSetup const&) {} + virtual void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) {} virtual void endEvent(edm::Event const&, edm::EventSetup const&) {} virtual bool filterRunType(short const*) { return true; }; diff --git a/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h b/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h index eba669fdbeee0..8420e4d6e97f2 100644 --- a/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h +++ b/DQM/EcalMonitorTasks/interface/EcalDQMonitorTask.h @@ -15,7 +15,7 @@ namespace edm { class ParameterSetDescription; } // namespace edm -class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::NoCache>>, +class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::EcalLSCache>>, public ecaldqm::EcalDQMonitor { public: EcalDQMonitorTask(edm::ParameterSet const&); @@ -28,8 +28,8 @@ class EcalDQMonitorTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecal private: void dqmEndRun(edm::Run const&, edm::EventSetup const&) override; - std::shared_ptr<ecaldqm::NoCache> globalBeginLuminosityBlock(edm::LuminosityBlock const&, - edm::EventSetup const&) const override; + std::shared_ptr<ecaldqm::EcalLSCache> globalBeginLuminosityBlock(edm::LuminosityBlock const&, + edm::EventSetup const&) const override; void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; void analyze(edm::Event const&, edm::EventSetup const&) override; diff --git a/DQM/EcalMonitorTasks/interface/EnergyTask.h b/DQM/EcalMonitorTasks/interface/EnergyTask.h index 65db3519a0fe1..79cdd54ac6028 100644 --- a/DQM/EcalMonitorTasks/interface/EnergyTask.h +++ b/DQM/EcalMonitorTasks/interface/EnergyTask.h @@ -14,8 +14,7 @@ namespace ecaldqm { bool filterRunType(short const*) override; - void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; void runOnRecHits(EcalRecHitCollection const&); diff --git a/DQM/EcalMonitorTasks/interface/IntegrityTask.h b/DQM/EcalMonitorTasks/interface/IntegrityTask.h index 12ea52085dff8..aa92ba2509469 100644 --- a/DQM/EcalMonitorTasks/interface/IntegrityTask.h +++ b/DQM/EcalMonitorTasks/interface/IntegrityTask.h @@ -15,7 +15,7 @@ namespace ecaldqm { IntegrityTask(); ~IntegrityTask() override {} - void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; diff --git a/DQM/EcalMonitorTasks/interface/LaserTask.h b/DQM/EcalMonitorTasks/interface/LaserTask.h index cc92ad773ae1c..17ee4a7c8de33 100644 --- a/DQM/EcalMonitorTasks/interface/LaserTask.h +++ b/DQM/EcalMonitorTasks/interface/LaserTask.h @@ -22,7 +22,7 @@ namespace ecaldqm { void beginRun(edm::Run const&, edm::EventSetup const&) override; void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - void beginEvent(edm::Event const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; diff --git a/DQM/EcalMonitorTasks/interface/LedTask.h b/DQM/EcalMonitorTasks/interface/LedTask.h index 6b7a33b5b7e6c..5535b62bd4d71 100644 --- a/DQM/EcalMonitorTasks/interface/LedTask.h +++ b/DQM/EcalMonitorTasks/interface/LedTask.h @@ -22,7 +22,7 @@ namespace ecaldqm { void beginRun(edm::Run const&, edm::EventSetup const&) override; void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - void beginEvent(edm::Event const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; diff --git a/DQM/EcalMonitorTasks/interface/OccupancyTask.h b/DQM/EcalMonitorTasks/interface/OccupancyTask.h index 2ab22d558bd44..5f28e6173d041 100644 --- a/DQM/EcalMonitorTasks/interface/OccupancyTask.h +++ b/DQM/EcalMonitorTasks/interface/OccupancyTask.h @@ -15,7 +15,7 @@ namespace ecaldqm { bool filterRunType(short const*) override; - void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; diff --git a/DQM/EcalMonitorTasks/interface/PresampleTask.h b/DQM/EcalMonitorTasks/interface/PresampleTask.h index e4bce5d61b7d3..cf65593ab3f0c 100644 --- a/DQM/EcalMonitorTasks/interface/PresampleTask.h +++ b/DQM/EcalMonitorTasks/interface/PresampleTask.h @@ -14,13 +14,13 @@ namespace ecaldqm { bool filterRunType(short const*) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; template <typename DigiCollection> void runOnDigis(DigiCollection const&); private: - void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; void setParams(edm::ParameterSet const&) override; bool doPulseMaxCheck_; diff --git a/DQM/EcalMonitorTasks/interface/RawDataTask.h b/DQM/EcalMonitorTasks/interface/RawDataTask.h index 5892550bd2d39..e62eaf70d24fe 100644 --- a/DQM/EcalMonitorTasks/interface/RawDataTask.h +++ b/DQM/EcalMonitorTasks/interface/RawDataTask.h @@ -17,8 +17,7 @@ namespace ecaldqm { void addDependencies(DependencySet&) override; void beginRun(edm::Run const&, edm::EventSetup const&) override; - void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - void beginEvent(edm::Event const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; diff --git a/DQM/EcalMonitorTasks/interface/SelectiveReadoutTask.h b/DQM/EcalMonitorTasks/interface/SelectiveReadoutTask.h index 7adaa8505b118..dae6c5bd77da9 100644 --- a/DQM/EcalMonitorTasks/interface/SelectiveReadoutTask.h +++ b/DQM/EcalMonitorTasks/interface/SelectiveReadoutTask.h @@ -23,7 +23,7 @@ namespace ecaldqm { void addDependencies(DependencySet&) override; void beginRun(edm::Run const&, edm::EventSetup const&) override; - void beginEvent(edm::Event const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; diff --git a/DQM/EcalMonitorTasks/interface/TimingTask.h b/DQM/EcalMonitorTasks/interface/TimingTask.h index fd3d73e6f9f4b..e0fa74d96034c 100644 --- a/DQM/EcalMonitorTasks/interface/TimingTask.h +++ b/DQM/EcalMonitorTasks/interface/TimingTask.h @@ -20,8 +20,7 @@ namespace ecaldqm { void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const&); private: - void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - void beginEvent(edm::Event const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; void setParams(edm::ParameterSet const&) override; std::vector<int> bxBinEdges_; diff --git a/DQM/EcalMonitorTasks/interface/TrigPrimTask.h b/DQM/EcalMonitorTasks/interface/TrigPrimTask.h index e546b08d774c5..d23cf75195227 100644 --- a/DQM/EcalMonitorTasks/interface/TrigPrimTask.h +++ b/DQM/EcalMonitorTasks/interface/TrigPrimTask.h @@ -24,8 +24,7 @@ namespace ecaldqm { void addDependencies(DependencySet&) override; void beginRun(edm::Run const&, edm::EventSetup const&) override; - void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - void beginEvent(edm::Event const&, edm::EventSetup const&) override; + void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override; bool analyze(void const*, Collections) override; @@ -60,7 +59,6 @@ namespace ecaldqm { edm::InputTag lhcStatusInfoCollectionTag_; edm::EDGetTokenT<TCDSRecord> lhcStatusInfoRecordToken_; - bool lhcStatusSet_; }; inline bool TrigPrimTask::analyze(void const* _p, Collections _collection) { diff --git a/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc b/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc index 79868b8a0f42c..be91d9afd06af 100644 --- a/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc +++ b/DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc @@ -25,7 +25,7 @@ #include <sstream> EcalDQMonitorTask::EcalDQMonitorTask(edm::ParameterSet const& _ps) - : DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::NoCache> >(), + : DQMOneEDAnalyzer<edm::LuminosityBlockCache<ecaldqm::EcalLSCache>>(), ecaldqm::EcalDQMonitor(_ps), schedule_(), allowMissingCollections_(_ps.getUntrackedParameter<bool>("allowMissingCollections")), @@ -119,10 +119,19 @@ void EcalDQMonitorTask::dqmEndRun(edm::Run const& _run, edm::EventSetup const& _ executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms"); } -std::shared_ptr<ecaldqm::NoCache> EcalDQMonitorTask::globalBeginLuminosityBlock(edm::LuminosityBlock const& _lumi, - edm::EventSetup const& _es) const { +std::shared_ptr<ecaldqm::EcalLSCache> EcalDQMonitorTask::globalBeginLuminosityBlock(edm::LuminosityBlock const& _lumi, + edm::EventSetup const& _es) const { + std::shared_ptr<ecaldqm::EcalLSCache> tmpCache = std::make_shared<ecaldqm::EcalLSCache>(); + executeOnWorkers_( + [&tmpCache](ecaldqm::DQWorker* worker) { (tmpCache->ByLumiPlotsResetSwitches)[worker->getName()] = true; }, + "globalBeginLuminosityBlock"); + if (this->verbosity_ > 2) + edm::LogInfo("EcalDQM") << "Set LS cache."; + + // Reset lhcStatusSet_ to false at the beginning of each LS; when LHC status is set in some event this variable will be set to tru + tmpCache->lhcStatusSet_ = false; ecaldqmBeginLuminosityBlock(_lumi, _es); - return nullptr; + return tmpCache; } void EcalDQMonitorTask::globalEndLuminosityBlock(edm::LuminosityBlock const& _lumi, edm::EventSetup const& _es) { @@ -187,13 +196,18 @@ void EcalDQMonitorTask::analyze(edm::Event const& _evt, edm::EventSetup const& _ ++processedEvents_; // start event processing + auto lumiCache = luminosityBlockCache(_evt.getLuminosityBlock().index()); executeOnWorkers_( - [&_evt, &_es, &enabledTasks](ecaldqm::DQWorker* worker) { + [&_evt, &_es, &enabledTasks, &lumiCache](ecaldqm::DQWorker* worker) { if (enabledTasks.find(worker) != enabledTasks.end()) { if (worker->onlineMode()) worker->setTime(time(nullptr)); worker->setEventNumber(_evt.id().event()); - static_cast<ecaldqm::DQWorkerTask*>(worker)->beginEvent(_evt, _es); + bool ByLumiResetSwitch = (lumiCache->ByLumiPlotsResetSwitches).at(worker->getName()); + bool lhcStatusSet = lumiCache->lhcStatusSet_; + static_cast<ecaldqm::DQWorkerTask*>(worker)->beginEvent(_evt, _es, ByLumiResetSwitch, lhcStatusSet); + (lumiCache->ByLumiPlotsResetSwitches)[worker->getName()] = false; + lumiCache->lhcStatusSet_ = lhcStatusSet; } }, "beginEvent"); diff --git a/DQM/EcalMonitorTasks/src/ClusterTask.cc b/DQM/EcalMonitorTasks/src/ClusterTask.cc index e6b3e73435393..3e3e38110b316 100644 --- a/DQM/EcalMonitorTasks/src/ClusterTask.cc +++ b/DQM/EcalMonitorTasks/src/ClusterTask.cc @@ -74,7 +74,7 @@ namespace ecaldqm { _dependencies.push_back(Dependency(kEESuperCluster, kEERecHit)); } - void ClusterTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es) { + void ClusterTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es, bool const&, bool&) { if (!doExtra_) return; diff --git a/DQM/EcalMonitorTasks/src/EnergyTask.cc b/DQM/EcalMonitorTasks/src/EnergyTask.cc index 7c3ed6d8e03e0..8171b9a662d15 100644 --- a/DQM/EcalMonitorTasks/src/EnergyTask.cc +++ b/DQM/EcalMonitorTasks/src/EnergyTask.cc @@ -26,9 +26,10 @@ namespace ecaldqm { return false; } - void EnergyTask::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) { - // Reset by LS plots at beginning of every LS - MEs_.at("HitMapAllByLumi").reset(); + void EnergyTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es, bool const& ByLumiResetSwitch, bool&) { + if (ByLumiResetSwitch) { + MEs_.at("HitMapAllByLumi").reset(); + } } void EnergyTask::runOnRecHits(EcalRecHitCollection const& _hits) { diff --git a/DQM/EcalMonitorTasks/src/IntegrityTask.cc b/DQM/EcalMonitorTasks/src/IntegrityTask.cc index a634a17fb127c..80257f02b9c70 100644 --- a/DQM/EcalMonitorTasks/src/IntegrityTask.cc +++ b/DQM/EcalMonitorTasks/src/IntegrityTask.cc @@ -6,10 +6,14 @@ namespace ecaldqm { IntegrityTask::IntegrityTask() : DQWorkerTask() {} - void IntegrityTask::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) { - // Reset by LS plots at beginning of every LS - MEs_.at("MapByLumi").reset(); - MEs_.at("ByLumi").reset(); + void IntegrityTask::beginEvent(edm::Event const& _evt, + edm::EventSetup const& _es, + bool const& ByLumiResetSwitch, + bool&) { + if (ByLumiResetSwitch) { + MEs_.at("MapByLumi").reset(); + MEs_.at("ByLumi").reset(); + } } template <typename IDCollection> diff --git a/DQM/EcalMonitorTasks/src/LaserTask.cc b/DQM/EcalMonitorTasks/src/LaserTask.cc index e73a097bbeb86..a6abcfaec086a 100644 --- a/DQM/EcalMonitorTasks/src/LaserTask.cc +++ b/DQM/EcalMonitorTasks/src/LaserTask.cc @@ -60,7 +60,7 @@ namespace ecaldqm { emptyLS_ = -1; } - void LaserTask::beginEvent(edm::Event const& _evt, edm::EventSetup const&) { pnAmp_.clear(); } + void LaserTask::beginEvent(edm::Event const& _evt, edm::EventSetup const&, bool const&, bool&) { pnAmp_.clear(); } void LaserTask::runOnRawData(EcalRawDataCollection const& _rawData) { MESet& meCalibStatus(MEs_.at("CalibStatus")); diff --git a/DQM/EcalMonitorTasks/src/LedTask.cc b/DQM/EcalMonitorTasks/src/LedTask.cc index 3f354fa71504e..98c06f270b938 100644 --- a/DQM/EcalMonitorTasks/src/LedTask.cc +++ b/DQM/EcalMonitorTasks/src/LedTask.cc @@ -61,7 +61,7 @@ namespace ecaldqm { emptyLS_ = -1; } - void LedTask::beginEvent(edm::Event const&, edm::EventSetup const&) { pnAmp_.clear(); } + void LedTask::beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) { pnAmp_.clear(); } void LedTask::runOnRawData(EcalRawDataCollection const& _rawData) { MESet& meCalibStatus(MEs_.at("CalibStatus")); diff --git a/DQM/EcalMonitorTasks/src/OccupancyTask.cc b/DQM/EcalMonitorTasks/src/OccupancyTask.cc index aedc914de1d19..23a7fd608be0a 100644 --- a/DQM/EcalMonitorTasks/src/OccupancyTask.cc +++ b/DQM/EcalMonitorTasks/src/OccupancyTask.cc @@ -25,11 +25,15 @@ namespace ecaldqm { return false; } - void OccupancyTask::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) { - // Reset by LS plots at beginning of every LS - MEs_.at("DigiAllByLumi").reset(); - MEs_.at("TPDigiThrAllByLumi").reset(); - MEs_.at("RecHitThrAllByLumi").reset(); + void OccupancyTask::beginEvent(edm::Event const& _evt, + edm::EventSetup const& _es, + bool const& ByLumiResetSwitch, + bool&) { + if (ByLumiResetSwitch) { + MEs_.at("DigiAllByLumi").reset(); + MEs_.at("TPDigiThrAllByLumi").reset(); + MEs_.at("RecHitThrAllByLumi").reset(); + } } void OccupancyTask::runOnRawData(EcalRawDataCollection const& _dcchs) { diff --git a/DQM/EcalMonitorTasks/src/PresampleTask.cc b/DQM/EcalMonitorTasks/src/PresampleTask.cc index 5ce6dfea7e069..ff0ff2a642ca2 100644 --- a/DQM/EcalMonitorTasks/src/PresampleTask.cc +++ b/DQM/EcalMonitorTasks/src/PresampleTask.cc @@ -28,13 +28,18 @@ namespace ecaldqm { return false; } - void PresampleTask::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) { - // Fill separate MEs with only 10 LSs worth of stats - // Used to correctly fill Presample Trend plots: - // 1 pt:10 LS in Trend plots - mePedestalByLS = &MEs_.at("PedestalByLS"); - if (timestamp_.iLumi % 10 == 0) - mePedestalByLS->reset(); + void PresampleTask::beginEvent(edm::Event const& _evt, + edm::EventSetup const& _es, + bool const& ByLumiResetSwitch, + bool&) { + if (ByLumiResetSwitch) { + // Fill separate MEs with only 10 LSs worth of stats + // Used to correctly fill Presample Trend plots: + // 1 pt:10 LS in Trend plots + mePedestalByLS = &MEs_.at("PedestalByLS"); + if (timestamp_.iLumi % 10 == 0) + mePedestalByLS->reset(); + } } template <typename DigiCollection> diff --git a/DQM/EcalMonitorTasks/src/RawDataTask.cc b/DQM/EcalMonitorTasks/src/RawDataTask.cc index d372d8e3700b2..92a4fa6d9dffa 100644 --- a/DQM/EcalMonitorTasks/src/RawDataTask.cc +++ b/DQM/EcalMonitorTasks/src/RawDataTask.cc @@ -20,19 +20,17 @@ namespace ecaldqm { void RawDataTask::beginRun(edm::Run const& _run, edm::EventSetup const&) { runNumber_ = _run.run(); } - void RawDataTask::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) { - // Reset by LS plots at beginning of every LS - MEs_.at("DesyncByLumi").reset(); - MEs_.at("FEByLumi").reset(); - MEs_.at("FEStatusErrMapByLumi").reset(); - } - - void RawDataTask::beginEvent(edm::Event const& _evt, edm::EventSetup const&) { + void RawDataTask::beginEvent(edm::Event const& _evt, edm::EventSetup const&, bool const& ByLumiResetSwitch, bool&) { orbit_ = _evt.orbitNumber() & 0xffffffff; bx_ = _evt.bunchCrossing() & 0xfff; triggerType_ = _evt.experimentType() & 0xf; l1A_ = 0; feL1Offset_ = _evt.isRealData() ? 1 : 0; + if (ByLumiResetSwitch) { + MEs_.at("DesyncByLumi").reset(); + MEs_.at("FEByLumi").reset(); + MEs_.at("FEStatusErrMapByLumi").reset(); + } } void RawDataTask::runOnSource(FEDRawDataCollection const& _fedRaw) { diff --git a/DQM/EcalMonitorTasks/src/SelectiveReadoutTask.cc b/DQM/EcalMonitorTasks/src/SelectiveReadoutTask.cc index 132e92c810f85..d53ed47e5b67a 100644 --- a/DQM/EcalMonitorTasks/src/SelectiveReadoutTask.cc +++ b/DQM/EcalMonitorTasks/src/SelectiveReadoutTask.cc @@ -59,7 +59,7 @@ namespace ecaldqm { } } - void SelectiveReadoutTask::beginEvent(edm::Event const&, edm::EventSetup const&) { + void SelectiveReadoutTask::beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) { flags_.assign(nRU, -1); suppressed_.clear(); } diff --git a/DQM/EcalMonitorTasks/src/TimingTask.cc b/DQM/EcalMonitorTasks/src/TimingTask.cc index 8840ed345cf26..55d329bd8accc 100644 --- a/DQM/EcalMonitorTasks/src/TimingTask.cc +++ b/DQM/EcalMonitorTasks/src/TimingTask.cc @@ -47,19 +47,15 @@ namespace ecaldqm { return false; } - void TimingTask::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) { - // Fill separate MEs with only 10 LSs worth of stats - // Used to correctly fill Presample Trend plots: - // 1 pt:10 LS in Trend plots - meTimeMapByLS = &MEs_.at("TimeMapByLS"); - if (timestamp_.iLumi % 10 == 0) - meTimeMapByLS->reset(); - } - - void TimingTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es) { + void TimingTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es, bool const& ByLumiResetSwitch, bool&) { using namespace std; std::vector<int>::iterator pBin = std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing()); bxBin_ = static_cast<int>(pBin - bxBinEdges_.begin()) - 0.5; + if (ByLumiResetSwitch) { + meTimeMapByLS = &MEs_.at("TimeMapByLS"); + if (timestamp_.iLumi % 10 == 0) + meTimeMapByLS->reset(); + } } void TimingTask::runOnRecHits(EcalRecHitCollection const& _hits, Collections _collection) { diff --git a/DQM/EcalMonitorTasks/src/TrigPrimTask.cc b/DQM/EcalMonitorTasks/src/TrigPrimTask.cc index 71717336b28c0..cbfea87b9d335 100644 --- a/DQM/EcalMonitorTasks/src/TrigPrimTask.cc +++ b/DQM/EcalMonitorTasks/src/TrigPrimTask.cc @@ -24,8 +24,7 @@ namespace ecaldqm { bxBinEdges_{{1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565}}, bxBin_(0.), towerReadouts_(), - lhcStatusInfoCollectionTag_(), - lhcStatusSet_(false) {} + lhcStatusInfoCollectionTag_() {} void TrigPrimTask::setParams(edm::ParameterSet const& _params) { runOnEmul_ = _params.getUntrackedParameter<bool>("runOnEmul"); @@ -54,32 +53,31 @@ namespace ecaldqm { _es.get<EcalTPGStripStatusRcd>().get(StripStatusRcd); } - void TrigPrimTask::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) { - // Reset by LS plots at beginning of every LS - MEs_.at("EtSummaryByLumi").reset(); - MEs_.at("TTFlags4ByLumi").reset(); - MEs_.at("LHCStatusByLumi").reset(-1); - - // Reset lhcStatusSet_ to false at the beginning of each LS; when LHC status is set in some event this variable will be set to true - lhcStatusSet_ = false; - } - - void TrigPrimTask::beginEvent(edm::Event const& _evt, edm::EventSetup const& _es) { + void TrigPrimTask::beginEvent(edm::Event const& _evt, + edm::EventSetup const& _es, + bool const& ByLumiResetSwitch, + bool& lhcStatusSet) { using namespace std; towerReadouts_.clear(); - if (!lhcStatusSet_) { + if (!lhcStatusSet) { // Update LHC status once each LS MESet& meLHCStatusByLumi(static_cast<MESet&>(MEs_.at("LHCStatusByLumi"))); edm::Handle<TCDSRecord> tcdsData; _evt.getByToken(lhcStatusInfoRecordToken_, tcdsData); if (tcdsData.isValid()) { meLHCStatusByLumi.fill(double(tcdsData->getBST().getBeamMode())); - lhcStatusSet_ = true; + lhcStatusSet = true; } } + if (ByLumiResetSwitch) { + MEs_.at("EtSummaryByLumi").reset(); + MEs_.at("TTFlags4ByLumi").reset(); + MEs_.at("LHCStatusByLumi").reset(-1); + } + realTps_ = nullptr; // HLTCaloBit_ = false; From 8f715453140d57984ec94b5408c68e08be64fece Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Thu, 15 Oct 2020 00:06:50 +0200 Subject: [PATCH 585/778] Add ConfigurationDescriptions and ParameterSetDescription to framework forward declarations --- FWCore/Framework/interface/Frameworkfwd.h | 2 ++ FWCore/Framework/interface/FrameworkfwdMostUsed.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/FWCore/Framework/interface/Frameworkfwd.h b/FWCore/Framework/interface/Frameworkfwd.h index c28051ffd5779..19c76de6fcc8d 100644 --- a/FWCore/Framework/interface/Frameworkfwd.h +++ b/FWCore/Framework/interface/Frameworkfwd.h @@ -12,6 +12,7 @@ Forward declarations of types in the EDM. namespace edm { class PrincipalGetAdapter; + class ConfigurationDescriptions; class ConsumesCollector; class DelayedReader; class EDAnalyzer; @@ -34,6 +35,7 @@ namespace edm { class OutputModule; struct OutputModuleDescription; class ParameterSet; + class ParameterSetDescription; class Principal; class PrincipalCache; class PrincipalGetAdapter; diff --git a/FWCore/Framework/interface/FrameworkfwdMostUsed.h b/FWCore/Framework/interface/FrameworkfwdMostUsed.h index 3e8afc93ecb87..99528f6b9fd4f 100644 --- a/FWCore/Framework/interface/FrameworkfwdMostUsed.h +++ b/FWCore/Framework/interface/FrameworkfwdMostUsed.h @@ -8,10 +8,12 @@ Forward declarations of types in the EDM that are most frequently used. ----------------------------------------------------------------------*/ namespace edm { class ConsumesCollector; + class ConfigurationDescriptions; class Event; class EventSetup; class LuminosityBlock; class ParameterSet; + class ParameterSetDescription; class ProcessBlock; class Run; class StreamID; From 282f4c894a3ea96e98957d790ed71bb7b7ea9a80 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Wed, 14 Oct 2020 00:35:43 +0200 Subject: [PATCH 586/778] Migrate rest of CSCTFTrackProducer to EventSetup consumes --- .../CSCTrackFinder/interface/CSCTFPtLUT.h | 29 +++++++++++---- .../interface/CSCTFSectorProcessor.h | 29 ++++++++++----- .../plugins/CSCTFTrackProducer.cc | 6 +-- .../plugins/CSCTFTrackProducer.h | 1 + L1Trigger/CSCTrackFinder/src/CSCTFPtLUT.cc | 37 ++++++++----------- .../src/CSCTFSectorProcessor.cc | 21 +++++++---- .../CSCTrackFinder/src/CSCTFTrackBuilder.cc | 5 +-- .../CSCTrackFinder/src/CSCTFTrackBuilder.h | 9 ++++- 8 files changed, 82 insertions(+), 55 deletions(-) diff --git a/L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h b/L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h index 5676d196af833..ed07274e9eb2c 100644 --- a/L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h +++ b/L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h @@ -1,20 +1,33 @@ #ifndef CSCTrackFinder_CSCTFPtLUT_h #define CSCTrackFinder_CSCTFPtLUT_h -#include <FWCore/ParameterSet/interface/ParameterSet.h> -#include <L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h> -#include <CondFormats/L1TObjects/interface/L1MuTriggerScales.h> -#include <CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h> -#include <L1Trigger/CSCTrackFinder/interface/CSCTFPtMethods.h> -#include <FWCore/ParameterSet/interface/FileInPath.h> +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTrackFinderDataTypes.h" +#include "CondFormats/L1TObjects/interface/L1MuCSCPtLut.h" +#include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h" +#include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h" +#include "CondFormats/DataRecord/interface/L1MuCSCPtLutRcd.h" +#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" +#include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTFPtMethods.h" +#include "FWCore/ParameterSet/interface/FileInPath.h" ///KK -#include <FWCore/Framework/interface/EventSetup.h> +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/EventSetup.h" /// class CSCTFPtLUT { public: + struct Tokens { + edm::ESGetToken<L1MuCSCPtLut, L1MuCSCPtLutRcd> ptLUT; + edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> scales; + edm::ESGetToken<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd> ptScale; + }; + + static Tokens consumes(edm::ConsumesCollector iC); + ///KK - CSCTFPtLUT(const edm::EventSetup& c); + CSCTFPtLUT(const edm::EventSetup& c, const Tokens& tokens); /// CSCTFPtLUT(const edm::ParameterSet&, const L1MuTriggerScales* scales, const L1MuTriggerPtScale* ptScale); diff --git a/L1Trigger/CSCTrackFinder/interface/CSCTFSectorProcessor.h b/L1Trigger/CSCTrackFinder/interface/CSCTFSectorProcessor.h index 326890b85a537..7c7e6ced07d8e 100644 --- a/L1Trigger/CSCTrackFinder/interface/CSCTFSectorProcessor.h +++ b/L1Trigger/CSCTrackFinder/interface/CSCTFSectorProcessor.h @@ -11,20 +11,29 @@ #include <vector> #include <map> #include <string> -#include <DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h> -#include <DataFormats/L1CSCTrackFinder/interface/TrackStub.h> -#include <DataFormats/L1CSCTrackFinder/interface/CSCTriggerContainer.h> -#include <FWCore/ParameterSet/interface/ParameterSet.h> - -#include <L1Trigger/CSCTrackFinder/interface/CSCSectorReceiverLUT.h> -#include <L1Trigger/CSCTrackFinder/interface/CSCTFSPCoreLogic.h> -#include <L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h> +#include "CondFormats/L1TObjects/interface/L1MuCSCTFConfiguration.h" +#include "CondFormats/DataRecord/interface/L1MuCSCTFConfigurationRcd.h" +#include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h" +#include "DataFormats/L1CSCTrackFinder/interface/TrackStub.h" +#include "DataFormats/L1CSCTrackFinder/interface/CSCTriggerContainer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "L1Trigger/CSCTrackFinder/interface/CSCSectorReceiverLUT.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTFSPCoreLogic.h" +#include "L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h" ///KK -#include <FWCore/Framework/interface/EventSetup.h> +#include "FWCore/Framework/interface/EventSetup.h" /// class CSCTFSectorProcessor { public: + struct Tokens { + CSCTFPtLUT::Tokens ptLUT; + edm::ESGetToken<L1MuCSCTFConfiguration, L1MuCSCTFConfigurationRcd> config; + }; + + static Tokens consumes(const edm::ParameterSet& pset, edm::ConsumesCollector iC); + CSCTFSectorProcessor(const unsigned& endcap, const unsigned& sector, const edm::ParameterSet& pset, @@ -33,7 +42,7 @@ class CSCTFSectorProcessor { const L1MuTriggerPtScale* ptScale); ///KK - void initialize(const edm::EventSetup& c); + void initialize(const edm::EventSetup& c, const Tokens& tokens); /// ~CSCTFSectorProcessor(); diff --git a/L1Trigger/CSCTrackFinder/plugins/CSCTFTrackProducer.cc b/L1Trigger/CSCTrackFinder/plugins/CSCTFTrackProducer.cc index 24b43a839ab66..ae94f78aa182b 100644 --- a/L1Trigger/CSCTrackFinder/plugins/CSCTFTrackProducer.cc +++ b/L1Trigger/CSCTrackFinder/plugins/CSCTFTrackProducer.cc @@ -26,7 +26,8 @@ CSCTFTrackProducer::CSCTFTrackProducer(const edm::ParameterSet& pset) m_scalesToken(esConsumes<L1MuTriggerScales, L1MuTriggerScalesRcd>()), m_ptScaleToken(esConsumes<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd>()), m_pDDToken(esConsumes<CSCGeometry, MuonGeometryRecord>()), - sp_pset{pset.getParameter<edm::ParameterSet>("SectorProcessor")} { + sp_pset{pset.getParameter<edm::ParameterSet>("SectorProcessor")}, + m_builderTokens(CSCTFTrackBuilder::consumes(sp_pset, consumesCollector())) { m_scalesCacheID = 0ULL; m_ptScaleCacheID = 0ULL; produces<L1CSCTrackCollection>(); @@ -48,10 +49,9 @@ void CSCTFTrackProducer::produce(edm::Event& e, const edm::EventSetup& c) { edm::ESHandle<L1MuTriggerScales> scales = c.getHandle(m_scalesToken); edm::ESHandle<L1MuTriggerPtScale> ptScale = c.getHandle(m_ptScaleToken); - c.get<L1MuTriggerPtScaleRcd>().get(ptScale); my_builder = std::make_unique<CSCTFTrackBuilder>(sp_pset, TMB07, scales.product(), ptScale.product()); - my_builder->initialize(c); + my_builder->initialize(c, m_builderTokens); m_scalesCacheID = c.get<L1MuTriggerScalesRcd>().cacheIdentifier(); m_ptScaleCacheID = c.get<L1MuTriggerPtScaleRcd>().cacheIdentifier(); diff --git a/L1Trigger/CSCTrackFinder/plugins/CSCTFTrackProducer.h b/L1Trigger/CSCTrackFinder/plugins/CSCTFTrackProducer.h index b399dcbb960d8..8e94836c7e22f 100644 --- a/L1Trigger/CSCTrackFinder/plugins/CSCTFTrackProducer.h +++ b/L1Trigger/CSCTrackFinder/plugins/CSCTFTrackProducer.h @@ -42,6 +42,7 @@ class CSCTFTrackProducer : public edm::one::EDProducer<edm::one::SharedResources const edm::ESGetToken<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd> m_ptScaleToken; const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> m_pDDToken; const edm::ParameterSet sp_pset; + const CSCTFTrackBuilder::Tokens m_builderTokens; unsigned long long m_scalesCacheID; unsigned long long m_ptScaleCacheID; std::unique_ptr<CSCTFTrackBuilder> my_builder; diff --git a/L1Trigger/CSCTrackFinder/src/CSCTFPtLUT.cc b/L1Trigger/CSCTrackFinder/src/CSCTFPtLUT.cc index 5b9eb7ec630a0..17f3bc5956d98 100644 --- a/L1Trigger/CSCTrackFinder/src/CSCTFPtLUT.cc +++ b/L1Trigger/CSCTrackFinder/src/CSCTFPtLUT.cc @@ -20,16 +20,8 @@ bool CSCTFPtLUT::lut_read_in = false; // CSCTFPtMethods CSCTFPtLUT::ptMethods; ///KK -#include "CondFormats/L1TObjects/interface/L1MuCSCPtLut.h" -#include "CondFormats/DataRecord/interface/L1MuCSCPtLutRcd.h" -#include "FWCore/Framework/interface/ESHandle.h" #include <L1Trigger/CSCTrackFinder/interface/CSCTFPtLUT.h> -#include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h" -#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h" -#include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h" -#include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h" - // info for getPtScale() pt scale in GeV // low edges of pt bins /* const float ptscale[33] = { */ @@ -92,7 +84,17 @@ const int CSCTFPtLUT::dEtaCut_Open[24] = {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, const int CSCTFPtLUT::getPtbyMLH = 0xFFFF; // all modes on -CSCTFPtLUT::CSCTFPtLUT(const edm::EventSetup& es) : read_pt_lut(true), isBinary(false) { +CSCTFPtLUT::Tokens CSCTFPtLUT::consumes(edm::ConsumesCollector iC) { + Tokens tok; + if (not lut_read_in) { + tok.ptLUT = iC.esConsumes(); + } + tok.scales = iC.esConsumes(); + tok.ptScale = iC.esConsumes(); + return tok; +} + +CSCTFPtLUT::CSCTFPtLUT(const edm::EventSetup& es, const Tokens& tokens) : read_pt_lut(true), isBinary(false) { pt_method = 34; //std::cout << "pt_method from 4 " << std::endl; lowQualityFlag = 4; @@ -100,23 +102,16 @@ CSCTFPtLUT::CSCTFPtLUT(const edm::EventSetup& es) : read_pt_lut(true), isBinary( if (!lut_read_in) { pt_lut = new ptdat[1 << 21]; - edm::ESHandle<L1MuCSCPtLut> ptLUT; - es.get<L1MuCSCPtLutRcd>().get(ptLUT); - const L1MuCSCPtLut* myConfigPt_ = ptLUT.product(); + const L1MuCSCPtLut& myConfigPt_ = es.getData(tokens.ptLUT); - memcpy((void*)pt_lut, (void*)myConfigPt_->lut(), (1 << 21) * sizeof(ptdat)); + memcpy((void*)pt_lut, (void*)myConfigPt_.lut(), (1 << 21) * sizeof(ptdat)); lut_read_in = true; } - edm::ESHandle<L1MuTriggerScales> scales; - es.get<L1MuTriggerScalesRcd>().get(scales); - trigger_scale = scales.product(); - - edm::ESHandle<L1MuTriggerPtScale> ptScale; - es.get<L1MuTriggerPtScaleRcd>().get(ptScale); - trigger_ptscale = ptScale.product(); + trigger_scale = &es.getData(tokens.scales); + trigger_ptscale = &es.getData(tokens.ptScale); - ptMethods = CSCTFPtMethods(ptScale.product()); + ptMethods = CSCTFPtMethods(trigger_ptscale); } /// diff --git a/L1Trigger/CSCTrackFinder/src/CSCTFSectorProcessor.cc b/L1Trigger/CSCTrackFinder/src/CSCTFSectorProcessor.cc index bbf456b74a341..da2d720eab0ea 100644 --- a/L1Trigger/CSCTrackFinder/src/CSCTFSectorProcessor.cc +++ b/L1Trigger/CSCTrackFinder/src/CSCTFSectorProcessor.cc @@ -4,15 +4,21 @@ #include <FWCore/MessageLogger/interface/MessageLogger.h> -#include "CondFormats/L1TObjects/interface/L1MuCSCTFConfiguration.h" -#include "CondFormats/DataRecord/interface/L1MuCSCTFConfigurationRcd.h" -#include "FWCore/Framework/interface/ESHandle.h" #include <cstdlib> #include <sstream> #include <strings.h> const std::string CSCTFSectorProcessor::FPGAs[5] = {"F1", "F2", "F3", "F4", "F5"}; +CSCTFSectorProcessor::Tokens CSCTFSectorProcessor::consumes(const edm::ParameterSet& pset, edm::ConsumesCollector iC) { + Tokens tok; + if (not pset.getParameter<bool>("initializeFromPSet")) { + tok.ptLUT = CSCTFPtLUT::consumes(iC); + tok.config = iC.esConsumes(); + } + return tok; +} + CSCTFSectorProcessor::CSCTFSectorProcessor(const unsigned& endcap, const unsigned& sector, const edm::ParameterSet& pset, @@ -179,7 +185,7 @@ CSCTFSectorProcessor::CSCTFSectorProcessor(const unsigned& endcap, firmSP_Map.insert(std::pair<int, int>(20140515, 20140515)); } -void CSCTFSectorProcessor::initialize(const edm::EventSetup& c) { +void CSCTFSectorProcessor::initialize(const edm::EventSetup& c, const Tokens& tokens) { initFail_ = false; if (!initializeFromPSet) { // Only pT lut can be initialized from EventSetup, all front LUTs are initialized locally from their parametrizations @@ -187,13 +193,12 @@ void CSCTFSectorProcessor::initialize(const edm::EventSetup& c) { << "SP:" << (m_endcap - 1) * 6 + (m_sector - 1); LogDebug("CSCTFSectorProcessor") << "Initializing pT LUT from EventSetup"; - ptLUT_ = new CSCTFPtLUT(c); + ptLUT_ = new CSCTFPtLUT(c, tokens.ptLUT); // Extract from EventSetup alternative (to the one, used in constructor) ParameterSet - edm::ESHandle<L1MuCSCTFConfiguration> config; - c.get<L1MuCSCTFConfigurationRcd>().get(config); + const L1MuCSCTFConfiguration& config = c.getData(tokens.config); // And initialize only those parameters, which left uninitialized during construction - readParameters(config.product()->parameters((m_endcap - 1) * 6 + (m_sector - 1))); + readParameters(config.parameters((m_endcap - 1) * 6 + (m_sector - 1))); } // --------------------------------------------------------------------------- diff --git a/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.cc b/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.cc index 83c80bc1478e5..304a6fc7a4e16 100644 --- a/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.cc +++ b/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.cc @@ -11,7 +11,6 @@ #include "CondFormats/L1TObjects/interface/L1MuCSCTFConfiguration.h" #include "CondFormats/DataRecord/interface/L1MuCSCTFConfigurationRcd.h" -#include "FWCore/Framework/interface/ESHandle.h" #include <sstream> #include <cstdlib> @@ -30,11 +29,11 @@ CSCTFTrackBuilder::CSCTFTrackBuilder(const edm::ParameterSet& pset, } } -void CSCTFTrackBuilder::initialize(const edm::EventSetup& c) { +void CSCTFTrackBuilder::initialize(const edm::EventSetup& c, const Tokens& tokens) { //my_dtrc->initialize(c); for (int e = CSCDetId::minEndcapId(); e <= CSCDetId::maxEndcapId(); ++e) { for (int s = CSCTriggerNumbering::minTriggerSectorId(); s <= CSCTriggerNumbering::maxTriggerSectorId(); ++s) { - my_SPs[e - 1][s - 1]->initialize(c); + my_SPs[e - 1][s - 1]->initialize(c, tokens); } } } diff --git a/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.h b/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.h index 120565c8ef808..952a6d61428d8 100644 --- a/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.h +++ b/L1Trigger/CSCTrackFinder/src/CSCTFTrackBuilder.h @@ -10,15 +10,20 @@ #include <cstring> #include <FWCore/Framework/interface/EventSetup.h> #include <FWCore/ParameterSet/interface/ParameterSet.h> +#include "L1Trigger/CSCTrackFinder/interface/CSCTFSectorProcessor.h" class CSCMuonPortCard; -class CSCTFSectorProcessor; class L1MuTriggerScales; class L1MuTriggerPtScale; class CSCTFTrackBuilder { public: - void initialize(const edm::EventSetup& c); + using Tokens = CSCTFSectorProcessor::Tokens; + static Tokens consumes(const edm::ParameterSet& pset, edm::ConsumesCollector iC) { + return CSCTFSectorProcessor::consumes(pset, iC); + } + + void initialize(const edm::EventSetup& c, const Tokens& tokens); enum { nEndcaps = 2, nSectors = 6 }; From 968b21dd13119e18b700ba8c5d57f08317118c8d Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Wed, 14 Oct 2020 19:46:47 +0200 Subject: [PATCH 587/778] Migrate TrackDetectorAssociator to EventSetup consumes --- .../plugins/EopTreeWriter.cc | 13 ++-- .../plugins/ValidIsoTrkCalib.cc | 22 +++--- .../plugins/IsolatedTracksCone.cc | 57 ++++++-------- .../IsolatedParticles/src/ChargeIsolation.cc | 3 +- .../src/ChargeIsolationExtra.cc | 9 ++- .../test/TestIsoSimTracks.cc | 9 ++- .../IsolatedParticles/test/TestIsoTracks.cc | 6 +- .../src/InterestingTrackEcalDetIdProducer.cc | 33 +++----- .../interface/MuonMETValueMapProducer.h | 1 + .../src/MuonMETValueMapProducer.cc | 9 ++- .../HSCP/interface/BetaCalculatorECAL.h | 12 +-- .../HSCP/src/BetaCalculatorECAL.cc | 28 +++---- .../interface/TrackAssociatorParameters.h | 19 +++++ .../interface/TrackDetMatchInfo.h | 3 +- .../interface/TrackDetectorAssociator.h | 32 ++++---- .../src/TrackAssociatorParameters.cc | 10 +++ .../src/TrackDetectorAssociator.cc | 77 +++++++------------ 17 files changed, 171 insertions(+), 172 deletions(-) diff --git a/Alignment/OfflineValidation/plugins/EopTreeWriter.cc b/Alignment/OfflineValidation/plugins/EopTreeWriter.cc index e7a041ef41e05..88b09c9f608d7 100644 --- a/Alignment/OfflineValidation/plugins/EopTreeWriter.cc +++ b/Alignment/OfflineValidation/plugins/EopTreeWriter.cc @@ -79,6 +79,7 @@ class EopTreeWriter : public edm::EDAnalyzer { // ----------member data --------------------------- edm::InputTag src_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geometryToken_; edm::Service<TFileService> fs_; TTree* tree_; @@ -98,7 +99,8 @@ class EopTreeWriter : public edm::EDAnalyzer { // // constructors and destructor // -EopTreeWriter::EopTreeWriter(const edm::ParameterSet& iConfig) : src_(iConfig.getParameter<edm::InputTag>("src")) { +EopTreeWriter::EopTreeWriter(const edm::ParameterSet& iConfig) + : src_(iConfig.getParameter<edm::InputTag>("src")), geometryToken_(esConsumes()) { //now do what ever initialization is needed // TrackAssociator parameters @@ -125,9 +127,7 @@ void EopTreeWriter::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe using namespace edm; // get geometry - edm::ESHandle<CaloGeometry> geometry; - iSetup.get<CaloGeometryRecord>().get(geometry); - const CaloGeometry* geo = geometry.product(); + const CaloGeometry* geo = &iSetup.getData(geometryToken_); // const CaloSubdetectorGeometry* towerGeometry = // geo->getSubdetectorGeometry(DetId::Calo, CaloTowerDetId::SubdetId); @@ -190,7 +190,10 @@ void EopTreeWriter::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe trackAssociator_.useDefaultPropagator(); TrackDetMatchInfo info = trackAssociator_.associate( - iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(iSetup, *track), parameters_); + iEvent, + iSetup, + trackAssociator_.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *track), + parameters_); trackemc1 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 0); trackemc3 = info.nXnEnergy(TrackDetMatchInfo::EcalRecHits, 1); diff --git a/Calibration/HcalCalibAlgos/plugins/ValidIsoTrkCalib.cc b/Calibration/HcalCalibAlgos/plugins/ValidIsoTrkCalib.cc index 77520a0bbb3d2..653cfd616c639 100644 --- a/Calibration/HcalCalibAlgos/plugins/ValidIsoTrkCalib.cc +++ b/Calibration/HcalCalibAlgos/plugins/ValidIsoTrkCalib.cc @@ -24,7 +24,6 @@ See the twiki page for details: // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" //#include "FWCore/Framework/interface/Event.h" //#include "FWCore/Framework/interface/MakerMacros.h" @@ -90,6 +89,9 @@ class ValidIsoTrkCalib : public edm::one::EDAnalyzer<edm::one::SharedResources> edm::EDGetTokenT<reco::IsolatedPixelTrackCandidateCollection> tok_track_; edm::EDGetTokenT<reco::TrackCollection> tok_track1_; + edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> tok_recalibCorrs_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + //std::string m_inputTrackLabel; //std::string m_hcalLabel; @@ -202,6 +204,9 @@ ValidIsoTrkCalib::ValidIsoTrkCalib(const edm::ParameterSet& iConfig) { consumes<reco::IsolatedPixelTrackCandidateCollection>(iConfig.getParameter<edm::InputTag>("HcalIsolTrackInput")); tok_track1_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("trackInput")); + tok_recalibCorrs_ = esConsumes(edm::ESInputTag("", "recalibrate")); + tok_geom_ = esConsumes(); + associationConeSize_ = iConfig.getParameter<double>("associationConeSize"); allowMissingInputs_ = iConfig.getUntrackedParameter<bool>("allowMissingInputs", true); // outputFileName_=iConfig.getParameter<std::string>("outputFileName"); @@ -229,9 +234,7 @@ ValidIsoTrkCalib::ValidIsoTrkCalib(const edm::ParameterSet& iConfig) { // ------------ method called to for each event ------------ void ValidIsoTrkCalib::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { try { - edm::ESHandle<HcalRespCorrs> recalibCorrs; - iSetup.get<HcalRespCorrsRcd>().get("recalibrate", recalibCorrs); - respRecalib = recalibCorrs.product(); + respRecalib = &iSetup.getData(tok_recalibCorrs_); edm::LogInfo("CalibConstants") << " Loaded: OK "; @@ -259,9 +262,7 @@ void ValidIsoTrkCalib::analyze(const edm::Event& iEvent, const edm::EventSetup& iEvent.getByToken(tok_hbhe_, hbhe); const HBHERecHitCollection Hithbhe = *(hbhe.product()); - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - geo = pG.product(); + geo = &iSetup.getData(tok_geom_); const HcalGeometry* gHcal = static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, HcalBarrel)); //Note: even though it says HcalBarrel, we actually get the whole Hcal detector geometry! @@ -328,8 +329,11 @@ void ValidIsoTrkCalib::analyze(const edm::Event& iEvent, const edm::EventSetup& //cout<<"Point 0.3. Matched :: pt: "<<trit->pt()<<" wholeEnergy: "<<trackE<<" emEnergy: "<<emEnergy<<" eta: "<<etahcal<<" phi: "<<phihcal<<endl; //cout<<"Point 0.4. EM energy in cone: "<<emEnergy<<" EtaHcal: "<<etahcal<<" PhiHcal: "<<phihcal<<endl; - TrackDetMatchInfo info = - trackAssociator_.associate(iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(iSetup, *trit), parameters_); + TrackDetMatchInfo info = trackAssociator_.associate( + iEvent, + iSetup, + trackAssociator_.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *trit), + parameters_); //float etaecal=info.trkGlobPosAtEcal.eta(); //float phiecal=info.trkGlobPosAtEcal.phi(); diff --git a/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc b/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc index 34afdec145c4a..f093efef4bc26 100644 --- a/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc +++ b/Calibration/IsolatedParticles/plugins/IsolatedTracksCone.cc @@ -66,7 +66,6 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Common/interface/TriggerNames.h" @@ -163,6 +162,12 @@ class IsolatedTracksCone : public edm::one::EDAnalyzer<edm::one::SharedResources const edm::EDGetTokenT<edm::PCaloHitContainer> tok_caloHH_; const edm::EDGetTokenT<edm::TriggerResults> tok_trigger_; + const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + const edm::ESGetToken<CaloTopology, CaloTopologyRecord> tok_caloTopology_; + const edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> tok_topo_; + const edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> tok_ecalChStatus_; + const edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> tok_sevlv_; + const double minTrackP_, maxTrackEta_, maxNearTrackP_; const int debugEcalSimInfo_; const bool applyEcalIsolation_; @@ -348,6 +353,11 @@ IsolatedTracksCone::IsolatedTracksCone(const edm::ParameterSet& iConfig) tok_caloEE_(consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEE"))), tok_caloHH_(consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "HcalHits"))), tok_trigger_(consumes<edm::TriggerResults>(edm::InputTag("TriggerResults", "", "HLT"))), + tok_geom_(esConsumes()), + tok_caloTopology_(esConsumes()), + tok_topo_(esConsumes()), + tok_ecalChStatus_(esConsumes()), + tok_sevlv_(esConsumes()), minTrackP_(iConfig.getUntrackedParameter<double>("minTrackP", 10.0)), maxTrackEta_(iConfig.getUntrackedParameter<double>("maxTrackEta", 5.0)), maxNearTrackP_(iConfig.getUntrackedParameter<double>("maxNearTrackP", 1.0)), @@ -485,21 +495,14 @@ void IsolatedTracksCone::analyze(const edm::Event& iEvent, const edm::EventSetup // Get the collection handles /////////////////////////////////////////////// - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); + const CaloGeometry* geo = &iSetup.getData(tok_geom_); const CaloSubdetectorGeometry* gEB = (geo->getSubdetectorGeometry(DetId::Ecal, EcalBarrel)); const CaloSubdetectorGeometry* gEE = (geo->getSubdetectorGeometry(DetId::Ecal, EcalEndcap)); const CaloSubdetectorGeometry* gHB = (geo->getSubdetectorGeometry(DetId::Hcal, HcalBarrel)); const CaloSubdetectorGeometry* gHE = (geo->getSubdetectorGeometry(DetId::Hcal, HcalEndcap)); - edm::ESHandle<CaloTopology> theCaloTopology; - iSetup.get<CaloTopologyRecord>().get(theCaloTopology); - const CaloTopology* caloTopology = theCaloTopology.product(); - - edm::ESHandle<HcalTopology> htopo; - iSetup.get<HcalRecNumberingRecord>().get(htopo); - const HcalTopology* theHBHETopology = htopo.product(); + const CaloTopology* caloTopology = &iSetup.getData(tok_caloTopology_); + const HcalTopology* theHBHETopology = &iSetup.getData(tok_topo_); edm::Handle<EcalRecHitCollection> barrelRecHitsHandle; edm::Handle<EcalRecHitCollection> endcapRecHitsHandle; @@ -507,9 +510,7 @@ void IsolatedTracksCone::analyze(const edm::Event& iEvent, const edm::EventSetup iEvent.getByToken(tok_EE_, endcapRecHitsHandle); // Retrieve the good/bad ECAL channels from the DB - edm::ESHandle<EcalChannelStatus> ecalChStatus; - iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus); - const EcalChannelStatus* theEcalChStatus = ecalChStatus.product(); + const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_ecalChStatus_); edm::Handle<HBHERecHitCollection> hbhe; iEvent.getByToken(tok_hbhe_, hbhe); @@ -628,6 +629,7 @@ void IsolatedTracksCone::analyze(const edm::Event& iEvent, const edm::EventSetup nMissEcal = 0; nMissHcal = 0; + const EcalSeverityLevelAlgo* sevlv = &iSetup.getData(tok_sevlv_); for (trkItr = trkCollection->begin(); trkItr != trkCollection->end(); ++trkItr) { nRawTRK++; @@ -668,7 +670,8 @@ void IsolatedTracksCone::analyze(const edm::Event& iEvent, const edm::EventSetup // Find track trajectory //////////////////////////////////////////// - const FreeTrajectoryState fts1 = trackAssociator_->getFreeTrajectoryState(iSetup, *pTrack); + const FreeTrajectoryState fts1 = + trackAssociator_->getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack); TrackDetMatchInfo info1 = trackAssociator_->associate(iEvent, iSetup, fts1, parameters_); @@ -757,33 +760,17 @@ void IsolatedTracksCone::analyze(const edm::Event& iEvent, const edm::EventSetup // NxN cluster double e3x3 = -999.0; double trkEcalEne = -999.0; - edm::ESHandle<EcalSeverityLevelAlgo> sevlv; - iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv); if (std::abs(point1.eta()) < 1.479) { const DetId isoCell = gEB->getClosestCell(point1); - e3x3 = spr::eECALmatrix(isoCell, - barrelRecHitsHandle, - endcapRecHitsHandle, - *theEcalChStatus, - geo, - caloTopology, - sevlv.product(), - 1, - 1) + e3x3 = spr::eECALmatrix( + isoCell, barrelRecHitsHandle, endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology, sevlv, 1, 1) .first; trkEcalEne = spr::eCaloSimInfo(iEvent, geo, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate); } else { const DetId isoCell = gEE->getClosestCell(point1); - e3x3 = spr::eECALmatrix(isoCell, - barrelRecHitsHandle, - endcapRecHitsHandle, - *theEcalChStatus, - geo, - caloTopology, - sevlv.product(), - 1, - 1) + e3x3 = spr::eECALmatrix( + isoCell, barrelRecHitsHandle, endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology, sevlv, 1, 1) .first; trkEcalEne = spr::eCaloSimInfo(iEvent, geo, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate); } diff --git a/Calibration/IsolatedParticles/src/ChargeIsolation.cc b/Calibration/IsolatedParticles/src/ChargeIsolation.cc index ece0fa1852a0f..bdd29d2bc9752 100644 --- a/Calibration/IsolatedParticles/src/ChargeIsolation.cc +++ b/Calibration/IsolatedParticles/src/ChargeIsolation.cc @@ -259,7 +259,8 @@ namespace spr { // candidate if (trkItr2 != trkItr) { // Get propagator - const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2); + const FreeTrajectoryState fts2 = + associator.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack2); TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_); // Make sure it reaches Hcal diff --git a/Calibration/IsolatedParticles/src/ChargeIsolationExtra.cc b/Calibration/IsolatedParticles/src/ChargeIsolationExtra.cc index ca5cb56137131..9435a41ff830a 100644 --- a/Calibration/IsolatedParticles/src/ChargeIsolationExtra.cc +++ b/Calibration/IsolatedParticles/src/ChargeIsolationExtra.cc @@ -41,7 +41,8 @@ namespace spr { bool trkQuality = pTrack2->quality(trackQuality_); if ((trkItr2 != trkItr) && trkQuality) { - const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2); + const FreeTrajectoryState fts2 = + associator.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack2); TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_); const GlobalPoint point2(info2.trkGlobPosAtEcal.x(), info2.trkGlobPosAtEcal.y(), info2.trkGlobPosAtEcal.z()); @@ -131,7 +132,8 @@ namespace spr { bool trkQuality = pTrack2->quality(trackQuality_); if ((trkItr2 != trkItr) && trkQuality) { - const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2); + const FreeTrajectoryState fts2 = + associator.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack2); TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_); const GlobalPoint point2(info2.trkGlobPosAtEcal.x(), info2.trkGlobPosAtEcal.y(), info2.trkGlobPosAtEcal.z()); @@ -204,7 +206,8 @@ namespace spr { bool trkQuality = pTrack2->quality(trackQuality_); if ((trkItr2 != trkItr) && trkQuality) { - const FreeTrajectoryState fts2 = associator.getFreeTrajectoryState(iSetup, *pTrack2); + const FreeTrajectoryState fts2 = + associator.getFreeTrajectoryState(&iSetup.getData(parameters_.bFieldToken), *pTrack2); TrackDetMatchInfo info2 = associator.associate(iEvent, iSetup, fts2, parameters_); const GlobalPoint point2(info2.trkGlobPosAtHcal.x(), info2.trkGlobPosAtHcal.y(), info2.trkGlobPosAtHcal.z()); diff --git a/JetMETCorrections/IsolatedParticles/test/TestIsoSimTracks.cc b/JetMETCorrections/IsolatedParticles/test/TestIsoSimTracks.cc index a3d0f843de9f1..bf7c51b4ec226 100644 --- a/JetMETCorrections/IsolatedParticles/test/TestIsoSimTracks.cc +++ b/JetMETCorrections/IsolatedParticles/test/TestIsoSimTracks.cc @@ -26,7 +26,6 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/Common/interface/OrphanHandle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -191,8 +190,12 @@ void TestIsoSimTracks::analyze(const edm::Event& iEvent, const edm::EventSetup& // << " GeV" << std::endl; // std::cout << "Details:\n" <<std::endl; - TrackDetMatchInfo info = trackAssociator_.associate( - iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(iSetup, *tracksCI, vertex), trackAssociatorParameters_); + TrackDetMatchInfo info = + trackAssociator_.associate(iEvent, + iSetup, + trackAssociator_.getFreeTrajectoryState( + &iSetup.getData(trackAssociatorParameters_.bFieldToken), *tracksCI, vertex), + trackAssociatorParameters_); // std::cout << "ECAL, if track reach ECAL: " << info.isGoodEcal << std::endl; // std::cout << "ECAL, number of crossed cells: " << info.crossedEcalRecHits.size() << std::endl; // std::cout << "ECAL, energy of crossed cells: " << info.ecalEnergy() << " GeV" << std::endl; diff --git a/JetMETCorrections/IsolatedParticles/test/TestIsoTracks.cc b/JetMETCorrections/IsolatedParticles/test/TestIsoTracks.cc index 9e79485883660..101e4ffebde04 100644 --- a/JetMETCorrections/IsolatedParticles/test/TestIsoTracks.cc +++ b/JetMETCorrections/IsolatedParticles/test/TestIsoTracks.cc @@ -26,7 +26,6 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/Common/interface/OrphanHandle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -215,7 +214,10 @@ void TestIsoTracks::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe // std::cout << "Details:\n" <<std::endl; TrackDetMatchInfo info = trackAssociator_.associate( - iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(iSetup, *tracksCI), trackAssociatorParameters_); + iEvent, + iSetup, + trackAssociator_.getFreeTrajectoryState(&iSetup.getData(trackAssociatorParameters_.bFieldToken), *tracksCI), + trackAssociatorParameters_); // std::cout << "ECAL, if track reach ECAL: " << info.isGoodEcal << std::endl; // std::cout << "ECAL, number of crossed cells: " << info.crossedEcalRecHits.size() << std::endl; // std::cout << "ECAL, energy of crossed cells: " << info.ecalEnergy() << " GeV" << std::endl; diff --git a/RecoEcal/EgammaClusterProducers/src/InterestingTrackEcalDetIdProducer.cc b/RecoEcal/EgammaClusterProducers/src/InterestingTrackEcalDetIdProducer.cc index 7c6c2867b2d61..ecb3e63a375db 100644 --- a/RecoEcal/EgammaClusterProducers/src/InterestingTrackEcalDetIdProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/InterestingTrackEcalDetIdProducer.cc @@ -47,20 +47,17 @@ class InterestingTrackEcalDetIdProducer : public edm::stream::EDProducer<> { public: explicit InterestingTrackEcalDetIdProducer(const edm::ParameterSet&); - ~InterestingTrackEcalDetIdProducer() override; private: void produce(edm::Event&, const edm::EventSetup&) override; - void beginRun(edm::Run const&, const edm::EventSetup&) override; // ----------member data --------------------------- edm::EDGetTokenT<reco::TrackCollection> trackCollectionToken_; - edm::InputTag trackCollection_; edm::ParameterSet trackAssociatorPS_; double minTrackPt_; - const CaloTopology* caloTopology_; + edm::ESGetToken<CaloTopology, CaloTopologyRecord> caloTopologyToken_; TrackDetectorAssociator trackAssociator_; TrackAssociatorParameters trackAssociatorParameters_; }; @@ -77,25 +74,18 @@ class InterestingTrackEcalDetIdProducer : public edm::stream::EDProducer<> { // constructors and destructor // InterestingTrackEcalDetIdProducer::InterestingTrackEcalDetIdProducer(const edm::ParameterSet& iConfig) - : - - trackAssociatorPS_(iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters")), - minTrackPt_(iConfig.getParameter<double>("MinTrackPt")) + : minTrackPt_(iConfig.getParameter<double>("MinTrackPt")), + caloTopologyToken_(esConsumes()) { trackCollectionToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("TrackCollection")); trackAssociator_.useDefaultPropagator(); edm::ConsumesCollector iC = consumesCollector(); - trackAssociatorParameters_.loadParameters(trackAssociatorPS_, iC); + trackAssociatorParameters_.loadParameters(iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters"), iC); produces<DetIdCollection>(); } -InterestingTrackEcalDetIdProducer::~InterestingTrackEcalDetIdProducer() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) -} - // // member functions // @@ -110,13 +100,18 @@ void InterestingTrackEcalDetIdProducer::produce(edm::Event& iEvent, const edm::E edm::Handle<reco::TrackCollection> tracks; iEvent.getByToken(trackCollectionToken_, tracks); + const auto& caloTopology = iSetup.getData(caloTopologyToken_); + // Loop over tracks for (reco::TrackCollection::const_iterator tkItr = tracks->begin(); tkItr != tracks->end(); ++tkItr) { if (tkItr->pt() < minTrackPt_) continue; TrackDetMatchInfo info = trackAssociator_.associate( - iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(iSetup, *tkItr), trackAssociatorParameters_); + iEvent, + iSetup, + trackAssociator_.getFreeTrajectoryState(&iSetup.getData(trackAssociatorParameters_.bFieldToken), *tkItr), + trackAssociatorParameters_); DetId centerId = info.findMaxDeposition(TrackDetMatchInfo::EcalRecHits); @@ -124,7 +119,7 @@ void InterestingTrackEcalDetIdProducer::produce(edm::Event& iEvent, const edm::E continue; // Find 5x5 around max - const CaloSubdetectorTopology* topology = caloTopology_->getSubdetectorTopology(DetId::Ecal, centerId.subdetId()); + const CaloSubdetectorTopology* topology = caloTopology.getSubdetectorTopology(DetId::Ecal, centerId.subdetId()); const std::vector<DetId>& ids = topology->getWindow(centerId, 5, 5); for (std::vector<DetId>::const_iterator idItr = ids.begin(); idItr != ids.end(); ++idItr) { if (std::find(interestingDetIdCollection->begin(), interestingDetIdCollection->end(), *idItr) == @@ -136,11 +131,5 @@ void InterestingTrackEcalDetIdProducer::produce(edm::Event& iEvent, const edm::E iEvent.put(std::move(interestingDetIdCollection)); } -void InterestingTrackEcalDetIdProducer::beginRun(edm::Run const& run, const edm::EventSetup& iSetup) { - edm::ESHandle<CaloTopology> theCaloTopology; - iSetup.get<CaloTopologyRecord>().get(theCaloTopology); - caloTopology_ = &(*theCaloTopology); -} - //define this as a plug-in DEFINE_FWK_MODULE(InterestingTrackEcalDetIdProducer); diff --git a/RecoMET/METProducers/interface/MuonMETValueMapProducer.h b/RecoMET/METProducers/interface/MuonMETValueMapProducer.h index 47c912d6e6745..d7af120bcf1a9 100644 --- a/RecoMET/METProducers/interface/MuonMETValueMapProducer.h +++ b/RecoMET/METProducers/interface/MuonMETValueMapProducer.h @@ -49,6 +49,7 @@ namespace cms { double& deltay, const reco::Muon& muon, double bfield, + const MagneticField& magneticField, edm::Event& iEvent, const edm::EventSetup& iSetup); reco::MuonMETCorrectionData::Type decide_correction_type(const reco::Muon& muon, diff --git a/RecoMET/METProducers/src/MuonMETValueMapProducer.cc b/RecoMET/METProducers/src/MuonMETValueMapProducer.cc index b30f14ecbc76d..a6c09339f4e49 100644 --- a/RecoMET/METProducers/src/MuonMETValueMapProducer.cc +++ b/RecoMET/METProducers/src/MuonMETValueMapProducer.cc @@ -84,16 +84,16 @@ namespace cms { edm::Handle<reco::BeamSpot> beamSpot; iEvent.getByToken(beamSpotToken_, beamSpot); - edm::ESHandle<MagneticField> magneticField = iSetup.getHandle(magFieldToken_); + const MagneticField& magneticField = iSetup.getData(magFieldToken_); - double bfield = magneticField->inTesla(GlobalPoint(0., 0., 0.)).z(); + double bfield = magneticField.inTesla(GlobalPoint(0., 0., 0.)).z(); std::vector<reco::MuonMETCorrectionData> muCorrDataList; for (edm::View<reco::Muon>::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) { double deltax = 0.0; double deltay = 0.0; - determine_deltax_deltay(deltax, deltay, *muon, bfield, iEvent, iSetup); + determine_deltax_deltay(deltax, deltay, *muon, bfield, magneticField, iEvent, iSetup); reco::MuonMETCorrectionData::Type muCorrType = decide_correction_type(*muon, beamSpot->position()); @@ -116,6 +116,7 @@ namespace cms { double& deltay, const reco::Muon& muon, double bfield, + const MagneticField& magneticField, edm::Event& iEvent, const edm::EventSetup& iSetup) { reco::TrackRef mu_track; @@ -127,7 +128,7 @@ namespace cms { mu_track = muon.outerTrack(); TrackDetMatchInfo info = trackAssociator_.associate( - iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(iSetup, *mu_track), trackAssociatorParameters_); + iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(&magneticField, *mu_track), trackAssociatorParameters_); MuonMETAlgo alg; alg.GetMuDepDeltas( diff --git a/SUSYBSMAnalysis/HSCP/interface/BetaCalculatorECAL.h b/SUSYBSMAnalysis/HSCP/interface/BetaCalculatorECAL.h index 89d8764d8f5a2..e66d6f38de410 100644 --- a/SUSYBSMAnalysis/HSCP/interface/BetaCalculatorECAL.h +++ b/SUSYBSMAnalysis/HSCP/interface/BetaCalculatorECAL.h @@ -5,18 +5,16 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/CaloTopology/interface/CaloTopology.h" @@ -63,7 +61,9 @@ class BetaCalculatorECAL { edm::EDGetTokenT<EBRecHitCollection> EBRecHitCollectionToken_; edm::EDGetTokenT<EERecHitCollection> EERecHitCollectionToken_; - edm::ESHandle<DetIdAssociator> ecalDetIdAssociator_; - edm::ESHandle<MagneticField> bField_; - edm::ESHandle<CaloGeometry> theCaloGeometry_; + edm::ESGetToken<DetIdAssociator, DetIdAssociatorRecord> ecalDetIdAssociatorToken_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bFieldToken_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> theCaloGeometryToken_; + edm::ESGetToken<CaloTopology, CaloTopologyRecord> caloTopologyToken_; + const MagneticField* bField_; }; diff --git a/SUSYBSMAnalysis/HSCP/src/BetaCalculatorECAL.cc b/SUSYBSMAnalysis/HSCP/src/BetaCalculatorECAL.cc index 158b14b15e346..57ef23068b9c9 100644 --- a/SUSYBSMAnalysis/HSCP/src/BetaCalculatorECAL.cc +++ b/SUSYBSMAnalysis/HSCP/src/BetaCalculatorECAL.cc @@ -1,7 +1,6 @@ #include "DataFormats/EcalDetId/interface/EBDetId.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" -#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" #include "Geometry/CaloGeometry/interface/TruncatedPyramid.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" @@ -20,7 +19,11 @@ BetaCalculatorECAL::BetaCalculatorECAL(const edm::ParameterSet& iConfig, edm::Co : EBRecHitCollectionToken_( iC.consumes<EBRecHitCollection>(iConfig.getParameter<edm::InputTag>("EBRecHitCollection"))), EERecHitCollectionToken_( - iC.consumes<EERecHitCollection>(iConfig.getParameter<edm::InputTag>("EERecHitCollection"))) { + iC.consumes<EERecHitCollection>(iConfig.getParameter<edm::InputTag>("EERecHitCollection"))), + ecalDetIdAssociatorToken_(iC.esConsumes(edm::ESInputTag("", "EcalDetIdAssociator"))), + bFieldToken_(iC.esConsumes()), + theCaloGeometryToken_(iC.esConsumes()), + caloTopologyToken_(iC.esConsumes()) { edm::ParameterSet trkParameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters"); parameters_.loadParameters(trkParameters, iC); trackAssociator_.useDefaultPropagator(); @@ -35,16 +38,13 @@ void BetaCalculatorECAL::addInfoToCandidate(HSCParticle& candidate, HSCPCaloInfo result; // EcalDetIdAssociator - iSetup.get<DetIdAssociatorRecord>().get("EcalDetIdAssociator", ecalDetIdAssociator_); + const auto& ecalDetIdAssociator_ = iSetup.getData(ecalDetIdAssociatorToken_); // Get the Bfield - iSetup.get<IdealMagneticFieldRecord>().get(bField_); + bField_ = &iSetup.getData(bFieldToken_); // Geometry - iSetup.get<CaloGeometryRecord>().get(theCaloGeometry_); - const CaloGeometry* theGeometry = theCaloGeometry_.product(); + const CaloGeometry* theGeometry = &iSetup.getData(theCaloGeometryToken_); // Topology - edm::ESHandle<CaloTopology> pCaloTopology; - iSetup.get<CaloTopologyRecord>().get(pCaloTopology); - const CaloTopology* theCaloTopology = pCaloTopology.product(); + const CaloTopology* theCaloTopology = &iSetup.getData(caloTopologyToken_); // EcalRecHits edm::Handle<EBRecHitCollection> ebRecHits; iEvent.getByToken(EBRecHitCollectionToken_, ebRecHits); @@ -69,16 +69,16 @@ void BetaCalculatorECAL::addInfoToCandidate(HSCParticle& candidate, // use the track associator to propagate to the calo TrackDetMatchInfo info = - trackAssociator_.associate(iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(iSetup, track), parameters_); + trackAssociator_.associate(iEvent, iSetup, trackAssociator_.getFreeTrajectoryState(bField_, track), parameters_); // do a custom propagation through Ecal std::map<int, GlobalPoint> trackExitPositionMap; // rawId to exit position (subtracting cry center) std::map<int, float> trackCrossedXtalCurvedMap; // rawId to trackLength - FreeTrajectoryState tkInnerState = trajectoryStateTransform::innerFreeState(track, &*bField_); + FreeTrajectoryState tkInnerState = trajectoryStateTransform::innerFreeState(track, bField_); // Build set of points in Ecal (necklace) using the propagator std::vector<SteppingHelixStateInfo> neckLace; - neckLace = calcEcalDeposit(&tkInnerState, *ecalDetIdAssociator_); + neckLace = calcEcalDeposit(&tkInnerState, ecalDetIdAssociator_); // Initialize variables to be filled by the track-length function double totalLengthCurved = 0.; GlobalPoint internalPointCurved(0., 0., 0.); @@ -211,11 +211,11 @@ std::vector<SteppingHelixStateInfo> BetaCalculatorECAL::calcEcalDeposit(const Fr SteppingHelixStateInfo trackOrigin(*tkInnerState); // Define Propagator - SteppingHelixPropagator* prop = new SteppingHelixPropagator(&*bField_, alongMomentum); + auto prop = std::make_unique<SteppingHelixPropagator>(bField_, alongMomentum); prop->setMaterialMode(false); prop->applyRadX0Correction(true); - return propagateThoughFromIP(trackOrigin, prop, associator.volume(), 500, 0.1, minR, minZ, maxR, maxZ); + return propagateThoughFromIP(trackOrigin, prop.get(), associator.volume(), 500, 0.1, minR, minZ, maxR, maxZ); } int BetaCalculatorECAL::getDetailedTrackLengthInXtals(std::map<int, GlobalPoint>& trackExitPositionMap, diff --git a/TrackingTools/TrackAssociator/interface/TrackAssociatorParameters.h b/TrackingTools/TrackAssociator/interface/TrackAssociatorParameters.h index a6852a2e3e0b8..2b97a6d185cbc 100644 --- a/TrackingTools/TrackAssociator/interface/TrackAssociatorParameters.h +++ b/TrackingTools/TrackAssociator/interface/TrackAssociatorParameters.h @@ -31,6 +31,15 @@ #include "DataFormats/GEMRecHit/interface/GEMSegmentCollection.h" #include "DataFormats/GEMRecHit/interface/ME0SegmentCollection.h" +class DetIdAssociator; +class DetIdAssociatorRecord; +class CaloGeometry; +class CaloGeometryRecord; +class GlobalTrackingGeometry; +class GlobalTrackingGeometryRecord; +class MagneticField; +class IdealMagneticFieldRecord; + class TrackAssociatorParameters { public: TrackAssociatorParameters() {} @@ -109,5 +118,15 @@ class TrackAssociatorParameters { edm::EDGetTokenT<edm::PCaloHitContainer> simEcalHitsEBToken; edm::EDGetTokenT<edm::PCaloHitContainer> simEcalHitsEEToken; edm::EDGetTokenT<edm::PCaloHitContainer> simHcalHitsToken; + + edm::ESGetToken<DetIdAssociator, DetIdAssociatorRecord> ecalDetIdAssociatorToken; + edm::ESGetToken<DetIdAssociator, DetIdAssociatorRecord> hcalDetIdAssociatorToken; + edm::ESGetToken<DetIdAssociator, DetIdAssociatorRecord> hoDetIdAssociatorToken; + edm::ESGetToken<DetIdAssociator, DetIdAssociatorRecord> caloDetIdAssociatorToken; + edm::ESGetToken<DetIdAssociator, DetIdAssociatorRecord> muonDetIdAssociatorToken; + edm::ESGetToken<DetIdAssociator, DetIdAssociatorRecord> preshowerDetIdAssociatorToken; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> theCaloGeometryToken; + edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> theTrackingGeometryToken; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bFieldToken; }; #endif diff --git a/TrackingTools/TrackAssociator/interface/TrackDetMatchInfo.h b/TrackingTools/TrackAssociator/interface/TrackDetMatchInfo.h index e7c1ad967fa44..f7232789effb4 100644 --- a/TrackingTools/TrackAssociator/interface/TrackDetMatchInfo.h +++ b/TrackingTools/TrackAssociator/interface/TrackDetMatchInfo.h @@ -8,7 +8,6 @@ #include "DataFormats/TrackReco/interface/TrackFwd.h" #include "SimDataFormats/Track/interface/SimTrackContainer.h" #include "TrackingTools/TrackAssociator/interface/TAMuonChamberMatch.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" class TrackDetMatchInfo { @@ -109,7 +108,7 @@ class TrackDetMatchInfo { int numberOfSegmentsInStation(int station, int detector) const; int numberOfSegmentsInDetector(int detector) const; - void setCaloGeometry(edm::ESHandle<CaloGeometry> geometry) { caloGeometry = geometry.product(); } + void setCaloGeometry(const CaloGeometry* geometry) { caloGeometry = geometry; } GlobalPoint getPosition(const DetId&); std::string dumpGeometry(const DetId&); diff --git a/TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h b/TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h index 4cd0b950dbe4e..b76447bf22d01 100644 --- a/TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h +++ b/TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h @@ -19,10 +19,7 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ESWatcher.h" -#include "DataFormats/Common/interface/OrphanHandle.h" #include "DataFormats/TrackReco/interface/TrackBase.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" @@ -48,8 +45,7 @@ class TrackDetectorAssociator { public: - TrackDetectorAssociator(); - ~TrackDetectorAssociator(); + explicit TrackDetectorAssociator(); typedef TrackAssociatorParameters AssociatorParameters; enum Direction { Any, InsideOut, OutsideIn }; @@ -104,9 +100,9 @@ class TrackDetectorAssociator { void useDefaultPropagator(); /// get FreeTrajectoryState from different track representations - static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup&, const reco::Track&); - static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup&, const SimTrack&, const SimVertex&); - static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup&, + static FreeTrajectoryState getFreeTrajectoryState(const MagneticField*, const reco::Track&); + static FreeTrajectoryState getFreeTrajectoryState(const MagneticField*, const SimTrack&, const SimVertex&); + static FreeTrajectoryState getFreeTrajectoryState(const MagneticField*, const GlobalVector&, const GlobalPoint&, const int); @@ -135,7 +131,7 @@ class TrackDetectorAssociator { void getTAMuonChamberMatches(std::vector<TAMuonChamberMatch>& matches, const AssociatorParameters& parameters) dso_internal; - void init(const edm::EventSetup&) dso_internal; + void init(const edm::EventSetup&, const AssociatorParameters&) dso_internal; math::XYZPoint getPoint(const GlobalPoint& point) dso_internal { return math::XYZPoint(point.x(), point.y(), point.z()); @@ -150,19 +146,19 @@ class TrackDetectorAssociator { math::XYZVector getVector(const LocalVector& vec) dso_internal { return math::XYZVector(vec.x(), vec.y(), vec.z()); } const Propagator* ivProp_; - Propagator* defProp_; + std::unique_ptr<Propagator> defProp_; CachedTrajectory cachedTrajectory_; bool useDefaultPropagator_; - edm::ESHandle<DetIdAssociator> ecalDetIdAssociator_; - edm::ESHandle<DetIdAssociator> hcalDetIdAssociator_; - edm::ESHandle<DetIdAssociator> hoDetIdAssociator_; - edm::ESHandle<DetIdAssociator> caloDetIdAssociator_; - edm::ESHandle<DetIdAssociator> muonDetIdAssociator_; - edm::ESHandle<DetIdAssociator> preshowerDetIdAssociator_; + const DetIdAssociator* ecalDetIdAssociator_; + const DetIdAssociator* hcalDetIdAssociator_; + const DetIdAssociator* hoDetIdAssociator_; + const DetIdAssociator* caloDetIdAssociator_; + const DetIdAssociator* muonDetIdAssociator_; + const DetIdAssociator* preshowerDetIdAssociator_; - edm::ESHandle<CaloGeometry> theCaloGeometry_; - edm::ESHandle<GlobalTrackingGeometry> theTrackingGeometry_; + const CaloGeometry* theCaloGeometry_; + const GlobalTrackingGeometry* theTrackingGeometry_; edm::ESWatcher<IdealMagneticFieldRecord> theMagneticFeildWatcher_; }; diff --git a/TrackingTools/TrackAssociator/src/TrackAssociatorParameters.cc b/TrackingTools/TrackAssociator/src/TrackAssociatorParameters.cc index 5983a99bd514b..776a89678e0af 100644 --- a/TrackingTools/TrackAssociator/src/TrackAssociatorParameters.cc +++ b/TrackingTools/TrackAssociator/src/TrackAssociatorParameters.cc @@ -80,6 +80,16 @@ void TrackAssociatorParameters::loadParameters(const edm::ParameterSet& iConfig, simEcalHitsEEToken = iC.consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "EcalHitsEE")); simHcalHitsToken = iC.consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "HcalHits")); } + + ecalDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "EcalDetIdAssociator")); + hcalDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "HcalDetIdAssociator")); + hoDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "HODetIdAssociator")); + caloDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "CaloDetIdAssociator")); + muonDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "MuonDetIdAssociator")); + preshowerDetIdAssociatorToken = iC.esConsumes(edm::ESInputTag("", "PreshowerDetIdAssociator")); + theCaloGeometryToken = iC.esConsumes(); + theTrackingGeometryToken = iC.esConsumes(); + bFieldToken = iC.esConsumes(); } TrackAssociatorParameters::TrackAssociatorParameters(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC) { diff --git a/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc b/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc index cc14668a0dbb6..a898dcde805df 100644 --- a/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc +++ b/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc @@ -25,11 +25,8 @@ #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/MakerMacros.h" #include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Utilities/interface/isFinite.h" -#include "DataFormats/Common/interface/OrphanHandle.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" @@ -103,15 +100,9 @@ using namespace reco; TrackDetectorAssociator::TrackDetectorAssociator() { ivProp_ = nullptr; - defProp_ = nullptr; useDefaultPropagator_ = false; } -TrackDetectorAssociator::~TrackDetectorAssociator() { - if (defProp_) - delete defProp_; -} - void TrackDetectorAssociator::setPropagator(const Propagator* ptr) { ivProp_ = ptr; cachedTrajectory_.setPropagator(ivProp_); @@ -119,36 +110,31 @@ void TrackDetectorAssociator::setPropagator(const Propagator* ptr) { void TrackDetectorAssociator::useDefaultPropagator() { useDefaultPropagator_ = true; } -void TrackDetectorAssociator::init(const edm::EventSetup& iSetup) { +void TrackDetectorAssociator::init(const edm::EventSetup& iSetup, const AssociatorParameters& parameters) { // access the calorimeter geometry - iSetup.get<CaloGeometryRecord>().get(theCaloGeometry_); - if (!theCaloGeometry_.isValid()) - throw cms::Exception("FatalError") << "Unable to find CaloGeometryRecord in event!\n"; + theCaloGeometry_ = &iSetup.getData(parameters.theCaloGeometryToken); // get the tracking Geometry - iSetup.get<GlobalTrackingGeometryRecord>().get(theTrackingGeometry_); - if (!theTrackingGeometry_.isValid()) - throw cms::Exception("FatalError") << "Unable to find GlobalTrackingGeometryRecord in event!\n"; + theTrackingGeometry_ = &iSetup.getData(parameters.theTrackingGeometryToken); if (useDefaultPropagator_ && (!defProp_ || theMagneticFeildWatcher_.check(iSetup))) { // setup propagator - edm::ESHandle<MagneticField> bField; - iSetup.get<IdealMagneticFieldRecord>().get(bField); + const MagneticField* bField = &iSetup.getData(parameters.bFieldToken); - SteppingHelixPropagator* prop = new SteppingHelixPropagator(&*bField, anyDirection); + auto prop = std::make_unique<SteppingHelixPropagator>(bField, anyDirection); prop->setMaterialMode(false); prop->applyRadX0Correction(true); // prop->setDebug(true); // tmp - defProp_ = prop; - setPropagator(defProp_); + defProp_ = std::move(prop); + setPropagator(defProp_.get()); } - iSetup.get<DetIdAssociatorRecord>().get("EcalDetIdAssociator", ecalDetIdAssociator_); - iSetup.get<DetIdAssociatorRecord>().get("HcalDetIdAssociator", hcalDetIdAssociator_); - iSetup.get<DetIdAssociatorRecord>().get("HODetIdAssociator", hoDetIdAssociator_); - iSetup.get<DetIdAssociatorRecord>().get("CaloDetIdAssociator", caloDetIdAssociator_); - iSetup.get<DetIdAssociatorRecord>().get("MuonDetIdAssociator", muonDetIdAssociator_); - iSetup.get<DetIdAssociatorRecord>().get("PreshowerDetIdAssociator", preshowerDetIdAssociator_); + ecalDetIdAssociator_ = &iSetup.getData(parameters.ecalDetIdAssociatorToken); + hcalDetIdAssociator_ = &iSetup.getData(parameters.hcalDetIdAssociatorToken); + hoDetIdAssociator_ = &iSetup.getData(parameters.hoDetIdAssociatorToken); + caloDetIdAssociator_ = &iSetup.getData(parameters.caloDetIdAssociatorToken); + muonDetIdAssociator_ = &iSetup.getData(parameters.muonDetIdAssociatorToken); + preshowerDetIdAssociator_ = &iSetup.getData(parameters.preshowerDetIdAssociatorToken); } TrackDetMatchInfo TrackDetectorAssociator::associate(const edm::Event& iEvent, @@ -173,7 +159,7 @@ TrackDetMatchInfo TrackDetectorAssociator::associate(const edm::Event& iEvent, info.stateAtIP = *innerState; cachedTrajectory_.setStateAtIP(trackOrigin); - init(iSetup); + init(iSetup, parameters); // get track trajectory // ECAL points (EB+EE) // If the phi angle between a track entrance and exit points is more @@ -566,7 +552,7 @@ void TrackDetectorAssociator::fillHO(const edm::Event& iEvent, } } -FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState(const edm::EventSetup& iSetup, +FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState(const MagneticField* bField, const SimTrack& track, const SimVertex& vertex) { GlobalVector vector(track.momentum().x(), track.momentum().y(), track.momentum().z()); @@ -577,17 +563,14 @@ FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState(const edm::E abs(track.type()) == 321 || // kaon abs(track.type()) == 2212) charge = track.type() < 0 ? -1 : 1; - return getFreeTrajectoryState(iSetup, vector, point, charge); + return getFreeTrajectoryState(bField, vector, point, charge); } -FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState(const edm::EventSetup& iSetup, +FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState(const MagneticField* bField, const GlobalVector& momentum, const GlobalPoint& vertex, const int charge) { - edm::ESHandle<MagneticField> bField; - iSetup.get<IdealMagneticFieldRecord>().get(bField); - - GlobalTrajectoryParameters tPars(vertex, momentum, charge, &*bField); + GlobalTrajectoryParameters tPars(vertex, momentum, charge, bField); ROOT::Math::SMatrixIdentity id; AlgebraicSymMatrix66 covT(id); @@ -597,16 +580,13 @@ FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState(const edm::E return FreeTrajectoryState(tPars, tCov); } -FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState(const edm::EventSetup& iSetup, +FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState(const MagneticField* bField, const reco::Track& track) { - edm::ESHandle<MagneticField> bField; - iSetup.get<IdealMagneticFieldRecord>().get(bField); - GlobalVector vector(track.momentum().x(), track.momentum().y(), track.momentum().z()); GlobalPoint point(track.vertex().x(), track.vertex().y(), track.vertex().z()); - GlobalTrajectoryParameters tPars(point, vector, track.charge(), &*bField); + GlobalTrajectoryParameters tPars(point, vector, track.charge(), bField); // FIX THIS !!! // need to convert from perigee to global or helix (curvilinear) frame @@ -1011,8 +991,7 @@ TrackDetMatchInfo TrackDetectorAssociator::associate(const edm::Event& iEvent, Direction direction /*= Any*/) { double currentStepSize = cachedTrajectory_.getPropagationStep(); - edm::ESHandle<MagneticField> bField; - iSetup.get<IdealMagneticFieldRecord>().get(bField); + const MagneticField* bField = &iSetup.getData(parameters.bFieldToken); if (track.extra().isNull()) { if (direction != InsideOut) @@ -1020,14 +999,14 @@ TrackDetMatchInfo TrackDetectorAssociator::associate(const edm::Event& iEvent, "something else than InsideOut track.\n" << "Either change the parameter or provide needed data!\n"; LogTrace("TrackAssociator") << "Track Extras not found\n"; - FreeTrajectoryState initialState = trajectoryStateTransform::initialFreeState(track, &*bField); + FreeTrajectoryState initialState = trajectoryStateTransform::initialFreeState(track, bField); return associate(iEvent, iSetup, parameters, &initialState); // 5th argument is null pointer } LogTrace("TrackAssociator") << "Track Extras found\n"; - FreeTrajectoryState innerState = trajectoryStateTransform::innerFreeState(track, &*bField); - FreeTrajectoryState outerState = trajectoryStateTransform::outerFreeState(track, &*bField); - FreeTrajectoryState referenceState = trajectoryStateTransform::initialFreeState(track, &*bField); + FreeTrajectoryState innerState = trajectoryStateTransform::innerFreeState(track, bField); + FreeTrajectoryState outerState = trajectoryStateTransform::outerFreeState(track, bField); + FreeTrajectoryState referenceState = trajectoryStateTransform::initialFreeState(track, bField); LogTrace("TrackAssociator") << "inner track state (rho, z, phi):" << track.innerPosition().Rho() << ", " << track.innerPosition().z() << ", " << track.innerPosition().phi() << "\n"; @@ -1092,7 +1071,8 @@ TrackDetMatchInfo TrackDetectorAssociator::associate(const edm::Event& iEvent, const SimTrack& track, const SimVertex& vertex, const AssociatorParameters& parameters) { - return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, track, vertex), parameters); + auto const* bField = &iSetup.getData(parameters.bFieldToken); + return associate(iEvent, iSetup, getFreeTrajectoryState(bField, track, vertex), parameters); } TrackDetMatchInfo TrackDetectorAssociator::associate(const edm::Event& iEvent, @@ -1101,7 +1081,8 @@ TrackDetMatchInfo TrackDetectorAssociator::associate(const edm::Event& iEvent, const GlobalPoint& vertex, const int charge, const AssociatorParameters& parameters) { - return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, momentum, vertex, charge), parameters); + auto const* bField = &iSetup.getData(parameters.bFieldToken); + return associate(iEvent, iSetup, getFreeTrajectoryState(bField, momentum, vertex, charge), parameters); } bool TrackDetectorAssociator::crossedIP(const reco::Track& track) { From 3300a89fbe9c670738d762b46d32431fc30368d5 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Thu, 15 Oct 2020 03:54:21 +0200 Subject: [PATCH 588/778] comments from Slava --- .../TrackerRecHit2D/interface/VectorHit.h | 7 ++--- .../TrackerRecHit2D/interface/VectorHit2D.h | 10 +++---- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 4 +-- .../interface/VectorHitBuilderAlgorithm.h | 8 +++--- .../interface/VectorHitBuilderAlgorithmBase.h | 16 +++++------- .../src/VectorHitBuilderAlgorithm.cc | 8 +++--- .../src/VectorHitBuilderAlgorithmBase.cc | 14 ++-------- .../python/earlyGeneralTracks_cfi.py | 26 +++++-------------- .../plugins/MeasurementTrackerESProducer.cc | 1 - .../plugins/SeedingOTEDProducer.cc | 6 ++--- ...ransientTrackingRecHitBuilderESProducer.cc | 1 - 11 files changed, 34 insertions(+), 67 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit.h b/DataFormats/TrackerRecHit2D/interface/VectorHit.h index 78e2862603ec3..df0a771f686d8 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit.h @@ -31,12 +31,10 @@ class VectorHit final : public BaseTrackerRecHit { VectorHit() : thePosition(), theDirection(), theCovMatrix() { setType(bad); } - //VectorHit(const VectorHit& vh); - VectorHit(const GeomDet& idet, const LocalPoint& posInner, const LocalVector& dir, - const AlgebraicSymMatrix44 covMatrix, + const AlgebraicSymMatrix44& covMatrix, const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper, @@ -75,7 +73,7 @@ class VectorHit final : public BaseTrackerRecHit { // returning methods LocalPoint localPosition() const override { return thePosition; } virtual LocalVector localDirection() const { return theDirection; } - AlgebraicSymMatrix44 covMatrix() const; + const AlgebraicSymMatrix44& covMatrix() const; LocalError localPositionError() const override; LocalError localDirectionError() const; Global3DVector globalDirectionVH() const; @@ -151,6 +149,5 @@ inline bool operator<(const VectorHit& one, const VectorHit& other) { return (on std::ostream& operator<<(std::ostream& os, const VectorHit& vh); typedef edmNew::DetSetVector<VectorHit> VectorHitCollection; -//typedef VectorHitCollection VectorHitCollectionNew; #endif diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index fac5297b52c15..3143cd72c72c8 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -16,12 +16,12 @@ class VectorHit2D { theDirection(dir), theCovMatrix(covMatrix), theLocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]), - theChi2(chi2){}; + theChi2(chi2){} - const LocalPoint localPosition() const { return thePosition; } - const LocalVector localDirection() const { return theDirection; } - const LocalError localDirectionError() const { return theLocalError; } - const AlgebraicSymMatrix22 covMatrix() const { return theCovMatrix; } + const LocalPoint& localPosition() const { return thePosition; } + const LocalVector& localDirection() const { return theDirection; } + const LocalError& localDirectionError() const { return theLocalError; } + const AlgebraicSymMatrix22& covMatrix() const { return theCovMatrix; } float chi2() const { return theChi2; } int dimension() const { return theDimension; } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index b964ac88c3aaf..d942c95062104 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -5,7 +5,7 @@ VectorHit::VectorHit(const GeomDet& idet, const LocalPoint& posLower, const LocalVector& dir, - const AlgebraicSymMatrix44 covMatrix, + const AlgebraicSymMatrix44& covMatrix, const float chi2, OmniClusterRef const& lower, OmniClusterRef const& upper, @@ -168,7 +168,7 @@ LocalError VectorHit::localDirectionError() const { return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]); } -AlgebraicSymMatrix44 VectorHit::covMatrix() const { return theCovMatrix; } +const AlgebraicSymMatrix44& VectorHit::covMatrix() const { return theCovMatrix; } std::ostream& operator<<(std::ostream& os, const VectorHit& vh) { os << " VectorHit create in the DetId#: " << vh.geographicalId() << "\n" diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h index 1cd6515c88378..8d31827293481 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithm.h @@ -31,8 +31,8 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { //not implemented yet bool checkClustersCompatibilityBeforeBuilding(edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - const detset& theLowerDetSet, - const detset& theUpperDetSet) const; + const Detset& theLowerDetSet, + const Detset& theUpperDetSet) const; bool checkClustersCompatibility(Local3DPoint& posinner, Local3DPoint& posouter, LocalError& errinner, @@ -52,8 +52,8 @@ class VectorHitBuilderAlgorithm : public VectorHitBuilderAlgorithmBase { DetId detIdStack, const StackGeomDet* stack, edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - const detset& DSVinner, - const detset& DSVouter, + const Detset& DSVinner, + const Detset& DSVouter, const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) const override; VectorHit buildVectorHit(const StackGeomDet* stack, diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h index 4ddb2dcb7ec6b..61d80a95cff87 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/interface/VectorHitBuilderAlgorithmBase.h @@ -18,8 +18,8 @@ class VectorHitBuilderAlgorithmBase { public: typedef edm::Ref<edmNew::DetSetVector<Phase2TrackerCluster1D>, Phase2TrackerCluster1D> Phase2TrackerCluster1DRef; - typedef edmNew::DetSet<Phase2TrackerCluster1D> detset; - typedef detset::const_iterator const_iterator; + typedef edmNew::DetSet<Phase2TrackerCluster1D> Detset; + typedef Detset::const_iterator const_iterator; typedef edmNew::DetSetVector<VectorHit> output_t; typedef std::pair<StackGeomDet, std::vector<Phase2TrackerCluster1D>> StackClusters; @@ -41,26 +41,22 @@ class VectorHitBuilderAlgorithmBase { DetId detIdStack, const StackGeomDet* stack, edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - const detset& DSVinner, - const detset& DSVouter, + const Detset& DSVinner, + const Detset& DSVouter, const std::vector<bool>& phase2OTClustersToSkip = std::vector<bool>()) const = 0; virtual VectorHit buildVectorHit(const StackGeomDet* stack, Phase2TrackerCluster1DRef lower, Phase2TrackerCluster1DRef upper) const = 0; - double computeParallaxCorrection(const PixelGeomDetUnit*&, + double computeParallaxCorrection(const PixelGeomDetUnit*, const Point3DBase<float, LocalTag>&, - const PixelGeomDetUnit*&, + const PixelGeomDetUnit*, const Point3DBase<float, LocalTag>&) const; void printClusters(const edmNew::DetSetVector<Phase2TrackerCluster1D>& clusters) const; void printCluster(const GeomDet* geomDetUnit, const Phase2TrackerCluster1D* cluster) const; - void loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit>>& theMap, - edmNew::DetSetVector<VectorHit>& theCollection, - const int totalSize) const; - const TrackerGeometry* tkGeom_; const TrackerTopology* tkTopo_; const ClusterParameterEstimator<Phase2TrackerCluster1D>* cpe_; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc index 1144086b29f58..be41bfc3aa412 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithm.cc @@ -47,8 +47,8 @@ void VectorHitBuilderAlgorithm::run(edm::Handle<edmNew::DetSetVector<Phase2Track bool VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding( edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - const detset& theLowerDetSet, - const detset& theUpperDetSet) const { + const Detset& theLowerDetSet, + const Detset& theUpperDetSet) const { if (theLowerDetSet.size() == 1 && theUpperDetSet.size() == 1) return true; @@ -80,8 +80,8 @@ void VectorHitBuilderAlgorithm::buildVectorHits(VectorHitCollection& vhAcc, DetId detIdStack, const StackGeomDet* stack, edm::Handle<edmNew::DetSetVector<Phase2TrackerCluster1D>> clusters, - const detset& theLowerDetSet, - const detset& theUpperDetSet, + const Detset& theLowerDetSet, + const Detset& theUpperDetSet, const std::vector<bool>& phase2OTClustersToSkip) const { if (checkClustersCompatibilityBeforeBuilding(clusters, theLowerDetSet, theUpperDetSet)) { LogDebug("VectorHitBuilderAlgorithm") << " compatible -> continue ... " << std::endl; diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index b9035a168e4fa..7d557b6beec5f 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -20,9 +20,9 @@ VectorHitBuilderAlgorithmBase::VectorHitBuilderAlgorithmBase( endcapCut_(conf.getParameter<std::vector<double> >("EndcapCut")), cpeTag_(conf.getParameter<edm::ESInputTag>("CPE")) {} -double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit*& geomDetUnit_low, +double VectorHitBuilderAlgorithmBase::computeParallaxCorrection(const PixelGeomDetUnit* geomDetUnit_low, const Point3DBase<float, LocalTag>& lPosClu_low, - const PixelGeomDetUnit*& geomDetUnit_upp, + const PixelGeomDetUnit* geomDetUnit_upp, const Point3DBase<float, LocalTag>& lPosClu_upp) const { double parallCorr = 0.0; Global3DPoint origin(0, 0, 0); @@ -96,13 +96,3 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, return; } -void VectorHitBuilderAlgorithmBase::loadDetSetVector(std::unordered_map<DetId, std::vector<VectorHit> >& theMap, - edmNew::DetSetVector<VectorHit>& theCollection, - const int totalSize) const { - theCollection.reserve(theMap.size(), totalSize); - for (const auto& it : theMap) { - edmNew::DetSetVector<VectorHit>::FastFiller vh_col(theCollection, it.first); - for (const auto& vh_it : it.second) - vh_col.push_back(vh_it); - } -} diff --git a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py index bb76495d7438a..bece85beee642 100644 --- a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py +++ b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py @@ -102,23 +102,11 @@ ) ) from Configuration.ProcessModifiers.vectorHits_cff import vectorHits - -(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, TrackProducers = ['initialStepTracks', - 'highPtTripletStepTracks', - 'lowPtQuadStepTracks', - 'lowPtTripletStepTracks', - 'detachedQuadStepTracks', - 'pixelPairStepTracks', - 'pixelLessStepTracks'], - hasSelector = [1,1,1,1,1,1,1], - indivShareFrac = [1.0,0.16,0.095,0.09,0.09,0.09,0.095], - selectedTrackQuals = ['initialStepSelector:initialStep', - 'highPtTripletStepSelector:highPtTripletStep', - 'lowPtQuadStepSelector:lowPtQuadStep', - 'lowPtTripletStepSelector:lowPtTripletStep', - 'detachedQuadStep', - 'pixelPairStepSelector:pixelPairStep', - 'pixelLessStepSelector:pixelLessStep'], - setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True))) -) +def _extend_pixelLess(x): + x.TrackProducers += ['pixelLessStepTracks'] + x.hasSelector += [1] + x.indivShareFrac += [0.095] + x.selectedTrackQuals += ['pixelLessStepSelector:pixelLessStep'] + x.setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True))) +(trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, _extend_pixelLess) diff --git a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc index 540532c0ad0ba..54b75367b7df5 100644 --- a/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc +++ b/RecoTracker/MeasurementDet/plugins/MeasurementTrackerESProducer.cc @@ -17,7 +17,6 @@ #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "RecoLocalTracker/Records/interface/TrackerCPERecord.h" -//#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 334d2f384d69a..9db09eea11ba7 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -47,7 +47,7 @@ class SeedingOTEDProducer : public edm::stream::EDProducer<> { std::vector<const VectorHit*> collectVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); void printVHsOnLayer(const edmNew::DetSetVector<VectorHit>&, unsigned int); const TrajectoryStateOnSurface buildInitialTSOS(const VectorHit*) const; - AlgebraicSymMatrix55 assign44To55(AlgebraicSymMatrix44) const; + AlgebraicSymMatrix55 assign44To55(const AlgebraicSymMatrix44&) const; std::pair<bool, TrajectoryStateOnSurface> propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator&, const TrackingRecHit& hit) const; @@ -322,9 +322,7 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto return tsos; } -AlgebraicSymMatrix55 SeedingOTEDProducer::assign44To55(AlgebraicSymMatrix44 mat44) const { - // if (mat44.num_row() != 4 || mat44.num_col() != 4) - // assert("Wrong dimension! This should be a 4x4 matrix!"); +AlgebraicSymMatrix55 SeedingOTEDProducer::assign44To55(const AlgebraicSymMatrix44& mat44) const { AlgebraicSymMatrix55 result; for (int i = 1; i < 5; i++) { diff --git a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc index e23f3a66df3e7..84908be991070 100644 --- a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc +++ b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc @@ -5,7 +5,6 @@ #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" #include "RecoLocalTracker/Records/interface/TrackerCPERecord.h" -//#include "RecoLocalTracker/Records/interface/TkPhase2OTCPERecord.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h" #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h" From 988c5a36f501de72f62ad4c82b47bccfa3baf316 Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Thu, 15 Oct 2020 04:11:49 +0200 Subject: [PATCH 589/778] code format and checks --- DataFormats/TrackerRecHit2D/interface/VectorHit2D.h | 2 +- DataFormats/TrackerRecHit2D/src/VectorHit.cc | 4 ++-- .../src/VectorHitBuilderAlgorithmBase.cc | 1 - .../FinalTrackSelectors/python/earlyGeneralTracks_cfi.py | 2 +- RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc | 1 - 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h index 3143cd72c72c8..d55130f6df8f3 100644 --- a/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h +++ b/DataFormats/TrackerRecHit2D/interface/VectorHit2D.h @@ -16,7 +16,7 @@ class VectorHit2D { theDirection(dir), theCovMatrix(covMatrix), theLocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]), - theChi2(chi2){} + theChi2(chi2) {} const LocalPoint& localPosition() const { return thePosition; } const LocalVector& localDirection() const { return theDirection; } diff --git a/DataFormats/TrackerRecHit2D/src/VectorHit.cc b/DataFormats/TrackerRecHit2D/src/VectorHit.cc index d942c95062104..d57358cc8f5d0 100644 --- a/DataFormats/TrackerRecHit2D/src/VectorHit.cc +++ b/DataFormats/TrackerRecHit2D/src/VectorHit.cc @@ -40,8 +40,8 @@ VectorHit::VectorHit(const GeomDet& idet, theCurvatureError(curvatureError), thePhi(phi) { //building the cov matrix 4x4 starting from the 2x2 - const AlgebraicSymMatrix22 covMatZX = vh2Dzx.covMatrix(); - const AlgebraicSymMatrix22 covMatZY = vh2Dzy.covMatrix(); + const AlgebraicSymMatrix22& covMatZX = vh2Dzx.covMatrix(); + const AlgebraicSymMatrix22& covMatZY = vh2Dzy.covMatrix(); theCovMatrix = AlgebraicSymMatrix44(); diff --git a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc index 7d557b6beec5f..b875042c9fee1 100644 --- a/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc +++ b/RecoLocalTracker/SiPhase2VectorHitBuilder/src/VectorHitBuilderAlgorithmBase.cc @@ -95,4 +95,3 @@ void VectorHitBuilderAlgorithmBase::printCluster(const GeomDet* geomDetUnit, return; } - diff --git a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py index bece85beee642..294008807c0df 100644 --- a/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py +++ b/RecoTracker/FinalTrackSelectors/python/earlyGeneralTracks_cfi.py @@ -107,6 +107,6 @@ def _extend_pixelLess(x): x.hasSelector += [1] x.indivShareFrac += [0.095] x.selectedTrackQuals += ['pixelLessStepSelector:pixelLessStep'] - x.setsToMerge = cms.VPSet( cms.PSet( tLists=cms.vint32(0,1,2,3,4,5,6), pQual=cms.bool(True))) + x.setsToMerge[0].tLists += [6] (trackingPhase2PU140 & vectorHits).toModify(earlyGeneralTracks, _extend_pixelLess) diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc index 9db09eea11ba7..ba28198988b29 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedingOTEDProducer.cc @@ -323,7 +323,6 @@ const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS(const Vecto } AlgebraicSymMatrix55 SeedingOTEDProducer::assign44To55(const AlgebraicSymMatrix44& mat44) const { - AlgebraicSymMatrix55 result; for (int i = 1; i < 5; i++) { for (int j = 1; j < 5; j++) { From 53aad7ea80671ecabf2561adcf945493510bc54f Mon Sep 17 00:00:00 2001 From: Jan-Frederik <jschulte@cern.ch> Date: Thu, 15 Oct 2020 04:39:51 +0200 Subject: [PATCH 590/778] fix vectorHits workflows --- .../PyReleaseValidation/python/upgradeWorkflowComponents.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 6ca34a2531afd..89ede13d1b47f 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -306,16 +306,15 @@ def condition(self, fragment, stepList, key, hasHarvest): return fragment=="TTbar_14TeV" and '2026' in key upgradeWFs['vectorHits'] = UpgradeWorkflow_vectorHits( steps = [ - 'Reco', + 'RecoGlobal', ], PU = [ - 'Reco', + 'RecoGlobal', ], suffix = '_vectorHits', offset = 0.9, ) - # Patatrack workflows class UpgradeWorkflowPatatrack(UpgradeWorkflow): def condition(self, fragment, stepList, key, hasHarvest): From 7ee7f7ba8bbb44f68463143dd092945e28ad4074 Mon Sep 17 00:00:00 2001 From: Andreas Psallidas <andreas.psallidas@cern.ch> Date: Thu, 15 Oct 2020 08:22:04 +0200 Subject: [PATCH 591/778] updating scripts due to the new ticl multiclusters collection names --- Validation/HGCalValidation/python/html.py | 22 +-- .../scripts/hgcalPerformanceValidation.py | 159 +++++++++++++----- 2 files changed, 131 insertions(+), 50 deletions(-) diff --git a/Validation/HGCalValidation/python/html.py b/Validation/HGCalValidation/python/html.py index 8d2892ff3e129..1d770c671ae5f 100644 --- a/Validation/HGCalValidation/python/html.py +++ b/Validation/HGCalValidation/python/html.py @@ -99,8 +99,8 @@ "hitCalibration": "Reconstructed hits calibration", "hitValidation" : "Simulated hits, digis, reconstructed hits validation" , "hgcalLayerClusters": "Layer clusters", - "multiClustersFromTrackstersEM": "Electromagnetic multiclusters", - "multiClustersFromTrackstersHAD": "Hadronic multiclusters", + "ticlMultiClustersFromTrackstersEM": "Electromagnetic multiclusters", + "ticlMultiClustersFromTrackstersHAD": "Hadronic multiclusters", "hgcalMultiClusters" : "Old multiclusters", "standalone" : "Standalone study on simulated hits, digis, reconstructed hits" } @@ -110,10 +110,10 @@ # Will add later # hgcalLayerClusters ("hgcalLayerClusters", "Layer clusters"), - # multiClustersFromTrackstersEM - ("multiClustersFromTrackstersEM","Electromagnetic multiclusters"), - # multiClustersFromTrackstersHAD - ("multiClustersFromTrackstersHAD","Hadronic multiclusters"), + # ticlMultiClustersFromTrackstersEM + ("ticlMultiClustersFromTrackstersEM","Electromagnetic multiclusters"), + # ticlMultiClustersFromTrackstersHAD + ("ticlMultiClustersFromTrackstersHAD","Hadronic multiclusters"), # hgcalMultiClusters ("hgcalMultiClusters","Old multiclusters"), ]) @@ -122,7 +122,7 @@ _summary = {} #Objects to keep in summary -_summobj = ['hitCalibration','hitValidation', 'hgcalLayerClusters','multiClustersFromTrackstersEM','multiClustersFromTrackstersHAD'] +_summobj = ['hitCalibration','hitValidation', 'hgcalLayerClusters','ticlMultiClustersFromTrackstersEM','ticlMultiClustersFromTrackstersHAD'] #_summobj = ['hitCalibration','hitValidation', 'hgcalLayerClusters'] #Plots to keep in summary from hitCalibration @@ -158,7 +158,7 @@ ] -#Plots to keep in summary from multiClustersFromTrackstersEM +#Plots to keep in summary from ticlMultiClustersFromTrackstersEM summmcEM = [ 'Efficiencies/Efficiencies_globalEfficiencies.png' , 'Duplicates/Duplicates_globalEfficiencies.png' , @@ -166,7 +166,7 @@ 'MergeRate/MergeRate_globalEfficiencies.png' ] -#Plots to keep in summary from multiClustersFromTrackstersHAD +#Plots to keep in summary from ticlMultiClustersFromTrackstersHAD summmcHAD = summmcEM #Plots to keep in summary from standalone analysis @@ -180,8 +180,8 @@ _summary['hitCalibration'] = summhitcalib _summary['hitValidation'] = summhitvalid _summary['hgcalLayerClusters'] = summlc -_summary['multiClustersFromTrackstersEM'] = summmcEM -_summary['multiClustersFromTrackstersHAD'] = summmcHAD +_summary['ticlMultiClustersFromTrackstersEM'] = summmcEM +_summary['ticlMultiClustersFromTrackstersHAD'] = summmcHAD diff --git a/Validation/HGCalValidation/scripts/hgcalPerformanceValidation.py b/Validation/HGCalValidation/scripts/hgcalPerformanceValidation.py index aff834e67b488..39cf0fcdd77b2 100755 --- a/Validation/HGCalValidation/scripts/hgcalPerformanceValidation.py +++ b/Validation/HGCalValidation/scripts/hgcalPerformanceValidation.py @@ -31,8 +31,8 @@ def parseOptions(): parser.add_option('', '--Obj', dest='OBJ', type='string', default=None, help='Object to run. Options are: Geometry, SimHits, Digis, RecHits, Calibrations, CaloParticles, hgcalLayerClusters') parser.add_option('', '--html-validation-name', dest='HTMLVALNAME', type='string', default='', help='Could be either be hgcalLayerClusters or hgcalMultiClusters') parser.add_option('-d', '--download', action='store_true', dest='DOWNLOAD', default=False, help='Download DQM files from RelVals') - parser.add_option('-g', '--gather', dest='GATHER', type='string', default=None, help='Objects to gather: hitValidation, hitCalibration, hgcalLayerClusters, hgcalMultiClusters, multiClustersFromTrackstersEM, multiClustersFromTrackstersHAD') - parser.add_option('-w', '--wwwarea', dest='WWWAREA', type='string', default='/eos/project/h/hgcaldpg/www', help='Objects to gather: hitValidation, hitCalibration, hgcalLayerClusters, hgcalMultiClusters, multiClustersFromTrackstersEM, multiClustersFromTrackstersHAD') + parser.add_option('-g', '--gather', dest='GATHER', type='string', default=None, help='Objects to gather: hitValidation, hitCalibration, hgcalLayerClusters, hgcalMultiClusters, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD') + parser.add_option('-w', '--wwwarea', dest='WWWAREA', type='string', default='/eos/project/h/hgcaldpg/www', help='Objects to gather: hitValidation, hitCalibration, hgcalLayerClusters, hgcalMultiClusters, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD') parser.add_option('-y', '--dry-run', action='store_true', dest='DRYRUN', default=False, help='perform a dry run (nothing is lauched).') parser.add_option('-i', '--inputeosarea', dest='INPUT', type='string', default='/eos/cms/store/group/dpg_hgcal/comm_hgcal/apsallid/RelVals', help='Eos area where we will place all DQM files of the new and reference release campaign') @@ -78,7 +78,19 @@ def putype(t): # will be placed. #------------------------------------------------------------------------------------------ #thereleases = { "CMSSW 11_1_X" : ["CMSSW_11_1_0_pre4_GEANT4","CMSSW_11_1_0_pre3","CMSSW_11_1_0_pre2"] } -thereleases = { "CMSSW 11_1_X" : [ +thereleases = { "CMSSW 11_2_X" : [ + "CMSSW_11_2_0_pre7_vs_CMSSW_11_2_0_pre6", + "CMSSW_11_2_0_pre6_ROOT622_vs_CMSSW_11_2_0_pre6", + "CMSSW_11_2_0_pre6_vs_CMSSW_11_2_0_pre5", + "CMSSW_11_2_0_pre5_GEANT106_vs_CMSSW_11_2_0_pre5", + "CMSSW_11_2_0_pre5_vs_CMSSW_11_2_0_pre3", + "CMSSW_11_2_0_pre3_vs_CMSSW_11_2_0_pre1", + "CMSSW_11_2_0_pre1_vs_CMSSW_11_1_0_pre8" + ], + "CMSSW 11_1_X" : [ + "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre8", + "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre7_raw1100", + "CMSSW_11_1_0_pre8_vs_CMSSW_11_1_0_pre7", "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre7", "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre6_raw1100", "CMSSW_11_1_0_pre7_vs_CMSSW_11_1_0_pre6", @@ -91,11 +103,12 @@ def putype(t): "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre4", "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre3_raw1100", "CMSSW_11_1_0_pre4_GEANT4","CMSSW_11_1_0_pre4" -] } + ] +} -RefRelease='CMSSW_11_1_0_pre7' +RefRelease='CMSSW_11_2_0_pre7' -NewRelease='CMSSW_11_1_0_pre7' +NewRelease='CMSSW_11_2_0_pre7' NotNormalRelease = "raw" NotNormalRefRelease = "normal" @@ -106,7 +119,9 @@ def putype(t): exit() if "raw" in NotNormalRelease: - appendglobaltag = "_2026D49noPU_raw1100_rsb" +# appendglobaltag = "_2026D49noPU_raw1100_rsb" +# appendglobaltag = "_2026D49noPU_raw1100" + appendglobaltag = "_2026D49noPU_gcc900" else: appendglobaltag = "_2026D49noPU" @@ -158,32 +173,76 @@ def putype(t): #Main workflow RelVals phase2samples_noPU = [ - #Sample("RelValZpTT_1500", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValZpTT_1500", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + ##Sample("RelValZpTT_1500", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValZTT", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValZEE", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + ##Sample("RelValTenTau_15_500_Eta3p1", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValTenTau_15_500", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValTTbar", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValQCD_Pt15To7000_Flat", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + ##Sample("RelValQCD_Pt15To7000_Flat", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValNuGun", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + ##Sample("RelValMinBias", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValMinBias", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValH125GGgluonfusion", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ) + + + Sample("RelValZpTT_1500", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValZpTT_1500", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValZTT", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValZEE", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValTenTau_15_500_Eta3p1", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValTenTau_15_500", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValTTbar", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), - #Sample("RelValQCD_Pt15To7000_Flat", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), + Sample("RelValQCD_Pt15To7000_Flat", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValQCD_Pt15To7000_Flat", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValNuGun", scenario="2026D49", appendGlobalTag=appendglobaltag ), - #Sample("RelValMinBias", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValMinBias", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), + Sample("RelValMinBias", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValH125GGgluonfusion", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ) + ] #More workflows phase2samples_noPU_extend = [ + + #Sample("RelValSingleMuPt10", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2"), + #Sample("RelValSingleMuPt100", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValSingleMuPt1000", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ) + + + Sample("RelValSingleMuPt10", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValSingleMuPt100", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValSingleMuPt1000", scenario="2026D49", appendGlobalTag=appendglobaltag ) + ] #These workflows were added in CMSSW_11_1_0_pre6 but there were missing from CMSSW_11_1_0_pre5. #So, I am only download them to be reary for pre7. Then, I comment them out -#For the moment I cannot find these in pre7. -''' +#For the moment I cannot find these in pre7. phase2samples_noPU_extend_more = [ + + #Sample("RelValCloseByPGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValCloseByPGun_CE_H_Fine_200um", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValCloseByPGun_CE_H_Fine_120um", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValCloseByPGun_CE_H_Coarse_Scint", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValCloseByPGun_CE_H_Coarse_300um", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValCloseByPGun_CE_E_Front_300um", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValCloseByPGun_CE_E_Front_200um", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValCloseByPGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValSingleGammaFlatPt8To150", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValSingleEFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ), + #Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ) + + + + Sample("RelValCloseByPGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValCloseByPGun_CE_H_Fine_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValCloseByPGun_CE_H_Fine_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ), @@ -194,25 +253,40 @@ def putype(t): Sample("RelValCloseByPGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValSingleGammaFlatPt8To150", scenario="2026D49", appendGlobalTag=appendglobaltag ), Sample("RelValSingleEFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValQCD_Pt20toInfMuEnrichPt15", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValDisplacedMuPt30To100", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValDisplacedMuPt2To10", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValDisplacedMuPt10To30", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValB0ToKstarMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValBsToEleEle", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValBsToMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValBsToJpsiGamma", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValBsToJpsiPhi_mumuKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValBsToPhiPhi_KKKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValTauToMuMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValSingleTauFlatPt2To150", scenario="2026D49", appendGlobalTag=appendglobaltag ), - Sample("RelValSingleMuFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ) + Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ) + + + #Sample("RelValCloseByPGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValCloseByPGun_CE_H_Fine_200um", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValCloseByPGun_CE_H_Fine_120um", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValCloseByPGun_CE_H_Coarse_Scint", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValCloseByPGun_CE_H_Coarse_300um", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValCloseByPGun_CE_E_Front_300um", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValCloseByPGun_CE_E_Front_200um", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValCloseByPGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValSingleGammaFlatPt8To150", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValSingleEFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ), + #Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag + "_HGCal" ) + + + #Sample("RelValQCD_Pt20toInfMuEnrichPt15", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValDisplacedMuPt30To100", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValDisplacedMuPt2To10", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValDisplacedMuPt10To30", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValB0ToKstarMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValBsToEleEle", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValBsToMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValBsToJpsiGamma", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValBsToJpsiPhi_mumuKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValBsToPhiPhi_KKKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValTauToMuMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValSingleTauFlatPt2To150", scenario="2026D49", appendGlobalTag=appendglobaltag ), + #Sample("RelValSingleMuFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ) ] -''' + phase2samples_noPU.extend(phase2samples_noPU_extend) -#phase2samples_noPU.extend(phase2samples_noPU_extend_more) +phase2samples_noPU.extend(phase2samples_noPU_extend_more) #phase2samples_noPU.extend(phase2samples_noPU_oldnaming) #For the PU samples @@ -247,14 +321,20 @@ def putype(t): processCmd('mkdir -p '+RefRepository+'/'+NewRelease) for infi in phase2samples_noPU: - processCmd('mv ' + infi.filename(NewRelease) + ' ' + RefRepository+'/'+NewRelease) + if "_HGCal" in infi.filename(NewRelease): + processCmd('mv ' + infi.filename(NewRelease) + ' ' + infi.filename(NewRelease).replace("_HGCal","")) + processCmd('mv ' + infi.filename(NewRelease).replace("_HGCal","") + ' ' + RefRepository+'/'+NewRelease) + else: + #processCmd('mv ' + infi.filename(NewRelease) + ' ' + infi.filename(NewRelease).replace("2026D49noPU-v2","2026D49noPU-v1")) + #processCmd('mv ' + infi.filename(NewRelease).replace("2026D49noPU-v2","2026D49noPU-v1") + ' ' + RefRepository+'/'+NewRelease) + processCmd('mv ' + infi.filename(NewRelease) + ' ' + RefRepository+'/'+NewRelease) #------------------------------------------------------------------------------------------ #Objects processing section: The objects defined in --Obj are analyzed here. #------------------------------------------------------------------------------------------ -#This is the hgcalLayerClusters, multiClustersFromTrackstersEM, multiClustersFromTrackstersHAD, and hitCalibration part -if (opt.OBJ == 'hgcalLayerClusters' or opt.OBJ == 'hitCalibration' or opt.OBJ == 'multiClustersFromTrackstersEM' or opt.OBJ == 'multiClustersFromTrackstersHAD'): +#This is the hgcalLayerClusters, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD, and hitCalibration part +if (opt.OBJ == 'hgcalLayerClusters' or opt.OBJ == 'hitCalibration' or opt.OBJ == 'ticlMultiClustersFromTrackstersEM' or opt.OBJ == 'ticlMultiClustersFromTrackstersHAD'): fragments = [] #Now that we have them in eos lets produce plots #Let's loop through RelVals @@ -278,11 +358,11 @@ def putype(t): if RefRelease == None: cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename)+ ' --collection %s' %(opt.HTMLVALNAME) elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease: - #cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v3_raw1100-v1","mcRun4_realistic_v3_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) - cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v3_2026D49noPU_raw1100_rsb-v1","mcRun4_realistic_v3_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) + cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v2_2026D49noPU_gcc900-v1","mcRun4_realistic_v2_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) + #cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v3_2026D49noPU_raw1100_rsb-v1","mcRun4_realistic_v3_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) elif "raw" in NotNormalRelease and "raw" in NotNormalRefRelease: - cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) - #cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("_2026D49noPU_raw1100_rsb","_raw1100") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) + #cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) + cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("_raw1100","_raw1100_rsb") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease: cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) else: @@ -300,7 +380,7 @@ def putype(t): processCmd('awk \'NR>=6&&NR<=44\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename)) if opt.OBJ == 'hitCalibration': processCmd('awk \'NR>=6&&NR<=15\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename)) - if opt.OBJ == 'multiClustersFromTrackstersEM' or opt.OBJ == 'multiClustersFromTrackstersHAD': + if opt.OBJ == 'ticlMultiClustersFromTrackstersEM' or opt.OBJ == 'ticlMultiClustersFromTrackstersHAD': processCmd('awk \'NR>=6&&NR<=25\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename)) @@ -372,10 +452,11 @@ def putype(t): if RefRelease == None: cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename)+ ' --collection %s' %(opt.HTMLVALNAME) elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease: - cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v3_2026D49noPU_raw1100_rsb-v1","mcRun4_realistic_v3_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) + cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v2_2026D49noPU_gcc900-v1","mcRun4_realistic_v2_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) + #cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v3_2026D49noPU_raw1100_rsb-v1","mcRun4_realistic_v3_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) elif "raw" in NotNormalRelease and "raw" in NotNormalRefRelease: - cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) - #cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("_2026D49noPU_raw1100_rsb","_raw1100") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) + #cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) + cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("_raw1100","_raw1100_rsb") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease: cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) else: From 160a1a5ab16011196117711eb66710afbbf50036 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Thu, 15 Oct 2020 09:38:05 +0200 Subject: [PATCH 592/778] remove unused headers --- DetectorDescription/Core/interface/DDPath.h | 28 ------------------- .../Core/interface/DDRegistry.h | 23 --------------- .../interface/DDExpandedViewDump.h | 9 ------ 3 files changed, 60 deletions(-) delete mode 100644 DetectorDescription/Core/interface/DDPath.h delete mode 100644 DetectorDescription/Core/interface/DDRegistry.h delete mode 100644 DetectorDescription/RegressionTest/interface/DDExpandedViewDump.h diff --git a/DetectorDescription/Core/interface/DDPath.h b/DetectorDescription/Core/interface/DDPath.h deleted file mode 100644 index 21376b956b5ee..0000000000000 --- a/DetectorDescription/Core/interface/DDPath.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef DDPath_h -#define DDPath_h - -#include "DetectorDescription/Core/interface/DDLogicalPart.h" -#include "DetectorDescription/Core/interface/DDPartSelection.h" - -#include <vector> -#include <utility> -#include <string> - -//enum typ_t { ddunknown, ddanynode, ddanychild, ddanylogp, ddanyposp, ddchildlogp, ddchildposp }; -typedef ddselection_type typ_t; - -struct DDPathLevel { - DDPathLevel(DDLogicalPart lp, int cp, typ_t t) - : lp_(lp), copyno_(cp), typ_(t) { } - - DDLogicalPart lp_; - - int copyno_; - - typ_t typ_; -}; - - -typedef std::vector< DDPathLevel > DDPath; - -#endif diff --git a/DetectorDescription/Core/interface/DDRegistry.h b/DetectorDescription/Core/interface/DDRegistry.h deleted file mode 100644 index 30e7c3097b36a..0000000000000 --- a/DetectorDescription/Core/interface/DDRegistry.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef DDD_DDRegistry_h -#define DDD_DDRegistry_h - -#include <map> -//#include "DetectorDescription/Core/interface/Singleton.h" -#include "DetectorDescription/Core/interface/DDName.h" - -template <class T> -class DDRegistry : public std::map<DDName,T> -{ -public: -/* - typedef std::map<DDName,T> RegistryMap; - typedef typename RegistryMap::iterator iterator; - typedef typename RegistryMap::const_iterator const_iterator; - typedef typename RegistryMap::value_type value_type; - typedef typename RegistryMap::key_type key_type; - typedef typename RegistryMap::std::mapped_type std::mapped_type; -*/ -private: - //RegMap reg_; -}; -#endif //. DDD_DDRegistry_h diff --git a/DetectorDescription/RegressionTest/interface/DDExpandedViewDump.h b/DetectorDescription/RegressionTest/interface/DDExpandedViewDump.h deleted file mode 100644 index d977490b09fa1..0000000000000 --- a/DetectorDescription/RegressionTest/interface/DDExpandedViewDump.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DDExpandedViewDump_h -#define DDExpandedViewDump_h - -#include <iostream> -#include "DetectorDescription/Core/interface/DDExpandedView.h" - -void DDExpandedViewDump(std::ostream &, DDExpandedView &, size_t skip=0, size_t mx=0); - -#endif From f54df668e69b76f4cabebf88aa5601614e79b04b Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Wed, 14 Oct 2020 17:10:52 +0200 Subject: [PATCH 593/778] use mother folder for summary harvesting --- .../RecoTrack/python/PostProcessorTracker_cfi.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Validation/RecoTrack/python/PostProcessorTracker_cfi.py b/Validation/RecoTrack/python/PostProcessorTracker_cfi.py index 965b67abd168a..cec8d3cd3cff9 100644 --- a/Validation/RecoTrack/python/PostProcessorTracker_cfi.py +++ b/Validation/RecoTrack/python/PostProcessorTracker_cfi.py @@ -17,6 +17,7 @@ def _addNoFlow(module): module.noFlowDists.append(tmp[ind-1]) _defaultSubdirs = ["Tracking/Track/*", "Tracking/TrackTPPtLess09/*", "Tracking/TrackFromPV/*", "Tracking/TrackFromPVAllTP/*", "Tracking/TrackAllTPEffic/*", "Tracking/TrackBuilding/*","Tracking/TrackConversion/*", "Tracking/TrackGsf/*"] +_defaultSubdirsSummary = [e.replace("/*","") for e in _defaultSubdirs] postProcessorTrack = DQMEDHarvester("DQMGenericClient", subDirs = cms.untracked.vstring(_defaultSubdirs), @@ -297,7 +298,7 @@ def _addNoFlow(module): postProcessorTrackSummary = DQMEDHarvester("DQMGenericClient", - subDirs = cms.untracked.vstring(_defaultSubdirs), + subDirs = cms.untracked.vstring(_defaultSubdirsSummary), efficiency = cms.vstring( "effic_vs_coll 'Efficiency vs track collection' num_assoc(simToReco)_coll num_simul_coll", "effic_vs_coll_allPt 'Efficiency vs track collection' num_assoc(simToReco)_coll_allPt num_simul_coll_allPt", @@ -317,7 +318,7 @@ def _addNoFlow(module): ) fastSim.toModify(postProcessorTrack, subDirs = [e for e in _defaultSubdirs if e not in ["Tracking/TrackGsf/*","Tracking/TrackConversion/*"]]) -fastSim.toModify(postProcessorTrackSummary, subDirs = [e for e in _defaultSubdirs if e not in ["Tracking/TrackGsf/*","Tracking/TrackConversion/*"]]) +fastSim.toModify(postProcessorTrackSummary, subDirs = [e for e in _defaultSubdirsSummary if e not in ["Tracking/TrackGsf","Tracking/TrackConversion"]]) ####### # Define a standalone seuquence to support the Standalone harvesting mode @@ -328,7 +329,7 @@ def _addNoFlow(module): subDirs = _defaultSubdirs+["Tracking/TrackBHadron/*"] ) postProcessorTrackSummaryStandalone = postProcessorTrackSummary.clone( - subDirs = _defaultSubdirs+["Tracking/TrackBHadron/*"] + subDirs = _defaultSubdirs+["Tracking/TrackBHadron"] ) postProcessorTrackSequenceStandalone = cms.Sequence( @@ -349,7 +350,7 @@ def _addNoFlow(module): postProcessorTrackTrackingOnly = postProcessorTrack.clone() postProcessorTrackTrackingOnly.subDirs.extend(["Tracking/TrackBHadron/*","Tracking/TrackSeeding/*", "Tracking/PixelTrack/*"]) postProcessorTrackSummaryTrackingOnly = postProcessorTrackSummary.clone() -postProcessorTrackSummaryTrackingOnly.subDirs.extend(["Tracking/TrackBHadron/*","Tracking/TrackSeeding/*", "Tracking/PixelTrack/*"]) +postProcessorTrackSummaryTrackingOnly.subDirs.extend(["Tracking/TrackBHadron","Tracking/TrackSeeding", "Tracking/PixelTrack"]) postProcessorTrackSequenceTrackingOnly = cms.Sequence( postProcessorTrackTrackingOnly+ @@ -358,4 +359,4 @@ def _addNoFlow(module): ) fastSim.toModify(postProcessorTrackTrackingOnly,subDirs = [e for e in _defaultSubdirs if e not in ["Tracking/TrackGsf/*","Tracking/TrackConversion/*","Tracking/TrackBHadron/*"]]) -fastSim.toModify(postProcessorTrackSummaryTrackingOnly,subDirs = [e for e in _defaultSubdirs if e not in ["Tracking/TrackGsf/*","Tracking/TrackConversion/*","Tracking/TrackBHadron/*"]]) +fastSim.toModify(postProcessorTrackSummaryTrackingOnly,subDirs = [e for e in _defaultSubdirsSummary if e not in ["Tracking/TrackGsf","Tracking/TrackConversion","Tracking/TrackBHadron"]]) From 21374c12ca0749e6843995f0a9c81e9fb87c313f Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Thu, 15 Oct 2020 10:52:48 +0200 Subject: [PATCH 594/778] Further optimizations for DataFormats/MuonReco --- DataFormats/MuonReco/interface/Muon.h | 12 +++++++----- DataFormats/MuonReco/src/Muon.cc | 22 ++++++++++++++-------- DataFormats/MuonReco/src/MuonSelectors.cc | 20 +++++++++++--------- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/DataFormats/MuonReco/interface/Muon.h b/DataFormats/MuonReco/interface/Muon.h index 77f7ea29697c2..cc37cc02e3224 100644 --- a/DataFormats/MuonReco/interface/Muon.h +++ b/DataFormats/MuonReco/interface/Muon.h @@ -419,12 +419,14 @@ namespace reco { float t0(int n = 0) { int i = 0; - for (auto& chamber : muMatches_) - for (auto& segment : chamber.segmentMatches) { - if (i == n) - return segment.t0; - ++i; + for (auto& chamber : muMatches_) { + int segmentMatchesSize = (int)chamber.segmentMatches.size(); + if (i + segmentMatchesSize < n) { + i += segmentMatchesSize; + continue; } + return chamber.segmentMatches[n - i].t0; + } return 0; } }; diff --git a/DataFormats/MuonReco/src/Muon.cc b/DataFormats/MuonReco/src/Muon.cc index a9749572d6c47..f1b028571b0dd 100644 --- a/DataFormats/MuonReco/src/Muon.cc +++ b/DataFormats/MuonReco/src/Muon.cc @@ -149,7 +149,10 @@ unsigned int Muon::stationMask(ArbitrationType type) const { RPCDetId rollId = chamberMatch.id.rawId(); int rpcIndex = rollId.region() == 0 ? 1 : 2; - for (auto& rpcMatch : chamberMatch.rpcMatches) { + // for (auto& rpcMatch : chamberMatch.rpcMatches) { // TO BE FIXED: there is clearly something odd here + // Replaced by something which restores the previous functionality, but one should verify which were the + // Original intentions of the author and provide a more appropriate fix (and remove these comment lines) + if (!chamberMatch.rpcMatches.empty()) { curMask = 1 << ((chamberMatch.station() - 1) + 4 * (rpcIndex - 1)); // do not double count @@ -234,7 +237,10 @@ unsigned int Muon::RPClayerMask(ArbitrationType type) const { } else rpcLayer += 6; - for (auto& rpcMatch : chamberMatch.rpcMatches) { // There is clearly something odd here + // for (auto& rpcMatch : chamberMatch.rpcMatches) { // TO BE FIXED: there is clearly something odd here + // Replaced by something which restores the previous functionality, but one should verify which were the + // Original intentions of the author and provide a more appropriate fix (and remove these comment lines) + if (!chamberMatch.rpcMatches.empty()) { curMask = 1 << (rpcLayer - 1); // do not double count @@ -293,8 +299,8 @@ unsigned int Muon::stationGapMaskPull(float sigmaCut) const { std::abs(edgeY / yErr) > sigmaCut) // inside the chamber so negates all gaps for this station continue; - if ((std::abs(edgeX / xErr) < sigmaCut && edgeY / yErr < sigmaCut) || - (std::abs(edgeY / yErr) < sigmaCut && edgeX / xErr < sigmaCut)) // inside gap + if ((std::abs(edgeX / xErr) < sigmaCut && edgeY < sigmaCut * yErr) || + (std::abs(edgeY / yErr) < sigmaCut && edgeX < sigmaCut * xErr)) // inside gap curMask = 1 << ((stationIndex - 1) + 4 * (detectorIndex - 1)); totMask += curMask; // add to total mask } @@ -503,7 +509,7 @@ float Muon::pullX(int station, int muonSubdetId, ArbitrationType type, bool incl return 999999; if (includeSegmentError) return (chamberSegmentPair.first->x - chamberSegmentPair.second->x) / - sqrt(pow(chamberSegmentPair.first->xErr, 2) + pow(chamberSegmentPair.second->xErr, 2)); + sqrt(std::pow(chamberSegmentPair.first->xErr, 2) + std::pow(chamberSegmentPair.second->xErr, 2)); return (chamberSegmentPair.first->x - chamberSegmentPair.second->x) / chamberSegmentPair.first->xErr; } @@ -518,7 +524,7 @@ float Muon::pullY(int station, int muonSubdetId, ArbitrationType type, bool incl return 999999; if (includeSegmentError) return (chamberSegmentPair.first->y - chamberSegmentPair.second->y) / - sqrt(pow(chamberSegmentPair.first->yErr, 2) + pow(chamberSegmentPair.second->yErr, 2)); + sqrt(std::pow(chamberSegmentPair.first->yErr, 2) + std::pow(chamberSegmentPair.second->yErr, 2)); return (chamberSegmentPair.first->y - chamberSegmentPair.second->y) / chamberSegmentPair.first->yErr; } @@ -531,7 +537,7 @@ float Muon::pullDxDz(int station, int muonSubdetId, ArbitrationType type, bool i return 999999; if (includeSegmentError) return (chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ) / - sqrt(pow(chamberSegmentPair.first->dXdZErr, 2) + pow(chamberSegmentPair.second->dXdZErr, 2)); + sqrt(std::pow(chamberSegmentPair.first->dXdZErr, 2) + std::pow(chamberSegmentPair.second->dXdZErr, 2)); return (chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ) / chamberSegmentPair.first->dXdZErr; } @@ -546,7 +552,7 @@ float Muon::pullDyDz(int station, int muonSubdetId, ArbitrationType type, bool i return 999999; if (includeSegmentError) return (chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ) / - sqrt(pow(chamberSegmentPair.first->dYdZErr, 2) + pow(chamberSegmentPair.second->dYdZErr, 2)); + sqrt(std::pow(chamberSegmentPair.first->dYdZErr, 2) + std::pow(chamberSegmentPair.second->dYdZErr, 2)); return (chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ) / chamberSegmentPair.first->dYdZErr; } diff --git a/DataFormats/MuonReco/src/MuonSelectors.cc b/DataFormats/MuonReco/src/MuonSelectors.cc index 341fbbc870ece..adbba0dd6800a 100644 --- a/DataFormats/MuonReco/src/MuonSelectors.cc +++ b/DataFormats/MuonReco/src/MuonSelectors.cc @@ -47,7 +47,7 @@ unsigned int muon::RequiredStationMask(const reco::Muon& muon, for (int detectorIdx = 1; detectorIdx < 3; ++detectorIdx) { float dist = muon.trackDist(stationIdx, detectorIdx, arbitrationType); if (dist < maxChamberDist && - dist / muon.trackDistErr(stationIdx, detectorIdx, arbitrationType) < maxChamberDistPull) + dist < maxChamberDistPull * muon.trackDistErr(stationIdx, detectorIdx, arbitrationType)) theMask += 1 << ((stationIdx - 1) + 4 * (detectorIdx - 1)); } } @@ -558,7 +558,7 @@ bool muon::isGoodMuon(const reco::Muon& muon, for (const auto& rpcMatch : chamberMatch.rpcMatches) { const float rpcX = rpcMatch.x; const float dX = std::abs(rpcX - trkX); - if (dX < maxAbsDx or dX / errX < maxAbsPullX) { + if (dX < maxAbsDx or dX < maxAbsPullX * errX) { ++nMatch; break; } @@ -593,10 +593,11 @@ bool muon::isGoodMuon(const reco::Muon& muon, const float dX = std::abs(me0X - trkX); const float dY = std::abs(me0Y - trkY); - const float pullX = dX / std::sqrt(errX2 + me0ErrX2); - const float pullY = dY / std::sqrt(errY2 + me0ErrY2); + const float invPullX2 = errX2 + me0ErrX2; + const float invPullY2 = errY2 + me0ErrY2; - if ((dX < maxAbsDx or pullX < maxAbsPullX) and (dY < maxAbsDy or pullY < maxAbsPullY)) { + if ((dX < maxAbsDx or dX < maxAbsPullX * std::sqrt(invPullX2)) and + (dY < maxAbsDy or dY < maxAbsPullY * std::sqrt(invPullY2))) { ++nMatch; break; } @@ -628,10 +629,11 @@ bool muon::isGoodMuon(const reco::Muon& muon, const float dX = std::abs(gemX - trkX); const float dY = std::abs(gemY - trkY); - const float pullX = dX / std::sqrt(errX2 + gemErrX2); - const float pullY = dY / std::sqrt(errY2 + gemErrY2); + const float invPullX2 = errX2 + gemErrX2; + const float invPullY2 = errY2 + gemErrY2; - if ((dX < maxAbsDx or pullX < maxAbsPullX) and (dY < maxAbsDy or pullY < maxAbsPullY)) { + if ((dX < maxAbsDx or dX < maxAbsPullX * std::sqrt(invPullX2)) and + (dY < maxAbsDy or dY < maxAbsPullY * std::sqrt(invPullY2))) { ++nMatch; break; } @@ -965,7 +967,7 @@ bool muon::isTrackerHighPtMuon(const reco::Muon& muon, const reco::Vertex& vtx) bool hits = muon.innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 && muon.innerTrack()->hitPattern().numberOfValidPixelHits() > 0; - bool momQuality = muon.tunePMuonBestTrack()->ptError() / muon.tunePMuonBestTrack()->pt() < 0.3; + bool momQuality = muon.tunePMuonBestTrack()->ptError() < 0.3 * muon.tunePMuonBestTrack()->pt(); bool ip = std::abs(muon.innerTrack()->dxy(vtx.position())) < 0.2 && std::abs(muon.innerTrack()->dz(vtx.position())) < 0.5; From 87e764fd5acf7cf7577e1553203cc8c95731abce Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Thu, 15 Oct 2020 11:24:25 +0200 Subject: [PATCH 595/778] Further optimizations for MuonIdProducer --- .../plugins/MuonIdProducer.cc | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc index d473ce155ac28..8fac2353a061d 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc @@ -11,6 +11,13 @@ // user include files #include "RecoMuon/MuonIdentification/plugins/MuonIdProducer.h" +#include "DataFormats/Math/interface/deltaPhi.h" +#include "DataFormats/MuonDetId/interface/MuonSubdetId.h" +#include "DataFormats/MuonDetId/interface/DTChamberId.h" +#include "DataFormats/MuonDetId/interface/CSCDetId.h" +#include "DataFormats/MuonDetId/interface/RPCDetId.h" +#include "DataFormats/MuonDetId/interface/GEMDetId.h" +#include "DataFormats/MuonDetId/interface/ME0DetId.h" #include "DataFormats/MuonReco/interface/MuonCocktails.h" #include "DataFormats/MuonReco/interface/MuonTime.h" #include "DataFormats/MuonReco/interface/MuonTimeExtra.h" @@ -21,15 +28,7 @@ #include "PhysicsTools/IsolationAlgos/interface/IsoDepositExtractorFactory.h" #include "TrackingTools/Records/interface/TrackingComponentsRecord.h" -#include "DataFormats/MuonDetId/interface/MuonSubdetId.h" -#include "DataFormats/MuonDetId/interface/DTChamberId.h" -#include "DataFormats/MuonDetId/interface/CSCDetId.h" -#include "DataFormats/MuonDetId/interface/RPCDetId.h" -#include "DataFormats/MuonDetId/interface/GEMDetId.h" -#include "DataFormats/MuonDetId/interface/ME0DetId.h" - #include "RecoMuon/MuonIdentification/interface/MuonMesh.h" - #include "RecoMuon/MuonIdentification/interface/MuonKinkFinder.h" MuonIdProducer::MuonIdProducer(const edm::ParameterSet& iConfig) @@ -564,7 +563,8 @@ void MuonIdProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) for (auto& muon : *outputMuons) { if (muon.innerTrack().get() == trackerMuon.innerTrack().get() && - cos(phiOfMuonInteractionRegion(muon) - phiOfMuonInteractionRegion(trackerMuon)) > 0) { + std::abs(reco::deltaPhi(phiOfMuonInteractionRegion(muon), phiOfMuonInteractionRegion(trackerMuon))) < + 0.5 * M_PI) { newMuon = false; muon.setMatches(trackerMuon.matches()); if (trackerMuon.isTimeValid()) @@ -665,7 +665,7 @@ void MuonIdProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) // predict direction based on the muon interaction region location // if it's available if (muon.isStandAloneMuon()) { - if (cos(phiOfMuonInteractionRegion(muon) - muon.phi()) > 0) { + if (std::abs(reco::deltaPhi(phiOfMuonInteractionRegion(muon), muon.phi())) < 0.5 * M_PI) { fillMuonId(iEvent, iSetup, muon, TrackDetectorAssociator::InsideOut); } else { fillMuonId(iEvent, iSetup, muon, TrackDetectorAssociator::OutsideIn); @@ -925,8 +925,10 @@ void MuonIdProducer::fillMuonId(edm::Event& iEvent, << ", chamber y: " << matchedChamber.y << ", max: " << maxAbsDy_; const double matchedSegChDx = std::abs(matchedSegment.x - matchedChamber.x); const double matchedSegChDy = std::abs(matchedSegment.y - matchedChamber.y); - const double matchedSegChPullX = matchedSegChDx / std::hypot(matchedSegment.xErr, matchedChamber.xErr); - const double matchedSegChPullY = matchedSegChDy / std::hypot(matchedSegment.yErr, matchedChamber.yErr); + const double matchedSegChPullX = + matchedSegChDx / std::sqrt(std::pow(matchedSegment.xErr, 2) + std::pow(matchedChamber.xErr, 2)); + const double matchedSegChPullY = + matchedSegChDy / std::sqrt(std::pow(matchedSegment.yErr, 2) + std::pow(matchedChamber.yErr, 2)); if (matchedSegment.xErr > 0 && matchedChamber.xErr > 0) LogTrace("MuonIdentification") << " xpull: " << matchedSegChPullX; if (matchedSegment.yErr > 0 && matchedChamber.yErr > 0) @@ -995,7 +997,7 @@ void MuonIdProducer::fillMuonId(edm::Event& iEvent, rpcHitMatch.bx = rpcRecHit.BunchX(); const double absDx = std::abs(rpcRecHit.localPosition().x() - chamber.tState.localPosition().x()); - if (absDx <= 20 or absDx / sqrt(localError.xx()) <= 4) + if (absDx <= 20 or absDx * absDx <= 16 * localError.xx()) matchedChamber.rpcMatches.push_back(rpcHitMatch); } @@ -1297,7 +1299,7 @@ void MuonIdProducer::fillMuonIsolation(edm::Event& iEvent, } reco::Muon MuonIdProducer::makeMuon(const reco::Track& track) { - const double energy = hypot(track.p(), 0.105658369); + const double energy = std::sqrt(track.p() * track.p() + 0.105658369 * 0.105658369); const math::XYZTLorentzVector p4(track.px(), track.py(), track.pz(), energy); return reco::Muon(track.charge(), p4, track.vertex()); } From daed709047c202e85dcc342d012491b25c5dc4bd Mon Sep 17 00:00:00 2001 From: Michal Bluj <michal.bluj@cern.ch> Date: Thu, 15 Oct 2020 12:35:36 +0200 Subject: [PATCH 596/778] use dict instead of PSet to define anit-e phase2 default payloads --- ...auDiscriminationAgainstElectronMVA6Phase2_cff.py | 13 +------------ ...auDiscriminationAgainstElectronMVA6Phase2_cff.py | 13 +------------ ...minationAgainstElectronMVA6Phase2_mvaDefs_cff.py | 2 +- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py index 715bd82cf6f45..7565461c686c4 100644 --- a/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py +++ b/RecoTauTag/RecoTau/python/PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py @@ -14,18 +14,7 @@ srcElectrons = "mergedSlimmedElectronsForTauId", isPhase2 = True, vetoEcalCracks = False, - mvaName_NoEleMatch_woGwoGSF_BL = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_BL, - mvaName_NoEleMatch_wGwoGSF_BL = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_BL, - mvaName_woGwGSF_BL = mvaNames_phase2.mvaName_woGwGSF_BL, - mvaName_wGwGSF_BL = mvaNames_phase2.mvaName_wGwGSF_BL, - mvaName_NoEleMatch_woGwoGSF_EC = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_EC, - mvaName_NoEleMatch_wGwoGSF_EC = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_EC, - mvaName_woGwGSF_EC = mvaNames_phase2.mvaName_woGwGSF_EC, - mvaName_wGwGSF_EC = mvaNames_phase2.mvaName_wGwGSF_EC, - mvaName_NoEleMatch_woGwoGSF_VFEC = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_VFEC, - mvaName_NoEleMatch_wGwoGSF_VFEC = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_VFEC, - mvaName_woGwGSF_VFEC = mvaNames_phase2.mvaName_woGwGSF_VFEC, - mvaName_wGwGSF_VFEC = mvaNames_phase2.mvaName_wGwGSF_VFEC + **mvaNames_phase2 ) # anti-e phase-2 tauID (WPs) from RecoTauTag.RecoTau.patTauDiscriminantCutMultiplexerDefault_cfi import patTauDiscriminantCutMultiplexerDefault diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py index ee93406fd5846..2f3db755b3eb7 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationAgainstElectronMVA6Phase2_cff.py @@ -27,18 +27,7 @@ isPhase2 = True, vetoEcalCracks = False, hgcalElectronIDs = [cms.InputTag("hgcElectronIdForTauId", key) for key in hgcElectronIdForTauId.variables], - mvaName_NoEleMatch_woGwoGSF_BL = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_BL, - mvaName_NoEleMatch_wGwoGSF_BL = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_BL, - mvaName_woGwGSF_BL = mvaNames_phase2.mvaName_woGwGSF_BL, - mvaName_wGwGSF_BL = mvaNames_phase2.mvaName_wGwGSF_BL, - mvaName_NoEleMatch_woGwoGSF_EC = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_EC, - mvaName_NoEleMatch_wGwoGSF_EC = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_EC, - mvaName_woGwGSF_EC = mvaNames_phase2.mvaName_woGwGSF_EC, - mvaName_wGwGSF_EC = mvaNames_phase2.mvaName_wGwGSF_EC, - mvaName_NoEleMatch_woGwoGSF_VFEC = mvaNames_phase2.mvaName_NoEleMatch_woGwoGSF_VFEC, - mvaName_NoEleMatch_wGwoGSF_VFEC = mvaNames_phase2.mvaName_NoEleMatch_wGwoGSF_VFEC, - mvaName_woGwGSF_VFEC = mvaNames_phase2.mvaName_woGwGSF_VFEC, - mvaName_wGwGSF_VFEC = mvaNames_phase2.mvaName_wGwGSF_VFEC + **mvaNames_phase2 ) # anti-e phase-2 tauID (WPs) from RecoTauTag.RecoTau.recoTauDiscriminantCutMultiplexerDefault_cfi import recoTauDiscriminantCutMultiplexerDefault diff --git a/RecoTauTag/RecoTau/python/tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff.py b/RecoTauTag/RecoTau/python/tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff.py index 2418cc9f74752..09927d3866bcf 100644 --- a/RecoTauTag/RecoTau/python/tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff.py +++ b/RecoTauTag/RecoTau/python/tauDiscriminationAgainstElectronMVA6Phase2_mvaDefs_cff.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms # anti-e phase-2 tauID mva names -mvaNames_phase2 = cms.PSet( +mvaNames_phase2 = dict( mvaName_NoEleMatch_woGwoGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_woGwoGSF_BL"), mvaName_NoEleMatch_wGwoGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_NoEleMatch_wGwoGSF_BL"), mvaName_woGwGSF_BL = cms.string("RecoTauTag_antiElectronPhase2MVA6v1_gbr_woGwGSF_BL"), From 3b68b667e99614c81b987429da77ad89ac46179f Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Thu, 15 Oct 2020 12:14:59 +0200 Subject: [PATCH 597/778] More optimizations for MuonIdProducer --- .../plugins/MuonIdProducer.cc | 40 +++++++++++-------- .../plugins/MuonIdProducer.h | 4 +- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc index 8fac2353a061d..0a7753d91d6cd 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc @@ -49,9 +49,11 @@ MuonIdProducer::MuonIdProducer(const edm::ParameterSet& iConfig) addExtraSoftMuons_ = iConfig.getParameter<bool>("addExtraSoftMuons"); maxAbsEta_ = iConfig.getParameter<double>("maxAbsEta"); maxAbsDx_ = iConfig.getParameter<double>("maxAbsDx"); - maxAbsPullX_ = iConfig.getParameter<double>("maxAbsPullX"); + maxAbsPullX2_ = iConfig.getParameter<double>("maxAbsPullX"); + maxAbsPullX2_ *= maxAbsPullX2_; maxAbsDy_ = iConfig.getParameter<double>("maxAbsDy"); - maxAbsPullY_ = iConfig.getParameter<double>("maxAbsPullY"); + maxAbsPullY2_ = iConfig.getParameter<double>("maxAbsPullY"); + maxAbsPullY2_ *= maxAbsPullY2_; fillCaloCompatibility_ = iConfig.getParameter<bool>("fillCaloCompatibility"); fillEnergy_ = iConfig.getParameter<bool>("fillEnergy"); storeCrossedHcalRecHits_ = iConfig.getParameter<bool>("storeCrossedHcalRecHits"); @@ -564,7 +566,7 @@ void MuonIdProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) for (auto& muon : *outputMuons) { if (muon.innerTrack().get() == trackerMuon.innerTrack().get() && std::abs(reco::deltaPhi(phiOfMuonInteractionRegion(muon), phiOfMuonInteractionRegion(trackerMuon))) < - 0.5 * M_PI) { + M_PI_2) { newMuon = false; muon.setMatches(trackerMuon.matches()); if (trackerMuon.isTimeValid()) @@ -665,7 +667,7 @@ void MuonIdProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) // predict direction based on the muon interaction region location // if it's available if (muon.isStandAloneMuon()) { - if (std::abs(reco::deltaPhi(phiOfMuonInteractionRegion(muon), muon.phi())) < 0.5 * M_PI) { + if (std::abs(reco::deltaPhi(phiOfMuonInteractionRegion(muon), muon.phi())) < M_PI_2) { fillMuonId(iEvent, iSetup, muon, TrackDetectorAssociator::InsideOut); } else { fillMuonId(iEvent, iSetup, muon, TrackDetectorAssociator::OutsideIn); @@ -860,7 +862,7 @@ void MuonIdProducer::fillMuonId(edm::Event& iEvent, std::vector<reco::MuonChamberMatch> muonChamberMatches; unsigned int nubmerOfMatchesAccordingToTrackAssociator = 0; for (const auto& chamber : info.chambers) { - if (chamber.id.subdetId() == 3 && rpcHitHandle_.isValid()) + if (chamber.id.subdetId() == MuonSubdetId::RPC && rpcHitHandle_.isValid()) continue; // Skip RPC chambers, they are taken care of below) reco::MuonChamberMatch matchedChamber; @@ -925,23 +927,29 @@ void MuonIdProducer::fillMuonId(edm::Event& iEvent, << ", chamber y: " << matchedChamber.y << ", max: " << maxAbsDy_; const double matchedSegChDx = std::abs(matchedSegment.x - matchedChamber.x); const double matchedSegChDy = std::abs(matchedSegment.y - matchedChamber.y); - const double matchedSegChPullX = - matchedSegChDx / std::sqrt(std::pow(matchedSegment.xErr, 2) + std::pow(matchedChamber.xErr, 2)); - const double matchedSegChPullY = - matchedSegChDy / std::sqrt(std::pow(matchedSegment.yErr, 2) + std::pow(matchedChamber.yErr, 2)); if (matchedSegment.xErr > 0 && matchedChamber.xErr > 0) - LogTrace("MuonIdentification") << " xpull: " << matchedSegChPullX; + LogTrace("MuonIdentification") << " xpull: " + << matchedSegChDx / std::sqrt(std::pow(matchedSegment.xErr, 2) + + std::pow(matchedChamber.xErr, 2)); if (matchedSegment.yErr > 0 && matchedChamber.yErr > 0) - LogTrace("MuonIdentification") << " ypull: " << matchedSegChPullY; + LogTrace("MuonIdentification") << " ypull: " + << matchedSegChDy / std::sqrt(std::pow(matchedSegment.yErr, 2) + + std::pow(matchedChamber.yErr, 2)); if (matchedSegChDx < maxAbsDx_) matchedX = true; + else if (matchedSegment.xErr > 0 && matchedChamber.xErr > 0) { + const double invMatchedSegChPullX2 = std::pow(matchedSegment.xErr, 2) + std::pow(matchedChamber.xErr, 2); + if (matchedSegChDx * matchedSegChDx < maxAbsPullX2_ * invMatchedSegChPullX2) + matchedX = true; + } if (matchedSegChDy < maxAbsDy_) matchedY = true; - if (matchedSegment.xErr > 0 && matchedChamber.xErr > 0 && matchedSegChPullX < maxAbsPullX_) - matchedX = true; - if (matchedSegment.yErr > 0 && matchedChamber.yErr > 0 && matchedSegChPullY < maxAbsPullY_) - matchedY = true; + else if (matchedSegment.yErr > 0 && matchedChamber.yErr > 0) { + const double invMatchedSegChPullY2 = std::pow(matchedSegment.yErr, 2) + std::pow(matchedChamber.yErr, 2); + if (matchedSegChDy * matchedSegChDy < maxAbsPullY2_ * invMatchedSegChPullY2) + matchedY = true; + } if (matchedX && matchedY) { if (matchedChamber.id.subdetId() == MuonSubdetId::ME0) matchedChamber.me0Matches.push_back(matchedSegment); @@ -958,7 +966,7 @@ void MuonIdProducer::fillMuonId(edm::Event& iEvent, LogTrace("MuonIdentification") << "RecoMuon/MuonIdProducer :: fillMuonId :: fill RPC info"; if (rpcHitHandle_.isValid()) { for (const auto& chamber : info.chambers) { - if (chamber.id.subdetId() != 3) + if (chamber.id.subdetId() != MuonSubdetId::RPC) continue; // Consider RPC chambers only const auto& lErr = chamber.tState.localError(); const auto& lPos = chamber.tState.localPosition(); diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h index c2fae4090cf56..6e81d9c72c8b8 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.h @@ -205,9 +205,9 @@ class MuonIdProducer : public edm::stream::EDProducer<> { // matching double maxAbsDx_; - double maxAbsPullX_; + double maxAbsPullX2_; double maxAbsDy_; - double maxAbsPullY_; + double maxAbsPullY2_; // what information to fill bool fillCaloCompatibility_; From f9a0cf38ecd0b912a4f36a58544d466c403a89fc Mon Sep 17 00:00:00 2001 From: Seungjin Yang <seungjin.yang@cern.ch> Date: Thu, 15 Oct 2020 22:15:05 +0900 Subject: [PATCH 598/778] Added a GEM offline DQM source sequence for the cosmics scenario and moved source/client sequences from POG to PDG. --- .../python/DQMOfflineCosmics_SecondStep_cff.py | 7 +++++++ .../Configuration/python/DQMOfflineCosmics_cff.py | 7 +++++++ .../python/DQMOfflineHeavyIons_SecondStep_cff.py | 6 ++++++ .../Configuration/python/DQMOfflineHeavyIons_cff.py | 6 ++++++ .../Configuration/python/DQMOffline_SecondStep_cff.py | 10 ++++++++++ DQMOffline/Configuration/python/DQMOffline_cff.py | 10 ++++++++++ DQMOffline/Muon/python/gemEfficiencyAnalyzer_cfi.py | 6 ++++-- DQMOffline/Muon/python/gemEfficiencyHarvester_cfi.py | 7 +------ DQMOffline/Muon/python/gem_dqm_offline_client_cff.py | 7 +++++++ DQMOffline/Muon/python/gem_dqm_offline_source_cff.py | 9 +++++++++ DQMOffline/Muon/python/muonMonitors_cff.py | 9 --------- DQMOffline/Muon/python/muonQualityTests_cff.py | 7 ------- 12 files changed, 67 insertions(+), 24 deletions(-) create mode 100644 DQMOffline/Muon/python/gem_dqm_offline_client_cff.py create mode 100644 DQMOffline/Muon/python/gem_dqm_offline_source_cff.py diff --git a/DQMOffline/Configuration/python/DQMOfflineCosmics_SecondStep_cff.py b/DQMOffline/Configuration/python/DQMOfflineCosmics_SecondStep_cff.py index 69f0186b323d3..e9a5d70975785 100644 --- a/DQMOffline/Configuration/python/DQMOfflineCosmics_SecondStep_cff.py +++ b/DQMOffline/Configuration/python/DQMOfflineCosmics_SecondStep_cff.py @@ -11,6 +11,7 @@ from DQM.DTMonitorClient.dtDQMOfflineClients_Cosmics_cff import * from DQM.RPCMonitorClient.RPCTier0Client_cff import * from DQM.CSCMonitorModule.csc_dqm_offlineclient_cosmics_cff import * +from DQMOffline.Muon.gem_dqm_offline_client_cff import * from DQMServices.Components.DQMFEDIntegrityClient_cff import * DQMNone = cms.Sequence() @@ -27,6 +28,12 @@ DQMOfflineCosmics_SecondStepMuonDPG = cms.Sequence( dtClientsCosmics * rpcTier0Client * cscOfflineCosmicsClients ) + +from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +_run3_GEM_DQMOfflineCosmics_SecondStepMuonDPG = DQMOfflineCosmics_SecondStepMuonDPG.copy() +_run3_GEM_DQMOfflineCosmics_SecondStepMuonDPG += gemClients +run3_GEM.toReplaceWith(DQMOfflineCosmics_SecondStepMuonDPG, _run3_GEM_DQMOfflineCosmics_SecondStepMuonDPG) + DQMOfflineCosmics_SecondStepFED = cms.Sequence( dqmFEDIntegrityClient ) DQMOfflineCosmics_SecondStep_PreDPG = cms.Sequence( diff --git a/DQMOffline/Configuration/python/DQMOfflineCosmics_cff.py b/DQMOffline/Configuration/python/DQMOfflineCosmics_cff.py index f897b2f46598f..2e4ada05de2fd 100644 --- a/DQMOffline/Configuration/python/DQMOfflineCosmics_cff.py +++ b/DQMOffline/Configuration/python/DQMOfflineCosmics_cff.py @@ -11,6 +11,7 @@ from DQM.DTMonitorModule.dtDQMOfflineSources_Cosmics_cff import * from DQM.RPCMonitorClient.RPCTier0Source_cff import * from DQM.CSCMonitorModule.csc_dqm_sourceclient_offline_cff import * +from DQMOffline.Muon.gem_dqm_offline_source_cff import * from DQM.EcalPreshowerMonitorModule.es_dqm_source_offline_cosmic_cff import * from DQM.CastorMonitor.castor_dqm_sourceclient_offline_cff import * @@ -33,6 +34,12 @@ rpcTier0Source * cscSources ) +from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +_run3_GEM_DQMOfflineCosmicsMuonDPG = DQMOfflineCosmicsMuonDPG.copy() +_run3_GEM_DQMOfflineCosmicsMuonDPG += gemSources +run3_GEM.toReplaceWith(DQMOfflineCosmicsMuonDPG, _run3_GEM_DQMOfflineCosmicsMuonDPG) + + DQMOfflineCosmicsCASTOR = cms.Sequence( castorSources ) DQMOfflineCosmicsPreDPG = cms.Sequence( DQMOfflineCosmicsDCS * diff --git a/DQMOffline/Configuration/python/DQMOfflineHeavyIons_SecondStep_cff.py b/DQMOffline/Configuration/python/DQMOfflineHeavyIons_SecondStep_cff.py index ff609f3beb87f..be01b91bf9392 100644 --- a/DQMOffline/Configuration/python/DQMOfflineHeavyIons_SecondStep_cff.py +++ b/DQMOffline/Configuration/python/DQMOfflineHeavyIons_SecondStep_cff.py @@ -11,6 +11,7 @@ from DQM.DTMonitorClient.dtDQMOfflineClients_cff import * from DQM.RPCMonitorClient.RPCTier0Client_cff import * from DQM.CSCMonitorModule.csc_dqm_offlineclient_collisions_cff import * +from DQMOffline.Muon.gem_dqm_offline_client_cff import * from DQMServices.Components.DQMFEDIntegrityClient_cff import * DQMNone = cms.Sequence() @@ -28,6 +29,11 @@ rpcTier0Client * cscOfflineCollisionsClients ) +from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +_run3_GEM_DQMOfflineHeavyIons_SecondStepMuonDPG = DQMOfflineHeavyIons_SecondStepMuonDPG.copy() +_run3_GEM_DQMOfflineHeavyIons_SecondStepMuonDPG += gemClients +run3_GEM.toReplaceWith(DQMOfflineHeavyIons_SecondStepMuonDPG, _run3_GEM_DQMOfflineHeavyIons_SecondStepMuonDPG) + DQMOfflineHeavyIons_SecondStepFED = cms.Sequence( dqmFEDIntegrityClient ) DQMOfflineHeavyIons_SecondStep_PreDPG = cms.Sequence( diff --git a/DQMOffline/Configuration/python/DQMOfflineHeavyIons_cff.py b/DQMOffline/Configuration/python/DQMOfflineHeavyIons_cff.py index 1ef2794f77357..75de40d2cd6f9 100644 --- a/DQMOffline/Configuration/python/DQMOfflineHeavyIons_cff.py +++ b/DQMOffline/Configuration/python/DQMOfflineHeavyIons_cff.py @@ -13,6 +13,7 @@ from DQM.DTMonitorModule.dtDQMOfflineSources_HI_cff import * from DQM.RPCMonitorClient.RPCTier0Source_cff import * from DQM.CSCMonitorModule.csc_dqm_sourceclient_offline_cff import * +from DQMOffline.Muon.gem_dqm_offline_source_cff import * from DQM.BeamMonitor.AlcaBeamMonitorHeavyIons_cff import * DQMNone = cms.Sequence() @@ -37,6 +38,11 @@ rpcTier0Source * cscSources ) +from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +_run3_GEM_DQMOfflineHeavyIonsMuonDPG = DQMOfflineHeavyIonsMuonDPG.copy() +_run3_GEM_DQMOfflineHeavyIonsMuonDPG += gemSources +run3_GEM.toReplaceWith(DQMOfflineHeavyIonsMuonDPG, _run3_GEM_DQMOfflineHeavyIonsMuonDPG) + DQMOfflineHeavyIonsPreDPG = cms.Sequence( DQMOfflineHeavyIonsDCS * DQMOfflineHeavyIonsL1T * DQMOfflineHeavyIonsEcal * diff --git a/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py b/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py index fdfc23ae61a91..870ca95a4a9c6 100644 --- a/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py +++ b/DQMOffline/Configuration/python/DQMOffline_SecondStep_cff.py @@ -10,6 +10,7 @@ from DQM.DTMonitorClient.dtDQMOfflineClients_cff import * from DQM.RPCMonitorClient.RPCTier0Client_cff import * from DQM.CSCMonitorModule.csc_dqm_offlineclient_collisions_cff import * +from DQMOffline.Muon.gem_dqm_offline_client_cff import * from DQMOffline.Hcal.HcalDQMOfflinePostProcessor_cff import * from DQM.HcalTasks.OfflineHarvestingSequence_pp import * from DQMServices.Components.DQMFEDIntegrityClient_cff import * @@ -29,6 +30,11 @@ rpcTier0Client * cscOfflineCollisionsClients ) +from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +_run3_GEM_DQMOffline_SecondStepMuonDPG = DQMOffline_SecondStepMuonDPG.copy() +_run3_GEM_DQMOffline_SecondStepMuonDPG += gemClients +run3_GEM.toReplaceWith(DQMOffline_SecondStepMuonDPG, _run3_GEM_DQMOffline_SecondStepMuonDPG) + DQMOffline_SecondStepHcal = cms.Sequence( hcalOfflineHarvesting ) DQMOffline_SecondStepHcal2 = cms.Sequence( HcalDQMOfflinePostProcessor ) @@ -189,6 +195,10 @@ muonQualityTests ) +_run3_GEM_DQMHarvestMuon = DQMHarvestMuon.copy() +_run3_GEM_DQMHarvestMuon += gemClients +run3_GEM.toReplaceWith(DQMHarvestMuon, _run3_GEM_DQMHarvestMuon) + DQMHarvestEcal = cms.Sequence( ecal_dqm_client_offline * es_dqm_client_offline ) diff --git a/DQMOffline/Configuration/python/DQMOffline_cff.py b/DQMOffline/Configuration/python/DQMOffline_cff.py index 6ff474af56f9e..0f16851a8f3b8 100644 --- a/DQMOffline/Configuration/python/DQMOffline_cff.py +++ b/DQMOffline/Configuration/python/DQMOffline_cff.py @@ -14,6 +14,7 @@ from DQM.DTMonitorModule.dtDQMOfflineSources_cff import * from DQM.RPCMonitorClient.RPCTier0Source_cff import * from DQM.CSCMonitorModule.csc_dqm_sourceclient_offline_cff import * +from DQMOffline.Muon.gem_dqm_offline_source_cff import * from DQM.CastorMonitor.castor_dqm_sourceclient_offline_cff import * from DQM.CTPPS.ctppsDQM_cff import * from DQM.SiTrackerPhase2.Phase2TrackerDQMFirstStep_cff import * @@ -60,6 +61,11 @@ rpcTier0Source * cscSources ) +from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +_run3_GEM_DQMOfflineMuonDPG = DQMOfflineMuonDPG.copy() +_run3_GEM_DQMOfflineMuonDPG += gemSources +run3_GEM.toReplaceWith(DQMOfflineMuonDPG, _run3_GEM_DQMOfflineMuonDPG) + DQMOfflineCASTOR = cms.Sequence( castorSources ) DQMOfflineCTPPS = cms.Sequence( ctppsDQMOfflineSource ) @@ -221,6 +227,10 @@ muonMonitors ) +_run3_GEM_DQMOfflineMuon = DQMOfflineMuon.copy() +_run3_GEM_DQMOfflineMuon += gemSources +run3_GEM.toReplaceWith(DQMOfflineMuon, _run3_GEM_DQMOfflineMuon) + #Taus not created in pp conditions for HI from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 _DQMOfflineTAU = cms.Sequence() diff --git a/DQMOffline/Muon/python/gemEfficiencyAnalyzer_cfi.py b/DQMOffline/Muon/python/gemEfficiencyAnalyzer_cfi.py index aeec3a375bb6d..c284afb7ab195 100644 --- a/DQMOffline/Muon/python/gemEfficiencyAnalyzer_cfi.py +++ b/DQMOffline/Muon/python/gemEfficiencyAnalyzer_cfi.py @@ -53,8 +53,10 @@ phase2_GEM.toModify(gemEfficiencyAnalyzerSTA, etaNbins=cms.untracked.int32(15), etaHigh=cms.untracked.double(3.0)) -gemEfficiencyAnalyzerSeq = cms.Sequence( +gemEfficiencyAnalyzerTightSeq = cms.Sequence( cms.ignore(gemOfflineDQMTightGlbMuons) * + gemEfficiencyAnalyzerTight) + +gemEfficiencyAnalyzerSTASeq = cms.Sequence( cms.ignore(gemOfflineDQMStaMuons) * - gemEfficiencyAnalyzerTight * gemEfficiencyAnalyzerSTA) diff --git a/DQMOffline/Muon/python/gemEfficiencyHarvester_cfi.py b/DQMOffline/Muon/python/gemEfficiencyHarvester_cfi.py index 7d4f575fe6869..ff49777cec015 100644 --- a/DQMOffline/Muon/python/gemEfficiencyHarvester_cfi.py +++ b/DQMOffline/Muon/python/gemEfficiencyHarvester_cfi.py @@ -1,18 +1,13 @@ import FWCore.ParameterSet.Config as cms -from DQMServices.Core.DQMEDHarvester import DQMEDHarvester +from DQMServices.Core.DQMEDHarvester import DQMEDHarvester gemEfficiencyHarvesterTight = DQMEDHarvester('GEMEfficiencyHarvester', folder = cms.untracked.string('GEM/GEMEfficiency/TightGlobalMuon'), logCategory = cms.untracked.string('GEMEfficiencyHarvesterTight') ) - gemEfficiencyHarvesterSTA = DQMEDHarvester('GEMEfficiencyHarvester', folder = cms.untracked.string('GEM/GEMEfficiency/StandaloneMuon'), logCategory = cms.untracked.string('GEMEfficiencyHarvesterSTA') ) - - -gemEfficiencyHarvesterSeq = cms.Sequence(gemEfficiencyHarvesterTight * - gemEfficiencyHarvesterSTA) diff --git a/DQMOffline/Muon/python/gem_dqm_offline_client_cff.py b/DQMOffline/Muon/python/gem_dqm_offline_client_cff.py new file mode 100644 index 0000000000000..8d89e87148dec --- /dev/null +++ b/DQMOffline/Muon/python/gem_dqm_offline_client_cff.py @@ -0,0 +1,7 @@ +import FWCore.ParameterSet.Config as cms + +from DQMOffline.Muon.gemEfficiencyHarvester_cfi import * + +gemClients = cms.Sequence( + gemEfficiencyHarvesterTight * + gemEfficiencyHarvesterSTA) diff --git a/DQMOffline/Muon/python/gem_dqm_offline_source_cff.py b/DQMOffline/Muon/python/gem_dqm_offline_source_cff.py new file mode 100644 index 0000000000000..0af44227fde1e --- /dev/null +++ b/DQMOffline/Muon/python/gem_dqm_offline_source_cff.py @@ -0,0 +1,9 @@ +import FWCore.ParameterSet.Config as cms + +from DQMOffline.Muon.gemOfflineMonitor_cfi import * +from DQMOffline.Muon.gemEfficiencyAnalyzer_cfi import * + +gemSources = cms.Sequence( + gemOfflineMonitor * + gemEfficiencyAnalyzerTightSeq * + gemEfficiencyAnalyzerSTASeq) diff --git a/DQMOffline/Muon/python/muonMonitors_cff.py b/DQMOffline/Muon/python/muonMonitors_cff.py index 73271adda4050..17f295b6f00ed 100644 --- a/DQMOffline/Muon/python/muonMonitors_cff.py +++ b/DQMOffline/Muon/python/muonMonitors_cff.py @@ -9,8 +9,6 @@ #dedicated analyzers for offline dqm from DQMOffline.Muon.muonAnalyzer_cff import * from DQMOffline.Muon.CSCMonitor_cfi import * -from DQMOffline.Muon.gemOfflineMonitor_cfi import * -from DQMOffline.Muon.gemEfficiencyAnalyzer_cfi import * from DQMOffline.Muon.muonIdDQM_cff import * from DQMOffline.Muon.muonIsolationDQM_cff import * @@ -37,10 +35,3 @@ muonMonitorsAndQualityTests = cms.Sequence(muonMonitors*muonQualityTests) - -_run3_muonMonitors = muonMonitors.copy() -_run3_muonMonitors += gemOfflineMonitor -_run3_muonMonitors += gemEfficiencyAnalyzerSeq - -from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM -run3_GEM.toReplaceWith(muonMonitors, _run3_muonMonitors) diff --git a/DQMOffline/Muon/python/muonQualityTests_cff.py b/DQMOffline/Muon/python/muonQualityTests_cff.py index 3e0c17e00323a..6c747f36d5e24 100644 --- a/DQMOffline/Muon/python/muonQualityTests_cff.py +++ b/DQMOffline/Muon/python/muonQualityTests_cff.py @@ -9,7 +9,6 @@ from DQMOffline.Muon.muonTestSummaryCosmics_cfi import * from DQMOffline.Muon.EfficencyPlotter_cfi import * from DQMOffline.Muon.TriggerMatchEfficencyPlotter_cfi import * -from DQMOffline.Muon.gemEfficiencyHarvester_cfi import * from DQMServices.Core.DQMQualityTester import DQMQualityTester muonSourcesQualityTests = DQMQualityTester( @@ -48,9 +47,3 @@ muonClientsQualityTests* muonTestSummary* triggerMatchEffPlotterTightMiniAOD) - -_run3_muonQualityTests = muonQualityTests.copy() -_run3_muonQualityTests += gemEfficiencyHarvesterSeq - -from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM -run3_GEM.toReplaceWith(muonQualityTests, _run3_muonQualityTests) From 70154bfcabddfea5dba05320c973f1dbdaa8b5f4 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Wed, 14 Oct 2020 19:12:15 +0200 Subject: [PATCH 599/778] update writeFile_phase2_cfg.py and use it for unit tests --- SLHCUpgradeSimulations/Geometry/test/BuildFile.xml | 5 +++++ .../Geometry/test/phase2_skimmed_geometry.sh | 6 ++++++ .../Geometry/test/testPhase2SkimmedGeometry.cpp | 2 ++ .../Geometry/test/writeFile_phase2_cfg.py | 7 +++---- 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100755 SLHCUpgradeSimulations/Geometry/test/phase2_skimmed_geometry.sh create mode 100644 SLHCUpgradeSimulations/Geometry/test/testPhase2SkimmedGeometry.cpp diff --git a/SLHCUpgradeSimulations/Geometry/test/BuildFile.xml b/SLHCUpgradeSimulations/Geometry/test/BuildFile.xml index 9d7a684243e43..78e14e010b003 100644 --- a/SLHCUpgradeSimulations/Geometry/test/BuildFile.xml +++ b/SLHCUpgradeSimulations/Geometry/test/BuildFile.xml @@ -38,4 +38,9 @@ <use name="FWCore/Utilities"/> </bin> + <bin name="testPhase2SkimmedGeometry" file="testPhase2SkimmedGeometry.cpp"> + <flags TEST_RUNNER_ARGS="/bin/bash SLHCUpgradeSimulations/Geometry/test phase2_skimmed_geometry.sh "/> + <use name="FWCore/Utilities"/> + </bin> + </environment> diff --git a/SLHCUpgradeSimulations/Geometry/test/phase2_skimmed_geometry.sh b/SLHCUpgradeSimulations/Geometry/test/phase2_skimmed_geometry.sh new file mode 100755 index 0000000000000..a53f672decd94 --- /dev/null +++ b/SLHCUpgradeSimulations/Geometry/test/phase2_skimmed_geometry.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Pass in name and status +function die { echo $1: status $2 ; exit $2; } + +(cmsRun ${LOCAL_TEST_DIR}/writeFile_phase2_cfg.py 0) || die 'Failure running cmsRun writeFile_phase2_cfg.py 0' $? diff --git a/SLHCUpgradeSimulations/Geometry/test/testPhase2SkimmedGeometry.cpp b/SLHCUpgradeSimulations/Geometry/test/testPhase2SkimmedGeometry.cpp new file mode 100644 index 0000000000000..2f0e0c40064da --- /dev/null +++ b/SLHCUpgradeSimulations/Geometry/test/testPhase2SkimmedGeometry.cpp @@ -0,0 +1,2 @@ +#include "FWCore/Utilities/interface/TestHelper.h" +RUNTEST() diff --git a/SLHCUpgradeSimulations/Geometry/test/writeFile_phase2_cfg.py b/SLHCUpgradeSimulations/Geometry/test/writeFile_phase2_cfg.py index 6f2c42fc34a59..81950b63ccdb0 100644 --- a/SLHCUpgradeSimulations/Geometry/test/writeFile_phase2_cfg.py +++ b/SLHCUpgradeSimulations/Geometry/test/writeFile_phase2_cfg.py @@ -2,14 +2,13 @@ process = cms.Process("ICALIB") process.load("Configuration.StandardSequences.Services_cff") -process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') +process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') process.trackerGeometry.applyAlignment = cms.bool(False) process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag -process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '') - +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T15', '') process.source = cms.Source("EmptyIOVSource", firstValue = cms.uint64(1), @@ -29,7 +28,7 @@ ) process.prodpixel = cms.EDAnalyzer("SiPixelDetInfoFileWriter", - FilePath = cms.untracked.string('PixelSkimmedGeometry_GeometryExtended2023Tilted.txt'), + FilePath = cms.untracked.string('PixelSkimmedGeometry_GeometryExtended2026Tilted_D49.txt'), WriteROCInfo = cms.untracked.bool(True) ) From 1e51878d92aec8073a79cf14acafaf87925aeedb Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 16 Jul 2020 15:02:47 +0200 Subject: [PATCH 600/778] add scripts for conversion among db formats --- .../DTCalibration/test/DumpDBToFile_cfg.py | 211 ++++++++++++++++++ .../DTCalibration/test/DumpFileToDB_cfg.py | 119 ++++++++++ 2 files changed, 330 insertions(+) create mode 100644 CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py create mode 100644 CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py diff --git a/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py b/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py new file mode 100644 index 0000000000000..69c6bd6899169 --- /dev/null +++ b/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py @@ -0,0 +1,211 @@ +import FWCore.ParameterSet.Config as cms +import FWCore.ParameterSet.VarParsing as VarParsing + +options = VarParsing.VarParsing() + +options.register('dbformat', + 'Legacy', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "DB format to use: 'Legacy' or 'DTRecoConditions'") + +options.register('type', + 'TTrigDB', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Database to read: 'TZeroDB', 'TTrigDB', 'VDriftDB', or 'UncertDB'") + +options.register('GT', + 'auto:run2_data', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Global tag to read, default is auto:run2_data") + +options.register('inputfile', + '', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Read payload from db file instead than GT") + +options.register('inputtag', + '', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Read payload from tag in frontier instead than GT") + +options.register('run', + 999999, #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.int, + "Run number (determines IOV to be read)") + + +options.parseArguments() + +DBFORMAT = options.dbformat +TYPE = options.type +INPUTFILE = options.inputfile +INPUTTAG = options.inputtag +GLOBALTAG = options.GT +RUN = options.run + + + +#Input sanification + +if DBFORMAT not in ['Legacy', 'DTRecoConditions'] : + print '\nERROR: invalid value for dbformat: ', DBFORMAT,'\n' + exit() + +if TYPE not in ['TZeroDB', 'TTrigDB', 'VDriftDB', 'UncertDB'] : + print '\nERROR: invalid value for type: ', TYPE,'\n' + exit() + + +if INPUTTAG!="" and INPUTFILE!="" : + print '\nERROR: specify either inputtag or inputfile\n' + exit() + + + + +ofExt = {'TZeroDB' : '_t0.txt', + 'TTrigDB' : '_ttrig.txt', + 'VDriftDB' : '_vdrift.txt', + 'UncertDB' : '_uncert.txt'} + + +if INPUTFILE!="": + OUTPUTFILE=INPUTFILE +elif INPUTTAG!="" : + OUTPUTFILE=INPUTTAG +else : + OUTPUTFILE=GLOBALTAG+"_"+str(RUN) + if OUTPUTFILE[0:5] == 'auto:' : OUTPUTFILE=OUTPUTFILE[5:] +OUTPUTFILE+=ofExt[TYPE] + + +########### + +RECORD="" +if TYPE=="TZeroDB" : RECORD = "DTT0Rcd" +elif DBFORMAT=="Legacy" : + if TYPE=="TTrigDB" : RECORD = "DTTtrigRcd" + if TYPE=="VDriftDB" : RECORD = "DTMtimeRcd" + if TYPE=="UncertDB" : + RECORD = "DTRecoUncertaintiesRcd" + print '\nWARNING, Legacy RecoUncertDB is deprecated, as it is no longer used in reconstruction code' +elif DBFORMAT=="DTRecoConditions" : + if TYPE=="TTrigDB" : RECORD = "DTRecoConditionsTtrigRcd" + if TYPE=="VDriftDB" : RECORD = "DTRecoConditionsVdriftRcd" + if TYPE=="UncertDB" : RECORD = "DTRecoConditionsUncertRcd" + + +process = cms.Process("DumpDBToFile") +process.load("CondCore.CondDB.CondDB_cfi") + +process.source = cms.Source("EmptySource", + numberEventsInRun = cms.untracked.uint32(1), + firstRun = cms.untracked.uint32(RUN) +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + + +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, GLOBALTAG, '') + +# Read from local db file +if INPUTFILE!="" : + print "\nDumpDBToFile: Read from: ", INPUTFILE + print " Record: ", RECORD + print " Type: ", TYPE + + + process.GlobalTag.toGet = cms.VPSet( + cms.PSet(record = cms.string(RECORD), + tag = cms.string(TYPE), # NOTE: commonly used tags for db files are 'ttrig', 't0','T0DB', etc. + connect = cms.string("sqlite_file:"+INPUTFILE) + ) + ) + + +# Read payload with the specified tag from frontier +if INPUTTAG!="" : + print "\nDumpDBToFile: Read from Frontier, tag: ", INPUTTAG + print " Record: ", RECORD + print " Type: ", TYPE + + process.GlobalTag.toGet = cms.VPSet( + cms.PSet(record = cms.string(RECORD), + tag = cms.string(INPUTTAG), + connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'), +# connect = cms.string('frontier://FrontierProd/CMS_COND_DT_000') + ) + ) + +# Read payload specified in the GT +else : + print "\nDumpDBToFile: Read from GT:", GLOBALTAG + print " Type:", TYPE + +print 'Writing to file: ', OUTPUTFILE, '\n' + + + + +process.dumpT0ToFile = cms.EDAnalyzer("DumpDBToFile", + dbToDump = cms.untracked.string('TZeroDB'), + dbLabel = cms.untracked.string(''), + calibFileConfig = cms.untracked.PSet( + nFields = cms.untracked.int32(8), + calibConstGranularity = cms.untracked.string('byWire') + ), + outputFileName = cms.untracked.string(OUTPUTFILE) +) + +process.dumpTTrigToFile = cms.EDAnalyzer("DumpDBToFile", + dbToDump = cms.untracked.string('TTrigDB'), + dbLabel = cms.untracked.string(''), + dbFormat = cms.untracked.string(DBFORMAT), + calibFileConfig = cms.untracked.PSet( + nFields = cms.untracked.int32(8), + calibConstGranularity = cms.untracked.string('bySL') + ), + outputFileName = cms.untracked.string(OUTPUTFILE) +) + + +process.dumpVdToFile = cms.EDAnalyzer("DumpDBToFile", + dbToDump = cms.untracked.string('VDriftDB'), + dbLabel = cms.untracked.string(''), + dbFormat = cms.untracked.string(DBFORMAT), + calibFileConfig = cms.untracked.PSet( + nFields = cms.untracked.int32(8), + calibConstGranularity = cms.untracked.string('bySL') + ), + outputFileName = cms.untracked.string(OUTPUTFILE) +) + + +process.dumpUncertToFile = cms.EDAnalyzer("DumpDBToFile", + dbToDump = cms.untracked.string('RecoUncertDB'), + dbLabel = cms.untracked.string(''), + dbFormat = cms.untracked.string(DBFORMAT), + calibFileConfig = cms.untracked.PSet( + nFields = cms.untracked.int32(8), + calibConstGranularity = cms.untracked.string('bySL') + ), + outputFileName = cms.untracked.string(OUTPUTFILE) +) + + +if TYPE=="TZeroDB" : process.p2 = cms.Path(process.dumpT0ToFile) +if TYPE=="TTrigDB" : process.p2 = cms.Path(process.dumpTTrigToFile) +if TYPE=="VDriftDB" : process.p2 = cms.Path(process.dumpVdToFile) +if TYPE=="UncertDB": process.p2 = cms.Path(process.dumpUncertToFile) + + diff --git a/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py b/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py new file mode 100644 index 0000000000000..592c0ec390d46 --- /dev/null +++ b/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py @@ -0,0 +1,119 @@ +import FWCore.ParameterSet.Config as cms +import FWCore.ParameterSet.VarParsing as VarParsing +import os + +options = VarParsing.VarParsing() + +options.register('dbformat', + 'Legacy', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "DB format to use: 'Legacy' or 'DTRecoConditions'") + +options.register('type', + 'TTrigDB', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Database to read: 'TZeroDB', 'TTrigDB', 'VDriftDB', or 'UncertDB'") + +options.register('inputfile', + '', #default value + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "Input text file to be converted") + + +options.parseArguments() + +DBFORMAT = options.dbformat +TYPE = options.type +INPUTFILE = options.inputfile + +#Input sanification + +if DBFORMAT not in ['Legacy', 'DTRecoConditions'] : + print '\nERROR: invalid value for dbformat: ', DBFORMAT,'\n' + exit() + +if TYPE not in ['TZeroDB', 'TTrigDB', 'VDriftDB', 'UncertDB'] : + print '\nERROR: invalid value for type: ', TYPE,'\n' + exit() + +if INPUTFILE == '' : + print '\nERROR: must specify inputfile\n' + exit() + + + +process = cms.Process("DumpFileToDB") +process.load("CondCore.DBCommon.CondDBSetup_cfi") + + +process.source = cms.Source("EmptySource", + numberEventsInRun = cms.untracked.uint32(1), + firstRun = cms.untracked.uint32(1) +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + + + +OUTPUTFILE = INPUTFILE.replace('.txt','')+"_"+DBFORMAT+".db" + + +RECORD="" +GRANULARITY = "bySL" + +if TYPE=="TZeroDB" : + RECORD = "DTT0Rcd" + GRANULARITY = "byWire" +if DBFORMAT=="Legacy" : + if TYPE=="TTrigDB" : RECORD = "DTTtrigRcd" + if TYPE=="VDriftDB" : RECORD = "DTMtimeRcd" + if TYPE=="UncertDB" : + RECORD = "DTRecoUncertaintiesRcd" + print '\nWARNING, Legacy RecoUncertDB is deprecated, as it is no longer used in reconstruction code' +elif DBFORMAT=="DTRecoConditions" : + if TYPE=="TTrigDB" : RECORD = "DTRecoConditionsTtrigRcd" + if TYPE=="VDriftDB" : RECORD = "DTRecoConditionsVdriftRcd" + if TYPE=="UncertDB" : + RECORD = "DTRecoConditionsUncertRcd" + TYPE='RecoUncertDB' +try: + os.remove(OUTPUTFILE) +except OSError: + pass + + +print '\n Reading ', TYPE, ' from ', INPUTFILE +print ' Record : ', RECORD +print 'writing db file : ', OUTPUTFILE, '\n' + + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDBSetup, + connect = cms.string("sqlite_file:"+OUTPUTFILE), + toPut = cms.VPSet(cms.PSet(record = cms.string(RECORD), + tag = cms.string(TYPE))) + ) + + + +#Module to convert calibration table into a DB file +process.dumpToDB = cms.EDAnalyzer("DumpFileToDB", + calibFileConfig = cms.untracked.PSet( + calibConstFileName = cms.untracked.string(INPUTFILE), + calibConstGranularity = cms.untracked.string(GRANULARITY), + ), + dbFormat = cms.untracked.string(DBFORMAT), + dbToDump = cms.untracked.string(TYPE), + ) + + + + +process.p = cms.Path(process.dumpToDB) + + From 26d2d4e619ba99a2fc685bceb8d165c09e4a0e90 Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 16 Jul 2020 15:03:58 +0200 Subject: [PATCH 601/778] fix #includes for DB objects that are not used --- CalibMuon/DTCalibration/plugins/DTVDriftMeanTimer.cc | 2 +- CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftMeanTimer.cc b/CalibMuon/DTCalibration/plugins/DTVDriftMeanTimer.cc index 7e992a07dd611..8f0e7fe061ed8 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftMeanTimer.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftMeanTimer.cc @@ -13,7 +13,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/DTGeometry/interface/DTGeometry.h" -#include "CondFormats/DTObjects/interface/DTMtime.h" +#include "DataFormats/MuonDetId/interface/DTWireId.h" #include "CalibMuon/DTCalibration/interface/DTMeanTimerFitter.h" #include "CalibMuon/DTCalibration/interface/DTCalibDBUtils.h" diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc b/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc index da2be050d55d0..17297347a421a 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftSegmentCalibration.cc @@ -17,7 +17,6 @@ #include "Geometry/DTGeometry/interface/DTGeometry.h" #include "Geometry/Records/interface/MuonGeometryRecord.h" #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h" -#include "CondFormats/DTObjects/interface/DTMtime.h" #include "CalibMuon/DTCalibration/interface/DTCalibDBUtils.h" #include "CalibMuon/DTCalibration/interface/DTSegmentSelector.h" From 24255c2662552cd20fba90343c9a4305eadc9df2 Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 16 Jul 2020 17:53:31 +0200 Subject: [PATCH 602/778] Add option to read/write new vdrift format in calibration code --- .../DTCalibration/plugins/DTVDriftSegment.cc | 41 ++++++-- .../DTCalibration/plugins/DTVDriftSegment.h | 5 +- .../DTCalibration/plugins/DTVDriftWriter.cc | 96 ++++++++++++++----- .../DTCalibration/plugins/DTVDriftWriter.h | 7 +- .../python/dtVDriftSegmentWriter_cfi.py | 3 + 5 files changed, 115 insertions(+), 37 deletions(-) diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftSegment.cc b/CalibMuon/DTCalibration/plugins/DTVDriftSegment.cc index ef8f540bb46d2..326023ddc1a11 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftSegment.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftSegment.cc @@ -16,6 +16,8 @@ #include "Geometry/Records/interface/MuonGeometryRecord.h" #include "CondFormats/DTObjects/interface/DTMtime.h" #include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" #include "CalibMuon/DTCalibration/interface/DTResidualFitter.h" #include "CalibMuon/DTCalibration/interface/DTCalibDBUtils.h" @@ -32,14 +34,17 @@ using namespace edm; namespace dtCalibration { DTVDriftSegment::DTVDriftSegment(const ParameterSet& pset) - : nSigmas_(pset.getUntrackedParameter<unsigned int>("nSigmasFitRange", 1)) { + : nSigmas_(pset.getUntrackedParameter<unsigned int>("nSigmasFitRange", 1)), + mTimeMap_(nullptr), + vDriftMap_(nullptr) { string rootFileName = pset.getParameter<string>("rootFileName"); rootFile_ = new TFile(rootFileName.c_str(), "READ"); bool debug = pset.getUntrackedParameter<bool>("debug", false); fitter_ = new DTResidualFitter(debug); - //bool debug = pset.getUntrackedParameter<bool>("debug", false); //if(debug) fitter_->setVerbosity(1); + + readLegacyVDriftDB = pset.getParameter<bool>("readLegacyVDriftDB"); } DTVDriftSegment::~DTVDriftSegment() { @@ -49,18 +54,34 @@ namespace dtCalibration { void DTVDriftSegment::setES(const edm::EventSetup& setup) { // Get the map of vdrift from the setup - ESHandle<DTMtime> mTime; - setup.get<DTMtimeRcd>().get(mTime); - mTimeMap_ = &*mTime; + if (readLegacyVDriftDB) { + ESHandle<DTMtime> mTime; + setup.get<DTMtimeRcd>().get(mTime); + mTimeMap_ = &*mTime; + } else { + ESHandle<DTRecoConditions> hVdrift; + setup.get<DTRecoConditionsVdriftRcd>().get(hVdrift); + vDriftMap_ = &*hVdrift; + // Consistency check: no parametrization is implemented for the time being + int version = vDriftMap_->version(); + if (version != 1) { + throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; + } + } } DTVDriftData DTVDriftSegment::compute(DTSuperLayerId const& slId) { // Get original value from DB; vdrift is cm/ns , resolution is cm - float vDrift = 0., resolution = 0.; - int status = mTimeMap_->get(slId, vDrift, resolution, DTVelocityUnits::cm_per_ns); - - if (status != 0) - throw cms::Exception("DTCalibration") << "Could not find vDrift entry in DB for" << slId << endl; + // Note that resolution is irrelevant as it is no longer used anywhere in reconstruction. + + float vDrift = 0., resolution = 0.; + if (readLegacyVDriftDB) { // Legacy format + int status = mTimeMap_->get(slId, vDrift, resolution, DTVelocityUnits::cm_per_ns); + if (status != 0) + throw cms::Exception("DTCalibration") << "Could not find vDrift entry in DB for" << slId << endl; + } else { // New DB format + vDrift = vDriftMap_->get(DTWireId(slId.rawId())); + } // For RZ superlayers use original value if (slId.superLayer() == 2) { diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftSegment.h b/CalibMuon/DTCalibration/plugins/DTVDriftSegment.h index 42db8c5dc88ff..1b1afbf020a71 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftSegment.h +++ b/CalibMuon/DTCalibration/plugins/DTVDriftSegment.h @@ -14,6 +14,7 @@ #include <string> class DTMtime; +class DTRecoConditions; class DTResidualFitter; class TH1F; class TFile; @@ -34,7 +35,9 @@ namespace dtCalibration { unsigned int nSigmas_; - const DTMtime* mTimeMap_; + const DTMtime* mTimeMap_; // legacy DB object + const DTRecoConditions* vDriftMap_; // DB object in new format + bool readLegacyVDriftDB; // which one to use TFile* rootFile_; DTResidualFitter* fitter_; }; diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc index 3a76eae4f64fe..bba8d23c2ace8 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc @@ -19,6 +19,8 @@ #include "CondFormats/DTObjects/interface/DTMtime.h" #include "CondFormats/DataRecord/interface/DTMtimeRcd.h" +#include "CondFormats/DTObjects/interface/DTRecoConditions.h" +#include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h" #include "CalibMuon/DTCalibration/interface/DTCalibDBUtils.h" #include "CalibMuon/DTCalibration/interface/DTVDriftPluginFactory.h" @@ -32,6 +34,8 @@ using namespace edm; DTVDriftWriter::DTVDriftWriter(const ParameterSet& pset) : granularity_(pset.getUntrackedParameter<string>("calibGranularity", "bySL")), + mTimeMap_(nullptr), + vDriftMap_(nullptr), vDriftAlgo_{DTVDriftPluginFactory::get()->create(pset.getParameter<string>("vDriftAlgo"), pset.getParameter<ParameterSet>("vDriftAlgoConfig"))} { LogVerbatim("Calibration") << "[DTVDriftWriter]Constructor called!"; @@ -39,15 +43,30 @@ DTVDriftWriter::DTVDriftWriter(const ParameterSet& pset) if (granularity_ != "bySL") throw cms::Exception("Configuration") << "[DTVDriftWriter] Check parameter calibGranularity: " << granularity_ << " option not available."; + + readLegacyVDriftDB = pset.getParameter<bool>("readLegacyVDriftDB"); + writeLegacyVDriftDB = pset.getParameter<bool>("writeLegacyVDriftDB"); + } DTVDriftWriter::~DTVDriftWriter() { LogVerbatim("Calibration") << "[DTVDriftWriter]Destructor called!"; } void DTVDriftWriter::beginRun(const edm::Run& run, const edm::EventSetup& setup) { - // Get the map of ttrig from the Setup - ESHandle<DTMtime> mTime; - setup.get<DTMtimeRcd>().get(mTime); - mTimeMap_ = &*mTime; + // Get the map of vdrift from the Setup + if (readLegacyVDriftDB) { + ESHandle<DTMtime> mTime; + setup.get<DTMtimeRcd>().get(mTime); + mTimeMap_ = &*mTime; + } else { + ESHandle<DTRecoConditions> hVdrift; + setup.get<DTRecoConditionsVdriftRcd>().get(hVdrift); + vDriftMap_ = &*hVdrift; + // Consistency check: no parametrization is implemented for the time being + int version = vDriftMap_->version(); + if (version != 1) { + throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; + } + } // Get geometry from Event Setup setup.get<MuonGeometryRecord>().get(dtGeom_); @@ -57,7 +76,16 @@ void DTVDriftWriter::beginRun(const edm::Run& run, const edm::EventSetup& setup) void DTVDriftWriter::endJob() { // Create the object to be written to DB - DTMtime* mTimeNewMap = new DTMtime(); + DTMtime* mTimeNewMap = nullptr; + DTRecoConditions* vDriftNewMap = nullptr; + if (writeLegacyVDriftDB) { + mTimeNewMap = new DTMtime(); + } else{ + vDriftNewMap = new DTRecoConditions(); + vDriftNewMap->setFormulaExpr("[0]"); + //vDriftNewMap->setFormulaExpr("[0]*(1-[1]*x)"); // add parametrization for dependency along Y + vDriftNewMap->setVersion(1); + } if (granularity_ == "bySL") { // Get all the sls from the geometry @@ -66,34 +94,52 @@ void DTVDriftWriter::endJob() { auto sl_end = superLayers.end(); for (; sl != sl_end; ++sl) { DTSuperLayerId slId = (*sl)->id(); - // Get original value from DB - float vDrift = 0., resolution = 0.; - // vdrift is cm/ns , resolution is cm - int status = mTimeMap_->get(slId, vDrift, resolution, DTVelocityUnits::cm_per_ns); // Compute vDrift + float vDriftNew = -1.; + float resolutionNew = -1; try { - dtCalibration::DTVDriftData vDriftData = vDriftAlgo_->compute(slId); - float vDriftNew = vDriftData.vdrift; - float resolutionNew = vDriftData.resolution; - // vdrift is cm/ns , resolution is cm - mTimeNewMap->set(slId, vDriftNew, resolutionNew, DTVelocityUnits::cm_per_ns); - LogVerbatim("Calibration") << "vDrift for: " << slId << " Mean " << vDriftNew << " Resolution " - << resolutionNew; - } catch (cms::Exception& e) { + dtCalibration::DTVDriftData vDriftData = vDriftAlgo_->compute(slId); + vDriftNew = vDriftData.vdrift; + resolutionNew = vDriftData.resolution; + LogVerbatim("Calibration") << "vDrift for: " << slId << " Mean " << vDriftNew << " Resolution " + << resolutionNew; + } catch (cms::Exception& e) { // Failure to compute new value, fall back to old table LogError("Calibration") << e.explainSelf(); - // Go back to original value in case of error - if (!status) { - mTimeNewMap->set(slId, vDrift, resolution, DTVelocityUnits::cm_per_ns); - LogVerbatim("Calibration") << "Keep original vDrift for: " << slId << " Mean " << vDrift << " Resolution " - << resolution; - } + if (readLegacyVDriftDB) { //...reading old db format... + int status = mTimeMap_->get(slId, vDriftNew, resolutionNew, DTVelocityUnits::cm_per_ns); + if (status == 0) { // not found; silently skip this SL + continue; + } + } else { //...reading new db format + try { + vDriftNew = vDriftMap_->get(DTWireId(slId.rawId())); + } catch (cms::Exception& e2) { + // not found; silently skip this SL + continue; + } + } + LogVerbatim("Calibration") << "Keep original vDrift for: " << slId << " Mean " << vDriftNew << " Resolution " + << resolutionNew; + + } + + // Add value to the vdrift table + if (writeLegacyVDriftDB) { + mTimeNewMap->set(slId, vDriftNew, resolutionNew, DTVelocityUnits::cm_per_ns); + } else { + vector<double> params = {vDriftNew}; + vDriftNewMap->set(DTWireId(slId.rawId()), params); } } // End of loop on superlayers } // Write the vDrift object to DB LogVerbatim("Calibration") << "[DTVDriftWriter]Writing vdrift object to DB!"; - string record = "DTMtimeRcd"; - DTCalibDBUtils::writeToDB<DTMtime>(record, mTimeNewMap); + if (writeLegacyVDriftDB) { + string record = "DTMtimeRcd"; + DTCalibDBUtils::writeToDB<DTMtime>(record, mTimeNewMap); + } else{ + DTCalibDBUtils::writeToDB<DTRecoConditions>("DTRecoConditionsVdriftRcd", vDriftNewMap); + } } diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h index c3ebf0edbf924..8f92aeeb99034 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h +++ b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h @@ -16,6 +16,7 @@ #include <string> class DTMtime; +class DTRecoConditions; class DTGeometry; namespace dtCalibration { class DTVDriftBaseAlgo; @@ -34,7 +35,11 @@ class DTVDriftWriter : public edm::EDAnalyzer { private: std::string granularity_; // enforced by SL - const DTMtime* mTimeMap_; + const DTMtime* mTimeMap_; // legacy DB object + const DTRecoConditions* vDriftMap_; // DB object in new format + bool readLegacyVDriftDB; // which format to use to read old values + bool writeLegacyVDriftDB; // which format to be created + edm::ESHandle<DTGeometry> dtGeom_; std::unique_ptr<dtCalibration::DTVDriftBaseAlgo> vDriftAlgo_; diff --git a/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfi.py b/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfi.py index c374d12678f6a..ffe82fdd80292 100644 --- a/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfi.py +++ b/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfi.py @@ -2,9 +2,12 @@ dtVDriftSegmentWriter = cms.EDAnalyzer("DTVDriftWriter", vDriftAlgo = cms.string('DTVDriftSegment'), + readLegacyVDriftDB =cms.bool(True), + writeLegacyVDriftDB =cms.bool(True), vDriftAlgoConfig = cms.PSet( rootFileName = cms.string(''), nSigmasFitRange = cms.untracked.uint32(1), + readLegacyVDriftDB =cms.bool(True), debug = cms.untracked.bool(False) ) ) From f66660601dc3d3ad9645652343fdde839228b55b Mon Sep 17 00:00:00 2001 From: Luiz Mundim <luiz.mundim@cern.ch> Date: Thu, 15 Oct 2020 16:14:48 +0200 Subject: [PATCH 603/778] Implementing code-format recomendation --- SimTransport/PPSProtonTransport/src/HectorTransport.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SimTransport/PPSProtonTransport/src/HectorTransport.cc b/SimTransport/PPSProtonTransport/src/HectorTransport.cc index fd7d41e8adf1d..0e97be3671bc5 100644 --- a/SimTransport/PPSProtonTransport/src/HectorTransport.cc +++ b/SimTransport/PPSProtonTransport/src/HectorTransport.cc @@ -154,8 +154,10 @@ bool HectorTransport::transportProton(const HepMC::GenParticle* gpart) { double theta = sqrt(thx * thx + thy * thy) * urad; // copy the kinematic changing to CMS ref. frame, only the negative Pz needs to be changed - TLorentzVector p_out( - -tan(thx * urad) * partP * cos(theta), tan(thy * urad) * partP * cos(theta), -direction*partP * cos(theta), h_p.getE()); + TLorentzVector p_out(-tan(thx * urad) * partP * cos(theta), + tan(thy * urad) * partP * cos(theta), + -direction * partP * cos(theta), + h_p.getE()); m_beamPart[line] = p_out; m_xAtTrPoint[line] = -x1_ctpps * um_to_mm; // move to CMS ref. frame From 9c4588de292d9956804b57b25ab75969e334cc6c Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 15 Oct 2020 16:48:38 +0200 Subject: [PATCH 604/778] add option to switch between new and old DB format --- .../DTCalibration/python/dtVDriftSegmentWriter_cfg.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfg.py b/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfg.py index 104ffaf1b8752..76c90393dc0e2 100644 --- a/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfg.py +++ b/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfg.py @@ -2,6 +2,10 @@ process = cms.Process("DTVDriftWriter") +### Set to true to switch to writing constants in the new DB format. +NEWDBFORMAT = False +### + process.load("CalibMuon.DTCalibration.messageLoggerDebug_cff") process.MessageLogger.debugModules = cms.untracked.vstring('dtVDriftSegmentWriter') @@ -21,11 +25,15 @@ input = cms.untracked.int32(1) ) +RECORD = 'DTMtimeRcd' +if NEWDBFORMAT : + RECORD = 'DTRecoConditionsVdriftRcd' + process.PoolDBOutputService = cms.Service("PoolDBOutputService", process.CondDB, timetype = cms.untracked.string('runnumber'), toPut = cms.VPSet(cms.PSet( - record = cms.string('DTMtimeRcd'), + record = cms.string(RECORD), tag = cms.string('vDrift') )) ) From 15bd931079eb97c756c5903e98840e441ee6cc61 Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 15 Oct 2020 16:52:50 +0200 Subject: [PATCH 605/778] fix printouts for Py3 --- .../DTCalibration/test/DumpDBToFile_cfg.py | 27 ++++++++++--------- .../DTCalibration/test/DumpFileToDB_cfg.py | 15 ++++++----- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py b/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py index 69c6bd6899169..609564a561761 100644 --- a/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py +++ b/CalibMuon/DTCalibration/test/DumpDBToFile_cfg.py @@ -1,3 +1,4 @@ +from __future__ import print_function import FWCore.ParameterSet.Config as cms import FWCore.ParameterSet.VarParsing as VarParsing @@ -54,16 +55,16 @@ #Input sanification if DBFORMAT not in ['Legacy', 'DTRecoConditions'] : - print '\nERROR: invalid value for dbformat: ', DBFORMAT,'\n' + print('\nERROR: invalid value for dbformat: ', DBFORMAT,'\n') exit() if TYPE not in ['TZeroDB', 'TTrigDB', 'VDriftDB', 'UncertDB'] : - print '\nERROR: invalid value for type: ', TYPE,'\n' + print('\nERROR: invalid value for type: ', TYPE,'\n') exit() if INPUTTAG!="" and INPUTFILE!="" : - print '\nERROR: specify either inputtag or inputfile\n' + print('\nERROR: specify either inputtag or inputfile\n') exit() @@ -94,7 +95,7 @@ if TYPE=="VDriftDB" : RECORD = "DTMtimeRcd" if TYPE=="UncertDB" : RECORD = "DTRecoUncertaintiesRcd" - print '\nWARNING, Legacy RecoUncertDB is deprecated, as it is no longer used in reconstruction code' + print('\nWARNING, Legacy RecoUncertDB is deprecated, as it is no longer used in reconstruction code') elif DBFORMAT=="DTRecoConditions" : if TYPE=="TTrigDB" : RECORD = "DTRecoConditionsTtrigRcd" if TYPE=="VDriftDB" : RECORD = "DTRecoConditionsVdriftRcd" @@ -120,9 +121,9 @@ # Read from local db file if INPUTFILE!="" : - print "\nDumpDBToFile: Read from: ", INPUTFILE - print " Record: ", RECORD - print " Type: ", TYPE + print("\nDumpDBToFile: Read from: ", INPUTFILE) + print(" Record: ", RECORD) + print(" Type: ", TYPE) process.GlobalTag.toGet = cms.VPSet( @@ -135,9 +136,9 @@ # Read payload with the specified tag from frontier if INPUTTAG!="" : - print "\nDumpDBToFile: Read from Frontier, tag: ", INPUTTAG - print " Record: ", RECORD - print " Type: ", TYPE + print("\nDumpDBToFile: Read from Frontier, tag: ", INPUTTAG) + print(" Record: ", RECORD) + print(" Type: ", TYPE) process.GlobalTag.toGet = cms.VPSet( cms.PSet(record = cms.string(RECORD), @@ -149,10 +150,10 @@ # Read payload specified in the GT else : - print "\nDumpDBToFile: Read from GT:", GLOBALTAG - print " Type:", TYPE + print("\nDumpDBToFile: Read from GT:", GLOBALTAG) + print(" Type:", TYPE) -print 'Writing to file: ', OUTPUTFILE, '\n' +print('Writing to file: ', OUTPUTFILE, '\n') diff --git a/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py b/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py index 592c0ec390d46..6a77188143f28 100644 --- a/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py +++ b/CalibMuon/DTCalibration/test/DumpFileToDB_cfg.py @@ -1,3 +1,4 @@ +from __future__ import print_function import FWCore.ParameterSet.Config as cms import FWCore.ParameterSet.VarParsing as VarParsing import os @@ -32,15 +33,15 @@ #Input sanification if DBFORMAT not in ['Legacy', 'DTRecoConditions'] : - print '\nERROR: invalid value for dbformat: ', DBFORMAT,'\n' + print('\nERROR: invalid value for dbformat: ', DBFORMAT,'\n') exit() if TYPE not in ['TZeroDB', 'TTrigDB', 'VDriftDB', 'UncertDB'] : - print '\nERROR: invalid value for type: ', TYPE,'\n' + print('\nERROR: invalid value for type: ', TYPE,'\n') exit() if INPUTFILE == '' : - print '\nERROR: must specify inputfile\n' + print('\nERROR: must specify inputfile\n') exit() @@ -74,7 +75,7 @@ if TYPE=="VDriftDB" : RECORD = "DTMtimeRcd" if TYPE=="UncertDB" : RECORD = "DTRecoUncertaintiesRcd" - print '\nWARNING, Legacy RecoUncertDB is deprecated, as it is no longer used in reconstruction code' + print('\nWARNING, Legacy RecoUncertDB is deprecated, as it is no longer used in reconstruction code') elif DBFORMAT=="DTRecoConditions" : if TYPE=="TTrigDB" : RECORD = "DTRecoConditionsTtrigRcd" if TYPE=="VDriftDB" : RECORD = "DTRecoConditionsVdriftRcd" @@ -87,9 +88,9 @@ pass -print '\n Reading ', TYPE, ' from ', INPUTFILE -print ' Record : ', RECORD -print 'writing db file : ', OUTPUTFILE, '\n' +print('\n Reading ', TYPE, ' from ', INPUTFILE) +print(' Record : ', RECORD) +print('writing db file : ', OUTPUTFILE, '\n') process.PoolDBOutputService = cms.Service("PoolDBOutputService", From 227b975ba548f83d10dd05ea465e9c18e72b375d Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 15 Oct 2020 16:53:59 +0200 Subject: [PATCH 606/778] code-format --- .../DTCalibration/plugins/DTVDriftSegment.cc | 18 +++--- .../DTCalibration/plugins/DTVDriftSegment.h | 6 +- .../DTCalibration/plugins/DTVDriftWriter.cc | 56 +++++++++---------- .../DTCalibration/plugins/DTVDriftWriter.h | 8 +-- 4 files changed, 43 insertions(+), 45 deletions(-) diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftSegment.cc b/CalibMuon/DTCalibration/plugins/DTVDriftSegment.cc index 326023ddc1a11..514f947e54c74 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftSegment.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftSegment.cc @@ -34,9 +34,9 @@ using namespace edm; namespace dtCalibration { DTVDriftSegment::DTVDriftSegment(const ParameterSet& pset) - : nSigmas_(pset.getUntrackedParameter<unsigned int>("nSigmasFitRange", 1)), - mTimeMap_(nullptr), - vDriftMap_(nullptr) { + : nSigmas_(pset.getUntrackedParameter<unsigned int>("nSigmasFitRange", 1)), + mTimeMap_(nullptr), + vDriftMap_(nullptr) { string rootFileName = pset.getParameter<string>("rootFileName"); rootFile_ = new TFile(rootFileName.c_str(), "READ"); @@ -65,7 +65,7 @@ namespace dtCalibration { // Consistency check: no parametrization is implemented for the time being int version = vDriftMap_->version(); if (version != 1) { - throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; + throw cms::Exception("Configuration") << "only version 1 is presently supported for VDriftDB"; } } } @@ -73,13 +73,13 @@ namespace dtCalibration { DTVDriftData DTVDriftSegment::compute(DTSuperLayerId const& slId) { // Get original value from DB; vdrift is cm/ns , resolution is cm // Note that resolution is irrelevant as it is no longer used anywhere in reconstruction. - - float vDrift = 0., resolution = 0.; - if (readLegacyVDriftDB) { // Legacy format + + float vDrift = 0., resolution = 0.; + if (readLegacyVDriftDB) { // Legacy format int status = mTimeMap_->get(slId, vDrift, resolution, DTVelocityUnits::cm_per_ns); if (status != 0) - throw cms::Exception("DTCalibration") << "Could not find vDrift entry in DB for" << slId << endl; - } else { // New DB format + throw cms::Exception("DTCalibration") << "Could not find vDrift entry in DB for" << slId << endl; + } else { // New DB format vDrift = vDriftMap_->get(DTWireId(slId.rawId())); } diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftSegment.h b/CalibMuon/DTCalibration/plugins/DTVDriftSegment.h index 1b1afbf020a71..f1e42e452a086 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftSegment.h +++ b/CalibMuon/DTCalibration/plugins/DTVDriftSegment.h @@ -35,9 +35,9 @@ namespace dtCalibration { unsigned int nSigmas_; - const DTMtime* mTimeMap_; // legacy DB object - const DTRecoConditions* vDriftMap_; // DB object in new format - bool readLegacyVDriftDB; // which one to use + const DTMtime* mTimeMap_; // legacy DB object + const DTRecoConditions* vDriftMap_; // DB object in new format + bool readLegacyVDriftDB; // which one to use TFile* rootFile_; DTResidualFitter* fitter_; }; diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc index bba8d23c2ace8..363cab5cf2cf3 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc +++ b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.cc @@ -46,7 +46,6 @@ DTVDriftWriter::DTVDriftWriter(const ParameterSet& pset) readLegacyVDriftDB = pset.getParameter<bool>("readLegacyVDriftDB"); writeLegacyVDriftDB = pset.getParameter<bool>("writeLegacyVDriftDB"); - } DTVDriftWriter::~DTVDriftWriter() { LogVerbatim("Calibration") << "[DTVDriftWriter]Destructor called!"; } @@ -57,7 +56,7 @@ void DTVDriftWriter::beginRun(const edm::Run& run, const edm::EventSetup& setup) ESHandle<DTMtime> mTime; setup.get<DTMtimeRcd>().get(mTime); mTimeMap_ = &*mTime; - } else { + } else { ESHandle<DTRecoConditions> hVdrift; setup.get<DTRecoConditionsVdriftRcd>().get(hVdrift); vDriftMap_ = &*hVdrift; @@ -80,7 +79,7 @@ void DTVDriftWriter::endJob() { DTRecoConditions* vDriftNewMap = nullptr; if (writeLegacyVDriftDB) { mTimeNewMap = new DTMtime(); - } else{ + } else { vDriftNewMap = new DTRecoConditions(); vDriftNewMap->setFormulaExpr("[0]"); //vDriftNewMap->setFormulaExpr("[0]*(1-[1]*x)"); // add parametrization for dependency along Y @@ -99,37 +98,36 @@ void DTVDriftWriter::endJob() { float vDriftNew = -1.; float resolutionNew = -1; try { - dtCalibration::DTVDriftData vDriftData = vDriftAlgo_->compute(slId); - vDriftNew = vDriftData.vdrift; - resolutionNew = vDriftData.resolution; - LogVerbatim("Calibration") << "vDrift for: " << slId << " Mean " << vDriftNew << " Resolution " - << resolutionNew; - } catch (cms::Exception& e) { // Failure to compute new value, fall back to old table + dtCalibration::DTVDriftData vDriftData = vDriftAlgo_->compute(slId); + vDriftNew = vDriftData.vdrift; + resolutionNew = vDriftData.resolution; + LogVerbatim("Calibration") << "vDrift for: " << slId << " Mean " << vDriftNew << " Resolution " + << resolutionNew; + } catch (cms::Exception& e) { // Failure to compute new value, fall back to old table LogError("Calibration") << e.explainSelf(); - if (readLegacyVDriftDB) { //...reading old db format... - int status = mTimeMap_->get(slId, vDriftNew, resolutionNew, DTVelocityUnits::cm_per_ns); - if (status == 0) { // not found; silently skip this SL - continue; - } - } else { //...reading new db format - try { - vDriftNew = vDriftMap_->get(DTWireId(slId.rawId())); - } catch (cms::Exception& e2) { - // not found; silently skip this SL - continue; - } - } - LogVerbatim("Calibration") << "Keep original vDrift for: " << slId << " Mean " << vDriftNew << " Resolution " - << resolutionNew; - + if (readLegacyVDriftDB) { //...reading old db format... + int status = mTimeMap_->get(slId, vDriftNew, resolutionNew, DTVelocityUnits::cm_per_ns); + if (status == 0) { // not found; silently skip this SL + continue; + } + } else { //...reading new db format + try { + vDriftNew = vDriftMap_->get(DTWireId(slId.rawId())); + } catch (cms::Exception& e2) { + // not found; silently skip this SL + continue; + } + } + LogVerbatim("Calibration") << "Keep original vDrift for: " << slId << " Mean " << vDriftNew << " Resolution " + << resolutionNew; } - + // Add value to the vdrift table if (writeLegacyVDriftDB) { - mTimeNewMap->set(slId, vDriftNew, resolutionNew, DTVelocityUnits::cm_per_ns); + mTimeNewMap->set(slId, vDriftNew, resolutionNew, DTVelocityUnits::cm_per_ns); } else { vector<double> params = {vDriftNew}; - vDriftNewMap->set(DTWireId(slId.rawId()), params); + vDriftNewMap->set(DTWireId(slId.rawId()), params); } } // End of loop on superlayers } @@ -139,7 +137,7 @@ void DTVDriftWriter::endJob() { if (writeLegacyVDriftDB) { string record = "DTMtimeRcd"; DTCalibDBUtils::writeToDB<DTMtime>(record, mTimeNewMap); - } else{ + } else { DTCalibDBUtils::writeToDB<DTRecoConditions>("DTRecoConditionsVdriftRcd", vDriftNewMap); } } diff --git a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h index 8f92aeeb99034..a95c30059fcc9 100644 --- a/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h +++ b/CalibMuon/DTCalibration/plugins/DTVDriftWriter.h @@ -35,10 +35,10 @@ class DTVDriftWriter : public edm::EDAnalyzer { private: std::string granularity_; // enforced by SL - const DTMtime* mTimeMap_; // legacy DB object - const DTRecoConditions* vDriftMap_; // DB object in new format - bool readLegacyVDriftDB; // which format to use to read old values - bool writeLegacyVDriftDB; // which format to be created + const DTMtime* mTimeMap_; // legacy DB object + const DTRecoConditions* vDriftMap_; // DB object in new format + bool readLegacyVDriftDB; // which format to use to read old values + bool writeLegacyVDriftDB; // which format to be created edm::ESHandle<DTGeometry> dtGeom_; From 66d6251a4bb320ca5156af0cad129e870ac5bd62 Mon Sep 17 00:00:00 2001 From: "W. David Dagenhart" <wdd@fnal.gov> Date: Thu, 15 Oct 2020 17:02:01 +0200 Subject: [PATCH 607/778] Don't hardcode the global tag in the unit test --- .../ESSources/test/TestConcurrentIOVsCondCore_cfg.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CondCore/ESSources/test/TestConcurrentIOVsCondCore_cfg.py b/CondCore/ESSources/test/TestConcurrentIOVsCondCore_cfg.py index c6aed33355cdc..cc42123051106 100644 --- a/CondCore/ESSources/test/TestConcurrentIOVsCondCore_cfg.py +++ b/CondCore/ESSources/test/TestConcurrentIOVsCondCore_cfg.py @@ -66,11 +66,14 @@ RefreshEachRun = cms.untracked.bool(False), RefreshOpenIOVs = cms.untracked.bool(False), connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'), - globaltag = cms.string('110X_dataRun2_v5'), + globaltag = cms.string(''), pfnPostfix = cms.untracked.string(''), pfnPrefix = cms.untracked.string(''), - snapshotTime = cms.string(''), - toGet = cms.VPSet() + snapshotTime = cms.string('2020-10-10 00:00:00.000'), + toGet = cms.VPSet(cms.VPSet(cms.PSet(record = cms.string("BeamSpotObjectsRcd"), + tag = cms.string("BeamSpotObjects_2017UL_LumiBased_v2") + )) + ) ) process.test = cms.EDAnalyzer("TestConcurrentIOVsCondCore") From 2750f94c88860595e6ada505dee86464d025b15f Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 15 Oct 2020 17:11:52 +0200 Subject: [PATCH 608/778] add option to switch between new and old DB format --- .../DTCalibration/python/dtVDriftSegmentWriter_cfg.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfg.py b/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfg.py index 76c90393dc0e2..96fae8fb9d063 100644 --- a/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfg.py +++ b/CalibMuon/DTCalibration/python/dtVDriftSegmentWriter_cfg.py @@ -16,6 +16,8 @@ process.load("CondCore.CondDB.CondDB_cfi") +process.load("CalibMuon.DTCalibration.dtVDriftSegmentWriter_cfi") + process.source = cms.Source("EmptySource", numberEventsInRun = cms.untracked.uint32(1), firstRun = cms.untracked.uint32(1) @@ -28,6 +30,10 @@ RECORD = 'DTMtimeRcd' if NEWDBFORMAT : RECORD = 'DTRecoConditionsVdriftRcd' + process.dtVDriftSegmentWriter.writeLegacyVDriftDB = False + # The following needs to be set as well if calibration should start use + # constants written in the new format as a starting point. + # process.dtVDriftSegmentWriter.vDriftAlgoConfig.readLegacyVDriftDB = False process.PoolDBOutputService = cms.Service("PoolDBOutputService", process.CondDB, @@ -39,6 +45,4 @@ ) process.PoolDBOutputService.connect = cms.string('sqlite_file:vDrift.db') -process.load("CalibMuon.DTCalibration.dtVDriftSegmentWriter_cfi") - process.p = cms.Path(process.dtVDriftSegmentWriter) From 2ad8a7b5af86fe235895985534fd76ba062b5c29 Mon Sep 17 00:00:00 2001 From: Michal Bluj <michal.bluj@cern.ch> Date: Thu, 15 Oct 2020 17:22:56 +0200 Subject: [PATCH 609/778] set of small improvement from code review --- .../RecoTau/interface/AntiElectronIDMVA6.h | 8 +- .../TauDiscriminationAgainstElectronMVA6.cc | 22 +++--- RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc | 74 +++++++++++-------- .../src/PositionAtECalEntranceComputer.cc | 5 +- 4 files changed, 63 insertions(+), 46 deletions(-) diff --git a/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h b/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h index 02efa7d7019af..e4d90d0a8a4a5 100644 --- a/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h +++ b/RecoTauTag/RecoTau/interface/AntiElectronIDMVA6.h @@ -152,6 +152,10 @@ class AntiElectronIDMVA6 { double dCrackEta(double eta); double minimum(double a, double b); double dCrackPhi(double phi, double eta); + bool energyWeightedEtaAndPhiAtECal( + const pat::Tau& theTau, + float& eta, + float& phi); // MB: needed only for pat::Tau and called within pat::Tau specific method so also pat::Tau specific static constexpr float ecalBarrelEndcapEtaBorder_ = 1.479; static constexpr float ecalEndcapVFEndcapEtaBorder_ = 2.4; @@ -203,13 +207,13 @@ class AntiElectronIDMVA6 { std::vector<TFile*> inputFilesToDelete_; + const bool isPhase2_; + PositionAtECalEntranceComputer positionAtECalEntrance_; std::map<std::string, edm::EDGetTokenT<edm::ValueMap<float>>> electronIds_tokens_; std::map<std::string, edm::Handle<edm::ValueMap<float>>> electronIds_; - const bool isPhase2_; - const int verbosity_; }; diff --git a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc index 200bd56dcd423..e323a5dbe0355 100644 --- a/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc +++ b/RecoTauTag/RecoTau/plugins/TauDiscriminationAgainstElectronMVA6.cc @@ -121,7 +121,8 @@ TauDiscriminationAgainstElectronMVA6<TauType, TauDiscriminator, ElectronType>::d hasGsfTrack = (std::abs(packedLeadChCand->pdgId()) == 11); } else { const reco::PFCandidate* pfLeadChCand = dynamic_cast<const reco::PFCandidate*>(leadChCand.get()); - hasGsfTrack = (pfLeadChCand != nullptr && pfLeadChCand->gsfTrackRef().isNonnull()); + //pfLeadChCand can not be a nullptr here as it would be imply taus not built either with PFCandidates or PackedCandidates + hasGsfTrack = pfLeadChCand->gsfTrackRef().isNonnull(); } } } @@ -307,21 +308,22 @@ TauDiscriminationAgainstElectronMVA6<TauType, TauDiscriminator, ElectronType>::g float leadChargedCandEtaAtECalEntrance = -99; float sumEtaTimesEnergy = 0.; float sumEnergy = 0.; + float leadChargedCandPt = -99; - bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(theTauRef->leadChargedHadrCand().get(), success); - if (success) { - leadChargedCandEtaAtECalEntrance = posAtECal.eta(); - } else { - leadChargedCandEtaAtECalEntrance = theTauRef->leadChargedHadrCand()->eta(); - } for (const auto& candidate : theTauRef->signalCands()) { float etaAtECalEntrance = candidate->eta(); - success = false; - posAtECal = positionAtECalEntrance_(candidate.get(), success); + bool success = false; + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); if (success) { etaAtECalEntrance = posAtECal.eta(); } + const reco::Track* track = candidate->bestTrack(); + if (track != nullptr) { + if (track->pt() > leadChargedCandPt) { + leadChargedCandEtaAtECalEntrance = etaAtECalEntrance; + leadChargedCandPt = track->pt(); + } + } sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy(); sumEnergy += candidate->energy(); } diff --git a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc index 674db0b0a4f4f..6275bc6296eaf 100644 --- a/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc +++ b/RecoTauTag/RecoTau/src/AntiElectronIDMVA6.cc @@ -48,8 +48,8 @@ AntiElectronIDMVA6<TauType, ElectronType>::AntiElectronIDMVA6(const edm::Paramet mva_NoEleMatch_wGwoGSF_VFEC_(nullptr), mva_woGwGSF_VFEC_(nullptr), mva_wGwGSF_VFEC_(nullptr), - positionAtECalEntrance_(PositionAtECalEntranceComputer(cc, cfg.getParameter<bool>("isPhase2"))), isPhase2_(cfg.getParameter<bool>("isPhase2")), + positionAtECalEntrance_(PositionAtECalEntranceComputer(cc, isPhase2_)), verbosity_(cfg.getParameter<int>("verbosity")) { loadMVAfromDB_ = cfg.exists("loadMVAfromDB") ? cfg.getParameter<bool>("loadMVAfromDB") : false; if (!loadMVAfromDB_) { @@ -199,9 +199,7 @@ void AntiElectronIDMVA6<TauType, ElectronType>::beginEvent(const edm::Event& evt //MB: Handle additional inputs (HGCal EleID variables) only for Phase2 and reco::GsfElectrons if (isPhase2_ && std::is_same<ElectronType, reco::GsfElectron>::value) { for (const auto& eId_token : electronIds_tokens_) { - edm::Handle<edm::ValueMap<float>> electronId; - evt.getByToken(eId_token.second, electronId); - electronIds_[eId_token.first] = electronId; + electronIds_[eId_token.first] = evt.getHandle(eId_token.second); } } } @@ -1102,20 +1100,11 @@ TauVars AntiElectronIDMVA6<TauType, ElectronType>::getTauVarsTypeSpecific(const if (!usePhiAtEcalEntranceExtrapolation_) { tauVars.phi = theTau.phiAtEcalEntrance(); } else { - float sumPhiTimesEnergy = 0.; - float sumEnergy = 0.; - for (const auto& candidate : theTau.signalCands()) { - float phiAtECalEntrance = candidate->phi(); - bool success = false; - reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); - if (success) { - phiAtECalEntrance = posAtECal.phi(); - } - sumPhiTimesEnergy += phiAtECalEntrance * candidate->energy(); - sumEnergy += candidate->energy(); - } - if (sumEnergy > 0.) { - tauVars.phi = sumPhiTimesEnergy / sumEnergy; + float etaAtECal = 0.; + float phiAtECal = 0.; + bool success = energyWeightedEtaAndPhiAtECal(theTau, etaAtECal, phiAtECal); + if (success) { + tauVars.phi = phiAtECal; } } tauVars.emFraction = std::max(theTau.emFraction_MVA(), 0.f); @@ -1128,20 +1117,11 @@ TauVars AntiElectronIDMVA6<TauType, ElectronType>::getTauVarsTypeSpecific(const if (success) { tauVars.leadChargedPFCandEtaAtEcalEntrance = posAtECal.eta(); } - float sumEtaTimesEnergy = 0.; - float sumEnergy = 0.; - for (const auto& candidate : theTau.signalCands()) { - float etaAtECalEntrance = candidate->eta(); - success = false; - posAtECal = positionAtECalEntrance_(candidate.get(), success); - if (success) { - etaAtECalEntrance = posAtECal.eta(); - } - sumEtaTimesEnergy += etaAtECalEntrance * candidate->energy(); - sumEnergy += candidate->energy(); - } - if (sumEnergy > 0.) { - tauVars.etaAtEcalEntrance = sumEtaTimesEnergy / sumEnergy; + float phiAtECal = 0.; + float etaAtECal = 0.; + success = energyWeightedEtaAndPhiAtECal(theTau, etaAtECal, phiAtECal); + if (success) { + tauVars.etaAtEcalEntrance = etaAtECal; } } tauVars.emFraction = std::max(theTau.ecalEnergyLeadChargedHadrCand() / @@ -1336,6 +1316,36 @@ void AntiElectronIDMVA6<TauType, ElectronType>::getElecVarsHGCalTypeSpecific( elecVars.hgcalDepthCompatibility = theEleRef->userFloat("hgcElectronID:depthCompatibility"); } +template <class TauType, class ElectronType> +bool AntiElectronIDMVA6<TauType, ElectronType>::energyWeightedEtaAndPhiAtECal(const pat::Tau& theTau, + float& eta, + float& phi) { + eta = 0.; + phi = 0.; + float sumEnergy = 0.; + for (const auto& candidate : theTau.signalCands()) { + float etaAtECalEntrance = candidate->eta(); + float phiAtECalEntrance = candidate->phi(); + bool success = false; + reco::Candidate::Point posAtECal = positionAtECalEntrance_(candidate.get(), success); + if (success) { + etaAtECalEntrance = posAtECal.eta(); + phiAtECalEntrance = posAtECal.phi(); + } + eta += etaAtECalEntrance * candidate->energy(); + phi += phiAtECalEntrance * candidate->energy(); + sumEnergy += candidate->energy(); + } + if (sumEnergy > 0.) { + eta = eta / sumEnergy; + phi = phi / sumEnergy; + } else { + eta = -99.; + phi = -99.; + } + return (sumEnergy > 0.); +} + // compile desired types and make available to linker template class AntiElectronIDMVA6<reco::PFTau, reco::GsfElectron>; template class AntiElectronIDMVA6<pat::Tau, pat::Electron>; diff --git a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc index ccd085ac9762e..befa26919f898 100644 --- a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc +++ b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc @@ -15,9 +15,10 @@ namespace hgcal_helpers { class SimpleTrackPropagator { public: - SimpleTrackPropagator(MagneticField const* f) : field_(f), prod_(field_, alongMomentum, 5.e-5), absz_target_(0) { + SimpleTrackPropagator(MagneticField const* f) : field_(f), prod_(field_, alongMomentum), absz_target_(0) { ROOT::Math::SMatrixIdentity id; AlgebraicSymMatrix55 C(id); + //MB: To define uncertainty of starting point of trajectory propagation scale identity matrix created above by 0.001 C *= 0.001; err_ = CurvilinearTrajectoryError(C); } @@ -33,7 +34,7 @@ namespace hgcal_helpers { reco::Candidate::Point& output) const; private: - SimpleTrackPropagator() : field_(nullptr), prod_(field_, alongMomentum, 5e-5), absz_target_(0) {} + SimpleTrackPropagator() : field_(nullptr), prod_(field_, alongMomentum), absz_target_(0) {} const RKPropagatorInS& RKProp() const { return prod_.propagator; } Plane::PlanePointer targetPlaneForward_, targetPlaneBackward_; MagneticField const* field_; From 5444d9da6b1d5eb13229a605cc7e4921b5d5492b Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 14 Oct 2020 16:24:22 -0500 Subject: [PATCH 610/778] Made logging level object constexpr --- .../MessageLogger/interface/ELseverityLevel.h | 108 +++++------------- .../interface/ELseverityLevel.icc | 85 -------------- FWCore/MessageLogger/src/ELseverityLevel.cc | 71 ------------ 3 files changed, 30 insertions(+), 234 deletions(-) delete mode 100644 FWCore/MessageLogger/interface/ELseverityLevel.icc diff --git a/FWCore/MessageLogger/interface/ELseverityLevel.h b/FWCore/MessageLogger/interface/ELseverityLevel.h index 672b9d82e7a43..d62775a209fb1 100644 --- a/FWCore/MessageLogger/interface/ELseverityLevel.h +++ b/FWCore/MessageLogger/interface/ELseverityLevel.h @@ -42,50 +42,6 @@ namespace edm { - // ---------------------------------------------------------------------- - // Forward declaration: - // ---------------------------------------------------------------------- - - class ELseverityLevel; - - // ---------------------------------------------------------------------- - // Synonym for type of ELseverityLevel-generating function: - // ---------------------------------------------------------------------- - - typedef ELseverityLevel const ELslGen(); - - // ---------------------------------------------------------------------- - // ELslProxy class template: - // ---------------------------------------------------------------------- - - template <ELslGen ELgen> - struct ELslProxy { - // --- birth/death: - // - ELslProxy(); - ~ELslProxy(); - - // --- copying: - // - ELslProxy(ELslProxy const&); - ELslProxy const& operator=(ELslProxy const&); - - // --- conversion:: - // - operator ELseverityLevel const() const; - - // --- forwarding: - // - int getLevel() const; - const std::string& getSymbol() const; - const std::string& getName() const; - const std::string& getInputStr() const; - const std::string& getVarName() const; - - }; // ELslProxy<ELslGen> - - // ---------------------------------------------------------------------- - // ---------------------------------------------------------------------- // ELseverityLevel: // ---------------------------------------------------------------------- @@ -120,19 +76,19 @@ namespace edm { // ----- Birth/death: // - ELseverityLevel(ELsev_ lev = ELsev_unspecified); + constexpr ELseverityLevel(ELsev_ lev = ELsev_unspecified) noexcept : myLevel(lev) {} ELseverityLevel(std::string_view str); // str may match getSymbol, getName, getInputStr, // or getVarName -- see accessors - ~ELseverityLevel(); + ~ELseverityLevel() noexcept = default; // ----- Comparator: // - int cmp(ELseverityLevel const& e) const; + [[nodiscard]] constexpr int cmp(ELseverityLevel const& e) const noexcept { return myLevel - e.myLevel; } // ----- Accessors: // - int getLevel() const; + constexpr int getLevel() const noexcept { return myLevel; } const std::string& getSymbol() const; // example: "-e" const std::string& getName() const; // example: "Error" const std::string& getInputStr() const; // example: "ERROR" @@ -154,51 +110,47 @@ namespace edm { // one generator function and one proxy per non-default ELsev_: // ---------------------------------------------------------------------- - extern ELslGen ELzeroSeverityGen; - extern ELslProxy<ELzeroSeverityGen> const ELzeroSeverity; + constexpr const ELseverityLevel ELzeroSeverity{ELseverityLevel::ELsev_zeroSeverity}; - extern ELslGen ELdebugGen; - extern ELslProxy<ELdebugGen> const ELdebug; + constexpr const ELseverityLevel ELdebug{ELseverityLevel::ELsev_success}; - extern ELslGen ELinfoGen; - extern ELslProxy<ELinfoGen> const ELinfo; + constexpr const ELseverityLevel ELinfo{ELseverityLevel::ELsev_info}; - extern ELslGen ELwarningGen; - extern ELslProxy<ELwarningGen> const ELwarning; + constexpr const ELseverityLevel ELwarning{ELseverityLevel::ELsev_warning}; - extern ELslGen ELerrorGen; - extern ELslProxy<ELerrorGen> const ELerror; + constexpr const ELseverityLevel ELerror{ELseverityLevel::ELsev_error}; - extern ELslGen ELunspecifiedGen; - extern ELslProxy<ELunspecifiedGen> const ELunspecified; + constexpr const ELseverityLevel ELunspecified{ELseverityLevel::ELsev_unspecified}; - extern ELslGen ELsevereGen; - extern ELslProxy<ELsevereGen> const ELsevere; + constexpr const ELseverityLevel ELsevere{ELseverityLevel::ELsev_severe}; - extern ELslGen ELhighestSeverityGen; - extern ELslProxy<ELhighestSeverityGen> const ELhighestSeverity; + constexpr const ELseverityLevel ELhighestSeverity{ELseverityLevel::ELsev_highestSeverity}; // ---------------------------------------------------------------------- // Comparators: // ---------------------------------------------------------------------- - extern bool operator==(ELseverityLevel const& e1, ELseverityLevel const& e2); - extern bool operator!=(ELseverityLevel const& e1, ELseverityLevel const& e2); - extern bool operator<(ELseverityLevel const& e1, ELseverityLevel const& e2); - extern bool operator<=(ELseverityLevel const& e1, ELseverityLevel const& e2); - extern bool operator>(ELseverityLevel const& e1, ELseverityLevel const& e2); - extern bool operator>=(ELseverityLevel const& e1, ELseverityLevel const& e2); + constexpr inline bool operator==(ELseverityLevel const& e1, ELseverityLevel const& e2) noexcept { + return e1.cmp(e2) == 0; + } + constexpr inline bool operator!=(ELseverityLevel const& e1, ELseverityLevel const& e2) noexcept { + return e1.cmp(e2) != 0; + } + constexpr inline bool operator<(ELseverityLevel const& e1, ELseverityLevel const& e2) noexcept { + return e1.cmp(e2) < 0; + } + constexpr inline bool operator<=(ELseverityLevel const& e1, ELseverityLevel const& e2) noexcept { + return e1.cmp(e2) <= 0; + } + constexpr inline bool operator>(ELseverityLevel const& e1, ELseverityLevel const& e2) noexcept { + return e1.cmp(e2) > 0; + } + constexpr inline bool operator>=(ELseverityLevel const& e1, ELseverityLevel const& e2) noexcept { + return e1.cmp(e2) >= 0; + } // ---------------------------------------------------------------------- } // end of namespace edm -// ---------------------------------------------------------------------- - -#define ELSEVERITYLEVEL_ICC -#include "FWCore/MessageLogger/interface/ELseverityLevel.icc" -#undef ELSEVERITYLEVEL_ICC - -// ---------------------------------------------------------------------- - #endif // MessageLogger_ELseverityLevel_h diff --git a/FWCore/MessageLogger/interface/ELseverityLevel.icc b/FWCore/MessageLogger/interface/ELseverityLevel.icc deleted file mode 100644 index 2f8524d2f9023..0000000000000 --- a/FWCore/MessageLogger/interface/ELseverityLevel.icc +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef ELSEVERITYLEVEL_ICC -#error ELseverityLevel.icc erroneously included by file other than ELseverityLevel.h -#endif - -// ---------------------------------------------------------------------- -// -// ELseverityLevel.icc -// -// ---------------------------------------------------------------------- - -namespace edm { - - // ---------------------------------------------------------------------- - // ELslProxy<> template class methods: - // ---------------------------------------------------------------------- - - template <ELslGen ELgen> - inline ELslProxy<ELgen>::ELslProxy() { - ; - } - - template <ELslGen ELgen> - inline ELslProxy<ELgen>::~ELslProxy() { - ; - } - - template <ELslGen ELgen> - inline ELslProxy<ELgen>::ELslProxy(ELslProxy const&) { - ; - } - - template <ELslGen ELgen> - inline ELslProxy<ELgen> const& ELslProxy<ELgen>::operator=(ELslProxy const&) { - return *this; - } - - template <ELslGen ELgen> - inline ELslProxy<ELgen>::operator ELseverityLevel const() const { - return ELgen(); - } - - template <ELslGen ELgen> - inline int ELslProxy<ELgen>::getLevel() const { - return ELgen().getLevel(); - } - - template <ELslGen ELgen> - inline const std::string& ELslProxy<ELgen>::getSymbol() const { - return ELgen().getSymbol(); - } - - template <ELslGen ELgen> - inline const std::string& ELslProxy<ELgen>::getName() const { - return ELgen().getName(); - } - - template <ELslGen ELgen> - inline const std::string& ELslProxy<ELgen>::getInputStr() const { - return ELgen().getInputStr(); - } - - template <ELslGen ELgen> - inline const std::string& ELslProxy<ELgen>::getVarName() const { - return ELgen().getVarName(); - } - - // ---------------------------------------------------------------------- - // Comparators: - // ---------------------------------------------------------------------- - - inline bool operator==(ELseverityLevel const& e1, ELseverityLevel const& e2) { return e1.cmp(e2) == 0; } - - inline bool operator!=(ELseverityLevel const& e1, ELseverityLevel const& e2) { return e1.cmp(e2) != 0; } - - inline bool operator<(ELseverityLevel const& e1, ELseverityLevel const& e2) { return e1.cmp(e2) < 0; } - - inline bool operator<=(ELseverityLevel const& e1, ELseverityLevel const& e2) { return e1.cmp(e2) <= 0; } - - inline bool operator>(ELseverityLevel const& e1, ELseverityLevel const& e2) { return e1.cmp(e2) > 0; } - - inline bool operator>=(ELseverityLevel const& e1, ELseverityLevel const& e2) { return e1.cmp(e2) >= 0; } - - // ---------------------------------------------------------------------- - -} // end of namespace edm diff --git a/FWCore/MessageLogger/src/ELseverityLevel.cc b/FWCore/MessageLogger/src/ELseverityLevel.cc index 0680c5558f6a0..ad6f67d7b24c5 100644 --- a/FWCore/MessageLogger/src/ELseverityLevel.cc +++ b/FWCore/MessageLogger/src/ELseverityLevel.cc @@ -97,12 +97,6 @@ namespace edm { // Birth/death: // ---------------------------------------------------------------------- - ELseverityLevel::ELseverityLevel(enum ELsev_ lev) : myLevel(lev) { -#ifdef ELsevConTRACE - std::cerr << "--- ELseverityLevel " << lev << " (" << getName() << ")\n" << std::flush; -#endif - } - ELseverityLevel::ELseverityLevel(std::string_view s) { static ELmap const& m = loadMap(); @@ -110,20 +104,10 @@ namespace edm { myLevel = (i == m.end()) ? ELsev_unspecified : i->second; } - ELseverityLevel::~ELseverityLevel() { ; } - - // ---------------------------------------------------------------------- - // Comparator: - // ---------------------------------------------------------------------- - - int ELseverityLevel::cmp(ELseverityLevel const& e) const { return myLevel - e.myLevel; } - // ---------------------------------------------------------------------- // Accessors: // ---------------------------------------------------------------------- - int ELseverityLevel::getLevel() const { return myLevel; } - const std::string& ELseverityLevel::getSymbol() const { static const auto symbols = []() { std::array<std::string, nLevels> ret; @@ -206,59 +190,4 @@ namespace edm { std::ostream& operator<<(std::ostream& os, const ELseverityLevel& sev) { return os << " -" << sev.getName() << "- "; } - // ---------------------------------------------------------------------- - // Declare the globally available severity objects, - // one generator function and one proxy per non-default ELsev_: - // ---------------------------------------------------------------------- - - ELseverityLevel const ELzeroSeverityGen() { - static ELseverityLevel const e(ELseverityLevel::ELsev_zeroSeverity); - return e; - } - ELslProxy<ELzeroSeverityGen> const ELzeroSeverity; - - ELseverityLevel const ELdebugGen() { - static ELseverityLevel const e(ELseverityLevel::ELsev_success); - return e; - } - ELslProxy<ELdebugGen> const ELdebug; - - ELseverityLevel const ELinfoGen() { - static ELseverityLevel const e(ELseverityLevel::ELsev_info); - return e; - } - ELslProxy<ELinfoGen> const ELinfo; - - ELseverityLevel const ELwarningGen() { - static ELseverityLevel const e(ELseverityLevel::ELsev_warning); - return e; - } - ELslProxy<ELwarningGen> const ELwarning; - - ELseverityLevel const ELerrorGen() { - static ELseverityLevel const e(ELseverityLevel::ELsev_error); - return e; - } - ELslProxy<ELerrorGen> const ELerror; - - ELseverityLevel const ELunspecifiedGen() { - static ELseverityLevel const e(ELseverityLevel::ELsev_unspecified); - return e; - } - ELslProxy<ELunspecifiedGen> const ELunspecified; - - ELseverityLevel const ELsevereGen() { - static ELseverityLevel const e(ELseverityLevel::ELsev_severe); - return e; - } - ELslProxy<ELsevereGen> const ELsevere; - - ELseverityLevel const ELhighestSeverityGen() { - static ELseverityLevel const e(ELseverityLevel::ELsev_highestSeverity); - return e; - } - ELslProxy<ELhighestSeverityGen> const ELhighestSeverity; - - // ---------------------------------------------------------------------- - } // end of namespace edm */ From cbcab331866b04bd85a0fc58f510595fca98a3b0 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Thu, 15 Oct 2020 11:04:42 -0500 Subject: [PATCH 611/778] Consolidate all Log* classes into one implementation --- .../MessageLogger/interface/MessageLogger.h | 733 +++--------------- .../MessageLogger/interface/MessageSender.h | 17 +- FWCore/MessageLogger/src/MessageLogger.cc | 88 +-- 3 files changed, 107 insertions(+), 731 deletions(-) diff --git a/FWCore/MessageLogger/interface/MessageLogger.h b/FWCore/MessageLogger/interface/MessageLogger.h index fba76ea7568a1..629a8d0516df5 100644 --- a/FWCore/MessageLogger/interface/MessageLogger.h +++ b/FWCore/MessageLogger/interface/MessageLogger.h @@ -17,111 +17,6 @@ // See MessageService/interface/MessageLogger.h // // ================================================= -// Change log -// -// 1 mf 5/11/06 Added a space before the file/line string in LogDebug_ -// to avoid the run-together with the run and event number -// -// 2 mf 6/6/06 Added LogVerbatim and LogTrace -// -// 3 mf 10/30/06 Added LogSystem and LogPrint -// -// 4 mf 6/1/07 Added LogAbsolute and LogProblem -// -// 5 mf 7/24/07 Added HaltMessageLogging -// -// 6 mf 8/7/07 Added FlushMessageLog -// -// 7 mf 8/7/07 Added GroupLogStatistics(category) -// -// 8 mf 12/12/07 Reworked LogDebug macro, LogDebug_class,, and similarly -// for LogTrace, to avoid the need for the static dummy -// objects. This cures the use-of-thread-commands-after- -// exit problem in programs that link but do not use the -// MessageLogger. -// -// 9 mf 12/12/07 Check for subtly terrible situation of copying and then -// writing to a LogDebug_ object. Also forbid copying any -// of the ordinary LogXXX objects (since that implies either -// copying a MessageSender, or having a stale copy available -// to lose message contents). -// -// 10 mf 12/14/07 Moved the static free function onlyLowestDirectory -// to a class member function of LogDebug_, changing -// name to a more descriptive stripLeadingDirectoryTree. -// Cures the 2600-copies-of-this-function complaint. -// -// 11 mf 6/24/08 Added LogImportant which is LogProblem. For output -// which "obviously" ought to emerge, but allowing specific -// suppression as if it were at the LogError level, rather -// than the non-suppressible LogAbsolute. -// -// 12 ge 9/12/08 MessageLogger now works even when compiled with -DNDEBUG. -// The problem was that Suppress_LogDebug_ was missing the operator<< -// needed for streaming `std::iomanip`s. -// -// 13 wmtan 11/18/08 Use explicit non-inlined destructors -// -// 14 mf 3/23/09 ap.valid() used whenever possible suppression, to avoid -// null pointer usage -// -// 15 mf 8/11/09 provision for control of standalone threshold and ignores -// -// 16 mf 10/2/09 Correct mission in logVerbatim and others of check for -// whether this severity is enabled -// -// 17 wmtan 10/29/09 Out of line LogDebug_ and LogTrace_ constructors. -// -// 18 wmtan 07/08/10 Remove unnecessary includes -// -// 19 mf 09/21/10 !!! BEHAVIOR CHANGE: LogDebug suppression. -// The sole preprocessor symbol controlling suppression of -// LogDebug is EDM_ML_DEBUG. If EDM_ML_DEBUG is not defined -// then LogDebug is suppressed. Thus by default LogDebug is -// suppressed. -// -// 20 mf 09/21/10 The mechanism of LogDebug is modified such that if LogDebug -// is suppressed, whether via lack of the EDM_ML_DEBUG symbol -// or dynabically via !debgEnabled, all code past the -// LogDebug(...), including operator<< and functions to -// prepare the output strings, is squelched. This was the -// original intended behavior. -// -// ************ Note that in this regard, LogDebug behaves like assert: -// The use of functions having side effects, on a LogDebug -// statement (just as within an assert()), is unwise as it -// makes turning on the debugging aid alter the program -// behavior. -// -// 21 mf 9/23/10 Support for situations where no thresholds are low -// enough to react to LogDebug (or info, or warning). -// A key observation is that while debugEnabled -// should in principle be obtained via an instance() of -// MessageDrop, debugAlwaysSuppressed is universal across -// threads and hence is properly just a class static, which -// is much quicker to check. -// -// 22 mf 9/27/10 edmmltest::LogWarningThatSuppressesLikeLogInfo, -// a class provided solely to allow testing of the feature -// that if all destinations have threshold too high, then -// a level of messages (in this case, INFO) will be suppressed -// without even being seen by the destinations. -// -// 23 mf 11/30/10 SnapshotMessageLog() method to force MessageDrop to -// capture any pointed-to strings in anticipation of key -// objects going away before a message is going to be issued. -// -// 24 fwyzard 7/6/11 Add support for discarding LogError-level messages -// on a per-module basis (needed at HLT) -// -// 25 wmtan 7/17/11 Allocate MessageSender on stack rather than heap -// -// 26 wmtan 7/22/11 Fix clang compilation errors for LogDebug and LogTrace -// by making MessageSender copyable, and holding -// the ErrorObj in a shared pointer with a custom deleter. -// -// 27 mkortela 2/27/17 Add IfLogTrace and IfLogDebug -// ================================================= // system include files @@ -134,580 +29,142 @@ #include "FWCore/MessageLogger/interface/MessageSender.h" #include "FWCore/MessageLogger/interface/MessageDrop.h" -#include "FWCore/Utilities/interface/EDMException.h" // Change log 8 +#include "FWCore/Utilities/interface/EDMException.h" namespace edm { - class LogWarning { - public: - explicit LogWarning(std::string_view id) - : ap(ELwarning, - id, - false, - (MessageDrop::warningAlwaysSuppressed || !MessageDrop::instance()->warningEnabled)) // Change log 21 - {} - LogWarning(LogWarning const&) = delete; // Change log 9 - LogWarning& operator=(LogWarning const&) = delete; - ~LogWarning(); // Change log 13 - - template <class T> - LogWarning& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; - } - LogWarning& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogWarning& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - - template <typename... Args> - LogWarning& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogWarning& log(F&& iF) { - if (ap.valid()) { - iF(ap); - } - return *this; - } - - private: - MessageSender ap; - - }; // LogWarning - - class LogError { - public: - explicit LogError(std::string_view id) - : ap(ELerror, id, false, !MessageDrop::instance()->errorEnabled) // Change log 24 - {} - LogError(LogError const&) = delete; // Change log 9 - LogError& operator=(LogError const&) = delete; - ~LogError(); // Change log 13 - - template <class T> - LogError& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; - } - LogError& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogError& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - - template <typename... Args> - LogError& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogError& log(F&& iF) { - if (ap.valid()) { - iF(ap); - } - return *this; - } - - private: - MessageSender ap; - - }; // LogError - - class LogSystem { - public: - explicit LogSystem(std::string_view id) : ap(ELsevere, id) {} - LogSystem(LogSystem const&) = delete; // Change log 9 - LogSystem& operator=(LogSystem const&) = delete; - ~LogSystem(); // Change log 13 - - template <class T> - LogSystem& operator<<(T const& t) { - ap << t; - return *this; - } - LogSystem& operator<<(std::ostream& (*f)(std::ostream&)) { - ap << f; - return *this; - } - LogSystem& operator<<(std::ios_base& (*f)(std::ios_base&)) { - ap << f; - return *this; - } - - template <typename... Args> - LogSystem& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogSystem& log(F&& iF) { - iF(ap); - return *this; - } - - private: - MessageSender ap; - - }; // LogSystem - - class LogInfo { - public: - explicit LogInfo(std::string_view id) - : ap(ELinfo, - id, - false, - (MessageDrop::infoAlwaysSuppressed || !MessageDrop::instance()->infoEnabled)) // Change log 21 - {} - LogInfo(LogInfo const&) = delete; // Change log 9 - LogInfo& operator=(LogInfo const&) = delete; - - ~LogInfo(); // Change log 13 - - template <class T> - LogInfo& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; - } - LogInfo& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogInfo& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - - template <typename... Args> - LogInfo& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogInfo& log(F&& iF) { - if (ap.valid()) { - iF(ap); + namespace level { + struct System { + static constexpr const ELseverityLevel level = ELsevere; + constexpr static bool suppress() noexcept { return false; } + }; + struct Error { + static constexpr const ELseverityLevel level = ELerror; + static bool suppress() noexcept { return !MessageDrop::instance()->errorEnabled; } + }; + struct Warning { + static constexpr const ELseverityLevel level = ELwarning; + static bool suppress() noexcept { + return (MessageDrop::warningAlwaysSuppressed || !MessageDrop::instance()->warningEnabled); } - return *this; - } - - private: - MessageSender ap; - - }; // LogInfo - - // verbatim version of LogInfo - class LogVerbatim // change log 2 - { - public: - explicit LogVerbatim(std::string_view id) - : ap(ELinfo, - id, - true, - (MessageDrop::infoAlwaysSuppressed || !MessageDrop::instance()->infoEnabled)) // Change log 21 - {} - LogVerbatim(LogVerbatim const&) = delete; // Change log 9 - LogVerbatim& operator=(LogVerbatim const&) = delete; - ~LogVerbatim(); // Change log 13 - - template <class T> - LogVerbatim& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; - } - // Change log 14 - LogVerbatim& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogVerbatim& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - - template <typename... Args> - LogVerbatim& format(std::string_view fmt, Args&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogVerbatim& log(F&& iF) { - if (ap.valid()) { - iF(ap); + }; + struct Info { + static constexpr const ELseverityLevel level = ELinfo; + static bool suppress() noexcept { + return (MessageDrop::infoAlwaysSuppressed || !MessageDrop::instance()->infoEnabled); } - return *this; - } - - private: - MessageSender ap; - - }; // LogVerbatim - - // verbatim version of LogWarning - class LogPrint // change log 3 - { + }; + struct Debug { + static constexpr const ELseverityLevel level = ELdebug; + constexpr static bool suppress() noexcept { return false; } + }; + } // namespace level + + template <typename LVL, bool VERBATIM> + class Log { public: - explicit LogPrint(std::string_view id) - : ap(ELwarning, - id, - true, - (MessageDrop::warningAlwaysSuppressed || !MessageDrop::instance()->warningEnabled)) // Change log 21 - {} - LogPrint(LogPrint const&) = delete; // Change log 9 - LogPrint& operator=(LogPrint const&) = delete; - ~LogPrint(); // Change log 13 + using ThisLog = Log<LVL, VERBATIM>; + explicit Log(std::string_view id) : ap(LVL::level, id, VERBATIM, LVL::suppress()) {} + Log(ThisLog&&) = default; + Log(ThisLog const&) = delete; + Log& operator=(ThisLog const&) = delete; + ~Log() = default; template <class T> - LogPrint& operator<<(T const& t) { + ThisLog& operator<<(T const& t) { if (ap.valid()) ap << t; return *this; } - // Change log 14 - LogPrint& operator<<(std::ostream& (*f)(std::ostream&)) { + ThisLog& operator<<(std::ostream& (*f)(std::ostream&)) { if (ap.valid()) ap << f; return *this; } - LogPrint& operator<<(std::ios_base& (*f)(std::ios_base&)) { + ThisLog& operator<<(std::ios_base& (*f)(std::ios_base&)) { if (ap.valid()) ap << f; return *this; } template <typename... Args> - LogPrint& format(std::string_view fmt, Args const&... args) { + ThisLog& format(std::string_view fmt, Args const&... args) { if (ap.valid()) ap.format(fmt, args...); return *this; } template <typename F> - LogPrint& log(F&& iF) { + ThisLog& log(F&& iF) { if (ap.valid()) { iF(ap); } return *this; } - private: - MessageSender ap; - - }; // LogPrint - - // verbatim version of LogError - class LogProblem // change log 4 - { - public: - explicit LogProblem(std::string_view id) - : ap(ELerror, id, true, !MessageDrop::instance()->errorEnabled) // Change log 24 - {} - LogProblem(LogProblem const&) = delete; // Change log 9 - LogProblem& operator=(LogProblem const&) = delete; - ~LogProblem(); // Change log 13 - - template <class T> - LogProblem& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; - } - LogProblem& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogProblem& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - - template <typename... Args> - LogProblem& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogProblem& log(F&& iF) { - if (ap.valid()) { - iF(ap); - } - return *this; - } + protected: + Log() = default; + //Want standard copy ctr to be deleted to make compiler errors + // clearer. This does the same thing but with different signature + //Needed for LogDebug and LogTrace macros + Log(std::nullptr_t, ThisLog const& iOther) : ap(iOther.ap) {} private: MessageSender ap; - - }; // LogProblem - + }; + using LogWarning = Log<level::Warning, false>; + using LogError = Log<level::Error, false>; + using LogSystem = Log<level::System, false>; + using LogInfo = Log<level::Info, false>; + + using LogVerbatim = Log<level::Info, true>; + using LogPrint = Log<level::Warning, true>; + using LogProblem = Log<level::Error, true>; // less judgemental verbatim version of LogError - class LogImportant // change log 11 - { - public: - explicit LogImportant(std::string_view id) - : ap(ELerror, id, true, !MessageDrop::instance()->errorEnabled) // Change log 24 - {} - LogImportant(LogImportant const&) = delete; // Change log 9 - LogImportant& operator=(LogImportant const&) = delete; - ~LogImportant(); // Change log 13 - - template <class T> - LogImportant& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; - } - LogImportant& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogImportant& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - - template <typename... Args> - LogImportant& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogImportant& log(F&& iF) { - if (ap.valid()) { - iF(ap); - } - return *this; - } - - private: - MessageSender ap; - - }; // LogImportant - - // verbatim version of LogSystem - class LogAbsolute // change log 4 - { - public: - explicit LogAbsolute(std::string_view id) - : ap(ELsevere, id, true) // true for verbatim - {} - LogAbsolute(LogAbsolute const&) = delete; // Change log 9 - LogAbsolute& operator=(LogAbsolute const&) = delete; - ~LogAbsolute(); // Change log 13 - - template <class T> - LogAbsolute& operator<<(T const& t) { - ap << t; - return *this; - } - LogAbsolute& operator<<(std::ostream& (*f)(std::ostream&)) { - ap << f; - return *this; - } - LogAbsolute& operator<<(std::ios_base& (*f)(std::ios_base&)) { - ap << f; - return *this; - } - - template <typename... Args> - LogAbsolute& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogAbsolute& log(F&& iF) { - iF(ap); - return *this; - } - - private: - MessageSender ap; - - }; // LogAbsolute - - // change log 10: removed onlyLowestDirectory() + using LogImportant = Log<level::Error, true>; + using LogAbsolute = Log<level::System, true>; void LogStatistics(); - class LogDebug_ { + class LogDebug_ : public Log<level::Debug, false> { public: - LogDebug_() : ap() {} - explicit LogDebug_(std::string_view id, std::string_view file, int line); // Change log 17 - ~LogDebug_(); - - template <class T> - LogDebug_& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; - } - LogDebug_& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogDebug_& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - // Change log 8: The tests for ap.valid() being null - - template <typename... Args> - LogDebug_& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogDebug_& log(F&& iF) { - if (ap.valid()) { - iF(ap); - } - return *this; - } + LogDebug_() = default; + explicit LogDebug_(std::string_view id, std::string_view file, int line); + //Needed for the LogDebug macro + LogDebug_(Log<level::Debug, false> const& iOther) : Log<level::Debug, false>(nullptr, iOther) {} private: - MessageSender ap; std::string_view stripLeadingDirectoryTree(std::string_view file) const; - // change log 10 }; // LogDebug_ - class LogTrace_ { + class LogTrace_ : public Log<level::Debug, true> { public: - LogTrace_() : ap() {} - explicit LogTrace_(std::string_view id); // Change log 13 - ~LogTrace_(); - - template <class T> - LogTrace_& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; - } - LogTrace_& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogTrace_& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - // Change log 8: The tests for ap.valid() being null - - template <typename... Args> - LogTrace_& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } + LogTrace_() = default; + explicit LogTrace_(std::string_view id) : Log<level::Debug, true>(id) {} + //Needed for the LogTrace macro + LogTrace_(Log<level::Debug, true> const& iOther) : Log<level::Debug, true>(nullptr, iOther) {} + }; + + namespace impl { + //Needed for LogDebug and LogTrace macros in order to get the + // type on both sides of the ?: to be the same + struct LogDebugAdapter { + //Need an operator with lower precendence than operator<< + LogDebug_ operator|(Log<level::Debug, false>& iOther) { return LogDebug_(iOther); } + LogTrace_ operator|(Log<level::Debug, true>& iOther) { return LogTrace_(iOther); } + }; + } // namespace impl - template <typename F> - LogTrace_& log(F&& iF) { - if (ap.valid()) { - iF(ap); - } - return *this; - } - - private: - MessageSender ap; - - }; // LogTrace_ - - // Change log 22 namespace edmmltest { - class LogWarningThatSuppressesLikeLogInfo { - public: - explicit LogWarningThatSuppressesLikeLogInfo(std::string_view id) - : ap(ELwarning, - id, - false, - (MessageDrop::infoAlwaysSuppressed || !MessageDrop::instance()->warningEnabled)) // Change log 22 - {} - LogWarningThatSuppressesLikeLogInfo(LogWarningThatSuppressesLikeLogInfo const&) = delete; // Change log 9 - LogWarningThatSuppressesLikeLogInfo& operator=(LogWarningThatSuppressesLikeLogInfo const&) = delete; - ~LogWarningThatSuppressesLikeLogInfo(); - template <class T> - LogWarningThatSuppressesLikeLogInfo& operator<<(T const& t) { - if (ap.valid()) - ap << t; - return *this; + struct WarningThatSuppressesLikeLogInfo { + static constexpr const ELseverityLevel level = ELwarning; + static bool suppress() noexcept { + return (MessageDrop::infoAlwaysSuppressed || !MessageDrop::instance()->warningEnabled); } - LogWarningThatSuppressesLikeLogInfo& operator<<(std::ostream& (*f)(std::ostream&)) { - if (ap.valid()) - ap << f; - return *this; - } - LogWarningThatSuppressesLikeLogInfo& operator<<(std::ios_base& (*f)(std::ios_base&)) { - if (ap.valid()) - ap << f; - return *this; - } - - template <typename... Args> - LogWarningThatSuppressesLikeLogInfo& format(std::string_view fmt, Args const&... args) { - if (ap.valid()) - ap.format(fmt, args...); - return *this; - } - - template <typename F> - LogWarningThatSuppressesLikeLogInfo& log(F&& iF) { - if (ap.valid()) { - iF(ap); - } - return *this; - } - - private: - MessageSender ap; + }; - }; // LogWarningThatSuppressesLikeLogInfo - } // end namespace edmmltest + using LogWarningThatSuppressesLikeLogInfo = Log<WarningThatSuppressesLikeLogInfo, false>; + } // end namespace edmmltest class Suppress_LogDebug_ { // With any decent optimization, use of Suppress_LogDebug_ (...) @@ -717,9 +174,9 @@ namespace edm { template <class T> Suppress_LogDebug_& operator<<(T const&) { return *this; - } // Change log 12 - Suppress_LogDebug_& operator<<(std::ostream& (*)(std::ostream&)) { return *this; } // Change log 12 - Suppress_LogDebug_& operator<<(std::ios_base& (*)(std::ios_base&)) { return *this; } // Change log 12 + } + Suppress_LogDebug_& operator<<(std::ostream& (*)(std::ostream&)) { return *this; } + Suppress_LogDebug_& operator<<(std::ios_base& (*)(std::ios_base&)) { return *this; } template <typename... Args> Suppress_LogDebug_& format(std::string_view fmt, Args const&... args) { @@ -741,7 +198,6 @@ namespace edm { void GroupLogStatistics(std::string_view category); bool isMessageProcessingSetUp(); - // Change Log 15 // The following two methods have no effect except in stand-alone apps // that do not create a MessageServicePresence: void setStandAloneMessageThreshold(edm::ELseverityLevel const& severity); @@ -749,8 +205,7 @@ namespace edm { } // namespace edm -// change log 19 and change log 20 -// The preprocessor symbol controlling suppression of LogDebug is EDM_ML_DEBUG. Thus by default (BEHAVIOR CHANGE) LogDebug is +// The preprocessor symbol controlling suppression of LogDebug is EDM_ML_DEBUG. Thus by default LogDebug is // If LogDebug is suppressed, all code past the LogDebug(...) is squelched. // See doc/suppression.txt. @@ -758,18 +213,16 @@ namespace edm { #define LogDebug(id) true ? edm::Suppress_LogDebug_() : edm::Suppress_LogDebug_() #define LogTrace(id) true ? edm::Suppress_LogDebug_() : edm::Suppress_LogDebug_() #else -// change log 21 #define LogDebug(id) \ (edm::MessageDrop::debugAlwaysSuppressed || !edm::MessageDrop::instance()->debugEnabled) \ ? edm::LogDebug_() \ - : edm::LogDebug_(id, __FILE__, __LINE__) -#define LogTrace(id) \ - (edm::MessageDrop::debugAlwaysSuppressed || !edm::MessageDrop::instance()->debugEnabled) ? edm::LogTrace_() \ - : edm::LogTrace_(id) + : edm::impl::LogDebugAdapter() | edm::LogDebug_(id, __FILE__, __LINE__) +#define LogTrace(id) \ + (edm::MessageDrop::debugAlwaysSuppressed || !edm::MessageDrop::instance()->debugEnabled) \ + ? edm::LogTrace_() \ + : edm::impl::LogDebugAdapter() | edm::LogTrace_(id) #endif -// change log 27 -// // These macros reduce the need to pollute the code with #ifdefs. The // idea is that the condition is checked only if debugging is enabled. // That way the condition expression may use variables that are diff --git a/FWCore/MessageLogger/interface/MessageSender.h b/FWCore/MessageLogger/interface/MessageSender.h index 35aaaa823d7da..5e4e73b5d4b2a 100644 --- a/FWCore/MessageLogger/interface/MessageSender.h +++ b/FWCore/MessageLogger/interface/MessageSender.h @@ -8,17 +8,6 @@ #include <map> -// Change log -// -// 1 mf 8/25/08 error summary information for LoggedErrorsSummary() -// -// 2 mf 6/22/09 add severity to LoggedErrorsSummary by using -// ErrorSummaryEntry as map key -// -// 3 wmtan 6/22/11 Hold the ErrorObj with a shared pointer with a custom deleter. -// The custom deleter takes over the function of the message sending from the MessageSender destructor. -// This allows MessageSender to be copyable, which fixes the clang compilation errors. - namespace edm { class MessageSender { @@ -29,8 +18,10 @@ namespace edm { public: // --- birth/death: - MessageSender() : errorobj_p() {} + MessageSender() = default; MessageSender(ELseverityLevel const& sev, std::string_view id, bool verbatim = false, bool suppressed = false); + MessageSender(MessageSender&&) = default; + MessageSender(MessageSender const&) = default; ~MessageSender(); // --- stream out the next part of a message: @@ -48,7 +39,7 @@ namespace edm { return *this; } - bool valid() { return errorobj_p != nullptr; } + bool valid() const noexcept { return errorobj_p != nullptr; } private: // data: diff --git a/FWCore/MessageLogger/src/MessageLogger.cc b/FWCore/MessageLogger/src/MessageLogger.cc index 8bbd98bc62933..95d8c799c419e 100644 --- a/FWCore/MessageLogger/src/MessageLogger.cc +++ b/FWCore/MessageLogger/src/MessageLogger.cc @@ -1,91 +1,27 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/MessageLogger/interface/MessageLoggerQ.h" -// Change Log -// -// 12/12/07 mf elimination of dummyLogDebugObject_, dummyLogTraceObject_ -// (see change log 8 in MessageLogger.h) -// -// 12/14/07 mf Moved the static free function onlyLowestDirectory -// to a class member function of LogDebug_, changing -// name to a more descriptive stripLeadingDirectoryTree. -// Cures the 2600-copies-of-this-function complaint. -// Implementation of this is moved into this .cc file. -// -// 6/20/08 mf Have flushMessageLog() check messageLoggerScribeIsRunning -// (in the message drop) to avoid hangs if that thread is not -// around. -// -// 11/18/08 wmtan Use explicit non-inlined destructors -// -// 8/11/09 mf setStandAloneMessageThreshold() and -// squelchStandAloneMessageCategory() -// -// 10/29/09 wmtan Use explicit non-inlined constructors for LogDebug_ -// and LogTrace_ -// -// 8/11/09 mf setStandAloneMessageThreshold() and -// squelchStandAloneMessageCategory() -// -// 9/23/10 mf Initialize debugEnabled according to -// MessageDrop::debugAlwaysSuppressed, rather than -// just true. See change 21 of MessageLogger.h. -// -// 9/27/10 mf isDebugEnabled() - check that debugAlwaysSuppressed is -// false before examining debugEnabled, which in principle -// ought to be thread-specific thus more expensive to look at. -// -// 9/27/10b mf dtor for LogWarningThatSuppressesLikeLogInfo - see -// change log 22 in MessageLogger.h -// -// 11/30/10 mf SnapshotMessageLog() method to force MessageDrop to capture any -// pointed-to strings in anticipation of key objects going -// away before a message is going to be issued. -// -// -// 7/6/11 fwyzard Add support for discarding LogError-level messages -// on a per-module basis (needed at HLT) // ------------------------------------------------------------------------ namespace edm { - LogInfo::~LogInfo() {} - LogWarning::~LogWarning() {} - LogError::~LogError() {} - LogAbsolute::~LogAbsolute() {} - LogSystem::~LogSystem() {} - LogVerbatim::~LogVerbatim() {} - LogDebug_::~LogDebug_() {} - LogTrace_::~LogTrace_() {} - LogPrint::~LogPrint() {} - LogProblem::~LogProblem() {} - LogImportant::~LogImportant() {} - namespace edmmltest { // 9/27/10b mf - LogWarningThatSuppressesLikeLogInfo::~LogWarningThatSuppressesLikeLogInfo() {} - } // namespace edmmltest - void LogStatistics() { edm::MessageLoggerQ::MLqSUM(); // trigger summary info } bool isDebugEnabled() { - return ((!edm::MessageDrop::debugAlwaysSuppressed) // 9/27/10 mf - && edm::MessageDrop::instance()->debugEnabled); + return ((!edm::MessageDrop::debugAlwaysSuppressed) && edm::MessageDrop::instance()->debugEnabled); } bool isInfoEnabled() { - return ((!edm::MessageDrop::infoAlwaysSuppressed) // 9/27/10 mf - && edm::MessageDrop::instance()->infoEnabled); + return ((!edm::MessageDrop::infoAlwaysSuppressed) && edm::MessageDrop::instance()->infoEnabled); } bool isWarningEnabled() { - return ((!edm::MessageDrop::warningAlwaysSuppressed) // 9/27/10 mf - && edm::MessageDrop::instance()->warningEnabled); + return ((!edm::MessageDrop::warningAlwaysSuppressed) && edm::MessageDrop::instance()->warningEnabled); } - bool isErrorEnabled() { - return edm::MessageDrop::instance()->errorEnabled; // 7/6/11 fwyzard - } + bool isErrorEnabled() { return edm::MessageDrop::instance()->errorEnabled; } void HaltMessageLogging() { edm::MessageLoggerQ::MLqSHT(); // Shut the logger up @@ -93,17 +29,15 @@ namespace edm { void FlushMessageLog() { if (MessageDrop::instance()->messageLoggerScribeIsRunning != MLSCRIBE_RUNNING_INDICATOR) - return; // 6/20/08 mf + return; edm::MessageLoggerQ::MLqFLS(); // Flush the message log queue } - void clearMessageLog() { // 11/30/10 mf - MessageDrop::instance()->clear(); - } + void clearMessageLog() { MessageDrop::instance()->clear(); } - bool isMessageProcessingSetUp() { // 6/20/08 mf - // std::cerr << "isMessageProcessingSetUp: \n"; - // std::cerr << "messageLoggerScribeIsRunning = " + bool isMessageProcessingSetUp() { + // std::cerr << "isMessageProcessingSetUp: \n"; + // std::cerr << "messageLoggerScribeIsRunning = " // << (int)MessageDrop::instance()->messageLoggerScribeIsRunning << "\n"; return (MessageDrop::instance()->messageLoggerScribeIsRunning == MLSCRIBE_RUNNING_INDICATOR); } @@ -114,7 +48,7 @@ namespace edm { // Note that the scribe will be responsible for deleting cat_p } - edm::LogDebug_::LogDebug_(std::string_view id, std::string_view file, int line) : ap(ELdebug, id) { + edm::LogDebug_::LogDebug_(std::string_view id, std::string_view file, int line) : Log<level::Debug, false>(id) { *this << " " << stripLeadingDirectoryTree(file) << ":" << line << "\n"; } @@ -127,8 +61,6 @@ namespace edm { return file.substr(lastSlash + 1, file.size() - lastSlash - 1); } - edm::LogTrace_::LogTrace_(std::string_view id) : ap(ELdebug, id, true) {} - void setStandAloneMessageThreshold(edm::ELseverityLevel const& severity) { edm::MessageLoggerQ::standAloneThreshold(severity); } From fc76cf7450a896c471a7e7db1af18b1e3b1210a5 Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 15 Oct 2020 19:14:24 +0200 Subject: [PATCH 612/778] Replace deprecated MF configuration MagneticField_38T_PostLS1_cff with the standard one --- .../python/MagneticField_38T_PostLS1_cff.py | 13 ------------- SimMuon/RPCDigitizer/test/runRPCDigiProducer_cfg.py | 10 +++++----- .../test/python/digiValidation_cfg.py | 2 +- .../test/python/rechitValidation_cfg.py | 2 +- .../test/python/simHitValidation_cfg.py | 2 +- .../test/runGEMRecHitProducer_GE21v7_10deg_cfg.py | 2 +- .../test/runGEMRecHitProducer_GE21v7_cfg.py | 2 +- Validation/RecoJets/test/sequence_validation_cfg.py | 2 +- Validation/RecoMET/test/sequence_validation_cfg.py | 2 +- .../test/stripClusterMCanalysis_cfg.py | 2 +- 10 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py diff --git a/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py b/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py deleted file mode 100644 index 739c9b113917b..0000000000000 --- a/Configuration/StandardSequences/python/MagneticField_38T_PostLS1_cff.py +++ /dev/null @@ -1,13 +0,0 @@ -### THIS CFF IS DEPRECATED!!!! ### -# please use MagneticField_cff.py instead - -from __future__ import print_function -print(" ##################################################################### ") -print(" # WARNING: the module # ") -print(" # Configuration.StandardSequences.MagneticField_38T_PostLS1_cff # ") -print(" # is deprecated. Please import # ") -print(" # Configuration.StandardSequences.MagneticField_cff # ") -print(" ##################################################################### ") - -from Configuration.StandardSequences.MagneticField_38T_cff import * - diff --git a/SimMuon/RPCDigitizer/test/runRPCDigiProducer_cfg.py b/SimMuon/RPCDigitizer/test/runRPCDigiProducer_cfg.py index 15efdb3ad8815..79d9ee597410c 100644 --- a/SimMuon/RPCDigitizer/test/runRPCDigiProducer_cfg.py +++ b/SimMuon/RPCDigitizer/test/runRPCDigiProducer_cfg.py @@ -23,7 +23,7 @@ # process = customize_digi_addGEM_muon_only(process) # Digi only Muon Detectors # process.load('Configuration.Geometry.GeometryExtended2023MuonReco_cff') # process.load('Configuration.Geometry.GeometryExtended2023Muon_cff') -# process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +# process.load('Configuration.StandardSequences.MagneticField_cff') ############################ ### 2023 Geometry w/o ME0 ### @@ -35,7 +35,7 @@ # process = customize_digi_addGEM_muon_only(process) # Digi only Muon Detectors # process.load('Configuration.Geometry.GeometryExtended2023Reco_cff') # process.load('Configuration.Geometry.GeometryExtended2023_cff') -# process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +# process.load('Configuration.StandardSequences.MagneticField_cff') ############################# ### 2021 Geometry w/ GEM ### @@ -55,7 +55,7 @@ # process = customize_digi_addGEM_muon_only(process) # Digi only Muon Detectors # process.load('Configuration.Geometry.GeometryExtended2021Reco_cff') # process.load('Configuration.Geometry.GeometryExtended2021_cff') -# process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +# process.load('Configuration.StandardSequences.MagneticField_cff') ############################ ### Run 2 Geometry ### @@ -65,7 +65,7 @@ # process = customize_digi_muon_only(process) # Digi only Muon Detectors # process.load('Configuration.Geometry.GeometryExtended2015Reco_cff') # process.load('Configuration.Geometry.GeometryExtended2015_cff') -# process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +# process.load('Configuration.StandardSequences.MagneticField_cff') ###################### ### Run 1 Geometry ### @@ -74,7 +74,7 @@ from SimMuon.RPCDigitizer.customizeRPCDigi import customize_digi_muon_only # Customize for CSC + DT + RPC process = customize_digi_muon_only(process) # Digi only Muon Detectors process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') ###################### diff --git a/Validation/HGCalValidation/test/python/digiValidation_cfg.py b/Validation/HGCalValidation/test/python/digiValidation_cfg.py index 1f38fb5b37da4..1298a4b39aa2f 100644 --- a/Validation/HGCalValidation/test/python/digiValidation_cfg.py +++ b/Validation/HGCalValidation/test/python/digiValidation_cfg.py @@ -14,7 +14,7 @@ process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.Geometry.GeometryExtended2026D46Reco_cff') process.load('Configuration.Geometry.GeometryExtended2026D46_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') process.load('GeneratorInterface.Core.genFilterSummary_cff') diff --git a/Validation/HGCalValidation/test/python/rechitValidation_cfg.py b/Validation/HGCalValidation/test/python/rechitValidation_cfg.py index b0d100ce16d8f..72fce599744d7 100644 --- a/Validation/HGCalValidation/test/python/rechitValidation_cfg.py +++ b/Validation/HGCalValidation/test/python/rechitValidation_cfg.py @@ -14,7 +14,7 @@ process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.Geometry.GeometryExtended2026D46Reco_cff') process.load('Configuration.Geometry.GeometryExtended2026D46_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') process.load('GeneratorInterface.Core.genFilterSummary_cff') diff --git a/Validation/HGCalValidation/test/python/simHitValidation_cfg.py b/Validation/HGCalValidation/test/python/simHitValidation_cfg.py index f2569a850f963..5c659988f1f57 100644 --- a/Validation/HGCalValidation/test/python/simHitValidation_cfg.py +++ b/Validation/HGCalValidation/test/python/simHitValidation_cfg.py @@ -13,7 +13,7 @@ process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.Geometry.GeometryExtended2026D46Reco_cff') process.load('Configuration.Geometry.GeometryExtended2026D46_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedGauss_cfi') process.load('GeneratorInterface.Core.genFilterSummary_cff') diff --git a/Validation/MuonGEMHits/test/runGEMRecHitProducer_GE21v7_10deg_cfg.py b/Validation/MuonGEMHits/test/runGEMRecHitProducer_GE21v7_10deg_cfg.py index a3b8124cc4111..390560d36cb04 100644 --- a/Validation/MuonGEMHits/test/runGEMRecHitProducer_GE21v7_10deg_cfg.py +++ b/Validation/MuonGEMHits/test/runGEMRecHitProducer_GE21v7_10deg_cfg.py @@ -33,7 +33,7 @@ # process.load('Configuration.Geometry.GeometryExtended2023_cff') process.load('Configuration.Geometry.GeometryExtended2015MuonGEMDevReco_cff') process.load('Configuration.Geometry.GeometryExtended2015MuonGEMDev_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi') process.load('GeneratorInterface.Core.genFilterSummary_cff') diff --git a/Validation/MuonGEMHits/test/runGEMRecHitProducer_GE21v7_cfg.py b/Validation/MuonGEMHits/test/runGEMRecHitProducer_GE21v7_cfg.py index 09bc7e37d37a2..4054e244d6e34 100644 --- a/Validation/MuonGEMHits/test/runGEMRecHitProducer_GE21v7_cfg.py +++ b/Validation/MuonGEMHits/test/runGEMRecHitProducer_GE21v7_cfg.py @@ -33,7 +33,7 @@ # process.load('Configuration.Geometry.GeometryExtended2023_cff') process.load('Configuration.Geometry.GeometryExtended2015MuonGEMDevReco_cff') process.load('Configuration.Geometry.GeometryExtended2015MuonGEMDev_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi') process.load('GeneratorInterface.Core.genFilterSummary_cff') diff --git a/Validation/RecoJets/test/sequence_validation_cfg.py b/Validation/RecoJets/test/sequence_validation_cfg.py index e5b40e707b7c9..9979f57d8a899 100644 --- a/Validation/RecoJets/test/sequence_validation_cfg.py +++ b/Validation/RecoJets/test/sequence_validation_cfg.py @@ -4,7 +4,7 @@ process = cms.Process("METVALIDATION") process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Reconstruction_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') diff --git a/Validation/RecoMET/test/sequence_validation_cfg.py b/Validation/RecoMET/test/sequence_validation_cfg.py index ea9efb453e4fe..7c187b590214f 100644 --- a/Validation/RecoMET/test/sequence_validation_cfg.py +++ b/Validation/RecoMET/test/sequence_validation_cfg.py @@ -4,7 +4,7 @@ process = cms.Process("METVALIDATION") process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Reconstruction_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') diff --git a/Validation/TrackerRecHits/test/stripClusterMCanalysis_cfg.py b/Validation/TrackerRecHits/test/stripClusterMCanalysis_cfg.py index 9a884e08b1aee..7ea7b7d990b40 100644 --- a/Validation/TrackerRecHits/test/stripClusterMCanalysis_cfg.py +++ b/Validation/TrackerRecHits/test/stripClusterMCanalysis_cfg.py @@ -29,7 +29,7 @@ process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.RawToDigi_cff') process.load('Configuration.StandardSequences.Reconstruction_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') From fab096180c199d273617af7610619c2bcb838e53 Mon Sep 17 00:00:00 2001 From: Nicola Amapane <nicola.amapane@cern.ch> Date: Thu, 15 Oct 2020 19:23:02 +0200 Subject: [PATCH 613/778] Fix ConfigBuilder.py to use the standard MF configuration --- Configuration/Applications/python/ConfigBuilder.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index 5b6c6f8e7166b..672e4fef0d37a 100644 --- a/Configuration/Applications/python/ConfigBuilder.py +++ b/Configuration/Applications/python/ConfigBuilder.py @@ -1050,10 +1050,6 @@ def define_Configs(self): self.USERDefaultCFF=None # the magnetic field - if self._options.isData: - if self._options.magField==defaultOptions.magField: - print("magnetic field option forced to: AutoFromDBCurrent") - self._options.magField='AutoFromDBCurrent' self.magFieldCFF = 'Configuration/StandardSequences/MagneticField_'+self._options.magField.replace('.','')+'_cff' self.magFieldCFF = self.magFieldCFF.replace("__",'_') From 7fc263c920cb1881fd5e524397e228e8a07d22af Mon Sep 17 00:00:00 2001 From: Andres Vargas <vargasa@cua.edu> Date: Fri, 9 Oct 2020 18:09:39 -0500 Subject: [PATCH 614/778] GeometricDetExtra Removal --- CondCore/GeometryPlugins/plugins/plugin.cc | 4 - CondCore/Utilities/plugins/Module_2XML.cc | 1 - CondCore/Utilities/src/CondDBFetch.cc | 1 - CondCore/Utilities/src/CondDBImport.cc | 1 - CondCore/Utilities/src/CondFormats.h | 1 - .../GeometryObjects/doc/GeometryObjects.doc | 53 ---- .../interface/PGeometricDetExtra.h | 32 --- .../src/T_EventSetup_PGeometricDetExtra.cc | 4 - CondFormats/GeometryObjects/src/classes.h | 1 - .../GeometryObjects/src/classes_def.xml | 6 - .../test/testSerializationGeometryObjects.cpp | 3 - ...PGeometricDetExtra_automatic_default_0.xml | 9 - .../plugins/PGeometricDetExtraBuilder.cc | 80 ------ CondTools/Geometry/test/GeometryTester.cc | 14 - CondTools/Geometry/test/geometrytest_local.py | 5 - CondTools/Geometry/test/geometrywriter.py | 12 +- .../Geometry/test/trackergeometrywriter.py | 10 +- .../test/trackergeometrywriterRun2.py | 11 +- .../geometryExtended2016_writer.py | 12 +- .../geometryExtended2017Plan1_writer.py | 11 +- .../geometryExtended2017_writer.py | 11 +- .../geometryExtended2018_writer.py | 11 +- .../geometryExtended2019_writer.py | 10 +- .../geometryExtended2021_writer.py | 10 +- .../geometryExtended2026_writer.py | 10 +- .../writehelpers/geometryrun2devwriter.py | 10 +- .../test/writehelpers/geometryrun2writer.py | 10 +- .../test/writehelpers/geometrywriter.py | 11 +- .../writehelpers/splitExtended2016Database.sh | 1 - .../writehelpers/splitExtended2017Database.sh | 1 - .../splitExtended2017Plan1Database.sh | 1 - .../writehelpers/splitExtended2018Database.sh | 1 - .../writehelpers/splitExtended2019Database.sh | 1 - .../writehelpers/splitExtended2021Database.sh | 1 - .../writehelpers/splitExtended2026Database.sh | 1 - .../test/writehelpers/splitRun1Database.sh | 1 - .../test/writehelpers/splitRun2Database.sh | 1 - .../test/writehelpers/splitRun2devDatabase.sh | 1 - .../test/runTestCaloGeometryLocalDB_cfg.py | 1 - Geometry/Records/doc/Records.doc | 76 ----- .../Records/interface/IdealGeometryRecord.h | 8 +- .../Records/interface/PGeometricDetExtraRcd.h | 6 - Geometry/Records/src/PGeometricDetExtraRcd.cc | 4 - .../python/trackerModuleInfo_cfg.py | 7 +- .../TrackerGeometryBuilder/test/ModuleInfo.cc | 121 +------- .../python/testTrackerModuleInfoDB_cfg.py | 8 +- .../python/testTrackerModuleInfoDDD_cfg.py | 7 +- ...tTrackerModuleInfoFromDDDNoPrintDDD_cfg.py | 6 +- .../python/trackerModuleInfoLocalDB_cfg.py | 8 +- .../interface/CmsTrackerDebugNavigator.h | 25 -- .../interface/GeometricDetExtra.h | 79 ------ .../TrackerGeometricDetExtraESModule.cc | 267 ------------------ .../src/CmsTrackerDebugNavigator.cc | 47 --- .../src/GeometricDetExtra.cc | 25 -- .../TrackerNumberingBuilder/src/module.cc | 3 - .../test/ModuleNumbering.cc | 6 - .../test/trackerModuleNumbering_cfg.py | 8 +- .../Geometry/test/ModuleInfo_Phase2.cc | 191 ++----------- .../test/trackerModuleInfo_Phase2_cfg.py | 6 +- 59 files changed, 109 insertions(+), 1164 deletions(-) delete mode 100644 CondFormats/GeometryObjects/doc/GeometryObjects.doc delete mode 100644 CondFormats/GeometryObjects/interface/PGeometricDetExtra.h delete mode 100644 CondFormats/GeometryObjects/src/T_EventSetup_PGeometricDetExtra.cc delete mode 100644 CondFormats/GeometryObjects/xml/PGeometricDetExtra_automatic_default_0.xml delete mode 100644 CondTools/Geometry/plugins/PGeometricDetExtraBuilder.cc delete mode 100644 Geometry/Records/doc/Records.doc delete mode 100644 Geometry/Records/interface/PGeometricDetExtraRcd.h delete mode 100644 Geometry/Records/src/PGeometricDetExtraRcd.cc delete mode 100644 Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h delete mode 100644 Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h delete mode 100644 Geometry/TrackerNumberingBuilder/plugins/TrackerGeometricDetExtraESModule.cc delete mode 100644 Geometry/TrackerNumberingBuilder/src/CmsTrackerDebugNavigator.cc delete mode 100644 Geometry/TrackerNumberingBuilder/src/GeometricDetExtra.cc diff --git a/CondCore/GeometryPlugins/plugins/plugin.cc b/CondCore/GeometryPlugins/plugins/plugin.cc index bc464d8b07f4b..ae09f944fd533 100644 --- a/CondCore/GeometryPlugins/plugins/plugin.cc +++ b/CondCore/GeometryPlugins/plugins/plugin.cc @@ -26,9 +26,6 @@ #include "Geometry/Records/interface/GEMRecoGeometryRcd.h" #include "Geometry/Records/interface/ME0RecoGeometryRcd.h" -#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h" -#include "Geometry/Records/interface/PGeometricDetExtraRcd.h" - #include "CondFormats/GeometryObjects/interface/PTrackerParameters.h" #include "Geometry/Records/interface/PTrackerParametersRcd.h" @@ -43,7 +40,6 @@ REGISTER_PLUGIN(GeometryFileRcd, FileBlob); REGISTER_PLUGIN(IdealGeometryRecord, PGeometricDet); -REGISTER_PLUGIN(PGeometricDetExtraRcd, PGeometricDetExtra); REGISTER_PLUGIN(PTrackerParametersRcd, PTrackerParameters); REGISTER_PLUGIN(PEcalBarrelRcd, PCaloGeometry); REGISTER_PLUGIN(PEcalEndcapRcd, PCaloGeometry); diff --git a/CondCore/Utilities/plugins/Module_2XML.cc b/CondCore/Utilities/plugins/Module_2XML.cc index 7a60dd72c368d..e9bf734cb1501 100644 --- a/CondCore/Utilities/plugins/Module_2XML.cc +++ b/CondCore/Utilities/plugins/Module_2XML.cc @@ -205,7 +205,6 @@ PAYLOAD_2XML_MODULE(pluginUtilities_payload2xml) { PAYLOAD_2XML_CLASS(OOTPileupCorrectionBuffer); PAYLOAD_2XML_CLASS(PCaloGeometry); PAYLOAD_2XML_CLASS(PGeometricDet); - PAYLOAD_2XML_CLASS(PGeometricDetExtra); PAYLOAD_2XML_CLASS(PHGCalParameters); PAYLOAD_2XML_CLASS(PTrackerParameters); PAYLOAD_2XML_CLASS(PerformancePayloadFromBinnedTFormula); diff --git a/CondCore/Utilities/src/CondDBFetch.cc b/CondCore/Utilities/src/CondDBFetch.cc index a8d774ab5d4aa..65487da430c1b 100644 --- a/CondCore/Utilities/src/CondDBFetch.cc +++ b/CondCore/Utilities/src/CondDBFetch.cc @@ -242,7 +242,6 @@ namespace cond { FETCH_PAYLOAD_CASE(PCaloGeometry) FETCH_PAYLOAD_CASE(HcalParameters) FETCH_PAYLOAD_CASE(PGeometricDet) - FETCH_PAYLOAD_CASE(PGeometricDetExtra) FETCH_PAYLOAD_CASE(PTrackerParameters) FETCH_PAYLOAD_CASE(PHGCalParameters) //FETCH_PAYLOAD_CASE( PerformancePayload ) diff --git a/CondCore/Utilities/src/CondDBImport.cc b/CondCore/Utilities/src/CondDBImport.cc index fe6bd5578cbb2..051cded7514cd 100644 --- a/CondCore/Utilities/src/CondDBImport.cc +++ b/CondCore/Utilities/src/CondDBImport.cc @@ -265,7 +265,6 @@ namespace cond { IMPORT_PAYLOAD_CASE(PCaloGeometry) IMPORT_PAYLOAD_CASE(HcalParameters) IMPORT_PAYLOAD_CASE(PGeometricDet) - IMPORT_PAYLOAD_CASE(PGeometricDetExtra) IMPORT_PAYLOAD_CASE(PTrackerParameters) IMPORT_PAYLOAD_CASE(PHGCalParameters) //IMPORT_PAYLOAD_CASE( PerformancePayload ) diff --git a/CondCore/Utilities/src/CondFormats.h b/CondCore/Utilities/src/CondFormats.h index 11827f13fb029..53f7aaee6d801 100644 --- a/CondCore/Utilities/src/CondFormats.h +++ b/CondCore/Utilities/src/CondFormats.h @@ -115,7 +115,6 @@ #include "CondFormats/PhysicsToolsObjects/interface/PhysicsTGraphPayload.h" #include "CondFormats/PhysicsToolsObjects/interface/PhysicsTFormulaPayload.h" #include "CondFormats/GeometryObjects/interface/PGeometricDet.h" -#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h" #include "CondFormats/GeometryObjects/interface/PTrackerParameters.h" #include "CondFormats/GeometryObjects/interface/PHGCalParameters.h" #include "CondFormats/RPCObjects/interface/RPCEMap.h" diff --git a/CondFormats/GeometryObjects/doc/GeometryObjects.doc b/CondFormats/GeometryObjects/doc/GeometryObjects.doc deleted file mode 100644 index ed6ef39b38a33..0000000000000 --- a/CondFormats/GeometryObjects/doc/GeometryObjects.doc +++ /dev/null @@ -1,53 +0,0 @@ - -/*! - -\page CondFormats_GeometryObjects Package CondFormats/GeometryObjects - -<center> -<small> - -<!-- @CVS_TAG@ will be substituted at build time, no need to touch --> -<a href=http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/CondFormats/GeometryObjects/?cvsroot=CMSSW&only_with_tag=@CVS_TAG@>Source code (CVS tag: @CVS_TAG@)</a> - -<a href=http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/CondFormats/GeometryObjects/.admin/developers?rev=HEAD&cvsroot=CMSSW&content-type=text/vnd.viewcvs-markup>Administrative privileges</a> -</small> -</center> - -\section desc Description -<!-- Short description of what this package is supposed to provide --> - -(THE PACKAGE ADMINISTATOR SHOULD REPLACE THIS SENTENCE WITH HAND-WRITTEN DOCUMENTATION SAYING WHAT THE PACKAGE DOES.) - -\subsection interface Public interface -<!-- List the classes that are provided for use in other packages (if any) --> - -- CSCRecoDigiParameters -- GeometryFile -- PCaloGeometry -- PGeometricDet -- PGeometricDetExtra -- RecoIdealGeometry - - -\subsection pluginai Plugins -<!-- List the plugins that are provided for use in other packages (if any) --> - - - - -\subsection modules Modules -<!-- Describe modules implemented in this package and their parameter set --> - - -\subsection tests Unit tests and examples -<!-- Describe cppunit tests and example configuration files --> -Unknown - -\section status Status and planned development -<!-- e.g. completed, stable, missing features --> -Unknown - -<hr> -Last updated: -@DATE@ Author: computer-generated. -*/ - diff --git a/CondFormats/GeometryObjects/interface/PGeometricDetExtra.h b/CondFormats/GeometryObjects/interface/PGeometricDetExtra.h deleted file mode 100644 index 66fd04f8ba878..0000000000000 --- a/CondFormats/GeometryObjects/interface/PGeometricDetExtra.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CondFormats_PGeometricDetExtra_h -#define CondFormats_PGeometricDetExtra_h - -#include "CondFormats/Serialization/interface/Serializable.h" - -#include <vector> -#include <string> - -class PGeometricDetExtra { -public: - PGeometricDetExtra(){}; - ~PGeometricDetExtra(){}; - - struct Item { - int _geographicalId; // to be converted to DetId - // std::vector< DDExpandedNode > _parents; DO NOT SAVE! - //GeoHistory _parents; - double _volume; - double _density; - double _weight; - int _copy; - std::string _material; - - COND_SERIALIZABLE; - }; - - std::vector<Item> pgdes_; - - COND_SERIALIZABLE; -}; - -#endif diff --git a/CondFormats/GeometryObjects/src/T_EventSetup_PGeometricDetExtra.cc b/CondFormats/GeometryObjects/src/T_EventSetup_PGeometricDetExtra.cc deleted file mode 100644 index 0a5afd5231266..0000000000000 --- a/CondFormats/GeometryObjects/src/T_EventSetup_PGeometricDetExtra.cc +++ /dev/null @@ -1,4 +0,0 @@ -#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h" -#include "FWCore/Utilities/interface/typelookup.h" - -TYPELOOKUP_DATA_REG(PGeometricDetExtra); diff --git a/CondFormats/GeometryObjects/src/classes.h b/CondFormats/GeometryObjects/src/classes.h index d37fcb036731b..9eab3baa55c4b 100644 --- a/CondFormats/GeometryObjects/src/classes.h +++ b/CondFormats/GeometryObjects/src/classes.h @@ -1,5 +1,4 @@ #include "CondFormats/GeometryObjects/interface/PGeometricDet.h" -#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h" #include "CondFormats/GeometryObjects/interface/PGeometricTimingDet.h" #include "CondFormats/GeometryObjects/interface/PGeometricTimingDetExtra.h" #include "CondFormats/GeometryObjects/interface/PCaloGeometry.h" diff --git a/CondFormats/GeometryObjects/src/classes_def.xml b/CondFormats/GeometryObjects/src/classes_def.xml index 75f459f3d7171..d37f9ca2af066 100644 --- a/CondFormats/GeometryObjects/src/classes_def.xml +++ b/CondFormats/GeometryObjects/src/classes_def.xml @@ -5,12 +5,6 @@ <class name="PGeometricDet::Item"/> <class name="std::vector<PGeometricDet::Item>"/> - <class name="PGeometricDetExtra" class_version="0"> - <field name="pgdes_" mapping="blob"/> - </class> - <class name="PGeometricDetExtra::Item"/> - <class name="std::vector<PGeometricDetExtra::Item>"/> - <class name="PGeometricTimingDet" class_version="0"> <field name="pgeomdets_" mapping="blob"/> </class> diff --git a/CondFormats/GeometryObjects/test/testSerializationGeometryObjects.cpp b/CondFormats/GeometryObjects/test/testSerializationGeometryObjects.cpp index a123afc8b1768..fa49f925ad475 100644 --- a/CondFormats/GeometryObjects/test/testSerializationGeometryObjects.cpp +++ b/CondFormats/GeometryObjects/test/testSerializationGeometryObjects.cpp @@ -7,11 +7,8 @@ int main() { testSerialization<PCaloGeometry>(); testSerialization<PGeometricDet>(); //testSerialization<PGeometricDet::Item>(); has uninitialized booleans - testSerialization<PGeometricDetExtra>(); - testSerialization<PGeometricDetExtra::Item>(); testSerialization<RecoIdealGeometry>(); testSerialization<std::vector<PGeometricDet::Item>>(); - testSerialization<std::vector<PGeometricDetExtra::Item>>(); testSerialization<PTrackerParameters>(); testSerialization<PTrackerParameters::Item>(); testSerialization<HcalParameters>(); diff --git a/CondFormats/GeometryObjects/xml/PGeometricDetExtra_automatic_default_0.xml b/CondFormats/GeometryObjects/xml/PGeometricDetExtra_automatic_default_0.xml deleted file mode 100644 index e1a4842e98365..0000000000000 --- a/CondFormats/GeometryObjects/xml/PGeometricDetExtra_automatic_default_0.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version='1.0' encoding="UTF-8"?> -<!DOCTYPE PoolDatabase SYSTEM "InMemory"> - <PoolDatabase > - <PoolContainer name="PGeometricDetExtra" > - <Class table="PGEOMETRICDETEXTRA" id_columns="ID" name="PGeometricDetExtra" mapping_version="PGeometricDetExtra_automatic_default" > - <Blob column="DPGEOMDETEXTRAS" name="pgdes_" /> - </Class > - </PoolContainer > - </PoolDatabase > diff --git a/CondTools/Geometry/plugins/PGeometricDetExtraBuilder.cc b/CondTools/Geometry/plugins/PGeometricDetExtraBuilder.cc deleted file mode 100644 index 0d887b7c9f69a..0000000000000 --- a/CondTools/Geometry/plugins/PGeometricDetExtraBuilder.cc +++ /dev/null @@ -1,80 +0,0 @@ -#include "FWCore/Framework/interface/one/EDAnalyzer.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Framework/interface/Event.h" -#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESTransientHandle.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h" -#include "Geometry/Records/interface/PGeometricDetExtraRcd.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h" -#include "DetectorDescription/DDCMS/interface/DDCompactView.h" -#include "DetectorDescription/Core/interface/DDCompactView.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include <vector> - -class PGeometricDetExtraBuilder : public edm::one::EDAnalyzer<edm::one::WatchRuns> { -public: - PGeometricDetExtraBuilder(const edm::ParameterSet&); - - void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override; - void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {} - void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {} - -private: - void putOne(const GeometricDetExtra& gde, PGeometricDetExtra* pgde); - bool fromDD4hep_; -}; - -PGeometricDetExtraBuilder::PGeometricDetExtraBuilder(const edm::ParameterSet& iConfig) { - fromDD4hep_ = iConfig.getParameter<bool>("fromDD4hep"); -} - -void PGeometricDetExtraBuilder::beginRun(const edm::Run&, edm::EventSetup const& es) { - PGeometricDetExtra* pgde = new PGeometricDetExtra; - edm::Service<cond::service::PoolDBOutputService> mydbservice; - if (!mydbservice.isAvailable()) { - edm::LogError("PGeometricDetExtraBuilder") << "PoolDBOutputService unavailable"; - return; - } - - if (!fromDD4hep_) { - edm::ESTransientHandle<DDCompactView> cpvH; - es.get<IdealGeometryRecord>().get(cpvH); - } else { - edm::ESTransientHandle<cms::DDCompactView> cpvH; - es.get<IdealGeometryRecord>().get(cpvH); - } - edm::ESHandle<std::vector<GeometricDetExtra> > gdeH; - es.get<IdealGeometryRecord>().get(gdeH); - const std::vector<GeometricDetExtra>& gdes = (*gdeH); - - std::vector<GeometricDetExtra>::const_iterator git = gdes.begin(); - std::vector<GeometricDetExtra>::const_iterator egit = gdes.end(); - - for (; git != egit; ++git) { // one level below "tracker" - putOne(*git, pgde); - } - if (mydbservice->isNewTagRequest("PGeometricDetExtraRcd")) { - mydbservice->createNewIOV<PGeometricDetExtra>( - pgde, mydbservice->beginOfTime(), mydbservice->endOfTime(), "PGeometricDetExtraRcd"); - } else { - edm::LogError("PGeometricDetExtraBuilder") << "PGeometricDetExtra and PGeometricDetExtraRcd Tag already present"; - } -} - -void PGeometricDetExtraBuilder::putOne(const GeometricDetExtra& gde, PGeometricDetExtra* pgde) { - PGeometricDetExtra::Item item; - item._geographicalId = gde.geographicalId(); - item._volume = gde.volume(); - item._density = gde.density(); - item._weight = gde.weight(); - item._copy = gde.copyno(); - item._material = gde.material(); - pgde->pgdes_.push_back(item); -} - -DEFINE_FWK_MODULE(PGeometricDetExtraBuilder); diff --git a/CondTools/Geometry/test/GeometryTester.cc b/CondTools/Geometry/test/GeometryTester.cc index 8d0724c05208d..c6b1927626980 100644 --- a/CondTools/Geometry/test/GeometryTester.cc +++ b/CondTools/Geometry/test/GeometryTester.cc @@ -13,7 +13,6 @@ #include "CondFormats/Common/interface/FileBlob.h" #include "CondFormats/GeometryObjects/interface/PGeometricDet.h" -#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h" #include "CondFormats/GeometryObjects/interface/PCaloGeometry.h" #include "CondFormats/GeometryObjects/interface/RecoIdealGeometry.h" #include "CondFormats/GeometryObjects/interface/CSCRecoDigiParameters.h" @@ -21,7 +20,6 @@ #include "Geometry/Records/interface/GeometryFileRcd.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/Records/interface/PGeometricDetExtraRcd.h" #include "Geometry/Records/interface/DTRecoGeometryRcd.h" #include "Geometry/Records/interface/RPCRecoGeometryRcd.h" #include "Geometry/Records/interface/CSCRecoGeometryRcd.h" @@ -123,27 +121,15 @@ void GeometryTester::analyze(const edm::Event &, const edm::EventSetup &iSetup) FmtOstream outStream; if (m_tktest) { edm::ESHandle<PGeometricDet> tkGeo; - edm::ESHandle<PGeometricDetExtra> tkExtra; iSetup.get<IdealGeometryRecord>().get(tkGeo); - iSetup.get<PGeometricDetExtraRcd>().get(tkExtra); std::cout << "TRACKER\n"; - //helper map - std::map<uint32_t, uint32_t> diTogde; - for (uint32_t g = 0; g < tkExtra->pgdes_.size(); ++g) { - diTogde[tkExtra->pgdes_[g]._geographicalId] = g; - } - uint32_t tkeInd; for (auto it : tkGeo->pgeomdets_) { std::cout << "trk "; outStream << it._params0 << it._params1 << it._params2 << it._params3 << it._params4 << it._params5 << it._params6 << it._params7 << it._params8 << it._params9 << it._params10 << it._x << it._y << it._z << it._phi << it._rho << it._a11 << it._a12 << it._a13 << it._a21 << it._a22 << it._a23 << it._a31 << it._a32 << it._a33 << it._shape << it._name << it._ns; - tkeInd = diTogde[it._geographicalID]; - outStream << tkExtra->pgdes_[tkeInd]._volume << tkExtra->pgdes_[tkeInd]._density - << tkExtra->pgdes_[tkeInd]._weight << tkExtra->pgdes_[tkeInd]._copy - << tkExtra->pgdes_[tkeInd]._material; outStream << it._radLength << it._xi << it._pixROCRows << it._pixROCCols << it._pixROCx << it._pixROCy << it._stereo << it._siliconAPVNum << it._geographicalID << it._nt0 << it._nt1 << it._nt2 << it._nt3 << it._nt4 << it._nt5 << it._nt6 << it._nt7 << it._nt8 << it._nt9 << it._nt10 << "\n"; diff --git a/CondTools/Geometry/test/geometrytest_local.py b/CondTools/Geometry/test/geometrytest_local.py index e7d726fd29c09..a49bc674260bf 100644 --- a/CondTools/Geometry/test/geometrytest_local.py +++ b/CondTools/Geometry/test/geometrytest_local.py @@ -57,11 +57,6 @@ connect = cms.string("sqlite_file:myfile.db"), # label = cms.string("Extended") ), - cms.PSet(record = cms.string("PGeometricDetExtraRcd"), - tag = cms.string("TKExtra_Geometry_TagXX"), - connect = cms.string("sqlite_file:myfile.db"), -# label = cms.string("Extra") - ), cms.PSet(record = cms.string("IdealGeometryRecord"), tag = cms.string("TKRECO_Geometry_TagXX"), connect = cms.string("sqlite_file:myfile.db") diff --git a/CondTools/Geometry/test/geometrywriter.py b/CondTools/Geometry/test/geometrywriter.py index 222a5b143a012..f0a4d9f3b2569 100644 --- a/CondTools/Geometry/test/geometrywriter.py +++ b/CondTools/Geometry/test/geometrywriter.py @@ -17,12 +17,13 @@ XMLFileName = cms.untracked.string("./geTagXX.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) + +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) + process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool( False )) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder", fromDD4hep=cms.bool( False )) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder", fromDD4hep=cms.bool( False )) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -39,7 +40,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_Extended_TagXX')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), @@ -59,5 +59,5 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) diff --git a/CondTools/Geometry/test/trackergeometrywriter.py b/CondTools/Geometry/test/trackergeometrywriter.py index fd6c6c4804efb..87a586986ff83 100644 --- a/CondTools/Geometry/test/trackergeometrywriter.py +++ b/CondTools/Geometry/test/trackergeometrywriter.py @@ -11,12 +11,11 @@ interval = cms.uint64(1) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder", fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder", fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder", fromDD4hep=cms.bool(False)) process.CondDB.timetype = cms.untracked.string('runnumber') @@ -24,7 +23,6 @@ process.PoolDBOutputService = cms.Service("PoolDBOutputService", process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_Test01')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_Test01')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_Test01')) ) ) @@ -33,4 +31,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.TrackerGeometryWriter*process.TrackerGeometryExtraWriter*process.TrackerParametersWriter) +process.p1 = cms.Path(process.TrackerGeometryWriter*process.TrackerParametersWriter) diff --git a/CondTools/Geometry/test/trackergeometrywriterRun2.py b/CondTools/Geometry/test/trackergeometrywriterRun2.py index d5b9ded7417ed..aa77cbf82077d 100644 --- a/CondTools/Geometry/test/trackergeometrywriterRun2.py +++ b/CondTools/Geometry/test/trackergeometrywriterRun2.py @@ -11,12 +11,12 @@ interval = cms.uint64(1) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) + process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool( False )) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool( False )) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool( False )) process.CondDB.timetype = cms.untracked.string('runnumber') @@ -24,7 +24,6 @@ process.PoolDBOutputService = cms.Service("PoolDBOutputService", process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_Run2_Test02')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_Run2_Test02')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_Run2_Test02')) ) ) @@ -33,5 +32,5 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.TrackerGeometryWriter*process.TrackerGeometryExtraWriter*process.TrackerParametersWriter) +process.p1 = cms.Path(process.TrackerGeometryWriter*process.TrackerParametersWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryExtended2016_writer.py b/CondTools/Geometry/test/writehelpers/geometryExtended2016_writer.py index 39665b98f0c0e..b69ea4b2d7a3a 100644 --- a/CondTools/Geometry/test/writehelpers/geometryExtended2016_writer.py +++ b/CondTools/Geometry/test/writehelpers/geometryExtended2016_writer.py @@ -27,12 +27,13 @@ XMLFileName = cms.untracked.string("./geSingleBigFile.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ), - ) + +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) + process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -50,7 +51,6 @@ process.CondDBCommon, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2016_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), @@ -71,4 +71,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryExtended2017Plan1_writer.py b/CondTools/Geometry/test/writehelpers/geometryExtended2017Plan1_writer.py index 2f2b71cce6e52..c7aa13f75850b 100644 --- a/CondTools/Geometry/test/writehelpers/geometryExtended2017Plan1_writer.py +++ b/CondTools/Geometry/test/writehelpers/geometryExtended2017Plan1_writer.py @@ -28,12 +28,12 @@ XMLFileName = cms.untracked.string("./geSingleBigFile.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ), - ) + +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -52,7 +52,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2017Plan1_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), @@ -74,4 +73,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryExtended2017_writer.py b/CondTools/Geometry/test/writehelpers/geometryExtended2017_writer.py index 8bce521afd069..bac4ff06b7188 100644 --- a/CondTools/Geometry/test/writehelpers/geometryExtended2017_writer.py +++ b/CondTools/Geometry/test/writehelpers/geometryExtended2017_writer.py @@ -28,12 +28,10 @@ XMLFileName = cms.untracked.string("./geSingleBigFile.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ), - ) - +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -52,7 +50,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2017_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), @@ -74,4 +71,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryExtended2018_writer.py b/CondTools/Geometry/test/writehelpers/geometryExtended2018_writer.py index f33159cafda70..17f5258d3dcb1 100644 --- a/CondTools/Geometry/test/writehelpers/geometryExtended2018_writer.py +++ b/CondTools/Geometry/test/writehelpers/geometryExtended2018_writer.py @@ -28,12 +28,10 @@ XMLFileName = cms.untracked.string("./geSingleBigFile.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ), - ) - +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -52,7 +50,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2018_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), @@ -74,4 +71,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryExtended2019_writer.py b/CondTools/Geometry/test/writehelpers/geometryExtended2019_writer.py index d0ba0193fc205..7b7b074fc0d2d 100644 --- a/CondTools/Geometry/test/writehelpers/geometryExtended2019_writer.py +++ b/CondTools/Geometry/test/writehelpers/geometryExtended2019_writer.py @@ -28,12 +28,11 @@ XMLFileName = cms.untracked.string("./geSingleBigFile.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ), - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -52,7 +51,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2019_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), @@ -74,4 +72,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryExtended2021_writer.py b/CondTools/Geometry/test/writehelpers/geometryExtended2021_writer.py index 5ff5cc970a3d3..889ba608efbc2 100644 --- a/CondTools/Geometry/test/writehelpers/geometryExtended2021_writer.py +++ b/CondTools/Geometry/test/writehelpers/geometryExtended2021_writer.py @@ -28,12 +28,11 @@ XMLFileName = cms.untracked.string("./geSingleBigFile.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ), - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder", fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -52,7 +51,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2021_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), @@ -74,4 +72,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryExtended2026_writer.py b/CondTools/Geometry/test/writehelpers/geometryExtended2026_writer.py index f29c611058db5..50e8ea2aca18c 100644 --- a/CondTools/Geometry/test/writehelpers/geometryExtended2026_writer.py +++ b/CondTools/Geometry/test/writehelpers/geometryExtended2026_writer.py @@ -28,12 +28,11 @@ XMLFileName = cms.untracked.string("./geD17SingleBigFile.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ), - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder", @@ -55,7 +54,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'), tag = cms.string('XMLFILE_Geometry_TagXX_Extended2026D41_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'), tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'), tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'), tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PHcalRcd'), tag = cms.string('HCALRECO_Geometry_TagXX')), @@ -78,4 +76,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter+process.GEMGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryrun2devwriter.py b/CondTools/Geometry/test/writehelpers/geometryrun2devwriter.py index dacce5040dd57..7e5822730b8fa 100644 --- a/CondTools/Geometry/test/writehelpers/geometryrun2devwriter.py +++ b/CondTools/Geometry/test/writehelpers/geometryrun2devwriter.py @@ -28,12 +28,11 @@ XMLFileName = cms.untracked.string('./geSingleBigFile.xml'), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -50,7 +49,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2015dev_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry2015dev_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry2015dev_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry2015dev_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry2015dev_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry2015dev_TagXX')), @@ -71,4 +69,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometryrun2writer.py b/CondTools/Geometry/test/writehelpers/geometryrun2writer.py index f3c3058fbaea0..ee2cfdfca37b4 100644 --- a/CondTools/Geometry/test/writehelpers/geometryrun2writer.py +++ b/CondTools/Geometry/test/writehelpers/geometryrun2writer.py @@ -28,12 +28,11 @@ XMLFileName = cms.untracked.string('./geSingleBigFile.xml'), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -50,7 +49,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended2015_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry2015_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry2015_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry2015_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry2015_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry2015_TagXX')), @@ -71,4 +69,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/geometrywriter.py b/CondTools/Geometry/test/writehelpers/geometrywriter.py index c6b230ad8a76f..5e1d6cff83b5e 100644 --- a/CondTools/Geometry/test/writehelpers/geometrywriter.py +++ b/CondTools/Geometry/test/writehelpers/geometrywriter.py @@ -28,12 +28,10 @@ XMLFileName = cms.untracked.string("./geSingleBigFile.xml"), ZIP = cms.untracked.bool(True) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) - +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.TrackerGeometryWriter = cms.EDAnalyzer("PGeometricDetBuilder",fromDD4hep=cms.bool(False)) -process.TrackerGeometryExtraWriter = cms.EDAnalyzer("PGeometricDetExtraBuilder",fromDD4hep=cms.bool(False)) process.TrackerParametersWriter = cms.EDAnalyzer("PTrackerParametersDBBuilder",fromDD4hep=cms.bool(False)) process.CaloGeometryWriter = cms.EDAnalyzer("PCaloGeometryBuilder") @@ -50,7 +48,6 @@ process.CondDB, toPut = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_TagXX_Extended_mc')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PTrackerParametersRcd'),tag = cms.string('TKParameters_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), @@ -71,4 +68,4 @@ input = cms.untracked.int32(1) ) -process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerGeometryExtraWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) +process.p1 = cms.Path(process.XMLGeometryWriter+process.TrackerGeometryWriter+process.TrackerParametersWriter+process.CaloGeometryWriter+process.HcalParametersWriter+process.CSCGeometryWriter+process.DTGeometryWriter+process.RPCGeometryWriter) diff --git a/CondTools/Geometry/test/writehelpers/splitExtended2016Database.sh b/CondTools/Geometry/test/writehelpers/splitExtended2016Database.sh index 1a8e80493ada5..438e2dd20f86e 100755 --- a/CondTools/Geometry/test/writehelpers/splitExtended2016Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitExtended2016Database.sh @@ -2,7 +2,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2016.db -t XMLFILE_Geometry_TagXX_Extended2016_mc -i XMLFILE_Geometry_TagXX_Extended2016_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry_TagXX -i TKRECO_Geometry_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry_TagXX -i TKExtra_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry_TagXX -i TKParameters_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry_TagXX -i EBRECO_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry_TagXX -i EERECO_Geometry_TagXX diff --git a/CondTools/Geometry/test/writehelpers/splitExtended2017Database.sh b/CondTools/Geometry/test/writehelpers/splitExtended2017Database.sh index 871ebaa826855..7848a2c7a58ee 100755 --- a/CondTools/Geometry/test/writehelpers/splitExtended2017Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitExtended2017Database.sh @@ -2,7 +2,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2017.db -t XMLFILE_Geometry_TagXX_Extended2017_mc -i XMLFILE_Geometry_TagXX_Extended2017_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry_TagXX -i TKRECO_Geometry_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry_TagXX -i TKExtra_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry_TagXX -i TKParameters_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry_TagXX -i EBRECO_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry_TagXX -i EERECO_Geometry_TagXX diff --git a/CondTools/Geometry/test/writehelpers/splitExtended2017Plan1Database.sh b/CondTools/Geometry/test/writehelpers/splitExtended2017Plan1Database.sh index 9f1ca724ec8c3..f0c0de75a5c72 100755 --- a/CondTools/Geometry/test/writehelpers/splitExtended2017Plan1Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitExtended2017Plan1Database.sh @@ -3,7 +3,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2017Plan1.db -t XMLFILE_Geometry_TagXX_Extended2017Plan1_mc -i XMLFILE_Geometry_TagXX_Extended2017Plan1_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2017Plan1ZeroMaterial.db -t XMLFILE_Geometry_TagXX_Extended2017Plan1ZeroMaterial_mc -i XMLFILE_Geometry_TagXX_Extended2017Plan1ZeroMaterial_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry_TagXX -i TKRECO_Geometry_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry_TagXX -i TKExtra_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry_TagXX -i TKParameters_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry_TagXX -i EBRECO_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry_TagXX -i EERECO_Geometry_TagXX diff --git a/CondTools/Geometry/test/writehelpers/splitExtended2018Database.sh b/CondTools/Geometry/test/writehelpers/splitExtended2018Database.sh index 7ee11fcdd874c..3c3f79bb1c726 100755 --- a/CondTools/Geometry/test/writehelpers/splitExtended2018Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitExtended2018Database.sh @@ -4,7 +4,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2018.d conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2018ZeroMaterial.db -t XMLFILE_Geometry_TagXX_Extended2018ZeroMaterial_mc -i XMLFILE_Geometry_TagXX_Extended2018ZeroMaterial_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2018DetailedCavern.db -t XMLFILE_Geometry_TagXX_Extended2018DetailedCavern_mc -i XMLFILE_Geometry_TagXX_Extended2018DetailedCavern_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry_TagXX -i TKRECO_Geometry_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry_TagXX -i TKExtra_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry_TagXX -i TKParameters_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry_TagXX -i EBRECO_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry_TagXX -i EERECO_Geometry_TagXX diff --git a/CondTools/Geometry/test/writehelpers/splitExtended2019Database.sh b/CondTools/Geometry/test/writehelpers/splitExtended2019Database.sh index 72f3d091f340e..8af6e5c04d6f4 100755 --- a/CondTools/Geometry/test/writehelpers/splitExtended2019Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitExtended2019Database.sh @@ -2,7 +2,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2019.db -t XMLFILE_Geometry_TagXX_Extended2019_mc -i XMLFILE_Geometry_TagXX_Extended2019_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry_TagXX -i TKRECO_Geometry_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry_TagXX -i TKExtra_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry_TagXX -i TKParameters_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry_TagXX -i EBRECO_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry_TagXX -i EERECO_Geometry_TagXX diff --git a/CondTools/Geometry/test/writehelpers/splitExtended2021Database.sh b/CondTools/Geometry/test/writehelpers/splitExtended2021Database.sh index c1f637ae36899..747889deb2a37 100755 --- a/CondTools/Geometry/test/writehelpers/splitExtended2021Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitExtended2021Database.sh @@ -2,7 +2,6 @@ conddb --yes --db myfile.db copy XMLFILE_Geometry_TagXX_Extended2021_mc --destdb GeometryFileExtended2021.db conddb --yes --db myfile.db copy TKRECO_Geometry_TagXX --destdb TKRECO_Geometry.db -conddb --yes --db myfile.db copy TKExtra_Geometry_TagXX --destdb TKExtra_Geometry.db conddb --yes --db myfile.db copy TKParameters_Geometry_TagXX --destdb TKParameters_Geometry.db conddb --yes --db myfile.db copy EBRECO_Geometry_TagXX --destdb EBRECO_Geometry.db conddb --yes --db myfile.db copy EERECO_Geometry_TagXX --destdb EERECO_Geometry.db diff --git a/CondTools/Geometry/test/writehelpers/splitExtended2026Database.sh b/CondTools/Geometry/test/writehelpers/splitExtended2026Database.sh index 8bc0d9d177a80..f03ac4e27bed4 100755 --- a/CondTools/Geometry/test/writehelpers/splitExtended2026Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitExtended2026Database.sh @@ -2,7 +2,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2026D41.db -t XMLFILE_Geometry_TagXX_Extended2026D41_mc -i XMLFILE_Geometry_TagXX_Extended2026D41_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry_TagXX -i TKRECO_Geometry_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry_TagXX -i TKExtra_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry_TagXX -i TKParameters_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry_TagXX -i EBRECO_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:HCALRECO_Geometry.db -t HCALRECO_Geometry_TagXX -i HCALRECO_Geometry_TagXX diff --git a/CondTools/Geometry/test/writehelpers/splitRun1Database.sh b/CondTools/Geometry/test/writehelpers/splitRun1Database.sh index a939e36ed7d91..e418a76b42a9f 100755 --- a/CondTools/Geometry/test/writehelpers/splitRun1Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitRun1Database.sh @@ -3,7 +3,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended.db -t conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtendedZeroMaterial.db -t XMLFILE_Geometry_TagXX_ExtendedZeroMaterial_mc -i XMLFILE_Geometry_TagXX_ExtendedZeroMaterial_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileIdeal.db -t XMLFILE_Geometry_TagXX_Ideal_mc -i XMLFILE_Geometry_TagXX_Ideal_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry_TagXX -i TKRECO_Geometry_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry_TagXX -i TKExtra_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry_TagXX -i TKParameters_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry_TagXX -i EBRECO_Geometry_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry_TagXX -i EERECO_Geometry_TagXX diff --git a/CondTools/Geometry/test/writehelpers/splitRun2Database.sh b/CondTools/Geometry/test/writehelpers/splitRun2Database.sh index 2935dfd2e0405..5cf1e13993b92 100755 --- a/CondTools/Geometry/test/writehelpers/splitRun2Database.sh +++ b/CondTools/Geometry/test/writehelpers/splitRun2Database.sh @@ -10,7 +10,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2015Fl conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2015FlatPlus05Percent.db -t XMLFILE_Geometry_TagXX_Extended2015FlatPlus05Percent_mc -i XMLFILE_Geometry_TagXX_Extended2015FlatPlus05Percent_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtended2015FlatPlus10Percent.db -t XMLFILE_Geometry_TagXX_Extended2015FlatPlus10Percent_mc -i XMLFILE_Geometry_TagXX_Extended2015FlatPlus10Percent_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry2015_TagXX -i TKRECO_Geometry2015_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry2015_TagXX -i TKExtra_Geometry2015_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry2015_TagXX -i TKParameters_Geometry2015_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry2015_TagXX -i EBRECO_Geometry2015_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry2015_TagXX -i EERECO_Geometry2015_TagXX diff --git a/CondTools/Geometry/test/writehelpers/splitRun2devDatabase.sh b/CondTools/Geometry/test/writehelpers/splitRun2devDatabase.sh index 8e93ce764b738..d02217b69f28f 100755 --- a/CondTools/Geometry/test/writehelpers/splitRun2devDatabase.sh +++ b/CondTools/Geometry/test/writehelpers/splitRun2devDatabase.sh @@ -5,7 +5,6 @@ conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtendedCastor conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtendedCastorSystMinus2015dev.db -t XMLFILE_Geometry_TagXX_ExtendedCastorSystMinus2015dev_mc -i XMLFILE_Geometry_TagXX_ExtendedCastorSystMinus2015dev_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:GeometryFileExtendedCastorSystPlus2015dev.db -t XMLFILE_Geometry_TagXX_ExtendedCastorSystPlus2015dev_mc -i XMLFILE_Geometry_TagXX_ExtendedCastorSystPlus2015dev_mc conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKRECO_Geometry.db -t TKRECO_Geometry2015dev_TagXX -i TKRECO_Geometry2015dev_TagXX -conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKExtra_Geometry.db -t TKExtra_Geometry2015dev_TagXX -i TKExtra_Geometry2015dev_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:TKParameters_Geometry.db -t TKParameters_Geometry2015dev_TagXX -i TKParameters_Geometry2015dev_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EBRECO_Geometry.db -t EBRECO_Geometry2015dev_TagXX -i EBRECO_Geometry2015dev_TagXX conddb_import -f sqlite_file:myfile.db -c sqlite_file:EERECO_Geometry.db -t EERECO_Geometry2015dev_TagXX -i EERECO_Geometry2015dev_TagXX diff --git a/Geometry/CaloEventSetup/test/runTestCaloGeometryLocalDB_cfg.py b/Geometry/CaloEventSetup/test/runTestCaloGeometryLocalDB_cfg.py index e23656c3a11ee..555bc67df2887 100644 --- a/Geometry/CaloEventSetup/test/runTestCaloGeometryLocalDB_cfg.py +++ b/Geometry/CaloEventSetup/test/runTestCaloGeometryLocalDB_cfg.py @@ -30,7 +30,6 @@ cms.PSet(record = cms.string('CSCRecoDigiParametersRcd'),tag = cms.string('CSCRECODIGI_Geometry_TagXX')), cms.PSet(record = cms.string('DTRecoGeometryRcd'), tag = cms.string('DTRECO_Geometry_TagXX')), cms.PSet(record = cms.string('IdealGeometryRecord'), tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'), tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PZdcRcd'), tag = cms.string('ZDCRECO_Geometry_TagXX')), cms.PSet(record = cms.string('RPCRecoGeometryRcd'), tag = cms.string('RPCRECO_Geometry_TagXX')) ) diff --git a/Geometry/Records/doc/Records.doc b/Geometry/Records/doc/Records.doc deleted file mode 100644 index d16f4e9123b72..0000000000000 --- a/Geometry/Records/doc/Records.doc +++ /dev/null @@ -1,76 +0,0 @@ - -/*! - -\page Geometry_Records Package Geometry/Records - -<center> -<small> - -<!-- @CVS_TAG@ will be substituted at build time, no need to touch --> -<a href=http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/Geometry/Records/?cvsroot=CMSSW&only_with_tag=@CVS_TAG@>Source code (CVS tag: @CVS_TAG@)</a> - -<a href=http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/Geometry/Records/.admin/developers?rev=HEAD&cvsroot=CMSSW&content-type=text/vnd.viewcvs-markup>Administrative privileges</a> -</small> -</center> - -\section desc Description -<!-- Short description of what this package is supposed to provide --> - -(THE PACKAGE ADMINISTATOR SHOULD REPLACE THIS SENTENCE WITH HAND-WRITTEN DOCUMENTATION SAYING WHAT THE PACKAGE DOES.) - -\subsection interface Public interface -<!-- List the classes that are provided for use in other packages (if any) --> - -- CSCRecoDigiParametersRcd -- CSCRecoGeometryRcd -- CaloGeometryRecord -- CaloTopologyRecord -- CaloTowerGeometryRecord -- CastorGeometryRecord -- DTRecoGeometryRcd -- EcalBarrelGeometryRecord -- EcalEndcapGeometryRecord -- EcalGeometryDescriptionRcd -- EcalPreshowerGeometryRecord -- GeometricDetExtraRcd -- GeometryFileRcd -- GlobalTrackingGeometryRecord -- HcalGeometryRecord -- IdealGeometryRecord -- MuonGeometryRecord -- MuonNumberingRecord -- PCaloTowerRcd -- PCastorRcd -- PEcalBarrelRcd -- PEcalEndcapRcd -- PEcalPreshowerRcd -- PGeometricDetExtraRcd -- PHcalRcd -- PZdcRcd -- RPCRecoGeometryRcd -- TrackerDigiGeometryRecord -- ZDCGeometryRecord - - -\subsection pluginai Plugins -<!-- List the plugins that are provided for use in other packages (if any) --> - - - - -\subsection modules Modules -<!-- Describe modules implemented in this package and their parameter set --> - - -\subsection tests Unit tests and examples -<!-- Describe cppunit tests and example configuration files --> -Unknown - -\section status Status and planned development -<!-- e.g. completed, stable, missing features --> -Unknown - -<hr> -Last updated: -@DATE@ Author: computer-generated. -*/ - diff --git a/Geometry/Records/interface/IdealGeometryRecord.h b/Geometry/Records/interface/IdealGeometryRecord.h index 0fbf2769ce72f..b85ab470d495a 100644 --- a/Geometry/Records/interface/IdealGeometryRecord.h +++ b/Geometry/Records/interface/IdealGeometryRecord.h @@ -20,13 +20,11 @@ #include "FWCore/Framework/interface/DependentRecordImplementation.h" #include "Geometry/Records/interface/GeometryFileRcd.h" -#include "Geometry/Records/interface/PGeometricDetExtraRcd.h" #include "Geometry/Records/interface/PGeometricTimingDetExtraRcd.h" #include "FWCore/Utilities/interface/mplVector.h" -class IdealGeometryRecord - : public edm::eventsetup::DependentRecordImplementation< - IdealGeometryRecord, - edm::mpl::Vector<GeometryFileRcd, PGeometricDetExtraRcd, PGeometricTimingDetExtraRcd> > {}; +class IdealGeometryRecord : public edm::eventsetup::DependentRecordImplementation< + IdealGeometryRecord, + edm::mpl::Vector<GeometryFileRcd, PGeometricTimingDetExtraRcd> > {}; #endif /* RECORDS_IDEALGEOMETRYRECORD_H */ diff --git a/Geometry/Records/interface/PGeometricDetExtraRcd.h b/Geometry/Records/interface/PGeometricDetExtraRcd.h deleted file mode 100644 index 3d1334129f095..0000000000000 --- a/Geometry/Records/interface/PGeometricDetExtraRcd.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef PGeometricDetExtraRcd_H -#define PGeometricDetExtraRcd_H - -#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" -class PGeometricDetExtraRcd : public edm::eventsetup::EventSetupRecordImplementation<PGeometricDetExtraRcd> {}; -#endif diff --git a/Geometry/Records/src/PGeometricDetExtraRcd.cc b/Geometry/Records/src/PGeometricDetExtraRcd.cc deleted file mode 100644 index 6dd3bac9c21ab..0000000000000 --- a/Geometry/Records/src/PGeometricDetExtraRcd.cc +++ /dev/null @@ -1,4 +0,0 @@ -#include "Geometry/Records/interface/PGeometricDetExtraRcd.h" -#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" - -EVENTSETUP_RECORD_REG(PGeometricDetExtraRcd); diff --git a/Geometry/TrackerGeometryBuilder/python/trackerModuleInfo_cfg.py b/Geometry/TrackerGeometryBuilder/python/trackerModuleInfo_cfg.py index 615dc96c7f616..685edae2385ae 100644 --- a/Geometry/TrackerGeometryBuilder/python/trackerModuleInfo_cfg.py +++ b/Geometry/TrackerGeometryBuilder/python/trackerModuleInfo_cfg.py @@ -10,10 +10,9 @@ process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi") process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") -#this is always needed if users want access to the vector<GeometricDetExtra> -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.source = cms.Source("EmptySource") diff --git a/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc b/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc index 7980a5e5c6536..eea723d52dd32 100644 --- a/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc +++ b/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc @@ -100,14 +100,10 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup // get the GeometricDet // edm::ESHandle<GeometricDet> rDD; - edm::ESHandle<std::vector<GeometricDetExtra> > rDDE; iSetup.get<IdealGeometryRecord>().get(rDD); - iSetup.get<IdealGeometryRecord>().get(rDDE); edm::LogInfo("ModuleInfo") << " Top node is " << rDD.product() << " " << rDD.product()->name() << std::endl; edm::LogInfo("ModuleInfo") << " And Contains Daughters: " << rDD.product()->deepComponents().size() << std::endl; - CmsTrackerDebugNavigator nav(*rDDE.product()); - nav.dump(*rDD.product(), *rDDE.product()); // //first instance tracking geometry edm::ESHandle<TrackerGeometry> pDD; @@ -153,45 +149,13 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup unsigned int tec_r5_sterN = 0; unsigned int tec_r6_rphiN = 0; unsigned int tec_r7_rphiN = 0; - // - double volume_total = 0.0; - double weight_total = 0.0; - double activeSurface_total = 0.0; - double volume_pxb = 0.0; - double weight_pxb = 0.0; - double activeSurface_pxb = 0.0; - double volume_pxf = 0.0; - double weight_pxf = 0.0; - double activeSurface_pxf = 0.0; - double volume_tib = 0.0; - double weight_tib = 0.0; - double activeSurface_tib = 0.0; - double volume_tid = 0.0; - double weight_tid = 0.0; - double activeSurface_tid = 0.0; - double volume_tob = 0.0; - double weight_tob = 0.0; - double activeSurface_tob = 0.0; - double volume_tec = 0.0; - double weight_tec = 0.0; - double activeSurface_tec = 0.0; - // std::vector<const GeometricDet*> modules = (*rDD).deepComponents(); Output << "************************ List of modules with positions ************************" << std::endl; - // MEC: 2010-04-13: need to find corresponding GeometricDetExtra. - std::vector<GeometricDetExtra>::const_iterator gdei(rDDE->begin()), gdeEnd(rDDE->end()); + for (auto& module : modules) { unsigned int rawid = module->geographicalId().rawId(); DetId id(rawid); - gdei = rDDE->begin(); - for (; gdei != gdeEnd; ++gdei) { - if (gdei->geographicalId() == module->geographicalId()) - break; - } - - if (gdei == gdeEnd) - throw cms::Exception("ModuleInfo") << "THERE IS NO MATCHING DetId in the GeometricDetExtra"; //THIS never happens! GeometricDet::NavRange detPos = module->navpos(); Output << std::fixed << std::setprecision(6); // set as default 6 decimal digits @@ -202,22 +166,12 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup } Output << std::endl; int subdetid = module->geographicalId().subdetId(); - double volume = gdei->volume() / 1000; // mm3->cm3 - double density = gdei->density() / density_units; - double weight = gdei->weight() / density_units / 1000.; // [kg], hence the factor 1000; double thickness = module->bounds()->thickness() * 10000; // cm-->um - double activeSurface = volume / (thickness / 10000); // cm2 (thickness in um) - volume_total += volume; - weight_total += weight; - activeSurface_total += activeSurface; switch (subdetid) { // PXB case PixelSubdetector::PixelBarrel: { pxbN++; - volume_pxb += volume; - weight_pxb += weight; - activeSurface_pxb += activeSurface; const std::string& name = module->name(); if (name == "PixelBarrelActiveFull") pxb_fullN++; @@ -231,20 +185,12 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup << "\t" << "Layer " << theLayer << " Ladder " << theLadder << "\t" << " module " << theModule << " " << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name() << std::endl; - } else { - Output << " NO DDD Hierarchy available " << std::endl; - } break; } // PXF case PixelSubdetector::PixelEndcap: { pxfN++; - volume_pxf += volume; - weight_pxf += weight; - activeSurface_pxf += activeSurface; const std::string& name = module->name(); if (name == "PixelForwardActive1x2") pxf_1x2N++; @@ -265,20 +211,12 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " PXF" << side << "\t" << "Disk " << theDisk << " Blade " << theBlade << " Panel " << thePanel << "\t" << " module " << theModule << "\t" << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name() << std::endl; - } else { - Output << " NO DDD Hierarchy available " << std::endl; - } break; } // TIB case StripSubdetector::TIB: { tibN++; - volume_tib += volume; - weight_tib += weight; - activeSurface_tib += activeSurface; const std::string& name = module->name(); if (name == "TIBActiveRphi0") tib_L12_rphiN++; @@ -298,11 +236,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup << "Layer " << theLayer << " " << part << "\t" << "string " << theString[2] << "\t" << " module " << theModule << " " << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } Output << " " << module->translation().X() << " \t" << module->translation().Y() << " \t" << module->translation().Z() << std::endl; break; @@ -311,9 +244,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup // TID case StripSubdetector::TID: { tidN++; - volume_tid += volume; - weight_tid += weight; - activeSurface_tid += activeSurface; const std::string& name = module->name(); if (name == "TIDModule0RphiActive") tid_r1_rphiN++; @@ -334,11 +264,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " TID" << side << "\t" << "Disk " << theDisk << " Ring " << theRing << " " << part << "\t" << " module " << tTopo->tidModule(id) << "\t" << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } Output << " " << module->translation().X() << " \t" << module->translation().Y() << " \t" << module->translation().Z() << std::endl; break; @@ -347,9 +272,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup // TOB case StripSubdetector::TOB: { tobN++; - volume_tob += volume; - weight_tob += weight; - activeSurface_tob += activeSurface; const std::string& name = module->name(); if (name == "TOBActiveRphi0") tob_L12_rphiN++; @@ -368,11 +290,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " TOB" << side << "\t" << "Layer " << theLayer << "\t" << "rod " << tTopo->tobRod(id) << " module " << theModule << "\t" << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } Output << " " << module->translation().X() << " \t" << module->translation().Y() << " \t" << module->translation().Z() << std::endl; break; @@ -381,9 +298,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup // TEC case StripSubdetector::TEC: { tecN++; - volume_tec += volume; - weight_tec += weight; - activeSurface_tec += activeSurface; const std::string& name = module->name(); if (name == "TECModule0RphiActive") tec_r1_rphiN++; @@ -417,11 +331,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup << "\t" << "\t" << " module " << theModule << "\t" << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } Output << " " << module->translation().X() << " \t" << module->translation().Y() << " \t" << module->translation().Z() << std::endl; @@ -507,11 +416,7 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup // Output: set as default 4 decimal digits (0.1 um or 0.1 deg/rad) // active area center Output << "\t" - << "volume " << std::fixed << std::setprecision(3) << volume << " cm3 \t" - << "density " << std::fixed << std::setprecision(3) << density << " g/cm3 \t" - << "weight " << std::fixed << std::setprecision(6) << weight << " kg \t" - << "thickness " << std::fixed << std::setprecision(0) << thickness << " um \t" - << " active area " << std::fixed << std::setprecision(2) << activeSurface << " cm2" << std::endl; + << "thickness " << std::fixed << std::setprecision(0) << thickness << " um \n"; Output << "\tActive Area Center" << std::endl; Output << "\t O = (" << std::fixed << std::setprecision(4) << module->translation().X() << "," << std::fixed << std::setprecision(4) << module->translation().Y() << "," << std::fixed << std::setprecision(4) @@ -595,9 +500,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " Full = " << pxb_fullN << std::endl; Output << " Half = " << pxb_halfN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_pxb << " kg" << std::endl; - Output << " Volume = " << volume_pxb << " cm3" << std::endl; - Output << " Surface = " << activeSurface_pxb << " cm2" << std::endl; Output << " PSI46s = " << psi_pxb << std::endl; Output << " channels = " << chan_pxb << std::endl; Output << " PXF = " << pxfN << std::endl; @@ -607,9 +509,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " 2x4 = " << pxf_2x4N << std::endl; Output << " 2x5 = " << pxf_2x5N << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_pxf << " kg" << std::endl; - Output << " Volume = " << volume_pxf << " cm3" << std::endl; - Output << " Surface = " << activeSurface_pxf << " cm2" << std::endl; Output << " PSI46s = " << psi_pxf << std::endl; Output << " channels = " << chan_pxf << std::endl; Output << " TIB = " << tibN << std::endl; @@ -617,9 +516,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " L12 stereo = " << tib_L12_sterN << std::endl; Output << " L34 = " << tib_L34_rphiN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tib << " kg" << std::endl; - Output << " Volume = " << volume_tib << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tib << " cm2" << std::endl; Output << " APV25s = " << apv_tib << std::endl; Output << " channels = " << chan_tib << std::endl; Output << " TID = " << tidN << std::endl; @@ -629,10 +525,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " r2 stereo = " << tid_r2_sterN << std::endl; Output << " r3 rphi = " << tid_r3_rphiN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tid << " kg" << std::endl; - Output << " Volume = " << volume_tid << " cm3" << std::endl; - ; - Output << " Surface = " << activeSurface_tid << " cm2" << std::endl; Output << " APV25s = " << apv_tid << std::endl; Output << " channels = " << chan_tid << std::endl; Output << " TOB = " << tobN << std::endl; @@ -641,9 +533,6 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " L34 = " << tob_L34_rphiN << std::endl; Output << " L56 = " << tob_L56_rphiN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tob << " kg" << std::endl; - Output << " Volume = " << volume_tob << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tob << " cm2" << std::endl; Output << " APV25s = " << apv_tob << std::endl; Output << " channels = " << chan_tob << std::endl; Output << " TEC = " << tecN << std::endl; @@ -658,15 +547,9 @@ void ModuleInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup Output << " r6 rphi = " << tec_r6_rphiN << std::endl; Output << " r7 rphi = " << tec_r7_rphiN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tec << " kg" << std::endl; - Output << " Volume = " << volume_tec << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tec << " cm2" << std::endl; Output << " APV25s = " << apv_tec << std::endl; Output << " channels = " << chan_tec << std::endl; Output << "---------------------" << std::endl; - Output << " Total Weight = " << weight_total << " kg" << std::endl; - Output << " Total Volume = " << volume_total << " cm3" << std::endl; - Output << " Total Active Area = " << activeSurface_total << " cm2" << std::endl; Output << " PSI46s = " << psi_tot << std::endl; Output << " APV25s = " << apv_tot << std::endl; Output << " pixel channels = " << chan_pixel << std::endl; diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDB_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDB_cfg.py index 40c2d4b21add9..e068437e701eb 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDB_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDB_cfg.py @@ -11,10 +11,10 @@ process.source = cms.Source("EmptySource") -#this is always needed if users want access to the vector<GeometricDetExtra> -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( False ) - ) + +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( False ) + ) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py index b5b1995abd31d..6f5e8f5d5e000 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py @@ -10,9 +10,9 @@ process.load('Geometry.TrackerGeometryBuilder.trackerParameters_cfi') process.load('Geometry.TrackerNumberingBuilder.trackerTopology_cfi') -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") @@ -36,7 +36,6 @@ TrackerNumberingBuilder = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), TrackerGeometryBuilder = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), ModuleInfo = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), - CmsTrackerDebugNavigator =cms.untracked.PSet( limit = cms.untracked.int32(-1) ) ) process.prod = cms.EDAnalyzer("ModuleInfo", diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py index b56b4ce0c7e6b..5276ccd84aa23 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py @@ -7,9 +7,9 @@ process.source = cms.Source("EmptySource") -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") diff --git a/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDB_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDB_cfg.py index 09e949ad73f02..03bf8d9e00c04 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDB_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/trackerModuleInfoLocalDB_cfg.py @@ -14,16 +14,16 @@ input = cms.untracked.int32(1) ) -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( False ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( False ) + ) + process.CondDB.timetype = cms.untracked.string('runnumber') process.CondDB.connect = cms.string('sqlite_file:myfile.db') process.PoolDBESSourceGeometry = cms.ESSource("PoolDBESSource", process.CondDB, toGet = cms.VPSet(cms.PSet(record = cms.string('GeometryFileRcd'),tag = cms.string('XMLFILE_Geometry_Extended_TagXX')), cms.PSet(record = cms.string('IdealGeometryRecord'),tag = cms.string('TKRECO_Geometry_TagXX')), - cms.PSet(record = cms.string('PGeometricDetExtraRcd'),tag = cms.string('TKExtra_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalBarrelRcd'), tag = cms.string('EBRECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalEndcapRcd'), tag = cms.string('EERECO_Geometry_TagXX')), cms.PSet(record = cms.string('PEcalPreshowerRcd'),tag = cms.string('EPRECO_Geometry_TagXX')), diff --git a/Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h b/Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h deleted file mode 100644 index 44a8fb87974df..0000000000000 --- a/Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef Geometry_TrackerNumberingBuilder_CmsTrackerDebugNavigator_H -#define Geometry_TrackerNumberingBuilder_CmsTrackerDebugNavigator_H - -#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h" - -#include <vector> - -class GeometricDet; -/** - * This class travel recursively a GeometricDet and dumps the information about type - */ -class CmsTrackerDebugNavigator { -public: - CmsTrackerDebugNavigator(const std::vector<GeometricDetExtra>&); - void dump(const GeometricDet&, const std::vector<GeometricDetExtra>&); - -private: - void iterate(const GeometricDet&, int, const std::vector<GeometricDetExtra>&); - int numinstances[30]; - CmsTrackerStringToEnum _CmsTrackerStringToEnum; - std::map<uint32_t, const GeometricDetExtra*> _helperMap; -}; - -#endif diff --git a/Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h b/Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h deleted file mode 100644 index 21c52daac7317..0000000000000 --- a/Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef Geometry_TrackerNumberingBuilder_GeometricDetExtra_H -#define Geometry_TrackerNumberingBuilder_GeometricDetExtra_H - -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" -#include "DetectorDescription/Core/interface/DDExpandedView.h" -#include "DataFormats/DetId/interface/DetId.h" - -#include <vector> -#include "FWCore/ParameterSet/interface/types.h" - -#include <ext/pool_allocator.h> -/** - * Composite class GeometricDetExtra. A composite can contain other composites, and so on; - * You can understand what you are looking at via enum. - */ - -class GeometricDetExtra { -public: -#ifdef PoolAlloc - using GeoHistory = std::vector<DDExpandedNode, PoolAlloc<DDExpandedNode> >; -#else - using GeoHistory = std::vector<DDExpandedNode>; -#endif - /** - * Constructors to be used when looping over DDD - */ - explicit GeometricDetExtra(GeometricDet const* gd, - DetId id, - GeoHistory& gh, - double vol, - double dens, - double wgt, - double cpy, - const std::string& mat, - const std::string& name, - bool dd = false); - - /** - * get and set associated GeometricDet - * DOES NO CHECKING! - */ - GeometricDet const* geometricDet() const { return _mygd; } - - /** - * set or add or clear components - */ - void setGeographicalId(DetId id) { _geographicalId = id; } - DetId geographicalId() const { return _geographicalId; } - GeoHistory const& parents() const { return _parents; } - int copyno() const { return _copy; } - double volume() const { return _volume; } - double density() const { return _density; } - double weight() const { return _weight; } - std::string const& material() const { return _material; } - - /** - * what it says... used the DD in memory model to build the geometry... or not. - */ - bool wasBuiltFromDD() const { return _fromDD; } - - std::string const& name() const { return _name; } - -private: - /** Data members **/ - - GeometricDet const* _mygd; - DetId _geographicalId; - GeoHistory _parents; - double _volume; - double _density; - double _weight; - int _copy; - std::string _material; - std::string _name; - bool _fromDD; // may not need this, keep an eye on it. -}; - -#undef PoolAlloc -#endif diff --git a/Geometry/TrackerNumberingBuilder/plugins/TrackerGeometricDetExtraESModule.cc b/Geometry/TrackerNumberingBuilder/plugins/TrackerGeometricDetExtraESModule.cc deleted file mode 100644 index fd66ec38807bc..0000000000000 --- a/Geometry/TrackerNumberingBuilder/plugins/TrackerGeometricDetExtraESModule.cc +++ /dev/null @@ -1,267 +0,0 @@ -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESTransientHandle.h" -#include "FWCore/Framework/interface/ModuleFactory.h" -#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" -#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h" -#include "CondFormats/GeometryObjects/interface/PGeometricDet.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h" -#include "Geometry/TrackerNumberingBuilder/plugins/DDDCmsTrackerContruction.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/Records/interface/PGeometricDetExtraRcd.h" -#include "DetectorDescription/Core/interface/DDCompactView.h" -#include "DetectorDescription/Core/interface/DDSolid.h" -#include "DetectorDescription/Core/interface/DDMaterial.h" -#include "DetectorDescription/DDCMS/interface/DDCompactView.h" -#include "ExtractStringFromDDD.h" -#include "CondDBCmsTrackerConstruction.h" - -#include <memory> - -class TrackerGeometricDetExtraESModule : public edm::ESProducer { -public: - TrackerGeometricDetExtraESModule(const edm::ParameterSet& p); - - std::unique_ptr<std::vector<GeometricDetExtra> > produce(const IdealGeometryRecord&); - - static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - -private: - void putOne(std::vector<GeometricDetExtra>& gde, const GeometricDet* gd, const DDExpandedView& ev, int lev); - - edm::ESGetToken<GeometricDet, IdealGeometryRecord> geometricDetToken_; - edm::ESGetToken<DDCompactView, IdealGeometryRecord> ddToken_; - edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord> dd4hepToken_; - edm::ESGetToken<PGeometricDetExtra, PGeometricDetExtraRcd> pgToken_; - const bool fromDDD_; - const bool fromDD4hep_; -}; - -using namespace edm; - -TrackerGeometricDetExtraESModule::TrackerGeometricDetExtraESModule(const edm::ParameterSet& p) - : fromDDD_(p.getParameter<bool>("fromDDD")), fromDD4hep_(p.getParameter<bool>("fromDD4hep")) { - auto c = setWhatProduced(this); - geometricDetToken_ = c.consumes<GeometricDet>(edm::ESInputTag()); - if (fromDDD_) { - ddToken_ = c.consumes<DDCompactView>(edm::ESInputTag()); - } else if (fromDD4hep_) { - dd4hepToken_ = c.consumes<cms::DDCompactView>(edm::ESInputTag()); - } else { - pgToken_ = c.consumesFrom<PGeometricDetExtra, PGeometricDetExtraRcd>(edm::ESInputTag()); - } -} - -void TrackerGeometricDetExtraESModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - edm::ParameterSetDescription descDB; - descDB.add<bool>("fromDDD", false); - descDB.add<bool>("fromDD4hep", false); - descriptions.add("trackerNumberingExtraGeometryDB", descDB); - - edm::ParameterSetDescription desc; - desc.add<bool>("fromDDD", true); - desc.add<bool>("fromDD4hep", false); - descriptions.add("trackerNumberingExtraGeometry", desc); - - edm::ParameterSetDescription descDD4hep; - descDD4hep.add<bool>("fromDDD", false); - descDD4hep.add<bool>("fromDD4hep", true); - descriptions.add("DD4hep_trackerNumberingExtraGeometry", descDD4hep); -} - -std::unique_ptr<std::vector<GeometricDetExtra> > TrackerGeometricDetExtraESModule::produce( - const IdealGeometryRecord& iRecord) { - auto gde = std::make_unique<std::vector<GeometricDetExtra> >(); - // get the GeometricDet which has a nav_type - GeometricDet const& gd = iRecord.get(geometricDetToken_); - if (fromDDD_) { - // traverse all components from the tracker down; - // read the DD if from DD - const GeometricDet* tracker = &(gd); - edm::ESTransientHandle<DDCompactView> cpv = iRecord.getTransientHandle(ddToken_); - DDExpandedView ev(*cpv); - ev.goTo(tracker->navType()); - putOne((*gde), tracker, ev, 0); - std::vector<const GeometricDet*> tc = tracker->components(); - std::vector<const GeometricDet*>::const_iterator git = tc.begin(); - std::vector<const GeometricDet*>::const_iterator egit = tc.end(); - int count = 0; - int lev = 1; - // CmsTrackerStringToEnum ctst - gde->reserve(tracker->deepComponents().size()); - for (; git != egit; ++git) { // one level below "tracker" - ev.goTo((*git)->navType()); - putOne((*gde), *git, ev, lev); - std::vector<const GeometricDet*> inone = (*git)->components(); - // std::cout << lev << " type " << (*git)->type() << " " << int((*git)->geographicalId()) << std::endl; // << " has " << inone.size() << " components." << std::endl; - if (inone.empty()) - ++count; - std::vector<const GeometricDet*>::const_iterator git2 = inone.begin(); - std::vector<const GeometricDet*>::const_iterator egit2 = inone.end(); - ++lev; - for (; git2 != egit2; ++git2) { // level 2 - ev.goTo((*git2)->navType()); - putOne((*gde), *git2, ev, lev); - std::vector<const GeometricDet*> intwo = (*git2)->components(); - // std::cout << lev << "\ttype " << (*git2)->type() << " " << int((*git2)->geographicalId()) << std::endl; // << " has " << intwo.size() << " components." << std::endl; - if (intwo.empty()) - ++count; - std::vector<const GeometricDet*>::const_iterator git3 = intwo.begin(); - std::vector<const GeometricDet*>::const_iterator egit3 = intwo.end(); - ++lev; - for (; git3 != egit3; ++git3) { // level 3 - ev.goTo((*git3)->navType()); - putOne((*gde), *git3, ev, lev); - std::vector<const GeometricDet*> inthree = (*git3)->components(); - //std::cout << lev << "\t\ttype " << (*git3)->type() << " " << int((*git3)->geographicalId()) << std::endl; // << " has " << inthree.size() << " components." << std::endl; - if (inthree.empty()) - ++count; - std::vector<const GeometricDet*>::const_iterator git4 = inthree.begin(); - std::vector<const GeometricDet*>::const_iterator egit4 = inthree.end(); - ++lev; - for (; git4 != egit4; ++git4) { //level 4 - ev.goTo((*git4)->navType()); - putOne((*gde), *git4, ev, lev); - std::vector<const GeometricDet*> infour = (*git4)->components(); - // std::cout << lev << "\t\t\ttype " << (*git4)->type() << " " << int((*git4)->geographicalId()) << std::endl; // << " has " << infour.size() << " components." << std::endl; - if (infour.empty()) - ++count; - std::vector<const GeometricDet*>::const_iterator git5 = infour.begin(); - std::vector<const GeometricDet*>::const_iterator egit5 = infour.end(); - ++lev; - for (; git5 != egit5; ++git5) { // level 5 - ev.goTo((*git5)->navType()); - putOne((*gde), *git5, ev, lev); - std::vector<const GeometricDet*> infive = (*git5)->components(); - // std::cout << lev << "\t\t\t\ttype " << (*git5)->type() << " " << int((*git5)->geographicalId()) << std::endl; // << " has " << infive.size() << " components." << std::endl; - if (infive.empty()) - ++count; - std::vector<const GeometricDet*>::const_iterator git6 = infive.begin(); - std::vector<const GeometricDet*>::const_iterator egit6 = infive.end(); - ++lev; - for (; git6 != egit6; ++git6) { //level 6 - ev.goTo((*git6)->navType()); - putOne((*gde), *git6, ev, lev); - std::vector<const GeometricDet*> insix = (*git6)->components(); - // std::cout << lev << "\t\t\t\t\ttype " << (*git6)->type() << " " << int((*git6)->geographicalId()) << std::endl; // << " has " << insix.size() << " components." << std::endl; - if (insix.empty()) { - ++count; - } else { - edm::LogError("GeometricDetExtra") << "Hierarchy has exceeded hard-coded level 6 for Tracker "; - } - } // level 6 - --lev; - } // level 5 - --lev; - } // level 4 - --lev; - } //level 3 - --lev; - } // level 2 - --lev; - } - } else if (fromDD4hep_) { - // FIXME: - // traverse all components from the tracker down; - // read the DD if from DD - const GeometricDet* tracker = &(gd); - edm::ESTransientHandle<cms::DDCompactView> cpv = iRecord.getTransientHandle(dd4hepToken_); - edm::LogInfo("GeometricDetExtra") << " Top node is " << tracker << " " << tracker->name() << std::endl; - edm::LogInfo("GeometricDetExtra") << " radLength " << tracker->radLength() << "\n" - << " xi " << tracker->xi() << "\n" - << " PixelROCRows " << tracker->pixROCRows() << "\n" - << " PixROCCols " << tracker->pixROCCols() << "\n" - << " PixelROC_X " << tracker->pixROCx() << "\n" - << " PixelROC_Y " << tracker->pixROCy() << "\n" - << "TrackerStereoDetectors " << (tracker->stereo() ? "true" : "false") << "\n" - << "SiliconAPVNumber " << tracker->siliconAPVNum() << "\n"; - } else { - // if it is not from the DD, then just get the GDE from ES and match w/ GD. - PGeometricDetExtra const& pgde = iRecord.getRecord<PGeometricDetExtraRcd>().get(pgToken_); - std::map<uint32_t, const GeometricDet*> helperMap; - const GeometricDet* tracker = &gd; - helperMap[gd.geographicalId()] = tracker; - std::vector<const GeometricDet*> tc = tracker->components(); - std::vector<const GeometricDet*>::const_iterator git = tc.begin(); - std::vector<const GeometricDet*>::const_iterator egit = tc.end(); - for (; git != egit; ++git) { // one level below "tracker" - helperMap[(*git)->geographicalId()] = (*git); - std::vector<const GeometricDet*> inone = (*git)->components(); - std::vector<const GeometricDet*>::const_iterator git2 = inone.begin(); - std::vector<const GeometricDet*>::const_iterator egit2 = inone.end(); - for (; git2 != egit2; ++git2) { // level 2 - helperMap[(*git2)->geographicalId()] = (*git2); - std::vector<const GeometricDet*> intwo = (*git2)->components(); - std::vector<const GeometricDet*>::const_iterator git3 = intwo.begin(); - std::vector<const GeometricDet*>::const_iterator egit3 = intwo.end(); - for (; git3 != egit3; ++git3) { // level 3 - helperMap[(*git3)->geographicalId()] = (*git3); - std::vector<const GeometricDet*> inthree = (*git3)->components(); - std::vector<const GeometricDet*>::const_iterator git4 = inthree.begin(); - std::vector<const GeometricDet*>::const_iterator egit4 = inthree.end(); - for (; git4 != egit4; ++git4) { //level 4 - helperMap[(*git4)->geographicalId()] = (*git4); - std::vector<const GeometricDet*> infour = (*git4)->components(); - std::vector<const GeometricDet*>::const_iterator git5 = infour.begin(); - std::vector<const GeometricDet*>::const_iterator egit5 = infour.end(); - for (; git5 != egit5; ++git5) { // level 5 - helperMap[(*git5)->geographicalId()] = (*git5); - std::vector<const GeometricDet*> infive = (*git5)->components(); - std::vector<const GeometricDet*>::const_iterator git6 = infive.begin(); - std::vector<const GeometricDet*>::const_iterator egit6 = infive.end(); - for (; git6 != egit6; ++git6) { //level 6 - helperMap[(*git6)->geographicalId()] = (*git6); - if (!(*git6)->components().empty()) { - edm::LogError("GeometricDetExtra") << "Hierarchy has exceeded hard-coded level of 6 for Tracker "; - } - } // level 6 - } // level 5 - } // level 4 - } //level 3 - } // level 2 - } - - const std::vector<PGeometricDetExtra::Item>& pgdes = pgde.pgdes_; - gde->reserve(pgdes.size()); - std::vector<DDExpandedNode> evs; //EMPTY - std::string nm; //EMPTY - for (const auto& pgde : pgdes) { - // GeometricDetExtra( GeometricDet const *gd, DetId id, GeoHistory& gh, double vol, double dens, double wgt, double cpy, const std::string& mat, const std::string& name, bool dd=false ); - gde->emplace_back(GeometricDetExtra(helperMap[pgde._geographicalId], - pgde._geographicalId, - evs, - pgde._volume, - pgde._density, - pgde._weight, - pgde._copy, - pgde._material, - nm)); - } - } - return gde; -} - -void TrackerGeometricDetExtraESModule::putOne(std::vector<GeometricDetExtra>& gde, - const GeometricDet* gd, - const DDExpandedView& ev, - int lev) { - std::string matname = ((ev.logicalPart()).material()).name().fullname(); - std::string lpname = ((ev.logicalPart()).name().fullname()); - std::vector<DDExpandedNode> evs = GeometricDetExtra::GeoHistory(ev.geoHistory().begin(), ev.geoHistory().end()); - gde.emplace_back( - GeometricDetExtra(gd, - gd->geographicalId(), - evs, - ((ev.logicalPart()).solid()).volume(), - ((ev.logicalPart()).material()).density(), - ((ev.logicalPart()).material()).density() * (((ev.logicalPart()).solid()).volume() / 1000.), - ev.copyno(), - matname, - lpname, - true)); -} - -DEFINE_FWK_EVENTSETUP_MODULE(TrackerGeometricDetExtraESModule); diff --git a/Geometry/TrackerNumberingBuilder/src/CmsTrackerDebugNavigator.cc b/Geometry/TrackerNumberingBuilder/src/CmsTrackerDebugNavigator.cc deleted file mode 100644 index 09538228aa6cd..0000000000000 --- a/Geometry/TrackerNumberingBuilder/src/CmsTrackerDebugNavigator.cc +++ /dev/null @@ -1,47 +0,0 @@ -#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -CmsTrackerDebugNavigator::CmsTrackerDebugNavigator(const std::vector<GeometricDetExtra>& gdes) { - std::vector<GeometricDetExtra>::const_iterator gdeiEnd(gdes.end()); - std::vector<GeometricDetExtra>::const_iterator gdei(gdes.begin()); - for (; gdei != gdeiEnd; ++gdei) { - const GeometricDetExtra* gdeaddr = &(*gdei); - _helperMap[gdei->geographicalId().rawId()] = gdeaddr; - } -} - -void CmsTrackerDebugNavigator::dump(const GeometricDet& in, const std::vector<GeometricDetExtra>& gdes) { - edm::LogInfo("CmsTrackerDebugNavigator") << " CmsTrackerDebugNavigator - Starting debug"; - for (int k = 0; k < 20; k++) - numinstances[k] = 0; - iterate(in, 0, gdes); - - for (int k = 0; k < 20; k++) { - edm::LogInfo("CmsTrackerDebugNavigator") - << " CmsTrackerDebugNavigator has found " << numinstances[k] << " GeometricDets at level " << k; - } -} - -void CmsTrackerDebugNavigator::iterate(const GeometricDet& in, int level, const std::vector<GeometricDetExtra>& gdes) { - numinstances[level]++; - for (unsigned int k = 0; k < in.components().size(); k++) { - std::string spaces = ""; - for (unsigned int i = 0; (int)i <= level; i++) - spaces += " "; - const GeometricDetExtra* extra = _helperMap[in.components()[k]->geographicalId().rawId()]; - edm::LogInfo("CmsTrackerDebugNavigator") - << level << spaces << "### VOLUME " << in.components()[k]->name() << " of type " << in.components()[k]->type() - << " copy number " << extra->copyno() << " positioned in " << in.name() << " global position of centre " - << in.components()[k]->translation() - // << " rotation matrix " << in.components()[k]->rotation() - << " volume = " << extra->volume() << " cm3" - << " density = " << extra->density() << " g/cm3" - << " weight " << extra->weight() << " g" << std::endl; - iterate(*((in.components())[k]), level + 1, gdes); - } - return; -} diff --git a/Geometry/TrackerNumberingBuilder/src/GeometricDetExtra.cc b/Geometry/TrackerNumberingBuilder/src/GeometricDetExtra.cc deleted file mode 100644 index a799cdd92b5a3..0000000000000 --- a/Geometry/TrackerNumberingBuilder/src/GeometricDetExtra.cc +++ /dev/null @@ -1,25 +0,0 @@ -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h" - -/** - * Constructors to be used when looping over DDD - */ -GeometricDetExtra::GeometricDetExtra(GeometricDet const* gd, - DetId id, - GeoHistory& gh, - double vol, - double dens, - double wgt, - double cpy, - const std::string& mat, - const std::string& name, - bool dd) - : _mygd(gd), - _geographicalId(id), - _parents(gh), - _volume(vol), - _density(dens), - _weight(wgt), - _copy((int)(cpy)), - _material(mat), - _name(name), - _fromDD(dd) {} diff --git a/Geometry/TrackerNumberingBuilder/src/module.cc b/Geometry/TrackerNumberingBuilder/src/module.cc index 6bab8880f001e..6e4d42f1acd27 100644 --- a/Geometry/TrackerNumberingBuilder/src/module.cc +++ b/Geometry/TrackerNumberingBuilder/src/module.cc @@ -1,8 +1,5 @@ #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" -#include "Geometry/TrackerNumberingBuilder/interface/GeometricDetExtra.h" #include "FWCore/Utilities/interface/typelookup.h" TYPELOOKUP_DATA_REG(GeometricDet); -TYPELOOKUP_DATA_REG(GeometricDetExtra); -TYPELOOKUP_DATA_REG(std::vector<GeometricDetExtra>); diff --git a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc index 713ce1076f071..c51087b541304 100644 --- a/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc +++ b/Geometry/TrackerNumberingBuilder/test/ModuleNumbering.cc @@ -38,7 +38,6 @@ #include "DataFormats/GeometrySurface/interface/BoundSurface.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" @@ -184,9 +183,7 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i // get the GeometricDet // edm::ESHandle<GeometricDet> rDD; - edm::ESHandle<std::vector<GeometricDetExtra> > rDDE; iSetup.get<IdealGeometryRecord>().get(rDD); - iSetup.get<IdealGeometryRecord>().get(rDDE); edm::LogInfo("ModuleNumbering") << " Top node is " << rDD.product() << " " << rDD.product()->name() << std::endl; edm::LogInfo("ModuleNumbering") << " radLength " << rDD.product()->radLength() << "\n" << " xi " << rDD.product()->xi() << "\n" @@ -204,14 +201,11 @@ void ModuleNumbering::analyze(const edm::Event& iEvent, const edm::EventSetup& i edm::LogInfo("ModuleNumbering") << " And Contains Daughters: " << rDD.product()->deepComponents().size() << std::endl; - // output file const std::string& outputFileName = (!rDD.product()->isFromDD4hep() ? "ModuleNumbering.log" : "ModuleNumbering_dd4hep.log"); std::ofstream Output(outputFileName, std::ios::out); - CmsTrackerDebugNavigator nav(*rDDE.product()); - nav.dump(*rDD.product(), *rDDE.product()); // //first instance tracking geometry edm::ESHandle<TrackerGeometry> pDD; diff --git a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py index 5d52a1a940aab..c6a5b875118a1 100644 --- a/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py +++ b/Geometry/TrackerNumberingBuilder/test/trackerModuleNumbering_cfg.py @@ -6,10 +6,10 @@ process.load("Configuration.Geometry.GeometryExtended2021Reco_cff") -#this is always needed if users want access to the vector<GeometricDetExtra> -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) + process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( diff --git a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc index aa06d7ed3f35f..7de5b1009c876 100644 --- a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc +++ b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc @@ -131,19 +131,11 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& // get the GeometricDet // edm::ESHandle<GeometricDet> rDD; - edm::ESHandle<std::vector<GeometricDetExtra> > rDDE; - //if (fromDDD_) { + iSetup.get<IdealGeometryRecord>().get(rDD); - iSetup.get<IdealGeometryRecord>().get(rDDE); - //} else { - // iSetup.get<PGeometricDetRcd>().get( rDD ); - //} edm::LogInfo("ModuleInfo_Phase2") << " Top node is " << rDD.product() << " " << rDD.product()->name() << std::endl; edm::LogInfo("ModuleInfo_Phase2") << " And Contains Daughters: " << rDD.product()->deepComponents().size() << std::endl; - CmsTrackerDebugNavigator nav(*rDDE.product()); - nav.dump(*rDD.product(), *rDDE.product()); - // //first instance tracking geometry edm::ESHandle<TrackerGeometry> pDD; iSetup.get<TrackerDigiGeometryRecord>().get(pDD); @@ -261,34 +253,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& double thepixROCRowsD[16] = {0.0}; double thepixROCColsD[16] = {0.0}; // - double volume_total = 0.0; - double weight_total = 0.0; - double activeSurface_total = 0.0; - double volume_pxb = 0.0; - double weight_pxb = 0.0; - double activeSurface_pxb = 0.0; - double activeSurface_pxb_L[16] = {0.0}; - double volume_pxf = 0.0; - double weight_pxf = 0.0; - double activeSurface_pxf = 0.0; - double activeSurface_pxf_D[6] = {0.0}; - double volume_tib = 0.0; - double weight_tib = 0.0; - double activeSurface_tib = 0.0; - double activeSurface_tib_L[4] = {0.0}; - double volume_tid = 0.0; - double weight_tid = 0.0; - double activeSurface_tid = 0.0; - double activeSurface_tid_D[3] = {0.0}; - double volume_tob = 0.0; - double weight_tob = 0.0; - double activeSurface_tob = 0.0; - double activeSurface_tob_L[6] = {0.0}; - double volume_tec = 0.0; - double weight_tec = 0.0; - double activeSurface_tec = 0.0; - double activeSurface_tec_D[9] = {0.0}; - // unsigned int nlayersPXB = 0; // number of layers unsigned int nlayersTIB = 0; // number of layers unsigned int nlayersTOB = 0; // number of layers @@ -299,51 +263,27 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& std::vector<const GeometricDet*> modules = (*rDD).deepComponents(); Output << "************************ List of modules with positions ************************" << std::endl; // MEC: 2010-04-13: need to find corresponding GeometricDetExtra. - std::vector<GeometricDetExtra>::const_iterator gdei(rDDE->begin()), gdeEnd(rDDE->end()); + for (unsigned int i = 0; i < modules.size(); i++) { unsigned int rawid = modules[i]->geographicalId().rawId(); - gdei = rDDE->begin(); - for (; gdei != gdeEnd; ++gdei) { - if (gdei->geographicalId() == modules[i]->geographicalId()) - break; - } - - if (gdei == gdeEnd) - throw cms::Exception("ModuleInfo") << "THERE IS NO MATCHING DetId in the GeometricDetExtra"; //THIS never happens! GeometricDet::nav_type detNavType = modules[i]->navType(); Output << std::fixed << std::setprecision(6); // set as default 6 decimal digits std::bitset<32> binary_rawid(rawid); Output << " ******** raw Id = " << rawid << " (" << binary_rawid << ") "; - // if ( fromDDD_ && printDDD_ ) { - // Output << "\t nav type = " << detNavType; - // } - //nav_type typedef changed in 3_6_2; comment out for now. idr 10/6/10 - Output << std::endl; int subdetid = modules[i]->geographicalId().subdetId(); - double volume = gdei->volume() / 1000; // mm3->cm3 - double density = gdei->density() / density_units; - double weight = gdei->weight() / density_units / 1000.; // [kg], hence the factor 1000; double thickness = modules[i]->bounds()->thickness() * 10000; // cm-->um double length = (modules[i]->bounds()->length()); // already in cm - //double width = (modules[i]->bounds()->width()); // already in cm - double activeSurface = volume / (thickness / 10000); // cm2 (thickness in um) double polarRadius = std::sqrt(modules[i]->translation().X() * modules[i]->translation().X() + modules[i]->translation().Y() * modules[i]->translation().Y()); double positionZ = std::abs(modules[i]->translation().Z()) / 10.; //cm - volume_total += volume; - weight_total += weight; - activeSurface_total += activeSurface; switch (subdetid) { // PXB case 1: { pxbN++; - volume_pxb += volume; - weight_pxb += weight; - activeSurface_pxb += activeSurface; std::string name = modules[i]->name(); if (name == "PixelBarrelActiveFull" || name == "PixelBarrelActiveFull0" || name == "PixelBarrelActiveFull1" || name == "PixelBarrelActiveFull2" || name == "PixelBarrelActiveFull3") @@ -419,7 +359,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& std::cout << "\nYou have added PXB layers that are not taken into account! \ti.e. " << name << "\n"; if (16 < theLayer) std::cout << "\nYou need to increase the PXB array sizes!\n"; - activeSurface_pxb_L[theLayer - 1] += activeSurface; psi_pxb_L[theLayer - 1] += modules[i]->pixROCx() * modules[i]->pixROCy(); if (pxbZ_L[theLayer - 1] < positionZ + length / 2) @@ -429,20 +368,12 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& << "\t" << "Layer " << theLayer << " Ladder " << theLadder << "\t" << " module " << theModule << " " << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name() << std::endl; - } else { - Output << " NO DDD Hierarchy available " << std::endl; - } break; } // PXF case 2: { pxfN++; - volume_pxf += volume; - weight_pxf += weight; - activeSurface_pxf += activeSurface; std::string name = modules[i]->name(); if (name == "PixelForwardSensor" || name == "PixelForwardSensor1" || name == "PixelForwardSensor2" || name == "PixelForwardSensor3") @@ -496,7 +427,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& std::cout << "\nYou have added PXF layers that are not taken into account! \ti.e. " << name << "\n"; if (3 < theDisk) std::cout << "\nYou need to increase the PXF array sizes!\n"; - activeSurface_pxf_D[theDisk - 1] += activeSurface; psi_pxf_D[theDisk - 1] += modules[i]->pixROCx() * modules[i]->pixROCy(); psi_pxf[theDisk - 1] += modules[i]->pixROCx() * modules[i]->pixROCy(); pxfZ_D[theDisk - 1] += positionZ; @@ -510,20 +440,12 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& Output << " PXF" << side << "\t" << "Disk " << theDisk << " Blade " << theBlade << " Panel " << thePanel << "\t" << " module " << theModule << "\t" << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name() << std::endl; - } else { - Output << " NO DDD Hierarchy available " << std::endl; - } break; } // TIB case 3: { tibN++; - volume_tib += volume; - weight_tib += weight; - activeSurface_tib += activeSurface; std::string name = modules[i]->name(); if (name == "TIBActiveRphi0") tib_L12_rphiN++; @@ -547,7 +469,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& std::cout << "\nYou have added TIB layers that are not taken into account!\n\n"; if (6 < theLayer) std::cout << "\nYou need to increase the TIB array sizes!\n"; - activeSurface_tib_L[theLayer - 1] += activeSurface; tib_apv_L[theLayer - 1] += modules[i]->siliconAPVNum(); apv_tib += modules[i]->siliconAPVNum(); if (tibZ_L[theLayer - 1] < positionZ + length / 2) @@ -562,11 +483,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& << "Layer " << theLayer << " " << part << "\t" << "string " << theString[2] << "\t" << " module " << theModule << " " << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; break; @@ -575,9 +491,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& // TID case 4: { tidN++; - volume_tid += volume; - weight_tid += weight; - activeSurface_tid += activeSurface; std::string name = modules[i]->name(); if (name == "TIDModule0RphiActive") tid_r1_rphiN++; @@ -610,7 +523,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& std::cout << "\nYou have added TID layers that are not taken into account!\n\n"; if (3 < theDisk) std::cout << "\nYou need to increase the TID array sizes!\n"; - activeSurface_tid_D[theDisk - 1] += activeSurface; tid_apv_D[theDisk - 1] += modules[i]->siliconAPVNum(); apv_tid += modules[i]->siliconAPVNum(); tidZ_D[theDisk - 1] += positionZ; @@ -626,11 +538,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& Output << " TID" << side << "\t" << "Disk " << theDisk << " Ring " << theRing << " " << part << "\t" << " module " << theModule[1] << "\t" << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; break; @@ -639,9 +546,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& // TOB case 5: { tobN++; - volume_tob += volume; - weight_tob += weight; - activeSurface_tob += activeSurface; std::string name = modules[i]->name(); if (name == "TOBActiveRphi0") tob_L12_rphiN++; @@ -670,7 +574,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& std::cout << "\nYou have added TOB layers that are not taken into account!\n\n"; if (6 < theLayer) std::cout << "\nYou need to increase the TOB array sizes!\n"; - activeSurface_tob_L[theLayer - 1] += activeSurface; tob_apv_L[theLayer - 1] += modules[i]->siliconAPVNum(); apv_tob += modules[i]->siliconAPVNum(); if (tobZ_L[theLayer - 1] < positionZ + length / 2) @@ -682,11 +585,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& Output << " TOB" << side << "\t" << "Layer " << theLayer << "\t" << "rod " << theRod[1] << " module " << theModule << "\t" << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; break; @@ -695,9 +593,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& // TEC case 6: { tecN++; - volume_tec += volume; - weight_tec += weight; - activeSurface_tec += activeSurface; std::string name = modules[i]->name(); if (name == "TECModule0RphiActive") tec_r1_rphiN++; @@ -753,7 +648,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& std::cout << "\nYou have added TOB layers that are not taken into account!,\t" << name << "\n"; if (9 < theWheel) std::cout << "\nYou need to increase the TEC array sizes!\n"; - activeSurface_tec_D[theWheel - 1] += activeSurface; tec_apv_D[theWheel - 1] += modules[i]->siliconAPVNum(); apv_tec += modules[i]->siliconAPVNum(); tecZ_D[theWheel - 1] += positionZ; @@ -770,11 +664,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& << "Wheel " << theWheel << " Petal " << thePetal[1] << " " << petal << " Ring " << theRing << "\t" << "\t" << " module " << theModule << "\t" << name << "\t"; - if (fromDDD_ && printDDD_) { - Output << "son of " << gdei->parents()[gdei->parents().size() - 3].logicalPart().name(); - } else { - Output << " NO DDD Hierarchy available "; - } Output << " " << modules[i]->translation().X() << " \t" << modules[i]->translation().Y() << " \t" << modules[i]->translation().Z() << std::endl; @@ -860,11 +749,7 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& // Output: set as default 4 decimal digits (0.1 um or 0.1 deg/rad) // active area center Output << "\t" - << "volume " << std::fixed << std::setprecision(3) << volume << " cm3 \t" - << "density " << std::fixed << std::setprecision(3) << density << " g/cm3 \t" - << "weight " << std::fixed << std::setprecision(6) << weight << " kg \t" - << "thickness " << std::fixed << std::setprecision(0) << thickness << " um \t" - << " active area " << std::fixed << std::setprecision(2) << activeSurface << " cm2" << std::endl; + << "thickness " << std::fixed << std::setprecision(0) << thickness << " um \n"; Output << "\tActive Area Center" << std::endl; Output << "\t O = (" << std::fixed << std::setprecision(4) << modules[i]->translation().X() << "," << std::fixed << std::setprecision(4) << modules[i]->translation().Y() << "," << std::fixed << std::setprecision(4) @@ -959,9 +844,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& //Output << " Strx34: Full = " << pxb_full_strx34N << std::endl; //Output << " Strx34: Half = " << pxb_half_strx34N << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_pxb << " kg" << std::endl; - Output << " Volume = " << volume_pxb << " cm3" << std::endl; - Output << " Surface = " << activeSurface_pxb << " cm2" << std::endl; Output << " NEED TO VERIFY THE NEXT 6 LINES!!!!!!!!!!!!!!!!! " << std::endl; Output << " PSI46s Inner = " << (int)psi_pxbN << std::endl; Output << " PSI46s Strx12 = " << (int)psi_pxb_strx12N << std::endl; @@ -977,9 +859,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& Output << " 2x4 = " << pxf_2x4N << std::endl; Output << " 2x5 = " << pxf_2x5N << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_pxf << " kg" << std::endl; - Output << " Volume = " << volume_pxf << " cm3" << std::endl; - Output << " Surface = " << activeSurface_pxf << " cm2" << std::endl; Output << " PSI46s = " << (int)psi_pxfN << std::endl; Output << " channels = " << (int)chan_pxf << std::endl; Output << " TIB = " << tibN << std::endl; @@ -987,9 +866,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& Output << " L12 stereo = " << tib_L12_sterN << std::endl; Output << " L34 = " << tib_L34_rphiN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tib << " kg" << std::endl; - Output << " Volume = " << volume_tib << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tib << " cm2" << std::endl; Output << " APV25s = " << (int)apv_tib << std::endl; Output << " channels = " << (int)chan_tib << std::endl; Output << " TID = " << tidN << std::endl; @@ -999,10 +875,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& Output << " r2 stereo = " << tid_r2_sterN << std::endl; Output << " r3 rphi = " << tid_r3_rphiN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tid << " kg" << std::endl; - Output << " Volume = " << volume_tid << " cm3" << std::endl; - ; - Output << " Surface = " << activeSurface_tid << " cm2" << std::endl; Output << " APV25s = " << (int)apv_tid << std::endl; Output << " channels = " << (int)chan_tid << std::endl; Output << " TOB = " << tobN << std::endl; @@ -1011,9 +883,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& Output << " L34 = " << tob_L34_rphiN << std::endl; Output << " L56 = " << tob_L56_rphiN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tob << " kg" << std::endl; - Output << " Volume = " << volume_tob << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tob << " cm2" << std::endl; Output << " APV25s = " << (int)apv_tob << std::endl; Output << " channels = " << (int)chan_tob << std::endl; Output << " TEC = " << tecN << std::endl; @@ -1028,15 +897,9 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& Output << " r6 rphi = " << tec_r6_rphiN << std::endl; Output << " r7 rphi = " << tec_r7_rphiN << std::endl; Output << " Active Silicon Detectors" << std::endl; - Output << " Weight = " << weight_tec << " kg" << std::endl; - Output << " Volume = " << volume_tec << " cm3" << std::endl; - Output << " Surface = " << activeSurface_tec << " cm2" << std::endl; Output << " APV25s = " << (int)apv_tec << std::endl; Output << " channels = " << (int)chan_tec << std::endl; Output << "---------------------" << std::endl; - Output << " Total Weight = " << weight_total << " kg" << std::endl; - Output << " Total Volume = " << volume_total << " cm3" << std::endl; - Output << " Total Active Area = " << activeSurface_total << " cm2" << std::endl; Output << " PSI46s = " << (int)psi_tot << std::endl; Output << " APV25s = " << (int)apv_tot << std::endl; Output << " pixel channels = " << (int)chan_pixel << std::endl; @@ -1051,8 +914,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& GeometryOutput << " Number of Full module in PXB layer no. " << i + 1 << ": " << pxb_full_L[i] << std::endl; GeometryOutput << " Number of Half module in PXB layer no. " << i + 1 << ": " << pxb_half_L[i] << std::endl; GeometryOutput << " Number of stack module in PXB layer no. " << i + 1 << ": " << pxb_stack[i] << std::endl; - GeometryOutput << " Active Silicon surface in PXB layer no. " << i + 1 << ": " << activeSurface_pxb_L[i] - << " [cm^2]" << std::endl; GeometryOutput << " Number of PSI46s in PXB layer no. " << i + 1 << ": " << psi_pxb_L[i] << std::endl; GeometryOutput << " Number of pixel channels in PXB layer no. " << i + 1 << ": " << (int)psi_pxb_L[i] * chan_per_psiB[i] << std::endl; @@ -1060,9 +921,9 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& << pxbpitchy[i] << std::endl; GeometryOutput << std::endl; GeometryXLS << "PXB" << i + 1 << " " << pxbR_L[i] / (pxb_full_L[i] + pxb_half_L[i] + pxb_stack[i]) << " " << 0 - << " " << pxbZ_L[i] << " " << activeSurface_pxb_L[i] << " " << psi_pxb_L[i] << " " - << (int)psi_pxb_L[i] * chan_per_psiB[i] << " " << pxb_full_L[i] + pxb_half_L[i] + pxb_stack[i] << " " - << pxb_full_L[i] << " " << pxb_half_L[i] << " " << pxb_stack[i] << std::endl; + << " " << pxbZ_L[i] << " " << psi_pxb_L[i] << " " << (int)psi_pxb_L[i] * chan_per_psiB[i] << " " + << pxb_full_L[i] + pxb_half_L[i] + pxb_stack[i] << " " << pxb_full_L[i] << " " << pxb_half_L[i] << " " + << pxb_stack[i] << std::endl; } for (unsigned int i = 0; i < nlayersTIB; i++) { GeometryOutput << " TIB Layer no. " << i + 1 << std::endl; @@ -1078,16 +939,16 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& if (tib_L34_rphi_L[i] != 0) GeometryOutput << " Number of IB2 rphi minimodules in TIB layer no. " << i + 1 << ": " << tib_L34_rphi_L[i] << std::endl; - GeometryOutput << " Active Silicon surface in TIB layer no. " << i + 1 << ": " << activeSurface_tib_L[i] - << std::endl; + GeometryOutput << " Active Silicon surface in TIB layer no. " << i + 1 << ": " << std::endl; GeometryOutput << " Number of APV25s in TIB layer no. " << i + 1 << ": " << tib_apv_L[i] << std::endl; GeometryOutput << " Number of strip channels in TIB layer no. " << i + 1 << ": " << (int)tib_apv_L[i] * chan_per_apv << std::endl; GeometryOutput << std::endl; GeometryXLS << "TIB" << i + 1 << " " << tibR_L[i] / (tib_L12_rphi_L[i] + tib_L12_ster_L[i] + tib_L34_rphi_L[i]) - << " " << 0 << " " << tibZ_L[i] << " " << activeSurface_tib_L[i] << " " << tib_apv_L[i] << " " - << (int)tib_apv_L[i] * chan_per_apv << " " << tib_L12_rphi_L[i] + tib_L12_ster_L[i] + tib_L34_rphi_L[i] - << " " << tib_L12_rphi_L[i] << " " << tib_L12_ster_L[i] << " " << tib_L34_rphi_L[i] << std::endl; + << " " << 0 << " " << tibZ_L[i] << " " + << " " << tib_apv_L[i] << " " << (int)tib_apv_L[i] * chan_per_apv << " " + << tib_L12_rphi_L[i] + tib_L12_ster_L[i] + tib_L34_rphi_L[i] << " " << tib_L12_rphi_L[i] << " " + << tib_L12_ster_L[i] << " " << tib_L34_rphi_L[i] << std::endl; } for (unsigned int i = 0; i < nlayersTOB; i++) { GeometryOutput << " TOB Layer no. " << i + 1 << std::endl; @@ -1107,16 +968,14 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& if (tob_L56_rphi_L[i] != 0) GeometryOutput << " Number of OB2 rphi minimodules in TOB layer no. " << i + 1 << ": " << tob_L56_rphi_L[i] << std::endl; - GeometryOutput << " Active Silicon surface in TOB layer no. " << i + 1 << ": " << activeSurface_tob_L[i] - << std::endl; GeometryOutput << " Number of APV25s in TOB layer no. " << i + 1 << ": " << tob_apv_L[i] << std::endl; GeometryOutput << " Number of strip channels in TOB layer no. " << i + 1 << ": " << (int)tob_apv_L[i] * chan_per_apv << std::endl; GeometryOutput << std::endl; GeometryXLS << "TOB" << i + 1 << " " << tobR_L[i] / (tob_L12_rphi_L[i] + tob_L12_ster_L[i] + tob_L34_rphi_L[i] + tob_L56_rphi_L[i]) << " " - << 0 << " " << tobZ_L[i] << " " << activeSurface_tob_L[i] << " " << tob_apv_L[i] << " " - << (int)tob_apv_L[i] * chan_per_apv << " " + << 0 << " " << tobZ_L[i] << " " + << " " << tob_apv_L[i] << " " << (int)tob_apv_L[i] * chan_per_apv << " " << tob_L12_rphi_L[i] + tob_L12_ster_L[i] + tob_L34_rphi_L[i] + tob_L56_rphi_L[i] << " " << tob_L12_rphi_L[i] << " " << tob_L12_ster_L[i] << " " << tob_L34_rphi_L[i] << " " << tob_L56_rphi_L[i] << std::endl; @@ -1134,8 +993,6 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& GeometryOutput << " Number of 2x4 modules in PXF disk no. " << i + 1 << ": " << pxf_2x4_D[i] << std::endl; GeometryOutput << " Number of 2x5 modules in PXF disk no. " << i + 1 << ": " << pxf_2x5_D[i] << std::endl; GeometryOutput << " Number of 2x8 modules in PXF disk no. " << i + 1 << ": " << pxf_D[i] << std::endl; - GeometryOutput << " Active Silicon surface in PXF disk no. " << i + 1 << ": " << activeSurface_pxf_D[i] - << " [cm^2]" << std::endl; GeometryOutput << " Number of PSI46s in PXF disk no. " << i + 1 << ": " << psi_pxf_D[i] << std::endl; GeometryOutput << " Number of pixel channels in PXF disk no. " << i + 1 << ": " << (int)psi_pxf_D[i] * chan_per_psiD[i] << std::endl; @@ -1144,8 +1001,8 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& GeometryOutput << std::endl; GeometryXLS << "PXF" << i + 1 << " " << pxfR_min_D[i] << " " << pxfR_max_D[i] << " " << pxfZ_D[i] / (pxf_D[i] + pxf_1x2_D[i] + pxf_1x5_D[i] + pxf_2x3_D[i] + pxf_2x4_D[i] + pxf_2x5_D[i]) - << " " << activeSurface_pxf_D[i] << " " << psi_pxf_D[i] << " " << (int)psi_pxf_D[i] * chan_per_psiD[i] - << " " << pxf_D[i] + pxf_1x2_D[i] + pxf_1x5_D[i] + pxf_2x3_D[i] + pxf_2x4_D[i] + pxf_2x5_D[i] << " " + << " " << psi_pxf_D[i] << " " << (int)psi_pxf_D[i] * chan_per_psiD[i] << " " + << pxf_D[i] + pxf_1x2_D[i] + pxf_1x5_D[i] + pxf_2x3_D[i] + pxf_2x4_D[i] + pxf_2x5_D[i] << " " << pxf_D[i] << " " << pxf_1x2_D[i] << " " << pxf_1x5_D[i] << " " << pxf_2x3_D[i] << " " << pxf_2x4_D[i] << " " << pxf_2x5_D[i] << std::endl; } @@ -1165,16 +1022,14 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& << std::endl; GeometryOutput << " Number of r3_rphi modules in TID disk no. " << i + 1 << ": " << tid_r3_rphi_D[i] << std::endl; - GeometryOutput << " Active Silicon surface in TID disk no. " << i + 1 << ": " << activeSurface_tid_D[i] - << " [cm^2]" << std::endl; GeometryOutput << " Number of APV25s in TID disk no. " << i + 1 << ": " << tid_apv_D[i] << std::endl; GeometryOutput << " Number of strip channels in TID disk no. " << i + 1 << ": " << (int)tid_apv_D[i] * chan_per_apv << std::endl; GeometryOutput << std::endl; GeometryXLS << "TID" << i + 1 << " " << tidR_min_D[i] << " " << tidR_max_D[i] << " " << tidZ_D[i] / tot << " " - << activeSurface_tid_D[i] << " " << tid_apv_D[i] << " " << (int)tid_apv_D[i] * chan_per_apv << " " - << tot << " " << tid_r1_rphi_D[i] << " " << tid_r1_ster_D[i] << " " << tid_r2_rphi_D[i] << " " - << tid_r2_ster_D[i] << " " << tid_r3_rphi_D[i] << std::endl; + << " " << tid_apv_D[i] << " " << (int)tid_apv_D[i] * chan_per_apv << " " << tot << " " + << tid_r1_rphi_D[i] << " " << tid_r1_ster_D[i] << " " << tid_r2_rphi_D[i] << " " << tid_r2_ster_D[i] + << " " << tid_r3_rphi_D[i] << std::endl; } for (unsigned int i = 0; i < nwheelsTEC; i++) { GeometryOutput << " TEC Disk no. " << i + 1 << " (numbers are the total for both sides)" << std::endl; @@ -1203,17 +1058,15 @@ void ModuleInfo_Phase2::analyze(const edm::Event& iEvent, const edm::EventSetup& << std::endl; GeometryOutput << " Number of r7_rphi modules in TEC wheel no. " << i + 1 << ": " << tec_r7_rphi_D[i] << std::endl; - GeometryOutput << " Active Silicon surface in TEC wheel no. " << i + 1 << ": " << activeSurface_tec_D[i] - << " [cm^2]" << std::endl; GeometryOutput << " Number of APV25s in TEC wheel no. " << i + 1 << ": " << tec_apv_D[i] << std::endl; GeometryOutput << " Number of strip channels in TEC wheel no. " << i + 1 << ": " << (int)tec_apv_D[i] * chan_per_apv << std::endl; GeometryOutput << std::endl; GeometryXLS << "TEC" << i + 1 << " " << tecR_min_D[i] << " " << tecR_max_D[i] << " " << tecZ_D[i] / tot << " " - << activeSurface_tec_D[i] << " " << tec_apv_D[i] << " " << (int)tec_apv_D[i] * chan_per_apv << " " - << tot << " " << tec_r1_rphi_D[i] << " " << tec_r1_ster_D[i] << " " << tec_r2_rphi_D[i] << " " - << tec_r2_ster_D[i] << " " << tec_r3_rphi_D[i] << " " << tec_r4_rphi_D[i] << " " << tec_r5_rphi_D[i] - << " " << tec_r5_ster_D[i] << " " << tec_r6_rphi_D[i] << " " << tec_r7_rphi_D[i] << std::endl; + << tec_apv_D[i] << " " << (int)tec_apv_D[i] * chan_per_apv << " " << tot << " " << tec_r1_rphi_D[i] + << " " << tec_r1_ster_D[i] << " " << tec_r2_rphi_D[i] << " " << tec_r2_ster_D[i] << " " + << tec_r3_rphi_D[i] << " " << tec_r4_rphi_D[i] << " " << tec_r5_rphi_D[i] << " " << tec_r5_ster_D[i] + << " " << tec_r6_rphi_D[i] << " " << tec_r7_rphi_D[i] << std::endl; } } diff --git a/SLHCUpgradeSimulations/Geometry/test/trackerModuleInfo_Phase2_cfg.py b/SLHCUpgradeSimulations/Geometry/test/trackerModuleInfo_Phase2_cfg.py index 00696462acfbe..9bb50d3ef4b24 100644 --- a/SLHCUpgradeSimulations/Geometry/test/trackerModuleInfo_Phase2_cfg.py +++ b/SLHCUpgradeSimulations/Geometry/test/trackerModuleInfo_Phase2_cfg.py @@ -15,9 +15,9 @@ process.load("SLHCUpgradeSimulations.Geometry.Phase1_R34F16_cmsSimIdealGeometryXML_cff") #process.load('Configuration.StandardSequences.GeometryExtended_cff') -process.TrackerGeometricDetExtraESModule = cms.ESProducer( "TrackerGeometricDetExtraESModule", - fromDDD = cms.bool( True ) - ) +process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule", + fromDDD = cms.bool( True ) + ) process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") From f6188baf1f600a86c84e5b375a0b97637a04e9a0 Mon Sep 17 00:00:00 2001 From: Andres Vargas <vargasa@cua.edu> Date: Wed, 14 Oct 2020 08:55:02 -0500 Subject: [PATCH 615/778] Fix merging conflicts --- Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc | 3 --- .../test/python/testTrackerModuleInfoDDD_cfg.py | 1 - .../TrackerNumberingBuilder/test/GeometricDetAnalyzer.cc | 2 -- SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc | 5 ----- 4 files changed, 11 deletions(-) diff --git a/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc b/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc index eea723d52dd32..10666e15df9a2 100644 --- a/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc +++ b/Geometry/TrackerGeometryBuilder/test/ModuleInfo.cc @@ -41,7 +41,6 @@ #include "DataFormats/Math/interface/Rounding.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h" @@ -77,8 +76,6 @@ class ModuleInfo : public edm::one::EDAnalyzer<> { double tolerance_; }; -static const double density_units = 6.24151e+18; - ModuleInfo::ModuleInfo(const edm::ParameterSet& ps) : fromDDD_(ps.getParameter<bool>("fromDDD")), printDDD_(ps.getUntrackedParameter<bool>("printDDD", true)), diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py index 6f5e8f5d5e000..cf146b437cee4 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py @@ -29,7 +29,6 @@ process.MessageLogger.categories.append('TrackerGeometryBuilder') process.MessageLogger.categories.append('TrackerNumberingBuilder') process.MessageLogger.categories.append('ModuleInfo') -process.MessageLogger.categories.append('CmsTrackerDebugNavigator') process.MessageLogger.cout = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/Geometry/TrackerNumberingBuilder/test/GeometricDetAnalyzer.cc b/Geometry/TrackerNumberingBuilder/test/GeometricDetAnalyzer.cc index b7131af8163c4..4dcc40e552c13 100644 --- a/Geometry/TrackerNumberingBuilder/test/GeometricDetAnalyzer.cc +++ b/Geometry/TrackerNumberingBuilder/test/GeometricDetAnalyzer.cc @@ -34,8 +34,6 @@ #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h" - // CLHEP Dependency #include <CLHEP/Vector/ThreeVector.h> diff --git a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc index 7de5b1009c876..e437389878b05 100644 --- a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc +++ b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc @@ -42,7 +42,6 @@ #include "DataFormats/GeometrySurface/interface/BoundSurface.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerDebugNavigator.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" @@ -84,10 +83,6 @@ class ModuleInfo_Phase2 : public edm::EDAnalyzer { // constants, enums and typedefs // -// -// static data member definitions -// -static const double density_units = 6.24151e+18; // // constructors and destructor From 34ffcf93444e1ded07a65e4ab76b4f61b194e5c3 Mon Sep 17 00:00:00 2001 From: Andres Vargas <vargasa@cua.edu> Date: Wed, 14 Oct 2020 09:13:01 -0500 Subject: [PATCH 616/778] code format --- SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc index e437389878b05..2c6b0ce9bfa7f 100644 --- a/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc +++ b/SLHCUpgradeSimulations/Geometry/test/ModuleInfo_Phase2.cc @@ -83,7 +83,6 @@ class ModuleInfo_Phase2 : public edm::EDAnalyzer { // constants, enums and typedefs // - // // constructors and destructor // From 102ba8e2dba1ade74a26e3429d69b8dc7b5b0f5c Mon Sep 17 00:00:00 2001 From: Andres Vargas <vargasa@cua.edu> Date: Thu, 15 Oct 2020 12:57:30 -0500 Subject: [PATCH 617/778] Revert "Additional logs for Validation purposes" This reverts commit 10db664e05720166306691d1d156fb4d26f60953. --- .../src/TrackerG4SimHitNumberingScheme.cc | 30 +++++++++---------- .../test/dd4hep_ZMM_Run3_Step1_cfg.py | 1 - .../test/ddd_ZMM_Run3_Step1_cfg.py | 1 - 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc b/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc index 54c59ad64a368..465f355d49799 100644 --- a/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc +++ b/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc @@ -30,16 +30,11 @@ void TrackerG4SimHitNumberingScheme::buildAll() { for (auto& theSD : allSensitiveDets) { auto const& t = theSD->translation(); - edm::LogVerbatim("TrackerSimInfoNumbering") << "::buildAll" << theSD->geographicalId().rawId() << "\t" << t; theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(t.x(), t.y(), t.z())); G4TouchableHistory* hist = theNavigator.CreateTouchableHistory(); - assert(!!hist); TrackerG4SimHitNumberingScheme::Nav_Story st; touchToNavStory(hist, st); - for (const std::pair<int, std::string>& p : st) - edm::LogVerbatim("TrackerSimInfoNumbering") << "Nav_Story\t" << p.first << "\t" << p.second; - directMap_[st] = theSD->geographicalId(); LogDebug("TrackerSimDebugNumbering") << " INSERTING LV " << hist->GetVolume()->GetLogicalVolume()->GetName() @@ -60,24 +55,27 @@ void TrackerG4SimHitNumberingScheme::buildAll() { void TrackerG4SimHitNumberingScheme::touchToNavStory(const G4VTouchable* v, TrackerG4SimHitNumberingScheme::Nav_Story& st) { +#ifdef DEBUG std::vector<int> debugint; std::vector<std::string> debugstring; - +#endif int levels = v->GetHistoryDepth(); for (int k = 0; k <= levels; ++k) { if (v->GetVolume(k)->GetLogicalVolume()->GetName() != "TOBInactive") { st.emplace_back( std::pair<int, std::string>(v->GetVolume(k)->GetCopyNo(), v->GetVolume(k)->GetLogicalVolume()->GetName())); +#ifdef DEBUG debugint.emplace_back(v->GetVolume(k)->GetCopyNo()); debugstring.emplace_back(v->GetVolume(k)->GetLogicalVolume()->GetName()); +#endif } } - - for (const int& i : debugint) - edm::LogVerbatim("TrackerSimInfoNumbering") << " G4 TrackerG4SimHitNumberingScheme " << i; - for (const std::string& s : debugstring) - edm::LogVerbatim("TrackerSimInfoNumbering") << " " << s; +#ifdef DEBUG + LogDebug("TrackerSimDebugNumbering") << " G4 TrackerG4SimHitNumberingScheme " << debugint; + for (u_int32_t jj = 0; jj < debugstring.size(); jj++) + LogDebug("TrackerSimDebugNumbering") << " " << debugstring[jj]; +#endif } unsigned int TrackerG4SimHitNumberingScheme::g4ToNumberingScheme(const G4VTouchable* v) { @@ -87,8 +85,10 @@ unsigned int TrackerG4SimHitNumberingScheme::g4ToNumberingScheme(const G4VToucha TrackerG4SimHitNumberingScheme::Nav_Story st; touchToNavStory(v, st); +#ifdef DEBUG dumpG4VPV(v); - edm::LogVerbatim("TrackerSimInfoNumbering") << " Returning: " << directMap_[st]; + LogDebug("TrackerSimDebugNumbering") << " Returning: " << directMap_[st]; +#endif return directMap_[st]; } @@ -96,9 +96,9 @@ unsigned int TrackerG4SimHitNumberingScheme::g4ToNumberingScheme(const G4VToucha void TrackerG4SimHitNumberingScheme::dumpG4VPV(const G4VTouchable* v) { int levels = v->GetHistoryDepth(); - edm::LogVerbatim("TrackerSimInfoNumbering") << " NAME : " << v->GetVolume()->GetLogicalVolume()->GetName(); + LogDebug("TrackerSimDebugNumbering") << " NAME : " << v->GetVolume()->GetLogicalVolume()->GetName(); for (int k = 0; k <= levels; k++) { - edm::LogVerbatim("TrackerSimInfoNumbering") - << " Hist: " << v->GetVolume(k)->GetLogicalVolume()->GetName() << " Copy " << v->GetVolume(k)->GetCopyNo(); + LogDebug("TrackerSimInfoNumbering") << " Hist: " << v->GetVolume(k)->GetLogicalVolume()->GetName() << " Copy " + << v->GetVolume(k)->GetCopyNo(); } } diff --git a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py index bedce9fdc04a2..a5b485bae7f7a 100644 --- a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py @@ -20,7 +20,6 @@ process.load('Configuration.Geometry.GeometryDD4hepExtended2021_cff') # there w process.MessageLogger.categories.append("TrackerGeometryBuilder"); -process.MessageLogger.categories.append("TrackerSimInfoNumbering"); process.maxEvents = cms.untracked.PSet( diff --git a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py index b51379bd99970..2cac97a2a2c5a 100644 --- a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py +++ b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py @@ -20,7 +20,6 @@ process.load('Configuration.Geometry.GeometryExtended2021_cff') # there w process.MessageLogger.categories.append("TrackerGeometryBuilder"); -process.MessageLogger.categories.append("TrackerSimInfoNumbering"); process.maxEvents = cms.untracked.PSet( From c52adf8283562c38c35e01f857d22caeee157485 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Thu, 15 Oct 2020 14:13:00 -0500 Subject: [PATCH 618/778] Added LogFwk* Options The new options use the level fwkInfo which lies between info and warning. --- .../MessageLogger/interface/ELseverityLevel.h | 27 +- FWCore/MessageLogger/interface/MessageDrop.h | 69 +--- .../MessageLogger/interface/MessageLogger.h | 9 + FWCore/MessageLogger/src/ELseverityLevel.cc | 39 +-- FWCore/MessageLogger/src/MessageDrop.cc | 36 +- FWCore/MessageService/doc/cfg_validation.txt | 1 + .../MessageLogger_ReleaseValidation_cfi.py | 1 + .../python/MessageLogger_cfi.py | 1 + FWCore/MessageService/src/MessageLogger.cc | 75 +--- .../MessageService/src/MessageLoggerScribe.cc | 328 ++++-------------- .../src/MessageServicePSetValidation.cc | 12 +- .../src/MessageServicePSetValidation.h | 1 + .../src/ThreadSafeLogMessageLoggerScribe.cc | 10 +- FWCore/MessageService/test/standAloneTest.cpp | 8 + .../standAloneWithMessageLogger.cerr | 41 +++ .../test/test_catch2_LogErrorFilter.cc | 38 ++ 16 files changed, 227 insertions(+), 469 deletions(-) diff --git a/FWCore/MessageLogger/interface/ELseverityLevel.h b/FWCore/MessageLogger/interface/ELseverityLevel.h index d62775a209fb1..1d65572d82e3a 100644 --- a/FWCore/MessageLogger/interface/ELseverityLevel.h +++ b/FWCore/MessageLogger/interface/ELseverityLevel.h @@ -12,29 +12,6 @@ // might use is to check the relative level of two severities // using operator< or the like. // -// 30-Jun-1998 mf Created file. -// 26-Aug-1998 WEB Made ELseverityLevel object less weighty. -// 16-Jun-1999 mf Added constructor from string. -// 23-Jun-1999 mf Additional ELsev_noValueAssigned to allow constructor -// from string to give ELunspecified when not found, while -// still allowing finding zero severity. -// 23-Jun-1999 mf Corrections for subtleties in initialization of -// global symbols: -// Added ELsevLevGlobals array -// Changed extern consts of SLseverityLevels into -// const ELseverityLevel & 's -// Inserted class ELinitializeGlobalSeverityObjects -// in place of the -// initializeGlobalSeverityObjects() function. -// Changed globalSeverityObjectsGuarantor to an -// ELinitializeGlobalSeverityObjects instance. -// 30-Jun-1999 mf Modifications to eliminate problems with order of -// globals initializations: -// translate(), getInputStr(), getVarName() -// 12-Jun-2000 web Final fix to global static initialization problem -// 14-Jun-2000 web Declare classes before granting friendship. -// 27-Jun-2000 web Fix order-of-static-destruction problem -// // ---------------------------------------------------------------------- #include <string> @@ -60,6 +37,8 @@ namespace edm { , ELsev_info // information , + ELsev_fwkInfo // framework + , ELsev_warning // warning , ELsev_error // error detected @@ -116,6 +95,8 @@ namespace edm { constexpr const ELseverityLevel ELinfo{ELseverityLevel::ELsev_info}; + constexpr const ELseverityLevel ELfwkInfo{ELseverityLevel::ELsev_fwkInfo}; + constexpr const ELseverityLevel ELwarning{ELseverityLevel::ELsev_warning}; constexpr const ELseverityLevel ELerror{ELseverityLevel::ELsev_error}; diff --git a/FWCore/MessageLogger/interface/MessageDrop.h b/FWCore/MessageLogger/interface/MessageDrop.h index 489c2e766cfa6..a3a343e7bca43 100644 --- a/FWCore/MessageLogger/interface/MessageDrop.h +++ b/FWCore/MessageLogger/interface/MessageDrop.h @@ -31,46 +31,6 @@ #include <string> #include <string_view> -// Change log -// -// 1 mf 5/12/06 initialize debugEnabled to true, to avoid unitialized -// data detection in memory checks (and to be safe in -// getting enabled output independant of timings) -// -// 4 mf 2/22/07 static ex_p to have a way to convey exceptions to throw -// (this is needed when configuring could lead to an -// exception, for example) -// -// 5 mf 2/22/07 jobreport_name to have a way to convey content -// of jobreport option from cmsRun to MessageLogger class -// -// 6 mf 6/18/07 jobMode to have a way to convey choice of hardwired -// MessageLogger defaults -// -// 7 mf 6/20/08 MessageLoggerScribeIsRunning to let the scribe convey -// that it is active. -// -// 8 cdj 2/08/10 Make debugEnabled, infoEnabled, warningEnabled statics -// to avoid overhead of thread specific singleton access -// when deciding to keep or throw away messages -// -// 9 mf 9/23/10 Support for situations where no thresholds are low -// enough to react to LogDebug (or info, or warning) -// -// 10 mf, crj 11/2/10 (see MessageServer/src/MessageLogger.cc change 17) -// Support for reducing the string operations done when -// moving from one module to the next. -// -// 11 mf 11/29/10 Snapshot method to preare for invalidation of the -// pointers used to hold module context. Supports -// surviving throws that cause objects to go out of scope. -// -// 12 fwyzard 7/6/11 Add support for discarding LogError-level messages -// on a per-module basis (needed at HLT) -// -// 13 wmtan 11/11/11 Make non-copyable to satisfy Coverity. Would otherwise -// need special copy ctor and copy assignment operator. - // user include files namespace edm { @@ -84,13 +44,13 @@ namespace edm { struct MessageDrop { private: - MessageDrop(); // change log 10: + MessageDrop(); public: MessageDrop(MessageDrop const&) = delete; MessageDrop& operator=(MessageDrop const&) = delete; - ~MessageDrop(); // change log 10 + ~MessageDrop(); static MessageDrop* instance(); std::string moduleContext(); void setModuleWithPhase(std::string const& name, std::string const& label, unsigned int moduleID, const char* phase); @@ -100,16 +60,19 @@ namespace edm { std::string_view runEvent; unsigned int streamID; - bool debugEnabled; // change log 8 - bool infoEnabled; // change log 8 - bool warningEnabled; // change log 8 - bool errorEnabled; // change log 8, 12 - - CMS_THREAD_SAFE static std::string jobMode; // change log 6 - CMS_THREAD_SAFE static unsigned char messageLoggerScribeIsRunning; // change log 7 - CMS_THREAD_SAFE static bool debugAlwaysSuppressed; // change log 9 - CMS_THREAD_SAFE static bool infoAlwaysSuppressed; // change log 9 - CMS_THREAD_SAFE static bool warningAlwaysSuppressed; // change log 9 + bool debugEnabled; + bool infoEnabled; + bool fwkInfoEnabled; + bool warningEnabled; + bool errorEnabled; + + CMS_THREAD_SAFE static std::string jobMode; + CMS_THREAD_SAFE static unsigned char messageLoggerScribeIsRunning; + CMS_THREAD_SAFE static bool debugAlwaysSuppressed; + CMS_THREAD_SAFE static bool infoAlwaysSuppressed; + CMS_THREAD_SAFE static bool fwkInfoAlwaysSuppressed; + CMS_THREAD_SAFE static bool warningAlwaysSuppressed; + private: edm::propagate_const<messagedrop::StringProducerWithPhase*> spWithPhase; edm::propagate_const<messagedrop::StringProducerPath*> spPath; @@ -117,7 +80,7 @@ namespace edm { messagedrop::StringProducer const* moduleNameProducer; }; - static const unsigned char MLSCRIBE_RUNNING_INDICATOR = 29; // change log 7 + static const unsigned char MLSCRIBE_RUNNING_INDICATOR = 29; } // end of namespace edm diff --git a/FWCore/MessageLogger/interface/MessageLogger.h b/FWCore/MessageLogger/interface/MessageLogger.h index 629a8d0516df5..5178ea10b9400 100644 --- a/FWCore/MessageLogger/interface/MessageLogger.h +++ b/FWCore/MessageLogger/interface/MessageLogger.h @@ -48,6 +48,12 @@ namespace edm { return (MessageDrop::warningAlwaysSuppressed || !MessageDrop::instance()->warningEnabled); } }; + struct FwkInfo { + static constexpr const ELseverityLevel level = ELfwkInfo; + static bool suppress() noexcept { + return (MessageDrop::fwkInfoAlwaysSuppressed || !MessageDrop::instance()->fwkInfoEnabled); + } + }; struct Info { static constexpr const ELseverityLevel level = ELinfo; static bool suppress() noexcept { @@ -116,8 +122,10 @@ namespace edm { using LogError = Log<level::Error, false>; using LogSystem = Log<level::System, false>; using LogInfo = Log<level::Info, false>; + using LogFwkInfo = Log<level::FwkInfo, false>; using LogVerbatim = Log<level::Info, true>; + using LogFwkVerbatim = Log<level::FwkInfo, true>; using LogPrint = Log<level::Warning, true>; using LogProblem = Log<level::Error, true>; // less judgemental verbatim version of LogError @@ -191,6 +199,7 @@ namespace edm { bool isDebugEnabled(); bool isInfoEnabled(); + bool isFwkInfoEnabled(); bool isWarningEnabled(); void HaltMessageLogging(); void FlushMessageLog(); diff --git a/FWCore/MessageLogger/src/ELseverityLevel.cc b/FWCore/MessageLogger/src/ELseverityLevel.cc index ad6f67d7b24c5..29af5c97b6c03 100644 --- a/FWCore/MessageLogger/src/ELseverityLevel.cc +++ b/FWCore/MessageLogger/src/ELseverityLevel.cc @@ -9,33 +9,6 @@ // might use is to check the relative level of two severities // using operator<() or the like. // -// 29-Jun-1998 mf Created file. -// 26-Aug-1998 WEB Made ELseverityLevel object less weighty. -// 16-Jun-1999 mf Added constructor from string, plus two lists -// of names to match. Also added default constructor, -// more streamlined than default lev on original. -// 23-Jun-1999 mf Modifications to properly handle pre-main order -// of initialization issues: -// Instantiation ofthe 14 const ELseverity &'s -// Instantiation of objectsInitialized as false -// Constructor of ELinitializeGlobalSeverityObjects -// Removed guarantor function in favor of the -// constructor. -// 30-Jun-1999 mf Modifications to eliminate propblems with order of -// globals initializations: -// Constructor from lev calls translate() -// Constructor from string uses translate() -// translate() method -// List of strings for names in side getname() etc. -// Immediate initilization of ELsevLevGlobals -// Mods involving ELinitializeGlobalSeverityObjects -// 12-Jun-2000 web Final fix to global static initialization problem -// 27-Jun-2000 web Fix order-of-static-destruction problem -// 24-Aug-2000 web Fix defective C++ switch generation -// 13-Jun-2007 mf Change (requested by CMS) the name Severe to System -// (since that his how MessageLogger uses that level) -// 21-Apr-2009 mf Change the symbol for ELsev_success (which is used -// by CMS for LogDebug) from -! to -d. // ---------------------------------------------------------------------- #include <cassert> @@ -44,8 +17,6 @@ #include "FWCore/MessageLogger/interface/ELseverityLevel.h" #include "FWCore/MessageLogger/interface/ELmap.h" -// Possible Traces -// #define ELsevConTRACE namespace { // ---------------------------------------------------------------------- @@ -67,6 +38,10 @@ namespace { {edm::ELinfo.getName(), edm::ELseverityLevel::ELsev_info}, {edm::ELinfo.getInputStr(), edm::ELseverityLevel::ELsev_info}, {edm::ELinfo.getVarName(), edm::ELseverityLevel::ELsev_info}, + {edm::ELfwkInfo.getSymbol(), edm::ELseverityLevel::ELsev_fwkInfo}, + {edm::ELfwkInfo.getName(), edm::ELseverityLevel::ELsev_fwkInfo}, + {edm::ELfwkInfo.getInputStr(), edm::ELseverityLevel::ELsev_fwkInfo}, + {edm::ELfwkInfo.getVarName(), edm::ELseverityLevel::ELsev_fwkInfo}, {edm::ELwarning.getSymbol(), edm::ELseverityLevel::ELsev_warning}, {edm::ELwarning.getName(), edm::ELseverityLevel::ELsev_warning}, {edm::ELwarning.getInputStr(), edm::ELseverityLevel::ELsev_warning}, @@ -113,8 +88,9 @@ namespace edm { std::array<std::string, nLevels> ret; ret[ELsev_noValueAssigned] = "0"; ret[ELsev_zeroSeverity] = "--"; - ret[ELsev_success] = "-d"; // 4/21/09 mf + ret[ELsev_success] = "-d"; ret[ELsev_info] = "-i"; + ret[ELsev_fwkInfo] = "-f"; ret[ELsev_warning] = "-w"; ret[ELsev_error] = "-e"; ret[ELsev_unspecified] = "??"; @@ -134,6 +110,7 @@ namespace edm { ret[ELsev_zeroSeverity] = "--"; ret[ELsev_success] = "Debug"; // 4/21/09 mf ret[ELsev_info] = "Info"; + ret[ELsev_fwkInfo] = "FwkInfo"; ret[ELsev_warning] = "Warning"; ret[ELsev_error] = "Error"; ret[ELsev_unspecified] = "??"; @@ -153,6 +130,7 @@ namespace edm { ret[ELsev_zeroSeverity] = "ZERO"; ret[ELsev_success] = "DEBUG"; ret[ELsev_info] = "INFO"; + ret[ELsev_fwkInfo] = "FWKINFO"; ret[ELsev_warning] = "WARNING"; ret[ELsev_error] = "ERROR"; ret[ELsev_unspecified] = "UNSPECIFIED"; @@ -172,6 +150,7 @@ namespace edm { ret[ELsev_zeroSeverity] = "ELzeroSeverity "; ret[ELsev_success] = "ELdebug "; // 4/21/09 ret[ELsev_info] = "ELinfo "; + ret[ELsev_fwkInfo] = "ELfwkInfo "; ret[ELsev_warning] = "ELwarning "; ret[ELsev_error] = "ELerror "; ret[ELsev_unspecified] = "ELunspecified "; diff --git a/FWCore/MessageLogger/src/MessageDrop.cc b/FWCore/MessageLogger/src/MessageDrop.cc index dd95abb1e6409..6317a5c4462da 100644 --- a/FWCore/MessageLogger/src/MessageDrop.cc +++ b/FWCore/MessageLogger/src/MessageDrop.cc @@ -18,43 +18,16 @@ #include "FWCore/MessageLogger/interface/MessageDrop.h" #include "FWCore/Utilities/interface/thread_safety_macros.h" -// Change Log -// -// 1 12/13/07 mf the static drops had been file-global level; moved it -// into the instance() method to cure a 24-byte memory -// leak reported by valgrind. Suggested by MP. -// -// 2 9/23/10 mf Variables supporting situations where no thresholds are -// low enough to react to LogDebug (or info, or warning) -// -// 3 11/2/10 mf, crj Prepare moduleContext method: -// see MessageServer/src/MessageLogger.cc change 17. -// Change is extensive, involving StringProducer and -// its derivative classes. -// -// 4 11/29/10 mf Intitalize all local string-holders in the various -// string producers. -// -// 5 mf 11/30/10 Snapshot method to prepare for invalidation of the -// pointers used to hold module context. Supports -// surviving throws that cause objects to go out of scope. -// -// 6 mf 12/7/10 Fix in snapshot method to avoid strncpy from -// a string to the identical address, which valgrind -// reports as an overlap problem. -// -// 7 fwyzard 7/6/11 Add support for discarding LogError-level messages -// on a per-module basis (needed at HLT) - using namespace edm; // The following are false at initialization (in case configure is not done) // and are set true at the start of configure_ordinary_destinations, // but are set false once a destination is thresholded to react to the // corresponding severity: -bool MessageDrop::debugAlwaysSuppressed = false; // change log 2 -bool MessageDrop::infoAlwaysSuppressed = false; // change log 2 -bool MessageDrop::warningAlwaysSuppressed = false; // change log 2 +bool MessageDrop::debugAlwaysSuppressed = false; +bool MessageDrop::infoAlwaysSuppressed = false; +bool MessageDrop::fwkInfoAlwaysSuppressed = false; +bool MessageDrop::warningAlwaysSuppressed = false; std::string MessageDrop::jobMode{}; MessageDrop* MessageDrop::instance() { @@ -165,6 +138,7 @@ namespace edm { streamID(std::numeric_limits<unsigned int>::max()), debugEnabled(true), infoEnabled(true), + fwkInfoEnabled(true), warningEnabled(true), errorEnabled(true), spWithPhase(new messagedrop::StringProducerWithPhase), diff --git a/FWCore/MessageService/doc/cfg_validation.txt b/FWCore/MessageService/doc/cfg_validation.txt index 2bcf4839f4514..fda136a52dcc2 100644 --- a/FWCore/MessageService/doc/cfg_validation.txt +++ b/FWCore/MessageService/doc/cfg_validation.txt @@ -32,6 +32,7 @@ At the main level, only the following vstrings are allowed: debugModules vstring suppressInfo vstring + suppressFwkInfo vstring suppressDebug vstring suppressWarning vstring diff --git a/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py b/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py index 489f68504faa4..e476e1be80d60 100644 --- a/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py +++ b/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py @@ -2,6 +2,7 @@ MessageLogger = cms.Service("MessageLogger", suppressInfo = cms.untracked.vstring(), + suppressFwkInfo = cms.untracked.vstring(), debugs = cms.untracked.PSet( placeholder = cms.untracked.bool(True) ), diff --git a/FWCore/MessageService/python/MessageLogger_cfi.py b/FWCore/MessageService/python/MessageLogger_cfi.py index b656b1aec8a19..b45aed7202170 100644 --- a/FWCore/MessageService/python/MessageLogger_cfi.py +++ b/FWCore/MessageService/python/MessageLogger_cfi.py @@ -2,6 +2,7 @@ MessageLogger = cms.Service("MessageLogger", suppressInfo = cms.untracked.vstring(), + suppressFwkInfo = cms.untracked.vstring(), debugs = cms.untracked.PSet( placeholder = cms.untracked.bool(True) ), diff --git a/FWCore/MessageService/src/MessageLogger.cc b/FWCore/MessageService/src/MessageLogger.cc index 11839cbf8fcf1..fde86d978589d 100644 --- a/FWCore/MessageService/src/MessageLogger.cc +++ b/FWCore/MessageService/src/MessageLogger.cc @@ -9,68 +9,6 @@ // Original Author: W. Brown, M. Fischler // Created: Fri Nov 11 16:42:39 CST 2005 // -// Change log -// -// 1 mf 5/12/06 In ctor, MessageDrop::debugEnabled is set to a -// sensible value in case action happens before modules -// are entered. If any modules enable debugs, such -// LogDebug messages are not immediately discarded -// (though they might be filtered at the server side). -// -// 2 mf 5/27/06 In preEventProcessing, change the syntax for -// runEvent from 1/23 to Run: 1 Event: 23 -// -// 3 mf 6/27/06 PreModuleConstruction and PreSourceConstruction get -// correct module name -// -// 4 mf 6/27/06 Between events the run/event is previous one -// -// 5 mf 3/30/07 Support for --jobreport option -// -// 6 mf 6/6/07 Remove the catches for forgiveness of tracked -// parameters -// -// 7 mf 6/19/07 Support for --jobreport option -// -// 8 wmtan 6/25/07 Enable suppression for sources, just as for modules -// -// 9 mf 7/25/07 Modify names of the MessageLoggerQ methods, eg MLqLOG -// -//10 mf 6/18/07 Insert into the PostEndJob a possible SummarizeInJobReport -// -//11 mf 3/18/09 Fix wrong-sense test establishing anyDebugEnabled_ -// -//12 mf 5/19/09 MessageService PSet Validation -// -//13 mf 5/26/09 Get parameters without throwing since validation -// will point out any problems and throw at that point -// -//14 mf 7/1/09 Establish module name and set up enables/suppresses -// for all possible calls supplying module descriptor -// -//14 mf 7/1/09 Establish pseudo-module name and set up -// enables/suppresses for other calls from framework -//15 mf 9/8/09 Clean up erroneous assignments of some callbacks -// for specific watch routines (eg PreXYZ called postXYZ) -// -//16 mf 9/8/09 Eliminate caching by descriptor address during ctor -// phases (since addresses are not yet permanent then) -// -//17 mf 11/2/10 Move preparation of module out to MessageDrop methods -// crj which will only be called if a message is actually -// issued. Caching of the work is done within MessageDrop -// so that case of many messages in a module is still fast. -// -//18 mf 11/2/10 Eliminated curr_module, since it was only being used -// as a local variable for preparation of name (never -// used to transfer info between functions) and change -// 17 obviates its need. -// -// 19 mf 11/30/10 Add a messageDrop->snapshot() when establishing -// crj module ctors, to cure bug 75836. -// -// 20 fwyzard 7/06/11 Add support fro dropping LogError messages -// on a per-module basis (needed at HLT) // system include files // user include files @@ -189,6 +127,7 @@ namespace edm { vString debugModules; vString suppressDebug; vString suppressInfo; + vString suppressFwkInfo; vString suppressWarning; vString suppressError; // change log 20 @@ -204,6 +143,8 @@ namespace edm { suppressInfo = iPS.getUntrackedParameter<vString>("suppressInfo", empty_vString); + suppressFwkInfo = iPS.getUntrackedParameter<vString>("suppressFwkInfo", empty_vString); + suppressWarning = iPS.getUntrackedParameter<vString>("suppressWarning", empty_vString); suppressError = // change log 20 @@ -222,6 +163,10 @@ namespace edm { suppression_levels_[*it] = ELseverityLevel::ELsev_info; } + for (vString::const_iterator it = suppressFwkInfo.begin(); it != suppressFwkInfo.end(); ++it) { + suppression_levels_[*it] = ELseverityLevel::ELsev_fwkInfo; + } + for (vString::const_iterator it = suppressWarning.begin(); it != suppressWarning.end(); ++it) { suppression_levels_[*it] = ELseverityLevel::ELsev_warning; } @@ -403,10 +348,12 @@ namespace edm { if (it != suppression_levels_.end()) { messageDrop->debugEnabled = messageDrop->debugEnabled && (it->second < ELseverityLevel::ELsev_success); messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info); + messageDrop->fwkInfoEnabled = (it->second < ELseverityLevel::ELsev_fwkInfo); messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning); messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error); } else { messageDrop->infoEnabled = true; + messageDrop->fwkInfoEnabled = true; messageDrop->warningEnabled = true; messageDrop->errorEnabled = true; } @@ -442,10 +389,12 @@ namespace edm { if (it != suppression_levels_.end()) { messageDrop->debugEnabled = messageDrop->debugEnabled && (it->second < ELseverityLevel::ELsev_success); messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info); + messageDrop->fwkInfoEnabled = (it->second < ELseverityLevel::ELsev_fwkInfo); messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning); messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error); } else { messageDrop->infoEnabled = true; + messageDrop->fwkInfoEnabled = true; messageDrop->warningEnabled = true; messageDrop->errorEnabled = true; } @@ -517,10 +466,12 @@ namespace edm { if (it != suppression_levels_.end()) { messageDrop->debugEnabled = messageDrop->debugEnabled && (it->second < ELseverityLevel::ELsev_success); messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info); + messageDrop->fwkInfoEnabled = (it->second < ELseverityLevel::ELsev_fwkInfo); messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning); messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error); } else { messageDrop->infoEnabled = true; + messageDrop->fwkInfoEnabled = true; messageDrop->warningEnabled = true; messageDrop->errorEnabled = true; } diff --git a/FWCore/MessageService/src/MessageLoggerScribe.cc b/FWCore/MessageService/src/MessageLoggerScribe.cc index 30868f786031f..005ccd042d815 100644 --- a/FWCore/MessageService/src/MessageLoggerScribe.cc +++ b/FWCore/MessageService/src/MessageLoggerScribe.cc @@ -2,185 +2,6 @@ // // MessageLoggerScribe.cc // -// Changes: -// -// 1 - 3/22/06 mf - in configure_dest() -// Repaired the fact that destination limits for categories -// were not being effective: -// a) use values from the destination specific default PSet -// rather than the overall default PSet to set these -// b) when an explicit value has been set - either by overall default or -// by a destination specific default PSet - set that limit or -// timespan for that dest_ctrl via a "*" msgId. -// -// 2 - 3/22/06 mf - in configure_dest() -// Enabled the use of -1 in the .cfg file to mean infinite limit -// or timespan. This is done by: -// a) replacing the default value of -1 (by which we recognize -// never-specified values) by NO_VALUE_SET = -45654 -// b) checking for values of -1 and substituting a very large integer -// -// 3 - 4/28/06 mf - in configure_dest() -// Mods to help deal with the fact that checking for an empty PSet is -// unwise when untracked parameters are involved: The PSet will appear -// to be empty and if skipped, will result in limits not being applied. -// a) Replaced default values directly in getAparameter with variables -// which can be examined all in one place. -// b) Carefully checked that we are never comparing to the empty PSet -// -// 4 - 4/28/06 mf - in configure_dest() -// If a destination name does not have an extension, append .log -// (or in the case of a FwkJobReport, .xml). -// [note for this change - the filename kept as an index to stream_ps -// can be kept as its original name; it is just a tool for assigning -// the right shared stream to statistics destinations] -// -// 5 - 4/28/06 mf - in configure_dest() -// Provision for an overall default affecting all categories, for -// example, establishing a limit for all a specific category for -// every destination. -// -// 6 - 5/18/06 mf - in configure_dest() -// Implement establishing intervals between reacting to message of -// some type. -// -// 7 - 5/24/06 mf - in configure_dest() -// Corrected algorithm for estabolishing limits and intervals, avoiding -// interference between setting the one and getting the default for the -// other. -// -// 8 - 5/31/06 wmtan - in configure_errorlog() -// The presence of the framework job report should not affect the output -// to the early destination (cerr). -// -// 9 - 6/6/06 mf - in configure_dest() -// Support for placeholder PSet without actually creating the destination. -// Useful in a .cfi file, in conjunction with potential replace commands. -// -// 10 - 6/6/06 mf - in configure_dest() -// Changed cfg keyword interval to reportEvery -// -// 11 - 6/12/06 mf - in configure_errorlog() -// Check for placeholder before attaching a destination that may not be -// wanted. -// -// 12 - 6/14/06 mf - in configure_external_dests() -// Clear the list of external dests needing configuration, if there -// is no configuration file available. -// -// 13 - 8/7/06 mf - in configure_external_dests() -// Undo change 12: the list of external dests needing configuration -// is left intact if there is no configuration file available, the -// assumption being that at some later time there will be a file and -// the message logger will be configured again. -// -// Note: The change made in (12) and un-done here was necessary to -// prevent segfault behavior when a job is done with external -// destinations and no .cfg file under some circumstances. -// D. Evans (who was being hit with that behavior due to an -// accidental .cfg omission) asserts (8/16) that running with -// no .cfg file is a sufficient anomoly that the current change -// is acceptable. -// -// 14 - 10/18/06 mf - in configure_error_log() -// Finer control of output file name for a given destination: -// Accept a parameter extension, to specify some extension other than -// .log without needing to place a dot in the Pset name. Also accept -// an explicit filename. -// -// 15 - 2/11/07 mf - at bottom -// Declared static_errorlog_p -// -// 16 - 3/13/07 mf - in configure_errorlog() and addition of 3 functions -// Break out the configuring of each type of destination, for sanity. -// -// 17 - 3/13/07 mf - in run(), at CONFIGURE case -// Use the handshake to make this synchronous, and pass any throw -// across to the other thread. -// -// 18 - 3/14/07 mf - in configure_ordinary_destinations() and 2 others -// Use actual filename in a master ostream_ps list, and behave correctly -// when duplicates are found (duplicate names both used leads to grim -// file behavior when one file is opened as two streams). -// -// 19 - 3/15/07 mf - in configure_fwkJobReports() -// "Deturdification" - default is to not produce a job reports; a -// command-line option lets you produce them. -// -// 20 - 3/15/07 mf - in configure_statistics() and configure_fwkJobReports() -// Handle the placeholder case -// -// 21 - 3/15/07 mf - run() -// Improve the behavior of catches of exceptions in non-synchronous -// command cases: Unless the ConfigurationHandshake is used, re-throw -// is not an option, but exit is also not very good. -// -// 22 - 4/18/07 mf - in configure_error_log and its called functions -// Allow for duplicate file names if configuration happens twice. -// -// 23 - 6/13/07 mf - in configure_statistics -// Repared error of calling "cerr" "err", which would cause appended -// statistics destinations going to cerr to instead come out in a file -// err.log -// -// 24 - 6/15/07 mf - in configure_errlog and its descendants -// Major mods to hardwire defaults taken from the .cfi file -// To allow flexibility, this depends on MessageLoggerDefaults.h -// -// 25 - 7/24/07 mf - in run() -// A command SHUT_UP to deactivate, and in the LOG_A_MESSGE case, response to -// that command. This allows supression of the generator info in case of a -// completely .cfg-less cmsRun command. -// -// 26 - 8/7/07 mf - in run() -// A command FLUSH_LOG_Q to consume the entire queue, processing each -// message. Actually, the key is that on the other side, it is used in -// a synchronous manner (like CONFIGURE) so as soon as one gets up to -// the flush command, the queue has in fact been flushed! -// -// 27 - 8/16/07 mf - in run() -// A command GROUP_STATS to add a category to a list which ELstatistics -// will use to avoid separate per-module statistics for that category. -// -// 28 - 6/18/08 mf - in CONFIGURE case and FLUSH_LOG_Q case -// Changed expectation of p from a ParameterSet* to a void*: -// static cast it to the needed ParameterSet* -// -// 29 - 6/19/08 mf - in run() and a new function triggerFJRmessageSummary() -// Implemented filling a map with summary info for the Job Report -// -// 30 - 6/20/08 mf - in run() -// Setting MessageLoggerScribeIsRunning -// -// 31 - 7/9/08 mf - in configure_ordinary_destinations() -// and configure_statistics() -// using hardwired default output filename if there is one -// -// 32 - 10/21/08 mf - in ctor and in run() and new runCommand() -// split up run() to have ability to implement single-thread -// -// 33 - 10/22/08 mf -// implementation of singleThread -// -// 34 - 5/13/09 mf -// Allowing threshold to be set for default destination in default PSet -// -// 35 - 5/29/09 mf -// Avoiding throw when duplicate destination names are used, to let the -// validation report that and abort instead. -// -// 36 - 8/10/09 mf, cdj -// Use ThreadQ in place of the singleton MessageLoggerQ to consume -// -// 37 - 9/24/10 mf -// Establish values of debugAlwaysSuppressed, infoAlwaysSuppressed -// and warningAlwaysSuppressed when setting up thresholds -// -// 38 - 9/29/10 mf, ql -// Limit and timespan shuold be translated from -1 input to -// 2000000000. This was being done in all cases except the -// severity limits; omission rectified. -// // ---------------------------------------------------------------------- #include "FWCore/MessageService/src/MessageLoggerScribe.h" @@ -192,8 +13,8 @@ #include "FWCore/MessageLogger/interface/ErrorObj.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/MessageService/src/ConfigurationHandshake.h" -#include "FWCore/MessageLogger/interface/MessageDrop.h" // change log 37 -#include "FWCore/MessageLogger/interface/ELseverityLevel.h" // change log 37 +#include "FWCore/MessageLogger/interface/MessageDrop.h" +#include "FWCore/MessageLogger/interface/ELseverityLevel.h" #include "FWCore/Utilities/interface/EDMException.h" #include "FWCore/Utilities/interface/Algorithms.h" @@ -216,16 +37,11 @@ namespace edm { job_pset_p(), clean_slate_configuration(true), active(true), - singleThread(queue.get() == nullptr) // changeLog 36 - , - done(false) // changeLog 32 - , - purge_mode(false) // changeLog 32 - , - count(false) // changeLog 32 - , - m_queue(queue) // changeLog 36 - {} + singleThread(queue.get() == nullptr), + done(false), + purge_mode(false), + count(false), + m_queue(queue) {} MessageLoggerScribe::~MessageLoggerScribe() { admin_p->finish(); } @@ -233,22 +49,19 @@ namespace edm { MessageLoggerQ::OpCode opcode; void* operand; - MessageDrop::instance()->messageLoggerScribeIsRunning = MLSCRIBE_RUNNING_INDICATOR; // ChangeLog 30 + MessageDrop::instance()->messageLoggerScribeIsRunning = MLSCRIBE_RUNNING_INDICATOR; // std::cerr << "MessageLoggerScribe::run(): \n"; // std::cerr << "messageLoggerScribeIsRunning = " // << (int)MessageDrop::instance()->messageLoggerScribeIsRunning << "\n"; do { m_queue->consume(opcode, operand); // grab next work item from Q - // changeLog 36 runCommand(opcode, operand); } while (!done); } // MessageLoggerScribe::run() - void MessageLoggerScribe::runCommand( // changeLog 32 - MessageLoggerQ::OpCode opcode, - void* operand) { + void MessageLoggerScribe::runCommand(MessageLoggerQ::OpCode opcode, void* operand) { switch (opcode) { // interpret the work item default: { assert(false); // can't happen (we certainly hope!) @@ -257,7 +70,7 @@ namespace edm { case MessageLoggerQ::END_THREAD: { assert(operand == nullptr); done = true; - MessageDrop::instance()->messageLoggerScribeIsRunning = (unsigned char)-1; // ChangeLog 30 + MessageDrop::instance()->messageLoggerScribeIsRunning = (unsigned char)-1; break; } case MessageLoggerQ::LOG_A_MESSAGE: { @@ -283,7 +96,7 @@ namespace edm { delete errorobj_p; // dispose of the message text break; } - case MessageLoggerQ::CONFIGURE: { // changelog 17 + case MessageLoggerQ::CONFIGURE: { if (singleThread) { job_pset_p = std::shared_ptr<PSet>(static_cast<PSet*>(operand)); // propagate_const<T> has no reset() function @@ -329,7 +142,7 @@ namespace edm { } break; } - case MessageLoggerQ::JOBMODE: { // change log 24 + case MessageLoggerQ::JOBMODE: { std::string* jobMode_p = static_cast<std::string*>(operand); JobMode jm = MessageLoggerDefaults::mode(*jobMode_p); messageLoggerDefaults = value_ptr<MessageLoggerDefaults>(new MessageLoggerDefaults(jm)); @@ -345,7 +158,7 @@ namespace edm { active = false; break; } - case MessageLoggerQ::FLUSH_LOG_Q: { // changelog 26 + case MessageLoggerQ::FLUSH_LOG_Q: { if (singleThread) return; ConfigurationHandshake* h_p = static_cast<ConfigurationHandshake*>(operand); @@ -355,13 +168,13 @@ namespace edm { // finally, release the scoped lock by letting it go out of scope break; } - case MessageLoggerQ::GROUP_STATS: { // change log 27 + case MessageLoggerQ::GROUP_STATS: { std::string* cat_p = static_cast<std::string*>(operand); ELstatistics::noteGroupedCategory(*cat_p); delete cat_p; // dispose of the message text break; } - case MessageLoggerQ::FJR_SUMMARY: { // changelog 29 + case MessageLoggerQ::FJR_SUMMARY: { if (singleThread) { std::map<std::string, double>* smp = static_cast<std::map<std::string, double>*>(operand); triggerFJRmessageSummary(*smp); @@ -417,22 +230,22 @@ namespace edm { if (!stream_ps.empty()) { LogWarning("multiLogConfig") << "The message logger has been configured multiple times"; - clean_slate_configuration = false; // Change Log 22 + clean_slate_configuration = false; } - configure_ordinary_destinations(); // Change Log 16 - configure_statistics(); // Change Log 16 - } // MessageLoggerScribe::configure_errorlog() + configure_ordinary_destinations(); + configure_statistics(); + } // MessageLoggerScribe::configure_errorlog() void MessageLoggerScribe::configure_dest(std::shared_ptr<ELdestination> dest_ctrl, String const& filename) { - static const int NO_VALUE_SET = -45654; // change log 2 + static const int NO_VALUE_SET = -45654; vString empty_vString; PSet empty_PSet; String empty_String; - // Defaults: // change log 3a + // Defaults: const std::string COMMON_DEFAULT_THRESHOLD = "INFO"; const int COMMON_DEFAULT_LIMIT = NO_VALUE_SET; - const int COMMON_DEFAULT_INTERVAL = NO_VALUE_SET; // change log 6 + const int COMMON_DEFAULT_INTERVAL = NO_VALUE_SET; const int COMMON_DEFAULT_TIMESPAN = NO_VALUE_SET; char const* severity_array[] = {"WARNING", "INFO", "ERROR", "DEBUG"}; @@ -451,7 +264,7 @@ namespace edm { } // no longer need messageIDs // grab list of hardwired categories (hardcats) -- these are to be added - // to the list of categories -- change log 24 + // to the list of categories { std::vector<std::string> hardcats = messageLoggerDefaults->categories; // combine the lists, not caring about possible duplicates (for now) @@ -460,24 +273,18 @@ namespace edm { // grab default threshold common to all destinations String default_threshold = getAparameter<String>(*job_pset_p, "threshold", empty_String); - // change log 3a - // change log 24 // grab default limit/interval/timespan common to all destinations/categories: PSet default_pset = getAparameter<PSet>(*job_pset_p, "default", empty_PSet); int default_limit = getAparameter<int>(default_pset, "limit", COMMON_DEFAULT_LIMIT); int default_interval = getAparameter<int>(default_pset, "reportEvery", COMMON_DEFAULT_INTERVAL); - // change log 6, 10 int default_timespan = getAparameter<int>(default_pset, "timespan", COMMON_DEFAULT_TIMESPAN); - // change log 2a - // change log 3a String default_pset_threshold = getAparameter<String>(default_pset, "threshold", default_threshold); - // change log 34 // grab all of this destination's parameters: PSet dest_pset = getAparameter<PSet>(*job_pset_p, filename, empty_PSet); - // See if this is just a placeholder // change log 9 + // See if this is just a placeholder bool is_placeholder = getAparameter<bool>(dest_pset, "placeholder", false); if (is_placeholder) return; @@ -486,29 +293,27 @@ namespace edm { PSet dest_default_pset = getAparameter<PSet>(dest_pset, "default", empty_PSet); int dest_default_limit = getAparameter<int>(dest_default_pset, "limit", default_limit); int dest_default_interval = getAparameter<int>(dest_default_pset, "reportEvery", default_interval); - // change log 6 int dest_default_timespan = getAparameter<int>(dest_default_pset, "timespan", default_timespan); - // change log 1a if (dest_default_limit != NO_VALUE_SET) { if (dest_default_limit < 0) dest_default_limit = 2000000000; dest_ctrl->setLimit("*", dest_default_limit); - } // change log 1b, 2a, 2b - if (dest_default_interval != NO_VALUE_SET) { // change log 6 + } + if (dest_default_interval != NO_VALUE_SET) { dest_ctrl->setInterval("*", dest_default_interval); } if (dest_default_timespan != NO_VALUE_SET) { if (dest_default_timespan < 0) dest_default_timespan = 2000000000; dest_ctrl->setTimespan("*", dest_default_timespan); - } // change log 1b, 2a, 2b + } // establish this destination's threshold: String dest_threshold = getAparameter<String>(dest_pset, "threshold", default_threshold); if (dest_threshold == empty_String) { dest_threshold = default_threshold; } - if (dest_threshold == empty_String) { // change log 34 + if (dest_threshold == empty_String) { dest_threshold = default_pset_threshold; } if (dest_threshold == empty_String) { @@ -518,13 +323,15 @@ namespace edm { dest_threshold = COMMON_DEFAULT_THRESHOLD; ELseverityLevel threshold_sev(dest_threshold); dest_ctrl->setThreshold(threshold_sev); - // change log 37 if (threshold_sev <= ELseverityLevel::ELsev_success) { edm::MessageDrop::debugAlwaysSuppressed = false; } if (threshold_sev <= ELseverityLevel::ELsev_info) { edm::MessageDrop::infoAlwaysSuppressed = false; } + if (threshold_sev <= ELseverityLevel::ELsev_fwkInfo) { + edm::MessageDrop::fwkInfoAlwaysSuppressed = false; + } if (threshold_sev <= ELseverityLevel::ELsev_warning) { edm::MessageDrop::warningAlwaysSuppressed = false; } @@ -532,33 +339,30 @@ namespace edm { // establish this destination's limit/interval/timespan for each category: for (vString::const_iterator id_it = categories.begin(); id_it != categories.end(); ++id_it) { String msgID = *id_it; - PSet default_category_pset = getAparameter<PSet>(default_pset, msgID, empty_PSet); // change log 5 + PSet default_category_pset = getAparameter<PSet>(default_pset, msgID, empty_PSet); PSet category_pset = getAparameter<PSet>(dest_pset, msgID, default_category_pset); int category_default_limit = getAparameter<int>(default_category_pset, "limit", NO_VALUE_SET); int limit = getAparameter<int>(category_pset, "limit", category_default_limit); if (limit == NO_VALUE_SET) limit = dest_default_limit; - // change log 7 int category_default_interval = getAparameter<int>(default_category_pset, "reportEvery", NO_VALUE_SET); int interval = getAparameter<int>(category_pset, "reportEvery", category_default_interval); if (interval == NO_VALUE_SET) interval = dest_default_interval; - // change log 6 and then 7 int category_default_timespan = getAparameter<int>(default_category_pset, "timespan", NO_VALUE_SET); int timespan = getAparameter<int>(category_pset, "timespan", category_default_timespan); if (timespan == NO_VALUE_SET) timespan = dest_default_timespan; - // change log 7 const std::string& category = msgID; - if (limit == NO_VALUE_SET) { // change log 24 + if (limit == NO_VALUE_SET) { limit = messageLoggerDefaults->limit(filename, category); } - if (interval == NO_VALUE_SET) { // change log 24 + if (interval == NO_VALUE_SET) { interval = messageLoggerDefaults->reportEvery(filename, category); } - if (timespan == NO_VALUE_SET) { // change log 24 + if (timespan == NO_VALUE_SET) { timespan = messageLoggerDefaults->timespan(filename, category); } @@ -574,7 +378,7 @@ namespace edm { if (timespan < 0) timespan = 2000000000; dest_ctrl->setTimespan(msgID, timespan); - } // change log 2a, 2b + } } // for @@ -584,44 +388,41 @@ namespace edm { ELseverityLevel severity(sevID); PSet default_sev_pset = getAparameter<PSet>(default_pset, sevID, empty_PSet); PSet sev_pset = getAparameter<PSet>(dest_pset, sevID, default_sev_pset); - // change log 5 int limit = getAparameter<int>(sev_pset, "limit", NO_VALUE_SET); - if (limit == NO_VALUE_SET) { // change log 24 + if (limit == NO_VALUE_SET) { limit = messageLoggerDefaults->sev_limit(filename, sevID); } if (limit != NO_VALUE_SET) { if (limit < 0) - limit = 2000000000; // change log 38 + limit = 2000000000; dest_ctrl->setLimit(severity, limit); } int interval = getAparameter<int>(sev_pset, "reportEvery", NO_VALUE_SET); - if (interval == NO_VALUE_SET) { // change log 24 + if (interval == NO_VALUE_SET) { interval = messageLoggerDefaults->sev_reportEvery(filename, sevID); } if (interval != NO_VALUE_SET) dest_ctrl->setInterval(severity, interval); // change log 2 int timespan = getAparameter<int>(sev_pset, "timespan", NO_VALUE_SET); - if (timespan == NO_VALUE_SET) { // change log 24 + if (timespan == NO_VALUE_SET) { timespan = messageLoggerDefaults->sev_timespan(filename, sevID); } if (timespan != NO_VALUE_SET) { if (timespan < 0) - timespan = 2000000000; // change log 38 + timespan = 2000000000; dest_ctrl->setTimespan(severity, timespan); } } // for // establish this destination's linebreak policy: bool noLineBreaks_default = getAparameter<bool>(default_pset, "noLineBreaks", false); - // change log 5 bool noLineBreaks = getAparameter<bool>(dest_pset, "noLineBreaks", noLineBreaks_default); if (noLineBreaks) { dest_ctrl->setLineLength(32000); } else { int lenDef = 80; int lineLen_default = getAparameter<int>(default_pset, "lineLength", lenDef); - // change log 5 int lineLen = getAparameter<int>(dest_pset, "lineLength", lineLen_default); if (lineLen != lenDef) { dest_ctrl->setLineLength(lineLen); @@ -637,22 +438,22 @@ namespace edm { } // MessageLoggerScribe::configure_dest() - void MessageLoggerScribe::configure_ordinary_destinations() // Changelog 16 - { + void MessageLoggerScribe::configure_ordinary_destinations() { vString empty_vString; String empty_String; PSet empty_PSet; // Initialize unversal suppression variables - MessageDrop::debugAlwaysSuppressed = true; // change log 37 - MessageDrop::infoAlwaysSuppressed = true; // change log 37 - MessageDrop::warningAlwaysSuppressed = true; // change log 37 + MessageDrop::debugAlwaysSuppressed = true; + MessageDrop::infoAlwaysSuppressed = true; + MessageDrop::fwkInfoAlwaysSuppressed = true; + MessageDrop::warningAlwaysSuppressed = true; // grab list of destinations: vString destinations = getAparameter<vString>(*job_pset_p, "destinations", empty_vString); // Use the default list of destinations if and only if the grabbed list is - // empty // change log 24 + // empty if (destinations.empty()) { destinations = messageLoggerDefaults->destinations; } @@ -666,14 +467,13 @@ namespace edm { String filename = *it; String psetname = filename; - // check that this destination is not just a placeholder // change log 11 + // check that this destination is not just a placeholder PSet dest_pset = getAparameter<PSet>(*job_pset_p, psetname, empty_PSet); bool is_placeholder = getAparameter<bool>(dest_pset, "placeholder", false); if (is_placeholder) continue; // Modify the file name if extension or name is explicitly specified - // change log 14 // Although for an ordinary destination there is no output attribute // for the cfg (you can use filename instead) we provide output() for @@ -686,7 +486,7 @@ namespace edm { // supplied in the cfg. String filename_default = getAparameter<String>(dest_pset, "output", empty_String); if (filename_default == empty_String) { - filename_default = messageLoggerDefaults->output(psetname); // change log 31 + filename_default = messageLoggerDefaults->output(psetname); if (filename_default == empty_String) { filename_default = filename; } @@ -707,7 +507,7 @@ namespace edm { // Attach a default extension of .log if there is no extension on a file // change log 18 - this had been done in concert with attaching destination - std::string actual_filename = filename; // change log 4 + std::string actual_filename = filename; if ((filename != "cout") && (filename != "cerr")) { const std::string::size_type npos = std::string::npos; if (filename.find('.') == npos) { @@ -715,11 +515,10 @@ namespace edm { } } - // Check that this is not a duplicate name // change log 18 + // Check that this is not a duplicate name if (stream_ps.find(actual_filename) != stream_ps.end()) { - if (clean_slate_configuration) { // change log 22 - // throw edm::Exception ( edm::errors::Configuration ) - LogError("duplicateDestination") // change log 35 + if (clean_slate_configuration) { + LogError("duplicateDestination") << "Duplicate name for a MessageLogger Destination: " << actual_filename << "\n" << "Only the first configuration instructions are used"; continue; @@ -766,7 +565,7 @@ namespace edm { // grab list of statistics destinations: vString statistics = getAparameter<vString>(*job_pset_p, "statistics", empty_vString); - bool no_statistics_configured = statistics.empty(); // change log 24 + bool no_statistics_configured = statistics.empty(); if (no_statistics_configured) { // Read the list of staistics destinations from hardwired defaults, @@ -794,7 +593,7 @@ namespace edm { // Determine the destination file name String filename = getAparameter<String>(stat_pset, "output", empty_String); if (filename == empty_String) { - filename = messageLoggerDefaults->output(psetname); // change log 31 + filename = messageLoggerDefaults->output(psetname); if (filename == empty_String) { filename = statname; } @@ -817,10 +616,10 @@ namespace edm { } // Attach a default extension of .log if there is no extension on a file - // change log 18 - this had been done in concert with attaching destination + // this had been done in concert with attaching destination - std::string actual_filename = filename; // change log 4 - if ((filename != "cout") && (filename != "cerr")) { // change log 23 + std::string actual_filename = filename; + if ((filename != "cout") && (filename != "cerr")) { const std::string::size_type npos = std::string::npos; if (filename.find('.') == npos) { actual_filename += ".log"; @@ -831,7 +630,7 @@ namespace edm { // unless it is an ordinary destination (which stats can share) if (!search_all(ordinary_destination_filenames, actual_filename)) { if (stream_ps.find(actual_filename) != stream_ps.end()) { - if (clean_slate_configuration) { // change log 22 + if (clean_slate_configuration) { throw edm::Exception(edm::errors::Configuration) << "Duplicate name for a MessageLogger Statistics Destination: " << actual_filename << "\n"; } else { @@ -847,7 +646,7 @@ namespace edm { // or note (if statistics file matches a destination file name) the ostream. // But if no statistics destinations were provided in the config, do not // create a new destination for this hardwired statistics - only act if - // it is matches a destination. (shange log 24) + // it is matches a destination. bool statistics_destination_is_real = !no_statistics_configured; std::ostream* os_p; if (stream_ps.find(actual_filename) == stream_ps.end()) { @@ -862,11 +661,11 @@ namespace edm { } stream_ps[actual_filename] = os_p; } else { - statistics_destination_is_real = true; // change log 24 + statistics_destination_is_real = true; os_p = stream_ps[actual_filename]; } - if (statistics_destination_is_real) { // change log 24 + if (statistics_destination_is_real) { // attach the statistics destination, keeping a control handle to it: auto stat = std::make_shared<ELstatistics>(*os_p); admin_p->attach(stat); @@ -910,8 +709,7 @@ namespace edm { } } - void MessageLoggerScribe::triggerFJRmessageSummary(std::map<std::string, double>& sm) // ChangeLog 29 - { + void MessageLoggerScribe::triggerFJRmessageSummary(std::map<std::string, double>& sm) { if (statisticsDestControls.empty()) { sm["NoStatisticsDestinationsConfigured"] = 0.0; } else { diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.cc b/FWCore/MessageService/src/MessageServicePSetValidation.cc index 13b0b2a5ef7b5..b5e4a121fb1af 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.cc +++ b/FWCore/MessageService/src/MessageServicePSetValidation.cc @@ -9,8 +9,6 @@ // Original Author: M. Fischler // Created: Wed May 20 2009 // -// Change log -// // // system include files @@ -161,6 +159,12 @@ namespace edm { << " PSet: \n" << "Use of wildcard (*) in suppressInfo is not supported\n"; } + suppressFwkInfo = check<vString>(pset, "MessageLogger", "suppressFwkInfo"); + if (wildcard(suppressFwkInfo)) { + flaws << "MessageLogger" + << " PSet: \n" + << "Use of wildcard (*) in suppressFwkInfo is not supported\n"; + } suppressWarning = check<vString>(pset, "MessageLogger", "suppressWarning"); if (wildcard(suppressWarning)) { flaws << "MessageLogger" @@ -215,6 +219,8 @@ namespace edm { return true; if (s == "suppressInfo") return true; + if (s == "suppressFwkInfo") + return true; if (s == "suppressDebug") return true; if (s == "suppressWarning") @@ -323,6 +329,8 @@ namespace edm { return false; if (word == "suppressInfo") return false; + if (word == "suppressFwkInfo") + return false; if (word == "suppressDebug") return false; if (word == "suppressWarning") diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.h b/FWCore/MessageService/src/MessageServicePSetValidation.h index 4fe3d88166d51..bf55c09b9fcdf 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.h +++ b/FWCore/MessageService/src/MessageServicePSetValidation.h @@ -262,6 +262,7 @@ namespace edm { std::vector<std::string> messageIDs; std::vector<std::string> debugModules; std::vector<std::string> suppressInfo; + std::vector<std::string> suppressFwkInfo; std::vector<std::string> suppressDebug; std::vector<std::string> suppressWarning; std::vector<std::string> suppressError; diff --git a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc index b663096686f7c..e87c63a289cbc 100644 --- a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc +++ b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc @@ -319,6 +319,9 @@ namespace edm { if (threshold_sev <= ELseverityLevel::ELsev_info) { edm::MessageDrop::infoAlwaysSuppressed = false; } + if (threshold_sev <= ELseverityLevel::ELsev_fwkInfo) { + edm::MessageDrop::fwkInfoAlwaysSuppressed = false; + } if (threshold_sev <= ELseverityLevel::ELsev_warning) { edm::MessageDrop::warningAlwaysSuppressed = false; } @@ -438,9 +441,10 @@ namespace edm { PSet empty_PSet; // Initialize unversal suppression variables - MessageDrop::debugAlwaysSuppressed = true; // change log 37 - MessageDrop::infoAlwaysSuppressed = true; // change log 37 - MessageDrop::warningAlwaysSuppressed = true; // change log 37 + MessageDrop::debugAlwaysSuppressed = true; + MessageDrop::infoAlwaysSuppressed = true; + MessageDrop::fwkInfoAlwaysSuppressed = true; + MessageDrop::warningAlwaysSuppressed = true; // grab list of destinations: vString destinations = getAparameter<vString>(*job_pset_p, "destinations", empty_vString); diff --git a/FWCore/MessageService/test/standAloneTest.cpp b/FWCore/MessageService/test/standAloneTest.cpp index 2d2e146b9994e..b48bffcb37742 100644 --- a/FWCore/MessageService/test/standAloneTest.cpp +++ b/FWCore/MessageService/test/standAloneTest.cpp @@ -12,6 +12,10 @@ namespace edmtest { edm::LogInfo("cat_B") << "LogInfo was used to send cat_B"; edm::LogVerbatim("cat_A") << "LogVerbatim was used to send cat_A"; edm::LogVerbatim("cat_B") << "LogVerbatim was used to send cat_B"; + edm::LogFwkInfo("cat_A") << "LogFwkInfo was used to send cat_A"; + edm::LogFwkInfo("cat_B") << "LogFwkInfo was used to send cat_B"; + edm::LogFwkVerbatim("cat_A") << "LogFwkVerbatim was used to send cat_A"; + edm::LogFwkVerbatim("cat_B") << "LogFwkVerbatim was used to send cat_B"; edm::LogWarning("cat_A") << "LogWarning was used to send cat_A"; edm::LogWarning("cat_B") << "LogWarning was used to send cat_B"; edm::LogPrint("cat_A") << "LogPrint was used to send cat_A"; @@ -36,6 +40,10 @@ int main() { edm::setStandAloneMessageThreshold(edm::ELinfo); edmtest::sampleStandAlone(); + edm::LogImportant("note") << "threshold FWKINFO"; + edm::setStandAloneMessageThreshold(edm::ELfwkInfo); + edmtest::sampleStandAlone(); + edm::LogImportant("note") << "threshold WARNING"; edm::setStandAloneMessageThreshold(edm::ELwarning); edmtest::sampleStandAlone(); diff --git a/FWCore/MessageService/test/unit_test_outputs/standAloneWithMessageLogger.cerr b/FWCore/MessageService/test/unit_test_outputs/standAloneWithMessageLogger.cerr index 638208e8610f3..f6e57cb98aa60 100644 --- a/FWCore/MessageService/test/unit_test_outputs/standAloneWithMessageLogger.cerr +++ b/FWCore/MessageService/test/unit_test_outputs/standAloneWithMessageLogger.cerr @@ -34,6 +34,14 @@ LogInfo was used to send cat_B %MSG LogVerbatim was used to send cat_A LogVerbatim was used to send cat_B +%MSG-f cat_A: +LogFwkInfo was used to send cat_A +%MSG +%MSG-f cat_B: +LogFwkInfo was used to send cat_B +%MSG +LogFwkVerbatim was used to send cat_A +LogFwkVerbatim was used to send cat_B %MSG-w cat_A: LogWarning was used to send cat_A %MSG @@ -59,6 +67,39 @@ LogInfo was used to send cat_B %MSG LogVerbatim was used to send cat_A LogVerbatim was used to send cat_B +%MSG-f cat_A: +LogFwkInfo was used to send cat_A +%MSG +%MSG-f cat_B: +LogFwkInfo was used to send cat_B +%MSG +LogFwkVerbatim was used to send cat_A +LogFwkVerbatim was used to send cat_B +%MSG-w cat_A: +LogWarning was used to send cat_A +%MSG +%MSG-w cat_B: +LogWarning was used to send cat_B +%MSG +LogPrint was used to send cat_A +LogPrint was used to send cat_B +%MSG-e cat_A: +LogError was used to send cat_A +%MSG +%MSG-e cat_B: +LogError was used to send cat_B +%MSG +LogProblem was used to send cat_A +LogProblem was used to send cat_B +threshold FWKINFO +%MSG-f cat_A: +LogFwkInfo was used to send cat_A +%MSG +%MSG-f cat_B: +LogFwkInfo was used to send cat_B +%MSG +LogFwkVerbatim was used to send cat_A +LogFwkVerbatim was used to send cat_B %MSG-w cat_A: LogWarning was used to send cat_A %MSG diff --git a/FWCore/Modules/test/test_catch2_LogErrorFilter.cc b/FWCore/Modules/test/test_catch2_LogErrorFilter.cc index 1b540a1272f7b..fee89bf3d1e15 100644 --- a/FWCore/Modules/test/test_catch2_LogErrorFilter.cc +++ b/FWCore/Modules/test/test_catch2_LogErrorFilter.cc @@ -42,6 +42,11 @@ process.moduleToTest(process.errorFilter) REQUIRE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); REQUIRE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); } + { + ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_fwkInfo}}; + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + } { ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_info}}; REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); @@ -71,6 +76,11 @@ process.errorFilter.atLeastOneWarning = False REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); } + { + ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_fwkInfo}}; + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + } { ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_info}}; REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); @@ -100,6 +110,11 @@ process.errorFilter.atLeastOneError = False REQUIRE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); REQUIRE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); } + { + ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_fwkInfo}}; + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + } { ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_info}}; REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); @@ -142,6 +157,15 @@ process.errorFilter.avoidCategories = ["IgnoreCat"] ESVec errors = {{"IgnoreCat", "mod", edm::ELseverityLevel::ELsev_warning}}; REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); } + { + ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_fwkInfo}}; + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + } + { + ESVec errors = {{"IgnoreCat", "mod", edm::ELseverityLevel::ELsev_fwkInfo}}; + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + } { ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_info}}; REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); @@ -181,6 +205,11 @@ process.errorFilter.useThresholdsPerKind = True REQUIRE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); } + { + ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_fwkInfo}}; + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + } { ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_info}}; REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); @@ -242,6 +271,15 @@ process.errorFilter.avoidCategories = ["IgnoreCat"] REQUIRE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); } + { + ESVec errors = {{"IgnoreCat", "mod", edm::ELseverityLevel::ELsev_fwkInfo}}; + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + } + { + ESVec errors = {{"Cat", "mod", edm::ELseverityLevel::ELsev_fwkInfo}}; + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); + } { ESVec errors = {{"IgnoreCat", "mod", edm::ELseverityLevel::ELsev_info}}; REQUIRE_FALSE(tester.test(std::make_pair(putToken, std::make_unique<ESVec>(errors))).modulePassed()); From 056d257da392d50cf800cf801d231666d3a3c72d Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Thu, 15 Oct 2020 21:57:58 +0200 Subject: [PATCH 619/778] Add tools to test transition to dd4hep --- SimG4CMS/Calo/plugins/EcalSimHitDump.cc | 97 +++++++++++ SimG4CMS/Calo/src/CaloSD.cc | 3 + .../Calo/test/python/runEcalSimHitDump_cfg.py | 30 ++++ .../test/dd4hep_ZMM_Run3_Step1_cfg.py | 12 +- .../test/dd4hep_ZMM_Run3_Step2_cfg.py | 7 +- ...g.py => dd4hep_ttbar_2026D49_Step1_cfg.py} | 6 +- .../test/dd4hep_ttbar_Run3_Step1_cfg.py | 164 ++++++++++++++++++ .../test/ddd_ZMM_Run3_Step1_cfg.py | 7 +- .../test/ddd_ZMM_Run3_Step2_cfg.py | 4 + 9 files changed, 319 insertions(+), 11 deletions(-) create mode 100644 SimG4CMS/Calo/plugins/EcalSimHitDump.cc create mode 100644 SimG4CMS/Calo/test/python/runEcalSimHitDump_cfg.py rename SimG4Core/Configuration/test/{dd4hep_ttbar_2026D41_Step1_cfg.py => dd4hep_ttbar_2026D49_Step1_cfg.py} (98%) create mode 100644 SimG4Core/Configuration/test/dd4hep_ttbar_Run3_Step1_cfg.py diff --git a/SimG4CMS/Calo/plugins/EcalSimHitDump.cc b/SimG4CMS/Calo/plugins/EcalSimHitDump.cc new file mode 100644 index 0000000000000..a7f2a655a7926 --- /dev/null +++ b/SimG4CMS/Calo/plugins/EcalSimHitDump.cc @@ -0,0 +1,97 @@ +#include "DataFormats/EcalDetId/interface/EBDetId.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" +#include "DataFormats/EcalDetId/interface/ESDetId.h" +#include "DataFormats/EcalDetId/interface/EcalSubdetector.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/Utilities/interface/transform.h" + +#include "SimDataFormats/CaloHit/interface/PCaloHit.h" +#include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h" + +#include <string> +#include <vector> + +class EcalSimHitDump : public edm::one::EDAnalyzer<> { +public: + EcalSimHitDump(const edm::ParameterSet& ps); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +protected: + void analyze(edm::Event const&, edm::EventSetup const&) override; + +private: + + const std::string g4Label_; + const std::vector<std::string> hitLab_; + const std::vector<edm::EDGetTokenT<edm::PCaloHitContainer> > toksCalo_; + const std::vector<int> types_; + const int maxEvent_; + int kount_; +}; + +EcalSimHitDump::EcalSimHitDump(const edm::ParameterSet& ps) : + g4Label_(ps.getParameter<std::string>("ModuleLabel")), + hitLab_(ps.getParameter<std::vector<std::string>>("HitCollections")), + toksCalo_{ + edm::vector_transform(hitLab_, + [this](const std::string& name) { + return consumes<edm::PCaloHitContainer>( + edm::InputTag{g4Label_, name}); + })}, + types_(ps.getParameter<std::vector<int>>("CollectionTypes")), + maxEvent_(ps.getParameter<int>("MaxEvent")), + kount_(0) { + + edm::LogVerbatim("HitStudy") << "Module Label: " << g4Label_ << " with " << hitLab_.size() << " collections and maxEvent = " << maxEvent_; + for (unsigned int k = 0; k < hitLab_.size(); ++k) + edm::LogVerbatim("HitStudy") << "[" << k << "] Type " << types_[k] << " Label " << hitLab_[k]; +} + +void EcalSimHitDump::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + std::vector<std::string> coll = {"EcalHitsEB", "EcalHitsEE", "EcalHitsES"}; + std::vector<int> type = {0, 1, 2}; + desc.add<std::string>("ModuleLabel", "g4SimHits"); + desc.add<std::vector<std::string> >("HitCollections", coll); + desc.add<std::vector<int> >("CollectionTypes", type); + desc.add<int>("MaxEvent", 10); + descriptions.add("ecalSimHitDump", desc); +} + +void EcalSimHitDump::analyze(const edm::Event& e, const edm::EventSetup&) { + ++kount_; + edm::LogVerbatim("HitStudy") << "[" << kount_ << "] Run = " << e.id().run() << " Event = " << e.id().event(); + + if ((kount_ <= maxEvent_) || (maxEvent_ <= 0)) { + for (unsigned int k = 0; k < toksCalo_.size(); ++k) { + edm::Handle<edm::PCaloHitContainer> hitsCalo; + e.getByToken(toksCalo_[k], hitsCalo); + if (hitsCalo.isValid()) + edm::LogVerbatim("HitStudy") << "EcalSimHitDump: Input " << hitsCalo->size() << " hits of type " << types_[k]; + unsigned int i(0); + for (auto const& hit : *hitsCalo) { + double edep = hit.energy(); + double time = hit.time(); + unsigned int id = hit.id(); + if (types_[k] == 0) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << EBDetId(id) << " E" << edep << " T " << time; + else if (types_[k] == 1) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << EEDetId(id) << " E" << edep << " T " << time; + else + edm::LogVerbatim("HitStudy") << "[" << i << "] " << ESDetId(id) << " E" << edep << " T " << time; + ++i; + } + } + } +} + +//define this as a plug-in +DEFINE_FWK_MODULE(EcalSimHitDump); diff --git a/SimG4CMS/Calo/src/CaloSD.cc b/SimG4CMS/Calo/src/CaloSD.cc index 10213ca0d8288..4f98c899d4223 100644 --- a/SimG4CMS/Calo/src/CaloSD.cc +++ b/SimG4CMS/Calo/src/CaloSD.cc @@ -294,6 +294,9 @@ void CaloSD::PrintAll() { } void CaloSD::fillHits(edm::PCaloHitContainer& cc, const std::string& hname) { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("CaloSim") << "CaloSD: Tries to transfer " << slave.get()->hits().size() << " hits for " << slave.get()->name() << " " << hname; +#endif if (slave.get()->name() == hname) { cc = slave.get()->hits(); } diff --git a/SimG4CMS/Calo/test/python/runEcalSimHitDump_cfg.py b/SimG4CMS/Calo/test/python/runEcalSimHitDump_cfg.py new file mode 100644 index 0000000000000..f434b6043e3a2 --- /dev/null +++ b/SimG4CMS/Calo/test/python/runEcalSimHitDump_cfg.py @@ -0,0 +1,30 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process('Dump',Run3_dd4hep) + +# import of standard configurations +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.Geometry.GeometryDD4hepExtended2021_cff') +process.load('SimG4CMS.Calo.ecalSimHitDump_cfi') + +if hasattr(process,'MessageLogger'): + process.MessageLogger.categories.append('HitStudy') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10), + output = cms.optional.untracked.allowed(cms.int32,cms.PSet) +) + +process.source = cms.Source("PoolSource", + dropDescendantsOfDroppedBranches = cms.untracked.bool(False), + fileNames = cms.untracked.vstring('file:step1_ZMM_dd4hep.root'), +) + +process.analysis_step = cms.Path(process.ecalSimHitDump) + +process.ecalSimHitDump.MaxEvent = 10 + +# Schedule definition +process.schedule = cms.Schedule(process.analysis_step) diff --git a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py index bedce9fdc04a2..77a932443ee21 100644 --- a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py @@ -19,9 +19,15 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('Configuration.Geometry.GeometryDD4hepExtended2021_cff') # there w -process.MessageLogger.categories.append("TrackerGeometryBuilder"); -process.MessageLogger.categories.append("TrackerSimInfoNumbering"); - +#if hasattr(process,'MessageLogger'): +# process.MessageLogger.categories.append('EcalGeom') +# process.MessageLogger.categories.append('MuonSim') +# process.MessageLogger.categories.append('CaloSim') +# process.MessageLogger.categories.append('EcalSim') +# process.MessageLogger.categories.append('HcalSim') +# process.MessageLogger.categories.append('SimG4CoreApplication') +# process.MessageLogger.categories.append("TrackerGeometryBuilder"); +# process.MessageLogger.categories.append("TrackerSimInfoNumbering"); process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10), diff --git a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py index b89bb9fa5c884..10057df88c977 100644 --- a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py @@ -19,9 +19,10 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -if hasattr(process,'MessageLogger'): - process.MessageLogger.categories.append('EcalGeom') -# process.MessageLogger.categories.append('CaloGeometryBuilder') +#if hasattr(process,'MessageLogger'): +# process.MessageLogger.categories.append('EcalGeom') +# process.MessageLogger.categories.append('GEMGeometry') +# process.MessageLogger.categories.append('CaloGeometryBuilder') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10), diff --git a/SimG4Core/Configuration/test/dd4hep_ttbar_2026D41_Step1_cfg.py b/SimG4Core/Configuration/test/dd4hep_ttbar_2026D49_Step1_cfg.py similarity index 98% rename from SimG4Core/Configuration/test/dd4hep_ttbar_2026D41_Step1_cfg.py rename to SimG4Core/Configuration/test/dd4hep_ttbar_2026D49_Step1_cfg.py index d4ac70505c373..7f043daee59d8 100644 --- a/SimG4Core/Configuration/test/dd4hep_ttbar_2026D41_Step1_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ttbar_2026D49_Step1_cfg.py @@ -1,8 +1,8 @@ import FWCore.ParameterSet.Config as cms -from Configuration.Eras.Era_Phase2C8_dd4hep_cff import Phase2C8_dd4hep +from Configuration.Eras.Era_Phase2C9_dd4hep_cff import Phase2C9_dd4hep -process = cms.Process('SIM',Phase2C8_dd4hep) +process = cms.Process('SIM',Phase2C9_dd4hep) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') @@ -10,7 +10,7 @@ process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') -process.load('Configuration.Geometry.GeometryDD4hepExtended2026D41_cff') +process.load('Configuration.Geometry.GeometryDD4hepExtended2026D49_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedHLLHC14TeV_cfi') diff --git a/SimG4Core/Configuration/test/dd4hep_ttbar_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/dd4hep_ttbar_Run3_Step1_cfg.py new file mode 100644 index 0000000000000..34308d76ac03b --- /dev/null +++ b/SimG4Core/Configuration/test/dd4hep_ttbar_Run3_Step1_cfg.py @@ -0,0 +1,164 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process('SIM',Run3_dd4hep) + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryDD4hepExtended2021_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.Generator_cff') +process.load('IOMC.EventVertexGenerators.VtxSmearedHLLHC14TeV_cfi') +process.load('GeneratorInterface.Core.genFilterSummary_cff') +process.load('Configuration.StandardSequences.SimIdeal_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10), + output = cms.optional.untracked.allowed(cms.int32,cms.PSet) +) + +# Input source +process.source = cms.Source("EmptySource") + +process.options = cms.untracked.PSet( + FailPath = cms.untracked.vstring(), + IgnoreCompletely = cms.untracked.vstring(), + Rethrow = cms.untracked.vstring(), + SkipEvent = cms.untracked.vstring(), + allowUnscheduled = cms.obsolete.untracked.bool, + canDeleteEarly = cms.untracked.vstring(), + emptyRunLumiMode = cms.obsolete.untracked.string, + eventSetup = cms.untracked.PSet( + forceNumberOfConcurrentIOVs = cms.untracked.PSet( + + ), + numberOfConcurrentIOVs = cms.untracked.uint32(1) + ), + fileMode = cms.untracked.string('FULLMERGE'), + forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False), + makeTriggerResults = cms.obsolete.untracked.bool, + numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(1), + numberOfConcurrentRuns = cms.untracked.uint32(1), + numberOfStreams = cms.untracked.uint32(0), + numberOfThreads = cms.untracked.uint32(1), + printDependencies = cms.untracked.bool(False), + sizeOfStackForThreadsInKB = cms.optional.untracked.uint32, + throwIfIllegalParameter = cms.untracked.bool(True), + wantSummary = cms.untracked.bool(False) +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('TTbar_14TeV_TuneCP5_cfi nevts:10'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.FEVTDEBUGoutput = cms.OutputModule("PoolOutputModule", + SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('generation_step') + ), + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string('GEN-SIM'), + filterName = cms.untracked.string('') + ), + fileName = cms.untracked.string('file:step1.root'), + outputCommands = process.FEVTDEBUGEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +process.genstepfilter.triggerConditions=cms.vstring("generation_step") +from Configuration.AlCa.GlobalTag import GlobalTag +process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '') + +process.generator = cms.EDFilter("Pythia8GeneratorFilter", + PythiaParameters = cms.PSet( + parameterSets = cms.vstring( + 'pythia8CommonSettings', + 'pythia8CP5Settings', + 'processParameters' + ), + processParameters = cms.vstring( + 'Top:gg2ttbar = on ', + 'Top:qqbar2ttbar = on ', + '6:m0 = 175 ' + ), + pythia8CP5Settings = cms.vstring( + 'Tune:pp 14', + 'Tune:ee 7', + 'MultipartonInteractions:ecmPow=0.03344', + 'MultipartonInteractions:bProfile=2', + 'MultipartonInteractions:pT0Ref=1.41', + 'MultipartonInteractions:coreRadius=0.7634', + 'MultipartonInteractions:coreFraction=0.63', + 'ColourReconnection:range=5.176', + 'SigmaTotal:zeroAXB=off', + 'SpaceShower:alphaSorder=2', + 'SpaceShower:alphaSvalue=0.118', + 'SigmaProcess:alphaSvalue=0.118', + 'SigmaProcess:alphaSorder=2', + 'MultipartonInteractions:alphaSvalue=0.118', + 'MultipartonInteractions:alphaSorder=2', + 'TimeShower:alphaSorder=2', + 'TimeShower:alphaSvalue=0.118', + 'SigmaTotal:mode = 0', + 'SigmaTotal:sigmaEl = 21.89', + 'SigmaTotal:sigmaTot = 100.309', + 'PDF:pSet=LHAPDF6:NNPDF31_nnlo_as_0118' + ), + pythia8CommonSettings = cms.vstring( + 'Tune:preferLHAPDF = 2', + 'Main:timesAllowErrors = 10000', + 'Check:epTolErr = 0.01', + 'Beams:setProductionScalesFromLHEF = off', + 'SLHA:keepSM = on', + 'SLHA:minMassSM = 1000.', + 'ParticleDecays:limitTau0 = on', + 'ParticleDecays:tau0Max = 10', + 'ParticleDecays:allowPhotonRadiation = on' + ) + ), + comEnergy = cms.double(14000.0), + filterEfficiency = cms.untracked.double(1.0), + maxEventsToPrint = cms.untracked.int32(0), + pythiaHepMCVerbosity = cms.untracked.bool(False), + pythiaPylistVerbosity = cms.untracked.int32(0) +) + + +process.ProductionFilterSequence = cms.Sequence(process.generator) + +# Path and EndPath definitions +process.generation_step = cms.Path(process.pgen) +process.simulation_step = cms.Path(process.psim) +process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.FEVTDEBUGoutput_step = cms.EndPath(process.FEVTDEBUGoutput) + +# Schedule definition +process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step,process.simulation_step,process.endjob_step,process.FEVTDEBUGoutput_step) +from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask +associatePatAlgosToolsTask(process) +# filter all path with the production filter sequence +for path in process.paths: + getattr(process,path).insert(0, process.ProductionFilterSequence) + + +# Customisation from command line + +# Add early deletion of temporary data products to reduce peak memory need +from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete +process = customiseEarlyDelete(process) +# End adding early deletion diff --git a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py index b51379bd99970..ce708536b18f4 100644 --- a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py +++ b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py @@ -19,8 +19,11 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('Configuration.Geometry.GeometryExtended2021_cff') # there w -process.MessageLogger.categories.append("TrackerGeometryBuilder"); -process.MessageLogger.categories.append("TrackerSimInfoNumbering"); +#if hasattr(process,'MessageLogger'): +# process.MessageLogger.categories.append('Geometry') +# process.MessageLogger.categories.append('EcalGeom') +# process.MessageLogger.categories.append("TrackerGeometryBuilder"); +# process.MessageLogger.categories.append("TrackerSimInfoNumbering"); process.maxEvents = cms.untracked.PSet( diff --git a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py index 981400f1d6f1d..3cfb0e3a015a8 100644 --- a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py +++ b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py @@ -19,6 +19,10 @@ process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') +#if hasattr(process,'MessageLogger'): +# process.MessageLogger.categories.append('GEMGeometry') +# process.MessageLogger.categories.append('CaloGeometryBuilder') + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10), output = cms.optional.untracked.allowed(cms.int32,cms.PSet) From a30eb63b2cee2d212a6b59aad1fef4580a78b26c Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Thu, 15 Oct 2020 22:01:41 +0200 Subject: [PATCH 620/778] Correct numbering schemes to work for dd4hep --- .../src/EcalBarrelNumberingScheme.cc | 63 +++++++++++++------ .../src/EcalEndcapNumberingScheme.cc | 29 +++++---- .../src/EcalPreshowerNumberingScheme.cc | 16 ++--- 3 files changed, 63 insertions(+), 45 deletions(-) diff --git a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc index 0f112aac1ae23..7120bd6cb3404 100644 --- a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc @@ -5,10 +5,10 @@ #include "Geometry/EcalCommonData/interface/EcalBarrelNumberingScheme.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" -#include <iostream> +//#define EDM_ML_DEBUG EcalBarrelNumberingScheme::EcalBarrelNumberingScheme() : EcalNumberingScheme() { - edm::LogInfo("EcalGeom") << "Creating EcalBarrelNumberingScheme"; + edm::LogVerbatim("EcalGeom") << "Creating EcalBarrelNumberingScheme"; } EcalBarrelNumberingScheme::~EcalBarrelNumberingScheme() { @@ -18,34 +18,51 @@ EcalBarrelNumberingScheme::~EcalBarrelNumberingScheme() { uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const { const uint32_t nLevels(baseNumber.getLevels()); +#ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "ECalBarrelNumberingScheme geometry levels = " << nLevels; - +#endif if (12 > nLevels) { edm::LogWarning("EcalGeom") << "ECalBarrelNumberingScheme::getUnitID(): " << "Not enough levels found in EcalBaseNumber ( " << nLevels << ") Returning 0"; return 0; } - const std::string& cryName(baseNumber.getLevelName(0)); // name of crystal volume + const std::string& cryName(baseNumber.getLevelName(0).substr(0,7)); // name of crystal volume const int cryType(::atoi(cryName.c_str() + 5)); - const int off(12 < nLevels ? 3 : 0); + const int off(13 < nLevels ? 3 : 0); const uint32_t wallCopy(baseNumber.getCopyNumber(3 + off)); const uint32_t hawCopy(baseNumber.getCopyNumber(4 + off)); const uint32_t fawCopy(baseNumber.getCopyNumber(5 + off)); const uint32_t supmCopy(baseNumber.getCopyNumber(6 + off)); - /* - edm::LogVerbatim("EcalGeom") << baseNumber.getLevelName(0) << ", " - << baseNumber.getLevelName(1) << ", " - << baseNumber.getLevelName(2) << ", " - << baseNumber.getLevelName(3) << ", " - << baseNumber.getLevelName(4) << ", " - << baseNumber.getLevelName(5) << ", " - << baseNumber.getLevelName(6) << ", " - << baseNumber.getLevelName(7) ; - */ +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << nLevels << ", " << off << ", " + << cryType << ", " + << baseNumber.getLevelName(0) << ":" + << baseNumber.getCopyNumber(0) << ", " + << baseNumber.getLevelName(1) << ":" + << baseNumber.getCopyNumber(1) << ", " + << baseNumber.getLevelName(2) << ":" + << baseNumber.getCopyNumber(2) << ", " + << baseNumber.getLevelName(3) << ":" + << baseNumber.getCopyNumber(3) << ", " + << baseNumber.getLevelName(4) << ":" + << baseNumber.getCopyNumber(4) << ", " + << baseNumber.getLevelName(5) << ":" + << baseNumber.getCopyNumber(5) << ", " + << baseNumber.getLevelName(6) << ":" + << baseNumber.getCopyNumber(6) << ", " + << baseNumber.getLevelName(7) << ":" + << baseNumber.getCopyNumber(7) << ", " + << baseNumber.getLevelName(8) << ":" + << baseNumber.getCopyNumber(8) << ", " + << baseNumber.getLevelName(9) << ":" + << baseNumber.getCopyNumber(9) << ", " + << baseNumber.getLevelName(10) << ":" + << baseNumber.getCopyNumber(10); +#endif // error checking if (1 > cryType || 17 < cryType) { @@ -103,11 +120,17 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) } ++count; */ +#ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "EcalBarrelNumberingScheme: " - << "supmCopy = " << supmCopy << ", fawCopy = " << fawCopy << ", hawCopy = " << hawCopy - << ", wallCopy = " << wallCopy << ", cryType = " << cryType - << "\n zsign = " << zsign << ", eta = " << eta << ", phi = " << phi - << ", packed index = 0x" << std::hex << intindex << std::dec; - + << "supmCopy = " << supmCopy + << ", fawCopy = " << fawCopy + << ", hawCopy = " << hawCopy + << ", wallCopy = " << wallCopy + << ", cryType = " << cryType + << "\n zsign = " << zsign + << ", eta = " << eta + << ", phi = " << phi + << ", packed index = 0x" << std::hex << intindex << std::dec ; +#endif return intindex; } diff --git a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc index 5fbb2ffbca1fe..89a3a0163a8ae 100644 --- a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc @@ -5,8 +5,7 @@ #include "Geometry/EcalCommonData/interface/EcalEndcapNumberingScheme.h" #include "DataFormats/EcalDetId/interface/EEDetId.h" -#include <iostream> -#include <iomanip> +//#define EDM_ML_DEBUG EcalEndcapNumberingScheme::EcalEndcapNumberingScheme() : EcalNumberingScheme() { edm::LogVerbatim("EcalGeom") << "Creating EcalEndcapNumberingScheme"; @@ -18,8 +17,9 @@ EcalEndcapNumberingScheme::~EcalEndcapNumberingScheme() { uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const { const uint32_t nLevels(baseNumber.getLevels()); +#ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme geometry levels = " << nLevels; - +#endif if (7 > nLevels) { edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << "Not enough levels found in EcalBaseNumber ( " << nLevels << ") Returning 0"; @@ -50,10 +50,12 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) uint32_t intindex = EEDetId(module_number, crystal_number, zside, EEDetId::SCCRYSTALMODE).rawId(); - edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside - << " super crystal = " << module_number << " crystal = " << crystal_number - << " packed index = 0x" << std::hex << intindex << std::dec; - +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside + << " super crystal = " << module_number << " crystal = " + << crystal_number << " packed index = 0x" << std::hex + << intindex << std::dec; +#endif return intindex; } else { // algorithmic geometry @@ -118,14 +120,11 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) return 0; } - //************************************************************************************* - /* - edm::LogWarning("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " - <<std::dec<< ix << ", " << iy << ", " <<iq << ", " << id << ", " << iz << ", " << std::hex << idet ; - - edm::LogWarning("EdalGeom") << "ECalEndcapNumberingScheme::EEDetId: " - << EEDetId(idet) ; -*/ +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << std::dec << ix << ", " << iy << ", " << iq << ", " << id << ", " << iz << ", " << std::hex << idet << std::dec; + edm::LogVerbatim("EdalGeom") << "ECalEndcapNumberingScheme::EEDetId: " + << EEDetId(idet) ; +#endif return idet; } } diff --git a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc index 5df76c5ea9e06..1a510711a8a54 100644 --- a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc @@ -6,8 +6,7 @@ #include "Geometry/EcalCommonData/interface/EcalPreshowerNumberingScheme.h" #include "DataFormats/EcalDetId/interface/ESDetId.h" -#include <iostream> -using namespace std; +//#define EDM_ML_DEBUG EcalPreshowerNumberingScheme::EcalPreshowerNumberingScheme() : EcalNumberingScheme() { // For SFLX2a, we use copy# 1-3 @@ -414,15 +413,12 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe intIndex = ESDetId(strip, x, y, layer, zside).rawId(); - edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd - << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y - << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex - << std::dec; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex << std::dec; - for (int ich = 0; ich < level; ich++) { - edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) - << " copy = " << baseNumber.getCopyNumber(ich); - } + for (int ich = 0; ich < level; ich++) + edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) << " copy = " << baseNumber.getCopyNumber(ich); +#endif } return intIndex; From c5bf46c8b57a97554fe8fddf1cf078c21cabf061 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Thu, 15 Oct 2020 22:08:07 +0200 Subject: [PATCH 621/778] Code check --- SimG4CMS/Calo/plugins/EcalSimHitDump.cc | 59 ++++++++++++------------- SimG4CMS/Calo/src/CaloSD.cc | 3 +- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/SimG4CMS/Calo/plugins/EcalSimHitDump.cc b/SimG4CMS/Calo/plugins/EcalSimHitDump.cc index a7f2a655a7926..110b794a023d4 100644 --- a/SimG4CMS/Calo/plugins/EcalSimHitDump.cc +++ b/SimG4CMS/Calo/plugins/EcalSimHitDump.cc @@ -28,31 +28,28 @@ class EcalSimHitDump : public edm::one::EDAnalyzer<> { void analyze(edm::Event const&, edm::EventSetup const&) override; private: - const std::string g4Label_; const std::vector<std::string> hitLab_; - const std::vector<edm::EDGetTokenT<edm::PCaloHitContainer> > toksCalo_; + const std::vector<edm::EDGetTokenT<edm::PCaloHitContainer>> toksCalo_; const std::vector<int> types_; const int maxEvent_; int kount_; }; -EcalSimHitDump::EcalSimHitDump(const edm::ParameterSet& ps) : - g4Label_(ps.getParameter<std::string>("ModuleLabel")), - hitLab_(ps.getParameter<std::vector<std::string>>("HitCollections")), - toksCalo_{ - edm::vector_transform(hitLab_, - [this](const std::string& name) { - return consumes<edm::PCaloHitContainer>( - edm::InputTag{g4Label_, name}); - })}, - types_(ps.getParameter<std::vector<int>>("CollectionTypes")), - maxEvent_(ps.getParameter<int>("MaxEvent")), - kount_(0) { - - edm::LogVerbatim("HitStudy") << "Module Label: " << g4Label_ << " with " << hitLab_.size() << " collections and maxEvent = " << maxEvent_; - for (unsigned int k = 0; k < hitLab_.size(); ++k) - edm::LogVerbatim("HitStudy") << "[" << k << "] Type " << types_[k] << " Label " << hitLab_[k]; +EcalSimHitDump::EcalSimHitDump(const edm::ParameterSet& ps) + : g4Label_(ps.getParameter<std::string>("ModuleLabel")), + hitLab_(ps.getParameter<std::vector<std::string>>("HitCollections")), + toksCalo_{edm::vector_transform(hitLab_, + [this](const std::string& name) { + return consumes<edm::PCaloHitContainer>(edm::InputTag{g4Label_, name}); + })}, + types_(ps.getParameter<std::vector<int>>("CollectionTypes")), + maxEvent_(ps.getParameter<int>("MaxEvent")), + kount_(0) { + edm::LogVerbatim("HitStudy") << "Module Label: " << g4Label_ << " with " << hitLab_.size() + << " collections and maxEvent = " << maxEvent_; + for (unsigned int k = 0; k < hitLab_.size(); ++k) + edm::LogVerbatim("HitStudy") << "[" << k << "] Type " << types_[k] << " Label " << hitLab_[k]; } void EcalSimHitDump::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -60,8 +57,8 @@ void EcalSimHitDump::fillDescriptions(edm::ConfigurationDescriptions& descriptio std::vector<std::string> coll = {"EcalHitsEB", "EcalHitsEE", "EcalHitsES"}; std::vector<int> type = {0, 1, 2}; desc.add<std::string>("ModuleLabel", "g4SimHits"); - desc.add<std::vector<std::string> >("HitCollections", coll); - desc.add<std::vector<int> >("CollectionTypes", type); + desc.add<std::vector<std::string>>("HitCollections", coll); + desc.add<std::vector<int>>("CollectionTypes", type); desc.add<int>("MaxEvent", 10); descriptions.add("ecalSimHitDump", desc); } @@ -75,19 +72,19 @@ void EcalSimHitDump::analyze(const edm::Event& e, const edm::EventSetup&) { edm::Handle<edm::PCaloHitContainer> hitsCalo; e.getByToken(toksCalo_[k], hitsCalo); if (hitsCalo.isValid()) - edm::LogVerbatim("HitStudy") << "EcalSimHitDump: Input " << hitsCalo->size() << " hits of type " << types_[k]; + edm::LogVerbatim("HitStudy") << "EcalSimHitDump: Input " << hitsCalo->size() << " hits of type " << types_[k]; unsigned int i(0); for (auto const& hit : *hitsCalo) { - double edep = hit.energy(); - double time = hit.time(); - unsigned int id = hit.id(); - if (types_[k] == 0) - edm::LogVerbatim("HitStudy") << "[" << i << "] " << EBDetId(id) << " E" << edep << " T " << time; - else if (types_[k] == 1) - edm::LogVerbatim("HitStudy") << "[" << i << "] " << EEDetId(id) << " E" << edep << " T " << time; - else - edm::LogVerbatim("HitStudy") << "[" << i << "] " << ESDetId(id) << " E" << edep << " T " << time; - ++i; + double edep = hit.energy(); + double time = hit.time(); + unsigned int id = hit.id(); + if (types_[k] == 0) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << EBDetId(id) << " E" << edep << " T " << time; + else if (types_[k] == 1) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << EEDetId(id) << " E" << edep << " T " << time; + else + edm::LogVerbatim("HitStudy") << "[" << i << "] " << ESDetId(id) << " E" << edep << " T " << time; + ++i; } } } diff --git a/SimG4CMS/Calo/src/CaloSD.cc b/SimG4CMS/Calo/src/CaloSD.cc index 4f98c899d4223..c361fc56c7d75 100644 --- a/SimG4CMS/Calo/src/CaloSD.cc +++ b/SimG4CMS/Calo/src/CaloSD.cc @@ -295,7 +295,8 @@ void CaloSD::PrintAll() { void CaloSD::fillHits(edm::PCaloHitContainer& cc, const std::string& hname) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("CaloSim") << "CaloSD: Tries to transfer " << slave.get()->hits().size() << " hits for " << slave.get()->name() << " " << hname; + edm::LogVerbatim("CaloSim") << "CaloSD: Tries to transfer " << slave.get()->hits().size() << " hits for " + << slave.get()->name() << " " << hname; #endif if (slave.get()->name() == hname) { cc = slave.get()->hits(); From 8cf0dde4d723000666d0d6aa14e2a43000c5233a Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Thu, 15 Oct 2020 22:11:33 +0200 Subject: [PATCH 622/778] Code check --- .../src/EcalBarrelNumberingScheme.cc | 51 +++++++------------ .../src/EcalEndcapNumberingScheme.cc | 13 +++-- .../src/EcalPreshowerNumberingScheme.cc | 8 ++- 3 files changed, 29 insertions(+), 43 deletions(-) diff --git a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc index 7120bd6cb3404..1ad4b4d32e394 100644 --- a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc @@ -27,7 +27,7 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) return 0; } - const std::string& cryName(baseNumber.getLevelName(0).substr(0,7)); // name of crystal volume + const std::string& cryName(baseNumber.getLevelName(0).substr(0, 7)); // name of crystal volume const int cryType(::atoi(cryName.c_str() + 5)); @@ -38,30 +38,18 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const uint32_t fawCopy(baseNumber.getCopyNumber(5 + off)); const uint32_t supmCopy(baseNumber.getCopyNumber(6 + off)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << nLevels << ", " << off << ", " - << cryType << ", " - << baseNumber.getLevelName(0) << ":" - << baseNumber.getCopyNumber(0) << ", " - << baseNumber.getLevelName(1) << ":" - << baseNumber.getCopyNumber(1) << ", " - << baseNumber.getLevelName(2) << ":" - << baseNumber.getCopyNumber(2) << ", " - << baseNumber.getLevelName(3) << ":" - << baseNumber.getCopyNumber(3) << ", " - << baseNumber.getLevelName(4) << ":" - << baseNumber.getCopyNumber(4) << ", " - << baseNumber.getLevelName(5) << ":" - << baseNumber.getCopyNumber(5) << ", " - << baseNumber.getLevelName(6) << ":" - << baseNumber.getCopyNumber(6) << ", " - << baseNumber.getLevelName(7) << ":" - << baseNumber.getCopyNumber(7) << ", " - << baseNumber.getLevelName(8) << ":" - << baseNumber.getCopyNumber(8) << ", " - << baseNumber.getLevelName(9) << ":" - << baseNumber.getCopyNumber(9) << ", " - << baseNumber.getLevelName(10) << ":" - << baseNumber.getCopyNumber(10); + edm::LogVerbatim("EcalGeom") << nLevels << ", " << off << ", " << cryType << ", " << baseNumber.getLevelName(0) << ":" + << baseNumber.getCopyNumber(0) << ", " << baseNumber.getLevelName(1) << ":" + << baseNumber.getCopyNumber(1) << ", " << baseNumber.getLevelName(2) << ":" + << baseNumber.getCopyNumber(2) << ", " << baseNumber.getLevelName(3) << ":" + << baseNumber.getCopyNumber(3) << ", " << baseNumber.getLevelName(4) << ":" + << baseNumber.getCopyNumber(4) << ", " << baseNumber.getLevelName(5) << ":" + << baseNumber.getCopyNumber(5) << ", " << baseNumber.getLevelName(6) << ":" + << baseNumber.getCopyNumber(6) << ", " << baseNumber.getLevelName(7) << ":" + << baseNumber.getCopyNumber(7) << ", " << baseNumber.getLevelName(8) << ":" + << baseNumber.getCopyNumber(8) << ", " << baseNumber.getLevelName(9) << ":" + << baseNumber.getCopyNumber(9) << ", " << baseNumber.getLevelName(10) << ":" + << baseNumber.getCopyNumber(10); #endif // error checking @@ -122,15 +110,10 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) */ #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "EcalBarrelNumberingScheme: " - << "supmCopy = " << supmCopy - << ", fawCopy = " << fawCopy - << ", hawCopy = " << hawCopy - << ", wallCopy = " << wallCopy - << ", cryType = " << cryType - << "\n zsign = " << zsign - << ", eta = " << eta - << ", phi = " << phi - << ", packed index = 0x" << std::hex << intindex << std::dec ; + << "supmCopy = " << supmCopy << ", fawCopy = " << fawCopy << ", hawCopy = " << hawCopy + << ", wallCopy = " << wallCopy << ", cryType = " << cryType + << "\n zsign = " << zsign << ", eta = " << eta << ", phi = " << phi + << ", packed index = 0x" << std::hex << intindex << std::dec; #endif return intindex; } diff --git a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc index 89a3a0163a8ae..e5ad868226cb0 100644 --- a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc @@ -51,10 +51,9 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) uint32_t intindex = EEDetId(module_number, crystal_number, zside, EEDetId::SCCRYSTALMODE).rawId(); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside - << " super crystal = " << module_number << " crystal = " - << crystal_number << " packed index = 0x" << std::hex - << intindex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside + << " super crystal = " << module_number << " crystal = " << crystal_number + << " packed index = 0x" << std::hex << intindex << std::dec; #endif return intindex; } else { @@ -121,9 +120,9 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) } #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << std::dec << ix << ", " << iy << ", " << iq << ", " << id << ", " << iz << ", " << std::hex << idet << std::dec; - edm::LogVerbatim("EdalGeom") << "ECalEndcapNumberingScheme::EEDetId: " - << EEDetId(idet) ; + edm::LogVerbatim("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << std::dec << ix << ", " << iy << ", " + << iq << ", " << id << ", " << iz << ", " << std::hex << idet << std::dec; + edm::LogVerbatim("EdalGeom") << "ECalEndcapNumberingScheme::EEDetId: " << EEDetId(idet); #endif return idet; } diff --git a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc index 1a510711a8a54..16fd5d6f8fd35 100644 --- a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc @@ -414,10 +414,14 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe intIndex = ESDetId(strip, x, y, layer, zside).rawId(); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd + << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y + << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex + << std::dec; for (int ich = 0; ich < level; ich++) - edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) << " copy = " << baseNumber.getCopyNumber(ich); + edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) + << " copy = " << baseNumber.getCopyNumber(ich); #endif } From 99d0d604b07c5fd87febd67efb27a1c4ddfcb95b Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Fri, 16 Oct 2020 01:35:54 +0200 Subject: [PATCH 623/778] Update the 2 Reco files for dd4hep --- .../GeometryDD4hepExtended2021Reco_cff.py | 52 +++++++++++------- ...yDD4hepExtended2021ZeroMaterialReco_cff.py | 53 ++++++++++++------- 2 files changed, 67 insertions(+), 38 deletions(-) diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021Reco_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021Reco_cff.py index b53158f335522..66c4d2bb9f877 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021Reco_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021Reco_cff.py @@ -3,33 +3,47 @@ # Ideal geometry, needed for transient ECAL alignement from Configuration.Geometry.GeometryDD4hepExtended2021_cff import * - -# Reconstruction geometry services -# Tracking Geometry -#bah - well, this is not a cfi! +# tracker from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * - -#Tracker from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * - -#Muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * - -# Alignment from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * trackerGeometry.applyAlignment = cms.bool(False) -# Calorimeters +# calo from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometry_cff import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "EcalEndcap", + "EcalPreshower", + "TOWER", + ) +) +from Geometry.EcalAlgo.EcalGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cff import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# pps + + diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterialReco_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterialReco_cff.py index 7c0d81faefc8a..711fbfef2c7d0 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterialReco_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterialReco_cff.py @@ -3,32 +3,47 @@ # Ideal geometry, needed for transient ECAL alignement from Configuration.Geometry.GeometryDD4hepExtended2021ZeroMaterial_cff import * - -# Reconstruction geometry services -# Tracking Geometry -#bah - well, this is not a cfi! +# tracker from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * - -#Tracker from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * - -#Muon -from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * -from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * - -# Alignment from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * -from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * -from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * trackerGeometry.applyAlignment = cms.bool(False) -# Calorimeters +# calo from Geometry.CaloEventSetup.CaloTopology_cfi import * -from Geometry.CaloEventSetup.CaloGeometry_cff import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "EcalEndcap", + "EcalPreshower", + "TOWER", + ) +) +from Geometry.EcalAlgo.EcalGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * -from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * -from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cff import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# pps + + From 09216a8b110550727909a239dabb91202afc3ca3 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Thu, 15 Oct 2020 19:25:30 -0500 Subject: [PATCH 624/778] Use LogFwkVerbatim in the framework -This required updating many test results --- FWCore/Framework/src/InputSource.cc | 10 +- FWCore/Framework/src/Schedule.cc | 374 +++++++++--------- FWCore/MessageLogger/src/MessageLogger.cc | 4 + FWCore/MessageService/test/u14_cfg.py | 6 +- FWCore/MessageService/test/u21_cfg.py | 3 + .../test/unit_test_outputs/infos.log | 11 +- .../test/unit_test_outputs/u17_all.log | 4 +- .../test/unit_test_outputs/u23_infos.log | 21 +- .../test/unit_test_outputs/u25_only.log | 4 +- .../test/unit_test_outputs/u27FJR.xml | 4 +- .../test/unit_test_outputs/u27_infos.log | 21 +- .../test/unit_test_outputs/u31_infos.log | 15 +- .../test/unit_test_outputs/u33_all.log | 33 +- .../test/unit_test_outputs/u33d_all.log | 21 +- .../test/unit_test_outputs/u36_only.log | 1 + .../test/unit_test_outputs/u3_statistics.log | 15 +- .../test/unit_test_outputs/u4_another.log | 15 +- .../test/unit_test_outputs/u5_default.log | 16 +- .../test/unit_test_outputs/u5_noreset.log | 16 +- .../test/unit_test_outputs/u5_reset.log | 12 +- 20 files changed, 312 insertions(+), 294 deletions(-) diff --git a/FWCore/Framework/src/InputSource.cc b/FWCore/Framework/src/InputSource.cc index 64bbcfef683c1..c988b3b39c6c4 100644 --- a/FWCore/Framework/src/InputSource.cc +++ b/FWCore/Framework/src/InputSource.cc @@ -336,11 +336,11 @@ namespace edm { } void InputSource::issueReports(EventID const& eventID, StreamID streamID) { - if (isInfoEnabled()) { - LogVerbatim("FwkReport") << "Begin processing the " << readCount_ << suffix(readCount_) << " record. Run " - << eventID.run() << ", Event " << eventID.event() << ", LumiSection " - << eventID.luminosityBlock() << " on stream " << streamID.value() << " at " - << std::setprecision(3) << TimeOfDay(); + if (isFwkInfoEnabled()) { + LogFwkVerbatim("FwkReport") << "Begin processing the " << readCount_ << suffix(readCount_) << " record. Run " + << eventID.run() << ", Event " << eventID.event() << ", LumiSection " + << eventID.luminosityBlock() << " on stream " << streamID.value() << " at " + << std::setprecision(3) << TimeOfDay(); } if (!statusFileName_.empty()) { std::ofstream statusFile(statusFileName_.c_str()); diff --git a/FWCore/Framework/src/Schedule.cc b/FWCore/Framework/src/Schedule.cc index e98b82952dced..3ede512233ac4 100644 --- a/FWCore/Framework/src/Schedule.cc +++ b/FWCore/Framework/src/Schedule.cc @@ -939,41 +939,41 @@ namespace edm { // The trigger report (pass/fail etc.): - LogVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << ""; if (streamSchedules_[0]->context().processContext()->isSubProcess()) { - LogVerbatim("FwkSummary") << "TrigReport Process: " - << streamSchedules_[0]->context().processContext()->processName(); + LogFwkVerbatim("FwkSummary") << "TrigReport Process: " + << streamSchedules_[0]->context().processContext()->processName(); } - LogVerbatim("FwkSummary") << "TrigReport " - << "---------- Event Summary ------------"; + LogFwkVerbatim("FwkSummary") << "TrigReport " + << "---------- Event Summary ------------"; if (!tr.trigPathSummaries.empty()) { - LogVerbatim("FwkSummary") << "TrigReport" - << " Events total = " << tr.eventSummary.totalEvents - << " passed = " << tr.eventSummary.totalEventsPassed - << " failed = " << tr.eventSummary.totalEventsFailed << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport" + << " Events total = " << tr.eventSummary.totalEvents + << " passed = " << tr.eventSummary.totalEventsPassed + << " failed = " << tr.eventSummary.totalEventsFailed << ""; } else { - LogVerbatim("FwkSummary") << "TrigReport" - << " Events total = " << tr.eventSummary.totalEvents - << " passed = " << tr.eventSummary.totalEvents << " failed = 0"; + LogFwkVerbatim("FwkSummary") << "TrigReport" + << " Events total = " << tr.eventSummary.totalEvents + << " passed = " << tr.eventSummary.totalEvents << " failed = 0"; } - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TrigReport " - << "---------- Path Summary ------------"; - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#" - << " " << std::right << std::setw(10) << "Executed" - << " " << std::right << std::setw(10) << "Passed" - << " " << std::right << std::setw(10) << "Failed" - << " " << std::right << std::setw(10) << "Error" - << " " - << "Name" - << ""; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " + << "---------- Path Summary ------------"; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#" + << " " << std::right << std::setw(10) << "Executed" + << " " << std::right << std::setw(10) << "Passed" + << " " << std::right << std::setw(10) << "Failed" + << " " << std::right << std::setw(10) << "Error" + << " " + << "Name" + << ""; for (auto const& p : tr.trigPathSummaries) { - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5) - << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " " - << std::right << std::setw(10) << p.timesPassed << " " << std::right << std::setw(10) - << p.timesFailed << " " << std::right << std::setw(10) << p.timesExcept << " " - << p.name << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5) + << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " " + << std::right << std::setw(10) << p.timesPassed << " " << std::right + << std::setw(10) << p.timesFailed << " " << std::right << std::setw(10) + << p.timesExcept << " " << p.name << ""; } /* @@ -982,7 +982,7 @@ namespace edm { std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin(); for (; epi != epe; ++epi, ++epn) { - LogVerbatim("FwkSummary") << "TrigReport " + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5) << *epi << " " << std::right << std::setw(10) << totalEvents() << " " @@ -993,92 +993,92 @@ namespace edm { } */ - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TrigReport " - << "-------End-Path Summary ------------"; - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#" - << " " << std::right << std::setw(10) << "Executed" - << " " << std::right << std::setw(10) << "Passed" - << " " << std::right << std::setw(10) << "Failed" - << " " << std::right << std::setw(10) << "Error" - << " " - << "Name" - << ""; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " + << "-------End-Path Summary ------------"; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#" + << " " << std::right << std::setw(10) << "Executed" + << " " << std::right << std::setw(10) << "Passed" + << " " << std::right << std::setw(10) << "Failed" + << " " << std::right << std::setw(10) << "Error" + << " " + << "Name" + << ""; for (auto const& p : tr.endPathSummaries) { - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5) - << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " " - << std::right << std::setw(10) << p.timesPassed << " " << std::right << std::setw(10) - << p.timesFailed << " " << std::right << std::setw(10) << p.timesExcept << " " - << p.name << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5) + << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " " + << std::right << std::setw(10) << p.timesPassed << " " << std::right + << std::setw(10) << p.timesFailed << " " << std::right << std::setw(10) + << p.timesExcept << " " << p.name << ""; } for (auto const& p : tr.trigPathSummaries) { - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TrigReport " - << "---------- Modules in Path: " << p.name << " ------------"; - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#" - << " " << std::right << std::setw(10) << "Visited" - << " " << std::right << std::setw(10) << "Passed" - << " " << std::right << std::setw(10) << "Failed" - << " " << std::right << std::setw(10) << "Error" - << " " - << "Name" - << ""; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " + << "---------- Modules in Path: " << p.name << " ------------"; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#" + << " " << std::right << std::setw(10) << "Visited" + << " " << std::right << std::setw(10) << "Passed" + << " " << std::right << std::setw(10) << "Failed" + << " " << std::right << std::setw(10) << "Error" + << " " + << "Name" + << ""; unsigned int bitpos = 0; for (auto const& mod : p.moduleInPathSummaries) { - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5) - << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " " - << std::right << std::setw(10) << mod.timesPassed << " " << std::right - << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10) - << mod.timesExcept << " " << mod.moduleLabel << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5) + << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " " + << std::right << std::setw(10) << mod.timesPassed << " " << std::right + << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10) + << mod.timesExcept << " " << mod.moduleLabel << ""; ++bitpos; } } for (auto const& p : tr.endPathSummaries) { - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TrigReport " - << "------ Modules in End-Path: " << p.name << " ------------"; - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#" - << " " << std::right << std::setw(10) << "Visited" - << " " << std::right << std::setw(10) << "Passed" - << " " << std::right << std::setw(10) << "Failed" - << " " << std::right << std::setw(10) << "Error" - << " " - << "Name" - << ""; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " + << "------ Modules in End-Path: " << p.name << " ------------"; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#" + << " " << std::right << std::setw(10) << "Visited" + << " " << std::right << std::setw(10) << "Passed" + << " " << std::right << std::setw(10) << "Failed" + << " " << std::right << std::setw(10) << "Error" + << " " + << "Name" + << ""; unsigned int bitpos = 0; for (auto const& mod : p.moduleInPathSummaries) { - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5) - << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " " - << std::right << std::setw(10) << mod.timesPassed << " " << std::right - << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10) - << mod.timesExcept << " " << mod.moduleLabel << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5) + << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " " + << std::right << std::setw(10) << mod.timesPassed << " " << std::right + << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10) + << mod.timesExcept << " " << mod.moduleLabel << ""; ++bitpos; } } - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TrigReport " - << "---------- Module Summary ------------"; - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Visited" - << " " << std::right << std::setw(10) << "Executed" - << " " << std::right << std::setw(10) << "Passed" - << " " << std::right << std::setw(10) << "Failed" - << " " << std::right << std::setw(10) << "Error" - << " " - << "Name" - << ""; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " + << "---------- Module Summary ------------"; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Visited" + << " " << std::right << std::setw(10) << "Executed" + << " " << std::right << std::setw(10) << "Passed" + << " " << std::right << std::setw(10) << "Failed" + << " " << std::right << std::setw(10) << "Error" + << " " + << "Name" + << ""; for (auto const& worker : tr.workerSummaries) { - LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << worker.timesVisited << " " - << std::right << std::setw(10) << worker.timesRun << " " << std::right - << std::setw(10) << worker.timesPassed << " " << std::right << std::setw(10) - << worker.timesFailed << " " << std::right << std::setw(10) << worker.timesExcept - << " " << worker.moduleLabel << ""; + LogFwkVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << worker.timesVisited << " " + << std::right << std::setw(10) << worker.timesRun << " " << std::right + << std::setw(10) << worker.timesPassed << " " << std::right << std::setw(10) + << worker.timesFailed << " " << std::right << std::setw(10) << worker.timesExcept + << " " << worker.moduleLabel << ""; } - LogVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << ""; } // The timing report (CPU and Real Time): TriggerTimingReport tr; @@ -1086,124 +1086,126 @@ namespace edm { const int totalEvents = std::max(1, tr.eventSummary.totalEvents); - LogVerbatim("FwkSummary") << "TimeReport " - << "---------- Event Summary ---[sec]----"; - LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed - << " event loop CPU/event = " << tr.eventSummary.cpuTime / totalEvents; - LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed - << " event loop Real/event = " << tr.eventSummary.realTime / totalEvents; - LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed - << " sum Streams Real/event = " << tr.eventSummary.sumStreamRealTime / totalEvents; - LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed << " efficiency CPU/Real/thread = " - << tr.eventSummary.cpuTime / tr.eventSummary.realTime / preallocConfig_.numberOfThreads(); + LogFwkVerbatim("FwkSummary") << "TimeReport " + << "---------- Event Summary ---[sec]----"; + LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed + << " event loop CPU/event = " << tr.eventSummary.cpuTime / totalEvents; + LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed + << " event loop Real/event = " << tr.eventSummary.realTime / totalEvents; + LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed + << " sum Streams Real/event = " << tr.eventSummary.sumStreamRealTime / totalEvents; + LogFwkVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed + << " efficiency CPU/Real/thread = " + << tr.eventSummary.cpuTime / tr.eventSummary.realTime / + preallocConfig_.numberOfThreads(); constexpr int kColumn1Size = 10; constexpr int kColumn2Size = 12; constexpr int kColumn3Size = 12; - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TimeReport " - << "---------- Path Summary ---[Real sec]----"; - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per exec" - << " Name"; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " + << "---------- Path Summary ---[Real sec]----"; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per exec" + << " Name"; for (auto const& p : tr.trigPathSummaries) { const int timesRun = std::max(1, p.timesRun); - LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right - << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right - << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right + << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right + << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << ""; } - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per exec" - << " Name" - << ""; - - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TimeReport " - << "-------End-Path Summary ---[Real sec]----"; - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per exec" - << " Name" - << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per exec" + << " Name" + << ""; + + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " + << "-------End-Path Summary ---[Real sec]----"; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per exec" + << " Name" + << ""; for (auto const& p : tr.endPathSummaries) { const int timesRun = std::max(1, p.timesRun); - LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right - << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right - << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right + << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right + << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << ""; } - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per exec" - << " Name" - << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per exec" + << " Name" + << ""; for (auto const& p : tr.trigPathSummaries) { - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TimeReport " - << "---------- Modules in Path: " << p.name << " ---[Real sec]----"; - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per visit" - << " Name" - << ""; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " + << "---------- Modules in Path: " << p.name << " ---[Real sec]----"; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per visit" + << " Name" + << ""; for (auto const& mod : p.moduleInPathSummaries) { - LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right - << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right - << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " " - << mod.moduleLabel << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right + << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right + << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " " + << mod.moduleLabel << ""; } } if (not tr.trigPathSummaries.empty()) { - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per visit" - << " Name" - << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per visit" + << " Name" + << ""; } for (auto const& p : tr.endPathSummaries) { - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TimeReport " - << "------ Modules in End-Path: " << p.name << " ---[Real sec]----"; - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per visit" - << " Name" - << ""; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " + << "------ Modules in End-Path: " << p.name << " ---[Real sec]----"; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per visit" + << " Name" + << ""; for (auto const& mod : p.moduleInPathSummaries) { - LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right - << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right - << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " " - << mod.moduleLabel << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right + << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right + << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " " + << mod.moduleLabel << ""; } } if (not tr.endPathSummaries.empty()) { - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per visit" - << " Name" - << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per visit" + << " Name" + << ""; } - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "TimeReport " - << "---------- Module Summary ---[Real sec]----"; - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per exec" - << " " << std::right << std::setw(kColumn3Size) << "per visit" - << " Name" - << ""; + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " + << "---------- Module Summary ---[Real sec]----"; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per exec" + << " " << std::right << std::setw(kColumn3Size) << "per visit" + << " Name" + << ""; for (auto const& worker : tr.workerSummaries) { - LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right - << std::setw(kColumn1Size) << worker.realTime / totalEvents << " " << std::right - << std::setw(kColumn2Size) << worker.realTime / std::max(1, worker.timesRun) << " " - << std::right << std::setw(kColumn3Size) - << worker.realTime / std::max(1, worker.timesVisited) << " " << worker.moduleLabel - << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right + << std::setw(kColumn1Size) << worker.realTime / totalEvents << " " << std::right + << std::setw(kColumn2Size) << worker.realTime / std::max(1, worker.timesRun) << " " + << std::right << std::setw(kColumn3Size) + << worker.realTime / std::max(1, worker.timesVisited) << " " << worker.moduleLabel + << ""; } - LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" - << " " << std::right << std::setw(kColumn2Size) << "per exec" - << " " << std::right << std::setw(kColumn3Size) << "per visit" - << " Name" - << ""; - - LogVerbatim("FwkSummary") << ""; - LogVerbatim("FwkSummary") << "T---Report end!" - << ""; - LogVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event" + << " " << std::right << std::setw(kColumn2Size) << "per exec" + << " " << std::right << std::setw(kColumn3Size) << "per visit" + << " Name" + << ""; + + LogFwkVerbatim("FwkSummary") << ""; + LogFwkVerbatim("FwkSummary") << "T---Report end!" + << ""; + LogFwkVerbatim("FwkSummary") << ""; } void Schedule::closeOutputFiles() { diff --git a/FWCore/MessageLogger/src/MessageLogger.cc b/FWCore/MessageLogger/src/MessageLogger.cc index 95d8c799c419e..90e13a4836341 100644 --- a/FWCore/MessageLogger/src/MessageLogger.cc +++ b/FWCore/MessageLogger/src/MessageLogger.cc @@ -17,6 +17,10 @@ namespace edm { return ((!edm::MessageDrop::infoAlwaysSuppressed) && edm::MessageDrop::instance()->infoEnabled); } + bool isFwkInfoEnabled() { + return ((!edm::MessageDrop::fwkInfoAlwaysSuppressed) && edm::MessageDrop::instance()->fwkInfoEnabled); + } + bool isWarningEnabled() { return ((!edm::MessageDrop::warningAlwaysSuppressed) && edm::MessageDrop::instance()->warningEnabled); } diff --git a/FWCore/MessageService/test/u14_cfg.py b/FWCore/MessageService/test/u14_cfg.py index e6fc6893f7ef7..bb14e0ea7c0b2 100644 --- a/FWCore/MessageService/test/u14_cfg.py +++ b/FWCore/MessageService/test/u14_cfg.py @@ -11,8 +11,8 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - suppressInfo = cms.untracked.vstring('sendSomeMessages', - 'source'), + suppressInfo = cms.untracked.vstring('sendSomeMessages'), + suppressFwkInfo = cms.untracked.vstring('source'), u14_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), preEventProcessing = cms.untracked.PSet( @@ -44,7 +44,7 @@ fwkJobReports = cms.untracked.vstring('u14_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing'), - destinations = cms.untracked.vstring('u14_warnings', + destinations = cms.untracked.vstring('u14_warnings', 'u14_errors', 'u14_infos', 'u14_debugs', diff --git a/FWCore/MessageService/test/u21_cfg.py b/FWCore/MessageService/test/u21_cfg.py index 0e86cdd5ff89a..a2ae69956597b 100644 --- a/FWCore/MessageService/test/u21_cfg.py +++ b/FWCore/MessageService/test/u21_cfg.py @@ -33,6 +33,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), noTimeStamps = cms.untracked.bool(True), importantInfo = cms.untracked.PSet( limit = cms.untracked.int32(-1) diff --git a/FWCore/MessageService/test/unit_test_outputs/infos.log b/FWCore/MessageService/test/unit_test_outputs/infos.log index 67392fef20d10..ad901a6146258 100644 --- a/FWCore/MessageService/test/unit_test_outputs/infos.log +++ b/FWCore/MessageService/test/unit_test_outputs/infos.log @@ -39,8 +39,8 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1 1 - 2 cat_B -i UnitTestClient_G 10* 10 + 1 cat_B -i UnitTestClient_G 10* 10 + 2 FwkReport -f AfterSource 1 1 3 cat_A -w UnitTestClient_G 1 1 4 cat_C -w UnitTestClient_G 15* 15 @@ -48,14 +48,15 @@ MessageLogger Summary type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- - 1 FwkReport AfterSource - 2 cat_B 1/1 1/1 1/1 + 1 cat_B 1/1 1/1 1/1 + 2 FwkReport AfterSource 3 cat_A 1/1 4 cat_C 1/1 1/1 1/1 Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 11 11 +Info 10 10 +FwkInfo 1 1 Warning 16 16 dropped waiting message count 0 diff --git a/FWCore/MessageService/test/unit_test_outputs/u17_all.log b/FWCore/MessageService/test/unit_test_outputs/u17_all.log index d39fd5d6d4346..a35e74f75541d 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u17_all.log +++ b/FWCore/MessageService/test/unit_test_outputs/u17_all.log @@ -73,7 +73,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 2 2 + 1 FwkReport -f AfterSource 2 2 2 cat_P -w UnitTestClient_K 20* 20 3 cat_S -s UnitTestClient_K 20 20 @@ -87,7 +87,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 2 2 +FwkInfo 2 2 Warning 20 20 System 20 20 diff --git a/FWCore/MessageService/test/unit_test_outputs/u23_infos.log b/FWCore/MessageService/test/unit_test_outputs/u23_infos.log index 0f39acc21108a..d97bd6de5e5a4 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u23_infos.log +++ b/FWCore/MessageService/test/unit_test_outputs/u23_infos.log @@ -60,28 +60,29 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1 1 - 2 cat_A -i UTC_Q1:ssm_1a 1 1 - 3 cat_A -i UTC_Q1:ssm_1b 1 1 - 4 cat_A -i UTC_Q1:ssm_1c 1 1 - 5 cat_A -i UTC_Q2:ssm_2a 1 1 - 6 cat_A -i UTC_Q2:ssm_2b 1 1 - 7 cat_A -i UTC_Q2:ssm_2c 1 1 + 1 cat_A -i UTC_Q1:ssm_1a 1 1 + 2 cat_A -i UTC_Q1:ssm_1b 1 1 + 3 cat_A -i UTC_Q1:ssm_1c 1 1 + 4 cat_A -i UTC_Q2:ssm_2a 1 1 + 5 cat_A -i UTC_Q2:ssm_2b 1 1 + 6 cat_A -i UTC_Q2:ssm_2c 1 1 + 7 FwkReport -f AfterSource 1 1 8 timer -i <Any Module> <Any Function> 6 6 9 trace -i <Any Module> <Any Function> 6 6 type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- - 1 FwkReport AfterSource + 1 cat_A 1/1 2 cat_A 1/1 3 cat_A 1/1 4 cat_A 1/1 5 cat_A 1/1 6 cat_A 1/1 - 7 cat_A 1/1 + 7 FwkReport AfterSource Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 19 19 +Info 18 18 +FwkInfo 1 1 dropped waiting message count 0 diff --git a/FWCore/MessageService/test/unit_test_outputs/u25_only.log b/FWCore/MessageService/test/unit_test_outputs/u25_only.log index bed6b40d90173..e66e0daadabcc 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u25_only.log +++ b/FWCore/MessageService/test/unit_test_outputs/u25_only.log @@ -96,7 +96,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1 1 + 1 FwkReport -f AfterSource 1 1 2 cat_A -e UnitTestClient_R 10000* 10000 3 cat_B -e UnitTestClient_R 10000* 10000 @@ -110,7 +110,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 1 1 +FwkInfo 1 1 Error 20000 20000 dropped waiting message count 0 diff --git a/FWCore/MessageService/test/unit_test_outputs/u27FJR.xml b/FWCore/MessageService/test/unit_test_outputs/u27FJR.xml index c8317bb0bbc8d..3c7d37cce5de2 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u27FJR.xml +++ b/FWCore/MessageService/test/unit_test_outputs/u27FJR.xml @@ -1,12 +1,12 @@ <FrameworkJobReport> <MessageSummary> - <Category_i_FwkReport Value="1" /> + <Category_f_FwkReport Value="1" /> <Category_i_cat_A Value="6" /> <Category_i_timer Value="6" /> <Category_i_trace Value="6" /> <LogDebug_LogTrace Value="0" /> <LogError_LogProblem Value="0" /> - <LogInfo_LogVerbatim Value="19" /> + <LogInfo_LogVerbatim Value="18" /> <LogSystem_LogAbsolute Value="0" /> <LogWarnng_LogPrint Value="0" /> </MessageSummary> diff --git a/FWCore/MessageService/test/unit_test_outputs/u27_infos.log b/FWCore/MessageService/test/unit_test_outputs/u27_infos.log index 0f39acc21108a..d97bd6de5e5a4 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u27_infos.log +++ b/FWCore/MessageService/test/unit_test_outputs/u27_infos.log @@ -60,28 +60,29 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1 1 - 2 cat_A -i UTC_Q1:ssm_1a 1 1 - 3 cat_A -i UTC_Q1:ssm_1b 1 1 - 4 cat_A -i UTC_Q1:ssm_1c 1 1 - 5 cat_A -i UTC_Q2:ssm_2a 1 1 - 6 cat_A -i UTC_Q2:ssm_2b 1 1 - 7 cat_A -i UTC_Q2:ssm_2c 1 1 + 1 cat_A -i UTC_Q1:ssm_1a 1 1 + 2 cat_A -i UTC_Q1:ssm_1b 1 1 + 3 cat_A -i UTC_Q1:ssm_1c 1 1 + 4 cat_A -i UTC_Q2:ssm_2a 1 1 + 5 cat_A -i UTC_Q2:ssm_2b 1 1 + 6 cat_A -i UTC_Q2:ssm_2c 1 1 + 7 FwkReport -f AfterSource 1 1 8 timer -i <Any Module> <Any Function> 6 6 9 trace -i <Any Module> <Any Function> 6 6 type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- - 1 FwkReport AfterSource + 1 cat_A 1/1 2 cat_A 1/1 3 cat_A 1/1 4 cat_A 1/1 5 cat_A 1/1 6 cat_A 1/1 - 7 cat_A 1/1 + 7 FwkReport AfterSource Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 19 19 +Info 18 18 +FwkInfo 1 1 dropped waiting message count 0 diff --git a/FWCore/MessageService/test/unit_test_outputs/u31_infos.log b/FWCore/MessageService/test/unit_test_outputs/u31_infos.log index 1bf6502db3e8a..24403923f8959 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u31_infos.log +++ b/FWCore/MessageService/test/unit_test_outputs/u31_infos.log @@ -981,10 +981,10 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 16 16 - 2 summary -i UTC_T2:ssm_2a 4 4 - 3 summary -i UTC_T2:ssm_2b 4 4 - 4 summary -i UTC_T2:ssm_2c 4 4 + 1 summary -i UTC_T2:ssm_2a 4 4 + 2 summary -i UTC_T2:ssm_2b 4 4 + 3 summary -i UTC_T2:ssm_2c 4 4 + 4 FwkReport -f AfterSource 16 16 5 cat_A -w UTC_T1:ssm_1a 16 16 6 cat_A -w UTC_T1:ssm_1b 16 16 7 cat_A -w UTC_T1:ssm_1c 16 16 @@ -1006,10 +1006,10 @@ MessageLogger Summary type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- - 1 FwkReport AfterSource AfterSource AfterSource + 1 summary 1/10 1/10 1/16 2 summary 1/10 1/10 1/16 3 summary 1/10 1/10 1/16 - 4 summary 1/10 1/10 1/16 + 4 FwkReport AfterSource AfterSource AfterSource 5 cat_A 1/1 1/2 1/16 6 cat_A 1/1 1/2 1/16 7 cat_A 1/1 1/2 1/16 @@ -1031,7 +1031,8 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 28 28 +Info 12 12 +FwkInfo 16 16 Warning 96 96 Error 192 192 diff --git a/FWCore/MessageService/test/unit_test_outputs/u33_all.log b/FWCore/MessageService/test/unit_test_outputs/u33_all.log index b32bd7eb2d16d..096cdf026e2e5 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u33_all.log +++ b/FWCore/MessageService/test/unit_test_outputs/u33_all.log @@ -103,16 +103,16 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 2 2 - 2 cat_A -i UTC_V1:ssm_1a 2 2 - 3 cat_A -i UTC_V1:ssm_1b 2 2 - 4 cat_A -i UTC_V2:ssm_2b 2 2 - 5 cat_BPB -i UTC_V1:ssm_1a@be 1 1 - 6 cat_BPB -i UTC_V1:ssm_1b@be 1 1 - 7 cat_BR -i UTC_V1:ssm_1a@be 1 1 - 8 cat_BR -i UTC_V1:ssm_1b@be 1 1 - 9 cat_EPB -i UTC_V1:ssm_1a@en 1 1 - 10 cat_EPB -i UTC_V1:ssm_1b@en 1 1 + 1 cat_A -i UTC_V1:ssm_1a 2 2 + 2 cat_A -i UTC_V1:ssm_1b 2 2 + 3 cat_A -i UTC_V2:ssm_2b 2 2 + 4 cat_BPB -i UTC_V1:ssm_1a@be 1 1 + 5 cat_BPB -i UTC_V1:ssm_1b@be 1 1 + 6 cat_BR -i UTC_V1:ssm_1a@be 1 1 + 7 cat_BR -i UTC_V1:ssm_1b@be 1 1 + 8 cat_EPB -i UTC_V1:ssm_1a@en 1 1 + 9 cat_EPB -i UTC_V1:ssm_1b@en 1 1 + 10 FwkReport -f AfterSource 2 2 11 cat_A -w UTC_V1:ssm_1a 2 2 12 cat_A -w UTC_V1:ssm_1b 2 2 13 cat_A -w UTC_V2:ssm_2a 2 2 @@ -128,16 +128,16 @@ MessageLogger Summary type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- - 1 FwkReport AfterSource AfterSource + 1 cat_A 1/1 1/2 2 cat_A 1/1 1/2 3 cat_A 1/1 1/2 - 4 cat_A 1/1 1/2 + 4 cat_BPB pre-events 5 cat_BPB pre-events - 6 cat_BPB pre-events + 6 cat_BR Run: 1 7 cat_BR Run: 1 - 8 cat_BR Run: 1 + 8 cat_EPB post-events 9 cat_EPB post-events - 10 cat_EPB post-events + 10 FwkReport AfterSource AfterSource 11 cat_A 1/1 1/2 12 cat_A 1/1 1/2 13 cat_A 1/1 1/2 @@ -153,7 +153,8 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 14 14 +Info 12 12 +FwkInfo 2 2 Warning 12 12 Error 8 8 diff --git a/FWCore/MessageService/test/unit_test_outputs/u33d_all.log b/FWCore/MessageService/test/unit_test_outputs/u33d_all.log index 5a7dfa5bc58b8..dfa01c033f6e1 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u33d_all.log +++ b/FWCore/MessageService/test/unit_test_outputs/u33d_all.log @@ -110,12 +110,12 @@ MessageLogger Summary 2 cat_BJ -d UTC_Vd1:ssm_1b@b 1 1 3 cat_BJ -d UTC_Vd1:ssm_1b@b 1 1 4 cat_BL -d UTC_Vd1:ssm_1b@b 1 1 - 5 FwkReport -i AfterSource 2 2 - 6 cat_A -i UTC_Vd1:ssm_1a 2 2 - 7 cat_A -i UTC_Vd1:ssm_1b 2 2 - 8 cat_A -i UTC_Vd2:ssm_2b 2 2 - 9 cat_BR -i UTC_Vd1:ssm_1a@b 1 1 - 10 cat_BR -i UTC_Vd1:ssm_1b@b 1 1 + 5 cat_A -i UTC_Vd1:ssm_1a 2 2 + 6 cat_A -i UTC_Vd1:ssm_1b 2 2 + 7 cat_A -i UTC_Vd2:ssm_2b 2 2 + 8 cat_BR -i UTC_Vd1:ssm_1a@b 1 1 + 9 cat_BR -i UTC_Vd1:ssm_1b@b 1 1 + 10 FwkReport -f AfterSource 2 2 11 cat_A -w UTC_Vd1:ssm_1a 2 2 12 cat_A -w UTC_Vd1:ssm_1b 2 2 13 cat_A -w UTC_Vd2:ssm_2a 2 2 @@ -135,12 +135,12 @@ MessageLogger Summary 2 cat_BJ pre-events 3 cat_BJ Run: 1 4 cat_BL Run: 1 Lumi: 1 - 5 FwkReport AfterSource AfterSource + 5 cat_A 1/1 1/2 6 cat_A 1/1 1/2 7 cat_A 1/1 1/2 - 8 cat_A 1/1 1/2 + 8 cat_BR Run: 1 9 cat_BR Run: 1 - 10 cat_BR Run: 1 + 10 FwkReport AfterSource AfterSource 11 cat_A 1/1 1/2 12 cat_A 1/1 1/2 13 cat_A 1/1 1/2 @@ -157,7 +157,8 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- Debug 5 5 -Info 10 10 +Info 8 8 +FwkInfo 2 2 Warning 12 12 Error 8 8 diff --git a/FWCore/MessageService/test/unit_test_outputs/u36_only.log b/FWCore/MessageService/test/unit_test_outputs/u36_only.log index f87562df6de85..b95af30f64cfd 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u36_only.log +++ b/FWCore/MessageService/test/unit_test_outputs/u36_only.log @@ -1,3 +1,4 @@ +Begin processing the 1st record. Run 1, Event 1, LumiSection 1 on stream 0 at {Timestamp} %MSG-w cat_A: UnitTestClient_X:sendSomeMessages {Timestamp} Run: 1 Event: 1 LogWarning was used to send this message %MSG diff --git a/FWCore/MessageService/test/unit_test_outputs/u3_statistics.log b/FWCore/MessageService/test/unit_test_outputs/u3_statistics.log index 3401bf02597b1..d6ae5e5ca46f9 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u3_statistics.log +++ b/FWCore/MessageService/test/unit_test_outputs/u3_statistics.log @@ -6,9 +6,9 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- 1 FwkJob -i UnitTestClient_A 3* 3 - 2 FwkReport -i AfterSource 3 3 - 3 cat_A -i UnitTestClient_A 3 3 - 4 cat_B -i UnitTestClient_A 3 3 + 2 cat_A -i UnitTestClient_A 3 3 + 3 cat_B -i UnitTestClient_A 3 3 + 4 FwkReport -f AfterSource 3 3 5 cat_A -w UnitTestClient_A 3 3 6 cat_B -w UnitTestClient_A 3 3 7 cat_A -e UnitTestClient_A 3 3 @@ -19,9 +19,9 @@ MessageLogger Summary type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- 1 FwkJob 1/1 1/2 1/3 - 2 FwkReport AfterSource AfterSource AfterSource - 3 cat_A 1/1 1/2 1/3 - 4 cat_B 1/1 1/2 1/3 + 2 cat_A 1/1 1/2 1/3 + 3 cat_B 1/1 1/2 1/3 + 4 FwkReport AfterSource AfterSource AfterSource 5 cat_A 1/1 1/2 1/3 6 cat_B 1/1 1/2 1/3 7 cat_A 1/1 1/2 1/3 @@ -29,7 +29,8 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 12 12 +Info 9 9 +FwkInfo 3 3 Warning 6 6 Error 6 6 diff --git a/FWCore/MessageService/test/unit_test_outputs/u4_another.log b/FWCore/MessageService/test/unit_test_outputs/u4_another.log index d5279187e5038..571890404b49a 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u4_another.log +++ b/FWCore/MessageService/test/unit_test_outputs/u4_another.log @@ -6,9 +6,9 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- 1 FwkJob -i UnitTestClient_A 3* 3 - 2 FwkReport -i AfterSource 3* 3 - 3 cat_A -i UnitTestClient_A 3* 3 - 4 cat_B -i UnitTestClient_A 3* 3 + 2 cat_A -i UnitTestClient_A 3* 3 + 3 cat_B -i UnitTestClient_A 3* 3 + 4 FwkReport -f AfterSource 3* 3 5 cat_A -w UnitTestClient_A 3* 3 6 cat_B -w UnitTestClient_A 3* 3 7 cat_A -e UnitTestClient_A 3 3 @@ -19,9 +19,9 @@ MessageLogger Summary type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- 1 FwkJob 1/1 1/2 1/3 - 2 FwkReport AfterSource AfterSource AfterSource - 3 cat_A 1/1 1/2 1/3 - 4 cat_B 1/1 1/2 1/3 + 2 cat_A 1/1 1/2 1/3 + 3 cat_B 1/1 1/2 1/3 + 4 FwkReport AfterSource AfterSource AfterSource 5 cat_A 1/1 1/2 1/3 6 cat_B 1/1 1/2 1/3 7 cat_A 1/1 1/2 1/3 @@ -29,7 +29,8 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 12 12 +Info 9 9 +FwkInfo 3 3 Warning 6 6 Error 6 6 diff --git a/FWCore/MessageService/test/unit_test_outputs/u5_default.log b/FWCore/MessageService/test/unit_test_outputs/u5_default.log index b9bdfa49324cc..090a0d1524f12 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u5_default.log +++ b/FWCore/MessageService/test/unit_test_outputs/u5_default.log @@ -5,7 +5,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1* 1 + 1 FwkReport -f AfterSource 1* 1 2 cat_A -e UnitTestClient_B 1 1 3 cat_B -e UnitTestClient_B 1 1 @@ -19,7 +19,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 1 1 +FwkInfo 1 1 Error 2 2 dropped waiting message count 0 @@ -30,7 +30,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 2* 2 + 1 FwkReport -f AfterSource 2* 2 2 cat_A -e UnitTestClient_B 3 3 3 cat_B -e UnitTestClient_B 2 2 @@ -44,7 +44,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 2 2 +FwkInfo 2 2 Error 5 5 dropped waiting message count 0 @@ -55,7 +55,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 3* 3 + 1 FwkReport -f AfterSource 3* 3 2 cat_A -e UnitTestClient_B 6 6 3 cat_B -e UnitTestClient_B 3 3 @@ -69,7 +69,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 3 3 +FwkInfo 3 3 Error 9 9 dropped waiting message count 0 @@ -80,7 +80,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 3* 3 + 1 FwkReport -f AfterSource 3* 3 2 cat_A -e UnitTestClient_B 6 6 3 cat_B -e UnitTestClient_B 3 3 @@ -94,7 +94,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 3 3 +FwkInfo 3 3 Error 9 9 dropped waiting message count 0 diff --git a/FWCore/MessageService/test/unit_test_outputs/u5_noreset.log b/FWCore/MessageService/test/unit_test_outputs/u5_noreset.log index b9bdfa49324cc..090a0d1524f12 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u5_noreset.log +++ b/FWCore/MessageService/test/unit_test_outputs/u5_noreset.log @@ -5,7 +5,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1* 1 + 1 FwkReport -f AfterSource 1* 1 2 cat_A -e UnitTestClient_B 1 1 3 cat_B -e UnitTestClient_B 1 1 @@ -19,7 +19,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 1 1 +FwkInfo 1 1 Error 2 2 dropped waiting message count 0 @@ -30,7 +30,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 2* 2 + 1 FwkReport -f AfterSource 2* 2 2 cat_A -e UnitTestClient_B 3 3 3 cat_B -e UnitTestClient_B 2 2 @@ -44,7 +44,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 2 2 +FwkInfo 2 2 Error 5 5 dropped waiting message count 0 @@ -55,7 +55,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 3* 3 + 1 FwkReport -f AfterSource 3* 3 2 cat_A -e UnitTestClient_B 6 6 3 cat_B -e UnitTestClient_B 3 3 @@ -69,7 +69,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 3 3 +FwkInfo 3 3 Error 9 9 dropped waiting message count 0 @@ -80,7 +80,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 3* 3 + 1 FwkReport -f AfterSource 3* 3 2 cat_A -e UnitTestClient_B 6 6 3 cat_B -e UnitTestClient_B 3 3 @@ -94,7 +94,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 3 3 +FwkInfo 3 3 Error 9 9 dropped waiting message count 0 diff --git a/FWCore/MessageService/test/unit_test_outputs/u5_reset.log b/FWCore/MessageService/test/unit_test_outputs/u5_reset.log index 113f90e76be04..8d3e8d5054ab5 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u5_reset.log +++ b/FWCore/MessageService/test/unit_test_outputs/u5_reset.log @@ -5,7 +5,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1* 1 + 1 FwkReport -f AfterSource 1* 1 2 cat_A -e UnitTestClient_B 1 1 3 cat_B -e UnitTestClient_B 1 1 @@ -19,7 +19,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 1 1 +FwkInfo 1 1 Error 2 2 dropped waiting message count 0 @@ -30,7 +30,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1* 1 + 1 FwkReport -f AfterSource 1* 1 2 cat_A -e UnitTestClient_B 2 2 3 cat_B -e UnitTestClient_B 1 1 @@ -44,7 +44,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 1 1 +FwkInfo 1 1 Error 3 3 dropped waiting message count 0 @@ -55,7 +55,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkReport -i AfterSource 1* 1 + 1 FwkReport -f AfterSource 1* 1 2 cat_A -e UnitTestClient_B 3 3 3 cat_B -e UnitTestClient_B 1 1 @@ -69,7 +69,7 @@ MessageLogger Summary Severity # Occurrences Total Occurrences -------- ------------- ----------------- -Info 1 1 +FwkInfo 1 1 Error 4 4 dropped waiting message count 0 From 59b3826c510fff7a65724d2eb909c96a9e5b5d07 Mon Sep 17 00:00:00 2001 From: Andrea <perrotta@cern.ch> Date: Fri, 16 Oct 2020 09:23:37 +0200 Subject: [PATCH 625/778] Apply some further simplification in Muon.cc --- DataFormats/MuonReco/src/Muon.cc | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/DataFormats/MuonReco/src/Muon.cc b/DataFormats/MuonReco/src/Muon.cc index f1b028571b0dd..f926b2837282a 100644 --- a/DataFormats/MuonReco/src/Muon.cc +++ b/DataFormats/MuonReco/src/Muon.cc @@ -151,7 +151,7 @@ unsigned int Muon::stationMask(ArbitrationType type) const { // for (auto& rpcMatch : chamberMatch.rpcMatches) { // TO BE FIXED: there is clearly something odd here // Replaced by something which restores the previous functionality, but one should verify which were the - // Original intentions of the author and provide a more appropriate fix (and remove these comment lines) + // original intentions of the author and provide a more appropriate fix (and remove these comment lines) if (!chamberMatch.rpcMatches.empty()) { curMask = 1 << ((chamberMatch.station() - 1) + 4 * (rpcIndex - 1)); @@ -227,19 +227,20 @@ unsigned int Muon::RPClayerMask(ArbitrationType type) const { RPCDetId rollId = chamberMatch.id.rawId(); const int region = rollId.region(); + const int stationIndex = chamberMatch.station(); - int rpcLayer = chamberMatch.station(); + int rpcLayer = stationIndex; if (region == 0) { const int layer = rollId.layer(); - rpcLayer = chamberMatch.station() - 1 + chamberMatch.station() * layer; - if ((chamberMatch.station() == 2 && layer == 2) || (chamberMatch.station() == 4 && layer == 1)) + rpcLayer = stationIndex - 1 + stationIndex * layer; + if ((stationIndex == 2 && layer == 2) || (stationIndex == 4 && layer == 1)) rpcLayer -= 1; } else rpcLayer += 6; // for (auto& rpcMatch : chamberMatch.rpcMatches) { // TO BE FIXED: there is clearly something odd here // Replaced by something which restores the previous functionality, but one should verify which were the - // Original intentions of the author and provide a more appropriate fix (and remove these comment lines) + // original intentions of the author and provide a more appropriate fix (and remove these comment lines) if (!chamberMatch.rpcMatches.empty()) { curMask = 1 << (rpcLayer - 1); @@ -257,12 +258,12 @@ unsigned int Muon::stationGapMaskDistance(float distanceCut) const { distanceCut = std::abs(distanceCut); for (auto& chamberMatch : muMatches_) { unsigned int curMask(0); - int stationIndex = chamberMatch.station(); - if (stationIndex < 1 || stationIndex >= 5) - continue; - int detectorIndex = chamberMatch.detector(); + const int detectorIndex = chamberMatch.detector(); if (detectorIndex < 1 || detectorIndex >= 4) continue; + const int stationIndex = chamberMatch.station(); + if (stationIndex < 1 || stationIndex >= 5) + continue; float edgeX = chamberMatch.edgeX; float edgeY = chamberMatch.edgeY; @@ -284,12 +285,12 @@ unsigned int Muon::stationGapMaskPull(float sigmaCut) const { unsigned int totMask(0); for (auto& chamberMatch : muMatches_) { unsigned int curMask(0); - int stationIndex = chamberMatch.station(); - if (stationIndex < 1 || stationIndex >= 5) - continue; - int detectorIndex = chamberMatch.detector(); + const int detectorIndex = chamberMatch.detector(); if (detectorIndex < 1 || detectorIndex >= 4) continue; + const int stationIndex = chamberMatch.station(); + if (stationIndex < 1 || stationIndex >= 5) + continue; float edgeX = chamberMatch.edgeX; float edgeY = chamberMatch.edgeY; @@ -376,7 +377,7 @@ int Muon::numberOfSegments(int station, int muonSubdetId, ArbitrationType type) for (auto& chamberMatch : muMatches_) { if (chamberMatch.segmentMatches.empty()) continue; - if (!(chamberMatch.station() == station && chamberMatch.detector() == muonSubdetId)) + if (chamberMatch.detector() != muonSubdetId || chamberMatch.station() != station) continue; if (type == NoArbitration) { @@ -414,7 +415,7 @@ const std::vector<const MuonChamberMatch*> Muon::chambers(int station, int muonS for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin(); chamberMatch != muMatches_.end(); chamberMatch++) - if (chamberMatch->station() == station && chamberMatch->detector() == muonSubdetId) + if (chamberMatch->detector() == muonSubdetId && chamberMatch->station() == station) chambers.push_back(&(*chamberMatch)); return chambers; } From 9924ab13d0565705b99f45dc3912698b82820833 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Fri, 16 Oct 2020 08:36:40 -0500 Subject: [PATCH 626/778] Made TtEvent::printParticle a stand alone function Needed to remove forward declaration of edm::LogInfo since that is no longer a class. The function did not depend on anything in the class anyway. --- .../TopObjects/interface/TtEvent.h | 7 ---- AnalysisDataFormats/TopObjects/src/TtEvent.cc | 14 -------- .../TopObjects/src/TtFullHadronicEvent.cc | 3 ++ .../TopObjects/src/TtFullLeptonicEvent.cc | 3 ++ .../TopObjects/src/TtSemiLeptonicEvent.cc | 3 ++ .../TopObjects/src/printParticle.cc | 32 ++++++++++++++++++ .../TopObjects/src/printParticle.h | 33 +++++++++++++++++++ 7 files changed, 74 insertions(+), 21 deletions(-) create mode 100644 AnalysisDataFormats/TopObjects/src/printParticle.cc create mode 100644 AnalysisDataFormats/TopObjects/src/printParticle.h diff --git a/AnalysisDataFormats/TopObjects/interface/TtEvent.h b/AnalysisDataFormats/TopObjects/interface/TtEvent.h index 0b0494c5af108..a460c142953d4 100644 --- a/AnalysisDataFormats/TopObjects/interface/TtEvent.h +++ b/AnalysisDataFormats/TopObjects/interface/TtEvent.h @@ -20,10 +20,6 @@ provides access and administration. */ -namespace edm { - class LogInfo; -} - class TtEvent { public: /// supported classes of event hypotheses @@ -154,9 +150,6 @@ class TtEvent { /// get combined 4-vector of top and topBar from the TtGenEvent const math::XYZTLorentzVector* topPair() const { return (!genEvt_ ? nullptr : this->genEvent()->topPair()); }; - /// print pt, eta, phi, mass of a given candidate into an existing LogInfo - void printParticle(edm::LogInfo& log, const char* name, const reco::Candidate* cand) const; - /// set leptonic decay channels void setLepDecays(const WDecay::LeptonType& lepDecTop1, const WDecay::LeptonType& lepDecTop2) { lepDecays_ = std::make_pair(lepDecTop1, lepDecTop2); diff --git a/AnalysisDataFormats/TopObjects/src/TtEvent.cc b/AnalysisDataFormats/TopObjects/src/TtEvent.cc index b78d5fd39733c..e4ee8c7ffb523 100644 --- a/AnalysisDataFormats/TopObjects/src/TtEvent.cc +++ b/AnalysisDataFormats/TopObjects/src/TtEvent.cc @@ -1,6 +1,5 @@ #include "AnalysisDataFormats/TopObjects/interface/TtEvent.h" #include "CommonTools/Utils/interface/StringToEnumValue.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" #include <cstring> // find corresponding hypotheses based on JetLepComb @@ -16,16 +15,3 @@ int TtEvent::correspondingHypo(const HypoClassKey& key1, const unsigned& hyp1, c TtEvent::HypoClassKey TtEvent::hypoClassKeyFromString(const std::string& label) const { return (HypoClassKey)StringToEnumValue<HypoClassKey>(label); } - -// print pt, eta, phi, mass of a given candidate into an existing LogInfo -void TtEvent::printParticle(edm::LogInfo& log, const char* name, const reco::Candidate* cand) const { - if (!cand) { - log << std::setw(15) << name << ": not available!\n"; - return; - } - log << std::setprecision(3) << setiosflags(std::ios::fixed | std::ios::showpoint); - log << std::setw(15) << name << ": " << std::setw(7) << cand->pt() << "; " << std::setw(7) << cand->eta() << "; " - << std::setw(7) << cand->phi() << "; " << resetiosflags(std::ios::fixed | std::ios::showpoint) - << setiosflags(std::ios::scientific) << std::setw(10) << cand->mass() << "\n"; - log << resetiosflags(std::ios::scientific); -} diff --git a/AnalysisDataFormats/TopObjects/src/TtFullHadronicEvent.cc b/AnalysisDataFormats/TopObjects/src/TtFullHadronicEvent.cc index a53c77fdc59a1..cc03e9e3674ad 100644 --- a/AnalysisDataFormats/TopObjects/src/TtFullHadronicEvent.cc +++ b/AnalysisDataFormats/TopObjects/src/TtFullHadronicEvent.cc @@ -2,6 +2,9 @@ #include "AnalysisDataFormats/TopObjects/interface/TtFullHadronicEvent.h" #include "AnalysisDataFormats/TopObjects/interface/TtFullHadEvtPartons.h" +#include "printParticle.h" +using ttevent::printParticle; + // print info via MessageLogger void TtFullHadronicEvent::print(const int verbosity) const { if (verbosity % 10 <= 0) diff --git a/AnalysisDataFormats/TopObjects/src/TtFullLeptonicEvent.cc b/AnalysisDataFormats/TopObjects/src/TtFullLeptonicEvent.cc index 3c6691c7ea12e..537049e215540 100644 --- a/AnalysisDataFormats/TopObjects/src/TtFullLeptonicEvent.cc +++ b/AnalysisDataFormats/TopObjects/src/TtFullLeptonicEvent.cc @@ -2,6 +2,9 @@ #include "AnalysisDataFormats/TopObjects/interface/TtFullLeptonicEvent.h" #include "AnalysisDataFormats/TopObjects/interface/TtFullLepEvtPartons.h" +#include "printParticle.h" +using ttevent::printParticle; + // print info via MessageLogger void TtFullLeptonicEvent::print(const int verbosity) const { if (verbosity % 10 <= 0) diff --git a/AnalysisDataFormats/TopObjects/src/TtSemiLeptonicEvent.cc b/AnalysisDataFormats/TopObjects/src/TtSemiLeptonicEvent.cc index 55d50fdb11cfd..aec21f677cbd6 100644 --- a/AnalysisDataFormats/TopObjects/src/TtSemiLeptonicEvent.cc +++ b/AnalysisDataFormats/TopObjects/src/TtSemiLeptonicEvent.cc @@ -2,6 +2,9 @@ #include "AnalysisDataFormats/TopObjects/interface/TtSemiLeptonicEvent.h" #include "AnalysisDataFormats/TopObjects/interface/TtSemiLepEvtPartons.h" +#include "printParticle.h" +using ttevent::printParticle; + // print info via MessageLogger void TtSemiLeptonicEvent::print(const int verbosity) const { if (verbosity % 10 <= 0) diff --git a/AnalysisDataFormats/TopObjects/src/printParticle.cc b/AnalysisDataFormats/TopObjects/src/printParticle.cc new file mode 100644 index 0000000000000..75ab342d90901 --- /dev/null +++ b/AnalysisDataFormats/TopObjects/src/printParticle.cc @@ -0,0 +1,32 @@ +// -*- C++ -*- +// +// Package: AnalysisDataFormats/TopObjects +// Class : printParticle +// +// Implementation: +// [Notes on implementation] +// +// Original Author: Christopher Jones +// Created: Fri, 16 Oct 2020 13:25:54 GMT +// + +// system include files + +// user include files +#include "AnalysisDataFormats/TopObjects/src/printParticle.h" + +namespace ttevent { + // print pt, eta, phi, mass of a given candidate into an existing LogInfo + void printParticle(edm::LogInfo& log, const char* name, const reco::Candidate* cand) { + if (!cand) { + log << std::setw(15) << name << ": not available!\n"; + return; + } + log << std::setprecision(3) << setiosflags(std::ios::fixed | std::ios::showpoint); + log << std::setw(15) << name << ": " << std::setw(7) << cand->pt() << "; " << std::setw(7) << cand->eta() << "; " + << std::setw(7) << cand->phi() << "; " << resetiosflags(std::ios::fixed | std::ios::showpoint) + << setiosflags(std::ios::scientific) << std::setw(10) << cand->mass() << "\n"; + log << resetiosflags(std::ios::scientific); + } + +} // namespace ttevent diff --git a/AnalysisDataFormats/TopObjects/src/printParticle.h b/AnalysisDataFormats/TopObjects/src/printParticle.h new file mode 100644 index 0000000000000..9424ea18b0d98 --- /dev/null +++ b/AnalysisDataFormats/TopObjects/src/printParticle.h @@ -0,0 +1,33 @@ +#ifndef AnalysisDataFormats_TopObjects_printParticle_h +#define AnalysisDataFormats_TopObjects_printParticle_h +// -*- C++ -*- +// +// Package: AnalysisDataFormats/TopObjects +// Class : printParticle +// +/**\function ttevent::printParticle printParticle.h "AnalysisDataFormats/TopObjects/interface/printParticle.h" + + Description: [one line class summary] + + Usage: + <usage> + +*/ +// +// Original Author: Christopher Jones +// Created: Fri, 16 Oct 2020 13:22:44 GMT +// + +// system include files + +// user include files +#include "DataFormats/Candidate/interface/Candidate.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +// forward declarations + +namespace ttevent { + /// print pt, eta, phi, mass of a given candidate into an existing LogInfo + void printParticle(edm::LogInfo& log, const char* name, const reco::Candidate* cand); +} // namespace ttevent +#endif From 8f6e93a4ed87a413cee6bf8e211605519b90ccd7 Mon Sep 17 00:00:00 2001 From: Andres Vargas <vargasa@cua.edu> Date: Thu, 15 Oct 2020 12:06:50 -0500 Subject: [PATCH 627/778] autoCond key, ESPrefer. Patches from @mmusich: * See https://github.com/cms-sw/cmssw/pull/31729#issuecomment-709137245 * See https://github.com/cms-sw/cmssw/pull/31729#issuecomment-709982808 --- .../SiStripChannelGain/test/testSSTGain_PCL_FromRECO.sh | 2 +- .../test/python/testTrackerModuleInfoDB_cfg.py | 2 ++ .../test/python/testTrackerModuleInfoDDD_cfg.py | 2 ++ .../test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CalibTracker/SiStripChannelGain/test/testSSTGain_PCL_FromRECO.sh b/CalibTracker/SiStripChannelGain/test/testSSTGain_PCL_FromRECO.sh index 690462fca005c..9fa8fb8b17b0e 100755 --- a/CalibTracker/SiStripChannelGain/test/testSSTGain_PCL_FromRECO.sh +++ b/CalibTracker/SiStripChannelGain/test/testSSTGain_PCL_FromRECO.sh @@ -4,4 +4,4 @@ function die { echo $1: status $2 ; exit $2; } (cmsRun ${LOCAL_TEST_DIR}/testSSTGain_PCL_FromRECO_cfg.py era=A) || die 'Failure running cmsRun testSSTGain_PCL_FromRECO_cfg.py era=A' $? (cmsRun ${LOCAL_TEST_DIR}/testSSTGain_PCL_FromRECO_cfg.py era=B) || die 'Failure running cmsRun testSSTGain_PCL_FromRECO_cfg.py era=B' $? (cmsRun ${LOCAL_TEST_DIR}/testSSTGain_HARVEST_FromRECO.py 0) || die 'Failure running cmsRun testSSTGain_HARVEST_FromRECO.py 0' $? -(cmsRun ${LOCAL_TEST_DIR}/testSSTGain_MultiRun_ALCAHARVEST.py globalTag=102X_dataRun2_Express_v3) || die 'Failure running cmsRun testSSTGain_MultiRun_ALCAHARVEST.py 0' $? +(cmsRun ${LOCAL_TEST_DIR}/testSSTGain_MultiRun_ALCAHARVEST.py globalTag=auto:run3_data_express) || die 'Failure running cmsRun testSSTGain_MultiRun_ALCAHARVEST.py 0' $? diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDB_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDB_cfg.py index e068437e701eb..1b2e49cf40533 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDB_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDB_cfg.py @@ -16,6 +16,8 @@ fromDDD = cms.bool( False ) ) +process.es_prefer_geomdet = cms.ESPrefer("TrackerGeometricDetESModule","") + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py index cf146b437cee4..320c6fa075d70 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py @@ -14,6 +14,8 @@ fromDDD = cms.bool( True ) ) +process.es_prefer_geomdet = cms.ESPrefer("TrackerGeometricDetESModule","") + process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") diff --git a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py index 5276ccd84aa23..d695e33d4b751 100644 --- a/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py +++ b/Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoFromDDDNoPrintDDD_cfg.py @@ -11,6 +11,8 @@ fromDDD = cms.bool( True ) ) +process.es_prefer_geomdet = cms.ESPrefer("TrackerGeometricDetESModule","") + process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi") process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource") From 0d26fcf0167da60881dab2da7e1527ef8f9f1cd1 Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Fri, 16 Oct 2020 15:49:43 +0200 Subject: [PATCH 628/778] fixing *1D histograms filling --- .../MtdValidation/plugins/EtlLocalRecoValidation.cc | 2 +- .../MtdValidation/plugins/EtlSimHitsValidation.cc | 2 +- .../MtdValidation/plugins/MtdGlobalRecoValidation.cc | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc index 5e2010f3cd1f7..c372e040b501e 100644 --- a/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/EtlLocalRecoValidation.cc @@ -118,7 +118,7 @@ void EtlLocalRecoValidation::analyze(const edm::Event& iEvent, const edm::EventS // --- Loop over the ELT RECO hits - unsigned int n_reco_etl[4]; + unsigned int n_reco_etl[4] = {0, 0, 0, 0}; for (const auto& recHit : *etlRecHitsHandle) { ETLDetId detId = recHit.id(); DetId geoId = detId.geographicalId(); diff --git a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc index e5f1f030e02ec..b51ceb1101b91 100644 --- a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc @@ -523,7 +523,7 @@ void EtlSimHitsValidation::bookHistograms(DQMStore::IBooker& ibook, meHitTvsEta_[1] = ibook.bookProfile( "EtlHitTvsEtaZnegD2", "ETL SIM time vs #eta (-Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.); meHitTvsEta_[2] = - ibook.bookProfile("EtlHitTvsEtaZposD2", + ibook.bookProfile("EtlHitTvsEtaZposD1", "ETL SIM time vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, diff --git a/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc b/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc index f6ac8a510ec4f..bb70170bdbd3e 100644 --- a/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc +++ b/Validation/MtdValidation/plugins/MtdGlobalRecoValidation.cc @@ -62,9 +62,9 @@ class MtdGlobalRecoValidation : public DQMEDAnalyzer { MonitorElement* meETLTrackRPTime_[4]; MonitorElement* meETLTrackNumHits_[4]; - MonitorElement* meETLTrackEffEtaTot_[4]; - MonitorElement* meETLTrackEffPhiTot_[4]; - MonitorElement* meETLTrackEffPtTot_[4]; + MonitorElement* meETLTrackEffEtaTot_[2]; + MonitorElement* meETLTrackEffPhiTot_[2]; + MonitorElement* meETLTrackEffPtTot_[2]; MonitorElement* meETLTrackEffEtaMtd_[4]; MonitorElement* meETLTrackEffPhiMtd_[4]; MonitorElement* meETLTrackEffPtMtd_[4]; @@ -308,13 +308,13 @@ void MtdGlobalRecoValidation::bookHistograms(DQMStore::IBooker& ibook, meETLTrackEffPhiMtd_[1] = ibook.book1D( "TrackETLEffPhiMtdZnegD2", "Track efficiency vs phi (Mtd) (-Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); meETLTrackEffPhiMtd_[2] = - ibook.book1D("TrackETLEffPhiMtdZposD2", + ibook.book1D("TrackETLEffPhiMtdZposD1", "Track efficiency vs phi (Mtd) (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); meETLTrackEffPhiMtd_[3] = ibook.book1D( - "TrackETLEffPhiMtdZposD1", "Track efficiency vs phi (Mtd) (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); + "TrackETLEffPhiMtdZposD2", "Track efficiency vs phi (Mtd) (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2); meETLTrackEffPtMtd_[0] = ibook.book1D("TrackETLEffPtMtdZnegD1", "Track efficiency vs pt (Mtd) (-Z, Single(topo1D)/First(topo2D) Disk);pt_{RECO} [GeV]", From 53633189b6daebfee9a575e008ef04bf41bd1181 Mon Sep 17 00:00:00 2001 From: Michal Bluj <michal.bluj@cern.ch> Date: Fri, 16 Oct 2020 17:06:42 +0200 Subject: [PATCH 629/778] Use BaseParticlePropagator also for propagation to HGCal for phase-2 --- RecoTauTag/RecoTau/BuildFile.xml | 1 - .../PositionAtECalEntranceComputer.h | 2 +- .../src/PositionAtECalEntranceComputer.cc | 118 ++++-------------- 3 files changed, 23 insertions(+), 98 deletions(-) diff --git a/RecoTauTag/RecoTau/BuildFile.xml b/RecoTauTag/RecoTau/BuildFile.xml index 19e5503d0ab85..70f6ab5b5d632 100644 --- a/RecoTauTag/RecoTau/BuildFile.xml +++ b/RecoTauTag/RecoTau/BuildFile.xml @@ -23,7 +23,6 @@ <use name="PhysicsTools/JetMCUtils"/> <use name="CommonTools/Utils"/> <use name="CommonTools/BaseParticlePropagator"/> -<use name="TrackPropagation/RungeKutta"/> <use name="RecoLocalCalo/HGCalRecAlgos"/> <use name="roottmva"/> <use name="PhysicsTools/TensorFlow"/> diff --git a/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h b/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h index d4b4a5cb31353..e9af27fa03bcf 100644 --- a/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h +++ b/RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h @@ -38,10 +38,10 @@ class PositionAtECalEntranceComputer { edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeo_esToken_; double bField_z_; bool isPhase2_; - MagneticField const* bField_; hgcal::RecHitTools recHitTools_; float hgcalFace_z_; static constexpr float ecalBarrelEndcapEtaBorder_ = 1.479; + static constexpr float hgcalHfEtaBorder_ = 3.0; }; #endif // RecoTauTag_RecoTau_PositionAtECalEntranceComputer_h diff --git a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc index befa26919f898..8537b98d0c5f2 100644 --- a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc +++ b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc @@ -5,78 +5,9 @@ #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "CommonTools/BaseParticlePropagator/interface/BaseParticlePropagator.h" -#include "DataFormats/GeometrySurface/interface/Plane.h" -#include "TrackPropagation/RungeKutta/interface/defaultRKPropagator.h" #include <cassert> -//HGCal helper classes -//MB: looks be copy of HGCal utils: L1Trigger/L1THGCalUtilities/plugins/ntuples/HGCalTriggerNtupleGen.cc -namespace hgcal_helpers { - class SimpleTrackPropagator { - public: - SimpleTrackPropagator(MagneticField const* f) : field_(f), prod_(field_, alongMomentum), absz_target_(0) { - ROOT::Math::SMatrixIdentity id; - AlgebraicSymMatrix55 C(id); - //MB: To define uncertainty of starting point of trajectory propagation scale identity matrix created above by 0.001 - C *= 0.001; - err_ = CurvilinearTrajectoryError(C); - } - void setPropagationTargetZ(const float& z); - - bool propagate(const double& px, - const double& py, - const double& pz, - const double& x, - const double& y, - const double& z, - const float& charge, - reco::Candidate::Point& output) const; - - private: - SimpleTrackPropagator() : field_(nullptr), prod_(field_, alongMomentum), absz_target_(0) {} - const RKPropagatorInS& RKProp() const { return prod_.propagator; } - Plane::PlanePointer targetPlaneForward_, targetPlaneBackward_; - MagneticField const* field_; - CurvilinearTrajectoryError err_; - defaultRKPropagator::Product prod_; - float absz_target_; - }; - void SimpleTrackPropagator::setPropagationTargetZ(const float& z) { - targetPlaneForward_ = Plane::build(Plane::PositionType(0, 0, std::abs(z)), Plane::RotationType()); - targetPlaneBackward_ = Plane::build(Plane::PositionType(0, 0, -std::abs(z)), Plane::RotationType()); - absz_target_ = std::abs(z); - } - bool SimpleTrackPropagator::propagate(const double& px, - const double& py, - const double& pz, - const double& x, - const double& y, - const double& z, - const float& charge, - reco::Candidate::Point& output) const { - typedef TrajectoryStateOnSurface TSOS; - GlobalPoint startingPosition(x, y, z); - GlobalVector startingMomentum(px, py, pz); - Plane::PlanePointer startingPlane = Plane::build(Plane::PositionType(x, y, z), Plane::RotationType()); - TSOS startingStateP( - GlobalTrajectoryParameters(startingPosition, startingMomentum, charge, field_), err_, *startingPlane); - TSOS trackStateP; - if (pz > 0) { - trackStateP = RKProp().propagate(startingStateP, *targetPlaneForward_); - } else { - trackStateP = RKProp().propagate(startingStateP, *targetPlaneBackward_); - } - if (trackStateP.isValid()) { - output.SetXYZ( - trackStateP.globalPosition().x(), trackStateP.globalPosition().y(), trackStateP.globalPosition().z()); - return true; - } - output.SetXYZ(0, 0, 0); - return false; - } -} // namespace hgcal_helpers - PositionAtECalEntranceComputer::PositionAtECalEntranceComputer(edm::ConsumesCollector&& cc, bool isPhase2) : bField_esToken_(cc.esConsumes<MagneticField, IdealMagneticFieldRecord>()), caloGeo_esToken_(cc.esConsumes<CaloGeometry, CaloGeometryRecord>()), @@ -92,8 +23,7 @@ PositionAtECalEntranceComputer::PositionAtECalEntranceComputer(edm::ConsumesColl PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer() {} void PositionAtECalEntranceComputer::beginEvent(const edm::EventSetup& es) { - bField_ = &es.getData(bField_esToken_); - bField_z_ = bField_->inTesla(GlobalPoint(0., 0., 0.)).z(); + bField_z_ = es.getData(bField_esToken_).inTesla(GlobalPoint(0., 0., 0.)).z(); if (isPhase2_) { recHitTools_.setGeometry(es.getData(caloGeo_esToken_)); hgcalFace_z_ = recHitTools_.getPositionLayer(1).z(); // HGCal 1st layer @@ -104,36 +34,32 @@ reco::Candidate::Point PositionAtECalEntranceComputer::operator()(const reco::Ca bool& success) const { assert(bField_z_ != -1.); reco::Candidate::Point position; + BaseParticlePropagator propagator = BaseParticlePropagator( + RawParticle(particle->p4(), + math::XYZTLorentzVector(particle->vertex().x(), particle->vertex().y(), particle->vertex().z(), 0.), + particle->charge()), + 0., + 0., + bField_z_); if (!isPhase2_ || std::abs(particle->eta()) < ecalBarrelEndcapEtaBorder_) { // ECal - BaseParticlePropagator propagator = BaseParticlePropagator( - RawParticle(particle->p4(), - math::XYZTLorentzVector(particle->vertex().x(), particle->vertex().y(), particle->vertex().z(), 0.), - particle->charge()), - 0., - 0., - bField_z_); propagator.propagateToEcalEntrance(false); - if (propagator.getSuccess() != 0) { - position = propagator.particle().vertex().Vect(); - success = true; - } else { + } else { // HGCal + if (std::abs(particle->vertex().z()) >= hgcalFace_z_) { success = false; + return position; } - } else { // HGCal + propagator.setPropagationConditions(152.6, hgcalFace_z_, false); + propagator.propagate(); + } + if (propagator.getSuccess() != 0) { + position = propagator.particle().vertex().Vect(); + if (std::abs(position.eta()) > hgcalHfEtaBorder_) { + success = false; + } else { + success = true; + } + } else { success = false; - if (std::abs(particle->vertex().z()) >= hgcalFace_z_) - return position; - - hgcal_helpers::SimpleTrackPropagator propagator(bField_); - propagator.setPropagationTargetZ(hgcalFace_z_); - success = propagator.propagate(particle->px(), - particle->py(), - particle->pz(), - particle->vertex().x(), - particle->vertex().y(), - particle->vertex().z(), - particle->charge(), - position); } return position; } From 3888fe7bf998def934ab97848f79c57b9997769b Mon Sep 17 00:00:00 2001 From: Loukas Gouskos <Loukas.Gouskos@cern.ch> Date: Fri, 16 Oct 2020 17:14:38 +0200 Subject: [PATCH 630/778] change int to uint8 --- PhysicsTools/NanoAOD/python/vertices_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysicsTools/NanoAOD/python/vertices_cff.py b/PhysicsTools/NanoAOD/python/vertices_cff.py index fea0cfe899758..97c915d5d16c0 100644 --- a/PhysicsTools/NanoAOD/python/vertices_cff.py +++ b/PhysicsTools/NanoAOD/python/vertices_cff.py @@ -31,7 +31,7 @@ z = Var("position().z()", float, doc = "secondary vertex Z position, in cm",precision=14), ndof = Var("vertexNdof()", float, doc = "number of degrees of freedom",precision=8), chi2 = Var("vertexNormalizedChi2()", float, doc = "reduced chi2, i.e. chi/ndof",precision=8), - ntracks = Var("numberOfDaughters()", int, doc = "number of tracks"), + ntracks = Var("numberOfDaughters()", "uint8", doc = "number of tracks"), ), ) svCandidateTable.variables.pt.precision=10 From 03cfce4b3bbabddf5169c9799a8d8ec9b75f31be Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar <tkmudholkar@gmail.com> Date: Fri, 16 Oct 2020 17:37:19 +0200 Subject: [PATCH 631/778] Fix to enable concurrent processing of lumisections with ESIntegrityTask included in the workflow. --- .../interface/ESIntegrityTask.h | 12 ++++++--- .../src/ESIntegrityTask.cc | 27 ++++++++++--------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h b/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h index 7a6bf607953a1..4d5554c3c2b02 100644 --- a/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h +++ b/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h @@ -9,7 +9,11 @@ #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" -class ESIntegrityTask : public DQMOneLumiEDAnalyzer<> { +struct ESLSCache { + int ievtLS_; +}; + +class ESIntegrityTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ESLSCache>> { public: ESIntegrityTask(const edm::ParameterSet& ps); ~ESIntegrityTask() override {} @@ -27,13 +31,13 @@ class ESIntegrityTask : public DQMOneLumiEDAnalyzer<> { void dqmEndRun(const edm::Run& r, const edm::EventSetup& c) override; /// Begin Lumi - void dqmBeginLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) override; + std::shared_ptr<ESLSCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) const override; /// End Lumi - void dqmEndLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) override; + void globalEndLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) override; /// Calculate Data Integrity Fraction - void calculateDIFraction(void); + void calculateDIFraction(const edm::LuminosityBlock& lumi, const edm::EventSetup& c); private: int ievt_; diff --git a/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc b/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc index 111ce18aecb57..83bad75d8be2c 100644 --- a/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc +++ b/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc @@ -67,9 +67,11 @@ void ESIntegrityTask::dqmEndRun(const Run& r, const EventSetup& c) { // TODO: no longer possible, clone histo beforehand if full statisticcs at end of run are required. } -void ESIntegrityTask::dqmBeginLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) { +std::shared_ptr<ESLSCache> ESIntegrityTask::globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) const { LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events"; // In case of Lumi based analysis SoftReset the Integrity histogram + auto lumiCache = std::make_shared<ESLSCache>(); + lumiCache->ievtLS_ = 0; if (doLumiAnalysis_) { for (int i = 0; i < 2; ++i) { for (int j = 0; j < 2; ++j) { @@ -78,13 +80,13 @@ void ESIntegrityTask::dqmBeginLuminosityBlock(const edm::LuminosityBlock& lumi, } } } - ievt_ = 0; } + return lumiCache; } -void ESIntegrityTask::dqmEndLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) { +void ESIntegrityTask::globalEndLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) { if (doLumiAnalysis_) - calculateDIFraction(); + calculateDIFraction(lumi, c); } void ESIntegrityTask::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const&, edm::EventSetup const&) { @@ -178,7 +180,6 @@ void ESIntegrityTask::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& if (doLumiAnalysis_) { sprintf(histo, "ES Good Channel Fraction"); - auto scope = DQMStore::IBooker::UseLumiScope(iBooker); meDIFraction_ = iBooker.book2D(histo, histo, 3, 1.0, 3.0, 3, 1.0, 3.0); } } @@ -187,6 +188,8 @@ void ESIntegrityTask::endJob(void) { LogInfo("ESIntegrityTask") << "analyzed " < void ESIntegrityTask::analyze(const Event& e, const EventSetup& c) { ievt_++; + auto lumiCache = luminosityBlockCache(e.getLuminosityBlock().index()); + ++(lumiCache->ievtLS_); Handle<ESRawDataCollection> dccs; Handle<ESLocalRawDataCollection> kchips; @@ -315,9 +318,10 @@ void ESIntegrityTask::analyze(const Event& e, const EventSetup& c) { // // -- Calculate Data Integrity Fraction // -void ESIntegrityTask::calculateDIFraction(void) { +void ESIntegrityTask::calculateDIFraction(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) { float nValidChannels = 0; float nGlobalErrors = 0; + auto lumiCache = luminosityBlockCache(lumi.index()); for (int i = 0; i < 2; ++i) { for (int j = 0; j < 2; ++j) { @@ -331,16 +335,15 @@ void ESIntegrityTask::calculateDIFraction(void) { float val = meDIErrors_[i][j]->getBinContent(x + 1, y + 1); if (fed_[i][j][x][y] == -1) continue; - if (ievt_ != 0) - nGlobalErrors += val / ievt_; + if ((lumiCache->ievtLS_) != 0) + nGlobalErrors += val / (lumiCache->ievtLS_); nValidChannels++; - if (ievt_ != 0) - nGlobalErrorsES += val / ievt_; + if ((lumiCache->ievtLS_) != 0) + nGlobalErrorsES += val / (lumiCache->ievtLS_); nValidChannelsES++; } } - if (nValidChannelsES != 0) - reportSummaryES = 1 - nGlobalErrorsES / nValidChannelsES; + if (nValidChannelsES != 0) reportSummaryES = 1 - nGlobalErrorsES / nValidChannelsES; meDIFraction_->setBinContent(i + 1, j + 1, reportSummaryES); } } From 9277c0be003893cd0235e8cf896ec475f18c75c6 Mon Sep 17 00:00:00 2001 From: Michal Bluj <michal.bluj@cern.ch> Date: Fri, 16 Oct 2020 17:43:27 +0200 Subject: [PATCH 632/778] small simplification --- RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc index 8537b98d0c5f2..7b15c10d57427 100644 --- a/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc +++ b/RecoTauTag/RecoTau/src/PositionAtECalEntranceComputer.cc @@ -53,11 +53,7 @@ reco::Candidate::Point PositionAtECalEntranceComputer::operator()(const reco::Ca } if (propagator.getSuccess() != 0) { position = propagator.particle().vertex().Vect(); - if (std::abs(position.eta()) > hgcalHfEtaBorder_) { - success = false; - } else { - success = true; - } + success = (std::abs(position.eta()) <= hgcalHfEtaBorder_); } else { success = false; } From be52a08273b8142b9149ca13f3645724d0fd9f0b Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Fri, 16 Oct 2020 10:48:24 -0500 Subject: [PATCH 633/778] Explicitly tell compiler how to handle auto-generated functions --- FWCore/MessageLogger/interface/MessageLogger.h | 1 + FWCore/MessageLogger/interface/MessageSender.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/FWCore/MessageLogger/interface/MessageLogger.h b/FWCore/MessageLogger/interface/MessageLogger.h index 5178ea10b9400..5c69805e37f8c 100644 --- a/FWCore/MessageLogger/interface/MessageLogger.h +++ b/FWCore/MessageLogger/interface/MessageLogger.h @@ -74,6 +74,7 @@ namespace edm { Log(ThisLog&&) = default; Log(ThisLog const&) = delete; Log& operator=(ThisLog const&) = delete; + Log& operator=(ThisLog&&) = default; ~Log() = default; template <class T> diff --git a/FWCore/MessageLogger/interface/MessageSender.h b/FWCore/MessageLogger/interface/MessageSender.h index 5e4e73b5d4b2a..23881f7fb19d3 100644 --- a/FWCore/MessageLogger/interface/MessageSender.h +++ b/FWCore/MessageLogger/interface/MessageSender.h @@ -22,6 +22,8 @@ namespace edm { MessageSender(ELseverityLevel const& sev, std::string_view id, bool verbatim = false, bool suppressed = false); MessageSender(MessageSender&&) = default; MessageSender(MessageSender const&) = default; + MessageSender& operator=(MessageSender&&) = default; + MessageSender& operator=(MessageSender const&) = default; ~MessageSender(); // --- stream out the next part of a message: From e293a01b512b6303f810b4227688aa8bc60e24ee Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Fri, 16 Oct 2020 10:48:51 -0500 Subject: [PATCH 634/778] Removed unnecessary comments --- FWCore/MessageLogger/src/ELseverityLevel.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FWCore/MessageLogger/src/ELseverityLevel.cc b/FWCore/MessageLogger/src/ELseverityLevel.cc index 29af5c97b6c03..9b3d4bdb16fb7 100644 --- a/FWCore/MessageLogger/src/ELseverityLevel.cc +++ b/FWCore/MessageLogger/src/ELseverityLevel.cc @@ -108,13 +108,13 @@ namespace edm { std::array<std::string, nLevels> ret; ret[ELsev_noValueAssigned] = "?no value?"; ret[ELsev_zeroSeverity] = "--"; - ret[ELsev_success] = "Debug"; // 4/21/09 mf + ret[ELsev_success] = "Debug"; ret[ELsev_info] = "Info"; ret[ELsev_fwkInfo] = "FwkInfo"; ret[ELsev_warning] = "Warning"; ret[ELsev_error] = "Error"; ret[ELsev_unspecified] = "??"; - ret[ELsev_severe] = "System"; // 6/13/07 mf + ret[ELsev_severe] = "System"; ret[ELsev_highestSeverity] = "!!"; return ret; }(); @@ -134,7 +134,7 @@ namespace edm { ret[ELsev_warning] = "WARNING"; ret[ELsev_error] = "ERROR"; ret[ELsev_unspecified] = "UNSPECIFIED"; - ret[ELsev_severe] = "SYSTEM"; // 6/13/07 mf + ret[ELsev_severe] = "SYSTEM"; ret[ELsev_highestSeverity] = "HIGHEST"; return ret; }(); @@ -148,13 +148,13 @@ namespace edm { std::array<std::string, nLevels> ret; ret[ELsev_noValueAssigned] = "?no value?"; ret[ELsev_zeroSeverity] = "ELzeroSeverity "; - ret[ELsev_success] = "ELdebug "; // 4/21/09 + ret[ELsev_success] = "ELdebug "; ret[ELsev_info] = "ELinfo "; ret[ELsev_fwkInfo] = "ELfwkInfo "; ret[ELsev_warning] = "ELwarning "; ret[ELsev_error] = "ELerror "; ret[ELsev_unspecified] = "ELunspecified "; - ret[ELsev_severe] = "ELsystem "; // 6/13/07 + ret[ELsev_severe] = "ELsystem "; ret[ELsev_highestSeverity] = "ELhighestSeverity"; return ret; }(); From 34d22ec8cf46fac9a45ad22d153d0ff735d4347f Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Fri, 16 Oct 2020 11:17:24 -0500 Subject: [PATCH 635/778] Make validation accept FWKINFO threshold --- FWCore/MessageService/src/MessageServicePSetValidation.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.cc b/FWCore/MessageService/src/MessageServicePSetValidation.cc index b5e4a121fb1af..c33b0b666ad75 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.cc +++ b/FWCore/MessageService/src/MessageServicePSetValidation.cc @@ -235,7 +235,7 @@ namespace edm { if (checkThreshold(thresh)) return true; flaws << psetName << " PSet: \n" - << "threshold has value " << thresh << " which is not among {DEBUG, INFO, WARNING, ERROR}\n"; + << "threshold has value " << thresh << " which is not among {DEBUG, INFO, FWKINFO, WARNING, ERROR}\n"; return false; } // validateThreshold @@ -244,6 +244,8 @@ namespace edm { return true; if (thresh == "INFO") return true; + if (thresh == "FWKINFO") + return true; if (thresh == "ERROR") return true; if (thresh == "DEBUG") From 467cd82665fe279eea3f4db1c3f32d8a07f8c352 Mon Sep 17 00:00:00 2001 From: Giulia Sorrentino <sorrentinogiulia10@gmail.com> Date: Fri, 16 Oct 2020 18:21:31 +0200 Subject: [PATCH 636/778] fixing hitZ histograms range --- Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc | 8 ++++---- Validation/MtdValidation/plugins/EtlSimHitsValidation.cc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc index fdd91764fc14c..30652aa9c6efa 100644 --- a/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlDigiHitsValidation.cc @@ -283,11 +283,11 @@ void EtlDigiHitsValidation::bookHistograms(DQMStore::IBooker& ibook, "EtlHitYZposD1", "ETL DIGI hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{DIGI} [cm]", 100, -130., 130.); meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL DIGI hits Y (+Z, Second disk);Y_{DIGI} [cm]", 100, -130., 130.); meHitZ_[0] = ibook.book1D( - "EtlHitZZnegD1", "ETL DIGI hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, -310, -301); - meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL DIGI hits Z (-Z, Second disk);Z_{DIGI} [cm]", 100, -310, -301); + "EtlHitZZnegD1", "ETL DIGI hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, -304.2, -303.4); + meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL DIGI hits Z (-Z, Second disk);Z_{DIGI} [cm]", 100, -304.2, -303.4); meHitZ_[2] = ibook.book1D( - "EtlHitZZposD1", "ETL DIGI hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, 301, 310); - meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL DIGI hits Z (+Z, Second disk);Z_{DIGI} [cm]", 100, 301, 310); + "EtlHitZZposD1", "ETL DIGI hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{DIGI} [cm]", 100, 303.4, 304.2); + meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL DIGI hits Z (+Z, Second disk);Z_{DIGI} [cm]", 100, 303.4, 304.2); meHitPhi_[0] = ibook.book1D("EtlHitPhiZnegD1", "ETL DIGI hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{DIGI} [rad]", diff --git a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc index b51ceb1101b91..3de18b641f8e9 100644 --- a/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc +++ b/Validation/MtdValidation/plugins/EtlSimHitsValidation.cc @@ -381,11 +381,11 @@ void EtlSimHitsValidation::bookHistograms(DQMStore::IBooker& ibook, "EtlHitYZposD1", "ETL SIM hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.); meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL SIM hits Y (+Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.); meHitZ_[0] = ibook.book1D( - "EtlHitZZnegD1", "ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -305, -301); - meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL SIM hits Z (-Z, Second disk);Z_{SIM} [cm]", 100, -305, -301); + "EtlHitZZnegD1", "ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -304.2, -303.4); + meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL SIM hits Z (-Z, Second disk);Z_{SIM} [cm]", 100, -304.2, -303.4); meHitZ_[2] = ibook.book1D( - "EtlHitZZposD1", "ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 301, 305); - meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 301, 305); + "EtlHitZZposD1", "ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 303.4, 304.2); + meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 303.4, 304.2); meHitPhi_[0] = ibook.book1D( "EtlHitPhiZnegD1", "ETL SIM hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15); From 559d2240ec81afcc2aaabd63422f5868657d4836 Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar <tkmudholkar@gmail.com> Date: Fri, 16 Oct 2020 18:33:51 +0200 Subject: [PATCH 637/778] Fixed code to follow CMS coding guidelines. --- DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h | 3 ++- DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h b/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h index 4d5554c3c2b02..cae60b4fc63b2 100644 --- a/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h +++ b/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h @@ -31,7 +31,8 @@ class ESIntegrityTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ESLSCa void dqmEndRun(const edm::Run& r, const edm::EventSetup& c) override; /// Begin Lumi - std::shared_ptr<ESLSCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) const override; + std::shared_ptr<ESLSCache> globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi, + const edm::EventSetup& c) const override; /// End Lumi void globalEndLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) override; diff --git a/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc b/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc index 83bad75d8be2c..413787ab97e6f 100644 --- a/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc +++ b/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc @@ -67,7 +67,8 @@ void ESIntegrityTask::dqmEndRun(const Run& r, const EventSetup& c) { // TODO: no longer possible, clone histo beforehand if full statisticcs at end of run are required. } -std::shared_ptr<ESLSCache> ESIntegrityTask::globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& c) const { +std::shared_ptr<ESLSCache> ESIntegrityTask::globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi, + const edm::EventSetup& c) const { LogInfo("ESIntegrityTask") << "analyzed " << ievt_ << " events"; // In case of Lumi based analysis SoftReset the Integrity histogram auto lumiCache = std::make_shared<ESLSCache>(); @@ -343,7 +344,8 @@ void ESIntegrityTask::calculateDIFraction(const edm::LuminosityBlock& lumi, cons nValidChannelsES++; } } - if (nValidChannelsES != 0) reportSummaryES = 1 - nGlobalErrorsES / nValidChannelsES; + if (nValidChannelsES != 0) + reportSummaryES = 1 - nGlobalErrorsES / nValidChannelsES; meDIFraction_->setBinContent(i + 1, j + 1, reportSummaryES); } } From 0b8cdfd6b49c5963ccb6a874968d18a7b9e5e5d6 Mon Sep 17 00:00:00 2001 From: Tamas <vami.tamas@wigner.mta.hu> Date: Wed, 14 Oct 2020 21:23:17 +0200 Subject: [PATCH 638/778] Changes in 2D template making code cfg + adding a unit test --- CondTools/SiPixel/test/BuildFile.xml | 6 + ...el2DTemplateDBObjectUploader_Phase2_cfg.py | 114 +++++++++--------- .../SiPixel/test/run_Phase2cpeDBTest_v6.sh | 10 +- 3 files changed, 70 insertions(+), 60 deletions(-) diff --git a/CondTools/SiPixel/test/BuildFile.xml b/CondTools/SiPixel/test/BuildFile.xml index 74265cf0d8092..858d749d69126 100644 --- a/CondTools/SiPixel/test/BuildFile.xml +++ b/CondTools/SiPixel/test/BuildFile.xml @@ -19,3 +19,9 @@ </bin> </environment> +<environment> + <bin file="testPixelDBs.cpp"> + <flags TEST_RUNNER_ARGS=" /bin/bash CondTools/run_Phase2cpeDBTest_v6.sh"/> + <use name="FWCore/Utilities"/> + </bin> +</environment> diff --git a/CondTools/SiPixel/test/SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py b/CondTools/SiPixel/test/SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py index e14589cba74a2..fe377514344ce 100644 --- a/CondTools/SiPixel/test/SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py +++ b/CondTools/SiPixel/test/SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py @@ -1,6 +1,7 @@ import FWCore.ParameterSet.Config as cms import FWCore.ParameterSet.VarParsing as opts import csv +from io import open options = opts.VarParsing ('standard') @@ -83,31 +84,28 @@ MagFieldString+=magfieldstrsplit[1] #open the map file -mapfile = open(options.Map,'rUb') +mapfile = open(options.Map,'rU', newline='') #read the csv file into a reader mapfilereader = csv.reader(mapfile,delimiter=options.Delimiter,quotechar=options.Quotechar) #separate into the different sections barrel_rule_lines = []; endcap_rule_lines = [] barrel_exception_lines = []; endcap_exception_lines = [] sections = [barrel_rule_lines, endcap_rule_lines, barrel_exception_lines, endcap_exception_lines] -i=0; line = mapfilereader.next() +i=0; line = next(mapfilereader) for i in range(len(sections)) : - #print 'line = %s (length=%d)'%(line,len(line)) #DEBUG - while len(line)==0 or line[0].find('NUMERATOR TEMPLATE ID')==-1 : #skip to just before the section of info - line=mapfilereader.next() - # print 'line = %s (length=%d)'%(line,len(line)) #DEBUG + while line[0].find('TEMPLATE ID')==-1 : #skip to just before the section of info + line=next(mapfilereader) try : - line=mapfilereader.next() + line=next(mapfilereader) except StopIteration : - print 'Done reading input file' #DEBUG + print('Done reading input file') break - #print 'line2 = %s'%(line) #DEBUG - while len(line)>0 and line[1]!='' : #add the relevant lines to the section + while line[1]!='' : #add the lines that are the barrel rules sections[i].append(line) try : - line=mapfilereader.next() + line=next(mapfilereader) except StopIteration : - print 'Done reading input file' + print('Done reading input file') break #print 'barrel rules = %s\nendcap rules = %s\nbarrel exceptions = %s\nendcap exceptions = %s'%(barrel_rule_lines,endcap_rule_lines,barrel_exception_lines,endcap_exception_lines) #DEBUG #Make the lists of location strings and template IDs @@ -121,7 +119,7 @@ for s in range(len(sections)) : for line in sections[s] : # print 'reading line: %s'%(line) #DEBUG - template_ID_s = line[0] if options.numerator==True else line[1] + template_ID_s = line[0] while len(template_ID_s)<4 : template_ID_s='0'+template_ID_s newtemplatefilename = prefix+template_ID_s+suffix @@ -129,7 +127,7 @@ if not newtemplatefilename in template_filenames : template_filenames.append(newtemplatefilename) if s%2==0 : - lay, lad, mod = line[2], line[3], line[4] + lay, lad, mod = line[1], line[2], line[3] # print ' lay = %s, lad = %s, mod = %s'%(lay, lad, mod) #DEBUG #barrel ID strings are "layer_ladder_module" laysplit = lay.split('-'); firstlay=int(laysplit[0]); lastlay= int(laysplit[1])+1 if len(laysplit)>1 else firstlay+1 @@ -149,7 +147,7 @@ location_index = barrel_locations.index(location_string) barrel_template_IDs[location_index]=template_ID else : - disk, blade, side, panel = line[2], line[3], line[4], line[5] + disk, blade, side, panel = line[1], line[2], line[3], line[4] #endcap ID strings are "disk_blade_side_panel" disksplit = disk.split('-'); firstdisk=int(disksplit[0]); lastdisk = int(disksplit[1])+1 if len(disksplit)>1 else firstdisk+1 for i in range(firstdisk,lastdisk) : @@ -172,9 +170,9 @@ #Debug print out assignments #print 'BARREL ASSIGNMENTS:' #DEBUG #for i in range(len(barrel_locations)) : #DEBUG -# tempid = barrel_template_IDs[i] #DEBUG -# lay, lad, mod = barrel_locations[i].split('_')[0], barrel_locations[i].split('_')[1], barrel_locations[i].split('_')[2] #DEBUG -# print ' layer %s, ladder %s, module %s will have template ID %d assigned to it'%(lay,lad,mod,tempid) #DEBUG + #tempid = barrel_template_IDs[i] #DEBUG + #lay, lad, mod = barrel_locations[i].split('_')[0], barrel_locations[i].split('_')[1], barrel_locations[i].split('_')[2] #DEBUG + #print ' layer %s, ladder %s, module %s will have template ID %d assigned to it'%(lay,lad,mod,tempid) #DEBUG #print 'ENDCAP ASSIGNMENTS:' #DEBUG #for i in range(len(endcap_locations)) : #DEBUG # tempid = endcap_template_IDs[i] #DEBUG @@ -186,13 +184,13 @@ process = cms.Process("SiPixel2DTemplateDBUpload",eras.Phase2)#C2) process.load("CondCore.CondDB.CondDB_cfi") process.load("FWCore.MessageService.MessageLogger_cfi") -process.load('Configuration.Geometry.GeometryExtended2023D17Reco_cff') -process.load('Configuration.Geometry.GeometryExtended2023D17_cff') +process.load('Configuration.Geometry.GeometryExtended2026D49_cff') +process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff') process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, options.GlobalTag, '') -template_base = 'SiPixel2DTemplateDBObject_phase2_'+MagFieldString+'T_'+options.Year+'_v'+version +template_base = 'SiPixel2DTemplateDBObject_phase2_'+MagFieldString+'T'+'_v'+version if options.numerator==True : template_base+='_num' elif options.denominator==True : @@ -205,49 +203,49 @@ print '\nUploading %s with record SiPixel2DTemplateDBObjectRcd in file %s\n' % (template_base,sqlitefilename) process.source = cms.Source("EmptyIOVSource", - timetype = cms.string('runnumber'), - firstValue = cms.uint64(1), - lastValue = cms.uint64(1), - interval = cms.uint64(1) - ) + timetype = cms.string('runnumber'), + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + interval = cms.uint64(1) + ) process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) if options.numerator==True : process.PoolDBOutputService = cms.Service("PoolDBOutputService", - DBParameters = cms.PSet(messageLevel = cms.untracked.int32(0), - authenticationPath = cms.untracked.string('.') - ), - timetype = cms.untracked.string('runnumber'), - connect = cms.string(sqlitefilename), - toPut = cms.VPSet(cms.PSet(record = cms.string('SiPixel2DTemplateDBObjectRcd'), - tag = cms.string(template_base) - ) - ) - ) + DBParameters = cms.PSet(messageLevel = cms.untracked.int32(0), + authenticationPath = cms.untracked.string('.') + ), + timetype = cms.untracked.string('runnumber'), + connect = cms.string(sqlitefilename), + toPut = cms.VPSet(cms.PSet(record = cms.string('SiPixel2DTemplateDBObjectRcd'), + tag = cms.string(template_base) + ) + ) + ) elif options.denominator==True : process.PoolDBOutputService = cms.Service("PoolDBOutputService", - DBParameters = cms.PSet(messageLevel = cms.untracked.int32(0), - authenticationPath = cms.untracked.string('.') - ), - timetype = cms.untracked.string('runnumber'), - connect = cms.string(sqlitefilename), - toPut = cms.VPSet(cms.PSet(record = cms.string('SiPixel2DTemplateDBObjectRcd'), - label=cms.string('unirradiated'), - tag = cms.string(template_base) - ) - ) - ) + DBParameters = cms.PSet(messageLevel = cms.untracked.int32(0), + authenticationPath = cms.untracked.string('.') + ), + timetype = cms.untracked.string('runnumber'), + connect = cms.string(sqlitefilename), + toPut = cms.VPSet(cms.PSet(record = cms.string('SiPixel2DTemplateDBObjectRcd'), + label=cms.string('unirradiated'), + tag = cms.string(template_base) + ) + ) + ) process.uploader = cms.EDAnalyzer("SiPixel2DTemplateDBObjectUploader", - siPixelTemplateCalibrations = cms.vstring(template_filenames), - theTemplateBaseString = cms.string(template_base), - Version = cms.double(3.0), - MagField = cms.double(MagFieldValue), - detIds = cms.vuint32(1,2), #0 is for all, 1 is Barrel, 2 is EndCap - barrelLocations = cms.vstring(barrel_locations), - endcapLocations = cms.vstring(endcap_locations), - barrelTemplateIds = cms.vuint32(barrel_template_IDs), - endcapTemplateIds = cms.vuint32(endcap_template_IDs), - useVectorIndices = cms.untracked.bool(options.useVectorIndices), - ) + siPixelTemplateCalibrations = cms.vstring(template_filenames), + theTemplateBaseString = cms.string(template_base), + Version = cms.double(3.0), + MagField = cms.double(MagFieldValue), + detIds = cms.vuint32(1,2), #0 is for all, 1 is Barrel, 2 is EndCap + barrelLocations = cms.vstring(barrel_locations), + endcapLocations = cms.vstring(endcap_locations), + barrelTemplateIds = cms.vuint32(barrel_template_IDs), + endcapTemplateIds = cms.vuint32(endcap_template_IDs), + useVectorIndices = cms.untracked.bool(options.useVectorIndices), + ) process.myprint = cms.OutputModule("AsciiOutputModule") process.p = cms.Path(process.uploader) process.CondDB.connect = sqlitefilename diff --git a/CondTools/SiPixel/test/run_Phase2cpeDBTest_v6.sh b/CondTools/SiPixel/test/run_Phase2cpeDBTest_v6.sh index 5faf30a235efd..e54086decfbd4 100644 --- a/CondTools/SiPixel/test/run_Phase2cpeDBTest_v6.sh +++ b/CondTools/SiPixel/test/run_Phase2cpeDBTest_v6.sh @@ -1,4 +1,10 @@ -cmsRun SiPixelTemplateDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=6 Append=mc_25x100 Map=../data/phase2_T15_mapping.csv geometry=T15 TemplateFilePath=CondTools/SiPixel/data/25by100_dual_slope_temps +function die { echo $1: status $2 ; exit $2; } -cmsRun SiPixelGenErrorDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=6 Append=mc_25x100 Map=../data/phase2_T15_mapping.csv geometry=T15 GenErrFilePath=CondTools/SiPixel/data/25by100_dual_slope_temps +echo "TESTING Pixel CPE DB codes (for Phase-2) ..." +cmsRun ${LOCAL_TEST_DIR}/SiPixelTemplateDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=6 Append=mc_25x100 Map= ${LOCAL_TEST_DIR}/../data/phase2_T15_mapping.csv geometry=T15 TemplateFilePath= ${LOCAL_TEST_DIR}/CondTools/SiPixel/data/25by100_dual_slope_temps || die "Failure running SiPixelTemplateDBObjectUploader_cfg.py" $? + +cmsRun ${LOCAL_TEST_DIR}/SiPixelGenErrorDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=6 Append=mc_25x100 Map= ${LOCAL_TEST_DIR}/../data/phase2_T15_mapping.csv geometry=T15 GenErrFilePath= ${LOCAL_TEST_DIR}/CondTools/SiPixel/data/25by100_dual_slope_temps || die "Failure running SiPixelGenErrorDBObjectUploader_Phase2_cfg.py" $? + +#For 2D templates +cmsRun ${LOCAL_TEST_DIR}/SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=7 Append=mc_25x100 Map= ${LOCAL_TEST_DIR}/../data/Phase2_25by100_templates_2020October/phase2_T15_mapping.csv TemplateFilePath= ${LOCAL_TEST_DIR}/CondTools/SiPixel/data/Phase2_25by100_templates_2020October denominator=True || die "Failure running SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py" $? \ No newline at end of file From 3072c1acf26d90369e2e1c319744ba9c6ce8d4bf Mon Sep 17 00:00:00 2001 From: Nurfikri Norjoharuddeen <nurfikri89@gmail.com> Date: Fri, 16 Oct 2020 19:56:45 +0200 Subject: [PATCH 639/778] Modify NPUTablesProducer to save maximum of pT hats. Add flag for this option and configured to be false as default in globals_cff.py. Switched on in custom_jme_cff.py --- .../NanoAOD/plugins/NPUTablesProducer.cc | 17 ++++++++++++++++- PhysicsTools/NanoAOD/python/custom_jme_cff.py | 6 ++++++ PhysicsTools/NanoAOD/python/globals_cff.py | 3 ++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc b/PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc index d8bd6999647df..4b0e5de2a1244 100644 --- a/PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc @@ -10,13 +10,16 @@ #include <vector> #include <iostream> +#include <algorithm> class NPUTablesProducer : public edm::global::EDProducer<> { public: NPUTablesProducer(edm::ParameterSet const& params) : npuTag_(consumes<std::vector<PileupSummaryInfo>>(params.getParameter<edm::InputTag>("src"))), pvTag_(consumes<std::vector<reco::Vertex>>(params.getParameter<edm::InputTag>("pvsrc"))), - vz_(params.getParameter<std::vector<double>>("zbins")) { + vz_(params.getParameter<std::vector<double>>("zbins")), + savePtHatMax_(params.getParameter<bool>("savePtHatMax")) + { produces<nanoaod::FlatTable>(); } @@ -47,6 +50,8 @@ class NPUTablesProducer : public edm::global::EDProducer<> { float pudensity = 0; float gpudensity = 0; + float pthatmax = 0; + for (unsigned int ibx = 0; ibx < npuProd.size(); ibx++) { if (npuProd[ibx].getBunchCrossing() == 0) { bx0 = ibx; @@ -64,6 +69,10 @@ class NPUTablesProducer : public edm::global::EDProducer<> { gpudensity++; } gpudensity /= (20.0 * (*(zbin) - *(zbin - 1))); + + if (savePtHatMax_){ + pthatmax = *max_element(npuProd[ibx].getPU_pT_hats().begin(), npuProd[ibx].getPU_pT_hats().end()); + } } } unsigned int eoot = 0; @@ -86,6 +95,9 @@ class NPUTablesProducer : public edm::global::EDProducer<> { out.addColumnValue<int>("sumLOOT", loot, "number of late out of time pileup"); out.addColumnValue<float>("pudensity", pudensity, "PU vertices / mm"); out.addColumnValue<float>("gpudensity", gpudensity, "Generator-level PU vertices / mm"); + if (savePtHatMax_){ + out.addColumnValue<float>("pthatmax", pthatmax, "Maximum pt-hat"); + } } static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -95,6 +107,7 @@ class NPUTablesProducer : public edm::global::EDProducer<> { desc.add<edm::InputTag>("pvsrc", edm::InputTag("offlineSlimmedPrimaryVertices"))->setComment("tag for the PVs"); desc.add<std::vector<double>>("zbins", {}) ->setComment("Z bins to compute the generator-level number of PU vertices per mm"); + desc.add<bool>("savePtHatMax",false)->setComment("Store maximum pt-hat of PU"); descriptions.add("puTable", desc); } @@ -103,6 +116,8 @@ class NPUTablesProducer : public edm::global::EDProducer<> { const edm::EDGetTokenT<std::vector<reco::Vertex>> pvTag_; const std::vector<double> vz_; + + bool savePtHatMax_; }; #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/PhysicsTools/NanoAOD/python/custom_jme_cff.py b/PhysicsTools/NanoAOD/python/custom_jme_cff.py index 1829e4c538466..38222859ede37 100644 --- a/PhysicsTools/NanoAOD/python/custom_jme_cff.py +++ b/PhysicsTools/NanoAOD/python/custom_jme_cff.py @@ -874,6 +874,12 @@ def PrepJMECustomNanoAOD(process,runOnMC): cfg = { k : v for k, v in jetConfig.items() if k != "enabled"} recoJetInfo = recoJA.addRecoJetCollection(process, **cfg) AddNewPatJets(process, recoJetInfo, runOnMC) + + ########################################################################### + # Save Maximum of Pt Hat Max + ########################################################################### + if runOnMC: + process.puTable.savePtHatMax = True return process diff --git a/PhysicsTools/NanoAOD/python/globals_cff.py b/PhysicsTools/NanoAOD/python/globals_cff.py index bfa17e721636b..acaf0711e4175 100644 --- a/PhysicsTools/NanoAOD/python/globals_cff.py +++ b/PhysicsTools/NanoAOD/python/globals_cff.py @@ -14,7 +14,8 @@ puTable = cms.EDProducer("NPUTablesProducer", src = cms.InputTag("slimmedAddPileupInfo"), pvsrc = cms.InputTag("offlineSlimmedPrimaryVertices"), - zbins = cms.vdouble( [0.0,1.7,2.6,3.0,3.5,4.2,5.2,6.0,7.5,9.0,12.0] ) + zbins = cms.vdouble( [0.0,1.7,2.6,3.0,3.5,4.2,5.2,6.0,7.5,9.0,12.0] ), + savePtHatMax = cms.bool(False), ) genTable = cms.EDProducer("SimpleGenEventFlatTableProducer", From 485601b45eeb5ddd9616d54d4bf0be633caf8dfd Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Fri, 16 Oct 2020 19:12:59 +0200 Subject: [PATCH 640/778] clean some more BuildFiles --- CondCore/SiPixelPlugins/BuildFile.xml | 2 -- CondCore/SiPixelPlugins/plugins/BuildFile.xml | 2 -- DQM/SiTrackerPhase2/{src => }/BuildFile.xml | 0 Geometry/CaloEventSetup/BuildFile.xml | 1 + Geometry/ForwardGeometry/plugins/BuildFile.xml | 3 +-- GeometryReaders/XMLIdealGeometryESSource/test/BuildFile.xml | 1 - Validation/SiTrackerPhase2V/{src => }/BuildFile.xml | 0 Validation/SiTrackerPhase2V/plugins/BuildFile.xml | 2 -- 8 files changed, 2 insertions(+), 9 deletions(-) rename DQM/SiTrackerPhase2/{src => }/BuildFile.xml (100%) rename Validation/SiTrackerPhase2V/{src => }/BuildFile.xml (100%) diff --git a/CondCore/SiPixelPlugins/BuildFile.xml b/CondCore/SiPixelPlugins/BuildFile.xml index 4fa45f6c24c18..a555b7101e54c 100644 --- a/CondCore/SiPixelPlugins/BuildFile.xml +++ b/CondCore/SiPixelPlugins/BuildFile.xml @@ -1,5 +1,3 @@ <use name="CalibTracker/StandaloneTrackerTopology"/> <use name="CalibTracker/SiPixelESProducers"/> -<use name="CondCore/ESSources"/> <use name="CondFormats/SiPixelObjects"/> -<use name="CondFormats/DataRecord"/> diff --git a/CondCore/SiPixelPlugins/plugins/BuildFile.xml b/CondCore/SiPixelPlugins/plugins/BuildFile.xml index 6271975ebdcec..9ad92c25b96b0 100644 --- a/CondCore/SiPixelPlugins/plugins/BuildFile.xml +++ b/CondCore/SiPixelPlugins/plugins/BuildFile.xml @@ -45,10 +45,8 @@ <use name="CondCore/SiPixelPlugins"/> <use name="CondCore/Utilities"/> <use name="CondCore/CondDB"/> - <use name="CondFormats/Common"/> <use name="CondFormats/SiPixelTransient"/> <use name="CalibTracker/StandaloneTrackerTopology"/> - <use name="CalibTracker/SiPixelESProducers"/> </library> <library file="plugin.cc" name="CondCoreSiPixelPluginsPlugin"> diff --git a/DQM/SiTrackerPhase2/src/BuildFile.xml b/DQM/SiTrackerPhase2/BuildFile.xml similarity index 100% rename from DQM/SiTrackerPhase2/src/BuildFile.xml rename to DQM/SiTrackerPhase2/BuildFile.xml diff --git a/Geometry/CaloEventSetup/BuildFile.xml b/Geometry/CaloEventSetup/BuildFile.xml index 9a142cc1c00c6..0ed14cf7f44b3 100644 --- a/Geometry/CaloEventSetup/BuildFile.xml +++ b/Geometry/CaloEventSetup/BuildFile.xml @@ -1,3 +1,4 @@ +<use name="CondFormats/Alignment"/> <use name="CondFormats/GeometryObjects"/> <use name="Geometry/Records"/> <export> diff --git a/Geometry/ForwardGeometry/plugins/BuildFile.xml b/Geometry/ForwardGeometry/plugins/BuildFile.xml index f6bcfdfcfcfc8..da4726a6e8705 100644 --- a/Geometry/ForwardGeometry/plugins/BuildFile.xml +++ b/Geometry/ForwardGeometry/plugins/BuildFile.xml @@ -1,10 +1,9 @@ <use name="Geometry/ForwardGeometry"/> <use name="Geometry/Records"/> +<use name="Geometry/CaloEventSetup"/> <use name="Geometry/CaloGeometry"/> <use name="FWCore/Framework"/> <use name="FWCore/MessageLogger"/> -<use name="CondFormats/Alignment"/> -<use name="zlib"/> <library file="*.cc" name="GeometryForwardGeometryPlugins"> <flags EDM_PLUGIN="1"/> </library> diff --git a/GeometryReaders/XMLIdealGeometryESSource/test/BuildFile.xml b/GeometryReaders/XMLIdealGeometryESSource/test/BuildFile.xml index a2bda402c6f7c..02739de8c9d76 100644 --- a/GeometryReaders/XMLIdealGeometryESSource/test/BuildFile.xml +++ b/GeometryReaders/XMLIdealGeometryESSource/test/BuildFile.xml @@ -5,7 +5,6 @@ <use name="DetectorDescription/Parser"/> <use name="DetectorDescription/OfflineDBLoader"/> <use name="CondFormats/Common"/> -<use name="CondFormats/GeometryObjects"/> <flags EDM_PLUGIN="1"/> <library file="PerfectGeometryAnalyzer.cc"> </library> diff --git a/Validation/SiTrackerPhase2V/src/BuildFile.xml b/Validation/SiTrackerPhase2V/BuildFile.xml similarity index 100% rename from Validation/SiTrackerPhase2V/src/BuildFile.xml rename to Validation/SiTrackerPhase2V/BuildFile.xml diff --git a/Validation/SiTrackerPhase2V/plugins/BuildFile.xml b/Validation/SiTrackerPhase2V/plugins/BuildFile.xml index 611a15d830f3f..0f313c97de175 100644 --- a/Validation/SiTrackerPhase2V/plugins/BuildFile.xml +++ b/Validation/SiTrackerPhase2V/plugins/BuildFile.xml @@ -1,4 +1,3 @@ - <use name="FWCore/Framework"/> <use name="FWCore/ParameterSet"/> <use name="FWCore/ServiceRegistry"/> @@ -6,7 +5,6 @@ <use name="DataFormats/DetId"/> <use name="DataFormats/Common"/> <use name="DataFormats/TrackerCommon"/> -<use name="DataFormats/Phase2TrackerCluster"/> <use name="DataFormats/TrackerRecHit2D"/> <use name="DataFormats/GeometrySurface"/> <use name="DataFormats/GeometryVector"/> From fdbde17a165a0920340428a2b1d9ddf24aeedcdf Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Fri, 16 Oct 2020 20:58:20 +0200 Subject: [PATCH 641/778] Remove cfis and use fillDescriptions defaults --- .../PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py | 7 +++---- RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc | 2 +- RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc | 2 +- RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py | 7 ------- RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py | 7 ------- 5 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py delete mode 100644 RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py diff --git a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py index b2404039c60b2..94c9b8a1d1983 100644 --- a/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py +++ b/PhysicsTools/PatAlgos/python/producersHeavyIons/heavyIonJets_cff.py @@ -1,11 +1,12 @@ import FWCore.ParameterSet.Config as cms -from RecoHI.HiJetAlgos.HiSignalParticleProducer_cfi import hiSignalGenParticles +from RecoHI.HiJetAlgos.hiSignalParticleProducer_cfi import hiSignalParticleProducer as hiSignalGenParticles from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets from RecoHI.HiJetAlgos.HiGenCleaner_cff import hiPartons from RecoHI.HiJetAlgos.HiGenJets_cff import ak4HiGenJets from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets -from RecoHI.HiJetAlgos.HiSignalGenJetProducer_cfi import hiSignalGenJets +from RecoHI.HiJetAlgos.hiSignalGenJetProducer_cfi import hiSignalGenJetProducer +ak4HiSignalGenJets = hiSignalGenJetProducer.clone(src = "ak4HiGenJets") allPartons = cms.EDProducer( "PartonSelector", @@ -20,8 +21,6 @@ src = 'allPartons', ) -ak4HiSignalGenJets = hiSignalGenJets.clone(src = "ak4HiGenJets") - hiGenJetsTask = cms.Task( hiSignalGenParticles, genParticlesForJets, diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc index a79be7043cc70..e9be77cd28445 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalGenJetProducer.cc @@ -56,7 +56,7 @@ void HiSignalGenJetProducer::fillDescriptions(edm::ConfigurationDescriptions& de edm::ParameterSetDescription desc; desc.setComment("Selects genJets from collision id = 0"); desc.add<edm::InputTag>("src", edm::InputTag("akHiGenJets")); - descriptions.add("HiSignalGenJetProducer", desc); + descriptions.addWithDefaultLabel(desc); } DEFINE_FWK_MODULE(HiSignalGenJetProducer); diff --git a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc index c392eaea3f5b1..1f1148cadd2f2 100644 --- a/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc +++ b/RecoHI/HiJetAlgos/plugins/HiSignalParticleProducer.cc @@ -53,7 +53,7 @@ void HiSignalParticleProducer::fillDescriptions(edm::ConfigurationDescriptions& edm::ParameterSetDescription desc; desc.setComment("Selects genParticles from collision id = 0"); desc.add<edm::InputTag>("src", edm::InputTag("genParticles")); - descriptions.add("HiSignalParticleProducer", desc); + descriptions.addWithDefaultLabel(desc); } DEFINE_FWK_MODULE(HiSignalParticleProducer); diff --git a/RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py b/RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py deleted file mode 100644 index 63a2d3af8e6c6..0000000000000 --- a/RecoHI/HiJetAlgos/python/HiSignalGenJetProducer_cfi.py +++ /dev/null @@ -1,7 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -hiSignalGenJets = cms.EDProducer('HiSignalGenJetProducer', - src = cms.InputTag('ak4HiGenJets') - ) - diff --git a/RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py b/RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py deleted file mode 100644 index 08645ffecb98e..0000000000000 --- a/RecoHI/HiJetAlgos/python/HiSignalParticleProducer_cfi.py +++ /dev/null @@ -1,7 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -hiSignalGenParticles = cms.EDProducer('HiSignalParticleProducer', - src = cms.InputTag('genParticles') - ) - From e1d8ff3d4343bc70f1f5f99014ab854f95a5c3be Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Fri, 16 Oct 2020 14:30:19 -0500 Subject: [PATCH 642/778] Properly propagate FWKINFO within the MessageLogger config system --- FWCore/MessageService/src/MessageLoggerScribe.cc | 5 +++-- FWCore/MessageService/src/MessageServicePSetValidation.cc | 5 +++++ .../MessageService/src/ThreadSafeLogMessageLoggerScribe.cc | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/FWCore/MessageService/src/MessageLoggerScribe.cc b/FWCore/MessageService/src/MessageLoggerScribe.cc index 005ccd042d815..3b30806660dee 100644 --- a/FWCore/MessageService/src/MessageLoggerScribe.cc +++ b/FWCore/MessageService/src/MessageLoggerScribe.cc @@ -237,6 +237,7 @@ namespace edm { } // MessageLoggerScribe::configure_errorlog() void MessageLoggerScribe::configure_dest(std::shared_ptr<ELdestination> dest_ctrl, String const& filename) { + static const int NO_VALUE_SET = -45654; vString empty_vString; PSet empty_PSet; @@ -248,8 +249,7 @@ namespace edm { const int COMMON_DEFAULT_INTERVAL = NO_VALUE_SET; const int COMMON_DEFAULT_TIMESPAN = NO_VALUE_SET; - char const* severity_array[] = {"WARNING", "INFO", "ERROR", "DEBUG"}; - vString const severities(severity_array + 0, severity_array + 4); + vString const severities = {{"WARNING", "INFO", "FWKINFO", "ERROR", "DEBUG"}}; // grab list of categories vString categories = getAparameter<vString>(*job_pset_p, "categories", empty_vString); @@ -386,6 +386,7 @@ namespace edm { for (vString::const_iterator sev_it = severities.begin(); sev_it != severities.end(); ++sev_it) { String sevID = *sev_it; ELseverityLevel severity(sevID); + PSet default_sev_pset = getAparameter<PSet>(default_pset, sevID, empty_PSet); PSet sev_pset = getAparameter<PSet>(dest_pset, sevID, default_sev_pset); int limit = getAparameter<int>(sev_pset, "limit", NO_VALUE_SET); diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.cc b/FWCore/MessageService/src/MessageServicePSetValidation.cc index c33b0b666ad75..bde88be565bfb 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.cc +++ b/FWCore/MessageService/src/MessageServicePSetValidation.cc @@ -345,6 +345,8 @@ namespace edm { return false; if (word == "WARNING") return false; + if (word == "FWKINFO") + return false; if (word == "INFO") return false; if (word == "DEBUG") @@ -692,6 +694,8 @@ namespace edm { continue; if ((*i) == "WARNING") continue; + if ((*i) == "FWKINFO") + continue; if ((*i) == "INFO") continue; if ((*i) == "DEBUG") @@ -723,6 +727,7 @@ namespace edm { std::string const& psetName) { categoryPSet(pset, psetName, "ERROR"); categoryPSet(pset, psetName, "WARNING"); + categoryPSet(pset, psetName, "FWKINFO"); categoryPSet(pset, psetName, "INFO"); categoryPSet(pset, psetName, "DEBUG"); if (psetName != "MessageLogger") diff --git a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc index e87c63a289cbc..d34c39adfa77b 100644 --- a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc +++ b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc @@ -229,8 +229,7 @@ namespace edm { const int COMMON_DEFAULT_INTERVAL = NO_VALUE_SET; // change log 6 const int COMMON_DEFAULT_TIMESPAN = NO_VALUE_SET; - char const* severity_array[] = {"WARNING", "INFO", "ERROR", "DEBUG"}; - vString const severities(severity_array + 0, severity_array + 4); + vString const severities = {{"WARNING", "INFO", "FWKINFO", "ERROR", "DEBUG"}}; // grab list of categories vString categories = getAparameter<vString>(*job_pset_p, "categories", empty_vString); From 5a3a782acb675bc6fbae09273be3c6a4c3d369aa Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar <tkmudholkar@gmail.com> Date: Fri, 16 Oct 2020 21:47:43 +0200 Subject: [PATCH 643/778] Fixed bug in plot that stores LHC status. --- DQM/EcalMonitorTasks/src/TrigPrimTask.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DQM/EcalMonitorTasks/src/TrigPrimTask.cc b/DQM/EcalMonitorTasks/src/TrigPrimTask.cc index cbfea87b9d335..c53c9e485e7a4 100644 --- a/DQM/EcalMonitorTasks/src/TrigPrimTask.cc +++ b/DQM/EcalMonitorTasks/src/TrigPrimTask.cc @@ -61,6 +61,12 @@ namespace ecaldqm { towerReadouts_.clear(); + if (ByLumiResetSwitch) { + MEs_.at("EtSummaryByLumi").reset(); + MEs_.at("TTFlags4ByLumi").reset(); + MEs_.at("LHCStatusByLumi").reset(-1); + } + if (!lhcStatusSet) { // Update LHC status once each LS MESet& meLHCStatusByLumi(static_cast<MESet&>(MEs_.at("LHCStatusByLumi"))); @@ -72,12 +78,6 @@ namespace ecaldqm { } } - if (ByLumiResetSwitch) { - MEs_.at("EtSummaryByLumi").reset(); - MEs_.at("TTFlags4ByLumi").reset(); - MEs_.at("LHCStatusByLumi").reset(-1); - } - realTps_ = nullptr; // HLTCaloBit_ = false; From d266125925ee3bdce620fe607c3e6785a9cc6fba Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Fri, 16 Oct 2020 15:16:04 -0500 Subject: [PATCH 644/778] Set limit on FWKINFO severity messages --- Geometry/MTDCommonData/test/testMTDGeometry.py | 3 +++ Geometry/MTDCommonData/test/testMTDinDD4hep.py | 6 ++++++ Geometry/MTDCommonData/test/testMTDinDDD.py | 6 ++++++ Geometry/MTDGeometryBuilder/test/dd4hep_mtd_cfg.py | 6 ++++++ Geometry/MTDGeometryBuilder/test/mtd_cfg.py | 6 ++++++ Geometry/MTDNumberingBuilder/test/dd4hep_mtd_cfg.py | 3 +++ Geometry/MTDNumberingBuilder/test/mtd_cfg.py | 6 ++++++ 7 files changed, 36 insertions(+) diff --git a/Geometry/MTDCommonData/test/testMTDGeometry.py b/Geometry/MTDCommonData/test/testMTDGeometry.py index b9e7b4ddb28b4..5d591cf4f5695 100644 --- a/Geometry/MTDCommonData/test/testMTDGeometry.py +++ b/Geometry/MTDCommonData/test/testMTDGeometry.py @@ -19,6 +19,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), noLineBreaks = cms.untracked.bool(True), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) diff --git a/Geometry/MTDCommonData/test/testMTDinDD4hep.py b/Geometry/MTDCommonData/test/testMTDinDD4hep.py index f71001c69e6b9..86b6f7d1fd366 100644 --- a/Geometry/MTDCommonData/test/testMTDinDD4hep.py +++ b/Geometry/MTDCommonData/test/testMTDinDD4hep.py @@ -20,6 +20,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), DD4hep_TestMTDIdealGeometry = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), @@ -38,6 +41,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), noLineBreaks = cms.untracked.bool(True), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) diff --git a/Geometry/MTDCommonData/test/testMTDinDDD.py b/Geometry/MTDCommonData/test/testMTDinDDD.py index 50fbda4f62a14..f7c4fe81fd2af 100644 --- a/Geometry/MTDCommonData/test/testMTDinDDD.py +++ b/Geometry/MTDCommonData/test/testMTDinDDD.py @@ -20,6 +20,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), TestMTDIdealGeometry = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), @@ -38,6 +41,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), noLineBreaks = cms.untracked.bool(True), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) diff --git a/Geometry/MTDGeometryBuilder/test/dd4hep_mtd_cfg.py b/Geometry/MTDGeometryBuilder/test/dd4hep_mtd_cfg.py index bc3c86c0ac8f5..85b5895987049 100644 --- a/Geometry/MTDGeometryBuilder/test/dd4hep_mtd_cfg.py +++ b/Geometry/MTDGeometryBuilder/test/dd4hep_mtd_cfg.py @@ -24,12 +24,18 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), MTDDigiGeometryAnalyzer = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), noLineBreaks = cms.untracked.bool(True) ), mtdGeometryDD4hep = cms.untracked.PSet( + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/Geometry/MTDGeometryBuilder/test/mtd_cfg.py b/Geometry/MTDGeometryBuilder/test/mtd_cfg.py index b788f5fc03744..024f78c54cc7b 100644 --- a/Geometry/MTDGeometryBuilder/test/mtd_cfg.py +++ b/Geometry/MTDGeometryBuilder/test/mtd_cfg.py @@ -23,6 +23,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), MTDDigiGeometryAnalyzer = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), @@ -32,6 +35,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), noLineBreaks = cms.untracked.bool(True), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) diff --git a/Geometry/MTDNumberingBuilder/test/dd4hep_mtd_cfg.py b/Geometry/MTDNumberingBuilder/test/dd4hep_mtd_cfg.py index 00295be9189f4..770f1d1e96a53 100644 --- a/Geometry/MTDNumberingBuilder/test/dd4hep_mtd_cfg.py +++ b/Geometry/MTDNumberingBuilder/test/dd4hep_mtd_cfg.py @@ -37,6 +37,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), noLineBreaks = cms.untracked.bool(True), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) diff --git a/Geometry/MTDNumberingBuilder/test/mtd_cfg.py b/Geometry/MTDNumberingBuilder/test/mtd_cfg.py index 6b16478c864b2..27463c627bb4c 100644 --- a/Geometry/MTDNumberingBuilder/test/mtd_cfg.py +++ b/Geometry/MTDNumberingBuilder/test/mtd_cfg.py @@ -24,6 +24,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), GeometricTimingDetAnalyzer = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), @@ -36,6 +39,9 @@ INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), noLineBreaks = cms.untracked.bool(True), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) From b2bd0aedbd6ad99e3fdaf0255e53658a9edd7f07 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Fri, 16 Oct 2020 15:26:39 -0500 Subject: [PATCH 645/778] code-format --- FWCore/MessageService/src/MessageLoggerScribe.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/FWCore/MessageService/src/MessageLoggerScribe.cc b/FWCore/MessageService/src/MessageLoggerScribe.cc index 3b30806660dee..0b59cd17b2c3f 100644 --- a/FWCore/MessageService/src/MessageLoggerScribe.cc +++ b/FWCore/MessageService/src/MessageLoggerScribe.cc @@ -237,7 +237,6 @@ namespace edm { } // MessageLoggerScribe::configure_errorlog() void MessageLoggerScribe::configure_dest(std::shared_ptr<ELdestination> dest_ctrl, String const& filename) { - static const int NO_VALUE_SET = -45654; vString empty_vString; PSet empty_PSet; From d3c347a3edcfbe5cfebd29365fcd103c73a3f8a1 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Fri, 16 Oct 2020 23:37:43 +0200 Subject: [PATCH 646/778] Try to sort out the issue of SimHit for muons using dd4hep --- .../GeometryObjects/interface/MuonOffsetMap.h | 19 + .../src/T_EventSetup_MuonOffsetMap.cc | 4 + CondFormats/GeometryObjects/src/classes.h | 1 + .../GeometryObjects/src/classes_def.xml | 3 + ...metryDD4hepExtended2021ZeroMaterial_cff.py | 1 + .../python/GeometryDD4hepExtended2021_cff.py | 1 + .../GeometryExtended2021ZeroMaterial_cff.py | 1 + .../python/GeometryExtended2021_cff.py | 1 + .../Geometry/python/dict2021Geometry.py | 3 +- .../data/dd4hep/cmsExtendedGeometry2021.xml | 2 +- .../cmsExtendedGeometry2021ZeroMaterial.xml | 2 +- .../python/cmsExtendedGeometry2021XML_cfi.py | 2 +- ...ExtendedGeometry2021ZeroMaterialXML_cfi.py | 2 +- .../muonNumbering/2021/v2x/muonNumbering.xml | 483 ++++++++++++++++++ Geometry/MuonNumbering/BuildFile.xml | 4 +- .../interface/MuonOffsetFromDD.h | 29 ++ Geometry/MuonNumbering/plugins/BuildFile.xml | 7 +- .../plugins/MuonOffsetESProducer.cc | 95 ++++ .../python/muonOffsetESProducer_cff.py | 9 + .../MuonNumbering/src/MuonOffsetFromDD.cc | 90 ++++ Geometry/MuonNumbering/test/BuildFile.xml | 4 +- .../MuonNumbering/test/MuonOffsetAnalyzer.cc | 37 ++ .../test/testMuonOffsetDD4Hep_cfg.py | 22 + .../test/testMuonOffsetDDD_cfg.py | 22 + SimG4CMS/Muon/BuildFile.xml | 5 +- SimG4CMS/Muon/interface/MuonG4Numbering.h | 5 +- .../Muon/interface/MuonRPCFrameRotation.h | 3 +- .../Muon/interface/MuonSensitiveDetector.h | 3 +- SimG4CMS/Muon/src/MuonG4Numbering.cc | 21 +- SimG4CMS/Muon/src/MuonRPCFrameRotation.cc | 4 +- SimG4CMS/Muon/src/MuonSensitiveDetector.cc | 14 +- 31 files changed, 874 insertions(+), 25 deletions(-) create mode 100644 CondFormats/GeometryObjects/interface/MuonOffsetMap.h create mode 100644 CondFormats/GeometryObjects/src/T_EventSetup_MuonOffsetMap.cc create mode 100644 Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml create mode 100644 Geometry/MuonNumbering/interface/MuonOffsetFromDD.h create mode 100644 Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc create mode 100644 Geometry/MuonNumbering/python/muonOffsetESProducer_cff.py create mode 100644 Geometry/MuonNumbering/src/MuonOffsetFromDD.cc create mode 100644 Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc create mode 100644 Geometry/MuonNumbering/test/testMuonOffsetDD4Hep_cfg.py create mode 100644 Geometry/MuonNumbering/test/testMuonOffsetDDD_cfg.py diff --git a/CondFormats/GeometryObjects/interface/MuonOffsetMap.h b/CondFormats/GeometryObjects/interface/MuonOffsetMap.h new file mode 100644 index 0000000000000..66f02e974a806 --- /dev/null +++ b/CondFormats/GeometryObjects/interface/MuonOffsetMap.h @@ -0,0 +1,19 @@ +#ifndef CondFormats_GeometryObjects_MuonOffsetMap_h +#define CondFormats_GeometryObjects_MuonOffsetMap_h + +#include "CondFormats/Serialization/interface/Serializable.h" +#include <string> +#include <vector> +#include <unordered_map> + +class MuonOffsetMap { +public: + MuonOffsetMap(void) {} + ~MuonOffsetMap(void) {} + + std::unordered_map<std::string, std::pair<int, int> > muonMap_; + + COND_SERIALIZABLE; +}; + +#endif diff --git a/CondFormats/GeometryObjects/src/T_EventSetup_MuonOffsetMap.cc b/CondFormats/GeometryObjects/src/T_EventSetup_MuonOffsetMap.cc new file mode 100644 index 0000000000000..730bce50a9491 --- /dev/null +++ b/CondFormats/GeometryObjects/src/T_EventSetup_MuonOffsetMap.cc @@ -0,0 +1,4 @@ +#include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(MuonOffsetMap); diff --git a/CondFormats/GeometryObjects/src/classes.h b/CondFormats/GeometryObjects/src/classes.h index d37fcb036731b..9bd040c3155ae 100644 --- a/CondFormats/GeometryObjects/src/classes.h +++ b/CondFormats/GeometryObjects/src/classes.h @@ -13,3 +13,4 @@ #include "CondFormats/GeometryObjects/interface/EcalSimulationParameters.h" #include "CondFormats/GeometryObjects/interface/PHGCalParameters.h" #include "CondFormats/GeometryObjects/interface/PDetGeomDesc.h" +#include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" diff --git a/CondFormats/GeometryObjects/src/classes_def.xml b/CondFormats/GeometryObjects/src/classes_def.xml index 75f459f3d7171..8bab12b0370cc 100644 --- a/CondFormats/GeometryObjects/src/classes_def.xml +++ b/CondFormats/GeometryObjects/src/classes_def.xml @@ -206,6 +206,9 @@ <field name="matNames_" mapping="blob"/> <field name="dzs_" mapping="blob"/> </class> + <class name="MuonOffsetMap" class_version="0"> + <field name="muonMap_" mapping="blob"/> + </class> <class name="PDetGeomDesc" class_version="0"> <field name="container_" mapping="blob"/> diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterial_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterial_cff.py index 7020aa5a73487..e27bfc1f26428 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterial_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021ZeroMaterial_cff.py @@ -24,3 +24,4 @@ from Geometry.EcalCommonData.ecalSimulationParameters_cff import * from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MuonNumbering.muonOffsetESProducer_cff import * diff --git a/Configuration/Geometry/python/GeometryDD4hepExtended2021_cff.py b/Configuration/Geometry/python/GeometryDD4hepExtended2021_cff.py index 583f4d575d448..c7d4e0bcf36ea 100644 --- a/Configuration/Geometry/python/GeometryDD4hepExtended2021_cff.py +++ b/Configuration/Geometry/python/GeometryDD4hepExtended2021_cff.py @@ -24,3 +24,4 @@ from Geometry.EcalCommonData.ecalSimulationParameters_cff import * from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MuonNumbering.muonOffsetESProducer_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2021ZeroMaterial_cff.py b/Configuration/Geometry/python/GeometryExtended2021ZeroMaterial_cff.py index 4e948f3ef5d3a..b7e70cbd28708 100644 --- a/Configuration/Geometry/python/GeometryExtended2021ZeroMaterial_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021ZeroMaterial_cff.py @@ -8,4 +8,5 @@ from Geometry.EcalCommonData.ecalSimulationParameters_cff import * from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MuonNumbering.muonOffsetESProducer_cff import * diff --git a/Configuration/Geometry/python/GeometryExtended2021_cff.py b/Configuration/Geometry/python/GeometryExtended2021_cff.py index 2a636b9dd1822..62135deb81d73 100644 --- a/Configuration/Geometry/python/GeometryExtended2021_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2021_cff.py @@ -8,4 +8,5 @@ from Geometry.EcalCommonData.ecalSimulationParameters_cff import * from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MuonNumbering.muonOffsetESProducer_cff import * diff --git a/Configuration/Geometry/python/dict2021Geometry.py b/Configuration/Geometry/python/dict2021Geometry.py index f08e8b479cc33..cee7224298097 100644 --- a/Configuration/Geometry/python/dict2021Geometry.py +++ b/Configuration/Geometry/python/dict2021Geometry.py @@ -1029,7 +1029,7 @@ 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', ], 2 : [ - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml', ], 3 : [ 'Geometry/MuonSimData/data/v2/muonSens.xml', @@ -1045,6 +1045,7 @@ ], "sim" : [ 'from Geometry.MuonNumbering.muonGeometryConstants_cff import *', + 'from Geometry.MuonNumbering.muonOffsetESProducer_cff import *', ], "reco" : [ 'from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *', diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml index 521f45c29cc66..a4a027e5efd96 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -248,7 +248,7 @@ <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> <Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/> - <Include ref='Geometry/MuonCommonData/data/muonNumbering/2021/v2/muonNumbering.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml'/> <Include ref='Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml'/> <Include ref='Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml'/> <Include ref='Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml'/> diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml index 5f0ae14c20cc9..49c42559a4af2 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml @@ -247,7 +247,7 @@ <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> <Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/> - <Include ref='Geometry/MuonCommonData/data/muonNumbering/2021/v2/muonNumbering.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml'/> <Include ref='Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml'/> <Include ref='Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml'/> <Include ref='Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml'/> diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py index 0816898e77c9d..4bc3a12d91428 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py @@ -251,7 +251,7 @@ 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', )+ cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml', 'Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml', 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py index 1cd57edac0174..6c21e7a78d85b 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py @@ -250,7 +250,7 @@ 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', )+ cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml', 'Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml', 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', diff --git a/Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml b/Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml new file mode 100644 index 0000000000000..4d06228a43446 --- /dev/null +++ b/Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml @@ -0,0 +1,483 @@ +<?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="muonconstants" eval="true"> + <Constant name="xml_starts_with_copyno" value="1"/> + <Constant name="level" value="1000"/> + <Constant name="super" value="100"/> + <Constant name="base" value="1"/> + <Constant name="mb_region" value="1*[level]"/> + <Constant name="mb_wheel" value="2*[level]"/> + <Constant name="mb_station" value="3*[level]"/> + <Constant name="mb_superlayer" value="4*[level]"/> + <Constant name="mb_layer" value="5*[level]"/> + <Constant name="mb_wire" value="6*[level]"/> + <Constant name="me_region" value="[mb_region]"/> + <Constant name="me_station" value="2*[level]"/> + <Constant name="me_subring" value="3*[level]"/> + <Constant name="me_sector" value="4*[level]"/> + <Constant name="me_ring" value="5*[level]"/> + <Constant name="me_layer" value="6*[level]"/> + <Constant name="mr_region" value="[mb_region]"/> + <Constant name="mr_bwheel" value="[mb_wheel]"/> + <Constant name="mr_bstation" value="[mb_station]"/> + <Constant name="mr_bplane" value="4*[level]"/> + <Constant name="mr_bchamber" value="5*[level]"/> + <Constant name="mr_estation" value="[me_station]"/> + <Constant name="mr_eplane" value="3*[level]"/> + <Constant name="mr_esector" value="4*[level]"/> + <Constant name="mr_eroll" value="5*[level]"/> + <Constant name="mg_region" value="[mb_region]"/> + <Constant name="mg_station" value="[me_station]"/> + <Constant name="mg_ring" value="3*[level]"/> + <Constant name="mg_sector" value="4*[level]"/> + <Constant name="mg_roll" value="5*[level]"/> + </ConstantsSection> + <SpecParSection label="muonregionnumbering" eval="true"> + <SpecPar name="MuonCommonNumbering"> + <Parameter name="OnlyForMuonNumbering" value="muonstep0" eval="false"/> + <PartSelector path="//MUON"/> + <Parameter name="xml_starts_with_copyno" value="[xml_starts_with_copyno]"/> + <Parameter name="level" value="[level]"/> + <Parameter name="super" value="[super]"/> + <Parameter name="base" value="[base]"/> + <Parameter name="mb_region" value="[mb_region]"/> + <Parameter name="mb_wheel" value="[mb_wheel]"/> + <Parameter name="mb_station" value="[mb_station]"/> + <Parameter name="mb_superlayer" value="[mb_superlayer]"/> + <Parameter name="mb_layer" value="[mb_layer]"/> + <Parameter name="mb_wire" value="[mb_wire]"/> + <Parameter name="me_region" value="[me_region]"/> + <Parameter name="me_station" value="[me_station]"/> + <Parameter name="me_subring" value="[me_subring]"/> + <Parameter name="me_sector" value="[me_sector]"/> + <Parameter name="me_ring" value="[me_ring]"/> + <Parameter name="me_layer" value="[me_layer]"/> + <Parameter name="mr_region" value="[mr_region]"/> + <Parameter name="mr_bwheel" value="[mr_bwheel]"/> + <Parameter name="mr_bstation" value="[mr_bstation]"/> + <Parameter name="mr_bplane" value="[mr_bplane]"/> + <Parameter name="mr_bchamber" value="[mr_bchamber]"/> + <Parameter name="mr_estation" value="[mr_estation]"/> + <Parameter name="mr_eplane" value="[mr_eplane]"/> + <Parameter name="mr_esector" value="[mr_esector]"/> + <Parameter name="mr_eroll" value="[mr_eroll]"/> + <Parameter name="mg_region" value="[mg_region]"/> + <Parameter name="mg_station" value="[mg_station]"/> + <Parameter name="mg_ring" value="[mg_ring]"/> + <Parameter name="mg_sector" value="[mg_sector]"/> + <Parameter name="mg_roll" value="[mg_roll]"/> + </SpecPar> + <SpecPar name="MuonBarrel"> + <Parameter name="OnlyForMuonNumbering" value="muonstep1" eval="false"/> + <PartSelector path="//MB"/> + <Parameter name="CopyNoTag" value="[mb_region]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcap"> + <Parameter name="OnlyForMuonNumbering" value="muonstep2" eval="false"/> + <PartSelector path="//MEP"/> + <PartSelector path="//MEN"/> + <Parameter name="CopyNoTag" value="[me_region]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonbarrelnumbering" eval="true"> + <SpecPar name="MuonBarrelWheels"> + <Parameter name="OnlyForMuonNumbering" value="muonstep3" eval="false"/> + <PartSelector path="//MBWheel_.*"/> + <Parameter name="CopyNoTag" value="[mb_wheel]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep4" eval="false"/> + <PartSelector path="//MB1N0P"/> + <PartSelector path="//MB1P"/> + <PartSelector path="//MB1P0"/> + <PartSelector path="//MB1ChimP"/> + <PartSelector path="//MB1N"/> + <PartSelector path="//MB1ChimN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep5" eval="false"/> + <PartSelector path="//MB2N32P"/> + <PartSelector path="//MB2P32P"/> + <PartSelector path="//MB2ChimP"/> + <PartSelector path="//MB2N32N"/> + <PartSelector path="//MB2ChimN"/> + <PartSelector path="//MB2P23P"/> + <PartSelector path="//MB2N23N"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep6" eval="false"/> + <PartSelector path="//MB3P"/> + <PartSelector path="//MB3N"/> + <PartSelector path="//MB3ChimP"/> + <PartSelector path="//MB3ChimN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep7" eval="false"/> + <PartSelector path="//MB4BigLeftP"/> + <PartSelector path="//MB4BigRightP"/> + <PartSelector path="//MB4BigLeftN"/> + <PartSelector path="//MB4BigChimN"/> + <PartSelector path="//MB4BigRightN"/> + <PartSelector path="//MB4SmallRightP"/> + <PartSelector path="//MB4SmallLeftP"/> + <PartSelector path="//MB4SmallRightN"/> + <PartSelector path="//MB4SmallLeftN"/> + <PartSelector path="//MB4TopP"/> + <PartSelector path="//MB4TopChimP"/> + <PartSelector path="//MB4TopN"/> + <PartSelector path="//MB4BottomLeftP"/> + <PartSelector path="//MB4BottomRightP"/> + <PartSelector path="//MB4BottomRightN"/> + <PartSelector path="//MB4BottomLeftN"/> + <PartSelector path="//MB4FeetP"/> + <PartSelector path="//MB4FeetN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelSuperLayer"> + <Parameter name="OnlyForMuonNumbering" value="muonstep8" eval="false"/> + <PartSelector path="//MB.*SuperLayer.*"/> + <Parameter name="CopyNoTag" value="[mb_superlayer]"/> + </SpecPar> + <SpecPar name="MuonBarrelLayer"> + <Parameter name="OnlyForMuonNumbering" value="muonstep9" eval="false"/> + <PartSelector path="//MB.*SLPhiLayer.*"/> + <PartSelector path="//MB.*SLZLayer.*"/> + <Parameter name="CopyNoTag" value="[mb_layer]"/> + </SpecPar> + <SpecPar name="MuonBarrelWire"> + <Parameter name="OnlyForMuonNumbering" value="muonstep10" eval="false"/> + <PartSelector path="//MBSLPhiGas"/> + <PartSelector path="//MBChimSLPhiGas"/> + <PartSelector path="//MB.*SLZGas"/> + <Parameter name="CopyNoTag" value="[mb_wire]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonrpcnumbering" eval="true"> + <SpecPar name="MuonRpcPlane1I"> + <Parameter name="OnlyForMuonNumbering" value="muonstep11" eval="false"/> + <PartSelector path="//MB1RPC_IP"/> + <PartSelector path="//MB1RPC_IN"/> + <PartSelector path="//MB1ChimRPC_IP"/> + <PartSelector path="//MB1ChimRPC_IN"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane1O"> + <Parameter name="OnlyForMuonNumbering" value="muonstep12" eval="false"/> + <PartSelector path="//MB1RPC_OP"/> + <PartSelector path="//MB1RPC_ON"/> + <PartSelector path="//MB1ChimRPC_OP"/> + <PartSelector path="//MB1ChimRPC_ON"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane2I"> + <Parameter name="OnlyForMuonNumbering" value="muonstep13" eval="false"/> + <PartSelector path="//MB22RPC_IP"/> + <PartSelector path="//MB22RPC_IN"/> + <PartSelector path="//MB23RPC_IP"/> + <PartSelector path="//MB23RPC_IN"/> + <PartSelector path="//MB2ChimRPC_IP"/> + <PartSelector path="//MB2ChimRPC_IN"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane2O"> + <Parameter name="OnlyForMuonNumbering" value="muonstep14" eval="false"/> + <PartSelector path="//MB22RPC_OP"/> + <PartSelector path="//MB22RPC_ON"/> + <PartSelector path="//MB23RPC_OP"/> + <PartSelector path="//MB23RPC_ON"/> + <PartSelector path="//MB2ChimRPC_OP"/> + <PartSelector path="//MB2ChimRPC_ON"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane3S"> + <Parameter name="OnlyForMuonNumbering" value="muonstep15" eval="false"/> + <PartSelector path="//MB3RPC_P"/> + <PartSelector path="//MB3RPC_N"/> + <PartSelector path="//MB3ChimRPC_P"/> + <PartSelector path="//MB3ChimRPC_N"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="5*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep16" eval="false"/> + <PartSelector path="//MB4RPC_P"/> + <PartSelector path="//MB4RPC_N"/> + <PartSelector path="//MB4SmallRPC_PS8"/> + <PartSelector path="//MB4SmallRPC_NS8"/> + <PartSelector path="//MB4SmallRPC_PS12"/> + <PartSelector path="//MB4SmallRPC_NS12"/> + <PartSelector path="//MB4TopRPC_P"/> + <PartSelector path="//MB4TopRPC_N"/> + <PartSelector path="//MB4FeetRPC_P"/> + <PartSelector path="//MB4FeetRPC_N"/> + <PartSelector path="//MB4BottomRPC_P"/> + <PartSelector path="//MB4BottomRPC_N"/> + <PartSelector path="//MB4TopChimRPC_P"/> + <PartSelector path="//MB4BigChimRPC_N"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="6*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberLeft"> + <Parameter name="OnlyForMuonNumbering" value="muonstep17" eval="false"/> + <PartSelector path="//MB.*RPC.*GasLeft"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberMiddle"> + <Parameter name="OnlyForMuonNumbering" value="muonstep18" eval="false"/> + <PartSelector path="//MB.*RPC.*GasMiddle"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberRight"> + <Parameter name="OnlyForMuonNumbering" value="muonstep19" eval="false"/> + <PartSelector path="//MB.*RPC.*GasRight"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep20" eval="false"/> + <PartSelector path="//RR12"/> + <PartSelector path="//RR12N"/> + <PartSelector path="//RR13"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep21" eval="false"/> + <PartSelector path="//RR2X"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep22" eval="false"/> + <PartSelector path="//RR3X"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep23" eval="false"/> + <PartSelector path="//RR4XP"/> + <PartSelector path="//RR4XN"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapSector"> + <Parameter name="OnlyForMuonNumbering" value="muonstep24" eval="false"/> + <PartSelector path="//RT1B"/> + <PartSelector path="//RT1BN"/> + <PartSelector path="//RT1C"/> + <PartSelector path="//RTXU"/> + <PartSelector path="//RTXUR"/> + <Parameter name="CopyNoTag" value="[mr_esector]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep25" eval="false"/> + <PartSelector path="//REB1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep26" eval="false"/> + <PartSelector path="//REB2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep27" eval="false"/> + <PartSelector path="//REB3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep28" eval="false"/> + <PartSelector path="//REC1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep29" eval="false"/> + <PartSelector path="//REC2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep30" eval="false"/> + <PartSelector path="//REC3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep31" eval="false"/> + <PartSelector path="//REE1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep32" eval="false"/> + <PartSelector path="//REE2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep33" eval="false"/> + <PartSelector path="//REE3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep34" eval="false"/> + <PartSelector path="//REF1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep35" eval="false"/> + <PartSelector path="//REF2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep36" eval="false"/> + <PartSelector path="//REF3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+2"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonendcapnumbering" eval="true"> + <SpecPar name="MuonEndcapStation1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep37" eval="false"/> + <PartSelector path="//ME1RingP"/> + <PartSelector path="//ME1RingN"/> + <PartSelector path="//ME12RingP"/> + <PartSelector path="//ME12RingN"/> + <PartSelector path="//ME13RingP"/> + <PartSelector path="//ME13RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep38" eval="false"/> + <PartSelector path="//ME2RingP"/> + <PartSelector path="//ME2RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep39" eval="false"/> + <PartSelector path="//ME3RingP"/> + <PartSelector path="//ME3RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep40" eval="false"/> + <PartSelector path="//ME4RingP"/> + <PartSelector path="//ME4RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapSubrings"> + <Parameter name="OnlyForMuonNumbering" value="muonstep41" eval="false"/> + <PartSelector path="//ME11Space"/> + <PartSelector path="//ME12Space"/> + <PartSelector path="//ME13Space"/> + <PartSelector path="//ME21Space"/> + <PartSelector path="//ME22Space"/> + <PartSelector path="//ME31Space"/> + <PartSelector path="//ME32Space"/> + <PartSelector path="//ME41Space"/> + <PartSelector path="//ME42Space"/> + <Parameter name="CopyNoTag" value="[me_subring]"/> + </SpecPar> + <SpecPar name="MuonEndcapSectors"> + <Parameter name="OnlyForMuonNumbering" value="muonstep42" eval="false"/> + <PartSelector path="//ME11SpaceDivision"/> + <PartSelector path="//ME12SpaceDivision"/> + <PartSelector path="//ME13SpaceDivision"/> + <PartSelector path="//ME21SpaceDivision"/> + <PartSelector path="//ME22SpaceDivision"/> + <PartSelector path="//ME31SpaceDivision"/> + <PartSelector path="//ME32SpaceDivision"/> + <PartSelector path="//ME41SpaceDivision"/> + <PartSelector path="//ME42SpaceDivision"/> + <Parameter name="CopyNoTag" value="[me_sector]"/> + </SpecPar> + <SpecPar name="MuonEndcapLayers"> + <Parameter name="OnlyForMuonNumbering" value="muonstep43" eval="false"/> + <PartSelector path="//ME11Layer"/> + <PartSelector path="//ME12Layer"/> + <PartSelector path="//ME13Layer"/> + <PartSelector path="//ME21Layer"/> + <PartSelector path="//ME22Layer"/> + <PartSelector path="//ME31Layer"/> + <PartSelector path="//ME32Layer"/> + <PartSelector path="//ME41Layer"/> + <PartSelector path="//ME42Layer"/> + <Parameter name="CopyNoTag" value="[me_layer]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep44" eval="false"/> + <PartSelector path="//ME11AlumFrame"/> + <PartSelector path="//ME21AlumFrame"/> + <PartSelector path="//ME31AlumFrame"/> + <PartSelector path="//ME41AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep45" eval="false"/> + <PartSelector path="//ME12AlumFrame"/> + <PartSelector path="//ME22AlumFrame"/> + <PartSelector path="//ME32AlumFrame"/> + <PartSelector path="//ME42AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep46" eval="false"/> + <PartSelector path="//ME13AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRingA"> + <Parameter name="OnlyForMuonNumbering" value="muonstep47" eval="false"/> + <PartSelector path="//ME1A_ActiveGasVol"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonGEMnumbering" eval="true"> + <SpecPar name="MuonGEMEndcap"> + <Parameter name="OnlyForMuonNumbering" value="muonstep48" eval="false"/> + <PartSelector path="//GEMDisk11.*"/> + <Parameter name="CopyNoTag" value="[mg_ring]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonGEMSector"> + <Parameter name="OnlyForMuonNumbering" value="muonstep49" eval="false"/> + <PartSelector path="//GEMBox.*"/> + <Parameter name="CopyNoTag" value="[mg_sector]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonGEMChamber"> + <Parameter name="OnlyForMuonNumbering" value="muonstep50" eval="false"/> + <PartSelector path="//GHA.*"/> + <Parameter name="CopyNoTag" value="[mg_roll]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + </SpecParSection> +</DDDefinition> diff --git a/Geometry/MuonNumbering/BuildFile.xml b/Geometry/MuonNumbering/BuildFile.xml index e706b02f18e25..0ff3aee45724a 100644 --- a/Geometry/MuonNumbering/BuildFile.xml +++ b/Geometry/MuonNumbering/BuildFile.xml @@ -1,5 +1,7 @@ -<use name="DetectorDescription/Core"/> +<use name="CondFormats/GeometryObjects"/> <use name="DataFormats/MuonDetId"/> +<use name="DetectorDescription/Core"/> +<use name="DetectorDescription/DDCMS"/> <export> <lib name="1"/> </export> diff --git a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h new file mode 100644 index 0000000000000..0178fff98c653 --- /dev/null +++ b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h @@ -0,0 +1,29 @@ +#ifndef MuonNUmbering_MuonOffsetFromDD_h +#define MuonNUmbering_MuonOffsetFromDD_h + +#include "DetectorDescription/Core/interface/DDsvalues.h" +#include "DetectorDescription/Core/interface/DDCompactView.h" +#include "DetectorDescription/DDCMS/interface/DDCompactView.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include <string> +#include <vector> + +class DDFilteredView; +class MuonOffsetMap; + +class MuonOffsetFromDD { + +public: + MuonOffsetFromDD() = default; + virtual ~MuonOffsetFromDD() {} + + bool build(const DDCompactView*, MuonOffsetMap&); + bool build(const cms::DDCompactView*, MuonOffsetMap&); + +private: + bool buildParameters(const MuonOffsetMap&); + int getNumber(const std::string&, const DDsvalues_type&); + static constexpr int nset_ = 51; +}; + +#endif diff --git a/Geometry/MuonNumbering/plugins/BuildFile.xml b/Geometry/MuonNumbering/plugins/BuildFile.xml index e4aad995a3ad2..58ac7d0e83536 100644 --- a/Geometry/MuonNumbering/plugins/BuildFile.xml +++ b/Geometry/MuonNumbering/plugins/BuildFile.xml @@ -1,10 +1,11 @@ +<use name="CondFormats/GeometryObjects"/> +<use name="DetectorDescription/Core"/> +<use name="DetectorDescription/DDCMS"/> <use name="FWCore/Framework"/> +<use name="FWCore/MessageLogger"/> <use name="FWCore/ParameterSet"/> <use name="Geometry/MuonNumbering"/> <use name="Geometry/Records"/> -<use name="FWCore/MessageLogger"/> -<use name="DetectorDescription/Core"/> -<use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> <library file="*.cc" name="GeometryMuonNumberingPlugins"> <flags EDM_PLUGIN="1"/> diff --git a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc new file mode 100644 index 0000000000000..a5249e2a7e6f0 --- /dev/null +++ b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc @@ -0,0 +1,95 @@ +// -*- C++ -*- +// +// Package: DetectorDescription/MuonOffsetESProducer +// Class: MuonOffsetESProducer +// +/**\class MuonOffsetESProducer + + Description: Produce offsets and tags for Muon volume copy numbers + + Implementation: + The constants are defined in XML as SpecPars +*/ +// +// Original Author: Sunanda Banerjee +// Created: Fri, 16 Oct 2020 09:10:32 GMT +// +// + +#include <memory> + +#include "FWCore/Framework/interface/ModuleFactory.h" +#include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/Framework/interface/ESTransientHandle.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" +#include "DetectorDescription/Core/interface/DDCompactView.h" +#include "DetectorDescription/DDCMS/interface/DDCompactView.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/MuonNumbering/interface/MuonOffsetFromDD.h" + +#include <memory> + +//#define EDM_ML_DEBUG + +class MuonOffsetESProducer : public edm::ESProducer { +public: + MuonOffsetESProducer(const edm::ParameterSet&); + + using ReturnType = std::unique_ptr<MuonOffsetMap>; + + static void fillDescriptions(edm::ConfigurationDescriptions&); + ReturnType produce(const IdealGeometryRecord&); + +private: + const bool fromDD4Hep_; + edm::ESGetToken<DDCompactView, IdealGeometryRecord> cpvTokenDDD_; + edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord> cpvTokenDD4Hep_; +}; + +MuonOffsetESProducer::MuonOffsetESProducer(const edm::ParameterSet& iConfig) + : fromDD4Hep_(iConfig.getParameter<bool>("fromDD4Hep")) { + auto cc = setWhatProduced(this); + if (fromDD4Hep_) { + cpvTokenDD4Hep_ = cc.consumesFrom<cms::DDCompactView, IdealGeometryRecord>(edm::ESInputTag()); + } else { + cpvTokenDDD_ = cc.consumesFrom<DDCompactView, IdealGeometryRecord>(edm::ESInputTag()); + } +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("MuonGeom") << "MuonOffsetESProducer::MuonOffsetESProducer called with dd4hep: " << fromDD4Hep_; +#endif +} + +void MuonOffsetESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add<bool>("fromDD4Hep", false); + descriptions.add("muonOffsetESProducer", desc); +} + +MuonOffsetESProducer::ReturnType MuonOffsetESProducer::produce(const IdealGeometryRecord& iRecord) { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("MuonGeom") << "MuonOffsetESProducer::produce(const IdealGeometryRecord& iRecord)"; +#endif + + auto ptp = std::make_unique<MuonOffsetMap>(); + MuonOffsetFromDD builder; + + if (fromDD4Hep_) { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access cms::DDCompactView"; +#endif + edm::ESTransientHandle<cms::DDCompactView> cpv = iRecord.getTransientHandle(cpvTokenDD4Hep_); + builder.build(&(*cpv), *ptp); + } else { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access DDCompactView"; +#endif + edm::ESTransientHandle<DDCompactView> cpv = iRecord.getTransientHandle(cpvTokenDDD_); + builder.build(&(*cpv), *ptp); + } + return ptp; +} + +DEFINE_FWK_EVENTSETUP_MODULE(MuonOffsetESProducer); diff --git a/Geometry/MuonNumbering/python/muonOffsetESProducer_cff.py b/Geometry/MuonNumbering/python/muonOffsetESProducer_cff.py new file mode 100644 index 0000000000000..5f550b896d068 --- /dev/null +++ b/Geometry/MuonNumbering/python/muonOffsetESProducer_cff.py @@ -0,0 +1,9 @@ +import FWCore.ParameterSet.Config as cms + +from Geometry.MuonNumbering.muonOffsetESProducer_cfi import * + +from Configuration.ProcessModifiers.dd4hep_cff import dd4hep + +dd4hep.toModify(muonOffsetESProducer, + fromDD4Hep = cms.bool(True) +) diff --git a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc new file mode 100644 index 0000000000000..22bea67e9deda --- /dev/null +++ b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc @@ -0,0 +1,90 @@ +#include "Geometry/MuonNumbering/interface/MuonOffsetFromDD.h" +#include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" +#include "DetectorDescription/Core/interface/DDFilteredView.h" +#include "DetectorDescription/Core/interface/DDFilter.h" +#include "DetectorDescription/Core/interface/DDValue.h" +#include "DetectorDescription/Core/interface/DDutils.h" +#include "DetectorDescription/DDCMS/interface/DDFilteredView.h" +#include <iostream> +#include <iomanip> + +//#define EDM_ML_DEBUG + +bool MuonOffsetFromDD::build(const DDCompactView* cpv, MuonOffsetMap& php) { + edm::LogVerbatim("MuonGeom") + << "Inside MuonOffsetFromDD::build(const DDCompactView*, MuonOffsetMap&)"; + + // Loop over all the sets + std::string attribute = "OnlyForMuonNumbering"; + std::string name; + for (int k = 0; k < nset_; ++k) { + name = "muonstep" + std::to_string(k); + DDSpecificsMatchesValueFilter filter{DDValue(attribute, name, 0)}; + DDFilteredView fv(*cpv, filter); + bool dodet = fv.firstChild(); + DDsvalues_type sv(fv.mergedSpecifics()); + int offset = getNumber("CopyNoOffset", sv); + int tag = getNumber("CopyNoTag", sv); + while (dodet) { + name = fv.logicalPart().name().name(); + php.muonMap_[name] = std::make_pair(offset, tag); + dodet = fv.next(); + } + } + return this->buildParameters(php); +} + +bool MuonOffsetFromDD::build(const cms::DDCompactView* cpv, MuonOffsetMap& php) { + edm::LogVerbatim("MuonGeom") + << "Inside MuonOffsetFromDD::build(const cms::DDCompactView*, MuonOffsetMap&)"; + + std::string specpars[nset_] = {"MuonCommonNumbering", "MuonBarrel", "MuonEndcap", "MuonBarrelWheels", "MuonBarrelStation1", "MuonBarrelStation2", "MuonBarrelStation3", "MuonBarrelStation4", "MuonBarrelSuperLayer", "MuonBarrelLayer", "MuonBarrelWire", "MuonRpcPlane1I", "MuonRpcPlane1O", "MuonRpcPlane2I", "MuonRpcPlane2O", "MuonRpcPlane3S", "MuonRpcPlane4", "MuonRpcChamberLeft", "MuonRpcChamberMiddle", "MuonRpcChamberRight", "MuonRpcEndcap1", "MuonRpcEndcap2", "MuonRpcEndcap3", "MuonRpcEndcap4", "MuonRpcEndcapSector", "MuonRpcEndcapChamberB1", "MuonRpcEndcapChamberB2", "MuonRpcEndcapChamberB3", "MuonRpcEndcapChamberC1", "MuonRpcEndcapChamberC2", "MuonRpcEndcapChamberC3", "MuonRpcEndcapChamberE1", "MuonRpcEndcapChamberE2", "MuonRpcEndcapChamberE3", "MuonRpcEndcapChamberF1", "MuonRpcEndcapChamberF2", "MuonRpcEndcapChamberF3", "MuonEndcapStation1", "MuonEndcapStation2", "MuonEndcapStation3", "MuonEndcapStation4", "MuonEndcapSubrings", "MuonEndcapSectors", "MuonEndcapLayers", "MuonEndcapRing1", "MuonEndcapRing2", "MuonEndcapRing3", "MuonEndcapRingA", "MuonGEMEndcap", "MuonGEMSector", "MuonGEMChamber"}; + + // Get the offsets and tags first + int offsets[nset_], tags[nset_]; + cms::DDFilteredView fv(cpv->detector(), cpv->detector()->worldVolume()); + for (int k = 0; k < nset_; ++k) { + std::vector<int> off = fv.get<std::vector<int>>(specpars[k], "CopyNoOffset"); + offsets[k] = (off.size() > 0) ? off[0] : 0; + std::vector<int> tag = fv.get<std::vector<int>>(specpars[k], "CopyNoTag"); + tags[k] = (tag.size() > 0) ? tag[0] : 0; + } + // Now loop over the detectors + std::string attribute = "OnlyForMuonNumbering"; + std::string name; + for (int k = 0; k < nset_; ++k) { + name = "muonstep" + std::to_string(k); + const cms::DDFilter filter(attribute, name); + cms::DDFilteredView fv((*cpv), filter); + while (fv.firstChild()) { + name = static_cast<std::string>(fv.name()); + php.muonMap_[name] = std::make_pair(offsets[k], tags[k]); + } + } + return this->buildParameters(php); +} + +bool MuonOffsetFromDD::buildParameters(const MuonOffsetMap& php) { + edm::LogVerbatim("MuonGeom") << "MuonOffsetFromDD: Finds " << php.muonMap_.size() << " entries in the map"; +#ifdef EDM_ML_DEBUG + unsigned int k(0); + for (auto itr = php.muonMap_.begin(); itr != php.muonMap_.end(); ++itr, ++k) { + edm::LogVerbatim("MuonGeom") << "[" << k << "] " << itr->first << ": (" << (itr->second).first << ", " << (itr->second).second << ")"; + } +#endif + return true; +} + +int MuonOffsetFromDD::getNumber(const std::string& str, const DDsvalues_type& sv) { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("MuonGeom") << "MuonOffsetFromDD::getNumbers called for " << str; +#endif + DDValue value(str); + if (DDfetch(&sv, value)) { + const std::vector<double>& fvec = value.doubles(); + int nval = (fvec.size() > 0) ? static_cast<int>(fvec[0]) : 0; + return nval; + } else { + return 0; + } +} diff --git a/Geometry/MuonNumbering/test/BuildFile.xml b/Geometry/MuonNumbering/test/BuildFile.xml index 34fde165a4b72..d96a30d4a8cdf 100644 --- a/Geometry/MuonNumbering/test/BuildFile.xml +++ b/Geometry/MuonNumbering/test/BuildFile.xml @@ -1,7 +1,9 @@ +<use name="CondFormats/GeometryObjects"/> +<use name="DetectorDescription/Core"/> <use name="FWCore/Framework"/> +<use name="FWCore/ParameterSet"/> <use name="Geometry/Records"/> <use name="Geometry/MuonNumbering"/> -<use name="DetectorDescription/Core"/> <use name="CoralBase"/> <flags EDM_PLUGIN="1"/> <library file="*.cc" name="testGeometryMuonNumbering"> diff --git a/Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc b/Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc new file mode 100644 index 0000000000000..0b59d75d83667 --- /dev/null +++ b/Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc @@ -0,0 +1,37 @@ +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include <iostream> + +class MuonOffsetAnalyzer : public edm::one::EDAnalyzer<> { +public: + explicit MuonOffsetAnalyzer(const edm::ParameterSet&); + + void analyze(edm::Event const& iEvent, edm::EventSetup const&) override; + +private: + edm::ESGetToken<MuonOffsetMap, IdealGeometryRecord> parToken_; +}; + +MuonOffsetAnalyzer::MuonOffsetAnalyzer(const edm::ParameterSet&) { + parToken_ = esConsumes<MuonOffsetMap, IdealGeometryRecord>(edm::ESInputTag{}); +} + +void MuonOffsetAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup) { + const auto& par = iSetup.getData(parToken_); + const MuonOffsetMap* php = ∥ + + edm::LogVerbatim("MuonGeom") << "MuonOffsetFromDD: Finds " << php->muonMap_.size() << " entries in the map"; + + unsigned int k(0); + for (auto itr = php->muonMap_.begin(); itr != php->muonMap_.end(); ++itr, ++k) { + edm::LogVerbatim("MuonGeom") << "[" << k << "] " << itr->first << ": (" << (itr->second).first << ", " << (itr->second).second << ")"; + } +} + +DEFINE_FWK_MODULE(MuonOffsetAnalyzer); diff --git a/Geometry/MuonNumbering/test/testMuonOffsetDD4Hep_cfg.py b/Geometry/MuonNumbering/test/testMuonOffsetDD4Hep_cfg.py new file mode 100644 index 0000000000000..c89c802dc4c26 --- /dev/null +++ b/Geometry/MuonNumbering/test/testMuonOffsetDD4Hep_cfg.py @@ -0,0 +1,22 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process('Dump',Run3_dd4hep) + +process.load('Configuration.Geometry.GeometryDD4hepExtended2021_cff') +process.load('Geometry.MuonNumbering.muonOffsetESProducer_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') + +process.source = cms.Source("EmptySource") +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) + ) + +if hasattr(process,'MessageLogger'): + process.MessageLogger.categories.append('MuonGeom') + +process.hpa = cms.EDAnalyzer("MuonOffsetAnalyzer") +process.Timing = cms.Service("Timing") + +process.p1 = cms.Path(process.hpa) diff --git a/Geometry/MuonNumbering/test/testMuonOffsetDDD_cfg.py b/Geometry/MuonNumbering/test/testMuonOffsetDDD_cfg.py new file mode 100644 index 0000000000000..160d3cec9612f --- /dev/null +++ b/Geometry/MuonNumbering/test/testMuonOffsetDDD_cfg.py @@ -0,0 +1,22 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_cff import Run3 + +process = cms.Process('Dump',Run3) + +process.load('Configuration.Geometry.GeometryExtended2021_cff') +process.load('Geometry.MuonNumbering.muonOffsetESProducer_cff') +process.load('FWCore.MessageService.MessageLogger_cfi') + +process.source = cms.Source("EmptySource") +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) + ) + +if hasattr(process,'MessageLogger'): + process.MessageLogger.categories.append('MuonGeom') + +process.hpa = cms.EDAnalyzer("MuonOffsetAnalyzer") +process.Timing = cms.Service("Timing") + +process.p1 = cms.Path(process.hpa) diff --git a/SimG4CMS/Muon/BuildFile.xml b/SimG4CMS/Muon/BuildFile.xml index 092ff6fd14c74..74a1dccc423ca 100644 --- a/SimG4CMS/Muon/BuildFile.xml +++ b/SimG4CMS/Muon/BuildFile.xml @@ -1,9 +1,10 @@ +<use name="CondFormats/GeometryObjects"/> +<use name="Geometry/MuonNumbering"/> +<use name="Geometry/Records"/> <use name="SimG4Core/SensitiveDetector"/> <use name="SimG4Core/Notification"/> <use name="SimG4Core/Physics"/> <use name="SimDataFormats/SimHitMaker"/> -<use name="Geometry/MuonNumbering"/> -<use name="Geometry/Records"/> <use name="boost"/> <use name="geant4core"/> <use name="hepmc"/> diff --git a/SimG4CMS/Muon/interface/MuonG4Numbering.h b/SimG4CMS/Muon/interface/MuonG4Numbering.h index 99c793bc8ec6e..c8650e3c729cb 100644 --- a/SimG4CMS/Muon/interface/MuonG4Numbering.h +++ b/SimG4CMS/Muon/interface/MuonG4Numbering.h @@ -21,10 +21,11 @@ class G4Step; class MuonBaseNumber; class MuonGeometryConstants; +class MuonOffsetMap; class MuonG4Numbering { public: - MuonG4Numbering(const MuonGeometryConstants& muonConstants); + MuonG4Numbering(const MuonGeometryConstants& muonConstants, const MuonOffsetMap* offMap, bool dd4hep); ~MuonG4Numbering(){}; MuonBaseNumber PhysicalVolumeToBaseNumber(const G4Step* aStep); @@ -35,6 +36,8 @@ class MuonG4Numbering { const int getCopyNoBaseNo(const int); const bool copyNoRelevant(const int); + const MuonOffsetMap* offMap_; + const bool dd4hep_; int theLevelPart; int theSuperPart; int theBasePart; diff --git a/SimG4CMS/Muon/interface/MuonRPCFrameRotation.h b/SimG4CMS/Muon/interface/MuonRPCFrameRotation.h index 67b52f29f02c5..b2c53c8b518ac 100644 --- a/SimG4CMS/Muon/interface/MuonRPCFrameRotation.h +++ b/SimG4CMS/Muon/interface/MuonRPCFrameRotation.h @@ -12,6 +12,7 @@ */ #include "SimG4CMS/Muon/interface/MuonFrameRotation.h" +#include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" #include "G4Step.hh" @@ -20,7 +21,7 @@ class MuonGeometryConstants; class MuonRPCFrameRotation : public MuonFrameRotation { public: - MuonRPCFrameRotation(const MuonGeometryConstants& constants); + MuonRPCFrameRotation(const MuonGeometryConstants& constants, const MuonOffsetMap* offMap, bool dd4hep); ~MuonRPCFrameRotation() override; Local3DPoint transformPoint(const Local3DPoint&, const G4Step*) const override; diff --git a/SimG4CMS/Muon/interface/MuonSensitiveDetector.h b/SimG4CMS/Muon/interface/MuonSensitiveDetector.h index ef3d4f9911fd1..805164d33f61b 100644 --- a/SimG4CMS/Muon/interface/MuonSensitiveDetector.h +++ b/SimG4CMS/Muon/interface/MuonSensitiveDetector.h @@ -19,6 +19,7 @@ #include "SimG4Core/Notification/interface/BeginOfEvent.h" #include "SimG4Core/SensitiveDetector/interface/SensitiveTkDetector.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" +#include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" #include <string> @@ -59,7 +60,7 @@ class MuonSensitiveDetector : public SensitiveTkDetector, public Observer<const MuonSlaveSD* slaveMuon; MuonSimHitNumberingScheme* numbering; MuonSubDetector* detector; - MuonFrameRotation* theRotation; + const MuonFrameRotation* theRotation; MuonG4Numbering* g4numbering; bool newHit(const G4Step*); diff --git a/SimG4CMS/Muon/src/MuonG4Numbering.cc b/SimG4CMS/Muon/src/MuonG4Numbering.cc index 061bac94f5232..c85dda9618dcd 100644 --- a/SimG4CMS/Muon/src/MuonG4Numbering.cc +++ b/SimG4CMS/Muon/src/MuonG4Numbering.cc @@ -1,4 +1,5 @@ #include "SimG4CMS/Muon/interface/MuonG4Numbering.h" +#include "CondFormats/GeometryObjects/interface/MuonOffsetMap.h" #include "Geometry/MuonNumbering/interface/MuonBaseNumber.h" #include "Geometry/MuonNumbering/interface/MuonGeometryConstants.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -11,7 +12,7 @@ //#define EDM_ML_DEBUG -MuonG4Numbering::MuonG4Numbering(const MuonGeometryConstants& muonConstants) { +MuonG4Numbering::MuonG4Numbering(const MuonGeometryConstants& muonConstants, const MuonOffsetMap* offMap, bool dd4hep) : offMap_(offMap), dd4hep_(dd4hep) { theLevelPart = muonConstants.getValue("level"); theSuperPart = muonConstants.getValue("super"); theBasePart = muonConstants.getValue("base"); @@ -37,6 +38,7 @@ MuonG4Numbering::MuonG4Numbering(const MuonGeometryConstants& muonConstants) { edm::LogVerbatim("MuonSim") << "MuonG4Numbering configured with" << "Level = " << theLevelPart << " Super = " << theSuperPart << " Base = " << theBasePart << " StartCopyNo = " << theStartCopyNo; + edm::LogVerbatim("MuonSim") << "dd4hep flag set to " << dd4hep_ << " and offsetmap at " << offMap_; #endif } @@ -47,9 +49,22 @@ MuonBaseNumber MuonG4Numbering::PhysicalVolumeToBaseNumber(const G4Step* aStep) for (int ii = 0; ii < touch->GetHistoryDepth(); ii++) { G4VPhysicalVolume* vol = touch->GetVolume(ii); int copyno = vol->GetCopyNo(); + int extra(0); + if (dd4hep_ && (offMap_ != nullptr)) { + std::string namx = static_cast<std::string>(vol->GetName()); + std::size_t last = namx.rfind("_"); + std::string name = ((last == std::string::npos) ? namx : (namx.substr(0, last))); + auto itr = offMap_->muonMap_.find(name); + if (itr != offMap_->muonMap_.end()) + extra = (itr->second).first + (itr->second).second; #ifdef EDM_ML_DEBUG - edm::LogVerbatim("MuonSim") << "MuonG4Numbering: " << vol->GetName() << " " << copyno << std::endl - << "Split " << copyNoRelevant(copyno) << ":" << theLevelPart << ":" << theSuperPart + edm::LogVerbatim("MuonSim") << "MuonG4Numbering: " << namx << ":" << name << " iterator " << (itr != offMap_->muonMap_.end()) << " Extra " << extra; +#endif + } + copyno += extra; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("MuonSim") << "MuonG4Numbering: " << vol->GetName() << " " << copyno + << " Split " << copyNoRelevant(copyno) << ":" << theLevelPart << ":" << theSuperPart << " "; #endif if (copyNoRelevant(copyno)) { diff --git a/SimG4CMS/Muon/src/MuonRPCFrameRotation.cc b/SimG4CMS/Muon/src/MuonRPCFrameRotation.cc index 6a097e26e1f31..23e7cda3b02a3 100644 --- a/SimG4CMS/Muon/src/MuonRPCFrameRotation.cc +++ b/SimG4CMS/Muon/src/MuonRPCFrameRotation.cc @@ -5,9 +5,9 @@ #include "G4Step.hh" -MuonRPCFrameRotation::MuonRPCFrameRotation(const MuonGeometryConstants& muonConstants) +MuonRPCFrameRotation::MuonRPCFrameRotation(const MuonGeometryConstants& muonConstants, const MuonOffsetMap* offMap, bool dd4hep) : MuonFrameRotation::MuonFrameRotation() { - g4numbering = new MuonG4Numbering(muonConstants); + g4numbering = new MuonG4Numbering(muonConstants, offMap, dd4hep); int theLevelPart = muonConstants.getValue("level"); theRegion = muonConstants.getValue("mr_region") / theLevelPart; } diff --git a/SimG4CMS/Muon/src/MuonSensitiveDetector.cc b/SimG4CMS/Muon/src/MuonSensitiveDetector.cc index 2579a7dcbaca2..5941c9b2f55a6 100644 --- a/SimG4CMS/Muon/src/MuonSensitiveDetector.cc +++ b/SimG4CMS/Muon/src/MuonSensitiveDetector.cc @@ -52,16 +52,20 @@ MuonSensitiveDetector::MuonSensitiveDetector(const std::string& name, ePersistentCutGeV = m_MuonSD.getParameter<double>("EnergyThresholdForPersistency") / CLHEP::GeV; //Default 1. GeV allMuonsPersistent = m_MuonSD.getParameter<bool>("AllMuonsPersistent"); printHits = m_MuonSD.getParameter<bool>("PrintHits"); - + bool dd4hep = p.getParameter<bool>("g4GeometryDD4hepSource"); // // Here simply create 1 MuonSlaveSD for the moment // #ifdef EDM_ML_DEBUG - edm::LogVerbatim("MuonSim") << "create MuonSubDetector " << name; + edm::LogVerbatim("MuonSim") << "create MuonSubDetector " << name << " with dd4hep flag " << dd4hep; #endif detector = new MuonSubDetector(name); //The constants take time to calculate and are needed by many helpers + edm::ESHandle<MuonOffsetMap> mom; + es.get<IdealGeometryRecord>().get(mom); + const MuonOffsetMap* offmap = (mom.isValid()) ? mom.product() : nullptr; + edm::LogVerbatim("MuonSim") << "Finds the offset map at " << offmap; edm::ESHandle<MuonGeometryConstants> mdc; es.get<IdealGeometryRecord>().get(mdc); if (!mdc.isValid()) @@ -72,7 +76,7 @@ MuonSensitiveDetector::MuonSensitiveDetector(const std::string& name, theRotation = new MuonEndcapFrameRotation(); sdet = "Endcap"; } else if (detector->isRPC()) { - theRotation = new MuonRPCFrameRotation(constants); + theRotation = new MuonRPCFrameRotation(constants, offmap, dd4hep); sdet = "RPC"; } else if (detector->isGEM()) { theRotation = new MuonGEMFrameRotation(constants); @@ -85,13 +89,13 @@ MuonSensitiveDetector::MuonSensitiveDetector(const std::string& name, } slaveMuon = new MuonSlaveSD(detector, theManager); numbering = new MuonSimHitNumberingScheme(detector, constants); - g4numbering = new MuonG4Numbering(constants); + g4numbering = new MuonG4Numbering(constants, offmap, dd4hep); if (printHits) { thePrinter = new SimHitPrinter("HitPositionOSCAR.dat"); } - edm::LogVerbatim("MuonSensitiveDetector") + edm::LogVerbatim("MuonSim") << " of type " << sdet << " <" << GetName() << "> EnergyThresholdForPersistency(GeV) " << ePersistentCutGeV / CLHEP::GeV << " allMuonsPersistent: " << allMuonsPersistent; From aaa0f061abb9b6212a7c09cf56942df9fa9e50ba Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Fri, 16 Oct 2020 23:51:43 +0200 Subject: [PATCH 647/778] Code check --- .../interface/MuonOffsetFromDD.h | 1 - .../plugins/MuonOffsetESProducer.cc | 2 +- .../MuonNumbering/src/MuonOffsetFromDD.cc | 67 ++++++++++++++++--- .../MuonNumbering/test/MuonOffsetAnalyzer.cc | 3 +- .../Muon/interface/MuonRPCFrameRotation.h | 2 +- SimG4CMS/Muon/src/MuonG4Numbering.cc | 17 ++--- SimG4CMS/Muon/src/MuonRPCFrameRotation.cc | 4 +- SimG4CMS/Muon/src/MuonSensitiveDetector.cc | 5 +- 8 files changed, 76 insertions(+), 25 deletions(-) diff --git a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h index 0178fff98c653..92393a51c61d5 100644 --- a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h +++ b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h @@ -12,7 +12,6 @@ class DDFilteredView; class MuonOffsetMap; class MuonOffsetFromDD { - public: MuonOffsetFromDD() = default; virtual ~MuonOffsetFromDD() {} diff --git a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc index a5249e2a7e6f0..61be6def12c5e 100644 --- a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc +++ b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc @@ -50,7 +50,7 @@ class MuonOffsetESProducer : public edm::ESProducer { }; MuonOffsetESProducer::MuonOffsetESProducer(const edm::ParameterSet& iConfig) - : fromDD4Hep_(iConfig.getParameter<bool>("fromDD4Hep")) { + : fromDD4Hep_(iConfig.getParameter<bool>("fromDD4Hep")) { auto cc = setWhatProduced(this); if (fromDD4Hep_) { cpvTokenDD4Hep_ = cc.consumesFrom<cms::DDCompactView, IdealGeometryRecord>(edm::ESInputTag()); diff --git a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc index 22bea67e9deda..f705ebb7800d6 100644 --- a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc +++ b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc @@ -11,8 +11,7 @@ //#define EDM_ML_DEBUG bool MuonOffsetFromDD::build(const DDCompactView* cpv, MuonOffsetMap& php) { - edm::LogVerbatim("MuonGeom") - << "Inside MuonOffsetFromDD::build(const DDCompactView*, MuonOffsetMap&)"; + edm::LogVerbatim("MuonGeom") << "Inside MuonOffsetFromDD::build(const DDCompactView*, MuonOffsetMap&)"; // Loop over all the sets std::string attribute = "OnlyForMuonNumbering"; @@ -35,19 +34,68 @@ bool MuonOffsetFromDD::build(const DDCompactView* cpv, MuonOffsetMap& php) { } bool MuonOffsetFromDD::build(const cms::DDCompactView* cpv, MuonOffsetMap& php) { - edm::LogVerbatim("MuonGeom") - << "Inside MuonOffsetFromDD::build(const cms::DDCompactView*, MuonOffsetMap&)"; + edm::LogVerbatim("MuonGeom") << "Inside MuonOffsetFromDD::build(const cms::DDCompactView*, MuonOffsetMap&)"; - std::string specpars[nset_] = {"MuonCommonNumbering", "MuonBarrel", "MuonEndcap", "MuonBarrelWheels", "MuonBarrelStation1", "MuonBarrelStation2", "MuonBarrelStation3", "MuonBarrelStation4", "MuonBarrelSuperLayer", "MuonBarrelLayer", "MuonBarrelWire", "MuonRpcPlane1I", "MuonRpcPlane1O", "MuonRpcPlane2I", "MuonRpcPlane2O", "MuonRpcPlane3S", "MuonRpcPlane4", "MuonRpcChamberLeft", "MuonRpcChamberMiddle", "MuonRpcChamberRight", "MuonRpcEndcap1", "MuonRpcEndcap2", "MuonRpcEndcap3", "MuonRpcEndcap4", "MuonRpcEndcapSector", "MuonRpcEndcapChamberB1", "MuonRpcEndcapChamberB2", "MuonRpcEndcapChamberB3", "MuonRpcEndcapChamberC1", "MuonRpcEndcapChamberC2", "MuonRpcEndcapChamberC3", "MuonRpcEndcapChamberE1", "MuonRpcEndcapChamberE2", "MuonRpcEndcapChamberE3", "MuonRpcEndcapChamberF1", "MuonRpcEndcapChamberF2", "MuonRpcEndcapChamberF3", "MuonEndcapStation1", "MuonEndcapStation2", "MuonEndcapStation3", "MuonEndcapStation4", "MuonEndcapSubrings", "MuonEndcapSectors", "MuonEndcapLayers", "MuonEndcapRing1", "MuonEndcapRing2", "MuonEndcapRing3", "MuonEndcapRingA", "MuonGEMEndcap", "MuonGEMSector", "MuonGEMChamber"}; + std::string specpars[nset_] = {"MuonCommonNumbering", + "MuonBarrel", + "MuonEndcap", + "MuonBarrelWheels", + "MuonBarrelStation1", + "MuonBarrelStation2", + "MuonBarrelStation3", + "MuonBarrelStation4", + "MuonBarrelSuperLayer", + "MuonBarrelLayer", + "MuonBarrelWire", + "MuonRpcPlane1I", + "MuonRpcPlane1O", + "MuonRpcPlane2I", + "MuonRpcPlane2O", + "MuonRpcPlane3S", + "MuonRpcPlane4", + "MuonRpcChamberLeft", + "MuonRpcChamberMiddle", + "MuonRpcChamberRight", + "MuonRpcEndcap1", + "MuonRpcEndcap2", + "MuonRpcEndcap3", + "MuonRpcEndcap4", + "MuonRpcEndcapSector", + "MuonRpcEndcapChamberB1", + "MuonRpcEndcapChamberB2", + "MuonRpcEndcapChamberB3", + "MuonRpcEndcapChamberC1", + "MuonRpcEndcapChamberC2", + "MuonRpcEndcapChamberC3", + "MuonRpcEndcapChamberE1", + "MuonRpcEndcapChamberE2", + "MuonRpcEndcapChamberE3", + "MuonRpcEndcapChamberF1", + "MuonRpcEndcapChamberF2", + "MuonRpcEndcapChamberF3", + "MuonEndcapStation1", + "MuonEndcapStation2", + "MuonEndcapStation3", + "MuonEndcapStation4", + "MuonEndcapSubrings", + "MuonEndcapSectors", + "MuonEndcapLayers", + "MuonEndcapRing1", + "MuonEndcapRing2", + "MuonEndcapRing3", + "MuonEndcapRingA", + "MuonGEMEndcap", + "MuonGEMSector", + "MuonGEMChamber"}; // Get the offsets and tags first int offsets[nset_], tags[nset_]; cms::DDFilteredView fv(cpv->detector(), cpv->detector()->worldVolume()); for (int k = 0; k < nset_; ++k) { std::vector<int> off = fv.get<std::vector<int>>(specpars[k], "CopyNoOffset"); - offsets[k] = (off.size() > 0) ? off[0] : 0; + offsets[k] = (!off.empty()) ? off[0] : 0; std::vector<int> tag = fv.get<std::vector<int>>(specpars[k], "CopyNoTag"); - tags[k] = (tag.size() > 0) ? tag[0] : 0; + tags[k] = (!tag.empty()) ? tag[0] : 0; } // Now loop over the detectors std::string attribute = "OnlyForMuonNumbering"; @@ -69,7 +117,8 @@ bool MuonOffsetFromDD::buildParameters(const MuonOffsetMap& php) { #ifdef EDM_ML_DEBUG unsigned int k(0); for (auto itr = php.muonMap_.begin(); itr != php.muonMap_.end(); ++itr, ++k) { - edm::LogVerbatim("MuonGeom") << "[" << k << "] " << itr->first << ": (" << (itr->second).first << ", " << (itr->second).second << ")"; + edm::LogVerbatim("MuonGeom") << "[" << k << "] " << itr->first << ": (" << (itr->second).first << ", " + << (itr->second).second << ")"; } #endif return true; @@ -82,7 +131,7 @@ int MuonOffsetFromDD::getNumber(const std::string& str, const DDsvalues_type& sv DDValue value(str); if (DDfetch(&sv, value)) { const std::vector<double>& fvec = value.doubles(); - int nval = (fvec.size() > 0) ? static_cast<int>(fvec[0]) : 0; + int nval = (!fvec.empty()) ? static_cast<int>(fvec[0]) : 0; return nval; } else { return 0; diff --git a/Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc b/Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc index 0b59d75d83667..0a0b74f6a4019 100644 --- a/Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc +++ b/Geometry/MuonNumbering/test/MuonOffsetAnalyzer.cc @@ -30,7 +30,8 @@ void MuonOffsetAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::EventS unsigned int k(0); for (auto itr = php->muonMap_.begin(); itr != php->muonMap_.end(); ++itr, ++k) { - edm::LogVerbatim("MuonGeom") << "[" << k << "] " << itr->first << ": (" << (itr->second).first << ", " << (itr->second).second << ")"; + edm::LogVerbatim("MuonGeom") << "[" << k << "] " << itr->first << ": (" << (itr->second).first << ", " + << (itr->second).second << ")"; } } diff --git a/SimG4CMS/Muon/interface/MuonRPCFrameRotation.h b/SimG4CMS/Muon/interface/MuonRPCFrameRotation.h index b2c53c8b518ac..4fd6861dba1a8 100644 --- a/SimG4CMS/Muon/interface/MuonRPCFrameRotation.h +++ b/SimG4CMS/Muon/interface/MuonRPCFrameRotation.h @@ -21,7 +21,7 @@ class MuonGeometryConstants; class MuonRPCFrameRotation : public MuonFrameRotation { public: - MuonRPCFrameRotation(const MuonGeometryConstants& constants, const MuonOffsetMap* offMap, bool dd4hep); + MuonRPCFrameRotation(const MuonGeometryConstants& constants, const MuonOffsetMap* offMap, bool dd4hep); ~MuonRPCFrameRotation() override; Local3DPoint transformPoint(const Local3DPoint&, const G4Step*) const override; diff --git a/SimG4CMS/Muon/src/MuonG4Numbering.cc b/SimG4CMS/Muon/src/MuonG4Numbering.cc index c85dda9618dcd..3a004c8c3747c 100644 --- a/SimG4CMS/Muon/src/MuonG4Numbering.cc +++ b/SimG4CMS/Muon/src/MuonG4Numbering.cc @@ -12,7 +12,8 @@ //#define EDM_ML_DEBUG -MuonG4Numbering::MuonG4Numbering(const MuonGeometryConstants& muonConstants, const MuonOffsetMap* offMap, bool dd4hep) : offMap_(offMap), dd4hep_(dd4hep) { +MuonG4Numbering::MuonG4Numbering(const MuonGeometryConstants& muonConstants, const MuonOffsetMap* offMap, bool dd4hep) + : offMap_(offMap), dd4hep_(dd4hep) { theLevelPart = muonConstants.getValue("level"); theSuperPart = muonConstants.getValue("super"); theBasePart = muonConstants.getValue("base"); @@ -52,20 +53,20 @@ MuonBaseNumber MuonG4Numbering::PhysicalVolumeToBaseNumber(const G4Step* aStep) int extra(0); if (dd4hep_ && (offMap_ != nullptr)) { std::string namx = static_cast<std::string>(vol->GetName()); - std::size_t last = namx.rfind("_"); + std::size_t last = namx.rfind('_'); std::string name = ((last == std::string::npos) ? namx : (namx.substr(0, last))); auto itr = offMap_->muonMap_.find(name); if (itr != offMap_->muonMap_.end()) - extra = (itr->second).first + (itr->second).second; + extra = (itr->second).first + (itr->second).second; #ifdef EDM_ML_DEBUG - edm::LogVerbatim("MuonSim") << "MuonG4Numbering: " << namx << ":" << name << " iterator " << (itr != offMap_->muonMap_.end()) << " Extra " << extra; + edm::LogVerbatim("MuonSim") << "MuonG4Numbering: " << namx << ":" << name << " iterator " + << (itr != offMap_->muonMap_.end()) << " Extra " << extra; #endif - } + } copyno += extra; #ifdef EDM_ML_DEBUG - edm::LogVerbatim("MuonSim") << "MuonG4Numbering: " << vol->GetName() << " " << copyno - << " Split " << copyNoRelevant(copyno) << ":" << theLevelPart << ":" << theSuperPart - << " "; + edm::LogVerbatim("MuonSim") << "MuonG4Numbering: " << vol->GetName() << " " << copyno << " Split " + << copyNoRelevant(copyno) << ":" << theLevelPart << ":" << theSuperPart << " "; #endif if (copyNoRelevant(copyno)) { num.addBase(getCopyNoLevel(copyno), getCopyNoSuperNo(copyno), getCopyNoBaseNo(copyno) - theStartCopyNo); diff --git a/SimG4CMS/Muon/src/MuonRPCFrameRotation.cc b/SimG4CMS/Muon/src/MuonRPCFrameRotation.cc index 23e7cda3b02a3..022d1b5e717eb 100644 --- a/SimG4CMS/Muon/src/MuonRPCFrameRotation.cc +++ b/SimG4CMS/Muon/src/MuonRPCFrameRotation.cc @@ -5,7 +5,9 @@ #include "G4Step.hh" -MuonRPCFrameRotation::MuonRPCFrameRotation(const MuonGeometryConstants& muonConstants, const MuonOffsetMap* offMap, bool dd4hep) +MuonRPCFrameRotation::MuonRPCFrameRotation(const MuonGeometryConstants& muonConstants, + const MuonOffsetMap* offMap, + bool dd4hep) : MuonFrameRotation::MuonFrameRotation() { g4numbering = new MuonG4Numbering(muonConstants, offMap, dd4hep); int theLevelPart = muonConstants.getValue("level"); diff --git a/SimG4CMS/Muon/src/MuonSensitiveDetector.cc b/SimG4CMS/Muon/src/MuonSensitiveDetector.cc index 5941c9b2f55a6..1df916dc19832 100644 --- a/SimG4CMS/Muon/src/MuonSensitiveDetector.cc +++ b/SimG4CMS/Muon/src/MuonSensitiveDetector.cc @@ -95,9 +95,8 @@ MuonSensitiveDetector::MuonSensitiveDetector(const std::string& name, thePrinter = new SimHitPrinter("HitPositionOSCAR.dat"); } - edm::LogVerbatim("MuonSim") - << " of type " << sdet << " <" << GetName() << "> EnergyThresholdForPersistency(GeV) " - << ePersistentCutGeV / CLHEP::GeV << " allMuonsPersistent: " << allMuonsPersistent; + edm::LogVerbatim("MuonSim") << " of type " << sdet << " <" << GetName() << "> EnergyThresholdForPersistency(GeV) " + << ePersistentCutGeV / CLHEP::GeV << " allMuonsPersistent: " << allMuonsPersistent; theG4ProcessTypeEnumerator = new G4ProcessTypeEnumerator; } From 61da785d25280313d2992455c92a0f19ee58a0f3 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Fri, 16 Oct 2020 15:14:00 +0200 Subject: [PATCH 648/778] Migrate GlobalMuonRefitter to EventSetup consumes --- .../interface/GlobalMuonRefitter.h | 17 ++++++++--------- .../src/GlobalMuonRefitter.cc | 18 ++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/RecoMuon/GlobalTrackingTools/interface/GlobalMuonRefitter.h b/RecoMuon/GlobalTrackingTools/interface/GlobalMuonRefitter.h index d6a59657d9c21..e49282598869d 100644 --- a/RecoMuon/GlobalTrackingTools/interface/GlobalMuonRefitter.h +++ b/RecoMuon/GlobalTrackingTools/interface/GlobalMuonRefitter.h @@ -16,11 +16,11 @@ #include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/EDProducer.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "RecoMuon/TrackingTools/interface/MuonTrajectoryBuilder.h" #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h" #include "TrackingTools/TrackRefitter/interface/TrackTransformer.h" @@ -33,9 +33,6 @@ #include "DataFormats/MuonReco/interface/DYTInfo.h" #include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h" -namespace edm { - class Event; -} namespace reco { class TransientTrack; } @@ -48,6 +45,8 @@ class MuonServiceProxy; class Trajectory; class TrajectoryFitter; +class TrajectoryFitterRecord; +class TransientRecHitRecord; class GlobalMuonRefitter { public: @@ -172,15 +171,15 @@ class GlobalMuonRefitter { edm::ParameterSet theDYTthrsParameters; reco::DYTInfo* dytInfo; - std::string theFitterName; + edm::ESGetToken<TrajectoryFitter, TrajectoryFitterRecord> theFitterToken; std::unique_ptr<TrajectoryFitter> theFitter; - std::string theTrackerRecHitBuilderName; - edm::ESHandle<TransientTrackingRecHitBuilder> theTrackerRecHitBuilder; + edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theTrackerRecHitBuilderToken; + const TransientTrackingRecHitBuilder* theTrackerRecHitBuilder; TkClonerImpl hitCloner; - std::string theMuonRecHitBuilderName; - edm::ESHandle<TransientTrackingRecHitBuilder> theMuonRecHitBuilder; + edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theMuonRecHitBuilderToken; + const TransientTrackingRecHitBuilder* theMuonRecHitBuilder; const MuonServiceProxy* theService; const edm::Event* theEvent; diff --git a/RecoMuon/GlobalTrackingTools/src/GlobalMuonRefitter.cc b/RecoMuon/GlobalTrackingTools/src/GlobalMuonRefitter.cc index b13868e118180..7ca852105e629 100644 --- a/RecoMuon/GlobalTrackingTools/src/GlobalMuonRefitter.cc +++ b/RecoMuon/GlobalTrackingTools/src/GlobalMuonRefitter.cc @@ -105,15 +105,15 @@ GlobalMuonRefitter::GlobalMuonRefitter(const edm::ParameterSet& par, << "\n" << "RefitDirection = insideOut or RefitDirection = outsideIn"; - theFitterName = par.getParameter<string>("Fitter"); + theFitterToken = iC.esConsumes(edm::ESInputTag("", par.getParameter<string>("Fitter"))); thePropagatorName = par.getParameter<string>("Propagator"); theSkipStation = par.getParameter<int>("SkipStation"); theTrackerSkipSystem = par.getParameter<int>("TrackerSkipSystem"); theTrackerSkipSection = par.getParameter<int>("TrackerSkipSection"); //layer, wheel, or disk depending on the system - theTrackerRecHitBuilderName = par.getParameter<string>("TrackerRecHitBuilder"); - theMuonRecHitBuilderName = par.getParameter<string>("MuonRecHitBuilder"); + theTrackerRecHitBuilderToken = iC.esConsumes(edm::ESInputTag("", par.getParameter<string>("TrackerRecHitBuilder"))); + theMuonRecHitBuilderToken = iC.esConsumes(edm::ESInputTag("", par.getParameter<string>("MuonRecHitBuilder"))); theRPCInTheFit = par.getParameter<bool>("RefitRPCHits"); @@ -161,17 +161,15 @@ void GlobalMuonRefitter::setEvent(const edm::Event& event) { } void GlobalMuonRefitter::setServices(const EventSetup& setup) { - edm::ESHandle<TrajectoryFitter> aFitter; - theService->eventSetup().get<TrajectoryFitter::Record>().get(theFitterName, aFitter); - theFitter = aFitter->clone(); + theFitter = setup.getData(theFitterToken).clone(); // Transient Rechit Builders unsigned long long newCacheId_TRH = setup.get<TransientRecHitRecord>().cacheIdentifier(); if (newCacheId_TRH != theCacheId_TRH) { LogDebug(theCategory) << "TransientRecHitRecord changed!"; - setup.get<TransientRecHitRecord>().get(theTrackerRecHitBuilderName, theTrackerRecHitBuilder); - setup.get<TransientRecHitRecord>().get(theMuonRecHitBuilderName, theMuonRecHitBuilder); - hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder.product())->cloner(); + theTrackerRecHitBuilder = &setup.getData(theTrackerRecHitBuilderToken); + theMuonRecHitBuilder = &setup.getData(theMuonRecHitBuilderToken); + hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder)->cloner(); } theFitter->setHitCloner(&hitCloner); } @@ -188,7 +186,7 @@ vector<Trajectory> GlobalMuonRefitter::refit(const reco::Track& globalTrack, reco::TransientTrack track(globalTrack, &*(theService->magneticField()), theService->trackingGeometry()); - auto tkbuilder = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder.product()); + auto tkbuilder = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder); for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) if ((*hit)->isValid()) { From fec10940b83fdae71a3a75ce3b4ba9c43cd6d046 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Fri, 16 Oct 2020 17:38:23 +0200 Subject: [PATCH 649/778] Migrate GlobalTrajectoryBuilderBase to EventSetup consumes --- .../interface/GlobalTrajectoryBuilderBase.h | 12 +++++----- .../src/GlobalTrajectoryBuilderBase.cc | 23 +++++++------------ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/RecoMuon/GlobalTrackingTools/interface/GlobalTrajectoryBuilderBase.h b/RecoMuon/GlobalTrackingTools/interface/GlobalTrajectoryBuilderBase.h index 0eb876e44cefd..6395b24a92a70 100644 --- a/RecoMuon/GlobalTrackingTools/interface/GlobalTrajectoryBuilderBase.h +++ b/RecoMuon/GlobalTrackingTools/interface/GlobalTrajectoryBuilderBase.h @@ -18,7 +18,6 @@ * \author A. Everett Purdue University */ -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" #include "RecoMuon/TrackingTools/interface/MuonTrajectoryBuilder.h" #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h" @@ -38,6 +37,7 @@ class MuonDetLayerMeasurements; class MuonServiceProxy; class MuonTrackingRegionBuilder; class GlobalMuonRefitter; +class TransientRecHitRecord; class GlobalTrajectoryBuilderBase : public MuonTrajectoryBuilder { public: @@ -151,7 +151,6 @@ class GlobalTrajectoryBuilderBase : public MuonTrajectoryBuilder { MuonTrackingRegionBuilder* theRegionBuilder; const MuonServiceProxy* theService; GlobalMuonRefitter* theGlbRefitter; - unsigned long long theCacheId_TRH; bool theRPCInTheFit; bool theRefitFlag; int theMuonHitsOption; @@ -159,10 +158,11 @@ class GlobalTrajectoryBuilderBase : public MuonTrajectoryBuilder { float theTECyScale; std::string theTrackerPropagatorName; const edm::Event* theEvent; - std::string theTrackerRecHitBuilderName; - edm::ESHandle<TransientTrackingRecHitBuilder> theTrackerRecHitBuilder; - std::string theMuonRecHitBuilderName; - edm::ESHandle<TransientTrackingRecHitBuilder> theMuonRecHitBuilder; + edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theTrackerRecHitBuilderToken; + const TransientTrackingRecHitBuilder* theTrackerRecHitBuilder; + edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theMuonRecHitBuilderToken; + const TransientTrackingRecHitBuilder* theMuonRecHitBuilder; + edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTopoToken; const TrackerTopology* theTopo; }; #endif diff --git a/RecoMuon/GlobalTrackingTools/src/GlobalTrajectoryBuilderBase.cc b/RecoMuon/GlobalTrackingTools/src/GlobalTrajectoryBuilderBase.cc index 170a4e745ac86..efdc961fa8a22 100644 --- a/RecoMuon/GlobalTrackingTools/src/GlobalTrajectoryBuilderBase.cc +++ b/RecoMuon/GlobalTrackingTools/src/GlobalTrajectoryBuilderBase.cc @@ -103,8 +103,10 @@ GlobalTrajectoryBuilderBase::GlobalTrajectoryBuilderBase(const edm::ParameterSet theMuonHitsOption = refitterParameters.getParameter<int>("MuonHitsOption"); theRefitFlag = refitterParameters.getParameter<bool>("RefitFlag"); - theTrackerRecHitBuilderName = par.getParameter<std::string>("TrackerRecHitBuilder"); - theMuonRecHitBuilderName = par.getParameter<std::string>("MuonRecHitBuilder"); + theTrackerRecHitBuilderToken = + iC.esConsumes(edm::ESInputTag("", par.getParameter<std::string>("TrackerRecHitBuilder"))); + theMuonRecHitBuilderToken = iC.esConsumes(edm::ESInputTag("", par.getParameter<std::string>("MuonRecHitBuilder"))); + theTopoToken = iC.esConsumes(); theRPCInTheFit = par.getParameter<bool>("RefitRPCHits"); @@ -112,8 +114,6 @@ GlobalTrajectoryBuilderBase::GlobalTrajectoryBuilderBase(const edm::ParameterSet theTECyScale = par.getParameter<double>("ScaleTECyFactor"); thePtCut = par.getParameter<double>("PtCut"); thePCut = par.getParameter<double>("PCut"); - - theCacheId_TRH = 0; } //-------------- @@ -142,18 +142,11 @@ void GlobalTrajectoryBuilderBase::setEvent(const edm::Event& event) { theGlbRefitter->setEvent(event); theGlbRefitter->setServices(theService->eventSetup()); - unsigned long long newCacheId_TRH = theService->eventSetup().get<TransientRecHitRecord>().cacheIdentifier(); - if (newCacheId_TRH != theCacheId_TRH) { - LogDebug(theCategory) << "TransientRecHitRecord changed!"; - theCacheId_TRH = newCacheId_TRH; - theService->eventSetup().get<TransientRecHitRecord>().get(theTrackerRecHitBuilderName, theTrackerRecHitBuilder); - theService->eventSetup().get<TransientRecHitRecord>().get(theMuonRecHitBuilderName, theMuonRecHitBuilder); - } + theTrackerRecHitBuilder = &theService->eventSetup().getData(theTrackerRecHitBuilderToken); + theMuonRecHitBuilder = &theService->eventSetup().getData(theMuonRecHitBuilderToken); //Retrieve tracker topology from geometry - edm::ESHandle<TrackerTopology> tTopoHand; - theService->eventSetup().get<TrackerTopologyRcd>().get(tTopoHand); - theTopo = tTopoHand.product(); + theTopo = &theService->eventSetup().getData(theTopoToken); } // @@ -510,7 +503,7 @@ TransientTrackingRecHit::ConstRecHitContainer GlobalTrajectoryBuilderBase::getTr TrajectoryStateOnSurface currTsos = trajectoryStateTransform::innerStateOnSurface( track, *theService->trackingGeometry(), &*theService->magneticField()); - auto tkbuilder = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder.product()); + auto tkbuilder = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder); auto hitCloner = tkbuilder->cloner(); for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) { if ((*hit)->isValid()) { From 27d5ed3666b4353cbad6deec084cbbda2c564469 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Fri, 16 Oct 2020 23:35:44 +0200 Subject: [PATCH 650/778] Migrate GlobalTrackQualityProducer fully to EventSetup consumes --- .../plugins/GlobalTrackQualityProducer.cc | 5 ++--- .../GlobalTrackingTools/plugins/GlobalTrackQualityProducer.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RecoMuon/GlobalTrackingTools/plugins/GlobalTrackQualityProducer.cc b/RecoMuon/GlobalTrackingTools/plugins/GlobalTrackQualityProducer.cc index b5728003b2254..73bb76d6824f7 100644 --- a/RecoMuon/GlobalTrackingTools/plugins/GlobalTrackQualityProducer.cc +++ b/RecoMuon/GlobalTrackingTools/plugins/GlobalTrackQualityProducer.cc @@ -28,6 +28,7 @@ GlobalTrackQualityProducer::GlobalTrackQualityProducer(const edm::ParameterSet& iConfig) : inputCollection_(iConfig.getParameter<edm::InputTag>("InputCollection")), inputLinksCollection_(iConfig.getParameter<edm::InputTag>("InputLinksCollection")), + tTopoToken_(esConsumes()), theService(nullptr), theGlbRefitter(nullptr), theGlbMatcher(nullptr) { @@ -81,9 +82,7 @@ void GlobalTrackQualityProducer::produce(edm::Event& iEvent, const edm::EventSet iEvent.getByToken(linkCollectionToken, linkCollectionHandle); //Retrieve tracker topology from geometry - edm::ESHandle<TrackerTopology> tTopoHand; - iSetup.get<TrackerTopologyRcd>().get(tTopoHand); - const TrackerTopology* tTopo = tTopoHand.product(); + const TrackerTopology* tTopo = &iSetup.getData(tTopoToken_); // reserve some space std::vector<reco::MuonQuality> valuesQual; diff --git a/RecoMuon/GlobalTrackingTools/plugins/GlobalTrackQualityProducer.h b/RecoMuon/GlobalTrackingTools/plugins/GlobalTrackQualityProducer.h index a34e931b2e37f..56273fed8a64d 100644 --- a/RecoMuon/GlobalTrackingTools/plugins/GlobalTrackQualityProducer.h +++ b/RecoMuon/GlobalTrackingTools/plugins/GlobalTrackQualityProducer.h @@ -44,6 +44,7 @@ class GlobalTrackQualityProducer : public edm::stream::EDProducer<> { edm::InputTag inputLinksCollection_; edm::EDGetTokenT<reco::TrackCollection> glbMuonsToken; edm::EDGetTokenT<reco::MuonTrackLinksCollection> linkCollectionToken; + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_; MuonServiceProxy* theService; GlobalMuonRefitter* theGlbRefitter; GlobalMuonTrackMatcher* theGlbMatcher; From 36f11b103cb0a2f82f2ae6f52d27f793b9a69f2a Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Sat, 17 Oct 2020 00:15:35 +0200 Subject: [PATCH 651/778] Migrate TevMuonProducer to EventSetup consumes --- RecoMuon/GlobalMuonProducer/src/TevMuonProducer.cc | 6 ++---- RecoMuon/GlobalMuonProducer/src/TevMuonProducer.h | 9 +++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/RecoMuon/GlobalMuonProducer/src/TevMuonProducer.cc b/RecoMuon/GlobalMuonProducer/src/TevMuonProducer.cc index 348f363afdabc..252767510251c 100644 --- a/RecoMuon/GlobalMuonProducer/src/TevMuonProducer.cc +++ b/RecoMuon/GlobalMuonProducer/src/TevMuonProducer.cc @@ -33,7 +33,7 @@ using namespace reco; // // constructor with config // -TevMuonProducer::TevMuonProducer(const ParameterSet& parameterSet) { +TevMuonProducer::TevMuonProducer(const ParameterSet& parameterSet) : tTopoToken(esConsumes()) { LogDebug("Muon|RecoMuon|TevMuonProducer") << "constructor called" << endl; // GLB Muon Collection Label @@ -92,9 +92,7 @@ void TevMuonProducer::produce(Event& event, const EventSetup& eventSetup) { theRefitter->setServices(theService->eventSetup()); //Retrieve tracker topology from geometry - edm::ESHandle<TrackerTopology> tTopoHand; - eventSetup.get<TrackerTopologyRcd>().get(tTopoHand); - const TrackerTopology* tTopo = tTopoHand.product(); + const TrackerTopology* tTopo = &eventSetup.getData(tTopoToken); // Take the GLB muon container(s) Handle<reco::TrackCollection> glbMuons; diff --git a/RecoMuon/GlobalMuonProducer/src/TevMuonProducer.h b/RecoMuon/GlobalMuonProducer/src/TevMuonProducer.h index 125df166fda57..9ba8559e4f6d4 100644 --- a/RecoMuon/GlobalMuonProducer/src/TevMuonProducer.h +++ b/RecoMuon/GlobalMuonProducer/src/TevMuonProducer.h @@ -14,6 +14,7 @@ */ #include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "RecoMuon/GlobalTrackingTools/interface/GlobalMuonRefitter.h" #include "RecoMuon/TrackingTools/interface/MuonTrackLoader.h" @@ -31,14 +32,9 @@ typedef edm::ValueMap<reco::DYTInfo> DYTestimators; -namespace edm { - class ParameterSet; - class Event; - class EventSetup; -} // namespace edm - class MuonTrackFinder; class MuonServiceProxy; +class TrackerTopologyRcd; class TevMuonProducer : public edm::stream::EDProducer<> { public: @@ -56,6 +52,7 @@ class TevMuonProducer : public edm::stream::EDProducer<> { edm::InputTag theGLBCollectionLabel; edm::EDGetTokenT<reco::TrackCollection> glbMuonsToken; edm::EDGetTokenT<std::vector<Trajectory> > glbMuonsTrajToken; + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken; /// the event setup proxy, it takes care the services update std::unique_ptr<MuonServiceProxy> theService; From f7fd98ec77f84013eb5474fc235ca23921aa03c8 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Thu, 15 Oct 2020 02:33:38 +0200 Subject: [PATCH 652/778] Migrate TrackTransformer to EventSetup consumes, but leave non-migrated code path available as well Otherwise there would be way too many callers to migrate at this time (including EDLooper in Alignment). --- .../src/TrackingRecoMaterialAnalyser.cc | 19 +++-- .../RPCRecHit/interface/CSCSegtoRPC.h | 23 +++--- .../RPCRecHit/interface/DTSegtoRPC.h | 23 ++++-- .../RPCRecHit/interface/RPCPointProducer.h | 18 +++-- .../RPCRecHit/interface/TracktoRPC.h | 37 +++++---- RecoLocalMuon/RPCRecHit/src/CSCSegtoRPC.cc | 27 +++---- RecoLocalMuon/RPCRecHit/src/DTSegtoRPC.cc | 32 ++++---- .../RPCRecHit/src/RPCPointProducer.cc | 37 +++++---- RecoLocalMuon/RPCRecHit/src/TracktoRPC.cc | 79 +++++++++---------- .../src/GlobalTrajectoryBuilderBase.cc | 2 +- .../interface/MuonKinkFinder.h | 3 +- .../plugins/MuonIdProducer.cc | 2 +- .../MuonIdentification/src/MuonKinkFinder.cc | 4 +- .../SpecialSeedGenerators/src/MuonReSeeder.cc | 10 ++- .../interface/TrackTransformer.h | 32 +++++--- .../plugins/TracksToTrajectories.cc | 3 +- .../TrackRefitter/src/TrackTransformer.cc | 72 ++++++++++------- 17 files changed, 242 insertions(+), 181 deletions(-) diff --git a/DQM/TrackingMonitor/src/TrackingRecoMaterialAnalyser.cc b/DQM/TrackingMonitor/src/TrackingRecoMaterialAnalyser.cc index 8d4574f2e8535..b3083a3d613e4 100644 --- a/DQM/TrackingMonitor/src/TrackingRecoMaterialAnalyser.cc +++ b/DQM/TrackingMonitor/src/TrackingRecoMaterialAnalyser.cc @@ -16,13 +16,11 @@ #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESTransientHandle.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/EDMException.h" #include <cassert> #include <unordered_map> @@ -45,6 +43,8 @@ class TrackingRecoMaterialAnalyser : public DQMEDAnalyzer { const edm::EDGetTokenT<reco::TrackCollection> tracksToken_; const edm::EDGetTokenT<reco::BeamSpot> beamspotToken_; const edm::EDGetTokenT<reco::VertexCollection> verticesToken_; + const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeometryTokenRun_; + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_; bool usePV_; std::string folder_; std::unordered_map<std::string, MonitorElement *> histosOriEta_; @@ -66,10 +66,12 @@ class TrackingRecoMaterialAnalyser : public DQMEDAnalyzer { //------------------------------------------------------------------------- TrackingRecoMaterialAnalyser::TrackingRecoMaterialAnalyser(const edm::ParameterSet &iPSet) - : refitter_(iPSet), + : refitter_(iPSet, consumesCollector()), tracksToken_(consumes<reco::TrackCollection>(iPSet.getParameter<edm::InputTag>("tracks"))), beamspotToken_(consumes<reco::BeamSpot>(iPSet.getParameter<edm::InputTag>("beamspot"))), verticesToken_(mayConsume<reco::VertexCollection>(iPSet.getParameter<edm::InputTag>("vertices"))), + trackerGeometryTokenRun_(esConsumes<edm::Transition::BeginRun>()), + tTopoToken_(esConsumes()), usePV_(iPSet.getParameter<bool>("usePV")), folder_(iPSet.getParameter<std::string>("folder")), histo_RZ_(nullptr), @@ -94,8 +96,7 @@ void TrackingRecoMaterialAnalyser::bookHistograms(DQMStore::IBooker &ibook, edm::Run const &, edm::EventSetup const &setup) { using namespace std; - edm::ESHandle<TrackerGeometry> trackerGeometry; - setup.get<TrackerDigiGeometryRecord>().get(trackerGeometry); + const TrackerGeometry &trackerGeometry = setup.getData(trackerGeometryTokenRun_); ibook.setCurrentFolder(folder_); @@ -154,7 +155,7 @@ void TrackingRecoMaterialAnalyser::bookHistograms(DQMStore::IBooker &ibook, char title[50]; char key[20]; for (unsigned int det = 1; det < sDETS.size(); ++det) { - for (unsigned int sub_det = 1; sub_det <= trackerGeometry->numberOfLayers(det); ++sub_det) { + for (unsigned int sub_det = 1; sub_det <= trackerGeometry.numberOfLayers(det); ++sub_det) { memset(title, 0, sizeof(title)); snprintf(title, sizeof(title), "Original_RadLen_vs_Eta_%s%d", sDETS[det].data(), sub_det); snprintf(key, sizeof(key), "%s%d", sDETS[det].data(), sub_det); @@ -177,11 +178,9 @@ void TrackingRecoMaterialAnalyser::analyze(const edm::Event &event, const edm::E Handle<TrackCollection> tracks; Handle<VertexCollection> vertices; - ESHandle<TrackerTopology> trk_topology; // Get the TrackerTopology - setup.get<TrackerTopologyRcd>().get(trk_topology); - const TrackerTopology *const tTopo = trk_topology.product(); + const TrackerTopology *const tTopo = &setup.getData(tTopoToken_); // Get Tracks event.getByToken(tracksToken_, tracks); diff --git a/RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h b/RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h index 72cd1d9c4a867..c21cfdd71bbb1 100644 --- a/RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h +++ b/RecoLocalMuon/RPCRecHit/interface/CSCSegtoRPC.h @@ -1,26 +1,31 @@ #ifndef CSCSEGTORPC_H #define CSCSEGTORPC_H -#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/RPCRecHit/interface/RPCRecHit.h" #include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h" #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h" #include <memory> +class RPCGeometry; +class CSCGeometry; +class CSCObjectMap; +class MuonGeometryRecord; + class CSCSegtoRPC { public: - CSCSegtoRPC(CSCSegmentCollection const* allCSCSegments, edm::EventSetup const& iSetup, bool debug, double eyr); - ~CSCSegtoRPC(); - std::unique_ptr<RPCRecHitCollection>&& thePoints() { return std::move(_ThePoints); } + explicit CSCSegtoRPC(edm::ConsumesCollector iC); + std::unique_ptr<RPCRecHitCollection> thePoints(CSCSegmentCollection const* allCSCSegments, + edm::EventSetup const& iSetup, + bool debug, + double eyr); private: - std::unique_ptr<RPCRecHitCollection> _ThePoints; - edm::OwnVector<RPCRecHit> RPCPointVector; - bool inclcsc; - double MaxD; + edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeoToken_; + edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeoToken_; + edm::ESGetToken<CSCObjectMap, MuonGeometryRecord> cscMapToken_; }; #endif diff --git a/RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h b/RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h index 706b44fdc7da7..dd0710980e36f 100644 --- a/RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h +++ b/RecoLocalMuon/RPCRecHit/interface/DTSegtoRPC.h @@ -1,31 +1,38 @@ #ifndef DTSEGTORPC_H #define DTSEGTORPC_H -#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h" #include "DataFormats/RPCRecHit/interface/RPCRecHit.h" #include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h" #include <memory> +class RPCGeometry; +class DTGeometry; +class DTObjectMap; +class MuonGeometryRecord; + class DTSegtoRPC { public: - DTSegtoRPC(DTRecSegment4DCollection const* all4DSegments, edm::EventSetup const& iSetup, bool debug, double eyr); - ~DTSegtoRPC(); - std::unique_ptr<RPCRecHitCollection>&& thePoints() { return std::move(_ThePoints); } + explicit DTSegtoRPC(edm::ConsumesCollector iC); + std::unique_ptr<RPCRecHitCollection> thePoints(DTRecSegment4DCollection const* all4DSegments, + edm::EventSetup const& iSetup, + bool debug, + double eyr); private: - std::unique_ptr<RPCRecHitCollection> _ThePoints; - edm::OwnVector<RPCRecHit> RPCPointVector; + edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeoToken_; + edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeoToken_; + edm::ESGetToken<DTObjectMap, MuonGeometryRecord> dtMapToken_; + bool incldt; bool incldtMB4; double MinCosAng; double MaxD; double MaxDrb4; double MaxDistanceBetweenSegments; - std::vector<uint32_t> extrapolatedRolls; }; #endif diff --git a/RecoLocalMuon/RPCRecHit/interface/RPCPointProducer.h b/RecoLocalMuon/RPCRecHit/interface/RPCPointProducer.h index a2195e1c4cb9a..c09d97d63ad80 100644 --- a/RecoLocalMuon/RPCRecHit/interface/RPCPointProducer.h +++ b/RecoLocalMuon/RPCRecHit/interface/RPCPointProducer.h @@ -1,5 +1,5 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -19,17 +19,20 @@ // class decleration // -class RPCPointProducer : public edm::global::EDProducer<> { +class RPCPointProducer : public edm::stream::EDProducer<> { public: explicit RPCPointProducer(const edm::ParameterSet&); private: - void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + void produce(edm::Event&, const edm::EventSetup&) override; - const edm::EDGetTokenT<CSCSegmentCollection> cscSegments; - const edm::EDGetTokenT<DTRecSegment4DCollection> dt4DSegments; - const edm::EDGetTokenT<reco::TrackCollection> tracks; - const edm::InputTag tracks_; + edm::EDGetTokenT<CSCSegmentCollection> cscSegments; + edm::EDGetTokenT<DTRecSegment4DCollection> dt4DSegments; + edm::EDGetTokenT<reco::TrackCollection> tracks; + + std::unique_ptr<DTSegtoRPC> dtSegtoRPC; + std::unique_ptr<CSCSegtoRPC> cscSegtoRPC; + std::unique_ptr<TracktoRPC> tracktoRPC; const bool incldt; const bool inclcsc; @@ -39,5 +42,4 @@ class RPCPointProducer : public edm::global::EDProducer<> { const double MaxD; const double MaxDrb4; const double ExtrapolatedRegion; - const edm::ParameterSet trackTransformerParam; }; diff --git a/RecoLocalMuon/RPCRecHit/interface/TracktoRPC.h b/RecoLocalMuon/RPCRecHit/interface/TracktoRPC.h index b63c155ad054e..594b3a655e7b4 100644 --- a/RecoLocalMuon/RPCRecHit/interface/TracktoRPC.h +++ b/RecoLocalMuon/RPCRecHit/interface/TracktoRPC.h @@ -3,11 +3,9 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/ServiceRegistry/interface/Service.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" @@ -51,29 +49,36 @@ #include <memory> +class RPCGeometry; +class DTGeometry; +class DTObjectMap; +class CSCGeometry; +class CSCObjectMap; +class MuonGeometryRecord; +class Propagator; +class TrackingComponentsRecord; + using reco::MuonCollection; using reco::TrackCollection; typedef std::vector<Trajectory> Trajectories; class TracktoRPC { public: - TracktoRPC(reco::TrackCollection const* alltracks, - edm::EventSetup const& iSetup, - bool debug, - const edm::ParameterSet& iConfig, - const edm::InputTag& tracklabel); - ~TracktoRPC(); - std::unique_ptr<RPCRecHitCollection>&& thePoints() { return std::move(_ThePoints); } + TracktoRPC(const edm::ParameterSet& iConfig, const edm::InputTag& tracklabel, edm::ConsumesCollector iC); + std::unique_ptr<RPCRecHitCollection> thePoints(reco::TrackCollection const* alltracks, + edm::EventSetup const& iSetup, + bool debug); private: - bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup& iSetup); - - std::unique_ptr<RPCRecHitCollection> _ThePoints; - edm::OwnVector<RPCRecHit> RPCPointVector; - double MaxD; + bool ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const RPCGeometry* rpcGeo); - TrackTransformerBase* theTrackTransformer; - edm::ESHandle<Propagator> thePropagator; + edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeoToken_; + edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeoToken_; + edm::ESGetToken<DTObjectMap, MuonGeometryRecord> dtMapToken_; + edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeoToken_; + edm::ESGetToken<CSCObjectMap, MuonGeometryRecord> cscMapToken_; + edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_; + std::unique_ptr<TrackTransformerBase> theTrackTransformer; }; #endif diff --git a/RecoLocalMuon/RPCRecHit/src/CSCSegtoRPC.cc b/RecoLocalMuon/RPCRecHit/src/CSCSegtoRPC.cc index 03643a2aa3034..5cb6b0ea8215d 100644 --- a/RecoLocalMuon/RPCRecHit/src/CSCSegtoRPC.cc +++ b/RecoLocalMuon/RPCRecHit/src/CSCSegtoRPC.cc @@ -12,24 +12,24 @@ #include "RecoLocalMuon/RPCRecHit/src/CSCStationIndex.h" #include "RecoLocalMuon/RPCRecHit/src/CSCObjectMap.h" -CSCSegtoRPC::CSCSegtoRPC(const CSCSegmentCollection* allCSCSegments, - const edm::EventSetup& iSetup, - bool debug, - double eyr) { - edm::ESHandle<RPCGeometry> rpcGeo; - edm::ESHandle<CSCGeometry> cscGeo; - edm::ESHandle<CSCObjectMap> cscMap; +CSCSegtoRPC::CSCSegtoRPC(edm::ConsumesCollector iC) + : rpcGeoToken_(iC.esConsumes()), cscGeoToken_(iC.esConsumes()), cscMapToken_(iC.esConsumes()) {} - iSetup.get<MuonGeometryRecord>().get(rpcGeo); - iSetup.get<MuonGeometryRecord>().get(cscGeo); - iSetup.get<MuonGeometryRecord>().get(cscMap); +std::unique_ptr<RPCRecHitCollection> CSCSegtoRPC::thePoints(const CSCSegmentCollection* allCSCSegments, + const edm::EventSetup& iSetup, + bool debug, + double eyr) { + edm::ESHandle<RPCGeometry> rpcGeo = iSetup.getHandle(rpcGeoToken_); + edm::ESHandle<CSCGeometry> cscGeo = iSetup.getHandle(cscGeoToken_); + edm::ESHandle<CSCObjectMap> cscMap = iSetup.getHandle(cscMapToken_); - MaxD = 80.; + double MaxD = 80.; if (debug) std::cout << "CSC \t Number of CSC Segments in this event = " << allCSCSegments->size() << std::endl; - _ThePoints = std::make_unique<RPCRecHitCollection>(); + auto _ThePoints = std::make_unique<RPCRecHitCollection>(); + edm::OwnVector<RPCRecHit> RPCPointVector; if (allCSCSegments->size() == 0) { if (debug) @@ -280,6 +280,5 @@ CSCSegtoRPC::CSCSegtoRPC(const CSCSegmentCollection* allCSCSegments, } } } + return _ThePoints; } - -CSCSegtoRPC::~CSCSegtoRPC() {} diff --git a/RecoLocalMuon/RPCRecHit/src/DTSegtoRPC.cc b/RecoLocalMuon/RPCRecHit/src/DTSegtoRPC.cc index f9392692613cf..47b2cbb2cb6db 100644 --- a/RecoLocalMuon/RPCRecHit/src/DTSegtoRPC.cc +++ b/RecoLocalMuon/RPCRecHit/src/DTSegtoRPC.cc @@ -36,10 +36,8 @@ int distwheel(int wheel1, int wheel2) { return distance; } -DTSegtoRPC::DTSegtoRPC(const DTRecSegment4DCollection* all4DSegments, - const edm::EventSetup& iSetup, - bool debug, - double eyr) { +DTSegtoRPC::DTSegtoRPC(edm::ConsumesCollector iC) + : rpcGeoToken_(iC.esConsumes()), dtGeoToken_(iC.esConsumes()), dtMapToken_(iC.esConsumes()) { /* MinCosAng=iConfig.getUntrackedParameter<double>("MinCosAng",0.95); MaxD=iConfig.getUntrackedParameter<double>("MaxD",80.); @@ -58,8 +56,14 @@ DTSegtoRPC::DTSegtoRPC(const DTRecSegment4DCollection* all4DSegments, //These should be always true expect for debuggin porpouses incldt=true; incldtMB4=true; + */ +} - +std::unique_ptr<RPCRecHitCollection> DTSegtoRPC::thePoints(const DTRecSegment4DCollection* all4DSegments, + const edm::EventSetup& iSetup, + bool debug, + double eyr) { + /* struct timespec start_time, stop_time; time_t fs; time_t fn; @@ -68,19 +72,17 @@ DTSegtoRPC::DTSegtoRPC(const DTRecSegment4DCollection* all4DSegments, clock_gettime(CLOCK_REALTIME, &start_time); */ - _ThePoints = std::make_unique<RPCRecHitCollection>(); + auto _ThePoints = std::make_unique<RPCRecHitCollection>(); + edm::OwnVector<RPCRecHit> RPCPointVector; + std::vector<uint32_t> extrapolatedRolls; if (all4DSegments->size() > 8) { if (debug) std::cout << "Too many segments in this event we are not doing the extrapolation" << std::endl; } else { - edm::ESHandle<RPCGeometry> rpcGeo; - edm::ESHandle<DTGeometry> dtGeo; - edm::ESHandle<DTObjectMap> dtMap; - - iSetup.get<MuonGeometryRecord>().get(rpcGeo); - iSetup.get<MuonGeometryRecord>().get(dtGeo); - iSetup.get<MuonGeometryRecord>().get(dtMap); + edm::ESHandle<RPCGeometry> rpcGeo = iSetup.getHandle(rpcGeoToken_); + edm::ESHandle<DTGeometry> dtGeo = iSetup.getHandle(dtGeoToken_); + edm::ESHandle<DTObjectMap> dtMap = iSetup.getHandle(dtMapToken_); /* clock_gettime(CLOCK_REALTIME, &stop_time); @@ -608,6 +610,6 @@ DTSegtoRPC::DTSegtoRPC(const DTRecSegment4DCollection* all4DSegments, ln=stop_time.tv_nsec; std::cout <<" =================|||| "<<ls-fs<<" sec "<<ln-fn<<" us"<<std::endl; */ -} -DTSegtoRPC::~DTSegtoRPC() {} + return _ThePoints; +} diff --git a/RecoLocalMuon/RPCRecHit/src/RPCPointProducer.cc b/RecoLocalMuon/RPCRecHit/src/RPCPointProducer.cc index d1c0b60c4d739..615bea872d38e 100644 --- a/RecoLocalMuon/RPCRecHit/src/RPCPointProducer.cc +++ b/RecoLocalMuon/RPCRecHit/src/RPCPointProducer.cc @@ -26,31 +26,41 @@ // user include files RPCPointProducer::RPCPointProducer(const edm::ParameterSet& iConfig) - : cscSegments(consumes<CSCSegmentCollection>(iConfig.getParameter<edm::InputTag>("cscSegments"))), - dt4DSegments(consumes<DTRecSegment4DCollection>(iConfig.getParameter<edm::InputTag>("dt4DSegments"))), - tracks(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"))), - tracks_(iConfig.getParameter<edm::InputTag>("tracks")), - incldt(iConfig.getUntrackedParameter<bool>("incldt", true)), + : incldt(iConfig.getUntrackedParameter<bool>("incldt", true)), inclcsc(iConfig.getUntrackedParameter<bool>("inclcsc", true)), incltrack(iConfig.getUntrackedParameter<bool>("incltrack", true)), debug(iConfig.getUntrackedParameter<bool>("debug", false)), MinCosAng(iConfig.getUntrackedParameter<double>("MinCosAng", 0.95)), MaxD(iConfig.getUntrackedParameter<double>("MaxD", 80.)), MaxDrb4(iConfig.getUntrackedParameter<double>("MaxDrb4", 150.)), - ExtrapolatedRegion(iConfig.getUntrackedParameter<double>("ExtrapolatedRegion", 0.5)), - trackTransformerParam(iConfig.getParameter<edm::ParameterSet>("TrackTransformer")) { + ExtrapolatedRegion(iConfig.getUntrackedParameter<double>("ExtrapolatedRegion", 0.5)) { + if (incldt) { + dt4DSegments = consumes<DTRecSegment4DCollection>(iConfig.getParameter<edm::InputTag>("dt4DSegments")); + dtSegtoRPC = std::make_unique<DTSegtoRPC>(consumesCollector()); + } + if (inclcsc) { + cscSegments = consumes<CSCSegmentCollection>(iConfig.getParameter<edm::InputTag>("cscSegments")); + cscSegtoRPC = std::make_unique<CSCSegtoRPC>(consumesCollector()); + } + if (incltrack) { + tracks = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks")); + tracktoRPC = std::make_unique<TracktoRPC>(iConfig.getParameter<edm::ParameterSet>("TrackTransformer"), + iConfig.getParameter<edm::InputTag>("tracks"), + consumesCollector()); + } + produces<RPCRecHitCollection>("RPCDTExtrapolatedPoints"); produces<RPCRecHitCollection>("RPCCSCExtrapolatedPoints"); produces<RPCRecHitCollection>("RPCTrackExtrapolatedPoints"); } -void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { +void RPCPointProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { if (incldt) { edm::Handle<DTRecSegment4DCollection> all4DSegments; iEvent.getByToken(dt4DSegments, all4DSegments); if (all4DSegments.isValid()) { - DTSegtoRPC DTClass(all4DSegments.product(), iSetup, debug, ExtrapolatedRegion); - iEvent.put(std::move(DTClass.thePoints()), "RPCDTExtrapolatedPoints"); + iEvent.put(dtSegtoRPC->thePoints(all4DSegments.product(), iSetup, debug, ExtrapolatedRegion), + "RPCDTExtrapolatedPoints"); } else { if (debug) std::cout << "RPCHLT Invalid DTSegments collection" << std::endl; @@ -61,8 +71,8 @@ void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve edm::Handle<CSCSegmentCollection> allCSCSegments; iEvent.getByToken(cscSegments, allCSCSegments); if (allCSCSegments.isValid()) { - CSCSegtoRPC CSCClass(allCSCSegments.product(), iSetup, debug, ExtrapolatedRegion); - iEvent.put(std::move(CSCClass.thePoints()), "RPCCSCExtrapolatedPoints"); + iEvent.put(cscSegtoRPC->thePoints(allCSCSegments.product(), iSetup, debug, ExtrapolatedRegion), + "RPCCSCExtrapolatedPoints"); } else { if (debug) std::cout << "RPCHLT Invalid CSCSegments collection" << std::endl; @@ -72,8 +82,7 @@ void RPCPointProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Eve edm::Handle<reco::TrackCollection> alltracks; iEvent.getByToken(tracks, alltracks); if (!(alltracks->empty())) { - TracktoRPC TrackClass(alltracks.product(), iSetup, debug, trackTransformerParam, tracks_); - iEvent.put(std::move(TrackClass.thePoints()), "RPCTrackExtrapolatedPoints"); + iEvent.put(tracktoRPC->thePoints(alltracks.product(), iSetup, debug), "RPCTrackExtrapolatedPoints"); } else { if (debug) std::cout << "RPCHLT Invalid Tracks collection" << std::endl; diff --git a/RecoLocalMuon/RPCRecHit/src/TracktoRPC.cc b/RecoLocalMuon/RPCRecHit/src/TracktoRPC.cc index 276028398bc41..489f82c6fbe4a 100644 --- a/RecoLocalMuon/RPCRecHit/src/TracktoRPC.cc +++ b/RecoLocalMuon/RPCRecHit/src/TracktoRPC.cc @@ -4,11 +4,11 @@ #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/Records/interface/MuonGeometryRecord.h" #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "Geometry/RPCGeometry/interface/RPCGeomServ.h" #include "DataFormats/RPCRecHit/interface/RPCRecHit.h" #include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h" #include "DataFormats/DetId/interface/DetId.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "RecoLocalMuon/RPCRecHit/interface/TracktoRPC.h" #include "RecoLocalMuon/RPCRecHit/src/DTStationIndex.h" #include "RecoLocalMuon/RPCRecHit/src/DTObjectMap.h" @@ -18,10 +18,7 @@ #include <ctime> #include <TMath.h> -bool TracktoRPC::ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::EventSetup &iSetup) { - edm::ESHandle<RPCGeometry> rpcGeo; - iSetup.get<MuonGeometryRecord>().get(rpcGeo); - +bool TracktoRPC::ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const RPCGeometry *rpcGeo) { const GeomDet *whichdet3 = rpcGeo->idToDet(rpcid.rawId()); const RPCRoll *aroll = dynamic_cast<const RPCRoll *>(whichdet3); float locx = LocalP.x(), locy = LocalP.y(); //, locz=LocalP.z(); @@ -54,35 +51,37 @@ bool TracktoRPC::ValidRPCSurface(RPCDetId rpcid, LocalPoint LocalP, const edm::E return false; } -TracktoRPC::TracktoRPC(const reco::TrackCollection *alltracks, - const edm::EventSetup &iSetup, - bool debug, - const edm::ParameterSet &iConfig, - const edm::InputTag &tracklabel) { - _ThePoints = std::make_unique<RPCRecHitCollection>(); - // if(alltracks->empty()) return; - +TracktoRPC::TracktoRPC(const edm::ParameterSet &iConfig, const edm::InputTag &tracklabel, edm::ConsumesCollector iC) + : rpcGeoToken_(iC.esConsumes()), + dtGeoToken_(iC.esConsumes()), + dtMapToken_(iC.esConsumes()), + cscGeoToken_(iC.esConsumes()), + cscMapToken_(iC.esConsumes()), + propagatorToken_(iC.esConsumes(edm::ESInputTag("", "SteppingHelixPropagatorAny"))) { if (tracklabel.label().find("cosmic") == 0) - theTrackTransformer = new TrackTransformerForCosmicMuons(iConfig); + theTrackTransformer = std::make_unique<TrackTransformerForCosmicMuons>(iConfig); else if (tracklabel.label().find("globalCosmic") == 0) - theTrackTransformer = new TrackTransformerForCosmicMuons(iConfig); + theTrackTransformer = std::make_unique<TrackTransformerForCosmicMuons>(iConfig); else - theTrackTransformer = new TrackTransformer(iConfig); - theTrackTransformer->setServices(iSetup); + theTrackTransformer = std::make_unique<TrackTransformer>(iConfig, iC); +} - edm::ESHandle<RPCGeometry> rpcGeo; - edm::ESHandle<DTGeometry> dtGeo; - edm::ESHandle<DTObjectMap> dtMap; - edm::ESHandle<CSCGeometry> cscGeo; - edm::ESHandle<CSCObjectMap> cscMap; +std::unique_ptr<RPCRecHitCollection> TracktoRPC::thePoints(reco::TrackCollection const *alltracks, + edm::EventSetup const &iSetup, + bool debug) { + auto _ThePoints = std::make_unique<RPCRecHitCollection>(); + // if(alltracks->empty()) return; + + theTrackTransformer->setServices(iSetup); - iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny", thePropagator); - iSetup.get<MuonGeometryRecord>().get(rpcGeo); - iSetup.get<MuonGeometryRecord>().get(dtGeo); - iSetup.get<MuonGeometryRecord>().get(dtMap); - iSetup.get<MuonGeometryRecord>().get(cscGeo); - iSetup.get<MuonGeometryRecord>().get(cscMap); + const RPCGeometry *rpcGeo = &iSetup.getData(rpcGeoToken_); + const DTGeometry *dtGeo = &iSetup.getData(dtGeoToken_); + const DTObjectMap *dtMap = &iSetup.getData(dtMapToken_); + const CSCGeometry *cscGeo = &iSetup.getData(cscGeoToken_); + const CSCObjectMap *cscMap = &iSetup.getData(cscMapToken_); + const Propagator *propagator = &iSetup.getData(propagatorToken_); + edm::OwnVector<RPCRecHit> RPCPointVector; std::vector<uint32_t> rpcput; double MaxD = 999.; @@ -150,15 +149,15 @@ TracktoRPC::TracktoRPC(const reco::TrackCollection *alltracks, if (dtS == 14) dtS = 10; DTStationIndex theindex(0, dtW, dtS, dtT); - std::set<RPCDetId> rollsForThisDT = dtMap->getRolls(theindex); + const std::set<RPCDetId> &rollsForThisDT = dtMap->getRolls(theindex); for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisDT.begin(); iteraRoll != rollsForThisDT.end(); iteraRoll++) { const RPCRoll *rollasociated = rpcGeo->roll(*iteraRoll); TrajectoryStateOnSurface ptss = - thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface()); + propagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface()); if (ptss.isValid()) - if (ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup)) { + if (ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), rpcGeo)) { rpcrollCounter[rollasociated->id().rawId()]++; bool check = true; std::vector<uint32_t>::iterator rpcroll; @@ -205,16 +204,16 @@ TracktoRPC::TracktoRPC(const reco::TrackCollection *alltracks, Ri = 1; CSCStationIndex theindex(En, St, Ri, rpcSegment); - std::set<RPCDetId> rollsForThisCSC = cscMap->getRolls(theindex); + const std::set<RPCDetId> &rollsForThisCSC = cscMap->getRolls(theindex); for (std::set<RPCDetId>::iterator iteraRoll = rollsForThisCSC.begin(); iteraRoll != rollsForThisCSC.end(); iteraRoll++) { const RPCRoll *rollasociated = rpcGeo->roll(*iteraRoll); TrajectoryStateOnSurface ptss = - thePropagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface()); + propagator->propagate(upd2, rpcGeo->idToDet(rollasociated->id())->surface()); if (ptss.isValid()) - if (ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), iSetup)) { + if (ValidRPCSurface(rollasociated->id().rawId(), ptss.localPosition(), rpcGeo)) { rpcrollCounter[rollasociated->id().rawId()]++; bool check = true; std::vector<uint32_t>::iterator rpcroll; @@ -337,9 +336,9 @@ TracktoRPC::TracktoRPC(const reco::TrackCollection *alltracks, TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint); const TrajectoryStateOnSurface &upd2 = (tMt).updatedState(); if (upd2.isValid()) { - TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface()); + TrajectoryStateOnSurface ptss = propagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface()); if (ptss.isValid()) - if (ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup)) { + if (ValidRPCSurface(*rpcroll2, ptss.localPosition(), rpcGeo)) { float rpcGPX = ptss.globalPosition().x(); float rpcGPY = ptss.globalPosition().y(); float rpcGPZ = ptss.globalPosition().z(); @@ -393,9 +392,9 @@ TracktoRPC::TracktoRPC(const reco::TrackCollection *alltracks, TrajectoryMeasurement tMt = trajectory->closestMeasurement(dcPoint); const TrajectoryStateOnSurface &upd2 = (tMt).updatedState(); if (upd2.isValid()) { - TrajectoryStateOnSurface ptss = thePropagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface()); + TrajectoryStateOnSurface ptss = propagator->propagate(upd2, rpcGeo->idToDet(*rpcroll2)->surface()); if (ptss.isValid()) - if (ValidRPCSurface(*rpcroll2, ptss.localPosition(), iSetup)) { + if (ValidRPCSurface(*rpcroll2, ptss.localPosition(), rpcGeo)) { float rpcGPX = ptss.globalPosition().x(); float rpcGPY = ptss.globalPosition().y(); float rpcGPZ = ptss.globalPosition().z(); @@ -443,6 +442,6 @@ TracktoRPC::TracktoRPC(const reco::TrackCollection *alltracks, if (debug) std::cout << "last steps OK!! " << std::endl; } -} -TracktoRPC::~TracktoRPC() {} + return _ThePoints; +} diff --git a/RecoMuon/GlobalTrackingTools/src/GlobalTrajectoryBuilderBase.cc b/RecoMuon/GlobalTrackingTools/src/GlobalTrajectoryBuilderBase.cc index 170a4e745ac86..85ea1153d6e4c 100644 --- a/RecoMuon/GlobalTrackingTools/src/GlobalTrajectoryBuilderBase.cc +++ b/RecoMuon/GlobalTrackingTools/src/GlobalTrajectoryBuilderBase.cc @@ -90,7 +90,7 @@ GlobalTrajectoryBuilderBase::GlobalTrajectoryBuilderBase(const edm::ParameterSet theTrackerPropagatorName = par.getParameter<std::string>("TrackerPropagator"); edm::ParameterSet trackTransformerPSet = par.getParameter<edm::ParameterSet>("TrackTransformer"); - theTrackTransformer = new TrackTransformer(trackTransformerPSet); + theTrackTransformer = new TrackTransformer(trackTransformerPSet, iC); edm::ParameterSet regionBuilderPSet = par.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder"); diff --git a/RecoMuon/MuonIdentification/interface/MuonKinkFinder.h b/RecoMuon/MuonIdentification/interface/MuonKinkFinder.h index ee962f5f2dbb9..ecdcdee4f4fee 100644 --- a/RecoMuon/MuonIdentification/interface/MuonKinkFinder.h +++ b/RecoMuon/MuonIdentification/interface/MuonKinkFinder.h @@ -2,11 +2,12 @@ #define RecoMuon_MuonIdentification_MuonKinkFinder_h #include "DataFormats/MuonReco/interface/MuonQuality.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "TrackingTools/TrackRefitter/interface/TrackTransformer.h" class MuonKinkFinder { public: - MuonKinkFinder(const edm::ParameterSet &iConfig); + MuonKinkFinder(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC); ~MuonKinkFinder(); // set event setup diff --git a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc index a3ffca69344d1..65252c153cc18 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc +++ b/RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc @@ -148,7 +148,7 @@ MuonIdProducer::MuonIdProducer(const edm::ParameterSet& iConfig) if (fillTrackerKink_) { trackerKinkFinder_ = - std::make_unique<MuonKinkFinder>(iConfig.getParameter<edm::ParameterSet>("TrackerKinkFinderParameters")); + std::make_unique<MuonKinkFinder>(iConfig.getParameter<edm::ParameterSet>("TrackerKinkFinderParameters"), iC); } //create mesh holder diff --git a/RecoMuon/MuonIdentification/src/MuonKinkFinder.cc b/RecoMuon/MuonIdentification/src/MuonKinkFinder.cc index ad5b5cd6e0c49..1ac8e4e5da77b 100644 --- a/RecoMuon/MuonIdentification/src/MuonKinkFinder.cc +++ b/RecoMuon/MuonIdentification/src/MuonKinkFinder.cc @@ -2,10 +2,10 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "TrackingTools/PatternTools/interface/Trajectory.h" -MuonKinkFinder::MuonKinkFinder(const edm::ParameterSet &iConfig) +MuonKinkFinder::MuonKinkFinder(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC) : diagonalOnly_(iConfig.getParameter<bool>("diagonalOnly")), usePosition_(iConfig.getParameter<bool>("usePosition")), - refitter_(iConfig) {} + refitter_(iConfig, iC) {} MuonKinkFinder::~MuonKinkFinder() {} diff --git a/RecoTracker/SpecialSeedGenerators/src/MuonReSeeder.cc b/RecoTracker/SpecialSeedGenerators/src/MuonReSeeder.cc index 23b7db13250ac..b5e04340e9f9c 100644 --- a/RecoTracker/SpecialSeedGenerators/src/MuonReSeeder.cc +++ b/RecoTracker/SpecialSeedGenerators/src/MuonReSeeder.cc @@ -9,6 +9,7 @@ \author Giovanni Petrucciani */ +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -36,6 +37,7 @@ class MuonReSeeder : public edm::stream::EDProducer<> { private: /// Labels for input collections edm::EDGetTokenT<edm::View<reco::Muon>> src_; + const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_; /// Muon selection StringCutObjectSelector<reco::Muon> selector_; @@ -55,11 +57,12 @@ class MuonReSeeder : public edm::stream::EDProducer<> { MuonReSeeder::MuonReSeeder(const edm::ParameterSet &iConfig) : src_(consumes<edm::View<reco::Muon>>(iConfig.getParameter<edm::InputTag>("src"))), + tTopoToken_(esConsumes()), selector_(iConfig.existsAs<std::string>("cut") ? iConfig.getParameter<std::string>("cut") : "", true), layersToKeep_(iConfig.getParameter<int32_t>("layersToKeep")), insideOut_(iConfig.getParameter<bool>("insideOut")), debug_(iConfig.getUntrackedParameter<bool>("debug", false)), - refitter_(iConfig) { + refitter_(iConfig, consumesCollector()) { produces<std::vector<TrajectorySeed>>(); } @@ -73,8 +76,7 @@ void MuonReSeeder::produce(edm::Event &iEvent, const edm::EventSetup &iSetup) { iEvent.getByToken(src_, src); //Retrieve tracker topology from geometry - edm::ESHandle<TrackerTopology> tTopo; - iSetup.get<TrackerTopologyRcd>().get(tTopo); + const TrackerTopology &tTopo = iSetup.getData(tTopoToken_); auto out = std::make_unique<std::vector<TrajectorySeed>>(); unsigned int nsrc = src->size(); @@ -123,7 +125,7 @@ void MuonReSeeder::produce(edm::Event &iEvent, const edm::EventSetup &iSetup) { if (!hit) continue; int subdet = hit->geographicalId().subdetId(); - int lay = tTopo->layer(hit->geographicalId()); + int lay = tTopo.layer(hit->geographicalId()); if (subdet != lastSubdet || lay != lastLayer) { // I'm on a new layer if (lastHit != nullptr && taken == layersToKeep_) { diff --git a/TrackingTools/TrackRefitter/interface/TrackTransformer.h b/TrackingTools/TrackRefitter/interface/TrackTransformer.h index b660cbd0dd425..1d776534964e2 100644 --- a/TrackingTools/TrackRefitter/interface/TrackTransformer.h +++ b/TrackingTools/TrackRefitter/interface/TrackTransformer.h @@ -17,7 +17,9 @@ #include "TrackingTools/TrackRefitter/interface/RefitDirection.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Utilities/interface/ESGetToken.h" #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h" #include "MagneticField/Engine/interface/MagneticField.h" @@ -26,11 +28,6 @@ #include "DataFormats/TrackReco/interface/TrackFwd.h" -namespace edm { - class ParameterSet; - class EventSetup; - class ParameterSetDescription; -} // namespace edm namespace reco { class TransientTrack; } @@ -40,12 +37,22 @@ class TrajectorySmoother; class Propagator; class TransientTrackingRecHitBuilder; class Trajectory; +class GlobalTrackingGeometryRecord; +class IdealMagneticFieldRecord; +class TrajectoryFitterRecord; +class TrackingComponentsRecord; +class TransientRecHitRecord; class TrackTransformer final : public TrackTransformerBase { public: - /// Constructor + /// Constructor (for modules not yet migrated to ES-consumes) explicit TrackTransformer(const edm::ParameterSet&); + /// Constructor (for modules migrated to ES-consumes) + explicit TrackTransformer(const edm::ParameterSet&, edm::ConsumesCollector&); + explicit TrackTransformer(const edm::ParameterSet& parameterSet, edm::ConsumesCollector&& iC) + : TrackTransformer(parameterSet, iC) {} + /// Destructor ~TrackTransformer() override; @@ -92,9 +99,6 @@ class TrackTransformer final : public TrackTransformerBase { private: RefitDirection::GeometricalDirection checkRecHitsOrdering(TransientTrackingRecHit::ConstRecHitContainer const&) const; - unsigned long long theCacheId_TC = 0; - unsigned long long theCacheId_GTG = 0; - unsigned long long theCacheId_MG = 0; unsigned long long theCacheId_TRH = 0; const bool theRPCInTheFit; @@ -102,27 +106,35 @@ class TrackTransformer final : public TrackTransformerBase { const bool theDoPredictionsOnly; const RefitDirection theRefitDirection; + edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> theTrackingGeometryToken; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> theMGFieldToken; edm::ESHandle<GlobalTrackingGeometry> theTrackingGeometry; edm::ESHandle<MagneticField> theMGField; const std::string theFitterName; + edm::ESGetToken<TrajectoryFitter, TrajectoryFitterRecord> theFitterToken; std::unique_ptr<TrajectoryFitter> theFitter; const std::string theSmootherName; + edm::ESGetToken<TrajectorySmoother, TrajectoryFitterRecord> theSmootherToken; std::unique_ptr<TrajectorySmoother> theSmoother; const std::string thePropagatorName; + edm::ESGetToken<Propagator, TrackingComponentsRecord> thePropagatorToken; edm::ESHandle<Propagator> const& propagator() const { return thePropagator; } edm::ESHandle<Propagator> thePropagator; const std::string theTrackerRecHitBuilderName; - edm::ESHandle<TransientTrackingRecHitBuilder> theTrackerRecHitBuilder; + edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theTrackerRecHitBuilderToken; + const TransientTrackingRecHitBuilder* theTrackerRecHitBuilder; TkClonerImpl hitCloner; const std::string theMuonRecHitBuilderName; + edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theMuonRecHitBuilderToken; edm::ESHandle<TransientTrackingRecHitBuilder> theMuonRecHitBuilder; const std::string theMTDRecHitBuilderName; + edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> theMTDRecHitBuilderToken; bool theMtdAvailable; edm::ESHandle<TransientTrackingRecHitBuilder> theMTDRecHitBuilder; }; diff --git a/TrackingTools/TrackRefitter/plugins/TracksToTrajectories.cc b/TrackingTools/TrackRefitter/plugins/TracksToTrajectories.cc index 9a25b6468171f..f9f79afb3286c 100644 --- a/TrackingTools/TrackRefitter/plugins/TracksToTrajectories.cc +++ b/TrackingTools/TrackRefitter/plugins/TracksToTrajectories.cc @@ -2,6 +2,7 @@ #include "TrackingTools/TrackRefitter/interface/TrackTransformerForGlobalCosmicMuons.h" #include "TrackingTools/TrackRefitter/interface/TrackTransformerForCosmicMuons.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" @@ -72,7 +73,7 @@ TracksToTrajectories::TracksToTrajectories(const ParameterSet& parameterSet, con string type = parameterSet.getParameter<string>("Type"); if (type == "Default") - theTrackTransformer = std::make_unique<TrackTransformer>(trackTransformerParam); + theTrackTransformer = std::make_unique<TrackTransformer>(trackTransformerParam, consumesCollector()); else if (type == "GlobalCosmicMuonsForAlignment") theTrackTransformer = std::make_unique<TrackTransformerForGlobalCosmicMuons>(trackTransformerParam); else if (type == "CosmicMuonsForAlignment") diff --git a/TrackingTools/TrackRefitter/src/TrackTransformer.cc b/TrackingTools/TrackRefitter/src/TrackTransformer.cc index 71d77db786e34..93a7a9f6401fc 100644 --- a/TrackingTools/TrackRefitter/src/TrackTransformer.cc +++ b/TrackingTools/TrackRefitter/src/TrackTransformer.cc @@ -1,5 +1,6 @@ #include "TrackingTools/TrackRefitter/interface/TrackTransformer.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -39,6 +40,18 @@ TrackTransformer::TrackTransformer(const ParameterSet& parameterSet) theMuonRecHitBuilderName(parameterSet.getParameter<string>("MuonRecHitBuilder")), theMTDRecHitBuilderName(parameterSet.getParameter<string>("MTDRecHitBuilder")) {} +TrackTransformer::TrackTransformer(const ParameterSet& parameterSet, edm::ConsumesCollector& iC) + : TrackTransformer(parameterSet) { + theTrackingGeometryToken = iC.esConsumes(); + theMGFieldToken = iC.esConsumes(); + theFitterToken = iC.esConsumes(edm::ESInputTag("", theFitterName)); + theSmootherToken = iC.esConsumes(edm::ESInputTag("", theSmootherName)); + thePropagatorToken = iC.esConsumes(edm::ESInputTag("", thePropagatorName)); + theTrackerRecHitBuilderToken = iC.esConsumes(edm::ESInputTag("", theTrackerRecHitBuilderName)); + theMuonRecHitBuilderToken = iC.esConsumes(edm::ESInputTag("", theMuonRecHitBuilderName)); + theMTDRecHitBuilderToken = iC.esConsumes(edm::ESInputTag("", theMTDRecHitBuilderName)); +} + /// Destructor TrackTransformer::~TrackTransformer() {} @@ -66,34 +79,31 @@ void TrackTransformer::fillPSetDescription(edm::ParameterSetDescription& desc, void TrackTransformer::setServices(const EventSetup& setup) { const std::string metname = "Reco|TrackingTools|TrackTransformer"; - edm::ESHandle<TrajectoryFitter> aFitter; - edm::ESHandle<TrajectorySmoother> aSmoother; - setup.get<TrajectoryFitter::Record>().get(theFitterName, aFitter); - setup.get<TrajectoryFitter::Record>().get(theSmootherName, aSmoother); - theFitter = aFitter->clone(); - theSmoother.reset(aSmoother->clone()); + if (theFitterToken.isInitialized()) { + theFitter = setup.getData(theFitterToken).clone(); + theSmoother.reset(setup.getData(theSmootherToken).clone()); + + thePropagator = setup.getHandle(thePropagatorToken); + + // Global Tracking Geometry + theTrackingGeometry = setup.getHandle(theTrackingGeometryToken); - unsigned long long newCacheId_TC = setup.get<TrackingComponentsRecord>().cacheIdentifier(); + // Magfield Field + theMGField = setup.getHandle(theMGFieldToken); + } else { + edm::ESHandle<TrajectoryFitter> aFitter; + edm::ESHandle<TrajectorySmoother> aSmoother; + setup.get<TrajectoryFitter::Record>().get(theFitterName, aFitter); + setup.get<TrajectoryFitter::Record>().get(theSmootherName, aSmoother); + theFitter = aFitter->clone(); + theSmoother.reset(aSmoother->clone()); - if (newCacheId_TC != theCacheId_TC) { - LogTrace(metname) << "Tracking Component changed!"; - theCacheId_TC = newCacheId_TC; setup.get<TrackingComponentsRecord>().get(thePropagatorName, thePropagator); - } - // Global Tracking Geometry - unsigned long long newCacheId_GTG = setup.get<GlobalTrackingGeometryRecord>().cacheIdentifier(); - if (newCacheId_GTG != theCacheId_GTG) { - LogTrace(metname) << "GlobalTrackingGeometry changed!"; - theCacheId_GTG = newCacheId_GTG; + // Global Tracking Geometry setup.get<GlobalTrackingGeometryRecord>().get(theTrackingGeometry); - } - // Magfield Field - unsigned long long newCacheId_MG = setup.get<IdealMagneticFieldRecord>().cacheIdentifier(); - if (newCacheId_MG != theCacheId_MG) { - LogTrace(metname) << "Magnetic Field changed!"; - theCacheId_MG = newCacheId_MG; + // Magfield Field setup.get<IdealMagneticFieldRecord>().get(theMGField); } @@ -102,11 +112,19 @@ void TrackTransformer::setServices(const EventSetup& setup) { if (newCacheId_TRH != theCacheId_TRH) { theCacheId_TRH = newCacheId_TRH; LogTrace(metname) << "TransientRecHitRecord changed!"; - setup.get<TransientRecHitRecord>().get(theTrackerRecHitBuilderName, theTrackerRecHitBuilder); - setup.get<TransientRecHitRecord>().get(theMuonRecHitBuilderName, theMuonRecHitBuilder); - setup.get<TransientRecHitRecord>().get(theMTDRecHitBuilderName, theMTDRecHitBuilder); + if (theTrackerRecHitBuilderToken.isInitialized()) { + theTrackerRecHitBuilder = &setup.getData(theTrackerRecHitBuilderToken); + theMuonRecHitBuilder = setup.getHandle(theMuonRecHitBuilderToken); + theMTDRecHitBuilder = setup.getHandle(theMTDRecHitBuilderToken); + } else { + edm::ESHandle<TransientTrackingRecHitBuilder> aTrackerRecHitBuilder; + setup.get<TransientRecHitRecord>().get(theTrackerRecHitBuilderName, aTrackerRecHitBuilder); + theTrackerRecHitBuilder = aTrackerRecHitBuilder.product(); + setup.get<TransientRecHitRecord>().get(theMuonRecHitBuilderName, theMuonRecHitBuilder); + setup.get<TransientRecHitRecord>().get(theMTDRecHitBuilderName, theMTDRecHitBuilder); + } theMtdAvailable = theMTDRecHitBuilder.isValid(); - hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder.product())->cloner(); + hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder)->cloner(); } theFitter->setHitCloner(&hitCloner); theSmoother->setHitCloner(&hitCloner); @@ -117,7 +135,7 @@ vector<Trajectory> TrackTransformer::transform(const reco::TrackRef& track) cons TransientTrackingRecHit::ConstRecHitContainer TrackTransformer::getTransientRecHits( const reco::TransientTrack& track) const { TransientTrackingRecHit::ConstRecHitContainer result; - auto tkbuilder = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder.product()); + auto tkbuilder = static_cast<TkTransientTrackingRecHitBuilder const*>(theTrackerRecHitBuilder); for (auto hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) { if ((*hit)->isValid()) { From 8ce9546a4db16d5d917207923b6f32d8d9626f53 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Fri, 16 Oct 2020 19:52:34 +0200 Subject: [PATCH 653/778] Migrate PhysicsTowerOrganizer to EventSetup consumes --- .../HcalRecAlgos/interface/HBHEIsolatedNoiseAlgos.h | 8 ++++---- .../HcalRecAlgos/src/HBHEIsolatedNoiseAlgos.cc | 12 ++++-------- .../src/HBHEIsolatedNoiseReflagger.cc | 4 +++- .../src/HBHEIsolatedNoiseReflagger.h | 1 + 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/RecoLocalCalo/HcalRecAlgos/interface/HBHEIsolatedNoiseAlgos.h b/RecoLocalCalo/HcalRecAlgos/interface/HBHEIsolatedNoiseAlgos.h index 9c9662c03fba6..b8feb89ffb5ac 100644 --- a/RecoLocalCalo/HcalRecAlgos/interface/HBHEIsolatedNoiseAlgos.h +++ b/RecoLocalCalo/HcalRecAlgos/interface/HBHEIsolatedNoiseAlgos.h @@ -45,6 +45,7 @@ class EcalRecHit; class HcalChannelQuality; class HcalSeverityLevelComputer; class EcalSeverityLevelAlgo; +class CaloGeometry; ////////////////////////////////////////////////////////////////////////////// // @@ -173,14 +174,13 @@ class PhysicsTowerOrganizer { bool operator()(const PhysicsTower& lhs, const PhysicsTower& rhs) const { return (lhs.id < rhs.id); } }; - PhysicsTowerOrganizer(const edm::Event& iEvent, - const edm::EventSetup& evSetup, - const edm::Handle<HBHERecHitCollection>& hbhehitcoll_h, + PhysicsTowerOrganizer(const edm::Handle<HBHERecHitCollection>& hbhehitcoll_h, const edm::Handle<EcalRecHitCollection>& ebhitcoll_h, const edm::Handle<EcalRecHitCollection>& eehitcoll_h, const edm::Handle<std::vector<reco::TrackExtrapolation> >& trackextrapcoll_h, const ObjectValidatorAbs& objectvalidator, - const CaloTowerConstituentsMap& ctcm); + const CaloTowerConstituentsMap& ctcm, + const CaloGeometry& geo); virtual ~PhysicsTowerOrganizer() {} diff --git a/RecoLocalCalo/HcalRecAlgos/src/HBHEIsolatedNoiseAlgos.cc b/RecoLocalCalo/HcalRecAlgos/src/HBHEIsolatedNoiseAlgos.cc index 789bce6a15b4e..91aaba0ff9399 100644 --- a/RecoLocalCalo/HcalRecAlgos/src/HBHEIsolatedNoiseAlgos.cc +++ b/RecoLocalCalo/HcalRecAlgos/src/HBHEIsolatedNoiseAlgos.cc @@ -149,20 +149,16 @@ bool ObjectValidator::validTrack(const reco::Track& trk) const { //////////////////////////////////////////////////////////// PhysicsTowerOrganizer::PhysicsTowerOrganizer( - const edm::Event& iEvent, - const edm::EventSetup& evSetup, const edm::Handle<HBHERecHitCollection>& hbhehitcoll_h, const edm::Handle<EcalRecHitCollection>& ebhitcoll_h, const edm::Handle<EcalRecHitCollection>& eehitcoll_h, const edm::Handle<std::vector<reco::TrackExtrapolation> >& trackextrapcoll_h, const ObjectValidatorAbs& objectvalidator, - const CaloTowerConstituentsMap& ctcm) { + const CaloTowerConstituentsMap& ctcm, + const CaloGeometry& geo) { // get some geometries - edm::ESHandle<CaloGeometry> pG; - evSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); - const CaloSubdetectorGeometry* gEB = geo->getSubdetectorGeometry(DetId::Ecal, EcalBarrel); - const CaloSubdetectorGeometry* gEE = geo->getSubdetectorGeometry(DetId::Ecal, EcalEndcap); + const CaloSubdetectorGeometry* gEB = geo.getSubdetectorGeometry(DetId::Ecal, EcalBarrel); + const CaloSubdetectorGeometry* gEE = geo.getSubdetectorGeometry(DetId::Ecal, EcalEndcap); // do the HCAL hits for (HBHERecHitCollection::const_iterator it = hbhehitcoll_h->begin(); it != hbhehitcoll_h->end(); ++it) { diff --git a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc index df820e0430442..044d7576fcd22 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc @@ -70,6 +70,7 @@ HBHEIsolatedNoiseReflagger::HBHEIsolatedNoiseReflagger(const edm::ParameterSet& ecalSevToken_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>(); ctcmToken_ = esConsumes<CaloTowerConstituentsMap, CaloGeometryRecord>(); hfemapToken_ = esConsumes<HcalFrontEndMap, HcalFrontEndMapRcd>(); + geoToken_ = esConsumes(); produces<HBHERecHitCollection>(); } @@ -116,7 +117,8 @@ void HBHEIsolatedNoiseReflagger::produce(edm::Event& iEvent, const edm::EventSet objvalidator_.setEERecHitCollection(&(*eehits_h)); // organizer the hits - PhysicsTowerOrganizer pto(iEvent, evSetup, hbhehits_h, ebhits_h, eehits_h, trackextraps_h, objvalidator_, ctcm); + PhysicsTowerOrganizer pto( + hbhehits_h, ebhits_h, eehits_h, trackextraps_h, objvalidator_, ctcm, evSetup.getData(geoToken_)); HBHEHitMapOrganizer organizer(hbhehits_h, objvalidator_, pto, hfemap); // get the rbxs, hpds, dihits, and monohits diff --git a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.h b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.h index acab01be5ee5f..3761cda8d38d5 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.h +++ b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.h @@ -79,6 +79,7 @@ class HBHEIsolatedNoiseReflagger : public edm::stream::EDProducer<> { edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> ecalSevToken_; edm::ESGetToken<CaloTowerConstituentsMap, CaloGeometryRecord> ctcmToken_; edm::ESGetToken<HcalFrontEndMap, HcalFrontEndMapRcd> hfemapToken_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geoToken_; }; #endif From 1865a0acc0216c3091ed3a892ad87251cba24567 Mon Sep 17 00:00:00 2001 From: Nurfikri Norjoharuddeen <nurfikri89@gmail.com> Date: Sat, 17 Oct 2020 04:16:29 +0200 Subject: [PATCH 654/778] code-format changes --- PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc b/PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc index 4b0e5de2a1244..aebb3ac83b200 100644 --- a/PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc +++ b/PhysicsTools/NanoAOD/plugins/NPUTablesProducer.cc @@ -18,8 +18,7 @@ class NPUTablesProducer : public edm::global::EDProducer<> { : npuTag_(consumes<std::vector<PileupSummaryInfo>>(params.getParameter<edm::InputTag>("src"))), pvTag_(consumes<std::vector<reco::Vertex>>(params.getParameter<edm::InputTag>("pvsrc"))), vz_(params.getParameter<std::vector<double>>("zbins")), - savePtHatMax_(params.getParameter<bool>("savePtHatMax")) - { + savePtHatMax_(params.getParameter<bool>("savePtHatMax")) { produces<nanoaod::FlatTable>(); } @@ -51,7 +50,7 @@ class NPUTablesProducer : public edm::global::EDProducer<> { float gpudensity = 0; float pthatmax = 0; - + for (unsigned int ibx = 0; ibx < npuProd.size(); ibx++) { if (npuProd[ibx].getBunchCrossing() == 0) { bx0 = ibx; @@ -70,7 +69,7 @@ class NPUTablesProducer : public edm::global::EDProducer<> { } gpudensity /= (20.0 * (*(zbin) - *(zbin - 1))); - if (savePtHatMax_){ + if (savePtHatMax_) { pthatmax = *max_element(npuProd[ibx].getPU_pT_hats().begin(), npuProd[ibx].getPU_pT_hats().end()); } } @@ -95,7 +94,7 @@ class NPUTablesProducer : public edm::global::EDProducer<> { out.addColumnValue<int>("sumLOOT", loot, "number of late out of time pileup"); out.addColumnValue<float>("pudensity", pudensity, "PU vertices / mm"); out.addColumnValue<float>("gpudensity", gpudensity, "Generator-level PU vertices / mm"); - if (savePtHatMax_){ + if (savePtHatMax_) { out.addColumnValue<float>("pthatmax", pthatmax, "Maximum pt-hat"); } } @@ -107,7 +106,7 @@ class NPUTablesProducer : public edm::global::EDProducer<> { desc.add<edm::InputTag>("pvsrc", edm::InputTag("offlineSlimmedPrimaryVertices"))->setComment("tag for the PVs"); desc.add<std::vector<double>>("zbins", {}) ->setComment("Z bins to compute the generator-level number of PU vertices per mm"); - desc.add<bool>("savePtHatMax",false)->setComment("Store maximum pt-hat of PU"); + desc.add<bool>("savePtHatMax", false)->setComment("Store maximum pt-hat of PU"); descriptions.add("puTable", desc); } From ffa2829cf64d20c1dd019fa440ca07c5ecde2a4d Mon Sep 17 00:00:00 2001 From: Sergio Lo Meo <sergio.lomeo@cern.ch> Date: Sat, 17 Oct 2020 17:53:43 +0200 Subject: [PATCH 655/778] Fixed Non Planar Trapezoids --- .../data/muonYoke/2021/v5/muonYoke.xml | 4504 +++++++++++++++++ 1 file changed, 4504 insertions(+) create mode 100644 Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml diff --git a/Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml b/Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml new file mode 100644 index 0000000000000..4a7f8869c0887 --- /dev/null +++ b/Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml @@ -0,0 +1,4504 @@ +<?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"> + <SolidSection label="muonYoke.xml"> + <Cone name="YN12_a" dz="0.245*m" rMin1="0.9243*m" rMax1="2.6300*m" rMin2="0.8900*m" rMax2="2.6300*m" startPhi="75*deg" deltaPhi="30*deg"/> + <Tubs name="YN12_b" rMin="0.7250*m" rMax="2.6300*m" dz="0.0500*m" startPhi="75*deg" deltaPhi="30*deg"/> + <Tubs name="YN12_c" rMin="0.8500*m" rMax="2.6300*m" dz="0.1640*m" startPhi="75*deg" deltaPhi="30*deg"/> + <Tubs name="YE1_a" rMin="0.8500*m" rMax="1.1349*m" dz="0.3550*m" startPhi="75*deg" deltaPhi="30*deg"/> + <TruncTubs name="YE1_bl" rMin="1.1349*m" rMax="7.20024*m" cutAtStart="6.9549*m" cutAtDelta="7.20024*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.2959*m"/> + <TruncTubs name="YE1_br" rMin="1.1349*m" rMax="7.20024*m" cutAtStart="7.20024*m" cutAtDelta="6.9549*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.2959*m"/> + <UnionSolid name="YE1_b"> + <rSolid name="YE1_bl"/> + <rSolid name="YE1_br"/> + <rRotation name="rotations:R345"/> + </UnionSolid> + <Tubs name="YE12" rMin="0.9350*m" rMax="1.1350*m" dz="0.2675*m" startPhi="75*deg" deltaPhi="30*deg"/> + <Tubs name="YE2_a" rMin="0.9500*m" rMax="1.3599*m" dz="0.3600*m" startPhi="75*deg" deltaPhi="30*deg"/> + <TruncTubs name="YE2_bl" rMin="1.3599*m" rMax="7.20024*m" cutAtStart="6.9549*m" cutAtDelta="7.20024*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.2959*m"/> + <TruncTubs name="YE2_br" rMin="1.3599*m" rMax="7.20024*m" cutAtStart="7.20024*m" cutAtDelta="6.9549*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.2959*m"/> + <UnionSolid name="YE2_b"> + <rSolid name="YE2_bl"/> + <rSolid name="YE2_br"/> + <rRotation name="rotations:R345"/> + </UnionSolid> + <Tubs name="YE23" rMin="1.0400*m" rMax="1.3600*m" dz="0.2675*m" startPhi="75*deg" deltaPhi="30*deg"/> + <Tubs name="YE3_a" rMin="1.0400*m" rMax="1.5299*m" dz="0.175*m" startPhi="75*deg" deltaPhi="30*deg"/> + <TruncTubs name="YE3_bl" rMin="1.5299*m" rMax="7.20024*m" cutAtStart="6.9549*m" cutAtDelta="7.20024*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.116*m"/> + <TruncTubs name="YE3_br" rMin="1.5299*m" rMax="7.20024*m" cutAtStart="7.20024*m" cutAtDelta="6.9549*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.116*m"/> + <UnionSolid name="YE3_b"> + <rSolid name="YE3_bl"/> + <rSolid name="YE3_br"/> + <rRotation name="rotations:R345"/> + </UnionSolid> + <Tubs name="YE34" rMin="1.1300*m" rMax="1.5300*m" dz="0.2725*m" startPhi="75*deg" deltaPhi="30*deg"/> + <Tubs name="ShieldingME4" rMin="1.1300*m" rMax="2.5000*m" dz="0.0375*m" startPhi="75*deg" deltaPhi="30*deg"/> + <TruncTubs name="YE4l" rMin="2.5001*m" rMax="7.20024*m" cutAtStart="6.9549*m" cutAtDelta="7.20024*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.0624*m"/> + <TruncTubs name="YE4r" rMin="2.5001*m" rMax="7.20024*m" cutAtStart="7.20024*m" cutAtDelta="6.9549*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.0624*m"/> + <UnionSolid name="YE4"> + <rSolid name="YE4l"/> + <rSolid name="YE4r"/> + <rRotation name="rotations:R345"/> + </UnionSolid> + <TruncTubs name="YE4_in_l" rMin="2.7001*m" rMax="7.20024*m" cutAtStart="6.7549*m" cutAtDelta="7.00024*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.0375*m"/> + <TruncTubs name="YE4_in_r" rMin="2.7001*m" rMax="7.20024*m" cutAtStart="7.00024*m" cutAtDelta="6.7549*m" cutInside="false" startPhi="0*deg" deltaPhi="15*deg" zHalf="0.0375*m"/> + <UnionSolid name="YE4_in"> + <rSolid name="YE4_in_l"/> + <rSolid name="YE4_in_r"/> + <rRotation name="rotations:R345"/> + </UnionSolid> + <Trapezoid name="YB1_w0_b1" dz="0.63395*m" alp1="-7.63074*deg" bl1="0.186343*m" tl1="0.198401*m" h1="0.045*m" alp2="-7.63074*deg" bl2="0.186343*m" tl2="0.198401*m" h2="0.045*m" phi="0*deg" theta="0*deg"/> + <Box name="YB1_w0_b2" dx="0.7925*m - 0.000001040716*m" dy="0.0450*m" dz="0.62495*m"/> + <Trapezoid name="YB1_w0_b3" dz="1.268*m" alp1="7.63074*deg" bl1="0.257742*m" tl1="0.2698*m" h1="0.045*m" alp2="7.63074*deg" bl2="0.257742*m" tl2="0.2698*m" h2="0.045*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB1_w1_b1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.186343*m" tl1="0.198401*m" h1="0.045*m" alp2="-7.63074*deg" bl2="0.186343*m" tl2="0.198401*m" h2="0.045*m" phi="0*deg" theta="0*deg"/> + <Box name="YB1_w1_b2" dx="0.21695*m" dy="0.0450*m" dz="0.186*m"/> + <Box name="YB1_w1_b3" dx="0.08*m" dy="0.0450*m - 0.00000245782*m - 0.00000284419*m" dz="0.186*m"/> + <Box name="YB1_w1_b4" dx="0.2700*m - 0.000207145*m" dy="0.0450*m - 0.00000284419*m" dz="0.186*m"/> + <Box name="YB1_w1_b5" dx="0.08*m" dy="0.0450*m - 0.00000245782*m" dz="0.186*m"/> + <Box name="YB1_w1_b6" dx="0.14555*m" dy="0.0450*m" dz="0.186*m"/> + <Box name="YB1_w1_b7" dx="0.7925*m - 0.000000165104*m - 0.000000713952*m" dy="0.0450*m - 0.00000305385*m" dz="1.0639*m"/> + <Trapezoid name="YB1_w1_b8" dz="1.2679*m" alp1="7.63074*deg" bl1="0.257742*m" tl1="0.2698*m" h1="0.045*m" alp2="7.63074*deg" bl2="0.257742*m" tl2="0.2698*m" h2="0.045*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB1_w2_b1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.186343*m" tl1="0.198401*m" h1="0.045*m" alp2="-7.63074*deg" bl2="0.186343*m" tl2="0.198401*m" h2="0.045*m" phi="0*deg" theta="0*deg"/> + <Box name="YB1_w2_b2" dx="0.79244*m" dy="0.0450*m - 0.00000305385*m" dz="1.2500*m"/> + <Trapezoid name="YB1_w2_b3" dz="1.2679*m" alp1="7.63074*deg" bl1="0.257742*m" tl1="0.2698*m" h1="0.045*m - 0.00000282824*m" alp2="7.63074*deg" bl2="0.257742*m" tl2="0.2698*m" h2="0.045*m - 0.00000282824*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB1_w0_m" dz="0.63395*m - 1.0*mm" alp1="0*deg" bl1="1.2607*m -1.0*mm" tl1="1.3143*m -1.0*mm" h1="0.1000*m - 0.00000305385*m -1.0*mm" alp2="0*deg" bl2="1.2607*m -1.0*mm" tl2="1.3143*m -1.0*mm" h2="0.1000*m - 0.00000305385*m -1.0*mm" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB1_w1_m1" dz="0.195*m" alp1="-7.6321701*deg" bl1="0.4154*m" tl1="0.4422*m" h1="0.1000*m" alp2="-7.6321701*deg" bl2="0.4154*m" tl2="0.4422*m" h2="0.1000*m" phi="0*deg" theta="0*deg"/> + <Box name="YB1_w1_m2" dx="0.08*m - 0.000026056*m - 1.0*mm" dy="0.1000*m" dz="0.195*m"/> + <Box name="YB1_w1_m3" dx="0.2700*m" dy="0.1000*m - 0.00000284419*m" dz="0.195*m"/> + <Box name="YB1_w1_m4" dx="0.08*m - 0.000284419*m" dy="0.1000*m - 0.00000284419*m" dz="0.195*m"/> + <Trapezoid name="YB1_w1_m5" dz="0.195*m" alp1="7.6321701*deg" bl1="0.4154*m" tl1="0.4422*m - 0.000000896967*m" h1="0.1000*m" alp2="7.6321701*deg" bl2="0.4154*m" tl2="0.4422*m - 0.000000896967*m" h2="0.1000*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB1_w1_m6" dz="1.0729*m" alp1="0*deg" bl1="1.2607*m -1.0*mm" tl1="1.3143*m -1.0*mm" h1="0.1000*m - 0.00000282824*m" alp2="0*deg" bl2="1.2607*m -1.0*mm" tl2="1.3143*m - 1.0*mm" h2="0.1000*m - 0.00000282824*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB1_w2_m1" dz="1.2679*m -1.0*mm" alp1="0*deg" bl1="1.2607*m -1.0*mm" tl1="1.3143*m -1.0*mm" h1="0.1000*m -1.0*mm" alp2="0*deg" bl2="1.2607*m -1.0*mm" tl2="1.3143*m -1.0*mm" h2="0.1000*m -1.0*mm" phi="0*deg" theta="0*deg"/> + <Box name="YBSepar2_w0" dx="0.0369*m" dy="0.2225*m - 0.000000120219*m" dz="0.63405*m - 0.001*m"/> + <Box name="YBSepar2_w1" dx="0.0369*m" dy="0.2225*m - 0.000000820541*m - 0.00000738487*m" dz="1.2679*m"/> + <Box name="YBSepar2_w2" dx="0.0369*m" dy="0.2225*m - 0.000000120219*m" dz="1.2679*m"/> + <Trapezoid name="YB2_w0_b1" dz="0.63395*m" alp1="-7.63074*deg" bl1="0.185862*m" tl1="0.19725*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.185862*m" tl2="0.19725*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB2_w0_b2" dx="1.09675*m - 0.00000362891*m" dy="0.0425*m" dz="0.62495*m"/> + <Trapezoid name="YB2_w0_b3" dz="0.63395*m" alp1="7.63074*deg" bl1="0.150916*m" tl1="0.162304*m" h1="0.0425*m - 0.00000277556*m" alp2="7.63074*deg" bl2="0.150916*m" tl2="0.162304*m" h2="0.0425*m - 0.00000277556*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w1_b1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.185862*m" tl1="0.19725*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.185862*m" tl2="0.19725*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB2_w1_b2" dx="0.31595*m - 0.00000413552*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB2_w1_b3" dx="0.08*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB2_w1_b4" dx="0.2700*m - 0.003*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB2_w1_b5" dx="0.08*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB2_w1_b6" dx="0.3509*m - 0.0000023802*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB2_w1_b7" dx="1.09675*m - 0.00000362891*m" dy="0.0425*m" dz="1.0639*m"/> + <Trapezoid name="YB2_w1_b8" dz="1.2679*m" alp1="7.63074*deg" bl1="0.150916*m" tl1="0.162304*m" h1="0.0425*m" alp2="7.63074*deg" bl2="0.150916*m" tl2="0.162304*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w2_b1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.185862*m" tl1="0.19725*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.185862*m" tl2="0.19725*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB2_w2_b2" dx="1.09675*m - 0.00000362891*m" dy="0.0425*m" dz="1.2500*m"/> + <Trapezoid name="YB2_w2_b3" dz="1.2679*m" alp1="7.63074*deg" bl1="0.150916*m" tl1="0.162304*m" h1="0.0425*m - 0.00000277556*m" alp2="7.63074*deg" bl2="0.150916*m" tl2="0.162304*m" h2="0.0425*m - 0.00000277556*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w0_m" dz="0.63395*m -0.1*mm" alp1="0*deg" bl1="1.4563*m -0.1*mm" tl1="1.5769*m -0.1*mm" h1="0.2250*m -0.1*mm" alp2="0*deg" bl2="1.4563*m -0.1*mm" tl2="1.5769*m -0.1*mm" h2="0.2250*m -0.1*mm" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w1_m1" dz="0.195*m -0.1*mm" alp1="-7.6321701*deg" bl1="0.5132*m -0.1*mm" tl1="0.5735*m -0.1*mm" h1="0.2250*m -0.1*mm" alp2="-7.6321701*deg" bl2="0.5132*m -0.1*mm" tl2="0.5735*m -0.1*mm" h2="0.2250*m -0.1*mm" phi="0*deg" theta="0*deg"/> + <Box name="YB2_w1_m2" dx="0.08*m - 0.00000128175*m" dy="0.2250*m - 0.0000100001*m - 0.000000878882*m" dz="0.195*m"/> + <Box name="YB2_w1_m3" dx="0.2700*m - 0.0010879*m" dy="0.2250*m - 0.00000500004*m" dz="0.195*m"/> + <Box name="YB2_w1_m4" dx="0.08*m - 0.00000500004*m" dy="0.2250*m - 0.00000500004*m" dz="0.195*m"/> + <Trapezoid name="YB2_w1_m5" dz="0.195*m -0.1*mm" alp1="7.6321701*deg" bl1="0.5132*m -0.1*mm" tl1="0.5735*m -0.1*mm" h1="0.2250*m -0.1*mm" alp2="7.6321701*deg" bl2="0.5132*m -0.1*mm" tl2="0.5735*m -0.1*mm" h2="0.2250*m -0.1*mm" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w1_m6" dz="1.0729*m -0.1*mm" alp1="0*deg" bl1="1.4563*m -0.1*mm" tl1="1.5769*m -0.1*mm" h1="0.2250*m - 0.00000899323*m -0.1*mm" alp2="0*deg" bl2="1.4563*m -0.1*mm" tl2="1.5769*m -0.1*mm" h2="0.2250*m - 0.00000899323*m -0.1*mm" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w2_m1" dz="1.2679*m - 1.0*mm" alp1="0*deg" bl1="1.4563*m - 1.0*mm" tl1="1.5769*m - 1.0*mm" h1="0.2250*m - 1.0*mm" alp2="0*deg" bl2="1.4563*m - 1.0*mm" tl2="1.5769*m - 1.0*mm" h2="0.2250*m - 1.0*mm" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w0_t1" dz="0.63395*m" alp1="-7.63074*deg" bl1="0.170592*m" tl1="0.18198*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.170592*m" tl2="0.18198*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB2_w0_t2" dx="1.1837*m" dy="0.0425*m" dz="0.62495*m"/> + <Trapezoid name="YB2_w0_t3" dz="0.63395*m" alp1="7.63074*deg" bl1="0.222589*m - 0.000230615*m" tl1="0.233977*m - 0.000230615*m" h1="0.0425*m" alp2="7.63074*deg" bl2="0.222589*m - 0.000230615*m" tl2="0.233977*m - 0.000230615*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w1_t1" dz="1.2679*m-0.00022993*m" alp1="-7.63074*deg" bl1="0.170592*m -0.00022993*m" tl1="0.18198*m-0.00022993*m" h1="0.0425*m - 0.00000120486*m - 0.00000992626*m" alp2="-7.63074*deg" bl2="0.170592*m-0.00022993*m" tl2="0.18198*m-0.00022993*m" h2="0.0425*m - 0.00000120486*m - 0.00000992626*m" phi="0*deg" theta="0*deg"/> + <Box name="YB2_w1_t2" dx="0.4029*m - 0.0000014786*m - 0.00000132987*m" dy="0.0425*m - 0.00000139205*m" dz="0.186*m"/> + <Box name="YB2_w1_t3" dx="0.08*m" dy="0.0425*m - 0.00000302717*m" dz="0.186*m"/> + <Box name="YB2_w1_t4" dx="0.2700*m - 0.000500004*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB2_w1_t5" dx="0.08*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB2_w1_t6" dx="0.3509*m" dy="0.0425*m - 0.00000813113*m" dz="0.186*m"/> + <Box name="YB2_w1_t7" dx="1.1837*m - 0.000000724682*m" dy="0.0425*m" dz="1.0639*m"/> + <Trapezoid name="YB2_w1_t8" dz="1.2679*m" alp1="7.63074*deg" bl1="0.222589*m" tl1="0.233977*m" h1="0.0425*m - 0.000000437559*m - 0.00000797313*m" alp2="7.63074*deg" bl2="0.222589*m" tl2="0.233977*m" h2="0.0425*m - 0.000000437559*m - 0.00000797313*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB2_w2_t1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.170592*m" tl1="0.18198*m" h1="0.0425*m - 0.00000230615*m" alp2="-7.63074*deg" bl2="0.170592*m" tl2="0.18198*m" h2="0.0425*m - 0.00000230615*m" phi="0*deg" theta="0*deg"/> + <Box name="YB2_w2_t2" dx="1.1837*m" dy="0.0425*m" dz="1.2500*m"/> + <Trapezoid name="YB2_w2_t3" dz="1.2679*m" alp1="7.63074*deg" bl1="0.170592*m" tl1="0.18198*m" h1="0.0425*m" alp2="7.63074*deg" bl2="0.170592*m" tl2="0.18198*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YBSepar3_w0" dx="0.0494*m" dy="0.2025*m - 0.00000352829*m" dz="0.63395*m"/> + <Box name="YBSepar3_w1" dx="0.0494*m" dy="0.2025*m - 0.00000352829*m" dz="1.2679*m"/> + <Box name="YBSepar3_w2" dx="0.0494*m" dy="0.2025*m - 0.00000352829*m" dz="1.2679*m"/> + <Trapezoid name="YB3_w0_b1" dz="0.63395*m" alp1="-7.63074*deg" bl1="0.169235*m - 0.000680958*m" tl1="0.180623*m - 0.000680958*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.169235*m - 0.000680958*m" tl2="0.180623*m - 0.000680958*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB3_w0_b2" dx="1.34475*m" dy="0.0425*m" dz="0.62495*m"/> + <Trapezoid name="YB3_w0_b3" dz="0.63395*m" alp1="7.63074*deg" bl1="0.194191*m" tl1="0.205578*m" h1="0.0425*m - 0.00000876162*m" alp2="7.63074*deg" bl2="0.194191*m" tl2="0.205578*m" h2="0.0425*m - 0.00000876162*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w1_b1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.169235*m - 0.00000630826*m" tl1="0.180623*m - 0.00000630826*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.169235*m - 0.00000630826*m" tl2="0.180623*m - 0.00000630826*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB3_w1_b2" dx="0.4700*m - 0.0000807408*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB3_w1_b3" dx="0.08*m - 0.000163912*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB3_w1_b4" dx="0.2700*m" dy="0.0425*m - 0.00000146301*m" dz="0.186*m"/> + <Box name="YB3_w1_b5" dx="0.08*m - 0.000292602*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB3_w1_b6" dx="0.44495*m - 0.00000111774*m - 0.000000195269*m" dy="0.0425*m - 0.00000519394*m" dz="0.186*m"/> + <Box name="YB3_w1_b7" dx="1.34475*m" dy="0.0425*m - 0.00000147966*m" dz="1.0639*m"/> + <Trapezoid name="YB3_w1_b8" dz="1.2679*m" alp1="7.63074*deg" bl1="0.194191*m - 0.00000630826*m" tl1="0.205578*m - 0.00000630826*m" h1="0.0425*m - 0.00000387392*m" alp2="7.63074*deg" bl2="0.194191*m - 0.00000630826*m" tl2="0.205578*m - 0.00000630826*m" h2="0.0425*m - 0.00000387392*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w2_b1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.169237*m" tl1="0.180625*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.169237*m" tl2="0.180625*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB3_w2_b2" dx="1.34468*m - 0.00000121798*m" dy="0.0425*m - 0.00000121798*m" dz="1.2500*m"/> + <Trapezoid name="YB3_w2_b3" dz="1.2679*m" alp1="7.63074*deg" bl1="0.169237*m" tl1="0.180625*m" h1="0.0425*m" alp2="7.63074*deg" bl2="0.169237*m" tl2="0.180625*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w0_m" dz="0.63395*m" alp1="0*deg" bl1="1.731*m - 0.00239102*m" tl1="1.8515*m - 0.00239102*m" h1="0.2250*m - 0.00000147966*m" alp2="0*deg" bl2="1.731*m - 0.00239102*m" tl2="1.8515*m - 0.00239102*m" h2="0.2250*m - 0.00000147966*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w1_m1" dz="0.195*m -0.1*mm" alp1="-7.6259161*deg" bl1="0.65055*m -0.1*mm" tl1="0.7108*m -0.1*mm" h1="0.2250*m - 0.0000261358*m -0.1*mm" alp2="-7.6259161*deg" bl2="0.65055*m -0.1*mm" tl2="0.7108*m -0.1*mm" h2="0.2250*m - 0.0000261358*m -0.1*mm" phi="0*deg" theta="0*deg"/> + <Box name="YB3_w1_m2" dx="0.08*m - 0.00000143878*m - 1.0*mm" dy="0.2250*m" dz="0.195*m"/> + <Box name="YB3_w1_m3" dx="0.2700*m" dy="0.2250*m - 0.000000878882*m - 1.0*mm" dz="0.195*m"/> + <Box name="YB3_w1_m4" dx="0.08*m - 0.000175776*m" dy="0.2250*m" dz="0.195*m"/> + <Trapezoid name="YB3_w1_m5" dz="0.195*m - 0.1*mm" alp1="7.6259161*deg" bl1="0.65055*m -0.1*mm" tl1="0.7108*m -0.1*mm" h1="0.2250*m -0.1*mm" alp2="7.6259161*deg" bl2="0.65055*m -0.1*mm" tl2="0.7108*m -0.1*mm" h2="0.2250*m -0.1*mm" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w1_m6" dz="1.0729*m - 0.00005*m" alp1="0*deg" bl1="1.731*m - 0.00005*m" tl1="1.8515*m - 0.00005*m" h1="0.2250*m - 0.00005*m" alp2="0*deg" bl2="1.731*m - 0.00005*m" tl2="1.8515*m - 0.00005*m" h2="0.2250*m - 0.00005*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w2_m1" dz="1.2679*m - 0.00005*m" alp1="0*deg" bl1="1.731*m - 0.00005*m" tl1="1.8515*m - 0.00005*m" h1="0.2250*m - 0.00005*m" alp2="0*deg" bl2="1.731*m - 0.00005*m" tl2="1.8515*m - 0.00005*m" h2="0.2250*m - 0.00005*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w0_t1" dz="0.63395*m" alp1="-7.63074*deg" bl1="0.245512*m - 0.000167856*m" tl1="0.2569*m - 0.000167856*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.245512*m - 0.000167856*m" tl2="0.2569*m - 0.000167856*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB3_w0_t2" dx="1.43693*m - 0.00000210212*m" dy="0.0425*m" dz="0.62495*m"/> + <Trapezoid name="YB3_w0_t3" dz="0.63395*m" alp1="7.63074*deg" bl1="0.169087*m" tl1="0.180475*m" h1="0.0425*m" alp2="7.63074*deg" bl2="0.169087*m" tl2="0.180475*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w1_t1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.245514*m" tl1="0.256901*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.245514*m" tl2="0.256901*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB3_w1_t2" dx="0.4653*m - 0.0000119433*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB3_w1_t3" dx="0.08*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB3_w1_t4" dx="0.2700*m - 0.0001749356*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB3_w1_t5" dx="0.08*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB3_w1_t6" dx="0.5418*m - 0.000009*m" dy="0.0425*m" dz="0.186*m"/> + <Box name="YB3_w1_t7" dx="1.437*m - 0.00000247035*m - 0.000000480318*m" dy="0.0425*m - 0.00000136796*m" dz="1.0639*m"/> + <Trapezoid name="YB3_w1_t8" dz="1.2679*m" alp1="7.63074*deg" bl1="0.169015*m" tl1="0.180403*m" h1="0.0425*m - 0.00000368825*m" alp2="7.63074*deg" bl2="0.169015*m" tl2="0.180403*m" h2="0.0425*m - 0.00000368825*m" phi="0*deg" theta="0*deg"/> + <Trapezoid name="YB3_w2_t1" dz="1.2679*m" alp1="-7.63074*deg" bl1="0.245514*m" tl1="0.256901*m" h1="0.0425*m" alp2="-7.63074*deg" bl2="0.245514*m" tl2="0.256901*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="YB3_w2_t2" dx="1.437*m - 0.00000246843*m" dy="0.0425*m - 0.000000842895*m" dz="1.2500*m"/> + <Trapezoid name="YB3_w2_t3" dz="1.2679*m" alp1="7.63074*deg" bl1="0.169015*m" tl1="0.180403*m" h1="0.0425*m" alp2="7.63074*deg" bl2="0.169015*m" tl2="0.180403*m" h2="0.0425*m" phi="0*deg" theta="0*deg"/> + <Box name="CHIMHOLE_IRON_P" dx="0.27*m" dy="0.63/2*m" dz="0.1861*m"/> + <Box name="CHIMHOLE_IRON_N" dx="0.42*m" dy="0.63/2*m" dz="0.1861*m"/> + <SubtractionSolid name="YB1Chim_w1N_b3"> + <rSolid name="YB1_w1_b3"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB1Chim_w1N_b5"> + <rSolid name="YB1_w1_b5"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="-0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB1Chim_w1N_m3"> + <rSolid name="YB1_w1_m3"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*m" y="0.*fm" z="9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB1Chim_w1N_m2"> + <rSolid name="YB1_w1_m2"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.35*m" y="0.*fm" z="9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB1Chim_w1N_m4"> + <rSolid name="YB1_w1_m4"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="-0.35*m" y="0.*fm" z="9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB2Chim_w1N_b3"> + <rSolid name="YB2_w1_b3"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB2Chim_w1N_b5"> + <rSolid name="YB2_w1_b5"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="-0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB2Chim_w1N_m3"> + <rSolid name="YB2_w1_m3"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*m" y="0.*fm" z="9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB2Chim_w1N_m2"> + <rSolid name="YB2_w1_m2"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.35*m" y="0.*fm" z="9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB2Chim_w1N_m4"> + <rSolid name="YB2_w1_m4"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="-0.35*m" y="0.*fm" z="9*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB2Chim_w1N_t3"> + <rSolid name="YB2_w1_t3"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB2Chim_w1N_t5"> + <rSolid name="YB2_w1_t5"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="-0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB3Chim_w1N_b3"> + <rSolid name="YB3_w1_b3"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB3Chim_w1N_b5"> + <rSolid name="YB3_w1_b5"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="-0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB3Chim_w1N_m3"> + <rSolid name="YB3_w1_m3"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*m" y="0.*fm" z="9.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB3Chim_w1N_m2"> + <rSolid name="YB3_w1_m2"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.35*m" y="0.*fm" z="9.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB3Chim_w1N_m4"> + <rSolid name="YB3_w1_m4"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="-0.35*m" y="0.*fm" z="9.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB3Chim_w1N_t3"> + <rSolid name="YB3_w1_t3"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB3Chim_w1N_t5"> + <rSolid name="YB3_w1_b5"/> + <rSolid name="CHIMHOLE_IRON_N"/> + <rRotation name="rotations:000D"/> + <Translation x="-0.35*m" y="0.*fm" z="0.*fm"/> + </SubtractionSolid> + <SubtractionSolid name="YB1Chim_w1P_m3"> + <rSolid name="YB1_w1_m3"/> + <rSolid name="CHIMHOLE_IRON_P"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*m" y="0.*fm" z="-9.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB2Chim_w1P_m3"> + <rSolid name="YB2_w1_m3"/> + <rSolid name="CHIMHOLE_IRON_P"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*m" y="0.*fm" z="-9.*mm"/> + </SubtractionSolid> + <SubtractionSolid name="YB3Chim_w1P_m3"> + <rSolid name="YB3_w1_m3"/> + <rSolid name="CHIMHOLE_IRON_P"/> + <rRotation name="rotations:000D"/> + <Translation x="0.*m" y="0.*fm" z="-9.*mm"/> + </SubtractionSolid> + <!--- #### Non iron volumes --> + <Box name="YBSepar_1" dx="3.75*cm" dy="43.4669*cm" dz="1.268*m"/> + </SolidSection> + <LogicalPartSection label="muonYoke.xml"> + <LogicalPart name="YN12p_a" category="unspecified"> + <rSolid name="YN12_a"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YN12p_b" category="unspecified"> + <rSolid name="YN12_b"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YN12p_c" category="unspecified"> + <rSolid name="YN12_c"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE1p_a" category="unspecified"> + <rSolid name="YE1_a"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE1p_b" category="unspecified"> + <rSolid name="YE1_b"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE12" category="unspecified"> + <rSolid name="YE12"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE2p_a" category="unspecified"> + <rSolid name="YE2_a"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE2p_b" category="unspecified"> + <rSolid name="YE2_b"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE23" category="unspecified"> + <rSolid name="YE23"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE3p_a" category="unspecified"> + <rSolid name="YE3_a"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE3p_b" category="unspecified"> + <rSolid name="YE3_b"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE34" category="unspecified"> + <rSolid name="YE34"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="ShieldingME4" category="unspecified"> + <rSolid name="ShieldingME4"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE4" category="unspecified"> + <rSolid name="YE4"/> + <rMaterial name="materials:AISI-1018-Steel"/> + </LogicalPart> + <LogicalPart name="YE4_in" category="unspecified"> + <rSolid name="YE4_in"/> + <rMaterial name="materials:Heavy Boron concrete"/> + </LogicalPart> + <LogicalPart name="YB1_w0_b1" category="unspecified"> + <rSolid name="YB1_w0_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w0_b4" category="unspecified"> + <rSolid name="YB1_w0_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w0_b2" category="unspecified"> + <rSolid name="YB1_w0_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w0_b5" category="unspecified"> + <rSolid name="YB1_w0_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w0_b3" category="unspecified"> + <rSolid name="YB1_w0_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_b1" category="unspecified"> + <rSolid name="YB1_w1_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_b1" category="unspecified"> + <rSolid name="YB1_w1_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_b2" category="unspecified"> + <rSolid name="YB1_w1_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_b2" category="unspecified"> + <rSolid name="YB1_w1_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_b3" category="unspecified"> + <rSolid name="YB1_w1_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_b3" category="unspecified"> + <rSolid name="YB1_w1_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_b4" category="unspecified"> + <rSolid name="YB1_w1_b4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_b4" category="unspecified"> + <rSolid name="YB1_w1_b4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_b5" category="unspecified"> + <rSolid name="YB1_w1_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_b5" category="unspecified"> + <rSolid name="YB1_w1_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_b6" category="unspecified"> + <rSolid name="YB1_w1_b6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_b6" category="unspecified"> + <rSolid name="YB1_w1_b6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_b7" category="unspecified"> + <rSolid name="YB1_w1_b7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_b7" category="unspecified"> + <rSolid name="YB1_w1_b7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_b8" category="unspecified"> + <rSolid name="YB1_w1_b8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_b8" category="unspecified"> + <rSolid name="YB1_w1_b8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w2P_b1" category="unspecified"> + <rSolid name="YB1_w2_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w2N_b1" category="unspecified"> + <rSolid name="YB1_w2_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w2P_b2" category="unspecified"> + <rSolid name="YB1_w2_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w2N_b2" category="unspecified"> + <rSolid name="YB1_w2_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w2P_b3" category="unspecified"> + <rSolid name="YB1_w2_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w2N_b3" category="unspecified"> + <rSolid name="YB1_w2_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w0_m1" category="unspecified"> + <rSolid name="YB1_w0_m"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w0_m2" category="unspecified"> + <rSolid name="YB1_w0_m"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_m1" category="unspecified"> + <rSolid name="YB1_w1_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_m1" category="unspecified"> + <rSolid name="YB1_w1_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_m2" category="unspecified"> + <rSolid name="YB1_w1_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_m2" category="unspecified"> + <rSolid name="YB1_w1_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_m3" category="unspecified"> + <rSolid name="YB1_w1_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_m3" category="unspecified"> + <rSolid name="YB1_w1_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_m4" category="unspecified"> + <rSolid name="YB1_w1_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_m4" category="unspecified"> + <rSolid name="YB1_w1_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_m5" category="unspecified"> + <rSolid name="YB1_w1_m5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_m5" category="unspecified"> + <rSolid name="YB1_w1_m5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1P_m6" category="unspecified"> + <rSolid name="YB1_w1_m6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w1N_m6" category="unspecified"> + <rSolid name="YB1_w1_m6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w2P_m1" category="unspecified"> + <rSolid name="YB1_w2_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1_w2N_m1" category="unspecified"> + <rSolid name="YB1_w2_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar2_w0_1" category="unspecified"> + <rSolid name="YBSepar2_w0"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar2_w0_2" category="unspecified"> + <rSolid name="YBSepar2_w0"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar2_w1P" category="unspecified"> + <rSolid name="YBSepar2_w1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar2_w1N" category="unspecified"> + <rSolid name="YBSepar2_w1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar2_w2P" category="unspecified"> + <rSolid name="YBSepar2_w2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar2_w2N" category="unspecified"> + <rSolid name="YBSepar2_w2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_b1" category="unspecified"> + <rSolid name="YB2_w0_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_b4" category="unspecified"> + <rSolid name="YB2_w0_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_b2" category="unspecified"> + <rSolid name="YB2_w0_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_b5" category="unspecified"> + <rSolid name="YB2_w0_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_b3" category="unspecified"> + <rSolid name="YB2_w0_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_b6" category="unspecified"> + <rSolid name="YB2_w0_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_b1" category="unspecified"> + <rSolid name="YB2_w1_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_b1" category="unspecified"> + <rSolid name="YB2_w1_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_b2" category="unspecified"> + <rSolid name="YB2_w1_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_b2" category="unspecified"> + <rSolid name="YB2_w1_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_b3" category="unspecified"> + <rSolid name="YB2_w1_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_b3" category="unspecified"> + <rSolid name="YB2_w1_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_b4" category="unspecified"> + <rSolid name="YB2_w1_b4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_b4" category="unspecified"> + <rSolid name="YB2_w1_b4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_b5" category="unspecified"> + <rSolid name="YB2_w1_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_b5" category="unspecified"> + <rSolid name="YB2_w1_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_b6" category="unspecified"> + <rSolid name="YB2_w1_b6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_b6" category="unspecified"> + <rSolid name="YB2_w1_b6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_b7" category="unspecified"> + <rSolid name="YB2_w1_b7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_b7" category="unspecified"> + <rSolid name="YB2_w1_b7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_b8" category="unspecified"> + <rSolid name="YB2_w1_b8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_b8" category="unspecified"> + <rSolid name="YB2_w1_b8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2P_b1" category="unspecified"> + <rSolid name="YB2_w2_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2N_b1" category="unspecified"> + <rSolid name="YB2_w2_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2P_b2" category="unspecified"> + <rSolid name="YB2_w2_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2N_b2" category="unspecified"> + <rSolid name="YB2_w2_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2P_b3" category="unspecified"> + <rSolid name="YB2_w2_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2N_b3" category="unspecified"> + <rSolid name="YB2_w2_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_m1" category="unspecified"> + <rSolid name="YB2_w0_m"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_m2" category="unspecified"> + <rSolid name="YB2_w0_m"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_m1" category="unspecified"> + <rSolid name="YB2_w1_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_m1" category="unspecified"> + <rSolid name="YB2_w1_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_m2" category="unspecified"> + <rSolid name="YB2_w1_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_m2" category="unspecified"> + <rSolid name="YB2_w1_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_m3" category="unspecified"> + <rSolid name="YB2_w1_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_m3" category="unspecified"> + <rSolid name="YB2_w1_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_m4" category="unspecified"> + <rSolid name="YB2_w1_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_m4" category="unspecified"> + <rSolid name="YB2_w1_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_m5" category="unspecified"> + <rSolid name="YB2_w1_m5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_m5" category="unspecified"> + <rSolid name="YB2_w1_m5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_m6" category="unspecified"> + <rSolid name="YB2_w1_m6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_m6" category="unspecified"> + <rSolid name="YB2_w1_m6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2P_m1" category="unspecified"> + <rSolid name="YB2_w2_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2N_m1" category="unspecified"> + <rSolid name="YB2_w2_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_t1" category="unspecified"> + <rSolid name="YB2_w0_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_t4" category="unspecified"> + <rSolid name="YB2_w0_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_t2" category="unspecified"> + <rSolid name="YB2_w0_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_t5" category="unspecified"> + <rSolid name="YB2_w0_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_t3" category="unspecified"> + <rSolid name="YB2_w0_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w0_t6" category="unspecified"> + <rSolid name="YB2_w0_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_t1" category="unspecified"> + <rSolid name="YB2_w1_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_t1" category="unspecified"> + <rSolid name="YB2_w1_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_t2" category="unspecified"> + <rSolid name="YB2_w1_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_t2" category="unspecified"> + <rSolid name="YB2_w1_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_t3" category="unspecified"> + <rSolid name="YB2_w1_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_t3" category="unspecified"> + <rSolid name="YB2_w1_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_t4" category="unspecified"> + <rSolid name="YB2_w1_t4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_t4" category="unspecified"> + <rSolid name="YB2_w1_t4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_t5" category="unspecified"> + <rSolid name="YB2_w1_t5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_t5" category="unspecified"> + <rSolid name="YB2_w1_t5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_t6" category="unspecified"> + <rSolid name="YB2_w1_t6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_t6" category="unspecified"> + <rSolid name="YB2_w1_t6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_t7" category="unspecified"> + <rSolid name="YB2_w1_t7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_t7" category="unspecified"> + <rSolid name="YB2_w1_t7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1P_t8" category="unspecified"> + <rSolid name="YB2_w1_t8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w1N_t8" category="unspecified"> + <rSolid name="YB2_w1_t8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2P_t1" category="unspecified"> + <rSolid name="YB2_w2_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2N_t1" category="unspecified"> + <rSolid name="YB2_w2_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2P_t2" category="unspecified"> + <rSolid name="YB2_w2_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2N_t2" category="unspecified"> + <rSolid name="YB2_w2_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2P_t3" category="unspecified"> + <rSolid name="YB2_w2_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2_w2N_t3" category="unspecified"> + <rSolid name="YB2_w2_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar3_w0_1" category="unspecified"> + <rSolid name="YBSepar3_w0"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar3_w0_2" category="unspecified"> + <rSolid name="YBSepar3_w0"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar3_w1P" category="unspecified"> + <rSolid name="YBSepar3_w1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar3_w1N" category="unspecified"> + <rSolid name="YBSepar3_w1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar3_w2P" category="unspecified"> + <rSolid name="YBSepar3_w2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YBSepar3_w2N" category="unspecified"> + <rSolid name="YBSepar3_w2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_b1" category="unspecified"> + <rSolid name="YB3_w0_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_b4" category="unspecified"> + <rSolid name="YB3_w0_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_b2" category="unspecified"> + <rSolid name="YB3_w0_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_b5" category="unspecified"> + <rSolid name="YB3_w0_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_b3" category="unspecified"> + <rSolid name="YB3_w0_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_b6" category="unspecified"> + <rSolid name="YB3_w0_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_b1" category="unspecified"> + <rSolid name="YB3_w1_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_b1" category="unspecified"> + <rSolid name="YB3_w1_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_b2" category="unspecified"> + <rSolid name="YB3_w1_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_b2" category="unspecified"> + <rSolid name="YB3_w1_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_b3" category="unspecified"> + <rSolid name="YB3_w1_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_b3" category="unspecified"> + <rSolid name="YB3_w1_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_b4" category="unspecified"> + <rSolid name="YB3_w1_b4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_b4" category="unspecified"> + <rSolid name="YB3_w1_b4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_b5" category="unspecified"> + <rSolid name="YB3_w1_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_b5" category="unspecified"> + <rSolid name="YB3_w1_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_b6" category="unspecified"> + <rSolid name="YB3_w1_b6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_b6" category="unspecified"> + <rSolid name="YB3_w1_b6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_b7" category="unspecified"> + <rSolid name="YB3_w1_b7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_b7" category="unspecified"> + <rSolid name="YB3_w1_b7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_b8" category="unspecified"> + <rSolid name="YB3_w1_b8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_b8" category="unspecified"> + <rSolid name="YB3_w1_b8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2P_b1" category="unspecified"> + <rSolid name="YB3_w2_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2N_b1" category="unspecified"> + <rSolid name="YB3_w2_b1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2P_b2" category="unspecified"> + <rSolid name="YB3_w2_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2N_b2" category="unspecified"> + <rSolid name="YB3_w2_b2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2P_b3" category="unspecified"> + <rSolid name="YB3_w2_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2N_b3" category="unspecified"> + <rSolid name="YB3_w2_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_m1" category="unspecified"> + <rSolid name="YB3_w0_m"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_m2" category="unspecified"> + <rSolid name="YB3_w0_m"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_m1" category="unspecified"> + <rSolid name="YB3_w1_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_m1" category="unspecified"> + <rSolid name="YB3_w1_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_m2" category="unspecified"> + <rSolid name="YB3_w1_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_m2" category="unspecified"> + <rSolid name="YB3_w1_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_m3" category="unspecified"> + <rSolid name="YB3_w1_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_m3" category="unspecified"> + <rSolid name="YB3_w1_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_m4" category="unspecified"> + <rSolid name="YB3_w1_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_m4" category="unspecified"> + <rSolid name="YB3_w1_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_m5" category="unspecified"> + <rSolid name="YB3_w1_m5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_m5" category="unspecified"> + <rSolid name="YB3_w1_m5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_m6" category="unspecified"> + <rSolid name="YB3_w1_m6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_m6" category="unspecified"> + <rSolid name="YB3_w1_m6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2P_m1" category="unspecified"> + <rSolid name="YB3_w2_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2N_m1" category="unspecified"> + <rSolid name="YB3_w2_m1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_t1" category="unspecified"> + <rSolid name="YB3_w0_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_t4" category="unspecified"> + <rSolid name="YB3_w0_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_t2" category="unspecified"> + <rSolid name="YB3_w0_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_t5" category="unspecified"> + <rSolid name="YB3_w0_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_t3" category="unspecified"> + <rSolid name="YB3_w0_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w0_t6" category="unspecified"> + <rSolid name="YB3_w0_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_t1" category="unspecified"> + <rSolid name="YB3_w1_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_t1" category="unspecified"> + <rSolid name="YB3_w1_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_t2" category="unspecified"> + <rSolid name="YB3_w1_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_t2" category="unspecified"> + <rSolid name="YB3_w1_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_t3" category="unspecified"> + <rSolid name="YB3_w1_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_t3" category="unspecified"> + <rSolid name="YB3_w1_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_t4" category="unspecified"> + <rSolid name="YB3_w1_t4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_t4" category="unspecified"> + <rSolid name="YB3_w1_t4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_t5" category="unspecified"> + <rSolid name="YB3_w1_t5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_t5" category="unspecified"> + <rSolid name="YB3_w1_t5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_t6" category="unspecified"> + <rSolid name="YB3_w1_t6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_t6" category="unspecified"> + <rSolid name="YB3_w1_t6"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_t7" category="unspecified"> + <rSolid name="YB3_w1_t7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_t7" category="unspecified"> + <rSolid name="YB3_w1_t7"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1P_t8" category="unspecified"> + <rSolid name="YB3_w1_t8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w1N_t8" category="unspecified"> + <rSolid name="YB3_w1_t8"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2P_t1" category="unspecified"> + <rSolid name="YB3_w2_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2N_t1" category="unspecified"> + <rSolid name="YB3_w2_t1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2P_t2" category="unspecified"> + <rSolid name="YB3_w2_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2N_t2" category="unspecified"> + <rSolid name="YB3_w2_t2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2P_t3" category="unspecified"> + <rSolid name="YB3_w2_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3_w2N_t3" category="unspecified"> + <rSolid name="YB3_w2_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="CHIMHOLE_IRON_P" category="unspecified"> + <rSolid name="CHIMHOLE_IRON_P"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="CHIMHOLE_IRON_N" category="unspecified"> + <rSolid name="CHIMHOLE_IRON_N"/> + <rMaterial name="materials:Air"/> + </LogicalPart> + <LogicalPart name="YB1Chim_w1N_b3" category="unspecified"> + <rSolid name="YB1Chim_w1N_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1Chim_w1N_b5" category="unspecified"> + <rSolid name="YB1Chim_w1N_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1Chim_w1N_m3" category="unspecified"> + <rSolid name="YB1Chim_w1N_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1Chim_w1N_m2" category="unspecified"> + <rSolid name="YB1Chim_w1N_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1Chim_w1N_m4" category="unspecified"> + <rSolid name="YB1Chim_w1N_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2Chim_w1N_b3" category="unspecified"> + <rSolid name="YB2Chim_w1N_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2Chim_w1N_b5" category="unspecified"> + <rSolid name="YB2Chim_w1N_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2Chim_w1N_m3" category="unspecified"> + <rSolid name="YB2Chim_w1N_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2Chim_w1N_m2" category="unspecified"> + <rSolid name="YB2Chim_w1N_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2Chim_w1N_m4" category="unspecified"> + <rSolid name="YB2Chim_w1N_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2Chim_w1N_t3" category="unspecified"> + <rSolid name="YB2Chim_w1N_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2Chim_w1N_t5" category="unspecified"> + <rSolid name="YB2Chim_w1N_t5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3Chim_w1N_b3" category="unspecified"> + <rSolid name="YB3Chim_w1N_b3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3Chim_w1N_b5" category="unspecified"> + <rSolid name="YB3Chim_w1N_b5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3Chim_w1N_m3" category="unspecified"> + <rSolid name="YB3Chim_w1N_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3Chim_w1N_m2" category="unspecified"> + <rSolid name="YB3Chim_w1N_m2"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3Chim_w1N_m4" category="unspecified"> + <rSolid name="YB3Chim_w1N_m4"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3Chim_w1N_t3" category="unspecified"> + <rSolid name="YB3Chim_w1N_t3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3Chim_w1N_t5" category="unspecified"> + <rSolid name="YB3Chim_w1N_t5"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB1Chim_w1P_m3" category="unspecified"> + <rSolid name="YB1Chim_w1P_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB2Chim_w1P_m3" category="unspecified"> + <rSolid name="YB2Chim_w1P_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <LogicalPart name="YB3Chim_w1P_m3" category="unspecified"> + <rSolid name="YB3Chim_w1P_m3"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + <!--- #### Non iron volumes --> + <LogicalPart name="YBSepar_1" category="unspecified"> + <rSolid name="YBSepar_1"/> + <rMaterial name="materials:M_Steel-008"/> + </LogicalPart> + </LogicalPartSection> + <PosPartSection label="muonYoke.xml"> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YN12p_a"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 6.5900*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YN12p_b"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 6.885*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YN12p_c"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 7.099*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE1p_a"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 7.62*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE1p_b"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 7.565*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0*deg, 0.*deg, 0*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE12"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 8.2425*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE2p_a"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 8.870*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE2p_b"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 8.82*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0*deg, 0.*deg, 0*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE23"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 9.4975*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE3p_a"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 9.950*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE3p_b"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 9.9*m - 0.495*cm </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0*deg, 0.*deg, 0*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE34"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 10.4075*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="ShieldingME4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 10.7175*m + 0.455*cm </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEP"/> + <String name="ChildName" value="YE4"/> + <Numeric name="StartCopyNo" value="1" /> + <Numeric name="IncrCopyNo" value="1" /> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 10.7425*m + 0.455*cm</Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0*deg, 0.*deg, 0*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonYoke:YE4"/> + <rChild name="YE4_in"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YN12p_a"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 6.5900*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YN12p_b"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 6.885*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YN12p_c"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 7.099*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE1p_a"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 7.62*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE1p_b"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 7.565*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0*deg, 0.*deg, 0*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE12"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 8.2425*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE2p_a"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 8.870*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE2p_b"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 8.82*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0*deg, 0.*deg, 0*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE23"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 9.4975*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE3p_a"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 9.950*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE3p_b"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 9.9*m - 0.495*cm </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0*deg, 0.*deg, 0*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE34"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 10.4075*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="ShieldingME4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 10.7175*m + 0.455*cm </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="mf:MEN"/> + <String name="ChildName" value="YE4"/> + <Numeric name="StartCopyNo" value="1" /> + <Numeric name="IncrCopyNo" value="1" /> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="0*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 10.7425*m + 0.455*cm </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0*deg, 0.*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB1_w0_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.7713*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.77821*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.7713*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB1_w0_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.7713*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.77821*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.7713*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB1_w0_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.8778*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.66055*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.8778*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB1_w0_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.8778*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.66055*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.8778*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB1_w0_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="348.0664*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.76294*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -78.0664*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.7713*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.77821*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.7713*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.7713*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.77821*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.7713*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.9027*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.70468*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.9027*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.9027*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.70468*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.9027*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="4.294*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.67312*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -94.294*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="4.294*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="4.67312*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -94.294*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b3"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="94.294*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="4.67312*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -94.294*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB1Chim_w1N_b3"/> + <rRotation name="rotations:R330"/> + <Translation x="4.67312*m*cos(64.294*deg)" y="4.67312*m*sin(64.294*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="3"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="60*deg"/> + <Numeric name="Radius" value="4.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b4"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="StartAngle" value="120*deg"/> + <Numeric name="RangeAngle" value="210*deg"/> + <Numeric name="Radius" value="4.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="4.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b4"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="90*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="4.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="355.706*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.67312*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -85.706*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="355.706*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="4.67312*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 94.294*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b5"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9 "/> + <Numeric name="StartAngle" value="85.706*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="4.67312*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 94.294*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB1Chim_w1N_b5"/> + <rRotation name="rotations:R330"/> + <Translation x="4.67312*m*cos(55.706*deg)" y="4.67312*m*sin(55.706*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="352.9603*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.6954*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -82.9603*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="352.9603*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.6954*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 97.0397*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.8778*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.66055*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.8778*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.8778*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.66055*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.8778*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_b8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="348.0664*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.76294*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -78.0664*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_b8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="348.0664*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.76294*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -78.0664*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB1_w2P_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.7713*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.77821*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.7713*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB1_w2N_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.7713*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.77821*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.7713*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB1_w2P_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.8778*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.66055*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.8778*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB1_w2N_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.8778*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.66055*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.8778*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB1_w2P_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="348.0664*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.76294*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -78.0664*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB1_w2N_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="348.0664*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.76294*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -78.0664*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB1_w0_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB1_w0_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="10.132*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.88113*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.073*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -100.132*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="10.132*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.88113*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.073*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -100.132*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="4.1649*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.81772*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -94.1649*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="4.1649*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="4.81772*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -94.1649*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m2"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="94.1649*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="4.81772*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -94.1649*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB1Chim_w1N_m2"/> + <rRotation name="rotations:R330"/> + <Translation x="4.81772*m*cos(64.1649*deg)" y="4.81772*m*sin(64.1649*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_m3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="3"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="60*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_m3"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="StartAngle" value="120*deg"/> + <Numeric name="RangeAngle" value="210*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <PosPart copyNumber="4"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="YB1Chim_w1P_m3"/> + <rRotation name="rotations:000D"/> + <Translation x="4.805*m*cos(90.*deg)" y="4.805*m*sin(90.*deg)" z="-1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m3"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="90*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB1Chim_w1N_m3"/> + <rRotation name="rotations:R330"/> + <Translation x="4.805*m*cos(60*deg)" y="4.805*m*sin(60*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_m4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="355.8351*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.81772*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -85.8351*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="355.8351*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="4.81772*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -85.8351*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m4"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="85.8351*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="4.81772*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -85.8351*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB1Chim_w1N_m4"/> + <rRotation name="rotations:R330"/> + <Translation x="4.81772*m*cos(55.8351*deg)" y="4.81772*m*sin(55.8351*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_m5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="349.8677*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.88113*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -79.8677*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="349.8677*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.88113*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -79.8677*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB1_w1P_m6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.195*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB1_w1N_m6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.195*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB1_w2P_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB1_w2N_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="4.805*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YBSepar2_w0_1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.25767*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63405*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YBSepar2_w0_2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.25767*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63405*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YBSepar2_w1P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.25767*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YBSepar2_w1N"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.25767*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YBSepar2_w2P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.25767*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YBSepar2_w2N"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="12.776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.25767*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -102.776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0847*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.5362413*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0847*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0847*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.5362413*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0847*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.6287*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.39261*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.6287*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.6287*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.39261*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.6287*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.5635*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.54426*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.5635*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_b6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.5635*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.54426*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.5635*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0847*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.5362413*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0847*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0847*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.5362413*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0847*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.8748*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.44384*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.8748*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.8748*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.44384*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.8748*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="3.7125*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.40384*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.7125*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="3.7125*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.40384*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.7125*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b3"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="93.7125*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.40384*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.7125*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB2Chim_w1N_b3"/> + <rRotation name="rotations:R330"/> + <Translation x="5.40384*m*cos(63.7125*deg)" y="5.40384*m*sin(63.7125*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="3"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="60*deg"/> + <Numeric name="Radius" value="5.3925*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b4"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="StartAngle" value="120*deg"/> + <Numeric name="RangeAngle" value="210*deg"/> + <Numeric name="Radius" value="5.3925*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.3925*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b4"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="90*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.3925*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="356.2875*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.40384*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.2875*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="356.2875*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.40384*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.2875*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b5"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="86.2875*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.40384*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.2875*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB2Chim_w1N_b5"/> + <rRotation name="rotations:R330"/> + <Translation x="5.40384*m*cos(56.2875*deg)" y="5.40384*m*sin(56.2875*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="351.7612*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.44873*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -81.7612*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="351.7612*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.44873*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -81.7612*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.6287*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.39261*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.6287*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.6287*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.39261*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.6287*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_b8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.5635*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.54426*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.5635*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_b8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.5635*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.54426*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.5635*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB2_w2P_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0847*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.5362413*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0847*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB2_w2N_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0847*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.5362413*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0847*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB2_w2P_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.6287*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.39261*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.6287*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB2_w2N_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.6287*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.39261*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.6287*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB2_w2P_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.5635*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.54426*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.5635*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB2_w2N_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.5635*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.54426*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.5635*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="9.7567*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.74307*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -99.7567*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="9.7567*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.74307*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -99.7567*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="3.5375*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.67081*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.5375*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="3.5375*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.67081*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.5375*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m2"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="93.5375*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.67081*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.5375*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB2Chim_w1N_m2"/> + <rRotation name="rotations:R330"/> + <Translation x="5.67081*m*cos(63.5375*deg)" y="5.67081*m*sin(63.5375*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_m3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="3"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="60*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_m3"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="StartAngle" value="120*deg"/> + <Numeric name="RangeAngle" value="210*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <PosPart copyNumber="4"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="YB2Chim_w1P_m3"/> + <rRotation name="rotations:000D"/> + <Translation x="5.66*m*cos(90.*deg)" y="5.66*m*sin(90.*deg)" z="-1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m3"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="90*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB2Chim_w1N_m3"/> + <rRotation name="rotations:R330"/> + <Translation x="5.66*m*cos(60*deg)" y="5.66*m*sin(60*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_m4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="356.4625*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.67081*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.4625*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="356.4625*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.67081*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.4625*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m4"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="86.4625*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.67081*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.4625*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB2Chim_w1N_m4"/> + <rRotation name="rotations:R330"/> + <Translation x="5.67081*m*cos(56.4625*deg)" y="5.67081*m*sin(56.4625*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_m5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="350.2433*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.74307*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -80.2433*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="350.2433*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.74307*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -80.2433*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_m6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.195*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_m6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.195*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB2_w2P_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB2_w2N_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.66*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.3987*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0933547*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.3987*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_t4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.3987*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0933547*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.3987*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.5026*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.92773*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.5026*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_t5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.5026*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.92773*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.5026*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="347.0779*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0815176*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -77.0779*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB2_w0_t6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="347.0779*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0815176*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -77.0779*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.3987*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0933547*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.3987*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.3987*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0933547*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.3987*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.9976*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.98572*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.9976*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.9976*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.98572*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.9976*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="3.3782*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.93782*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.3782*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="3.3782*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.93782*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.3782*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t3"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="93.3782*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.93782*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.3782*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB2Chim_w1N_t3"/> + <rRotation name="rotations:R330"/> + <Translation x="5.93782*m*cos(63.3782*deg)" y="5.93782*m*sin(63.3782*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="3"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="60*deg"/> + <Numeric name="Radius" value="5.9275*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t4"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="StartAngle" value="120*deg"/> + <Numeric name="RangeAngle" value="210*deg"/> + <Numeric name="Radius" value="5.9275*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.9275*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t4"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="90*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.9275*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="356.6218*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.93782*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.6218*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="356.6218*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="5.93782*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.6218*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t5"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="86.6218*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="5.93782*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.6218*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB2Chim_w1N_t5"/> + <rRotation name="rotations:R330"/> + <Translation x="5.93782*m*cos(56.6218*deg)" y="5.93782*m*sin(56.6218*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="352.4959*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.9787*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -82.4959*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="352.4959*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.9787*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -82.4959*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.5026*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.92773*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.5026*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.5026*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.92773*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.5026*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB2_w1P_t8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="347.0779*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0815176*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -77.0779*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB2_w1N_t8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="347.0779*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0815176*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -77.0779*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB2_w2P_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.3987*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0933547*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.3987*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB2_w2N_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.3987*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0933547*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.3987*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB2_w2P_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.5026*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.92773*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.5026*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB2_w2N_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.5026*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="5.92773*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.5026*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB2_w2P_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="347.0779*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0815176*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -77.0779*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB2_w2N_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="347.0779*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.0815176*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -77.0779*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YBSepar3_w0_1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.8409*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.33895*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.8409*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YBSepar3_w0_2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.8409*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.33895*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.8409*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YBSepar3_w1P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.8409*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.33895*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.8409*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YBSepar3_w1N"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.8409*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.33895*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.8409*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YBSepar3_w2P"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.8409*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.33895*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.8409*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YBSepar3_w2N"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.8409*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.33895*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.8409*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.5332*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.60077*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.5332*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.5332*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.60077*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.5332*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.2228*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.41755*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.2228*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.2228*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.41755*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.2228*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.6776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.59498*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.6776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_b6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.6776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.59498*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.6776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.5332*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.60077*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.5332*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.5332*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.60077*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.5332*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.9814*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.48027*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.9814*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.9814*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.48027*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.9814*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="3.1208*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.42703*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.1208*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="3.1208*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.42703*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.1208*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b3"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="93.1208*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.42703*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -93.1208*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB3Chim_w1N_b3"/> + <rRotation name="rotations:R330"/> + <Translation x="6.42703*m*cos(63.1208*deg)" y="6.42703*m*sin(63.1208*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="3"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="60*deg"/> + <Numeric name="Radius" value="6.4175*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b4"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="StartAngle" value="120*deg"/> + <Numeric name="RangeAngle" value="210*deg"/> + <Numeric name="Radius" value="6.4175*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.4175*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b4"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="90*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.4175*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="356.8792*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.42703*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.8792*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="356.8792*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.42703*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.8792*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b5"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="86.8792*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.42703*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -86.8792*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB3Chim_w1N_b5"/> + <rRotation name="rotations:R330"/> + <Translation x="6.42703*m*cos(56.8792*deg)" y="6.42703*m*sin(56.8792*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="352.2371*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.47686*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -82.2371*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="352.2371*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.47686*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -82.2371*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.2228*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.41755*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.2228*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.2228*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.41755*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.2228*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_b8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.6776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.59498*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.6776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_b8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.6776*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.59498*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.6776*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB3_w2P_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.5332*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.60077*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.5332*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB3_w2N_b1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.5332*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.60077*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.5332*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB3_w2P_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.2234*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.41755*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.2234*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB3_w2N_b2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0.2234*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.41755*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90.2234*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB3_w2P_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.6782*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.59496*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.6782*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB3_w2N_b3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.6782*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.59496*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.6782*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="9.4324*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.77662*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -99.4324*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="9.4324*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.77662*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -99.4324*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="2.9962*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.69415*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -92.9962*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="2.9962*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.69415*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -92.9962*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m2"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="92.9962*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.69415*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -92.9962*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB3Chim_w1N_m2"/> + <rRotation name="rotations:R330"/> + <Translation x="6.69415*m*cos(62.9962*deg)" y="6.69415*m*sin(62.9962*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_m3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="3"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="60*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_m3"/> + <Numeric name="StartCopyNo" value="8"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="StartAngle" value="120*deg"/> + <Numeric name="RangeAngle" value="210*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <PosPart copyNumber="4"> + <rParent name="muonBase:MBWheel_1P"/> + <rChild name="YB3Chim_w1P_m3"/> + <rRotation name="rotations:000D"/> + <Translation x="6.685*m*cos(90.*deg)" y="6.685*m*sin(90.*deg)" z="-1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m3"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="90*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB3Chim_w1N_m3"/> + <rRotation name="rotations:R330"/> + <Translation x="6.685*m*cos(60*deg)" y="6.685*m*sin(60*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_m4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="357.0038*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.69415*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -87.0038*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="357.0038*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.69415*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -87.0038*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m4"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="87.0038*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.69415*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -87.0038*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB3Chim_w1N_m4"/> + <rRotation name="rotations:R330"/> + <Translation x="6.69415*m*cos(57.0038*deg)" y="6.69415*m*sin(57.0038*deg)" z="1.0729*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_m5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="350.5676*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.77662*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -80.5676*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="350.5676*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.77662*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0729*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -80.5676*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_m6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.195*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_m6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.195*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB3_w2P_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB3_w2N_m1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.685*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.13687*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_t4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.13687*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.3702*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.95292*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.3702*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_t5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.3702*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.95292*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.62495*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.3702*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.3521*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.15451*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.3521*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YB3_w0_t6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.3521*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.15451*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.63395*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.3521*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.13687*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.13687*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.337*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.0100*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.337*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="7.337*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.0100*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -97.337*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="2.8811*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.9613*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -92.8811*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="2.8811*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.9613*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -92.8811*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t3"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="92.8811*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.9613*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -92.8811*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB3Chim_w1N_t3"/> + <rRotation name="rotations:R330"/> + <Translation x="6.9613*m*cos(62.8811*deg)" y="6.9613*m*sin(62.8811*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="3"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="60*deg"/> + <Numeric name="Radius" value="6.9525*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t4"/> + <Numeric name="StartCopyNo" value="5"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="8"/> + <Numeric name="StartAngle" value="120*deg"/> + <Numeric name="RangeAngle" value="210*deg"/> + <Numeric name="Radius" value="6.9525*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t4"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="0*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.9525*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t4"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="90*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.9525*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -90*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="357.1189*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.9613*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -87.1189*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t5"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="2"/> + <Numeric name="StartAngle" value="357.1189*deg"/> + <Numeric name="RangeAngle" value="30*deg"/> + <Numeric name="Radius" value="6.9613*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -87.1189*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t5"/> + <Numeric name="StartCopyNo" value="4"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="9"/> + <Numeric name="StartAngle" value="87.1189*deg"/> + <Numeric name="RangeAngle" value="240*deg"/> + <Numeric name="Radius" value="6.9613*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -87.1189*deg </Vector> + </Algorithm> + <PosPart copyNumber="3"> + <rParent name="muonBase:MBWheel_1N"/> + <rChild name="YB3Chim_w1N_t5"/> + <rRotation name="rotations:R330"/> + <Translation x="6.9613*m*cos(57.1189*deg)" y="6.9613*m*sin(57.1189*deg)" z="1.0639*m"/> + </PosPart> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="352.0437*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.02008*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -82.0437*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t6"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="352.0437*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.02008*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 1.0639*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -82.0437*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.3696*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.95292*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.3696*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t7"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.3696*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.95292*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, -0.186*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.3696*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1P"/> + <String name="ChildName" value="YB3_w1P_t8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.3516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.15453*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.3516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_1N"/> + <String name="ChildName" value="YB3_w1N_t8"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.3516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.15453*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.3516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB3_w2P_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.13687*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB3_w2N_t1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="13.0516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.13687*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -103.0516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB3_w2P_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.3696*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.95292*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.3696*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB3_w2N_t2"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="359.3696*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="6.95292*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -89.3696*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2P"/> + <String name="ChildName" value="YB3_w2P_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.3516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.15453*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.3516*deg </Vector> + </Algorithm> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_2N"/> + <String name="ChildName" value="YB3_w2N_t3"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="StartAngle" value="346.3516*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Numeric name="Radius" value="7.15453*m"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, -76.3516*deg </Vector> + </Algorithm> + <!--- #### Non iron volumes --> + <Algorithm name="global:DDAngular"> + <rParent name="muonBase:MBWheel_0"/> + <String name="ChildName" value="YBSepar_1"/> + <Numeric name="StartCopyNo" value="1"/> + <Numeric name="IncrCopyNo" value="1"/> + <Numeric name="N" value="12"/> + <Numeric name="Radius" value="4.23467*m"/> + <Numeric name="StartAngle" value="79.8900*deg"/> + <Numeric name="RangeAngle" value="360*deg"/> + <Vector name="Center" type="numeric" nEntries="3"> 0, 0, 0.*m </Vector> + <Vector name="RotateSolid" type="numeric" nEntries="3"> 0.*deg, 0.*deg, 270.00*deg </Vector> + </Algorithm> + </PosPartSection> +</DDDefinition> From d4c7fd2a5f99da14526c7d40775088bc92182459 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Sat, 17 Oct 2020 19:52:07 +0200 Subject: [PATCH 656/778] Add analyzer to dump content of Muon SimHits --- SimG4CMS/Muon/test/BuildFile.xml | 10 ++ SimG4CMS/Muon/test/MuonSimHitDump.cc | 106 ++++++++++++++++++++ SimG4CMS/Muon/test/runMuonSimHitDump_cfg.py | 30 ++++++ 3 files changed, 146 insertions(+) create mode 100644 SimG4CMS/Muon/test/BuildFile.xml create mode 100644 SimG4CMS/Muon/test/MuonSimHitDump.cc create mode 100644 SimG4CMS/Muon/test/runMuonSimHitDump_cfg.py diff --git a/SimG4CMS/Muon/test/BuildFile.xml b/SimG4CMS/Muon/test/BuildFile.xml new file mode 100644 index 0000000000000..a8825a9fccefb --- /dev/null +++ b/SimG4CMS/Muon/test/BuildFile.xml @@ -0,0 +1,10 @@ +<use name="DataFormats/MuonDetId"/> +<use name="FWCore/Framework"/> +<use name="FWCore/ParameterSet"/> +<use name="FWCore/MessageLogger"/> +<use name="FWCore/PluginManager"/> +<use name="SimDataFormats/TrackingHit"/> + +<library file="*.cc" name="SimG4CMSMuonTest"> + <flags EDM_PLUGIN="1"/> +</library> diff --git a/SimG4CMS/Muon/test/MuonSimHitDump.cc b/SimG4CMS/Muon/test/MuonSimHitDump.cc new file mode 100644 index 0000000000000..8c7ef5651e318 --- /dev/null +++ b/SimG4CMS/Muon/test/MuonSimHitDump.cc @@ -0,0 +1,106 @@ +#include "DataFormats/MuonDetId/interface/CSCDetId.h" +#include "DataFormats/MuonDetId/interface/DTWireId.h" +#include "DataFormats/MuonDetId/interface/GEMDetId.h" +#include "DataFormats/MuonDetId/interface/ME0DetId.h" +#include "DataFormats/MuonDetId/interface/RPCDetId.h" +#include "DataFormats/MuonDetId/interface/MuonSubdetId.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/Utilities/interface/transform.h" + +#include "SimDataFormats/TrackingHit/interface/PSimHit.h" +#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" + +#include <string> +#include <vector> + +class MuonSimHitDump : public edm::one::EDAnalyzer<> { +public: + MuonSimHitDump(const edm::ParameterSet& ps); + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +protected: + void analyze(edm::Event const&, edm::EventSetup const&) override; + +private: + const std::string g4Label_; + const std::vector<std::string> hitLab_; + const std::vector<edm::EDGetTokenT<edm::PSimHitContainer> > toksMuon_; + const std::vector<int> types_; + const int maxEvent_; + int kount_; +}; + +MuonSimHitDump::MuonSimHitDump(const edm::ParameterSet& ps) : + g4Label_(ps.getParameter<std::string>("ModuleLabel")), + hitLab_(ps.getParameter<std::vector<std::string>>("HitCollections")), + toksMuon_{ + edm::vector_transform(hitLab_, + [this](const std::string& name) { + return consumes<edm::PSimHitContainer>( + edm::InputTag{g4Label_, name}); + })}, + types_(ps.getParameter<std::vector<int>>("CollectionTypes")), + maxEvent_(ps.getParameter<int>("MaxEvent")), + kount_(0) { + + edm::LogVerbatim("HitStudy") << "Module Label: " << g4Label_ << " with " << hitLab_.size() << " collections and maxEvent = " << maxEvent_; + for (unsigned int k = 0; k < hitLab_.size(); ++k) + edm::LogVerbatim("HitStudy") << "[" << k << "] Type " << types_[k] << " Label " << hitLab_[k]; +} + +void MuonSimHitDump::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + std::vector<std::string> coll = {"MuonDTHits", "MuonCSCHits", "MuonRPCHits", "MuonGEMHits"}; + std::vector<int> type = {0, 1, 2, 3}; + desc.add<std::string>("ModuleLabel", "g4SimHits"); + desc.add<std::vector<std::string> >("HitCollections", coll); + desc.add<std::vector<int> >("CollectionTypes", type); + desc.add<int>("MaxEvent", 10); + descriptions.add("muonSimHitDump", desc); +} + +void MuonSimHitDump::analyze(const edm::Event& e, const edm::EventSetup&) { + ++kount_; + edm::LogVerbatim("HitStudy") << "[" << kount_ << "] Run = " << e.id().run() << " Event = " << e.id().event(); + std::vector<std::string> dets = {"DT", "CSC", "RPC", "GEM", "ME0"}; + if ((kount_ <= maxEvent_) || (maxEvent_ <= 0)) { + for (unsigned int k = 0; k < toksMuon_.size(); ++k) { + edm::Handle<edm::PSimHitContainer> hitsMuon; + e.getByToken(toksMuon_[k], hitsMuon); + if (hitsMuon.isValid()) + edm::LogVerbatim("HitStudy") << "MuonSimHitDump: Input " << hitsMuon->size() << " hits of type " << types_[k] << " (" << dets[k] << ")"; + unsigned int i(0); + for (auto const& hit : *hitsMuon) { + auto entry = hit.entryPoint(); + auto exit = hit.exitPoint(); + auto p = hit.pabs(); + auto tof = hit.tof(); + auto edep = hit.energyLoss(); + unsigned int track = hit.trackId(); + unsigned int id = hit.detUnitId(); + if (types_[k] == 0) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << DTWireId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + else if (types_[k] == 1) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << CSCDetId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + else if (types_[k] == 2) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << RPCDetId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + else if (types_[k] == 3) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << GEMDetId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + else + edm::LogVerbatim("HitStudy") << "[" << i << "] " << ME0DetId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + ++i; + } + } + } +} + +//define this as a plug-in +DEFINE_FWK_MODULE(MuonSimHitDump); diff --git a/SimG4CMS/Muon/test/runMuonSimHitDump_cfg.py b/SimG4CMS/Muon/test/runMuonSimHitDump_cfg.py new file mode 100644 index 0000000000000..d1f4560691fec --- /dev/null +++ b/SimG4CMS/Muon/test/runMuonSimHitDump_cfg.py @@ -0,0 +1,30 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep + +process = cms.Process('Dump',Run3_dd4hep) + +# import of standard configurations +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.Geometry.GeometryDD4hepExtended2021_cff') +process.load('SimG4CMS.Muon.muonSimHitDump_cfi') + +if hasattr(process,'MessageLogger'): + process.MessageLogger.categories.append('HitStudy') + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(10), + output = cms.optional.untracked.allowed(cms.int32,cms.PSet) +) + +process.source = cms.Source("PoolSource", + dropDescendantsOfDroppedBranches = cms.untracked.bool(False), + fileNames = cms.untracked.vstring('file:step1_ZMM_dd4hep.root'), +) + +process.analysis_step = cms.Path(process.muonSimHitDump) + +process.muonSimHitDump.MaxEvent = 10 + +# Schedule definition +process.schedule = cms.Schedule(process.analysis_step) From e7ea7d6b6b8ae73a4bd6a9caad592690e5455ee8 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Sat, 17 Oct 2020 20:10:22 +0200 Subject: [PATCH 657/778] Code check --- SimG4CMS/Muon/test/MuonSimHitDump.cc | 80 +++++++++++++++------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/SimG4CMS/Muon/test/MuonSimHitDump.cc b/SimG4CMS/Muon/test/MuonSimHitDump.cc index 8c7ef5651e318..e85e8b5643f7a 100644 --- a/SimG4CMS/Muon/test/MuonSimHitDump.cc +++ b/SimG4CMS/Muon/test/MuonSimHitDump.cc @@ -32,28 +32,26 @@ class MuonSimHitDump : public edm::one::EDAnalyzer<> { private: const std::string g4Label_; const std::vector<std::string> hitLab_; - const std::vector<edm::EDGetTokenT<edm::PSimHitContainer> > toksMuon_; + const std::vector<edm::EDGetTokenT<edm::PSimHitContainer>> toksMuon_; const std::vector<int> types_; const int maxEvent_; int kount_; }; -MuonSimHitDump::MuonSimHitDump(const edm::ParameterSet& ps) : - g4Label_(ps.getParameter<std::string>("ModuleLabel")), - hitLab_(ps.getParameter<std::vector<std::string>>("HitCollections")), - toksMuon_{ - edm::vector_transform(hitLab_, - [this](const std::string& name) { - return consumes<edm::PSimHitContainer>( - edm::InputTag{g4Label_, name}); - })}, - types_(ps.getParameter<std::vector<int>>("CollectionTypes")), - maxEvent_(ps.getParameter<int>("MaxEvent")), - kount_(0) { - - edm::LogVerbatim("HitStudy") << "Module Label: " << g4Label_ << " with " << hitLab_.size() << " collections and maxEvent = " << maxEvent_; - for (unsigned int k = 0; k < hitLab_.size(); ++k) - edm::LogVerbatim("HitStudy") << "[" << k << "] Type " << types_[k] << " Label " << hitLab_[k]; +MuonSimHitDump::MuonSimHitDump(const edm::ParameterSet& ps) + : g4Label_(ps.getParameter<std::string>("ModuleLabel")), + hitLab_(ps.getParameter<std::vector<std::string>>("HitCollections")), + toksMuon_{edm::vector_transform(hitLab_, + [this](const std::string& name) { + return consumes<edm::PSimHitContainer>(edm::InputTag{g4Label_, name}); + })}, + types_(ps.getParameter<std::vector<int>>("CollectionTypes")), + maxEvent_(ps.getParameter<int>("MaxEvent")), + kount_(0) { + edm::LogVerbatim("HitStudy") << "Module Label: " << g4Label_ << " with " << hitLab_.size() + << " collections and maxEvent = " << maxEvent_; + for (unsigned int k = 0; k < hitLab_.size(); ++k) + edm::LogVerbatim("HitStudy") << "[" << k << "] Type " << types_[k] << " Label " << hitLab_[k]; } void MuonSimHitDump::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -61,8 +59,8 @@ void MuonSimHitDump::fillDescriptions(edm::ConfigurationDescriptions& descriptio std::vector<std::string> coll = {"MuonDTHits", "MuonCSCHits", "MuonRPCHits", "MuonGEMHits"}; std::vector<int> type = {0, 1, 2, 3}; desc.add<std::string>("ModuleLabel", "g4SimHits"); - desc.add<std::vector<std::string> >("HitCollections", coll); - desc.add<std::vector<int> >("CollectionTypes", type); + desc.add<std::vector<std::string>>("HitCollections", coll); + desc.add<std::vector<int>>("CollectionTypes", type); desc.add<int>("MaxEvent", 10); descriptions.add("muonSimHitDump", desc); } @@ -76,27 +74,33 @@ void MuonSimHitDump::analyze(const edm::Event& e, const edm::EventSetup&) { edm::Handle<edm::PSimHitContainer> hitsMuon; e.getByToken(toksMuon_[k], hitsMuon); if (hitsMuon.isValid()) - edm::LogVerbatim("HitStudy") << "MuonSimHitDump: Input " << hitsMuon->size() << " hits of type " << types_[k] << " (" << dets[k] << ")"; + edm::LogVerbatim("HitStudy") << "MuonSimHitDump: Input " << hitsMuon->size() << " hits of type " << types_[k] + << " (" << dets[k] << ")"; unsigned int i(0); for (auto const& hit : *hitsMuon) { - auto entry = hit.entryPoint(); - auto exit = hit.exitPoint(); - auto p = hit.pabs(); - auto tof = hit.tof(); - auto edep = hit.energyLoss(); - unsigned int track = hit.trackId(); - unsigned int id = hit.detUnitId(); - if (types_[k] == 0) - edm::LogVerbatim("HitStudy") << "[" << i << "] " << DTWireId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; - else if (types_[k] == 1) - edm::LogVerbatim("HitStudy") << "[" << i << "] " << CSCDetId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; - else if (types_[k] == 2) - edm::LogVerbatim("HitStudy") << "[" << i << "] " << RPCDetId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; - else if (types_[k] == 3) - edm::LogVerbatim("HitStudy") << "[" << i << "] " << GEMDetId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; - else - edm::LogVerbatim("HitStudy") << "[" << i << "] " << ME0DetId(id) << " Trk " << track << " p " << p << " dE " << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; - ++i; + auto entry = hit.entryPoint(); + auto exit = hit.exitPoint(); + auto p = hit.pabs(); + auto tof = hit.tof(); + auto edep = hit.energyLoss(); + unsigned int track = hit.trackId(); + unsigned int id = hit.detUnitId(); + if (types_[k] == 0) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << DTWireId(id) << " Trk " << track << " p " << p << " dE " + << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + else if (types_[k] == 1) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << CSCDetId(id) << " Trk " << track << " p " << p << " dE " + << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + else if (types_[k] == 2) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << RPCDetId(id) << " Trk " << track << " p " << p << " dE " + << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + else if (types_[k] == 3) + edm::LogVerbatim("HitStudy") << "[" << i << "] " << GEMDetId(id) << " Trk " << track << " p " << p << " dE " + << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + else + edm::LogVerbatim("HitStudy") << "[" << i << "] " << ME0DetId(id) << " Trk " << track << " p " << p << " dE " + << edep << " T " << tof << " Enetry " << entry << " Exit " << exit; + ++i; } } } From 0814557e054bde1b05a8938eac6aee4511fafd8b Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Wed, 7 Oct 2020 11:45:14 +0200 Subject: [PATCH 658/778] EgammaHadTower should not use EventSetup directly --- .../src/ElectronHcalHelper.cc | 12 ++++++++- ...ammaHLTBcHcalIsolationProducersRegional.cc | 12 ++++++++- .../interface/EgammaHadTower.h | 16 +++++++----- .../src/EgammaHadTower.cc | 26 +++++-------------- .../src/GEDPhotonProducer.cc | 14 +++++++++- .../src/PhotonProducer.cc | 13 +++++++++- .../plugins/importers/SuperClusterImporter.cc | 12 ++++++++- 7 files changed, 73 insertions(+), 32 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc index 262b02783e626..5ebc4c376cae7 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc @@ -5,6 +5,8 @@ #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" using namespace reco; @@ -18,7 +20,15 @@ void ElectronHcalHelper::checkSetup(const edm::EventSetup& es) { if (cfg_.useTowers) { delete hadTower_; - hadTower_ = new EgammaHadTower(es); + edm::ESHandle<CaloTowerConstituentsMap> ctmaph; + es.get<CaloGeometryRecord>().get(ctmaph); + + edm::ESHandle<HcalChannelQuality> hQuality; + es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); + + edm::ESHandle<HcalTopology> hcalTopology; + es.get<HcalRecNumberingRecord>().get(hcalTopology); + hadTower_ = new EgammaHadTower(*ctmaph, *hQuality, *hcalTopology); } else { unsigned long long newCaloGeomCacheId_ = es.get<CaloGeometryRecord>().cacheIdentifier(); if (caloGeomCacheId_ != newCaloGeomCacheId_) { diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc index 36d6c38a9f25c..d6c444455cd4f 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc @@ -15,6 +15,8 @@ #include "FWCore/Utilities/interface/Exception.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" //this class produces either Hcal isolation or H for H/E depending if doEtSum=true or false //H for H/E = towers behind SC, hcal isolation has these towers excluded @@ -121,7 +123,15 @@ void EgammaHLTBcHcalIsolationProducersRegional::produce(edm::StreamID, } auto const &caloTowers = iEvent.get(caloTowerProducer_); - EgammaHadTower hadTower(iSetup); + edm::ESHandle<CaloTowerConstituentsMap> ctmaph; + iSetup.get<CaloGeometryRecord>().get(ctmaph); + + edm::ESHandle<HcalChannelQuality> hQuality; + iSetup.get<HcalChannelQualityRcd>().get("withTopo", hQuality); + + edm::ESHandle<HcalTopology> hcalTopology; + iSetup.get<HcalRecNumberingRecord>().get(hcalTopology); + EgammaHadTower hadTower(*ctmaph, *hQuality, *hcalTopology); const EgammaTowerIsolation towerIso1(outerCone_, 0., etMin_, 1, &caloTowers); const EgammaTowerIsolation towerIso2(outerCone_, 0., etMin_, 2, &caloTowers); diff --git a/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h b/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h index 3b0b38aa56156..608d4249ecce3 100644 --- a/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h +++ b/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h @@ -4,7 +4,6 @@ // Finds the towers behind a super-cluster using the CaloTowerConstituentMap // Florian Beaudette 22 Jun 2011 -#include "FWCore/Framework/interface/EventSetup.h" #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" #include "DataFormats/EgammaReco/interface/SuperCluster.h" #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" @@ -18,7 +17,11 @@ class EgammaHadTower { public: enum HoeMode { SingleTower = 0, TowersBehindCluster = 1 }; - EgammaHadTower(const edm::EventSetup& es, HoeMode mode = SingleTower); + EgammaHadTower(CaloTowerConstituentsMap const& towerMap, + HcalChannelQuality const& hcalQuality, + HcalTopology const& hcalTopology, + HoeMode mode = SingleTower) + : towerMap_{towerMap}, mode_{mode}, hcalQuality_{hcalQuality}, hcalTopology_{hcalTopology} {} double getDepth1HcalESum(const std::vector<CaloTowerDetId>& towers, CaloTowerCollection const&) const; double getDepth2HcalESum(const std::vector<CaloTowerDetId>& towers, CaloTowerCollection const&) const; std::vector<CaloTowerDetId> towersOf(const reco::SuperCluster& sc) const; @@ -26,11 +29,10 @@ class EgammaHadTower { bool hasActiveHcal(const std::vector<CaloTowerDetId>& towers) const; private: - const CaloTowerConstituentsMap* towerMap_; - HoeMode mode_; - unsigned int nMaxClusters_; - const HcalChannelQuality* hcalQuality_; - const HcalTopology* hcalTopology_; + const CaloTowerConstituentsMap& towerMap_; + const HoeMode mode_; + const HcalChannelQuality& hcalQuality_; + const HcalTopology& hcalTopology_; }; #endif diff --git a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc index 3672048d56375..17edc151f5684 100644 --- a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc +++ b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc @@ -1,6 +1,5 @@ #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "CondFormats/HcalObjects/interface/HcalChannelStatus.h" @@ -17,21 +16,6 @@ //#define EDM_ML_DEBUG -EgammaHadTower::EgammaHadTower(const edm::EventSetup& es, HoeMode mode) : mode_(mode) { - edm::ESHandle<CaloTowerConstituentsMap> ctmaph; - es.get<CaloGeometryRecord>().get(ctmaph); - towerMap_ = &(*ctmaph); - nMaxClusters_ = 4; - - edm::ESHandle<HcalChannelQuality> hQuality; - es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); - hcalQuality_ = hQuality.product(); - - edm::ESHandle<HcalTopology> hcalTopology; - es.get<HcalRecNumberingRecord>().get(hcalTopology); - hcalTopology_ = hcalTopology.product(); -} - CaloTowerDetId EgammaHadTower::towerOf(const reco::CaloCluster& cluster) const { DetId detid = cluster.seed(); if (detid.det() != DetId::Ecal) { @@ -43,11 +27,13 @@ CaloTowerDetId EgammaHadTower::towerOf(const reco::CaloCluster& cluster) const { return tower; } } - CaloTowerDetId id(towerMap_->towerOf(detid)); + CaloTowerDetId id(towerMap_.towerOf(detid)); return id; } std::vector<CaloTowerDetId> EgammaHadTower::towersOf(const reco::SuperCluster& sc) const { + constexpr unsigned int nMaxClusters = 4; + std::vector<CaloTowerDetId> towers; std::vector<reco::CaloClusterPtr> orderedClusters; @@ -64,7 +50,7 @@ std::vector<CaloTowerDetId> EgammaHadTower::towersOf(const reco::SuperCluster& s } std::sort(orderedClusters.begin(), orderedClusters.end(), [](auto& c1, auto& c2) { return (*c1 > *c2); }); unsigned nclusters = orderedClusters.size(); - for (unsigned iclus = 0; iclus < nclusters && iclus < nMaxClusters_; ++iclus) { + for (unsigned iclus = 0; iclus < nclusters && iclus < nMaxClusters; ++iclus) { // Get the tower CaloTowerDetId id = towerOf(*(orderedClusters[iclus])); #ifdef EDM_ML_DEBUG @@ -123,7 +109,7 @@ bool EgammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers) co #endif for (auto towerid : towers) { unsigned int ngood = 0, nbad = 0; - for (DetId id : towerMap_->constituentsOf(towerid)) { + for (DetId id : towerMap_.constituentsOf(towerid)) { if (id.det() != DetId::Hcal) { continue; } @@ -138,7 +124,7 @@ bool EgammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers) co // Sunanda's fix for 2017 Plan1 // and removed protection int status = - hcalQuality_->getValues((DetId)(hcalTopology_->idFront(HcalDetId(id))), /*throwOnFail=*/true)->getValue(); + hcalQuality_.getValues((DetId)(hcalTopology_.idFront(HcalDetId(id))), /*throwOnFail=*/true)->getValue(); #ifdef EDM_ML_DEBUG std::cout << "channels status = " << std::hex << status << std::dec << " int value = " << status << std::endl; diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index ab7fe7b5134ed..5a8d413f52101 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -40,6 +40,9 @@ #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "RecoEcal/EgammaCoreTools/interface/EcalTools.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" + namespace { inline double ptFast(const double energy, const math::XYZPoint& position, const math::XYZPoint& origin) { const auto v = position - origin; @@ -516,7 +519,16 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, HoE1 = towerIso1.getTowerESum(&(*scRef)) / scRef->energy(); HoE2 = towerIso2.getTowerESum(&(*scRef)) / scRef->energy(); - EgammaHadTower towerIsoBehindClus(es); + edm::ESHandle<CaloTowerConstituentsMap> ctmaph; + es.get<CaloGeometryRecord>().get(ctmaph); + + edm::ESHandle<HcalChannelQuality> hQuality; + es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); + + edm::ESHandle<HcalTopology> hcalTopology; + es.get<HcalRecNumberingRecord>().get(hcalTopology); + EgammaHadTower towerIsoBehindClus(*ctmaph, *hQuality, *hcalTopology); + TowersBehindClus = towerIsoBehindClus.towersOf(*scRef); hcalDepth1OverEcalBc = towerIsoBehindClus.getDepth1HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); hcalDepth2OverEcalBc = towerIsoBehindClus.getDepth2HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); diff --git a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc index 80c6431340bc7..c889c93f29d83 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc @@ -30,6 +30,9 @@ #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" + PhotonProducer::PhotonProducer(const edm::ParameterSet& config) : photonEnergyCorrector_(config, consumesCollector()) { // use onfiguration file to setup input/output collection names @@ -272,7 +275,15 @@ void PhotonProducer::fillPhotonCollection(edm::Event& evt, double HoE1 = towerIso1.getTowerESum(&(*scRef)) / scRef->energy(); double HoE2 = towerIso2.getTowerESum(&(*scRef)) / scRef->energy(); - const EgammaHadTower egammaHadTower(es); + edm::ESHandle<CaloTowerConstituentsMap> ctmaph; + es.get<CaloGeometryRecord>().get(ctmaph); + + edm::ESHandle<HcalChannelQuality> hQuality; + es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); + + edm::ESHandle<HcalTopology> hcalTopology; + es.get<HcalRecNumberingRecord>().get(hcalTopology); + const EgammaHadTower egammaHadTower(*ctmaph, *hQuality, *hcalTopology); auto towersBehindCluster = egammaHadTower.towersOf(*scRef); float hcalDepth1OverEcalBc = egammaHadTower.getDepth1HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); float hcalDepth2OverEcalBc = egammaHadTower.getDepth2HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); diff --git a/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc b/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc index aa39240af1a2d..77ad0d24c18d7 100644 --- a/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc +++ b/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc @@ -4,6 +4,8 @@ #include "DataFormats/ParticleFlowReco/interface/PFBlockElementSuperCluster.h" #include "DataFormats/EgammaReco/interface/SuperCluster.h" #include "RecoParticleFlow/PFProducer/interface/PFBlockElementSCEqual.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" +#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" // for single tower H/E #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" @@ -51,7 +53,15 @@ SuperClusterImporter::SuperClusterImporter(const edm::ParameterSet& conf, edm::C _superClustersArePF(conf.getParameter<bool>("superClustersArePF")) {} void SuperClusterImporter::updateEventSetup(const edm::EventSetup& es) { - _hadTower = std::make_unique<EgammaHadTower>(es, EgammaHadTower::SingleTower); + edm::ESHandle<CaloTowerConstituentsMap> ctmaph; + es.get<CaloGeometryRecord>().get(ctmaph); + + edm::ESHandle<HcalChannelQuality> hQuality; + es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); + + edm::ESHandle<HcalTopology> hcalTopology; + es.get<HcalRecNumberingRecord>().get(hcalTopology); + _hadTower = std::make_unique<EgammaHadTower>(*ctmaph, *hQuality, *hcalTopology, EgammaHadTower::SingleTower); } void SuperClusterImporter::importToBlock(const edm::Event& e, BlockElementImporterBase::ElementList& elems) const { From f0e02d0dffd39c1c29d32f714b57d051002dcef5 Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Wed, 7 Oct 2020 12:13:41 +0200 Subject: [PATCH 659/778] less member variables for EgammaHadTower --- .../interface/ElectronHcalHelper.h | 4 ++++ .../EgammaElectronAlgos/src/ElectronHcalHelper.cc | 8 +++++--- .../EgammaHLTBcHcalIsolationProducersRegional.cc | 8 +------- .../interface/EgammaHadTower.h | 15 +++++---------- .../EgammaIsolationAlgos/src/EgammaHadTower.cc | 12 +++++++----- .../src/GEDPhotonProducer.cc | 8 ++++---- .../EgammaPhotonProducers/src/PhotonProducer.cc | 8 +------- .../plugins/importers/SuperClusterImporter.cc | 8 +------- 8 files changed, 28 insertions(+), 43 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h index 36794e9ea052a..e72b4ac369a82 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h @@ -17,6 +17,8 @@ class EgammaTowerIsolation; #include "FWCore/Framework/interface/ConsumesCollector.h" class EgammaHadTower; +class HcalTopology; +class HcalChannelQuality; class ElectronHcalHelper { public: @@ -71,6 +73,8 @@ class ElectronHcalHelper { EgammaTowerIsolation *towerIso2_; EgammaHadTower *hadTower_; CaloTowerCollection const *towersFromCollection_ = nullptr; + HcalChannelQuality const *hcalQuality_ = nullptr; + HcalTopology const *hcalTopology_ = nullptr; }; #endif diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc index 5ebc4c376cae7..84daca9a280b9 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc @@ -25,10 +25,12 @@ void ElectronHcalHelper::checkSetup(const edm::EventSetup& es) { edm::ESHandle<HcalChannelQuality> hQuality; es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); - + hcalQuality_ = hQuality.product(); edm::ESHandle<HcalTopology> hcalTopology; es.get<HcalRecNumberingRecord>().get(hcalTopology); - hadTower_ = new EgammaHadTower(*ctmaph, *hQuality, *hcalTopology); + hcalTopology_ = hcalTopology.product(); + + hadTower_ = new EgammaHadTower(*ctmaph); } else { unsigned long long newCaloGeomCacheId_ = es.get<CaloGeometryRecord>().cacheIdentifier(); if (caloGeomCacheId_ != newCaloGeomCacheId_) { @@ -115,7 +117,7 @@ double ElectronHcalHelper::hcalESumDepth2(const SuperCluster& sc, bool ElectronHcalHelper::hasActiveHcal(const reco::SuperCluster& sc) const { if (cfg_.checkHcalStatus && cfg_.hOverEConeSize != 0 && cfg_.useTowers) { - return hadTower_->hasActiveHcal(hadTower_->towersOf(sc)); + return hadTower_->hasActiveHcal(hadTower_->towersOf(sc), *hcalQuality_, *hcalTopology_); } else { return true; } diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc index d6c444455cd4f..45788ccbbe386 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc @@ -16,7 +16,6 @@ #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" //this class produces either Hcal isolation or H for H/E depending if doEtSum=true or false //H for H/E = towers behind SC, hcal isolation has these towers excluded @@ -126,12 +125,7 @@ void EgammaHLTBcHcalIsolationProducersRegional::produce(edm::StreamID, edm::ESHandle<CaloTowerConstituentsMap> ctmaph; iSetup.get<CaloGeometryRecord>().get(ctmaph); - edm::ESHandle<HcalChannelQuality> hQuality; - iSetup.get<HcalChannelQualityRcd>().get("withTopo", hQuality); - - edm::ESHandle<HcalTopology> hcalTopology; - iSetup.get<HcalRecNumberingRecord>().get(hcalTopology); - EgammaHadTower hadTower(*ctmaph, *hQuality, *hcalTopology); + EgammaHadTower hadTower(*ctmaph); const EgammaTowerIsolation towerIso1(outerCone_, 0., etMin_, 1, &caloTowers); const EgammaTowerIsolation towerIso2(outerCone_, 0., etMin_, 2, &caloTowers); diff --git a/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h b/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h index 608d4249ecce3..3bdd5e91f1cb2 100644 --- a/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h +++ b/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h @@ -17,22 +17,17 @@ class EgammaHadTower { public: enum HoeMode { SingleTower = 0, TowersBehindCluster = 1 }; - EgammaHadTower(CaloTowerConstituentsMap const& towerMap, - HcalChannelQuality const& hcalQuality, - HcalTopology const& hcalTopology, - HoeMode mode = SingleTower) - : towerMap_{towerMap}, mode_{mode}, hcalQuality_{hcalQuality}, hcalTopology_{hcalTopology} {} + EgammaHadTower(CaloTowerConstituentsMap const& towerMap) : towerMap_{towerMap} {} double getDepth1HcalESum(const std::vector<CaloTowerDetId>& towers, CaloTowerCollection const&) const; double getDepth2HcalESum(const std::vector<CaloTowerDetId>& towers, CaloTowerCollection const&) const; - std::vector<CaloTowerDetId> towersOf(const reco::SuperCluster& sc) const; + std::vector<CaloTowerDetId> towersOf(const reco::SuperCluster& sc, HoeMode mode = SingleTower) const; CaloTowerDetId towerOf(const reco::CaloCluster& cluster) const; - bool hasActiveHcal(const std::vector<CaloTowerDetId>& towers) const; + bool hasActiveHcal(const std::vector<CaloTowerDetId>& towers, + const HcalChannelQuality& hcalQuality, + HcalTopology const& hcalTopology) const; private: const CaloTowerConstituentsMap& towerMap_; - const HoeMode mode_; - const HcalChannelQuality& hcalQuality_; - const HcalTopology& hcalTopology_; }; #endif diff --git a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc index 17edc151f5684..ecbd90981a7c2 100644 --- a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc +++ b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc @@ -31,19 +31,19 @@ CaloTowerDetId EgammaHadTower::towerOf(const reco::CaloCluster& cluster) const { return id; } -std::vector<CaloTowerDetId> EgammaHadTower::towersOf(const reco::SuperCluster& sc) const { +std::vector<CaloTowerDetId> EgammaHadTower::towersOf(const reco::SuperCluster& sc, HoeMode mode) const { constexpr unsigned int nMaxClusters = 4; std::vector<CaloTowerDetId> towers; std::vector<reco::CaloClusterPtr> orderedClusters; // in this mode, check only the tower behind the seed - if (mode_ == SingleTower) { + if (mode == SingleTower) { towers.push_back(towerOf(*sc.seed())); } // in this mode check the towers behind each basic cluster - if (mode_ == TowersBehindCluster) { + if (mode == TowersBehindCluster) { // Loop on the basic clusters for (auto it = sc.clustersBegin(); it != sc.clustersEnd(); ++it) { orderedClusters.push_back(*it); @@ -99,7 +99,9 @@ double EgammaHadTower::getDepth2HcalESum(const std::vector<CaloTowerDetId>& towe return esum; } -bool EgammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers) const { +bool EgammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, + const HcalChannelQuality& hcalQuality, + HcalTopology const& hcalTopology) const { bool active = false; int statusMask = ((1 << HcalChannelStatus::HcalCellOff) | (1 << HcalChannelStatus::HcalCellMask) | (1 << HcalChannelStatus::HcalCellDead)); @@ -124,7 +126,7 @@ bool EgammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers) co // Sunanda's fix for 2017 Plan1 // and removed protection int status = - hcalQuality_.getValues((DetId)(hcalTopology_.idFront(HcalDetId(id))), /*throwOnFail=*/true)->getValue(); + hcalQuality.getValues((DetId)(hcalTopology.idFront(HcalDetId(id))), /*throwOnFail=*/true)->getValue(); #ifdef EDM_ML_DEBUG std::cout << "channels status = " << std::hex << status << std::dec << " int value = " << status << std::endl; diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index 5a8d413f52101..effb259ad4bc3 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -522,19 +522,19 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, edm::ESHandle<CaloTowerConstituentsMap> ctmaph; es.get<CaloGeometryRecord>().get(ctmaph); - edm::ESHandle<HcalChannelQuality> hQuality; - es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); + edm::ESHandle<HcalChannelQuality> hcalQuality; + es.get<HcalChannelQualityRcd>().get("withTopo", hcalQuality); edm::ESHandle<HcalTopology> hcalTopology; es.get<HcalRecNumberingRecord>().get(hcalTopology); - EgammaHadTower towerIsoBehindClus(*ctmaph, *hQuality, *hcalTopology); + EgammaHadTower towerIsoBehindClus(*ctmaph); TowersBehindClus = towerIsoBehindClus.towersOf(*scRef); hcalDepth1OverEcalBc = towerIsoBehindClus.getDepth1HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); hcalDepth2OverEcalBc = towerIsoBehindClus.getDepth2HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); if (checkHcalStatus_ && hcalDepth1OverEcalBc == 0 && hcalDepth2OverEcalBc == 0) { - invalidHcal = !towerIsoBehindClus.hasActiveHcal(TowersBehindClus); + invalidHcal = !towerIsoBehindClus.hasActiveHcal(TowersBehindClus, *hcalQuality, *hcalTopology); } } diff --git a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc index c889c93f29d83..6af6e397650d1 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc @@ -31,7 +31,6 @@ #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" PhotonProducer::PhotonProducer(const edm::ParameterSet& config) : photonEnergyCorrector_(config, consumesCollector()) { // use onfiguration file to setup input/output collection names @@ -278,12 +277,7 @@ void PhotonProducer::fillPhotonCollection(edm::Event& evt, edm::ESHandle<CaloTowerConstituentsMap> ctmaph; es.get<CaloGeometryRecord>().get(ctmaph); - edm::ESHandle<HcalChannelQuality> hQuality; - es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); - - edm::ESHandle<HcalTopology> hcalTopology; - es.get<HcalRecNumberingRecord>().get(hcalTopology); - const EgammaHadTower egammaHadTower(*ctmaph, *hQuality, *hcalTopology); + const EgammaHadTower egammaHadTower(*ctmaph); auto towersBehindCluster = egammaHadTower.towersOf(*scRef); float hcalDepth1OverEcalBc = egammaHadTower.getDepth1HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); float hcalDepth2OverEcalBc = egammaHadTower.getDepth2HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); diff --git a/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc b/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc index 77ad0d24c18d7..906fe6f05925f 100644 --- a/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc +++ b/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc @@ -5,7 +5,6 @@ #include "DataFormats/EgammaReco/interface/SuperCluster.h" #include "RecoParticleFlow/PFProducer/interface/PFBlockElementSCEqual.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" // for single tower H/E #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" @@ -56,12 +55,7 @@ void SuperClusterImporter::updateEventSetup(const edm::EventSetup& es) { edm::ESHandle<CaloTowerConstituentsMap> ctmaph; es.get<CaloGeometryRecord>().get(ctmaph); - edm::ESHandle<HcalChannelQuality> hQuality; - es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); - - edm::ESHandle<HcalTopology> hcalTopology; - es.get<HcalRecNumberingRecord>().get(hcalTopology); - _hadTower = std::make_unique<EgammaHadTower>(*ctmaph, *hQuality, *hcalTopology, EgammaHadTower::SingleTower); + _hadTower = std::make_unique<EgammaHadTower>(*ctmaph); } void SuperClusterImporter::importToBlock(const edm::Event& e, BlockElementImporterBase::ElementList& elems) const { From d57cec75bc1e72a3801a774de4e5a84310f663fc Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Wed, 7 Oct 2020 12:39:30 +0200 Subject: [PATCH 660/778] EgammaHadTower to namespace --- .../interface/ElectronHcalHelper.h | 12 ++--- .../src/ElectronHcalHelper.cc | 16 +++---- ...ammaHLTBcHcalIsolationProducersRegional.cc | 10 ++-- .../interface/EgammaHadTower.h | 34 +++++++------- .../src/EgammaHadTower.cc | 46 ++++++++----------- .../src/GEDPhotonProducer.cc | 19 ++------ .../src/PhotonProducer.cc | 9 ++-- .../plugins/importers/SuperClusterImporter.cc | 18 ++++---- 8 files changed, 67 insertions(+), 97 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h index e72b4ac369a82..9995615392b47 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h @@ -1,24 +1,20 @@ - #ifndef ElectronHcalHelper_h #define ElectronHcalHelper_h -class EgammaHcalIsolation; -class EgammaTowerIsolation; - #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" -#include "DataFormats/Common/interface/Handle.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" +class EgammaHcalIsolation; +class EgammaTowerIsolation; class EgammaHadTower; class HcalTopology; class HcalChannelQuality; +class CaloTowerConstituentsMap; class ElectronHcalHelper { public: @@ -71,8 +67,8 @@ class ElectronHcalHelper { // event data (towers strategy) EgammaTowerIsolation *towerIso1_; EgammaTowerIsolation *towerIso2_; - EgammaHadTower *hadTower_; CaloTowerCollection const *towersFromCollection_ = nullptr; + CaloTowerConstituentsMap const *towerMap_ = nullptr; HcalChannelQuality const *hcalQuality_ = nullptr; HcalTopology const *hcalTopology_ = nullptr; }; diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc index 84daca9a280b9..45a770bb47288 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc @@ -1,4 +1,3 @@ - #include "RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h" @@ -11,7 +10,7 @@ using namespace reco; ElectronHcalHelper::ElectronHcalHelper(const Configuration& cfg) - : cfg_(cfg), caloGeomCacheId_(0), hcalIso_(nullptr), towerIso1_(nullptr), towerIso2_(nullptr), hadTower_(nullptr) {} + : cfg_(cfg), caloGeomCacheId_(0), hcalIso_(nullptr), towerIso1_(nullptr), towerIso2_(nullptr) {} void ElectronHcalHelper::checkSetup(const edm::EventSetup& es) { if (cfg_.hOverEConeSize == 0) { @@ -19,9 +18,9 @@ void ElectronHcalHelper::checkSetup(const edm::EventSetup& es) { } if (cfg_.useTowers) { - delete hadTower_; edm::ESHandle<CaloTowerConstituentsMap> ctmaph; es.get<CaloGeometryRecord>().get(ctmaph); + towerMap_ = ctmaph.product(); edm::ESHandle<HcalChannelQuality> hQuality; es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); @@ -30,7 +29,6 @@ void ElectronHcalHelper::checkSetup(const edm::EventSetup& es) { es.get<HcalRecNumberingRecord>().get(hcalTopology); hcalTopology_ = hcalTopology.product(); - hadTower_ = new EgammaHadTower(*ctmaph); } else { unsigned long long newCaloGeomCacheId_ = es.get<CaloGeometryRecord>().cacheIdentifier(); if (caloGeomCacheId_ != newCaloGeomCacheId_) { @@ -69,15 +67,15 @@ void ElectronHcalHelper::readEvent(const edm::Event& evt) { } std::vector<CaloTowerDetId> ElectronHcalHelper::hcalTowersBehindClusters(const reco::SuperCluster& sc) const { - return hadTower_->towersOf(sc); + return egammaHadTower::towersOf(sc, *towerMap_); } double ElectronHcalHelper::hcalESumDepth1BehindClusters(const std::vector<CaloTowerDetId>& towers) const { - return hadTower_->getDepth1HcalESum(towers, *towersFromCollection_); + return egammaHadTower::getDepth1HcalESum(towers, *towersFromCollection_); } double ElectronHcalHelper::hcalESumDepth2BehindClusters(const std::vector<CaloTowerDetId>& towers) const { - return hadTower_->getDepth2HcalESum(towers, *towersFromCollection_); + return egammaHadTower::getDepth2HcalESum(towers, *towersFromCollection_); } double ElectronHcalHelper::hcalESum(const SuperCluster& sc, const std::vector<CaloTowerDetId>* excludeTowers) const { @@ -117,7 +115,8 @@ double ElectronHcalHelper::hcalESumDepth2(const SuperCluster& sc, bool ElectronHcalHelper::hasActiveHcal(const reco::SuperCluster& sc) const { if (cfg_.checkHcalStatus && cfg_.hOverEConeSize != 0 && cfg_.useTowers) { - return hadTower_->hasActiveHcal(hadTower_->towersOf(sc), *hcalQuality_, *hcalTopology_); + return egammaHadTower::hasActiveHcal( + egammaHadTower::towersOf(sc, *towerMap_), *towerMap_, *hcalQuality_, *hcalTopology_); } else { return true; } @@ -130,7 +129,6 @@ ElectronHcalHelper::~ElectronHcalHelper() { if (cfg_.useTowers) { delete towerIso1_; delete towerIso2_; - delete hadTower_; } else { delete hcalIso_; } diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc index 45788ccbbe386..03a11ca81d1fc 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc @@ -125,8 +125,6 @@ void EgammaHLTBcHcalIsolationProducersRegional::produce(edm::StreamID, edm::ESHandle<CaloTowerConstituentsMap> ctmaph; iSetup.get<CaloGeometryRecord>().get(ctmaph); - EgammaHadTower hadTower(*ctmaph); - const EgammaTowerIsolation towerIso1(outerCone_, 0., etMin_, 1, &caloTowers); const EgammaTowerIsolation towerIso2(outerCone_, 0., etMin_, 2, &caloTowers); @@ -137,8 +135,8 @@ void EgammaHLTBcHcalIsolationProducersRegional::produce(edm::StreamID, float isol = 0; - auto towersBehindCluster = - useSingleTower_ ? hadTower.towersOf(*(recoEcalCandRef->superCluster())) : std::vector<CaloTowerDetId>{}; + auto towersBehindCluster = useSingleTower_ ? egammaHadTower::towersOf(*(recoEcalCandRef->superCluster()), *ctmaph) + : std::vector<CaloTowerDetId>{}; if (doEtSum_) { //calculate hcal isolation excluding the towers behind the cluster which will be used for H for H/E const EgammaTowerIsolation isolAlgo(outerCone_, innerCone_, etMin_, depth_, &caloTowers); @@ -151,8 +149,8 @@ void EgammaHLTBcHcalIsolationProducersRegional::produce(edm::StreamID, } else { //calcuate H for H/E if (useSingleTower_) - isol = hadTower.getDepth1HcalESum(towersBehindCluster, caloTowers) + - hadTower.getDepth2HcalESum(towersBehindCluster, caloTowers); + isol = egammaHadTower::getDepth1HcalESum(towersBehindCluster, caloTowers) + + egammaHadTower::getDepth2HcalESum(towersBehindCluster, caloTowers); else { auto const &sc = recoEcalCandRef->superCluster().get(); isol = towerIso1.getTowerESum(sc) + towerIso2.getTowerESum(sc); diff --git a/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h b/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h index 3bdd5e91f1cb2..3b39d482d15e4 100644 --- a/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h +++ b/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h @@ -5,7 +5,6 @@ // Florian Beaudette 22 Jun 2011 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" #include "DataFormats/CaloRecHit/interface/CaloCluster.h" #include "Geometry/CaloTopology/interface/CaloTowerConstituentsMap.h" @@ -13,21 +12,22 @@ class HcalChannelQuality; -class EgammaHadTower { -public: - enum HoeMode { SingleTower = 0, TowersBehindCluster = 1 }; - - EgammaHadTower(CaloTowerConstituentsMap const& towerMap) : towerMap_{towerMap} {} - double getDepth1HcalESum(const std::vector<CaloTowerDetId>& towers, CaloTowerCollection const&) const; - double getDepth2HcalESum(const std::vector<CaloTowerDetId>& towers, CaloTowerCollection const&) const; - std::vector<CaloTowerDetId> towersOf(const reco::SuperCluster& sc, HoeMode mode = SingleTower) const; - CaloTowerDetId towerOf(const reco::CaloCluster& cluster) const; - bool hasActiveHcal(const std::vector<CaloTowerDetId>& towers, - const HcalChannelQuality& hcalQuality, - HcalTopology const& hcalTopology) const; - -private: - const CaloTowerConstituentsMap& towerMap_; -}; +namespace egammaHadTower { + enum class HoeMode { SingleTower = 0, TowersBehindCluster = 1 }; + + double getDepth1HcalESum(std::vector<CaloTowerDetId> const& towers, CaloTowerCollection const&); + double getDepth2HcalESum(std::vector<CaloTowerDetId> const& towers, CaloTowerCollection const&); + + std::vector<CaloTowerDetId> towersOf(reco::SuperCluster const& sc, + CaloTowerConstituentsMap const& towerMap, + HoeMode mode = HoeMode::SingleTower); + + CaloTowerDetId towerOf(reco::CaloCluster const& cluster, CaloTowerConstituentsMap const& towerMap); + + bool hasActiveHcal(std::vector<CaloTowerDetId> const& towers, + CaloTowerConstituentsMap const& towerMap, + HcalChannelQuality const& hcalQuality, + HcalTopology const& hcalTopology); +}; // namespace egammaHadTower #endif diff --git a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc index ecbd90981a7c2..7c20b6ecf3993 100644 --- a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc +++ b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc @@ -1,22 +1,13 @@ #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" -#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" -#include "DataFormats/EcalDetId/interface/EcalSubdetector.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "CondFormats/HcalObjects/interface/HcalChannelStatus.h" #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" -#include "CondFormats/HcalObjects/interface/HcalCondObjectContainer.h" -#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" #include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "Geometry/Records/interface/HcalRecNumberingRecord.h" - -#include <algorithm> #include <iostream> +#include <algorithm> -//#define EDM_ML_DEBUG - -CaloTowerDetId EgammaHadTower::towerOf(const reco::CaloCluster& cluster) const { +CaloTowerDetId egammaHadTower::towerOf(const reco::CaloCluster& cluster, CaloTowerConstituentsMap const& towerMap) { DetId detid = cluster.seed(); if (detid.det() != DetId::Ecal) { // Basic clusters of hybrid super-cluster do not have the seed set; take the first DetId instead @@ -27,23 +18,25 @@ CaloTowerDetId EgammaHadTower::towerOf(const reco::CaloCluster& cluster) const { return tower; } } - CaloTowerDetId id(towerMap_.towerOf(detid)); + CaloTowerDetId id(towerMap.towerOf(detid)); return id; } -std::vector<CaloTowerDetId> EgammaHadTower::towersOf(const reco::SuperCluster& sc, HoeMode mode) const { +std::vector<CaloTowerDetId> egammaHadTower::towersOf(const reco::SuperCluster& sc, + CaloTowerConstituentsMap const& towerMap, + HoeMode mode) { constexpr unsigned int nMaxClusters = 4; std::vector<CaloTowerDetId> towers; std::vector<reco::CaloClusterPtr> orderedClusters; // in this mode, check only the tower behind the seed - if (mode == SingleTower) { - towers.push_back(towerOf(*sc.seed())); + if (mode == HoeMode::SingleTower) { + towers.push_back(towerOf(*sc.seed(), towerMap)); } // in this mode check the towers behind each basic cluster - if (mode == TowersBehindCluster) { + if (mode == HoeMode::TowersBehindCluster) { // Loop on the basic clusters for (auto it = sc.clustersBegin(); it != sc.clustersEnd(); ++it) { orderedClusters.push_back(*it); @@ -52,7 +45,7 @@ std::vector<CaloTowerDetId> EgammaHadTower::towersOf(const reco::SuperCluster& s unsigned nclusters = orderedClusters.size(); for (unsigned iclus = 0; iclus < nclusters && iclus < nMaxClusters; ++iclus) { // Get the tower - CaloTowerDetId id = towerOf(*(orderedClusters[iclus])); + CaloTowerDetId id = towerOf(*(orderedClusters[iclus]), towerMap); #ifdef EDM_ML_DEBUG std::cout << "CaloTowerId " << id << std::endl; #endif @@ -77,8 +70,8 @@ std::vector<CaloTowerDetId> EgammaHadTower::towersOf(const reco::SuperCluster& s return towers; } -double EgammaHadTower::getDepth1HcalESum(const std::vector<CaloTowerDetId>& towers, - CaloTowerCollection const& towerCollection) const { +double egammaHadTower::getDepth1HcalESum(const std::vector<CaloTowerDetId>& towers, + CaloTowerCollection const& towerCollection) { double esum = 0.; for (auto const& tower : towerCollection) { if (std::find(towers.begin(), towers.end(), tower.id()) != towers.end()) { @@ -88,8 +81,8 @@ double EgammaHadTower::getDepth1HcalESum(const std::vector<CaloTowerDetId>& towe return esum; } -double EgammaHadTower::getDepth2HcalESum(const std::vector<CaloTowerDetId>& towers, - CaloTowerCollection const& towerCollection) const { +double egammaHadTower::getDepth2HcalESum(const std::vector<CaloTowerDetId>& towers, + CaloTowerCollection const& towerCollection) { double esum = 0.; for (auto const& tower : towerCollection) { if (std::find(towers.begin(), towers.end(), tower.id()) != towers.end()) { @@ -99,9 +92,10 @@ double EgammaHadTower::getDepth2HcalESum(const std::vector<CaloTowerDetId>& towe return esum; } -bool EgammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, +bool egammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, + CaloTowerConstituentsMap const& towerMap, const HcalChannelQuality& hcalQuality, - HcalTopology const& hcalTopology) const { + HcalTopology const& hcalTopology) { bool active = false; int statusMask = ((1 << HcalChannelStatus::HcalCellOff) | (1 << HcalChannelStatus::HcalCellMask) | (1 << HcalChannelStatus::HcalCellDead)); @@ -111,7 +105,7 @@ bool EgammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, #endif for (auto towerid : towers) { unsigned int ngood = 0, nbad = 0; - for (DetId id : towerMap_.constituentsOf(towerid)) { + for (DetId id : towerMap.constituentsOf(towerid)) { if (id.det() != DetId::Hcal) { continue; } @@ -119,7 +113,7 @@ bool EgammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, if (hid.subdet() != HcalBarrel && hid.subdet() != HcalEndcap) continue; #ifdef EDM_ML_DEBUG - std::cout << "EgammaHadTower DetId " << std::hex << id.rawId() << " hid.rawId " << hid.rawId() << std::dec + std::cout << "egammaHadTower DetId " << std::hex << id.rawId() << " hid.rawId " << hid.rawId() << std::dec << " sub " << hid.subdet() << " ieta " << hid.ieta() << " iphi " << hid.iphi() << " depth " << hid.depth() << std::endl; #endif diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index effb259ad4bc3..aab84415ccca7 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -2,7 +2,6 @@ #include <vector> #include <memory> -// Framework #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Utilities/interface/isFinite.h" @@ -15,21 +14,12 @@ #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" #include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" #include "DataFormats/EgammaReco/interface/ClusterShape.h" #include "DataFormats/EgammaCandidates/interface/PhotonCore.h" #include "DataFormats/EgammaCandidates/interface/Photon.h" -#include "DataFormats/EgammaCandidates/interface/PhotonFwd.h" -#include "DataFormats/EgammaCandidates/interface/Conversion.h" #include "DataFormats/Common/interface/ValueMap.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateEGammaExtra.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateEGammaExtraFwd.h" - -#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h" - -#include "DataFormats/EgammaReco/interface/ElectronSeed.h" -#include "RecoCaloTools/Selectors/interface/CaloConeSelector.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" @@ -527,14 +517,13 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, edm::ESHandle<HcalTopology> hcalTopology; es.get<HcalRecNumberingRecord>().get(hcalTopology); - EgammaHadTower towerIsoBehindClus(*ctmaph); - TowersBehindClus = towerIsoBehindClus.towersOf(*scRef); - hcalDepth1OverEcalBc = towerIsoBehindClus.getDepth1HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); - hcalDepth2OverEcalBc = towerIsoBehindClus.getDepth2HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); + TowersBehindClus = egammaHadTower::towersOf(*scRef, *ctmaph); + hcalDepth1OverEcalBc = egammaHadTower::getDepth1HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); + hcalDepth2OverEcalBc = egammaHadTower::getDepth2HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); if (checkHcalStatus_ && hcalDepth1OverEcalBc == 0 && hcalDepth2OverEcalBc == 0) { - invalidHcal = !towerIsoBehindClus.hasActiveHcal(TowersBehindClus, *hcalQuality, *hcalTopology); + invalidHcal = !egammaHadTower::hasActiveHcal(TowersBehindClus, *ctmaph, *hcalQuality, *hcalTopology); } } diff --git a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc index 6af6e397650d1..7d167e0dd83bb 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc @@ -13,11 +13,9 @@ #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" #include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" #include "DataFormats/EgammaReco/interface/ClusterShape.h" #include "DataFormats/EgammaCandidates/interface/PhotonCore.h" #include "DataFormats/EgammaCandidates/interface/Photon.h" -#include "DataFormats/EgammaCandidates/interface/PhotonFwd.h" #include "DataFormats/EgammaCandidates/interface/Conversion.h" #include "DataFormats/EgammaReco/interface/ElectronSeed.h" @@ -277,10 +275,9 @@ void PhotonProducer::fillPhotonCollection(edm::Event& evt, edm::ESHandle<CaloTowerConstituentsMap> ctmaph; es.get<CaloGeometryRecord>().get(ctmaph); - const EgammaHadTower egammaHadTower(*ctmaph); - auto towersBehindCluster = egammaHadTower.towersOf(*scRef); - float hcalDepth1OverEcalBc = egammaHadTower.getDepth1HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); - float hcalDepth2OverEcalBc = egammaHadTower.getDepth2HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); + auto towersBehindCluster = egammaHadTower::towersOf(*scRef, *ctmaph); + float hcalDepth1OverEcalBc = egammaHadTower::getDepth1HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); + float hcalDepth2OverEcalBc = egammaHadTower::getDepth2HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); // recalculate position of seed BasicCluster taking shower depth for unconverted photon math::XYZPoint unconvPos = diff --git a/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc b/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc index 906fe6f05925f..8bfaa7585a10b 100644 --- a/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc +++ b/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc @@ -31,7 +31,7 @@ class SuperClusterImporter : public BlockElementImporterBase { edm::EDGetTokenT<reco::SuperClusterCollection> _srcEB, _srcEE; edm::EDGetTokenT<CaloTowerCollection> _srcTowers; const double _maxHoverE, _pTbyPass, _minSCPt; - std::unique_ptr<EgammaHadTower> _hadTower; + CaloTowerConstituentsMap const* towerMap_; bool _superClustersArePF; static const math::XYZPoint _zero; }; @@ -48,14 +48,12 @@ SuperClusterImporter::SuperClusterImporter(const edm::ParameterSet& conf, edm::C _maxHoverE(conf.getParameter<double>("maximumHoverE")), _pTbyPass(conf.getParameter<double>("minPTforBypass")), _minSCPt(conf.getParameter<double>("minSuperClusterPt")), - _hadTower(nullptr), _superClustersArePF(conf.getParameter<bool>("superClustersArePF")) {} void SuperClusterImporter::updateEventSetup(const edm::EventSetup& es) { edm::ESHandle<CaloTowerConstituentsMap> ctmaph; es.get<CaloGeometryRecord>().get(ctmaph); - - _hadTower = std::make_unique<EgammaHadTower>(*ctmaph); + towerMap_ = ctmaph.product(); } void SuperClusterImporter::importToBlock(const edm::Event& e, BlockElementImporterBase::ElementList& elems) const { @@ -76,9 +74,9 @@ void SuperClusterImporter::importToBlock(const edm::Event& e, BlockElementImport PFBlockElementSCEqual myEqual(scref); auto sc_elem = std::find_if(elems.begin(), SCs_end, myEqual); const double scpT = ptFast(sc->energy(), sc->position(), _zero); - const auto towersBehindCluster = _hadTower->towersOf(*sc); - const double H_tower = (_hadTower->getDepth1HcalESum(towersBehindCluster, towers) + - _hadTower->getDepth2HcalESum(towersBehindCluster, towers)); + const auto towersBehindCluster = egammaHadTower::towersOf(*sc, *towerMap_); + const double H_tower = (egammaHadTower::getDepth1HcalESum(towersBehindCluster, towers) + + egammaHadTower::getDepth2HcalESum(towersBehindCluster, towers)); const double HoverE = H_tower / sc->energy(); if (sc_elem == SCs_end && scpT > _minSCPt && (scpT > _pTbyPass || HoverE < _maxHoverE)) { scbe = new reco::PFBlockElementSuperCluster(scref); @@ -95,9 +93,9 @@ void SuperClusterImporter::importToBlock(const edm::Event& e, BlockElementImport PFBlockElementSCEqual myEqual(scref); auto sc_elem = std::find_if(elems.begin(), SCs_end, myEqual); const double scpT = ptFast(sc->energy(), sc->position(), _zero); - const auto towersBehindCluster = _hadTower->towersOf(*sc); - const double H_tower = (_hadTower->getDepth1HcalESum(towersBehindCluster, towers) + - _hadTower->getDepth2HcalESum(towersBehindCluster, towers)); + const auto towersBehindCluster = egammaHadTower::towersOf(*sc, *towerMap_); + const double H_tower = (egammaHadTower::getDepth1HcalESum(towersBehindCluster, towers) + + egammaHadTower::getDepth2HcalESum(towersBehindCluster, towers)); const double HoverE = H_tower / sc->energy(); if (sc_elem == SCs_end && scpT > _minSCPt && (scpT > _pTbyPass || HoverE < _maxHoverE)) { scbe = new reco::PFBlockElementSuperCluster(scref); From 5b5a4da8595e54d070257e1f652be8e9fae241f1 Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Sun, 18 Oct 2020 14:03:33 +0200 Subject: [PATCH 661/778] modernize ElectronHcalHelper --- .../interface/ElectronHcalHelper.h | 19 +++--- .../src/ElectronHcalHelper.cc | 60 +++++-------------- .../src/GsfElectronAlgo.cc | 7 +-- .../plugins/ElectronSeedProducer.cc | 5 +- 4 files changed, 28 insertions(+), 63 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h index 9995615392b47..9062ef279da22 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h @@ -8,9 +8,9 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h" +#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h" -class EgammaHcalIsolation; -class EgammaTowerIsolation; class EgammaHadTower; class HcalTopology; class HcalChannelQuality; @@ -35,10 +35,9 @@ class ElectronHcalHelper { double hOverEHFMinE; }; - ElectronHcalHelper(const Configuration &); - void checkSetup(const edm::EventSetup &); - void readEvent(const edm::Event &); - ~ElectronHcalHelper(); + ElectronHcalHelper(const Configuration &cfg) : cfg_(cfg) {} + + void beginEvent(const edm::Event &, const edm::EventSetup &); double hcalESum(const reco::SuperCluster &, const std::vector<CaloTowerDetId> *excludeTowers = nullptr) const; double hcalESumDepth1(const reco::SuperCluster &, const std::vector<CaloTowerDetId> *excludeTowers = nullptr) const; @@ -58,15 +57,15 @@ class ElectronHcalHelper { const Configuration cfg_; // event setup data (rechits strategy) - unsigned long long caloGeomCacheId_; + unsigned long long caloGeomCacheId_ = 0; edm::ESHandle<CaloGeometry> caloGeom_; // event data (rechits strategy) - EgammaHcalIsolation *hcalIso_; + std::unique_ptr<EgammaHcalIsolation> hcalIso_ = nullptr; // event data (towers strategy) - EgammaTowerIsolation *towerIso1_; - EgammaTowerIsolation *towerIso2_; + std::unique_ptr<EgammaTowerIsolation> towerIso1_ = nullptr; + std::unique_ptr<EgammaTowerIsolation> towerIso2_ = nullptr; CaloTowerCollection const *towersFromCollection_ = nullptr; CaloTowerConstituentsMap const *towerMap_ = nullptr; HcalChannelQuality const *hcalQuality_ = nullptr; diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc index 45a770bb47288..1d6416407abb5 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc @@ -1,6 +1,4 @@ #include "RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h" -#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h" -#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -9,15 +7,18 @@ using namespace reco; -ElectronHcalHelper::ElectronHcalHelper(const Configuration& cfg) - : cfg_(cfg), caloGeomCacheId_(0), hcalIso_(nullptr), towerIso1_(nullptr), towerIso2_(nullptr) {} - -void ElectronHcalHelper::checkSetup(const edm::EventSetup& es) { +void ElectronHcalHelper::beginEvent(const edm::Event& evt, const edm::EventSetup& es) { if (cfg_.hOverEConeSize == 0) { return; } if (cfg_.useTowers) { + towersFromCollection_ = &evt.get(cfg_.hcalTowers); + towerIso1_ = + std::make_unique<EgammaTowerIsolation>(cfg_.hOverEConeSize, 0., cfg_.hOverEPtMin, 1, towersFromCollection_); + towerIso2_ = + std::make_unique<EgammaTowerIsolation>(cfg_.hOverEConeSize, 0., cfg_.hOverEPtMin, 2, towersFromCollection_); + edm::ESHandle<CaloTowerConstituentsMap> ctmaph; es.get<CaloGeometryRecord>().get(ctmaph); towerMap_ = ctmaph.product(); @@ -28,41 +29,20 @@ void ElectronHcalHelper::checkSetup(const edm::EventSetup& es) { edm::ESHandle<HcalTopology> hcalTopology; es.get<HcalRecNumberingRecord>().get(hcalTopology); hcalTopology_ = hcalTopology.product(); - } else { - unsigned long long newCaloGeomCacheId_ = es.get<CaloGeometryRecord>().cacheIdentifier(); - if (caloGeomCacheId_ != newCaloGeomCacheId_) { - caloGeomCacheId_ = newCaloGeomCacheId_; - es.get<CaloGeometryRecord>().get(caloGeom_); - } - } -} - -void ElectronHcalHelper::readEvent(const edm::Event& evt) { - if (cfg_.hOverEConeSize == 0) { - return; - } - - if (cfg_.useTowers) { - delete towerIso1_; - towerIso1_ = nullptr; - delete towerIso2_; - towerIso2_ = nullptr; - - towersFromCollection_ = &evt.get(cfg_.hcalTowers); - towerIso1_ = new EgammaTowerIsolation(cfg_.hOverEConeSize, 0., cfg_.hOverEPtMin, 1, towersFromCollection_); - towerIso2_ = new EgammaTowerIsolation(cfg_.hOverEConeSize, 0., cfg_.hOverEPtMin, 2, towersFromCollection_); - } else { - delete hcalIso_; - hcalIso_ = nullptr; - edm::Handle<HBHERecHitCollection> hbhe_; if (!evt.getByToken(cfg_.hcalRecHits, hbhe_)) { edm::LogError("ElectronHcalHelper::readEvent") << "failed to get the rechits"; } - hcalIso_ = new EgammaHcalIsolation( + hcalIso_ = std::make_unique<EgammaHcalIsolation>( cfg_.hOverEConeSize, 0., cfg_.hOverEHBMinE, cfg_.hOverEHFMinE, 0., 0., caloGeom_, *hbhe_); + + unsigned long long newCaloGeomCacheId_ = es.get<CaloGeometryRecord>().cacheIdentifier(); + if (caloGeomCacheId_ != newCaloGeomCacheId_) { + caloGeomCacheId_ = newCaloGeomCacheId_; + es.get<CaloGeometryRecord>().get(caloGeom_); + } } } @@ -121,15 +101,3 @@ bool ElectronHcalHelper::hasActiveHcal(const reco::SuperCluster& sc) const { return true; } } - -ElectronHcalHelper::~ElectronHcalHelper() { - if (cfg_.hOverEConeSize == 0) { - return; - } - if (cfg_.useTowers) { - delete towerIso1_; - delete towerIso2_; - } else { - delete hcalIso_; - } -} diff --git a/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc b/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc index f836f8ca2e61d..eac43356a9bac 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc @@ -397,7 +397,6 @@ GsfElectronAlgo::GsfElectronAlgo(const Tokens& input, {} void GsfElectronAlgo::checkSetup(const edm::EventSetup& es) { - hcalHelper_.checkSetup(es); if (cfg_.strategy.useEcalRegression || cfg_.strategy.useCombinationRegression) regHelper_.checkSetup(es); @@ -412,9 +411,6 @@ void GsfElectronAlgo::checkSetup(const edm::EventSetup& es) { GsfElectronAlgo::EventData GsfElectronAlgo::beginEvent(edm::Event const& event, CaloGeometry const& caloGeometry, EcalSeverityLevelAlgo const& ecalSeveretyLevelAlgo) { - // prepare access to hcal data - hcalHelper_.readEvent(event); - auto const& towers = event.get(cfg_.tokens.hcalTowersTag); // Isolation algos @@ -538,6 +534,9 @@ reco::GsfElectronCollection GsfElectronAlgo::completeElectrons(edm::Event const& auto const& trackerGeometry = eventSetup.getData(trackerGeometryToken_); auto const& ecalSeveretyLevelAlgo = eventSetup.getData(ecalSeveretyLevelAlgoToken_); + // prepare access to hcal data + hcalHelper_.beginEvent(event, eventSetup); + checkSetup(eventSetup); auto eventData = beginEvent(event, caloGeometry, ecalSeveretyLevelAlgo); double magneticFieldInTesla = magneticField.inTesla(GlobalPoint(0., 0., 0.)).z(); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc index fbe4a806cb652..751956d20782b 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc @@ -77,7 +77,7 @@ ElectronSeedProducer::ElectronSeedProducer(const edm::ParameterSet& conf) // for H/E applyHOverECut_ = conf.getParameter<bool>("applyHOverECut"); if (applyHOverECut_) { - ElectronHcalHelper::Configuration hcalCfg; + ElectronHcalHelper::Configuration hcalCfg{}; hcalCfg.hOverEConeSize = conf.getParameter<double>("hOverEConeSize"); if (hcalCfg.hOverEConeSize > 0) { hcalCfg.useTowers = true; @@ -116,8 +116,7 @@ void ElectronSeedProducer::produce(edm::Event& e, const edm::EventSetup& iSetup) std::unique_ptr<TrajectorySeedCollection> initialSeedCollectionPtr = nullptr; //created on the fly if (hcalHelper_) { - hcalHelper_->checkSetup(iSetup); - hcalHelper_->readEvent(e); + hcalHelper_->beginEvent(e, iSetup); if (allowHGCal_) { hgcClusterTools_->getEventSetup(iSetup); hgcClusterTools_->getEvent(e); From 372a7f1e45f72b358bd6973c64633d37eb2501e5 Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Sun, 18 Oct 2020 14:40:00 +0200 Subject: [PATCH 662/778] migrate ElectronHcalHelper to esConsumes --- .../interface/ElectronHcalHelper.h | 12 ++-- .../src/ElectronHcalHelper.cc | 55 ++++++++++--------- .../src/GsfElectronAlgo.cc | 12 ++-- .../plugins/ElectronSeedProducer.cc | 2 +- 4 files changed, 44 insertions(+), 37 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h index 9062ef279da22..6d5e9a9c9a5b0 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h @@ -3,6 +3,7 @@ #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -10,7 +11,9 @@ #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h" +#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" +class ConsumesCollector; class EgammaHadTower; class HcalTopology; class HcalChannelQuality; @@ -35,7 +38,7 @@ class ElectronHcalHelper { double hOverEHFMinE; }; - ElectronHcalHelper(const Configuration &cfg) : cfg_(cfg) {} + ElectronHcalHelper(const Configuration &cfg, edm::ConsumesCollector &&cc); void beginEvent(const edm::Event &, const edm::EventSetup &); @@ -56,9 +59,10 @@ class ElectronHcalHelper { private: const Configuration cfg_; - // event setup data (rechits strategy) - unsigned long long caloGeomCacheId_ = 0; - edm::ESHandle<CaloGeometry> caloGeom_; + edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> hcalChannelQualityToken_; + edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> hcalTopologyToken_; + edm::ESGetToken<CaloTowerConstituentsMap, CaloGeometryRecord> towerMapToken_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeometryToken_; // event data (rechits strategy) std::unique_ptr<EgammaHcalIsolation> hcalIso_ = nullptr; diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc index 1d6416407abb5..3799929a7fbb9 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc @@ -3,46 +3,49 @@ #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" -#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" using namespace reco; -void ElectronHcalHelper::beginEvent(const edm::Event& evt, const edm::EventSetup& es) { +ElectronHcalHelper::ElectronHcalHelper(const Configuration& cfg, edm::ConsumesCollector&& cc) : cfg_(cfg) { + if (cfg_.hOverEConeSize == 0) { + return; + } + + if (cfg_.useTowers) { + hcalChannelQualityToken_ = cc.esConsumes(edm::ESInputTag("", "withTopo")); + hcalTopologyToken_ = cc.esConsumes(); + towerMapToken_ = cc.esConsumes(); + } else { + caloGeometryToken_ = cc.esConsumes(); + } +} + +void ElectronHcalHelper::beginEvent(const edm::Event& evt, const edm::EventSetup& eventSetup) { if (cfg_.hOverEConeSize == 0) { return; } if (cfg_.useTowers) { towersFromCollection_ = &evt.get(cfg_.hcalTowers); + + towerMap_ = &eventSetup.getData(towerMapToken_); + hcalQuality_ = &eventSetup.getData(hcalChannelQualityToken_); + hcalTopology_ = &eventSetup.getData(hcalTopologyToken_); + towerIso1_ = std::make_unique<EgammaTowerIsolation>(cfg_.hOverEConeSize, 0., cfg_.hOverEPtMin, 1, towersFromCollection_); towerIso2_ = std::make_unique<EgammaTowerIsolation>(cfg_.hOverEConeSize, 0., cfg_.hOverEPtMin, 2, towersFromCollection_); - - edm::ESHandle<CaloTowerConstituentsMap> ctmaph; - es.get<CaloGeometryRecord>().get(ctmaph); - towerMap_ = ctmaph.product(); - - edm::ESHandle<HcalChannelQuality> hQuality; - es.get<HcalChannelQualityRcd>().get("withTopo", hQuality); - hcalQuality_ = hQuality.product(); - edm::ESHandle<HcalTopology> hcalTopology; - es.get<HcalRecNumberingRecord>().get(hcalTopology); - hcalTopology_ = hcalTopology.product(); } else { - edm::Handle<HBHERecHitCollection> hbhe_; - if (!evt.getByToken(cfg_.hcalRecHits, hbhe_)) { - edm::LogError("ElectronHcalHelper::readEvent") << "failed to get the rechits"; - } - - hcalIso_ = std::make_unique<EgammaHcalIsolation>( - cfg_.hOverEConeSize, 0., cfg_.hOverEHBMinE, cfg_.hOverEHFMinE, 0., 0., caloGeom_, *hbhe_); - - unsigned long long newCaloGeomCacheId_ = es.get<CaloGeometryRecord>().cacheIdentifier(); - if (caloGeomCacheId_ != newCaloGeomCacheId_) { - caloGeomCacheId_ = newCaloGeomCacheId_; - es.get<CaloGeometryRecord>().get(caloGeom_); - } + hcalIso_ = std::make_unique<EgammaHcalIsolation>(cfg_.hOverEConeSize, + 0., + cfg_.hOverEHBMinE, + cfg_.hOverEHFMinE, + 0., + 0., + eventSetup.getHandle(caloGeometryToken_), + evt.get(cfg_.hcalRecHits)); } } diff --git a/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc b/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc index eac43356a9bac..69279f78ff521 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc @@ -383,12 +383,12 @@ GsfElectronAlgo::GsfElectronAlgo(const Tokens& input, tkIsol04CalcCfg_(tkIsol04), tkIsolHEEP03CalcCfg_(tkIsolHEEP03), tkIsolHEEP04CalcCfg_(tkIsolHEEP04), - magneticFieldToken_{cc.esConsumes<MagneticField, IdealMagneticFieldRecord>()}, - caloGeometryToken_{cc.esConsumes<CaloGeometry, CaloGeometryRecord>()}, - caloTopologyToken_{cc.esConsumes<CaloTopology, CaloTopologyRecord>()}, - trackerGeometryToken_{cc.esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()}, - ecalSeveretyLevelAlgoToken_{cc.esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>()}, - hcalHelper_{hcal}, + magneticFieldToken_{cc.esConsumes()}, + caloGeometryToken_{cc.esConsumes()}, + caloTopologyToken_{cc.esConsumes()}, + trackerGeometryToken_{cc.esConsumes()}, + ecalSeveretyLevelAlgoToken_{cc.esConsumes()}, + hcalHelper_{hcal, std::move(cc)}, superClusterErrorFunction_{ std::forward<std::unique_ptr<EcalClusterFunctionBaseClass>>(superClusterErrorFunction)}, crackCorrectionFunction_{std::forward<std::unique_ptr<EcalClusterFunctionBaseClass>>(crackCorrectionFunction)}, diff --git a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc index 751956d20782b..045c74eb6dc74 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc @@ -84,7 +84,7 @@ ElectronSeedProducer::ElectronSeedProducer(const edm::ParameterSet& conf) hcalCfg.hcalTowers = consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("hcalTowers")); hcalCfg.hOverEPtMin = conf.getParameter<double>("hOverEPtMin"); } - hcalHelper_ = std::make_unique<ElectronHcalHelper>(hcalCfg); + hcalHelper_ = std::make_unique<ElectronHcalHelper>(hcalCfg, consumesCollector()); allowHGCal_ = conf.getParameter<bool>("allowHGCal"); if (allowHGCal_) { From 4fec42d4168bad056e7d057a2689e5a3fe2fcc14 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Sun, 18 Oct 2020 16:48:58 +0200 Subject: [PATCH 663/778] Make the list of names as input parameters --- .../interface/MuonOffsetFromDD.h | 6 +- .../plugins/MuonOffsetESProducer.cc | 60 +++++++++++++++- .../MuonNumbering/src/MuonOffsetFromDD.cc | 69 ++++--------------- 3 files changed, 74 insertions(+), 61 deletions(-) diff --git a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h index 92393a51c61d5..5c1d70ae863bf 100644 --- a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h +++ b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h @@ -13,8 +13,7 @@ class MuonOffsetMap; class MuonOffsetFromDD { public: - MuonOffsetFromDD() = default; - virtual ~MuonOffsetFromDD() {} + MuonOffsetFromDD(std::vector<std::string> names); bool build(const DDCompactView*, MuonOffsetMap&); bool build(const cms::DDCompactView*, MuonOffsetMap&); @@ -22,7 +21,8 @@ class MuonOffsetFromDD { private: bool buildParameters(const MuonOffsetMap&); int getNumber(const std::string&, const DDsvalues_type&); - static constexpr int nset_ = 51; + const std::vector<std::string> specpars_; + const unsigned int nset_; }; #endif diff --git a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc index 61be6def12c5e..1652f0e5bb93e 100644 --- a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc +++ b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc @@ -31,6 +31,8 @@ #include "Geometry/MuonNumbering/interface/MuonOffsetFromDD.h" #include <memory> +#include <string> +#include <vector> //#define EDM_ML_DEBUG @@ -45,12 +47,14 @@ class MuonOffsetESProducer : public edm::ESProducer { private: const bool fromDD4Hep_; + const std::vector<std::string> names_; edm::ESGetToken<DDCompactView, IdealGeometryRecord> cpvTokenDDD_; edm::ESGetToken<cms::DDCompactView, IdealGeometryRecord> cpvTokenDD4Hep_; }; MuonOffsetESProducer::MuonOffsetESProducer(const edm::ParameterSet& iConfig) - : fromDD4Hep_(iConfig.getParameter<bool>("fromDD4Hep")) { + : fromDD4Hep_(iConfig.getParameter<bool>("fromDD4Hep")), + names_(iConfig.getParameter<std::vector<std::string> >("names")) { auto cc = setWhatProduced(this); if (fromDD4Hep_) { cpvTokenDD4Hep_ = cc.consumesFrom<cms::DDCompactView, IdealGeometryRecord>(edm::ESInputTag()); @@ -64,7 +68,59 @@ MuonOffsetESProducer::MuonOffsetESProducer(const edm::ParameterSet& iConfig) void MuonOffsetESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; + std::vector<std::string> names = {"MuonCommonNumbering", + "MuonBarrel", + "MuonEndcap", + "MuonBarrelWheels", + "MuonBarrelStation1", + "MuonBarrelStation2", + "MuonBarrelStation3", + "MuonBarrelStation4", + "MuonBarrelSuperLayer", + "MuonBarrelLayer", + "MuonBarrelWire", + "MuonRpcPlane1I", + "MuonRpcPlane1O", + "MuonRpcPlane2I", + "MuonRpcPlane2O", + "MuonRpcPlane3S", + "MuonRpcPlane4", + "MuonRpcChamberLeft", + "MuonRpcChamberMiddle", + "MuonRpcChamberRight", + "MuonRpcEndcap1", + "MuonRpcEndcap2", + "MuonRpcEndcap3", + "MuonRpcEndcap4", + "MuonRpcEndcapSector", + "MuonRpcEndcapChamberB1", + "MuonRpcEndcapChamberB2", + "MuonRpcEndcapChamberB3", + "MuonRpcEndcapChamberC1", + "MuonRpcEndcapChamberC2", + "MuonRpcEndcapChamberC3", + "MuonRpcEndcapChamberE1", + "MuonRpcEndcapChamberE2", + "MuonRpcEndcapChamberE3", + "MuonRpcEndcapChamberF1", + "MuonRpcEndcapChamberF2", + "MuonRpcEndcapChamberF3", + "MuonEndcapStation1", + "MuonEndcapStation2", + "MuonEndcapStation3", + "MuonEndcapStation4", + "MuonEndcapSubrings", + "MuonEndcapSectors", + "MuonEndcapLayers", + "MuonEndcapRing1", + "MuonEndcapRing2", + "MuonEndcapRing3", + "MuonEndcapRingA", + "MuonGEMEndcap", + "MuonGEMSector", + "MuonGEMChamber"}; desc.add<bool>("fromDD4Hep", false); + desc.add<std::vector<std::string>>("names", names); descriptions.add("muonOffsetESProducer", desc); } @@ -74,7 +130,7 @@ MuonOffsetESProducer::ReturnType MuonOffsetESProducer::produce(const IdealGeomet #endif auto ptp = std::make_unique<MuonOffsetMap>(); - MuonOffsetFromDD builder; + MuonOffsetFromDD builder(names_); if (fromDD4Hep_) { #ifdef EDM_ML_DEBUG diff --git a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc index f705ebb7800d6..23506b97db911 100644 --- a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc +++ b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc @@ -10,13 +10,21 @@ //#define EDM_ML_DEBUG +MuonOffsetFromDD::MuonOffsetFromDD(std::vector<std::string> name) : specpars_(name), nset_(name.size()) { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("MuonGeom") << "MuonOffsetFromDD initialized with " << nset_ << " specpars"; +#endif +} + bool MuonOffsetFromDD::build(const DDCompactView* cpv, MuonOffsetMap& php) { +#ifdef EDM_ML_DEBUG edm::LogVerbatim("MuonGeom") << "Inside MuonOffsetFromDD::build(const DDCompactView*, MuonOffsetMap&)"; +#endif // Loop over all the sets std::string attribute = "OnlyForMuonNumbering"; std::string name; - for (int k = 0; k < nset_; ++k) { + for (unsigned int k = 0; k < nset_; ++k) { name = "muonstep" + std::to_string(k); DDSpecificsMatchesValueFilter filter{DDValue(attribute, name, 0)}; DDFilteredView fv(*cpv, filter); @@ -36,71 +44,20 @@ bool MuonOffsetFromDD::build(const DDCompactView* cpv, MuonOffsetMap& php) { bool MuonOffsetFromDD::build(const cms::DDCompactView* cpv, MuonOffsetMap& php) { edm::LogVerbatim("MuonGeom") << "Inside MuonOffsetFromDD::build(const cms::DDCompactView*, MuonOffsetMap&)"; - std::string specpars[nset_] = {"MuonCommonNumbering", - "MuonBarrel", - "MuonEndcap", - "MuonBarrelWheels", - "MuonBarrelStation1", - "MuonBarrelStation2", - "MuonBarrelStation3", - "MuonBarrelStation4", - "MuonBarrelSuperLayer", - "MuonBarrelLayer", - "MuonBarrelWire", - "MuonRpcPlane1I", - "MuonRpcPlane1O", - "MuonRpcPlane2I", - "MuonRpcPlane2O", - "MuonRpcPlane3S", - "MuonRpcPlane4", - "MuonRpcChamberLeft", - "MuonRpcChamberMiddle", - "MuonRpcChamberRight", - "MuonRpcEndcap1", - "MuonRpcEndcap2", - "MuonRpcEndcap3", - "MuonRpcEndcap4", - "MuonRpcEndcapSector", - "MuonRpcEndcapChamberB1", - "MuonRpcEndcapChamberB2", - "MuonRpcEndcapChamberB3", - "MuonRpcEndcapChamberC1", - "MuonRpcEndcapChamberC2", - "MuonRpcEndcapChamberC3", - "MuonRpcEndcapChamberE1", - "MuonRpcEndcapChamberE2", - "MuonRpcEndcapChamberE3", - "MuonRpcEndcapChamberF1", - "MuonRpcEndcapChamberF2", - "MuonRpcEndcapChamberF3", - "MuonEndcapStation1", - "MuonEndcapStation2", - "MuonEndcapStation3", - "MuonEndcapStation4", - "MuonEndcapSubrings", - "MuonEndcapSectors", - "MuonEndcapLayers", - "MuonEndcapRing1", - "MuonEndcapRing2", - "MuonEndcapRing3", - "MuonEndcapRingA", - "MuonGEMEndcap", - "MuonGEMSector", - "MuonGEMChamber"}; // Get the offsets and tags first int offsets[nset_], tags[nset_]; cms::DDFilteredView fv(cpv->detector(), cpv->detector()->worldVolume()); - for (int k = 0; k < nset_; ++k) { - std::vector<int> off = fv.get<std::vector<int>>(specpars[k], "CopyNoOffset"); + for (unsigned int k = 0; k < nset_; ++k) { + std::vector<int> off = fv.get<std::vector<int>>(specpars_[k], "CopyNoOffset"); offsets[k] = (!off.empty()) ? off[0] : 0; - std::vector<int> tag = fv.get<std::vector<int>>(specpars[k], "CopyNoTag"); + std::vector<int> tag = fv.get<std::vector<int>>(specpars_[k], "CopyNoTag"); tags[k] = (!tag.empty()) ? tag[0] : 0; } // Now loop over the detectors std::string attribute = "OnlyForMuonNumbering"; std::string name; - for (int k = 0; k < nset_; ++k) { + for (unsigned int k = 0; k < nset_; ++k) { name = "muonstep" + std::to_string(k); const cms::DDFilter filter(attribute, name); cms::DDFilteredView fv((*cpv), filter); From 0344b4828c9122f33acd0c72d9631dc4c4e58a85 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Sun, 18 Oct 2020 17:00:41 +0200 Subject: [PATCH 664/778] Code check --- .../plugins/MuonOffsetESProducer.cc | 102 +++++++++--------- .../MuonNumbering/src/MuonOffsetFromDD.cc | 1 - 2 files changed, 51 insertions(+), 52 deletions(-) diff --git a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc index 1652f0e5bb93e..2e3664fc619b4 100644 --- a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc +++ b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc @@ -54,7 +54,7 @@ class MuonOffsetESProducer : public edm::ESProducer { MuonOffsetESProducer::MuonOffsetESProducer(const edm::ParameterSet& iConfig) : fromDD4Hep_(iConfig.getParameter<bool>("fromDD4Hep")), - names_(iConfig.getParameter<std::vector<std::string> >("names")) { + names_(iConfig.getParameter<std::vector<std::string>>("names")) { auto cc = setWhatProduced(this); if (fromDD4Hep_) { cpvTokenDD4Hep_ = cc.consumesFrom<cms::DDCompactView, IdealGeometryRecord>(edm::ESInputTag()); @@ -69,56 +69,56 @@ MuonOffsetESProducer::MuonOffsetESProducer(const edm::ParameterSet& iConfig) void MuonOffsetESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; std::vector<std::string> names = {"MuonCommonNumbering", - "MuonBarrel", - "MuonEndcap", - "MuonBarrelWheels", - "MuonBarrelStation1", - "MuonBarrelStation2", - "MuonBarrelStation3", - "MuonBarrelStation4", - "MuonBarrelSuperLayer", - "MuonBarrelLayer", - "MuonBarrelWire", - "MuonRpcPlane1I", - "MuonRpcPlane1O", - "MuonRpcPlane2I", - "MuonRpcPlane2O", - "MuonRpcPlane3S", - "MuonRpcPlane4", - "MuonRpcChamberLeft", - "MuonRpcChamberMiddle", - "MuonRpcChamberRight", - "MuonRpcEndcap1", - "MuonRpcEndcap2", - "MuonRpcEndcap3", - "MuonRpcEndcap4", - "MuonRpcEndcapSector", - "MuonRpcEndcapChamberB1", - "MuonRpcEndcapChamberB2", - "MuonRpcEndcapChamberB3", - "MuonRpcEndcapChamberC1", - "MuonRpcEndcapChamberC2", - "MuonRpcEndcapChamberC3", - "MuonRpcEndcapChamberE1", - "MuonRpcEndcapChamberE2", - "MuonRpcEndcapChamberE3", - "MuonRpcEndcapChamberF1", - "MuonRpcEndcapChamberF2", - "MuonRpcEndcapChamberF3", - "MuonEndcapStation1", - "MuonEndcapStation2", - "MuonEndcapStation3", - "MuonEndcapStation4", - "MuonEndcapSubrings", - "MuonEndcapSectors", - "MuonEndcapLayers", - "MuonEndcapRing1", - "MuonEndcapRing2", - "MuonEndcapRing3", - "MuonEndcapRingA", - "MuonGEMEndcap", - "MuonGEMSector", - "MuonGEMChamber"}; + "MuonBarrel", + "MuonEndcap", + "MuonBarrelWheels", + "MuonBarrelStation1", + "MuonBarrelStation2", + "MuonBarrelStation3", + "MuonBarrelStation4", + "MuonBarrelSuperLayer", + "MuonBarrelLayer", + "MuonBarrelWire", + "MuonRpcPlane1I", + "MuonRpcPlane1O", + "MuonRpcPlane2I", + "MuonRpcPlane2O", + "MuonRpcPlane3S", + "MuonRpcPlane4", + "MuonRpcChamberLeft", + "MuonRpcChamberMiddle", + "MuonRpcChamberRight", + "MuonRpcEndcap1", + "MuonRpcEndcap2", + "MuonRpcEndcap3", + "MuonRpcEndcap4", + "MuonRpcEndcapSector", + "MuonRpcEndcapChamberB1", + "MuonRpcEndcapChamberB2", + "MuonRpcEndcapChamberB3", + "MuonRpcEndcapChamberC1", + "MuonRpcEndcapChamberC2", + "MuonRpcEndcapChamberC3", + "MuonRpcEndcapChamberE1", + "MuonRpcEndcapChamberE2", + "MuonRpcEndcapChamberE3", + "MuonRpcEndcapChamberF1", + "MuonRpcEndcapChamberF2", + "MuonRpcEndcapChamberF3", + "MuonEndcapStation1", + "MuonEndcapStation2", + "MuonEndcapStation3", + "MuonEndcapStation4", + "MuonEndcapSubrings", + "MuonEndcapSectors", + "MuonEndcapLayers", + "MuonEndcapRing1", + "MuonEndcapRing2", + "MuonEndcapRing3", + "MuonEndcapRingA", + "MuonGEMEndcap", + "MuonGEMSector", + "MuonGEMChamber"}; desc.add<bool>("fromDD4Hep", false); desc.add<std::vector<std::string>>("names", names); descriptions.add("muonOffsetESProducer", desc); diff --git a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc index 23506b97db911..f60e15c52153c 100644 --- a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc +++ b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc @@ -44,7 +44,6 @@ bool MuonOffsetFromDD::build(const DDCompactView* cpv, MuonOffsetMap& php) { bool MuonOffsetFromDD::build(const cms::DDCompactView* cpv, MuonOffsetMap& php) { edm::LogVerbatim("MuonGeom") << "Inside MuonOffsetFromDD::build(const cms::DDCompactView*, MuonOffsetMap&)"; - // Get the offsets and tags first int offsets[nset_], tags[nset_]; cms::DDFilteredView fv(cpv->detector(), cpv->detector()->worldVolume()); From 1533e0b0fd7775fce4bf0bed13054b01c844da38 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Sun, 18 Oct 2020 18:01:51 +0200 Subject: [PATCH 665/778] Add a new scenario 2026D74 with V14 HGCal and GE0 --- Configuration/Geometry/README.md | 1 + .../python/GeometryExtended2026D74Reco_cff.py | 59 ++++++++ .../python/GeometryExtended2026D74_cff.py | 13 ++ .../Geometry/python/dict2026Geometry.py | 1 + .../PyReleaseValidation/python/relval_2026.py | 3 + .../python/upgradeWorkflowComponents.py | 9 ++ .../StandardSequences/python/GeometryConf.py | 1 + .../dd4hep/cmsExtendedGeometry2026D74.xml | 126 +++++++++++++++++ .../cmsExtendedGeometry2026D74XML_cfi.py | 130 ++++++++++++++++++ 9 files changed, 343 insertions(+) create mode 100644 Configuration/Geometry/python/GeometryExtended2026D74Reco_cff.py create mode 100644 Configuration/Geometry/python/GeometryExtended2026D74_cff.py create mode 100644 Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D74.xml create mode 100644 Geometry/CMSCommonData/python/cmsExtendedGeometry2026D74XML_cfi.py diff --git a/Configuration/Geometry/README.md b/Configuration/Geometry/README.md index 13ce00ac4a90d..43f60e144b624 100644 --- a/Configuration/Geometry/README.md +++ b/Configuration/Geometry/README.md @@ -85,5 +85,6 @@ Several detector combinations have been generated: * D71 = T21+C14+M7+I11+O7+F6 * D72 = T21+C11+M6+I12+O5+F4 * D73 = T21+C11+M6+I13+O5+F4 +* D74 = T21+C14+M9+I11+O7+F6 D49 is the HLT TDR baseline. diff --git a/Configuration/Geometry/python/GeometryExtended2026D74Reco_cff.py b/Configuration/Geometry/python/GeometryExtended2026D74Reco_cff.py new file mode 100644 index 0000000000000..166ce744342d9 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D74Reco_cff.py @@ -0,0 +1,59 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Configuration.Geometry.GeometryExtended2026D74_cff import * + +# tracker +from Geometry.CommonTopologies.globalTrackingGeometry_cfi import * +from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import * +from Geometry.TrackerGeometryBuilder.trackerParameters_cff import * +from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import * +from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import * +trackerGeometry.applyAlignment = cms.bool(False) + +# calo +from Geometry.CaloEventSetup.HGCalV9Topology_cfi import * +from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import * +from Geometry.CaloEventSetup.CaloTopology_cfi import * +from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import * +CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder", + SelectedCalos = cms.vstring("HCAL", + "ZDC", + "EcalBarrel", + "TOWER", + "HGCalEESensitive", + "HGCalHESiliconSensitive", + "HGCalHEScintillatorSensitive" + ) +) +from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import * +from Geometry.HcalEventSetup.HcalGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import * +from Geometry.HcalEventSetup.CaloTowerTopology_cfi import * +from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import * +from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import * +from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * +from Geometry.EcalMapping.EcalMapping_cfi import * +from Geometry.EcalMapping.EcalMappingRecord_cfi import * + +# muon +from Geometry.MuonNumbering.muonNumberingInitialization_cfi import * +from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.GEMGeometryBuilder.gemGeometry_cfi import * +from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import * +from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import * + +# forward +from Geometry.ForwardGeometry.ForwardGeometry_cfi import * + +# timing +from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import * +from Geometry.MTDGeometryBuilder.mtdParameters_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * +from Geometry.MTDNumberingBuilder.mtdTopology_cfi import * +from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import * +from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import * +mtdGeometry.applyAlignment = cms.bool(False) + diff --git a/Configuration/Geometry/python/GeometryExtended2026D74_cff.py b/Configuration/Geometry/python/GeometryExtended2026D74_cff.py new file mode 100644 index 0000000000000..8ea2129f0f6d9 --- /dev/null +++ b/Configuration/Geometry/python/GeometryExtended2026D74_cff.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +from Geometry.CMSCommonData.cmsExtendedGeometry2026D74XML_cfi import * +from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi import * +from Geometry.EcalCommonData.ecalSimulationParameters_cff import * +from Geometry.HcalCommonData.hcalDDDSimConstants_cff import * +from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import * +from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import * +from Geometry.MuonNumbering.muonGeometryConstants_cff import * +from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import * diff --git a/Configuration/Geometry/python/dict2026Geometry.py b/Configuration/Geometry/python/dict2026Geometry.py index 3f399daef8d58..6ea0aeebe76d4 100644 --- a/Configuration/Geometry/python/dict2026Geometry.py +++ b/Configuration/Geometry/python/dict2026Geometry.py @@ -1234,6 +1234,7 @@ ("O7","T21","C14","M7","F6","I11") : "D71", ("O5","T21","C11","M6","F4","I12") : "D72", ("O5","T21","C11","M6","F4","I13") : "D73", + ("O7","T21","C14","M9","F6","I11") : "D74", } deprecatedDets = set([ "D1", "D2", "D3", "D5", "D6" , "D7", "D4", "D8" , "D9", "D12", "D13", "D15", "D10", "D11", "D14", "D16", "D17", "D18", "D19", "D20", "D21", "D22", "D23", "D24", "D25", "D26", "D27", "D28", "D29", "D30", "D31", "D32", "D33", "D34", "D36", "D37", "D38", "D39", "D40", "D42", "D35", "D41", "D43", "D44", "D45", "D46", "D48", "D47", "D51", "D52", "D53", "D54", "D55", "D56", "D57", "D58", "D59", "D61", "D62", "D63" ]) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index e023aaf2653d8..b7016acf8ce50 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -28,6 +28,9 @@ numWFIB.extend([31834.0]) #2026D69 numWFIB.extend([32234.0]) #2026D70 numWFIB.extend([32634.0]) #2026D71 +numWFIB.extend([33034.0]) #2026D72 +numWFIB.extend([33434.0]) #2026D73 +numWFIB.extend([33834.0]) #2026D74 for numWF in numWFIB: workflows[numWF] = _upgrade_workflows[numWF] diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 0abe3e53bad20..a6717b2931603 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -52,6 +52,8 @@ '2026D72PU', '2026D73', '2026D73PU', + '2026D74', + '2026D74PU', ] # pre-generation of WF numbers @@ -1011,6 +1013,13 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C11', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], }, + '2026D74' : { + 'Geom' : 'Extended2026D74', + 'HLTmenu': '@fake2', + 'GT' : 'auto:phase2_realistic_T21', + 'Era' : 'Phase2C11M9', + 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal'], + }, } # standard PU sequences diff --git a/Configuration/StandardSequences/python/GeometryConf.py b/Configuration/StandardSequences/python/GeometryConf.py index 141e692b3587e..6bee24d01d875 100644 --- a/Configuration/StandardSequences/python/GeometryConf.py +++ b/Configuration/StandardSequences/python/GeometryConf.py @@ -44,4 +44,5 @@ 'Extended2026D71' : 'Extended2026D71,Extended2026D71Reco', 'Extended2026D72' : 'Extended2026D72,Extended2026D72Reco', 'Extended2026D73' : 'Extended2026D73,Extended2026D73Reco', + 'Extended2026D74' : 'Extended2026D74,Extended2026D74Reco', } diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D74.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D74.xml new file mode 100644 index 0000000000000..7c4018a93c4f4 --- /dev/null +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2026D74.xml @@ -0,0 +1,126 @@ +<?xml version="1.0"?> +<DDDefinition> + <open_geometry/> + <close_geometry/> + + <IncludeSection> + <Include ref='Geometry/CMSCommonData/data/materials/2021/v1/materials.xml'/> + <Include ref='Geometry/CMSCommonData/data/rotations.xml'/> + <Include ref='Geometry/CMSCommonData/data/extend/v2/cmsextent.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml'/> + <Include ref='Geometry/CMSCommonData/data/cms/2026/v5/cms.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMother.xml'/> + <Include ref='Geometry/CMSCommonData/data/eta3/etaMax.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsTracker.xml'/> + <Include ref='Geometry/CMSCommonData/data/caloBase/2026/v5/caloBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsCalo.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsMuon.xml'/> + <Include ref='Geometry/CMSCommonData/data/mgnt.xml'/> + <Include ref='Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml'/> + <Include ref='Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMB.xml'/> + <Include ref='Geometry/CMSCommonData/data/muonMagnet.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml'/> + <Include ref='Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml'/> + <Include ref='Geometry/TrackerCommonData/data/pixfwdCommon.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/trackermaterial.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml'/> + <Include ref='Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml'/> + <Include ref='Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml'/> + <Include ref='SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml'/> + <Include ref='Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml'/> + <Include ref='Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml'/> + <Include ref='Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebalgo.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebcon.xml'/> + <Include ref='Geometry/EcalCommonData/data/ebrot.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalrotations.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalbarrelalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalouteralgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalforwardalgo.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml'/> + <Include ref='Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcal/v14/hgcal.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml'/> + <Include ref='Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml'/> + <Include ref='Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> + <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/mf/2026/v7/mf.xml'/> + <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> + <Include ref='Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> + <Include ref='Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml'/> + <Include ref='Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml'/> + <Include ref='Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml'/> + <Include ref='Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcmaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumimaterials.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdcrotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/lumirotations.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdc.xml'/> + <Include ref='Geometry/ForwardCommonData/data/zdclumi.xml'/> + <Include ref='Geometry/ForwardCommonData/data/cmszdc.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml'/> + <Include ref='Geometry/MTDCommonData/data/btl/v1/btl.xml'/> + <Include ref='Geometry/MTDCommonData/data/etl/v3/etl.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml'/> + <Include ref='Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v3/muonNumbering.xml'/> + <Include ref='Geometry/EcalSimData/data/PhaseII/ecalsens.xml'/> + <Include ref='Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml'/> + <Include ref='Geometry/HcalSimData/data/hf.xml'/> + <Include ref='Geometry/HcalSimData/data/hfpmt.xml'/> + <Include ref='Geometry/HcalSimData/data/hffibrebundle.xml'/> + <Include ref='Geometry/HcalSimData/data/CaloUtil.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcsensv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml'/> + <Include ref='Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml'/> + <Include ref='Geometry/CSCGeometryBuilder/data/cscSpecs.xml'/> + <Include ref='Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v12/GEMSpecsFilter.xml'/> + <Include ref='Geometry/GEMGeometryBuilder/data/v12/GEMSpecs.xml'/> + <Include ref='Geometry/ForwardCommonData/data/brmsens.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcsens.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdsens.xml'/> + <Include ref='Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml'/> + <Include ref='Geometry/EcalSimData/data/EcalProdCuts.xml'/> + <Include ref='Geometry/HGCalSimData/data/hgcProdCutsv9.xml'/> + <Include ref='Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/zdcProdCuts.xml'/> + <Include ref='Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml'/> + <Include ref='Geometry/MTDSimData/data/v1/mtdProdCuts.xml'/> + <Include ref='Geometry/CMSCommonData/data/FieldParameters.xml'/> + </IncludeSection> +</DDDefinition> diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D74XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D74XML_cfi.py new file mode 100644 index 0000000000000..6f504d6dcbe97 --- /dev/null +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2026D74XML_cfi.py @@ -0,0 +1,130 @@ +import FWCore.ParameterSet.Config as cms + +# This config was generated automatically using generate2026Geometry.py +# If you notice a mistake, please update the generating script, not just this config + +XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials/2021/v1/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml', + 'Geometry/CMSCommonData/data/cavernData/2021/v1/cavernData.xml', + 'Geometry/CMSCommonData/data/cms/2026/v5/cms.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', + 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/caloBase/2026/v5/caloBase.xml', + 'Geometry/CMSCommonData/data/cmsCalo.xml', + 'Geometry/CMSCommonData/data/muonBase/2026/v5/muonBase.xml', + 'Geometry/CMSCommonData/data/cmsMuon.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/CMSCommonData/data/beampipe/2026/v3/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam/2026/v1/cmsBeam.xml', + 'Geometry/CMSCommonData/data/muonMB.xml', + 'Geometry/CMSCommonData/data/muonMagnet.xml', + 'Geometry/CMSCommonData/data/cavern/2021/v1/cavern.xml', + 'Geometry/CMSCommonData/data/cavernFloor/2017/v1/cavernFloor.xml', + 'Geometry/TrackerCommonData/data/PhaseII/trackerParameters.xml', + 'Geometry/TrackerCommonData/data/pixfwdCommon.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/pixbar.xml', + 'Geometry/TrackerCommonData/data/trackermaterial.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker616_2020_04/otst.xml', + 'Geometry/TrackerCommonData/data/PhaseII/OuterTracker800_2020_07/tracker.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker615/pixel.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerbar.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerfwd.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker404/trackerStructureTopology.xml', + 'Geometry/TrackerCommonData/data/PhaseII/TiltedTracker613/pixelStructureTopology.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackersens.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelsens.xml', + 'Geometry/TrackerRecoData/data/PhaseII/OuterTracker616_2020_04/trackerRecoMaterial.xml', + 'SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/trackerProdCuts.xml', + 'Geometry/TrackerSimData/data/PhaseII/TiltedTracker404/pixelProdCuts.xml', + 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', + 'Geometry/EcalCommonData/data/eregalgo/2026/v2/eregalgo.xml', + 'Geometry/EcalCommonData/data/ectkcable/2026/v1/ectkcable.xml', + 'Geometry/EcalCommonData/data/ectkcablemat/2026/v1/ectkcablemat.xml', + 'Geometry/EcalCommonData/data/ebalgo.xml', + 'Geometry/EcalCommonData/data/ebcon.xml', + 'Geometry/EcalCommonData/data/ebrot.xml', + 'Geometry/HcalCommonData/data/hcalrotations.xml', + 'Geometry/HcalCommonData/data/hcal/v2/hcalalgo.xml', + 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo/v2/hcalcablealgo.xml', + 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', + 'Geometry/HcalCommonData/data/hcalSimNumbering/NoHE/hcalSimNumbering.xml', + 'Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', + 'Geometry/HGCalCommonData/data/hgcalMaterial/v1/hgcalMaterial.xml', + 'Geometry/HGCalCommonData/data/hgcal/v14/hgcal.xml', + 'Geometry/HGCalCommonData/data/hgcalcell/v9/hgcalcell.xml', + 'Geometry/HGCalCommonData/data/hgcalwafer/v9/hgcalwafer.xml', + 'Geometry/HGCalCommonData/data/hgcalEE/v14/hgcalEE.xml', + 'Geometry/HGCalCommonData/data/hgcalHEsil/v14/hgcalHEsil.xml', + 'Geometry/HGCalCommonData/data/hgcalHEmix/v14/hgcalHEmix.xml', + 'Geometry/HGCalCommonData/data/hgcalCons/v14/hgcalCons.xml', + 'Geometry/HGCalCommonData/data/hgcalConsData/v13/hgcalConsData.xml', + 'Geometry/MuonCommonData/data/mbCommon/2021/v1/mbCommon.xml', + 'Geometry/MuonCommonData/data/mb1/2015/v2/mb1.xml', + 'Geometry/MuonCommonData/data/mb2/2015/v2/mb2.xml', + 'Geometry/MuonCommonData/data/mb3/2015/v2/mb3.xml', + 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', + 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', + 'Geometry/MuonCommonData/data/muonYoke/2026/v1/muonYoke.xml', + 'Geometry/MuonCommonData/data/mf/2026/v7/mf.xml', + 'Geometry/MuonCommonData/data/csc/2021/v2/csc.xml', + 'Geometry/MuonCommonData/data/rpcf/2026/v3/rpcf.xml', + 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', + 'Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml', + 'Geometry/MuonCommonData/data/gem21/TDR_Eta16/gem21.xml', + 'Geometry/MuonCommonData/data/mfshield/2026/v5/mfshield.xml', + 'Geometry/MuonCommonData/data/ge0/TDR_Dev/v3/ge0.xml', + 'Geometry/ForwardCommonData/data/forwardshield/2026/v4/forwardshield.xml', + 'Geometry/ForwardCommonData/data/brmrotations.xml', + 'Geometry/ForwardCommonData/data/brm/2026/v1/brm.xml', + 'Geometry/ForwardCommonData/data/zdcmaterials.xml', + 'Geometry/ForwardCommonData/data/lumimaterials.xml', + 'Geometry/ForwardCommonData/data/zdcrotations.xml', + 'Geometry/ForwardCommonData/data/lumirotations.xml', + 'Geometry/ForwardCommonData/data/zdc.xml', + 'Geometry/ForwardCommonData/data/zdclumi.xml', + 'Geometry/ForwardCommonData/data/cmszdc.xml', + 'Geometry/MTDCommonData/data/mtdMaterial/v1/mtdMaterial.xml', + 'Geometry/MTDCommonData/data/btl/v1/btl.xml', + 'Geometry/MTDCommonData/data/etl/v3/etl.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdStructureTopology.xml', + 'Geometry/MTDCommonData/data/mtdParameters/v1/mtdParameters.xml', + )+ + cms.vstring( + 'Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v3/muonNumbering.xml', + 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', + 'Geometry/HcalCommonData/data/hcalsens/NoHE/hcalsenspmf.xml', + 'Geometry/HcalSimData/data/hf.xml', + 'Geometry/HcalSimData/data/hfpmt.xml', + 'Geometry/HcalSimData/data/hffibrebundle.xml', + 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsensv9.xml', + 'Geometry/MuonSimData/data/PhaseII/v2/muonSens.xml', + 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', + 'Geometry/CSCGeometryBuilder/data/cscSpecs.xml', + 'Geometry/RPCGeometryBuilder/data/2026/v1/RPCSpecs.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecsFilter.xml', + 'Geometry/GEMGeometryBuilder/data/v12/GEMSpecs.xml', + 'Geometry/ForwardCommonData/data/brmsens.xml', + 'Geometry/ForwardSimData/data/zdcsens.xml', + 'Geometry/MTDSimData/data/v1/mtdsens.xml', + 'Geometry/HcalSimData/data/HcalProdCuts/2021/v1/HcalProdCuts.xml', + 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCutsv9.xml', + 'Geometry/MuonSimData/data/PhaseII/muonProdCuts.xml', + 'Geometry/ForwardSimData/data/zdcProdCuts.xml', + 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', + 'Geometry/MTDSimData/data/v1/mtdProdCuts.xml', + 'Geometry/CMSCommonData/data/FieldParameters.xml', + ), + rootNodeName = cms.string('cms:OCMS') +) From f1bfc2e94ef4afd96324a553db93a1d5dc304072 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov <slava77@cern.ch> Date: Sun, 18 Oct 2020 17:03:48 +0200 Subject: [PATCH 666/778] remove hgcal local reco from reconstruction_trackingOnlyTask for trackingPhase2PU140 --- Configuration/StandardSequences/python/Reconstruction_cff.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Configuration/StandardSequences/python/Reconstruction_cff.py b/Configuration/StandardSequences/python/Reconstruction_cff.py index 24776960bc877..4428ffc6bd0c9 100644 --- a/Configuration/StandardSequences/python/Reconstruction_cff.py +++ b/Configuration/StandardSequences/python/Reconstruction_cff.py @@ -209,6 +209,9 @@ logErrorHarvester.includeModules = cms.untracked.vstring(set(_modulesInReconstruction)) reconstruction_trackingOnlyTask = cms.Task(localrecoTask,globalreco_trackingTask) +#calo parts removed as long as tracking is not running jetCore in phase2 +trackingPhase2PU140.toReplaceWith(reconstruction_trackingOnlyTask, + reconstruction_trackingOnlyTask.copyAndExclude([hgcalLocalRecoTask,castorreco])) reconstruction_trackingOnly = cms.Sequence(reconstruction_trackingOnlyTask) reconstruction_pixelTrackingOnlyTask = cms.Task( pixeltrackerlocalrecoTask, From 5e03f73729fb82be14b0c2bd9a7445100b512724 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Mon, 19 Oct 2020 03:12:12 +0900 Subject: [PATCH 667/778] GEMDigiToRawModule - fix AMC size in packing only 12 AMCs can be readout GEMRawToDigiModule - fix gem digi bx --- .../plugins/GEMDigiToRawModule.cc | 128 +++++++++--------- .../plugins/GEMRawToDigiModule.cc | 43 ++++-- EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc | 4 + 3 files changed, 98 insertions(+), 77 deletions(-) diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index f9160ca142dcf..41011b3ed4745 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -52,9 +52,9 @@ DEFINE_FWK_MODULE(GEMDigiToRawModule); using namespace gem; GEMDigiToRawModule::GEMDigiToRawModule(const edm::ParameterSet& pset) - : event_type_(pset.getParameter<int>("eventType")), - digi_token(consumes<GEMDigiCollection>(pset.getParameter<edm::InputTag>("gemDigi"))), - useDBEMap_(pset.getParameter<bool>("useDBEMap")) { + : event_type_(pset.getParameter<int>("eventType")), + digi_token(consumes<GEMDigiCollection>(pset.getParameter<edm::InputTag>("gemDigi"))), + useDBEMap_(pset.getParameter<bool>("useDBEMap")) { produces<FEDRawDataCollection>(); if (useDBEMap_) { gemEMapToken_ = esConsumes<GEMeMap, GEMeMapRcd, edm::Transition::BeginRun>(); @@ -123,37 +123,36 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } } - for (unsigned int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXGEMFEDID; ++fedId) { + for (unsigned int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXME0FEDID; ++fedId) { uint32_t amc13EvtLength = 0; std::unique_ptr<AMC13Event> amc13Event = std::make_unique<AMC13Event>(); - for (auto const& gemBx : gemBxMap) { - int bx = gemBx.first; - GEMDigiCollection inBxGemDigis = gemBx.second; - - for (uint8_t amcNum = 0; amcNum < GEMeMap::maxAMCs_; ++amcNum) { - uint32_t amcSize = 0; - std::unique_ptr<AMCdata> amcData = std::make_unique<AMCdata>(); - - for (uint8_t gebId = 0; gebId < GEMeMap::maxGEBs_; ++gebId) { - std::unique_ptr<GEBdata> gebData = std::make_unique<GEBdata>(); - GEMROMapping::chamEC geb_ec{fedId, amcNum, gebId}; - - if (!gemROMap->isValidChamber(geb_ec)) - continue; - GEMROMapping::chamDC geb_dc = gemROMap->chamberPos(geb_ec); - - auto vfats = gemROMap->getVfats(geb_dc.detId); - for (auto const& vfat_ec : vfats) { - GEMROMapping::vfatDC vfat_dc = gemROMap->vfatPos(vfat_ec); - GEMDetId gemId = vfat_dc.detId; - uint16_t vfatId = vfat_ec.vfatAdd; - - bool hasDigi = false; - + for (uint8_t amcNum = 0; amcNum < GEMeMap::maxAMCs_; ++amcNum) { + uint32_t amcSize = 0; + std::unique_ptr<AMCdata> amcData = std::make_unique<AMCdata>(); + + for (uint8_t gebId = 0; gebId < GEMeMap::maxGEBs_; ++gebId) { + std::unique_ptr<GEBdata> gebData = std::make_unique<GEBdata>(); + GEMROMapping::chamEC geb_ec{fedId, amcNum, gebId}; + + if (!gemROMap->isValidChamber(geb_ec)) + continue; + GEMROMapping::chamDC geb_dc = gemROMap->chamberPos(geb_ec); + + auto vfats = gemROMap->getVfats(geb_dc.detId); + for (auto const& vfat_ec : vfats) { + GEMROMapping::vfatDC vfat_dc = gemROMap->vfatPos(vfat_ec); + GEMDetId gemId = vfat_dc.detId; + uint16_t vfatId = vfat_ec.vfatAdd; + + for (auto const& gemBx : gemBxMap) { + int bc = BX_id + gemBx.first; + + bool hasDigi = false; uint64_t lsData = 0; ///<channels from 1to64 uint64_t msData = 0; ///<channels from 65to128 - + + GEMDigiCollection inBxGemDigis = gemBx.second; const GEMDigiCollection::Range& range = inBxGemDigis.get(gemId); for (GEMDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) { const GEMDigi& digi = (*digiIt); @@ -174,46 +173,46 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve msData |= 1UL << (chMap.chNum - 64); LogDebug("GEMDigiToRawModule") - << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) - << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId - << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); + << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) + << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId + << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); } if (!hasDigi) continue; // only make vfat with hits amcSize += 3; - auto vfatData = std::make_unique<VFATdata>(geb_dc.vfatVer, bx, 0, vfatId, lsData, msData); + auto vfatData = std::make_unique<VFATdata>(geb_dc.vfatVer, bc, 0, vfatId, lsData, msData); gebData->addVFAT(*vfatData); - - } // end of vfats in GEB - - if (!gebData->vFATs()->empty()) { - amcSize += 2; - gebData->setChamberHeader(gebData->vFATs()->size() * 3, gebId); - gebData->setChamberTrailer(0, 0, gebData->vFATs()->size() * 3); - amcData->addGEB(*gebData); } + + } // end of vfats in GEB + + if (!gebData->vFATs()->empty()) { + amcSize += 2; + gebData->setChamberHeader(gebData->vFATs()->size() * 3, gebId); + gebData->setChamberTrailer(LV1_id, BX_id, gebData->vFATs()->size() * 3); + amcData->addGEB(*gebData); + } + } // end of GEB loop + + if (!amcData->gebs()->empty()) { + amcSize += 5; + amcData->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); + amcData->setAMCheader2(amcNum, OrN, 1); + amcData->setGEMeventHeader(amcData->gebs()->size(), 0); + LogDebug("GEMDigiToRawModule") << "davCnt: "<< int(amcData->davCnt()); + amc13Event->addAMCpayload(*amcData); + // AMC header in AMC13Event + uint8_t Blk_No = 0; + uint8_t AMC_No = 0; + uint16_t BoardID = 0; + amc13Event->addAMCheader(amcSize, Blk_No, AMC_No, BoardID); + amc13EvtLength += amcSize + 1; // AMC data size + AMC header size + } - } // end of GEB loop - - if (!amcData->gebs()->empty()) { - amcSize += 5; - amcData->setAMCheader1(amcSize, bx, LV1_id, amcNum); - amcData->setAMCheader2(amcNum, OrN, 1); - amcData->setGEMeventHeader(amcData->gebs()->size(), 0); - amc13Event->addAMCpayload(*amcData); - // AMC header in AMC13Event - uint8_t Blk_No = 0; - uint8_t AMC_No = 0; - uint16_t BoardID = 0; - amc13Event->addAMCheader(amcSize, Blk_No, AMC_No, BoardID); - amc13EvtLength += amcSize + 1; // AMC data size + AMC header size - } - - } // end of AMC loop - } // end of BX loop - + } // end of AMC loop + if (!amc13Event->getAMCpayloads()->empty()) { // CDFHeader amc13Event->setCDFHeader(event_type_, LV1_id, BX_id, fedId); @@ -226,9 +225,14 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve LogDebug("GEMDigiToRawModule") << " EvtLength: " << int(EvtLength); amc13Event->setCDFTrailer(EvtLength); + LogDebug("GEMDigiToRawModule") << "getAMCpayloads: "<< amc13Event->getAMCpayloads()->size(); + LogDebug("GEMDigiToRawModule") << " nAMC: "<< int(amc13Event->nAMC()) + << " LV1_id: "<< int(LV1_id) + << " BX_id: "<< int(BX_id); + amc13Events.emplace_back(std::move(amc13Event)); } // finished making amc13Event data - } // end of FED loop + }// end of FED loop // read out amc13Events into fedRawData for (const auto& amc13e : amc13Events) { @@ -270,7 +274,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve uint64_t* w = reinterpret_cast<uint64_t*>(fedRawData.data()); for (const auto& word : words) { - LogDebug("GEMDigiToRawModule") << std::bitset<64>(word); + //std::cout << std::bitset<64>(word) <<std::endl; *(w++) = word; } LogDebug("GEMDigiToRawModule") << " words " << words.size(); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index 1b5cedabe0e3a..504038d7f03a5 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -57,10 +57,10 @@ DEFINE_FWK_MODULE(GEMRawToDigiModule); using namespace gem; GEMRawToDigiModule::GEMRawToDigiModule(const edm::ParameterSet& pset) - : fed_token(consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("InputLabel"))), - useDBEMap_(pset.getParameter<bool>("useDBEMap")), - unPackStatusDigis_(pset.getParameter<bool>("unPackStatusDigis")), - gemRawToDigi_(std::make_unique<GEMRawToDigi>()) { + : fed_token(consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("InputLabel"))), + useDBEMap_(pset.getParameter<bool>("useDBEMap")), + unPackStatusDigis_(pset.getParameter<bool>("unPackStatusDigis")), + gemRawToDigi_(std::make_unique<GEMRawToDigi>()) { produces<GEMDigiCollection>(); if (unPackStatusDigis_) { produces<GEMVfatStatusDigiCollection>("vfatStatus"); @@ -122,14 +122,25 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve const uint64_t* word = reinterpret_cast<const uint64_t*>(data); + // const uint64_t* w = word; + // for (int i =0; i< nWords;i++) { + // std::cout << std::bitset<64>(*(w++)) << std::endl; + // } + auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); - if (amc13Event == nullptr) + if (amc13Event == nullptr){ + LogDebug("GEMRawToDigiModule") << "amc13Event does not exists"; continue; - + } + LogDebug("GEMRawToDigiModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() << " orbitNumber:" << iEvent.orbitNumber(); + LogDebug("GEMRawToDigiModule") << "AMC13 bx:" << amc13Event->bxId() << " lv1Id:" << int(amc13Event->lv1Id()) << " orbitNumber:" << amc13Event->orbitNumber(); + // Read AMC data for (auto amcData : *(amc13Event->getAMCpayloads())) { + uint16_t amcBx = amcData.bx(); uint8_t amcNum = amcData.amcNum(); + LogDebug("GEMRawToDigiModule") << "AMC bx:" << int(amcData.bx()) << " lv1Id:" << int(amcData.l1A()) << " orbitNumber:" << int(amcData.orbitNum()); // Read GEB data for (auto gebData : *amcData.gebs()) { @@ -137,6 +148,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve GEMROMapping::chamEC geb_ec = {fedId, amcNum, gebId}; GEMROMapping::chamDC geb_dc = gemROMap->chamberPos(geb_ec); GEMDetId gemChId = geb_dc.detId; + LogDebug("GEMRawToDigiModule") << "GEB bx:" << int(gebData.bcOH()) << " lv1Id:" << int(gebData.ecOH()); //Read vfat data for (auto vfatData : *gebData.vFATs()) { @@ -147,18 +159,18 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // check if ChipID exists. if (!gemROMap->isValidChipID(vfat_ec)) { edm::LogWarning("GEMRawToDigiModule") - << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId) << " vfatId " << int(vfatId) - << " vfat Pos " << int(vfatData.position()); + << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId) << " vfatId " << int(vfatId) + << " vfat Pos " << int(vfatData.position()); continue; } // check vfat data if (vfatData.quality()) { edm::LogWarning("GEMRawToDigiModule") - << "Quality " << int(vfatData.quality()) << " b1010 " << int(vfatData.b1010()) << " b1100 " - << int(vfatData.b1100()) << " b1110 " << int(vfatData.b1110()); + << "Quality " << int(vfatData.quality()) << " b1010 " << int(vfatData.b1010()) << " b1100 " + << int(vfatData.b1100()) << " b1110 " << int(vfatData.b1110()); if (vfatData.crc() != vfatData.checkCRC()) { edm::LogWarning("GEMRawToDigiModule") - << "DIFFERENT CRC :" << vfatData.crc() << " " << vfatData.checkCRC(); + << "DIFFERENT CRC :" << vfatData.crc() << " " << vfatData.checkCRC(); } } @@ -166,7 +178,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve vfatData.setPhi(vfat_dc.localPhi); GEMDetId gemId = vfat_dc.detId; - int bx(vfatData.bc()); + int bx = vfatData.bc()-amcBx; for (int chan = 0; chan < VFATdata::nChannels; ++chan) { uint8_t chan0xf = 0; @@ -186,10 +198,11 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve GEMDigi digi(stripId, bx); + LogDebug("GEMRawToDigiModule") << "VFATbx:" << int(vfatData.bc()) << " lv1Id:" << int(vfatData.ec()); LogDebug("GEMRawToDigiModule") - << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) << " vfat:" << vfat_dc.localPhi - << ",type: " << vfat_dc.vfatType << " id:" << gemId << " ch:" << chMap.chNum << " st:" << digi.strip() - << " bx:" << digi.bx(); + << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) << " vfat:" << vfat_dc.localPhi + << ",type: " << vfat_dc.vfatType << " id:" << gemId << " ch:" << chMap.chNum << " st:" << digi.strip() + << " bx:" << digi.bx(); outGEMDigis.get()->insertDigi(gemId, digi); diff --git a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc index 9409da674cbe0..95344cce2aae1 100644 --- a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc +++ b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc @@ -2,6 +2,7 @@ * \author J. Lee, Yechan Kang - UoS */ #include "EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" using namespace gem; @@ -12,6 +13,7 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t amc13Event->setAMC13Header(*(++word)); // Readout out AMC headers + LogDebug("GEMRawToDigi") << "nAMC: "<< int(amc13Event->nAMC()); for (uint8_t i = 0; i < amc13Event->nAMC(); ++i) amc13Event->addAMCheader(*(++word)); @@ -22,11 +24,13 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t amcData.setAMCheader2(*(++word)); amcData.setGEMeventHeader(*(++word)); + LogDebug("GEMRawToDigi") << "davCnt: "<< int(amcData.davCnt()); // Fill GEB for (uint8_t j = 0; j < amcData.davCnt(); ++j) { auto gebData = GEBdata(); gebData.setChamberHeader(*(++word)); + LogDebug("GEMRawToDigi") << "vfatWordCnt: "<< int(gebData.vfatWordCnt()); // Fill vfat for (uint16_t k = 0; k < gebData.vfatWordCnt() / 3; k++) { auto vfatData = VFATdata(); From 066c85943151405087a00ad3ad6a0c0415737ec3 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Mon, 19 Oct 2020 03:46:17 +0900 Subject: [PATCH 668/778] remove commented code --- EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc | 1 - EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 41011b3ed4745..62a5ea4f1910f 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -274,7 +274,6 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve uint64_t* w = reinterpret_cast<uint64_t*>(fedRawData.data()); for (const auto& word : words) { - //std::cout << std::bitset<64>(word) <<std::endl; *(w++) = word; } LogDebug("GEMDigiToRawModule") << " words " << words.size(); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index 504038d7f03a5..6522d4dc163f2 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -118,15 +118,9 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve if (nWords < 5) continue; + const unsigned char* data = fedData.data(); - const uint64_t* word = reinterpret_cast<const uint64_t*>(data); - - // const uint64_t* w = word; - // for (int i =0; i< nWords;i++) { - // std::cout << std::bitset<64>(*(w++)) << std::endl; - // } - auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); if (amc13Event == nullptr){ From bc718678e1f599bcbbfc3b5cf91ccf7cd42376cb Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Sun, 18 Oct 2020 10:42:05 -0500 Subject: [PATCH 669/778] Added PSetTemplate to allow description of a PSet This is used in conjunction with required or optional functionality to describe the allowed parameters of a PSet. --- FWCore/ParameterSet/python/Config.py | 6 ++- FWCore/ParameterSet/python/Mixins.py | 4 ++ FWCore/ParameterSet/python/Types.py | 73 +++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/FWCore/ParameterSet/python/Config.py b/FWCore/ParameterSet/python/Config.py index 218dc66ec151d..60e12a2f127e3 100644 --- a/FWCore/ParameterSet/python/Config.py +++ b/FWCore/ParameterSet/python/Config.py @@ -1990,7 +1990,9 @@ def __init__(self,*arg,**args): def testProcessDumpPython(self): self.assertEqual(Process("test").dumpPython(), -"""import FWCore.ParameterSet.Config as cms\n\nprocess = cms.Process("test") +"""import FWCore.ParameterSet.Config as cms + +process = cms.Process("test") process.maxEvents = cms.untracked.PSet( input = cms.optional.untracked.int32, @@ -2011,7 +2013,7 @@ def testProcessDumpPython(self): emptyRunLumiMode = cms.obsolete.untracked.string, eventSetup = cms.untracked.PSet( forceNumberOfConcurrentIOVs = cms.untracked.PSet( - + allowAnyLabel_=cms.required.untracked.uint32 ), numberOfConcurrentIOVs = cms.untracked.uint32(1) ), diff --git a/FWCore/ParameterSet/python/Mixins.py b/FWCore/ParameterSet/python/Mixins.py index 390adf5812e07..aa53cf042104d 100644 --- a/FWCore/ParameterSet/python/Mixins.py +++ b/FWCore/ParameterSet/python/Mixins.py @@ -364,6 +364,10 @@ def dumpPython(self, options=PrintOptions()): # usings need to go first resultList = usings resultList.extend(others) + if self.__validator is not None: + options.indent() + resultList.append(options.indentation()+"allowAnyLabel_="+self.__validator.dumpPython(options)) + options.unindent() return ',\n'.join(resultList)+'\n' def __repr__(self): return self.dumpPython() diff --git a/FWCore/ParameterSet/python/Types.py b/FWCore/ParameterSet/python/Types.py index 6b9c9b3156d52..f2f857e4a85be 100644 --- a/FWCore/ParameterSet/python/Types.py +++ b/FWCore/ParameterSet/python/Types.py @@ -59,6 +59,8 @@ def __setattr__(self,name, value): if v is not None: return setattr(v,name,value) else: + if not name.startswith('_'): + raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name)) return object.__setattr__(self, name, value) def __bool__(self): v = self.__dict__.get('_ProxyParameter__value',None) @@ -71,7 +73,9 @@ def dumpPython(self, options=PrintOptions()): v = "cms."+self._dumpPythonName() if not _ParameterTypeBase.isTracked(self): v+=".untracked" - return v+'.'+self.__type.__name__ + if hasattr(self.__type, "__name__"): + return v+'.'+self.__type.__name__ + return v+'.'+self.__type.dumpPython(options) def validate_(self,value): return isinstance(value,self.__type) def convert_(self,value): @@ -138,6 +142,19 @@ def __call__(self,value): raise RuntimeError("Cannot convert "+str(value)+" to 'allowed' type") return chosenType(value) +class _PSetTemplate(object): + def __init__(self, *args, **kargs): + self._pset = PSet(*args,**kargs) + self.__dict__['_PSetTemplate__value'] = None + def __call__(self, value): + self.__dict__ + return self._pset.clone(**value) + def dumpPython(self, options=PrintOptions()): + v =self.__dict__.get('_ProxyParameter__value',None) + if v is not None: + return v.dumpPython(options) + return "PSetTemplate(\n"+_Parameterizable.dumpPython(self._pset, options)+options.indentation()+")" + class _ProxyParameterFactory(object): """Class type for ProxyParameter types to allow nice syntax""" @@ -160,7 +177,17 @@ def __call__(self, *args): return self.type(_AllowedParameterTypes(*args)) return _AllowedWrapper(self.__isUntracked, self.__type) - + if name == 'PSetTemplate': + class _PSetTemplateWrapper(object): + def __init__(self, untracked, type): + self.untracked = untracked + self.type = type + def __call__(self,*args,**kargs): + if self.untracked: + return untracked(self.type(_PSetTemplate(*args,**kargs))) + return self.type(_PSetTemplate(*args,**kargs)) + return _PSetTemplateWrapper(self.__isUntracked, self.__type) + type = globals()[name] if not issubclass(type, _ParameterTypeBase): raise AttributeError @@ -1859,6 +1886,27 @@ def testRequired(self): self.assertEqual(p1.foo.value(),3) self.failIf(p1.foo.isTracked()) self.assertRaises(ValueError,setattr,p1, 'bar', 'bad') + #PSetTemplate use + p1 = PSet(aPSet = required.PSetTemplate()) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.required.PSetTemplate(\n\n )\n)') + p1.aPSet = dict() + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.PSet(\n\n )\n)') + p1 = PSet(aPSet=required.PSetTemplate(a=required.int32)) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.required.PSetTemplate(\n a = cms.required.int32\n )\n)') + p1.aPSet = dict(a=5) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.PSet(\n a = cms.int32(5)\n )\n)') + self.assertEqual(p1.aPSet.a.value(), 5) + p1 = PSet(aPSet=required.untracked.PSetTemplate(a=required.int32)) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.required.untracked.PSetTemplate(\n a = cms.required.int32\n )\n)') + p1.aPSet = dict(a=5) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.untracked.PSet(\n a = cms.int32(5)\n )\n)') + self.assertEqual(p1.aPSet.a.value(), 5) + p1 = PSet(allowAnyLabel_=required.PSetTemplate(a=required.int32)) + self.assertEqual(p1.dumpPython(), 'cms.PSet(\n allowAnyLabel_=cms.required.PSetTemplate(\n a = cms.required.int32\n )\n)') + p1.foo = dict(a=5) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n foo = cms.PSet(\n a = cms.int32(5)\n ),\n allowAnyLabel_=cms.required.PSetTemplate(\n a = cms.required.int32\n )\n)') + self.assertEqual(p1.foo.a.value(), 5) + def testOptional(self): p1 = PSet(anInt = optional.int32) self.assert_(hasattr(p1,"anInt")) @@ -1887,6 +1935,27 @@ def testOptional(self): self.failIf(p1.f) p1.f.append(3) self.assert_(p1.f) + #PSetTemplate use + p1 = PSet(aPSet = optional.PSetTemplate()) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.optional.PSetTemplate(\n\n )\n)') + p1.aPSet = dict() + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.PSet(\n\n )\n)') + p1 = PSet(aPSet=optional.PSetTemplate(a=optional.int32)) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.optional.PSetTemplate(\n a = cms.optional.int32\n )\n)') + p1.aPSet = dict(a=5) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.PSet(\n a = cms.int32(5)\n )\n)') + self.assertEqual(p1.aPSet.a.value(), 5) + p1 = PSet(aPSet=optional.untracked.PSetTemplate(a=optional.int32)) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.optional.untracked.PSetTemplate(\n a = cms.optional.int32\n )\n)') + p1.aPSet = dict(a=5) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n aPSet = cms.untracked.PSet(\n a = cms.int32(5)\n )\n)') + self.assertEqual(p1.aPSet.a.value(), 5) + p1 = PSet(allowAnyLabel_=optional.PSetTemplate(a=optional.int32)) + self.assertEqual(p1.dumpPython(), 'cms.PSet(\n allowAnyLabel_=cms.optional.PSetTemplate(\n a = cms.optional.int32\n )\n)') + p1.foo = dict(a=5) + self.assertEqual(p1.dumpPython(),'cms.PSet(\n foo = cms.PSet(\n a = cms.int32(5)\n ),\n allowAnyLabel_=cms.optional.PSetTemplate(\n a = cms.optional.int32\n )\n)') + self.assertEqual(p1.foo.a.value(), 5) + def testAllowed(self): p1 = PSet(aValue = required.allowed(int32, string)) From 6aa2342a490eeed37ad08640564621a057dfdd03 Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar <tkmudholkar@gmail.com> Date: Sun, 18 Oct 2020 23:12:56 +0200 Subject: [PATCH 670/778] Removed reset statement to make code compatible with concurrent lumis processing. --- .../interface/ESIntegrityTask.h | 1 + .../src/ESIntegrityTask.cc | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h b/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h index cae60b4fc63b2..69288e831622c 100644 --- a/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h +++ b/DQM/EcalPreshowerMonitorModule/interface/ESIntegrityTask.h @@ -11,6 +11,7 @@ struct ESLSCache { int ievtLS_; + int DIErrorsLS_[2][2][40][40]; }; class ESIntegrityTask : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<ESLSCache>> { diff --git a/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc b/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc index 413787ab97e6f..1963366538a46 100644 --- a/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc +++ b/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc @@ -74,10 +74,12 @@ std::shared_ptr<ESLSCache> ESIntegrityTask::globalBeginLuminosityBlock(const edm auto lumiCache = std::make_shared<ESLSCache>(); lumiCache->ievtLS_ = 0; if (doLumiAnalysis_) { - for (int i = 0; i < 2; ++i) { - for (int j = 0; j < 2; ++j) { - if (meDIErrors_[i][j]) { - meDIErrors_[i][j]->Reset(); + for (int iz = 0; iz < 2; ++iz) { + for (int ip = 0; ip < 2; ++ip) { + for (int ix = 0; ix < 40; ++ix) { + for (int iy = 0; iy < 40; ++iy) { + (lumiCache->DIErrorsLS_)[iz][ip][ix][iy] = 0; + } } } } @@ -312,8 +314,11 @@ void ESIntegrityTask::analyze(const Event& e, const EventSetup& c) { if (fed_[iz][ip][ix][iy] == -1) continue; - if (nDIErr[fed_[iz][ip][ix][iy] - 520][fiber_[iz][ip][ix][iy]] > 0) + if (nDIErr[fed_[iz][ip][ix][iy] - 520][fiber_[iz][ip][ix][iy]] > 0) { meDIErrors_[iz][ip]->Fill(ix + 1, iy + 1, 1); + if (doLumiAnalysis_) + (lumiCache->DIErrorsLS_)[iz][ip][ix][iy] += 1; + } } } // @@ -329,11 +334,9 @@ void ESIntegrityTask::calculateDIFraction(const edm::LuminosityBlock& lumi, cons float nValidChannelsES = 0; float nGlobalErrorsES = 0; float reportSummaryES = -1; - if (!meDIErrors_[i][j]) - continue; for (int x = 0; x < 40; ++x) { for (int y = 0; y < 40; ++y) { - float val = meDIErrors_[i][j]->getBinContent(x + 1, y + 1); + float val = 1.0*((lumiCache->DIErrorsLS_)[i][j][x][y]); if (fed_[i][j][x][y] == -1) continue; if ((lumiCache->ievtLS_) != 0) From 548ed0cb3049b022bb86e5700d82848f06567106 Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Mon, 19 Oct 2020 00:48:24 +0200 Subject: [PATCH 671/778] implement review comments and less template parameters --- .../interface/ElectronHcalHelper.h | 11 ++++++-- .../src/ElectronHcalHelper.cc | 16 +---------- .../src/TrajSeedMatcher.cc | 11 +++----- .../plugins/ElectronNHitSeedProducer.cc | 2 +- ...ammaHLTBcHcalIsolationProducersRegional.cc | 8 +++--- .../plugins/EgammaHLTGsfTrackVarProducer.cc | 4 +-- .../interface/EgammaHadTower.h | 8 +++--- .../EgammaEcalRecHitIsolationProducer.cc | 4 +-- .../plugins/EleIsoDetIdCollectionProducer.cc | 4 +-- .../plugins/GamIsoDetIdCollectionProducer.cc | 4 +-- .../src/EgammaHadTower.cc | 28 +++++++++---------- .../src/ConversionProducer.cc | 7 ++--- .../src/ConversionTrackProducer.cc | 2 +- .../src/ConvertedPhotonProducer.cc | 2 +- .../src/GEDPhotonProducer.cc | 8 +++--- .../src/PhotonProducer.cc | 6 ++-- .../src/ReducedEGProducer.cc | 2 +- .../EgammaTools/src/HGCalEgammaIDHelper.cc | 2 +- .../plugins/ElectronHEEPIDValueMapProducer.cc | 2 +- .../plugins/importers/SuperClusterImporter.cc | 12 ++++---- 20 files changed, 64 insertions(+), 79 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h index 6d5e9a9c9a5b0..40d3474b794ba 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h @@ -10,6 +10,7 @@ #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h" +#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h" #include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" @@ -48,9 +49,13 @@ class ElectronHcalHelper { double hOverEConeSize() const { return cfg_.hOverEConeSize; } // Behind clusters - std::vector<CaloTowerDetId> hcalTowersBehindClusters(const reco::SuperCluster &sc) const; - double hcalESumDepth1BehindClusters(const std::vector<CaloTowerDetId> &towers) const; - double hcalESumDepth2BehindClusters(const std::vector<CaloTowerDetId> &towers) const; + inline auto hcalTowersBehindClusters(const reco::SuperCluster &sc) const { return egamma::towersOf(sc, *towerMap_); } + inline auto hcalESumDepth1BehindClusters(const std::vector<CaloTowerDetId> &towers) const { + return egamma::depth1HcalESum(towers, *towersFromCollection_); + } + inline auto hcalESumDepth2BehindClusters(const std::vector<CaloTowerDetId> &towers) const { + return egamma::depth2HcalESum(towers, *towersFromCollection_); + } // forward EgammaHadTower methods, if checkHcalStatus is enabled, using towers and H/E // otherwise, return true diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc index 3799929a7fbb9..d37dd87742ca3 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronHcalHelper.cc @@ -1,5 +1,4 @@ #include "RecoEgamma/EgammaElectronAlgos/interface/ElectronHcalHelper.h" -#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" @@ -49,18 +48,6 @@ void ElectronHcalHelper::beginEvent(const edm::Event& evt, const edm::EventSetup } } -std::vector<CaloTowerDetId> ElectronHcalHelper::hcalTowersBehindClusters(const reco::SuperCluster& sc) const { - return egammaHadTower::towersOf(sc, *towerMap_); -} - -double ElectronHcalHelper::hcalESumDepth1BehindClusters(const std::vector<CaloTowerDetId>& towers) const { - return egammaHadTower::getDepth1HcalESum(towers, *towersFromCollection_); -} - -double ElectronHcalHelper::hcalESumDepth2BehindClusters(const std::vector<CaloTowerDetId>& towers) const { - return egammaHadTower::getDepth2HcalESum(towers, *towersFromCollection_); -} - double ElectronHcalHelper::hcalESum(const SuperCluster& sc, const std::vector<CaloTowerDetId>* excludeTowers) const { if (cfg_.hOverEConeSize == 0) { return 0; @@ -98,8 +85,7 @@ double ElectronHcalHelper::hcalESumDepth2(const SuperCluster& sc, bool ElectronHcalHelper::hasActiveHcal(const reco::SuperCluster& sc) const { if (cfg_.checkHcalStatus && cfg_.hOverEConeSize != 0 && cfg_.useTowers) { - return egammaHadTower::hasActiveHcal( - egammaHadTower::towersOf(sc, *towerMap_), *towerMap_, *hcalQuality_, *hcalTopology_); + return egamma::hasActiveHcal(egamma::towersOf(sc, *towerMap_), *towerMap_, *hcalQuality_, *hcalTopology_); } else { return true; } diff --git a/RecoEgamma/EgammaElectronAlgos/src/TrajSeedMatcher.cc b/RecoEgamma/EgammaElectronAlgos/src/TrajSeedMatcher.cc index ade7a3f3d0d11..0b19c11b65c8f 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/TrajSeedMatcher.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/TrajSeedMatcher.cc @@ -81,13 +81,10 @@ namespace { }; // namespace TrajSeedMatcher::Configuration::Configuration(const edm::ParameterSet& pset, edm::ConsumesCollector&& cc) - : magFieldToken{cc.esConsumes<MagneticField, IdealMagneticFieldRecord>()}, - paramMagFieldToken{ - cc.esConsumes<MagneticField, IdealMagneticFieldRecord>(pset.getParameter<edm::ESInputTag>("paramMagField"))}, - navSchoolToken{ - cc.esConsumes<NavigationSchool, NavigationSchoolRecord>(pset.getParameter<edm::ESInputTag>("navSchool"))}, - detLayerGeomToken{ - cc.esConsumes<DetLayerGeometry, RecoGeometryRecord>(pset.getParameter<edm::ESInputTag>("detLayerGeom"))}, + : magFieldToken{cc.esConsumes()}, + paramMagFieldToken{cc.esConsumes(pset.getParameter<edm::ESInputTag>("paramMagField"))}, + navSchoolToken{cc.esConsumes(pset.getParameter<edm::ESInputTag>("navSchool"))}, + detLayerGeomToken{cc.esConsumes(pset.getParameter<edm::ESInputTag>("detLayerGeom"))}, useRecoVertex{pset.getParameter<bool>("useRecoVertex")}, enableHitSkipping{pset.getParameter<bool>("enableHitSkipping")}, requireExactMatchCount{pset.getParameter<bool>("requireExactMatchCount")}, diff --git a/RecoEgamma/EgammaElectronProducers/plugins/ElectronNHitSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/ElectronNHitSeedProducer.cc index b36e7a7bb81e7..dc2e17270188b 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/ElectronNHitSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/ElectronNHitSeedProducer.cc @@ -85,7 +85,7 @@ ElectronNHitSeedProducer::ElectronNHitSeedProducer(const edm::ParameterSet& pset beamSpotToken_(consumes<reco::BeamSpot>(pset.getParameter<edm::InputTag>("beamSpot"))), measTkEvtToken_(consumes<MeasurementTrackerEvent>(pset.getParameter<edm::InputTag>("measTkEvt"))), putToken_{produces<reco::ElectronSeedCollection>()}, - trackerTopologyToken_{esConsumes<TrackerTopology, TrackerTopologyRcd>()} { + trackerTopologyToken_{esConsumes()} { for (const auto& scTag : pset.getParameter<std::vector<edm::InputTag>>("superClusters")) { superClustersTokens_.emplace_back(consumes<std::vector<reco::SuperClusterRef>>(scTag)); } diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc index 03a11ca81d1fc..147796fb5b2b6 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTBcHcalIsolationProducersRegional.cc @@ -135,8 +135,8 @@ void EgammaHLTBcHcalIsolationProducersRegional::produce(edm::StreamID, float isol = 0; - auto towersBehindCluster = useSingleTower_ ? egammaHadTower::towersOf(*(recoEcalCandRef->superCluster()), *ctmaph) - : std::vector<CaloTowerDetId>{}; + auto towersBehindCluster = + useSingleTower_ ? egamma::towersOf(*(recoEcalCandRef->superCluster()), *ctmaph) : std::vector<CaloTowerDetId>{}; if (doEtSum_) { //calculate hcal isolation excluding the towers behind the cluster which will be used for H for H/E const EgammaTowerIsolation isolAlgo(outerCone_, innerCone_, etMin_, depth_, &caloTowers); @@ -149,8 +149,8 @@ void EgammaHLTBcHcalIsolationProducersRegional::produce(edm::StreamID, } else { //calcuate H for H/E if (useSingleTower_) - isol = egammaHadTower::getDepth1HcalESum(towersBehindCluster, caloTowers) + - egammaHadTower::getDepth2HcalESum(towersBehindCluster, caloTowers); + isol = egamma::depth1HcalESum(towersBehindCluster, caloTowers) + + egamma::depth2HcalESum(towersBehindCluster, caloTowers); else { auto const &sc = recoEcalCandRef->superCluster().get(); isol = towerIso1.getTowerESum(sc) + towerIso2.getTowerESum(sc); diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc index f2d045d397de0..b2fd95688325c 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc @@ -73,8 +73,8 @@ EgammaHLTGsfTrackVarProducer::EgammaHLTGsfTrackVarProducer(const edm::ParameterS electronToken_{consumes<reco::ElectronCollection>(config.getParameter<edm::InputTag>("inputCollection"))}, gsfTrackToken_{consumes<reco::GsfTrackCollection>(config.getParameter<edm::InputTag>("inputCollection"))}, beamSpotToken_{consumes<reco::BeamSpot>(config.getParameter<edm::InputTag>("beamSpotProducer"))}, - magneticFieldToken_{esConsumes<MagneticField, IdealMagneticFieldRecord>()}, - trackerGeometryToken_{esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()}, + magneticFieldToken_{esConsumes()}, + trackerGeometryToken_{esConsumes()}, upperTrackNrToRemoveCut_{config.getParameter<int>("upperTrackNrToRemoveCut")}, lowerTrackNrToRemoveCut_{config.getParameter<int>("lowerTrackNrToRemoveCut")}, useDefaultValuesForBarrel_{config.getParameter<bool>("useDefaultValuesForBarrel")}, diff --git a/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h b/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h index 3b39d482d15e4..3f53209a678a3 100644 --- a/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h +++ b/RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h @@ -12,11 +12,11 @@ class HcalChannelQuality; -namespace egammaHadTower { +namespace egamma { enum class HoeMode { SingleTower = 0, TowersBehindCluster = 1 }; - double getDepth1HcalESum(std::vector<CaloTowerDetId> const& towers, CaloTowerCollection const&); - double getDepth2HcalESum(std::vector<CaloTowerDetId> const& towers, CaloTowerCollection const&); + double depth1HcalESum(std::vector<CaloTowerDetId> const& towers, CaloTowerCollection const&); + double depth2HcalESum(std::vector<CaloTowerDetId> const& towers, CaloTowerCollection const&); std::vector<CaloTowerDetId> towersOf(reco::SuperCluster const& sc, CaloTowerConstituentsMap const& towerMap, @@ -28,6 +28,6 @@ namespace egammaHadTower { CaloTowerConstituentsMap const& towerMap, HcalChannelQuality const& hcalQuality, HcalTopology const& hcalTopology); -}; // namespace egammaHadTower +}; // namespace egamma #endif diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalRecHitIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalRecHitIsolationProducer.cc index 441d09846add7..79d0d867cf48a 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalRecHitIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalRecHitIsolationProducer.cc @@ -48,8 +48,8 @@ EgammaEcalRecHitIsolationProducer::EgammaEcalRecHitIsolationProducer(const edm:: vetoClustered_ = conf_.getParameter<bool>("vetoClustered"); //EventSetup Tokens - sevLvToken_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>(); - caloGeometrytoken_ = esConsumes<CaloGeometry, CaloGeometryRecord>(); + sevLvToken_ = esConsumes(); + caloGeometrytoken_ = esConsumes(); //register your products produces<edm::ValueMap<double>>(); diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EleIsoDetIdCollectionProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EleIsoDetIdCollectionProducer.cc index e384e2558d763..0dd33d9d539a3 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EleIsoDetIdCollectionProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EleIsoDetIdCollectionProducer.cc @@ -27,8 +27,8 @@ EleIsoDetIdCollectionProducer::EleIsoDetIdCollectionProducer(const edm::ParameterSet& iConfig) : recHitsToken_(consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitsLabel"))), emObjectToken_(consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("emObjectLabel"))), - caloGeometryToken_(esConsumes<CaloGeometry, CaloGeometryRecord>()), - sevLvToken_(esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>()), + caloGeometryToken_(esConsumes()), + sevLvToken_(esConsumes()), recHitsLabel_(iConfig.getParameter<edm::InputTag>("recHitsLabel")), emObjectLabel_(iConfig.getParameter<edm::InputTag>("emObjectLabel")), energyCut_(iConfig.getParameter<double>("energyCut")), diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/GamIsoDetIdCollectionProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/GamIsoDetIdCollectionProducer.cc index 06d71063e2894..46e1847859271 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/GamIsoDetIdCollectionProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/GamIsoDetIdCollectionProducer.cc @@ -27,8 +27,8 @@ GamIsoDetIdCollectionProducer::GamIsoDetIdCollectionProducer(const edm::ParameterSet& iConfig) : recHitsToken_(consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitsLabel"))), emObjectToken_(consumes<reco::PhotonCollection>(iConfig.getParameter<edm::InputTag>("emObjectLabel"))), - caloGeometryToken_(esConsumes<CaloGeometry, CaloGeometryRecord>()), - sevLvToken_(esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>()), + caloGeometryToken_(esConsumes()), + sevLvToken_(esConsumes()), //the labels are still used to decide if its endcap or barrel... recHitsLabel_(iConfig.getParameter<edm::InputTag>("recHitsLabel")), emObjectLabel_(iConfig.getParameter<edm::InputTag>("emObjectLabel")), diff --git a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc index 7c20b6ecf3993..7316b99b12bf2 100644 --- a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc +++ b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc @@ -7,7 +7,7 @@ #include <iostream> #include <algorithm> -CaloTowerDetId egammaHadTower::towerOf(const reco::CaloCluster& cluster, CaloTowerConstituentsMap const& towerMap) { +CaloTowerDetId egamma::towerOf(const reco::CaloCluster& cluster, CaloTowerConstituentsMap const& towerMap) { DetId detid = cluster.seed(); if (detid.det() != DetId::Ecal) { // Basic clusters of hybrid super-cluster do not have the seed set; take the first DetId instead @@ -22,9 +22,9 @@ CaloTowerDetId egammaHadTower::towerOf(const reco::CaloCluster& cluster, CaloTow return id; } -std::vector<CaloTowerDetId> egammaHadTower::towersOf(const reco::SuperCluster& sc, - CaloTowerConstituentsMap const& towerMap, - HoeMode mode) { +std::vector<CaloTowerDetId> egamma::towersOf(const reco::SuperCluster& sc, + CaloTowerConstituentsMap const& towerMap, + HoeMode mode) { constexpr unsigned int nMaxClusters = 4; std::vector<CaloTowerDetId> towers; @@ -70,8 +70,7 @@ std::vector<CaloTowerDetId> egammaHadTower::towersOf(const reco::SuperCluster& s return towers; } -double egammaHadTower::getDepth1HcalESum(const std::vector<CaloTowerDetId>& towers, - CaloTowerCollection const& towerCollection) { +double egamma::depth1HcalESum(const std::vector<CaloTowerDetId>& towers, CaloTowerCollection const& towerCollection) { double esum = 0.; for (auto const& tower : towerCollection) { if (std::find(towers.begin(), towers.end(), tower.id()) != towers.end()) { @@ -81,8 +80,7 @@ double egammaHadTower::getDepth1HcalESum(const std::vector<CaloTowerDetId>& towe return esum; } -double egammaHadTower::getDepth2HcalESum(const std::vector<CaloTowerDetId>& towers, - CaloTowerCollection const& towerCollection) { +double egamma::depth2HcalESum(const std::vector<CaloTowerDetId>& towers, CaloTowerCollection const& towerCollection) { double esum = 0.; for (auto const& tower : towerCollection) { if (std::find(towers.begin(), towers.end(), tower.id()) != towers.end()) { @@ -92,10 +90,10 @@ double egammaHadTower::getDepth2HcalESum(const std::vector<CaloTowerDetId>& towe return esum; } -bool egammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, - CaloTowerConstituentsMap const& towerMap, - const HcalChannelQuality& hcalQuality, - HcalTopology const& hcalTopology) { +bool egamma::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, + CaloTowerConstituentsMap const& towerMap, + const HcalChannelQuality& hcalQuality, + HcalTopology const& hcalTopology) { bool active = false; int statusMask = ((1 << HcalChannelStatus::HcalCellOff) | (1 << HcalChannelStatus::HcalCellMask) | (1 << HcalChannelStatus::HcalCellDead)); @@ -113,9 +111,9 @@ bool egammaHadTower::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, if (hid.subdet() != HcalBarrel && hid.subdet() != HcalEndcap) continue; #ifdef EDM_ML_DEBUG - std::cout << "egammaHadTower DetId " << std::hex << id.rawId() << " hid.rawId " << hid.rawId() << std::dec - << " sub " << hid.subdet() << " ieta " << hid.ieta() << " iphi " << hid.iphi() << " depth " - << hid.depth() << std::endl; + std::cout << "egamma DetId " << std::hex << id.rawId() << " hid.rawId " << hid.rawId() << std::dec << " sub " + << hid.subdet() << " ieta " << hid.ieta() << " iphi " << hid.iphi() << " depth " << hid.depth() + << std::endl; #endif // Sunanda's fix for 2017 Plan1 // and removed protection diff --git a/RecoEgamma/EgammaPhotonProducers/src/ConversionProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ConversionProducer.cc index 36570c064d5b8..eabf52700a163 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ConversionProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ConversionProducer.cc @@ -97,10 +97,9 @@ ConversionProducer::ConversionProducer(const edm::ParameterSet& iConfig) vertexProducer_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("primaryVertexProducer")); - transientTrackBuilder_ = - esConsumes<TransientTrackBuilder, TransientTrackRecord>(edm::ESInputTag("", "TransientTrackBuilder")); - trackerGeometry_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>(); - magneticField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + transientTrackBuilder_ = esConsumes(edm::ESInputTag("", "TransientTrackBuilder")); + trackerGeometry_ = esConsumes(); + magneticField_ = esConsumes(); //Track-cluster matching eta and phi cuts dEtaTkBC_ = iConfig.getParameter<double>("dEtaTrackBC"); //TODO research on cut endcap/barrel diff --git a/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackProducer.cc index 4cc20ec2e5687..b9493bac510e2 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackProducer.cc @@ -45,7 +45,7 @@ ConversionTrackProducer::ConversionTrackProducer(edm::ParameterSet const& conf) kfTrajectories = consumes<TrajTrackAssociationCollection>(thetp); gsfTrajectories = consumes<TrajGsfTrackAssociationCollection>(thetp); } - magFieldToken = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + magFieldToken = esConsumes(); produces<reco::ConversionTrackCollection>(); } diff --git a/RecoEgamma/EgammaPhotonProducers/src/ConvertedPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ConvertedPhotonProducer.cc index 75a7d27332d6d..10eea77618598 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ConvertedPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ConvertedPhotonProducer.cc @@ -87,7 +87,7 @@ ConvertedPhotonProducer::ConvertedPhotonProducer(const edm::ParameterSet& config risolveAmbiguity_ = conf_.getParameter<bool>("risolveConversionAmbiguity"); likelihoodWeights_ = conf_.getParameter<std::string>("MVA_weights_location"); - caloGeomToken_ = esConsumes<CaloGeometry, CaloGeometryRecord>(); + caloGeomToken_ = esConsumes(); mFToken_ = esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>(); transientTrackToken_ = esConsumes<TransientTrackBuilder, TransientTrackRecord, edm::Transition::BeginRun>( edm::ESInputTag("", "TransientTrackBuilder")); diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index aab84415ccca7..9a644ca10ed98 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -518,12 +518,12 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, edm::ESHandle<HcalTopology> hcalTopology; es.get<HcalRecNumberingRecord>().get(hcalTopology); - TowersBehindClus = egammaHadTower::towersOf(*scRef, *ctmaph); - hcalDepth1OverEcalBc = egammaHadTower::getDepth1HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); - hcalDepth2OverEcalBc = egammaHadTower::getDepth2HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); + TowersBehindClus = egamma::towersOf(*scRef, *ctmaph); + hcalDepth1OverEcalBc = egamma::depth1HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); + hcalDepth2OverEcalBc = egamma::depth2HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy(); if (checkHcalStatus_ && hcalDepth1OverEcalBc == 0 && hcalDepth2OverEcalBc == 0) { - invalidHcal = !egammaHadTower::hasActiveHcal(TowersBehindClus, *ctmaph, *hcalQuality, *hcalTopology); + invalidHcal = !egamma::hasActiveHcal(TowersBehindClus, *ctmaph, *hcalQuality, *hcalTopology); } } diff --git a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc index 7d167e0dd83bb..b1949ced9411e 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc @@ -275,9 +275,9 @@ void PhotonProducer::fillPhotonCollection(edm::Event& evt, edm::ESHandle<CaloTowerConstituentsMap> ctmaph; es.get<CaloGeometryRecord>().get(ctmaph); - auto towersBehindCluster = egammaHadTower::towersOf(*scRef, *ctmaph); - float hcalDepth1OverEcalBc = egammaHadTower::getDepth1HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); - float hcalDepth2OverEcalBc = egammaHadTower::getDepth2HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); + auto towersBehindCluster = egamma::towersOf(*scRef, *ctmaph); + float hcalDepth1OverEcalBc = egamma::depth1HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); + float hcalDepth2OverEcalBc = egamma::depth2HcalESum(towersBehindCluster, hcalTowers) / scRef->energy(); // recalculate position of seed BasicCluster taking shower depth for unconverted photon math::XYZPoint unconvPos = diff --git a/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc index 7879bd216e99d..4a7e5f6523421 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc @@ -99,7 +99,7 @@ ReducedEGProducer::ReducedEGProducer(const edm::ParameterSet& config) relinkGsfElectronSel_(config.getParameter<std::string>("relinkGsfElectrons")), hcalHitSel_(config.getParameter<edm::ParameterSet>("hcalHitSel"), consumesCollector()) { const edm::InputTag& aTag = config.getParameter<edm::InputTag>("ootPhotons"); - caloTopology_ = esConsumes<CaloTopology, CaloTopologyRecord>(); + caloTopology_ = esConsumes(); if (not aTag.label().empty()) ootPhotonT_ = consumes<reco::PhotonCollection>(aTag); diff --git a/RecoEgamma/EgammaTools/src/HGCalEgammaIDHelper.cc b/RecoEgamma/EgammaTools/src/HGCalEgammaIDHelper.cc index 0a3a929da50d4..2ae1e66ea1418 100644 --- a/RecoEgamma/EgammaTools/src/HGCalEgammaIDHelper.cc +++ b/RecoEgamma/EgammaTools/src/HGCalEgammaIDHelper.cc @@ -16,7 +16,7 @@ HGCalEgammaIDHelper::HGCalEgammaIDHelper(const edm::ParameterSet& iConfig, edm:: recHitsFH_ = iC.consumes<HGCRecHitCollection>(fhRecHitInputTag_); recHitsBH_ = iC.consumes<HGCRecHitCollection>(bhRecHitInputTag_); hitMap_ = iC.consumes<std::unordered_map<DetId, const HGCRecHit*>>(hitMapInputTag_); - caloGeometry_ = iC.esConsumes<CaloGeometry, CaloGeometryRecord>(); + caloGeometry_ = iC.esConsumes(); pcaHelper_.setdEdXWeights(dEdXWeights_); debug_ = iConfig.getUntrackedParameter<bool>("debug", false); } diff --git a/RecoEgamma/ElectronIdentification/plugins/ElectronHEEPIDValueMapProducer.cc b/RecoEgamma/ElectronIdentification/plugins/ElectronHEEPIDValueMapProducer.cc index 4539cd23fef14..d1cce43138b3c 100644 --- a/RecoEgamma/ElectronIdentification/plugins/ElectronHEEPIDValueMapProducer.cc +++ b/RecoEgamma/ElectronIdentification/plugins/ElectronHEEPIDValueMapProducer.cc @@ -198,7 +198,7 @@ ElectronHEEPIDValueMapProducer::ElectronHEEPIDValueMapProducer(const edm::Parame setToken(eleToken_, iConfig, "elesAOD", "elesMiniAOD", dataFormat_); setToken(candTokens_, iConfig, "candsAOD", "candsMiniAOD", dataFormat_); setToken(beamSpotToken_, iConfig, "beamSpot"); - caloTopoToken_ = esConsumes<CaloTopology, CaloTopologyRecord>(); + caloTopoToken_ = esConsumes(); auto fillVetos = [](const auto& in, auto& out) { std::transform(in.begin(), in.end(), std::back_inserter(out), EleTkIsolFromCands::pidVetoFromStr); diff --git a/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc b/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc index 8bfaa7585a10b..090afd756bd3c 100644 --- a/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc +++ b/RecoParticleFlow/PFProducer/plugins/importers/SuperClusterImporter.cc @@ -74,9 +74,9 @@ void SuperClusterImporter::importToBlock(const edm::Event& e, BlockElementImport PFBlockElementSCEqual myEqual(scref); auto sc_elem = std::find_if(elems.begin(), SCs_end, myEqual); const double scpT = ptFast(sc->energy(), sc->position(), _zero); - const auto towersBehindCluster = egammaHadTower::towersOf(*sc, *towerMap_); - const double H_tower = (egammaHadTower::getDepth1HcalESum(towersBehindCluster, towers) + - egammaHadTower::getDepth2HcalESum(towersBehindCluster, towers)); + const auto towersBehindCluster = egamma::towersOf(*sc, *towerMap_); + const double H_tower = + (egamma::depth1HcalESum(towersBehindCluster, towers) + egamma::depth2HcalESum(towersBehindCluster, towers)); const double HoverE = H_tower / sc->energy(); if (sc_elem == SCs_end && scpT > _minSCPt && (scpT > _pTbyPass || HoverE < _maxHoverE)) { scbe = new reco::PFBlockElementSuperCluster(scref); @@ -93,9 +93,9 @@ void SuperClusterImporter::importToBlock(const edm::Event& e, BlockElementImport PFBlockElementSCEqual myEqual(scref); auto sc_elem = std::find_if(elems.begin(), SCs_end, myEqual); const double scpT = ptFast(sc->energy(), sc->position(), _zero); - const auto towersBehindCluster = egammaHadTower::towersOf(*sc, *towerMap_); - const double H_tower = (egammaHadTower::getDepth1HcalESum(towersBehindCluster, towers) + - egammaHadTower::getDepth2HcalESum(towersBehindCluster, towers)); + const auto towersBehindCluster = egamma::towersOf(*sc, *towerMap_); + const double H_tower = + (egamma::depth1HcalESum(towersBehindCluster, towers) + egamma::depth2HcalESum(towersBehindCluster, towers)); const double HoverE = H_tower / sc->energy(); if (sc_elem == SCs_end && scpT > _minSCPt && (scpT > _pTbyPass || HoverE < _maxHoverE)) { scbe = new reco::PFBlockElementSuperCluster(scref); From 72f446b677eab51cfd8a57a4ba9b3409ef21f636 Mon Sep 17 00:00:00 2001 From: Tanmay Mudholkar <tkmudholkar@gmail.com> Date: Mon, 19 Oct 2020 02:14:02 +0200 Subject: [PATCH 672/778] Code formatting fix. --- DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc b/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc index 1963366538a46..313212d5912e8 100644 --- a/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc +++ b/DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc @@ -336,7 +336,7 @@ void ESIntegrityTask::calculateDIFraction(const edm::LuminosityBlock& lumi, cons float reportSummaryES = -1; for (int x = 0; x < 40; ++x) { for (int y = 0; y < 40; ++y) { - float val = 1.0*((lumiCache->DIErrorsLS_)[i][j][x][y]); + float val = 1.0 * ((lumiCache->DIErrorsLS_)[i][j][x][y]); if (fed_[i][j][x][y] == -1) continue; if ((lumiCache->ievtLS_) != 0) From 6911b1b061613ad229ce4bfce2acad345c367c03 Mon Sep 17 00:00:00 2001 From: Chris West <christopher.alan.west@gmail.com> Date: Mon, 19 Oct 2020 04:40:19 +0200 Subject: [PATCH 673/778] Update HCAL channel quality for Run 3 --- Configuration/AlCa/python/autoCond.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Configuration/AlCa/python/autoCond.py b/Configuration/AlCa/python/autoCond.py index 59978e8f4dd2a..f87d8a074a9ef 100644 --- a/Configuration/AlCa/python/autoCond.py +++ b/Configuration/AlCa/python/autoCond.py @@ -69,17 +69,17 @@ # GlobalTag for MC production (cosmics) with realistic conditions for full Phase1 2018 detector, Strip tracker in PEAK mode 'phase1_2018_cosmics_peak' : '112X_upgrade2018cosmics_realistic_peak_v4', # GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2021 - 'phase1_2021_design' : '112X_mcRun3_2021_design_v9', # GT containing design conditions for Phase1 2021 + 'phase1_2021_design' : '112X_mcRun3_2021_design_v10', # GT containing design conditions for Phase1 2021 # GlobalTag for MC production with realistic conditions for Phase1 2021 - 'phase1_2021_realistic' : '112X_mcRun3_2021_realistic_v9', # GT containing realistic conditions for Phase1 2021 + 'phase1_2021_realistic' : '112X_mcRun3_2021_realistic_v10', # GT containing realistic conditions for Phase1 2021 # GlobalTag for MC production (cosmics) with realistic conditions for Phase1 2021, Strip tracker in DECO mode - 'phase1_2021_cosmics' : '112X_mcRun3_2021cosmics_realistic_deco_v9', + 'phase1_2021_cosmics' : '112X_mcRun3_2021cosmics_realistic_deco_v10', # GlobalTag for MC production with realistic conditions for Phase1 2021 detector for Heavy Ion - 'phase1_2021_realistic_hi' : '112X_mcRun3_2021_realistic_HI_v10', + 'phase1_2021_realistic_hi' : '112X_mcRun3_2021_realistic_HI_v11', # GlobalTag for MC production with realistic conditions for Phase1 2023 - 'phase1_2023_realistic' : '112X_mcRun3_2023_realistic_v9', # GT containing realistic conditions for Phase1 2023 + 'phase1_2023_realistic' : '112X_mcRun3_2023_realistic_v10', # GT containing realistic conditions for Phase1 2023 # GlobalTag for MC production with realistic conditions for Phase1 2024 - 'phase1_2024_realistic' : '112X_mcRun3_2024_realistic_v9', # GT containing realistic conditions for Phase1 2024 + 'phase1_2024_realistic' : '112X_mcRun3_2024_realistic_v10', # GT containing realistic conditions for Phase1 2024 # GlobalTag for MC production with realistic conditions for Phase2 'phase2_realistic' : '112X_mcRun4_realistic_v3' } From d88eb3aa411df51127429f103a13608da2f2301c Mon Sep 17 00:00:00 2001 From: Chris West <christopher.alan.west@gmail.com> Date: Mon, 19 Oct 2020 05:01:07 +0200 Subject: [PATCH 674/778] Introduce scenario for 2016 cosmics with realistic conditions --- Configuration/AlCa/python/autoCond.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/AlCa/python/autoCond.py b/Configuration/AlCa/python/autoCond.py index 59978e8f4dd2a..d3a2cc70c14cb 100644 --- a/Configuration/AlCa/python/autoCond.py +++ b/Configuration/AlCa/python/autoCond.py @@ -20,7 +20,7 @@ #GlobalTag for MC production with optimistic alignment and calibrations for 2016, after VFP change 'run2_mc' : '112X_mcRun2_asymptotic_v1', # GlobalTag for MC production (cosmics) with starup-like alignment and calibrations for Run2, Strip tracker in peak mode - 'run2_mc_cosmics' : '112X_mcRun2cosmics_startup_deco_v1', + 'run2_mc_cosmics' : '112X_mcRun2cosmics_asymptotic_deco_v1', # GlobalTag for MC production (Heavy Ions collisions) with optimistic alignment and calibrations for Run2 'run2_mc_hi' : '112X_mcRun2_HeavyIon_v1', # GlobalTag for MC production (p-Pb collisions) with realistic alignment and calibrations for Run2 From 97fcb96ea73b6a33150c153f374ac61df795d902 Mon Sep 17 00:00:00 2001 From: Silvio <silvio.donato@cern.ch> Date: Mon, 19 Oct 2020 13:45:28 +0200 Subject: [PATCH 675/778] fix version in IOrules of l1t::RegionalMuonCand --- DataFormats/L1TMuon/src/classes_def.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFormats/L1TMuon/src/classes_def.xml b/DataFormats/L1TMuon/src/classes_def.xml index ba9b6271f7095..1769f74510e66 100644 --- a/DataFormats/L1TMuon/src/classes_def.xml +++ b/DataFormats/L1TMuon/src/classes_def.xml @@ -5,7 +5,7 @@ <version ClassVersion="11" checksum="2292293737"/> <version ClassVersion="10" checksum="1070099328"/> </class> - <ioread sourceClass="l1t::RegionalMuonCand" targetClass="l1t::RegionalMuonCand" version="[-10]" source="int m_hwPt2" target="m_hwPtUnconstrained"> + <ioread sourceClass="l1t::RegionalMuonCand" targetClass="l1t::RegionalMuonCand" version="[10]" source="int m_hwPt2" target="m_hwPtUnconstrained"> <![CDATA[ m_hwPtUnconstrained = onfile.m_hwPt2; ]]> </ioread> From 9092c57531ea98969204a280eee0ab8c88e45f5f Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Mon, 19 Oct 2020 14:14:02 +0200 Subject: [PATCH 676/778] Change v2x to v3 for muonNumbering/2021 --- Configuration/Geometry/python/dict2021Geometry.py | 2 +- Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml | 2 +- .../data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml | 2 +- Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py | 2 +- .../python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py | 2 +- .../data/muonNumbering/2021/{v2x => v3}/muonNumbering.xml | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename Geometry/MuonCommonData/data/muonNumbering/2021/{v2x => v3}/muonNumbering.xml (100%) diff --git a/Configuration/Geometry/python/dict2021Geometry.py b/Configuration/Geometry/python/dict2021Geometry.py index cee7224298097..e7ad9a281415b 100644 --- a/Configuration/Geometry/python/dict2021Geometry.py +++ b/Configuration/Geometry/python/dict2021Geometry.py @@ -1029,7 +1029,7 @@ 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', ], 2 : [ - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml', ], 3 : [ 'Geometry/MuonSimData/data/v2/muonSens.xml', diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml index a4a027e5efd96..189659f59b938 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -248,7 +248,7 @@ <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> <Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/> - <Include ref='Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml'/> <Include ref='Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml'/> <Include ref='Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml'/> <Include ref='Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml'/> diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml index 49c42559a4af2..122b40dfd6edd 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml @@ -247,7 +247,7 @@ <Include ref='Geometry/MuonCommonData/data/gem11/TDR_BaseLine/gem11.xml'/> <Include ref='Geometry/MuonCommonData/data/csc/2021/v2/csc.xml'/> <Include ref='Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml'/> - <Include ref='Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml'/> <Include ref='Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml'/> <Include ref='Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml'/> <Include ref='Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml'/> diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py index 4bc3a12d91428..5d296e112df12 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py @@ -251,7 +251,7 @@ 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', )+ cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml', 'Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml', 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py index 6c21e7a78d85b..098e42551406f 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py @@ -250,7 +250,7 @@ 'Geometry/MuonCommonData/data/mfshield/2017/v2/mfshield.xml', )+ cms.vstring( - 'Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml', + 'Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml', 'Geometry/ForwardCommonData/data/forward/2021/v1/forward.xml', 'Geometry/ForwardCommonData/data/totemt2/2021/v1/totemt2.xml', 'Geometry/ForwardCommonData/data/forwardshield/2021/v1/forwardshield.xml', diff --git a/Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml b/Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml similarity index 100% rename from Geometry/MuonCommonData/data/muonNumbering/2021/v2x/muonNumbering.xml rename to Geometry/MuonCommonData/data/muonNumbering/2021/v3/muonNumbering.xml From cd30f3e03f8b592a20e6a32b8e7b35a4808a372d Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Mon, 19 Oct 2020 14:17:58 +0200 Subject: [PATCH 677/778] Also get changes from Sergio --- Configuration/Geometry/python/dict2021Geometry.py | 2 +- Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml | 2 +- .../data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml | 2 +- Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py | 2 +- .../python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Configuration/Geometry/python/dict2021Geometry.py b/Configuration/Geometry/python/dict2021Geometry.py index e7ad9a281415b..d443b79f45451 100644 --- a/Configuration/Geometry/python/dict2021Geometry.py +++ b/Configuration/Geometry/python/dict2021Geometry.py @@ -1020,7 +1020,7 @@ 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml', + 'Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml', 'Geometry/MuonCommonData/data/mf/2021/v2/mf.xml', 'Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml index 189659f59b938..d700cc305ede2 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -241,7 +241,7 @@ <Include ref='Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml'/> <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> - <Include ref='Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml'/> <Include ref='Geometry/MuonCommonData/data/mf/2021/v2/mf.xml'/> <Include ref='Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml'/> <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml index 122b40dfd6edd..f1aa1e6fdd18d 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021ZeroMaterial.xml @@ -240,7 +240,7 @@ <Include ref='Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml'/> <Include ref='Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml'/> <Include ref='Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml'/> - <Include ref='Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml'/> + <Include ref='Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml'/> <Include ref='Geometry/MuonCommonData/data/mf/2021/v2/mf.xml'/> <Include ref='Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml'/> <Include ref='Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml'/> diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py index 5d296e112df12..acb7ea1862fed 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021XML_cfi.py @@ -242,7 +242,7 @@ 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml', + 'Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml', 'Geometry/MuonCommonData/data/mf/2021/v2/mf.xml', 'Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py index 098e42551406f..e3db637739d60 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2021ZeroMaterialXML_cfi.py @@ -241,7 +241,7 @@ 'Geometry/MuonCommonData/data/mb3/2021/v1/mb3.xml', 'Geometry/MuonCommonData/data/mb4/2015/v2/mb4.xml', 'Geometry/MuonCommonData/data/mb4Shield/2021/v1/mb4Shield.xml', - 'Geometry/MuonCommonData/data/muonYoke/2021/v4/muonYoke.xml', + 'Geometry/MuonCommonData/data/muonYoke/2021/v5/muonYoke.xml', 'Geometry/MuonCommonData/data/mf/2021/v2/mf.xml', 'Geometry/MuonCommonData/data/rpcf/2015/v1/rpcf.xml', 'Geometry/MuonCommonData/data/gemf/TDR_BaseLine/gemf.xml', From 8ed16454f666970fe03fead7b6da815ba65733dc Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Mon, 19 Oct 2020 14:22:54 +0200 Subject: [PATCH 678/778] Step toward transition to dd4hep for Phase2 scenarios --- .../TDR_DeV/v4/muonNumbering.xml | 541 ++++++++++++++++++ .../TDR_DeV/v5/muonNumbering.xml | 541 ++++++++++++++++++ 2 files changed, 1082 insertions(+) create mode 100644 Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v4/muonNumbering.xml create mode 100644 Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml diff --git a/Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v4/muonNumbering.xml b/Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v4/muonNumbering.xml new file mode 100644 index 0000000000000..06b9c8e68b798 --- /dev/null +++ b/Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v4/muonNumbering.xml @@ -0,0 +1,541 @@ +<?xml version="1.0"?> +<DDDefinition> + <ConstantsSection label="muonconstants" eval="true"> + <Constant name="xml_starts_with_copyno" value="1"/> + <Constant name="level" value="1000"/> + <Constant name="super" value="100"/> + <Constant name="base" value="1"/> + <Constant name="mb_region" value="1*[level]"/> + <Constant name="mb_wheel" value="2*[level]"/> + <Constant name="mb_station" value="3*[level]"/> + <Constant name="mb_superlayer" value="4*[level]"/> + <Constant name="mb_layer" value="5*[level]"/> + <Constant name="mb_wire" value="6*[level]"/> + <Constant name="me_region" value="[mb_region]"/> + <Constant name="me_station" value="2*[level]"/> + <Constant name="me_subring" value="3*[level]"/> + <Constant name="me_sector" value="4*[level]"/> + <Constant name="me_ring" value="5*[level]"/> + <Constant name="me_layer" value="6*[level]"/> + <Constant name="mr_region" value="[mb_region]"/> + <Constant name="mr_bwheel" value="[mb_wheel]"/> + <Constant name="mr_bstation" value="[mb_station]"/> + <Constant name="mr_bplane" value="4*[level]"/> + <Constant name="mr_bchamber" value="5*[level]"/> + <Constant name="mr_estation" value="[me_station]"/> + <Constant name="mr_eplane" value="3*[level]"/> + <Constant name="mr_esector" value="4*[level]"/> + <Constant name="mr_eroll" value="5*[level]"/> + <Constant name="mg_region" value="[mb_region]"/> + <Constant name="mg_station" value="[me_station]"/> + <Constant name="mg_ring" value="3*[level]"/> + <Constant name="mg_sector" value="4*[level]"/> + <Constant name="mg_roll" value="5*[level]"/> + <Constant name="m0_region" value="[me_region]"/> + <Constant name="m0_sector" value="3*[level]"/> + <Constant name="m0_layer" value="4*[level]"/> + <Constant name="m0_roll" value="5*[level]"/> + <Constant name="m0_nroll" value="10"/> <!-- m0_nroll = 1 for 1 etapart geometry, = 10 for 10 etapart geometry --> + </ConstantsSection> + <SpecParSection label="muonregionnumbering" eval="true"> + <SpecPar name="MuonCommonNumbering"> + <Parameter name="OnlyForMuonNumbering" value="muonstep0" eval="false"/> + <PartSelector path="//MUON"/> + <Parameter name="xml_starts_with_copyno" value="[xml_starts_with_copyno]"/> + <Parameter name="level" value="[level]"/> + <Parameter name="super" value="[super]"/> + <Parameter name="base" value="[base]"/> + <Parameter name="mb_region" value="[mb_region]"/> + <Parameter name="mb_wheel" value="[mb_wheel]"/> + <Parameter name="mb_station" value="[mb_station]"/> + <Parameter name="mb_superlayer" value="[mb_superlayer]"/> + <Parameter name="mb_layer" value="[mb_layer]"/> + <Parameter name="mb_wire" value="[mb_wire]"/> + <Parameter name="me_region" value="[me_region]"/> + <Parameter name="me_station" value="[me_station]"/> + <Parameter name="me_subring" value="[me_subring]"/> + <Parameter name="me_sector" value="[me_sector]"/> + <Parameter name="me_ring" value="[me_ring]"/> + <Parameter name="me_layer" value="[me_layer]"/> + <Parameter name="mr_region" value="[mr_region]"/> + <Parameter name="mr_bwheel" value="[mr_bwheel]"/> + <Parameter name="mr_bstation" value="[mr_bstation]"/> + <Parameter name="mr_bplane" value="[mr_bplane]"/> + <Parameter name="mr_bchamber" value="[mr_bchamber]"/> + <Parameter name="mr_estation" value="[mr_estation]"/> + <Parameter name="mr_eplane" value="[mr_eplane]"/> + <Parameter name="mr_esector" value="[mr_esector]"/> + <Parameter name="mr_eroll" value="[mr_eroll]"/> + <Parameter name="mg_region" value="[mg_region]"/> + <Parameter name="mg_station" value="[mg_station]"/> + <Parameter name="mg_ring" value="[mg_ring]"/> + <Parameter name="mg_sector" value="[mg_sector]"/> + <Parameter name="mg_roll" value="[mg_roll]"/> + <Parameter name="m0_region" value="[m0_region]"/> + <Parameter name="m0_layer" value="[m0_layer]"/> + <Parameter name="m0_sector" value="[m0_sector]"/> + <Parameter name="m0_roll" value="[m0_roll]"/> + <Parameter name="m0_nroll" value="[m0_nroll]"/> + </SpecPar> + <SpecPar name="MuonBarrel"> + <Parameter name="OnlyForMuonNumbering" value="muonstep1" eval="false"/> + <PartSelector path="//MB"/> + <Parameter name="CopyNoTag" value="[mb_region]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcap"> + <Parameter name="OnlyForMuonNumbering" value="muonstep2" eval="false"/> + <PartSelector path="//MEP"/> + <PartSelector path="//MEN"/> + <Parameter name="CopyNoTag" value="[me_region]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonbarrelnumbering" eval="true"> + <SpecPar name="MuonBarrelWheels"> + <Parameter name="OnlyForMuonNumbering" value="muonstep3" eval="false"/> + <PartSelector path="//MBWheel_.*"/> + <Parameter name="CopyNoTag" value="[mb_wheel]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep4" eval="false"/> + <PartSelector path="//MB1N0P"/> + <PartSelector path="//MB1P"/> + <PartSelector path="//MB1P0"/> + <PartSelector path="//MB1ChimP"/> + <PartSelector path="//MB1N"/> + <PartSelector path="//MB1ChimN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep5" eval="false"/> + <PartSelector path="//MB2N32P"/> + <PartSelector path="//MB2P32P"/> + <PartSelector path="//MB2ChimP"/> + <PartSelector path="//MB2N32N"/> + <PartSelector path="//MB2ChimN"/> + <PartSelector path="//MB2P23P"/> + <PartSelector path="//MB2N23N"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep6" eval="false"/> + <PartSelector path="//MB3P"/> + <PartSelector path="//MB3N"/> + <PartSelector path="//MB3ChimP"/> + <PartSelector path="//MB3ChimN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep7" eval="false"/> + <PartSelector path="//MB4BigLeftP"/> + <PartSelector path="//MB4BigRightP"/> + <PartSelector path="//MB4BigLeftN"/> + <PartSelector path="//MB4BigChimN"/> + <PartSelector path="//MB4BigRightN"/> + <PartSelector path="//MB4SmallRightP"/> + <PartSelector path="//MB4SmallLeftP"/> + <PartSelector path="//MB4SmallRightN"/> + <PartSelector path="//MB4SmallLeftN"/> + <PartSelector path="//MB4TopP"/> + <PartSelector path="//MB4TopChimP"/> + <PartSelector path="//MB4TopN"/> + <PartSelector path="//MB4BottomLeftP"/> + <PartSelector path="//MB4BottomRightP"/> + <PartSelector path="//MB4BottomRightN"/> + <PartSelector path="//MB4BottomLeftN"/> + <PartSelector path="//MB4FeetP"/> + <PartSelector path="//MB4FeetN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelSuperLayer"> + <Parameter name="OnlyForMuonNumbering" value="muonstep8" eval="false"/> + <PartSelector path="//MB.*SuperLayer.*"/> + <Parameter name="CopyNoTag" value="[mb_superlayer]"/> + </SpecPar> + <SpecPar name="MuonBarrelLayer"> + <Parameter name="OnlyForMuonNumbering" value="muonstep9" eval="false"/> + <PartSelector path="//MB.*SLPhiLayer.*"/> + <PartSelector path="//MB.*SLZLayer.*"/> + <Parameter name="CopyNoTag" value="[mb_layer]"/> + </SpecPar> + <SpecPar name="MuonBarrelWire"> + <Parameter name="OnlyForMuonNumbering" value="muonstep10" eval="false"/> + <PartSelector path="//MBSLPhiGas"/> + <PartSelector path="//MBChimSLPhiGas"/> + <PartSelector path="//MB.*SLZGas"/> + <Parameter name="CopyNoTag" value="[mb_wire]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonrpcnumbering" eval="true"> + <SpecPar name="MuonRpcPlane1I"> + <Parameter name="OnlyForMuonNumbering" value="muonstep11" eval="false"/> + <PartSelector path="//MB1RPC_IP"/> + <PartSelector path="//MB1RPC_IN"/> + <PartSelector path="//MB1ChimRPC_IP"/> + <PartSelector path="//MB1ChimRPC_IN"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane1O"> + <Parameter name="OnlyForMuonNumbering" value="muonstep12" eval="false"/> + <PartSelector path="//MB1RPC_OP"/> + <PartSelector path="//MB1RPC_ON"/> + <PartSelector path="//MB1ChimRPC_OP"/> + <PartSelector path="//MB1ChimRPC_ON"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane2I"> + <Parameter name="OnlyForMuonNumbering" value="muonstep13" eval="false"/> + <PartSelector path="//MB22RPC_IP"/> + <PartSelector path="//MB22RPC_IN"/> + <PartSelector path="//MB23RPC_IP"/> + <PartSelector path="//MB23RPC_IN"/> + <PartSelector path="//MB2ChimRPC_IP"/> + <PartSelector path="//MB2ChimRPC_IN"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane2O"> + <Parameter name="OnlyForMuonNumbering" value="muonstep14" eval="false"/> + <PartSelector path="//MB22RPC_OP"/> + <PartSelector path="//MB22RPC_ON"/> + <PartSelector path="//MB23RPC_OP"/> + <PartSelector path="//MB23RPC_ON"/> + <PartSelector path="//MB2ChimRPC_OP"/> + <PartSelector path="//MB2ChimRPC_ON"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane3S"> + <Parameter name="OnlyForMuonNumbering" value="muonstep15" eval="false"/> + <PartSelector path="//MB3RPC_P"/> + <PartSelector path="//MB3RPC_N"/> + <PartSelector path="//MB3ChimRPC_P"/> + <PartSelector path="//MB3ChimRPC_N"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="5*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep16" eval="false"/> + <PartSelector path="//MB4RPC_P"/> + <PartSelector path="//MB4RPC_N"/> + <PartSelector path="//MB4SmallRPC_PS8"/> + <PartSelector path="//MB4SmallRPC_NS8"/> + <PartSelector path="//MB4SmallRPC_PS12"/> + <PartSelector path="//MB4SmallRPC_NS12"/> + <PartSelector path="//MB4TopRPC_P"/> + <PartSelector path="//MB4TopRPC_N"/> + <PartSelector path="//MB4FeetRPC_P"/> + <PartSelector path="//MB4FeetRPC_N"/> + <PartSelector path="//MB4BottomRPC_P"/> + <PartSelector path="//MB4BottomRPC_N"/> + <PartSelector path="//MB4TopChimRPC_P"/> + <PartSelector path="//MB4BigChimRPC_N"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="6*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberLeft"> + <Parameter name="OnlyForMuonNumbering" value="muonstep17" eval="false"/> + <PartSelector path="//MB.*RPC.*GasLeft"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberMiddle"> + <Parameter name="OnlyForMuonNumbering" value="muonstep18" eval="false"/> + <PartSelector path="//MB.*RPC.*GasMiddle"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberRight"> + <Parameter name="OnlyForMuonNumbering" value="muonstep19" eval="false"/> + <PartSelector path="//MB.*RPC.*GasRight"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep20" eval="false"/> + <PartSelector path="//RR12"/> + <PartSelector path="//RR12N"/> + <PartSelector path="//RR13"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep21" eval="false"/> + <PartSelector path="//RR2X"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep22" eval="false"/> + <PartSelector path="//RR3X"/> + <PartSelector path="//RR3XXP"/> + <PartSelector path="//RR3XXN"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep23" eval="false"/> + <PartSelector path="//RR4XP"/> + <PartSelector path="//RR4XN"/> + <PartSelector path="//RR4XXP"/> + <PartSelector path="//RR4XXN"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapSector"> + <Parameter name="OnlyForMuonNumbering" value="muonstep24" eval="false"/> + <PartSelector path="//RT1B"/> + <PartSelector path="//RT1BN"/> + <PartSelector path="//RT1C"/> + <PartSelector path="//RTXU"/> + <PartSelector path="//RTXUR"/> + <PartSelector path="//RT3G"/> + <PartSelector path="//RT4H"/> + <Parameter name="CopyNoTag" value="[mr_esector]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep25" eval="false"/> + <PartSelector path="//REB1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep26" eval="false"/> + <PartSelector path="//REB2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep27" eval="false"/> + <PartSelector path="//REB3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep28" eval="false"/> + <PartSelector path="//REC1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep29" eval="false"/> + <PartSelector path="//REC2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep30" eval="false"/> + <PartSelector path="//REC3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep31" eval="false"/> + <PartSelector path="//REE1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep32" eval="false"/> + <PartSelector path="//REE2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep33" eval="false"/> + <PartSelector path="//REE3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep34" eval="false"/> + <PartSelector path="//REF1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep35" eval="false"/> + <PartSelector path="//REF2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep36" eval="false"/> + <PartSelector path="//REF3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberG1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep37" eval="false"/> + <PartSelector path="//REG1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="7*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberH1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep38" eval="false"/> + <PartSelector path="//REH1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="8*[super]+0"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonendcapnumbering" eval="true"> + <SpecPar name="MuonEndcapStation1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep39" eval="false"/> + <PartSelector path="//ME0RingP"/> + <PartSelector path="//ME0RingN"/> + <PartSelector path="//ME1RingP"/> + <PartSelector path="//ME1RingN"/> + <PartSelector path="//ME12RingP"/> + <PartSelector path="//ME12RingN"/> + <PartSelector path="//ME13RingP"/> + <PartSelector path="//ME13RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep40" eval="false"/> + <PartSelector path="//ME2RingP"/> + <PartSelector path="//ME2RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep41" eval="false"/> + <PartSelector path="//ME3RingP"/> + <PartSelector path="//ME3RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep42" eval="false"/> + <PartSelector path="//ME4RingP"/> + <PartSelector path="//ME4RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapSubrings"> + <Parameter name="OnlyForMuonNumbering" value="muonstep43" eval="false"/> + <PartSelector path="//ME11Space"/> + <PartSelector path="//ME12Space"/> + <PartSelector path="//ME13Space"/> + <PartSelector path="//ME21Space"/> + <PartSelector path="//ME22Space"/> + <PartSelector path="//ME31Space"/> + <PartSelector path="//ME32Space"/> + <PartSelector path="//ME41Space"/> + <PartSelector path="//ME42Space"/> + <Parameter name="CopyNoTag" value="[me_subring]"/> + </SpecPar> + <SpecPar name="MuonEndcapSectors"> + <Parameter name="OnlyForMuonNumbering" value="muonstep44" eval="false"/> + <PartSelector path="//ME11SpaceDivision"/> + <PartSelector path="//ME12SpaceDivision"/> + <PartSelector path="//ME13SpaceDivision"/> + <PartSelector path="//ME21SpaceDivision"/> + <PartSelector path="//ME22SpaceDivision"/> + <PartSelector path="//ME31SpaceDivision"/> + <PartSelector path="//ME32SpaceDivision"/> + <PartSelector path="//ME41SpaceDivision"/> + <PartSelector path="//ME42SpaceDivision"/> + <Parameter name="CopyNoTag" value="[me_sector]"/> + </SpecPar> + <SpecPar name="MuonEndcapLayers"> + <Parameter name="OnlyForMuonNumbering" value="muonstep45" eval="false"/> + <PartSelector path="//ME11Layer"/> + <PartSelector path="//ME12Layer"/> + <PartSelector path="//ME13Layer"/> + <PartSelector path="//ME21Layer"/> + <PartSelector path="//ME22Layer"/> + <PartSelector path="//ME31Layer"/> + <PartSelector path="//ME32Layer"/> + <PartSelector path="//ME41Layer"/> + <PartSelector path="//ME42Layer"/> + <Parameter name="CopyNoTag" value="[me_layer]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep46" eval="false"/> + <PartSelector path="//ME11AlumFrame"/> + <PartSelector path="//ME21AlumFrame"/> + <PartSelector path="//ME31AlumFrame"/> + <PartSelector path="//ME41AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep47" eval="false"/> + <PartSelector path="//ME12AlumFrame"/> + <PartSelector path="//ME22AlumFrame"/> + <PartSelector path="//ME32AlumFrame"/> + <PartSelector path="//ME42AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep48" eval="false"/> + <PartSelector path="//ME13AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRingA"> + <Parameter name="OnlyForMuonNumbering" value="muonstep49" eval="false"/> + <PartSelector path="//ME1A_ActiveGasVol"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonGEMnumbering" eval="true"> + <SpecPar name="MuonGEMEndcap"> + <Parameter name="OnlyForMuonNumbering" value="muonstep50" eval="false"/> + <PartSelector path="//GEMDisk11."/> + <Parameter name="CopyNoTag" value="[mg_ring]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonGEMEndcap2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep51" eval="false"/> + <PartSelector path="//GEMDisk21L."/> + <Parameter name="CopyNoTag" value="[mg_ring]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonGEMSector"> + <Parameter name="OnlyForMuonNumbering" value="muonstep52" eval="false"/> + <PartSelector path="//GEMBox11."/> + <PartSelector path="//GEMBox21."/> + <Parameter name="CopyNoTag" value="[mg_sector]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonGEMChamber"> + <Parameter name="OnlyForMuonNumbering" value="muonstep53" eval="false"/> + <PartSelector path="//GHA1.*"/> + <PartSelector path="//GHA2.*"/> + <Parameter name="CopyNoTag" value="[mg_roll]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonME0Numbering" eval="true"> + <SpecPar name="MuonGE0Sector"> + <Parameter name="OnlyForMuonNumbering" value="muonstep54" eval="false"/> + <PartSelector path="//ME0Box"/> + <Parameter name="CopyNoTag" value="[m0_sector]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonGE0Layer"> + <Parameter name="OnlyForMuonNumbering" value="muonstep55" eval="false"/> + <PartSelector path="//ME0L.*"/> + <Parameter name="CopyNoTag" value="[m0_layer]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonGE0Chamber"> + <Parameter name="OnlyForMuonNumbering" value="muonstep56" eval="false"/> + <PartSelector path="//GHA0.*"/> + <Parameter name="CopyNoTag" value="[m0_roll]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + </SpecParSection> +</DDDefinition> diff --git a/Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml b/Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml new file mode 100644 index 0000000000000..978edac18060b --- /dev/null +++ b/Geometry/MuonCommonData/data/muonNumbering/TDR_DeV/v5/muonNumbering.xml @@ -0,0 +1,541 @@ +<?xml version="1.0"?> +<DDDefinition> + <ConstantsSection label="muonconstants" eval="true"> + <Constant name="xml_starts_with_copyno" value="1"/> + <Constant name="level" value="1000"/> + <Constant name="super" value="100"/> + <Constant name="base" value="1"/> + <Constant name="mb_region" value="1*[level]"/> + <Constant name="mb_wheel" value="2*[level]"/> + <Constant name="mb_station" value="3*[level]"/> + <Constant name="mb_superlayer" value="4*[level]"/> + <Constant name="mb_layer" value="5*[level]"/> + <Constant name="mb_wire" value="6*[level]"/> + <Constant name="me_region" value="[mb_region]"/> + <Constant name="me_station" value="2*[level]"/> + <Constant name="me_subring" value="3*[level]"/> + <Constant name="me_sector" value="4*[level]"/> + <Constant name="me_ring" value="5*[level]"/> + <Constant name="me_layer" value="6*[level]"/> + <Constant name="mr_region" value="[mb_region]"/> + <Constant name="mr_bwheel" value="[mb_wheel]"/> + <Constant name="mr_bstation" value="[mb_station]"/> + <Constant name="mr_bplane" value="4*[level]"/> + <Constant name="mr_bchamber" value="5*[level]"/> + <Constant name="mr_estation" value="[me_station]"/> + <Constant name="mr_eplane" value="3*[level]"/> + <Constant name="mr_esector" value="4*[level]"/> + <Constant name="mr_eroll" value="5*[level]"/> + <Constant name="mg_region" value="[mb_region]"/> + <Constant name="mg_station" value="[me_station]"/> + <Constant name="mg_ring" value="3*[level]"/> + <Constant name="mg_sector" value="4*[level]"/> + <Constant name="mg_roll" value="5*[level]"/> + <Constant name="m0_region" value="[me_region]"/> + <Constant name="m0_sector" value="3*[level]"/> + <Constant name="m0_layer" value="4*[level]"/> + <Constant name="m0_roll" value="5*[level]"/> + <Constant name="m0_nroll" value="10"/> <!-- m0_nroll = 1 for 1 etapart geometry, = 10 for 10 etapart geometry --> + </ConstantsSection> + <SpecParSection label="muonregionnumbering" eval="true"> + <SpecPar name="MuonCommonNumbering"> + <Parameter name="OnlyForMuonNumbering" value="muonstep0" eval="false"/> + <PartSelector path="//MUON"/> + <Parameter name="xml_starts_with_copyno" value="[xml_starts_with_copyno]"/> + <Parameter name="level" value="[level]"/> + <Parameter name="super" value="[super]"/> + <Parameter name="base" value="[base]"/> + <Parameter name="mb_region" value="[mb_region]"/> + <Parameter name="mb_wheel" value="[mb_wheel]"/> + <Parameter name="mb_station" value="[mb_station]"/> + <Parameter name="mb_superlayer" value="[mb_superlayer]"/> + <Parameter name="mb_layer" value="[mb_layer]"/> + <Parameter name="mb_wire" value="[mb_wire]"/> + <Parameter name="me_region" value="[me_region]"/> + <Parameter name="me_station" value="[me_station]"/> + <Parameter name="me_subring" value="[me_subring]"/> + <Parameter name="me_sector" value="[me_sector]"/> + <Parameter name="me_ring" value="[me_ring]"/> + <Parameter name="me_layer" value="[me_layer]"/> + <Parameter name="mr_region" value="[mr_region]"/> + <Parameter name="mr_bwheel" value="[mr_bwheel]"/> + <Parameter name="mr_bstation" value="[mr_bstation]"/> + <Parameter name="mr_bplane" value="[mr_bplane]"/> + <Parameter name="mr_bchamber" value="[mr_bchamber]"/> + <Parameter name="mr_estation" value="[mr_estation]"/> + <Parameter name="mr_eplane" value="[mr_eplane]"/> + <Parameter name="mr_esector" value="[mr_esector]"/> + <Parameter name="mr_eroll" value="[mr_eroll]"/> + <Parameter name="mg_region" value="[mg_region]"/> + <Parameter name="mg_station" value="[mg_station]"/> + <Parameter name="mg_ring" value="[mg_ring]"/> + <Parameter name="mg_sector" value="[mg_sector]"/> + <Parameter name="mg_roll" value="[mg_roll]"/> + <Parameter name="m0_region" value="[m0_region]"/> + <Parameter name="m0_layer" value="[m0_layer]"/> + <Parameter name="m0_sector" value="[m0_sector]"/> + <Parameter name="m0_roll" value="[m0_roll]"/> + <Parameter name="m0_nroll" value="[m0_nroll]"/> + </SpecPar> + <SpecPar name="MuonBarrel"> + <Parameter name="OnlyForMuonNumbering" value="muonstep1" eval="false"/> + <PartSelector path="//MB"/> + <Parameter name="CopyNoTag" value="[mb_region]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcap"> + <Parameter name="OnlyForMuonNumbering" value="muonstep2" eval="false"/> + <PartSelector path="//MEP"/> + <PartSelector path="//MEN"/> + <Parameter name="CopyNoTag" value="[me_region]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonbarrelnumbering" eval="true"> + <SpecPar name="MuonBarrelWheels"> + <Parameter name="OnlyForMuonNumbering" value="muonstep3" eval="false"/> + <PartSelector path="//MBWheel_.*"/> + <Parameter name="CopyNoTag" value="[mb_wheel]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep4" eval="false"/> + <PartSelector path="//MB1N0P"/> + <PartSelector path="//MB1P"/> + <PartSelector path="//MB1P0"/> + <PartSelector path="//MB1ChimP"/> + <PartSelector path="//MB1N"/> + <PartSelector path="//MB1ChimN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep5" eval="false"/> + <PartSelector path="//MB2N32P"/> + <PartSelector path="//MB2P32P"/> + <PartSelector path="//MB2ChimP"/> + <PartSelector path="//MB2N32N"/> + <PartSelector path="//MB2ChimN"/> + <PartSelector path="//MB2P23P"/> + <PartSelector path="//MB2N23N"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep6" eval="false"/> + <PartSelector path="//MB3P"/> + <PartSelector path="//MB3N"/> + <PartSelector path="//MB3ChimP"/> + <PartSelector path="//MB3ChimN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelStation4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep7" eval="false"/> + <PartSelector path="//MB4BigLeftP"/> + <PartSelector path="//MB4BigRightP"/> + <PartSelector path="//MB4BigLeftN"/> + <PartSelector path="//MB4BigChimN"/> + <PartSelector path="//MB4BigRightN"/> + <PartSelector path="//MB4SmallRightP"/> + <PartSelector path="//MB4SmallLeftP"/> + <PartSelector path="//MB4SmallRightN"/> + <PartSelector path="//MB4SmallLeftN"/> + <PartSelector path="//MB4TopP"/> + <PartSelector path="//MB4TopChimP"/> + <PartSelector path="//MB4TopN"/> + <PartSelector path="//MB4BottomLeftP"/> + <PartSelector path="//MB4BottomRightP"/> + <PartSelector path="//MB4BottomRightN"/> + <PartSelector path="//MB4BottomLeftN"/> + <PartSelector path="//MB4FeetP"/> + <PartSelector path="//MB4FeetN"/> + <Parameter name="CopyNoTag" value="[mb_station]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonBarrelSuperLayer"> + <Parameter name="OnlyForMuonNumbering" value="muonstep8" eval="false"/> + <PartSelector path="//MB.*SuperLayer.*"/> + <Parameter name="CopyNoTag" value="[mb_superlayer]"/> + </SpecPar> + <SpecPar name="MuonBarrelLayer"> + <Parameter name="OnlyForMuonNumbering" value="muonstep9" eval="false"/> + <PartSelector path="//MB.*SLPhiLayer.*"/> + <PartSelector path="//MB.*SLZLayer.*"/> + <Parameter name="CopyNoTag" value="[mb_layer]"/> + </SpecPar> + <SpecPar name="MuonBarrelWire"> + <Parameter name="OnlyForMuonNumbering" value="muonstep10" eval="false"/> + <PartSelector path="//MBSLPhiGas"/> + <PartSelector path="//MBChimSLPhiGas"/> + <PartSelector path="//MB.*SLZGas"/> + <Parameter name="CopyNoTag" value="[mb_wire]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonrpcnumbering" eval="true"> + <SpecPar name="MuonRpcPlane1I"> + <Parameter name="OnlyForMuonNumbering" value="muonstep11" eval="false"/> + <PartSelector path="//MB1RPC_IP"/> + <PartSelector path="//MB1RPC_IN"/> + <PartSelector path="//MB1ChimRPC_IP"/> + <PartSelector path="//MB1ChimRPC_IN"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane1O"> + <Parameter name="OnlyForMuonNumbering" value="muonstep12" eval="false"/> + <PartSelector path="//MB1RPC_OP"/> + <PartSelector path="//MB1RPC_ON"/> + <PartSelector path="//MB1ChimRPC_OP"/> + <PartSelector path="//MB1ChimRPC_ON"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane2I"> + <Parameter name="OnlyForMuonNumbering" value="muonstep13" eval="false"/> + <PartSelector path="//MB22RPC_IP"/> + <PartSelector path="//MB22RPC_IN"/> + <PartSelector path="//MB23RPC_IP"/> + <PartSelector path="//MB23RPC_IN"/> + <PartSelector path="//MB2ChimRPC_IP"/> + <PartSelector path="//MB2ChimRPC_IN"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane2O"> + <Parameter name="OnlyForMuonNumbering" value="muonstep14" eval="false"/> + <PartSelector path="//MB22RPC_OP"/> + <PartSelector path="//MB22RPC_ON"/> + <PartSelector path="//MB23RPC_OP"/> + <PartSelector path="//MB23RPC_ON"/> + <PartSelector path="//MB2ChimRPC_OP"/> + <PartSelector path="//MB2ChimRPC_ON"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane3S"> + <Parameter name="OnlyForMuonNumbering" value="muonstep15" eval="false"/> + <PartSelector path="//MB3RPC_P"/> + <PartSelector path="//MB3RPC_N"/> + <PartSelector path="//MB3ChimRPC_P"/> + <PartSelector path="//MB3ChimRPC_N"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="5*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcPlane4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep16" eval="false"/> + <PartSelector path="//MB4RPC_P"/> + <PartSelector path="//MB4RPC_N"/> + <PartSelector path="//MB4SmallRPC_PS8"/> + <PartSelector path="//MB4SmallRPC_NS8"/> + <PartSelector path="//MB4SmallRPC_PS12"/> + <PartSelector path="//MB4SmallRPC_NS12"/> + <PartSelector path="//MB4TopRPC_P"/> + <PartSelector path="//MB4TopRPC_N"/> + <PartSelector path="//MB4FeetRPC_P"/> + <PartSelector path="//MB4FeetRPC_N"/> + <PartSelector path="//MB4BottomRPC_P"/> + <PartSelector path="//MB4BottomRPC_N"/> + <PartSelector path="//MB4TopChimRPC_P"/> + <PartSelector path="//MB4BigChimRPC_N"/> + <Parameter name="CopyNoTag" value="[mr_bplane]"/> + <Parameter name="CopyNoOffset" value="6*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberLeft"> + <Parameter name="OnlyForMuonNumbering" value="muonstep17" eval="false"/> + <PartSelector path="//MB.*RPC.*GasLeft"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberMiddle"> + <Parameter name="OnlyForMuonNumbering" value="muonstep18" eval="false"/> + <PartSelector path="//MB.*RPC.*GasMiddle"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcChamberRight"> + <Parameter name="OnlyForMuonNumbering" value="muonstep19" eval="false"/> + <PartSelector path="//MB.*RPC.*GasRight"/> + <Parameter name="CopyNoTag" value="[mr_bchamber]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep20" eval="false"/> + <PartSelector path="//RR12"/> + <PartSelector path="//RR12N"/> + <PartSelector path="//RR13"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep21" eval="false"/> + <PartSelector path="//RR2X"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep22" eval="false"/> + <PartSelector path="//RR3X"/> + <PartSelector path="//RR3XXP"/> + <PartSelector path="//RR3XXN"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcap4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep23" eval="false"/> + <PartSelector path="//RR4XP"/> + <PartSelector path="//RR4XN"/> + <PartSelector path="//RR4XXP"/> + <PartSelector path="//RR4XXN"/> + <Parameter name="CopyNoTag" value="[mr_eplane]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapSector"> + <Parameter name="OnlyForMuonNumbering" value="muonstep24" eval="false"/> + <PartSelector path="//RT1B"/> + <PartSelector path="//RT1BN"/> + <PartSelector path="//RT1C"/> + <PartSelector path="//RTXU"/> + <PartSelector path="//RTXUR"/> + <PartSelector path="//RT3G"/> + <PartSelector path="//RT4H"/> + <Parameter name="CopyNoTag" value="[mr_esector]"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep25" eval="false"/> + <PartSelector path="//REB1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep26" eval="false"/> + <PartSelector path="//REB2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberB3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep27" eval="false"/> + <PartSelector path="//REB3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="2*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep28" eval="false"/> + <PartSelector path="//REC1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep29" eval="false"/> + <PartSelector path="//REC2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberC3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep30" eval="false"/> + <PartSelector path="//REC3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="3*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep31" eval="false"/> + <PartSelector path="//REE1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep32" eval="false"/> + <PartSelector path="//REE2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberE3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep33" eval="false"/> + <PartSelector path="//REE3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="5*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep34" eval="false"/> + <PartSelector path="//REF1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep35" eval="false"/> + <PartSelector path="//REF2"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+1"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberF3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep36" eval="false"/> + <PartSelector path="//REF3"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="6*[super]+2"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberG1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep37" eval="false"/> + <PartSelector path="//REG1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="7*[super]+0"/> + </SpecPar> + <SpecPar name="MuonRpcEndcapChamberH1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep38" eval="false"/> + <PartSelector path="//REH1"/> + <Parameter name="CopyNoTag" value="[mr_eroll]"/> + <Parameter name="CopyNoOffset" value="8*[super]+0"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonendcapnumbering" eval="true"> + <SpecPar name="MuonEndcapStation1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep39" eval="false"/> + <PartSelector path="//GE0RingP"/> + <PartSelector path="//GE0RingN"/> + <PartSelector path="//ME1RingP"/> + <PartSelector path="//ME1RingN"/> + <PartSelector path="//ME12RingP"/> + <PartSelector path="//ME12RingN"/> + <PartSelector path="//ME13RingP"/> + <PartSelector path="//ME13RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep40" eval="false"/> + <PartSelector path="//ME2RingP"/> + <PartSelector path="//ME2RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep41" eval="false"/> + <PartSelector path="//ME3RingP"/> + <PartSelector path="//ME3RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapStation4"> + <Parameter name="OnlyForMuonNumbering" value="muonstep42" eval="false"/> + <PartSelector path="//ME4RingP"/> + <PartSelector path="//ME4RingN"/> + <Parameter name="CopyNoTag" value="[me_station]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapSubrings"> + <Parameter name="OnlyForMuonNumbering" value="muonstep43" eval="false"/> + <PartSelector path="//ME11Space"/> + <PartSelector path="//ME12Space"/> + <PartSelector path="//ME13Space"/> + <PartSelector path="//ME21Space"/> + <PartSelector path="//ME22Space"/> + <PartSelector path="//ME31Space"/> + <PartSelector path="//ME32Space"/> + <PartSelector path="//ME41Space"/> + <PartSelector path="//ME42Space"/> + <Parameter name="CopyNoTag" value="[me_subring]"/> + </SpecPar> + <SpecPar name="MuonEndcapSectors"> + <Parameter name="OnlyForMuonNumbering" value="muonstep44" eval="false"/> + <PartSelector path="//ME11SpaceDivision"/> + <PartSelector path="//ME12SpaceDivision"/> + <PartSelector path="//ME13SpaceDivision"/> + <PartSelector path="//ME21SpaceDivision"/> + <PartSelector path="//ME22SpaceDivision"/> + <PartSelector path="//ME31SpaceDivision"/> + <PartSelector path="//ME32SpaceDivision"/> + <PartSelector path="//ME41SpaceDivision"/> + <PartSelector path="//ME42SpaceDivision"/> + <Parameter name="CopyNoTag" value="[me_sector]"/> + </SpecPar> + <SpecPar name="MuonEndcapLayers"> + <Parameter name="OnlyForMuonNumbering" value="muonstep45" eval="false"/> + <PartSelector path="//ME11Layer"/> + <PartSelector path="//ME12Layer"/> + <PartSelector path="//ME13Layer"/> + <PartSelector path="//ME21Layer"/> + <PartSelector path="//ME22Layer"/> + <PartSelector path="//ME31Layer"/> + <PartSelector path="//ME32Layer"/> + <PartSelector path="//ME41Layer"/> + <PartSelector path="//ME42Layer"/> + <Parameter name="CopyNoTag" value="[me_layer]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing1"> + <Parameter name="OnlyForMuonNumbering" value="muonstep46" eval="false"/> + <PartSelector path="//ME11AlumFrame"/> + <PartSelector path="//ME21AlumFrame"/> + <PartSelector path="//ME31AlumFrame"/> + <PartSelector path="//ME41AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep47" eval="false"/> + <PartSelector path="//ME12AlumFrame"/> + <PartSelector path="//ME22AlumFrame"/> + <PartSelector path="//ME32AlumFrame"/> + <PartSelector path="//ME42AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRing3"> + <Parameter name="OnlyForMuonNumbering" value="muonstep48" eval="false"/> + <PartSelector path="//ME13AlumFrame"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonEndcapRingA"> + <Parameter name="OnlyForMuonNumbering" value="muonstep49" eval="false"/> + <PartSelector path="//ME1A_ActiveGasVol"/> + <Parameter name="CopyNoTag" value="[me_ring]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonGEMnumbering" eval="true"> + <SpecPar name="MuonGEMEndcap"> + <Parameter name="OnlyForMuonNumbering" value="muonstep50" eval="false"/> + <PartSelector path="//GEMDisk11."/> + <Parameter name="CopyNoTag" value="[mg_ring]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonGEMEndcap2"> + <Parameter name="OnlyForMuonNumbering" value="muonstep51" eval="false"/> + <PartSelector path="//GEMDisk21L."/> + <Parameter name="CopyNoTag" value="[mg_ring]"/> + <Parameter name="CopyNoOffset" value="2*[super]"/> + </SpecPar> + <SpecPar name="MuonGEMSector"> + <Parameter name="OnlyForMuonNumbering" value="muonstep52" eval="false"/> + <PartSelector path="//GEMBox11."/> + <PartSelector path="//GEMBox21."/> + <Parameter name="CopyNoTag" value="[mg_sector]"/> + <Parameter name="CopyNoOffset" value="3*[super]"/> + </SpecPar> + <SpecPar name="MuonGEMChamber"> + <Parameter name="OnlyForMuonNumbering" value="muonstep53" eval="false"/> + <PartSelector path="//GHA1.*"/> + <PartSelector path="//GHA2.*"/> + <Parameter name="CopyNoTag" value="[mg_roll]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + </SpecParSection> + <SpecParSection label="muonGE0Numbering" eval="true"> + <SpecPar name="MuonGE0Sector"> + <Parameter name="OnlyForMuonNumbering" value="muonstep54" eval="false"/> + <PartSelector path="//GE0Box"/> + <Parameter name="CopyNoTag" value="[mg_sector]"/> + <Parameter name="CopyNoOffset" value="1*[super]"/> + </SpecPar> + <SpecPar name="MuonGE0Layer"> + <Parameter name="OnlyForMuonNumbering" value="muonstep55" eval="false"/> + <PartSelector path="//GE0L.*"/> + <Parameter name="CopyNoTag" value="[mg_ring]"/> + <Parameter name="CopyNoOffset" value="3*[super]+1"/> + </SpecPar> + <SpecPar name="MuonGE0Chamber"> + <Parameter name="OnlyForMuonNumbering" value="muonstep56" eval="false"/> + <PartSelector path="//GHA0.*"/> + <Parameter name="CopyNoTag" value="[mg_roll]"/> + <Parameter name="CopyNoOffset" value="4*[super]"/> + </SpecPar> + </SpecParSection> +</DDDefinition> From aeaaf65d6077cfddf449677e771c0f7e90ad5a8e Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Fri, 16 Oct 2020 21:34:40 +0200 Subject: [PATCH 679/778] Migrate {Ecal,Hcal}HaloAlgo to EventSetup consumes --- RecoMET/METAlgorithms/interface/EcalHaloAlgo.h | 3 ++- RecoMET/METAlgorithms/interface/HcalHaloAlgo.h | 7 ++++--- RecoMET/METAlgorithms/src/EcalHaloAlgo.cc | 7 +++---- RecoMET/METAlgorithms/src/HcalHaloAlgo.cc | 7 +++---- RecoMET/METProducers/interface/EcalHaloDataProducer.h | 1 + RecoMET/METProducers/interface/HcalHaloDataProducer.h | 1 + RecoMET/METProducers/src/EcalHaloDataProducer.cc | 3 +-- RecoMET/METProducers/src/HcalHaloDataProducer.cc | 3 +-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/RecoMET/METAlgorithms/interface/EcalHaloAlgo.h b/RecoMET/METAlgorithms/interface/EcalHaloAlgo.h index b5737a565754b..12f8d955e215b 100644 --- a/RecoMET/METAlgorithms/interface/EcalHaloAlgo.h +++ b/RecoMET/METAlgorithms/interface/EcalHaloAlgo.h @@ -44,7 +44,7 @@ class EcalHaloAlgo { public: // constructor - EcalHaloAlgo(); + explicit EcalHaloAlgo(edm::ConsumesCollector iC); // destructor ~EcalHaloAlgo() {} @@ -117,6 +117,7 @@ class EcalHaloAlgo { float SumEnergyThreshold; int NHitsThreshold; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geoToken_; const CaloGeometry* geo; math::XYZPoint getPosition(const DetId& id, reco::Vertex::Point vtx); }; diff --git a/RecoMET/METAlgorithms/interface/HcalHaloAlgo.h b/RecoMET/METAlgorithms/interface/HcalHaloAlgo.h index bed5c02e73e6f..1ec1589092e22 100644 --- a/RecoMET/METAlgorithms/interface/HcalHaloAlgo.h +++ b/RecoMET/METAlgorithms/interface/HcalHaloAlgo.h @@ -36,12 +36,12 @@ #include "DataFormats/METReco/interface/HaloClusterCandidateHCAL.h" +#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" + class HcalHaloAlgo { public: //constructor - HcalHaloAlgo(); - //destructor - ~HcalHaloAlgo() {} + explicit HcalHaloAlgo(edm::ConsumesCollector iC); // run algorithm reco::HcalHaloData Calculate(const CaloGeometry& TheCaloGeometry, @@ -99,6 +99,7 @@ class HcalHaloAlgo { float SumEnergyThreshold; int NHitsThreshold; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geoToken_; const CaloGeometry* geo_; const HcalGeometry* hgeo_; math::XYZPoint getPosition(const DetId& id, reco::Vertex::Point vtx); diff --git a/RecoMET/METAlgorithms/src/EcalHaloAlgo.cc b/RecoMET/METAlgorithms/src/EcalHaloAlgo.cc index d8d6588af3003..fb939f02b93eb 100644 --- a/RecoMET/METAlgorithms/src/EcalHaloAlgo.cc +++ b/RecoMET/METAlgorithms/src/EcalHaloAlgo.cc @@ -1,3 +1,4 @@ +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "RecoMET/METAlgorithms/interface/EcalHaloAlgo.h" #include "DataFormats/Common/interface/ValueMap.h" @@ -16,7 +17,7 @@ using namespace edm; bool CompareTime(const EcalRecHit* x, const EcalRecHit* y) { return x->time() < y->time(); } -EcalHaloAlgo::EcalHaloAlgo() { +EcalHaloAlgo::EcalHaloAlgo(edm::ConsumesCollector iC) : geoToken_(iC.esConsumes()) { RoundnessCut = 0; AngleCut = 0; EBRecHitEnergyThreshold = 0.; @@ -182,9 +183,7 @@ EcalHaloData EcalHaloAlgo::Calculate(const CaloGeometry& TheCaloGeometry, TheAngleFiller.fill(); } - edm::ESHandle<CaloGeometry> pGeo; - TheSetup.get<CaloGeometryRecord>().get(pGeo); - geo = pGeo.product(); + geo = &TheSetup.getData(geoToken_); //Halo cluster building: //Various clusters are built, depending on the subdetector. diff --git a/RecoMET/METAlgorithms/src/HcalHaloAlgo.cc b/RecoMET/METAlgorithms/src/HcalHaloAlgo.cc index 01df8e817a4a8..3ac31a33c7772 100644 --- a/RecoMET/METAlgorithms/src/HcalHaloAlgo.cc +++ b/RecoMET/METAlgorithms/src/HcalHaloAlgo.cc @@ -1,3 +1,4 @@ +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "RecoMET/METAlgorithms/interface/HcalHaloAlgo.h" #include <map> @@ -20,7 +21,7 @@ bool CompareTowers(const CaloTower* x, const CaloTower* y) { return x->iphi() * 1000 + x->ieta() < y->iphi() * 1000 + y->ieta(); } -HcalHaloAlgo::HcalHaloAlgo() : geo_(nullptr), hgeo_(nullptr) { +HcalHaloAlgo::HcalHaloAlgo(edm::ConsumesCollector iC) : geoToken_(iC.esConsumes()), geo_(nullptr), hgeo_(nullptr) { HBRecHitEnergyThreshold = 0.; HERecHitEnergyThreshold = 0.; SumEnergyThreshold = 0.; @@ -223,9 +224,7 @@ HcalHaloData HcalHaloAlgo::Calculate(const CaloGeometry& TheCaloGeometry, prevHadEt = tower->hadEt(); } - edm::ESHandle<CaloGeometry> pGeo; - TheSetup.get<CaloGeometryRecord>().get(pGeo); - geo_ = pGeo.product(); + geo_ = &TheSetup.getData(geoToken_); hgeo_ = dynamic_cast<const HcalGeometry*>(geo_->getSubdetectorGeometry(DetId::Hcal, 1)); //Halo cluster building: diff --git a/RecoMET/METProducers/interface/EcalHaloDataProducer.h b/RecoMET/METProducers/interface/EcalHaloDataProducer.h index e14ab504fab09..a81cea5230a98 100644 --- a/RecoMET/METProducers/interface/EcalHaloDataProducer.h +++ b/RecoMET/METProducers/interface/EcalHaloDataProducer.h @@ -116,6 +116,7 @@ namespace reco { edm::EDGetTokenT<reco::SuperClusterCollection> supercluster_token_; edm::EDGetTokenT<reco::PhotonCollection> photon_token_; edm::ESGetToken<CaloGeometry, CaloGeometryRecord> calogeometry_token_; + EcalHaloAlgo EcalAlgo; float EBRecHitEnergyThreshold; float EERecHitEnergyThreshold; diff --git a/RecoMET/METProducers/interface/HcalHaloDataProducer.h b/RecoMET/METProducers/interface/HcalHaloDataProducer.h index 0b0e5786dc64f..f719cd54a9425 100644 --- a/RecoMET/METProducers/interface/HcalHaloDataProducer.h +++ b/RecoMET/METProducers/interface/HcalHaloDataProducer.h @@ -105,6 +105,7 @@ namespace reco { edm::EDGetTokenT<HFRecHitCollection> hfrechit_token_; edm::EDGetTokenT<CaloTowerCollection> calotower_token_; edm::ESGetToken<CaloGeometry, CaloGeometryRecord> calogeometry_token_; + HcalHaloAlgo HcalAlgo; float HBRecHitEnergyThreshold; float HERecHitEnergyThreshold; diff --git a/RecoMET/METProducers/src/EcalHaloDataProducer.cc b/RecoMET/METProducers/src/EcalHaloDataProducer.cc index 6edb297a3cc8c..29e8f5d63371c 100644 --- a/RecoMET/METProducers/src/EcalHaloDataProducer.cc +++ b/RecoMET/METProducers/src/EcalHaloDataProducer.cc @@ -12,7 +12,7 @@ using namespace edm; using namespace std; using namespace reco; -EcalHaloDataProducer::EcalHaloDataProducer(const edm::ParameterSet& iConfig) { +EcalHaloDataProducer::EcalHaloDataProducer(const edm::ParameterSet& iConfig) : EcalAlgo(consumesCollector()) { //RecHit Level IT_EBRecHit = iConfig.getParameter<edm::InputTag>("EBRecHitLabel"); IT_EERecHit = iConfig.getParameter<edm::InputTag>("EERecHitLabel"); @@ -82,7 +82,6 @@ void EcalHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup) { iEvent.getByToken(photon_token_, ThePhotons); //Run the EcalHaloAlgo to reconstruct the EcalHaloData object - EcalHaloAlgo EcalAlgo; EcalAlgo.SetRoundnessCut(RoundnessCut); EcalAlgo.SetAngleCut(AngleCut); EcalAlgo.SetRecHitEnergyThresholds(EBRecHitEnergyThreshold, EERecHitEnergyThreshold, ESRecHitEnergyThreshold); diff --git a/RecoMET/METProducers/src/HcalHaloDataProducer.cc b/RecoMET/METProducers/src/HcalHaloDataProducer.cc index 3254ff169617d..4b25f906038f6 100644 --- a/RecoMET/METProducers/src/HcalHaloDataProducer.cc +++ b/RecoMET/METProducers/src/HcalHaloDataProducer.cc @@ -12,7 +12,7 @@ using namespace edm; using namespace std; using namespace reco; -HcalHaloDataProducer::HcalHaloDataProducer(const edm::ParameterSet& iConfig) { +HcalHaloDataProducer::HcalHaloDataProducer(const edm::ParameterSet& iConfig) : HcalAlgo(consumesCollector()) { //RecHit Level IT_EBRecHit = iConfig.getParameter<edm::InputTag>("EBRecHitLabel"); IT_EERecHit = iConfig.getParameter<edm::InputTag>("EERecHitLabel"); @@ -63,7 +63,6 @@ void HcalHaloDataProducer::produce(Event& iEvent, const EventSetup& iSetup) { iEvent.getByToken(hfrechit_token_, TheHFRecHits); // Run the HcalHaloAlgo to reconstruct the HcalHaloData object - HcalHaloAlgo HcalAlgo; HcalAlgo.SetRecHitEnergyThresholds(HBRecHitEnergyThreshold, HERecHitEnergyThreshold); HcalAlgo.SetPhiWedgeThresholds(SumHcalEnergyThreshold, NHitsHcalThreshold); From 5f8afba070a7cce6bcf38f6fe278547ef557a244 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Mon, 19 Oct 2020 15:56:05 +0200 Subject: [PATCH 680/778] Avoid error from static analyzer --- Geometry/MuonNumbering/src/GEMNumberingScheme.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Geometry/MuonNumbering/src/GEMNumberingScheme.cc b/Geometry/MuonNumbering/src/GEMNumberingScheme.cc index 172c79e6a7f87..7df97c764d654 100644 --- a/Geometry/MuonNumbering/src/GEMNumberingScheme.cc +++ b/Geometry/MuonNumbering/src/GEMNumberingScheme.cc @@ -35,7 +35,7 @@ int GEMNumberingScheme::baseNumberToUnitNumber(const MuonBaseNumber& num) const #ifdef EDM_ML_DEBUG if (levels != theRollLevel) edm::LogVerbatim("GEMNumberingScheme") << "MuonGEMNumberingScheme::BNToUN: BaseNumber has " << num.getLevels() - << " levels, need " << maxLevel << ":" << theRingLevel; + << " levels, need at least till " << theRingLevel; #endif int region(GEMDetId::minRegionId), ring(GEMDetId::minRingId); From aa3ab598d8b2183d2700d46b9a4957a65a3965c0 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Mon, 19 Oct 2020 15:57:35 +0200 Subject: [PATCH 681/778] Use ESGetToken and LogVerbatim --- .../plugins/AlCaHBHEMuonFilter.cc | 48 ++++++++--------- .../plugins/AlCaHEMuonFilter.cc | 47 ++++++++-------- .../plugins/AlCaIsoTracksFilter.cc | 22 ++++---- .../plugins/AlCaIsoTracksProducerFilter.cc | 14 ++--- .../plugins/AlCaIsolatedBunchFilter.cc | 26 ++++----- .../plugins/AlCaIsolatedBunchSelector.cc | 18 +++---- .../plugins/AlCaLowPUHBHEMuonFilter.cc | 37 ++++++------- .../src/AlCaDiJetsProducer.cc | 2 +- .../src/AlCaHBHEMuonProducer.cc | 18 +++---- .../src/AlCaIsoTracksProducer.cc | 54 +++++++++---------- .../src/ProducerAnalyzer.cc | 6 +-- .../src/ProducerAnalyzer.h | 5 ++ 12 files changed, 152 insertions(+), 145 deletions(-) diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc index 4b1322d8f0e14..c876cd11a089c 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc @@ -34,7 +34,7 @@ #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" -//#define DebugLog +//#define EDM_ML_DEBUG // // class declaration // @@ -76,6 +76,8 @@ class AlCaHBHEMuonFilter : public edm::stream::EDFilter<edm::GlobalCache<AlCaHBH edm::EDGetTokenT<trigger::TriggerEvent> tok_trigEvt; edm::EDGetTokenT<edm::TriggerResults> tok_trigRes_; edm::EDGetTokenT<reco::MuonCollection> tok_Muon_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_magField_; }; // @@ -107,11 +109,15 @@ AlCaHBHEMuonFilter::AlCaHBHEMuonFilter(edm::ParameterSet const& iConfig, const A // define tokens for access tok_trigRes_ = consumes<edm::TriggerResults>(triggerResults_); tok_Muon_ = consumes<reco::MuonCollection>(labelMuon_); - edm::LogInfo("HBHEMuon") << "Parameters read from config file \n" + + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>(); + tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + + edm::LogVerbatim("HBHEMuon") << "Parameters read from config file \n" << "Process " << processName_ << " Prescale " << preScale_ << " Isolation Cuts " << trackIsoCut_ << ":" << caloIsoCut_ << "\n"; for (unsigned int k = 0; k < trigNames_.size(); ++k) - edm::LogInfo("HBHEMuon") << "Trigger[" << k << "] " << trigNames_[k] << "\n"; + edm::LogVerbatim("HBHEMuon") << "Trigger[" << k << "] " << trigNames_[k] << "\n"; } // AlCaHBHEMuonFilter::AlCaHBHEMuonFilter constructor AlCaHBHEMuonFilter::~AlCaHBHEMuonFilter() {} @@ -124,8 +130,8 @@ AlCaHBHEMuonFilter::~AlCaHBHEMuonFilter() {} bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) { bool accept(false); ++nAll_; -#ifdef DebugLog - edm::LogInfo("HBHEMuon") << "AlCaHBHEMuonFilter::Run " << iEvent.id().run() << " Event " << iEvent.id().event() +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; #endif @@ -145,8 +151,8 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu if (hlt > 0) { ok = true; } -#ifdef DebugLog - edm::LogInfo("HBHEMuon") << "AlCaHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" << ok << std::endl; #endif } @@ -154,25 +160,19 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu } if (ok) { //Step2: Get geometry/B-field information - //Get magnetic field - edm::ESHandle<MagneticField> bFieldH; - iSetup.get<IdealMagneticFieldRecord>().get(bFieldH); - const MagneticField* bField = bFieldH.product(); - // get handles to calogeometry - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); + const MagneticField* bField = &(iSetup.getData(tok_magField_)); + const CaloGeometry* geo = &(iSetup.getData(tok_geom_)); // Relevant blocks from iEvent edm::Handle<reco::MuonCollection> _Muon; iEvent.getByToken(tok_Muon_, _Muon); -#ifdef DebugLog - edm::LogInfo("HBHEMuon") << "AlCaHBHEMuonFilter::Muon Handle " << _Muon.isValid() << std::endl; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Muon Handle " << _Muon.isValid() << std::endl; #endif if (_Muon.isValid()) { for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) { -#ifdef DebugLog - edm::LogInfo("HBHEMuon") << "AlCaHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() << " innerTrack " << RecMuon->innerTrack().isNonnull() << " outerTrack " << RecMuon->outerTrack().isNonnull() << " globalTrack " << RecMuon->globalTrack().isNonnull() << std::endl; @@ -181,8 +181,8 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu (RecMuon->outerTrack().isNonnull()) && (RecMuon->globalTrack().isNonnull())) { const reco::Track* pTrack = (RecMuon->innerTrack()).get(); spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false); -#ifdef DebugLog - edm::LogInfo("HBHEMuon") << "AlCaHBHEMuonFilter::Propagate: ECAL " << trackID.okECAL << " to HCAL " +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Propagate: ECAL " << trackID.okECAL << " to HCAL " << trackID.okHCAL << std::endl; #endif double trackIso = RecMuon->isolationR03().sumPt; @@ -224,7 +224,7 @@ void AlCaHBHEMuonFilter::endStream() { } void AlCaHBHEMuonFilter::globalEndJob(const AlCaHBHEMuons::Counters* count) { - edm::LogInfo("HBHEMuon") << "Selects " << count->nFinal_ << " out of " << count->nGood_ << " good events out of " + edm::LogVerbatim("HBHEMuon") << "Selects " << count->nFinal_ << " out of " << count->nGood_ << " good events out of " << count->nAll_ << " total # of events\n"; } @@ -232,12 +232,12 @@ void AlCaHBHEMuonFilter::globalEndJob(const AlCaHBHEMuons::Counters* count) { void AlCaHBHEMuonFilter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); bool flag = hltConfig_.init(iRun, iSetup, processName_, changed); - edm::LogInfo("HBHEMuon") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag << std::endl; + edm::LogVerbatim("HBHEMuon") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag << std::endl; } // ------------ method called when ending the processing of a run ------------ void AlCaHBHEMuonFilter::endRun(edm::Run const& iRun, edm::EventSetup const&) { - edm::LogInfo("HBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run() << "\n"; + edm::LogVerbatim("HBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run() << "\n"; nRun_++; } diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHEMuonFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHEMuonFilter.cc index bc6d942ee070b..aa0efe4d182ba 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHEMuonFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHEMuonFilter.cc @@ -34,7 +34,7 @@ #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" -//#define DebugLog +//#define EDM_ML_DEBUG // // class declaration // @@ -76,6 +76,8 @@ class AlCaHEMuonFilter : public edm::stream::EDFilter<edm::GlobalCache<AlCaHEMuo edm::EDGetTokenT<trigger::TriggerEvent> tok_trigEvt; edm::EDGetTokenT<edm::TriggerResults> tok_trigRes_; edm::EDGetTokenT<reco::MuonCollection> tok_Muon_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_magField_; }; // @@ -109,11 +111,15 @@ AlCaHEMuonFilter::AlCaHEMuonFilter(edm::ParameterSet const& iConfig, const AlCaH // define tokens for access tok_trigRes_ = consumes<edm::TriggerResults>(triggerResults_); tok_Muon_ = consumes<reco::MuonCollection>(labelMuon_); - edm::LogInfo("HEMuon") << "Parameters read from config file \n" + + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>(); + tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + + edm::LogVerbatim("HEMuon") << "Parameters read from config file \n" << "Process " << processName_ << " Prescale " << preScale_ << " Isolation Cuts " << trackIsoCut_ << ":" << caloIsoCut_ << "\n"; for (unsigned int k = 0; k < trigNames_.size(); ++k) - edm::LogInfo("HEMuon") << "Trigger[" << k << "] " << trigNames_[k] << "\n"; + edm::LogVerbatim("HEMuon") << "Trigger[" << k << "] " << trigNames_[k] << "\n"; } // AlCaHEMuonFilter::AlCaHEMuonFilter constructor AlCaHEMuonFilter::~AlCaHEMuonFilter() {} @@ -126,8 +132,8 @@ AlCaHEMuonFilter::~AlCaHEMuonFilter() {} bool AlCaHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) { bool accept(false); ++nAll_; -#ifdef DebugLog - edm::LogInfo("HEMuon") << "AlCaHEMuonFilter::Run " << iEvent.id().run() << " Event " << iEvent.id().event() +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; #endif @@ -147,8 +153,8 @@ bool AlCaHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) if (hlt > 0) { ok = true; } -#ifdef DebugLog - edm::LogInfo("HEMuon") << "AlCaHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" << ok +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" << ok << std::endl; #endif } @@ -157,24 +163,19 @@ bool AlCaHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) if (ok) { //Step2: Get geometry/B-field information //Get magnetic field - edm::ESHandle<MagneticField> bFieldH; - iSetup.get<IdealMagneticFieldRecord>().get(bFieldH); - const MagneticField* bField = bFieldH.product(); - // get handles to calogeometry - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); + const MagneticField* bField = &(iSetup.getData(tok_magField_)); + const CaloGeometry* geo = &(iSetup.getData(tok_geom_)); // Relevant blocks from iEvent edm::Handle<reco::MuonCollection> _Muon; iEvent.getByToken(tok_Muon_, _Muon); -#ifdef DebugLog - edm::LogInfo("HEMuon") << "AlCaHEMuonFilter::Muon Handle " << _Muon.isValid() << std::endl; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Muon Handle " << _Muon.isValid() << std::endl; #endif if (_Muon.isValid()) { for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) { -#ifdef DebugLog - edm::LogInfo("HEMuon") << "AlCaHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() << " innerTrack " +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() << " innerTrack " << RecMuon->innerTrack().isNonnull() << " outerTrack " << RecMuon->outerTrack().isNonnull() << " globalTrack " << RecMuon->globalTrack().isNonnull() << std::endl; @@ -188,8 +189,8 @@ bool AlCaHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) const reco::Track* pTrack = (RecMuon->innerTrack()).get(); spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false); -#ifdef DebugLog - edm::LogInfo("HEMuon") << "AlCaHEMuonFilter::Propagate: ECAL " << trackID.okECAL << " to HCAL " +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Propagate: ECAL " << trackID.okECAL << " to HCAL " << trackID.okHCAL << std::endl; #endif double trackIso = RecMuon->isolationR03().sumPt; @@ -231,7 +232,7 @@ void AlCaHEMuonFilter::endStream() { } void AlCaHEMuonFilter::globalEndJob(const AlCaHEMuons::Counters* count) { - edm::LogInfo("HEMuon") << "Selects " << count->nFinal_ << " out of " << count->nGood_ << " good events out of " + edm::LogVerbatim("HEMuon") << "Selects " << count->nFinal_ << " out of " << count->nGood_ << " good events out of " << count->nAll_ << " total # of events\n"; } @@ -239,12 +240,12 @@ void AlCaHEMuonFilter::globalEndJob(const AlCaHEMuons::Counters* count) { void AlCaHEMuonFilter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); bool flag = hltConfig_.init(iRun, iSetup, processName_, changed); - edm::LogInfo("HEMuon") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag << std::endl; + edm::LogVerbatim("HEMuon") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag << std::endl; } // ------------ method called when ending the processing of a run ------------ void AlCaHEMuonFilter::endRun(edm::Run const& iRun, edm::EventSetup const&) { - edm::LogInfo("HEMuon") << "endRun[" << nRun_ << "] " << iRun.run() << "\n"; + edm::LogVerbatim("HEMuon") << "endRun[" << nRun_ << "] " << iRun.run() << "\n"; nRun_++; } diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc index e1fd38325418f..a86ffb2212e42 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc @@ -110,6 +110,8 @@ class AlCaIsoTracksFilter : public edm::stream::EDFilter<edm::GlobalCache<AlCaIs edm::EDGetTokenT<EcalRecHitCollection> tok_EB_; edm::EDGetTokenT<EcalRecHitCollection> tok_EE_; edm::EDGetTokenT<HBHERecHitCollection> tok_hbhe_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_magField_; }; // @@ -190,7 +192,10 @@ AlCaIsoTracksFilter::AlCaIsoTracksFilter(const edm::ParameterSet& iConfig, const tok_EE_ = consumes<EcalRecHitCollection>(labelEE_); tok_hbhe_ = consumes<HBHERecHitCollection>(labelHBHE_); - edm::LogInfo("HcalIsoTrack") << "Parameters read from config file \n" + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>(); + tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + + edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n" << "\t minPt " << selectionParameter_.minPt << "\t theTrackQuality " << theTrackQuality_ << "\t minQuality " << selectionParameter_.minQuality << "\t maxDxyPV " << selectionParameter_.maxDxyPV << "\t maxDzPV " << selectionParameter_.maxDzPV @@ -209,7 +214,7 @@ AlCaIsoTracksFilter::AlCaIsoTracksFilter(const edm::ParameterSet& iConfig, const << hitEthrEEHi_; for (unsigned int k = 0; k < trigNames_.size(); ++k) - edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k]; + edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k]; } // AlCaIsoTracksFilter::AlCaIsoTracksFilter constructor AlCaIsoTracksFilter::~AlCaIsoTracksFilter() {} @@ -265,13 +270,8 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet //Step2: Get geometry/B-field information if (triggerSatisfied) { //Get magnetic field - edm::ESHandle<MagneticField> bFieldH; - iSetup.get<IdealMagneticFieldRecord>().get(bFieldH); - const MagneticField* bField = bFieldH.product(); - // get handles to calogeometry and calotopology - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); + const MagneticField* bField = &(iSetup.getData(tok_magField_)); + const CaloGeometry* geo = &(iSetup.getData(tok_geom_)); //Also relevant information to extrapolate tracks to Hcal surface bool foundCollections(true); @@ -429,14 +429,14 @@ void AlCaIsoTracksFilter::globalEndJob(const AlCaIsoTracks::Counters* count) { // ------------ method called when starting to processes a run ------------ void AlCaIsoTracksFilter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); - edm::LogInfo("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " + edm::LogVerbatim("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << hltConfig_.init(iRun, iSetup, processName_, changed); } // ------------ method called when ending the processing of a run ------------ void AlCaIsoTracksFilter::endRun(edm::Run const& iRun, edm::EventSetup const&) { ++nRun_; - edm::LogInfo("HcalIsoTrack") << "endRun[" << nRun_ << "] " << iRun.run(); + edm::LogVerbatim("HcalIsoTrack") << "endRun[" << nRun_ << "] " << iRun.run(); } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc index 68f1c69206ab0..cf6830d9a9775 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc @@ -73,10 +73,10 @@ AlCaIsoTracksProducerFilter::AlCaIsoTracksProducerFilter(const edm::ParameterSet // define tokens for access tok_trigRes_ = consumes<edm::TriggerResults>(triggerResultsLabel_); - edm::LogInfo("HcalIsoTrack") << "Use process name " << processName_ << " Labels " << triggerResultsLabel_ + edm::LogVerbatim("HcalIsoTrack") << "Use process name " << processName_ << " Labels " << triggerResultsLabel_ << " selecting " << trigNames_.size() << " triggers\n"; for (unsigned int k = 0; k < trigNames_.size(); ++k) { - edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k] << std::endl; + edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k] << std::endl; } } @@ -84,7 +84,7 @@ AlCaIsoTracksProducerFilter::~AlCaIsoTracksProducerFilter() {} bool AlCaIsoTracksProducerFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) { ++nAll_; - edm::LogInfo("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " + edm::LogVerbatim("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; //Find if the event passes one of the chosen triggers @@ -102,7 +102,7 @@ bool AlCaIsoTracksProducerFilter::filter(edm::Event& iEvent, edm::EventSetup con int hlt = triggerResults->accept(iHLT); for (unsigned int i = 0; i < trigNames_.size(); ++i) { if (triggerNames_[iHLT].find(trigNames_[i]) != std::string::npos) { - edm::LogInfo("HcalIsoTrack") << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" + edm::LogVerbatim("HcalIsoTrack") << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << triggerSatisfied << std::endl; if (hlt > 0) { triggerSatisfied = true; @@ -126,18 +126,18 @@ void AlCaIsoTracksProducerFilter::endStream() { } void AlCaIsoTracksProducerFilter::globalEndJob(const AlCaIsoTracksProdFilter::Counters* count) { - edm::LogInfo("HcalIsoTrack") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events " << std::endl; + edm::LogVerbatim("HcalIsoTrack") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events " << std::endl; } void AlCaIsoTracksProducerFilter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); bool flag = hltConfig_.init(iRun, iSetup, processName_, changed); - edm::LogInfo("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag << std::endl; + edm::LogVerbatim("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag << std::endl; } void AlCaIsoTracksProducerFilter::endRun(edm::Run const& iRun, edm::EventSetup const&) { ++nRun_; - edm::LogInfo("HcalIsoTrack") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl; + edm::LogVerbatim("HcalIsoTrack") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl; } void AlCaIsoTracksProducerFilter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchFilter.cc index 48bf8662d7a13..2b541b3311882 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchFilter.cc @@ -26,7 +26,7 @@ // class declaration // -//#define DebugLog +//#define EDM_ML_DEBUG namespace AlCaIsolatedBunch { struct Counters { @@ -77,13 +77,13 @@ AlCaIsolatedBunchFilter::AlCaIsolatedBunchFilter(const edm::ParameterSet& iConfi // define tokens for access tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel_); - edm::LogInfo("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_ << " with " + edm::LogVerbatim("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_ << " with " << trigIsoBunchNames_.size() << ":" << trigJetNames_.size() << " trigger names and" << " process " << processName_ << std::endl; for (unsigned int k = 0; k < trigIsoBunchNames_.size(); ++k) - edm::LogInfo("AlCaIsoBunch") << "Isolated Bunch[" << k << "] " << trigIsoBunchNames_[k] << std::endl; + edm::LogVerbatim("AlCaIsoBunch") << "Isolated Bunch[" << k << "] " << trigIsoBunchNames_[k] << std::endl; for (unsigned int k = 0; k < trigJetNames_.size(); ++k) - edm::LogInfo("AlCaIsoBunch") << "Jet Trigger[" << k << "] " << trigJetNames_[k] << std::endl; + edm::LogVerbatim("AlCaIsoBunch") << "Jet Trigger[" << k << "] " << trigJetNames_[k] << std::endl; } AlCaIsolatedBunchFilter::~AlCaIsolatedBunchFilter() {} @@ -96,8 +96,8 @@ AlCaIsolatedBunchFilter::~AlCaIsolatedBunchFilter() {} bool AlCaIsolatedBunchFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) { bool accept(false); ++nAll_; -#ifdef DebugLog - edm::LogInfo("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; #endif //Step1: Find if the event passes one of the chosen triggers @@ -119,8 +119,8 @@ bool AlCaIsolatedBunchFilter::filter(edm::Event& iEvent, edm::EventSetup const& if (hlt > 0) jet = true; if (jet) { -#ifdef DebugLog - edm::LogInfo("AlCaIsoBunch") +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AlCaIsoBunch") << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << jet << ":" << isobunch << std::endl; #endif break; @@ -134,8 +134,8 @@ bool AlCaIsolatedBunchFilter::filter(edm::Event& iEvent, edm::EventSetup const& if (hlt > 0) isobunch = true; if (isobunch) { -#ifdef DebugLog - edm::LogInfo("AlCaIsoBunch") +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AlCaIsoBunch") << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << jet << ":" << isobunch << std::endl; #endif break; @@ -164,19 +164,19 @@ void AlCaIsolatedBunchFilter::endStream() { } void AlCaIsolatedBunchFilter::globalEndJob(const AlCaIsolatedBunch::Counters* count) { - edm::LogInfo("AlCaIsoBunch") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events" << std::endl; + edm::LogVerbatim("AlCaIsoBunch") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events" << std::endl; } // ------------ method called when starting to processes a run ------------ void AlCaIsolatedBunchFilter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); - edm::LogInfo("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " + edm::LogVerbatim("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl; } // ------------ method called when ending the processing of a run ------------ void AlCaIsolatedBunchFilter::endRun(edm::Run const& iRun, edm::EventSetup const&) { ++nRun_; - edm::LogInfo("AlCaIsoBunch") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl; + edm::LogVerbatim("AlCaIsoBunch") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl; } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchSelector.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchSelector.cc index 494ad0b4bc1a3..a2b958216f1cc 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchSelector.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchSelector.cc @@ -26,7 +26,7 @@ // class declaration // -//#define DebugLog +//#define EDM_ML_DEBUG namespace AlCaIsolatedBunch { struct Counters { @@ -76,7 +76,7 @@ AlCaIsolatedBunchSelector::AlCaIsolatedBunchSelector(const edm::ParameterSet& iC // define tokens for access tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel_); - edm::LogInfo("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_ << " with trigger name " + edm::LogVerbatim("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_ << " with trigger name " << trigName_ << " and process " << processName_ << std::endl; } @@ -90,8 +90,8 @@ AlCaIsolatedBunchSelector::~AlCaIsolatedBunchSelector() {} bool AlCaIsolatedBunchSelector::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) { bool accept(false); ++nAll_; -#ifdef DebugLog - edm::LogInfo("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; #endif //Step1: Find if the event passes the chosen trigger @@ -105,8 +105,8 @@ bool AlCaIsolatedBunchSelector::filter(edm::Event& iEvent, edm::EventSetup const if (triggerNames_[iHLT].find(trigName_) != std::string::npos) { if (hlt > 0) { accept = true; -#ifdef DebugLog - edm::LogInfo("AlCaIsoBunch") << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << accept +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AlCaIsoBunch") << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << accept << std::endl; #endif break; @@ -128,19 +128,19 @@ void AlCaIsolatedBunchSelector::endStream() { } void AlCaIsolatedBunchSelector::globalEndJob(const AlCaIsolatedBunch::Counters* count) { - edm::LogInfo("AlCaIsoBunch") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events" << std::endl; + edm::LogVerbatim("AlCaIsoBunch") << "Selects " << count->nGood_ << " in " << count->nAll_ << " events" << std::endl; } // ------------ method called when starting to processes a run ------------ void AlCaIsolatedBunchSelector::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); - edm::LogInfo("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " + edm::LogVerbatim("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl; } // ------------ method called when ending the processing of a run ------------ void AlCaIsolatedBunchSelector::endRun(edm::Run const& iRun, edm::EventSetup const&) { ++nRun_; - edm::LogInfo("AlCaIsoBunch") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl; + edm::LogVerbatim("AlCaIsoBunch") << "endRun[" << nRun_ << "] " << iRun.run() << std::endl; } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaLowPUHBHEMuonFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaLowPUHBHEMuonFilter.cc index da1acfaeedea8..1f2f4e4806ca3 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaLowPUHBHEMuonFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaLowPUHBHEMuonFilter.cc @@ -76,6 +76,8 @@ class AlCaLowPUHBHEMuonFilter : public edm::stream::EDFilter<edm::GlobalCache<Al edm::EDGetTokenT<trigger::TriggerEvent> tok_trigEvt; edm::EDGetTokenT<edm::TriggerResults> tok_trigRes_; edm::EDGetTokenT<reco::MuonCollection> tok_Muon_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_magField_; }; // @@ -100,15 +102,20 @@ AlCaLowPUHBHEMuonFilter::AlCaLowPUHBHEMuonFilter(edm::ParameterSet const& iConfi pfIsoCut_ = iConfig.getParameter<double>("pfIsolationCut"); minimumMuonpT_ = iConfig.getParameter<double>("minimumMuonpT"); minimumMuoneta_ = iConfig.getParameter<double>("minimumMuoneta"); + // define tokens for access tok_trigRes_ = consumes<edm::TriggerResults>(triggerResults_); tok_Muon_ = consumes<reco::MuonCollection>(labelMuon_); - edm::LogInfo("LowPUHBHEMuon") << "Parameters read from config file \n" + + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>(); + tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + + edm::LogVerbatim("LowPUHBHEMuon") << "Parameters read from config file \n" << "Process " << processName_ << " PF Isolation Cuts " << pfIsoCut_ << " minimum Muon pT cut " << minimumMuonpT_ << " minimum Muon eta cut " << minimumMuoneta_; for (unsigned int k = 0; k < trigNames_.size(); ++k) - edm::LogInfo("LowPUHBHEMuon") << "Trigger[" << k << "] " << trigNames_[k]; + edm::LogVerbatim("LowPUHBHEMuon") << "Trigger[" << k << "] " << trigNames_[k]; } // AlCaLowPUHBHEMuonFilter::AlCaLowPUHBHEMuonFilter constructor AlCaLowPUHBHEMuonFilter::~AlCaLowPUHBHEMuonFilter() {} @@ -122,7 +129,7 @@ bool AlCaLowPUHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& bool accept(false); ++nAll_; #ifdef EDM_ML_DEBUG - edm::LogInfo("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Run " << iEvent.id().run() << " Event " + edm::LogVerbatim("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); #endif @@ -144,7 +151,7 @@ bool AlCaLowPUHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& if (hlt > 0) ok = true; #ifdef EDM_ML_DEBUG - edm::LogInfo("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt + edm::LogVerbatim("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" << ok; #endif } @@ -152,25 +159,19 @@ bool AlCaLowPUHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& } if (ok) { //Step2: Get geometry/B-field information - //Get magnetic field - edm::ESHandle<MagneticField> bFieldH; - iSetup.get<IdealMagneticFieldRecord>().get(bFieldH); - const MagneticField* bField = bFieldH.product(); - // get handles to calogeometry - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); + const MagneticField* bField = &(iSetup.getData(tok_magField_)); + const CaloGeometry* geo = &(iSetup.getData(tok_geom_)); // Relevant blocks from iEvent edm::Handle<reco::MuonCollection> _Muon; iEvent.getByToken(tok_Muon_, _Muon); #ifdef EDM_ML_DEBUG - edm::LogInfo("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Muon Handle " << _Muon.isValid(); + edm::LogVerbatim("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Muon Handle " << _Muon.isValid(); #endif if (_Muon.isValid()) { for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) { #ifdef EDM_ML_DEBUG - edm::LogInfo("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() + edm::LogVerbatim("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() << " innerTrack " << RecMuon->innerTrack().isNonnull() << " outerTrack " << RecMuon->outerTrack().isNonnull() << " globalTrack " << RecMuon->globalTrack().isNonnull(); @@ -182,7 +183,7 @@ bool AlCaLowPUHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& const reco::Track* pTrack = (RecMuon->innerTrack()).get(); spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false); #ifdef EDM_ML_DEBUG - edm::LogInfo("LowPUHBHEMuon") + edm::LogVerbatim("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Propagate: ECAL " << trackID.okECAL << " to HCAL " << trackID.okHCAL; #endif double isolR04 = @@ -216,7 +217,7 @@ void AlCaLowPUHBHEMuonFilter::endStream() { } void AlCaLowPUHBHEMuonFilter::globalEndJob(const AlCaLowPUHBHEMuons::Counters* count) { - edm::LogInfo("LowPUHBHEMuon") << "Selects " << count->nGood_ << " good events out of " << count->nAll_ + edm::LogVerbatim("LowPUHBHEMuon") << "Selects " << count->nGood_ << " good events out of " << count->nAll_ << " total # of events"; } @@ -224,12 +225,12 @@ void AlCaLowPUHBHEMuonFilter::globalEndJob(const AlCaLowPUHBHEMuons::Counters* c void AlCaLowPUHBHEMuonFilter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); bool flag = hltConfig_.init(iRun, iSetup, processName_, changed); - edm::LogInfo("LowPUHBHEMuon") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag; + edm::LogVerbatim("LowPUHBHEMuon") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag; } // ------------ method called when ending the processing of a run ------------ void AlCaLowPUHBHEMuonFilter::endRun(edm::Run const& iRun, edm::EventSetup const&) { - edm::LogInfo("LowPUHBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run(); + edm::LogVerbatim("LowPUHBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run(); nRun_++; } diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaDiJetsProducer.cc b/Calibration/HcalAlCaRecoProducers/src/AlCaDiJetsProducer.cc index 83a4c7841645d..1bde66ae4bd2c 100644 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaDiJetsProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/src/AlCaDiJetsProducer.cc @@ -97,7 +97,7 @@ AlCaDiJetsProducer::~AlCaDiJetsProducer() {} void AlCaDiJetsProducer::beginJob() {} void AlCaDiJetsProducer::endJob() { - edm::LogInfo("AlcaDiJets") << "Accepts " << nSelect_ << " events from a total of " << nAll_ << " events"; + edm::LogVerbatim("AlcaDiJets") << "Accepts " << nSelect_ << " events from a total of " << nAll_ << " events"; } bool AlCaDiJetsProducer::select(reco::PFJetCollection jt) { diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc b/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc index 209d0a1145de1..4f752b378cbc2 100644 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc @@ -1,5 +1,5 @@ // -*- C++ -*- -//#define DebugLog +//#define EDM_ML_DEBUG // system include files #include <atomic> @@ -96,7 +96,7 @@ AlCaHBHEMuonProducer::AlCaHBHEMuonProducer(edm::ParameterSet const& iConfig, con tok_HBHE_ = consumes<HBHERecHitCollection>(labelHBHE_); tok_Muon_ = consumes<reco::MuonCollection>(labelMuon_); - edm::LogInfo("HcalHBHEMuon") << "Parameters read from config file \n" + edm::LogVerbatim("HcalHBHEMuon") << "Parameters read from config file \n" << "\t minP of muon " << pMuonMin_ << "\t input labels " << labelBS_ << " " << labelVtx_ << " " << labelEB_ << " " << labelEE_ << " " << labelHBHE_ << " " << labelMuon_; @@ -114,8 +114,8 @@ AlCaHBHEMuonProducer::~AlCaHBHEMuonProducer() {} void AlCaHBHEMuonProducer::produce(edm::Event& iEvent, edm::EventSetup const& iSetup) { ++nAll_; bool valid(true); -#ifdef DebugLog - edm::LogInfo("HcalHBHEMuon") << "AlCaHBHEMuonProducer::Run " << iEvent.id().run() << " Event " << iEvent.id().event() +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalHBHEMuon") << "AlCaHBHEMuonProducer::Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); #endif @@ -162,8 +162,8 @@ void AlCaHBHEMuonProducer::produce(edm::Event& iEvent, edm::EventSetup const& iS valid = false; } -#ifdef DebugLog - edm::LogInfo("HcalHBHEMuon") << "AlCaHBHEMuonProducer::obtained the collections with validity flag " << valid; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalHBHEMuon") << "AlCaHBHEMuonProducer::obtained the collections with validity flag " << valid; #endif //For accepted events @@ -220,16 +220,16 @@ void AlCaHBHEMuonProducer::endStream() { } void AlCaHBHEMuonProducer::globalEndJob(const AlCaHBHEMuons::Counters* count) { - edm::LogInfo("HcalHBHEMuon") << "Finds " << count->nGood_ << " good tracks in " << count->nAll_ << " events"; + edm::LogVerbatim("HcalHBHEMuon") << "Finds " << count->nGood_ << " good tracks in " << count->nAll_ << " events"; } void AlCaHBHEMuonProducer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { - edm::LogInfo("HcalHBHEMuon") << "Run[" << nRun_ << "] " << iRun.run(); + edm::LogVerbatim("HcalHBHEMuon") << "Run[" << nRun_ << "] " << iRun.run(); } void AlCaHBHEMuonProducer::endRun(edm::Run const& iRun, edm::EventSetup const&) { ++nRun_; - edm::LogInfo("HcalHBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run(); + edm::LogVerbatim("HcalHBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run(); } bool AlCaHBHEMuonProducer::select(const reco::MuonCollection& muons) { diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc b/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc index 3705529357c77..a72d00ce73a3c 100644 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc @@ -1,6 +1,5 @@ - // -*- C++ -*- -//#define DebugLog +//#define EDM_ML_DEBUG // system include files #include <atomic> @@ -144,6 +143,8 @@ class AlCaIsoTracksProducer : public edm::stream::EDProducer<edm::GlobalCache<Al edm::EDGetTokenT<EcalRecHitCollection> tok_EB_; edm::EDGetTokenT<EcalRecHitCollection> tok_EE_; edm::EDGetTokenT<HBHERecHitCollection> tok_hbhe_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_magField_; }; AlCaIsoTracksProducer::AlCaIsoTracksProducer(edm::ParameterSet const& iConfig, const AlCaIsoTracks::Counters* counters) @@ -204,8 +205,11 @@ AlCaIsoTracksProducer::AlCaIsoTracksProducer(edm::ParameterSet const& iConfig, c tok_EB_ = consumes<EcalRecHitCollection>(labelEB_); tok_EE_ = consumes<EcalRecHitCollection>(labelEE_); tok_hbhe_ = consumes<HBHERecHitCollection>(labelHBHE_); + // for event setup + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>(); + tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>(); - edm::LogInfo("HcalIsoTrack") << "Parameters read from config file \n" + edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n" << "\t minPt " << selectionParameter_.minPt << "\t theTrackQuality " << theTrackQuality_ << "\t minQuality " << selectionParameter_.minQuality << "\t maxDxyPV " << selectionParameter_.maxDxyPV << "\t maxDzPV " << selectionParameter_.maxDzPV @@ -222,7 +226,7 @@ AlCaIsoTracksProducer::AlCaIsoTracksProducer(edm::ParameterSet const& iConfig, c << "\t Precale factor " << preScale_ << "\t in momentum range " << pTrackLow_ << ":" << pTrackHigh_; for (unsigned int k = 0; k < trigNames_.size(); ++k) - edm::LogInfo("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k]; + edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k]; //create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track produces<reco::HcalIsolatedTrackCandidateCollection>(labelIsoTk_); @@ -231,7 +235,7 @@ AlCaIsoTracksProducer::AlCaIsoTracksProducer(edm::ParameterSet const& iConfig, c produces<EcalRecHitCollection>(labelEE_.instance()); produces<HBHERecHitCollection>(labelHBHE_.label()); - edm::LogInfo("HcalIsoTrack") << " Expected to produce the collections:\n" + edm::LogVerbatim("HcalIsoTrack") << " Expected to produce the collections:\n" << "reco::HcalIsolatedTrackCandidateCollection " << " with label HcalIsolatedTrackCollection\n" << "reco::VertexCollection with label " << labelRecVtx_.label() << "\n" @@ -288,8 +292,8 @@ void AlCaIsoTracksProducer::fillDescriptions(edm::ConfigurationDescriptions& des void AlCaIsoTracksProducer::produce(edm::Event& iEvent, edm::EventSetup const& iSetup) { nAll_++; -#ifdef DebugLog - edm::LogInfo("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); #endif bool valid(true); @@ -332,8 +336,8 @@ void AlCaIsoTracksProducer::produce(edm::Event& iEvent, edm::EventSetup const& i leadPV = beamSpotH->position(); } } -#ifdef DebugLog - edm::LogInfo("HcalIsoTrack") << "Primary Vertex " << leadPV; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "Primary Vertex " << leadPV; #endif edm::Handle<EcalRecHitCollection> barrelRecHitsHandle; @@ -400,8 +404,8 @@ void AlCaIsoTracksProducer::produce(edm::Event& iEvent, edm::EventSetup const& i ptL1, etaL1, phiL1); -#ifdef DebugLog - edm::LogInfo("HcalIsoTrack") << "AlCaIsoTracksProducer::select returns " << isotk->size() << " isolated tracks"; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksProducer::select returns " << isotk->size() << " isolated tracks"; #endif if (!isotk->empty()) { @@ -460,25 +464,21 @@ void AlCaIsoTracksProducer::endStream() { } void AlCaIsoTracksProducer::globalEndJob(const AlCaIsoTracks::Counters* count) { - edm::LogInfo("HcalIsoTrack") << "Finds " << count->nGood_ << " good tracks in " << count->nAll_ << " events and " + edm::LogVerbatim("HcalIsoTrack") << "Finds " << count->nGood_ << " good tracks in " << count->nAll_ << " events and " << count->nRange_ << " events in the momentum raange"; } void AlCaIsoTracksProducer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); - edm::LogInfo("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " + edm::LogVerbatim("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << hltConfig_.init(iRun, iSetup, processName_, changed); - edm::ESHandle<MagneticField> bFieldH; - iSetup.get<IdealMagneticFieldRecord>().get(bFieldH); - bField = bFieldH.product(); - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - geo = pG.product(); + bField = &(iSetup.getData(tok_magField_)); + geo = &(iSetup.getData(tok_geom_)); } void AlCaIsoTracksProducer::endRun(edm::Run const& iRun, edm::EventSetup const&) { - edm::LogInfo("HcalIsoTrack") << "endRun [" << nRun_ << "] " << iRun.run(); + edm::LogVerbatim("HcalIsoTrack") << "endRun [" << nRun_ << "] " << iRun.run(); ++nRun_; } @@ -504,7 +504,7 @@ reco::HcalIsolatedTrackCandidateCollection* AlCaIsoTracksProducer::select( if (hlt > 0) { ok = true; } - edm::LogInfo("HcalIsoTrack") << "The trigger we are looking for " << triggerNames_[iHLT] << " Flag " << hlt + edm::LogVerbatim("HcalIsoTrack") << "The trigger we are looking for " << triggerNames_[iHLT] << " Flag " << hlt << ":" << ok; } } @@ -520,14 +520,14 @@ reco::HcalIsolatedTrackCandidateCollection* AlCaIsoTracksProducer::select( trkDetItr++, nTracks++) { const reco::Track* pTrack = &(*(trkDetItr->trkItr)); math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p()); -#ifdef DebugLog - edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" << pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p(); #endif //Selection of good track bool qltyFlag = spr::goodTrack(pTrack, leadPV, selectionParameter_, false); -#ifdef DebugLog - edm::LogInfo("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag << "|" << trkDetItr->okECAL << "|" +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag << "|" << trkDetItr->okECAL << "|" << trkDetItr->okHCAL; #endif if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) { @@ -548,8 +548,8 @@ reco::HcalIsolatedTrackCandidateCollection* AlCaIsoTracksProducer::select( double eIsolation = (maxRestrictionP_ * exp(slopeRestrictionP_ * ((double)(ieta)))); if (eIsolation < eIsolate_) eIsolation = eIsolate_; -#ifdef DebugLog - edm::LogInfo("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" << pTrack->eta() << "|" << pTrack->phi() << "|" << t_p << " e_MIP " << eMipDR << " Chg Isolation " << hmaxNearP << ":" << eIsolation; #endif diff --git a/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.cc b/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.cc index f4633d6078e2d..fadac8bf6beb7 100644 --- a/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.cc +++ b/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.cc @@ -50,6 +50,8 @@ namespace cms { tok_hbheProd_ = consumes<HBHERecHitCollection>(edm::InputTag(nameProd_, hbheInput_)); tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag(hbheInput_)); + + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>(); } ProducerAnalyzer::~ProducerAnalyzer() { @@ -69,9 +71,7 @@ namespace cms { void ProducerAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace edm; - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); + const CaloGeometry* geo = &(iSetup.getData(tok_geom_)); std::vector<StableProvenance const*> theProvenance; iEvent.getAllStableProvenance(theProvenance); diff --git a/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h b/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h index 8104a44d0c372..3f404ce48c0f0 100644 --- a/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h +++ b/Calibration/HcalAlCaRecoProducers/src/ProducerAnalyzer.h @@ -26,6 +26,9 @@ #include "DataFormats/TrackReco/interface/TrackFwd.h" #include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" + namespace edm { class ParameterSet; class Event; @@ -73,6 +76,8 @@ namespace cms { edm::EDGetTokenT<HBHERecHitCollection> tok_hbhe_; edm::EDGetTokenT<HBHERecHitCollection> tok_hbheProd_; + + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; }; } // end namespace cms #endif From ad22b28a761ebc1994566e068cb5cdfe5d423542 Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Mon, 19 Oct 2020 12:22:31 +0200 Subject: [PATCH 682/778] ESGetToken for some more EgammaElectronProducers --- .../interface/ElectronSeedGenerator.h | 14 ++-- .../interface/PixelHitMatcher.h | 2 +- .../src/ElectronSeedGenerator.cc | 30 ++------ .../src/PixelHitMatcher.cc | 8 +- .../plugins/ElectronNHitSeedProducer.cc | 10 +-- .../plugins/ElectronSeedProducer.cc | 8 +- .../plugins/GEDGsfElectronCoreProducer.cc | 2 +- .../plugins/GEDGsfElectronValueMapProducer.cc | 2 +- .../GsfElectronCoreEcalDrivenProducer.cc | 2 +- .../plugins/GsfElectronProducer.cc | 28 +++---- .../plugins/LowPtGSFToTrackLinker.cc | 2 +- .../plugins/LowPtGsfElectronCoreProducer.cc | 2 +- .../plugins/LowPtGsfElectronIDProducer.cc | 2 +- .../plugins/LowPtGsfElectronSCProducer.cc | 2 +- .../plugins/LowPtGsfElectronSeedProducer.cc | 74 ++++++++----------- .../LowPtGsfElectronSeedValueMapsProducer.cc | 2 +- ...rackingRegionsFromSuperClustersProducer.cc | 12 +-- .../python/lowPtGsfElectronSeeds_cfi.py | 6 +- .../src/EgammaHadTower.cc | 6 +- .../HGCalRecAlgos/interface/ClusterTools.h | 4 + .../HGCalRecAlgos/src/ClusterTools.cc | 21 ++---- 21 files changed, 103 insertions(+), 136 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h b/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h index 7b624bb83c7ed..e5cc3b315b5dc 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h @@ -31,6 +31,7 @@ #include "DataFormats/VertexReco/interface/VertexFwd.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -38,6 +39,9 @@ #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" + class ElectronSeedGenerator { public: struct Tokens { @@ -50,11 +54,10 @@ class ElectronSeedGenerator { typedef TransientTrackingRecHit::RecHitPointer RecHitPointer; typedef TransientTrackingRecHit::RecHitContainer RecHitContainer; - ElectronSeedGenerator(const edm::ParameterSet&, const Tokens&); + ElectronSeedGenerator(const edm::ParameterSet&, const Tokens&, edm::ConsumesCollector&&); void setupES(const edm::EventSetup& setup); void run(edm::Event&, - const edm::EventSetup& setup, const reco::SuperClusterRefVector&, const std::vector<const TrajectorySeedCollection*>& seedsV, reco::ElectronSeedCollection&); @@ -66,8 +69,11 @@ class ElectronSeedGenerator { reco::ElectronSeedCollection& out); const bool dynamicPhiRoad_; + const edm::EDGetTokenT<std::vector<reco::Vertex> > verticesTag_; const edm::EDGetTokenT<reco::BeamSpot> beamSpotTag_; + const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_; + const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeometryToken_; const float lowPtThresh_; const float highPtThresh_; @@ -84,10 +90,6 @@ class ElectronSeedGenerator { const std::vector<const TrajectorySeedCollection*>* initialSeedCollectionVector_ = nullptr; - edm::ESHandle<MagneticField> magField_; - edm::ESHandle<TrackerGeometry> trackerGeometry_; - std::unique_ptr<PropagatorWithMaterial> propagator_; - // keep cacheIds to get records only when necessary unsigned long long cacheIDMagField_ = 0; unsigned long long cacheIDCkfComp_ = 0; diff --git a/RecoEgamma/EgammaElectronAlgos/interface/PixelHitMatcher.h b/RecoEgamma/EgammaElectronAlgos/interface/PixelHitMatcher.h index 3a7d849550eb8..669e45ae7e433 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/PixelHitMatcher.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/PixelHitMatcher.h @@ -54,7 +54,7 @@ class PixelHitMatcher { float rMaxI, bool useRecoVertex); - void setES(const MagneticField*, const TrackerGeometry* trackerGeometry); + void setES(MagneticField const&, TrackerGeometry const& trackerGeometry); std::vector<SeedWithInfo> operator()(const std::vector<const TrajectorySeedCollection*>& seedsV, const GlobalPoint& xmeas, diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc index fef5fba61634b..57e629923b7fc 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc @@ -20,8 +20,6 @@ #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" #include "RecoTracker/Record/interface/CkfComponentsRecord.h" #include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" #include "TrackingTools/Records/interface/TrackingComponentsRecord.h" #include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h" @@ -127,10 +125,14 @@ namespace { } // namespace -ElectronSeedGenerator::ElectronSeedGenerator(const edm::ParameterSet &pset, const ElectronSeedGenerator::Tokens &ts) +ElectronSeedGenerator::ElectronSeedGenerator(const edm::ParameterSet &pset, + const ElectronSeedGenerator::Tokens &ts, + edm::ConsumesCollector &&cc) : dynamicPhiRoad_(pset.getParameter<bool>("dynamicPhiRoad")), verticesTag_(ts.token_vtx), beamSpotTag_(ts.token_bs), + magFieldToken_{cc.esConsumes()}, + trackerGeometryToken_{cc.esConsumes()}, lowPtThresh_(pset.getParameter<double>("LowPtThreshold")), highPtThresh_(pset.getParameter<double>("HighPtThreshold")), nSigmasDeltaZ1_(pset.getParameter<double>("nSigmasDeltaZ1")), @@ -141,7 +143,6 @@ ElectronSeedGenerator::ElectronSeedGenerator(const edm::ParameterSet &pset, cons // so that deltaPhi1 = dPhi1Coef1_ + dPhi1Coef2_/clusterEnergyT dPhi1Coef2_(dynamicPhiRoad_ ? (deltaPhi1Low_ - deltaPhi1High_) / (1. / lowPtThresh_ - 1. / highPtThresh_) : 0.), dPhi1Coef1_(dynamicPhiRoad_ ? deltaPhi1Low_ - dPhi1Coef2_ / lowPtThresh_ : 0.), - propagator_(nullptr), // use of reco vertex useRecoVertex_(pset.getParameter<bool>("useRecoVertex")), // new B/F configurables @@ -163,29 +164,10 @@ ElectronSeedGenerator::ElectronSeedGenerator(const edm::ParameterSet &pset, cons useRecoVertex_) {} void ElectronSeedGenerator::setupES(const edm::EventSetup &setup) { - // get records if necessary (called once per event) - bool tochange = false; - - if (cacheIDMagField_ != setup.get<IdealMagneticFieldRecord>().cacheIdentifier()) { - setup.get<IdealMagneticFieldRecord>().get(magField_); - cacheIDMagField_ = setup.get<IdealMagneticFieldRecord>().cacheIdentifier(); - propagator_ = std::make_unique<PropagatorWithMaterial>(alongMomentum, .000511, &(*magField_)); - tochange = true; - } - - if (cacheIDTrkGeom_ != setup.get<TrackerDigiGeometryRecord>().cacheIdentifier()) { - cacheIDTrkGeom_ = setup.get<TrackerDigiGeometryRecord>().cacheIdentifier(); - setup.get<TrackerDigiGeometryRecord>().get(trackerGeometry_); - tochange = true; //FIXME - } - - if (tochange) { - matcher_.setES(magField_.product(), trackerGeometry_.product()); - } + matcher_.setES(setup.getData(magFieldToken_), setup.getData(trackerGeometryToken_)); } void ElectronSeedGenerator::run(edm::Event &e, - const edm::EventSetup &setup, const reco::SuperClusterRefVector &sclRefs, const std::vector<const TrajectorySeedCollection *> &seedsV, reco::ElectronSeedCollection &out) { diff --git a/RecoEgamma/EgammaElectronAlgos/src/PixelHitMatcher.cc b/RecoEgamma/EgammaElectronAlgos/src/PixelHitMatcher.cc index 011f0acd54699..e4f3691bd014f 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/PixelHitMatcher.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/PixelHitMatcher.cc @@ -98,10 +98,10 @@ void PixelHitMatcher::set2ndLayer(float dummyphi2minB, float dummyphi2maxB, floa meas2ndFLayer.thePhiMax = dummyphi2maxF; } -void PixelHitMatcher::setES(const MagneticField *magField, const TrackerGeometry *trackerGeometry) { - theMagField = magField; - theTrackerGeometry = trackerGeometry; - float mass = .000511; // electron propagation +void PixelHitMatcher::setES(MagneticField const &magField, TrackerGeometry const &trackerGeometry) { + theMagField = &magField; + theTrackerGeometry = &trackerGeometry; + constexpr float mass = .000511; // electron propagation prop1stLayer = std::make_unique<PropagatorWithMaterial>(oppositeToMomentum, mass, theMagField); prop2ndLayer = std::make_unique<PropagatorWithMaterial>(alongMomentum, mass, theMagField); } diff --git a/RecoEgamma/EgammaElectronProducers/plugins/ElectronNHitSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/ElectronNHitSeedProducer.cc index dc2e17270188b..8f265c9d8aebc 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/ElectronNHitSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/ElectronNHitSeedProducer.cc @@ -80,14 +80,14 @@ namespace { ElectronNHitSeedProducer::ElectronNHitSeedProducer(const edm::ParameterSet& pset) : matcherConfiguration_(pset.getParameter<edm::ParameterSet>("matcherConfig"), consumesCollector()), - initialSeedsToken_(consumes<TrajectorySeedCollection>(pset.getParameter<edm::InputTag>("initialSeeds"))), - verticesToken_(consumes<std::vector<reco::Vertex>>(pset.getParameter<edm::InputTag>("vertices"))), - beamSpotToken_(consumes<reco::BeamSpot>(pset.getParameter<edm::InputTag>("beamSpot"))), - measTkEvtToken_(consumes<MeasurementTrackerEvent>(pset.getParameter<edm::InputTag>("measTkEvt"))), + initialSeedsToken_(consumes(pset.getParameter<edm::InputTag>("initialSeeds"))), + verticesToken_(consumes(pset.getParameter<edm::InputTag>("vertices"))), + beamSpotToken_(consumes(pset.getParameter<edm::InputTag>("beamSpot"))), + measTkEvtToken_(consumes(pset.getParameter<edm::InputTag>("measTkEvt"))), putToken_{produces<reco::ElectronSeedCollection>()}, trackerTopologyToken_{esConsumes()} { for (const auto& scTag : pset.getParameter<std::vector<edm::InputTag>>("superClusters")) { - superClustersTokens_.emplace_back(consumes<std::vector<reco::SuperClusterRef>>(scTag)); + superClustersTokens_.emplace_back(consumes(scTag)); } } diff --git a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc index 045c74eb6dc74..db9e0085c548f 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc @@ -100,10 +100,10 @@ ElectronSeedProducer::ElectronSeedProducer(const edm::ParameterSet& conf) esg_tokens.token_bs = beamSpotTag_; esg_tokens.token_vtx = mayConsume<reco::VertexCollection>(conf.getParameter<edm::InputTag>("vertices")); - matcher_ = std::make_unique<ElectronSeedGenerator>(conf, esg_tokens); + matcher_ = std::make_unique<ElectronSeedGenerator>(conf, esg_tokens, consumesCollector()); - superClusters_[0] = consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("barrelSuperClusters")); - superClusters_[1] = consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("endcapSuperClusters")); + superClusters_[0] = consumes(conf.getParameter<edm::InputTag>("barrelSuperClusters")); + superClusters_[1] = consumes(conf.getParameter<edm::InputTag>("endcapSuperClusters")); //register your products produces<ElectronSeedCollection>(); @@ -137,7 +137,7 @@ void ElectronSeedProducer::produce(edm::Event& e, const edm::EventSetup& iSetup) // loop over barrel + endcap for (unsigned int i = 0; i < 2; i++) { auto clusterRefs = filterClusters(beamSportPosition, e.getHandle(superClusters_[i])); - matcher_->run(e, iSetup, clusterRefs, initialSeedCollections, *seeds); + matcher_->run(e, clusterRefs, initialSeedCollections, *seeds); } // store the accumulated result diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronCoreProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronCoreProducer.cc index ce5059015f474..9833cd8c2a910 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronCoreProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronCoreProducer.cc @@ -43,7 +43,7 @@ GEDGsfElectronCoreProducer::GEDGsfElectronCoreProducer(const edm::ParameterSet & gedEMUnbiasedToken_(consumes<reco::PFCandidateCollection>(config.getParameter<edm::InputTag>("GEDEMUnbiased"))), putToken_(produces<reco::GsfElectronCoreCollection>()) {} -void GEDGsfElectronCoreProducer::produce(edm::StreamID iStream, edm::Event &event, const edm::EventSetup &setup) const { +void GEDGsfElectronCoreProducer::produce(edm::StreamID iStream, edm::Event &event, const edm::EventSetup &) const { auto ctfTracksHandle = event.getHandle(ctfTracksToken_); auto ctfTrackVariables = makeLazy<edm::soa::EtaPhiTable>(*ctfTracksHandle); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronValueMapProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronValueMapProducer.cc index 6b3ee9f9aded7..8aa0ad27c5cd7 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronValueMapProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronValueMapProducer.cc @@ -24,7 +24,7 @@ GEDGsfElectronValueMapProducer::GEDGsfElectronValueMapProducer(const edm::Parame pfCandsToken_(consumes<reco::PFCandidateCollection>(cfg.getParameter<edm::InputTag>("egmPFCandidatesTag"))), putToken_{produces<edm::ValueMap<reco::GsfElectronRef>>()} {} -void GEDGsfElectronValueMapProducer::produce(edm::StreamID, edm::Event& event, const edm::EventSetup& setup) const { +void GEDGsfElectronValueMapProducer::produce(edm::StreamID, edm::Event& event, const edm::EventSetup&) const { auto electrons = event.getHandle(electronsToken_); auto pfCandidatesHandle = event.getHandle(pfCandsToken_); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc index 5fdad7bcd3894..5db44a1eae35d 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc @@ -50,7 +50,7 @@ GsfElectronCoreEcalDrivenProducer::GsfElectronCoreEcalDrivenProducer(const edm:: ctfTracksToken_(consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("ctfTracks"))), putToken_(produces<reco::GsfElectronCoreCollection>()) {} -void GsfElectronCoreEcalDrivenProducer::produce(edm::StreamID, edm::Event& event, const edm::EventSetup& setup) const { +void GsfElectronCoreEcalDrivenProducer::produce(edm::StreamID, edm::Event& event, const edm::EventSetup&) const { auto gsfTracksHandle = event.getHandle(gsfTracksToken_); auto ctfTracksHandle = event.getHandle(ctfTracksToken_); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronProducer.cc index 853bb84cb2d47..6658d8f110189 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronProducer.cc @@ -281,28 +281,24 @@ GsfElectronProducer::GsfElectronProducer(const edm::ParameterSet& cfg, const Gsf : cutsCfg_{makeCutsConfiguration(cfg.getParameter<edm::ParameterSet>("preselection"))}, ecalSeedingParametersChecked_(false), electronPutToken_(produces<GsfElectronCollection>()), - gsfPfRecTracksTag_(consumes<reco::GsfPFRecTrackCollection>(cfg.getParameter<edm::InputTag>("gsfPfRecTracksTag"))), + gsfPfRecTracksTag_(consumes(cfg.getParameter<edm::InputTag>("gsfPfRecTracksTag"))), useGsfPfRecTracks_(cfg.getParameter<bool>("useGsfPfRecTracks")), resetMvaValuesUsingPFCandidates_(cfg.getParameter<bool>("resetMvaValuesUsingPFCandidates")) { if (resetMvaValuesUsingPFCandidates_) { - egmPFCandidateCollection_ = - consumes<reco::PFCandidateCollection>(cfg.getParameter<edm::InputTag>("egmPFCandidatesTag")); + egmPFCandidateCollection_ = consumes(cfg.getParameter<edm::InputTag>("egmPFCandidatesTag")); } - inputCfg_.gsfElectronCores = - consumes<reco::GsfElectronCoreCollection>(cfg.getParameter<edm::InputTag>("gsfElectronCoresTag")); - inputCfg_.hcalTowersTag = consumes<CaloTowerCollection>(cfg.getParameter<edm::InputTag>("hcalTowers")); - inputCfg_.barrelRecHitCollection = - consumes<EcalRecHitCollection>(cfg.getParameter<edm::InputTag>("barrelRecHitCollectionTag")); - inputCfg_.endcapRecHitCollection = - consumes<EcalRecHitCollection>(cfg.getParameter<edm::InputTag>("endcapRecHitCollectionTag")); - inputCfg_.ctfTracks = consumes<reco::TrackCollection>(cfg.getParameter<edm::InputTag>("ctfTracksTag")); + inputCfg_.gsfElectronCores = consumes(cfg.getParameter<edm::InputTag>("gsfElectronCoresTag")); + inputCfg_.hcalTowersTag = consumes(cfg.getParameter<edm::InputTag>("hcalTowers")); + inputCfg_.barrelRecHitCollection = consumes(cfg.getParameter<edm::InputTag>("barrelRecHitCollectionTag")); + inputCfg_.endcapRecHitCollection = consumes(cfg.getParameter<edm::InputTag>("endcapRecHitCollectionTag")); + inputCfg_.ctfTracks = consumes(cfg.getParameter<edm::InputTag>("ctfTracksTag")); // used to check config consistency with seeding - inputCfg_.seedsTag = consumes<reco::ElectronSeedCollection>(cfg.getParameter<edm::InputTag>("seedsTag")); - inputCfg_.beamSpotTag = consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpotTag")); - inputCfg_.vtxCollectionTag = consumes<reco::VertexCollection>(cfg.getParameter<edm::InputTag>("vtxTag")); + inputCfg_.seedsTag = consumes(cfg.getParameter<edm::InputTag>("seedsTag")); + inputCfg_.beamSpotTag = consumes(cfg.getParameter<edm::InputTag>("beamSpotTag")); + inputCfg_.vtxCollectionTag = consumes(cfg.getParameter<edm::InputTag>("vtxTag")); if (cfg.getParameter<bool>("fillConvVtxFitProb")) - inputCfg_.conversions = consumes<reco::ConversionCollection>(cfg.getParameter<edm::InputTag>("conversionsTag")); + inputCfg_.conversions = consumes(cfg.getParameter<edm::InputTag>("conversionsTag")); strategyCfg_.useDefaultEnergyCorrection = cfg.getParameter<bool>("useDefaultEnergyCorrection"); @@ -330,7 +326,7 @@ GsfElectronProducer::GsfElectronProducer(const edm::ParameterSet& cfg, const Gsf if (hcalCfg_.hOverEConeSize > 0) { hcalCfg_.useTowers = true; hcalCfg_.checkHcalStatus = cfg.getParameter<bool>("checkHcalStatus"); - hcalCfg_.hcalTowers = consumes<CaloTowerCollection>(cfg.getParameter<edm::InputTag>("hcalTowers")); + hcalCfg_.hcalTowers = consumes(cfg.getParameter<edm::InputTag>("hcalTowers")); hcalCfg_.hOverEPtMin = psetPreselection.getParameter<double>("hOverEPtMin"); } diff --git a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGSFToTrackLinker.cc b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGSFToTrackLinker.cc index cdb7f0f23463f..c44506605c68d 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGSFToTrackLinker.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGSFToTrackLinker.cc @@ -40,7 +40,7 @@ LowPtGSFToTrackLinker::LowPtGSFToTrackLinker(const edm::ParameterSet& iConfig) produces<edm::Association<reco::TrackCollection> >(); } -void LowPtGSFToTrackLinker::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { +void LowPtGSFToTrackLinker::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { auto gsftracks = iEvent.getHandle(gsftracks_); auto tracks = iEvent.getHandle(tracks_); auto preid = iEvent.getHandle(preid_); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronCoreProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronCoreProducer.cc index 41c89d972cf22..221f0b47004e6 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronCoreProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronCoreProducer.cc @@ -36,7 +36,7 @@ LowPtGsfElectronCoreProducer::LowPtGsfElectronCoreProducer(const edm::ParameterS superClusterRefs_(consumes<edm::ValueMap<SuperClusterRef> >(config.getParameter<edm::InputTag>("superClusters"))), putToken_(produces<reco::GsfElectronCoreCollection>()) {} -void LowPtGsfElectronCoreProducer::produce(edm::StreamID, edm::Event& event, const edm::EventSetup& setup) const { +void LowPtGsfElectronCoreProducer::produce(edm::StreamID, edm::Event& event, const edm::EventSetup&) const { // Output collection reco::GsfElectronCoreCollection electrons; diff --git a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronIDProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronIDProducer.cc index ca46d4f4100d5..8eba1d052f8d0 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronIDProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronIDProducer.cc @@ -73,7 +73,7 @@ LowPtGsfElectronIDProducer::LowPtGsfElectronIDProducer(const edm::ParameterSet& //////////////////////////////////////////////////////////////////////////////// // -void LowPtGsfElectronIDProducer::produce(edm::StreamID, edm::Event& event, const edm::EventSetup& setup) const { +void LowPtGsfElectronIDProducer::produce(edm::StreamID, edm::Event& event, const edm::EventSetup&) const { // Pileup edm::Handle<double> rho; event.getByToken(rho_, rho); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSCProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSCProducer.cc index 492ce724052f2..b634ab962865a 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSCProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSCProducer.cc @@ -55,7 +55,7 @@ LowPtGsfElectronSCProducer::LowPtGsfElectronSCProducer(const edm::ParameterSet& //////////////////////////////////////////////////////////////////////////////// // -void LowPtGsfElectronSCProducer::produce(edm::Event& event, const edm::EventSetup& setup) { +void LowPtGsfElectronSCProducer::produce(edm::Event& event, const edm::EventSetup&) { // Input GsfPFRecTracks collection auto gsfPfRecTracks = edm::makeValid(event.getHandle(gsfPfRecTracks_)); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedProducer.cc index 39fd486a3d74e..93136a5c4f8de 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedProducer.cc @@ -54,8 +54,6 @@ #include "LowPtGsfElectronSeedHeavyObjectCache.h" -#include "TMath.h" - class LowPtGsfElectronSeedProducer final : public edm::stream::EDProducer<edm::GlobalCache<lowptgsfeleseed::HeavyObjectCache> > { public: @@ -136,7 +134,7 @@ class LowPtGsfElectronSeedProducer final noZS::EcalClusterLazyTools& ecalTools); // Perform lightweight GSF tracking - bool lightGsfTracking(reco::PreId&, const reco::TrackRef&, const reco::ElectronSeed&, const edm::EventSetup&); + bool lightGsfTracking(reco::PreId&, const reco::TrackRef&, const reco::ElectronSeed&); private: // member data edm::ESHandle<MagneticField> field_; @@ -150,9 +148,11 @@ class LowPtGsfElectronSeedProducer final const edm::EDGetTokenT<EcalRecHitCollection> eeRecHits_; const edm::EDGetTokenT<double> rho_; const edm::EDGetTokenT<reco::BeamSpot> beamSpot_; - const std::string fitter_; - const std::string smoother_; - const std::string builder_; + + const edm::ESGetToken<TrajectoryFitter, TrajectoryFitter::Record> trajectoryFitterToken_; + const edm::ESGetToken<TrajectorySmoother, TrajectoryFitter::Record> trajectorySmootherToken_; + const edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> builderToken_; + const bool passThrough_; const bool usePfTracks_; const double minPtThreshold_; @@ -173,24 +173,24 @@ LowPtGsfElectronSeedProducer::LowPtGsfElectronSeedProducer(const edm::ParameterS smootherPtr_(), kfTracks_(), pfTracks_(), - ecalClusters_{consumes<reco::PFClusterCollection>(conf.getParameter<edm::InputTag>("ecalClusters"))}, + ecalClusters_{consumes(conf.getParameter<edm::InputTag>("ecalClusters"))}, hcalClusters_(), - ebRecHits_{consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EBRecHits"))}, - eeRecHits_{consumes<EcalRecHitCollection>(conf.getParameter<edm::InputTag>("EERecHits"))}, - rho_(consumes<double>(conf.getParameter<edm::InputTag>("rho"))), - beamSpot_(consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("BeamSpot"))), - fitter_(conf.getParameter<std::string>("Fitter")), - smoother_(conf.getParameter<std::string>("Smoother")), - builder_(conf.getParameter<std::string>("TTRHBuilder")), + ebRecHits_{consumes(conf.getParameter<edm::InputTag>("EBRecHits"))}, + eeRecHits_{consumes(conf.getParameter<edm::InputTag>("EERecHits"))}, + rho_(consumes(conf.getParameter<edm::InputTag>("rho"))), + beamSpot_(consumes(conf.getParameter<edm::InputTag>("BeamSpot"))), + trajectoryFitterToken_{esConsumes(conf.getParameter<edm::ESInputTag>("Fitter"))}, + trajectorySmootherToken_{esConsumes(conf.getParameter<edm::ESInputTag>("Smoother"))}, + builderToken_{esConsumes(conf.getParameter<edm::ESInputTag>("TTRHBuilder"))}, passThrough_(conf.getParameter<bool>("PassThrough")), usePfTracks_(conf.getParameter<bool>("UsePfTracks")), minPtThreshold_(conf.getParameter<double>("MinPtThreshold")), maxPtThreshold_(conf.getParameter<double>("MaxPtThreshold")) { if (usePfTracks_) { - pfTracks_ = consumes<reco::PFRecTrackCollection>(conf.getParameter<edm::InputTag>("pfTracks")); - hcalClusters_ = consumes<reco::PFClusterCollection>(conf.getParameter<edm::InputTag>("hcalClusters")); + pfTracks_ = consumes(conf.getParameter<edm::InputTag>("pfTracks")); + hcalClusters_ = consumes(conf.getParameter<edm::InputTag>("hcalClusters")); } - kfTracks_ = consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("tracks")); + kfTracks_ = consumes(conf.getParameter<edm::InputTag>("tracks")); produces<reco::ElectronSeedCollection>(); produces<reco::PreIdCollection>(); @@ -293,33 +293,24 @@ void LowPtGsfElectronSeedProducer::loop(const edm::Handle<std::vector<T> >& hand edm::Event& event, const edm::EventSetup& setup) { // Pileup - edm::Handle<double> rho; - event.getByToken(rho_, rho); + auto const& rho = event.get(rho_); // Beam spot - edm::Handle<reco::BeamSpot> spot; - event.getByToken(beamSpot_, spot); + auto const& spot = event.get(beamSpot_); // Track fitter - edm::ESHandle<TrajectoryFitter> fitter; - setup.get<TrajectoryFitter::Record>().get(fitter_, fitter); - fitterPtr_ = fitter->clone(); + fitterPtr_ = setup.getData(trajectoryFitterToken_).clone(); // Track smoother - edm::ESHandle<TrajectorySmoother> smoother; - setup.get<TrajectoryFitter::Record>().get(smoother_, smoother); - smootherPtr_.reset(smoother->clone()); + smootherPtr_.reset(setup.getData(trajectorySmootherToken_).clone()); // RecHit cloner - edm::ESHandle<TransientTrackingRecHitBuilder> builder; - setup.get<TransientRecHitRecord>().get(builder_, builder); - TkClonerImpl hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(builder.product())->cloner(); + TkClonerImpl hitCloner = static_cast<TkTransientTrackingRecHitBuilder const&>(setup.getData(builderToken_)).cloner(); fitterPtr_->setHitCloner(&hitCloner); smootherPtr_->setHitCloner(&hitCloner); // ECAL clusters - edm::Handle<reco::PFClusterCollection> ecalClusters; - event.getByToken(ecalClusters_, ecalClusters); + auto ecalClusters = event.getHandle(ecalClusters_); // Utility to access to shower shape vars noZS::EcalClusterLazyTools ecalTools(event, setup, ebRecHits_, eeRecHits_); @@ -363,10 +354,10 @@ void LowPtGsfElectronSeedProducer::loop(const edm::Handle<std::vector<T> >& hand templatedRef, ecalClusters, hcalClusters, matchedEcalClusters, matchedHcalClusters, ecalPreId, hcalPreId); // Add variables related to GSF tracks to PreId - lightGsfTracking(ecalPreId, trackRef, seed, setup); + lightGsfTracking(ecalPreId, trackRef, seed); // Decision based on BDT - bool result = decision(templatedRef, ecalPreId, hcalPreId, *rho, *spot, ecalTools); + bool result = decision(templatedRef, ecalPreId, hcalPreId, rho, spot, ecalTools); // If fails BDT, do not store seed if (!result) { @@ -563,8 +554,7 @@ void LowPtGsfElectronSeedProducer::propagateTrackToCalo( // Original implementation for "lightweight" GSF tracking bool LowPtGsfElectronSeedProducer::lightGsfTracking(reco::PreId& preId, const reco::TrackRef& trackRef, - const reco::ElectronSeed& seed, - const edm::EventSetup& setup) { + const reco::ElectronSeed& seed) { Trajectory::ConstRecHitContainer hits; for (unsigned int ihit = 0; ihit < trackRef->recHitsSize(); ++ihit) { hits.push_back(trackRef->recHit(ihit)->cloneSH()); @@ -658,12 +648,12 @@ void LowPtGsfElectronSeedProducer::fillDescriptions(edm::ConfigurationDescriptio desc.add<edm::InputTag>("EERecHits", edm::InputTag("ecalRecHit", "EcalRecHitsEE")); desc.add<edm::InputTag>("rho", edm::InputTag("fixedGridRhoFastjetAllTmp")); desc.add<edm::InputTag>("BeamSpot", edm::InputTag("offlineBeamSpot")); - desc.add<std::string>("Fitter", "GsfTrajectoryFitter_forPreId"); - desc.add<std::string>("Smoother", "GsfTrajectorySmoother_forPreId"); - desc.add<std::string>("TTRHBuilder", "WithAngleAndTemplate"); - desc.add<std::vector<std::string> >("ModelNames", std::vector<std::string>()); - desc.add<std::vector<std::string> >("ModelWeights", std::vector<std::string>()); - desc.add<std::vector<double> >("ModelThresholds", std::vector<double>()); + desc.add<edm::ESInputTag>("Fitter", edm::ESInputTag{"", "GsfTrajectoryFitter_forPreId"}); + desc.add<edm::ESInputTag>("Smoother", edm::ESInputTag{"", "GsfTrajectorySmoother_forPreId"}); + desc.add<edm::ESInputTag>("TTRHBuilder", edm::ESInputTag{"", "WithAngleAndTemplate"}); + desc.add<std::vector<std::string> >("ModelNames", {}); + desc.add<std::vector<std::string> >("ModelWeights", {}); + desc.add<std::vector<double> >("ModelThresholds", {}); desc.add<bool>("PassThrough", false); desc.add<bool>("UsePfTracks", true); desc.add<double>("MinPtThreshold", 1.0); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedValueMapsProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedValueMapsProducer.cc index 1ac89df87d484..94340b6592a48 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedValueMapsProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/LowPtGsfElectronSeedValueMapsProducer.cc @@ -45,7 +45,7 @@ LowPtGsfElectronSeedValueMapsProducer::LowPtGsfElectronSeedValueMapsProducer(con //////////////////////////////////////////////////////////////////////////////// // -void LowPtGsfElectronSeedValueMapsProducer::produce(edm::Event& event, const edm::EventSetup& setup) { +void LowPtGsfElectronSeedValueMapsProducer::produce(edm::Event& event, const edm::EventSetup&) { // Retrieve GsfTracks from Event edm::Handle<reco::GsfTrackCollection> gsfTracks; event.getByToken(gsfTracks_, gsfTracks); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/TrackingRegionsFromSuperClustersProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/TrackingRegionsFromSuperClustersProducer.cc index 0c3a18678cd9c..3a70d6dba0a40 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/TrackingRegionsFromSuperClustersProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/TrackingRegionsFromSuperClustersProducer.cc @@ -132,6 +132,8 @@ class TrackingRegionsFromSuperClustersProducer : public TrackingRegionProducer { edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_; edm::EDGetTokenT<MeasurementTrackerEvent> measTrackerEventToken_; std::vector<edm::EDGetTokenT<std::vector<reco::SuperClusterRef>>> superClustersTokens_; + + const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_; }; namespace { @@ -144,7 +146,8 @@ namespace { } // namespace TrackingRegionsFromSuperClustersProducer::TrackingRegionsFromSuperClustersProducer(const edm::ParameterSet& cfg, - edm::ConsumesCollector&& iC) { + edm::ConsumesCollector&& iC) + : magFieldToken_{iC.esConsumes()} { edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet"); ptMin_ = regionPSet.getParameter<double>("ptMin"); @@ -227,17 +230,16 @@ std::vector<std::unique_ptr<TrackingRegion>> TrackingRegionsFromSuperClustersPro if (!measTrackerEventToken_.isUninitialized()) { measTrackerEvent = getHandle(iEvent, measTrackerEventToken_).product(); } - edm::ESHandle<MagneticField> magFieldHandle; - iSetup.get<IdealMagneticFieldRecord>().get(magFieldHandle); + auto const& magField = iSetup.getData(magFieldToken_); for (auto& superClustersToken : superClustersTokens_) { auto superClustersHandle = getHandle(iEvent, superClustersToken); for (auto& superClusterRef : *superClustersHandle) { //do both charge hypothesises trackingRegions.emplace_back( - createTrackingRegion(*superClusterRef, vtxPos, deltaZVertex, Charge::POS, measTrackerEvent, *magFieldHandle)); + createTrackingRegion(*superClusterRef, vtxPos, deltaZVertex, Charge::POS, measTrackerEvent, magField)); trackingRegions.emplace_back( - createTrackingRegion(*superClusterRef, vtxPos, deltaZVertex, Charge::NEG, measTrackerEvent, *magFieldHandle)); + createTrackingRegion(*superClusterRef, vtxPos, deltaZVertex, Charge::NEG, measTrackerEvent, magField)); } } return trackingRegions; diff --git a/RecoEgamma/EgammaElectronProducers/python/lowPtGsfElectronSeeds_cfi.py b/RecoEgamma/EgammaElectronProducers/python/lowPtGsfElectronSeeds_cfi.py index cd5d930f71833..95f6a87da6091 100644 --- a/RecoEgamma/EgammaElectronProducers/python/lowPtGsfElectronSeeds_cfi.py +++ b/RecoEgamma/EgammaElectronProducers/python/lowPtGsfElectronSeeds_cfi.py @@ -14,9 +14,9 @@ def thresholds( wp ) : EERecHits = cms.InputTag("ecalRecHit","EcalRecHitsEE"), rho = cms.InputTag('fixedGridRhoFastjetAllTmp'), BeamSpot = cms.InputTag("offlineBeamSpot"), - Fitter = cms.string('GsfTrajectoryFitter_forPreId'), - Smoother = cms.string('GsfTrajectorySmoother_forPreId'), - TTRHBuilder = cms.string('WithAngleAndTemplate'), + Fitter = cms.ESInputTag("", 'GsfTrajectoryFitter_forPreId'), + Smoother = cms.ESInputTag("", 'GsfTrajectorySmoother_forPreId'), + TTRHBuilder = cms.ESInputTag("", 'WithAngleAndTemplate'), ModelNames = cms.vstring([ 'unbiased', 'ptbiased', diff --git a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc index 7316b99b12bf2..75b6021478aa7 100644 --- a/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc +++ b/RecoEgamma/EgammaIsolationAlgos/src/EgammaHadTower.cc @@ -111,9 +111,9 @@ bool egamma::hasActiveHcal(const std::vector<CaloTowerDetId>& towers, if (hid.subdet() != HcalBarrel && hid.subdet() != HcalEndcap) continue; #ifdef EDM_ML_DEBUG - std::cout << "egamma DetId " << std::hex << id.rawId() << " hid.rawId " << hid.rawId() << std::dec << " sub " - << hid.subdet() << " ieta " << hid.ieta() << " iphi " << hid.iphi() << " depth " << hid.depth() - << std::endl; + std::cout << "EgammaHadTower DetId " << std::hex << id.rawId() << " hid.rawId " << hid.rawId() << std::dec + << " sub " << hid.subdet() << " ieta " << hid.ieta() << " iphi " << hid.iphi() << " depth " + << hid.depth() << std::endl; #endif // Sunanda's fix for 2017 Plan1 // and removed protection diff --git a/RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h b/RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h index d47ef674721a3..08fbdaaecec9c 100644 --- a/RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h +++ b/RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h @@ -9,6 +9,8 @@ #include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h" #include "DataFormats/CaloRecHit/interface/CaloCluster.h" #include "DataFormats/ParticleFlowReco/interface/HGCalMultiCluster.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ConsumesCollector.h" @@ -58,6 +60,8 @@ namespace hgcal { RecHitTools rhtools_; const edm::EDGetTokenT<HGCRecHitCollection> eetok, fhtok, bhtok; + const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeometryToken_; + const HGCRecHitCollection *eerh_, *fhrh_, *bhrh_; }; } // namespace hgcal diff --git a/RecoLocalCalo/HGCalRecAlgos/src/ClusterTools.cc b/RecoLocalCalo/HGCalRecAlgos/src/ClusterTools.cc index 098c5b3990510..6c95b46768254 100644 --- a/RecoLocalCalo/HGCalRecAlgos/src/ClusterTools.cc +++ b/RecoLocalCalo/HGCalRecAlgos/src/ClusterTools.cc @@ -4,8 +4,6 @@ #include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" #include "Geometry/HGCalGeometry/interface/HGCalGeometry.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "FWCore/Framework/interface/ESHandle.h" @@ -23,23 +21,16 @@ ClusterTools::ClusterTools() {} ClusterTools::ClusterTools(const edm::ParameterSet& conf, edm::ConsumesCollector& sumes) : eetok(sumes.consumes<HGCRecHitCollection>(conf.getParameter<edm::InputTag>("HGCEEInput"))), fhtok(sumes.consumes<HGCRecHitCollection>(conf.getParameter<edm::InputTag>("HGCFHInput"))), - bhtok(sumes.consumes<HGCRecHitCollection>(conf.getParameter<edm::InputTag>("HGCBHInput"))) {} + bhtok(sumes.consumes<HGCRecHitCollection>(conf.getParameter<edm::InputTag>("HGCBHInput"))), + caloGeometryToken_{sumes.esConsumes()} {} void ClusterTools::getEvent(const edm::Event& ev) { - edm::Handle<HGCRecHitCollection> temp; - ev.getByToken(eetok, temp); - eerh_ = temp.product(); - ev.getByToken(fhtok, temp); - fhrh_ = temp.product(); - ev.getByToken(bhtok, temp); - bhrh_ = temp.product(); + eerh_ = &ev.get(eetok); + fhrh_ = &ev.get(fhtok); + bhrh_ = &ev.get(bhtok); } -void ClusterTools::getEventSetup(const edm::EventSetup& es) { - edm::ESHandle<CaloGeometry> geom; - es.get<CaloGeometryRecord>().get(geom); - rhtools_.setGeometry(*geom); -} +void ClusterTools::getEventSetup(const edm::EventSetup& es) { rhtools_.setGeometry(es.getData(caloGeometryToken_)); } float ClusterTools::getClusterHadronFraction(const reco::CaloCluster& clus) const { float energy = 0.f, energyHad = 0.f; From af0da139847d1df3f42b5a1a75c1c6155dbac0ed Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 10:05:28 -0500 Subject: [PATCH 683/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py b/Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py index 868fa6a9eb5e1..a16db8aba4d6a 100644 --- a/Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py +++ b/Alignment/LaserAlignmentSimulation/test/LaserSimulation_cfg.py @@ -71,8 +71,7 @@ 'HCalGeom', 'HcalSim', 'TrackerMapDDDtoID', - 'TrackerSimInfoNumbering'), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport.xml') + 'TrackerSimInfoNumbering') ) From c717223b739b0963aca5381b88e7430db30d336b Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Mon, 19 Oct 2020 17:24:32 +0200 Subject: [PATCH 684/778] Code check --- .../plugins/AlCaHBHEMuonFilter.cc | 22 +++---- .../plugins/AlCaHEMuonFilter.cc | 24 +++---- .../plugins/AlCaIsoTracksFilter.cc | 35 ++++++----- .../plugins/AlCaIsoTracksProducerFilter.cc | 8 +-- .../plugins/AlCaIsolatedBunchFilter.cc | 8 +-- .../plugins/AlCaIsolatedBunchSelector.cc | 13 ++-- .../plugins/AlCaLowPUHBHEMuonFilter.cc | 24 +++---- .../src/AlCaHBHEMuonProducer.cc | 10 +-- .../src/AlCaIsoTracksProducer.cc | 62 ++++++++++--------- 9 files changed, 106 insertions(+), 100 deletions(-) diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc index c876cd11a089c..12e1244bb599c 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc @@ -114,8 +114,8 @@ AlCaHBHEMuonFilter::AlCaHBHEMuonFilter(edm::ParameterSet const& iConfig, const A tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); edm::LogVerbatim("HBHEMuon") << "Parameters read from config file \n" - << "Process " << processName_ << " Prescale " << preScale_ << " Isolation Cuts " - << trackIsoCut_ << ":" << caloIsoCut_ << "\n"; + << "Process " << processName_ << " Prescale " << preScale_ << " Isolation Cuts " + << trackIsoCut_ << ":" << caloIsoCut_ << "\n"; for (unsigned int k = 0; k < trigNames_.size(); ++k) edm::LogVerbatim("HBHEMuon") << "Trigger[" << k << "] " << trigNames_[k] << "\n"; } // AlCaHBHEMuonFilter::AlCaHBHEMuonFilter constructor @@ -132,8 +132,8 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu ++nAll_; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Run " << iEvent.id().run() << " Event " << iEvent.id().event() - << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() - << std::endl; + << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() + << std::endl; #endif //Step1: Find if the event passes one of the chosen triggers /////////////////////////////TriggerResults @@ -152,8 +152,8 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu ok = true; } #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" - << ok << std::endl; + edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt + << ":" << ok << std::endl; #endif } } @@ -173,9 +173,9 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() - << " innerTrack " << RecMuon->innerTrack().isNonnull() << " outerTrack " - << RecMuon->outerTrack().isNonnull() << " globalTrack " - << RecMuon->globalTrack().isNonnull() << std::endl; + << " innerTrack " << RecMuon->innerTrack().isNonnull() << " outerTrack " + << RecMuon->outerTrack().isNonnull() << " globalTrack " + << RecMuon->globalTrack().isNonnull() << std::endl; #endif if ((RecMuon->track().isNonnull()) && (RecMuon->innerTrack().isNonnull()) && (RecMuon->outerTrack().isNonnull()) && (RecMuon->globalTrack().isNonnull())) { @@ -183,7 +183,7 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Propagate: ECAL " << trackID.okECAL << " to HCAL " - << trackID.okHCAL << std::endl; + << trackID.okHCAL << std::endl; #endif double trackIso = RecMuon->isolationR03().sumPt; double caloIso = RecMuon->isolationR03().emEt + RecMuon->isolationR03().hadEt; @@ -225,7 +225,7 @@ void AlCaHBHEMuonFilter::endStream() { void AlCaHBHEMuonFilter::globalEndJob(const AlCaHBHEMuons::Counters* count) { edm::LogVerbatim("HBHEMuon") << "Selects " << count->nFinal_ << " out of " << count->nGood_ << " good events out of " - << count->nAll_ << " total # of events\n"; + << count->nAll_ << " total # of events\n"; } // ------------ method called when starting to processes a run ------------ diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHEMuonFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHEMuonFilter.cc index aa0efe4d182ba..6ba6617073ffe 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHEMuonFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHEMuonFilter.cc @@ -116,8 +116,8 @@ AlCaHEMuonFilter::AlCaHEMuonFilter(edm::ParameterSet const& iConfig, const AlCaH tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); edm::LogVerbatim("HEMuon") << "Parameters read from config file \n" - << "Process " << processName_ << " Prescale " << preScale_ << " Isolation Cuts " - << trackIsoCut_ << ":" << caloIsoCut_ << "\n"; + << "Process " << processName_ << " Prescale " << preScale_ << " Isolation Cuts " + << trackIsoCut_ << ":" << caloIsoCut_ << "\n"; for (unsigned int k = 0; k < trigNames_.size(); ++k) edm::LogVerbatim("HEMuon") << "Trigger[" << k << "] " << trigNames_[k] << "\n"; } // AlCaHEMuonFilter::AlCaHEMuonFilter constructor @@ -134,8 +134,8 @@ bool AlCaHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) ++nAll_; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Run " << iEvent.id().run() << " Event " << iEvent.id().event() - << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() - << std::endl; + << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() + << std::endl; #endif //Step1: Find if the event passes one of the chosen triggers /////////////////////////////TriggerResults @@ -154,8 +154,8 @@ bool AlCaHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) ok = true; } #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" << ok - << std::endl; + edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" + << ok << std::endl; #endif } } @@ -175,10 +175,10 @@ bool AlCaHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) if (_Muon.isValid()) { for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() << " innerTrack " - << RecMuon->innerTrack().isNonnull() << " outerTrack " - << RecMuon->outerTrack().isNonnull() << " globalTrack " - << RecMuon->globalTrack().isNonnull() << std::endl; + edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() + << " innerTrack " << RecMuon->innerTrack().isNonnull() << " outerTrack " + << RecMuon->outerTrack().isNonnull() << " globalTrack " + << RecMuon->globalTrack().isNonnull() << std::endl; #endif if ((RecMuon->track().isNonnull()) && (RecMuon->innerTrack().isNonnull()) && (RecMuon->outerTrack().isNonnull()) && (RecMuon->globalTrack().isNonnull())) { @@ -191,7 +191,7 @@ bool AlCaHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HEMuon") << "AlCaHEMuonFilter::Propagate: ECAL " << trackID.okECAL << " to HCAL " - << trackID.okHCAL << std::endl; + << trackID.okHCAL << std::endl; #endif double trackIso = RecMuon->isolationR03().sumPt; double caloIso = RecMuon->isolationR03().emEt + RecMuon->isolationR03().hadEt; @@ -233,7 +233,7 @@ void AlCaHEMuonFilter::endStream() { void AlCaHEMuonFilter::globalEndJob(const AlCaHEMuons::Counters* count) { edm::LogVerbatim("HEMuon") << "Selects " << count->nFinal_ << " out of " << count->nGood_ << " good events out of " - << count->nAll_ << " total # of events\n"; + << count->nAll_ << " total # of events\n"; } // ------------ method called when starting to processes a run ------------ diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc index a86ffb2212e42..ff8b3ea2304c8 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksFilter.cc @@ -196,22 +196,23 @@ AlCaIsoTracksFilter::AlCaIsoTracksFilter(const edm::ParameterSet& iConfig, const tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n" - << "\t minPt " << selectionParameter_.minPt << "\t theTrackQuality " << theTrackQuality_ - << "\t minQuality " << selectionParameter_.minQuality << "\t maxDxyPV " - << selectionParameter_.maxDxyPV << "\t maxDzPV " << selectionParameter_.maxDzPV - << "\t maxChi2 " << selectionParameter_.maxChi2 << "\t maxDpOverP " - << selectionParameter_.maxDpOverP << "\t minOuterHit " << selectionParameter_.minOuterHit - << "\t minLayerCrossed " << selectionParameter_.minLayerCrossed << "\t maxInMiss " - << selectionParameter_.maxInMiss << "\t maxOutMiss " << selectionParameter_.maxOutMiss - << "\n" - << "\t a_coneR " << a_coneR_ << "\t a_charIsoR " << a_charIsoR_ << "\t a_mipR " - << a_mipR_ << "\t maxRestrictionP_ " << maxRestrictionP_ << "\t slopeRestrictionP_ " - << slopeRestrictionP_ << "\t eIsolate_ " << eIsolate_ << "\n" - << "\t Precale factor " << preScale_ << "\t in momentum range " << pTrackLow_ << ":" - << pTrackHigh_ << " and prescale factor " << preScaleH_ << " for p > " << pTrackH_ - << " Threshold for EB " << hitEthrEB_ << " EE " << hitEthrEE0_ << ":" << hitEthrEE1_ - << ":" << hitEthrEE2_ << ":" << hitEthrEE3_ << ":" << hitEthrEELo_ << ":" - << hitEthrEEHi_; + << "\t minPt " << selectionParameter_.minPt << "\t theTrackQuality " + << theTrackQuality_ << "\t minQuality " << selectionParameter_.minQuality + << "\t maxDxyPV " << selectionParameter_.maxDxyPV << "\t maxDzPV " + << selectionParameter_.maxDzPV << "\t maxChi2 " << selectionParameter_.maxChi2 + << "\t maxDpOverP " << selectionParameter_.maxDpOverP << "\t minOuterHit " + << selectionParameter_.minOuterHit << "\t minLayerCrossed " + << selectionParameter_.minLayerCrossed << "\t maxInMiss " + << selectionParameter_.maxInMiss << "\t maxOutMiss " + << selectionParameter_.maxOutMiss << "\n" + << "\t a_coneR " << a_coneR_ << "\t a_charIsoR " << a_charIsoR_ << "\t a_mipR " + << a_mipR_ << "\t maxRestrictionP_ " << maxRestrictionP_ << "\t slopeRestrictionP_ " + << slopeRestrictionP_ << "\t eIsolate_ " << eIsolate_ << "\n" + << "\t Precale factor " << preScale_ << "\t in momentum range " << pTrackLow_ << ":" + << pTrackHigh_ << " and prescale factor " << preScaleH_ << " for p > " << pTrackH_ + << " Threshold for EB " << hitEthrEB_ << " EE " << hitEthrEE0_ << ":" << hitEthrEE1_ + << ":" << hitEthrEE2_ << ":" << hitEthrEE3_ << ":" << hitEthrEELo_ << ":" + << hitEthrEEHi_; for (unsigned int k = 0; k < trigNames_.size(); ++k) edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k]; @@ -430,7 +431,7 @@ void AlCaIsoTracksFilter::globalEndJob(const AlCaIsoTracks::Counters* count) { void AlCaIsoTracksFilter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); edm::LogVerbatim("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " - << hltConfig_.init(iRun, iSetup, processName_, changed); + << hltConfig_.init(iRun, iSetup, processName_, changed); } // ------------ method called when ending the processing of a run ------------ diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc index cf6830d9a9775..754886ac18382 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsoTracksProducerFilter.cc @@ -74,7 +74,7 @@ AlCaIsoTracksProducerFilter::AlCaIsoTracksProducerFilter(const edm::ParameterSet tok_trigRes_ = consumes<edm::TriggerResults>(triggerResultsLabel_); edm::LogVerbatim("HcalIsoTrack") << "Use process name " << processName_ << " Labels " << triggerResultsLabel_ - << " selecting " << trigNames_.size() << " triggers\n"; + << " selecting " << trigNames_.size() << " triggers\n"; for (unsigned int k = 0; k < trigNames_.size(); ++k) { edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k] << std::endl; } @@ -85,7 +85,7 @@ AlCaIsoTracksProducerFilter::~AlCaIsoTracksProducerFilter() {} bool AlCaIsoTracksProducerFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetup) { ++nAll_; edm::LogVerbatim("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " - << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; + << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; //Find if the event passes one of the chosen triggers bool triggerSatisfied(false); @@ -102,8 +102,8 @@ bool AlCaIsoTracksProducerFilter::filter(edm::Event& iEvent, edm::EventSetup con int hlt = triggerResults->accept(iHLT); for (unsigned int i = 0; i < trigNames_.size(); ++i) { if (triggerNames_[iHLT].find(trigNames_[i]) != std::string::npos) { - edm::LogVerbatim("HcalIsoTrack") << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" - << triggerSatisfied << std::endl; + edm::LogVerbatim("HcalIsoTrack") + << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << triggerSatisfied << std::endl; if (hlt > 0) { triggerSatisfied = true; break; diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchFilter.cc index 2b541b3311882..34dc963286a33 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchFilter.cc @@ -78,8 +78,8 @@ AlCaIsolatedBunchFilter::AlCaIsolatedBunchFilter(const edm::ParameterSet& iConfi tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel_); edm::LogVerbatim("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_ << " with " - << trigIsoBunchNames_.size() << ":" << trigJetNames_.size() << " trigger names and" - << " process " << processName_ << std::endl; + << trigIsoBunchNames_.size() << ":" << trigJetNames_.size() << " trigger names and" + << " process " << processName_ << std::endl; for (unsigned int k = 0; k < trigIsoBunchNames_.size(); ++k) edm::LogVerbatim("AlCaIsoBunch") << "Isolated Bunch[" << k << "] " << trigIsoBunchNames_[k] << std::endl; for (unsigned int k = 0; k < trigJetNames_.size(); ++k) @@ -98,7 +98,7 @@ bool AlCaIsolatedBunchFilter::filter(edm::Event& iEvent, edm::EventSetup const& ++nAll_; #ifdef EDM_ML_DEBUG edm::LogVerbatim("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " - << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; + << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; #endif //Step1: Find if the event passes one of the chosen triggers if ((trigIsoBunchNames_.empty()) && (trigJetNames_.empty())) { @@ -171,7 +171,7 @@ void AlCaIsolatedBunchFilter::globalEndJob(const AlCaIsolatedBunch::Counters* co void AlCaIsolatedBunchFilter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); edm::LogVerbatim("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " - << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl; + << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl; } // ------------ method called when ending the processing of a run ------------ void AlCaIsolatedBunchFilter::endRun(edm::Run const& iRun, edm::EventSetup const&) { diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchSelector.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchSelector.cc index a2b958216f1cc..54332a05caa61 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchSelector.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaIsolatedBunchSelector.cc @@ -76,8 +76,9 @@ AlCaIsolatedBunchSelector::AlCaIsolatedBunchSelector(const edm::ParameterSet& iC // define tokens for access tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel_); - edm::LogVerbatim("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_ << " with trigger name " - << trigName_ << " and process " << processName_ << std::endl; + edm::LogVerbatim("AlCaIsoBunch") << "Input tag for trigger results " << theTriggerResultsLabel_ + << " with trigger name " << trigName_ << " and process " << processName_ + << std::endl; } AlCaIsolatedBunchSelector::~AlCaIsolatedBunchSelector() {} @@ -92,7 +93,7 @@ bool AlCaIsolatedBunchSelector::filter(edm::Event& iEvent, edm::EventSetup const ++nAll_; #ifdef EDM_ML_DEBUG edm::LogVerbatim("AlCaIsoBunch") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " - << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; + << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing() << std::endl; #endif //Step1: Find if the event passes the chosen trigger edm::Handle<edm::TriggerResults> triggerResults; @@ -106,8 +107,8 @@ bool AlCaIsolatedBunchSelector::filter(edm::Event& iEvent, edm::EventSetup const if (hlt > 0) { accept = true; #ifdef EDM_ML_DEBUG - edm::LogVerbatim("AlCaIsoBunch") << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << accept - << std::endl; + edm::LogVerbatim("AlCaIsoBunch") + << triggerNames_[iHLT] << " has got HLT flag " << hlt << ":" << accept << std::endl; #endif break; } @@ -135,7 +136,7 @@ void AlCaIsolatedBunchSelector::globalEndJob(const AlCaIsolatedBunch::Counters* void AlCaIsolatedBunchSelector::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); edm::LogVerbatim("AlCaIsoBunch") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " - << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl; + << hltConfig_.init(iRun, iSetup, processName_, changed) << std::endl; } // ------------ method called when ending the processing of a run ------------ void AlCaIsolatedBunchSelector::endRun(edm::Run const& iRun, edm::EventSetup const&) { diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaLowPUHBHEMuonFilter.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaLowPUHBHEMuonFilter.cc index 1f2f4e4806ca3..781be61d8cdef 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaLowPUHBHEMuonFilter.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaLowPUHBHEMuonFilter.cc @@ -111,9 +111,9 @@ AlCaLowPUHBHEMuonFilter::AlCaLowPUHBHEMuonFilter(edm::ParameterSet const& iConfi tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); edm::LogVerbatim("LowPUHBHEMuon") << "Parameters read from config file \n" - << "Process " << processName_ << " PF Isolation Cuts " << pfIsoCut_ - << " minimum Muon pT cut " << minimumMuonpT_ << " minimum Muon eta cut " - << minimumMuoneta_; + << "Process " << processName_ << " PF Isolation Cuts " << pfIsoCut_ + << " minimum Muon pT cut " << minimumMuonpT_ << " minimum Muon eta cut " + << minimumMuoneta_; for (unsigned int k = 0; k < trigNames_.size(); ++k) edm::LogVerbatim("LowPUHBHEMuon") << "Trigger[" << k << "] " << trigNames_[k]; } // AlCaLowPUHBHEMuonFilter::AlCaLowPUHBHEMuonFilter constructor @@ -130,8 +130,8 @@ bool AlCaLowPUHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& ++nAll_; #ifdef EDM_ML_DEBUG edm::LogVerbatim("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Run " << iEvent.id().run() << " Event " - << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " - << iEvent.bunchCrossing(); + << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " + << iEvent.bunchCrossing(); #endif //Step1: Find if the event passes one of the chosen triggers /////////////////////////////TriggerResults @@ -151,8 +151,8 @@ bool AlCaLowPUHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& if (hlt > 0) ok = true; #ifdef EDM_ML_DEBUG - edm::LogVerbatim("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt - << ":" << ok; + edm::LogVerbatim("LowPUHBHEMuon") + << "AlCaLowPUHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt << ":" << ok; #endif } } @@ -171,10 +171,10 @@ bool AlCaLowPUHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& if (_Muon.isValid()) { for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon != _Muon->end(); ++RecMuon) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("LowPUHBHEMuon") << "AlCaLowPUHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() - << " innerTrack " << RecMuon->innerTrack().isNonnull() << " outerTrack " - << RecMuon->outerTrack().isNonnull() << " globalTrack " - << RecMuon->globalTrack().isNonnull(); + edm::LogVerbatim("LowPUHBHEMuon") + << "AlCaLowPUHBHEMuonFilter::Muon:Track " << RecMuon->track().isNonnull() << " innerTrack " + << RecMuon->innerTrack().isNonnull() << " outerTrack " << RecMuon->outerTrack().isNonnull() + << " globalTrack " << RecMuon->globalTrack().isNonnull(); #endif if ((RecMuon->pt() < minimumMuonpT_) || fabs(RecMuon->eta() < minimumMuoneta_)) continue; @@ -218,7 +218,7 @@ void AlCaLowPUHBHEMuonFilter::endStream() { void AlCaLowPUHBHEMuonFilter::globalEndJob(const AlCaLowPUHBHEMuons::Counters* count) { edm::LogVerbatim("LowPUHBHEMuon") << "Selects " << count->nGood_ << " good events out of " << count->nAll_ - << " total # of events"; + << " total # of events"; } // ------------ method called when starting to processes a run ------------ diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc b/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc index 4f752b378cbc2..f9624f7e77575 100644 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/src/AlCaHBHEMuonProducer.cc @@ -97,8 +97,9 @@ AlCaHBHEMuonProducer::AlCaHBHEMuonProducer(edm::ParameterSet const& iConfig, con tok_Muon_ = consumes<reco::MuonCollection>(labelMuon_); edm::LogVerbatim("HcalHBHEMuon") << "Parameters read from config file \n" - << "\t minP of muon " << pMuonMin_ << "\t input labels " << labelBS_ << " " << labelVtx_ - << " " << labelEB_ << " " << labelEE_ << " " << labelHBHE_ << " " << labelMuon_; + << "\t minP of muon " << pMuonMin_ << "\t input labels " << labelBS_ << " " + << labelVtx_ << " " << labelEB_ << " " << labelEE_ << " " << labelHBHE_ << " " + << labelMuon_; //saves the following collections produces<reco::BeamSpot>(labelBS_.label()); @@ -115,8 +116,9 @@ void AlCaHBHEMuonProducer::produce(edm::Event& iEvent, edm::EventSetup const& iS ++nAll_; bool valid(true); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HcalHBHEMuon") << "AlCaHBHEMuonProducer::Run " << iEvent.id().run() << " Event " << iEvent.id().event() - << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); + edm::LogVerbatim("HcalHBHEMuon") << "AlCaHBHEMuonProducer::Run " << iEvent.id().run() << " Event " + << iEvent.id().event() << " Luminosity " << iEvent.luminosityBlock() << " Bunch " + << iEvent.bunchCrossing(); #endif //Step1: Get all the relevant containers diff --git a/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc b/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc index a72d00ce73a3c..157129f9ceab3 100644 --- a/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/src/AlCaIsoTracksProducer.cc @@ -210,21 +210,22 @@ AlCaIsoTracksProducer::AlCaIsoTracksProducer(edm::ParameterSet const& iConfig, c tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>(); edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n" - << "\t minPt " << selectionParameter_.minPt << "\t theTrackQuality " << theTrackQuality_ - << "\t minQuality " << selectionParameter_.minQuality << "\t maxDxyPV " - << selectionParameter_.maxDxyPV << "\t maxDzPV " << selectionParameter_.maxDzPV - << "\t maxChi2 " << selectionParameter_.maxChi2 << "\t maxDpOverP " - << selectionParameter_.maxDpOverP << "\t minOuterHit " << selectionParameter_.minOuterHit - << "\t minLayerCrossed " << selectionParameter_.minLayerCrossed << "\t maxInMiss " - << selectionParameter_.maxInMiss << "\t maxOutMiss " << selectionParameter_.maxOutMiss - << "\n" - << "\t a_coneR " << a_coneR_ << "\t a_charIsoR " << a_charIsoR_ << "\t a_mipR " - << a_mipR_ << "\t pTrackMin " << pTrackMin_ << "\t eEcalMax " << eEcalMax_ - << "\t maxRestrictionP_ " << maxRestrictionP_ << "\t slopeRestrictionP_ " - << slopeRestrictionP_ << "\t eIsolate_ " << eIsolate_ << "\t Process " << processName_ - << "\n" - << "\t Precale factor " << preScale_ << "\t in momentum range " << pTrackLow_ << ":" - << pTrackHigh_; + << "\t minPt " << selectionParameter_.minPt << "\t theTrackQuality " + << theTrackQuality_ << "\t minQuality " << selectionParameter_.minQuality + << "\t maxDxyPV " << selectionParameter_.maxDxyPV << "\t maxDzPV " + << selectionParameter_.maxDzPV << "\t maxChi2 " << selectionParameter_.maxChi2 + << "\t maxDpOverP " << selectionParameter_.maxDpOverP << "\t minOuterHit " + << selectionParameter_.minOuterHit << "\t minLayerCrossed " + << selectionParameter_.minLayerCrossed << "\t maxInMiss " + << selectionParameter_.maxInMiss << "\t maxOutMiss " + << selectionParameter_.maxOutMiss << "\n" + << "\t a_coneR " << a_coneR_ << "\t a_charIsoR " << a_charIsoR_ << "\t a_mipR " + << a_mipR_ << "\t pTrackMin " << pTrackMin_ << "\t eEcalMax " << eEcalMax_ + << "\t maxRestrictionP_ " << maxRestrictionP_ << "\t slopeRestrictionP_ " + << slopeRestrictionP_ << "\t eIsolate_ " << eIsolate_ << "\t Process " + << processName_ << "\n" + << "\t Precale factor " << preScale_ << "\t in momentum range " << pTrackLow_ << ":" + << pTrackHigh_; for (unsigned int k = 0; k < trigNames_.size(); ++k) edm::LogVerbatim("HcalIsoTrack") << "Trigger[" << k << "] " << trigNames_[k]; @@ -236,12 +237,12 @@ AlCaIsoTracksProducer::AlCaIsoTracksProducer(edm::ParameterSet const& iConfig, c produces<HBHERecHitCollection>(labelHBHE_.label()); edm::LogVerbatim("HcalIsoTrack") << " Expected to produce the collections:\n" - << "reco::HcalIsolatedTrackCandidateCollection " - << " with label HcalIsolatedTrackCollection\n" - << "reco::VertexCollection with label " << labelRecVtx_.label() << "\n" - << "EcalRecHitCollection with label EcalRecHitsEB\n" - << "EcalRecHitCollection with label EcalRecHitsEE\n" - << "HBHERecHitCollection with label " << labelHBHE_.label(); + << "reco::HcalIsolatedTrackCandidateCollection " + << " with label HcalIsolatedTrackCollection\n" + << "reco::VertexCollection with label " << labelRecVtx_.label() << "\n" + << "EcalRecHitCollection with label EcalRecHitsEB\n" + << "EcalRecHitCollection with label EcalRecHitsEE\n" + << "HBHERecHitCollection with label " << labelHBHE_.label(); } AlCaIsoTracksProducer::~AlCaIsoTracksProducer() {} @@ -294,7 +295,7 @@ void AlCaIsoTracksProducer::produce(edm::Event& iEvent, edm::EventSetup const& i nAll_++; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "Run " << iEvent.id().run() << " Event " << iEvent.id().event() << " Luminosity " - << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); + << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); #endif bool valid(true); //Step1: Get all the relevant containers @@ -405,7 +406,8 @@ void AlCaIsoTracksProducer::produce(edm::Event& iEvent, edm::EventSetup const& i etaL1, phiL1); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksProducer::select returns " << isotk->size() << " isolated tracks"; + edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksProducer::select returns " << isotk->size() + << " isolated tracks"; #endif if (!isotk->empty()) { @@ -465,13 +467,13 @@ void AlCaIsoTracksProducer::endStream() { void AlCaIsoTracksProducer::globalEndJob(const AlCaIsoTracks::Counters* count) { edm::LogVerbatim("HcalIsoTrack") << "Finds " << count->nGood_ << " good tracks in " << count->nAll_ << " events and " - << count->nRange_ << " events in the momentum raange"; + << count->nRange_ << " events in the momentum raange"; } void AlCaIsoTracksProducer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { bool changed(false); edm::LogVerbatim("HcalIsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " - << hltConfig_.init(iRun, iSetup, processName_, changed); + << hltConfig_.init(iRun, iSetup, processName_, changed); bField = &(iSetup.getData(tok_magField_)); geo = &(iSetup.getData(tok_geom_)); @@ -505,7 +507,7 @@ reco::HcalIsolatedTrackCandidateCollection* AlCaIsoTracksProducer::select( ok = true; } edm::LogVerbatim("HcalIsoTrack") << "The trigger we are looking for " << triggerNames_[iHLT] << " Flag " << hlt - << ":" << ok; + << ":" << ok; } } } @@ -522,13 +524,13 @@ reco::HcalIsolatedTrackCandidateCollection* AlCaIsoTracksProducer::select( math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p()); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" - << pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p(); + << pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p(); #endif //Selection of good track bool qltyFlag = spr::goodTrack(pTrack, leadPV, selectionParameter_, false); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "qltyFlag|okECAL|okHCAL : " << qltyFlag << "|" << trkDetItr->okECAL << "|" - << trkDetItr->okHCAL; + << trkDetItr->okHCAL; #endif if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) { double t_p = pTrack->p(); @@ -550,8 +552,8 @@ reco::HcalIsolatedTrackCandidateCollection* AlCaIsoTracksProducer::select( eIsolation = eIsolate_; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|" - << pTrack->eta() << "|" << pTrack->phi() << "|" << t_p << " e_MIP " << eMipDR - << " Chg Isolation " << hmaxNearP << ":" << eIsolation; + << pTrack->eta() << "|" << pTrack->phi() << "|" << t_p << " e_MIP " << eMipDR + << " Chg Isolation " << hmaxNearP << ":" << eIsolation; #endif if (t_p > pTrackMin_ && eMipDR < eEcalMax_ && hmaxNearP < eIsolation) { reco::HcalIsolatedTrackCandidate newCandidate(v4); From ad1881ee68eb542442af6d9e353411d129e3d2ed Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 10:24:52 -0500 Subject: [PATCH 685/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- DQMServices/Components/python/MessageLogger_cfi.py | 8 -------- DQMServices/Examples/python/test/MessageLogger_cfi.py | 6 ------ 2 files changed, 14 deletions(-) diff --git a/DQMServices/Components/python/MessageLogger_cfi.py b/DQMServices/Components/python/MessageLogger_cfi.py index 0a4794ebc8f4a..58215f6e859d2 100644 --- a/DQMServices/Components/python/MessageLogger_cfi.py +++ b/DQMServices/Components/python/MessageLogger_cfi.py @@ -120,14 +120,6 @@ limit = cms.untracked.int32(10000000) ) ), - FrameworkJobReport = cms.untracked.PSet( - #untracked PSet default = - # { untracked int32 limit = 0 } - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000) - ) - ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), categories = cms.untracked.vstring('FwkJob', 'MEtoEDMConverter_MEtoEDMConverter', 'MEtoEDMConverter_endJob', 'MEtoEDMConverter_beginRun', 'MEtoEDMConverter_endRun', 'EDMtoMEConverter_EDMtoMEConverter', 'EDMtoMEConverter_endJob', 'EDMtoMEConverter_beginRun', 'EDMtoMEConverter_endRun', 'ScheduleExecutionFailure', 'EventSetupDependency', 'Root_Warning', 'Root_Error'), destinations = cms.untracked.vstring('MessageLogger', 'cout', 'cerr') ) diff --git a/DQMServices/Examples/python/test/MessageLogger_cfi.py b/DQMServices/Examples/python/test/MessageLogger_cfi.py index f6dd7716a1796..03ecd22e58d73 100644 --- a/DQMServices/Examples/python/test/MessageLogger_cfi.py +++ b/DQMServices/Examples/python/test/MessageLogger_cfi.py @@ -228,12 +228,6 @@ limit = cms.untracked.int32(10000000) ) ), - FrameworkJobReport = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000) - ) - ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), categories = cms.untracked.vstring('FwkJob', 'MEtoEDMConverter_MEtoEDMConverter', 'MEtoEDMConverter_endJob', From 970ef4298f3519dd2a4e305fa1d7650d91f83fcf Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 10:14:45 -0500 Subject: [PATCH 686/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- .../test/PCC_Random_Event_Integrator_cfg.py | 11 ----------- .../test/PCC_Random_Event_cfg.py | 6 ------ .../LumiAlCaRecoProducers/test/PCC_Random_cfg.py | 11 ----------- .../LumiAlCaRecoProducers/test/PCC_ZeroBias_cfg.py | 11 ----------- .../LumiAlCaRecoProducers/test/raw_ZeroBias_cfg.py | 11 ----------- .../LumiAlCaRecoProducers/test/raw_corr_Random_cfg.py | 11 ----------- 6 files changed, 61 deletions(-) diff --git a/Calibration/LumiAlCaRecoProducers/test/PCC_Random_Event_Integrator_cfg.py b/Calibration/LumiAlCaRecoProducers/test/PCC_Random_Event_Integrator_cfg.py index c993bf8c699e6..cdf5658f0bd09 100644 --- a/Calibration/LumiAlCaRecoProducers/test/PCC_Random_Event_Integrator_cfg.py +++ b/Calibration/LumiAlCaRecoProducers/test/PCC_Random_Event_Integrator_cfg.py @@ -121,16 +121,6 @@ process.ALCARECOStreamPromptCalibProdOutPath = cms.EndPath(process.ALCARECOStreamPromptCalibProdPCC) process.MessageLogger = cms.Service("MessageLogger", - FrameworkJobReport = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000), - optionalPSet = cms.untracked.bool(True) - ), - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - optionalPSet = cms.untracked.bool(True) - ), categories = cms.untracked.vstring('FwkJob', 'FwkReport', 'FwkSummary', @@ -188,7 +178,6 @@ errors = cms.untracked.PSet( placeholder = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), infos = cms.untracked.PSet( Root_NoDictionary = cms.untracked.PSet( limit = cms.untracked.int32(0), diff --git a/Calibration/LumiAlCaRecoProducers/test/PCC_Random_Event_cfg.py b/Calibration/LumiAlCaRecoProducers/test/PCC_Random_Event_cfg.py index bb5ff599aa53b..c0170b402a959 100644 --- a/Calibration/LumiAlCaRecoProducers/test/PCC_Random_Event_cfg.py +++ b/Calibration/LumiAlCaRecoProducers/test/PCC_Random_Event_cfg.py @@ -110,11 +110,6 @@ process.ALCARECOStreamPromptCalibProdOutPath = cms.EndPath(process.ALCARECOStreamPromptCalibProdPCC) process.MessageLogger = cms.Service("MessageLogger", - FrameworkJobReport = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000), - optionalPSet = cms.untracked.bool(True) - ), default = cms.untracked.PSet( limit = cms.untracked.int32(0) ), @@ -177,7 +172,6 @@ errors = cms.untracked.PSet( placeholder = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), infos = cms.untracked.PSet( Root_NoDictionary = cms.untracked.PSet( limit = cms.untracked.int32(0), diff --git a/Calibration/LumiAlCaRecoProducers/test/PCC_Random_cfg.py b/Calibration/LumiAlCaRecoProducers/test/PCC_Random_cfg.py index 499cc2d9fac31..5f4c5bb6673dd 100644 --- a/Calibration/LumiAlCaRecoProducers/test/PCC_Random_cfg.py +++ b/Calibration/LumiAlCaRecoProducers/test/PCC_Random_cfg.py @@ -116,16 +116,6 @@ process.ALCARECOStreamPromptCalibProdOutPath = cms.EndPath(process.ALCARECOStreamPromptCalibProdPCC) process.MessageLogger = cms.Service("MessageLogger", - FrameworkJobReport = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000), - optionalPSet = cms.untracked.bool(True) - ), - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - optionalPSet = cms.untracked.bool(True) - ), categories = cms.untracked.vstring('FwkJob', 'FwkReport', 'FwkSummary', @@ -183,7 +173,6 @@ errors = cms.untracked.PSet( placeholder = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), infos = cms.untracked.PSet( Root_NoDictionary = cms.untracked.PSet( limit = cms.untracked.int32(0), diff --git a/Calibration/LumiAlCaRecoProducers/test/PCC_ZeroBias_cfg.py b/Calibration/LumiAlCaRecoProducers/test/PCC_ZeroBias_cfg.py index 6cd5d1b7a215e..c07d275a71135 100644 --- a/Calibration/LumiAlCaRecoProducers/test/PCC_ZeroBias_cfg.py +++ b/Calibration/LumiAlCaRecoProducers/test/PCC_ZeroBias_cfg.py @@ -120,16 +120,6 @@ process.ALCARECOStreamPromptCalibProdOutPath = cms.EndPath(process.ALCARECOStreamPromptCalibProdPCC) process.MessageLogger = cms.Service("MessageLogger", - FrameworkJobReport = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000), - optionalPSet = cms.untracked.bool(True) - ), - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - optionalPSet = cms.untracked.bool(True) - ), categories = cms.untracked.vstring('FwkJob', 'FwkReport', 'FwkSummary', @@ -187,7 +177,6 @@ errors = cms.untracked.PSet( placeholder = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), infos = cms.untracked.PSet( Root_NoDictionary = cms.untracked.PSet( limit = cms.untracked.int32(0), diff --git a/Calibration/LumiAlCaRecoProducers/test/raw_ZeroBias_cfg.py b/Calibration/LumiAlCaRecoProducers/test/raw_ZeroBias_cfg.py index c6bec91d03691..9de5f216f59ce 100644 --- a/Calibration/LumiAlCaRecoProducers/test/raw_ZeroBias_cfg.py +++ b/Calibration/LumiAlCaRecoProducers/test/raw_ZeroBias_cfg.py @@ -65,16 +65,6 @@ process.ALCARECOStreamPromptCalibProdOutPath = cms.EndPath(process.ALCARECOStreamPromptCalibProdPCC) process.MessageLogger = cms.Service("MessageLogger", - FrameworkJobReport = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000), - optionalPSet = cms.untracked.bool(True) - ), - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - optionalPSet = cms.untracked.bool(True) - ), categories = cms.untracked.vstring('FwkJob', 'FwkReport', 'FwkSummary', @@ -132,7 +122,6 @@ errors = cms.untracked.PSet( placeholder = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), infos = cms.untracked.PSet( Root_NoDictionary = cms.untracked.PSet( limit = cms.untracked.int32(0), diff --git a/Calibration/LumiAlCaRecoProducers/test/raw_corr_Random_cfg.py b/Calibration/LumiAlCaRecoProducers/test/raw_corr_Random_cfg.py index c57192fb8d267..c1972acfca3ed 100644 --- a/Calibration/LumiAlCaRecoProducers/test/raw_corr_Random_cfg.py +++ b/Calibration/LumiAlCaRecoProducers/test/raw_corr_Random_cfg.py @@ -77,16 +77,6 @@ # process.MessageLogger = cms.Service("MessageLogger", - FrameworkJobReport = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000), - optionalPSet = cms.untracked.bool(True) - ), - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - optionalPSet = cms.untracked.bool(True) - ), categories = cms.untracked.vstring('FwkJob', 'FwkReport', 'FwkSummary', @@ -144,7 +134,6 @@ errors = cms.untracked.PSet( placeholder = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), infos = cms.untracked.PSet( #Root_NoDictionary = cms.untracked.PSet( # limit = cms.untracked.int32(0), From ebcf66f9b66e7e4ac62da6445f306e188b3146a2 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 10:44:43 -0500 Subject: [PATCH 687/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- EventFilter/L1GlobalTriggerRawToDigi/test/L1GtEvmUnpacker_cfg.py | 1 - EventFilter/L1GlobalTriggerRawToDigi/test/L1GtUnpacker_cfg.py | 1 - 2 files changed, 2 deletions(-) diff --git a/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtEvmUnpacker_cfg.py b/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtEvmUnpacker_cfg.py index cd57f7957128b..23880badb1607 100644 --- a/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtEvmUnpacker_cfg.py +++ b/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtEvmUnpacker_cfg.py @@ -96,7 +96,6 @@ 'L1GtEvmUnpacker' ] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] process.MessageLogger.L1GtEvmUnpacker_errors = cms.untracked.PSet( threshold = cms.untracked.string('ERROR'), diff --git a/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtUnpacker_cfg.py b/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtUnpacker_cfg.py index 0e7d35bde8b07..5527f4db5f56e 100644 --- a/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtUnpacker_cfg.py +++ b/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtUnpacker_cfg.py @@ -126,7 +126,6 @@ 'L1GtUnpacker' ] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] process.MessageLogger.L1GtUnpacker_errors = cms.untracked.PSet( threshold = cms.untracked.string('ERROR'), From d67bd80907c114e221f434c5d34eb1363c53961f Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Mon, 19 Oct 2020 17:52:40 +0200 Subject: [PATCH 688/778] Add back explicit destructor for TrackDetectorAssociator I was getting link errors without (not really sure why though). --- .../TrackAssociator/interface/TrackDetectorAssociator.h | 1 + TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h b/TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h index b76447bf22d01..d4a8fad682940 100644 --- a/TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h +++ b/TrackingTools/TrackAssociator/interface/TrackDetectorAssociator.h @@ -46,6 +46,7 @@ class TrackDetectorAssociator { public: explicit TrackDetectorAssociator(); + ~TrackDetectorAssociator(); typedef TrackAssociatorParameters AssociatorParameters; enum Direction { Any, InsideOut, OutsideIn }; diff --git a/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc b/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc index a898dcde805df..517e5d1fe4224 100644 --- a/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc +++ b/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc @@ -103,6 +103,8 @@ TrackDetectorAssociator::TrackDetectorAssociator() { useDefaultPropagator_ = false; } +TrackDetectorAssociator::~TrackDetectorAssociator() = default; + void TrackDetectorAssociator::setPropagator(const Propagator* ptr) { ivProp_ = ptr; cachedTrajectory_.setPropagator(ivProp_); From 7a0a8b2d485b153b897248a1c69d97bae8fcaaa2 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 11:08:30 -0500 Subject: [PATCH 689/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- GeneratorInterface/ExternalDecays/test/Py6EvtGenFilter_cfg.py | 2 +- .../ExternalDecays/test/Py6GenFilter_Photos_cfg.py | 2 +- .../ExternalDecays/test/Py6GenFilter_W2TauNu_Tauola_cfg.py | 2 +- .../ExternalDecays/test/Py8GenFilter_Onia_EvtGen_cfg.py | 2 +- .../ExternalDecays/test/Py8GenFilter_Photos_cfg.py | 2 +- .../ExternalDecays/test/Py8GenFilter_W2TauNu_Tauola_cfg.py | 2 +- .../ExternalDecays/test/Py8_Z2tautau_tauolacxx_cfg.py | 2 +- GeneratorInterface/ExternalDecays/test/TauSpinnerWTest.py | 2 +- GeneratorInterface/ExternalDecays/test/TauSpinnerZTest.py | 2 +- GeneratorInterface/GenExtensions/test/EDDE_cfg.py | 2 +- GeneratorInterface/GenFilters/test/comphep_singletop_Py8.py | 2 +- GeneratorInterface/GenFilters/test/test_EMJetHeep_cfg.py | 2 +- GeneratorInterface/GenFilters/test/test_EMJetMB_cfg.py | 2 +- .../Pythia6Interface/test/AlpgenSource_Py6Had_cfg.py | 2 +- GeneratorInterface/Pythia6Interface/test/Py6EvtGenFilter_cfg.py | 2 +- .../Pythia6Interface/test/Py6GenFilter_CSAMode_cfg.py | 2 +- .../test/Py6GenFilter_ElectronProtonInitialState_cfg.py | 2 +- .../Pythia6Interface/test/Py6GenFilter_EvtGenTest_cfg.py | 2 +- .../Pythia6Interface/test/Py6GenFilter_PDG_convert_cfg.py | 2 +- .../Pythia6Interface/test/Py6GenFilter_Photos_cfg.py | 2 +- .../Pythia6Interface/test/Py6GenFilter_SLHA_cfg.py | 2 +- .../Pythia6Interface/test/Py6GenFilter_Ztautau_Tauola_cfg.py | 2 +- GeneratorInterface/Pythia6Interface/test/Py6GenFilter_cfg.py | 2 +- .../Pythia6Interface/test/Py6GenFilter_gluino_cfg.py | 2 +- .../Pythia6Interface/test/Py6GenFilter_stophadrons_cfg.py | 2 +- .../Pythia6Interface/test/Py6HadFilter_RestoreRNDM_cfg.py | 2 +- GeneratorInterface/Pythia6Interface/test/Py6HadFilter_cfg.py | 2 +- .../Pythia6Interface/test/Py6HadFilter_mgmatching_cfg.py | 2 +- GeneratorInterface/TauolaInterface/test/TauSpinnerWTest.py | 2 +- GeneratorInterface/TauolaInterface/test/TauSpinnerZTest.py | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/GeneratorInterface/ExternalDecays/test/Py6EvtGenFilter_cfg.py b/GeneratorInterface/ExternalDecays/test/Py6EvtGenFilter_cfg.py index 5013027ade61b..ede491450e894 100644 --- a/GeneratorInterface/ExternalDecays/test/Py6EvtGenFilter_cfg.py +++ b/GeneratorInterface/ExternalDecays/test/Py6EvtGenFilter_cfg.py @@ -16,7 +16,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(500)) diff --git a/GeneratorInterface/ExternalDecays/test/Py6GenFilter_Photos_cfg.py b/GeneratorInterface/ExternalDecays/test/Py6GenFilter_Photos_cfg.py index 53826cf947804..759eeb5ba7444 100644 --- a/GeneratorInterface/ExternalDecays/test/Py6GenFilter_Photos_cfg.py +++ b/GeneratorInterface/ExternalDecays/test/Py6GenFilter_Photos_cfg.py @@ -25,7 +25,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(20)) diff --git a/GeneratorInterface/ExternalDecays/test/Py6GenFilter_W2TauNu_Tauola_cfg.py b/GeneratorInterface/ExternalDecays/test/Py6GenFilter_W2TauNu_Tauola_cfg.py index 7c2226ea8fbb2..70ea3183896b1 100644 --- a/GeneratorInterface/ExternalDecays/test/Py6GenFilter_W2TauNu_Tauola_cfg.py +++ b/GeneratorInterface/ExternalDecays/test/Py6GenFilter_W2TauNu_Tauola_cfg.py @@ -29,7 +29,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(5)) diff --git a/GeneratorInterface/ExternalDecays/test/Py8GenFilter_Onia_EvtGen_cfg.py b/GeneratorInterface/ExternalDecays/test/Py8GenFilter_Onia_EvtGen_cfg.py index 5804d982e35a2..a19f5bfd79f43 100644 --- a/GeneratorInterface/ExternalDecays/test/Py8GenFilter_Onia_EvtGen_cfg.py +++ b/GeneratorInterface/ExternalDecays/test/Py8GenFilter_Onia_EvtGen_cfg.py @@ -70,7 +70,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", generator = cms.PSet( diff --git a/GeneratorInterface/ExternalDecays/test/Py8GenFilter_Photos_cfg.py b/GeneratorInterface/ExternalDecays/test/Py8GenFilter_Photos_cfg.py index 6b4a790fd6418..0321b3a54f78e 100644 --- a/GeneratorInterface/ExternalDecays/test/Py8GenFilter_Photos_cfg.py +++ b/GeneratorInterface/ExternalDecays/test/Py8GenFilter_Photos_cfg.py @@ -63,7 +63,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", generator = cms.PSet( diff --git a/GeneratorInterface/ExternalDecays/test/Py8GenFilter_W2TauNu_Tauola_cfg.py b/GeneratorInterface/ExternalDecays/test/Py8GenFilter_W2TauNu_Tauola_cfg.py index 18e21b1bd3d76..b47fbf0361f87 100644 --- a/GeneratorInterface/ExternalDecays/test/Py8GenFilter_W2TauNu_Tauola_cfg.py +++ b/GeneratorInterface/ExternalDecays/test/Py8GenFilter_W2TauNu_Tauola_cfg.py @@ -76,7 +76,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", generator = cms.PSet( diff --git a/GeneratorInterface/ExternalDecays/test/Py8_Z2tautau_tauolacxx_cfg.py b/GeneratorInterface/ExternalDecays/test/Py8_Z2tautau_tauolacxx_cfg.py index 30985370651b2..4a73cd921926a 100644 --- a/GeneratorInterface/ExternalDecays/test/Py8_Z2tautau_tauolacxx_cfg.py +++ b/GeneratorInterface/ExternalDecays/test/Py8_Z2tautau_tauolacxx_cfg.py @@ -77,7 +77,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService", generator = cms.PSet( diff --git a/GeneratorInterface/ExternalDecays/test/TauSpinnerWTest.py b/GeneratorInterface/ExternalDecays/test/TauSpinnerWTest.py index 3ab6eccce0d32..9e48e5d243397 100644 --- a/GeneratorInterface/ExternalDecays/test/TauSpinnerWTest.py +++ b/GeneratorInterface/ExternalDecays/test/TauSpinnerWTest.py @@ -33,7 +33,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) diff --git a/GeneratorInterface/ExternalDecays/test/TauSpinnerZTest.py b/GeneratorInterface/ExternalDecays/test/TauSpinnerZTest.py index b903aec625fe4..ba33caac5a2a3 100644 --- a/GeneratorInterface/ExternalDecays/test/TauSpinnerZTest.py +++ b/GeneratorInterface/ExternalDecays/test/TauSpinnerZTest.py @@ -26,7 +26,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) diff --git a/GeneratorInterface/GenExtensions/test/EDDE_cfg.py b/GeneratorInterface/GenExtensions/test/EDDE_cfg.py index 98ba2e98b7748..309490a7d52f7 100644 --- a/GeneratorInterface/GenExtensions/test/EDDE_cfg.py +++ b/GeneratorInterface/GenExtensions/test/EDDE_cfg.py @@ -24,7 +24,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(50)) diff --git a/GeneratorInterface/GenFilters/test/comphep_singletop_Py8.py b/GeneratorInterface/GenFilters/test/comphep_singletop_Py8.py index 2876054757f03..963c67086b4f3 100644 --- a/GeneratorInterface/GenFilters/test/comphep_singletop_Py8.py +++ b/GeneratorInterface/GenFilters/test/comphep_singletop_Py8.py @@ -18,7 +18,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") ##process.MessageLogger.destinations = ['cerr'] ##process.MessageLogger.statistics = [] -##process.MessageLogger.fwkJobReports = [] +## ##process.MessageLogger.cerr.threshold = "Warning" diff --git a/GeneratorInterface/GenFilters/test/test_EMJetHeep_cfg.py b/GeneratorInterface/GenFilters/test/test_EMJetHeep_cfg.py index b5e0852bfecbd..e2bfcd5c730a5 100644 --- a/GeneratorInterface/GenFilters/test/test_EMJetHeep_cfg.py +++ b/GeneratorInterface/GenFilters/test/test_EMJetHeep_cfg.py @@ -26,7 +26,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.MessageLogger.cerr.threshold = "Warning" diff --git a/GeneratorInterface/GenFilters/test/test_EMJetMB_cfg.py b/GeneratorInterface/GenFilters/test/test_EMJetMB_cfg.py index da1b967211085..bb5100b177d4f 100644 --- a/GeneratorInterface/GenFilters/test/test_EMJetMB_cfg.py +++ b/GeneratorInterface/GenFilters/test/test_EMJetMB_cfg.py @@ -26,7 +26,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.MessageLogger.cerr.threshold = "Warning" diff --git a/GeneratorInterface/Pythia6Interface/test/AlpgenSource_Py6Had_cfg.py b/GeneratorInterface/Pythia6Interface/test/AlpgenSource_Py6Had_cfg.py index 53ec110ec7c72..80cc75fc99a25 100644 --- a/GeneratorInterface/Pythia6Interface/test/AlpgenSource_Py6Had_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/AlpgenSource_Py6Had_cfg.py @@ -28,7 +28,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.generator = cms.EDFilter("Pythia6HadronizerFilter", pythiaHepMCVerbosity = cms.untracked.bool(True), diff --git a/GeneratorInterface/Pythia6Interface/test/Py6EvtGenFilter_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6EvtGenFilter_cfg.py index 7db60167cca8e..e3a35c3b447dc 100755 --- a/GeneratorInterface/Pythia6Interface/test/Py6EvtGenFilter_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6EvtGenFilter_cfg.py @@ -16,7 +16,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_CSAMode_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_CSAMode_cfg.py index bfa4dcc90a804..e01e74a8788c5 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_CSAMode_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_CSAMode_cfg.py @@ -19,7 +19,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(5)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_ElectronProtonInitialState_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_ElectronProtonInitialState_cfg.py index 9c39e6c8d1d24..b92792d727f65 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_ElectronProtonInitialState_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_ElectronProtonInitialState_cfg.py @@ -18,7 +18,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(20)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_EvtGenTest_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_EvtGenTest_cfg.py index bc6efd1b593eb..354193ee4b347 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_EvtGenTest_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_EvtGenTest_cfg.py @@ -26,7 +26,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(5)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_PDG_convert_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_PDG_convert_cfg.py index 8a34e123cb04c..cf4324895c73d 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_PDG_convert_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_PDG_convert_cfg.py @@ -19,7 +19,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_Photos_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_Photos_cfg.py index 60543d9a6f48a..de9fb60f453b9 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_Photos_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_Photos_cfg.py @@ -25,7 +25,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(20)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_SLHA_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_SLHA_cfg.py index 6fa0edc79f14f..7db80613f59b7 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_SLHA_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_SLHA_cfg.py @@ -19,7 +19,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_Ztautau_Tauola_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_Ztautau_Tauola_cfg.py index 4a904a77b0bdb..a639942db65c5 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_Ztautau_Tauola_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_Ztautau_Tauola_cfg.py @@ -18,7 +18,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(5)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_cfg.py index 9fc323440d6d3..df00e85617e90 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_cfg.py @@ -18,7 +18,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(20)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_gluino_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_gluino_cfg.py index 18e7ba57b6efe..74c45cdce09b4 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_gluino_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_gluino_cfg.py @@ -19,7 +19,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_stophadrons_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_stophadrons_cfg.py index 18a120ae28dfc..61c18d4e0c4d3 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_stophadrons_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6GenFilter_stophadrons_cfg.py @@ -19,7 +19,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_RestoreRNDM_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_RestoreRNDM_cfg.py index f4827b9d76581..9f7a328748f30 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_RestoreRNDM_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_RestoreRNDM_cfg.py @@ -24,7 +24,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(5)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_cfg.py index 06cf1b1b42b3b..a711c6424b292 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_cfg.py @@ -23,7 +23,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(50)) diff --git a/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_mgmatching_cfg.py b/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_mgmatching_cfg.py index 352aeed192bdf..ca5a8752dab60 100644 --- a/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_mgmatching_cfg.py +++ b/GeneratorInterface/Pythia6Interface/test/Py6HadFilter_mgmatching_cfg.py @@ -23,7 +23,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1000)) diff --git a/GeneratorInterface/TauolaInterface/test/TauSpinnerWTest.py b/GeneratorInterface/TauolaInterface/test/TauSpinnerWTest.py index 7485c85afbb18..c1c818649c313 100644 --- a/GeneratorInterface/TauolaInterface/test/TauSpinnerWTest.py +++ b/GeneratorInterface/TauolaInterface/test/TauSpinnerWTest.py @@ -26,7 +26,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) diff --git a/GeneratorInterface/TauolaInterface/test/TauSpinnerZTest.py b/GeneratorInterface/TauolaInterface/test/TauSpinnerZTest.py index 562e81e3bdcb2..f73b330a985a8 100644 --- a/GeneratorInterface/TauolaInterface/test/TauSpinnerZTest.py +++ b/GeneratorInterface/TauolaInterface/test/TauSpinnerZTest.py @@ -26,7 +26,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) From b4a6d66eff742c02e979983dfa368d7eb767fe1f Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 11:14:42 -0500 Subject: [PATCH 690/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- Geometry/CMSCommonData/test/runPrint_cfg.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Geometry/CMSCommonData/test/runPrint_cfg.py b/Geometry/CMSCommonData/test/runPrint_cfg.py index dfdebb698dec9..298fd0af59316 100644 --- a/Geometry/CMSCommonData/test/runPrint_cfg.py +++ b/Geometry/CMSCommonData/test/runPrint_cfg.py @@ -6,18 +6,8 @@ process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), - categories = cms.untracked.vstring('FwkJob'), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), cout = cms.untracked.PSet( threshold = cms.untracked.string('INFO') - ), - FrameworkJobReport = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ) ) ) From fb4c87a0050a42c874955e8d416e922b48c5ce69 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 12:10:26 -0500 Subject: [PATCH 691/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- .../Configuration/python/customizeHLTforCMSSW.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index a39bf91851e18..161a1fd7920d5 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -203,10 +203,22 @@ def customiseFor2018Input(process): process = synchronizeHCALHLTofflineRun3on2018data(process) +def customizeToDropObsoleteMessageLoggerOptions(process): + if 'MessageLogger' in process.__dict__: + if not hasattr(process.MessageLogger, "fwkJobReports"): + return process + for config in process.MessageLogger.fwkJobReports.value(): + if hasattr(process.MessageLogger, config): + delattr(process.MessageLogger, config) + delattr(process.MessageLogger, "fwkJobReports") + return process + + # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): # add call to action function in proper order: newest last! # process = customiseFor12718(process) + process = customizeToDropObsoleteMessageLoggerOptions(process) return process From 4261f97a125ecefac1995afa7d85b6150b392943 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 12:19:22 -0500 Subject: [PATCH 692/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- IOMC/Input/test/testWriter_cfg.py | 1 - 1 file changed, 1 deletion(-) diff --git a/IOMC/Input/test/testWriter_cfg.py b/IOMC/Input/test/testWriter_cfg.py index 5c6d06ad6fe44..f9c593b44ad49 100644 --- a/IOMC/Input/test/testWriter_cfg.py +++ b/IOMC/Input/test/testWriter_cfg.py @@ -18,7 +18,6 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(5)) From 536686c4b16f16ebe0a570152dbd63d58f2ad76c Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 12:23:50 -0500 Subject: [PATCH 693/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- .../Geometry/test/print_geominfo_cfg.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/SLHCUpgradeSimulations/Geometry/test/print_geominfo_cfg.py b/SLHCUpgradeSimulations/Geometry/test/print_geominfo_cfg.py index dceaa7a7f1503..9312e8a1c6bad 100644 --- a/SLHCUpgradeSimulations/Geometry/test/print_geominfo_cfg.py +++ b/SLHCUpgradeSimulations/Geometry/test/print_geominfo_cfg.py @@ -19,18 +19,9 @@ process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), - categories = cms.untracked.vstring('FwkJob'), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), + categories = cms.untracked.vstring(), cout = cms.untracked.PSet( threshold = cms.untracked.string('INFO') - ), - FrameworkJobReport = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ) ) ) From 26708daf45dd453211901b1a5bc26177791c2e5e Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 12:45:49 -0500 Subject: [PATCH 694/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. The category 'FwkJob' also is not used anywhere in CMSSW (it was originally where the job report would send messages to the MessageLogger). --- .../GlobalDigis/python/MessageLogger_cfi.py | 10 +--------- .../GlobalHits/python/MessageLogger_cfi.py | 10 +--------- .../GlobalRecHits/python/MessageLogger_cfi.py | 10 +--------- .../ElectronBenchmarkGeneric/benchmark_cfg.py | 20 ++----------------- 4 files changed, 5 insertions(+), 45 deletions(-) diff --git a/Validation/GlobalDigis/python/MessageLogger_cfi.py b/Validation/GlobalDigis/python/MessageLogger_cfi.py index ca16458ebafee..8d330f0a2cbb1 100644 --- a/Validation/GlobalDigis/python/MessageLogger_cfi.py +++ b/Validation/GlobalDigis/python/MessageLogger_cfi.py @@ -822,15 +822,7 @@ limit = cms.untracked.int32(10000000) ) ), - FrameworkJobReport = cms.untracked.PSet( - #untracked PSet default = - # { untracked int32 limit = 0 } - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000) - ) - ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), - categories = cms.untracked.vstring('FwkJob', + categories = cms.untracked.vstring( 'GlobalHitsProducer_GlobalHitsProducer', 'GlobalHitsProducer_endJob', 'GlobalHitsProducer_produce', diff --git a/Validation/GlobalHits/python/MessageLogger_cfi.py b/Validation/GlobalHits/python/MessageLogger_cfi.py index a4087d623091b..3a8b8c579f597 100644 --- a/Validation/GlobalHits/python/MessageLogger_cfi.py +++ b/Validation/GlobalHits/python/MessageLogger_cfi.py @@ -822,15 +822,7 @@ limit = cms.untracked.int32(10000000) ) ), - FrameworkJobReport = cms.untracked.PSet( - #untracked PSet default = - # { untracked int32 limit = 0 } - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000) - ) - ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), - categories = cms.untracked.vstring('FwkJob', + categories = cms.untracked.vstring( 'GlobalHitsProducer_GlobalHitsProducer', 'GlobalHitsProducer_endJob', 'GlobalHitsProducer_produce', diff --git a/Validation/GlobalRecHits/python/MessageLogger_cfi.py b/Validation/GlobalRecHits/python/MessageLogger_cfi.py index a4087d623091b..3a8b8c579f597 100644 --- a/Validation/GlobalRecHits/python/MessageLogger_cfi.py +++ b/Validation/GlobalRecHits/python/MessageLogger_cfi.py @@ -822,15 +822,7 @@ limit = cms.untracked.int32(10000000) ) ), - FrameworkJobReport = cms.untracked.PSet( - #untracked PSet default = - # { untracked int32 limit = 0 } - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000) - ) - ), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport'), - categories = cms.untracked.vstring('FwkJob', + categories = cms.untracked.vstring( 'GlobalHitsProducer_GlobalHitsProducer', 'GlobalHitsProducer_endJob', 'GlobalHitsProducer_produce', diff --git a/Validation/RecoParticleFlow/Benchmarks/ElectronBenchmarkGeneric/benchmark_cfg.py b/Validation/RecoParticleFlow/Benchmarks/ElectronBenchmarkGeneric/benchmark_cfg.py index 370054bd96f8d..79bfa45e77831 100644 --- a/Validation/RecoParticleFlow/Benchmarks/ElectronBenchmarkGeneric/benchmark_cfg.py +++ b/Validation/RecoParticleFlow/Benchmarks/ElectronBenchmarkGeneric/benchmark_cfg.py @@ -110,10 +110,6 @@ limit = cms.untracked.int32(0) ), threshold = cms.untracked.string('INFO'), - FwkJob = cms.untracked.PSet( - optionalPSet = cms.untracked.bool(True), - limit = cms.untracked.int32(0) - ), FwkSummary = cms.untracked.PSet( reportEvery = cms.untracked.int32(1), optionalPSet = cms.untracked.bool(True), @@ -121,16 +117,6 @@ ), optionalPSet = cms.untracked.bool(True) ), - FrameworkJobReport = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - optionalPSet = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( - optionalPSet = cms.untracked.bool(True), - limit = cms.untracked.int32(10000000) - ) - ), suppressWarning = cms.untracked.vstring(), errors = cms.untracked.PSet( placeholder = cms.untracked.bool(True) @@ -150,11 +136,9 @@ ), placeholder = cms.untracked.bool(True) ), - categories = cms.untracked.vstring('FwkJob', - 'FwkReport', + categories = cms.untracked.vstring('FwkReport', 'FwkSummary', - 'Root_NoDictionary'), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport') + 'Root_NoDictionary') ) From d7cec9eb41ec635e29670a6838f4b5983d0d16a2 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Tue, 20 Oct 2020 03:36:36 +0900 Subject: [PATCH 695/778] added more sanity checks --- DataFormats/GEMDigi/interface/AMC13Event.h | 4 + .../GEMRawToDigi/interface/GEMRawToDigi.h | 4 + .../plugins/GEMDigiToRawModule.cc | 65 +++++++-------- .../plugins/GEMRawToDigiModule.cc | 80 ++++++++++++++----- EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc | 23 ++++-- 5 files changed, 117 insertions(+), 59 deletions(-) diff --git a/DataFormats/GEMDigi/interface/AMC13Event.h b/DataFormats/GEMDigi/interface/AMC13Event.h index 3f05e675acc48..3e44aba5b28be 100644 --- a/DataFormats/GEMDigi/interface/AMC13Event.h +++ b/DataFormats/GEMDigi/interface/AMC13Event.h @@ -82,6 +82,10 @@ namespace gem { void setCDFTrailer(uint64_t word) { cdft_ = word; } void setCDFTrailer(uint32_t EvtLength); uint64_t getCDFTrailer() const { return cdft_; } + uint32_t fragmentLength() const { return CDFTrailer{cdft_}.evtLength; } + uint16_t crc() const { return CDFTrailer{cdft_}.crcCDF; } + uint8_t evtStatus() const { return CDFTrailer{cdft_}.evtStat; } + uint8_t ttsBits() const { return CDFTrailer{cdft_}.tts; } int bxId() const { return (int8_t)CDFHeader{cdfh_}.bxId; } uint32_t lv1Id() const { return CDFHeader{cdfh_}.lv1Id; } diff --git a/EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h b/EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h index 4aa9e5d10019d..f5997127a4756 100644 --- a/EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h +++ b/EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h @@ -9,7 +9,11 @@ class GEMRawToDigi { public: std::unique_ptr<gem::AMC13Event> convertWordToAMC13Event(const uint64_t* word); + bool vfatError() const { return vfatError_; } + bool amcError() const { return amcError_; } private: + bool vfatError_; + bool amcError_; }; #endif diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 62a5ea4f1910f..32d8035987e33 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -52,9 +52,9 @@ DEFINE_FWK_MODULE(GEMDigiToRawModule); using namespace gem; GEMDigiToRawModule::GEMDigiToRawModule(const edm::ParameterSet& pset) - : event_type_(pset.getParameter<int>("eventType")), - digi_token(consumes<GEMDigiCollection>(pset.getParameter<edm::InputTag>("gemDigi"))), - useDBEMap_(pset.getParameter<bool>("useDBEMap")) { + : event_type_(pset.getParameter<int>("eventType")), + digi_token(consumes<GEMDigiCollection>(pset.getParameter<edm::InputTag>("gemDigi"))), + useDBEMap_(pset.getParameter<bool>("useDBEMap")) { produces<FEDRawDataCollection>(); if (useDBEMap_) { gemEMapToken_ = esConsumes<GEMeMap, GEMeMapRcd, edm::Transition::BeginRun>(); @@ -100,9 +100,11 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve std::vector<std::unique_ptr<AMC13Event>> amc13Events; amc13Events.reserve(FEDNumbering::MAXGEMFEDID - FEDNumbering::MINGEMFEDID + 1); - uint32_t LV1_id = iEvent.id().event(); - uint16_t BX_id = iEvent.bunchCrossing(); - uint32_t OrN = iEvent.orbitNumber(); + int LV1_id = iEvent.id().event(); + int BX_id = iEvent.bunchCrossing(); + int OrN = iEvent.orbitNumber(); + LogDebug("GEMDigiToRawModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() + << " orbitNumber:" << iEvent.orbitNumber(); // making map of bx GEMDigiCollection // each bx will be saved as new AMC13Event, so GEMDigiCollection needs to be split into bx @@ -130,6 +132,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve for (uint8_t amcNum = 0; amcNum < GEMeMap::maxAMCs_; ++amcNum) { uint32_t amcSize = 0; std::unique_ptr<AMCdata> amcData = std::make_unique<AMCdata>(); + amcData->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); for (uint8_t gebId = 0; gebId < GEMeMap::maxGEBs_; ++gebId) { std::unique_ptr<GEBdata> gebData = std::make_unique<GEBdata>(); @@ -144,14 +147,14 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve GEMROMapping::vfatDC vfat_dc = gemROMap->vfatPos(vfat_ec); GEMDetId gemId = vfat_dc.detId; uint16_t vfatId = vfat_ec.vfatAdd; - + for (auto const& gemBx : gemBxMap) { - int bc = BX_id + gemBx.first; - - bool hasDigi = false; + int bc = amcData->bx() + gemBx.first; + + bool hasDigi = false; uint64_t lsData = 0; ///<channels from 1to64 uint64_t msData = 0; ///<channels from 65to128 - + GEMDigiCollection inBxGemDigis = gemBx.second; const GEMDigiCollection::Range& range = inBxGemDigis.get(gemId); for (GEMDigiCollection::const_iterator digiIt = range.first; digiIt != range.second; ++digiIt) { @@ -173,9 +176,9 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve msData |= 1UL << (chMap.chNum - 64); LogDebug("GEMDigiToRawModule") - << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) - << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId - << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); + << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) + << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId + << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); } if (!hasDigi) @@ -183,36 +186,35 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // only make vfat with hits amcSize += 3; auto vfatData = std::make_unique<VFATdata>(geb_dc.vfatVer, bc, 0, vfatId, lsData, msData); + LogDebug("GEMDigiToRawModule") + << "VFAT bx:" << bc << " bx:" << int(vfatData->bc()) << " orbitNumber:" << iEvent.orbitNumber(); gebData->addVFAT(*vfatData); } - - } // end of vfats in GEB + + } // end of vfats in GEB if (!gebData->vFATs()->empty()) { amcSize += 2; gebData->setChamberHeader(gebData->vFATs()->size() * 3, gebId); gebData->setChamberTrailer(LV1_id, BX_id, gebData->vFATs()->size() * 3); amcData->addGEB(*gebData); - } - } // end of GEB loop + } + } // end of GEB loop if (!amcData->gebs()->empty()) { amcSize += 5; amcData->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); amcData->setAMCheader2(amcNum, OrN, 1); amcData->setGEMeventHeader(amcData->gebs()->size(), 0); - LogDebug("GEMDigiToRawModule") << "davCnt: "<< int(amcData->davCnt()); + LogDebug("GEMDigiToRawModule") << "davCnt: " << int(amcData->davCnt()); amc13Event->addAMCpayload(*amcData); // AMC header in AMC13Event - uint8_t Blk_No = 0; - uint8_t AMC_No = 0; - uint16_t BoardID = 0; - amc13Event->addAMCheader(amcSize, Blk_No, AMC_No, BoardID); - amc13EvtLength += amcSize + 1; // AMC data size + AMC header size + amc13Event->addAMCheader(amcSize, 0, amcNum, 0); + amc13EvtLength += amcSize + 1; // AMC data size + AMC header size } - } // end of AMC loop - + } // end of AMC loop + if (!amc13Event->getAMCpayloads()->empty()) { // CDFHeader amc13Event->setCDFHeader(event_type_, LV1_id, BX_id, fedId); @@ -225,14 +227,13 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve LogDebug("GEMDigiToRawModule") << " EvtLength: " << int(EvtLength); amc13Event->setCDFTrailer(EvtLength); - LogDebug("GEMDigiToRawModule") << "getAMCpayloads: "<< amc13Event->getAMCpayloads()->size(); - LogDebug("GEMDigiToRawModule") << " nAMC: "<< int(amc13Event->nAMC()) - << " LV1_id: "<< int(LV1_id) - << " BX_id: "<< int(BX_id); - + LogDebug("GEMDigiToRawModule") << "getAMCpayloads: " << amc13Event->getAMCpayloads()->size(); + LogDebug("GEMDigiToRawModule") << " nAMC: " << int(amc13Event->nAMC()) << " LV1_id: " << int(LV1_id) + << " BX_id: " << int(BX_id); + amc13Events.emplace_back(std::move(amc13Event)); } // finished making amc13Event data - }// end of FED loop + } // end of FED loop // read out amc13Events into fedRawData for (const auto& amc13e : amc13Events) { diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index 6522d4dc163f2..c9ef35651d35c 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -10,6 +10,7 @@ #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/FEDRawData/interface/FEDNumbering.h" #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" +#include "DataFormats/FEDRawData/interface/FEDTrailer.h" #include "DataFormats/GEMDigi/interface/AMC13Event.h" #include "DataFormats/GEMDigi/interface/GEMAMC13EventCollection.h" #include "DataFormats/GEMDigi/interface/GEMAMCdataCollection.h" @@ -57,10 +58,10 @@ DEFINE_FWK_MODULE(GEMRawToDigiModule); using namespace gem; GEMRawToDigiModule::GEMRawToDigiModule(const edm::ParameterSet& pset) - : fed_token(consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("InputLabel"))), - useDBEMap_(pset.getParameter<bool>("useDBEMap")), - unPackStatusDigis_(pset.getParameter<bool>("unPackStatusDigis")), - gemRawToDigi_(std::make_unique<GEMRawToDigi>()) { + : fed_token(consumes<FEDRawDataCollection>(pset.getParameter<edm::InputTag>("InputLabel"))), + useDBEMap_(pset.getParameter<bool>("useDBEMap")), + unPackStatusDigis_(pset.getParameter<bool>("unPackStatusDigis")), + gemRawToDigi_(std::make_unique<GEMRawToDigi>()) { produces<GEMDigiCollection>(); if (unPackStatusDigis_) { produces<GEMVfatStatusDigiCollection>("vfatStatus"); @@ -118,28 +119,66 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve if (nWords < 5) continue; - + + // trailer checks + FEDTrailer trailer(fedData.data() + fedData.size() - FEDTrailer::length); + if (not trailer.check()) { + edm::LogWarning("GEMRawToDigiModule") << " FED trailer check failed\n"; + } + if (trailer.fragmentLength() * sizeof(uint64_t) != fedData.size()) { + edm::LogWarning("GEMRawToDigiModule") << " FED fragment size mismatch: " << trailer.fragmentLength() + << " (fragment length) vs " << nWords << " (data size) words\n"; + } + const unsigned char* data = fedData.data(); const uint64_t* word = reinterpret_cast<const uint64_t*>(data); auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); - if (amc13Event == nullptr){ - LogDebug("GEMRawToDigiModule") << "amc13Event does not exists"; + if (amc13Event == nullptr) { + LogDebug("GEMRawToDigiModule") << "amc13Event FAILED to unpack"; continue; } - LogDebug("GEMRawToDigiModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() << " orbitNumber:" << iEvent.orbitNumber(); - LogDebug("GEMRawToDigiModule") << "AMC13 bx:" << amc13Event->bxId() << " lv1Id:" << int(amc13Event->lv1Id()) << " orbitNumber:" << amc13Event->orbitNumber(); - + if (gemRawToDigi_->amcError() || gemRawToDigi_->vfatError()) { + edm::LogWarning("GEMRawToDigiModule") + << " amcError:" << gemRawToDigi_->amcError() << " vfatError:" << gemRawToDigi_->vfatError(); + } + // compare trailers + if (amc13Event->fragmentLength() != trailer.fragmentLength()) { + edm::LogWarning("GEMRawToDigiModule") << " fragmentLength miss match"; + } + if (amc13Event->crc() != trailer.crc()) { + edm::LogWarning("GEMRawToDigiModule") << " crc miss match"; + } + if (amc13Event->evtStatus() != trailer.evtStatus()) { + edm::LogWarning("GEMRawToDigiModule") << " evtStatus miss match"; + } + if (amc13Event->ttsBits() != trailer.ttsBits()) { + edm::LogWarning("GEMRawToDigiModule") << " ttsBits miss match"; + } + + LogDebug("GEMRawToDigiModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() + << " orbitNumber:" << iEvent.orbitNumber(); + LogDebug("GEMRawToDigiModule") << "AMC13 bx:" << amc13Event->bxId() << " lv1Id:" << int(amc13Event->lv1Id()) + << " orbitNumber:" << amc13Event->orbitNumber(); + // Read AMC data for (auto amcData : *(amc13Event->getAMCpayloads())) { uint16_t amcBx = amcData.bx(); uint8_t amcNum = amcData.amcNum(); - LogDebug("GEMRawToDigiModule") << "AMC bx:" << int(amcData.bx()) << " lv1Id:" << int(amcData.l1A()) << " orbitNumber:" << int(amcData.orbitNum()); + LogDebug("GEMRawToDigiModule") << "AMC no.:" << int(amcData.amcNum()) << " bx:" << int(amcData.bx()) + << " lv1Id:" << int(amcData.l1A()) << " orbitNumber:" << int(amcData.orbitNum()); // Read GEB data for (auto gebData : *amcData.gebs()) { uint8_t gebId = gebData.inputID(); GEMROMapping::chamEC geb_ec = {fedId, amcNum, gebId}; + + // check if Chamber exists. + if (!gemROMap->isValidChamber(geb_ec)) { + edm::LogWarning("GEMRawToDigiModule") << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId); + continue; + } + GEMROMapping::chamDC geb_dc = gemROMap->chamberPos(geb_ec); GEMDetId gemChId = geb_dc.detId; LogDebug("GEMRawToDigiModule") << "GEB bx:" << int(gebData.bcOH()) << " lv1Id:" << int(gebData.ecOH()); @@ -153,18 +192,19 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // check if ChipID exists. if (!gemROMap->isValidChipID(vfat_ec)) { edm::LogWarning("GEMRawToDigiModule") - << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId) << " vfatId " << int(vfatId) - << " vfat Pos " << int(vfatData.position()); + << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId) << " vfatId " << int(vfatId) + << " vfat Pos " << int(vfatData.position()); continue; } + // check vfat data if (vfatData.quality()) { edm::LogWarning("GEMRawToDigiModule") - << "Quality " << int(vfatData.quality()) << " b1010 " << int(vfatData.b1010()) << " b1100 " - << int(vfatData.b1100()) << " b1110 " << int(vfatData.b1110()); + << "Quality " << int(vfatData.quality()) << " b1010 " << int(vfatData.b1010()) << " b1100 " + << int(vfatData.b1100()) << " b1110 " << int(vfatData.b1110()); if (vfatData.crc() != vfatData.checkCRC()) { edm::LogWarning("GEMRawToDigiModule") - << "DIFFERENT CRC :" << vfatData.crc() << " " << vfatData.checkCRC(); + << "DIFFERENT CRC :" << vfatData.crc() << " " << vfatData.checkCRC(); } } @@ -172,7 +212,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve vfatData.setPhi(vfat_dc.localPhi); GEMDetId gemId = vfat_dc.detId; - int bx = vfatData.bc()-amcBx; + int bx = vfatData.bc() - amcBx; for (int chan = 0; chan < VFATdata::nChannels; ++chan) { uint8_t chan0xf = 0; @@ -194,9 +234,9 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve LogDebug("GEMRawToDigiModule") << "VFATbx:" << int(vfatData.bc()) << " lv1Id:" << int(vfatData.ec()); LogDebug("GEMRawToDigiModule") - << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) << " vfat:" << vfat_dc.localPhi - << ",type: " << vfat_dc.vfatType << " id:" << gemId << " ch:" << chMap.chNum << " st:" << digi.strip() - << " bx:" << digi.bx(); + << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) << " vfat:" << vfat_dc.localPhi + << ",type: " << vfat_dc.vfatType << " id:" << gemId << " ch:" << chMap.chNum << " st:" << digi.strip() + << " bx:" << digi.bx(); outGEMDigis.get()->insertDigi(gemId, digi); diff --git a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc index 95344cce2aae1..df6731384b191 100644 --- a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc +++ b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc @@ -7,13 +7,16 @@ using namespace gem; std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t* word) { + vfatError_ = false; + amcError_ = false; + auto amc13Event = std::make_unique<AMC13Event>(); amc13Event->setCDFHeader(*word); amc13Event->setAMC13Header(*(++word)); // Readout out AMC headers - LogDebug("GEMRawToDigi") << "nAMC: "<< int(amc13Event->nAMC()); + LogDebug("GEMRawToDigi") << "nAMC: " << int(amc13Event->nAMC()); for (uint8_t i = 0; i < amc13Event->nAMC(); ++i) amc13Event->addAMCheader(*(++word)); @@ -24,13 +27,13 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t amcData.setAMCheader2(*(++word)); amcData.setGEMeventHeader(*(++word)); - LogDebug("GEMRawToDigi") << "davCnt: "<< int(amcData.davCnt()); + LogDebug("GEMRawToDigi") << "davCnt: " << int(amcData.davCnt()); // Fill GEB for (uint8_t j = 0; j < amcData.davCnt(); ++j) { auto gebData = GEBdata(); gebData.setChamberHeader(*(++word)); - LogDebug("GEMRawToDigi") << "vfatWordCnt: "<< int(gebData.vfatWordCnt()); + LogDebug("GEMRawToDigi") << "vfatWordCnt: " << int(gebData.vfatWordCnt()); // Fill vfat for (uint16_t k = 0; k < gebData.vfatWordCnt() / 3; k++) { auto vfatData = VFATdata(); @@ -42,16 +45,22 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t } // end of vfat loop gebData.setChamberTrailer(*(++word)); - if (gebData.vfatWordCnt() != gebData.vfatWordCntT()) - return nullptr; + if (gebData.vfatWordCnt() != gebData.vfatWordCntT()) { + vfatError_ = true; + edm::LogWarning("GEMRawToDigi") << "VFAT word count miss match between header and trailer"; + } amcData.addGEB(gebData); } // end of geb loop amcData.setGEMeventTrailer(*(++word)); amcData.setAMCTrailer(*(++word)); - if (amc13Event->getAMCsize(i) != amcData.dataLength()) - return nullptr; + LogDebug("GEMRawToDigi") << "amcData.dataLength(): " << int(amcData.dataLength()) + << " amc13Event->getAMCsize(i): " << int(amc13Event->getAMCsize(i)); + if (amc13Event->getAMCsize(i) != amcData.dataLength()) { + amcError_ = true; + edm::LogWarning("GEMRawToDigi") << "AMC size miss match"; + } amc13Event->addAMCpayload(amcData); } // end of amc loop From fe75e759e63cd121e504f65e8fb0ccac104001d2 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 13:59:20 -0500 Subject: [PATCH 696/778] Removed unused fwkJobReports from MessageLogger The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. Removed 'FwkJob' category as it is no longer used either. --- .../test/L1GtEmulTrigReport_cfg.py | 1 - .../L1GtConfigProducers/test/L1GtTester_cfg.py | 1 - .../test/L1GtTriggerMenuTester_cfg.py | 1 - .../L1Analyzer/test/BscTrigger_cfg.py | 16 ++-------------- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/L1Trigger/GlobalTriggerAnalyzer/test/L1GtEmulTrigReport_cfg.py b/L1Trigger/GlobalTriggerAnalyzer/test/L1GtEmulTrigReport_cfg.py index cdeb561392336..1c17583ea64f1 100644 --- a/L1Trigger/GlobalTriggerAnalyzer/test/L1GtEmulTrigReport_cfg.py +++ b/L1Trigger/GlobalTriggerAnalyzer/test/L1GtEmulTrigReport_cfg.py @@ -221,7 +221,6 @@ 'L1GtEmulTrigReport' ] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] process.MessageLogger.L1GtEmulTrigReport_errors = cms.untracked.PSet( threshold = cms.untracked.string('ERROR'), diff --git a/L1TriggerConfig/L1GtConfigProducers/test/L1GtTester_cfg.py b/L1TriggerConfig/L1GtConfigProducers/test/L1GtTester_cfg.py index 425c71a6f0714..8ed6a6774c397 100644 --- a/L1TriggerConfig/L1GtConfigProducers/test/L1GtTester_cfg.py +++ b/L1TriggerConfig/L1GtConfigProducers/test/L1GtTester_cfg.py @@ -135,7 +135,6 @@ 'L1GtTester_debug' ] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] process.MessageLogger.L1GtTester_errors = cms.untracked.PSet( threshold = cms.untracked.string('ERROR'), diff --git a/L1TriggerConfig/L1GtConfigProducers/test/L1GtTriggerMenuTester_cfg.py b/L1TriggerConfig/L1GtConfigProducers/test/L1GtTriggerMenuTester_cfg.py index 3de96c398de17..7703a055b38d3 100644 --- a/L1TriggerConfig/L1GtConfigProducers/test/L1GtTriggerMenuTester_cfg.py +++ b/L1TriggerConfig/L1GtConfigProducers/test/L1GtTriggerMenuTester_cfg.py @@ -119,7 +119,6 @@ 'L1GtTriggerMenuTester_debug' ] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] process.MessageLogger.L1GtTriggerMenuTester_errors = cms.untracked.PSet( threshold = cms.untracked.string('ERROR'), diff --git a/L1TriggerOffline/L1Analyzer/test/BscTrigger_cfg.py b/L1TriggerOffline/L1Analyzer/test/BscTrigger_cfg.py index 3297692a1f384..60d3a2c40e41d 100644 --- a/L1TriggerOffline/L1Analyzer/test/BscTrigger_cfg.py +++ b/L1TriggerOffline/L1Analyzer/test/BscTrigger_cfg.py @@ -49,23 +49,12 @@ Root_NoDictionary = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), FwkSummary = cms.untracked.PSet( reportEvery = cms.untracked.int32(1), limit = cms.untracked.int32(10000000) ), threshold = cms.untracked.string('DEBUG') ), - FrameworkJobReport = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000) - ) - ), suppressWarning = cms.untracked.vstring(), statistics = cms.untracked.vstring('cerr_stats'), cerr_stats = cms.untracked.PSet( @@ -85,11 +74,10 @@ 'cout', 'cerr'), debugModules = cms.untracked.vstring('bscTrigger'), - categories = cms.untracked.vstring('BscSim','FwkJob', + categories = cms.untracked.vstring('BscSim', 'FwkReport', 'FwkSummary', - 'Root_NoDictionary'), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport') + 'Root_NoDictionary') ) # import of standard configurations process.load('Configuration/StandardSequences/Services_cff') From ff40bab0807069026917f2b82f528e57b1d3d0da Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Tue, 20 Oct 2020 09:43:13 +0900 Subject: [PATCH 697/778] typo --- EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc | 8 ++++---- EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index c9ef35651d35c..b41b7cb7e5d6f 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -144,16 +144,16 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } // compare trailers if (amc13Event->fragmentLength() != trailer.fragmentLength()) { - edm::LogWarning("GEMRawToDigiModule") << " fragmentLength miss match"; + edm::LogWarning("GEMRawToDigiModule") << " fragmentLength mismatch"; } if (amc13Event->crc() != trailer.crc()) { - edm::LogWarning("GEMRawToDigiModule") << " crc miss match"; + edm::LogWarning("GEMRawToDigiModule") << " crc mismatch"; } if (amc13Event->evtStatus() != trailer.evtStatus()) { - edm::LogWarning("GEMRawToDigiModule") << " evtStatus miss match"; + edm::LogWarning("GEMRawToDigiModule") << " evtStatus mismatch"; } if (amc13Event->ttsBits() != trailer.ttsBits()) { - edm::LogWarning("GEMRawToDigiModule") << " ttsBits miss match"; + edm::LogWarning("GEMRawToDigiModule") << " ttsBits mismatch"; } LogDebug("GEMRawToDigiModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() diff --git a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc index df6731384b191..623cfa82494d3 100644 --- a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc +++ b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc @@ -47,7 +47,8 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t gebData.setChamberTrailer(*(++word)); if (gebData.vfatWordCnt() != gebData.vfatWordCntT()) { vfatError_ = true; - edm::LogWarning("GEMRawToDigi") << "VFAT word count miss match between header and trailer"; + edm::LogWarning("GEMRawToDigi") << "VFAT word count mismatch between header:" << gebData.vfatWordCnt() + << " and trailer:" << gebData.vfatWordCntT(); } amcData.addGEB(gebData); @@ -55,11 +56,10 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t amcData.setGEMeventTrailer(*(++word)); amcData.setAMCTrailer(*(++word)); - LogDebug("GEMRawToDigi") << "amcData.dataLength(): " << int(amcData.dataLength()) - << " amc13Event->getAMCsize(i): " << int(amc13Event->getAMCsize(i)); if (amc13Event->getAMCsize(i) != amcData.dataLength()) { amcError_ = true; - edm::LogWarning("GEMRawToDigi") << "AMC size miss match"; + edm::LogWarning("GEMRawToDigi") << "AMC size mismatch - AMC13:" << int(amc13Event->getAMCsize(i)) + << " AMC:" << int(amcData.dataLength()); } amc13Event->addAMCpayload(amcData); From 6d3614d2551a22c51c90bb082f7e7a5d822cdf86 Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Tue, 20 Oct 2020 09:36:11 +0200 Subject: [PATCH 698/778] Fix warning about "type qualifier on return type is meaningless" --- CondFormats/HcalObjects/interface/HcalCondObjectContainer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CondFormats/HcalObjects/interface/HcalCondObjectContainer.h b/CondFormats/HcalObjects/interface/HcalCondObjectContainer.h index 87654e35917a9..59ef2a5480089 100644 --- a/CondFormats/HcalObjects/interface/HcalCondObjectContainer.h +++ b/CondFormats/HcalObjects/interface/HcalCondObjectContainer.h @@ -64,7 +64,7 @@ class HcalCondObjectContainer : public HcalCondObjectContainerBase { const Item* getValues(DetId fId, bool throwOnFail = true) const; // does the object exist ? - const bool exists(DetId fId) const; + bool exists(DetId fId) const; // set the object/fill it in: bool addValues(const Item& myItem); @@ -220,7 +220,7 @@ const Item* HcalCondObjectContainer<Item>::getValues(DetId fId, bool throwOnFail } template <class Item> -const bool HcalCondObjectContainer<Item>::exists(DetId fId) const { +bool HcalCondObjectContainer<Item>::exists(DetId fId) const { const Item* cell = getValues(fId, false); if (cell) { From c09d6ee91a14c8f8538ae4fe0d5577fdd9fb383a Mon Sep 17 00:00:00 2001 From: Ianna Osborne <yana@cmsdev20.cern.ch> Date: Sat, 10 Oct 2020 21:45:59 +0200 Subject: [PATCH 699/778] replace tbb containers with std ones --- DetectorDescription/DDCMS/interface/DDParsingContext.h | 1 + 1 file changed, 1 insertion(+) diff --git a/DetectorDescription/DDCMS/interface/DDParsingContext.h b/DetectorDescription/DDCMS/interface/DDParsingContext.h index 86a9fff85513d..d885a9efe36cd 100644 --- a/DetectorDescription/DDCMS/interface/DDParsingContext.h +++ b/DetectorDescription/DDCMS/interface/DDParsingContext.h @@ -66,6 +66,7 @@ namespace cms { bool debug_specpars = false; dd4hep::Detector& description; + std::unordered_map<std::string, dd4hep::Assembly> assemblies; std::unordered_map<std::string, dd4hep::Rotation3D> rotations; std::unordered_map<std::string, dd4hep::Solid> shapes; From 966e1299f6362d90d53664fd082c81e28c5aadb7 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Tue, 13 Oct 2020 16:00:14 +0200 Subject: [PATCH 700/778] final changes to replace tbb with std - requires updated dd4hep --- .../DDCMS/interface/DDFilteredView.h | 4 +- .../DDCMS/plugins/test/DDTestSpecPars.cc | 2 +- .../plugins/test/DDTestSpecParsFilter.cc | 8 +- .../DDCMS/src/DDCompactView.cc | 6 +- .../DDCMS/src/DDFilteredView.cc | 94 ++++++++++++++----- DetectorDescription/DDCMS/test/BuildFile.xml | 8 ++ .../DDCMS/test/Filter.cppunit.cc | 44 +++++++-- 7 files changed, 126 insertions(+), 40 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index f1fe2729262f1..38fc916db11be 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -172,7 +172,7 @@ namespace cms { std::string path = this->path(); for (const auto& specPar : refs) { - for (const auto& part : specPar->paths) { + for (const auto& part : specPar.second->paths) { bool flag(true); std::size_t from = 0; for (auto name : dd4hep::dd::split(part, "/")) { @@ -185,7 +185,7 @@ namespace cms { } } if (flag) { - return specPar->value<std::vector<T>>(key); + return specPar.second->value<std::vector<T>>(key); } } } diff --git a/DetectorDescription/DDCMS/plugins/test/DDTestSpecPars.cc b/DetectorDescription/DDCMS/plugins/test/DDTestSpecPars.cc index 30610a900f5ef..3ed77010eb060 100644 --- a/DetectorDescription/DDCMS/plugins/test/DDTestSpecPars.cc +++ b/DetectorDescription/DDCMS/plugins/test/DDTestSpecPars.cc @@ -32,7 +32,7 @@ void DDTestSpecPars::analyze(const Event&, const EventSetup& iEventSetup) { LogVerbatim("Geometry").log([®istry](auto& log) { log << "DD SpecPar Registry size: " << registry->specpars.size(); for (const auto& i : registry->specpars) { - log << " " << i.first << " == " << std::string({i.second.name.data(), i.second.name.size()}) << " =>"; + log << " " << i.first << " =>"; log << "\npaths:\n"; for (const auto& k : i.second.paths) log << k << ", "; diff --git a/DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc b/DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc index 7ca45d554f9e2..1dba92270a7b8 100644 --- a/DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc +++ b/DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc @@ -52,10 +52,10 @@ void DDTestSpecParsFilter::analyze(const Event&, const EventSetup& iEventSetup) log << "Filtered DD SpecPar Registry size: " << myReg.size() << "\n"; for (const auto& t : myReg) { log << "\nRegExps { "; - for (const auto& ki : t->paths) + for (const auto& ki : t.second->paths) log << ki << " "; log << "};\n "; - for (const auto& kl : t->spars) { + for (const auto& kl : t.second->spars) { log << kl.first << " = "; for (const auto& kil : kl.second) { log << kil << " "; @@ -66,8 +66,8 @@ void DDTestSpecParsFilter::analyze(const Event&, const EventSetup& iEventSetup) }); std::cout << "*** Check names in a path after filtering:\n"; for (auto it : myReg) { - if (it->hasPath("//ME11AlumFrame")) { - std::cout << it->name << "\n"; + if (it.second->hasPath("//ME11AlumFrame")) { + std::cout << it.first << "\n"; } } } diff --git a/DetectorDescription/DDCMS/src/DDCompactView.cc b/DetectorDescription/DDCMS/src/DDCompactView.cc index b434b15e912fc..31c99522e8b64 100644 --- a/DetectorDescription/DDCMS/src/DDCompactView.cc +++ b/DetectorDescription/DDCMS/src/DDCompactView.cc @@ -3,7 +3,7 @@ #include <DD4hep/Filter.h> #include <cmath> -#include "tbb/concurrent_vector.h" +#include <vector> template <> std::vector<int> cms::DDCompactView::getVector<int>(const std::string& key) const { @@ -42,8 +42,8 @@ std::vector<double> const& cms::DDCompactView::get<std::vector<double>>(const st } template <> -tbb::concurrent_vector<double> const& cms::DDCompactView::get<tbb::concurrent_vector<double>>( - const std::string& name, const std::string& key) const { +std::vector<double> const& cms::DDCompactView::get<std::vector<double>>(const std::string& name, + const std::string& key) const { const auto& spec = specpars().specPar(name); if (spec != nullptr) { auto const& nitem = spec->numpars.find(key); diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index c922a9e8c394e..f2be79e5f741d 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -50,11 +50,11 @@ DDFilteredView::DDFilteredView(const DDCompactView& cpv, const cms::DDFilter& fi log << "Filtered by an attribute " << filter.attribute() << "==" << filter.value() << " DD SpecPar Registry size: " << refs_.size() << "\n"; for (const auto& t : refs_) { - log << "\nRegExps { "; - for (const auto& ki : t->paths) + log << "\nSpecPar " << t.first << "\nRegExps { "; + for (const auto& ki : t.second->paths) log << ki << " "; log << "};\n "; - for (const auto& kl : t->spars) { + for (const auto& kl : t.second->spars) { log << kl.first << " = "; for (const auto& kil : kl.second) { log << kil << " "; @@ -164,7 +164,7 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { filters_.shrink_to_fit(); } for (const auto& i : specs) { - for (const auto& j : i->paths) { + for (const auto& j : i.second->paths) { auto const& firstTok = front(j); auto const& filter = find_if(begin(filters_), end(filters_), [&](auto const& f) { auto const& k = find_if(begin(f->skeys), end(f->skeys), [&](auto const& p) { return firstTok == p; }); @@ -175,12 +175,20 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { return false; }); if (filter == end(filters_)) { - filters_.emplace_back(unique_ptr<Filter>( - new Filter{{firstTok}, - {std::regex(std::string("^").append({firstTok.data(), firstTok.size()}).append("$"))}, - nullptr, - nullptr, - i})); + bool isRegex = dd4hep::dd::isRegex(firstTok); + filters_.emplace_back(make_unique<Filter>()); + filters_.back()->isRegex.emplace_back(isRegex); + filters_.back()->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(firstTok)); + if (isRegex) { + filters_.back()->index.emplace_back(filters_.back()->keys.size()); + filters_.back()->keys.emplace_back(std::regex(begin(firstTok), end(firstTok))); + } else { + filters_.back()->index.emplace_back(filters_.back()->skeys.size()); + } + filters_.back()->skeys.emplace_back(firstTok); + filters_.back()->up = nullptr; + filters_.back()->spec = i.second; + // initialize current filter if it's empty if (currentFilter_ == nullptr) { currentFilter_ = filters_.back().get(); @@ -195,26 +203,63 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { return toks.front() == p; }); if (l == end(currentFilter_->skeys)) { + bool isRegex = dd4hep::dd::isRegex(toks[pos]); + currentFilter_->isRegex.emplace_back(isRegex); + currentFilter_->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + if (isRegex) { + currentFilter_->index.emplace_back(currentFilter_->keys.size()); + currentFilter_->keys.emplace_back(std::regex(std::begin(toks[pos]), std::end(toks[pos]))); + } else { + currentFilter_->index.emplace_back(currentFilter_->skeys.size()); + } currentFilter_->skeys.emplace_back(toks[pos]); - currentFilter_->keys.emplace_back( - std::regex(std::string("^").append({toks[pos].data(), toks[pos].size()}).append("$"))); } } else { - currentFilter_->next.reset( - new Filter{{toks[pos]}, - {std::regex(std::string("^").append({toks[pos].data(), toks[pos].size()}).append("$"))}, - nullptr, - currentFilter_, - i}); + auto filter = std::make_unique<Filter>(); + bool isRegex = dd4hep::dd::isRegex(toks[pos]); + filter->isRegex.emplace_back(isRegex); + filter->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + if (isRegex) { + filter->index.emplace_back(filters_.back()->keys.size()); + filter->keys.emplace_back(std::regex(toks[pos].begin(), toks[pos].end())); + } else { + filter->index.emplace_back(filters_.back()->skeys.size()); + } + filter->skeys.emplace_back(toks.front()); + filter->next = nullptr; + filter->up = currentFilter_; + filter->spec = i.second; + + currentFilter_->next = std::move(filter); } } } } } +void print(const Filter* filter) { + edm::LogVerbatim("Geometry").log([&](auto& log) { + for (const auto& it : filter->skeys) { + log << it << ", "; + } + }); +} + void DDFilteredView::printFilter() const { for (const auto& f : filters_) { - f->print(); + edm::LogVerbatim("Geometry").log([&](auto& log) { + for (const auto& it : f->skeys) { + log << it << ", "; + } + if (f->next) { + log << "Next:\n"; + print(&*f->next); + } + if (f->up) { + log << "Up:\n"; + print(f->up); + } + }); } } @@ -664,10 +709,11 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { filter(specParRefs, key); for (auto const& specPar : specParRefs) { - auto pos = find_if( - begin(specPar->paths), end(specPar->paths), [&](auto const& partSelector) { return matchPath(partSelector); }); - if (pos != end(specPar->paths)) { - return specPar; + auto pos = find_if(begin(specPar.second->paths), end(specPar.second->paths), [&](auto const& partSelector) { + return matchPath(partSelector); + }); + if (pos != end(specPar.second->paths)) { + return specPar.second; } } @@ -677,7 +723,7 @@ const DDSpecPar* DDFilteredView::find(const std::string& key) const { void DDFilteredView::filter(DDSpecParRefs& refs, const std::string& key) const { for (auto const& it : registry_->specpars) { if (it.second.hasValue(key) || (it.second.spars.find(key) != end(it.second.spars))) { - refs.emplace_back(&it.second); + refs.emplace_back(it.first, &it.second); } } } diff --git a/DetectorDescription/DDCMS/test/BuildFile.xml b/DetectorDescription/DDCMS/test/BuildFile.xml index 3a55304f92426..9e6f6b904bd6b 100644 --- a/DetectorDescription/DDCMS/test/BuildFile.xml +++ b/DetectorDescription/DDCMS/test/BuildFile.xml @@ -2,36 +2,43 @@ <bin name="testDD4hepFilteredView" file="DDFilteredView.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> + <use name="rootgeom"/> </bin> <bin name="testDD4hepFilteredViewFirstChild" file="DDFilteredView.firstChild.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> + <use name="rootgeom"/> </bin> <bin name="testDD4hepFilteredViewLevel" file="DDFilteredView.level.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> + <use name="rootgeom"/> </bin> <bin name="testDD4hepFilteredViewGet" file="DDFilteredView.get.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> + <use name="rootgeom"/> </bin> <bin name="testDD4hepFilteredViewGoTo" file="DDFilteredView.goto.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> + <use name="rootgeom"/> </bin> <bin name="testDD4hepFilteredViewFind" file="DDFilteredView.find.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> + <use name="rootgeom"/> </bin> <bin name="testDD4hepCompactView" file="DDCompactView.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> <use name="dd4hep"/> + <use name="rootgeom"/> </bin> <bin name="testDD4hepFilter" file="Filter.cppunit.cc,testRunner.cpp"> @@ -48,6 +55,7 @@ <bin name="testDD4hepDDSolid" file="DDSolid.cppunit.cc,testRunner.cpp"> <use name="DetectorDescription/DDCMS"/> + <use name="rootgeom"/> </bin> <bin name="testDD4hepDDSolidLegacyShapes" file="DDSolidLegacyShapes.cppunit.cc,testRunner.cpp"> diff --git a/DetectorDescription/DDCMS/test/Filter.cppunit.cc b/DetectorDescription/DDCMS/test/Filter.cppunit.cc index 982d30390999d..29eab71e88d68 100644 --- a/DetectorDescription/DDCMS/test/Filter.cppunit.cc +++ b/DetectorDescription/DDCMS/test/Filter.cppunit.cc @@ -51,8 +51,19 @@ void testFilter::setUp() { return false; }); if (filter == end(filters_)) { - filters_.emplace_back(unique_ptr<Filter>(new Filter{ - {toks.front()}, {std::regex(std::string(toks.front().data(), toks.front().size()))}, nullptr, nullptr})); + bool isRegex = dd4hep::dd::isRegex(toks.front()); + filters_.emplace_back(make_unique<Filter>()); + filters_.back()->isRegex.emplace_back(isRegex); + filters_.back()->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks.front())); + if (isRegex) { + filters_.back()->index.emplace_back(filters_.back()->keys.size()); + filters_.back()->keys.emplace_back(std::regex(std::begin(toks.front()), std::end(toks.front()))); + } else { + filters_.back()->index.emplace_back(filters_.back()->skeys.size()); + } + filters_.back()->skeys.emplace_back(toks.front()); + filters_.back()->up = nullptr; + filters_.back()->spec = nullptr; currentFilter = filters_.back().get(); } // all next levels @@ -62,12 +73,33 @@ void testFilter::setUp() { auto const& l = find_if( begin(currentFilter->skeys), end(currentFilter->skeys), [&](auto const& p) { return toks[pos] == p; }); if (l == end(currentFilter->skeys)) { + bool isRegex = dd4hep::dd::isRegex(toks.front()); + currentFilter->isRegex.emplace_back(isRegex); + currentFilter->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks.front())); + if (isRegex) { + currentFilter->index.emplace_back(currentFilter->keys.size()); + currentFilter->keys.emplace_back(std::regex(std::begin(toks.front()), std::end(toks.front()))); + } else { + currentFilter->index.emplace_back(currentFilter->skeys.size()); + } currentFilter->skeys.emplace_back(toks.front()); - currentFilter->keys.emplace_back(std::regex(std::string(toks.front().data(), toks.front().size()))); } } else { - currentFilter->next.reset(new Filter{ - {toks[pos]}, {std::regex(std::string({toks[pos].data(), toks[pos].size()}))}, nullptr, currentFilter}); + auto filter = std::make_unique<Filter>(); + bool isRegex = dd4hep::dd::isRegex(toks[pos]); + filter->isRegex.emplace_back(isRegex); + filter->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + if (isRegex) { + filter->index.emplace_back(filters_.back()->keys.size()); + filter->keys.emplace_back(std::regex(toks[pos].begin(), toks[pos].end())); + } else { + filter->index.emplace_back(filters_.back()->skeys.size()); + } + filter->skeys.emplace_back(toks.front()); + filter->next = nullptr; + filter->up = currentFilter; + + currentFilter->next = std::move(filter); } } } @@ -75,7 +107,7 @@ void testFilter::setUp() { void testFilter::checkFilter() { string_view name = "MB2P.*"sv; - CPPUNIT_ASSERT(std::regex_match(std::string({name.data(), name.size()}), filters_.front()->keys.front()) == 1); + CPPUNIT_ASSERT(std::regex_match(name.begin(), name.end(), filters_.front()->keys.front()) == 1); CPPUNIT_ASSERT(filters_.front()->up == nullptr); CPPUNIT_ASSERT(filters_.front()->next != nullptr); CPPUNIT_ASSERT(filters_.size() == 1); From 66f87c6f2b5c11d06c1bbfe0493eea24dab2c68d Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Tue, 13 Oct 2020 17:13:00 +0200 Subject: [PATCH 701/778] update to a new API --- .../MTDCommonData/test/DD4hep_TestMTDIdealGeometry.cc | 8 ++++---- .../test/DD4hep_MTDTopologyAnalyzer.cc | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Geometry/MTDCommonData/test/DD4hep_TestMTDIdealGeometry.cc b/Geometry/MTDCommonData/test/DD4hep_TestMTDIdealGeometry.cc index 8cb2e58e43d96..8fac42a0d9199 100644 --- a/Geometry/MTDCommonData/test/DD4hep_TestMTDIdealGeometry.cc +++ b/Geometry/MTDCommonData/test/DD4hep_TestMTDIdealGeometry.cc @@ -121,11 +121,11 @@ void DD4hep_TestMTDIdealGeometry::analyze(const edm::Event& iEvent, const edm::E edm::LogVerbatim("Geometry").log([&specs](auto& log) { log << "Filtered DD SpecPar Registry size: " << specs.size() << "\n"; for (const auto& t : specs) { - log << "\nRegExps { "; - for (const auto& ki : t->paths) + log << "\nSpecPar " << t.first << ":\nRegExps { "; + for (const auto& ki : t.second->paths) log << ki << " "; log << "};\n "; - for (const auto& kl : t->spars) { + for (const auto& kl : t.second->spars) { log << kl.first << " = "; for (const auto& kil : kl.second) { log << kil << " "; @@ -193,7 +193,7 @@ void DD4hep_TestMTDIdealGeometry::analyze(const edm::Event& iEvent, const edm::E bool isSens = false; for (auto const& t : specs) { - for (auto const& it : t->paths) { + for (auto const& it : t.second->paths) { if (dd4hep::dd::compareEqual(fv.name(), dd4hep::dd::realTopName(it))) { isSens = true; break; diff --git a/Geometry/MTDNumberingBuilder/test/DD4hep_MTDTopologyAnalyzer.cc b/Geometry/MTDNumberingBuilder/test/DD4hep_MTDTopologyAnalyzer.cc index 9514140f1a17d..d16aac25d1390 100644 --- a/Geometry/MTDNumberingBuilder/test/DD4hep_MTDTopologyAnalyzer.cc +++ b/Geometry/MTDNumberingBuilder/test/DD4hep_MTDTopologyAnalyzer.cc @@ -112,10 +112,10 @@ void DD4hep_MTDTopologyAnalyzer::analyze(const edm::Event& iEvent, const edm::Ev log << "Filtered DD SpecPar Registry size: " << specs.size() << "\n"; for (const auto& t : specs) { log << "\nRegExps { "; - for (const auto& ki : t->paths) + for (const auto& ki : t.second->paths) log << ki << " "; log << "};\n "; - for (const auto& kl : t->spars) { + for (const auto& kl : t.second->spars) { log << kl.first << " = "; for (const auto& kil : kl.second) { log << kil << " "; @@ -178,7 +178,7 @@ void DD4hep_MTDTopologyAnalyzer::analyze(const edm::Event& iEvent, const edm::Ev bool isSens = false; for (auto const& t : specs) { - for (auto const& it : t->paths) { + for (auto const& it : t.second->paths) { if (dd4hep::dd::compareEqual(fv.name(), dd4hep::dd::realTopName(it))) { isSens = true; break; From 755406f9c2e91cccd8cacc0cf9202436e116f5fc Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Wed, 14 Oct 2020 19:16:57 +0200 Subject: [PATCH 702/778] update to the new dd4hep version --- .../plugins/dd4hep/DDDefinitions2Objects.cc | 302 +++++++++++++++++- .../DDCMS/src/DDFilteredView.cc | 24 +- .../DDCMS/test/Filter.cppunit.cc | 6 +- .../data/dd4hep/cmsExtendedGeometry2021.xml | 2 +- 4 files changed, 309 insertions(+), 25 deletions(-) diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index 8599cb0f3e6a8..e1a4ad5b43c2c 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -29,6 +29,8 @@ #include <unordered_map> #include <utility> +#define EDM_ML_DEBUG + using namespace std; using namespace dd4hep; using namespace cms; @@ -415,6 +417,9 @@ void Converter<DDLConstant>::operator()(xml_h element) const { ns.addConstant(nam, val, typ); res->originalConst[real] = val; } catch (const exception& e) { + +#ifdef EDM_ML_DEBUG + printout(INFO, "DD4CMS", "++ Unresolved constant: %s = %s [%s]. Try to resolve later. [%s]", @@ -422,6 +427,8 @@ void Converter<DDLConstant>::operator()(xml_h element) const { val.c_str(), typ.c_str(), e.what()); +#endif + } return; } @@ -436,8 +443,14 @@ void Converter<DDLConstant>::operator()(xml_h element) const { val[idp] = NAMESPACE_SEP; idx = val.find('[', idx); } + +#ifdef EDM_ML_DEBUG + printout( ns.context()->debug_constants ? ALWAYS : DEBUG, "Constant", "Unresolved: %s -> %s", real.c_str(), val.c_str()); + +#endif + res->originalConst[real] = val; res->unresolvedConst[real] = val; } @@ -457,8 +470,13 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { double atomicWeight = xmat.attr<double>(DD_CMU(atomicWeight)) / (dd4hep::g / dd4hep::mole); TGeoElementTable* tab = mgr.GetElementTable(); int nElem = tab->GetNelements(); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS", "+++ Element table size = %d", nElem); +#endif + if (nElem <= 1) { // Restore the element table DD4hep destroyed. tab->TGeoElementTable::~TGeoElementTable(); new (tab) TGeoElementTable(); @@ -466,6 +484,9 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { } TGeoMixture* mix = new TGeoMixture(nam.c_str(), 1, density); TGeoElement* elt = tab->FindElement(xmat.nameStr().c_str()); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS", "+++ Searching for material %-48s elt_ptr = %ld", @@ -482,10 +503,15 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { density, mix->GetDensity()); +#endif + bool newMatDef = false; if (elt) { // A is Mass of a mole in Geant4 units for atoms with atomic shell + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS", " ROOT definition of %-50s Atomic weight %g, Atomic number %u, Number of nucleons %u", @@ -498,6 +524,8 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { "+++ Compared to XML values: Atomic weight %g, Atomic number %u", atomicWeight, atomicNumber); +#endif + static constexpr double const weightTolerance = 1.0e-6; if (atomicNumber != elt->Z() || (std::abs(atomicWeight - elt->A()) > (weightTolerance * (atomicWeight + elt->A())))) @@ -505,17 +533,29 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { } if (!elt || newMatDef) { - if (newMatDef) + if (newMatDef) { + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS Warning", "+++ Converter<ElementaryMaterial> Different definition of a default element with name:%s [CREATE NEW " "MATERIAL]", matname); - else + +#endif + + } else { + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS Warning", "+++ Converter<ElementaryMaterial> No default element present with name:%s [CREATE NEW MATERIAL]", matname); + +#endif + } elt = new TGeoElement(xmat.nameStr().c_str(), "CMS element", atomicNumber, atomicWeight); } @@ -547,6 +587,8 @@ void Converter<DDLCompositeMaterial>::operator()(xml_h element) const { xml_coll_t composites(xmat, DD_CMU(MaterialFraction)); TGeoMixture* mix = new TGeoMixture(nam.c_str(), composites.size(), density); +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS", "++ Converting material %-48s Density: %8.3f [g/cm3] ROOT: %8.3f [g/cm3]", @@ -554,6 +596,8 @@ void Converter<DDLCompositeMaterial>::operator()(xml_h element) const { density, mix->GetDensity()); +#endif + for (composites.reset(); composites; ++composites) { xml_dim_t xfrac(composites); xml_dim_t xfrac_mat(xfrac.child(DD_CMU(rMaterial))); @@ -568,11 +612,16 @@ void Converter<DDLCompositeMaterial>::operator()(xml_h element) const { continue; } +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS Warning", "+++ Composite material \"%s\" [nor \"%s\"] not present! [delay resolution]", fracname.c_str(), ns.prepend(fracname).c_str()); + +#endif + ns.context()->unresolvedMaterials[nam].emplace_back( cms::DDParsingContext::CompositeMaterial(ns.prepend(fracname), fraction)); } @@ -602,6 +651,9 @@ void Converter<DDLRotation>::operator()(xml_h element) const { double thetaZ = xrot.hasAttr(DD_CMU(thetaZ)) ? ns.attr<double>(xrot, DD_CMU(thetaZ)) : 0e0; double phiZ = xrot.hasAttr(DD_CMU(phiZ)) ? ns.attr<double>(xrot, DD_CMU(phiZ)) : 0e0; Rotation3D rot = makeRotation3D(thetaX, phiX, thetaY, phiY, thetaZ, phiZ); + +#ifdef EDM_ML_DEBUG + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+++ Adding rotation: %-32s: (theta/phi)[rad] X: %6.3f %6.3f Y: %6.3f %6.3f Z: %6.3f %6.3f", @@ -612,6 +664,9 @@ void Converter<DDLRotation>::operator()(xml_h element) const { phiY, thetaZ, phiZ); + +#endif + ns.addRotation(nam, rot); } @@ -628,6 +683,9 @@ void Converter<DDLReflectionRotation>::operator()(xml_h element) const { double phiY = xrot.hasAttr(DD_CMU(phiY)) ? ns.attr<double>(xrot, DD_CMU(phiY)) : 0e0; double thetaZ = xrot.hasAttr(DD_CMU(thetaZ)) ? ns.attr<double>(xrot, DD_CMU(thetaZ)) : 0e0; double phiZ = xrot.hasAttr(DD_CMU(phiZ)) ? ns.attr<double>(xrot, DD_CMU(phiZ)) : 0e0; + +#ifdef EDM_ML_DEBUG + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+++ Adding reflection rotation: %-32s: (theta/phi)[rad] X: %6.3f %6.3f Y: %6.3f %6.3f Z: %6.3f %6.3f", @@ -638,6 +696,9 @@ void Converter<DDLReflectionRotation>::operator()(xml_h element) const { phiY, thetaZ, phiZ); + +#endif + Rotation3D rot = makeRotReflect(thetaX, phiX, thetaY, phiY, thetaZ, phiZ); ns.addRotation(name, rot); } @@ -655,17 +716,26 @@ void Converter<DDLRotationSequence>::operator()(xml_h element) const { string axis = ns.attr<string>(rotations, DD_CMU(axis)); double angle = ns.attr<double>(rotations, _U(angle)); rot = makeRotation3D(rot, axis, angle); + +#ifdef EDM_ML_DEBUG + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+ Adding rotation to: %-29s: (axis/angle)[rad] Axis: %s Angle: %6.3f", nam.c_str(), axis.c_str(), angle); + +#endif + } double xx, xy, xz; double yx, yy, yz; double zx, zy, zz; rot.GetComponents(xx, xy, xz, yx, yy, yz, zx, zy, zz); + +#ifdef EDM_ML_DEBUG + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+++ Adding rotation sequence: %-23s: %6.3f %6.3f %6.3f, %6.3f %6.3f %6.3f, %6.3f %6.3f %6.3f", @@ -679,6 +749,9 @@ void Converter<DDLRotationSequence>::operator()(xml_h element) const { zx, zy, zz); + +#endif + ns.addRotation(nam, rot); } @@ -695,12 +768,18 @@ void Converter<DDLRotationByAxis>::operator()(xml_h element) const { double angle = ns.attr<double>(xrot, _U(angle)); Rotation3D rot; rot = makeRotation3D(rot, axis, angle); + +#ifdef EDM_ML_DEBUG + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+++ Adding rotation: %-32s: (axis/angle)[rad] Axis: %s Angle: %6.3f", ns.prepend(nam).c_str(), axis.c_str(), angle); + +#endif + ns.addRotation(nam, rot); } } @@ -715,7 +794,15 @@ void Converter<DDLLogicalPart>::operator()(xml_h element) const { string volName = e.attr<string>(_U(name)); Solid solid = ns.solid(sol); Material material = ns.material(mat); - Volume volume = ns.addVolume(Volume(volName, solid, material)); + +#ifdef EDM_ML_DEBUG + Volume volume = +#endif + + ns.addVolume(Volume(volName, solid, material)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_volumes ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Volume: %-24s [%s] Shape: %-32s [%s] Material: %-40s [%s]", @@ -726,6 +813,8 @@ void Converter<DDLLogicalPart>::operator()(xml_h element) const { solid.isValid() ? "VALID" : "INVALID", mat.c_str(), material.isValid() ? "VALID" : "INVALID"); + +#endif } /// Helper converter @@ -772,6 +861,9 @@ void Converter<DDLPosPart>::operator()(xml_h element) const { string childName = ns.attr<string>(e.child(DD_CMU(rChild)), _U(name)); Volume parent = ns.volume(parentName, false); Volume child = ns.volume(childName, false); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Parent: %-24s [%s] Child: %-32s [%s] copy:%d", @@ -782,6 +874,8 @@ void Converter<DDLPosPart>::operator()(xml_h element) const { child.isValid() ? "VALID" : "INVALID", copy); +#endif + if (!parent.isValid() && strchr(parentName.c_str(), NAMESPACE_SEP) == nullptr) parentName = ns.prepend(parentName); parent = ns.volume(parentName); @@ -790,6 +884,8 @@ void Converter<DDLPosPart>::operator()(xml_h element) const { childName = ns.prepend(childName); child = ns.volume(childName, false); +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Parent: %-24s [%s] Child: %-32s [%s] copy:%d", @@ -800,6 +896,8 @@ void Converter<DDLPosPart>::operator()(xml_h element) const { child.isValid() ? "VALID" : "INVALID", copy); +#endif + PlacedVolume pv; if (child.isValid()) { Transform3D transform; @@ -863,12 +961,17 @@ void Converter<PartSelector>::operator()(xml_h element) const { xml_dim_t specPar = e.parent(); string specParName = specPar.attr<string>(_U(name)); string path = e.attr<string>(DD_CMU(path)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_specpars ? ALWAYS : DEBUG, "DD4CMS", "+++ PartSelector for %s path: %s", specParName.c_str(), path.c_str()); +#endif + size_t pos = std::string::npos; if ((pos = path.find("//.*:")) != std::string::npos) { path.erase(pos + 2, 3); @@ -892,6 +995,8 @@ void Converter<Parameter>::operator()(xml_h element) const { : (specParSect.hasAttr(_U(eval)) ? specParSect.attr<bool>(_U(eval)) : false); string type = eval ? "number" : "string"; +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_specpars ? ALWAYS : DEBUG, "DD4CMS", "+++ Parameter for %s: %s value %s is a %s", @@ -900,6 +1005,8 @@ void Converter<Parameter>::operator()(xml_h element) const { value.c_str(), type.c_str()); +#endif + size_t idx = value.find('['); if (idx == string::npos || type == "string") { registry.specpars[specParName].spars[name].emplace_back(std::move(value)); @@ -929,7 +1036,7 @@ void Converter<Parameter>::operator()(xml_h element) const { v.replace(idx, idq - idx + 1, rep); } } - registry.specpars[specParName].numpars[name].emplace_back(_toDouble(value)); + registry.specpars[specParName].numpars[name].emplace_back(dd4hep::_toDouble(value)); } template <typename TYPE> @@ -958,6 +1065,8 @@ static void convert_boolean(cms::DDParsingContext* context, xml_h element) { except("DD4CMS", "+++ Failed to create boolean solid %s. Found only %d parts.", nam.c_str(), cnt); } +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ BooleanSolid: %s Left: %-32s Right: %-32s", @@ -965,6 +1074,8 @@ static void convert_boolean(cms::DDParsingContext* context, xml_h element) { ((solids[0].ptr() == nullptr) ? solidName[0].c_str() : solids[0]->GetName()), ((solids[1].ptr() == nullptr) ? solidName[1].c_str() : solids[1]->GetName())); +#endif + if (solids[0].isValid() && solids[1].isValid()) { Transform3D trafo; Converter<DDLTransform3D>(context->description, context, &trafo)(element); @@ -1021,14 +1132,23 @@ void Converter<DDLPolycone>::operator()(xml_h element) const { rmax.emplace_back(ns.attr<double>(zplane, DD_CMU(rMax))); z.emplace_back(ns.attr<double>(zplane, _U(z))); } + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Polycone: startPhi=%10.3f [rad] deltaPhi=%10.3f [rad] %4ld z-planes", startPhi, deltaPhi, z.size()); + +#endif + ns.addSolid(nam, Polycone(startPhi, deltaPhi, rmin, rmax, z)); } else { + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Polycone: startPhi=%10.3f [rad] deltaPhi=%10.3f [rad] %4ld z-planes and %4ld radii", @@ -1036,6 +1156,9 @@ void Converter<DDLPolycone>::operator()(xml_h element) const { deltaPhi, z.size(), r.size()); + +#endif + ns.addSolid(nam, Polycone(startPhi, deltaPhi, r, z)); } } @@ -1058,11 +1181,17 @@ void Converter<DDLExtrudedPolygon>::operator()(xml_h element) const { pt_x.emplace_back(ns.attr<double>(pt, _U(x))); pt_y.emplace_back(ns.attr<double>(pt, _U(y))); } + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ ExtrudedPolygon: %4ld points %4ld zxy sections", pt_x.size(), sec_z.size()); + +#endif + ns.addSolid(nam, ExtrudedPolygon(pt_x, pt_y, sec_z, sec_x, sec_y, sec_scale)); } @@ -1087,6 +1216,9 @@ void Converter<DDLPolyhedra>::operator()(xml_h element) const { rmax.emplace_back(ns.attr<double>(zplane, DD_CMU(rMax))); z.emplace_back(ns.attr<double>(zplane, _U(z))); } + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Polyhedra:startPhi=%8.3f [rad] deltaPhi=%8.3f [rad] %4d sides %4ld z-planes", @@ -1094,6 +1226,9 @@ void Converter<DDLPolyhedra>::operator()(xml_h element) const { deltaPhi, numSide, z.size()); + +#endif + ns.addSolid(nam, Polyhedra(numSide, startPhi, deltaPhi, z, rmin, rmax)); } @@ -1109,6 +1244,9 @@ void Converter<DDLSphere>::operator()(xml_h element) const { double deltaPhi = ns.attr<double>(e, DD_CMU(deltaPhi)); double startTheta = ns.attr<double>(e, DD_CMU(startTheta)); double deltaTheta = ns.attr<double>(e, DD_CMU(deltaTheta)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Sphere: r_inner=%8.3f [cm] r_outer=%8.3f [cm]" @@ -1119,6 +1257,9 @@ void Converter<DDLSphere>::operator()(xml_h element) const { deltaPhi, startTheta, deltaTheta); + +#endif + ns.addSolid(nam, Sphere(rinner, router, startTheta, deltaTheta, startPhi, deltaPhi)); } @@ -1133,6 +1274,9 @@ void Converter<DDLTorus>::operator()(xml_h element) const { double router = ns.attr<double>(e, DD_CMU(outerRadius)); double startPhi = ns.attr<double>(e, DD_CMU(startPhi)); double deltaPhi = ns.attr<double>(e, DD_CMU(deltaPhi)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Torus: r=%10.3f [cm] r_inner=%10.3f [cm] r_outer=%10.3f [cm]" @@ -1142,6 +1286,9 @@ void Converter<DDLTorus>::operator()(xml_h element) const { router, startPhi, deltaPhi); + +#endif + ns.addSolid(nam, Torus(r, rinner, router, startPhi, deltaPhi)); } @@ -1158,6 +1305,9 @@ void Converter<DDLPseudoTrap>::operator()(xml_h element) const { double dz = ns.attr<double>(e, _U(dz)); double r = ns.attr<double>(e, _U(radius)); bool atMinusZ = ns.attr<bool>(e, DD_CMU(atMinusZ)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Pseudotrap: dz=%8.3f [cm] dx1:%.3f dy1:%.3f dx2=%.3f dy2=%.3f radius:%.3f atMinusZ:%s", @@ -1168,6 +1318,9 @@ void Converter<DDLPseudoTrap>::operator()(xml_h element) const { dy2, r, yes_no(atMinusZ)); + +#endif + ns.addSolid(nam, PseudoTrap(dx1, dx2, dy1, dy2, dz, r, atMinusZ)); } @@ -1189,6 +1342,8 @@ void Converter<DDLTrapezoid>::operator()(xml_h element) const { double phi = ns.attr<double>(e, _U(phi), 0.0); double theta = ns.attr<double>(e, _U(theta), 0.0); +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Trapezoid: dz=%10.3f [cm] alp1:%.3f bl1=%.3f tl1=%.3f alp2=%.3f bl2=%.3f tl2=%.3f h2=%.3f phi=%.3f " @@ -1204,6 +1359,9 @@ void Converter<DDLTrapezoid>::operator()(xml_h element) const { h2, phi, theta); + +#endif + ns.addSolid(nam, Trap(dz, theta, phi, h1, bl1, tl1, alp1, h2, bl2, tl2, alp2)); } @@ -1219,6 +1377,9 @@ void Converter<DDLTrd1>::operator()(xml_h element) const { double dy2 = ns.attr<double>(e, DD_CMU(dy2), dy1); double dz = ns.attr<double>(e, DD_CMU(dz)); if (dy1 == dy2) { + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Trd1: dz=%8.3f [cm] dx1:%.3f dy1:%.3f dx2:%.3f dy2:%.3f", @@ -1227,8 +1388,14 @@ void Converter<DDLTrd1>::operator()(xml_h element) const { dy1, dx2, dy2); + +#endif + ns.addSolid(nam, Trd1(dx1, dx2, dy1, dz)); } else { + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Trd1(which is actually Trd2): dz=%8.3f [cm] dx1:%.3f dy1:%.3f dx2:%.3f dy2:%.3f", @@ -1237,6 +1404,9 @@ void Converter<DDLTrd1>::operator()(xml_h element) const { dy1, dx2, dy2); + +#endif + ns.addSolid(nam, Trd2(dx1, dx2, dy1, dy2, dz)); } } @@ -1252,6 +1422,9 @@ void Converter<DDLTrd2>::operator()(xml_h element) const { double dx2 = ns.attr<double>(e, DD_CMU(dx2), 0.0); double dy2 = ns.attr<double>(e, DD_CMU(dy2), dy1); double dz = ns.attr<double>(e, DD_CMU(dz)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Trd1: dz=%8.3f [cm] dx1:%.3f dy1:%.3f dx2:%.3f dy2:%.3f", @@ -1260,6 +1433,9 @@ void Converter<DDLTrd2>::operator()(xml_h element) const { dy1, dx2, dy2); + +#endif + ns.addSolid(nam, Trd2(dx1, dx2, dy1, dy2, dz)); } @@ -1274,6 +1450,9 @@ void Converter<DDLTubs>::operator()(xml_h element) const { double rmax = ns.attr<double>(e, DD_CMU(rMax)); double startPhi = ns.attr<double>(e, DD_CMU(startPhi), 0.0); double deltaPhi = ns.attr<double>(e, DD_CMU(deltaPhi), 2 * M_PI); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Tubs: dz=%8.3f [cm] rmin=%8.3f [cm] rmax=%8.3f [cm]" @@ -1283,6 +1462,9 @@ void Converter<DDLTubs>::operator()(xml_h element) const { rmax, startPhi, deltaPhi); + +#endif + ns.addSolid(nam, Tube(rmin, rmax, dz, startPhi, startPhi + deltaPhi)); } @@ -1303,6 +1485,9 @@ void Converter<DDLCutTubs>::operator()(xml_h element) const { double tx = ns.attr<double>(e, DD_CMU(tx)); double ty = ns.attr<double>(e, DD_CMU(ty)); double tz = ns.attr<double>(e, DD_CMU(tz)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ CutTube: dz=%8.3f [cm] rmin=%8.3f [cm] rmax=%8.3f [cm]" @@ -1312,6 +1497,9 @@ void Converter<DDLCutTubs>::operator()(xml_h element) const { rmax, startPhi, deltaPhi); + +#endif + ns.addSolid(nam, CutTube(rmin, rmax, dz, startPhi, startPhi + deltaPhi, lx, ly, lz, tx, ty, tz)); } @@ -1329,6 +1517,9 @@ void Converter<DDLTruncTubs>::operator()(xml_h element) const { double cutAtStart = ns.attr<double>(e, DD_CMU(cutAtStart)); double cutAtDelta = ns.attr<double>(e, DD_CMU(cutAtDelta)); bool cutInside = ns.attr<bool>(e, DD_CMU(cutInside)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ TruncTube:zHalf=%8.3f [cm] rmin=%8.3f [cm] rmax=%8.3f [cm]" @@ -1341,6 +1532,9 @@ void Converter<DDLTruncTubs>::operator()(xml_h element) const { cutAtStart, cutAtDelta, yes_no(cutInside)); + + #endif + ns.addSolid(nam, TruncatedTube(zhalf, rmin, rmax, startPhi, deltaPhi, cutAtStart, cutAtDelta, cutInside)); } @@ -1353,12 +1547,18 @@ void Converter<DDLEllipticalTube>::operator()(xml_h element) const { double dx = ns.attr<double>(e, DD_CMU(xSemiAxis)); double dy = ns.attr<double>(e, DD_CMU(ySemiAxis)); double dz = ns.attr<double>(e, DD_CMU(zHeight)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ EllipticalTube xSemiAxis=%8.3f [cm] ySemiAxis=%8.3f [cm] zHeight=%8.3f [cm]", dx, dy, dz); + +#endif + ns.addSolid(nam, EllipticalTube(dx, dy, dz)); } @@ -1376,6 +1576,9 @@ void Converter<DDLCone>::operator()(xml_h element) const { double startPhi = ns.attr<double>(e, DD_CMU(startPhi)); double deltaPhi = ns.attr<double>(e, DD_CMU(deltaPhi)); double phi2 = startPhi + deltaPhi; + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Cone: dz=%8.3f [cm]" @@ -1389,6 +1592,9 @@ void Converter<DDLCone>::operator()(xml_h element) const { rmax2, startPhi, deltaPhi); + +#endif + ns.addSolid(nam, ConeSegment(dz, rmin1, rmax1, rmin2, rmax2, startPhi, phi2)); } @@ -1398,10 +1604,16 @@ void Converter<DDLShapeless>::operator()(xml_h element) const { cms::DDNamespace ns(_param<cms::DDParsingContext>()); xml_dim_t e(element); string nam = e.nameStr(); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Shapeless: THIS ONE CAN ONLY BE USED AT THE VOLUME LEVEL -> Assembly%s", nam.c_str()); + +#endif + ns.addSolid(nam, Box(1, 1, 1)); } @@ -1414,12 +1626,18 @@ void Converter<DDLBox>::operator()(xml_h element) const { double dx = ns.attr<double>(e, DD_CMU(dx)); double dy = ns.attr<double>(e, DD_CMU(dy)); double dz = ns.attr<double>(e, DD_CMU(dz)); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Box: dx=%10.3f [cm] dy=%10.3f [cm] dz=%10.3f [cm]", dx, dy, dz); + +#endif + ns.addSolid(nam, Box(dx, dy, dz)); } @@ -1430,10 +1648,16 @@ void Converter<include_load>::operator()(xml_h element) const { edm::FileInPath fp(fname); xml::Document doc; doc = xml::DocumentHandler().load(fp.fullPath()); + +#ifdef EDM_ML_DEBUG + printout(_param<cms::DDParsingContext>()->debug_includes ? ALWAYS : DEBUG, "DD4CMS", "+++ Processing the CMS detector description %s", fname.c_str()); + +#endif + _option<DDRegistry>()->includes.emplace_back(doc); } @@ -1442,10 +1666,14 @@ template <> void Converter<include_unload>::operator()(xml_h element) const { string fname = xml::DocumentHandler::system_path(element); xml::DocumentHolder(xml_elt_t(element).document()).assign(nullptr); + +#ifdef EDM_ML_DEBUG + printout(_param<cms::DDParsingContext>()->debug_includes ? ALWAYS : DEBUG, "DD4CMS", "+++ Finished processing %s", fname.c_str()); +#endif } /// DD4hep specific Converter for <Include/> tags: process only the constants @@ -1491,6 +1719,8 @@ void Converter<DDLDivision>::operator()(xml_h element) const { double width = e.hasAttr(DD_CMU(width)) ? ns.attr<double>(e, DD_CMU(width)) : 0e0; int nReplicas = e.hasAttr(DD_CMU(nReplicas)) ? ns.attr<int>(e, DD_CMU(nReplicas)) : 0; +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ Start executing Division of %s along %s (%d) with offset %6.3f and %6.3f to produce %s....", @@ -1501,6 +1731,8 @@ void Converter<DDLDivision>::operator()(xml_h element) const { width, childName.c_str()); +#endif + Volume parent = ns.volume(parentName); const TGeoShape* shape = parent.solid(); @@ -1510,6 +1742,9 @@ void Converter<DDLDivision>::operator()(xml_h element) const { double widthInDeg = convertRadToDeg(width); double startInDeg = convertRadToDeg(offset); int numCopies = (int)((sh->GetPhi2() - sh->GetPhi1()) / widthInDeg); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ ...divide %s along %s (%d) with offset %6.3f deg and %6.3f deg to produce %d copies", @@ -1519,10 +1754,15 @@ void Converter<DDLDivision>::operator()(xml_h element) const { startInDeg, widthInDeg, numCopies); + +#endif + Volume child = parent.divide(childName, static_cast<int>(axesmap.at(axis)), numCopies, startInDeg, widthInDeg); ns.context()->volumes[childName] = child; +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Parent: %-24s [%s] Child: %-32s [%s] is multivolume [%s]", @@ -1532,9 +1772,13 @@ void Converter<DDLDivision>::operator()(xml_h element) const { child.name(), child.isValid() ? "VALID" : "INVALID", child->IsVolumeMulti() ? "YES" : "NO"); - +#endif + } else if (cl == TGeoTrd1::Class()) { double dy = static_cast<const TGeoTrd1*>(shape)->GetDy(); + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ ...divide %s along %s (%d) with offset %6.3f cm and %6.3f cm to produce %d copies in %6.3f", @@ -1545,10 +1789,15 @@ void Converter<DDLDivision>::operator()(xml_h element) const { width, nReplicas, dy); + +#endif + Volume child = parent.divide(childName, static_cast<int>(axesmap.at(axis)), nReplicas, -dy + offset + width, width); ns.context()->volumes[childName] = child; +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Parent: %-24s [%s] Child: %-32s [%s] is multivolume [%s]", @@ -1558,6 +1807,9 @@ void Converter<DDLDivision>::operator()(xml_h element) const { child.name(), child.isValid() ? "VALID" : "INVALID", child->IsVolumeMulti() ? "YES" : "NO"); + +#endif + } else { printout(ERROR, "DD4CMS", "++ FAILED Division of a %s is not implemented yet!", parent.solid().type()); } @@ -1574,16 +1826,26 @@ void Converter<DDLAlgorithm>::operator()(xml_h element) const { while ((idx = type.find(NAMESPACE_SEP)) != string::npos) type[idx] = '_'; +#ifdef EDM_ML_DEBUG + printout( ns.context()->debug_algorithms ? ALWAYS : DEBUG, "DD4CMS", "+++ Start executing algorithm %s....", type.c_str()); +#endif + long ret = PluginService::Create<long>(type, &description, ns.context(), &element); if (ret == s_executed) { + +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_algorithms ? ALWAYS : DEBUG, - "DD4CMS", + + "DD4CMS", "+++ Executed algorithm: %08lX = %s", ret, name.c_str()); + +#endif return; } printout(ERROR, "DD4CMS", "++ FAILED NOT ADDING SUBDETECTOR %08lX = %s", ret, name.c_str()); @@ -1647,6 +1909,8 @@ void Converter<DDLVector>::operator()(xml_h element) const { string val = e.text(); val.erase(remove_if(val.begin(), val.end(), [](unsigned char x) { return isspace(x); }), val.end()); +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_constants ? ALWAYS : DEBUG, "DD4CMS", "+++ Vector<%s>: %s[%s]: %s", @@ -1654,12 +1918,18 @@ void Converter<DDLVector>::operator()(xml_h element) const { name.c_str(), nEntries.c_str(), val.c_str()); + +#endif + try { std::vector<double> results = splitNumeric(val); registry->insert( {name, results}); //tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(results.begin(), results.end())}); } catch (const exception& e) { + +#ifdef EDM_ML_DEBUG + printout(INFO, "DD4CMS", "++ Unresolved Vector<%s>: %s[%s]: %s. Try to resolve later. [%s]", @@ -1669,6 +1939,8 @@ void Converter<DDLVector>::operator()(xml_h element) const { val.c_str(), e.what()); +#endif + std::vector<string> results = splitString(val); context->unresolvedVectors.insert({name, results}); } @@ -1706,12 +1978,15 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { cms::DDNamespace ns(context); int count = 0; +#ifdef EDM_ML_DEBUG + printout(context->debug_constants ? ALWAYS : DEBUG, "DD4CMS", "+++ RESOLVING %ld unknown constants..... (out of %ld)", res->unresolvedConst.size(), res->originalConst.size()); - +#endif + while (!res->unresolvedConst.empty()) { for (auto& i : res->unresolvedConst) { const string& n = i.first; @@ -1734,12 +2009,18 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { while ((idx = v.find("+-")) != string::npos) v.replace(idx, 2, "-"); } - printout(context->debug_constants ? ALWAYS : DEBUG, + +#ifdef EDM_ML_DEBUG + + printout(context->debug_constants ? ALWAYS : DEBUG, "DD4CMS", "+++ [%06ld] ---------- %-40s = %s", res->unresolvedConst.size() - 1, n.c_str(), res->originalConst[n].c_str()); + +#endif + ns.addConstantNS(n, v, "number"); res->unresolvedConst.erase(n); break; @@ -1760,10 +2041,15 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { template <> void Converter<print_xml_doc>::operator()(xml_h element) const { string fname = xml::DocumentHandler::system_path(element); + +#ifdef EDM_ML_DEBUG + printout(_param<cms::DDParsingContext>()->debug_includes ? ALWAYS : DEBUG, "DD4CMS", "+++ Processing data from: %s", fname.c_str()); + +#endif } /// Converter for <DDDefinition/> tags diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index f2be79e5f741d..747d7ff827614 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -50,7 +50,7 @@ DDFilteredView::DDFilteredView(const DDCompactView& cpv, const cms::DDFilter& fi log << "Filtered by an attribute " << filter.attribute() << "==" << filter.value() << " DD SpecPar Registry size: " << refs_.size() << "\n"; for (const auto& t : refs_) { - log << "\nSpecPar " << t.first << "\nRegExps { "; + log << "\nSpecPar " << std::string(t.first.data(), t.first.size()) << "\nRegExps { "; for (const auto& ki : t.second->paths) log << ki << " "; log << "};\n "; @@ -178,7 +178,7 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { bool isRegex = dd4hep::dd::isRegex(firstTok); filters_.emplace_back(make_unique<Filter>()); filters_.back()->isRegex.emplace_back(isRegex); - filters_.back()->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(firstTok)); + filters_.back()->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(firstTok)); if (isRegex) { filters_.back()->index.emplace_back(filters_.back()->keys.size()); filters_.back()->keys.emplace_back(std::regex(begin(firstTok), end(firstTok))); @@ -205,7 +205,7 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { if (l == end(currentFilter_->skeys)) { bool isRegex = dd4hep::dd::isRegex(toks[pos]); currentFilter_->isRegex.emplace_back(isRegex); - currentFilter_->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + currentFilter_->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); if (isRegex) { currentFilter_->index.emplace_back(currentFilter_->keys.size()); currentFilter_->keys.emplace_back(std::regex(std::begin(toks[pos]), std::end(toks[pos]))); @@ -218,7 +218,7 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { auto filter = std::make_unique<Filter>(); bool isRegex = dd4hep::dd::isRegex(toks[pos]); filter->isRegex.emplace_back(isRegex); - filter->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + filter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); if (isRegex) { filter->index.emplace_back(filters_.back()->keys.size()); filter->keys.emplace_back(std::regex(toks[pos].begin(), toks[pos].end())); @@ -413,7 +413,7 @@ bool DDFilteredView::firstSibling() { else return false; do { - if (accepted(currentFilter_->keys, noNamespace(node->GetVolume()->GetName()))) { + if (dd4hep::dd::accepted(currentFilter_, noNamespace(node->GetVolume()->GetName()))) { node_ = node; return true; } @@ -435,7 +435,7 @@ bool DDFilteredView::nextSibling() { it_.back().SetType(1); Node* node = node_; do { - if (accepted(currentFilter_->keys, noNamespace(node->GetVolume()->GetName()))) { + if (dd4hep::dd::accepted(currentFilter_, noNamespace(node->GetVolume()->GetName()))) { node_ = node; return true; } @@ -453,7 +453,7 @@ bool DDFilteredView::sibling() { it_.back().SetType(1); Node* node = nullptr; while ((node = it_.back().Next())) { - if (accepted(currentFilter_->keys, node->GetVolume()->GetName())) { + if (dd4hep::dd::accepted(currentFilter_, node->GetVolume()->GetName())) { node_ = node; return true; } @@ -469,7 +469,7 @@ bool DDFilteredView::checkChild() { it_.back().SetType(1); Node* node = nullptr; while ((node = it_.back().Next())) { - if (accepted(currentFilter_->keys, node->GetVolume()->GetName())) { + if (dd4hep::dd::accepted(currentFilter_, node->GetVolume()->GetName())) { return true; } } @@ -523,14 +523,12 @@ void DDFilteredView::up() { } bool DDFilteredView::accept(std::string_view name) { - bool result = false; for (const auto& it : filters_) { currentFilter_ = it.get(); - result = accepted(currentFilter_->keys, name); - if (result) - return result; + if (dd4hep::dd::accepted(currentFilter_, name)) + return true; } - return result; + return false; } const std::vector<double> DDFilteredView::parameters() const { diff --git a/DetectorDescription/DDCMS/test/Filter.cppunit.cc b/DetectorDescription/DDCMS/test/Filter.cppunit.cc index 29eab71e88d68..46d88476d8814 100644 --- a/DetectorDescription/DDCMS/test/Filter.cppunit.cc +++ b/DetectorDescription/DDCMS/test/Filter.cppunit.cc @@ -54,7 +54,7 @@ void testFilter::setUp() { bool isRegex = dd4hep::dd::isRegex(toks.front()); filters_.emplace_back(make_unique<Filter>()); filters_.back()->isRegex.emplace_back(isRegex); - filters_.back()->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks.front())); + filters_.back()->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks.front())); if (isRegex) { filters_.back()->index.emplace_back(filters_.back()->keys.size()); filters_.back()->keys.emplace_back(std::regex(std::begin(toks.front()), std::end(toks.front()))); @@ -75,7 +75,7 @@ void testFilter::setUp() { if (l == end(currentFilter->skeys)) { bool isRegex = dd4hep::dd::isRegex(toks.front()); currentFilter->isRegex.emplace_back(isRegex); - currentFilter->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks.front())); + currentFilter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks.front())); if (isRegex) { currentFilter->index.emplace_back(currentFilter->keys.size()); currentFilter->keys.emplace_back(std::regex(std::begin(toks.front()), std::end(toks.front()))); @@ -88,7 +88,7 @@ void testFilter::setUp() { auto filter = std::make_unique<Filter>(); bool isRegex = dd4hep::dd::isRegex(toks[pos]); filter->isRegex.emplace_back(isRegex); - filter->hasNamaspace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + filter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); if (isRegex) { filter->index.emplace_back(filters_.back()->keys.size()); filter->keys.emplace_back(std::regex(toks[pos].begin(), toks[pos].end())); diff --git a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml index 521f45c29cc66..ade5ecbed2f23 100644 --- a/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml +++ b/Geometry/CMSCommonData/data/dd4hep/cmsExtendedGeometry2021.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <DDDefinition> <open_geometry/> - <close_geometry/> + <!--close_geometry/--> <IncludeSection> <Include ref='Geometry/CMSCommonData/data/materials/2021/v2/materials.xml'/> From 129015272d61cdc509f8447204a847ef6c9e6e54 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Thu, 15 Oct 2020 19:43:38 +0200 Subject: [PATCH 703/778] use regex comparison if selection is a regex --- SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc b/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc index 41a8aff41385a..7bce4be3f7c2f 100644 --- a/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc +++ b/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc @@ -40,9 +40,10 @@ G4VPhysicalVolume *DDG4Builder::BuildGeometry(SensitiveDetectorCatalog &catalog) dd4hep::SpecParRefs specs; specPars.filter(specs, "SensitiveDetector"); for (auto const &it : map_) { + bool isRegex = dd4hep::dd::isRegex(it.first.name()); for (auto const &fit : specs) { for (auto const &pit : fit->paths) { - if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first.name()), dd4hep::dd::realTopName(pit))) { + if (dd4hep::dd::compareEqualName(dd4hep::dd::noNamespace(it.first.name()), dd4hep::dd::realTopName(pit))) { dd4hepVec.emplace_back(&*it.second, &*fit); } } From d4a5a55fc01ba6d32b44c22e979f0f3d9ff2d975 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Thu, 15 Oct 2020 19:49:04 +0200 Subject: [PATCH 704/778] remove unused variable --- SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc b/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc index 7bce4be3f7c2f..30b55e8dd0c38 100644 --- a/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc +++ b/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc @@ -40,7 +40,6 @@ G4VPhysicalVolume *DDG4Builder::BuildGeometry(SensitiveDetectorCatalog &catalog) dd4hep::SpecParRefs specs; specPars.filter(specs, "SensitiveDetector"); for (auto const &it : map_) { - bool isRegex = dd4hep::dd::isRegex(it.first.name()); for (auto const &fit : specs) { for (auto const &pit : fit->paths) { if (dd4hep::dd::compareEqualName(dd4hep::dd::noNamespace(it.first.name()), dd4hep::dd::realTopName(pit))) { From 6d1e1d07144568dfa375bf650901ce36fd4134f1 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Thu, 15 Oct 2020 20:18:51 +0200 Subject: [PATCH 705/778] update to new vesrion of dd4hep --- SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc | 4 ++-- SimG4Core/Geometry/src/DDG4ProductionCuts.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc b/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc index 30b55e8dd0c38..7bbb8bea2d645 100644 --- a/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc +++ b/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc @@ -41,9 +41,9 @@ G4VPhysicalVolume *DDG4Builder::BuildGeometry(SensitiveDetectorCatalog &catalog) specPars.filter(specs, "SensitiveDetector"); for (auto const &it : map_) { for (auto const &fit : specs) { - for (auto const &pit : fit->paths) { + for (auto const &pit : fit.second->paths) { if (dd4hep::dd::compareEqualName(dd4hep::dd::noNamespace(it.first.name()), dd4hep::dd::realTopName(pit))) { - dd4hepVec.emplace_back(&*it.second, &*fit); + dd4hepVec.emplace_back(&*it.second, &*fit.second); } } } diff --git a/SimG4Core/Geometry/src/DDG4ProductionCuts.cc b/SimG4Core/Geometry/src/DDG4ProductionCuts.cc index a50c3530b541a..23f66e0c14f67 100644 --- a/SimG4Core/Geometry/src/DDG4ProductionCuts.cc +++ b/SimG4Core/Geometry/src/DDG4ProductionCuts.cc @@ -113,9 +113,9 @@ void DDG4ProductionCuts::dd4hepInitialize() { for (auto const& it : *dd4hepMap_) { for (auto const& fit : specs) { - for (auto const& pit : fit->paths) { + for (auto const& pit : fit.second->paths) { if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first.name()), dd4hep::dd::realTopName(pit))) { - dd4hepVec_.emplace_back(std::make_pair<G4LogicalVolume*, const dd4hep::SpecPar*>(&*it.second, &*fit)); + dd4hepVec_.emplace_back(std::make_pair<G4LogicalVolume*, const dd4hep::SpecPar*>(&*it.second, &*fit.second)); } } } From 02c84a8a12d46ccaca176a1091b763eaef5c1bf7 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <yana@cmsdev20.cern.ch> Date: Thu, 15 Oct 2020 21:04:18 +0200 Subject: [PATCH 706/778] reverse comparison --- SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc b/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc index 7bbb8bea2d645..0ffb65513965f 100644 --- a/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc +++ b/SimG4Core/Geometry/src/DD4hep_DDG4Builder.cc @@ -42,7 +42,7 @@ G4VPhysicalVolume *DDG4Builder::BuildGeometry(SensitiveDetectorCatalog &catalog) for (auto const &it : map_) { for (auto const &fit : specs) { for (auto const &pit : fit.second->paths) { - if (dd4hep::dd::compareEqualName(dd4hep::dd::noNamespace(it.first.name()), dd4hep::dd::realTopName(pit))) { + if (dd4hep::dd::compareEqualName(dd4hep::dd::realTopName(pit), dd4hep::dd::noNamespace(it.first.name()))) { dd4hepVec.emplace_back(&*it.second, &*fit.second); } } From 724d9417cb7dde18a36524a4d6b95eab4b745c7b Mon Sep 17 00:00:00 2001 From: Ianna Osborne <yana@cmsdev20.cern.ch> Date: Sat, 10 Oct 2020 21:45:59 +0200 Subject: [PATCH 707/778] replace tbb containers with std ones --- DetectorDescription/DDCMS/interface/DDParsingContext.h | 2 +- DetectorDescription/DDCMS/src/DDNamespace.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DetectorDescription/DDCMS/interface/DDParsingContext.h b/DetectorDescription/DDCMS/interface/DDParsingContext.h index d885a9efe36cd..77cfab1c01749 100644 --- a/DetectorDescription/DDCMS/interface/DDParsingContext.h +++ b/DetectorDescription/DDCMS/interface/DDParsingContext.h @@ -12,7 +12,7 @@ namespace cms { class DDParsingContext { public: - DDParsingContext(dd4hep::Detector& det) : description(det) { + DDParsingContext(dd4hep::Detector* det) : description(det) { assemblies.reserve(100); rotations.reserve(3000); shapes.reserve(4000); diff --git a/DetectorDescription/DDCMS/src/DDNamespace.cc b/DetectorDescription/DDCMS/src/DDNamespace.cc index 4e5b453e7adfb..3c2ccf0736375 100644 --- a/DetectorDescription/DDCMS/src/DDNamespace.cc +++ b/DetectorDescription/DDCMS/src/DDNamespace.cc @@ -109,6 +109,7 @@ void DDNamespace::addConstantNS(const string& name, const string& val, const str type.c_str()); dd4hep::_toDictionary(n, v, type); dd4hep::Constant c(n, v, type); + m_context->description.addConstant(c); } From fe0ac3fbf4989c4cf3926eaf8ea1bee8e283cb10 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Mon, 12 Oct 2020 10:51:44 +0200 Subject: [PATCH 708/778] no need for atomic --- DetectorDescription/DDCMS/interface/DDParsingContext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DetectorDescription/DDCMS/interface/DDParsingContext.h b/DetectorDescription/DDCMS/interface/DDParsingContext.h index 77cfab1c01749..d885a9efe36cd 100644 --- a/DetectorDescription/DDCMS/interface/DDParsingContext.h +++ b/DetectorDescription/DDCMS/interface/DDParsingContext.h @@ -12,7 +12,7 @@ namespace cms { class DDParsingContext { public: - DDParsingContext(dd4hep::Detector* det) : description(det) { + DDParsingContext(dd4hep::Detector& det) : description(det) { assemblies.reserve(100); rotations.reserve(3000); shapes.reserve(4000); From 6cd3fe5abaae5ab9d0676c843be34b8da50382dc Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Fri, 16 Oct 2020 10:42:22 +0200 Subject: [PATCH 709/778] final changes and cleanup --- .../interface/CocoaAnalyzer.h | 43 ---- .../CocoaApplication/src/CocoaAnalyzer.cc | 146 ++++++------ Alignment/CocoaApplication/src/SealModule.cc | 4 - .../DDCMS/interface/DDCompactView.h | 39 ++++ .../DDCMS/interface/DDSpecParRegistry.h | 1 + .../plugins/dd4hep/DDDefinitions2Objects.cc | 214 +++++++++--------- .../plugins/dd4hep/DD4hep_ListGroups.cc | 4 +- .../plugins/dd4hep/DD4hep_ListIds.cc | 2 +- .../dd4hep/DD4hep_MaterialAccountingGroup.cc | 2 +- 9 files changed, 216 insertions(+), 239 deletions(-) delete mode 100644 Alignment/CocoaApplication/interface/CocoaAnalyzer.h delete mode 100644 Alignment/CocoaApplication/src/SealModule.cc diff --git a/Alignment/CocoaApplication/interface/CocoaAnalyzer.h b/Alignment/CocoaApplication/interface/CocoaAnalyzer.h deleted file mode 100644 index 3438b652fa2cc..0000000000000 --- a/Alignment/CocoaApplication/interface/CocoaAnalyzer.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ALIGNMENT_COCOA_APPLICATION_COCOA_ANALYZER_H -#define ALIGNMENT_COCOA_APPLICATION_COCOA_ANALYZER_H - -#include "FWCore/Framework/interface/one/EDAnalyzer.h" -#include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h" -#include "CondFormats/OptAlignObjects/interface/OpticalAlignments.h" -#include "CondFormats/OptAlignObjects/interface/OpticalAlignMeasurements.h" - -class CocoaAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> { -public: - explicit CocoaAnalyzer(edm::ParameterSet const& p); - explicit CocoaAnalyzer(int i) {} - ~CocoaAnalyzer() override {} - - void beginJob() override; - void analyze(const edm::Event& e, const edm::EventSetup& c) override; - -private: - void readXMLFile(const edm::EventSetup& evts); - - std::vector<OpticalAlignInfo> readCalibrationDB(const edm::EventSetup& evts); - void correctAllOpticalAlignments(std::vector<OpticalAlignInfo>& allDBOpticalAlignments); - void correctOpticalAlignmentParameter(OpticalAlignParam& myXMLParam, const OpticalAlignParam& myDBParam); - - void runCocoa(); - - template <typename T> - std::vector<T> getAllParameterValuesFromSpecParSections(const cms::DDSpecParRegistry& allSpecParSections, - const std::string& nodePath, - const std::string& parameterName); - template <typename T> - T getParameterValueFromSpecParSections(const cms::DDSpecParRegistry& allSpecParSections, - const std::string& nodePath, - const std::string& parameterName, - const unsigned int parameterValueIndex); - -private: - OpticalAlignments oaList_; - OpticalAlignMeasurements measList_; - std::string theCocoaDaqRootFileName_; -}; - -#endif diff --git a/Alignment/CocoaApplication/src/CocoaAnalyzer.cc b/Alignment/CocoaApplication/src/CocoaAnalyzer.cc index f9aab2322b4ce..466aefcfc9d9e 100644 --- a/Alignment/CocoaApplication/src/CocoaAnalyzer.cc +++ b/Alignment/CocoaApplication/src/CocoaAnalyzer.cc @@ -10,9 +10,9 @@ #include "FWCore/Framework/interface/ESTransientHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" #include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Alignment/CocoaApplication/interface/CocoaAnalyzer.h" #include "Alignment/CocoaUtilities/interface/ALIUtils.h" #include "Alignment/CocoaModel/interface/Model.h" #include "Alignment/CocoaFit/interface/Fit.h" @@ -22,6 +22,34 @@ #include "Alignment/CocoaModel/interface/OpticalObject.h" #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h" #include "Alignment/CocoaFit/interface/CocoaDBMgr.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" +#include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h" +#include "CondFormats/OptAlignObjects/interface/OpticalAlignments.h" +#include "CondFormats/OptAlignObjects/interface/OpticalAlignMeasurements.h" + +class CocoaAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> { +public: + explicit CocoaAnalyzer(edm::ParameterSet const& p); + explicit CocoaAnalyzer(int i) {} + ~CocoaAnalyzer() override {} + + void beginJob() override; + void analyze(const edm::Event& e, const edm::EventSetup& c) override; + +private: + void readXMLFile(const edm::EventSetup& evts); + + std::vector<OpticalAlignInfo> readCalibrationDB(const edm::EventSetup& evts); + void correctAllOpticalAlignments(std::vector<OpticalAlignInfo>& allDBOpticalAlignments); + void correctOpticalAlignmentParameter(OpticalAlignParam& myXMLParam, const OpticalAlignParam& myDBParam); + + void runCocoa(); + +private: + OpticalAlignments oaList_; + OpticalAlignMeasurements measList_; + std::string theCocoaDaqRootFileName_; +}; using namespace cms_units::operators; @@ -160,35 +188,35 @@ void CocoaAnalyzer::readXMLFile(const edm::EventSetup& evts) { oaInfo.x_.name_ = "X"; oaInfo.x_.dim_type_ = "centre"; oaInfo.x_.value_ = transl.x() / (1._m); // COCOA units are m - oaInfo.x_.error_ = getParameterValueFromSpecParSections<double>(allSpecParSections, - nodePath, - "centre_X_sigma", - 0) / + oaInfo.x_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, + nodePath, + "centre_X_sigma", + 0) / (1._m); // COCOA units are m oaInfo.x_.quality_ = static_cast<int>( - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_X_quality", 0)); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_X_quality", 0)); // Y oaInfo.y_.name_ = "Y"; oaInfo.y_.dim_type_ = "centre"; oaInfo.y_.value_ = transl.y() / (1._m); // COCOA units are m - oaInfo.y_.error_ = getParameterValueFromSpecParSections<double>(allSpecParSections, - nodePath, - "centre_Y_sigma", - 0) / + oaInfo.y_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, + nodePath, + "centre_Y_sigma", + 0) / (1._m); // COCOA units are m oaInfo.y_.quality_ = static_cast<int>( - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_Y_quality", 0)); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_Y_quality", 0)); // Z oaInfo.z_.name_ = "Z"; oaInfo.z_.dim_type_ = "centre"; oaInfo.z_.value_ = transl.z() / (1._m); // COCOA units are m - oaInfo.z_.error_ = getParameterValueFromSpecParSections<double>(allSpecParSections, - nodePath, - "centre_Z_sigma", - 0) / + oaInfo.z_.error_ = cms::getParameterValueFromSpecParSections<double>(allSpecParSections, + nodePath, + "centre_Z_sigma", + 0) / (1._m); // COCOA units are m oaInfo.z_.quality_ = static_cast<int>( - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_Z_quality", 0)); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "centre_Z_quality", 0)); // ROTATIONS @@ -234,34 +262,35 @@ void CocoaAnalyzer::readXMLFile(const edm::EventSetup& evts) { oaInfo.angx_.name_ = "X"; oaInfo.angx_.dim_type_ = "angles"; oaInfo.angx_.value_ = - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_value", 0); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_value", 0); oaInfo.angx_.error_ = - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_sigma", 0); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_sigma", 0); oaInfo.angx_.quality_ = static_cast<int>( - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_quality", 0)); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_X_quality", 0)); // Y oaInfo.angy_.name_ = "Y"; oaInfo.angy_.dim_type_ = "angles"; oaInfo.angy_.value_ = - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_value", 0); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_value", 0); oaInfo.angy_.error_ = - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_sigma", 0); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_sigma", 0); oaInfo.angy_.quality_ = static_cast<int>( - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_quality", 0)); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Y_quality", 0)); // Z oaInfo.angz_.name_ = "Z"; oaInfo.angz_.dim_type_ = "angles"; oaInfo.angz_.value_ = - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_value", 0); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_value", 0); oaInfo.angz_.error_ = - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_sigma", 0); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_sigma", 0); oaInfo.angz_.quality_ = static_cast<int>( - getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_quality", 0)); + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "angles_Z_quality", 0)); - oaInfo.type_ = getParameterValueFromSpecParSections<std::string>(allSpecParSections, nodePath, "cocoa_type", 0); + oaInfo.type_ = + cms::getParameterValueFromSpecParSections<std::string>(allSpecParSections, nodePath, "cocoa_type", 0); - oaInfo.ID_ = - static_cast<int>(getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "cmssw_ID", 0)); + oaInfo.ID_ = static_cast<int>( + cms::getParameterValueFromSpecParSections<double>(allSpecParSections, nodePath, "cmssw_ID", 0)); if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << "CocoaAnalyzer::ReadXML OBJECT " << oaInfo.name_ << " pos/angles read "; @@ -279,15 +308,15 @@ void CocoaAnalyzer::readXMLFile(const edm::EventSetup& evts) { // EXTRA PARAM ENTRIES (FROM XMLS) // Here initial code to define the containers was fully removed, this is much more compact. const std::vector<std::string>& names = - getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "extra_entry"); + cms::getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "extra_entry"); const std::vector<std::string>& dims = - getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "dimType"); + cms::getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "dimType"); const std::vector<double>& values = - getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "value"); + cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "value"); const std::vector<double>& errors = - getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "sigma"); + cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "sigma"); const std::vector<double>& quality = - getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "quality"); + cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "quality"); if (ALIUtils::debug >= 4) { edm::LogInfo("Alignment") << " CocoaAnalyzer::ReadXML: Fill extra entries with read parameters "; @@ -320,9 +349,9 @@ void CocoaAnalyzer::readXMLFile(const edm::EventSetup& evts) { // MEASUREMENTS (FROM XMLS) const std::vector<std::string>& measNames = - getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "meas_name"); + cms::getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "meas_name"); const std::vector<std::string>& measTypes = - getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "meas_type"); + cms::getAllParameterValuesFromSpecParSections<std::string>(allSpecParSections, nodePath, "meas_type"); std::map<std::string, std::vector<std::string>> measObjectNames; std::map<std::string, std::vector<std::string>> measParamNames; @@ -330,15 +359,15 @@ void CocoaAnalyzer::readXMLFile(const edm::EventSetup& evts) { std::map<std::string, std::vector<double>> measParamSigmas; std::map<std::string, std::vector<double>> measIsSimulatedValue; for (const auto& name : measNames) { - measObjectNames[name] = getAllParameterValuesFromSpecParSections<std::string>( + measObjectNames[name] = cms::getAllParameterValuesFromSpecParSections<std::string>( allSpecParSections, nodePath, "meas_object_name_" + name); - measParamNames[name] = getAllParameterValuesFromSpecParSections<std::string>( + measParamNames[name] = cms::getAllParameterValuesFromSpecParSections<std::string>( allSpecParSections, nodePath, "meas_value_name_" + name); measParamValues[name] = - getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "meas_value_" + name); + cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "meas_value_" + name); measParamSigmas[name] = - getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "meas_sigma_" + name); - measIsSimulatedValue[name] = getAllParameterValuesFromSpecParSections<double>( + cms::getAllParameterValuesFromSpecParSections<double>(allSpecParSections, nodePath, "meas_sigma_" + name); + measIsSimulatedValue[name] = cms::getAllParameterValuesFromSpecParSections<double>( allSpecParSections, nodePath, "meas_is_simulated_value_" + name); } @@ -568,39 +597,4 @@ void CocoaAnalyzer::runCocoa() { } } -/* Helper: For a given node, get the values associated to a given parameter, from the XMLs SpecPar sections. - * NB: The same parameter can appear several times WITHIN the same SpecPar section (hence, we have a std::vector). - * WARNING: This stops at the first relevant SpecPar section encountered. - * Hence, if A GIVEN NODE HAS SEVERAL SPECPAR XML SECTIONS RE-DEFINING THE SAME PARAMETER, - * only the first XML SpecPar block will be considered. - */ -template <typename T> -std::vector<T> CocoaAnalyzer::getAllParameterValuesFromSpecParSections(const cms::DDSpecParRegistry& allSpecParSections, - const std::string& nodePath, - const std::string& parameterName) { - cms::DDSpecParRefs filteredSpecParSections; - allSpecParSections.filter(filteredSpecParSections, parameterName); - for (const auto& mySpecParSection : filteredSpecParSections) { - if (mySpecParSection->hasPath(nodePath)) { - return mySpecParSection->value<std::vector<T>>(parameterName); - } - } - - return std::vector<T>(); -} - -/* Helper: For a given node, get the value associated to a given parameter, from the XMLs SpecPar sections. - * This is the parameterValueIndex-th value (within a XML SpecPar block.) of the desired parameter. - */ -template <typename T> -T CocoaAnalyzer::getParameterValueFromSpecParSections(const cms::DDSpecParRegistry& allSpecParSections, - const std::string& nodePath, - const std::string& parameterName, - const unsigned int parameterValueIndex) { - const std::vector<T>& allParameterValues = - getAllParameterValuesFromSpecParSections<T>(allSpecParSections, nodePath, parameterName); - if (parameterValueIndex < allParameterValues.size()) { - return allParameterValues.at(parameterValueIndex); - } - return T(); -} +DEFINE_FWK_MODULE(CocoaAnalyzer); diff --git a/Alignment/CocoaApplication/src/SealModule.cc b/Alignment/CocoaApplication/src/SealModule.cc deleted file mode 100644 index 6fabe6d7c6341..0000000000000 --- a/Alignment/CocoaApplication/src/SealModule.cc +++ /dev/null @@ -1,4 +0,0 @@ -#include "FWCore/Framework/interface/MakerMacros.h" -#include "Alignment/CocoaApplication/interface/CocoaAnalyzer.h" - -DEFINE_FWK_MODULE(CocoaAnalyzer); diff --git a/DetectorDescription/DDCMS/interface/DDCompactView.h b/DetectorDescription/DDCMS/interface/DDCompactView.h index 1c19a9a0f58b4..652ed53385025 100644 --- a/DetectorDescription/DDCMS/interface/DDCompactView.h +++ b/DetectorDescription/DDCMS/interface/DDCompactView.h @@ -26,6 +26,7 @@ namespace cms { using DDSpecParRegistry = dd4hep::SpecParRegistry; + using DDSpecParRefs = dd4hep::SpecParRefs; class DDCompactView { public: @@ -43,6 +44,44 @@ namespace cms { private: const cms::DDDetector& m_det; }; + + /* Helper: For a given node, get the values associated to a given parameter, from the XMLs SpecPar sections. + * NB: The same parameter can appear several times WITHIN the same SpecPar section (hence, we have a std::vector). + * WARNING: This stops at the first relevant SpecPar section encountered. + * Hence, if A GIVEN NODE HAS SEVERAL SPECPAR XML SECTIONS RE-DEFINING THE SAME PARAMETER, + * only the first XML SpecPar block will be considered. + */ + template <typename T> + std::vector<T> getAllParameterValuesFromSpecParSections(const cms::DDSpecParRegistry& allSpecParSections, + const std::string& nodePath, + const std::string& parameterName) { + cms::DDSpecParRefs filteredSpecParSections; + allSpecParSections.filter(filteredSpecParSections, parameterName); + for (const auto& mySpecParSection : filteredSpecParSections) { + if (mySpecParSection.second->hasPath(nodePath)) { + return mySpecParSection.second->value<std::vector<T>>(parameterName); + } + } + + return std::vector<T>(); + } + + /* Helper: For a given node, get the value associated to a given parameter, from the XMLs SpecPar sections. + * This is the parameterValueIndex-th value (within a XML SpecPar block.) of the desired parameter. + */ + template <typename T> + T getParameterValueFromSpecParSections(const cms::DDSpecParRegistry& allSpecParSections, + const std::string& nodePath, + const std::string& parameterName, + const unsigned int parameterValueIndex) { + const std::vector<T>& allParameterValues = + getAllParameterValuesFromSpecParSections<T>(allSpecParSections, nodePath, parameterName); + if (parameterValueIndex < allParameterValues.size()) { + return allParameterValues.at(parameterValueIndex); + } + return T(); + } + } // namespace cms #endif diff --git a/DetectorDescription/DDCMS/interface/DDSpecParRegistry.h b/DetectorDescription/DDCMS/interface/DDSpecParRegistry.h index 8c03a5fd3a5f6..297e00a29d89f 100644 --- a/DetectorDescription/DDCMS/interface/DDSpecParRegistry.h +++ b/DetectorDescription/DDCMS/interface/DDSpecParRegistry.h @@ -7,6 +7,7 @@ namespace cms { using DDSpecParRegistry = dd4hep::SpecParRegistry; using DDSpecPar = dd4hep::SpecPar; + using DDSpecParRefs = dd4hep::SpecParRefs; } // namespace cms diff --git a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc index e1a4ad5b43c2c..576b4e8353f23 100644 --- a/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/dd4hep/DDDefinitions2Objects.cc @@ -417,7 +417,6 @@ void Converter<DDLConstant>::operator()(xml_h element) const { ns.addConstant(nam, val, typ); res->originalConst[real] = val; } catch (const exception& e) { - #ifdef EDM_ML_DEBUG printout(INFO, @@ -428,7 +427,6 @@ void Converter<DDLConstant>::operator()(xml_h element) const { typ.c_str(), e.what()); #endif - } return; } @@ -504,7 +502,7 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { mix->GetDensity()); #endif - + bool newMatDef = false; if (elt) { @@ -525,7 +523,7 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { atomicWeight, atomicNumber); #endif - + static constexpr double const weightTolerance = 1.0e-6; if (atomicNumber != elt->Z() || (std::abs(atomicWeight - elt->A()) > (weightTolerance * (atomicWeight + elt->A())))) @@ -534,9 +532,8 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { if (!elt || newMatDef) { if (newMatDef) { +#ifdef EDM_ML_DEBUG -#ifdef EDM_ML_DEBUG - printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS Warning", "+++ Converter<ElementaryMaterial> Different definition of a default element with name:%s [CREATE NEW " @@ -544,11 +541,10 @@ void Converter<DDLElementaryMaterial>::operator()(xml_h element) const { matname); #endif - + } else { - #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS Warning", "+++ Converter<ElementaryMaterial> No default element present with name:%s [CREATE NEW MATERIAL]", @@ -587,8 +583,8 @@ void Converter<DDLCompositeMaterial>::operator()(xml_h element) const { xml_coll_t composites(xmat, DD_CMU(MaterialFraction)); TGeoMixture* mix = new TGeoMixture(nam.c_str(), composites.size(), density); -#ifdef EDM_ML_DEBUG - +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS", "++ Converting material %-48s Density: %8.3f [g/cm3] ROOT: %8.3f [g/cm3]", @@ -597,7 +593,7 @@ void Converter<DDLCompositeMaterial>::operator()(xml_h element) const { mix->GetDensity()); #endif - + for (composites.reset(); composites; ++composites) { xml_dim_t xfrac(composites); xml_dim_t xfrac_mat(xfrac.child(DD_CMU(rMaterial))); @@ -612,8 +608,8 @@ void Converter<DDLCompositeMaterial>::operator()(xml_h element) const { continue; } -#ifdef EDM_ML_DEBUG - +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_materials ? ALWAYS : DEBUG, "DD4CMS Warning", "+++ Composite material \"%s\" [nor \"%s\"] not present! [delay resolution]", @@ -621,7 +617,7 @@ void Converter<DDLCompositeMaterial>::operator()(xml_h element) const { ns.prepend(fracname).c_str()); #endif - + ns.context()->unresolvedMaterials[nam].emplace_back( cms::DDParsingContext::CompositeMaterial(ns.prepend(fracname), fraction)); } @@ -653,7 +649,7 @@ void Converter<DDLRotation>::operator()(xml_h element) const { Rotation3D rot = makeRotation3D(thetaX, phiX, thetaY, phiY, thetaZ, phiZ); #ifdef EDM_ML_DEBUG - + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+++ Adding rotation: %-32s: (theta/phi)[rad] X: %6.3f %6.3f Y: %6.3f %6.3f Z: %6.3f %6.3f", @@ -666,7 +662,7 @@ void Converter<DDLRotation>::operator()(xml_h element) const { phiZ); #endif - + ns.addRotation(nam, rot); } @@ -685,7 +681,7 @@ void Converter<DDLReflectionRotation>::operator()(xml_h element) const { double phiZ = xrot.hasAttr(DD_CMU(phiZ)) ? ns.attr<double>(xrot, DD_CMU(phiZ)) : 0e0; #ifdef EDM_ML_DEBUG - + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+++ Adding reflection rotation: %-32s: (theta/phi)[rad] X: %6.3f %6.3f Y: %6.3f %6.3f Z: %6.3f %6.3f", @@ -697,8 +693,8 @@ void Converter<DDLReflectionRotation>::operator()(xml_h element) const { thetaZ, phiZ); -#endif - +#endif + Rotation3D rot = makeRotReflect(thetaX, phiX, thetaY, phiY, thetaZ, phiZ); ns.addRotation(name, rot); } @@ -718,7 +714,7 @@ void Converter<DDLRotationSequence>::operator()(xml_h element) const { rot = makeRotation3D(rot, axis, angle); #ifdef EDM_ML_DEBUG - + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+ Adding rotation to: %-29s: (axis/angle)[rad] Axis: %s Angle: %6.3f", @@ -727,7 +723,6 @@ void Converter<DDLRotationSequence>::operator()(xml_h element) const { angle); #endif - } double xx, xy, xz; double yx, yy, yz; @@ -735,7 +730,7 @@ void Converter<DDLRotationSequence>::operator()(xml_h element) const { rot.GetComponents(xx, xy, xz, yx, yy, yz, zx, zy, zz); #ifdef EDM_ML_DEBUG - + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+++ Adding rotation sequence: %-23s: %6.3f %6.3f %6.3f, %6.3f %6.3f %6.3f, %6.3f %6.3f %6.3f", @@ -750,8 +745,8 @@ void Converter<DDLRotationSequence>::operator()(xml_h element) const { zy, zz); -#endif - +#endif + ns.addRotation(nam, rot); } @@ -770,7 +765,7 @@ void Converter<DDLRotationByAxis>::operator()(xml_h element) const { rot = makeRotation3D(rot, axis, angle); #ifdef EDM_ML_DEBUG - + printout(context->debug_rotations ? ALWAYS : DEBUG, "DD4CMS", "+++ Adding rotation: %-32s: (axis/angle)[rad] Axis: %s Angle: %6.3f", @@ -779,7 +774,7 @@ void Converter<DDLRotationByAxis>::operator()(xml_h element) const { angle); #endif - + ns.addRotation(nam, rot); } } @@ -798,11 +793,11 @@ void Converter<DDLLogicalPart>::operator()(xml_h element) const { #ifdef EDM_ML_DEBUG Volume volume = #endif - - ns.addVolume(Volume(volName, solid, material)); + + ns.addVolume(Volume(volName, solid, material)); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_volumes ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Volume: %-24s [%s] Shape: %-32s [%s] Material: %-40s [%s]", @@ -814,7 +809,7 @@ void Converter<DDLLogicalPart>::operator()(xml_h element) const { mat.c_str(), material.isValid() ? "VALID" : "INVALID"); -#endif +#endif } /// Helper converter @@ -863,7 +858,7 @@ void Converter<DDLPosPart>::operator()(xml_h element) const { Volume child = ns.volume(childName, false); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Parent: %-24s [%s] Child: %-32s [%s] copy:%d", @@ -875,7 +870,7 @@ void Converter<DDLPosPart>::operator()(xml_h element) const { copy); #endif - + if (!parent.isValid() && strchr(parentName.c_str(), NAMESPACE_SEP) == nullptr) parentName = ns.prepend(parentName); parent = ns.volume(parentName); @@ -885,7 +880,7 @@ void Converter<DDLPosPart>::operator()(xml_h element) const { child = ns.volume(childName, false); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Parent: %-24s [%s] Child: %-32s [%s] copy:%d", @@ -896,8 +891,8 @@ void Converter<DDLPosPart>::operator()(xml_h element) const { child.isValid() ? "VALID" : "INVALID", copy); -#endif - +#endif + PlacedVolume pv; if (child.isValid()) { Transform3D transform; @@ -962,16 +957,16 @@ void Converter<PartSelector>::operator()(xml_h element) const { string specParName = specPar.attr<string>(_U(name)); string path = e.attr<string>(DD_CMU(path)); -#ifdef EDM_ML_DEBUG - +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_specpars ? ALWAYS : DEBUG, "DD4CMS", "+++ PartSelector for %s path: %s", specParName.c_str(), path.c_str()); -#endif - +#endif + size_t pos = std::string::npos; if ((pos = path.find("//.*:")) != std::string::npos) { path.erase(pos + 2, 3); @@ -996,7 +991,7 @@ void Converter<Parameter>::operator()(xml_h element) const { string type = eval ? "number" : "string"; #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_specpars ? ALWAYS : DEBUG, "DD4CMS", "+++ Parameter for %s: %s value %s is a %s", @@ -1005,7 +1000,7 @@ void Converter<Parameter>::operator()(xml_h element) const { value.c_str(), type.c_str()); -#endif +#endif size_t idx = value.find('['); if (idx == string::npos || type == "string") { @@ -1065,8 +1060,8 @@ static void convert_boolean(cms::DDParsingContext* context, xml_h element) { except("DD4CMS", "+++ Failed to create boolean solid %s. Found only %d parts.", nam.c_str(), cnt); } -#ifdef EDM_ML_DEBUG - +#ifdef EDM_ML_DEBUG + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ BooleanSolid: %s Left: %-32s Right: %-32s", @@ -1075,7 +1070,7 @@ static void convert_boolean(cms::DDParsingContext* context, xml_h element) { ((solids[1].ptr() == nullptr) ? solidName[1].c_str() : solids[1]->GetName())); #endif - + if (solids[0].isValid() && solids[1].isValid()) { Transform3D trafo; Converter<DDLTransform3D>(context->description, context, &trafo)(element); @@ -1134,7 +1129,7 @@ void Converter<DDLPolycone>::operator()(xml_h element) const { } #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Polycone: startPhi=%10.3f [rad] deltaPhi=%10.3f [rad] %4ld z-planes", @@ -1142,13 +1137,12 @@ void Converter<DDLPolycone>::operator()(xml_h element) const { deltaPhi, z.size()); -#endif - +#endif + ns.addSolid(nam, Polycone(startPhi, deltaPhi, rmin, rmax, z)); } else { - #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Polycone: startPhi=%10.3f [rad] deltaPhi=%10.3f [rad] %4ld z-planes and %4ld radii", @@ -1158,7 +1152,7 @@ void Converter<DDLPolycone>::operator()(xml_h element) const { r.size()); #endif - + ns.addSolid(nam, Polycone(startPhi, deltaPhi, r, z)); } } @@ -1183,15 +1177,15 @@ void Converter<DDLExtrudedPolygon>::operator()(xml_h element) const { } #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ ExtrudedPolygon: %4ld points %4ld zxy sections", pt_x.size(), sec_z.size()); -#endif - +#endif + ns.addSolid(nam, ExtrudedPolygon(pt_x, pt_y, sec_z, sec_x, sec_y, sec_scale)); } @@ -1218,7 +1212,7 @@ void Converter<DDLPolyhedra>::operator()(xml_h element) const { } #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Polyhedra:startPhi=%8.3f [rad] deltaPhi=%8.3f [rad] %4d sides %4ld z-planes", @@ -1228,7 +1222,7 @@ void Converter<DDLPolyhedra>::operator()(xml_h element) const { z.size()); #endif - + ns.addSolid(nam, Polyhedra(numSide, startPhi, deltaPhi, z, rmin, rmax)); } @@ -1246,7 +1240,7 @@ void Converter<DDLSphere>::operator()(xml_h element) const { double deltaTheta = ns.attr<double>(e, DD_CMU(deltaTheta)); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Sphere: r_inner=%8.3f [cm] r_outer=%8.3f [cm]" @@ -1259,7 +1253,7 @@ void Converter<DDLSphere>::operator()(xml_h element) const { deltaTheta); #endif - + ns.addSolid(nam, Sphere(rinner, router, startTheta, deltaTheta, startPhi, deltaPhi)); } @@ -1276,7 +1270,7 @@ void Converter<DDLTorus>::operator()(xml_h element) const { double deltaPhi = ns.attr<double>(e, DD_CMU(deltaPhi)); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Torus: r=%10.3f [cm] r_inner=%10.3f [cm] r_outer=%10.3f [cm]" @@ -1288,7 +1282,7 @@ void Converter<DDLTorus>::operator()(xml_h element) const { deltaPhi); #endif - + ns.addSolid(nam, Torus(r, rinner, router, startPhi, deltaPhi)); } @@ -1307,7 +1301,7 @@ void Converter<DDLPseudoTrap>::operator()(xml_h element) const { bool atMinusZ = ns.attr<bool>(e, DD_CMU(atMinusZ)); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Pseudotrap: dz=%8.3f [cm] dx1:%.3f dy1:%.3f dx2=%.3f dy2=%.3f radius:%.3f atMinusZ:%s", @@ -1320,7 +1314,7 @@ void Converter<DDLPseudoTrap>::operator()(xml_h element) const { yes_no(atMinusZ)); #endif - + ns.addSolid(nam, PseudoTrap(dx1, dx2, dy1, dy2, dz, r, atMinusZ)); } @@ -1343,7 +1337,7 @@ void Converter<DDLTrapezoid>::operator()(xml_h element) const { double theta = ns.attr<double>(e, _U(theta), 0.0); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Trapezoid: dz=%10.3f [cm] alp1:%.3f bl1=%.3f tl1=%.3f alp2=%.3f bl2=%.3f tl2=%.3f h2=%.3f phi=%.3f " @@ -1361,7 +1355,7 @@ void Converter<DDLTrapezoid>::operator()(xml_h element) const { theta); #endif - + ns.addSolid(nam, Trap(dz, theta, phi, h1, bl1, tl1, alp1, h2, bl2, tl2, alp2)); } @@ -1377,9 +1371,8 @@ void Converter<DDLTrd1>::operator()(xml_h element) const { double dy2 = ns.attr<double>(e, DD_CMU(dy2), dy1); double dz = ns.attr<double>(e, DD_CMU(dz)); if (dy1 == dy2) { - #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Trd1: dz=%8.3f [cm] dx1:%.3f dy1:%.3f dx2:%.3f dy2:%.3f", @@ -1390,12 +1383,11 @@ void Converter<DDLTrd1>::operator()(xml_h element) const { dy2); #endif - + ns.addSolid(nam, Trd1(dx1, dx2, dy1, dz)); } else { - #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Trd1(which is actually Trd2): dz=%8.3f [cm] dx1:%.3f dy1:%.3f dx2:%.3f dy2:%.3f", @@ -1406,7 +1398,7 @@ void Converter<DDLTrd1>::operator()(xml_h element) const { dy2); #endif - + ns.addSolid(nam, Trd2(dx1, dx2, dy1, dy2, dz)); } } @@ -1424,7 +1416,7 @@ void Converter<DDLTrd2>::operator()(xml_h element) const { double dz = ns.attr<double>(e, DD_CMU(dz)); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Trd1: dz=%8.3f [cm] dx1:%.3f dy1:%.3f dx2:%.3f dy2:%.3f", @@ -1435,7 +1427,7 @@ void Converter<DDLTrd2>::operator()(xml_h element) const { dy2); #endif - + ns.addSolid(nam, Trd2(dx1, dx2, dy1, dy2, dz)); } @@ -1452,7 +1444,7 @@ void Converter<DDLTubs>::operator()(xml_h element) const { double deltaPhi = ns.attr<double>(e, DD_CMU(deltaPhi), 2 * M_PI); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Tubs: dz=%8.3f [cm] rmin=%8.3f [cm] rmax=%8.3f [cm]" @@ -1464,7 +1456,7 @@ void Converter<DDLTubs>::operator()(xml_h element) const { deltaPhi); #endif - + ns.addSolid(nam, Tube(rmin, rmax, dz, startPhi, startPhi + deltaPhi)); } @@ -1499,7 +1491,7 @@ void Converter<DDLCutTubs>::operator()(xml_h element) const { deltaPhi); #endif - + ns.addSolid(nam, CutTube(rmin, rmax, dz, startPhi, startPhi + deltaPhi, lx, ly, lz, tx, ty, tz)); } @@ -1533,8 +1525,8 @@ void Converter<DDLTruncTubs>::operator()(xml_h element) const { cutAtDelta, yes_no(cutInside)); - #endif - +#endif + ns.addSolid(nam, TruncatedTube(zhalf, rmin, rmax, startPhi, deltaPhi, cutAtStart, cutAtDelta, cutInside)); } @@ -1558,7 +1550,7 @@ void Converter<DDLEllipticalTube>::operator()(xml_h element) const { dz); #endif - + ns.addSolid(nam, EllipticalTube(dx, dy, dz)); } @@ -1594,7 +1586,7 @@ void Converter<DDLCone>::operator()(xml_h element) const { deltaPhi); #endif - + ns.addSolid(nam, ConeSegment(dz, rmin1, rmax1, rmin2, rmax2, startPhi, phi2)); } @@ -1613,7 +1605,7 @@ void Converter<DDLShapeless>::operator()(xml_h element) const { nam.c_str()); #endif - + ns.addSolid(nam, Box(1, 1, 1)); } @@ -1628,7 +1620,7 @@ void Converter<DDLBox>::operator()(xml_h element) const { double dz = ns.attr<double>(e, DD_CMU(dz)); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_shapes ? ALWAYS : DEBUG, "DD4CMS", "+ Box: dx=%10.3f [cm] dy=%10.3f [cm] dz=%10.3f [cm]", @@ -1637,7 +1629,7 @@ void Converter<DDLBox>::operator()(xml_h element) const { dz); #endif - + ns.addSolid(nam, Box(dx, dy, dz)); } @@ -1656,8 +1648,8 @@ void Converter<include_load>::operator()(xml_h element) const { "+++ Processing the CMS detector description %s", fname.c_str()); -#endif - +#endif + _option<DDRegistry>()->includes.emplace_back(doc); } @@ -1668,12 +1660,12 @@ void Converter<include_unload>::operator()(xml_h element) const { xml::DocumentHolder(xml_elt_t(element).document()).assign(nullptr); #ifdef EDM_ML_DEBUG - + printout(_param<cms::DDParsingContext>()->debug_includes ? ALWAYS : DEBUG, "DD4CMS", "+++ Finished processing %s", fname.c_str()); -#endif +#endif } /// DD4hep specific Converter for <Include/> tags: process only the constants @@ -1720,7 +1712,7 @@ void Converter<DDLDivision>::operator()(xml_h element) const { int nReplicas = e.hasAttr(DD_CMU(nReplicas)) ? ns.attr<int>(e, DD_CMU(nReplicas)) : 0; #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ Start executing Division of %s along %s (%d) with offset %6.3f and %6.3f to produce %s....", @@ -1732,7 +1724,7 @@ void Converter<DDLDivision>::operator()(xml_h element) const { childName.c_str()); #endif - + Volume parent = ns.volume(parentName); const TGeoShape* shape = parent.solid(); @@ -1744,7 +1736,7 @@ void Converter<DDLDivision>::operator()(xml_h element) const { int numCopies = (int)((sh->GetPhi2() - sh->GetPhi1()) / widthInDeg); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ ...divide %s along %s (%d) with offset %6.3f deg and %6.3f deg to produce %d copies", @@ -1756,13 +1748,13 @@ void Converter<DDLDivision>::operator()(xml_h element) const { numCopies); #endif - + Volume child = parent.divide(childName, static_cast<int>(axesmap.at(axis)), numCopies, startInDeg, widthInDeg); ns.context()->volumes[childName] = child; #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Parent: %-24s [%s] Child: %-32s [%s] is multivolume [%s]", @@ -1773,7 +1765,7 @@ void Converter<DDLDivision>::operator()(xml_h element) const { child.isValid() ? "VALID" : "INVALID", child->IsVolumeMulti() ? "YES" : "NO"); #endif - + } else if (cl == TGeoTrd1::Class()) { double dy = static_cast<const TGeoTrd1*>(shape)->GetDy(); @@ -1791,13 +1783,13 @@ void Converter<DDLDivision>::operator()(xml_h element) const { dy); #endif - + Volume child = parent.divide(childName, static_cast<int>(axesmap.at(axis)), nReplicas, -dy + offset + width, width); ns.context()->volumes[childName] = child; #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_placements ? ALWAYS : DEBUG, "DD4CMS", "+++ %s Parent: %-24s [%s] Child: %-32s [%s] is multivolume [%s]", @@ -1809,7 +1801,7 @@ void Converter<DDLDivision>::operator()(xml_h element) const { child->IsVolumeMulti() ? "YES" : "NO"); #endif - + } else { printout(ERROR, "DD4CMS", "++ FAILED Division of a %s is not implemented yet!", parent.solid().type()); } @@ -1827,25 +1819,24 @@ void Converter<DDLAlgorithm>::operator()(xml_h element) const { type[idx] = '_'; #ifdef EDM_ML_DEBUG - + printout( ns.context()->debug_algorithms ? ALWAYS : DEBUG, "DD4CMS", "+++ Start executing algorithm %s....", type.c_str()); -#endif +#endif long ret = PluginService::Create<long>(type, &description, ns.context(), &element); if (ret == s_executed) { - #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_algorithms ? ALWAYS : DEBUG, - "DD4CMS", + "DD4CMS", "+++ Executed algorithm: %08lX = %s", ret, name.c_str()); -#endif +#endif return; } printout(ERROR, "DD4CMS", "++ FAILED NOT ADDING SUBDETECTOR %08lX = %s", ret, name.c_str()); @@ -1910,7 +1901,7 @@ void Converter<DDLVector>::operator()(xml_h element) const { val.erase(remove_if(val.begin(), val.end(), [](unsigned char x) { return isspace(x); }), val.end()); #ifdef EDM_ML_DEBUG - + printout(ns.context()->debug_constants ? ALWAYS : DEBUG, "DD4CMS", "+++ Vector<%s>: %s[%s]: %s", @@ -1920,16 +1911,15 @@ void Converter<DDLVector>::operator()(xml_h element) const { val.c_str()); #endif - + try { std::vector<double> results = splitNumeric(val); registry->insert( {name, results}); //tbb::concurrent_vector<double, tbb::cache_aligned_allocator<double>>(results.begin(), results.end())}); } catch (const exception& e) { - #ifdef EDM_ML_DEBUG - + printout(INFO, "DD4CMS", "++ Unresolved Vector<%s>: %s[%s]: %s. Try to resolve later. [%s]", @@ -1940,7 +1930,7 @@ void Converter<DDLVector>::operator()(xml_h element) const { e.what()); #endif - + std::vector<string> results = splitString(val); context->unresolvedVectors.insert({name, results}); } @@ -1979,14 +1969,14 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { int count = 0; #ifdef EDM_ML_DEBUG - + printout(context->debug_constants ? ALWAYS : DEBUG, "DD4CMS", "+++ RESOLVING %ld unknown constants..... (out of %ld)", res->unresolvedConst.size(), res->originalConst.size()); #endif - + while (!res->unresolvedConst.empty()) { for (auto& i : res->unresolvedConst) { const string& n = i.first; @@ -2009,10 +1999,10 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { while ((idx = v.find("+-")) != string::npos) v.replace(idx, 2, "-"); } - + #ifdef EDM_ML_DEBUG - printout(context->debug_constants ? ALWAYS : DEBUG, + printout(context->debug_constants ? ALWAYS : DEBUG, "DD4CMS", "+++ [%06ld] ---------- %-40s = %s", res->unresolvedConst.size() - 1, @@ -2020,7 +2010,7 @@ void Converter<DDRegistry>::operator()(xml_h /* element */) const { res->originalConst[n].c_str()); #endif - + ns.addConstantNS(n, v, "number"); res->unresolvedConst.erase(n); break; @@ -2043,7 +2033,7 @@ void Converter<print_xml_doc>::operator()(xml_h element) const { string fname = xml::DocumentHandler::system_path(element); #ifdef EDM_ML_DEBUG - + printout(_param<cms::DDParsingContext>()->debug_includes ? ALWAYS : DEBUG, "DD4CMS", "+++ Processing data from: %s", diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc index 306e61d48c51b..c6fe2206a9f38 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc +++ b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc @@ -367,7 +367,7 @@ void DD4hep_ListGroups::analyze(const edm::Event &evt, const edm::EventSetup &se cms::DDFilteredView fv(*cpv, filter); for (const auto &t : fv.specpars()) { - m_group_names.insert(t->strValue("TrackingMaterialGroup")); + m_group_names.insert(t.second->strValue("TrackingMaterialGroup")); } for (const auto &i : m_group_names) { @@ -376,7 +376,7 @@ void DD4hep_ListGroups::analyze(const edm::Event &evt, const edm::EventSetup &se bool firstChild = fv1.firstChild(); for (const auto j : fv1.specpars()) { - for (const auto &k : j->paths) { + for (const auto &k : j.second->paths) { if (firstChild) { std::vector<std::vector<cms::Node *>> children = fv1.children(k); for (auto const &path : children) { diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListIds.cc b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListIds.cc index b5a29926e1086..d829b23665cc3 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListIds.cc +++ b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListIds.cc @@ -51,7 +51,7 @@ void DD4hep_ListIds::analyze(const edm::Event &evt, const edm::EventSetup &setup std::set<std::string_view> tkdss; for (const auto &t : fv.specpars()) { - tkdss.insert(t->strValue(attribute)); + tkdss.insert(t.second->strValue(attribute)); } for (const auto &i : tkdss) { diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc index 8dc741b90338b..a2230fbe84b23 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc +++ b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc @@ -35,7 +35,7 @@ DD4hep_MaterialAccountingGroup::DD4hep_MaterialAccountingGroup(const std::string edm::LogVerbatim("TrackingMaterialAnalysis") << "Elements within: " << name; for (const auto j : fv.specpars()) { - for (const auto& k : j->paths) { + for (const auto& k : j.second->paths) { if (firstChild) { std::vector<std::vector<cms::Node*>> children = fv.children(k); for (auto const& path : children) { From 58a5d0df77d81091639c7dceb83125abbd18856a Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Fri, 16 Oct 2020 11:20:52 +0200 Subject: [PATCH 710/778] clang tidy --- .../TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc | 2 +- .../plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc index c6fe2206a9f38..d8335b2fb5f2a 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc +++ b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc @@ -375,7 +375,7 @@ void DD4hep_ListGroups::analyze(const edm::Event &evt, const edm::EventSetup &se cms::DDFilteredView fv1(*cpv, filter1); bool firstChild = fv1.firstChild(); - for (const auto j : fv1.specpars()) { + for (const auto& j : fv1.specpars()) { for (const auto &k : j.second->paths) { if (firstChild) { std::vector<std::vector<cms::Node *>> children = fv1.children(k); diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc index a2230fbe84b23..896eac59774e5 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc +++ b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_MaterialAccountingGroup.cc @@ -34,7 +34,7 @@ DD4hep_MaterialAccountingGroup::DD4hep_MaterialAccountingGroup(const std::string edm::LogVerbatim("TrackingMaterialAnalysis") << "Elements within: " << name; - for (const auto j : fv.specpars()) { + for (const auto& j : fv.specpars()) { for (const auto& k : j.second->paths) { if (firstChild) { std::vector<std::vector<cms::Node*>> children = fv.children(k); From 784badbcfcea1c84bb9264860400737a2c066ac9 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Mon, 19 Oct 2020 15:57:52 +0200 Subject: [PATCH 711/778] one more fix and code format --- SimG4Core/DD4hepGeometry/test/plugins/DD4hepTestDDDWorld.cc | 6 +++--- .../plugins/dd4hep/DD4hep_ListGroups.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SimG4Core/DD4hepGeometry/test/plugins/DD4hepTestDDDWorld.cc b/SimG4Core/DD4hepGeometry/test/plugins/DD4hepTestDDDWorld.cc index 4a8faa9e74551..3ab1eeaf56d4a 100644 --- a/SimG4Core/DD4hepGeometry/test/plugins/DD4hepTestDDDWorld.cc +++ b/SimG4Core/DD4hepGeometry/test/plugins/DD4hepTestDDDWorld.cc @@ -106,14 +106,14 @@ void DD4hepTestDDDWorld::initialize(const dd4hep::sim::Geant4GeometryMaps::Volum LogVerbatim("Geometry").log([&](auto& log) { for (auto const& it : vmap) { for (auto const& fit : specs_) { - for (auto const& sit : fit->spars) { + for (auto const& sit : fit.second->spars) { log << sit.first << " = " << sit.second[0] << "\n"; } - for (auto const& pit : fit->paths) { + for (auto const& pit : fit.second->paths) { log << dd4hep::dd::realTopName(pit) << "\n"; log << " compare equal to " << dd4hep::dd::noNamespace(it.first.name()) << " ... "; if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first.name()), dd4hep::dd::realTopName(pit))) { - vec_.emplace_back(std::make_pair<G4LogicalVolume*, const dd4hep::SpecPar*>(&*it.second, &*fit)); + vec_.emplace_back(std::make_pair<G4LogicalVolume*, const dd4hep::SpecPar*>(&*it.second, &*fit.second)); log << " are equal!\n"; } else log << " nope.\n"; diff --git a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc index d8335b2fb5f2a..35335a64c2b7b 100644 --- a/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc +++ b/SimTracker/TrackerMaterialAnalysis/plugins/dd4hep/DD4hep_ListGroups.cc @@ -375,7 +375,7 @@ void DD4hep_ListGroups::analyze(const edm::Event &evt, const edm::EventSetup &se cms::DDFilteredView fv1(*cpv, filter1); bool firstChild = fv1.firstChild(); - for (const auto& j : fv1.specpars()) { + for (const auto &j : fv1.specpars()) { for (const auto &k : j.second->paths) { if (firstChild) { std::vector<std::vector<cms::Node *>> children = fv1.children(k); From 6828a9f31e303460575536fa985281622cc392e4 Mon Sep 17 00:00:00 2001 From: Jonas Rembser <jonas.rembser@cern.ch> Date: Tue, 20 Oct 2020 12:30:15 +0200 Subject: [PATCH 712/778] use edm::ESWatcher to see if records change --- .../EgammaElectronAlgos/interface/ElectronSeedGenerator.h | 8 +++----- .../EgammaElectronAlgos/src/ElectronSeedGenerator.cc | 4 +++- .../plugins/ElectronSeedProducer.cc | 4 ++-- .../plugins/TrackingRegionsFromSuperClustersProducer.cc | 8 ++++---- RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h b/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h index e5cc3b315b5dc..2b3435999e79d 100644 --- a/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h +++ b/RecoEgamma/EgammaElectronAlgos/interface/ElectronSeedGenerator.h @@ -35,6 +35,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ESWatcher.h" #include "FWCore/Framework/interface/EDConsumerBase.h" #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h" @@ -74,6 +75,8 @@ class ElectronSeedGenerator { const edm::EDGetTokenT<reco::BeamSpot> beamSpotTag_; const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_; const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeometryToken_; + edm::ESWatcher<IdealMagneticFieldRecord> magneticFieldWatcher_; + edm::ESWatcher<TrackerDigiGeometryRecord> trackerGeometryWatcher_; const float lowPtThresh_; const float highPtThresh_; @@ -90,11 +93,6 @@ class ElectronSeedGenerator { const std::vector<const TrajectorySeedCollection*>* initialSeedCollectionVector_ = nullptr; - // keep cacheIds to get records only when necessary - unsigned long long cacheIDMagField_ = 0; - unsigned long long cacheIDCkfComp_ = 0; - unsigned long long cacheIDTrkGeom_ = 0; - const bool useRecoVertex_; const float deltaPhi2B_; diff --git a/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc b/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc index 57e629923b7fc..661c5752dba55 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/ElectronSeedGenerator.cc @@ -164,7 +164,9 @@ ElectronSeedGenerator::ElectronSeedGenerator(const edm::ParameterSet &pset, useRecoVertex_) {} void ElectronSeedGenerator::setupES(const edm::EventSetup &setup) { - matcher_.setES(setup.getData(magFieldToken_), setup.getData(trackerGeometryToken_)); + if (magneticFieldWatcher_.check(setup) || trackerGeometryWatcher_.check(setup)) { + matcher_.setES(setup.getData(magFieldToken_), setup.getData(trackerGeometryToken_)); + } } void ElectronSeedGenerator::run(edm::Event &e, diff --git a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc index db9e0085c548f..96578f86d3b38 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc @@ -72,7 +72,7 @@ ElectronSeedProducer::ElectronSeedProducer(const edm::ParameterSet& conf) auto theconsumes = consumesCollector(); // new beamSpot tag - beamSpotTag_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpot")); + beamSpotTag_ = consumes(conf.getParameter<edm::InputTag>("beamSpot")); // for H/E applyHOverECut_ = conf.getParameter<bool>("applyHOverECut"); @@ -81,7 +81,7 @@ ElectronSeedProducer::ElectronSeedProducer(const edm::ParameterSet& conf) hcalCfg.hOverEConeSize = conf.getParameter<double>("hOverEConeSize"); if (hcalCfg.hOverEConeSize > 0) { hcalCfg.useTowers = true; - hcalCfg.hcalTowers = consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("hcalTowers")); + hcalCfg.hcalTowers = consumes(conf.getParameter<edm::InputTag>("hcalTowers")); hcalCfg.hOverEPtMin = conf.getParameter<double>("hOverEPtMin"); } hcalHelper_ = std::make_unique<ElectronHcalHelper>(hcalCfg, consumesCollector()); diff --git a/RecoEgamma/EgammaElectronProducers/plugins/TrackingRegionsFromSuperClustersProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/TrackingRegionsFromSuperClustersProducer.cc index 3a70d6dba0a40..9d3e0d2329349 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/TrackingRegionsFromSuperClustersProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/TrackingRegionsFromSuperClustersProducer.cc @@ -172,15 +172,15 @@ TrackingRegionsFromSuperClustersProducer::TrackingRegionsFromSuperClustersProduc auto measTrackerEventTag = regionPSet.getParameter<edm::InputTag>("measurementTrackerEvent"); if (useZInVertex_) { - verticesToken_ = iC.consumes<reco::VertexCollection>(verticesTag); + verticesToken_ = iC.consumes(verticesTag); } else { - beamSpotToken_ = iC.consumes<reco::BeamSpot>(beamSpotTag); + beamSpotToken_ = iC.consumes(beamSpotTag); } if (whereToUseMeasTracker_ != RectangularEtaPhiTrackingRegion::UseMeasurementTracker::kNever) { - measTrackerEventToken_ = iC.consumes<MeasurementTrackerEvent>(measTrackerEventTag); + measTrackerEventToken_ = iC.consumes(measTrackerEventTag); } for (const auto& tag : superClustersTags) { - superClustersTokens_.emplace_back(iC.consumes<std::vector<reco::SuperClusterRef>>(tag)); + superClustersTokens_.emplace_back(iC.consumes(tag)); } } diff --git a/RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h b/RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h index 08fbdaaecec9c..600f797a9e7ad 100644 --- a/RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h +++ b/RecoLocalCalo/HGCalRecAlgos/interface/ClusterTools.h @@ -9,8 +9,8 @@ #include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h" #include "DataFormats/CaloRecHit/interface/CaloCluster.h" #include "DataFormats/ParticleFlowReco/interface/HGCalMultiCluster.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/ConsumesCollector.h" From 7f462071c41836ae2670b4a4b13a9dd1c8d7ceab Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Tue, 20 Oct 2020 12:04:51 +0200 Subject: [PATCH 713/778] fix stray Global Tags post GeometricDetExtra Migration --- Configuration/PyReleaseValidation/python/relval_steps.py | 6 +++--- .../python/config/FrontierCondition_GT_autoExpress_cfi.py | 2 +- DQM/Integration/python/config/FrontierCondition_GT_cfi.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 0e46f23fddcbe..6c4d3499295ac 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -2093,7 +2093,7 @@ def lhegensim2018ml(fragment,howMuch): steps['ALCAHARVDHPBS']={'-s':'ALCAHARVEST:%s'%(autoPCL['PromptCalibProdBeamSpotHP']), #'--conditions':'auto:run2_data_promptlike', - '--conditions':'92X_dataRun2_Express_v2_snapshotted', # to replaced with line above once run2_data_promptlike will contain DropBoxMetadata + '--conditions':'auto:run3_data_express', # to replaced with line above once run2_data_promptlike will contain DropBoxMetadata '--scenario':'pp', '--data':'', '--era':'Run2_2017', @@ -2102,7 +2102,7 @@ def lhegensim2018ml(fragment,howMuch): steps['ALCAHARVDHPBSLOWPU']={'-s':'ALCAHARVEST:%s'%(autoPCL['PromptCalibProdBeamSpotHPLowPU']), #'--conditions':'auto:run2_data_promptlike', - '--conditions':'92X_dataRun2_Express_v2_snapshotted', # to replaced with line above once run2_data_promptlike will contain DropBoxMetadata + '--conditions':'auto:run3_data_express', # to replaced with line above once run2_data_promptlike will contain DropBoxMetadata '--scenario':'pp', '--data':'', '--era':'Run2_2017', @@ -2111,7 +2111,7 @@ def lhegensim2018ml(fragment,howMuch): steps['ALCAHARVDSIPIXELCAL']={'-s':'ALCAHARVEST:%s'%(autoPCL['PromptCalibProdSiPixel']), - '--conditions':'100X_dataRun2_Express_v2', + '--conditions':'auto:run3_data_express', '--scenario':'pp', '--data':'', '--era':'Run2_2017', diff --git a/DQM/Integration/python/config/FrontierCondition_GT_autoExpress_cfi.py b/DQM/Integration/python/config/FrontierCondition_GT_autoExpress_cfi.py index 0a115936e0af8..0f9d82935786a 100644 --- a/DQM/Integration/python/config/FrontierCondition_GT_autoExpress_cfi.py +++ b/DQM/Integration/python/config/FrontierCondition_GT_autoExpress_cfi.py @@ -7,7 +7,7 @@ # It should be kept in synch with Express processing at Tier0: what the url # https://cmsweb.cern.ch/t0wmadatasvc/prod/express_config # would tell you. -GlobalTag.globaltag = "106X_dataRun3_Express_v2" +GlobalTag.globaltag = "111X_dataRun3_Express_v4" # ===== auto -> Automatically get the GT string from current Tier0 configuration via a Tier0Das call. # This needs a valid proxy to access the cern.ch network from the .cms one. diff --git a/DQM/Integration/python/config/FrontierCondition_GT_cfi.py b/DQM/Integration/python/config/FrontierCondition_GT_cfi.py index 2ed754649750f..fafa0c11ecc74 100644 --- a/DQM/Integration/python/config/FrontierCondition_GT_cfi.py +++ b/DQM/Integration/python/config/FrontierCondition_GT_cfi.py @@ -1,3 +1,3 @@ import FWCore.ParameterSet.Config as cms from Configuration.StandardSequences.FrontierConditions_GlobalTag_cff import * -GlobalTag.globaltag = "111X_dataRun3_HLT_GEMRecoGEO_v1" +GlobalTag.globaltag = "111X_dataRun3_HLT_v3" From 21c3725b2c4715d124ca0e4630009423f38281f5 Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Wed, 14 Nov 2018 23:56:26 +0100 Subject: [PATCH 714/778] Synchronise with CMSSW_10_4_0_pre2 --- DataFormats/CaloRecHit/test/BuildFile.xml | 15 ++-- .../CaloRecHit/test/test_calo_rechit.cu | 72 +++++++++---------- 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/DataFormats/CaloRecHit/test/BuildFile.xml b/DataFormats/CaloRecHit/test/BuildFile.xml index abf5dd0108a73..983e853f47698 100644 --- a/DataFormats/CaloRecHit/test/BuildFile.xml +++ b/DataFormats/CaloRecHit/test/BuildFile.xml @@ -1,14 +1,13 @@ -<bin name="testCaloCluster" file="testRunner.cpp,testCaloCluster.cppunit.cc"> - <use name="DataFormats/CaloRecHit"/> - <use name="DataFormats/Math"/> - <use name="cppunit"/> +<bin name="testCaloCluster" file="testRunner.cpp,testCaloCluster.cppunit.cc"> + + <use name="DataFormats/CaloRecHit"/> + <use name="DataFormats/Math"/> + <use name="cppunit"/> </bin> - <iftool name="cuda-gcc-support"> - <bin name="test_calo_rechit" file="test_calo_rechit.cu"> +<bin name="test_calo_rechit" file="test_calo_rechit.cu"> <use name="DataFormats/CaloRecHit"/> <use name="DataFormats/DetId"/> <use name="cuda"/> - </bin> - +</bin> </iftool> diff --git a/DataFormats/CaloRecHit/test/test_calo_rechit.cu b/DataFormats/CaloRecHit/test/test_calo_rechit.cu index 9c24668240425..595127824d61e 100644 --- a/DataFormats/CaloRecHit/test/test_calo_rechit.cu +++ b/DataFormats/CaloRecHit/test/test_calo_rechit.cu @@ -7,48 +7,48 @@ #include "DataFormats/CaloRecHit/interface/CaloRecHit.h" __global__ void kernel_test_calo_rechit(CaloRecHit* other) { - CaloRecHit rh{DetId(0), 10, 1, 0, 0}; - other->setEnergy(rh.energy()); - other->setTime(rh.time()); - other->setFlagField(10, 31, 1); + CaloRecHit rh{DetId(0), 10, 1, 0, 0}; + other->setEnergy(rh.energy()); + other->setTime(rh.time()); + other->setFlagField(10, 31, 1); } void test_calo_rechit() { - auto check_error = [](auto code) { - if (code != cudaSuccess) { - std::cout << cudaGetErrorString(code) << std::endl; - assert(false); - } - }; - - CaloRecHit h_rh, h_rh_test{DetId(0), 10, 1, 0, 0}; - h_rh_test.setFlagField(10, 31, 1); - CaloRecHit* d_rh; - - cudaMalloc((void**)&d_rh, sizeof(CaloRecHit)); - cudaMemcpy(d_rh, &h_rh, sizeof(CaloRecHit), cudaMemcpyHostToDevice); - kernel_test_calo_rechit<<<1, 1>>>(d_rh); - cudaDeviceSynchronize(); - check_error(cudaGetLastError()); - cudaMemcpy(&h_rh, d_rh, sizeof(CaloRecHit), cudaMemcpyDeviceToHost); - - std::cout << h_rh << std::endl; - std::cout << h_rh_test << std::endl; - assert(h_rh.energy() == h_rh_test.energy()); - assert(h_rh.time() == h_rh_test.time()); - assert(h_rh.flags() == h_rh_test.flags()); - assert(h_rh.aux() == h_rh_test.aux()); - assert(h_rh.detid() == h_rh_test.detid()); + auto check_error = [](auto code) { + if (code != cudaSuccess) { + std::cout << cudaGetErrorString(code) << std::endl; + assert(false); + } + }; + + CaloRecHit h_rh, h_rh_test{DetId(0), 10, 1, 0, 0}; + h_rh_test.setFlagField(10, 31, 1); + CaloRecHit *d_rh; + + cudaMalloc((void**)&d_rh, sizeof(CaloRecHit)); + cudaMemcpy(d_rh, &h_rh, sizeof(CaloRecHit), cudaMemcpyHostToDevice); + kernel_test_calo_rechit<<<1,1>>>(d_rh); + cudaDeviceSynchronize(); + check_error(cudaGetLastError()); + cudaMemcpy(&h_rh, d_rh, sizeof(CaloRecHit), cudaMemcpyDeviceToHost); + + std::cout << h_rh << std::endl; + std::cout << h_rh_test << std::endl; + assert(h_rh.energy() == h_rh_test.energy()); + assert(h_rh.time() == h_rh_test.time()); + assert(h_rh.flags() == h_rh_test.flags()); + assert(h_rh.aux() == h_rh_test.aux()); + assert(h_rh.detid() == h_rh_test.detid()); } int main(int argc, char** argv) { - int nDevices; - cudaGetDeviceCount(&nDevices); - std::cout << "nDevices = " << nDevices << std::endl; + int nDevices; + cudaGetDeviceCount(&nDevices); + std::cout << "nDevices = " << nDevices << std::endl; - if (nDevices > 0) - test_calo_rechit(); + if (nDevices > 0) + test_calo_rechit(); - std::cout << "all good!" << std::endl; - return 0; + std::cout << "all good!" << std::endl; + return 0; } From ec46b7ce25f44640e506421684924acb3b1cb2e7 Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Thu, 17 Jan 2019 15:50:11 +0100 Subject: [PATCH 715/778] Skip CUDA-related tests if no GPU is present (#252) Make unit tests that require a CUDA device skip the test and exit succesfully if the CUDA runtime is not available, or no CUDA devices are available. --- DataFormats/CaloRecHit/test/BuildFile.xml | 13 +++++++------ DataFormats/CaloRecHit/test/test_calo_rechit.cu | 14 ++++++-------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/DataFormats/CaloRecHit/test/BuildFile.xml b/DataFormats/CaloRecHit/test/BuildFile.xml index 983e853f47698..6daf8cf086086 100644 --- a/DataFormats/CaloRecHit/test/BuildFile.xml +++ b/DataFormats/CaloRecHit/test/BuildFile.xml @@ -1,13 +1,14 @@ -<bin name="testCaloCluster" file="testRunner.cpp,testCaloCluster.cppunit.cc"> - - <use name="DataFormats/CaloRecHit"/> - <use name="DataFormats/Math"/> - <use name="cppunit"/> +<bin name="testCaloCluster" file="testRunner.cpp,testCaloCluster.cppunit.cc"> + <use name="cppunit"/> + <use name="DataFormats/CaloRecHit"/> + <use name="DataFormats/Math"/> </bin> + <iftool name="cuda-gcc-support"> <bin name="test_calo_rechit" file="test_calo_rechit.cu"> + <use name="cuda"/> <use name="DataFormats/CaloRecHit"/> <use name="DataFormats/DetId"/> - <use name="cuda"/> + <use name="HeterogeneousCore/CUDAUtilities"/> </bin> </iftool> diff --git a/DataFormats/CaloRecHit/test/test_calo_rechit.cu b/DataFormats/CaloRecHit/test/test_calo_rechit.cu index 595127824d61e..76475bc0aabdb 100644 --- a/DataFormats/CaloRecHit/test/test_calo_rechit.cu +++ b/DataFormats/CaloRecHit/test/test_calo_rechit.cu @@ -1,10 +1,11 @@ +#include <cassert> +#include <iostream> + #include <cuda.h> #include <cuda_runtime.h> -#include <iostream> -#include <cassert> - #include "DataFormats/CaloRecHit/interface/CaloRecHit.h" +#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h" __global__ void kernel_test_calo_rechit(CaloRecHit* other) { CaloRecHit rh{DetId(0), 10, 1, 0, 0}; @@ -42,12 +43,9 @@ void test_calo_rechit() { } int main(int argc, char** argv) { - int nDevices; - cudaGetDeviceCount(&nDevices); - std::cout << "nDevices = " << nDevices << std::endl; + exitSansCUDADevices(); - if (nDevices > 0) - test_calo_rechit(); + test_calo_rechit(); std::cout << "all good!" << std::endl; return 0; From 6ecc08d086b1f8f6cec76042c5f5880271f655dc Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Thu, 12 Sep 2019 00:22:05 +0200 Subject: [PATCH 716/778] Apply clang-format style formatting --- .../CaloRecHit/test/test_calo_rechit.cu | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/DataFormats/CaloRecHit/test/test_calo_rechit.cu b/DataFormats/CaloRecHit/test/test_calo_rechit.cu index 76475bc0aabdb..301db13ba508f 100644 --- a/DataFormats/CaloRecHit/test/test_calo_rechit.cu +++ b/DataFormats/CaloRecHit/test/test_calo_rechit.cu @@ -8,45 +8,45 @@ #include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h" __global__ void kernel_test_calo_rechit(CaloRecHit* other) { - CaloRecHit rh{DetId(0), 10, 1, 0, 0}; - other->setEnergy(rh.energy()); - other->setTime(rh.time()); - other->setFlagField(10, 31, 1); + CaloRecHit rh{DetId(0), 10, 1, 0, 0}; + other->setEnergy(rh.energy()); + other->setTime(rh.time()); + other->setFlagField(10, 31, 1); } void test_calo_rechit() { - auto check_error = [](auto code) { - if (code != cudaSuccess) { - std::cout << cudaGetErrorString(code) << std::endl; - assert(false); - } - }; - - CaloRecHit h_rh, h_rh_test{DetId(0), 10, 1, 0, 0}; - h_rh_test.setFlagField(10, 31, 1); - CaloRecHit *d_rh; - - cudaMalloc((void**)&d_rh, sizeof(CaloRecHit)); - cudaMemcpy(d_rh, &h_rh, sizeof(CaloRecHit), cudaMemcpyHostToDevice); - kernel_test_calo_rechit<<<1,1>>>(d_rh); - cudaDeviceSynchronize(); - check_error(cudaGetLastError()); - cudaMemcpy(&h_rh, d_rh, sizeof(CaloRecHit), cudaMemcpyDeviceToHost); - - std::cout << h_rh << std::endl; - std::cout << h_rh_test << std::endl; - assert(h_rh.energy() == h_rh_test.energy()); - assert(h_rh.time() == h_rh_test.time()); - assert(h_rh.flags() == h_rh_test.flags()); - assert(h_rh.aux() == h_rh_test.aux()); - assert(h_rh.detid() == h_rh_test.detid()); + auto check_error = [](auto code) { + if (code != cudaSuccess) { + std::cout << cudaGetErrorString(code) << std::endl; + assert(false); + } + }; + + CaloRecHit h_rh, h_rh_test{DetId(0), 10, 1, 0, 0}; + h_rh_test.setFlagField(10, 31, 1); + CaloRecHit* d_rh; + + cudaMalloc((void**)&d_rh, sizeof(CaloRecHit)); + cudaMemcpy(d_rh, &h_rh, sizeof(CaloRecHit), cudaMemcpyHostToDevice); + kernel_test_calo_rechit<<<1, 1>>>(d_rh); + cudaDeviceSynchronize(); + check_error(cudaGetLastError()); + cudaMemcpy(&h_rh, d_rh, sizeof(CaloRecHit), cudaMemcpyDeviceToHost); + + std::cout << h_rh << std::endl; + std::cout << h_rh_test << std::endl; + assert(h_rh.energy() == h_rh_test.energy()); + assert(h_rh.time() == h_rh_test.time()); + assert(h_rh.flags() == h_rh_test.flags()); + assert(h_rh.aux() == h_rh_test.aux()); + assert(h_rh.detid() == h_rh_test.detid()); } int main(int argc, char** argv) { - exitSansCUDADevices(); + exitSansCUDADevices(); - test_calo_rechit(); + test_calo_rechit(); - std::cout << "all good!" << std::endl; - return 0; + std::cout << "all good!" << std::endl; + return 0; } From c58b7af60d974e43f7aab94311ac5bdda49d079e Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Mon, 2 Dec 2019 14:43:35 +0100 Subject: [PATCH 717/778] Rename exitSansCUDADevices to requireCUDADevices (#423) --- DataFormats/CaloRecHit/test/test_calo_rechit.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataFormats/CaloRecHit/test/test_calo_rechit.cu b/DataFormats/CaloRecHit/test/test_calo_rechit.cu index 301db13ba508f..a22fb77dc7d06 100644 --- a/DataFormats/CaloRecHit/test/test_calo_rechit.cu +++ b/DataFormats/CaloRecHit/test/test_calo_rechit.cu @@ -5,7 +5,7 @@ #include <cuda_runtime.h> #include "DataFormats/CaloRecHit/interface/CaloRecHit.h" -#include "HeterogeneousCore/CUDAUtilities/interface/exitSansCUDADevices.h" +#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h" __global__ void kernel_test_calo_rechit(CaloRecHit* other) { CaloRecHit rh{DetId(0), 10, 1, 0, 0}; @@ -43,7 +43,7 @@ void test_calo_rechit() { } int main(int argc, char** argv) { - exitSansCUDADevices(); + requireCUDADevices(); test_calo_rechit(); From d83badbe3e74f79d1e5754fd540355bd7f61179d Mon Sep 17 00:00:00 2001 From: Matti Kortelainen <matti.kortelainen@cern.ch> Date: Fri, 17 Jan 2020 09:10:53 -0600 Subject: [PATCH 718/778] Implement changes from the CUDA framework review (#429) Rename the cudautils namespace to cms::cuda or cms::cudatest, and drop the CUDA prefix from the symbols defined there. Always record and query the CUDA event, to minimize need for error checking in CUDAScopedContextProduce destructor. Add comments to highlight the pieces in CachingDeviceAllocator that have been changed wrt. cub. Various other updates and clean up: - enable CUDA for compute capability 3.5. - clean up CUDAService, CUDA tests and plugins. - add CUDA existence protections to BuildFiles. - mark thread-safe static variables with CMS_THREAD_SAFE. --- DataFormats/CaloRecHit/test/test_calo_rechit.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DataFormats/CaloRecHit/test/test_calo_rechit.cu b/DataFormats/CaloRecHit/test/test_calo_rechit.cu index a22fb77dc7d06..21b53aeeca94f 100644 --- a/DataFormats/CaloRecHit/test/test_calo_rechit.cu +++ b/DataFormats/CaloRecHit/test/test_calo_rechit.cu @@ -5,7 +5,7 @@ #include <cuda_runtime.h> #include "DataFormats/CaloRecHit/interface/CaloRecHit.h" -#include "HeterogeneousCore/CUDAUtilities/interface/requireCUDADevices.h" +#include "HeterogeneousCore/CUDAUtilities/interface/requireDevices.h" __global__ void kernel_test_calo_rechit(CaloRecHit* other) { CaloRecHit rh{DetId(0), 10, 1, 0, 0}; @@ -43,7 +43,7 @@ void test_calo_rechit() { } int main(int argc, char** argv) { - requireCUDADevices(); + cms::cudatest::requireDevices(); test_calo_rechit(); From 19af36700dbde46df2a7d70882dd16205860ba3f Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Mon, 11 May 2020 14:49:56 +0200 Subject: [PATCH 719/778] Synchronise with CMSSW_11_1_0_pre7 --- DataFormats/CaloRecHit/test/BuildFile.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DataFormats/CaloRecHit/test/BuildFile.xml b/DataFormats/CaloRecHit/test/BuildFile.xml index 6daf8cf086086..8f507461fbb6b 100644 --- a/DataFormats/CaloRecHit/test/BuildFile.xml +++ b/DataFormats/CaloRecHit/test/BuildFile.xml @@ -1,14 +1,14 @@ <bin name="testCaloCluster" file="testRunner.cpp,testCaloCluster.cppunit.cc"> - <use name="cppunit"/> <use name="DataFormats/CaloRecHit"/> <use name="DataFormats/Math"/> + <use name="cppunit"/> </bin> <iftool name="cuda-gcc-support"> -<bin name="test_calo_rechit" file="test_calo_rechit.cu"> - <use name="cuda"/> + <bin name="test_calo_rechit" file="test_calo_rechit.cu"> <use name="DataFormats/CaloRecHit"/> <use name="DataFormats/DetId"/> <use name="HeterogeneousCore/CUDAUtilities"/> -</bin> + <use name="cuda"/> + </bin> </iftool> From 230403b98509ef8ec2a3152c0de24aeff65aa43c Mon Sep 17 00:00:00 2001 From: Viktor Khristenko <vdkhristenko1991@gmail.com> Date: Sun, 12 Jul 2020 14:43:04 +0200 Subject: [PATCH 720/778] Update ECAL and HCAL reconstruction to run on multple GPUs [1/3] (#502) Use caching allocators for host and device CUDA memory. Use dedicated ESProducers to make part of the modules' configuration available on all GPUs. Rename hcal and hcal::common namespaces to to calo::common. --- CUDADataFormats/CaloCommon/BuildFile.xml | 6 ++ CUDADataFormats/CaloCommon/interface/Common.h | 68 +++++++++++++++++++ CUDADataFormats/CaloCommon/src/classes.h | 2 + .../CaloCommon/src/classes_def.xml | 8 +++ 4 files changed, 84 insertions(+) create mode 100644 CUDADataFormats/CaloCommon/BuildFile.xml create mode 100644 CUDADataFormats/CaloCommon/interface/Common.h create mode 100644 CUDADataFormats/CaloCommon/src/classes.h create mode 100644 CUDADataFormats/CaloCommon/src/classes_def.xml diff --git a/CUDADataFormats/CaloCommon/BuildFile.xml b/CUDADataFormats/CaloCommon/BuildFile.xml new file mode 100644 index 0000000000000..635af5bdaf6b3 --- /dev/null +++ b/CUDADataFormats/CaloCommon/BuildFile.xml @@ -0,0 +1,6 @@ +<use name="CUDADataFormats/Common" /> +<use name="HeterogeneousCore/CUDAUtilities"/> + +<export> + <lib name="1"/> +</export> diff --git a/CUDADataFormats/CaloCommon/interface/Common.h b/CUDADataFormats/CaloCommon/interface/Common.h new file mode 100644 index 0000000000000..ca5ce8ed734bb --- /dev/null +++ b/CUDADataFormats/CaloCommon/interface/Common.h @@ -0,0 +1,68 @@ +#ifndef CUDADataFormats_CaloCommon_interface_Common_h +#define CUDADataFormats_CaloCommon_interface_Common_h + +#include <vector> + +#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h" +#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" + +namespace calo { + namespace common { + + // FIXME: not able to get enums to work with genreflex + namespace tags { + + struct Vec {}; + struct Ptr {}; + struct DevPtr {}; + + } // namespace tags + + template <typename tag> + struct AddSize {}; + + template <> + struct AddSize<tags::Ptr> { + uint32_t size; + }; + + template<> + struct AddSize<tags::DevPtr> { + uint32_t size; + }; + + struct ViewStoragePolicy { + using TagType = tags::Ptr; + + template <typename T> + struct StorageSelector { + using type = T*; + }; + }; + + struct DevStoragePolicy { + using TagType = tags::DevPtr; + + template<typename T> + struct StorageSelector { + using type = cms::cuda::device::unique_ptr<T[]>; + }; + }; + + template <template <typename> typename Allocator = std::allocator> + struct VecStoragePolicy { + using TagType = tags::Vec; + + template <typename T> + struct StorageSelector { + using type = std::vector<T, Allocator<T>>; + }; + }; + + template <typename T> + using CUDAHostAllocatorAlias = cms::cuda::HostAllocator<T>; + + } // namespace common +} // namespace calo + +#endif // CUDADataFormats_CaloCommon_interface_Common_h diff --git a/CUDADataFormats/CaloCommon/src/classes.h b/CUDADataFormats/CaloCommon/src/classes.h new file mode 100644 index 0000000000000..8eff4378875a9 --- /dev/null +++ b/CUDADataFormats/CaloCommon/src/classes.h @@ -0,0 +1,2 @@ +#include "DataFormats/Common/interface/Wrapper.h" +#include "CUDADataFormats/CaloCommon/interface/Common.h" diff --git a/CUDADataFormats/CaloCommon/src/classes_def.xml b/CUDADataFormats/CaloCommon/src/classes_def.xml new file mode 100644 index 0000000000000..6ac0b60762027 --- /dev/null +++ b/CUDADataFormats/CaloCommon/src/classes_def.xml @@ -0,0 +1,8 @@ +<lcgdict> + <enum name="calo::common::tags::Ptr"/> + <enum name="calo::common::tags::Vec"/> + <enum name="calo::common::tags::DevPtr"/> + <class name="calo::common::AddSize<calo::common::tags::Ptr>"/> + <class name="calo::common::AddSize<calo::common::tags::Vec>"/> + <class name="calo::common::AddSize<calo::common::tags::DevPtr>"/> +</lcgdict> From 1c0e66ddf22e157039917d8b77e8d32e3d267a1b Mon Sep 17 00:00:00 2001 From: Andrea Bocci <andrea.bocci@cern.ch> Date: Sun, 12 Jul 2020 15:09:00 +0200 Subject: [PATCH 721/778] Apply code formatting --- CUDADataFormats/CaloCommon/interface/Common.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CUDADataFormats/CaloCommon/interface/Common.h b/CUDADataFormats/CaloCommon/interface/Common.h index ca5ce8ed734bb..1be760ec917df 100644 --- a/CUDADataFormats/CaloCommon/interface/Common.h +++ b/CUDADataFormats/CaloCommon/interface/Common.h @@ -26,9 +26,9 @@ namespace calo { uint32_t size; }; - template<> + template <> struct AddSize<tags::DevPtr> { - uint32_t size; + uint32_t size; }; struct ViewStoragePolicy { @@ -43,9 +43,9 @@ namespace calo { struct DevStoragePolicy { using TagType = tags::DevPtr; - template<typename T> + template <typename T> struct StorageSelector { - using type = cms::cuda::device::unique_ptr<T[]>; + using type = cms::cuda::device::unique_ptr<T[]>; }; }; @@ -58,7 +58,7 @@ namespace calo { using type = std::vector<T, Allocator<T>>; }; }; - + template <typename T> using CUDAHostAllocatorAlias = cms::cuda::HostAllocator<T>; From 8938c570e40f46eb8a0a7ed74e7fbac07f0f183a Mon Sep 17 00:00:00 2001 From: mariadalfonso <mariadalfonso@users.noreply.github.com> Date: Tue, 20 Oct 2020 09:25:14 +0200 Subject: [PATCH 722/778] Move multifit/MAHI common code to DataFormats/CaloRecHit (#557) Move multifit/MAHI common code to DataFormats/CaloRecHit/interface/MultifitComputations.h . Improve naming and description of fnnls parameters. Use Eigen preprocessor symbols instead of explicit CUDA keywords, and CUDA preprocessor symbols to protect CUDA-only functions. Co-authored-by: Andrea Bocci <andrea.bocci@cern.ch> --- .../interface/MultifitComputations.h | 446 ++++++++++++++++++ 1 file changed, 446 insertions(+) create mode 100644 DataFormats/CaloRecHit/interface/MultifitComputations.h diff --git a/DataFormats/CaloRecHit/interface/MultifitComputations.h b/DataFormats/CaloRecHit/interface/MultifitComputations.h new file mode 100644 index 0000000000000..c62765b747ac6 --- /dev/null +++ b/DataFormats/CaloRecHit/interface/MultifitComputations.h @@ -0,0 +1,446 @@ +#ifndef DataFormats_CaloRecHit_interface_MultifitComputations_h +#define DataFormats_CaloRecHit_interface_MultifitComputations_h + +#include <cmath> +#include <limits> +#include <type_traits> + +#include <Eigen/Dense> + +namespace calo { + namespace multifit { + + template <int NROWS, int NCOLS> + using ColMajorMatrix = Eigen::Matrix<float, NROWS, NCOLS, Eigen::ColMajor>; + + template <int NROWS, int NCOLS> + using RowMajorMatrix = Eigen::Matrix<float, NROWS, NCOLS, Eigen::RowMajor>; + + template <int SIZE, typename T = float> + using ColumnVector = Eigen::Matrix<T, SIZE, 1>; + + template <int SIZE, typename T = float> + using RowVector = Eigen::Matrix<T, 1, SIZE>; + + // FIXME: provide specialization for Row Major layout + template <typename T, int Stride, int Order = Eigen::ColMajor> + struct MapSymM { + using type = T; + using base_type = typename std::remove_const<type>::type; + + static constexpr int total = Stride * (Stride + 1) / 2; + static constexpr int stride = Stride; + T* data; + + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC MapSymM(T* data) : data{data} {} + + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC T const& operator()(int const row, int const col) const { + auto const tmp = (Stride - col) * (Stride - col + 1) / 2; + auto const index = total - tmp + row - col; + return data[index]; + } + + template <typename U = T> + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC typename std::enable_if<std::is_same<base_type, U>::value, base_type>::type& + operator()(int const row, int const col) { + auto const tmp = (Stride - col) * (Stride - col + 1) / 2; + auto const index = total - tmp + row - col; + return data[index]; + } + }; + + // FIXME: either use/modify/improve eigen or make this more generic + // this is a map for a pulse matrix to building a 2d matrix for each channel + // and hide indexing + template <typename T> + struct MapMForPM { + using type = T; + using base_type = typename std::remove_cv<type>::type; + + type* data; + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC MapMForPM(type* data) : data{data} {} + + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC base_type operator()(int const row, int const col) const { + auto const index = 2 - col + row; + return index >= 0 ? data[index] : 0; + } + }; + + // simple/trivial cholesky decomposition impl + template <typename MatrixType1, typename MatrixType2> + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC void compute_decomposition_unrolled(MatrixType1& L, MatrixType2 const& M) { + auto const sqrtm_0_0 = std::sqrt(M(0, 0)); + L(0, 0) = sqrtm_0_0; + using T = typename MatrixType1::base_type; + +#pragma unroll + for (int i = 1; i < MatrixType1::stride; i++) { + T sumsq{0}; + for (int j = 0; j < i; j++) { + T sumsq2{0}; + auto const m_i_j = M(i, j); + for (int k = 0; k < j; ++k) + sumsq2 += L(i, k) * L(j, k); + + auto const value_i_j = (m_i_j - sumsq2) / L(j, j); + L(i, j) = value_i_j; + + sumsq += value_i_j * value_i_j; + } + + auto const l_i_i = std::sqrt(M(i, i) - sumsq); + L(i, i) = l_i_i; + } + } + + template <typename MatrixType1, typename MatrixType2> + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC void compute_decomposition(MatrixType1& L, + MatrixType2 const& M, + int const N) { + auto const sqrtm_0_0 = std::sqrt(M(0, 0)); + L(0, 0) = sqrtm_0_0; + using T = typename MatrixType1::base_type; + + for (int i = 1; i < N; i++) { + T sumsq{0}; + for (int j = 0; j < i; j++) { + T sumsq2{0}; + auto const m_i_j = M(i, j); + for (int k = 0; k < j; ++k) + sumsq2 += L(i, k) * L(j, k); + + auto const value_i_j = (m_i_j - sumsq2) / L(j, j); + L(i, j) = value_i_j; + + sumsq += value_i_j * value_i_j; + } + + auto const l_i_i = std::sqrt(M(i, i) - sumsq); + L(i, i) = l_i_i; + } + } + + template <typename MatrixType1, typename MatrixType2, typename VectorType> + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC void compute_decomposition_forwardsubst_with_offsets( + MatrixType1& L, + MatrixType2 const& M, + float b[MatrixType1::stride], + VectorType const& Atb, + int const N, + ColumnVector<MatrixType1::stride, int> const& pulseOffsets) { + auto const real_0 = pulseOffsets(0); + auto const sqrtm_0_0 = std::sqrt(M(real_0, real_0)); + L(0, 0) = sqrtm_0_0; + using T = typename MatrixType1::base_type; + b[0] = Atb(real_0) / sqrtm_0_0; + + for (int i = 1; i < N; i++) { + auto const i_real = pulseOffsets(i); + T sumsq{0}; + T total = 0; + auto const atb = Atb(i_real); + for (int j = 0; j < i; j++) { + auto const j_real = pulseOffsets(j); + T sumsq2{0}; + auto const m_i_j = M(std::max(i_real, j_real), std::min(i_real, j_real)); + for (int k = 0; k < j; ++k) + sumsq2 += L(i, k) * L(j, k); + + auto const value_i_j = (m_i_j - sumsq2) / L(j, j); + L(i, j) = value_i_j; + + sumsq += value_i_j * value_i_j; + total += value_i_j * b[j]; + } + + auto const l_i_i = std::sqrt(M(i_real, i_real) - sumsq); + L(i, i) = l_i_i; + b[i] = (atb - total) / l_i_i; + } + } + + template <typename MatrixType1, typename MatrixType2, typename VectorType> + EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC void update_decomposition_forwardsubst_with_offsets( + MatrixType1& L, + MatrixType2 const& M, + float b[MatrixType1::stride], + VectorType const& Atb, + int const N, + ColumnVector<MatrixType1::stride, int> const& pulseOffsets) { + using T = typename MatrixType1::base_type; + auto const i = N - 1; + auto const i_real = pulseOffsets(i); + T sumsq{0}; + T total = 0; + for (int j = 0; j < i; j++) { + auto const j_real = pulseOffsets(j); + T sumsq2{0}; + auto const m_i_j = M(std::max(i_real, j_real), std::min(i_real, j_real)); + for (int k = 0; k < j; ++k) + sumsq2 += L(i, k) * L(j, k); + + auto const value_i_j = (m_i_j - sumsq2) / L(j, j); + L(i, j) = value_i_j; + sumsq += value_i_j * value_i_j; + + total += value_i_j * b[j]; + } + + auto const l_i_i = std::sqrt(M(i_real, i_real) - sumsq); + L(i, i) = l_i_i; + b[i] = (Atb(i_real) - total) / l_i_i; + } + + template <typename MatrixType1, typename MatrixType2, typename MatrixType3> + EIGEN_DEVICE_FUNC void solve_forward_subst_matrix(MatrixType1& A, + MatrixType2 const& pulseMatrixView, + MatrixType3 const& matrixL) { + // FIXME: this assumes pulses are on columns and samples on rows + constexpr auto NPULSES = MatrixType2::ColsAtCompileTime; + constexpr auto NSAMPLES = MatrixType2::RowsAtCompileTime; + +#pragma unroll + for (int icol = 0; icol < NPULSES; icol++) { + float reg_b[NSAMPLES]; + float reg_L[NSAMPLES]; + +// preload a column and load column 0 of cholesky +#pragma unroll + for (int i = 0; i < NSAMPLES; i++) { +#ifdef __CUDA_ARCH__ + // load through the read-only cache + reg_b[i] = __ldg(&pulseMatrixView.coeffRef(i, icol)); +#else + reg_b[i] = pulseMatrixView.coeffRef(i, icol); +#endif // __CUDA_ARCH__ + reg_L[i] = matrixL(i, 0); + } + + // compute x0 and store it + auto x_prev = reg_b[0] / reg_L[0]; + A(0, icol) = x_prev; + +// iterate +#pragma unroll + for (int iL = 1; iL < NSAMPLES; iL++) { +// update accum +#pragma unroll + for (int counter = iL; counter < NSAMPLES; counter++) + reg_b[counter] -= x_prev * reg_L[counter]; + +// load the next column of cholesky +#pragma unroll + for (int counter = iL; counter < NSAMPLES; counter++) + reg_L[counter] = matrixL(counter, iL); + + // compute the next x for M(iL, icol) + x_prev = reg_b[iL] / reg_L[iL]; + + // store the result value + A(iL, icol) = x_prev; + } + } + } + + template <typename MatrixType1, typename MatrixType2> + EIGEN_DEVICE_FUNC void solve_forward_subst_vector(float reg_b[MatrixType1::RowsAtCompileTime], + MatrixType1 inputAmplitudesView, + MatrixType2 matrixL) { + constexpr auto NSAMPLES = MatrixType1::RowsAtCompileTime; + + float reg_b_tmp[NSAMPLES]; + float reg_L[NSAMPLES]; + +// preload a column and load column 0 of cholesky +#pragma unroll + for (int i = 0; i < NSAMPLES; i++) { + reg_b_tmp[i] = inputAmplitudesView(i); + reg_L[i] = matrixL(i, 0); + } + + // compute x0 and store it + auto x_prev = reg_b_tmp[0] / reg_L[0]; + reg_b[0] = x_prev; + +// iterate +#pragma unroll + for (int iL = 1; iL < NSAMPLES; iL++) { +// update accum +#pragma unroll + for (int counter = iL; counter < NSAMPLES; counter++) + reg_b_tmp[counter] -= x_prev * reg_L[counter]; + +// load the next column of cholesky +#pragma unroll + for (int counter = iL; counter < NSAMPLES; counter++) + reg_L[counter] = matrixL(counter, iL); + + // compute the next x for M(iL, icol) + x_prev = reg_b_tmp[iL] / reg_L[iL]; + + // store the result value + reg_b[iL] = x_prev; + } + } + + // TODO: add active bxs + template <typename MatrixType, typename VectorType> + EIGEN_DEVICE_FUNC void fnnls(MatrixType const& AtA, + VectorType const& Atb, + VectorType& solution, + int& npassive, + ColumnVector<VectorType::RowsAtCompileTime, int>& pulseOffsets, + MapSymM<float, VectorType::RowsAtCompileTime>& matrixL, + double eps, // convergence condition + const int maxIterations, // maximum number of iterations + const int relaxationPeriod, // every "relaxationPeriod" iterations + const int relaxationFactor) { // multiply "eps" by "relaxationFactor" + // constants + constexpr auto NPULSES = VectorType::RowsAtCompileTime; + + // to keep track of where to terminate if converged + Eigen::Index w_max_idx_prev = 0; + float w_max_prev = 0; + bool recompute = false; + + // used throughout + VectorType s; + float reg_b[NPULSES]; + //float matrixLStorage[MapSymM<float, NPULSES>::total]; + //MapSymM<float, NPULSES> matrixL{matrixLStorage}; + + int iter = 0; + while (true) { + if (iter > 0 || npassive == 0) { + auto const nactive = NPULSES - npassive; + // exit if there are no more pulses to constrain + if (nactive == 0) + break; + + // compute the gradient + //w.tail(nactive) = Atb.tail(nactive) - (AtA * solution).tail(nactive); + Eigen::Index w_max_idx; + float w_max = -std::numeric_limits<float>::max(); + for (int icol = npassive; icol < NPULSES; icol++) { + auto const icol_real = pulseOffsets(icol); + auto const atb = Atb(icol_real); + float sum = 0; +#pragma unroll + for (int counter = 0; counter < NPULSES; counter++) + sum += counter > icol_real ? AtA(counter, icol_real) * solution(counter) + : AtA(icol_real, counter) * solution(counter); + + auto const w = atb - sum; + if (w > w_max) { + w_max = w; + w_max_idx = icol - npassive; + } + } + + // check for convergence + if (w_max < eps || w_max_idx == w_max_idx_prev && w_max == w_max_prev) + break; + + if (iter >= maxIterations) + break; + + w_max_prev = w_max; + w_max_idx_prev = w_max_idx; + + // move index to the right part of the vector + w_max_idx += npassive; + + Eigen::numext::swap(pulseOffsets.coeffRef(npassive), pulseOffsets.coeffRef(w_max_idx)); + ++npassive; + } + + // inner loop + while (true) { + if (npassive == 0) + break; + + //s.head(npassive) + //auto const& matrixL = + // AtA.topLeftCorner(npassive, npassive) + // .llt().matrixL(); + //.solve(Atb.head(npassive)); + if (recompute || iter == 0) + compute_decomposition_forwardsubst_with_offsets(matrixL, AtA, reg_b, Atb, npassive, pulseOffsets); + else + update_decomposition_forwardsubst_with_offsets(matrixL, AtA, reg_b, Atb, npassive, pulseOffsets); + + // run backward substituion + s(npassive - 1) = reg_b[npassive - 1] / matrixL(npassive - 1, npassive - 1); + for (int i = npassive - 2; i >= 0; --i) { + float total = 0; + for (int j = i + 1; j < npassive; j++) + total += matrixL(j, i) * s(j); + + s(i) = (reg_b[i] - total) / matrixL(i, i); + } + + // done if solution values are all positive + bool hasNegative = false; + bool hasNans = false; + for (int counter = 0; counter < npassive; counter++) { + auto const s_ii = s(counter); + hasNegative |= s_ii <= 0; + hasNans |= std::isnan(s_ii); + } + + // FIXME: temporary solution. my cholesky impl is unstable yielding nans + // this check removes nans - do not accept solution unless all values + // are stable + if (hasNans) + break; + if (!hasNegative) { + for (int i = 0; i < npassive; i++) { + auto const i_real = pulseOffsets(i); + solution(i_real) = s(i); + } + //solution.head(npassive) = s.head(npassive); + recompute = false; + break; + } + + // there were negative values -> have to recompute the whole decomp + recompute = true; + + auto alpha = std::numeric_limits<float>::max(); + Eigen::Index alpha_idx = 0, alpha_idx_real = 0; + for (int i = 0; i < npassive; i++) { + if (s[i] <= 0.) { + auto const i_real = pulseOffsets(i); + auto const ratio = solution[i_real] / (solution[i_real] - s[i]); + if (ratio < alpha) { + alpha = ratio; + alpha_idx = i; + alpha_idx_real = i_real; + } + } + } + + // upadte solution + for (int i = 0; i < npassive; i++) { + auto const i_real = pulseOffsets(i); + solution(i_real) += alpha * (s(i) - solution(i_real)); + } + //solution.head(npassive) += alpha * + // (s.head(npassive) - solution.head(npassive)); + solution[alpha_idx_real] = 0; + --npassive; + + Eigen::numext::swap(pulseOffsets.coeffRef(npassive), pulseOffsets.coeffRef(alpha_idx)); + } + + // as in cpu + ++iter; + if (iter % relaxationPeriod == 0) + eps *= relaxationFactor; + } + } + + } // namespace multifit +} // namespace calo + +#endif // DataFormats_CaloRecHit_interface_MultifitComputations_h From df56fdc6d158540d5e383750b75639374b60207f Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 14:58:57 -0500 Subject: [PATCH 723/778] Removed unused fwkJobReports from MessageLogger tests The parameter fwkJobReports is an obsolete parameter which has had no functionality for many years. --- FWCore/Integration/test/AssociationMapReadTest_cfg.py | 2 +- FWCore/Integration/test/AssociationMapTest_cfg.py | 2 +- FWCore/Integration/test/RefTest_cfg.py | 2 +- FWCore/Integration/test/TransRefTest_cfg.py | 2 +- FWCore/Integration/test/ViewTest_cfg.py | 2 +- FWCore/Integration/test/parentlessTest_cfg.py | 2 +- FWCore/MessageService/bin/Standalone.cpp | 8 +------- .../test/PsetValidationSamples/cat_cfg.py | 1 - .../test/PsetValidationSamples/categories_cfg.py | 1 - .../test/PsetValidationSamples/debugModules_cfg.py | 1 - .../test/PsetValidationSamples/dest_cfg.py | 1 - .../test/PsetValidationSamples/destlist_cfg.py | 1 - .../test/PsetValidationSamples/fwkJRlist_cfg.py | 10 ---------- .../test/PsetValidationSamples/gpm_cfg.py | 1 - .../test/PsetValidationSamples/mstjp_cfg.py | 1 - .../test/PsetValidationSamples/statlist_cfg.py | 1 - .../test/PsetValidationSamples/suppress_cfg.py | 1 - .../test/PsetValidationSamples/threshold_cfg.py | 1 - .../test/PsetValidationSamples/vstring_cfg.py | 1 - .../test/PsetValidationSamples/xPSet_cfg.py | 1 - FWCore/MessageService/test/messageLogger_cfg.py | 6 ------ FWCore/MessageService/test/u10_cfg.py | 1 - FWCore/MessageService/test/u14_cfg.py | 1 - FWCore/MessageService/test/u16-2warnings_cfg.py | 1 - FWCore/MessageService/test/u16_cfg.py | 5 ----- FWCore/MessageService/test/u19_cfg.py | 3 +-- FWCore/MessageService/test/u19d_cfg.py | 3 +-- FWCore/MessageService/test/u1_cfg.py | 1 - FWCore/MessageService/test/u1d_cfg.py | 1 - FWCore/MessageService/test/u7_cfg.py | 6 +----- FWCore/MessageService/test/u9_cfg.py | 1 - FWCore/Services/bin/edmTracerLogToSimpleConfig.py | 2 +- 32 files changed, 11 insertions(+), 62 deletions(-) diff --git a/FWCore/Integration/test/AssociationMapReadTest_cfg.py b/FWCore/Integration/test/AssociationMapReadTest_cfg.py index 576ca64e0b87c..5837e26ada95e 100644 --- a/FWCore/Integration/test/AssociationMapReadTest_cfg.py +++ b/FWCore/Integration/test/AssociationMapReadTest_cfg.py @@ -5,7 +5,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.load("FWCore.Framework.test.cmsExceptionsFatal_cff") diff --git a/FWCore/Integration/test/AssociationMapTest_cfg.py b/FWCore/Integration/test/AssociationMapTest_cfg.py index 012dc2e4f1061..e5cb3bed77577 100644 --- a/FWCore/Integration/test/AssociationMapTest_cfg.py +++ b/FWCore/Integration/test/AssociationMapTest_cfg.py @@ -5,7 +5,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.load("FWCore.Framework.test.cmsExceptionsFatal_cff") diff --git a/FWCore/Integration/test/RefTest_cfg.py b/FWCore/Integration/test/RefTest_cfg.py index fe7dd8539efe6..121c34f1a6eb2 100644 --- a/FWCore/Integration/test/RefTest_cfg.py +++ b/FWCore/Integration/test/RefTest_cfg.py @@ -9,7 +9,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(2) diff --git a/FWCore/Integration/test/TransRefTest_cfg.py b/FWCore/Integration/test/TransRefTest_cfg.py index 86ae5a0ae3210..d0934fa91f096 100644 --- a/FWCore/Integration/test/TransRefTest_cfg.py +++ b/FWCore/Integration/test/TransRefTest_cfg.py @@ -9,7 +9,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(2) diff --git a/FWCore/Integration/test/ViewTest_cfg.py b/FWCore/Integration/test/ViewTest_cfg.py index 6b2d272f50996..81fa79af3a989 100644 --- a/FWCore/Integration/test/ViewTest_cfg.py +++ b/FWCore/Integration/test/ViewTest_cfg.py @@ -9,7 +9,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(3) diff --git a/FWCore/Integration/test/parentlessTest_cfg.py b/FWCore/Integration/test/parentlessTest_cfg.py index 8008767d150c9..63359241a086c 100644 --- a/FWCore/Integration/test/parentlessTest_cfg.py +++ b/FWCore/Integration/test/parentlessTest_cfg.py @@ -9,7 +9,7 @@ process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(2) diff --git a/FWCore/MessageService/bin/Standalone.cpp b/FWCore/MessageService/bin/Standalone.cpp index 952403e346b11..3c9e5d6b6cd7e 100644 --- a/FWCore/MessageService/bin/Standalone.cpp +++ b/FWCore/MessageService/bin/Standalone.cpp @@ -77,18 +77,12 @@ int main(int, char* argv[]) { "untracked PSet infos = {" "untracked string threshold = 'INFO'" "untracked PSet default = {untracked int32 limit = 1000000}" - "untracked PSet FwkJob = {untracked int32 limit = 0}" "}" "untracked PSet warnings = {" "untracked string threshold = 'WARNING'" "untracked PSet default = {untracked int32 limit = 1000000}" "}" - "untracked vstring fwkJobReports = {'FrameworkJobReport.xml'}" - "untracked vstring categories = {'FwkJob'}" - "untracked PSet FrameworkJobReport.xml = {" - "untracked PSet default = {untracked int32 limit = 0}" - "untracked PSet FwkJob = {untracked int32 limit = 10000000}" - "}" + "untracked vstring categories = {}" "}" "service = JobReportService{}" "service = SiteLocalConfigService{}" diff --git a/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py index ca7a6747f4118..5a77584c08922 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py @@ -15,7 +15,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y' ), - fwkJobReports = cms.untracked.vstring( 'u1_f' ), categories = cms.untracked.vstring('preEventProcessing','FwkJob', 'cat_A','cat_B', 'cat_J', 'cat_K'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py index 8b9b99a8ba58d..910159ba79d46 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py @@ -15,7 +15,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - fwkJobReports = cms.untracked.vstring( 'u1_f' ), #enable one of the following -- the first should pass, the rest fail categories = cms.untracked.vstring('preEventProcessing','FwkJob', diff --git a/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py index 5d776d7f1d799..94624089326fc 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py @@ -15,7 +15,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - fwkJobReports = cms.untracked.vstring( 'u1_f' ), categories = cms.untracked.vstring('preEventProcessing','FwkJob', 'cat_A','cat_B'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py index 1467533f1eb8b..4e023907ca48f 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py @@ -15,7 +15,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y' ), - fwkJobReports = cms.untracked.vstring( 'u1_f' ), categories = cms.untracked.vstring('preEventProcessing','FwkJob', 'cat_A','cat_B'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/destlist_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/destlist_cfg.py index b672f89bf3307..a0f7a3e813837 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/destlist_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/destlist_cfg.py @@ -71,7 +71,6 @@ threshold = cms.untracked.string('ERROR'), noTimeStamps = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('u1_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob') diff --git a/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py index 6a654bafa5687..bb3c7fe9e44f8 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py @@ -16,16 +16,6 @@ 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), -#enable one of the following -- the first should pass, the rest fail -# fwkJobReports = cms.untracked.vstring( 'u1_f' ), -# fwkJobReports = cms.vstring('cout'), -# fwkJobReports = cms.untracked.int32(2), -# fwkJobReports = cms.untracked.vstring('u1_warnings', 'u1_errors', 'u1_warnings'), -# fwkJobReports = cms.untracked.vstring('cout','limit'), -# fwkJobReports = cms.untracked.vstring('u1_y'), -# fwkJobReports = cms.untracked.vstring('u1_x'), - fwkJobReports = cms.untracked.vstring('u1_y','u1_x'), - u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/gpm_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/gpm_cfg.py index 5fbcb963426b3..051833f8e83e3 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/gpm_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/gpm_cfg.py @@ -57,7 +57,6 @@ threshold = cms.untracked.string('ERROR'), noTimeStamps = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('u1_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/mstjp_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/mstjp_cfg.py index 1a39553831913..dbd6422e7f19c 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/mstjp_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/mstjp_cfg.py @@ -54,7 +54,6 @@ threshold = cms.untracked.string('ERROR'), noTimeStamps = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('u1_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py index 14f0fe12fb162..af10f9df84912 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py @@ -60,7 +60,6 @@ threshold = cms.untracked.string('ERROR'), noTimeStamps = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('u1_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob') diff --git a/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py index b510e8f9a3262..d0a74c5bc28c4 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py @@ -15,7 +15,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - fwkJobReports = cms.untracked.vstring( 'u1_f' ), categories = cms.untracked.vstring('preEventProcessing','FwkJob', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/threshold_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/threshold_cfg.py index 8894ec7439569..8797615790541 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/threshold_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/threshold_cfg.py @@ -61,7 +61,6 @@ threshold = cms.untracked.string('ERROR'), noTimeStamps = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('u1_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py index b2de9ef5200ee..1afdef03dc229 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py @@ -15,7 +15,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - fwkJobReports = cms.untracked.vstring( 'u1_f' ), categories = cms.untracked.vstring('preEventProcessing','FwkJob', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), diff --git a/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py index bcf916e2932c3..95a5b973b02e1 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py @@ -15,7 +15,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - fwkJobReports = cms.untracked.vstring( 'u1_f' ), categories = cms.untracked.vstring('preEventProcessing','FwkJob', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), diff --git a/FWCore/MessageService/test/messageLogger_cfg.py b/FWCore/MessageService/test/messageLogger_cfg.py index 8df6dfd06c2ab..40d0477c6e55b 100644 --- a/FWCore/MessageService/test/messageLogger_cfg.py +++ b/FWCore/MessageService/test/messageLogger_cfg.py @@ -12,11 +12,6 @@ process.MessageLogger = cms.Service("MessageLogger", messageIDs = cms.untracked.vstring('unimportant', 'trkwarning'), - anotherfile = cms.untracked.PSet( - postBeginJob = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), default = cms.untracked.PSet( limit = cms.untracked.int32(100), timespan = cms.untracked.int32(60) @@ -41,7 +36,6 @@ critical = cms.untracked.PSet( threshold = cms.untracked.string('ERROR') ), - fwkJobReports = cms.untracked.vstring('anotherfile'), debugModules = cms.untracked.vstring('sendSomeMessages'), categories = cms.untracked.vstring('postBeginJob'), destinations = cms.untracked.vstring('detailedInfo', diff --git a/FWCore/MessageService/test/u10_cfg.py b/FWCore/MessageService/test/u10_cfg.py index 3fedd8ac152f5..6d67597f08d31 100644 --- a/FWCore/MessageService/test/u10_cfg.py +++ b/FWCore/MessageService/test/u10_cfg.py @@ -16,7 +16,6 @@ noTimeStamps = cms.untracked.bool(True) ), destinations = cms.untracked.vstring('u10_warnings'), - fwkJobReports = cms.untracked.vstring('u10_job_report') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u14_cfg.py b/FWCore/MessageService/test/u14_cfg.py index bb14e0ea7c0b2..97857579954cc 100644 --- a/FWCore/MessageService/test/u14_cfg.py +++ b/FWCore/MessageService/test/u14_cfg.py @@ -41,7 +41,6 @@ limit = cms.untracked.int32(0) ) ), - fwkJobReports = cms.untracked.vstring('u14_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing'), destinations = cms.untracked.vstring('u14_warnings', diff --git a/FWCore/MessageService/test/u16-2warnings_cfg.py b/FWCore/MessageService/test/u16-2warnings_cfg.py index b0b426394356f..2b24db36ba327 100644 --- a/FWCore/MessageService/test/u16-2warnings_cfg.py +++ b/FWCore/MessageService/test/u16-2warnings_cfg.py @@ -68,7 +68,6 @@ extension = cms.untracked.string('mmlog'), filename = cms.untracked.string('u16_altDebugs') ), - fwkJobReports = cms.untracked.vstring('u16_job_report'), destinations = cms.untracked.vstring('u16_warnings', 'u16_warnings2', 'u16_errors', diff --git a/FWCore/MessageService/test/u16_cfg.py b/FWCore/MessageService/test/u16_cfg.py index d881b01a040c5..285ce86791f44 100644 --- a/FWCore/MessageService/test/u16_cfg.py +++ b/FWCore/MessageService/test/u16_cfg.py @@ -20,10 +20,6 @@ threshold = cms.untracked.string('WARNING'), extension = cms.untracked.string('mslog') ), - # produce file u16_job_report.mmxml - u16_job_report = cms.untracked.PSet( - extension = cms.untracked.string('mmxml') - ), default = cms.untracked.PSet( FwkJob = cms.untracked.PSet( limit = cms.untracked.int32(0) @@ -67,7 +63,6 @@ extension = cms.untracked.string('mmlog'), filename = cms.untracked.string('u16_altDebugs') ), - fwkJobReports = cms.untracked.vstring('u16_job_report'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob'), diff --git a/FWCore/MessageService/test/u19_cfg.py b/FWCore/MessageService/test/u19_cfg.py index d455360945f89..38b7b0b956289 100644 --- a/FWCore/MessageService/test/u19_cfg.py +++ b/FWCore/MessageService/test/u19_cfg.py @@ -36,8 +36,7 @@ ), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob', - 'ridiculously_long_category_name'), - fwkJobReports = cms.untracked.vstring('u1_job_report.mxml') + 'ridiculously_long_category_name') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u19d_cfg.py b/FWCore/MessageService/test/u19d_cfg.py index 7c38be7f8b893..c050e251db985 100644 --- a/FWCore/MessageService/test/u19d_cfg.py +++ b/FWCore/MessageService/test/u19d_cfg.py @@ -37,8 +37,7 @@ ), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob', - 'ridiculously_long_category_name'), - fwkJobReports = cms.untracked.vstring('u1_job_report.mxml') + 'ridiculously_long_category_name') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u1_cfg.py b/FWCore/MessageService/test/u1_cfg.py index f07995d745f02..bb94ac8723aa3 100644 --- a/FWCore/MessageService/test/u1_cfg.py +++ b/FWCore/MessageService/test/u1_cfg.py @@ -51,7 +51,6 @@ threshold = cms.untracked.string('ERROR'), noTimeStamps = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('u1_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob'), diff --git a/FWCore/MessageService/test/u1d_cfg.py b/FWCore/MessageService/test/u1d_cfg.py index b2a766e720bdf..874034561baf6 100644 --- a/FWCore/MessageService/test/u1d_cfg.py +++ b/FWCore/MessageService/test/u1d_cfg.py @@ -52,7 +52,6 @@ threshold = cms.untracked.string('ERROR'), noTimeStamps = cms.untracked.bool(True) ), - fwkJobReports = cms.untracked.vstring('u1d_job_report.mxml'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkJob'), diff --git a/FWCore/MessageService/test/u7_cfg.py b/FWCore/MessageService/test/u7_cfg.py index 0b8af91f2b1f8..1c38fec627f3d 100644 --- a/FWCore/MessageService/test/u7_cfg.py +++ b/FWCore/MessageService/test/u7_cfg.py @@ -11,9 +11,6 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u7_job_report = cms.untracked.PSet( - extension = cms.untracked.string("mxml") - ), u7_restrict = cms.untracked.PSet( default = cms.untracked.PSet( limit = cms.untracked.int32(0) @@ -32,8 +29,7 @@ destinations = cms.untracked.vstring('u7_log', 'u7_restrict'), categories = cms.untracked.vstring('FwkJob', - 'special'), - fwkJobReports = cms.untracked.vstring('u7_job_report') + 'special') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u9_cfg.py b/FWCore/MessageService/test/u9_cfg.py index db24ecbc8fe2f..f08d8c6d110b9 100644 --- a/FWCore/MessageService/test/u9_cfg.py +++ b/FWCore/MessageService/test/u9_cfg.py @@ -14,7 +14,6 @@ process.MessageLogger.destinations = ['warnings', 'infos'] process.MessageLogger.statistics = ['warnings', 'infos'] -process.MessageLogger.fwkJobReports = ['job_report'] process.MessageLogger.default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(False), FwkJob = cms.untracked.PSet( diff --git a/FWCore/Services/bin/edmTracerLogToSimpleConfig.py b/FWCore/Services/bin/edmTracerLogToSimpleConfig.py index 3726f0cb6870a..106bece31b75f 100644 --- a/FWCore/Services/bin/edmTracerLogToSimpleConfig.py +++ b/FWCore/Services/bin/edmTracerLogToSimpleConfig.py @@ -122,7 +122,7 @@ def finish(self): process.load("FWCore.MessageLogger.MessageLogger_cfi") process.MessageLogger.destinations = ['cerr'] process.MessageLogger.statistics = [] -process.MessageLogger.fwkJobReports = [] + process.MessageLogger.cerr.FwkReport.reportEvery = 50000 process.MessageLogger.cerr.threshold = 'WARNING' """) From 3d26a5968011a256a04609850b972c650ed8a0a6 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 15:35:45 -0500 Subject: [PATCH 724/778] Changed category FwkJob to FwkTest for all tests FwkJob hasn't been used by the framework for years so changed to a more suggestive name. --- FWCore/MessageService/test/AAA_AtlasOfTests | 4 ++-- .../MessageService/test/MLexampleModule_1.cc | 2 +- .../test/PsetValidationSamples/cat_cfg.py | 10 +++++----- .../PsetValidationSamples/categories_cfg.py | 18 +++++++++--------- .../PsetValidationSamples/debugModules_cfg.py | 8 ++++---- .../test/PsetValidationSamples/dest_cfg.py | 10 +++++----- .../test/PsetValidationSamples/destlist_cfg.py | 8 ++++---- .../PsetValidationSamples/fwkJRlist_cfg.py | 8 ++++---- .../test/PsetValidationSamples/gpm_cfg.py | 8 ++++---- .../test/PsetValidationSamples/mstjp_cfg.py | 8 ++++---- .../test/PsetValidationSamples/statlist_cfg.py | 8 ++++---- .../test/PsetValidationSamples/suppress_cfg.py | 8 ++++---- .../PsetValidationSamples/threshold_cfg.py | 8 ++++---- .../test/PsetValidationSamples/vstring_cfg.py | 8 ++++---- .../test/PsetValidationSamples/xPSet_cfg.py | 8 ++++---- FWCore/MessageService/test/UnitTestClient_A.cc | 2 +- .../test/UnitTestClient_A_suppTest.cc | 2 +- .../MessageService/test/UnitTestClient_Ad.cc | 2 +- FWCore/MessageService/test/UnitTestClient_D.cc | 2 +- FWCore/MessageService/test/UnitTestClient_I.cc | 2 +- FWCore/MessageService/test/memory_t1_cfg.py | 4 ++-- FWCore/MessageService/test/memory_t2_cfg.py | 4 ++-- FWCore/MessageService/test/memory_t3_cfg.py | 4 ++-- FWCore/MessageService/test/timing_t_cfg.py | 4 ++-- FWCore/MessageService/test/u11_cfg.py | 4 ++-- FWCore/MessageService/test/u13_cfg.py | 6 +++--- FWCore/MessageService/test/u13d_cfg.py | 6 +++--- FWCore/MessageService/test/u15_cfg.py | 6 +++--- .../MessageService/test/u16-2warnings_cfg.py | 4 ++-- FWCore/MessageService/test/u16_cfg.py | 4 ++-- FWCore/MessageService/test/u17_cfg.py | 4 ++-- FWCore/MessageService/test/u19_cfg.py | 6 +++--- FWCore/MessageService/test/u19d_cfg.py | 6 +++--- FWCore/MessageService/test/u1_cfg.py | 8 ++++---- FWCore/MessageService/test/u1d_cfg.py | 8 ++++---- FWCore/MessageService/test/u21_cfg.py | 8 ++++---- FWCore/MessageService/test/u22_cfg.py | 6 +++--- FWCore/MessageService/test/u23_cfg.py | 6 +++--- FWCore/MessageService/test/u24_cfg.py | 4 ++-- FWCore/MessageService/test/u25_cfg.py | 4 ++-- FWCore/MessageService/test/u27_cfg.py | 6 +++--- FWCore/MessageService/test/u30Lumi_cfg.py | 6 +++--- FWCore/MessageService/test/u30_cfg.py | 6 +++--- FWCore/MessageService/test/u31_cfg.py | 6 +++--- FWCore/MessageService/test/u3_cfg.py | 4 ++-- FWCore/MessageService/test/u7_cfg.py | 6 +++--- FWCore/MessageService/test/u8_cfg.py | 4 ++-- FWCore/MessageService/test/u9_cfg.py | 5 +++-- .../test/unit_test_outputs/u28_output.log | 6 +++--- .../test/unit_test_outputs/u3_statistics.log | 4 ++-- .../test/unit_test_outputs/u4_another.log | 4 ++-- 51 files changed, 149 insertions(+), 148 deletions(-) diff --git a/FWCore/MessageService/test/AAA_AtlasOfTests b/FWCore/MessageService/test/AAA_AtlasOfTests index fb827e253301b..cf0e9ec6f1878 100644 --- a/FWCore/MessageService/test/AAA_AtlasOfTests +++ b/FWCore/MessageService/test/AAA_AtlasOfTests @@ -4,7 +4,7 @@ Tests marked $ are tested in both single thread and multithread running. Tests marked % are tested with both the default and EDM_ML_DEBUG defined. u1 $% Gives different thresholds to multiple destinations, and assigns - limit=0 to annoying message categories preEventProcessing and FwkJob. + limit=0 to annoying message categories preEventProcessing and FwkTest. Incidnetally tests noTimeStamps. Also generates a job report file (u1_job_report.mxml). ---------- UnitTestClient_A @@ -32,7 +32,7 @@ u5 $ Tests reset versus no reset behavior when multiple statistics u6 $ Tests hex and other manipulators ---------- UnitTestClient_C -u7 Filtering all but one category (for example FwkJob). +u7 Filtering all but one category (for example FwkTest). Creates a fwkJobReports u7_job_report.mxml as well as logs. ---------- UnitTestClient_C diff --git a/FWCore/MessageService/test/MLexampleModule_1.cc b/FWCore/MessageService/test/MLexampleModule_1.cc index 516be5691ef6a..3f7917f45c3ae 100644 --- a/FWCore/MessageService/test/MLexampleModule_1.cc +++ b/FWCore/MessageService/test/MLexampleModule_1.cc @@ -20,7 +20,7 @@ namespace edmtest { edm::LogWarning("cat_B") << "LogWarning was used to send this other message"; edm::LogInfo("cat_A") << "LogInfo was used to send this message"; edm::LogInfo("cat_B") << "LogInfo was used to send this other message"; - edm::LogInfo("FwkJob") << "<Message>LogInfo was used to send a job report</Message>"; + edm::LogInfo("FwkTest") << "<Message>LogInfo was used to send a job report</Message>"; } // MessageLoggerClient::analyze() diff --git a/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py index 5a77584c08922..3030698b22ec3 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py @@ -15,7 +15,7 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y' ), - categories = cms.untracked.vstring('preEventProcessing','FwkJob', + categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B', 'cat_J', 'cat_K'), # enabling any of these acter the first one should fail: @@ -38,7 +38,7 @@ u1_x = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -66,7 +66,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -80,7 +80,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -89,7 +89,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py index 910159ba79d46..71a1abf68859e 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py @@ -17,15 +17,15 @@ statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), #enable one of the following -- the first should pass, the rest fail - categories = cms.untracked.vstring('preEventProcessing','FwkJob', + categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), -# categories = cms.vstring('preEventProcessing','FwkJob','u1_x'), -# categories = cms.vstring('preEventProcessing','FwkJob','u1_y'), -# categories = cms.vstring('preEventProcessing','FwkJob','u1_f'), +# categories = cms.vstring('preEventProcessing','FwkTest','u1_x'), +# categories = cms.vstring('preEventProcessing','FwkTest','u1_y'), +# categories = cms.vstring('preEventProcessing','FwkTest','u1_f'), # categories = cms.untracked.int32(2), -# categories = cms.untracked.vstring('preEventProcessing','FwkJob', +# categories = cms.untracked.vstring('preEventProcessing','FwkTest', # 'cat_A','cat_B','cat_A'), -# categories = cms.untracked.vstring('preEventProcessing','FwkJob', +# categories = cms.untracked.vstring('preEventProcessing','FwkTest', # 'cat_A','cat_B','limit'), # If the passing one above enabled, enabling this should now fail: @@ -34,7 +34,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -48,7 +48,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -57,7 +57,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py index 94624089326fc..e19d403f7e0d7 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py @@ -15,7 +15,7 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - categories = cms.untracked.vstring('preEventProcessing','FwkJob', + categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), #enable one of the following -- the first THREE should pass, the rest fail @@ -33,7 +33,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -47,7 +47,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -56,7 +56,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py index 4e023907ca48f..b5e3c7d304363 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py @@ -15,7 +15,7 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y' ), - categories = cms.untracked.vstring('preEventProcessing','FwkJob', + categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), # enabling any of these except the first 5 should fail: @@ -23,7 +23,7 @@ u1_x = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -52,7 +52,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -66,7 +66,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -75,7 +75,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/destlist_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/destlist_cfg.py index a0f7a3e813837..4cd491a5cbacf 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/destlist_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/destlist_cfg.py @@ -37,7 +37,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -51,7 +51,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -60,7 +60,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -73,7 +73,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob') + 'FwkTest') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py index bb3c7fe9e44f8..9fdd1b6f25d1f 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py @@ -20,7 +20,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -34,7 +34,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -43,7 +43,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -56,7 +56,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob') + 'FwkTest') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/gpm_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/gpm_cfg.py index 051833f8e83e3..b902f7eb46cba 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/gpm_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/gpm_cfg.py @@ -23,7 +23,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -37,7 +37,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -46,7 +46,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -59,7 +59,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u1_warnings', 'u1_errors', 'u1_infos', diff --git a/FWCore/MessageService/test/PsetValidationSamples/mstjp_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/mstjp_cfg.py index dbd6422e7f19c..d7502fa893626 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/mstjp_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/mstjp_cfg.py @@ -20,7 +20,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -34,7 +34,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -43,7 +43,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -56,7 +56,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u1_warnings', 'u1_errors', 'u1_infos', diff --git a/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py index af10f9df84912..80b79f23fd5ce 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py @@ -26,7 +26,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -40,7 +40,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -49,7 +49,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -62,7 +62,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob') + 'FwkTest') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py index d0a74c5bc28c4..e83009fbd1eb1 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py @@ -15,7 +15,7 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - categories = cms.untracked.vstring('preEventProcessing','FwkJob', + categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), @@ -35,7 +35,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -49,7 +49,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -58,7 +58,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/threshold_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/threshold_cfg.py index 8797615790541..1a86cc497fa6a 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/threshold_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/threshold_cfg.py @@ -27,7 +27,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -41,7 +41,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -50,7 +50,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -63,7 +63,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u1_warnings', 'u1_errors', 'u1_infos', diff --git a/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py index 1afdef03dc229..7f5f76073a2e6 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py @@ -15,7 +15,7 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - categories = cms.untracked.vstring('preEventProcessing','FwkJob', + categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), @@ -27,7 +27,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -41,7 +41,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -50,7 +50,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py index 95a5b973b02e1..bd42db21dc0c1 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py @@ -15,7 +15,7 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), - categories = cms.untracked.vstring('preEventProcessing','FwkJob', + categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), @@ -27,7 +27,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -41,7 +41,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -50,7 +50,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/UnitTestClient_A.cc b/FWCore/MessageService/test/UnitTestClient_A.cc index ed4daa78b04b5..ec26caca529e9 100644 --- a/FWCore/MessageService/test/UnitTestClient_A.cc +++ b/FWCore/MessageService/test/UnitTestClient_A.cc @@ -23,7 +23,7 @@ namespace edmtest { edm::LogWarning("cat_B") << "LogWarning was used to send this other message"; edm::LogInfo("cat_A") << "LogInfo was used to send this message"; edm::LogInfo("cat_B") << "LogInfo was used to send this other message"; - edm::LogInfo("FwkJob") << "<Message>LogInfo was used to send a job report</Message>"; + edm::LogInfo("FwkTest") << "<Message>LogInfo was used to send a job report</Message>"; } // MessageLoggerClient::analyze() diff --git a/FWCore/MessageService/test/UnitTestClient_A_suppTest.cc b/FWCore/MessageService/test/UnitTestClient_A_suppTest.cc index 997572dbf5bc4..304da754fddaa 100644 --- a/FWCore/MessageService/test/UnitTestClient_A_suppTest.cc +++ b/FWCore/MessageService/test/UnitTestClient_A_suppTest.cc @@ -49,7 +49,7 @@ void // TEMPORARY change to test suppression << foo("LogInfo"); edm::LogInfo ("cat_B") << "LogInfo was used to send this other message"; - edm::LogInfo ("FwkJob") << "<Message>LogInfo was used to send a job report</Message>"; + edm::LogInfo ("FwkTest") << "<Message>LogInfo was used to send a job report</Message>"; } // MessageLoggerClient::analyze() diff --git a/FWCore/MessageService/test/UnitTestClient_Ad.cc b/FWCore/MessageService/test/UnitTestClient_Ad.cc index 427ca41983979..b9c23f8267232 100644 --- a/FWCore/MessageService/test/UnitTestClient_Ad.cc +++ b/FWCore/MessageService/test/UnitTestClient_Ad.cc @@ -25,7 +25,7 @@ namespace edmtest { edm::LogWarning("cat_B") << "LogWarning was used to send this other message"; edm::LogInfo("cat_A") << "LogInfo was used to send this message"; edm::LogInfo("cat_B") << "LogInfo was used to send this other message"; - edm::LogInfo("FwkJob") << "<Message>LogInfo was used to send a job report</Message>"; + edm::LogInfo("FwkTest") << "<Message>LogInfo was used to send a job report</Message>"; } // MessageLoggerClient::analyze() diff --git a/FWCore/MessageService/test/UnitTestClient_D.cc b/FWCore/MessageService/test/UnitTestClient_D.cc index 4e3ff4fef8be6..e693b9fbe34c8 100644 --- a/FWCore/MessageService/test/UnitTestClient_D.cc +++ b/FWCore/MessageService/test/UnitTestClient_D.cc @@ -14,7 +14,7 @@ namespace edmtest { ) { edm::LogWarning("cat_A") << "This message should not appear in " << "the framework job report"; - edm::LogWarning("FwkJob") << "<Message>This message should appear in " + edm::LogWarning("FwkTest") << "<Message>This message should appear in " << "the framework job report</Message>"; edm::LogWarning("special") << "This message should appear in " << "restrict but the others should not"; diff --git a/FWCore/MessageService/test/UnitTestClient_I.cc b/FWCore/MessageService/test/UnitTestClient_I.cc index c959b84b747f1..f0f7a05f89494 100644 --- a/FWCore/MessageService/test/UnitTestClient_I.cc +++ b/FWCore/MessageService/test/UnitTestClient_I.cc @@ -24,7 +24,7 @@ namespace edmtest { edm::LogInfo("cat_A") << "LogInfo was used to send this message"; edm::LogInfo("cat_B") << "LogInfo was used to send this other message"; - edm::LogInfo("FwkJob") << "<Message>LogInfo was used to send a job report</Message>"; + edm::LogInfo("FwkTest") << "<Message>LogInfo was used to send a job report</Message>"; } // MessageLoggerClient::analyze() diff --git a/FWCore/MessageService/test/memory_t1_cfg.py b/FWCore/MessageService/test/memory_t1_cfg.py index c622957755cdf..ec140197643af 100644 --- a/FWCore/MessageService/test/memory_t1_cfg.py +++ b/FWCore/MessageService/test/memory_t1_cfg.py @@ -27,14 +27,14 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkReport', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('memory_t1_infos') ) diff --git a/FWCore/MessageService/test/memory_t2_cfg.py b/FWCore/MessageService/test/memory_t2_cfg.py index 1a86735d5554c..8472c5cb1d1bf 100644 --- a/FWCore/MessageService/test/memory_t2_cfg.py +++ b/FWCore/MessageService/test/memory_t2_cfg.py @@ -27,14 +27,14 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkReport', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('memory_t1_infos') ) diff --git a/FWCore/MessageService/test/memory_t3_cfg.py b/FWCore/MessageService/test/memory_t3_cfg.py index 4ebb004da346d..20c019556bbba 100644 --- a/FWCore/MessageService/test/memory_t3_cfg.py +++ b/FWCore/MessageService/test/memory_t3_cfg.py @@ -28,14 +28,14 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', 'FwkReport', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('memory_t3_infos') ) diff --git a/FWCore/MessageService/test/timing_t_cfg.py b/FWCore/MessageService/test/timing_t_cfg.py index 04e019f6997a0..78519c1b119d2 100644 --- a/FWCore/MessageService/test/timing_t_cfg.py +++ b/FWCore/MessageService/test/timing_t_cfg.py @@ -22,7 +22,7 @@ extension = cms.untracked.string('mmxml') ), default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -32,7 +32,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('timing_t') ) diff --git a/FWCore/MessageService/test/u11_cfg.py b/FWCore/MessageService/test/u11_cfg.py index f957dd5f816a2..a9ad919612cbc 100644 --- a/FWCore/MessageService/test/u11_cfg.py +++ b/FWCore/MessageService/test/u11_cfg.py @@ -56,7 +56,7 @@ expect_non_supercede_common_specific = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), int25bydefaults = cms.untracked.PSet( @@ -145,7 +145,7 @@ 'expect_non_supercede_common_specific', 'expect_specific', 'FwkReport', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u11_overall_unnamed', 'u11_overall_specific', 'u11_supercede_specific', diff --git a/FWCore/MessageService/test/u13_cfg.py b/FWCore/MessageService/test/u13_cfg.py index e0d780e8062a7..d9a3e49fa741f 100644 --- a/FWCore/MessageService/test/u13_cfg.py +++ b/FWCore/MessageService/test/u13_cfg.py @@ -20,7 +20,7 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -34,13 +34,13 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), categories = cms.untracked.vstring('preEventProcessing', 'FwkReport', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u13_infos', 'u13_debugs') ) diff --git a/FWCore/MessageService/test/u13d_cfg.py b/FWCore/MessageService/test/u13d_cfg.py index 34d7588ebeea6..f915865a60e30 100644 --- a/FWCore/MessageService/test/u13d_cfg.py +++ b/FWCore/MessageService/test/u13d_cfg.py @@ -21,7 +21,7 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -35,13 +35,13 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), categories = cms.untracked.vstring('preEventProcessing', 'FwkReport', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u13d_infos', 'u13d_debugs') ) diff --git a/FWCore/MessageService/test/u15_cfg.py b/FWCore/MessageService/test/u15_cfg.py index c166ee3abdec6..540a6a836564e 100644 --- a/FWCore/MessageService/test/u15_cfg.py +++ b/FWCore/MessageService/test/u15_cfg.py @@ -21,7 +21,7 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -35,13 +35,13 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), categories = cms.untracked.vstring('preEventProcessing', 'FwkReport', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u15_infos', 'u15_debugs') ) diff --git a/FWCore/MessageService/test/u16-2warnings_cfg.py b/FWCore/MessageService/test/u16-2warnings_cfg.py index 2b24db36ba327..ee294b861288b 100644 --- a/FWCore/MessageService/test/u16-2warnings_cfg.py +++ b/FWCore/MessageService/test/u16-2warnings_cfg.py @@ -26,7 +26,7 @@ extension = cms.untracked.string('mmxml') ), default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -76,7 +76,7 @@ 'u16_default'), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), # produce another file u16_altWarnings.log - temporary test u16_warnings2 = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), diff --git a/FWCore/MessageService/test/u16_cfg.py b/FWCore/MessageService/test/u16_cfg.py index 285ce86791f44..337ca767745b7 100644 --- a/FWCore/MessageService/test/u16_cfg.py +++ b/FWCore/MessageService/test/u16_cfg.py @@ -21,7 +21,7 @@ extension = cms.untracked.string('mslog') ), default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -65,7 +65,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u16_warnings', 'u16_errors', 'u16_infos', diff --git a/FWCore/MessageService/test/u17_cfg.py b/FWCore/MessageService/test/u17_cfg.py index 9c1f36fff0225..11c13ef6e92ff 100644 --- a/FWCore/MessageService/test/u17_cfg.py +++ b/FWCore/MessageService/test/u17_cfg.py @@ -18,12 +18,12 @@ statistics = cms.untracked.vstring('u17_all'), categories = cms.untracked.vstring('cat_P', 'cat_S', - 'FwkJob', + 'FwkTest', 'FwkReport'), u17_all = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), FwkReport = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u19_cfg.py b/FWCore/MessageService/test/u19_cfg.py index 38b7b0b956289..df36eb38b4fea 100644 --- a/FWCore/MessageService/test/u19_cfg.py +++ b/FWCore/MessageService/test/u19_cfg.py @@ -14,7 +14,7 @@ u19_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -27,7 +27,7 @@ u19_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -35,7 +35,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob', + 'FwkTest', 'ridiculously_long_category_name') ) diff --git a/FWCore/MessageService/test/u19d_cfg.py b/FWCore/MessageService/test/u19d_cfg.py index c050e251db985..ae74c31adf0ad 100644 --- a/FWCore/MessageService/test/u19d_cfg.py +++ b/FWCore/MessageService/test/u19d_cfg.py @@ -15,7 +15,7 @@ u19d_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -28,7 +28,7 @@ u19d_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -36,7 +36,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob', + 'FwkTest', 'ridiculously_long_category_name') ) diff --git a/FWCore/MessageService/test/u1_cfg.py b/FWCore/MessageService/test/u1_cfg.py index bb94ac8723aa3..5585d4efa3ef9 100644 --- a/FWCore/MessageService/test/u1_cfg.py +++ b/FWCore/MessageService/test/u1_cfg.py @@ -17,7 +17,7 @@ u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -31,7 +31,7 @@ u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -40,7 +40,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -53,7 +53,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u1_warnings', 'u1_errors', 'u1_infos', diff --git a/FWCore/MessageService/test/u1d_cfg.py b/FWCore/MessageService/test/u1d_cfg.py index 874034561baf6..102aac617c9cf 100644 --- a/FWCore/MessageService/test/u1d_cfg.py +++ b/FWCore/MessageService/test/u1d_cfg.py @@ -18,7 +18,7 @@ u1d_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -32,7 +32,7 @@ u1d_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -41,7 +41,7 @@ ), u1d_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -54,7 +54,7 @@ ), debugModules = cms.untracked.vstring('*'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u1d_warnings', 'u1d_errors', 'u1d_infos', diff --git a/FWCore/MessageService/test/u21_cfg.py b/FWCore/MessageService/test/u21_cfg.py index a2ae69956597b..d8976d00b9652 100644 --- a/FWCore/MessageService/test/u21_cfg.py +++ b/FWCore/MessageService/test/u21_cfg.py @@ -11,14 +11,14 @@ process.MessageLogger = cms.Service("MessageLogger", default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), u21_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -26,7 +26,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob', + 'FwkTest', 'importantInfo', 'routineInfo'), u21_warnings = cms.untracked.PSet( @@ -43,7 +43,7 @@ preEventProcessing = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), threshold = cms.untracked.string('INFO') diff --git a/FWCore/MessageService/test/u22_cfg.py b/FWCore/MessageService/test/u22_cfg.py index c5f36eed3a9c3..cbf7c39cd7cac 100644 --- a/FWCore/MessageService/test/u22_cfg.py +++ b/FWCore/MessageService/test/u22_cfg.py @@ -13,14 +13,14 @@ process.MessageLogger = cms.Service("MessageLogger", default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), u22_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -28,7 +28,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u22_warnings') ) diff --git a/FWCore/MessageService/test/u23_cfg.py b/FWCore/MessageService/test/u23_cfg.py index 0483fc548996a..157d13771c301 100644 --- a/FWCore/MessageService/test/u23_cfg.py +++ b/FWCore/MessageService/test/u23_cfg.py @@ -12,7 +12,7 @@ process.MessageLogger = cms.Service("MessageLogger", default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -20,7 +20,7 @@ u23_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -28,7 +28,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob', + 'FwkTest', 'timer', 'trace'), destinations = cms.untracked.vstring('u23_infos') diff --git a/FWCore/MessageService/test/u24_cfg.py b/FWCore/MessageService/test/u24_cfg.py index 05d6941cc1971..cb8d7f1b1d1e4 100644 --- a/FWCore/MessageService/test/u24_cfg.py +++ b/FWCore/MessageService/test/u24_cfg.py @@ -12,7 +12,7 @@ process.MessageLogger = cms.Service("MessageLogger", default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -32,7 +32,7 @@ filename = cms.untracked.string('u24') ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u24_warnings', 'u24_errors') ) diff --git a/FWCore/MessageService/test/u25_cfg.py b/FWCore/MessageService/test/u25_cfg.py index a4ece22582662..9ad7c1f29b4c7 100644 --- a/FWCore/MessageService/test/u25_cfg.py +++ b/FWCore/MessageService/test/u25_cfg.py @@ -15,11 +15,11 @@ destinations = cms.untracked.vstring('u25_only'), statistics = cms.untracked.vstring('u25_only'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), u25_only = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u27_cfg.py b/FWCore/MessageService/test/u27_cfg.py index 581ac99ee0416..30ff731583e4d 100644 --- a/FWCore/MessageService/test/u27_cfg.py +++ b/FWCore/MessageService/test/u27_cfg.py @@ -17,14 +17,14 @@ statistics = cms.untracked.vstring('u27_infos'), messageSummaryToJobReport = cms.untracked.bool(True), default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), u27_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -32,7 +32,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob', + 'FwkTest', 'timer', 'trace'), destinations = cms.untracked.vstring('u27_infos') diff --git a/FWCore/MessageService/test/u30Lumi_cfg.py b/FWCore/MessageService/test/u30Lumi_cfg.py index 9ff385ccdae1f..b0aada1b13966 100644 --- a/FWCore/MessageService/test/u30Lumi_cfg.py +++ b/FWCore/MessageService/test/u30Lumi_cfg.py @@ -9,14 +9,14 @@ process.MessageLogger = cms.Service("MessageLogger", default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(1000) ) ), u30_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(1000) ), preEventProcessing = cms.untracked.PSet( @@ -24,7 +24,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u30_infos') ) diff --git a/FWCore/MessageService/test/u30_cfg.py b/FWCore/MessageService/test/u30_cfg.py index 758329a5f624b..7987b73cc7e2a 100644 --- a/FWCore/MessageService/test/u30_cfg.py +++ b/FWCore/MessageService/test/u30_cfg.py @@ -12,14 +12,14 @@ process.MessageLogger = cms.Service("MessageLogger", default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(1000) ) ), u30_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -27,7 +27,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u30_infos') ) diff --git a/FWCore/MessageService/test/u31_cfg.py b/FWCore/MessageService/test/u31_cfg.py index 1e2e22eb14336..ad58a269bb0a0 100644 --- a/FWCore/MessageService/test/u31_cfg.py +++ b/FWCore/MessageService/test/u31_cfg.py @@ -10,7 +10,7 @@ process.MessageLogger = cms.Service("MessageLogger", default = cms.untracked.PSet( - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), @@ -18,7 +18,7 @@ u31_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -26,7 +26,7 @@ ) ), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob', + 'FwkTest', 'timer', 'trace'), destinations = cms.untracked.vstring('u31_infos') diff --git a/FWCore/MessageService/test/u3_cfg.py b/FWCore/MessageService/test/u3_cfg.py index 38394ff0e0ed8..e3c85812ddac8 100644 --- a/FWCore/MessageService/test/u3_cfg.py +++ b/FWCore/MessageService/test/u3_cfg.py @@ -15,7 +15,7 @@ u3_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), preEventProcessing = cms.untracked.PSet( @@ -24,7 +24,7 @@ ), statistics = cms.untracked.vstring('u3_statistics'), categories = cms.untracked.vstring('preEventProcessing', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u3_infos') ) diff --git a/FWCore/MessageService/test/u7_cfg.py b/FWCore/MessageService/test/u7_cfg.py index 1c38fec627f3d..2da2ab11c88b2 100644 --- a/FWCore/MessageService/test/u7_cfg.py +++ b/FWCore/MessageService/test/u7_cfg.py @@ -1,5 +1,5 @@ # Unit test configuration file for MessageLogger service: -# Filtering all but one category (for example FwkJob) +# Filtering all but one category (for example FwkTest) import FWCore.ParameterSet.Config as cms @@ -22,13 +22,13 @@ ), u7_log = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), destinations = cms.untracked.vstring('u7_log', 'u7_restrict'), - categories = cms.untracked.vstring('FwkJob', + categories = cms.untracked.vstring('FwkTest', 'special') ) diff --git a/FWCore/MessageService/test/u8_cfg.py b/FWCore/MessageService/test/u8_cfg.py index 1935efef733f2..ef7b84881ceb8 100644 --- a/FWCore/MessageService/test/u8_cfg.py +++ b/FWCore/MessageService/test/u8_cfg.py @@ -38,7 +38,7 @@ expect_non_supercede_common_specific = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), limit = cms.untracked.int32(5), @@ -118,7 +118,7 @@ 'expect_supercede_specific', 'expect_non_supercede_common_specific', 'expect_specific', - 'FwkJob'), + 'FwkTest'), destinations = cms.untracked.vstring('u8_overall_unnamed', 'u8_overall_specific', 'u8_supercede_specific', diff --git a/FWCore/MessageService/test/u9_cfg.py b/FWCore/MessageService/test/u9_cfg.py index f08d8c6d110b9..78855aa34f0e8 100644 --- a/FWCore/MessageService/test/u9_cfg.py +++ b/FWCore/MessageService/test/u9_cfg.py @@ -14,9 +14,10 @@ process.MessageLogger.destinations = ['warnings', 'infos'] process.MessageLogger.statistics = ['warnings', 'infos'] +process.MessageLogger.categories.append('FwkTest') process.MessageLogger.default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(False), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), limit = cms.untracked.int32(-1) @@ -33,7 +34,7 @@ limit = cms.untracked.int32(2) ), noTimeStamps = cms.untracked.bool(True), - FwkJob = cms.untracked.PSet( + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ) diff --git a/FWCore/MessageService/test/unit_test_outputs/u28_output.log b/FWCore/MessageService/test/unit_test_outputs/u28_output.log index a9525441b5215..73b50b8c45ec6 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u28_output.log +++ b/FWCore/MessageService/test/unit_test_outputs/u28_output.log @@ -17,7 +17,7 @@ LogInfo was used to send this message %MSG-i cat_B: UnitTestClient_A:sendSomeMessages Run: 1 Event: 1 LogInfo was used to send this other message %MSG -%MSG-i FwkJob: UnitTestClient_A:sendSomeMessages Run: 1 Event: 1 +%MSG-i FwkTest: UnitTestClient_A:sendSomeMessages Run: 1 Event: 1 <Message>LogInfo was used to send a job report</Message> %MSG Begin processing the 2nd record. Run 1, Event 2, LumiSection 1 on stream 0 at {Timestamp} @@ -39,7 +39,7 @@ LogInfo was used to send this message %MSG-i cat_B: UnitTestClient_A:sendSomeMessages Run: 1 Event: 2 LogInfo was used to send this other message %MSG -%MSG-i FwkJob: UnitTestClient_A:sendSomeMessages Run: 1 Event: 2 +%MSG-i FwkTest: UnitTestClient_A:sendSomeMessages Run: 1 Event: 2 <Message>LogInfo was used to send a job report</Message> %MSG Begin processing the 3rd record. Run 1, Event 3, LumiSection 1 on stream 0 at {Timestamp} @@ -61,7 +61,7 @@ LogInfo was used to send this message %MSG-i cat_B: UnitTestClient_A:sendSomeMessages Run: 1 Event: 3 LogInfo was used to send this other message %MSG -%MSG-i FwkJob: UnitTestClient_A:sendSomeMessages Run: 1 Event: 3 +%MSG-i FwkTest: UnitTestClient_A:sendSomeMessages Run: 1 Event: 3 <Message>LogInfo was used to send a job report</Message> %MSG diff --git a/FWCore/MessageService/test/unit_test_outputs/u3_statistics.log b/FWCore/MessageService/test/unit_test_outputs/u3_statistics.log index d6ae5e5ca46f9..8bb515e16b6ae 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u3_statistics.log +++ b/FWCore/MessageService/test/unit_test_outputs/u3_statistics.log @@ -5,7 +5,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkJob -i UnitTestClient_A 3* 3 + 1 FwkTest -i UnitTestClient_A 3* 3 2 cat_A -i UnitTestClient_A 3 3 3 cat_B -i UnitTestClient_A 3 3 4 FwkReport -f AfterSource 3 3 @@ -18,7 +18,7 @@ MessageLogger Summary type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- - 1 FwkJob 1/1 1/2 1/3 + 1 FwkTest 1/1 1/2 1/3 2 cat_A 1/1 1/2 1/3 3 cat_B 1/1 1/2 1/3 4 FwkReport AfterSource AfterSource AfterSource diff --git a/FWCore/MessageService/test/unit_test_outputs/u4_another.log b/FWCore/MessageService/test/unit_test_outputs/u4_another.log index 571890404b49a..53f78d2040074 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u4_another.log +++ b/FWCore/MessageService/test/unit_test_outputs/u4_another.log @@ -5,7 +5,7 @@ MessageLogger Summary type category sev module subroutine count total ---- -------------------- -- ---------------- ---------------- ----- ----- - 1 FwkJob -i UnitTestClient_A 3* 3 + 1 FwkTest -i UnitTestClient_A 3* 3 2 cat_A -i UnitTestClient_A 3* 3 3 cat_B -i UnitTestClient_A 3* 3 4 FwkReport -f AfterSource 3* 3 @@ -18,7 +18,7 @@ MessageLogger Summary type category Examples: run/evt run/evt run/evt ---- -------------------- ---------------- ---------------- ---------------- - 1 FwkJob 1/1 1/2 1/3 + 1 FwkTest 1/1 1/2 1/3 2 cat_A 1/1 1/2 1/3 3 cat_B 1/1 1/2 1/3 4 FwkReport AfterSource AfterSource AfterSource From 5e602a89af0fc3b065bdc6ae180fa673cf5336d7 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Mon, 19 Oct 2020 15:52:43 -0500 Subject: [PATCH 725/778] clang-format --- .../test/UnitTestClient_A_suppTest.cc | 70 +++++++++---------- .../MessageService/test/UnitTestClient_D.cc | 2 +- 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/FWCore/MessageService/test/UnitTestClient_A_suppTest.cc b/FWCore/MessageService/test/UnitTestClient_A_suppTest.cc index 304da754fddaa..28ff7ace301f7 100644 --- a/FWCore/MessageService/test/UnitTestClient_A_suppTest.cc +++ b/FWCore/MessageService/test/UnitTestClient_A_suppTest.cc @@ -1,15 +1,15 @@ // UnitTestClient_A_suppTest is a variant on UnitTestClient_A -// that adds a function call (foo()) to the end of the statemnts -// of a LogDebug and a LogInfo. foo() has a side efffect +// that adds a function call (foo()) to the end of the statemnts +// of a LogDebug and a LogInfo. foo() has a side efffect // (a write to cerr). What we are testing is whether when LogDebug // is suppressed because EDM_ML_DEBUG is not defined, foo() is not -// called. -// -// The correct behavior is that cerr will get two lines of +// called. +// +// The correct behavior is that cerr will get two lines of // foo(LogInfo) was called. -// But cerr should get no lines of +// But cerr should get no lines of // foo(LogDebug) was called. -// +// // Test passed 9/27/10 #include "FWCore/MessageService/test/UnitTestClient_A.h" @@ -20,42 +20,38 @@ #include <string> // TEMPORARY - to test suppression -static std::string foo(std::string const & x) { +static std::string foo(std::string const& x) { std::cerr << "foo(" << x << ") was called.\n"; return std::string(); } -namespace edmtest -{ - -void - UnitTestClient_A::analyze( edm::Event const & /*unused*/ - , edm::EventSetup const & /*unused*/ - ) -{ - std::string empty_; - std::string file_ = "nameOfFile"; - LogDebug ("cat_A") << "LogDebug was used to send this message" -// TEMPORARY change to test suppression - << foo("LogDebug"); - LogDebug ("cat_B") << "LogDebug was used to send this other message"; - edm::LogError ("cat_A") << "LogError was used to send this message" - << "-which is long enough to span lines but-" - << "will not be broken up by the logger any more"; - edm::LogError ("cat_B") << "LogError was used to send this other message"; - edm::LogWarning("cat_A") << "LogWarning was used to send this message"; - edm::LogWarning("cat_B") << "LogWarning was used to send this other message"; - edm::LogInfo ("cat_A") << "LogInfo was used to send this message" -// TEMPORARY change to test suppression - << foo("LogInfo"); - edm::LogInfo ("cat_B") << "LogInfo was used to send this other message"; - edm::LogInfo ("FwkTest") << "<Message>LogInfo was used to send a job report</Message>"; - - } // MessageLoggerClient::analyze() - +namespace edmtest { + + void UnitTestClient_A::analyze(edm::Event const& /*unused*/ + , + edm::EventSetup const& /*unused*/ + ) { + std::string empty_; + std::string file_ = "nameOfFile"; + LogDebug("cat_A") << "LogDebug was used to send this message" + // TEMPORARY change to test suppression + << foo("LogDebug"); + LogDebug("cat_B") << "LogDebug was used to send this other message"; + edm::LogError("cat_A") << "LogError was used to send this message" + << "-which is long enough to span lines but-" + << "will not be broken up by the logger any more"; + edm::LogError("cat_B") << "LogError was used to send this other message"; + edm::LogWarning("cat_A") << "LogWarning was used to send this message"; + edm::LogWarning("cat_B") << "LogWarning was used to send this other message"; + edm::LogInfo("cat_A") << "LogInfo was used to send this message" + // TEMPORARY change to test suppression + << foo("LogInfo"); + edm::LogInfo("cat_B") << "LogInfo was used to send this other message"; + edm::LogInfo("FwkTest") << "<Message>LogInfo was used to send a job report</Message>"; + + } // MessageLoggerClient::analyze() } // namespace edmtest - using edmtest::UnitTestClient_A; DEFINE_FWK_MODULE(UnitTestClient_A); diff --git a/FWCore/MessageService/test/UnitTestClient_D.cc b/FWCore/MessageService/test/UnitTestClient_D.cc index e693b9fbe34c8..517397a3fcda8 100644 --- a/FWCore/MessageService/test/UnitTestClient_D.cc +++ b/FWCore/MessageService/test/UnitTestClient_D.cc @@ -15,7 +15,7 @@ namespace edmtest { edm::LogWarning("cat_A") << "This message should not appear in " << "the framework job report"; edm::LogWarning("FwkTest") << "<Message>This message should appear in " - << "the framework job report</Message>"; + << "the framework job report</Message>"; edm::LogWarning("special") << "This message should appear in " << "restrict but the others should not"; From 917004d521801ea73b74800e2c135e00732168a6 Mon Sep 17 00:00:00 2001 From: mmusich <marco.musich@cern.ch> Date: Tue, 20 Oct 2020 15:41:45 +0200 Subject: [PATCH 726/778] fix stray Global Tags post GeometricDetExtra Migration --- .../python/clients/beam_dqm_sourceclient-live_cfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQM/Integration/python/clients/beam_dqm_sourceclient-live_cfg.py b/DQM/Integration/python/clients/beam_dqm_sourceclient-live_cfg.py index 8165fdc9b5727..6a51290c79c27 100644 --- a/DQM/Integration/python/clients/beam_dqm_sourceclient-live_cfg.py +++ b/DQM/Integration/python/clients/beam_dqm_sourceclient-live_cfg.py @@ -73,7 +73,7 @@ from Configuration.AlCa.GlobalTag import GlobalTag as gtCustomise process.GlobalTag = gtCustomise(process.GlobalTag, 'auto:run2_data', '') # you may need to set manually the GT in the line below - process.GlobalTag.globaltag = '100X_upgrade2018_realistic_v10' + #process.GlobalTag.globaltag = '100X_upgrade2018_realistic_v10' #---------------------------- # BeamMonitor From 7eb2e9950c07a20fa6045ff085981afe3eabf6f5 Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Tue, 20 Oct 2020 08:54:57 -0500 Subject: [PATCH 727/778] Added pull request number comment --- HLTrigger/Configuration/python/customizeHLTforCMSSW.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index 161a1fd7920d5..18e5251dd8cd8 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -219,6 +219,8 @@ def customizeHLTforCMSSW(process, menuType="GRun"): # add call to action function in proper order: newest last! # process = customiseFor12718(process) + + #introduced in pull request #31859 process = customizeToDropObsoleteMessageLoggerOptions(process) return process From 53de0fc25544dcad1b84ad7944b7a6a0e4a7c8ee Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 17:19:55 +0200 Subject: [PATCH 728/778] Take notes from Kevin --- CondFormats/GeometryObjects/interface/MuonOffsetMap.h | 4 ++-- Geometry/MuonNumbering/interface/MuonOffsetFromDD.h | 4 ++-- Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CondFormats/GeometryObjects/interface/MuonOffsetMap.h b/CondFormats/GeometryObjects/interface/MuonOffsetMap.h index 66f02e974a806..c9e1ea63986b9 100644 --- a/CondFormats/GeometryObjects/interface/MuonOffsetMap.h +++ b/CondFormats/GeometryObjects/interface/MuonOffsetMap.h @@ -8,8 +8,8 @@ class MuonOffsetMap { public: - MuonOffsetMap(void) {} - ~MuonOffsetMap(void) {} + MuonOffsetMap() {} + ~MuonOffsetMap() {} std::unordered_map<std::string, std::pair<int, int> > muonMap_; diff --git a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h index 5c1d70ae863bf..34fb7d35e7522 100644 --- a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h +++ b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h @@ -1,5 +1,5 @@ -#ifndef MuonNUmbering_MuonOffsetFromDD_h -#define MuonNUmbering_MuonOffsetFromDD_h +#ifndef Geometry_MuonNUmbering_MuonOffsetFromDD_h +#define Geometry_MuonNUmbering_MuonOffsetFromDD_h #include "DetectorDescription/Core/interface/DDsvalues.h" #include "DetectorDescription/Core/interface/DDCompactView.h" diff --git a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc index 2e3664fc619b4..be8795cd03f93 100644 --- a/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc +++ b/Geometry/MuonNumbering/plugins/MuonOffsetESProducer.cc @@ -16,8 +16,6 @@ // // -#include <memory> - #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESProducer.h" #include "FWCore/Framework/interface/ESTransientHandle.h" @@ -134,13 +132,13 @@ MuonOffsetESProducer::ReturnType MuonOffsetESProducer::produce(const IdealGeomet if (fromDD4Hep_) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access cms::DDCompactView"; + edm::LogVerbatim("MuonGeom") << "MuonOffsetESProducer::Try to access cms::DDCompactView"; #endif edm::ESTransientHandle<cms::DDCompactView> cpv = iRecord.getTransientHandle(cpvTokenDD4Hep_); builder.build(&(*cpv), *ptp); } else { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HCalGeom") << "CaloSimParametersESModule::Try to access DDCompactView"; + edm::LogVerbatim("MuonGeom") << "MuonOffsetESProducer::Try to access DDCompactView"; #endif edm::ESTransientHandle<DDCompactView> cpv = iRecord.getTransientHandle(cpvTokenDDD_); builder.build(&(*cpv), *ptp); From eb4659718631429856c1b7d8569eec087068fea2 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 17:21:49 +0200 Subject: [PATCH 729/778] Utilize ESGetToken in most of the classes in the package HcalCalibAlgos --- .../HcalCalibAlgos/plugins/AnalyzerMinbias.cc | 41 +++++--- .../plugins/Analyzer_minbias.cc | 12 +-- .../HcalCalibAlgos/plugins/Analyzer_minbias.h | 4 + .../plugins/HcalHBHEMuonAnalyzer.cc | 86 ++++++++-------- .../plugins/HcalHBHEMuonHighEtaAnalyzer.cc | 97 ++++++++++--------- .../plugins/HcalIsoTrkAnalyzer.cc | 63 ++++++------ .../plugins/RecAnalyzerMinbias.cc | 14 +-- .../plugins/SimAnalyzerMinbias.cc | 38 ++++---- .../python/simAnalyzerMinbias_cfi.py | 5 - 9 files changed, 186 insertions(+), 174 deletions(-) delete mode 100644 Calibration/HcalCalibAlgos/python/simAnalyzerMinbias_cfi.py diff --git a/Calibration/HcalCalibAlgos/plugins/AnalyzerMinbias.cc b/Calibration/HcalCalibAlgos/plugins/AnalyzerMinbias.cc index 9e5fc8103f3d3..8debe10ab5095 100644 --- a/Calibration/HcalCalibAlgos/plugins/AnalyzerMinbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/AnalyzerMinbias.cc @@ -59,6 +59,8 @@ #include "TH2.h" #include "TTree.h" +//#define EDM_ML_DEBUG + namespace HcalMinbias {} // constructors and destructor @@ -114,6 +116,7 @@ class AnalyzerMinbias : public edm::EDAnalyzer { edm::EDGetTokenT<HORecHitCollection> tok_horecoMB_, tok_horecoNoise_; edm::EDGetTokenT<HBHERecHitCollection> tok_hbheNormal_; edm::EDGetTokenT<L1GlobalTriggerObjectMapRecord> tok_hltL1GtMap_; + edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> tok_respCorr_; }; AnalyzerMinbias::AnalyzerMinbias(const edm::ParameterSet& iConfig) { @@ -135,6 +138,8 @@ AnalyzerMinbias::AnalyzerMinbias(const edm::ParameterSet& iConfig) { tok_hbheNormal_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco")); tok_hltL1GtMap_ = consumes<L1GlobalTriggerObjectMapRecord>(edm::InputTag("hltL1GtObjectMap")); + + tok_respCorr_ = esConsumes<HcalRespCorrs, HcalRespCorrsRcd>(); } AnalyzerMinbias::~AnalyzerMinbias() {} @@ -186,7 +191,9 @@ void AnalyzerMinbias::beginJob() { void AnalyzerMinbias::endJob() { int ii = 0; for (std::map<std::pair<int, HcalDetId>, myInfo>::const_iterator itr = myMap_.begin(); itr != myMap_.end(); ++itr) { - LogDebug("AnalyzerMB") << "Fired trigger bit number " << itr->first.first; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AnalyzerMB") << "Fired trigger bit number " << itr->first.first; +#endif myInfo info = itr->second; if (info.theMB0 > 0) { mom0_MB = info.theMB0; @@ -208,20 +215,22 @@ void AnalyzerMinbias::endJob() { depth = itr->first.second.depth(); ieta = itr->first.second.ieta(); iphi = itr->first.second.iphi(); - - LogDebug("AnalyzerMB") << " Result= " << trigbit << " " << mysubd << " " << ieta << " " << iphi << " mom0 " +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AnalyzerMB") << " Result= " << trigbit << " " << mysubd << " " << ieta << " " << iphi << " mom0 " << mom0_MB << " mom1 " << mom1_MB << " mom2 " << mom2_MB << " mom3 " << mom3_MB << " mom4 " << mom4_MB << " mom0_Noise " << mom0_Noise << " mom1_Noise " << mom1_Noise << " mom2_Noise " << mom2_Noise << " mom3_Noise " << mom3_Noise << " mom4_Noise " << mom4_Noise << " mom0_Diff " << mom0_Diff << " mom1_Diff " << mom1_Diff << " mom2_Diff " << mom2_Diff; +#endif myTree->Fill(); ii++; } } cells = ii; - LogDebug("AnalyzerMB") << "cells" - << " " << cells; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AnalyzerMB") << "cells " << cells; +#endif hOutputFile->Write(); hOutputFile->cd(); myTree->Write(); @@ -242,17 +251,15 @@ void AnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup& i rnnum = (float)iEvent.run(); const HcalRespCorrs* myRecalib = nullptr; if (theRecalib_) { - edm::ESHandle<HcalRespCorrs> recalibCorrs; - iSetup.get<HcalRespCorrsRcd>().get("recalibrate", recalibCorrs); - myRecalib = recalibCorrs.product(); + myRecalib = &iSetup.getData(tok_respCorr_); } // theRecalib edm::Handle<HBHERecHitCollection> hbheNormal; iEvent.getByToken(tok_hbheNormal_, hbheNormal); if (!hbheNormal.isValid()) { - edm::LogInfo("AnalyzerMB") << " hbheNormal failed"; + edm::LogVerbatim("AnalyzerMB") << " hbheNormal failed"; } else { - edm::LogInfo("AnalyzerMB") << " The size of the normal collection " << hbheNormal->size(); + edm::LogVerbatim("AnalyzerMB") << " The size of the normal collection " << hbheNormal->size(); } edm::Handle<HBHERecHitCollection> hbheNS; @@ -262,7 +269,7 @@ void AnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup& i return; } const HBHERecHitCollection HithbheNS = *(hbheNS.product()); - edm::LogInfo("AnalyzerMB") << "HBHE NS size of collection " << HithbheNS.size(); + edm::LogVerbatim("AnalyzerMB") << "HBHE NS size of collection " << HithbheNS.size(); if (runNZS_ && HithbheNS.size() != 5184) { edm::LogWarning("AnalyzerMB") << "HBHE NS problem " << rnnum << " size " << HithbheNS.size(); return; @@ -275,7 +282,7 @@ void AnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup& i return; } const HBHERecHitCollection HithbheMB = *(hbheMB.product()); - edm::LogInfo("AnalyzerMB") << "HBHE MB size of collection " << HithbheMB.size(); + edm::LogVerbatim("AnalyzerMB") << "HBHE MB size of collection " << HithbheMB.size(); if (runNZS_ && HithbheMB.size() != 5184) { edm::LogWarning("AnalyzerMB") << "HBHE problem " << rnnum << " size " << HithbheMB.size(); return; @@ -288,7 +295,7 @@ void AnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup& i return; } const HFRecHitCollection HithfNS = *(hfNS.product()); - edm::LogInfo("AnalyzerMB") << "HF NS size of collection " << HithfNS.size(); + edm::LogVerbatim("AnalyzerMB") << "HF NS size of collection " << HithfNS.size(); if (runNZS_ && HithfNS.size() != 1728) { edm::LogWarning("AnalyzerMB") << "HF NS problem " << rnnum << " size " << HithfNS.size(); return; @@ -301,7 +308,7 @@ void AnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup& i return; } const HFRecHitCollection HithfMB = *(hfMB.product()); - edm::LogInfo("AnalyzerMB") << "HF MB size of collection " << HithfMB.size(); + edm::LogVerbatim("AnalyzerMB") << "HF MB size of collection " << HithfMB.size(); if (runNZS_ && HithfMB.size() != 1728) { edm::LogWarning("AnalyzerMB") << "HF problem " << rnnum << " size " << HithfMB.size(); return; @@ -325,11 +332,13 @@ void AnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup& i analyzeHcal(myRecalib, HithbheNS, HithbheMB, HithfNS, HithfMB, algoBit, fill); fill = false; std::string algoNameStr = (*itMap).algoName(); - LogDebug("AnalyzerMB") << "Trigger[" << ii << "] " << algoNameStr << " bit " << algoBit << " entered"; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("AnalyzerMB") << "Trigger[" << ii << "] " << algoNameStr << " bit " << algoBit << " entered"; +#endif } } if (!ok) - edm::LogInfo("AnalyzerMB") << "No passed L1 Triggers"; + edm::LogVerbatim("AnalyzerMB") << "No passed L1 Triggers"; } } } diff --git a/Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.cc b/Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.cc index 75fcaa036851b..af311b27c5060 100644 --- a/Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.cc @@ -59,6 +59,8 @@ namespace cms { tok_gtRec_ = consumes<L1GlobalTriggerReadoutRecord>(edm::InputTag("gtDigisAlCaMB")); tok_hbheNorm_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco")); + tok_respCorr_ = esConsumes<HcalRespCorrs, HcalRespCorrsRcd>(); + theRecalib = iConfig.getParameter<bool>("Recalib"); // @@ -78,8 +80,8 @@ namespace cms { // (e.g. close files, deallocate resources etc.) } - void Analyzer_minbias::beginRun(const edm::Run& r, const edm::EventSetup& iSetup) { nevent_run = 0; } - void Analyzer_minbias::endRun(const edm::Run& r, const edm::EventSetup& iSetup) { + void Analyzer_minbias::beginRun(const edm::Run&, const edm::EventSetup&) { nevent_run = 0; } + void Analyzer_minbias::endRun(const edm::Run& r, const edm::EventSetup&) { edm::LogInfo("AnalyzerMB") << " Runnumber " << r.run() << " Nevents " << nevent_run; } @@ -415,11 +417,7 @@ namespace cms { const HcalRespCorrs* myRecalib = nullptr; if (theRecalib) { - // Radek: - edm::ESHandle<HcalRespCorrs> recalibCorrs; - iSetup.get<HcalRespCorrsRcd>().get("recalibrate", recalibCorrs); - myRecalib = recalibCorrs.product(); - // end + myRecalib = &iSetup.getData(tok_respCorr_); } // theRecalib // Noise part for HB HE diff --git a/Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.h b/Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.h index a7cd4735a16b0..ddc64043ade4c 100644 --- a/Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.h +++ b/Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.h @@ -17,6 +17,8 @@ #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "FWCore/Common/interface/TriggerNames.h" +#include "CondFormats/DataRecord/interface/HcalRespCorrsRcd.h" +#include "CondFormats/HcalObjects/interface/HcalRespCorrs.h" #include "DataFormats/Common/interface/Ref.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" @@ -146,6 +148,8 @@ namespace cms { edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> tok_gtRec_; edm::EDGetTokenT<HBHERecHitCollection> tok_hbheNorm_; + edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> tok_respCorr_; + bool theRecalib; }; } // namespace cms diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc index 0d0e591e41e36..a5c74c8a16a1a 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc @@ -85,7 +85,7 @@ class HcalHBHEMuonAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, ed double activeLength(const DetId&); bool isGoodVertex(const reco::Vertex& vtx); double respCorr(const DetId& id); - double gainFactor(const edm::ESHandle<HcalDbService>&, const HcalDetId& id); + double gainFactor(const HcalDbService* dbserv, const HcalDetId& id); int depth16HE(int ieta, int iphi); bool goodCell(const HcalDetId& hcid, const reco::Track* pTrack, const CaloGeometry* geo, const MagneticField* bField); @@ -105,6 +105,7 @@ class HcalHBHEMuonAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, ed const HcalDDDRecConstants* hdc_; const HcalTopology* theHBHETopology_; + const CaloGeometry* geo_; HcalRespCorrs* respCorrs_; edm::EDGetTokenT<edm::TriggerResults> tok_trigRes_; @@ -114,6 +115,16 @@ class HcalHBHEMuonAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, ed edm::EDGetTokenT<HBHERecHitCollection> tok_HBHE_; edm::EDGetTokenT<reco::MuonCollection> tok_Muon_; + edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> tok_ddrec_; + edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> tok_htopo_; + edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> tok_respcorr_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_magField_; + edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> tok_chan_; + edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> tok_sevlv_; + edm::ESGetToken<CaloTopology, CaloTopologyRecord> tok_topo_; + edm::ESGetToken<HcalDbService, HcalDbRecord> tok_dbservice_; + ////////////////////////////////////////////////////// static const int depthMax_ = 7; TTree* tree_; @@ -210,6 +221,16 @@ HcalHBHEMuonAnalyzer::HcalHBHEMuonAnalyzer(const edm::ParameterSet& iConfig) << edm::InputTag(modnam, labelMuon_, procnm); } + tok_ddrec_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>(); + tok_htopo_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>(); + tok_respcorr_ = esConsumes<HcalRespCorrs, HcalRespCorrsRcd, edm::Transition::BeginRun>(); + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>(); + tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + tok_chan_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>(); + tok_sevlv_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>(); + tok_topo_ = esConsumes<CaloTopology, CaloTopologyRecord>(); + tok_dbservice_ = esConsumes<HcalDbService, HcalDbRecord>(); + if (!fileInCorr_.empty()) { std::ifstream infile(fileInCorr_.c_str()); if (infile.is_open()) { @@ -284,27 +305,11 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet } // get handles to calogeometry and calotopology - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); - - edm::ESHandle<MagneticField> bFieldH; - iSetup.get<IdealMagneticFieldRecord>().get(bFieldH); - const MagneticField* bField = bFieldH.product(); - - edm::ESHandle<EcalChannelStatus> ecalChStatus; - iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus); - const EcalChannelStatus* theEcalChStatus = ecalChStatus.product(); - - edm::ESHandle<EcalSeverityLevelAlgo> sevlv; - iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv); - - edm::ESHandle<CaloTopology> theCaloTopology; - iSetup.get<CaloTopologyRecord>().get(theCaloTopology); - const CaloTopology* caloTopology = theCaloTopology.product(); - - edm::ESHandle<HcalDbService> conditions; - iSetup.get<HcalDbRecord>().get(conditions); + const MagneticField* bField = &iSetup.getData(tok_magField_); + const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_chan_); + const EcalSeverityLevelAlgo* sevlv = &iSetup.getData(tok_sevlv_); + const CaloTopology* caloTopology = &iSetup.getData(tok_topo_); + const HcalDbService* conditions = &iSetup.getData(tok_dbservice_); // Relevant blocks from iEvent edm::Handle<reco::VertexCollection> vtx; @@ -467,7 +472,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet } if (RecMuon->innerTrack().isNonnull()) { const reco::Track* pTrack = (RecMuon->innerTrack()).get(); - spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, (((verbosity_ / 100) % 10 > 0))); + spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0))); if ((RecMuon->p() > 10.0) && (trackID.okHCAL)) accept = true; @@ -476,7 +481,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet ehcalDetId_.push_back((trackID.detIdEHCAL)()); HcalDetId check; - std::pair<bool, HcalDetId> info = spr::propagateHCALBack(pTrack, geo, bField, (((verbosity_ / 100) % 10 > 0))); + std::pair<bool, HcalDetId> info = spr::propagateHCALBack(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0))); if (info.first) { check = info.second; } @@ -488,9 +493,9 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet barrelRecHitsHandle, endcapRecHitsHandle, *theEcalChStatus, - geo, + geo_, caloTopology, - sevlv.product(), + sevlv, 1, 1, -100.0, @@ -564,7 +569,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet for (const auto& ehd : ehdepth) edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first; } else { - tmpC = goodCell(hcid0, pTrack, geo, bField); + tmpC = goodCell(hcid0, pTrack, geo_, bField); double enec(ene); if (unCorrect_) { double corr = (ignoreHECorr_ && (subdet0 == HcalEndcap)) ? 1.0 : respCorr(DetId(hcid0)); @@ -601,7 +606,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet } #endif HcalDetId hotCell; - spr::eHCALmatrix(geo, theHBHETopology_, closestCell, hbhe, 1, 1, hotCell, false, useRaw_, false); + spr::eHCALmatrix(geo_, theHBHETopology_, closestCell, hbhe, 1, 1, hotCell, false, useRaw_, false); isHot = matchId(closestCell, hotCell); if (hotCell != HcalDetId()) { subdet = HcalDetId(hotCell).subdet(); @@ -638,7 +643,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet for (const auto& ehd : ehdepth) edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first; } else { - tmpC = goodCell(hcid0, pTrack, geo, bField); + tmpC = goodCell(hcid0, pTrack, geo_, bField); double chg(ene), enec(ene); if (unCorrect_) { double corr = (ignoreHECorr_ && (subdet0 == HcalEndcap)) ? 1.0 : respCorr(DetId(hcid0)); @@ -884,9 +889,8 @@ void HcalHBHEMuonAnalyzer::beginJob() { // ------------ method called when starting to processes a run ------------ void HcalHBHEMuonAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { - edm::ESHandle<HcalDDDRecConstants> pHRNDC; - iSetup.get<HcalRecNumberingRecord>().get(pHRNDC); - hdc_ = pHRNDC.product(); + + hdc_ = &iSetup.getData(tok_ddrec_); actHB.clear(); actHE.clear(); actHB = hdc_->getThickActive(0); @@ -940,21 +944,15 @@ void HcalHBHEMuonAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup const& << "name HLT failed"; } - edm::ESHandle<HcalTopology> htopo; - iSetup.get<HcalRecNumberingRecord>().get(htopo); - theHBHETopology_ = htopo.product(); - - edm::ESHandle<HcalRespCorrs> resp; - iSetup.get<HcalRespCorrsRcd>().get(resp); - respCorrs_ = new HcalRespCorrs(*resp.product()); + theHBHETopology_ = &iSetup.getData(tok_htopo_); + const HcalRespCorrs* resp = &iSetup.getData(tok_respcorr_); + respCorrs_ = new HcalRespCorrs(*resp); respCorrs_->setTopo(theHBHETopology_); + geo_ = &iSetup.getData(tok_geom_); // Write correction factors for all HB/HE events if (writeRespCorr_) { - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); - const HcalGeometry* gHcal = (const HcalGeometry*)(geo->getSubdetectorGeometry(DetId::Hcal, HcalBarrel)); + const HcalGeometry* gHcal = static_cast<const HcalGeometry*>(geo_->getSubdetectorGeometry(DetId::Hcal, HcalBarrel)); const std::vector<DetId>& ids = gHcal->getValidDetIds(DetId::Hcal, 0); edm::LogVerbatim("HBHEMuon") << "\nTable of Correction Factors for Run " << iRun.run() << "\n"; for (auto const& id : ids) { @@ -1142,7 +1140,7 @@ double HcalHBHEMuonAnalyzer::respCorr(const DetId& id) { return cfac; } -double HcalHBHEMuonAnalyzer::gainFactor(const edm::ESHandle<HcalDbService>& conditions, const HcalDetId& id) { +double HcalHBHEMuonAnalyzer::gainFactor(const HcalDbService* conditions, const HcalDetId& id) { double gain(0.0); const HcalCalibrations& calibs = conditions->getHcalCalibrations(id); for (int capid = 0; capid < 4; ++capid) diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc index d47e942fbf91d..e241a3d59399d 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc @@ -93,7 +93,7 @@ class HcalHBHEMuonHighEtaAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR double activeLength(const DetId&); bool isGoodVertex(const reco::Vertex&); double respCorr(const DetId&); - double gainFactor(const edm::ESHandle<HcalDbService>&, const HcalDetId&); + double gainFactor(const HcalDbService*, const HcalDetId&); int depth16HE(int, int); bool goodCell(const HcalDetId&, const reco::Track*, const CaloGeometry*, const MagneticField*); void fillTrackParameters(const reco::Track*, math::XYZPoint); @@ -112,7 +112,13 @@ class HcalHBHEMuonHighEtaAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR const HcalDDDRecConstants* hdc_; const HcalTopology* theHBHETopology_; + const CaloGeometry* geo_; HcalRespCorrs* respCorrs_; + const MagneticField* bField_; + const EcalChannelStatus* theEcalChStatus_; + const EcalSeverityLevelAlgo* sevlv_; + const CaloTopology* caloTopology_; + const HcalDbService* conditions_; edm::EDGetTokenT<reco::VertexCollection> tok_Vtx_; edm::EDGetTokenT<EcalRecHitCollection> tok_EB_; @@ -121,12 +127,15 @@ class HcalHBHEMuonHighEtaAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR edm::EDGetTokenT<reco::MuonCollection> tok_Muon_; edm::EDGetTokenT<reco::TrackCollection> tok_genTrack_; - edm::ESHandle<CaloGeometry> pG_; - edm::ESHandle<MagneticField> bFieldH_; - edm::ESHandle<EcalChannelStatus> ecalChStatus_; - edm::ESHandle<EcalSeverityLevelAlgo> sevlv_; - edm::ESHandle<CaloTopology> theCaloTopology_; - edm::ESHandle<HcalDbService> conditions_; + edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> tok_ddrec_; + edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> tok_htopo_; + edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> tok_respcorr_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_magField_; + edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> tok_chan_; + edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> tok_sevlv_; + edm::ESGetToken<CaloTopology, CaloTopologyRecord> tok_topo_; + edm::ESGetToken<HcalDbService, HcalDbRecord> tok_dbservice_; edm::Handle<EcalRecHitCollection> barrelRecHitsHandle_; edm::Handle<EcalRecHitCollection> endcapRecHitsHandle_; @@ -134,7 +143,7 @@ class HcalHBHEMuonHighEtaAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR ////////////////////////////////////////////////////// static const int depthMax_ = 7; - TTree* tree_; + TTree *tree_; unsigned int runNumber_, eventNumber_, goodVertex_; std::vector<bool> mediumMuon_; std::vector<double> ptGlob_, etaGlob_, phiGlob_, energyMuon_, pMuon_; @@ -219,6 +228,16 @@ HcalHBHEMuonHighEtaAnalyzer::HcalHBHEMuonHighEtaAnalyzer(const edm::ParameterSet << labelEBRecHit_ << " EE " << labelEERecHit_ << " HBHE " << labelHBHERecHit_ << " MU " << labelMuon_; + tok_ddrec_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>(); + tok_htopo_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>(); + tok_respcorr_ = esConsumes<HcalRespCorrs, HcalRespCorrsRcd, edm::Transition::BeginRun>(); + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>(); + tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + tok_chan_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>(); + tok_sevlv_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>(); + tok_topo_ = esConsumes<CaloTopology, CaloTopologyRecord>(); + tok_dbservice_ = esConsumes<HcalDbService, HcalDbRecord>(); + if (!fileInCorr_.empty()) { std::ifstream infile(fileInCorr_.c_str()); if (infile.is_open()) { @@ -349,13 +368,11 @@ void HcalHBHEMuonHighEtaAnalyzer::analyze(const edm::Event& iEvent, const edm::E #endif // get handles to calogeometry and calotopology - iSetup.get<CaloGeometryRecord>().get(pG_); - - iSetup.get<IdealMagneticFieldRecord>().get(bFieldH_); - iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus_); - iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv_); - iSetup.get<CaloTopologyRecord>().get(theCaloTopology_); - iSetup.get<HcalDbRecord>().get(conditions_); + bField_ = &iSetup.getData(tok_magField_); + theEcalChStatus_ = &iSetup.getData(tok_chan_); + sevlv_ = &iSetup.getData(tok_sevlv_); + caloTopology_ = &iSetup.getData(tok_topo_); + conditions_ = &iSetup.getData(tok_dbservice_); // Relevant blocks from iEvent edm::Handle<reco::VertexCollection> vtx; @@ -430,9 +447,7 @@ void HcalHBHEMuonHighEtaAnalyzer::analyze(const edm::Event& iEvent, const edm::E // ------------ method called when starting to processes a run ------------ void HcalHBHEMuonHighEtaAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { - edm::ESHandle<HcalDDDRecConstants> pHRNDC; - iSetup.get<HcalRecNumberingRecord>().get(pHRNDC); - hdc_ = pHRNDC.product(); + hdc_ = &iSetup.getData(tok_ddrec_); actHB.clear(); actHE.clear(); actHB = hdc_->getThickActive(0); @@ -463,21 +478,15 @@ void HcalHBHEMuonHighEtaAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup } #endif - edm::ESHandle<HcalTopology> htopo; - iSetup.get<HcalRecNumberingRecord>().get(htopo); - theHBHETopology_ = htopo.product(); - - edm::ESHandle<HcalRespCorrs> resp; - iSetup.get<HcalRespCorrsRcd>().get(resp); - respCorrs_ = new HcalRespCorrs(*resp.product()); + theHBHETopology_ = &iSetup.getData(tok_htopo_); + const HcalRespCorrs* resp = &iSetup.getData(tok_respcorr_); + respCorrs_ = new HcalRespCorrs(*resp); respCorrs_->setTopo(theHBHETopology_); + geo_ = &iSetup.getData(tok_geom_); // Write correction factors for all HB/HE events if (writeRespCorr_) { - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); - const HcalGeometry* gHcal = (const HcalGeometry*)(geo->getSubdetectorGeometry(DetId::Hcal, HcalBarrel)); + const HcalGeometry* gHcal = (const HcalGeometry*)(geo_->getSubdetectorGeometry(DetId::Hcal, HcalBarrel)); const std::vector<DetId>& ids = gHcal->getValidDetIds(DetId::Hcal, 0); edm::LogVerbatim("HBHEMuon") << "\nTable of Correction Factors for Run " << iRun.run() << "\n"; for (auto const& id : ids) { @@ -561,10 +570,8 @@ bool HcalHBHEMuonHighEtaAnalyzer::analyzeHadron(const edm::Event& iEvent, math:: bool accept = false; if (!trkCollection.isValid()) { - const CaloGeometry* geo = pG_.product(); - const MagneticField* bField = bFieldH_.product(); std::vector<spr::propagatedTrackID> trkCaloDets; - spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDets, false); + spr::propagateCALO(trkCollection, geo_, bField_, theTrackQuality_, trkCaloDets, false); int nTrack(0); std::vector<spr::propagatedTrackID>::const_iterator trkDetItr; for (trkDetItr = trkCaloDets.begin(), nTrack = 0; trkDetItr != trkCaloDets.end(); trkDetItr++, nTrack++) { @@ -582,17 +589,13 @@ bool HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(const reco::Track* pTrack, int nTrack, std::vector<spr::propagatedTrackID>& trkCaloDets, bool ifHadron) { - const CaloGeometry* geo = pG_.product(); - const MagneticField* bField = bFieldH_.product(); - const EcalChannelStatus* theEcalChStatus = ecalChStatus_.product(); - const CaloTopology* caloTopology = theCaloTopology_.product(); bool accept(false); if (spr::goodTrack(pTrack, leadPV, selectionParameter_, false)) { - spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false); + spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo_, bField_, false); if (trackID.okECAL && trackID.okHCAL) { - double emaxNearP = (ifHadron) ? spr::chargeIsolationEcal(nTrack, trkCaloDets, geo, caloTopology, 15, 15) : 0; + double emaxNearP = (ifHadron) ? spr::chargeIsolationEcal(nTrack, trkCaloDets, geo_, caloTopology_, 15, 15) : 0; if (emaxNearP < emaxNearPThr_) { double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0); double eHcalDepth[depthMax_], eHcalDepthHot[depthMax_]; @@ -613,7 +616,7 @@ bool HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(const reco::Track* pTrack, } HcalDetId check; - std::pair<bool, HcalDetId> info = spr::propagateHCALBack(pTrack, geo, bField, false); + std::pair<bool, HcalDetId> info = spr::propagateHCALBack(pTrack, geo_, bField_, false); if (info.first) check = info.second; @@ -621,10 +624,10 @@ bool HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(const reco::Track* pTrack, std::pair<double, bool> e3x3 = spr::eECALmatrix(isoCell, barrelRecHitsHandle_, endcapRecHitsHandle_, - *theEcalChStatus, - geo, - caloTopology, - sevlv_.product(), + *theEcalChStatus_, + geo_, + caloTopology_, + sevlv_, 1, 1, -100.0, @@ -698,7 +701,7 @@ bool HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(const reco::Track* pTrack, for (const auto& ehd : ehdepth) edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first; } else { - tmpC = goodCell(hcid0, pTrack, geo, bField); + tmpC = goodCell(hcid0, pTrack, geo_, bField_); double enec(ene); if (unCorrect_) { double corr = (ignoreHECorr_ && (subdet0 == HcalEndcap)) ? 1.0 : respCorr(DetId(hcid0)); @@ -737,7 +740,7 @@ bool HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(const reco::Track* pTrack, } #endif HcalDetId hotCell; - spr::eHCALmatrix(geo, theHBHETopology_, closestCell, hbhe_, 1, 1, hotCell, false, useRaw_, false); + spr::eHCALmatrix(geo_, theHBHETopology_, closestCell, hbhe_, 1, 1, hotCell, false, useRaw_, false); isHot = matchId(closestCell, hotCell); if (hotCell != HcalDetId()) { subdet = HcalDetId(hotCell).subdet(); @@ -774,7 +777,7 @@ bool HcalHBHEMuonHighEtaAnalyzer::analyzeTracks(const reco::Track* pTrack, for (const auto& ehd : ehdepth) edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first; } else { - tmpC = goodCell(hcid0, pTrack, geo, bField); + tmpC = goodCell(hcid0, pTrack, geo_, bField_); double chg(ene), enec(ene); if (unCorrect_) { double corr = (ignoreHECorr_ && (subdet0 == HcalEndcap)) ? 1.0 : respCorr(DetId(hcid0)); @@ -989,7 +992,7 @@ double HcalHBHEMuonHighEtaAnalyzer::respCorr(const DetId& id) { return cfac; } -double HcalHBHEMuonHighEtaAnalyzer::gainFactor(const edm::ESHandle<HcalDbService>& conditions, const HcalDetId& id) { +double HcalHBHEMuonHighEtaAnalyzer::gainFactor(const HcalDbService* conditions, const HcalDetId& id) { double gain(0.0); const HcalCalibrations& calibs = conditions->getHcalCalibrations(id); for (int capid = 0; capid < 4; ++capid) diff --git a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc index 6381ab18f6958..45f187e06de5d 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc @@ -170,6 +170,15 @@ class HcalIsoTrkAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm: edm::EDGetTokenT<GenEventInfoProduct> tok_ew_; edm::EDGetTokenT<BXVector<GlobalAlgBlk>> tok_alg_; + edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> tok_ddrec_; + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_bFieldH_; + edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> tok_ecalChStatus_; + edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> tok_sevlv_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<CaloTopology, CaloTopologyRecord> tok_caloTopology_; + edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> tok_htopo_; + edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> tok_resp_; + TTree *tree, *tree2; unsigned int t_RunNo, t_EventNo; int t_Run, t_Event, t_DataType, t_ieta, t_iphi; @@ -314,6 +323,22 @@ HcalIsoTrkAnalyzer::HcalIsoTrkAnalyzer(const edm::ParameterSet& iConfig) << edm::InputTag(modnam, labelEE_, prdnam) << " " << edm::InputTag(modnam, labelHBHE_, prdnam) << " " << labelTower_; } + edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_bFieldH_; + edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> tok_ecalChStatus_; + edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> tok_sevlv_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; + edm::ESGetToken<CaloTopology, CaloTopologyRecord> tok_caloTopology_; + edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> tok_htopo_; + edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> tok_resp_; + + tok_ddrec_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>(); + tok_bFieldH_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); + tok_ecalChStatus_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>(); + tok_sevlv_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>(); + tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>(); + tok_caloTopology_ = esConsumes<CaloTopology, CaloTopologyRecord>(); + tok_htopo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>(); + tok_resp_ = esConsumes<HcalRespCorrs, HcalRespCorrsRcd>(); edm::LogVerbatim("HcalIsoTrack") << "Parameters read from config file \n" @@ -374,34 +399,16 @@ void HcalIsoTrkAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const << " Luminosity " << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing(); #endif //Get magnetic field and ECAL channel status - edm::ESHandle<MagneticField> bFieldH; - iSetup.get<IdealMagneticFieldRecord>().get(bFieldH); - const MagneticField* bField = bFieldH.product(); - - edm::ESHandle<EcalChannelStatus> ecalChStatus; - iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus); - const EcalChannelStatus* theEcalChStatus = ecalChStatus.product(); - - edm::ESHandle<EcalSeverityLevelAlgo> sevlv; - iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv); - const EcalSeverityLevelAlgo* theEcalSevlv = sevlv.product(); + const MagneticField* bField = &iSetup.getData(tok_bFieldH_); + const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_ecalChStatus_); + const EcalSeverityLevelAlgo* theEcalSevlv = &iSetup.getData(tok_sevlv_); // get handles to calogeometry and calotopology - edm::ESHandle<CaloGeometry> pG; - iSetup.get<CaloGeometryRecord>().get(pG); - const CaloGeometry* geo = pG.product(); - - edm::ESHandle<CaloTopology> theCaloTopology; - iSetup.get<CaloTopologyRecord>().get(theCaloTopology); - const CaloTopology* caloTopology = theCaloTopology.product(); - - edm::ESHandle<HcalTopology> htopo; - iSetup.get<HcalRecNumberingRecord>().get(htopo); - const HcalTopology* theHBHETopology = htopo.product(); - - edm::ESHandle<HcalRespCorrs> resp; - iSetup.get<HcalRespCorrsRcd>().get(resp); - HcalRespCorrs* respCorrs = new HcalRespCorrs(*resp.product()); + const CaloGeometry* geo = &iSetup.getData(tok_geom_); + const CaloTopology* caloTopology = &iSetup.getData(tok_caloTopology_); + const HcalTopology* theHBHETopology = &iSetup.getData(tok_htopo_); + const HcalRespCorrs* resp = &iSetup.getData(tok_resp_); + HcalRespCorrs* respCorrs = new HcalRespCorrs(*resp); respCorrs->setTopo(theHBHETopology); //=== genParticle information @@ -771,9 +778,7 @@ void HcalIsoTrkAnalyzer::beginJob() { // ------------ method called when starting to processes a run ------------ void HcalIsoTrkAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { - edm::ESHandle<HcalDDDRecConstants> pHRNDC; - iSetup.get<HcalRecNumberingRecord>().get(pHRNDC); - hdc_ = pHRNDC.product(); + hdc_ = &iSetup.getData(tok_ddrec_); bool changed_(true); bool flag = hltConfig_.init(iRun, iSetup, processName_, changed_); diff --git a/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc b/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc index 605185c6a535a..8e29bc2c4d167 100644 --- a/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc @@ -184,13 +184,13 @@ RecAnalyzerMinbias::RecAnalyzerMinbias(const edm::ParameterSet& iConfig) : init_ } } infile.close(); - edm::LogInfo("RecAnalyzer") << "Reads " << nrec << " correction factors for " << ndets << " detIds"; + edm::LogVerbatim("RecAnalyzer") << "Reads " << nrec << " correction factors for " << ndets << " detIds"; theRecalib_ = (ndets > 0); } - edm::LogInfo("RecAnalyzer") << " Flags (ReCalib): " << theRecalib_ << " (IgnoreL1): " << ignoreL1_ << " (NZS) " + edm::LogVerbatim("RecAnalyzer") << " Flags (ReCalib): " << theRecalib_ << " (IgnoreL1): " << ignoreL1_ << " (NZS) " << runNZS_ << " and with " << ieta.size() << " detId for full histogram"; - edm::LogInfo("RecAnalyzer") << "Thresholds for HB " << eLowHB_ << ":" << eHighHB_ << " for HE " << eLowHE_ << ":" + edm::LogVerbatim("RecAnalyzer") << "Thresholds for HB " << eLowHB_ << ":" << eHighHB_ << " for HE " << eLowHE_ << ":" << eHighHE_ << " for HF " << eLowHF_ << ":" << eHighHF_; for (unsigned int k = 0; k < ieta.size(); ++k) { HcalSubdetector subd = @@ -201,11 +201,11 @@ RecAnalyzerMinbias::RecAnalyzerMinbias(const edm::ParameterSet& iConfig) : init_ : (depth[k] == 4) ? HcalOuter : HcalBarrel); unsigned int id = (HcalDetId(subd, ieta[k], iphi[k], depth[k])).rawId(); hcalID_.push_back(id); - edm::LogInfo("RecAnalyzer") << "DetId[" << k << "] " << HcalDetId(id); + edm::LogVerbatim("RecAnalyzer") << "DetId[" << k << "] " << HcalDetId(id); } - edm::LogInfo("RecAnalyzer") << "Select on " << trigbit_.size() << " L1 Trigger selection"; + edm::LogVerbatim("RecAnalyzer") << "Select on " << trigbit_.size() << " L1 Trigger selection"; for (unsigned int k = 0; k < trigbit_.size(); ++k) - edm::LogInfo("RecAnalyzer") << "Bit[" << k << "] " << trigbit_[k]; + edm::LogVerbatim("RecAnalyzer") << "Bit[" << k << "] " << trigbit_[k]; } RecAnalyzerMinbias::~RecAnalyzerMinbias() {} @@ -583,7 +583,7 @@ void RecAnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup } } if (!ok) { - edm::LogInfo("RecAnalyzer") << "No passed L1 Trigger found"; + edm::LogVerbatim("RecAnalyzer") << "No passed L1 Trigger found"; } } } diff --git a/Calibration/HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc b/Calibration/HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc index b66ed3e2426d0..67c50487a3136 100644 --- a/Calibration/HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc @@ -9,11 +9,13 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" @@ -35,15 +37,15 @@ #include "TTree.h" // class declaration -class SimAnalyzerMinbias : public edm::EDAnalyzer { +class SimAnalyzerMinbias : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> { public: explicit SimAnalyzerMinbias(const edm::ParameterSet&); - ~SimAnalyzerMinbias() override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); void analyze(const edm::Event&, const edm::EventSetup&) override; void beginJob() override; void endJob() override; - void beginRun(const edm::Run& r, const edm::EventSetup& iSetup) override; - void endRun(const edm::Run& r, const edm::EventSetup& iSetup) override; + void beginRun(const edm::Run& r, const edm::EventSetup& iSetup) override {}; + void endRun(const edm::Run& r, const edm::EventSetup& iSetup) override {}; private: // ----------member data --------------------------- @@ -66,24 +68,22 @@ class SimAnalyzerMinbias : public edm::EDAnalyzer { // constructors and destructor SimAnalyzerMinbias::SimAnalyzerMinbias(const edm::ParameterSet& iConfig) { + usesResource(TFileService::kSharedResource); timeCut_ = iConfig.getUntrackedParameter<double>("TimeCut", 500); // get token names of modules, producing object collections tok_evt_ = consumes<edm::HepMCProduct>(edm::InputTag("generator")); tok_hcal_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", "HcalHits")); - edm::LogInfo("AnalyzerMB") << "Use Time cut of " << timeCut_ << " ns"; + edm::LogVerbatim("AnalyzerMB") << "Use Time cut of " << timeCut_ << " ns"; } -SimAnalyzerMinbias::~SimAnalyzerMinbias() { - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) +void SimAnalyzerMinbias::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.addUntracked<double>("TimeCut", 500); + descriptions.add("simAnalyzerMinbias", desc); } -void SimAnalyzerMinbias::beginRun(const edm::Run& r, const edm::EventSetup& iSetup) {} - -void SimAnalyzerMinbias::endRun(const edm::Run& r, const edm::EventSetup& iSetup) {} - void SimAnalyzerMinbias::beginJob() { myTree_ = fs_->make<TTree>("SimJet", "SimJet Tree"); myTree_->Branch("mydet", &mydet, "mydet/I"); @@ -119,13 +119,13 @@ void SimAnalyzerMinbias::endJob() { mom4_MB = info.theMB4; cells++; - edm::LogInfo("AnalyzerMB") << " Result= " << mysubd << " " << ieta << " " << iphi << " mom0 " << mom0_MB + edm::LogVerbatim("AnalyzerMB") << " Result= " << mysubd << " " << ieta << " " << iphi << " mom0 " << mom0_MB << " mom1 " << mom1_MB << " mom2 " << mom2_MB << " mom3 " << mom3_MB << " mom4 " << mom4_MB; myTree_->Fill(); } } - edm::LogInfo("AnalyzerMB") << "cells " << cells; + edm::LogVerbatim("AnalyzerMB") << "cells " << cells; } // @@ -135,7 +135,7 @@ void SimAnalyzerMinbias::endJob() { // ------------ method called to produce the data ------------ void SimAnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup&) { - edm::LogInfo("AnalyzerMB") << " Start SimAnalyzerMinbias::analyze " << iEvent.id().run() << ":" + edm::LogVerbatim("AnalyzerMB") << " Start SimAnalyzerMinbias::analyze " << iEvent.id().run() << ":" << iEvent.id().event(); edm::Handle<edm::HepMCProduct> evtMC; @@ -144,7 +144,7 @@ void SimAnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup edm::LogWarning("AnalyzerMB") << "no HepMCProduct found"; } else { const HepMC::GenEvent* myGenEvent = evtMC->GetEvent(); - edm::LogInfo("AnalyzerMB") << "Event with " << myGenEvent->particles_size() << " particles + " + edm::LogVerbatim("AnalyzerMB") << "Event with " << myGenEvent->particles_size() << " particles + " << myGenEvent->vertices_size() << " vertices"; } @@ -170,7 +170,7 @@ void SimAnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup itr1->second += energyhit; } } - edm::LogInfo("AnalyzerMB") << "extract information of " << hitMap.size() << " towers from " << HitHcal->size() + edm::LogVerbatim("AnalyzerMB") << "extract information of " << hitMap.size() << " towers from " << HitHcal->size() << " hits"; for (std::map<HcalDetId, double>::const_iterator hcalItr = hitMap.begin(); hcalItr != hitMap.end(); ++hcalItr) { @@ -187,7 +187,7 @@ void SimAnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup itr1->second.theMB2 += (energyhit * energyhit); itr1->second.theMB3 += (energyhit * energyhit * energyhit); itr1->second.theMB4 += (energyhit * energyhit * energyhit * energyhit); - edm::LogInfo("AnalyzerMB") << "ID " << hid << " with energy " << energyhit; + edm::LogVerbatim("AnalyzerMB") << "ID " << hid << " with energy " << energyhit; } } diff --git a/Calibration/HcalCalibAlgos/python/simAnalyzerMinbias_cfi.py b/Calibration/HcalCalibAlgos/python/simAnalyzerMinbias_cfi.py deleted file mode 100644 index 0165bdbd8f06c..0000000000000 --- a/Calibration/HcalCalibAlgos/python/simAnalyzerMinbias_cfi.py +++ /dev/null @@ -1,5 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -simAnalyzerMinbias = cms.EDAnalyzer("SimAnalyzerMinbias", - TimeCut = cms.untracked.double(500), - ) From 5e415488a1e5a4f23bfe48c8f33f91fb81e1a19b Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 17:33:05 +0200 Subject: [PATCH 730/778] Code check --- .../HcalCalibAlgos/plugins/AnalyzerMinbias.cc | 12 ++++++------ .../HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc | 3 +-- .../plugins/HcalHBHEMuonHighEtaAnalyzer.cc | 4 ++-- .../HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc | 4 ++-- .../HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc | 14 +++++++------- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Calibration/HcalCalibAlgos/plugins/AnalyzerMinbias.cc b/Calibration/HcalCalibAlgos/plugins/AnalyzerMinbias.cc index 8debe10ab5095..5e7f33e036b81 100644 --- a/Calibration/HcalCalibAlgos/plugins/AnalyzerMinbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/AnalyzerMinbias.cc @@ -216,12 +216,12 @@ void AnalyzerMinbias::endJob() { ieta = itr->first.second.ieta(); iphi = itr->first.second.iphi(); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("AnalyzerMB") << " Result= " << trigbit << " " << mysubd << " " << ieta << " " << iphi << " mom0 " - << mom0_MB << " mom1 " << mom1_MB << " mom2 " << mom2_MB << " mom3 " << mom3_MB << " mom4 " - << mom4_MB << " mom0_Noise " << mom0_Noise << " mom1_Noise " << mom1_Noise - << " mom2_Noise " << mom2_Noise << " mom3_Noise " << mom3_Noise << " mom4_Noise " - << mom4_Noise << " mom0_Diff " << mom0_Diff << " mom1_Diff " << mom1_Diff << " mom2_Diff " - << mom2_Diff; + edm::LogVerbatim("AnalyzerMB") << " Result= " << trigbit << " " << mysubd << " " << ieta << " " << iphi + << " mom0 " << mom0_MB << " mom1 " << mom1_MB << " mom2 " << mom2_MB << " mom3 " + << mom3_MB << " mom4 " << mom4_MB << " mom0_Noise " << mom0_Noise << " mom1_Noise " + << mom1_Noise << " mom2_Noise " << mom2_Noise << " mom3_Noise " << mom3_Noise + << " mom4_Noise " << mom4_Noise << " mom0_Diff " << mom0_Diff << " mom1_Diff " + << mom1_Diff << " mom2_Diff " << mom2_Diff; #endif myTree->Fill(); ii++; diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc index a5c74c8a16a1a..0c8d0eb68d7b1 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc @@ -309,7 +309,7 @@ void HcalHBHEMuonAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSet const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_chan_); const EcalSeverityLevelAlgo* sevlv = &iSetup.getData(tok_sevlv_); const CaloTopology* caloTopology = &iSetup.getData(tok_topo_); - const HcalDbService* conditions = &iSetup.getData(tok_dbservice_); + const HcalDbService* conditions = &iSetup.getData(tok_dbservice_); // Relevant blocks from iEvent edm::Handle<reco::VertexCollection> vtx; @@ -889,7 +889,6 @@ void HcalHBHEMuonAnalyzer::beginJob() { // ------------ method called when starting to processes a run ------------ void HcalHBHEMuonAnalyzer::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { - hdc_ = &iSetup.getData(tok_ddrec_); actHB.clear(); actHE.clear(); diff --git a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc index e241a3d59399d..a70a57942fc1e 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonHighEtaAnalyzer.cc @@ -118,7 +118,7 @@ class HcalHBHEMuonHighEtaAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR const EcalChannelStatus* theEcalChStatus_; const EcalSeverityLevelAlgo* sevlv_; const CaloTopology* caloTopology_; - const HcalDbService* conditions_; + const HcalDbService* conditions_; edm::EDGetTokenT<reco::VertexCollection> tok_Vtx_; edm::EDGetTokenT<EcalRecHitCollection> tok_EB_; @@ -143,7 +143,7 @@ class HcalHBHEMuonHighEtaAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR ////////////////////////////////////////////////////// static const int depthMax_ = 7; - TTree *tree_; + TTree* tree_; unsigned int runNumber_, eventNumber_, goodVertex_; std::vector<bool> mediumMuon_; std::vector<double> ptGlob_, etaGlob_, phiGlob_, energyMuon_, pMuon_; diff --git a/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc b/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc index 8e29bc2c4d167..cf2fb3cfe165d 100644 --- a/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc @@ -189,9 +189,9 @@ RecAnalyzerMinbias::RecAnalyzerMinbias(const edm::ParameterSet& iConfig) : init_ } edm::LogVerbatim("RecAnalyzer") << " Flags (ReCalib): " << theRecalib_ << " (IgnoreL1): " << ignoreL1_ << " (NZS) " - << runNZS_ << " and with " << ieta.size() << " detId for full histogram"; + << runNZS_ << " and with " << ieta.size() << " detId for full histogram"; edm::LogVerbatim("RecAnalyzer") << "Thresholds for HB " << eLowHB_ << ":" << eHighHB_ << " for HE " << eLowHE_ << ":" - << eHighHE_ << " for HF " << eLowHF_ << ":" << eHighHF_; + << eHighHE_ << " for HF " << eLowHF_ << ":" << eHighHF_; for (unsigned int k = 0; k < ieta.size(); ++k) { HcalSubdetector subd = ((std::abs(ieta[k]) > 29) ? HcalForward diff --git a/Calibration/HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc b/Calibration/HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc index 67c50487a3136..2bf0e54f9aa3b 100644 --- a/Calibration/HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/SimAnalyzerMinbias.cc @@ -44,8 +44,8 @@ class SimAnalyzerMinbias : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm: void analyze(const edm::Event&, const edm::EventSetup&) override; void beginJob() override; void endJob() override; - void beginRun(const edm::Run& r, const edm::EventSetup& iSetup) override {}; - void endRun(const edm::Run& r, const edm::EventSetup& iSetup) override {}; + void beginRun(const edm::Run& r, const edm::EventSetup& iSetup) override{}; + void endRun(const edm::Run& r, const edm::EventSetup& iSetup) override{}; private: // ----------member data --------------------------- @@ -120,8 +120,8 @@ void SimAnalyzerMinbias::endJob() { cells++; edm::LogVerbatim("AnalyzerMB") << " Result= " << mysubd << " " << ieta << " " << iphi << " mom0 " << mom0_MB - << " mom1 " << mom1_MB << " mom2 " << mom2_MB << " mom3 " << mom3_MB << " mom4 " - << mom4_MB; + << " mom1 " << mom1_MB << " mom2 " << mom2_MB << " mom3 " << mom3_MB << " mom4 " + << mom4_MB; myTree_->Fill(); } } @@ -136,7 +136,7 @@ void SimAnalyzerMinbias::endJob() { void SimAnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup&) { edm::LogVerbatim("AnalyzerMB") << " Start SimAnalyzerMinbias::analyze " << iEvent.id().run() << ":" - << iEvent.id().event(); + << iEvent.id().event(); edm::Handle<edm::HepMCProduct> evtMC; iEvent.getByToken(tok_evt_, evtMC); @@ -145,7 +145,7 @@ void SimAnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup } else { const HepMC::GenEvent* myGenEvent = evtMC->GetEvent(); edm::LogVerbatim("AnalyzerMB") << "Event with " << myGenEvent->particles_size() << " particles + " - << myGenEvent->vertices_size() << " vertices"; + << myGenEvent->vertices_size() << " vertices"; } edm::Handle<edm::PCaloHitContainer> hcalHits; @@ -171,7 +171,7 @@ void SimAnalyzerMinbias::analyze(const edm::Event& iEvent, const edm::EventSetup } } edm::LogVerbatim("AnalyzerMB") << "extract information of " << hitMap.size() << " towers from " << HitHcal->size() - << " hits"; + << " hits"; for (std::map<HcalDetId, double>::const_iterator hcalItr = hitMap.begin(); hcalItr != hitMap.end(); ++hcalItr) { HcalDetId hid = hcalItr->first; From cac0b7e050693838a2a5c583938211eab2d066cf Mon Sep 17 00:00:00 2001 From: Christopher Jones <chrisdjones15@gmail.com> Date: Tue, 20 Oct 2020 10:35:42 -0500 Subject: [PATCH 731/778] Removed FwkJob category from MessageLogger config The FwkJob category has not been supported for many years. These changes are needed to be able to remove the default setup of FwkJob from within MessageLogger itself. --- Calibration/EcalAlCaRecoProducers/test/alcaSkimming.py | 4 ---- DQM/CSCMonitorModule/python/test/csc_unpacker_dump.py | 1 - DQMOffline/CalibMuon/test/DTPreCalibTask_cfg.py | 3 --- .../CalibMuon/test/DTnoiseDBValidation_ORCONsqlite_cfg.py | 3 --- DQMOffline/CalibMuon/test/DTnoiseDBValidation_cfg.py | 3 --- DQMOffline/Muon/test/simMuAnalyzer_cfg.py | 3 --- EventFilter/L1GlobalTriggerRawToDigi/test/L1GtRecord_cfg.py | 1 - .../L1GlobalTriggerRawToDigi/test/L1GtTriggerMenuLite_cfg.py | 1 - L1Trigger/GlobalTriggerAnalyzer/test/L1GtAnalyzer_cfg.py | 3 +-- .../test/L1GtPatternGenerator_overrideL1Menu_cfg.py | 1 - RecoTracker/CkfPattern/test/logger_cfi.py | 1 - 11 files changed, 1 insertion(+), 23 deletions(-) diff --git a/Calibration/EcalAlCaRecoProducers/test/alcaSkimming.py b/Calibration/EcalAlCaRecoProducers/test/alcaSkimming.py index 8ec43403557ab..d86062c6e48c9 100644 --- a/Calibration/EcalAlCaRecoProducers/test/alcaSkimming.py +++ b/Calibration/EcalAlCaRecoProducers/test/alcaSkimming.py @@ -187,10 +187,6 @@ optionalPSet = cms.untracked.bool(True), limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( - optionalPSet = cms.untracked.bool(True), - limit = cms.untracked.int32(0) - ), FwkSummary = cms.untracked.PSet( optionalPSet = cms.untracked.bool(True), reportEvery = cms.untracked.int32(1), diff --git a/DQM/CSCMonitorModule/python/test/csc_unpacker_dump.py b/DQM/CSCMonitorModule/python/test/csc_unpacker_dump.py index f983b7f979c02..ed02040e4b66f 100644 --- a/DQM/CSCMonitorModule/python/test/csc_unpacker_dump.py +++ b/DQM/CSCMonitorModule/python/test/csc_unpacker_dump.py @@ -52,7 +52,6 @@ default = cms.untracked.PSet(limit = cms.untracked.int32(10000000)), Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0)), DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), - FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0)), FwkSummary = cms.untracked.PSet(reportEvery = cms.untracked.int32(1), limit = cms.untracked.int32(10000000) ), threshold = cms.untracked.string('DEBUG') ) diff --git a/DQMOffline/CalibMuon/test/DTPreCalibTask_cfg.py b/DQMOffline/CalibMuon/test/DTPreCalibTask_cfg.py index 538c389619e30..f8a68c537ceba 100644 --- a/DQMOffline/CalibMuon/test/DTPreCalibTask_cfg.py +++ b/DQMOffline/CalibMuon/test/DTPreCalibTask_cfg.py @@ -63,9 +63,6 @@ ), noLineBreaks = cms.untracked.bool(True), threshold = cms.untracked.string('DEBUG'), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) ) diff --git a/DQMOffline/CalibMuon/test/DTnoiseDBValidation_ORCONsqlite_cfg.py b/DQMOffline/CalibMuon/test/DTnoiseDBValidation_ORCONsqlite_cfg.py index 4d6acb6eedf5e..df58d6324f770 100644 --- a/DQMOffline/CalibMuon/test/DTnoiseDBValidation_ORCONsqlite_cfg.py +++ b/DQMOffline/CalibMuon/test/DTnoiseDBValidation_ORCONsqlite_cfg.py @@ -61,9 +61,6 @@ ), noLineBreaks = cms.untracked.bool(True), threshold = cms.untracked.string('DEBUG'), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) ) diff --git a/DQMOffline/CalibMuon/test/DTnoiseDBValidation_cfg.py b/DQMOffline/CalibMuon/test/DTnoiseDBValidation_cfg.py index 789e86ec32186..6ea471f74bf02 100644 --- a/DQMOffline/CalibMuon/test/DTnoiseDBValidation_cfg.py +++ b/DQMOffline/CalibMuon/test/DTnoiseDBValidation_cfg.py @@ -57,9 +57,6 @@ ), noLineBreaks = cms.untracked.bool(True), threshold = cms.untracked.string('DEBUG'), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) ) diff --git a/DQMOffline/Muon/test/simMuAnalyzer_cfg.py b/DQMOffline/Muon/test/simMuAnalyzer_cfg.py index 0b0d085494fd3..654fa3a05b77f 100644 --- a/DQMOffline/Muon/test/simMuAnalyzer_cfg.py +++ b/DQMOffline/Muon/test/simMuAnalyzer_cfg.py @@ -75,9 +75,6 @@ trackResidualsTest = cms.untracked.PSet( limit = cms.untracked.int32(10000000) ), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), threshold = cms.untracked.string('DEBUG'), muRecoAnalyzer = cms.untracked.PSet( limit = cms.untracked.int32(10000000) diff --git a/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtRecord_cfg.py b/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtRecord_cfg.py index 230da6119aae9..2f69651f07772 100644 --- a/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtRecord_cfg.py +++ b/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtRecord_cfg.py @@ -431,7 +431,6 @@ process.MessageLogger.categories.append('L1GtTrigReport') process.MessageLogger.cerr.default.limit = 0 -process.MessageLogger.cerr.FwkJob.limit = 0 process.MessageLogger.cerr.FwkReport.limit = 0 process.MessageLogger.cerr.FwkSummary.limit = 0 diff --git a/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtTriggerMenuLite_cfg.py b/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtTriggerMenuLite_cfg.py index 7bf041cb1f204..c128f6ac3fe6c 100644 --- a/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtTriggerMenuLite_cfg.py +++ b/EventFilter/L1GlobalTriggerRawToDigi/test/L1GtTriggerMenuLite_cfg.py @@ -59,7 +59,6 @@ process.MessageLogger.categories.append('L1GtTriggerMenuLiteProducer') process.MessageLogger.cerr.default.limit = 0 -process.MessageLogger.cerr.FwkJob.limit = 0 process.MessageLogger.cerr.FwkReport.limit = 0 process.MessageLogger.cerr.FwkSummary.limit = 0 diff --git a/L1Trigger/GlobalTriggerAnalyzer/test/L1GtAnalyzer_cfg.py b/L1Trigger/GlobalTriggerAnalyzer/test/L1GtAnalyzer_cfg.py index 8b82e169a5011..46099d86d7fb0 100644 --- a/L1Trigger/GlobalTriggerAnalyzer/test/L1GtAnalyzer_cfg.py +++ b/L1Trigger/GlobalTriggerAnalyzer/test/L1GtAnalyzer_cfg.py @@ -166,7 +166,6 @@ ] process.MessageLogger.cerr.default.limit = 0 -process.MessageLogger.cerr.FwkJob.limit = 0 process.MessageLogger.cerr.FwkReport.limit = 0 process.MessageLogger.cerr.FwkSummary.limit = 0 @@ -206,4 +205,4 @@ L1GtAnalyzer = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), L1GtUtils = cms.untracked.PSet( limit = cms.untracked.int32(-1) ), L1GtTrigReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) - ) \ No newline at end of file + ) diff --git a/L1Trigger/GlobalTriggerAnalyzer/test/L1GtPatternGenerator_overrideL1Menu_cfg.py b/L1Trigger/GlobalTriggerAnalyzer/test/L1GtPatternGenerator_overrideL1Menu_cfg.py index 6306b63a27718..e94db476a37a4 100644 --- a/L1Trigger/GlobalTriggerAnalyzer/test/L1GtPatternGenerator_overrideL1Menu_cfg.py +++ b/L1Trigger/GlobalTriggerAnalyzer/test/L1GtPatternGenerator_overrideL1Menu_cfg.py @@ -265,7 +265,6 @@ ] process.MessageLogger.cerr.default.limit = 0 -process.MessageLogger.cerr.FwkJob.limit = 0 process.MessageLogger.cerr.FwkReport.limit = 0 process.MessageLogger.cerr.FwkSummary.limit = 0 diff --git a/RecoTracker/CkfPattern/test/logger_cfi.py b/RecoTracker/CkfPattern/test/logger_cfi.py index b2d29d349c073..a5605358b655b 100644 --- a/RecoTracker/CkfPattern/test/logger_cfi.py +++ b/RecoTracker/CkfPattern/test/logger_cfi.py @@ -17,7 +17,6 @@ default = cms.untracked.PSet(limit = cms.untracked.int32(10000000)), Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0)), DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)), - FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0)), FwkSummary = cms.untracked.PSet(reportEvery = cms.untracked.int32(1),limit = cms.untracked.int32(10000000) ), threshold = cms.untracked.string('DEBUG') ) From accdb22b9c66bc5469f3cb6ac8c89695d760f8d1 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Mon, 5 Oct 2020 15:51:52 +0200 Subject: [PATCH 732/778] Bad particle filter for 2018 PbPb data --- .../python/slimming/MicroEventContent_cff.py | 1 + .../python/slimming/lostTracks_cfi.py | 2 + .../python/slimming/packedPFCandidates_cff.py | 11 + .../python/slimming/packedPFCandidates_cfi.py | 4 + .../slimming/primaryVertexAssociation_cfi.py | 3 + .../python/slimming/slimmedMuons_cfi.py | 4 + .../PatAlgos/python/slimming/slimming_cff.py | 1 + .../HiJetAlgos/plugins/HiBadParticleFilter.cc | 307 ++++++++++++++++++ .../python/HiBadParticleFilter_cfi.py | 18 + RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | 3 +- 10 files changed, 353 insertions(+), 1 deletion(-) create mode 100644 RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc create mode 100644 RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py diff --git a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py index db6e283aa8a3f..a0f0a884f2e7f 100644 --- a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py @@ -140,6 +140,7 @@ _pp_on_AA_extraCommands = [ 'keep patPackedCandidates_hiPixelTracks_*_*', + 'keep patPackedCandidates_packedPFCandidatesCleaned_*_*', 'keep *_packedCandidateMuonID_*_*', 'keep *_slimmedJets_pfCandidates_*', 'keep floatedmValueMap_packedPFCandidateTrackChi2_*_*', diff --git a/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py b/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py index 0dc0b9e65f9f1..3a98fe9e8331d 100644 --- a/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py @@ -22,3 +22,5 @@ from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel phase1Pixel.toModify(lostTracks, covarianceVersion =1 ) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toModify(lostTracks,inputCandidates = "filteredParticleFlow") diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py index 262f53ef96925..27187b46aa57b 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py @@ -10,3 +10,14 @@ pfPileUpPFBRECO, pfNoPileUpPFBRECO ) + +from RecoHI.HiJetAlgos.HiBadParticleFilter_cfi import filteredParticleFlow + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +packedPFCandidatesCleaned = packedPFCandidates.clone( + inputCollection = "filteredParticleFlow:cleaned", + vertexAssociator = "primaryVertexAssociationCleaned:original" +) + +_pp_on_AA_2018_packedPFCandidatesTask = cms.Task(filteredParticleFlow,packedPFCandidatesCleaned,packedPFCandidatesTask.copy()) +pp_on_AA_2018.toReplaceWith(packedPFCandidatesTask,_pp_on_AA_2018_packedPFCandidatesTask) diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py index 933250f78239c..8186157cd5ca1 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py @@ -52,3 +52,7 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(packedPFCandidates, PuppiSrc = "", PuppiNoLepSrc = "") +pp_on_AA_2018.toModify(packedPFCandidates, + inputCollection = "filteredParticleFlow", + chargedHadronIsolation = "" + ) diff --git a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py b/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py index 929e40f7dafed..825cfe9cf3505 100644 --- a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py @@ -8,3 +8,6 @@ produceNoPileUpCollection = cms.bool(False) ) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toModify(primaryVertexAssociation,particles = "filteredParticleFlow") +primaryVertexAssociationCleaned = primaryVertexAssociation.clone(particles = "filteredParticleFlow:cleaned") diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py index 4ed9b93c71059..2c03c4dec3c49 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py @@ -26,3 +26,7 @@ from Configuration.ProcessModifiers.miniAOD_skip_trackExtras_cff import miniAOD_skip_trackExtras (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17 | pp_on_AA_2018 | miniAOD_skip_trackExtras).toModify(slimmedMuons, trackExtraAssocs = ["slimmedMuonTrackExtras"]) +pp_on_AA_2018.toModify(slimmedMuons, + packedPFCandidates = ["packedPFCandidates","packedPFCandidatesCleaned"], + pfCandidates = ["filteredParticleFlow","filteredParticleFlow:cleaned"] +) diff --git a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py index ca2b48f515bf1..aecad412b7d33 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py @@ -78,6 +78,7 @@ (pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith( slimmingTask, cms.Task(slimmingTask.copy(), packedCandidateMuonID, packedPFCandidateTrackChi2, lostTrackChi2, centralityBin, hiHFfilters)) +pp_on_AA_2018.toReplaceWith(slimmingTask,cms.Task(primaryVertexAssociationCleaned,slimmingTask.copy())) from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing _phase2_timing_slimmingTask = cms.Task(slimmingTask.copy(), diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc new file mode 100644 index 0000000000000..d27ffedf17c61 --- /dev/null +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc @@ -0,0 +1,307 @@ +// system include files +#include <memory> +#include <iostream> + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/global/EDFilter.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "DataFormats/MuonReco/interface/MuonSelectors.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +// +// class declaration +// + +class HiBadParticleFilter : public edm::global::EDFilter<> { +public: + explicit HiBadParticleFilter(const edm::ParameterSet&); + ~HiBadParticleFilter() override; + +private: + bool filter(edm::StreamID iID, edm::Event&, const edm::EventSetup&) const override; + + // ----------member data --------------------------- + + edm::EDGetTokenT<edm::View<reco::PFCandidate> > tokenPFCandidates_; + edm::EDGetTokenT<reco::VertexCollection> tokenPV_; + + const bool taggingMode_; + const bool verbose_; + const double minMuonPt_; + const double minChargedHadronPt_; + const double minMuonTrackRelPtErr_; + const double maxSigLoose_; + const double maxSigTight_; + const double minCaloCompatibility_; + const unsigned minTrackNHits_; + const unsigned minPixelNHits_; +}; + +// +// constructors and destructor +// +HiBadParticleFilter::HiBadParticleFilter(const edm::ParameterSet& iConfig) + : tokenPFCandidates_ ( consumes<edm::View<reco::PFCandidate> >(iConfig.getParameter<edm::InputTag> ("PFCandidates") )) + , tokenPV_ ( consumes<reco::VertexCollection> (iConfig.getParameter<edm::InputTag> ("offlinePV") )) + , taggingMode_ ( iConfig.getParameter<bool> ("taggingMode") ) + , verbose_ ( iConfig.getParameter<bool> ("verbose") ) + , minMuonPt_ ( iConfig.getParameter<double> ("minMuonPt") ) + , minChargedHadronPt_ ( iConfig.getParameter<double> ("minChargedHadronPt") ) + , minMuonTrackRelPtErr_ ( iConfig.getParameter<double> ("minMuonTrackRelPtErr") ) + , maxSigLoose_ ( iConfig.getParameter<double> ("maxSigLoose") ) + , maxSigTight_ ( iConfig.getParameter<double> ("maxSigTight") ) + , minCaloCompatibility_ ( iConfig.getParameter<double> ("minCaloCompatibility") ) + , minTrackNHits_ ( iConfig.getParameter<uint> ("minTrackNHits") ) + , minPixelNHits_ ( iConfig.getParameter<uint> ("minPixelNHits") ) +{ + produces<bool>(); + produces<reco::PFCandidateCollection>(); + produces<reco::PFCandidateCollection>("cleaned"); +} + +HiBadParticleFilter::~HiBadParticleFilter() { } + + +// +// member functions +// + +// ------------ method called on each new Event ------------ +bool +HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const edm::EventSetup& iSetup) const +{ + using namespace std; + using namespace edm; + + typedef View<reco::PFCandidate> CandidateView; + Handle<CandidateView> pfCandidates; + iEvent.getByToken(tokenPFCandidates_,pfCandidates); + + const reco::VertexCollection* recoVertices; + edm::Handle<reco::VertexCollection> vertexCollection; + iEvent.getByToken(tokenPV_,vertexCollection); + recoVertices = vertexCollection.product(); + + auto pOutputCandidateCollection = std::make_unique<reco::PFCandidateCollection>(); + auto pBadCandidateCollection = std::make_unique<reco::PFCandidateCollection>(); + + + bool foundBadCandidate = false; + + + for(unsigned j=0;j<pfCandidates->size();++j ) { + const reco::PFCandidate & pfCandidate = (*pfCandidates)[j]; + + + if(abs(pfCandidate.particleId()) == 3) // muon cleaning + { + if(pfCandidate.pt() > minMuonPt_){ + + if(!pfCandidate.muonRef()->isGlobalMuon() || !pfCandidate.muonRef()->isTrackerMuon() || !pfCandidate.trackRef().isNonnull()) + { + if(verbose_) std::cout<<" bad muon fit "<<pfCandidate.pt()<<std::endl; + cout<<" isGlobal "<<pfCandidate.muonRef()->isGlobalMuon()<<" isTracker "<<pfCandidate.muonRef()->isTrackerMuon()<<" has track "<<pfCandidate.trackRef().isNonnull()<<std::endl; + foundBadCandidate=true; + continue; + } + reco::TrackRef track = pfCandidate.trackRef(); + + if(track->ptError()/track->pt()>minMuonTrackRelPtErr_ || track->pt()<pfCandidate.pt()/2.){ + if(verbose_){ + std::cout<<" bad muon err "<<pfCandidate.pt()<<std::endl; + std::cout<<" rel err = "<<track->ptError()/track->pt()<<std::endl; + } + foundBadCandidate=true; + continue; + } + + + if(track->algo()==13 || track->algo()==14 || track->originalAlgo() == 14 || track->originalAlgo() ==13 || track->hitPattern().trackerLayersWithMeasurement()<7){ + + + float xVtx = (*recoVertices)[0].position().x(); + float yVtx = (*recoVertices)[0].position().y(); + float zVtx = (*recoVertices)[0].position().z(); + float xVtxErr = (*recoVertices)[0].xError(); + float yVtxErr = (*recoVertices)[0].yError(); + float zVtxErr = (*recoVertices)[0].zError(); + + math::XYZPoint vtx_temp(xVtx,yVtx,zVtx); + + float Dz = track->dz(vtx_temp); + float DzError = sqrt(track->dzError()*track->dzError()+zVtxErr*zVtxErr); + float Dxy = track->dxy(vtx_temp); + float DxyError = sqrt(track->dxyError()*track->dxyError()+xVtxErr*yVtxErr); + float dzSig = Dz/DzError; + float dxySig = Dxy/DxyError; + + float sig3d = sqrt(dxySig*dxySig + dzSig*dzSig); + + if(sig3d > maxSigLoose_ ){ + if(verbose_){ + std::cout<<" bad muon algo 14, large IP "<<pfCandidate.pt()<<std::endl; + std::cout<<" dxy "<<Dxy<<" dxy err "<<DxyError<<std::endl; + std::cout<<" dz "<<Dz<<" dz err "<<DzError<<std::endl; + } + pBadCandidateCollection->push_back(pfCandidate); + foundBadCandidate=true; + continue; + } + + if(track->pt()<pfCandidate.pt()/1.5 || track->pt() > pfCandidate.pt()*1.5){ + if(verbose_){ + std::cout<<" bad muon algo, bad ptack pT "<<pfCandidate.pt()<<std::endl; + std::cout<<" track pT "<<track->pt()<<" cand pT "<<pfCandidate.pt()<<std::endl; + } + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + if(track->originalAlgo() == 14 && track->hitPattern().trackerLayersWithMeasurement()<10){ + if(verbose_){ + std::cout<<" bad muon original algo 14, small number of hits "<<pfCandidate.pt()<<std::endl; + std::cout<<" trakc N hits "<<track->hitPattern().trackerLayersWithMeasurement()<<std::endl; + } + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + } + } + } + else if(abs(pfCandidate.particleId()) == 1) //charged hadron cleaning + { + if(pfCandidate.pt() > minChargedHadronPt_) + { + + reco::TrackRef track = pfCandidate.trackRef(); + + unsigned nHits = track->numberOfValidHits(); + unsigned nPixelHits = track->hitPattern().numberOfValidPixelHits(); + + if((nHits < minTrackNHits_ && nPixelHits < minPixelNHits_ ) || nHits==3 ){ + if(verbose_) std::cout<<" bad track with small nPixelHits, pT = "<<pfCandidate.pt()<<", nhits = "<<nPixelHits<<std::endl; + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + + float xVtx = (*recoVertices)[0].position().x(); + float yVtx = (*recoVertices)[0].position().y(); + float zVtx = (*recoVertices)[0].position().z(); + float xVtxErr = (*recoVertices)[0].xError(); + float yVtxErr = (*recoVertices)[0].yError(); + float zVtxErr = (*recoVertices)[0].zError(); + + math::XYZPoint vtx_temp(xVtx,yVtx,zVtx); + + float Dz = track->dz(vtx_temp); + float DzError = sqrt(track->dzError()*track->dzError()+zVtxErr*zVtxErr); + float Dxy = track->dxy(vtx_temp); + float DxyError = sqrt(track->dxyError()*track->dxyError()+xVtxErr*yVtxErr); + float dzSig = Dz/DzError; + float dxySig = Dxy/DxyError; + + float sig3d = sqrt(dxySig*dxySig + dzSig*dzSig); + + if(sig3d > maxSigLoose_ ){ + if(verbose_) std::cout<<" bad track impact parameter, pT = "<<pfCandidate.pt()<<", dxySig = "<<dxySig<<", dzSig = "<<dzSig<<std::endl; + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if( sig3d > maxSigTight_ && nHits < minTrackNHits_ ){ + if(verbose_) std::cout<<" bad track with small nhits, pT = "<<pfCandidate.pt()<<", nhits = "<<nHits<<std::endl; + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + + if(track->algo()==13 || track->algo()==14 || track->originalAlgo()==13 || track->originalAlgo()==14 ){ + + if(sig3d > maxSigLoose_ ){ + if(verbose_) std::cout<<" bad muon-seeded track impact parameter, pT = "<<pfCandidate.pt()<<", dxySig = "<<dxySig<<", dzSig = "<<dzSig<<std::endl; + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if( nHits < minTrackNHits_ ){ + if(verbose_) std::cout<<" bad muon-seeded track with small nhits, pT = "<<pfCandidate.pt()<<", nhits = "<<nHits<<std::endl; + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + } + + double caloEnergy = pfCandidate.ecalEnergy() + pfCandidate.hcalEnergy(); + + + if(caloEnergy < track->p()*minCaloCompatibility_) + { + + if(sig3d > maxSigTight_ ){ + if(verbose_) std::cout<<" bad calo-incompatible track impact parameter, pT = "<<pfCandidate.pt()<<", dxySig = "<<dxySig<<", dzSig = "<<dzSig<<std::endl; + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if( nHits < minTrackNHits_ ){ + if(verbose_) std::cout<<" bad calo-incompatible track with small nhits, pT = "<<pfCandidate.pt()<<", nhits = "<<nHits<<std::endl; + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if( nPixelHits < minPixelNHits_ ){ + if(verbose_) std::cout<<" bad calo-incompatible track with small nPixhits, pT = "<<pfCandidate.pt()<<", nhits = "<<nPixelHits<<std::endl; + foundBadCandidate=true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + } + + } + } + + + pOutputCandidateCollection->push_back(pfCandidate); + + + } // end loop over pf candidates + + bool pass = !foundBadCandidate; + + iEvent.put(std::move(pOutputCandidateCollection) ); + iEvent.put(std::move(pBadCandidateCollection), "cleaned" ); + + iEvent.put( std::unique_ptr<bool>(new bool(pass)) ); + + return taggingMode_ || pass; + + +} + + + + +//define this as a plug-in +DEFINE_FWK_MODULE(HiBadParticleFilter); diff --git a/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py b/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py new file mode 100644 index 0000000000000..6426cd1467e02 --- /dev/null +++ b/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py @@ -0,0 +1,18 @@ +import FWCore.ParameterSet.Config as cms + +filteredParticleFlow = cms.EDFilter( + "HiBadParticleFilter", + PFCandidates = cms.InputTag("particleFlow"), + offlinePV = cms.InputTag("offlinePrimaryVertices"), + taggingMode = cms.bool(False), + verbose = cms.bool(False), + minMuonTrackRelErr = cms.double(2.0), # minimum ptError/pt on muon best track + minMuonPt = cms.double(20.0), # minimum muon pt + minChargedHadronPt = cms.double(20.0), + minMuonTrackRelPtErr = cms.double(2.), + maxSigLoose = cms.double(100.), + maxSigTight = cms.double(10.), + minCaloCompatibility = cms.double(0.35), + minTrackNHits = cms.uint32(10), + minPixelNHits = cms.uint32(3) +) diff --git a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py index 1bc7d1c680ba4..c725eea387562 100644 --- a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py +++ b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py @@ -121,4 +121,5 @@ hiRecoPFJets = cms.Sequence(hiRecoPFJetsTask) - +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toModify(akCs4PFJets,src = 'filteredParticleFlow') From b1f1b02e915eb084988a909bb989233a04cb2d84 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Mon, 5 Oct 2020 15:54:27 +0200 Subject: [PATCH 733/778] code checks --- .../HiJetAlgos/plugins/HiBadParticleFilter.cc | 441 +++++++++--------- 1 file changed, 216 insertions(+), 225 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc index d27ffedf17c61..af5a955483ba8 100644 --- a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc @@ -35,273 +35,264 @@ class HiBadParticleFilter : public edm::global::EDFilter<> { // ----------member data --------------------------- - edm::EDGetTokenT<edm::View<reco::PFCandidate> > tokenPFCandidates_; - edm::EDGetTokenT<reco::VertexCollection> tokenPV_; - - const bool taggingMode_; - const bool verbose_; - const double minMuonPt_; - const double minChargedHadronPt_; - const double minMuonTrackRelPtErr_; - const double maxSigLoose_; - const double maxSigTight_; - const double minCaloCompatibility_; - const unsigned minTrackNHits_; - const unsigned minPixelNHits_; + edm::EDGetTokenT<edm::View<reco::PFCandidate> > tokenPFCandidates_; + edm::EDGetTokenT<reco::VertexCollection> tokenPV_; + + const bool taggingMode_; + const bool verbose_; + const double minMuonPt_; + const double minChargedHadronPt_; + const double minMuonTrackRelPtErr_; + const double maxSigLoose_; + const double maxSigTight_; + const double minCaloCompatibility_; + const unsigned minTrackNHits_; + const unsigned minPixelNHits_; }; // // constructors and destructor // HiBadParticleFilter::HiBadParticleFilter(const edm::ParameterSet& iConfig) - : tokenPFCandidates_ ( consumes<edm::View<reco::PFCandidate> >(iConfig.getParameter<edm::InputTag> ("PFCandidates") )) - , tokenPV_ ( consumes<reco::VertexCollection> (iConfig.getParameter<edm::InputTag> ("offlinePV") )) - , taggingMode_ ( iConfig.getParameter<bool> ("taggingMode") ) - , verbose_ ( iConfig.getParameter<bool> ("verbose") ) - , minMuonPt_ ( iConfig.getParameter<double> ("minMuonPt") ) - , minChargedHadronPt_ ( iConfig.getParameter<double> ("minChargedHadronPt") ) - , minMuonTrackRelPtErr_ ( iConfig.getParameter<double> ("minMuonTrackRelPtErr") ) - , maxSigLoose_ ( iConfig.getParameter<double> ("maxSigLoose") ) - , maxSigTight_ ( iConfig.getParameter<double> ("maxSigTight") ) - , minCaloCompatibility_ ( iConfig.getParameter<double> ("minCaloCompatibility") ) - , minTrackNHits_ ( iConfig.getParameter<uint> ("minTrackNHits") ) - , minPixelNHits_ ( iConfig.getParameter<uint> ("minPixelNHits") ) -{ + : tokenPFCandidates_(consumes<edm::View<reco::PFCandidate> >(iConfig.getParameter<edm::InputTag>("PFCandidates"))), + tokenPV_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("offlinePV"))), + taggingMode_(iConfig.getParameter<bool>("taggingMode")), + verbose_(iConfig.getParameter<bool>("verbose")), + minMuonPt_(iConfig.getParameter<double>("minMuonPt")), + minChargedHadronPt_(iConfig.getParameter<double>("minChargedHadronPt")), + minMuonTrackRelPtErr_(iConfig.getParameter<double>("minMuonTrackRelPtErr")), + maxSigLoose_(iConfig.getParameter<double>("maxSigLoose")), + maxSigTight_(iConfig.getParameter<double>("maxSigTight")), + minCaloCompatibility_(iConfig.getParameter<double>("minCaloCompatibility")), + minTrackNHits_(iConfig.getParameter<uint>("minTrackNHits")), + minPixelNHits_(iConfig.getParameter<uint>("minPixelNHits")) { produces<bool>(); produces<reco::PFCandidateCollection>(); produces<reco::PFCandidateCollection>("cleaned"); } -HiBadParticleFilter::~HiBadParticleFilter() { } - +HiBadParticleFilter::~HiBadParticleFilter() {} // // member functions // // ------------ method called on each new Event ------------ -bool -HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const edm::EventSetup& iSetup) const -{ +bool HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { using namespace std; using namespace edm; typedef View<reco::PFCandidate> CandidateView; Handle<CandidateView> pfCandidates; - iEvent.getByToken(tokenPFCandidates_,pfCandidates); + iEvent.getByToken(tokenPFCandidates_, pfCandidates); const reco::VertexCollection* recoVertices; edm::Handle<reco::VertexCollection> vertexCollection; - iEvent.getByToken(tokenPV_,vertexCollection); + iEvent.getByToken(tokenPV_, vertexCollection); recoVertices = vertexCollection.product(); auto pOutputCandidateCollection = std::make_unique<reco::PFCandidateCollection>(); auto pBadCandidateCollection = std::make_unique<reco::PFCandidateCollection>(); - bool foundBadCandidate = false; - - for(unsigned j=0;j<pfCandidates->size();++j ) { - const reco::PFCandidate & pfCandidate = (*pfCandidates)[j]; - - - if(abs(pfCandidate.particleId()) == 3) // muon cleaning - { - if(pfCandidate.pt() > minMuonPt_){ - - if(!pfCandidate.muonRef()->isGlobalMuon() || !pfCandidate.muonRef()->isTrackerMuon() || !pfCandidate.trackRef().isNonnull()) - { - if(verbose_) std::cout<<" bad muon fit "<<pfCandidate.pt()<<std::endl; - cout<<" isGlobal "<<pfCandidate.muonRef()->isGlobalMuon()<<" isTracker "<<pfCandidate.muonRef()->isTrackerMuon()<<" has track "<<pfCandidate.trackRef().isNonnull()<<std::endl; - foundBadCandidate=true; - continue; - } - reco::TrackRef track = pfCandidate.trackRef(); - - if(track->ptError()/track->pt()>minMuonTrackRelPtErr_ || track->pt()<pfCandidate.pt()/2.){ - if(verbose_){ - std::cout<<" bad muon err "<<pfCandidate.pt()<<std::endl; - std::cout<<" rel err = "<<track->ptError()/track->pt()<<std::endl; - } - foundBadCandidate=true; - continue; - } - - - if(track->algo()==13 || track->algo()==14 || track->originalAlgo() == 14 || track->originalAlgo() ==13 || track->hitPattern().trackerLayersWithMeasurement()<7){ - - - float xVtx = (*recoVertices)[0].position().x(); - float yVtx = (*recoVertices)[0].position().y(); - float zVtx = (*recoVertices)[0].position().z(); - float xVtxErr = (*recoVertices)[0].xError(); - float yVtxErr = (*recoVertices)[0].yError(); - float zVtxErr = (*recoVertices)[0].zError(); - - math::XYZPoint vtx_temp(xVtx,yVtx,zVtx); - - float Dz = track->dz(vtx_temp); - float DzError = sqrt(track->dzError()*track->dzError()+zVtxErr*zVtxErr); - float Dxy = track->dxy(vtx_temp); - float DxyError = sqrt(track->dxyError()*track->dxyError()+xVtxErr*yVtxErr); - float dzSig = Dz/DzError; - float dxySig = Dxy/DxyError; - - float sig3d = sqrt(dxySig*dxySig + dzSig*dzSig); - - if(sig3d > maxSigLoose_ ){ - if(verbose_){ - std::cout<<" bad muon algo 14, large IP "<<pfCandidate.pt()<<std::endl; - std::cout<<" dxy "<<Dxy<<" dxy err "<<DxyError<<std::endl; - std::cout<<" dz "<<Dz<<" dz err "<<DzError<<std::endl; - } - pBadCandidateCollection->push_back(pfCandidate); - foundBadCandidate=true; - continue; - } - - if(track->pt()<pfCandidate.pt()/1.5 || track->pt() > pfCandidate.pt()*1.5){ - if(verbose_){ - std::cout<<" bad muon algo, bad ptack pT "<<pfCandidate.pt()<<std::endl; - std::cout<<" track pT "<<track->pt()<<" cand pT "<<pfCandidate.pt()<<std::endl; - } - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - if(track->originalAlgo() == 14 && track->hitPattern().trackerLayersWithMeasurement()<10){ - if(verbose_){ - std::cout<<" bad muon original algo 14, small number of hits "<<pfCandidate.pt()<<std::endl; - std::cout<<" trakc N hits "<<track->hitPattern().trackerLayersWithMeasurement()<<std::endl; - } - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - } - } + for (unsigned j = 0; j < pfCandidates->size(); ++j) { + const reco::PFCandidate& pfCandidate = (*pfCandidates)[j]; + + if (abs(pfCandidate.particleId()) == 3) // muon cleaning + { + if (pfCandidate.pt() > minMuonPt_) { + if (!pfCandidate.muonRef()->isGlobalMuon() || !pfCandidate.muonRef()->isTrackerMuon() || + !pfCandidate.trackRef().isNonnull()) { + if (verbose_) + std::cout << " bad muon fit " << pfCandidate.pt() << std::endl; + cout << " isGlobal " << pfCandidate.muonRef()->isGlobalMuon() << " isTracker " + << pfCandidate.muonRef()->isTrackerMuon() << " has track " << pfCandidate.trackRef().isNonnull() + << std::endl; + foundBadCandidate = true; + continue; + } + reco::TrackRef track = pfCandidate.trackRef(); + + if (track->ptError() / track->pt() > minMuonTrackRelPtErr_ || track->pt() < pfCandidate.pt() / 2.) { + if (verbose_) { + std::cout << " bad muon err " << pfCandidate.pt() << std::endl; + std::cout << " rel err = " << track->ptError() / track->pt() << std::endl; + } + foundBadCandidate = true; + continue; + } + + if (track->algo() == 13 || track->algo() == 14 || track->originalAlgo() == 14 || track->originalAlgo() == 13 || + track->hitPattern().trackerLayersWithMeasurement() < 7) { + float xVtx = (*recoVertices)[0].position().x(); + float yVtx = (*recoVertices)[0].position().y(); + float zVtx = (*recoVertices)[0].position().z(); + float xVtxErr = (*recoVertices)[0].xError(); + float yVtxErr = (*recoVertices)[0].yError(); + float zVtxErr = (*recoVertices)[0].zError(); + + math::XYZPoint vtx_temp(xVtx, yVtx, zVtx); + + float Dz = track->dz(vtx_temp); + float DzError = sqrt(track->dzError() * track->dzError() + zVtxErr * zVtxErr); + float Dxy = track->dxy(vtx_temp); + float DxyError = sqrt(track->dxyError() * track->dxyError() + xVtxErr * yVtxErr); + float dzSig = Dz / DzError; + float dxySig = Dxy / DxyError; + + float sig3d = sqrt(dxySig * dxySig + dzSig * dzSig); + + if (sig3d > maxSigLoose_) { + if (verbose_) { + std::cout << " bad muon algo 14, large IP " << pfCandidate.pt() << std::endl; + std::cout << " dxy " << Dxy << " dxy err " << DxyError << std::endl; + std::cout << " dz " << Dz << " dz err " << DzError << std::endl; + } + pBadCandidateCollection->push_back(pfCandidate); + foundBadCandidate = true; + continue; + } + + if (track->pt() < pfCandidate.pt() / 1.5 || track->pt() > pfCandidate.pt() * 1.5) { + if (verbose_) { + std::cout << " bad muon algo, bad ptack pT " << pfCandidate.pt() << std::endl; + std::cout << " track pT " << track->pt() << " cand pT " << pfCandidate.pt() << std::endl; + } + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + if (track->originalAlgo() == 14 && track->hitPattern().trackerLayersWithMeasurement() < 10) { + if (verbose_) { + std::cout << " bad muon original algo 14, small number of hits " << pfCandidate.pt() << std::endl; + std::cout << " trakc N hits " << track->hitPattern().trackerLayersWithMeasurement() << std::endl; + } + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + } } - else if(abs(pfCandidate.particleId()) == 1) //charged hadron cleaning - { - if(pfCandidate.pt() > minChargedHadronPt_) - { - - reco::TrackRef track = pfCandidate.trackRef(); - - unsigned nHits = track->numberOfValidHits(); - unsigned nPixelHits = track->hitPattern().numberOfValidPixelHits(); - - if((nHits < minTrackNHits_ && nPixelHits < minPixelNHits_ ) || nHits==3 ){ - if(verbose_) std::cout<<" bad track with small nPixelHits, pT = "<<pfCandidate.pt()<<", nhits = "<<nPixelHits<<std::endl; - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - - - float xVtx = (*recoVertices)[0].position().x(); - float yVtx = (*recoVertices)[0].position().y(); - float zVtx = (*recoVertices)[0].position().z(); - float xVtxErr = (*recoVertices)[0].xError(); - float yVtxErr = (*recoVertices)[0].yError(); - float zVtxErr = (*recoVertices)[0].zError(); - - math::XYZPoint vtx_temp(xVtx,yVtx,zVtx); - - float Dz = track->dz(vtx_temp); - float DzError = sqrt(track->dzError()*track->dzError()+zVtxErr*zVtxErr); - float Dxy = track->dxy(vtx_temp); - float DxyError = sqrt(track->dxyError()*track->dxyError()+xVtxErr*yVtxErr); - float dzSig = Dz/DzError; - float dxySig = Dxy/DxyError; - - float sig3d = sqrt(dxySig*dxySig + dzSig*dzSig); - - if(sig3d > maxSigLoose_ ){ - if(verbose_) std::cout<<" bad track impact parameter, pT = "<<pfCandidate.pt()<<", dxySig = "<<dxySig<<", dzSig = "<<dzSig<<std::endl; - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - - if( sig3d > maxSigTight_ && nHits < minTrackNHits_ ){ - if(verbose_) std::cout<<" bad track with small nhits, pT = "<<pfCandidate.pt()<<", nhits = "<<nHits<<std::endl; - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - - - if(track->algo()==13 || track->algo()==14 || track->originalAlgo()==13 || track->originalAlgo()==14 ){ - - if(sig3d > maxSigLoose_ ){ - if(verbose_) std::cout<<" bad muon-seeded track impact parameter, pT = "<<pfCandidate.pt()<<", dxySig = "<<dxySig<<", dzSig = "<<dzSig<<std::endl; - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - - if( nHits < minTrackNHits_ ){ - if(verbose_) std::cout<<" bad muon-seeded track with small nhits, pT = "<<pfCandidate.pt()<<", nhits = "<<nHits<<std::endl; - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - } - - double caloEnergy = pfCandidate.ecalEnergy() + pfCandidate.hcalEnergy(); - - - if(caloEnergy < track->p()*minCaloCompatibility_) - { - - if(sig3d > maxSigTight_ ){ - if(verbose_) std::cout<<" bad calo-incompatible track impact parameter, pT = "<<pfCandidate.pt()<<", dxySig = "<<dxySig<<", dzSig = "<<dzSig<<std::endl; - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - - if( nHits < minTrackNHits_ ){ - if(verbose_) std::cout<<" bad calo-incompatible track with small nhits, pT = "<<pfCandidate.pt()<<", nhits = "<<nHits<<std::endl; - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - - if( nPixelHits < minPixelNHits_ ){ - if(verbose_) std::cout<<" bad calo-incompatible track with small nPixhits, pT = "<<pfCandidate.pt()<<", nhits = "<<nPixelHits<<std::endl; - foundBadCandidate=true; - pBadCandidateCollection->push_back(pfCandidate); - continue; - } - - } - - } + } else if (abs(pfCandidate.particleId()) == 1) //charged hadron cleaning + { + if (pfCandidate.pt() > minChargedHadronPt_) { + reco::TrackRef track = pfCandidate.trackRef(); + + unsigned nHits = track->numberOfValidHits(); + unsigned nPixelHits = track->hitPattern().numberOfValidPixelHits(); + + if ((nHits < minTrackNHits_ && nPixelHits < minPixelNHits_) || nHits == 3) { + if (verbose_) + std::cout << " bad track with small nPixelHits, pT = " << pfCandidate.pt() << ", nhits = " << nPixelHits + << std::endl; + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + float xVtx = (*recoVertices)[0].position().x(); + float yVtx = (*recoVertices)[0].position().y(); + float zVtx = (*recoVertices)[0].position().z(); + float xVtxErr = (*recoVertices)[0].xError(); + float yVtxErr = (*recoVertices)[0].yError(); + float zVtxErr = (*recoVertices)[0].zError(); + + math::XYZPoint vtx_temp(xVtx, yVtx, zVtx); + + float Dz = track->dz(vtx_temp); + float DzError = sqrt(track->dzError() * track->dzError() + zVtxErr * zVtxErr); + float Dxy = track->dxy(vtx_temp); + float DxyError = sqrt(track->dxyError() * track->dxyError() + xVtxErr * yVtxErr); + float dzSig = Dz / DzError; + float dxySig = Dxy / DxyError; + + float sig3d = sqrt(dxySig * dxySig + dzSig * dzSig); + + if (sig3d > maxSigLoose_) { + if (verbose_) + std::cout << " bad track impact parameter, pT = " << pfCandidate.pt() << ", dxySig = " << dxySig + << ", dzSig = " << dzSig << std::endl; + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if (sig3d > maxSigTight_ && nHits < minTrackNHits_) { + if (verbose_) + std::cout << " bad track with small nhits, pT = " << pfCandidate.pt() << ", nhits = " << nHits + << std::endl; + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if (track->algo() == 13 || track->algo() == 14 || track->originalAlgo() == 13 || track->originalAlgo() == 14) { + if (sig3d > maxSigLoose_) { + if (verbose_) + std::cout << " bad muon-seeded track impact parameter, pT = " << pfCandidate.pt() + << ", dxySig = " << dxySig << ", dzSig = " << dzSig << std::endl; + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if (nHits < minTrackNHits_) { + if (verbose_) + std::cout << " bad muon-seeded track with small nhits, pT = " << pfCandidate.pt() << ", nhits = " << nHits + << std::endl; + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + } + + double caloEnergy = pfCandidate.ecalEnergy() + pfCandidate.hcalEnergy(); + + if (caloEnergy < track->p() * minCaloCompatibility_) { + if (sig3d > maxSigTight_) { + if (verbose_) + std::cout << " bad calo-incompatible track impact parameter, pT = " << pfCandidate.pt() + << ", dxySig = " << dxySig << ", dzSig = " << dzSig << std::endl; + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if (nHits < minTrackNHits_) { + if (verbose_) + std::cout << " bad calo-incompatible track with small nhits, pT = " << pfCandidate.pt() + << ", nhits = " << nHits << std::endl; + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + + if (nPixelHits < minPixelNHits_) { + if (verbose_) + std::cout << " bad calo-incompatible track with small nPixhits, pT = " << pfCandidate.pt() + << ", nhits = " << nPixelHits << std::endl; + foundBadCandidate = true; + pBadCandidateCollection->push_back(pfCandidate); + continue; + } + } } - - - pOutputCandidateCollection->push_back(pfCandidate); + } + pOutputCandidateCollection->push_back(pfCandidate); - } // end loop over pf candidates + } // end loop over pf candidates bool pass = !foundBadCandidate; - iEvent.put(std::move(pOutputCandidateCollection) ); - iEvent.put(std::move(pBadCandidateCollection), "cleaned" ); - - iEvent.put( std::unique_ptr<bool>(new bool(pass)) ); - - return taggingMode_ || pass; + iEvent.put(std::move(pOutputCandidateCollection)); + iEvent.put(std::move(pBadCandidateCollection), "cleaned"); + iEvent.put(std::make_unique<bool>(pass)); + return taggingMode_ || pass; } - - - //define this as a plug-in DEFINE_FWK_MODULE(HiBadParticleFilter); From 599722e65a74c817c00b2b2314d37fc5f396bcf3 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Mon, 5 Oct 2020 16:56:03 +0200 Subject: [PATCH 734/778] remove abs causing clang warning --- RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc index af5a955483ba8..8d233107feddf 100644 --- a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc @@ -99,7 +99,7 @@ bool HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const ed for (unsigned j = 0; j < pfCandidates->size(); ++j) { const reco::PFCandidate& pfCandidate = (*pfCandidates)[j]; - if (abs(pfCandidate.particleId()) == 3) // muon cleaning + if (pfCandidate.particleId() == 3) // muon cleaning { if (pfCandidate.pt() > minMuonPt_) { if (!pfCandidate.muonRef()->isGlobalMuon() || !pfCandidate.muonRef()->isTrackerMuon() || @@ -174,7 +174,7 @@ bool HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const ed } } } - } else if (abs(pfCandidate.particleId()) == 1) //charged hadron cleaning + } else if (pfCandidate.particleId() == 1) //charged hadron cleaning { if (pfCandidate.pt() > minChargedHadronPt_) { reco::TrackRef track = pfCandidate.trackRef(); From 482b98ef089e4c3acf02638f9b570a5b615fdd37 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Tue, 6 Oct 2020 10:39:29 +0200 Subject: [PATCH 735/778] Change to EDProducer, fix vtx error calculation --- .../HiJetAlgos/plugins/HiBadParticleFilter.cc | 67 ++++++++----------- .../python/HiBadParticleFilter_cfi.py | 3 +- 2 files changed, 28 insertions(+), 42 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc index 8d233107feddf..1542b765a46dc 100644 --- a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc @@ -4,7 +4,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/global/EDFilter.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -25,20 +25,18 @@ // class declaration // -class HiBadParticleFilter : public edm::global::EDFilter<> { +class HiBadParticleFilter : public edm::stream::EDProducer<> { public: explicit HiBadParticleFilter(const edm::ParameterSet&); ~HiBadParticleFilter() override; private: - bool filter(edm::StreamID iID, edm::Event&, const edm::EventSetup&) const override; - + void produce(edm::Event&, const edm::EventSetup&) override; // ----------member data --------------------------- edm::EDGetTokenT<edm::View<reco::PFCandidate> > tokenPFCandidates_; edm::EDGetTokenT<reco::VertexCollection> tokenPV_; - const bool taggingMode_; const bool verbose_; const double minMuonPt_; const double minChargedHadronPt_; @@ -56,7 +54,6 @@ class HiBadParticleFilter : public edm::global::EDFilter<> { HiBadParticleFilter::HiBadParticleFilter(const edm::ParameterSet& iConfig) : tokenPFCandidates_(consumes<edm::View<reco::PFCandidate> >(iConfig.getParameter<edm::InputTag>("PFCandidates"))), tokenPV_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("offlinePV"))), - taggingMode_(iConfig.getParameter<bool>("taggingMode")), verbose_(iConfig.getParameter<bool>("verbose")), minMuonPt_(iConfig.getParameter<double>("minMuonPt")), minChargedHadronPt_(iConfig.getParameter<double>("minChargedHadronPt")), @@ -78,7 +75,7 @@ HiBadParticleFilter::~HiBadParticleFilter() {} // // ------------ method called on each new Event ------------ -bool HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { +void HiBadParticleFilter::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { using namespace std; using namespace edm; @@ -125,29 +122,25 @@ bool HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const ed if (track->algo() == 13 || track->algo() == 14 || track->originalAlgo() == 14 || track->originalAlgo() == 13 || track->hitPattern().trackerLayersWithMeasurement() < 7) { - float xVtx = (*recoVertices)[0].position().x(); - float yVtx = (*recoVertices)[0].position().y(); - float zVtx = (*recoVertices)[0].position().z(); - float xVtxErr = (*recoVertices)[0].xError(); - float yVtxErr = (*recoVertices)[0].yError(); - float zVtxErr = (*recoVertices)[0].zError(); - - math::XYZPoint vtx_temp(xVtx, yVtx, zVtx); - - float Dz = track->dz(vtx_temp); - float DzError = sqrt(track->dzError() * track->dzError() + zVtxErr * zVtxErr); - float Dxy = track->dxy(vtx_temp); - float DxyError = sqrt(track->dxyError() * track->dxyError() + xVtxErr * yVtxErr); - float dzSig = Dz / DzError; - float dxySig = Dxy / DxyError; + const reco::Vertex& vtx = (*recoVertices)[0]; + float bestVzError = vtx.zError(); + const math::XYZPoint& bestVtx(vtx.position()); + math::Error<3>::type vtx_cov = vtx.covariance(); + float dz = std::abs(track->dz(bestVtx)); + float dxy = std::abs(track->dxy(bestVtx)); + float dzError = std::hypot(track->dzError(), bestVzError); + float dxyError = track->dxyError(bestVtx, vtx_cov); + + float dzSig = dz / dzError; + float dxySig = dxy / dxyError; float sig3d = sqrt(dxySig * dxySig + dzSig * dzSig); if (sig3d > maxSigLoose_) { if (verbose_) { std::cout << " bad muon algo 14, large IP " << pfCandidate.pt() << std::endl; - std::cout << " dxy " << Dxy << " dxy err " << DxyError << std::endl; - std::cout << " dz " << Dz << " dz err " << DzError << std::endl; + std::cout << " dxy " << dxy << " dxy err " << dxyError << std::endl; + std::cout << " dz " << dz << " dz err " << dzError << std::endl; } pBadCandidateCollection->push_back(pfCandidate); foundBadCandidate = true; @@ -191,21 +184,17 @@ bool HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const ed continue; } - float xVtx = (*recoVertices)[0].position().x(); - float yVtx = (*recoVertices)[0].position().y(); - float zVtx = (*recoVertices)[0].position().z(); - float xVtxErr = (*recoVertices)[0].xError(); - float yVtxErr = (*recoVertices)[0].yError(); - float zVtxErr = (*recoVertices)[0].zError(); - - math::XYZPoint vtx_temp(xVtx, yVtx, zVtx); + const reco::Vertex& vtx = (*recoVertices)[0]; + float bestVzError = vtx.zError(); + const math::XYZPoint& bestVtx(vtx.position()); + math::Error<3>::type vtx_cov = vtx.covariance(); + float dz = std::abs(track->dz(bestVtx)); + float dxy = std::abs(track->dxy(bestVtx)); + float dzError = std::hypot(track->dzError(), bestVzError); + float dxyError = track->dxyError(bestVtx, vtx_cov); - float Dz = track->dz(vtx_temp); - float DzError = sqrt(track->dzError() * track->dzError() + zVtxErr * zVtxErr); - float Dxy = track->dxy(vtx_temp); - float DxyError = sqrt(track->dxyError() * track->dxyError() + xVtxErr * yVtxErr); - float dzSig = Dz / DzError; - float dxySig = Dxy / DxyError; + float dzSig = dz / dzError; + float dxySig = dxy / dxyError; float sig3d = sqrt(dxySig * dxySig + dzSig * dzSig); @@ -290,8 +279,6 @@ bool HiBadParticleFilter::filter(edm::StreamID iID, edm::Event& iEvent, const ed iEvent.put(std::move(pBadCandidateCollection), "cleaned"); iEvent.put(std::make_unique<bool>(pass)); - - return taggingMode_ || pass; } //define this as a plug-in diff --git a/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py b/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py index 6426cd1467e02..531e3ff295470 100644 --- a/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py +++ b/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py @@ -1,10 +1,9 @@ import FWCore.ParameterSet.Config as cms -filteredParticleFlow = cms.EDFilter( +filteredParticleFlow = cms.EDProducer( "HiBadParticleFilter", PFCandidates = cms.InputTag("particleFlow"), offlinePV = cms.InputTag("offlinePrimaryVertices"), - taggingMode = cms.bool(False), verbose = cms.bool(False), minMuonTrackRelErr = cms.double(2.0), # minimum ptError/pt on muon best track minMuonPt = cms.double(20.0), # minimum muon pt From 6bc137502fe0457046446cbd8e8eee9571417739 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Tue, 6 Oct 2020 19:01:23 +0200 Subject: [PATCH 736/778] Changed to global edproducer + other style comments from Andrea --- .../python/slimming/lostTracks_cfi.py | 2 +- .../python/slimming/packedPFCandidates_cff.py | 8 +- .../python/slimming/packedPFCandidates_cfi.py | 2 +- .../slimming/primaryVertexAssociation_cfi.py | 4 +- .../python/slimming/slimmedMuons_cfi.py | 4 +- ...ticleFilter.cc => HiBadParticleCleaner.cc} | 126 ++++++------------ ...ter_cfi.py => HiBadParticleCleaner_cfi.py} | 8 +- RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | 2 +- 8 files changed, 56 insertions(+), 100 deletions(-) rename RecoHI/HiJetAlgos/plugins/{HiBadParticleFilter.cc => HiBadParticleCleaner.cc} (55%) rename RecoHI/HiJetAlgos/python/{HiBadParticleFilter_cfi.py => HiBadParticleCleaner_cfi.py} (74%) diff --git a/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py b/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py index 3a98fe9e8331d..dbfab5f9753cb 100644 --- a/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py @@ -23,4 +23,4 @@ phase1Pixel.toModify(lostTracks, covarianceVersion =1 ) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(lostTracks,inputCandidates = "filteredParticleFlow") +pp_on_AA_2018.toModify(lostTracks,inputCandidates = "cleanedParticleFlow") diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py index 27187b46aa57b..621a018297c2b 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py @@ -11,13 +11,13 @@ pfNoPileUpPFBRECO ) -from RecoHI.HiJetAlgos.HiBadParticleFilter_cfi import filteredParticleFlow +from RecoHI.HiJetAlgos.HiBadParticleCleaner_cfi import cleanedParticleFlow from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -packedPFCandidatesCleaned = packedPFCandidates.clone( - inputCollection = "filteredParticleFlow:cleaned", +packedPFCandidatesRemoved = packedPFCandidates.clone( + inputCollection = "cleanedParticleFlow:removed", vertexAssociator = "primaryVertexAssociationCleaned:original" ) -_pp_on_AA_2018_packedPFCandidatesTask = cms.Task(filteredParticleFlow,packedPFCandidatesCleaned,packedPFCandidatesTask.copy()) +_pp_on_AA_2018_packedPFCandidatesTask = cms.Task(cleanedParticleFlow,packedPFCandidatesRemoved,packedPFCandidatesTask.copy()) pp_on_AA_2018.toReplaceWith(packedPFCandidatesTask,_pp_on_AA_2018_packedPFCandidatesTask) diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py index 8186157cd5ca1..a9589e2e35ee8 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py @@ -53,6 +53,6 @@ from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(packedPFCandidates, PuppiSrc = "", PuppiNoLepSrc = "") pp_on_AA_2018.toModify(packedPFCandidates, - inputCollection = "filteredParticleFlow", + inputCollection = "cleanedParticleFlow", chargedHadronIsolation = "" ) diff --git a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py b/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py index 825cfe9cf3505..68f078097225f 100644 --- a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py @@ -9,5 +9,5 @@ ) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(primaryVertexAssociation,particles = "filteredParticleFlow") -primaryVertexAssociationCleaned = primaryVertexAssociation.clone(particles = "filteredParticleFlow:cleaned") +pp_on_AA_2018.toModify(primaryVertexAssociation,particles = "cleanedParticleFlow") +primaryVertexAssociationCleaned = primaryVertexAssociation.clone(particles = "cleanedParticleFlow:removed") diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py index 2c03c4dec3c49..8df92c7c116ec 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py @@ -27,6 +27,6 @@ (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17 | pp_on_AA_2018 | miniAOD_skip_trackExtras).toModify(slimmedMuons, trackExtraAssocs = ["slimmedMuonTrackExtras"]) pp_on_AA_2018.toModify(slimmedMuons, - packedPFCandidates = ["packedPFCandidates","packedPFCandidatesCleaned"], - pfCandidates = ["filteredParticleFlow","filteredParticleFlow:cleaned"] + packedPFCandidates = ["packedPFCandidates","packedPFCandidatesRemoved"], + pfCandidates = ["cleanedParticleFlow","cleanedParticleFlow:removed"] ) diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc similarity index 55% rename from RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc rename to RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc index 1542b765a46dc..28f8dc728e016 100644 --- a/RecoHI/HiJetAlgos/plugins/HiBadParticleFilter.cc +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc @@ -4,14 +4,13 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/Math/interface/deltaR.h" #include "DataFormats/MuonReco/interface/Muon.h" #include "DataFormats/MuonReco/interface/MuonFwd.h" #include "DataFormats/MuonReco/interface/MuonSelectors.h" @@ -25,19 +24,18 @@ // class declaration // -class HiBadParticleFilter : public edm::stream::EDProducer<> { +class HiBadParticleCleaner : public edm::global::EDProducer<> { public: - explicit HiBadParticleFilter(const edm::ParameterSet&); - ~HiBadParticleFilter() override; + explicit HiBadParticleCleaner(const edm::ParameterSet&); + ~HiBadParticleCleaner() override; private: - void produce(edm::Event&, const edm::EventSetup&) override; + void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; // ----------member data --------------------------- edm::EDGetTokenT<edm::View<reco::PFCandidate> > tokenPFCandidates_; edm::EDGetTokenT<reco::VertexCollection> tokenPV_; - const bool verbose_; const double minMuonPt_; const double minChargedHadronPt_; const double minMuonTrackRelPtErr_; @@ -46,15 +44,16 @@ class HiBadParticleFilter : public edm::stream::EDProducer<> { const double minCaloCompatibility_; const unsigned minTrackNHits_; const unsigned minPixelNHits_; + const int minTrackerLayersForMuonLoose_; + const int minTrackerLayersForMuonTight_; }; // // constructors and destructor // -HiBadParticleFilter::HiBadParticleFilter(const edm::ParameterSet& iConfig) +HiBadParticleCleaner::HiBadParticleCleaner(const edm::ParameterSet& iConfig) : tokenPFCandidates_(consumes<edm::View<reco::PFCandidate> >(iConfig.getParameter<edm::InputTag>("PFCandidates"))), tokenPV_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("offlinePV"))), - verbose_(iConfig.getParameter<bool>("verbose")), minMuonPt_(iConfig.getParameter<double>("minMuonPt")), minChargedHadronPt_(iConfig.getParameter<double>("minChargedHadronPt")), minMuonTrackRelPtErr_(iConfig.getParameter<double>("minMuonTrackRelPtErr")), @@ -62,20 +61,23 @@ HiBadParticleFilter::HiBadParticleFilter(const edm::ParameterSet& iConfig) maxSigTight_(iConfig.getParameter<double>("maxSigTight")), minCaloCompatibility_(iConfig.getParameter<double>("minCaloCompatibility")), minTrackNHits_(iConfig.getParameter<uint>("minTrackNHits")), - minPixelNHits_(iConfig.getParameter<uint>("minPixelNHits")) { + minPixelNHits_(iConfig.getParameter<uint>("minPixelNHits")), + minTrackerLayersForMuonLoose_(iConfig.getParameter<int>("minTrackerLayersForMuonLoose")), + minTrackerLayersForMuonTight_(iConfig.getParameter<int>("minTrackerLayersForMuonTight")){ + produces<bool>(); produces<reco::PFCandidateCollection>(); - produces<reco::PFCandidateCollection>("cleaned"); + produces<reco::PFCandidateCollection>("removed"); } -HiBadParticleFilter::~HiBadParticleFilter() {} +HiBadParticleCleaner::~HiBadParticleCleaner() {} // // member functions // // ------------ method called on each new Event ------------ -void HiBadParticleFilter::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { +void HiBadParticleCleaner::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { using namespace std; using namespace edm; @@ -93,81 +95,57 @@ void HiBadParticleFilter::produce(edm::Event& iEvent, const edm::EventSetup& iSe bool foundBadCandidate = false; - for (unsigned j = 0; j < pfCandidates->size(); ++j) { - const reco::PFCandidate& pfCandidate = (*pfCandidates)[j]; + for(const reco::PFCandidate& pfCandidate : *pfCandidates){ - if (pfCandidate.particleId() == 3) // muon cleaning + if (pfCandidate.particleId() == reco::PFCandidate::ParticleType::mu) // muon cleaning { if (pfCandidate.pt() > minMuonPt_) { if (!pfCandidate.muonRef()->isGlobalMuon() || !pfCandidate.muonRef()->isTrackerMuon() || !pfCandidate.trackRef().isNonnull()) { - if (verbose_) - std::cout << " bad muon fit " << pfCandidate.pt() << std::endl; - cout << " isGlobal " << pfCandidate.muonRef()->isGlobalMuon() << " isTracker " - << pfCandidate.muonRef()->isTrackerMuon() << " has track " << pfCandidate.trackRef().isNonnull() - << std::endl; foundBadCandidate = true; continue; } reco::TrackRef track = pfCandidate.trackRef(); if (track->ptError() / track->pt() > minMuonTrackRelPtErr_ || track->pt() < pfCandidate.pt() / 2.) { - if (verbose_) { - std::cout << " bad muon err " << pfCandidate.pt() << std::endl; - std::cout << " rel err = " << track->ptError() / track->pt() << std::endl; - } foundBadCandidate = true; continue; } - if (track->algo() == 13 || track->algo() == 14 || track->originalAlgo() == 14 || track->originalAlgo() == 13 || - track->hitPattern().trackerLayersWithMeasurement() < 7) { + if (track->algo() == reco::TrackBase::muonSeededStepInOut || track->algo() == reco::TrackBase::muonSeededStepOutIn || track->originalAlgo() == reco::TrackBase::muonSeededStepInOut || track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn || track->hitPattern().trackerLayersWithMeasurement() < minTrackerLayersForMuonLoose_) { const reco::Vertex& vtx = (*recoVertices)[0]; float bestVzError = vtx.zError(); const math::XYZPoint& bestVtx(vtx.position()); math::Error<3>::type vtx_cov = vtx.covariance(); float dz = std::abs(track->dz(bestVtx)); float dxy = std::abs(track->dxy(bestVtx)); - float dzError = std::hypot(track->dzError(), bestVzError); + float dzError2 = track->dzError()*track->dzError() + bestVzError*bestVzError; float dxyError = track->dxyError(bestVtx, vtx_cov); - float dzSig = dz / dzError; - float dxySig = dxy / dxyError; + float dzSig2 = dz*dz / dzError2; + float dxySig2 = dxy*dxy / dxyError / dxyError; - float sig3d = sqrt(dxySig * dxySig + dzSig * dzSig); + float sig3d = sqrt( dzSig2 + dxySig2 ); if (sig3d > maxSigLoose_) { - if (verbose_) { - std::cout << " bad muon algo 14, large IP " << pfCandidate.pt() << std::endl; - std::cout << " dxy " << dxy << " dxy err " << dxyError << std::endl; - std::cout << " dz " << dz << " dz err " << dzError << std::endl; - } pBadCandidateCollection->push_back(pfCandidate); foundBadCandidate = true; continue; } if (track->pt() < pfCandidate.pt() / 1.5 || track->pt() > pfCandidate.pt() * 1.5) { - if (verbose_) { - std::cout << " bad muon algo, bad ptack pT " << pfCandidate.pt() << std::endl; - std::cout << " track pT " << track->pt() << " cand pT " << pfCandidate.pt() << std::endl; - } foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; } - if (track->originalAlgo() == 14 && track->hitPattern().trackerLayersWithMeasurement() < 10) { - if (verbose_) { - std::cout << " bad muon original algo 14, small number of hits " << pfCandidate.pt() << std::endl; - std::cout << " trakc N hits " << track->hitPattern().trackerLayersWithMeasurement() << std::endl; - } + if (track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn && track->hitPattern().trackerLayersWithMeasurement() < minTrackerLayersForMuonTight_) { foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; } } } - } else if (pfCandidate.particleId() == 1) //charged hadron cleaning + } else if (pfCandidate.particleId() == reco::PFCandidate::ParticleType::h) //charged hadron cleaning { if (pfCandidate.pt() > minChargedHadronPt_) { reco::TrackRef track = pfCandidate.trackRef(); @@ -176,60 +154,45 @@ void HiBadParticleFilter::produce(edm::Event& iEvent, const edm::EventSetup& iSe unsigned nPixelHits = track->hitPattern().numberOfValidPixelHits(); if ((nHits < minTrackNHits_ && nPixelHits < minPixelNHits_) || nHits == 3) { - if (verbose_) - std::cout << " bad track with small nPixelHits, pT = " << pfCandidate.pt() << ", nhits = " << nPixelHits - << std::endl; foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; } - const reco::Vertex& vtx = (*recoVertices)[0]; - float bestVzError = vtx.zError(); - const math::XYZPoint& bestVtx(vtx.position()); - math::Error<3>::type vtx_cov = vtx.covariance(); - float dz = std::abs(track->dz(bestVtx)); - float dxy = std::abs(track->dxy(bestVtx)); - float dzError = std::hypot(track->dzError(), bestVzError); - float dxyError = track->dxyError(bestVtx, vtx_cov); - - float dzSig = dz / dzError; - float dxySig = dxy / dxyError; - - float sig3d = sqrt(dxySig * dxySig + dzSig * dzSig); + const reco::Vertex& vtx = (*recoVertices)[0]; + float bestVzError = vtx.zError(); + const math::XYZPoint& bestVtx(vtx.position()); + math::Error<3>::type vtx_cov = vtx.covariance(); + float dz = std::abs(track->dz(bestVtx)); + float dxy = std::abs(track->dxy(bestVtx)); + float dzError2 = track->dzError()*track->dzError() + bestVzError*bestVzError; + float dxyError = track->dxyError(bestVtx, vtx_cov); + + float dzSig2 = dz*dz / dzError2; + float dxySig2 = dxy*dxy / dxyError / dxyError; + + float sig3d = sqrt( dzSig2 + dxySig2 ); if (sig3d > maxSigLoose_) { - if (verbose_) - std::cout << " bad track impact parameter, pT = " << pfCandidate.pt() << ", dxySig = " << dxySig - << ", dzSig = " << dzSig << std::endl; foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; } if (sig3d > maxSigTight_ && nHits < minTrackNHits_) { - if (verbose_) - std::cout << " bad track with small nhits, pT = " << pfCandidate.pt() << ", nhits = " << nHits - << std::endl; foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; } - if (track->algo() == 13 || track->algo() == 14 || track->originalAlgo() == 13 || track->originalAlgo() == 14) { + if (track->algo() == reco::TrackBase::muonSeededStepInOut || track->algo() == reco::TrackBase::muonSeededStepOutIn || track->originalAlgo() == reco::TrackBase::muonSeededStepInOut || track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn) { if (sig3d > maxSigLoose_) { - if (verbose_) - std::cout << " bad muon-seeded track impact parameter, pT = " << pfCandidate.pt() - << ", dxySig = " << dxySig << ", dzSig = " << dzSig << std::endl; foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; } if (nHits < minTrackNHits_) { - if (verbose_) - std::cout << " bad muon-seeded track with small nhits, pT = " << pfCandidate.pt() << ", nhits = " << nHits - << std::endl; foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; @@ -240,27 +203,18 @@ void HiBadParticleFilter::produce(edm::Event& iEvent, const edm::EventSetup& iSe if (caloEnergy < track->p() * minCaloCompatibility_) { if (sig3d > maxSigTight_) { - if (verbose_) - std::cout << " bad calo-incompatible track impact parameter, pT = " << pfCandidate.pt() - << ", dxySig = " << dxySig << ", dzSig = " << dzSig << std::endl; foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; } if (nHits < minTrackNHits_) { - if (verbose_) - std::cout << " bad calo-incompatible track with small nhits, pT = " << pfCandidate.pt() - << ", nhits = " << nHits << std::endl; foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; } if (nPixelHits < minPixelNHits_) { - if (verbose_) - std::cout << " bad calo-incompatible track with small nPixhits, pT = " << pfCandidate.pt() - << ", nhits = " << nPixelHits << std::endl; foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; @@ -276,10 +230,10 @@ void HiBadParticleFilter::produce(edm::Event& iEvent, const edm::EventSetup& iSe bool pass = !foundBadCandidate; iEvent.put(std::move(pOutputCandidateCollection)); - iEvent.put(std::move(pBadCandidateCollection), "cleaned"); + iEvent.put(std::move(pBadCandidateCollection), "removed"); iEvent.put(std::make_unique<bool>(pass)); } //define this as a plug-in -DEFINE_FWK_MODULE(HiBadParticleFilter); +DEFINE_FWK_MODULE(HiBadParticleCleaner); diff --git a/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py b/RecoHI/HiJetAlgos/python/HiBadParticleCleaner_cfi.py similarity index 74% rename from RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py rename to RecoHI/HiJetAlgos/python/HiBadParticleCleaner_cfi.py index 531e3ff295470..376c718a0ac94 100644 --- a/RecoHI/HiJetAlgos/python/HiBadParticleFilter_cfi.py +++ b/RecoHI/HiJetAlgos/python/HiBadParticleCleaner_cfi.py @@ -1,7 +1,7 @@ import FWCore.ParameterSet.Config as cms -filteredParticleFlow = cms.EDProducer( - "HiBadParticleFilter", +cleanedParticleFlow = cms.EDProducer( + "HiBadParticleCleaner", PFCandidates = cms.InputTag("particleFlow"), offlinePV = cms.InputTag("offlinePrimaryVertices"), verbose = cms.bool(False), @@ -13,5 +13,7 @@ maxSigTight = cms.double(10.), minCaloCompatibility = cms.double(0.35), minTrackNHits = cms.uint32(10), - minPixelNHits = cms.uint32(3) + minPixelNHits = cms.uint32(3), + minTrackerLayersForMuonLoose = cms.int32(7), + minTrackerLayersForMuonTight = cms.int32(10) ) diff --git a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py index c725eea387562..8d6b897ac956c 100644 --- a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py +++ b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py @@ -122,4 +122,4 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(akCs4PFJets,src = 'filteredParticleFlow') +pp_on_AA_2018.toModify(akCs4PFJets,src = 'cleanedParticleFlow') From 6aef98430ae6b07be524163439f985a5e782139b Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Tue, 6 Oct 2020 19:06:09 +0200 Subject: [PATCH 737/778] code format --- .../plugins/HiBadParticleCleaner.cc | 58 ++++++++++--------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc index 28f8dc728e016..7b5301f9e4ed4 100644 --- a/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc @@ -61,10 +61,9 @@ HiBadParticleCleaner::HiBadParticleCleaner(const edm::ParameterSet& iConfig) maxSigTight_(iConfig.getParameter<double>("maxSigTight")), minCaloCompatibility_(iConfig.getParameter<double>("minCaloCompatibility")), minTrackNHits_(iConfig.getParameter<uint>("minTrackNHits")), - minPixelNHits_(iConfig.getParameter<uint>("minPixelNHits")), - minTrackerLayersForMuonLoose_(iConfig.getParameter<int>("minTrackerLayersForMuonLoose")), - minTrackerLayersForMuonTight_(iConfig.getParameter<int>("minTrackerLayersForMuonTight")){ - + minPixelNHits_(iConfig.getParameter<uint>("minPixelNHits")), + minTrackerLayersForMuonLoose_(iConfig.getParameter<int>("minTrackerLayersForMuonLoose")), + minTrackerLayersForMuonTight_(iConfig.getParameter<int>("minTrackerLayersForMuonTight")) { produces<bool>(); produces<reco::PFCandidateCollection>(); produces<reco::PFCandidateCollection>("removed"); @@ -95,8 +94,7 @@ void HiBadParticleCleaner::produce(edm::StreamID, edm::Event& iEvent, const edm: bool foundBadCandidate = false; - for(const reco::PFCandidate& pfCandidate : *pfCandidates){ - + for (const reco::PFCandidate& pfCandidate : *pfCandidates) { if (pfCandidate.particleId() == reco::PFCandidate::ParticleType::mu) // muon cleaning { if (pfCandidate.pt() > minMuonPt_) { @@ -112,20 +110,24 @@ void HiBadParticleCleaner::produce(edm::StreamID, edm::Event& iEvent, const edm: continue; } - if (track->algo() == reco::TrackBase::muonSeededStepInOut || track->algo() == reco::TrackBase::muonSeededStepOutIn || track->originalAlgo() == reco::TrackBase::muonSeededStepInOut || track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn || track->hitPattern().trackerLayersWithMeasurement() < minTrackerLayersForMuonLoose_) { + if (track->algo() == reco::TrackBase::muonSeededStepInOut || + track->algo() == reco::TrackBase::muonSeededStepOutIn || + track->originalAlgo() == reco::TrackBase::muonSeededStepInOut || + track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn || + track->hitPattern().trackerLayersWithMeasurement() < minTrackerLayersForMuonLoose_) { const reco::Vertex& vtx = (*recoVertices)[0]; float bestVzError = vtx.zError(); const math::XYZPoint& bestVtx(vtx.position()); math::Error<3>::type vtx_cov = vtx.covariance(); float dz = std::abs(track->dz(bestVtx)); float dxy = std::abs(track->dxy(bestVtx)); - float dzError2 = track->dzError()*track->dzError() + bestVzError*bestVzError; + float dzError2 = track->dzError() * track->dzError() + bestVzError * bestVzError; float dxyError = track->dxyError(bestVtx, vtx_cov); - float dzSig2 = dz*dz / dzError2; - float dxySig2 = dxy*dxy / dxyError / dxyError; + float dzSig2 = dz * dz / dzError2; + float dxySig2 = dxy * dxy / dxyError / dxyError; - float sig3d = sqrt( dzSig2 + dxySig2 ); + float sig3d = sqrt(dzSig2 + dxySig2); if (sig3d > maxSigLoose_) { pBadCandidateCollection->push_back(pfCandidate); @@ -138,7 +140,8 @@ void HiBadParticleCleaner::produce(edm::StreamID, edm::Event& iEvent, const edm: pBadCandidateCollection->push_back(pfCandidate); continue; } - if (track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn && track->hitPattern().trackerLayersWithMeasurement() < minTrackerLayersForMuonTight_) { + if (track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn && + track->hitPattern().trackerLayersWithMeasurement() < minTrackerLayersForMuonTight_) { foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); continue; @@ -159,19 +162,19 @@ void HiBadParticleCleaner::produce(edm::StreamID, edm::Event& iEvent, const edm: continue; } - const reco::Vertex& vtx = (*recoVertices)[0]; - float bestVzError = vtx.zError(); - const math::XYZPoint& bestVtx(vtx.position()); - math::Error<3>::type vtx_cov = vtx.covariance(); - float dz = std::abs(track->dz(bestVtx)); - float dxy = std::abs(track->dxy(bestVtx)); - float dzError2 = track->dzError()*track->dzError() + bestVzError*bestVzError; - float dxyError = track->dxyError(bestVtx, vtx_cov); - - float dzSig2 = dz*dz / dzError2; - float dxySig2 = dxy*dxy / dxyError / dxyError; - - float sig3d = sqrt( dzSig2 + dxySig2 ); + const reco::Vertex& vtx = (*recoVertices)[0]; + float bestVzError = vtx.zError(); + const math::XYZPoint& bestVtx(vtx.position()); + math::Error<3>::type vtx_cov = vtx.covariance(); + float dz = std::abs(track->dz(bestVtx)); + float dxy = std::abs(track->dxy(bestVtx)); + float dzError2 = track->dzError() * track->dzError() + bestVzError * bestVzError; + float dxyError = track->dxyError(bestVtx, vtx_cov); + + float dzSig2 = dz * dz / dzError2; + float dxySig2 = dxy * dxy / dxyError / dxyError; + + float sig3d = sqrt(dzSig2 + dxySig2); if (sig3d > maxSigLoose_) { foundBadCandidate = true; @@ -185,7 +188,10 @@ void HiBadParticleCleaner::produce(edm::StreamID, edm::Event& iEvent, const edm: continue; } - if (track->algo() == reco::TrackBase::muonSeededStepInOut || track->algo() == reco::TrackBase::muonSeededStepOutIn || track->originalAlgo() == reco::TrackBase::muonSeededStepInOut || track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn) { + if (track->algo() == reco::TrackBase::muonSeededStepInOut || + track->algo() == reco::TrackBase::muonSeededStepOutIn || + track->originalAlgo() == reco::TrackBase::muonSeededStepInOut || + track->originalAlgo() == reco::TrackBase::muonSeededStepOutIn) { if (sig3d > maxSigLoose_) { foundBadCandidate = true; pBadCandidateCollection->push_back(pfCandidate); From e25e91bf7bcb7c458ca044301c9c143573cb0bcd Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Tue, 6 Oct 2020 23:16:48 +0200 Subject: [PATCH 738/778] Factorize pp_on_AA_2018 and pp_on_PbPb_run3 era --- .../Eras/python/Era_Run3_pp_on_PbPb_cff.py | 3 +-- .../StandardSequences/python/Reconstruction_cff.py | 3 ++- .../selectionLayer1/selectedPatCandidates_cff.py | 3 +++ .../PatAlgos/python/slimming/slimming_cff.py | 2 +- .../HiCentralityAlgos/python/HiCentrality_cfi.py | 14 +++++++------- .../Configuration/python/RecoJetsGlobal_cff.py | 5 +++-- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Configuration/Eras/python/Era_Run3_pp_on_PbPb_cff.py b/Configuration/Eras/python/Era_Run3_pp_on_PbPb_cff.py index a68c0f754dbb3..a035a85542f08 100644 --- a/Configuration/Eras/python/Era_Run3_pp_on_PbPb_cff.py +++ b/Configuration/Eras/python/Era_Run3_pp_on_PbPb_cff.py @@ -1,7 +1,6 @@ import FWCore.ParameterSet.Config as cms from Configuration.Eras.Era_Run3_cff import Run3 -from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 -Run3_pp_on_PbPb = cms.ModifierChain(Run3, pp_on_AA_2018, pp_on_PbPb_run3) +Run3_pp_on_PbPb = cms.ModifierChain(Run3, pp_on_PbPb_run3) diff --git a/Configuration/StandardSequences/python/Reconstruction_cff.py b/Configuration/StandardSequences/python/Reconstruction_cff.py index 24776960bc877..ba05064f488f9 100644 --- a/Configuration/StandardSequences/python/Reconstruction_cff.py +++ b/Configuration/StandardSequences/python/Reconstruction_cff.py @@ -182,6 +182,7 @@ # AA data with pp reco from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 from RecoHI.HiTracking.HILowPtConformalPixelTracks_cfi import * from RecoHI.HiCentralityAlgos.HiCentrality_cfi import hiCentrality from RecoHI.HiCentralityAlgos.HiClusterCompatibility_cfi import hiClusterCompatibility @@ -189,7 +190,7 @@ _highlevelreco_HITask.add(hiConformalPixelTracksTaskPhase1) _highlevelreco_HITask.add(hiCentrality) _highlevelreco_HITask.add(hiClusterCompatibility) -(pp_on_XeXe_2017 | pp_on_AA_2018).toReplaceWith(highlevelrecoTask, _highlevelreco_HITask) +(pp_on_XeXe_2017 | pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(highlevelrecoTask, _highlevelreco_HITask) pp_on_AA_2018.toReplaceWith(highlevelrecoTask,highlevelrecoTask.copyAndExclude([PFTauTask])) # not commisoned and not relevant in FastSim (?): diff --git a/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py b/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py index 8521d05a34ada..7c87afaf4133f 100644 --- a/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py @@ -36,5 +36,8 @@ selectedPatCandidates = cms.Sequence(selectedPatCandidateSummary, selectedPatCandidatesTask) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +#from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +#(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(selectedPatCandidatesTask, selectedPatCandidatesTask.copyAndExclude([selectedPatOOTPhotons])) +#(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(selectedPatCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("selectedPatOOTPhotons")) ) pp_on_AA_2018.toReplaceWith(selectedPatCandidatesTask, selectedPatCandidatesTask.copyAndExclude([selectedPatOOTPhotons])) pp_on_AA_2018.toModify(selectedPatCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("selectedPatOOTPhotons")) ) diff --git a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py index aecad412b7d33..8062664d83ad9 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py @@ -64,8 +64,8 @@ ) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedOOTPhotons])) from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedOOTPhotons])) from PhysicsTools.PatAlgos.slimming.hiPixelTracks_cfi import hiPixelTracks (pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(slimmingTask, cms.Task(slimmingTask.copy(), hiPixelTracks)) diff --git a/RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py b/RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py index 2eed47176fc51..96bf3b5871655 100644 --- a/RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py +++ b/RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py @@ -36,11 +36,11 @@ from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -for e in [pp_on_XeXe_2017, pp_on_AA_2018]: - e.toModify(hiCentrality, - producePixelTracks = True, - srcPixelTracks = "hiConformalPixelTracks", - srcTracks = cms.InputTag("generalTracks"), - srcVertex = cms.InputTag("offlinePrimaryVertices") - ) +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_XeXe_2017 | pp_on_AA_2018 | pp_on_PbPb_run3).toModify(hiCentrality, + producePixelTracks = True, + srcPixelTracks = "hiConformalPixelTracks", + srcTracks = cms.InputTag("generalTracks"), + srcVertex = cms.InputTag("offlinePrimaryVertices") + ) diff --git a/RecoJets/Configuration/python/RecoJetsGlobal_cff.py b/RecoJets/Configuration/python/RecoJetsGlobal_cff.py index cb899a0cd8a89..b487eec236168 100644 --- a/RecoJets/Configuration/python/RecoJetsGlobal_cff.py +++ b/RecoJets/Configuration/python/RecoJetsGlobal_cff.py @@ -24,6 +24,7 @@ from RecoHI.HiJetAlgos.HiRecoPFJets_cff import kt4PFJetsForRho from Configuration.Eras.Modifier_pA_2016_cff import pA_2016 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 from RecoHI.HiCentralityAlgos.pACentrality_cfi import pACentrality pA_2016.toModify(pACentrality, producePixelTracks = False) @@ -39,5 +40,5 @@ _jetHighLevelReco_HITask = cms.Task(recoPFJetsHITask,jetCorrectorsForRecoTask,recoJetAssociationsTask) _jetHighLevelReco_HI = cms.Sequence(_jetHighLevelReco_HITask) -pp_on_AA_2018.toReplaceWith(jetGlobalRecoTask,_jetGlobalReco_HITask) -pp_on_AA_2018.toReplaceWith(jetHighLevelRecoTask,_jetHighLevelReco_HITask) +(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(jetGlobalRecoTask,_jetGlobalReco_HITask) +(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(jetHighLevelRecoTask,_jetHighLevelReco_HITask) From 1dcc3b6016d65a83bdc1e2f4e5093aae4484facd Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 8 Oct 2020 07:37:49 +0200 Subject: [PATCH 739/778] Add modifier for HI reMiniAOD of 2018 PbPb data --- .../Eras/python/Modifier_run2_miniAOD_pp_on_AA_103X_cff.py | 4 ++++ Configuration/PyReleaseValidation/python/relval_steps.py | 5 ++--- Configuration/StandardSequences/python/Eras.py | 2 +- PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py | 4 ++-- .../PatAlgos/python/slimming/packedPFCandidates_cff.py | 3 ++- .../PatAlgos/python/slimming/primaryVertexAssociation_cfi.py | 4 ++-- PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py | 3 ++- RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc | 3 +-- RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | 5 ++--- 9 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 Configuration/Eras/python/Modifier_run2_miniAOD_pp_on_AA_103X_cff.py diff --git a/Configuration/Eras/python/Modifier_run2_miniAOD_pp_on_AA_103X_cff.py b/Configuration/Eras/python/Modifier_run2_miniAOD_pp_on_AA_103X_cff.py new file mode 100644 index 0000000000000..3dd0bca22445f --- /dev/null +++ b/Configuration/Eras/python/Modifier_run2_miniAOD_pp_on_AA_103X_cff.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +run2_miniAOD_pp_on_AA_103X = cms.Modifier() + diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 43e9d6ad47741..9b509ef3ba82b 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -1953,7 +1953,7 @@ def lhegensim2018ml(fragment,howMuch): '-s':'PAT,DQM:@miniAODDQM', '--datatier':'MINIAOD,DQMIO', '--eventcontent':'MINIAOD,DQM', - '--era':'Run2_2018_pp_on_AA', + '--era':'Run2_2018_pp_on_AA,run2_miniAOD_pp_on_AA_103X', '--data':'', '--processName':'PAT', '-n':'100' @@ -2507,9 +2507,8 @@ def gen2021HiMix(fragment,howMuch): '--eventcontent':'MINIAODSIM,DQM', '-n':100, '--era':'Run2_2018_pp_on_AA', - '--procModifiers':'genJetSubEvent', + '--procModifiers':'genJetSubEvent,run2_miniAOD_pp_on_AA_103X', },hiDefaults2018_ppReco,step3Up2015Defaults]) - steps['ALCARECOHI2018PPRECO']=merge([hiDefaults2018_ppReco,{'-s':'ALCA:TkAlMinBias+SiStripCalMinBias', '--datatier':'ALCARECO', '--eventcontent':'ALCARECO' diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index 5f5524eb6176a..ce418417f6cc8 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -61,7 +61,7 @@ def __init__(self): 'phase2_timing_layer', 'phase2_hcal', 'phase2_ecal', 'phase2_trigger', 'trackingLowPU', 'trackingPhase1', 'ctpps_2016', 'ctpps_2017', 'ctpps_2018', 'ctpps_2021', 'trackingPhase2PU140','highBetaStar_2018', - 'tracker_apv_vfp30_2016', 'pf_badHcalMitigation', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X', + 'tracker_apv_vfp30_2016', 'pf_badHcalMitigation', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X', 'run2_miniAOD_pp_on_AA_103X', 'run2_nanoAOD_94XMiniAODv1', 'run2_nanoAOD_94XMiniAODv2', 'run2_nanoAOD_94X2016', 'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', 'run2_nanoAOD_106Xv1', 'hcalHardcodeConditions', 'hcalSkipPacker', diff --git a/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py b/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py index dbfab5f9753cb..f9a178a2363ff 100644 --- a/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py @@ -22,5 +22,5 @@ from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel phase1Pixel.toModify(lostTracks, covarianceVersion =1 ) -from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(lostTracks,inputCandidates = "cleanedParticleFlow") +from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +run2_miniAOD_pp_on_AA_103X.toModify(lostTracks,inputCandidates = 'cleanedParticleFlow') diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py index 621a018297c2b..cce9f58cec21a 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py @@ -20,4 +20,5 @@ ) _pp_on_AA_2018_packedPFCandidatesTask = cms.Task(cleanedParticleFlow,packedPFCandidatesRemoved,packedPFCandidatesTask.copy()) -pp_on_AA_2018.toReplaceWith(packedPFCandidatesTask,_pp_on_AA_2018_packedPFCandidatesTask) +from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +run2_miniAOD_pp_on_AA_103X.toReplaceWith(packedPFCandidatesTask,_pp_on_AA_2018_packedPFCandidatesTask) diff --git a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py b/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py index 68f078097225f..0a21a7973e2d2 100644 --- a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py @@ -8,6 +8,6 @@ produceNoPileUpCollection = cms.bool(False) ) -from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(primaryVertexAssociation,particles = "cleanedParticleFlow") +from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +run2_miniAOD_pp_on_AA_103X.toModify(primaryVertexAssociation,particles = "cleanedParticleFlow") primaryVertexAssociationCleaned = primaryVertexAssociation.clone(particles = "cleanedParticleFlow:removed") diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py index 8df92c7c116ec..f6e735d1c27b4 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py @@ -26,7 +26,8 @@ from Configuration.ProcessModifiers.miniAOD_skip_trackExtras_cff import miniAOD_skip_trackExtras (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17 | pp_on_AA_2018 | miniAOD_skip_trackExtras).toModify(slimmedMuons, trackExtraAssocs = ["slimmedMuonTrackExtras"]) -pp_on_AA_2018.toModify(slimmedMuons, +from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +run2_miniAOD_pp_on_AA_103X.toModify(slimmedMuons, packedPFCandidates = ["packedPFCandidates","packedPFCandidatesRemoved"], pfCandidates = ["cleanedParticleFlow","cleanedParticleFlow:removed"] ) diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc index 7b5301f9e4ed4..4c609e3e69843 100644 --- a/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc @@ -1,6 +1,5 @@ // system include files #include <memory> -#include <iostream> // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" @@ -27,7 +26,7 @@ class HiBadParticleCleaner : public edm::global::EDProducer<> { public: explicit HiBadParticleCleaner(const edm::ParameterSet&); - ~HiBadParticleCleaner() override; + ~HiBadParticleCleaner(); private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; diff --git a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py index 8d6b897ac956c..43e70b078271a 100644 --- a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py +++ b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py @@ -120,6 +120,5 @@ ) hiRecoPFJets = cms.Sequence(hiRecoPFJetsTask) - -from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -pp_on_AA_2018.toModify(akCs4PFJets,src = 'cleanedParticleFlow') +from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +run2_miniAOD_pp_on_AA_103X.toModify(akCs4PFJets,src = 'cleanedParticleFlow') From d7d3af11b0e3645ea26faa07f8280cd2b42d4ae9 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 8 Oct 2020 07:51:35 +0200 Subject: [PATCH 740/778] code checks --- RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc index 4c609e3e69843..49eb379540801 100644 --- a/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc @@ -26,7 +26,7 @@ class HiBadParticleCleaner : public edm::global::EDProducer<> { public: explicit HiBadParticleCleaner(const edm::ParameterSet&); - ~HiBadParticleCleaner(); + ~HiBadParticleCleaner() override; private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; From 33075f586b8b1146386f2f142ae81f7b4d306bc0 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 8 Oct 2020 10:32:54 +0200 Subject: [PATCH 741/778] use default destructor --- RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc index 49eb379540801..7b8cce25d0795 100644 --- a/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc +++ b/RecoHI/HiJetAlgos/plugins/HiBadParticleCleaner.cc @@ -26,7 +26,7 @@ class HiBadParticleCleaner : public edm::global::EDProducer<> { public: explicit HiBadParticleCleaner(const edm::ParameterSet&); - ~HiBadParticleCleaner() override; + ~HiBadParticleCleaner() override = default; private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; @@ -68,8 +68,6 @@ HiBadParticleCleaner::HiBadParticleCleaner(const edm::ParameterSet& iConfig) produces<reco::PFCandidateCollection>("removed"); } -HiBadParticleCleaner::~HiBadParticleCleaner() {} - // // member functions // From 525930ba5dafb67f60bff36d61f9abb4b9db6cca Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 8 Oct 2020 11:19:18 +0200 Subject: [PATCH 742/778] minor cleanup --- RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py | 4 ++-- RecoHI/HiJetAlgos/python/HiBadParticleCleaner_cfi.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py b/RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py index 96bf3b5871655..684e615269e61 100644 --- a/RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py +++ b/RecoHI/HiCentralityAlgos/python/HiCentrality_cfi.py @@ -40,7 +40,7 @@ (pp_on_XeXe_2017 | pp_on_AA_2018 | pp_on_PbPb_run3).toModify(hiCentrality, producePixelTracks = True, srcPixelTracks = "hiConformalPixelTracks", - srcTracks = cms.InputTag("generalTracks"), - srcVertex = cms.InputTag("offlinePrimaryVertices") + srcTracks = "generalTracks", + srcVertex = "offlinePrimaryVertices" ) diff --git a/RecoHI/HiJetAlgos/python/HiBadParticleCleaner_cfi.py b/RecoHI/HiJetAlgos/python/HiBadParticleCleaner_cfi.py index 376c718a0ac94..2908fb5db78f9 100644 --- a/RecoHI/HiJetAlgos/python/HiBadParticleCleaner_cfi.py +++ b/RecoHI/HiJetAlgos/python/HiBadParticleCleaner_cfi.py @@ -4,7 +4,6 @@ "HiBadParticleCleaner", PFCandidates = cms.InputTag("particleFlow"), offlinePV = cms.InputTag("offlinePrimaryVertices"), - verbose = cms.bool(False), minMuonTrackRelErr = cms.double(2.0), # minimum ptError/pt on muon best track minMuonPt = cms.double(20.0), # minimum muon pt minChargedHadronPt = cms.double(20.0), From 87467f594874026aec01c38a7104ff5c6f7c72d2 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 8 Oct 2020 12:35:37 +0200 Subject: [PATCH 743/778] missed one instance for new miniAOD modifier --- .../PatAlgos/python/slimming/packedPFCandidates_cfi.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py index a9589e2e35ee8..3f54dc60d983a 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py @@ -52,7 +52,8 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(packedPFCandidates, PuppiSrc = "", PuppiNoLepSrc = "") -pp_on_AA_2018.toModify(packedPFCandidates, - inputCollection = "cleanedParticleFlow", - chargedHadronIsolation = "" - ) +from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +run2_miniAOD_pp_on_AA_103X.toModify(packedPFCandidates, + inputCollection = "cleanedParticleFlow", + chargedHadronIsolation = "" + ) From 8383fb3fc3277d361d20f675d8b18f6e37e2eaa4 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 8 Oct 2020 17:29:56 +0200 Subject: [PATCH 744/778] Switch from era to process modifier --- .../python/run2_miniAOD_pp_on_AA_103X_cff.py} | 0 Configuration/PyReleaseValidation/python/relval_steps.py | 5 ++++- PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py | 2 +- .../PatAlgos/python/slimming/packedPFCandidates_cff.py | 2 +- .../PatAlgos/python/slimming/packedPFCandidates_cfi.py | 2 +- .../PatAlgos/python/slimming/primaryVertexAssociation_cfi.py | 2 +- PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py | 2 +- RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py | 2 +- 8 files changed, 10 insertions(+), 7 deletions(-) rename Configuration/{Eras/python/Modifier_run2_miniAOD_pp_on_AA_103X_cff.py => ProcessModifiers/python/run2_miniAOD_pp_on_AA_103X_cff.py} (100%) diff --git a/Configuration/Eras/python/Modifier_run2_miniAOD_pp_on_AA_103X_cff.py b/Configuration/ProcessModifiers/python/run2_miniAOD_pp_on_AA_103X_cff.py similarity index 100% rename from Configuration/Eras/python/Modifier_run2_miniAOD_pp_on_AA_103X_cff.py rename to Configuration/ProcessModifiers/python/run2_miniAOD_pp_on_AA_103X_cff.py diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index 9b509ef3ba82b..956d6d59adc69 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -1953,7 +1953,8 @@ def lhegensim2018ml(fragment,howMuch): '-s':'PAT,DQM:@miniAODDQM', '--datatier':'MINIAOD,DQMIO', '--eventcontent':'MINIAOD,DQM', - '--era':'Run2_2018_pp_on_AA,run2_miniAOD_pp_on_AA_103X', + '--era':'Run2_2018_pp_on_AA', + '--procModifiers':'run2_miniAOD_pp_on_AA_103X', '--data':'', '--processName':'PAT', '-n':'100' @@ -2501,6 +2502,8 @@ def gen2021HiMix(fragment,howMuch): '--datatier':'MINIAODSIM,DQMIO', '--eventcontent':'MINIAODSIM,DQM', '-n':100, + '--era':'Run2_2018_pp_on_AA', + '--procModifiers':'run2_miniAOD_pp_on_AA_103X', },hiDefaults2018_ppReco,step3Up2015Defaults]) steps['REMINIAODHI2018PPRECOMB']=merge([{'-s':'PAT,VALIDATION:@miniAODValidation,DQM:@miniAODDQM', '--datatier':'MINIAODSIM,DQMIO', diff --git a/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py b/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py index f9a178a2363ff..1b6a851d8ea22 100644 --- a/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/lostTracks_cfi.py @@ -22,5 +22,5 @@ from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel phase1Pixel.toModify(lostTracks, covarianceVersion =1 ) -from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X run2_miniAOD_pp_on_AA_103X.toModify(lostTracks,inputCandidates = 'cleanedParticleFlow') diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py index cce9f58cec21a..b95295f2201a5 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py @@ -20,5 +20,5 @@ ) _pp_on_AA_2018_packedPFCandidatesTask = cms.Task(cleanedParticleFlow,packedPFCandidatesRemoved,packedPFCandidatesTask.copy()) -from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X run2_miniAOD_pp_on_AA_103X.toReplaceWith(packedPFCandidatesTask,_pp_on_AA_2018_packedPFCandidatesTask) diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py index 3f54dc60d983a..d951ea4ad7d92 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cfi.py @@ -52,7 +52,7 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 (pp_on_AA_2018 | pp_on_PbPb_run3).toModify(packedPFCandidates, PuppiSrc = "", PuppiNoLepSrc = "") -from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X run2_miniAOD_pp_on_AA_103X.toModify(packedPFCandidates, inputCollection = "cleanedParticleFlow", chargedHadronIsolation = "" diff --git a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py b/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py index 0a21a7973e2d2..a18ebc3feb4c5 100644 --- a/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/primaryVertexAssociation_cfi.py @@ -8,6 +8,6 @@ produceNoPileUpCollection = cms.bool(False) ) -from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X run2_miniAOD_pp_on_AA_103X.toModify(primaryVertexAssociation,particles = "cleanedParticleFlow") primaryVertexAssociationCleaned = primaryVertexAssociation.clone(particles = "cleanedParticleFlow:removed") diff --git a/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py b/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py index f6e735d1c27b4..49e4a415e5387 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimmedMuons_cfi.py @@ -26,7 +26,7 @@ from Configuration.ProcessModifiers.miniAOD_skip_trackExtras_cff import miniAOD_skip_trackExtras (run2_miniAOD_80XLegacy | run2_miniAOD_94XFall17 | pp_on_AA_2018 | miniAOD_skip_trackExtras).toModify(slimmedMuons, trackExtraAssocs = ["slimmedMuonTrackExtras"]) -from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X run2_miniAOD_pp_on_AA_103X.toModify(slimmedMuons, packedPFCandidates = ["packedPFCandidates","packedPFCandidatesRemoved"], pfCandidates = ["cleanedParticleFlow","cleanedParticleFlow:removed"] diff --git a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py index 43e70b078271a..3823feae8ee19 100644 --- a/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py +++ b/RecoHI/HiJetAlgos/python/HiRecoPFJets_cff.py @@ -120,5 +120,5 @@ ) hiRecoPFJets = cms.Sequence(hiRecoPFJetsTask) -from Configuration.Eras.Modifier_run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X run2_miniAOD_pp_on_AA_103X.toModify(akCs4PFJets,src = 'cleanedParticleFlow') From 7d85a56c8ce774cb0bf1b8171e3eee09db10b1cf Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 8 Oct 2020 18:46:24 +0200 Subject: [PATCH 745/778] remove modifier from list of eras --- Configuration/StandardSequences/python/Eras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index ce418417f6cc8..5f5524eb6176a 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -61,7 +61,7 @@ def __init__(self): 'phase2_timing_layer', 'phase2_hcal', 'phase2_ecal', 'phase2_trigger', 'trackingLowPU', 'trackingPhase1', 'ctpps_2016', 'ctpps_2017', 'ctpps_2018', 'ctpps_2021', 'trackingPhase2PU140','highBetaStar_2018', - 'tracker_apv_vfp30_2016', 'pf_badHcalMitigation', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X', 'run2_miniAOD_pp_on_AA_103X', + 'tracker_apv_vfp30_2016', 'pf_badHcalMitigation', 'run2_miniAOD_80XLegacy','run2_miniAOD_94XFall17', 'run2_nanoAOD_92X', 'run2_nanoAOD_94XMiniAODv1', 'run2_nanoAOD_94XMiniAODv2', 'run2_nanoAOD_94X2016', 'run2_miniAOD_devel', 'run2_nanoAOD_102Xv1', 'run2_nanoAOD_106Xv1', 'hcalHardcodeConditions', 'hcalSkipPacker', From 84cc4d8314bc51ec146da03e4e34bfc0950319e3 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Fri, 9 Oct 2020 18:33:07 +0200 Subject: [PATCH 746/778] Era cleanup that got lost in the shuffle --- .../python/selectionLayer1/selectedPatCandidates_cff.py | 8 +++----- .../PatAlgos/python/slimming/packedPFCandidates_cff.py | 1 - PhysicsTools/PatAlgos/python/slimming/slimming_cff.py | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py b/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py index 7c87afaf4133f..add5c311028ac 100644 --- a/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py @@ -36,8 +36,6 @@ selectedPatCandidates = cms.Sequence(selectedPatCandidateSummary, selectedPatCandidatesTask) from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 -#from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 -#(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(selectedPatCandidatesTask, selectedPatCandidatesTask.copyAndExclude([selectedPatOOTPhotons])) -#(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(selectedPatCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("selectedPatOOTPhotons")) ) -pp_on_AA_2018.toReplaceWith(selectedPatCandidatesTask, selectedPatCandidatesTask.copyAndExclude([selectedPatOOTPhotons])) -pp_on_AA_2018.toModify(selectedPatCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("selectedPatOOTPhotons")) ) +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +(pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith(selectedPatCandidatesTask, selectedPatCandidatesTask.copyAndExclude([selectedPatOOTPhotons])) +(pp_on_AA_2018 | pp_on_PbPb_run3).toModify(selectedPatCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("selectedPatOOTPhotons")) ) diff --git a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py index b95295f2201a5..be7ddadbbe071 100644 --- a/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/packedPFCandidates_cff.py @@ -13,7 +13,6 @@ from RecoHI.HiJetAlgos.HiBadParticleCleaner_cfi import cleanedParticleFlow -from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 packedPFCandidatesRemoved = packedPFCandidates.clone( inputCollection = "cleanedParticleFlow:removed", vertexAssociator = "primaryVertexAssociationCleaned:original" diff --git a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py index 8062664d83ad9..5ccb185f99eda 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py @@ -78,7 +78,8 @@ (pp_on_AA_2018 | pp_on_PbPb_run3).toReplaceWith( slimmingTask, cms.Task(slimmingTask.copy(), packedCandidateMuonID, packedPFCandidateTrackChi2, lostTrackChi2, centralityBin, hiHFfilters)) -pp_on_AA_2018.toReplaceWith(slimmingTask,cms.Task(primaryVertexAssociationCleaned,slimmingTask.copy())) +from Configuration.ProcessModifiers.run2_miniAOD_pp_on_AA_103X_cff import run2_miniAOD_pp_on_AA_103X +run2_miniAOD_pp_on_AA_103X.toReplaceWith(slimmingTask,cms.Task(primaryVertexAssociationCleaned,slimmingTask.copy())) from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing _phase2_timing_slimmingTask = cms.Task(slimmingTask.copy(), From 307021a5f9d59916a01b08b643c490cdade7093a Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Tue, 13 Oct 2020 15:04:05 +0200 Subject: [PATCH 747/778] fix name for keeping cleaned packed candidates --- PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py index a0f0a884f2e7f..eb38853fecbd2 100644 --- a/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py @@ -140,7 +140,7 @@ _pp_on_AA_extraCommands = [ 'keep patPackedCandidates_hiPixelTracks_*_*', - 'keep patPackedCandidates_packedPFCandidatesCleaned_*_*', + 'keep patPackedCandidates_packedPFCandidatesRemoved_*_*', 'keep *_packedCandidateMuonID_*_*', 'keep *_slimmedJets_pfCandidates_*', 'keep floatedmValueMap_packedPFCandidateTrackChi2_*_*', From 1ab028e49672bb169b71415c3d6b0d456b930b21 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti <fabio.cossutti@ts.infn.it> Date: Tue, 20 Oct 2020 18:42:39 +0200 Subject: [PATCH 748/778] Cleaning of PGeometricTimingDetExtra --- .../interface/PGeometricTimingDetExtra.h | 32 ------------------- .../T_EventSetup_PGeometricTimingDetExtra.cc | 4 --- CondFormats/GeometryObjects/src/classes.h | 1 - .../GeometryObjects/src/classes_def.xml | 7 ---- .../Records/interface/IdealGeometryRecord.h | 3 +- .../interface/PGeometricTimingDetExtraRcd.h | 7 ---- .../src/PGeometricTimingDetExtraRcd.cc | 4 --- 7 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 CondFormats/GeometryObjects/interface/PGeometricTimingDetExtra.h delete mode 100644 CondFormats/GeometryObjects/src/T_EventSetup_PGeometricTimingDetExtra.cc delete mode 100644 Geometry/Records/interface/PGeometricTimingDetExtraRcd.h delete mode 100644 Geometry/Records/src/PGeometricTimingDetExtraRcd.cc diff --git a/CondFormats/GeometryObjects/interface/PGeometricTimingDetExtra.h b/CondFormats/GeometryObjects/interface/PGeometricTimingDetExtra.h deleted file mode 100644 index 5e4003e91bc7e..0000000000000 --- a/CondFormats/GeometryObjects/interface/PGeometricTimingDetExtra.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CondFormats_PGeometricTimingDetExtra_h -#define CondFormats_PGeometricTimingDetExtra_h - -#include "CondFormats/Serialization/interface/Serializable.h" - -#include <vector> -#include <string> - -class PGeometricTimingDetExtra { -public: - PGeometricTimingDetExtra(){}; - ~PGeometricTimingDetExtra(){}; - - struct Item { - int geographicalId_; // to be converted to DetId - // std::vector< DDExpandedNode > parents_; DO NOT SAVE! - //GeoHistory _parents; - double volume_; - double density_; - double weight_; - int copy_; - std::string material_; - - COND_SERIALIZABLE; - }; - - std::vector<Item> pgdes_; - - COND_SERIALIZABLE; -}; - -#endif diff --git a/CondFormats/GeometryObjects/src/T_EventSetup_PGeometricTimingDetExtra.cc b/CondFormats/GeometryObjects/src/T_EventSetup_PGeometricTimingDetExtra.cc deleted file mode 100644 index ea28f31bad6f6..0000000000000 --- a/CondFormats/GeometryObjects/src/T_EventSetup_PGeometricTimingDetExtra.cc +++ /dev/null @@ -1,4 +0,0 @@ -#include "CondFormats/GeometryObjects/interface/PGeometricTimingDetExtra.h" -#include "FWCore/Utilities/interface/typelookup.h" - -TYPELOOKUP_DATA_REG(PGeometricTimingDetExtra); diff --git a/CondFormats/GeometryObjects/src/classes.h b/CondFormats/GeometryObjects/src/classes.h index 9eab3baa55c4b..5bd259b1cf1c2 100644 --- a/CondFormats/GeometryObjects/src/classes.h +++ b/CondFormats/GeometryObjects/src/classes.h @@ -1,6 +1,5 @@ #include "CondFormats/GeometryObjects/interface/PGeometricDet.h" #include "CondFormats/GeometryObjects/interface/PGeometricTimingDet.h" -#include "CondFormats/GeometryObjects/interface/PGeometricTimingDetExtra.h" #include "CondFormats/GeometryObjects/interface/PCaloGeometry.h" #include "CondFormats/GeometryObjects/interface/RecoIdealGeometry.h" #include "CondFormats/GeometryObjects/interface/CSCRecoDigiParameters.h" diff --git a/CondFormats/GeometryObjects/src/classes_def.xml b/CondFormats/GeometryObjects/src/classes_def.xml index d37f9ca2af066..2bea75cc3acbc 100644 --- a/CondFormats/GeometryObjects/src/classes_def.xml +++ b/CondFormats/GeometryObjects/src/classes_def.xml @@ -11,13 +11,6 @@ <class name="PGeometricTimingDet::Item"/> <class name="std::vector<PGeometricTimingDet::Item>"/> - <class name="PGeometricTimingDetExtra" class_version="0"> - <field name="pgdes_" mapping="blob"/> - </class> - <class name="PGeometricTimingDetExtra::Item"/> - <class name="std::vector<PGeometricTimingDetExtra::Item>"/> - - <class name="PCaloGeometry" class_version="0"> <field name="m_translation" mapping="blob"/> <field name="m_dimension" mapping="blob"/> diff --git a/Geometry/Records/interface/IdealGeometryRecord.h b/Geometry/Records/interface/IdealGeometryRecord.h index b85ab470d495a..e97e6a1270c24 100644 --- a/Geometry/Records/interface/IdealGeometryRecord.h +++ b/Geometry/Records/interface/IdealGeometryRecord.h @@ -20,11 +20,10 @@ #include "FWCore/Framework/interface/DependentRecordImplementation.h" #include "Geometry/Records/interface/GeometryFileRcd.h" -#include "Geometry/Records/interface/PGeometricTimingDetExtraRcd.h" #include "FWCore/Utilities/interface/mplVector.h" class IdealGeometryRecord : public edm::eventsetup::DependentRecordImplementation< IdealGeometryRecord, - edm::mpl::Vector<GeometryFileRcd, PGeometricTimingDetExtraRcd> > {}; + edm::mpl::Vector<GeometryFileRcd> > {}; #endif /* RECORDS_IDEALGEOMETRYRECORD_H */ diff --git a/Geometry/Records/interface/PGeometricTimingDetExtraRcd.h b/Geometry/Records/interface/PGeometricTimingDetExtraRcd.h deleted file mode 100644 index 5d2aeeaab0c1a..0000000000000 --- a/Geometry/Records/interface/PGeometricTimingDetExtraRcd.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef PGeometricTimingDetExtraRcd_H -#define PGeometricTimingDetExtraRcd_H - -#include "FWCore/Framework/interface/EventSetupRecordImplementation.h" -class PGeometricTimingDetExtraRcd - : public edm::eventsetup::EventSetupRecordImplementation<PGeometricTimingDetExtraRcd> {}; -#endif diff --git a/Geometry/Records/src/PGeometricTimingDetExtraRcd.cc b/Geometry/Records/src/PGeometricTimingDetExtraRcd.cc deleted file mode 100644 index 0b092d4e6b001..0000000000000 --- a/Geometry/Records/src/PGeometricTimingDetExtraRcd.cc +++ /dev/null @@ -1,4 +0,0 @@ -#include "Geometry/Records/interface/PGeometricTimingDetExtraRcd.h" -#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" - -EVENTSETUP_RECORD_REG(PGeometricTimingDetExtraRcd); From d6fd722f31e0917a1c912b1b788df8a1559357ba Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 18:48:10 +0200 Subject: [PATCH 749/778] Update tests for ESGetToken and also for checking content in geometry --- .../HGCalGeometry/test/HGCGeomAnalyzer.cc | 12 +-- .../test/HGCalGeomLocatorTester.cc | 3 +- .../test/HGCalWaferInFileTest.cc | 83 ++++++++++++------- 3 files changed, 61 insertions(+), 37 deletions(-) diff --git a/Geometry/HGCalGeometry/test/HGCGeomAnalyzer.cc b/Geometry/HGCalGeometry/test/HGCGeomAnalyzer.cc index ca2471021e512..9248e53d199d7 100644 --- a/Geometry/HGCalGeometry/test/HGCGeomAnalyzer.cc +++ b/Geometry/HGCalGeometry/test/HGCGeomAnalyzer.cc @@ -53,7 +53,9 @@ class HGCGeomAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> { // ----------member data --------------------------- edm::Service<TFileService> fs_; - std::string txtFileName_; + const std::string txtFileName_; + edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geomToken_; + std::map<std::pair<DetId::Detector, int>, TProfile2D *> layerXYview_; std::map<std::pair<DetId::Detector, int>, TProfile *> layerThickR_; std::map<std::pair<DetId::Detector, int>, TProfile *> layerThickEta_; @@ -61,7 +63,8 @@ class HGCGeomAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> { // HGCGeomAnalyzer::HGCGeomAnalyzer(const edm::ParameterSet &iConfig) - : txtFileName_(iConfig.getParameter<std::string>("fileName")) { + : txtFileName_(iConfig.getParameter<std::string>("fileName")), + geomToken_{esConsumes<CaloGeometry, CaloGeometryRecord>()} { usesResource("TFileService"); fs_->file().cd(); } @@ -76,13 +79,12 @@ void HGCGeomAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &e boundaries.open(txtFileName_); //get geometry - edm::ESHandle<CaloGeometry> geomhandle; - es.get<CaloGeometryRecord>().get(geomhandle); + const CaloGeometry* caloGeom = &es.getData(geomToken_); std::vector<DetId::Detector> dets = {DetId::HGCalEE, DetId::HGCalHSi, DetId::HGCalHSc}; for (const auto &d : dets) { const HGCalGeometry *geom = - static_cast<const HGCalGeometry *>(geomhandle->getSubdetectorGeometry(d, ForwardSubdetector::ForwardEmpty)); + static_cast<const HGCalGeometry *>(caloGeom->getSubdetectorGeometry(d, ForwardSubdetector::ForwardEmpty)); const HGCalTopology *topo = &(geom->topology()); const HGCalDDDConstants *ddd = &(topo->dddConstants()); diff --git a/Geometry/HGCalGeometry/test/HGCalGeomLocatorTester.cc b/Geometry/HGCalGeometry/test/HGCalGeomLocatorTester.cc index dff2755fc071f..fd21e847a66a6 100644 --- a/Geometry/HGCalGeometry/test/HGCalGeomLocatorTester.cc +++ b/Geometry/HGCalGeometry/test/HGCalGeomLocatorTester.cc @@ -33,8 +33,7 @@ HGCalGeomLocaterTester::HGCalGeomLocaterTester(const edm::ParameterSet& iC) geomToken_{esConsumes<HGCalGeometry, IdealGeometryRecord>(edm::ESInputTag{"", name_})} {} void HGCalGeomLocaterTester::analyze(const edm::Event&, const edm::EventSetup& iSetup) { - const auto& geomR = iSetup.getData(geomToken_); - const HGCalGeometry* geom = &geomR; + const HGCalGeometry* geom = &iSetup.getData(geomToken_); if (geom->topology().waferHexagon8()) { DetId::Detector det; if (name_ == "HGCalHESiliconSensitive") diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc index 042d859f99d77..50b7f7fdca30d 100644 --- a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc @@ -52,6 +52,7 @@ class HGCalWaferInFileTest : public edm::one::EDAnalyzer<> { private: std::vector<std::string> getPoints( double xpos, double ypos, double delX, double delY, double rin, double rout, int lay, int waferU, int waferV); + std::vector<double> getCorners(double xpos, double ypos, double delX, double delY); const std::string nameSense_, nameDetector_; const int verbosity_; const edm::ESGetToken<HGCalGeometry, IdealGeometryRecord> geomToken_; @@ -104,12 +105,16 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, true); const auto& rr = hgdc.rangeRLayer(layer, true); auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); + auto rpos = getCorners(xy.first, xy.second, delX, delY); std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << ", " << typex << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " << hgdc.waferZ(layer, true) << ") not present with " << points.size() << " points:"; for (auto point : points) std::cout << " " << point; - std::cout << " in the region " << rr.first << ":" << rr.second << std::endl; + std::cout << " in the region " << rr.first << ":" << rr.second << " Corners"; + for (auto point : rpos) + std::cout << " " << point; + std::cout << std::endl; ++bad1; if ((layer - layerf) < layers) ++miss[layer - layerf]; @@ -169,7 +174,7 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet int rotn2 = hgdc.waferTypeRotation(id.layer(), id.waferU(), id.waferV(), false, false).second; bool partOK = ((part1 == part2) || ((part1 == HGCalTypes::WaferFull) && (part2 == HGCalTypes::WaferOut))); bool rotnOK = ((rotn1 == rotn2) || (part1 == HGCalTypes::WaferFull) || (part2 == HGCalTypes::WaferFull)); - bool partOK2 = ((part1 > part2) || partOK); + bool partOK2 = (partOK) || (part2 < part1); if (!partOK) { ++badP; if ((layer - layerf) < layers) @@ -187,28 +192,32 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet } if ((!partOK) || (!rotnOK)) { ++badG; - std::string partx1 = (part1 < static_cast<int>(types.size())) ? types[part1] : "X"; - std::string partx2 = (part2 < static_cast<int>(types.size())) ? types[part2] : "X"; - const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, false); - const auto& rr = hgdc.rangeRLayer(layer, true); - auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); - std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV - << "," << type2 << ", " << partx1 << ":" << partx2 << ":" << part1 << ":" << part2 << ", " << rotn1 - << ":" << rotn2 << ", " << partOK2 << ") at (" << std::setprecision(4) << xy.first << ", " - << xy.second << ", " << hgdc.waferZ(layer, true) << ") failure flag " << partOK << ":" << rotnOK - << " with " << points.size() << " points:"; - for (auto point : points) - std::cout << " " << point; - std::cout << " in the region " << rr.first << ":" << rr.second << std::endl; + if ((verbosity_ > 0) || (!partOK2)) { + std::string partx1 = (part1 < static_cast<int>(types.size())) ? types[part1] : "X"; + std::string partx2 = (part2 < static_cast<int>(types.size())) ? types[part2] : "X"; + const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, false); + const auto& rr = hgdc.rangeRLayer(layer, true); + auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); + auto rpos = getCorners(xy.first, xy.second, delX, delY); + std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV + << "," << type2 << ", " << partx1 << ":" << partx2 << ":" << part1 << ":" << part2 << ", " << rotn1 + << ":" << rotn2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " + << hgdc.waferZ(layer, true) << ") failure flag " << partOK << ":" << rotnOK << " with " + << points.size() << " points:"; + for (auto point : points) + std::cout << " " << point; + std::cout << " in the region " << rr.first << ":" << rr.second << " Corners"; + for (auto point : rpos) + std::cout << " " << point; + std::cout << std::endl; + } } } } - std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR - << ") mismatch in partial|orientation among " << allX << " wafers with the same indices" << std::endl; + std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR << ") mismatch in partial|orientation among " << allX << " wafers with the same indices" << std::endl; for (int k = 0; k < layers; ++k) { if ((wrongP[k] > 0) || (wrongR[k] > 0)) - std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] << ":" << wrongR[k] - << std::endl; + std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] << ":" << wrongR[k] << std::endl; } std::cout << std::endl; } @@ -236,14 +245,14 @@ std::vector<std::string> HGCalWaferInFileTest::getPoints( iok *= base; } } - if (verbosity_ > 0) + if (verbosity_ > 1) std::cout << "I/p " << layer << ":" << waferU << ":" << waferV << ":" << xpos << ":" << ypos << ":" << delX << ":" << delY << ":" << rin << ":" << rout << " Corners " << ncor << " iok " << iok << std::endl; static const int parts = 3; static const std::string c1[parts] = {"A1", "A2", "A3"}; - double dx1[parts] = {0.25 * delX, 0.50 * delX, 0.75 * delX}; - double dy1[parts] = {-0.875 * delY, -0.75 * delY, -0.625 * delY}; + double dx1[parts] = {0.225 * delX, 0.50 * delX, 0.775 * delX}; + double dy1[parts] = {-0.8875 * delY, -0.75 * delY, -0.6125 * delY}; if ((((iok / 10000) % 10) == 1) && (((iok / 100000) % 10) == 0)) { for (int k = 0; k < parts; ++k) { double xc1 = xpos + dx1[k]; @@ -270,7 +279,7 @@ std::vector<std::string> HGCalWaferInFileTest::getPoints( static const std::string c2[parts] = {"B1", "B2", "B3"}; double dx2[parts] = {delX, delX, delX}; - double dy2[parts] = {-0.5 * delY, 0.0, 0.5 * delY}; + double dy2[parts] = {-0.275 * delY, 0.0, 0.275 * delY}; if ((((iok / 1000) % 10) == 1) && (((iok / 10000) % 10) == 0)) { for (int k = 0; k < parts; ++k) { double xc1 = xpos + dx2[k]; @@ -296,8 +305,8 @@ std::vector<std::string> HGCalWaferInFileTest::getPoints( } static const std::string c3[parts] = {"C1", "C2", "C3"}; - double dx3[parts] = {0.75 * delX, 0.50 * delX, 0.25 * delX}; - double dy3[parts] = {0.625 * delY, 0.75 * delY, 0.875 * delY}; + double dx3[parts] = {0.775 * delX, 0.50 * delX, 0.225 * delX}; + double dy3[parts] = {0.6125 * delY, 0.75 * delY, 0.8875 * delY}; if ((((iok / 100) % 10) == 1) && (((iok / 1000) % 10) == 0)) { for (int k = 0; k < parts; ++k) { double xc1 = xpos + dx3[k]; @@ -323,8 +332,8 @@ std::vector<std::string> HGCalWaferInFileTest::getPoints( } static const std::string c4[parts] = {"D1", "D2", "D3"}; - double dx4[parts] = {-0.25 * delX, -0.50 * delX, -0.75 * delX}; - double dy4[parts] = {0.875 * delY, 0.75 * delY, 0.625 * delY}; + double dx4[parts] = {-0.225 * delX, -0.50 * delX, -0.775 * delX}; + double dy4[parts] = {0.8875 * delY, 0.75 * delY, 0.6125 * delY}; if ((((iok / 10) % 10) == 1) && (((iok / 100) % 10) == 0)) { for (int k = 0; k < parts; ++k) { double xc1 = xpos + dx4[k]; @@ -351,7 +360,7 @@ std::vector<std::string> HGCalWaferInFileTest::getPoints( static const std::string c5[parts] = {"E1", "E2", "E3"}; double dx5[parts] = {-delX, -delX, -delX}; - double dy5[parts] = {0.5 * delY, 0.0, -0.5 * delY}; + double dy5[parts] = {0.275 * delY, 0.0, -0.275 * delY}; if ((((iok / 1) % 10) == 1) && (((iok / 10) % 10) == 0)) { for (int k = 0; k < parts; ++k) { double xc1 = xpos + dx5[k]; @@ -377,8 +386,8 @@ std::vector<std::string> HGCalWaferInFileTest::getPoints( } static const std::string c6[parts] = {"F1", "F2", "F3"}; - double dx6[parts] = {-0.75 * delX, -0.50 * delX, -0.25 * delX}; - double dy6[parts] = {-0.625 * delY, -0.75 * delY, -0.875 * delY}; + double dx6[parts] = {-0.775 * delX, -0.50 * delX, -0.225 * delX}; + double dy6[parts] = {-0.6125 * delY, -0.75 * delY, -0.8875 * delY}; if ((((iok / 100000) % 10) == 1) && (((iok / 1) % 10) == 0)) { for (int k = 0; k < parts; ++k) { double xc1 = xpos + dx6[k]; @@ -406,5 +415,19 @@ std::vector<std::string> HGCalWaferInFileTest::getPoints( return points; } +std::vector<double> HGCalWaferInFileTest::getCorners(double xpos, double ypos, double delX, double delY) { + std::vector<double> points; + static const int corners = 6; + double dx0[corners] = {0.0, delX, delX, 0.0, -delX, -delX}; + double dy0[corners] = {-delY, -0.5 * delY, 0.5 * delY, delY, 0.5 * delY, -0.5 * delY}; + for (int k = 0; k < corners; ++k) { + double xc = xpos + dx0[k]; + double yc = ypos + dy0[k]; + double rpos = sqrt(xc * xc + yc * yc); + points.emplace_back(rpos); + } + return points; +} + // define this as a plug-in DEFINE_FWK_MODULE(HGCalWaferInFileTest); From 5ef8093e7a40c8c71e69feae4637030e0c4c48ff Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 18:57:32 +0200 Subject: [PATCH 750/778] Code check --- .../HGCalGeometry/test/HGCGeomAnalyzer.cc | 2 +- .../test/HGCalWaferInFileTest.cc | 54 ++++++++++--------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Geometry/HGCalGeometry/test/HGCGeomAnalyzer.cc b/Geometry/HGCalGeometry/test/HGCGeomAnalyzer.cc index 9248e53d199d7..c42231184521a 100644 --- a/Geometry/HGCalGeometry/test/HGCGeomAnalyzer.cc +++ b/Geometry/HGCalGeometry/test/HGCGeomAnalyzer.cc @@ -79,7 +79,7 @@ void HGCGeomAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &e boundaries.open(txtFileName_); //get geometry - const CaloGeometry* caloGeom = &es.getData(geomToken_); + const CaloGeometry *caloGeom = &es.getData(geomToken_); std::vector<DetId::Detector> dets = {DetId::HGCalEE, DetId::HGCalHSi, DetId::HGCalHSc}; for (const auto &d : dets) { diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc index 50b7f7fdca30d..a50215995f4fa 100644 --- a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc @@ -105,16 +105,16 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, true); const auto& rr = hgdc.rangeRLayer(layer, true); auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); - auto rpos = getCorners(xy.first, xy.second, delX, delY); + auto rpos = getCorners(xy.first, xy.second, delX, delY); std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << ", " << typex << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " << hgdc.waferZ(layer, true) << ") not present with " << points.size() << " points:"; for (auto point : points) std::cout << " " << point; std::cout << " in the region " << rr.first << ":" << rr.second << " Corners"; - for (auto point : rpos) - std::cout << " " << point; - std::cout << std::endl; + for (auto point : rpos) + std::cout << " " << point; + std::cout << std::endl; ++bad1; if ((layer - layerf) < layers) ++miss[layer - layerf]; @@ -174,7 +174,7 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet int rotn2 = hgdc.waferTypeRotation(id.layer(), id.waferU(), id.waferV(), false, false).second; bool partOK = ((part1 == part2) || ((part1 == HGCalTypes::WaferFull) && (part2 == HGCalTypes::WaferOut))); bool rotnOK = ((rotn1 == rotn2) || (part1 == HGCalTypes::WaferFull) || (part2 == HGCalTypes::WaferFull)); - bool partOK2 = (partOK) || (part2 < part1); + bool partOK2 = (partOK) || (part2 < part1); if (!partOK) { ++badP; if ((layer - layerf) < layers) @@ -192,32 +192,34 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet } if ((!partOK) || (!rotnOK)) { ++badG; - if ((verbosity_ > 0) || (!partOK2)) { - std::string partx1 = (part1 < static_cast<int>(types.size())) ? types[part1] : "X"; - std::string partx2 = (part2 < static_cast<int>(types.size())) ? types[part2] : "X"; - const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, false); - const auto& rr = hgdc.rangeRLayer(layer, true); - auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); - auto rpos = getCorners(xy.first, xy.second, delX, delY); - std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV - << "," << type2 << ", " << partx1 << ":" << partx2 << ":" << part1 << ":" << part2 << ", " << rotn1 - << ":" << rotn2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " - << hgdc.waferZ(layer, true) << ") failure flag " << partOK << ":" << rotnOK << " with " - << points.size() << " points:"; - for (auto point : points) - std::cout << " " << point; - std::cout << " in the region " << rr.first << ":" << rr.second << " Corners"; - for (auto point : rpos) - std::cout << " " << point; - std::cout << std::endl; - } + if ((verbosity_ > 0) || (!partOK2)) { + std::string partx1 = (part1 < static_cast<int>(types.size())) ? types[part1] : "X"; + std::string partx2 = (part2 < static_cast<int>(types.size())) ? types[part2] : "X"; + const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, false); + const auto& rr = hgdc.rangeRLayer(layer, true); + auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); + auto rpos = getCorners(xy.first, xy.second, delX, delY); + std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV + << "," << type2 << ", " << partx1 << ":" << partx2 << ":" << part1 << ":" << part2 << ", " + << rotn1 << ":" << rotn2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second + << ", " << hgdc.waferZ(layer, true) << ") failure flag " << partOK << ":" << rotnOK << " with " + << points.size() << " points:"; + for (auto point : points) + std::cout << " " << point; + std::cout << " in the region " << rr.first << ":" << rr.second << " Corners"; + for (auto point : rpos) + std::cout << " " << point; + std::cout << std::endl; + } } } } - std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR << ") mismatch in partial|orientation among " << allX << " wafers with the same indices" << std::endl; + std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR + << ") mismatch in partial|orientation among " << allX << " wafers with the same indices" << std::endl; for (int k = 0; k < layers; ++k) { if ((wrongP[k] > 0) || (wrongR[k] > 0)) - std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] << ":" << wrongR[k] << std::endl; + std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] << ":" << wrongR[k] + << std::endl; } std::cout << std::endl; } From e909dd327a0125e29ee21f354bda35ad1bd27160 Mon Sep 17 00:00:00 2001 From: Fabio Cossutti <fabio.cossutti@ts.infn.it> Date: Tue, 20 Oct 2020 19:16:36 +0200 Subject: [PATCH 751/778] scram b code-format --- Geometry/Records/interface/IdealGeometryRecord.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Geometry/Records/interface/IdealGeometryRecord.h b/Geometry/Records/interface/IdealGeometryRecord.h index e97e6a1270c24..c3a991e6f0d86 100644 --- a/Geometry/Records/interface/IdealGeometryRecord.h +++ b/Geometry/Records/interface/IdealGeometryRecord.h @@ -22,8 +22,7 @@ #include "Geometry/Records/interface/GeometryFileRcd.h" #include "FWCore/Utilities/interface/mplVector.h" -class IdealGeometryRecord : public edm::eventsetup::DependentRecordImplementation< - IdealGeometryRecord, - edm::mpl::Vector<GeometryFileRcd> > {}; +class IdealGeometryRecord + : public edm::eventsetup::DependentRecordImplementation<IdealGeometryRecord, edm::mpl::Vector<GeometryFileRcd> > {}; #endif /* RECORDS_IDEALGEOMETRYRECORD_H */ From 7f4ea153b62ebc1fb908f632e31a890733de2cfd Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 22:21:37 +0200 Subject: [PATCH 752/778] Use Carl's suggestions --- CondFormats/GeometryObjects/interface/MuonOffsetMap.h | 4 ++-- Geometry/MuonNumbering/src/GEMNumberingScheme.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CondFormats/GeometryObjects/interface/MuonOffsetMap.h b/CondFormats/GeometryObjects/interface/MuonOffsetMap.h index c9e1ea63986b9..afdf129671e60 100644 --- a/CondFormats/GeometryObjects/interface/MuonOffsetMap.h +++ b/CondFormats/GeometryObjects/interface/MuonOffsetMap.h @@ -8,8 +8,8 @@ class MuonOffsetMap { public: - MuonOffsetMap() {} - ~MuonOffsetMap() {} + MuonOffsetMap() = default; + ~MuonOffsetMap() = default; std::unordered_map<std::string, std::pair<int, int> > muonMap_; diff --git a/Geometry/MuonNumbering/src/GEMNumberingScheme.cc b/Geometry/MuonNumbering/src/GEMNumberingScheme.cc index 7df97c764d654..41cb4c5d4f22e 100644 --- a/Geometry/MuonNumbering/src/GEMNumberingScheme.cc +++ b/Geometry/MuonNumbering/src/GEMNumberingScheme.cc @@ -35,7 +35,7 @@ int GEMNumberingScheme::baseNumberToUnitNumber(const MuonBaseNumber& num) const #ifdef EDM_ML_DEBUG if (levels != theRollLevel) edm::LogVerbatim("GEMNumberingScheme") << "MuonGEMNumberingScheme::BNToUN: BaseNumber has " << num.getLevels() - << " levels, need at least till " << theRingLevel; + << " levels, need at least till " << theRollLevel; #endif int region(GEMDetId::minRegionId), ring(GEMDetId::minRingId); From d89b13e838ed72bed7ad15cf53fb757823277ea7 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Wed, 21 Oct 2020 05:48:51 +0900 Subject: [PATCH 753/778] reduced warnings to 1 per FED --- DataFormats/GEMDigi/interface/AMC13Event.h | 12 ++- .../plugins/GEMDigiToRawModule.cc | 19 +--- .../plugins/GEMRawToDigiModule.cc | 86 +++++++++---------- EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc | 7 -- 4 files changed, 54 insertions(+), 70 deletions(-) diff --git a/DataFormats/GEMDigi/interface/AMC13Event.h b/DataFormats/GEMDigi/interface/AMC13Event.h index 3e44aba5b28be..6ccfe5d991189 100644 --- a/DataFormats/GEMDigi/interface/AMC13Event.h +++ b/DataFormats/GEMDigi/interface/AMC13Event.h @@ -39,9 +39,15 @@ namespace gem { union CDFTrailer { uint64_t word; struct { - uint64_t tts : 8; // tts (first 4 bits) - uint64_t evtStat : 4; // event status - uint64_t crcCDF : 20; // CDF crc (first 16 bits) + uint64_t res1 : 2; + uint64_t crcModified : 1; + uint64_t moreTrailers : 1; + uint64_t tts : 4; // tts + uint64_t evtStat : 4; // event status + uint64_t res2 : 2; + uint64_t slinkError : 1; + uint64_t wrongFedId : 1; + uint64_t crcCDF : 16; // CDF crc uint64_t evtLength : 24; // event length uint64_t eventType : 4; // Event Type uint64_t cbA : 4; // 0xA diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 32d8035987e33..036c2f8170b89 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -103,8 +103,6 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve int LV1_id = iEvent.id().event(); int BX_id = iEvent.bunchCrossing(); int OrN = iEvent.orbitNumber(); - LogDebug("GEMDigiToRawModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() - << " orbitNumber:" << iEvent.orbitNumber(); // making map of bx GEMDigiCollection // each bx will be saved as new AMC13Event, so GEMDigiCollection needs to be split into bx @@ -175,10 +173,9 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve else msData |= 1UL << (chMap.chNum - 64); - LogDebug("GEMDigiToRawModule") - << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) - << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId - << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); + LogDebug("") << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) + << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId + << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); } if (!hasDigi) @@ -186,8 +183,6 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // only make vfat with hits amcSize += 3; auto vfatData = std::make_unique<VFATdata>(geb_dc.vfatVer, bc, 0, vfatId, lsData, msData); - LogDebug("GEMDigiToRawModule") - << "VFAT bx:" << bc << " bx:" << int(vfatData->bc()) << " orbitNumber:" << iEvent.orbitNumber(); gebData->addVFAT(*vfatData); } @@ -206,7 +201,6 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve amcData->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); amcData->setAMCheader2(amcNum, OrN, 1); amcData->setGEMeventHeader(amcData->gebs()->size(), 0); - LogDebug("GEMDigiToRawModule") << "davCnt: " << int(amcData->davCnt()); amc13Event->addAMCpayload(*amcData); // AMC header in AMC13Event amc13Event->addAMCheader(amcSize, 0, amcNum, 0); @@ -224,13 +218,8 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve amc13Event->setAMC13Trailer(BX_id, LV1_id, BX_id); //CDF trailer uint32_t EvtLength = amc13EvtLength + 4; // 2 header and 2 trailer - LogDebug("GEMDigiToRawModule") << " EvtLength: " << int(EvtLength); amc13Event->setCDFTrailer(EvtLength); - LogDebug("GEMDigiToRawModule") << "getAMCpayloads: " << amc13Event->getAMCpayloads()->size(); - LogDebug("GEMDigiToRawModule") << " nAMC: " << int(amc13Event->nAMC()) << " LV1_id: " << int(LV1_id) - << " BX_id: " << int(BX_id); - amc13Events.emplace_back(std::move(amc13Event)); } // finished making amc13Event data } // end of FED loop @@ -277,7 +266,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve for (const auto& word : words) { *(w++) = word; } - LogDebug("GEMDigiToRawModule") << " words " << words.size(); + LogDebug("") << " words " << words.size(); } iEvent.put(std::move(fedRawDataCol)); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index b41b7cb7e5d6f..c38953816623d 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -115,19 +115,17 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve const FEDRawData& fedData = fed_buffers->FEDData(fedId); int nWords = fedData.size() / sizeof(uint64_t); - LogDebug("GEMRawToDigiModule") << "fedId:" << fedId << " words: " << nWords; + LogDebug("") << "fedId:" << fedId << " words: " << nWords; if (nWords < 5) continue; // trailer checks FEDTrailer trailer(fedData.data() + fedData.size() - FEDTrailer::length); - if (not trailer.check()) { - edm::LogWarning("GEMRawToDigiModule") << " FED trailer check failed\n"; - } - if (trailer.fragmentLength() * sizeof(uint64_t) != fedData.size()) { - edm::LogWarning("GEMRawToDigiModule") << " FED fragment size mismatch: " << trailer.fragmentLength() - << " (fragment length) vs " << nWords << " (data size) words\n"; + + bool failTrailerCheck = false, failTrailerMatch = false; + if (!trailer.check() || (trailer.fragmentLength() * sizeof(uint64_t) != fedData.size())) { + failTrailerCheck = true; } const unsigned char* data = fedData.data(); @@ -135,38 +133,34 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); if (amc13Event == nullptr) { - LogDebug("GEMRawToDigiModule") << "amc13Event FAILED to unpack"; + LogDebug("") << "AMC13Event FAILED to be produced"; continue; } - if (gemRawToDigi_->amcError() || gemRawToDigi_->vfatError()) { - edm::LogWarning("GEMRawToDigiModule") - << " amcError:" << gemRawToDigi_->amcError() << " vfatError:" << gemRawToDigi_->vfatError(); - } - // compare trailers - if (amc13Event->fragmentLength() != trailer.fragmentLength()) { - edm::LogWarning("GEMRawToDigiModule") << " fragmentLength mismatch"; - } - if (amc13Event->crc() != trailer.crc()) { - edm::LogWarning("GEMRawToDigiModule") << " crc mismatch"; - } - if (amc13Event->evtStatus() != trailer.evtStatus()) { - edm::LogWarning("GEMRawToDigiModule") << " evtStatus mismatch"; - } - if (amc13Event->ttsBits() != trailer.ttsBits()) { - edm::LogWarning("GEMRawToDigiModule") << " ttsBits mismatch"; + + // compare trailers found by last word of fedData.size() and gemRawToDigi + // caused by error in no. of AMC, GEB or VFAT stored in FEDs + if ((amc13Event->fragmentLength() != trailer.fragmentLength()) || (amc13Event->crc() != trailer.crc())) + failTrailerMatch = true; + + LogDebug("") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() + << " orbitNumber:" << iEvent.orbitNumber(); + LogDebug("") << "AMC13 bx:" << amc13Event->bxId() << " lv1Id:" << int(amc13Event->lv1Id()) + << " orbitNumber:" << amc13Event->orbitNumber(); + + if (failTrailerCheck || failTrailerMatch) { + // best to skip these events since FED is most likely corrupt + edm::LogWarning("") << "FED trailer: fail check? " << failTrailerCheck << " fail match? " << failTrailerMatch; + continue; } - LogDebug("GEMRawToDigiModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() - << " orbitNumber:" << iEvent.orbitNumber(); - LogDebug("GEMRawToDigiModule") << "AMC13 bx:" << amc13Event->bxId() << " lv1Id:" << int(amc13Event->lv1Id()) - << " orbitNumber:" << amc13Event->orbitNumber(); + bool unknownChamber = false, unknownVFat = false, badVfat = false; // Read AMC data for (auto amcData : *(amc13Event->getAMCpayloads())) { uint16_t amcBx = amcData.bx(); uint8_t amcNum = amcData.amcNum(); - LogDebug("GEMRawToDigiModule") << "AMC no.:" << int(amcData.amcNum()) << " bx:" << int(amcData.bx()) - << " lv1Id:" << int(amcData.l1A()) << " orbitNumber:" << int(amcData.orbitNum()); + LogDebug("") << "AMC no.:" << int(amcData.amcNum()) << " bx:" << int(amcData.bx()) + << " lv1Id:" << int(amcData.l1A()) << " orbitNumber:" << int(amcData.orbitNum()); // Read GEB data for (auto gebData : *amcData.gebs()) { @@ -175,13 +169,13 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // check if Chamber exists. if (!gemROMap->isValidChamber(geb_ec)) { - edm::LogWarning("GEMRawToDigiModule") << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId); + unknownChamber = true; + LogDebug("") << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId); continue; } GEMROMapping::chamDC geb_dc = gemROMap->chamberPos(geb_ec); GEMDetId gemChId = geb_dc.detId; - LogDebug("GEMRawToDigiModule") << "GEB bx:" << int(gebData.bcOH()) << " lv1Id:" << int(gebData.ecOH()); //Read vfat data for (auto vfatData : *gebData.vFATs()) { @@ -191,20 +185,19 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // check if ChipID exists. if (!gemROMap->isValidChipID(vfat_ec)) { - edm::LogWarning("GEMRawToDigiModule") - << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId) << " vfatId " << int(vfatId) - << " vfat Pos " << int(vfatData.position()); + unknownVFat = true; + LogDebug("") << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId) << " vfatId " << int(vfatId) + << " vfat Pos " << int(vfatData.position()); continue; } // check vfat data if (vfatData.quality()) { - edm::LogWarning("GEMRawToDigiModule") - << "Quality " << int(vfatData.quality()) << " b1010 " << int(vfatData.b1010()) << " b1100 " - << int(vfatData.b1100()) << " b1110 " << int(vfatData.b1110()); + badVfat = true; + LogDebug("") << "Quality " << int(vfatData.quality()) << " b1010 " << int(vfatData.b1010()) << " b1100 " + << int(vfatData.b1100()) << " b1110 " << int(vfatData.b1110()); if (vfatData.crc() != vfatData.checkCRC()) { - edm::LogWarning("GEMRawToDigiModule") - << "DIFFERENT CRC :" << vfatData.crc() << " " << vfatData.checkCRC(); + LogDebug("") << "DIFFERENT CRC :" << vfatData.crc() << " " << vfatData.checkCRC(); } } @@ -232,11 +225,9 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve GEMDigi digi(stripId, bx); - LogDebug("GEMRawToDigiModule") << "VFATbx:" << int(vfatData.bc()) << " lv1Id:" << int(vfatData.ec()); - LogDebug("GEMRawToDigiModule") - << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) << " vfat:" << vfat_dc.localPhi - << ",type: " << vfat_dc.vfatType << " id:" << gemId << " ch:" << chMap.chNum << " st:" << digi.strip() - << " bx:" << digi.bx(); + LogDebug("") << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) + << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId + << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); outGEMDigis.get()->insertDigi(gemId, digi); @@ -267,6 +258,11 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve outAMC13Event.get()->insertDigi(amc13Event->bxId(), AMC13Event(*amc13Event)); } + if (unknownChamber || unknownVFat || badVfat) { + edm::LogWarning("") << "unpacking error: unknown Chamber " << unknownChamber << " unknown VFat " << unknownVFat + << " bad VFat " << badVfat; + } + } // end of amc13Event iEvent.put(std::move(outGEMDigis)); diff --git a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc index 623cfa82494d3..c906553669b57 100644 --- a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc +++ b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc @@ -16,7 +16,6 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t amc13Event->setAMC13Header(*(++word)); // Readout out AMC headers - LogDebug("GEMRawToDigi") << "nAMC: " << int(amc13Event->nAMC()); for (uint8_t i = 0; i < amc13Event->nAMC(); ++i) amc13Event->addAMCheader(*(++word)); @@ -27,13 +26,11 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t amcData.setAMCheader2(*(++word)); amcData.setGEMeventHeader(*(++word)); - LogDebug("GEMRawToDigi") << "davCnt: " << int(amcData.davCnt()); // Fill GEB for (uint8_t j = 0; j < amcData.davCnt(); ++j) { auto gebData = GEBdata(); gebData.setChamberHeader(*(++word)); - LogDebug("GEMRawToDigi") << "vfatWordCnt: " << int(gebData.vfatWordCnt()); // Fill vfat for (uint16_t k = 0; k < gebData.vfatWordCnt() / 3; k++) { auto vfatData = VFATdata(); @@ -47,8 +44,6 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t gebData.setChamberTrailer(*(++word)); if (gebData.vfatWordCnt() != gebData.vfatWordCntT()) { vfatError_ = true; - edm::LogWarning("GEMRawToDigi") << "VFAT word count mismatch between header:" << gebData.vfatWordCnt() - << " and trailer:" << gebData.vfatWordCntT(); } amcData.addGEB(gebData); @@ -58,8 +53,6 @@ std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t amcData.setAMCTrailer(*(++word)); if (amc13Event->getAMCsize(i) != amcData.dataLength()) { amcError_ = true; - edm::LogWarning("GEMRawToDigi") << "AMC size mismatch - AMC13:" << int(amc13Event->getAMCsize(i)) - << " AMC:" << int(amcData.dataLength()); } amc13Event->addAMCpayload(amcData); From b301e10ae0b40bb54112a00de9e2de8750067235 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 22:49:44 +0200 Subject: [PATCH 754/778] Use Carl's suggestions --- Geometry/MuonNumbering/interface/MuonOffsetFromDD.h | 2 +- Geometry/MuonNumbering/src/MuonOffsetFromDD.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h index 34fb7d35e7522..848300cd345fe 100644 --- a/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h +++ b/Geometry/MuonNumbering/interface/MuonOffsetFromDD.h @@ -19,7 +19,7 @@ class MuonOffsetFromDD { bool build(const cms::DDCompactView*, MuonOffsetMap&); private: - bool buildParameters(const MuonOffsetMap&); + bool debugParameters(const MuonOffsetMap&); int getNumber(const std::string&, const DDsvalues_type&); const std::vector<std::string> specpars_; const unsigned int nset_; diff --git a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc index f60e15c52153c..847f7fa643b26 100644 --- a/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc +++ b/Geometry/MuonNumbering/src/MuonOffsetFromDD.cc @@ -38,7 +38,7 @@ bool MuonOffsetFromDD::build(const DDCompactView* cpv, MuonOffsetMap& php) { dodet = fv.next(); } } - return this->buildParameters(php); + return this->debugParameters(php); } bool MuonOffsetFromDD::build(const cms::DDCompactView* cpv, MuonOffsetMap& php) { @@ -65,10 +65,10 @@ bool MuonOffsetFromDD::build(const cms::DDCompactView* cpv, MuonOffsetMap& php) php.muonMap_[name] = std::make_pair(offsets[k], tags[k]); } } - return this->buildParameters(php); + return this->debugParameters(php); } -bool MuonOffsetFromDD::buildParameters(const MuonOffsetMap& php) { +bool MuonOffsetFromDD::debugParameters(const MuonOffsetMap& php) { edm::LogVerbatim("MuonGeom") << "MuonOffsetFromDD: Finds " << php.muonMap_.size() << " entries in the map"; #ifdef EDM_ML_DEBUG unsigned int k(0); From 057332518b60cd2dbb2c93a41277b242dddf1a95 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Tue, 20 Oct 2020 22:49:54 +0200 Subject: [PATCH 755/778] clean up filter test and merge specifics --- .../DDCMS/src/DDFilteredView.cc | 103 +++++++++--------- .../DDCMS/test/Filter.cppunit.cc | 15 ++- 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 747d7ff827614..32d632dbd57e8 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -156,81 +156,79 @@ void DDFilteredView::rot(dd4hep::Rotation3D& matrixOut) const { rotation[8]); } -void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specs) { +void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specPars) { currentSpecPar_ = nullptr; - if (!filters_.empty()) { filters_.clear(); filters_.shrink_to_fit(); } - for (const auto& i : specs) { - for (const auto& j : i.second->paths) { - auto const& firstTok = front(j); - auto const& filter = find_if(begin(filters_), end(filters_), [&](auto const& f) { - auto const& k = find_if(begin(f->skeys), end(f->skeys), [&](auto const& p) { return firstTok == p; }); - if (k != end(f->skeys)) { - currentFilter_ = f.get(); + + Filter* currentFilter = nullptr; + for (const auto& section : specPars) { + for (const auto& partSelector : section.second->paths) { + auto const& firstPartName = front(partSelector); + auto const& filterMatch = find_if(begin(filters_), end(filters_), [&](auto const& it) { + auto const& key = + find_if(begin(it->skeys), end(it->skeys), [&](auto const& partName) { return firstPartName == partName; }); + if (key != end(it->skeys)) { + currentFilter = it.get(); return true; } return false; }); - if (filter == end(filters_)) { - bool isRegex = dd4hep::dd::isRegex(firstTok); + if (filterMatch == end(filters_)) { filters_.emplace_back(make_unique<Filter>()); - filters_.back()->isRegex.emplace_back(isRegex); - filters_.back()->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(firstTok)); - if (isRegex) { + filters_.back()->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(firstPartName)); + if (dd4hep::dd::isRegex(firstPartName)) { + filters_.back()->isRegex.emplace_back(true); filters_.back()->index.emplace_back(filters_.back()->keys.size()); - filters_.back()->keys.emplace_back(std::regex(begin(firstTok), end(firstTok))); + filters_.back()->keys.emplace_back(std::regex(std::begin(firstPartName), std::end(firstPartName))); } else { + filters_.back()->isRegex.emplace_back(false); filters_.back()->index.emplace_back(filters_.back()->skeys.size()); } - filters_.back()->skeys.emplace_back(firstTok); + filters_.back()->skeys.emplace_back(firstPartName); filters_.back()->up = nullptr; - filters_.back()->spec = i.second; - - // initialize current filter if it's empty - if (currentFilter_ == nullptr) { - currentFilter_ = filters_.back().get(); - } + filters_.back()->next = nullptr; + filters_.back()->spec = section.second; + currentFilter = filters_.back().get(); } // all next levels - vector<string_view> toks = split(j, "/"); + vector<string_view> toks = split(partSelector, "/"); for (size_t pos = 1; pos < toks.size(); ++pos) { - if (currentFilter_->next != nullptr) { - currentFilter_ = currentFilter_->next.get(); - auto const& l = find_if(begin(currentFilter_->skeys), end(currentFilter_->skeys), [&](auto const& p) { - return toks.front() == p; - }); - if (l == end(currentFilter_->skeys)) { - bool isRegex = dd4hep::dd::isRegex(toks[pos]); - currentFilter_->isRegex.emplace_back(isRegex); - currentFilter_->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); - if (isRegex) { - currentFilter_->index.emplace_back(currentFilter_->keys.size()); - currentFilter_->keys.emplace_back(std::regex(std::begin(toks[pos]), std::end(toks[pos]))); + if (currentFilter->next != nullptr) { + currentFilter = currentFilter->next.get(); + auto const& key = find_if( + begin(currentFilter->skeys), end(currentFilter->skeys), [&](auto const& p) { return toks[pos] == p; }); + if (key == end(currentFilter->skeys)) { + currentFilter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + if (dd4hep::dd::isRegex(toks[pos])) { + currentFilter->isRegex.emplace_back(true); + currentFilter->index.emplace_back(currentFilter->keys.size()); + currentFilter->keys.emplace_back(std::regex(std::begin(toks[pos]), std::end(toks[pos]))); } else { - currentFilter_->index.emplace_back(currentFilter_->skeys.size()); + currentFilter->isRegex.emplace_back(false); + currentFilter->index.emplace_back(currentFilter->skeys.size()); } - currentFilter_->skeys.emplace_back(toks[pos]); + currentFilter->skeys.emplace_back(toks[pos]); } } else { - auto filter = std::make_unique<Filter>(); + auto nextLevelFilter = std::make_unique<Filter>(); bool isRegex = dd4hep::dd::isRegex(toks[pos]); - filter->isRegex.emplace_back(isRegex); - filter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + nextLevelFilter->isRegex.emplace_back(isRegex); + nextLevelFilter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); if (isRegex) { - filter->index.emplace_back(filters_.back()->keys.size()); - filter->keys.emplace_back(std::regex(toks[pos].begin(), toks[pos].end())); + nextLevelFilter->index.emplace_back(filters_.back()->keys.size()); + nextLevelFilter->keys.emplace_back(std::regex(toks[pos].begin(), toks[pos].end())); } else { - filter->index.emplace_back(filters_.back()->skeys.size()); + nextLevelFilter->index.emplace_back(filters_.back()->skeys.size()); } - filter->skeys.emplace_back(toks.front()); - filter->next = nullptr; - filter->up = currentFilter_; - filter->spec = i.second; + nextLevelFilter->skeys.emplace_back(toks[pos]); + nextLevelFilter->next = nullptr; + nextLevelFilter->up = currentFilter; + nextLevelFilter->spec = section.second; - currentFilter_->next = std::move(filter); + currentFilter->next = std::move(nextLevelFilter); } } } @@ -248,15 +246,16 @@ void print(const Filter* filter) { void DDFilteredView::printFilter() const { for (const auto& f : filters_) { edm::LogVerbatim("Geometry").log([&](auto& log) { + log << "\nFilter: "; for (const auto& it : f->skeys) { log << it << ", "; } if (f->next) { - log << "Next:\n"; + log << "\nNext: "; print(&*f->next); } if (f->up) { - log << "Up:\n"; + log << "Up: "; print(f->up); } }); @@ -853,7 +852,9 @@ double DDFilteredView::getNextValue(const std::string& key) const { return result; } -std::string_view DDFilteredView::name() const { return (volume().volume().name()); } +std::string_view DDFilteredView::name() const { + return (node_ == nullptr ? std::string_view() : (volume().volume().name())); +} dd4hep::Solid DDFilteredView::solid() const { return (volume().volume().solid()); } diff --git a/DetectorDescription/DDCMS/test/Filter.cppunit.cc b/DetectorDescription/DDCMS/test/Filter.cppunit.cc index 46d88476d8814..c82f6f698220f 100644 --- a/DetectorDescription/DDCMS/test/Filter.cppunit.cc +++ b/DetectorDescription/DDCMS/test/Filter.cppunit.cc @@ -41,7 +41,6 @@ void testFilter::setUp() { for (const auto& i : selections) { vector<string_view> toks = split(i, "/"); - unique_ptr<Filter> f = nullptr; auto const& filter = find_if(begin(filters_), end(filters_), [&](auto const& f) { auto const& k = find_if(begin(f->skeys), end(f->skeys), [&](auto const& p) { return toks.front() == p; }); if (k != end(f->skeys)) { @@ -73,16 +72,16 @@ void testFilter::setUp() { auto const& l = find_if( begin(currentFilter->skeys), end(currentFilter->skeys), [&](auto const& p) { return toks[pos] == p; }); if (l == end(currentFilter->skeys)) { - bool isRegex = dd4hep::dd::isRegex(toks.front()); + bool isRegex = dd4hep::dd::isRegex(toks[pos]); currentFilter->isRegex.emplace_back(isRegex); - currentFilter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks.front())); + currentFilter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); if (isRegex) { currentFilter->index.emplace_back(currentFilter->keys.size()); - currentFilter->keys.emplace_back(std::regex(std::begin(toks.front()), std::end(toks.front()))); + currentFilter->keys.emplace_back(std::regex(std::begin(toks[pos]), std::end(toks[pos]))); } else { currentFilter->index.emplace_back(currentFilter->skeys.size()); } - currentFilter->skeys.emplace_back(toks.front()); + currentFilter->skeys.emplace_back(toks[pos]); } } else { auto filter = std::make_unique<Filter>(); @@ -95,7 +94,7 @@ void testFilter::setUp() { } else { filter->index.emplace_back(filters_.back()->skeys.size()); } - filter->skeys.emplace_back(toks.front()); + filter->skeys.emplace_back(toks[pos]); filter->next = nullptr; filter->up = currentFilter; @@ -116,6 +115,10 @@ void testFilter::checkFilter() { for (auto const& i : filters_) { current = i.get(); do { + for (auto const& i : current->skeys) { + std::cout << i << ", "; + } + std::cout << "\n"; current = current->next.get(); } while (current != nullptr); } From 652bcdb62ecdc0cc51ebd59fa4df2d05910f9c97 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 23:03:19 +0200 Subject: [PATCH 756/778] Made changes to RecAnalyzerMinBias as suggested by Chris --- .../plugins/HcalIsoTrkAnalyzer.cc | 7 -- .../plugins/RecAnalyzerMinbias.cc | 113 +++++++++--------- 2 files changed, 56 insertions(+), 64 deletions(-) diff --git a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc index 45f187e06de5d..bc2df68b91d82 100644 --- a/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc +++ b/Calibration/HcalCalibAlgos/plugins/HcalIsoTrkAnalyzer.cc @@ -323,13 +323,6 @@ HcalIsoTrkAnalyzer::HcalIsoTrkAnalyzer(const edm::ParameterSet& iConfig) << edm::InputTag(modnam, labelEE_, prdnam) << " " << edm::InputTag(modnam, labelHBHE_, prdnam) << " " << labelTower_; } - edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> tok_bFieldH_; - edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> tok_ecalChStatus_; - edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> tok_sevlv_; - edm::ESGetToken<CaloGeometry, CaloGeometryRecord> tok_geom_; - edm::ESGetToken<CaloTopology, CaloTopologyRecord> tok_caloTopology_; - edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> tok_htopo_; - edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> tok_resp_; tok_ddrec_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>(); tok_bFieldH_ = esConsumes<MagneticField, IdealMagneticFieldRecord>(); diff --git a/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc b/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc index cf2fb3cfe165d..35b62250a8e88 100644 --- a/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc @@ -122,6 +122,7 @@ class RecAnalyzerMinbias : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm: edm::EDGetTokenT<HFDigiCollection> tok_hfdigi_; edm::EDGetTokenT<QIE10DigiCollection> tok_qie10digi_; edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> tok_gtRec_; + edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> tok_htopo_; }; // constructors and destructor @@ -162,6 +163,8 @@ RecAnalyzerMinbias::RecAnalyzerMinbias(const edm::ParameterSet& iConfig) : init_ tok_qie10digi_ = consumes<QIE10DigiCollection>(iConfig.getParameter<edm::InputTag>("hcalDigiCollectionTag")); tok_gtRec_ = consumes<L1GlobalTriggerReadoutRecord>(edm::InputTag("gtDigisAlCaMB")); + tok_htopo_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>(); + // Read correction factors std::ifstream infile(cfile.c_str()); if (!infile.is_open()) { @@ -350,63 +353,59 @@ void RecAnalyzerMinbias::beginRun(edm::Run const&, edm::EventSetup const& iS) { if (!init_) { init_ = true; if (fillHist_) { - edm::ESHandle<HcalTopology> htopo; - iS.get<IdealGeometryRecord>().get(htopo); - if (htopo.isValid()) { - const HcalTopology* hcaltopology = htopo.product(); - - char name[700], title[700]; - // For HB - int maxDepthHB = hcaltopology->maxDepthHB(); - int nbinHB = (Noise_) ? 18 : int(2000 * eHighHB_); - double x_min = (Noise_) ? -3. : 0.; - double x_max = (Noise_) ? 3. : 2. * eHighHB_; - for (int eta = -50; eta < 50; eta++) { - for (int phi = 0; phi < 100; phi++) { - for (int depth = 1; depth <= maxDepthHB; depth++) { - HcalDetId cell(HcalBarrel, eta, phi, depth); - if (hcaltopology->valid(cell)) { - sprintf(name, "HBeta%dphi%ddep%d", eta, phi, depth); - sprintf(title, "HB #eta %d #phi %d depth %d", eta, phi, depth); - TH1D* h = fs_->make<TH1D>(name, title, nbinHB, x_min, x_max); - histHC_[cell] = h; - } - } - } - } - // For HE - int maxDepthHE = hcaltopology->maxDepthHE(); - int nbinHE = (Noise_) ? 18 : int(2000 * eHighHE_); - x_min = (Noise_) ? -3. : 0.; - x_max = (Noise_) ? 3. : 2. * eHighHE_; - for (int eta = -50; eta < 50; eta++) { - for (int phi = 0; phi < 100; phi++) { - for (int depth = 1; depth <= maxDepthHE; depth++) { - HcalDetId cell(HcalEndcap, eta, phi, depth); - if (hcaltopology->valid(cell)) { - sprintf(name, "HEeta%dphi%ddep%d", eta, phi, depth); - sprintf(title, "HE #eta %d #phi %d depth %d", eta, phi, depth); - TH1D* h = fs_->make<TH1D>(name, title, nbinHE, x_min, x_max); - histHC_[cell] = h; - } - } - } - } - // For HF - int maxDepthHF = 4; - int nbinHF = (Noise_) ? 200 : int(2000 * eHighHF_); - x_min = (Noise_) ? -10. : 0.; - x_max = (Noise_) ? 10. : 2. * eHighHF_; - for (int eta = -50; eta < 50; eta++) { - for (int phi = 0; phi < 100; phi++) { - for (int depth = 1; depth <= maxDepthHF; depth++) { - HcalDetId cell(HcalForward, eta, phi, depth); - if (hcaltopology->valid(cell)) { - sprintf(name, "HFeta%dphi%ddep%d", eta, phi, depth); - sprintf(title, "Energy (HF #eta %d #phi %d depth %d)", eta, phi, depth); - TH1D* h = fs_->make<TH1D>(name, title, nbinHF, x_min, x_max); - histHC_[cell] = h; - } + const HcalTopology* hcaltopology = &iS.getData(tok_htopo_); + + char name[700], title[700]; + // For HB + int maxDepthHB = hcaltopology->maxDepthHB(); + int nbinHB = (Noise_) ? 18 : int(2000 * eHighHB_); + double x_min = (Noise_) ? -3. : 0.; + double x_max = (Noise_) ? 3. : 2. * eHighHB_; + for (int eta = -50; eta < 50; eta++) { + for (int phi = 0; phi < 100; phi++) { + for (int depth = 1; depth <= maxDepthHB; depth++) { + HcalDetId cell(HcalBarrel, eta, phi, depth); + if (hcaltopology->valid(cell)) { + sprintf(name, "HBeta%dphi%ddep%d", eta, phi, depth); + sprintf(title, "HB #eta %d #phi %d depth %d", eta, phi, depth); + TH1D* h = fs_->make<TH1D>(name, title, nbinHB, x_min, x_max); + histHC_[cell] = h; + } + } + } + } + // For HE + int maxDepthHE = hcaltopology->maxDepthHE(); + int nbinHE = (Noise_) ? 18 : int(2000 * eHighHE_); + x_min = (Noise_) ? -3. : 0.; + x_max = (Noise_) ? 3. : 2. * eHighHE_; + for (int eta = -50; eta < 50; eta++) { + for (int phi = 0; phi < 100; phi++) { + for (int depth = 1; depth <= maxDepthHE; depth++) { + HcalDetId cell(HcalEndcap, eta, phi, depth); + if (hcaltopology->valid(cell)) { + sprintf(name, "HEeta%dphi%ddep%d", eta, phi, depth); + sprintf(title, "HE #eta %d #phi %d depth %d", eta, phi, depth); + TH1D* h = fs_->make<TH1D>(name, title, nbinHE, x_min, x_max); + histHC_[cell] = h; + } + } + } + } + // For HF + int maxDepthHF = 4; + int nbinHF = (Noise_) ? 200 : int(2000 * eHighHF_); + x_min = (Noise_) ? -10. : 0.; + x_max = (Noise_) ? 10. : 2. * eHighHF_; + for (int eta = -50; eta < 50; eta++) { + for (int phi = 0; phi < 100; phi++) { + for (int depth = 1; depth <= maxDepthHF; depth++) { + HcalDetId cell(HcalForward, eta, phi, depth); + if (hcaltopology->valid(cell)) { + sprintf(name, "HFeta%dphi%ddep%d", eta, phi, depth); + sprintf(title, "Energy (HF #eta %d #phi %d depth %d)", eta, phi, depth); + TH1D* h = fs_->make<TH1D>(name, title, nbinHF, x_min, x_max); + histHC_[cell] = h; } } } From 2e686d15c131020726602a2257987cf46e2fa9f2 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Tue, 20 Oct 2020 23:17:20 +0200 Subject: [PATCH 757/778] Code check --- .../plugins/RecAnalyzerMinbias.cc | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc b/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc index 35b62250a8e88..299dca6364470 100644 --- a/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc +++ b/Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc @@ -362,17 +362,17 @@ void RecAnalyzerMinbias::beginRun(edm::Run const&, edm::EventSetup const& iS) { double x_min = (Noise_) ? -3. : 0.; double x_max = (Noise_) ? 3. : 2. * eHighHB_; for (int eta = -50; eta < 50; eta++) { - for (int phi = 0; phi < 100; phi++) { - for (int depth = 1; depth <= maxDepthHB; depth++) { - HcalDetId cell(HcalBarrel, eta, phi, depth); - if (hcaltopology->valid(cell)) { - sprintf(name, "HBeta%dphi%ddep%d", eta, phi, depth); - sprintf(title, "HB #eta %d #phi %d depth %d", eta, phi, depth); - TH1D* h = fs_->make<TH1D>(name, title, nbinHB, x_min, x_max); - histHC_[cell] = h; - } - } - } + for (int phi = 0; phi < 100; phi++) { + for (int depth = 1; depth <= maxDepthHB; depth++) { + HcalDetId cell(HcalBarrel, eta, phi, depth); + if (hcaltopology->valid(cell)) { + sprintf(name, "HBeta%dphi%ddep%d", eta, phi, depth); + sprintf(title, "HB #eta %d #phi %d depth %d", eta, phi, depth); + TH1D* h = fs_->make<TH1D>(name, title, nbinHB, x_min, x_max); + histHC_[cell] = h; + } + } + } } // For HE int maxDepthHE = hcaltopology->maxDepthHE(); @@ -380,17 +380,17 @@ void RecAnalyzerMinbias::beginRun(edm::Run const&, edm::EventSetup const& iS) { x_min = (Noise_) ? -3. : 0.; x_max = (Noise_) ? 3. : 2. * eHighHE_; for (int eta = -50; eta < 50; eta++) { - for (int phi = 0; phi < 100; phi++) { - for (int depth = 1; depth <= maxDepthHE; depth++) { - HcalDetId cell(HcalEndcap, eta, phi, depth); - if (hcaltopology->valid(cell)) { - sprintf(name, "HEeta%dphi%ddep%d", eta, phi, depth); - sprintf(title, "HE #eta %d #phi %d depth %d", eta, phi, depth); - TH1D* h = fs_->make<TH1D>(name, title, nbinHE, x_min, x_max); - histHC_[cell] = h; - } - } - } + for (int phi = 0; phi < 100; phi++) { + for (int depth = 1; depth <= maxDepthHE; depth++) { + HcalDetId cell(HcalEndcap, eta, phi, depth); + if (hcaltopology->valid(cell)) { + sprintf(name, "HEeta%dphi%ddep%d", eta, phi, depth); + sprintf(title, "HE #eta %d #phi %d depth %d", eta, phi, depth); + TH1D* h = fs_->make<TH1D>(name, title, nbinHE, x_min, x_max); + histHC_[cell] = h; + } + } + } } // For HF int maxDepthHF = 4; @@ -398,14 +398,14 @@ void RecAnalyzerMinbias::beginRun(edm::Run const&, edm::EventSetup const& iS) { x_min = (Noise_) ? -10. : 0.; x_max = (Noise_) ? 10. : 2. * eHighHF_; for (int eta = -50; eta < 50; eta++) { - for (int phi = 0; phi < 100; phi++) { - for (int depth = 1; depth <= maxDepthHF; depth++) { - HcalDetId cell(HcalForward, eta, phi, depth); - if (hcaltopology->valid(cell)) { - sprintf(name, "HFeta%dphi%ddep%d", eta, phi, depth); - sprintf(title, "Energy (HF #eta %d #phi %d depth %d)", eta, phi, depth); - TH1D* h = fs_->make<TH1D>(name, title, nbinHF, x_min, x_max); - histHC_[cell] = h; + for (int phi = 0; phi < 100; phi++) { + for (int depth = 1; depth <= maxDepthHF; depth++) { + HcalDetId cell(HcalForward, eta, phi, depth); + if (hcaltopology->valid(cell)) { + sprintf(name, "HFeta%dphi%ddep%d", eta, phi, depth); + sprintf(title, "Energy (HF #eta %d #phi %d depth %d)", eta, phi, depth); + TH1D* h = fs_->make<TH1D>(name, title, nbinHF, x_min, x_max); + histHC_[cell] = h; } } } From c9b5e8ee7bf1440889e7028b2ff233c8d80fb492 Mon Sep 17 00:00:00 2001 From: Tamas <vami.tamas@wigner.mta.hu> Date: Fri, 16 Oct 2020 19:11:32 +0200 Subject: [PATCH 758/778] Putting the unit tests into one file Putting the unit tests into one file Minor fix Minor fix Minor Alternative way to reach the mapping file fix fix3 --- CondTools/SiPixel/data/phase2_T15_mapping.csv | 10 +++++----- CondTools/SiPixel/test/BuildFile.xml | 9 +-------- CondTools/SiPixel/test/createTestDBObjects.sh | 20 +++++++++++++++++++ CondTools/SiPixel/test/run_0T_BoR3.sh | 7 ------- .../SiPixel/test/run_Phase2cpeDBTest_v6.sh | 10 ---------- 5 files changed, 26 insertions(+), 30 deletions(-) create mode 100755 CondTools/SiPixel/test/createTestDBObjects.sh delete mode 100755 CondTools/SiPixel/test/run_0T_BoR3.sh delete mode 100644 CondTools/SiPixel/test/run_Phase2cpeDBTest_v6.sh diff --git a/CondTools/SiPixel/data/phase2_T15_mapping.csv b/CondTools/SiPixel/data/phase2_T15_mapping.csv index eb47031b39530..efa606afa5ff9 100644 --- a/CondTools/SiPixel/data/phase2_T15_mapping.csv +++ b/CondTools/SiPixel/data/phase2_T15_mapping.csv @@ -3,15 +3,15 @@ RULES,,,, BARREL,,,, ,,,, TEMPLATE ID ,LAYER,LADDER,MODULE, -1293,1,1-12,1-9, -1293,2,1-28,1-9, -1293,3,1-24,1-9, -1293,4,1-32,1-9, +2293,1,1-12,1-9, +2293,2,1-28,1-9, +2293,3,1-24,1-9, +2293,4,1-32,1-9, ,,,, ENDCAP,,,, ,,,, TEMPLATE ID ,DISK,BLADE,SIDE,PANEL -1295,1-12,1-05,1-2,1 +2295,1-12,1-05,1-2,1 ,,,, EXCEPTIONS,,,, ,,,, diff --git a/CondTools/SiPixel/test/BuildFile.xml b/CondTools/SiPixel/test/BuildFile.xml index 858d749d69126..1a39aaf3dda1f 100644 --- a/CondTools/SiPixel/test/BuildFile.xml +++ b/CondTools/SiPixel/test/BuildFile.xml @@ -14,14 +14,7 @@ </library> <environment> <bin file="testPixelDBs.cpp"> - <flags TEST_RUNNER_ARGS=" /bin/bash CondTools/SiPixel/test run_0T_BoR3.sh"/> - <use name="FWCore/Utilities"/> - </bin> -</environment> - -<environment> - <bin file="testPixelDBs.cpp"> - <flags TEST_RUNNER_ARGS=" /bin/bash CondTools/run_Phase2cpeDBTest_v6.sh"/> + <flags TEST_RUNNER_ARGS=" /bin/bash CondTools/SiPixel/test createTestDBObjects.sh"/> <use name="FWCore/Utilities"/> </bin> </environment> diff --git a/CondTools/SiPixel/test/createTestDBObjects.sh b/CondTools/SiPixel/test/createTestDBObjects.sh new file mode 100755 index 0000000000000..35eac65cd9c79 --- /dev/null +++ b/CondTools/SiPixel/test/createTestDBObjects.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +function die { echo $1: status $2 ; exit $2; } + +echo "TESTING Pixel CPE DB codes ..." + +echo "TESTING Pixel 1D Template DB code ..." +cmsRun ${LOCAL_TEST_DIR}/SiPixelTemplateDBObjectUploader_cfg.py MagField=0.0 Fullname=SiPixelTemplateDBObject_phase1_0T_mc_BoR3_v1_bugfix Map=${LOCAL_TEST_DIR}/../data/phaseI_mapping.csv TemplateFilePath=CalibTracker/SiPixelESProducers/data/SiPixelTemplateDBObject_0T_phase1_BoR3_v1 || die "Failure running SiPixelTemplateDBObjectUploader_cfg.py" $? + +echo "TESTING Pixel 1D GenErr DB code ..." +cmsRun ${LOCAL_TEST_DIR}/SiPixelGenErrorDBObjectUploader_cfg.py MagField=0.0 Fullname=SiPixelGenErrorDBObject_phase1_0T_mc_BoR3_v1_bugfix Map=${LOCAL_TEST_DIR}/../data/phaseI_mapping.csv GenErrFilePath=CalibTracker/SiPixelESProducers/data/SiPixelTemplateDBObject_0T_phase1_BoR3_v1 || die "Failure running SiPixelGenErrorDBObjectUploader_cfg.py" $? + +echo "TESTING Pixel 1D Template DB code for Phase-2 ..." +cmsRun ${LOCAL_TEST_DIR}/SiPixelTemplateDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=7 Append=mc_25x100 Map=${LOCAL_TEST_DIR}/../data/phase2_T15_mapping.csv geometry=T15 TemplateFilePath=CalibTracker/SiPixelESProducers/data/Phase2_25by100_templates_2020October || die "Failure running SiPixelTemplateDBObjectUploader_Phase2_cfg.py" $? + +echo "TESTING Pixel 1D GenErr DB code for Phase-2 ..." +cmsRun ${LOCAL_TEST_DIR}/SiPixelGenErrorDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=7 Append=mc_25x100 Map=${LOCAL_TEST_DIR}/../data/phase2_T15_mapping.csv geometry=T15 GenErrFilePath=CalibTracker/SiPixelESProducers/data/Phase2_25by100_templates_2020October || die "Failure running SiPixelGenErrorDBObjectUploader_Phase2_cfg.py" $? + +echo "TESTING Pixel 2D Template DB code for Phase-2 ..." +cmsRun ${LOCAL_TEST_DIR}/SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=7 Append=mc_25x100 Map=${LOCAL_TEST_DIR}/../data/phase2_T15_mapping.csv TemplateFilePath=CalibTracker/SiPixelESProducers/data/Phase2_25by100_templates_2020October denominator=True || die "Failure running SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py" $? diff --git a/CondTools/SiPixel/test/run_0T_BoR3.sh b/CondTools/SiPixel/test/run_0T_BoR3.sh deleted file mode 100755 index 01a4bf2c7b83e..0000000000000 --- a/CondTools/SiPixel/test/run_0T_BoR3.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -function die { echo $1: status $2 ; exit $2; } - -echo "TESTING Pixel CPE DB codes ..." -cmsRun ${LOCAL_TEST_DIR}/SiPixelTemplateDBObjectUploader_cfg.py MagField=0.0 Fullname=SiPixelTemplateDBObject_phase1_0T_mc_BoR3_v1_bugfix Map=${LOCAL_TEST_DIR}/../data/phaseI_mapping.csv TemplateFilePath=CalibTracker/SiPixelESProducers/data/SiPixelTemplateDBObject_0T_phase1_BoR3_v1 || die "Failure running SiPixelTemplateDBObjectUploader_cfg.py" $? -cmsRun ${LOCAL_TEST_DIR}/SiPixelGenErrorDBObjectUploader_cfg.py MagField=0.0 Fullname=SiPixelGenErrorDBObject_phase1_0T_mc_BoR3_v1_bugfix Map=${LOCAL_TEST_DIR}/../data/phaseI_mapping.csv GenErrFilePath=CalibTracker/SiPixelESProducers/data/SiPixelTemplateDBObject_0T_phase1_BoR3_v1 || die "Failure running SiPixelGenErrorDBObjectUploader_cfg.py" $? diff --git a/CondTools/SiPixel/test/run_Phase2cpeDBTest_v6.sh b/CondTools/SiPixel/test/run_Phase2cpeDBTest_v6.sh deleted file mode 100644 index e54086decfbd4..0000000000000 --- a/CondTools/SiPixel/test/run_Phase2cpeDBTest_v6.sh +++ /dev/null @@ -1,10 +0,0 @@ -function die { echo $1: status $2 ; exit $2; } - -echo "TESTING Pixel CPE DB codes (for Phase-2) ..." - -cmsRun ${LOCAL_TEST_DIR}/SiPixelTemplateDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=6 Append=mc_25x100 Map= ${LOCAL_TEST_DIR}/../data/phase2_T15_mapping.csv geometry=T15 TemplateFilePath= ${LOCAL_TEST_DIR}/CondTools/SiPixel/data/25by100_dual_slope_temps || die "Failure running SiPixelTemplateDBObjectUploader_cfg.py" $? - -cmsRun ${LOCAL_TEST_DIR}/SiPixelGenErrorDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=6 Append=mc_25x100 Map= ${LOCAL_TEST_DIR}/../data/phase2_T15_mapping.csv geometry=T15 GenErrFilePath= ${LOCAL_TEST_DIR}/CondTools/SiPixel/data/25by100_dual_slope_temps || die "Failure running SiPixelGenErrorDBObjectUploader_Phase2_cfg.py" $? - -#For 2D templates -cmsRun ${LOCAL_TEST_DIR}/SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py MagField=3.8 Version=7 Append=mc_25x100 Map= ${LOCAL_TEST_DIR}/../data/Phase2_25by100_templates_2020October/phase2_T15_mapping.csv TemplateFilePath= ${LOCAL_TEST_DIR}/CondTools/SiPixel/data/Phase2_25by100_templates_2020October denominator=True || die "Failure running SiPixel2DTemplateDBObjectUploader_Phase2_cfg.py" $? \ No newline at end of file From deaa6455dc7c7e1f754a787ceceb77b952efac1a Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Wed, 21 Oct 2020 17:13:41 +0900 Subject: [PATCH 759/778] added back edm::Log category strings --- .../plugins/GEMDigiToRawModule.cc | 9 ++-- .../plugins/GEMRawToDigiModule.cc | 43 ++++++++++--------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 036c2f8170b89..3c181e4315562 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -173,9 +173,10 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve else msData |= 1UL << (chMap.chNum - 64); - LogDebug("") << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) - << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId - << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); + LogDebug("GEMDigiToRawModule") + << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) + << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId + << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); } if (!hasDigi) @@ -266,7 +267,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve for (const auto& word : words) { *(w++) = word; } - LogDebug("") << " words " << words.size(); + LogDebug("GEMDigiToRawModule") << " words " << words.size(); } iEvent.put(std::move(fedRawDataCol)); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index c38953816623d..b409745e6c407 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -115,7 +115,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve const FEDRawData& fedData = fed_buffers->FEDData(fedId); int nWords = fedData.size() / sizeof(uint64_t); - LogDebug("") << "fedId:" << fedId << " words: " << nWords; + LogDebug("GEMRawToDigiModule") << "fedId:" << fedId << " words: " << nWords; if (nWords < 5) continue; @@ -133,7 +133,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve auto amc13Event = gemRawToDigi_->convertWordToAMC13Event(word); if (amc13Event == nullptr) { - LogDebug("") << "AMC13Event FAILED to be produced"; + LogDebug("GEMRawToDigiModule") << "AMC13Event FAILED to be produced"; continue; } @@ -142,14 +142,15 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve if ((amc13Event->fragmentLength() != trailer.fragmentLength()) || (amc13Event->crc() != trailer.crc())) failTrailerMatch = true; - LogDebug("") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() - << " orbitNumber:" << iEvent.orbitNumber(); - LogDebug("") << "AMC13 bx:" << amc13Event->bxId() << " lv1Id:" << int(amc13Event->lv1Id()) - << " orbitNumber:" << amc13Event->orbitNumber(); + LogDebug("GEMRawToDigiModule") << "Event bx:" << iEvent.bunchCrossing() << " lv1Id:" << iEvent.id().event() + << " orbitNumber:" << iEvent.orbitNumber(); + LogDebug("GEMRawToDigiModule") << "AMC13 bx:" << amc13Event->bxId() << " lv1Id:" << int(amc13Event->lv1Id()) + << " orbitNumber:" << amc13Event->orbitNumber(); if (failTrailerCheck || failTrailerMatch) { // best to skip these events since FED is most likely corrupt - edm::LogWarning("") << "FED trailer: fail check? " << failTrailerCheck << " fail match? " << failTrailerMatch; + edm::LogWarning("GEMRawToDigiModule") + << "FED trailer: fail check? " << failTrailerCheck << " fail match? " << failTrailerMatch; continue; } @@ -159,8 +160,8 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve for (auto amcData : *(amc13Event->getAMCpayloads())) { uint16_t amcBx = amcData.bx(); uint8_t amcNum = amcData.amcNum(); - LogDebug("") << "AMC no.:" << int(amcData.amcNum()) << " bx:" << int(amcData.bx()) - << " lv1Id:" << int(amcData.l1A()) << " orbitNumber:" << int(amcData.orbitNum()); + LogDebug("GEMRawToDigiModule") << "AMC no.:" << int(amcData.amcNum()) << " bx:" << int(amcData.bx()) + << " lv1Id:" << int(amcData.l1A()) << " orbitNumber:" << int(amcData.orbitNum()); // Read GEB data for (auto gebData : *amcData.gebs()) { @@ -170,7 +171,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // check if Chamber exists. if (!gemROMap->isValidChamber(geb_ec)) { unknownChamber = true; - LogDebug("") << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId); + LogDebug("GEMRawToDigiModule") << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId); continue; } @@ -186,18 +187,19 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // check if ChipID exists. if (!gemROMap->isValidChipID(vfat_ec)) { unknownVFat = true; - LogDebug("") << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId) << " vfatId " << int(vfatId) - << " vfat Pos " << int(vfatData.position()); + LogDebug("GEMRawToDigiModule") << "InValid: amcNum " << int(amcNum) << " gebId " << int(gebId) << " vfatId " + << int(vfatId) << " vfat Pos " << int(vfatData.position()); continue; } // check vfat data if (vfatData.quality()) { badVfat = true; - LogDebug("") << "Quality " << int(vfatData.quality()) << " b1010 " << int(vfatData.b1010()) << " b1100 " - << int(vfatData.b1100()) << " b1110 " << int(vfatData.b1110()); + LogDebug("GEMRawToDigiModule") + << "Quality " << int(vfatData.quality()) << " b1010 " << int(vfatData.b1010()) << " b1100 " + << int(vfatData.b1100()) << " b1110 " << int(vfatData.b1110()); if (vfatData.crc() != vfatData.checkCRC()) { - LogDebug("") << "DIFFERENT CRC :" << vfatData.crc() << " " << vfatData.checkCRC(); + LogDebug("GEMRawToDigiModule") << "DIFFERENT CRC :" << vfatData.crc() << " " << vfatData.checkCRC(); } } @@ -225,9 +227,10 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve GEMDigi digi(stripId, bx); - LogDebug("") << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) - << " vfat:" << vfat_dc.localPhi << ",type: " << vfat_dc.vfatType << " id:" << gemId - << " ch:" << chMap.chNum << " st:" << digi.strip() << " bx:" << digi.bx(); + LogDebug("GEMRawToDigiModule") + << " fed: " << fedId << " amc:" << int(amcNum) << " geb:" << int(gebId) << " vfat:" << vfat_dc.localPhi + << ",type: " << vfat_dc.vfatType << " id:" << gemId << " ch:" << chMap.chNum << " st:" << digi.strip() + << " bx:" << digi.bx(); outGEMDigis.get()->insertDigi(gemId, digi); @@ -259,8 +262,8 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } if (unknownChamber || unknownVFat || badVfat) { - edm::LogWarning("") << "unpacking error: unknown Chamber " << unknownChamber << " unknown VFat " << unknownVFat - << " bad VFat " << badVfat; + edm::LogWarning("GEMRawToDigiModule") << "unpacking error: unknown Chamber " << unknownChamber << " unknown VFat " + << unknownVFat << " bad VFat " << badVfat; } } // end of amc13Event From d4db28e6e0c432878bce7313c92e0e11eb25b2e7 Mon Sep 17 00:00:00 2001 From: Jeongeun Lee <jeongeun.lee@cern.ch> Date: Wed, 21 Oct 2020 12:28:32 +0200 Subject: [PATCH 760/778] drop type specs in RecoHGCal --- RecoHGCal/TICL/python/EMStep_cff.py | 10 +++++----- RecoHGCal/TICL/python/HADStep_cff.py | 2 +- RecoHGCal/TICL/python/MIPStep_cff.py | 10 +++++----- RecoHGCal/TICL/python/TrkStep_cff.py | 2 +- RecoHGCal/TICL/python/ticl_iterations.py | 17 ++++++++--------- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/RecoHGCal/TICL/python/EMStep_cff.py b/RecoHGCal/TICL/python/EMStep_cff.py index 4c69b86b98766..0c3a5b5c497f3 100644 --- a/RecoHGCal/TICL/python/EMStep_cff.py +++ b/RecoHGCal/TICL/python/EMStep_cff.py @@ -18,7 +18,7 @@ # CA - PATTERN RECOGNITION ticlTrackstersEM = _trackstersProducer.clone( - filtered_mask = cms.InputTag("filteredLayerClustersEM", "EM"), + filtered_mask = "filteredLayerClustersEM:EM", original_mask = 'ticlTrackstersTrk', seeding_regions = "ticlSeedingGlobal", filter_on_categories = [0, 1], @@ -46,7 +46,7 @@ filteredLayerClustersHFNoseEM = filteredLayerClustersEM.clone( LayerClusters = 'hgcalLayerClustersHFNose', - LayerClustersInputMask = cms.InputTag("hgcalLayerClustersHFNose","InitialLayerClustersMask"), + LayerClustersInputMask = "hgcalLayerClustersHFNose:InitialLayerClustersMask", iteration_label = "EMn", algo_number = 9 #no tracking mask for EM for now @@ -56,10 +56,10 @@ detector = "HFNose", layer_clusters = "hgcalLayerClustersHFNose", layer_clusters_hfnose_tiles = "ticlLayerTileHFNose", - original_mask = cms.InputTag("hgcalLayerClustersHFNose","InitialLayerClustersMask"), - filtered_mask = cms.InputTag("filteredLayerClustersHFNoseEM","EMn"), + original_mask = "hgcalLayerClustersHFNose:InitialLayerClustersMask", + filtered_mask = "filteredLayerClustersHFNoseEM:EMn", seeding_regions = "ticlSeedingGlobalHFNose", - time_layerclusters = cms.InputTag("hgcalLayerClustersHFNose","timeLayerCluster"), + time_layerclusters = "hgcalLayerClustersHFNose:timeLayerCluster", min_clusters_per_ntuplet = 6 ) diff --git a/RecoHGCal/TICL/python/HADStep_cff.py b/RecoHGCal/TICL/python/HADStep_cff.py index 9f4b726250c03..883f84412b22b 100644 --- a/RecoHGCal/TICL/python/HADStep_cff.py +++ b/RecoHGCal/TICL/python/HADStep_cff.py @@ -19,7 +19,7 @@ # CA - PATTERN RECOGNITION ticlTrackstersHAD = _trackstersProducer.clone( - filtered_mask = cms.InputTag("filteredLayerClustersHAD", "HAD"), + filtered_mask = "filteredLayerClustersHAD:HAD", original_mask = 'ticlTrackstersEM', seeding_regions = "ticlSeedingGlobal", # For the moment we mask everything w/o requirements since we are last diff --git a/RecoHGCal/TICL/python/MIPStep_cff.py b/RecoHGCal/TICL/python/MIPStep_cff.py index 203e28c0c8ae3..da90839a6b90f 100644 --- a/RecoHGCal/TICL/python/MIPStep_cff.py +++ b/RecoHGCal/TICL/python/MIPStep_cff.py @@ -18,7 +18,7 @@ # CA - PATTERN RECOGNITION ticlTrackstersMIP = _trackstersProducer.clone( - filtered_mask = cms.InputTag("filteredLayerClustersMIP", "MIP"), + filtered_mask = "filteredLayerClustersMIP:MIP", seeding_regions = "ticlSeedingGlobal", missing_layers = 3, min_clusters_per_ntuplet = 10, @@ -42,7 +42,7 @@ filteredLayerClustersHFNoseMIP = filteredLayerClustersMIP.clone( LayerClusters = 'hgcalLayerClustersHFNose', - LayerClustersInputMask = cms.InputTag("hgcalLayerClustersHFNose","InitialLayerClustersMask"), + LayerClustersInputMask = "hgcalLayerClustersHFNose:InitialLayerClustersMask", iteration_label = "MIPn", algo_number = 9 ) @@ -51,10 +51,10 @@ detector = "HFNose", layer_clusters = "hgcalLayerClustersHFNose", layer_clusters_hfnose_tiles = "ticlLayerTileHFNose", - original_mask = cms.InputTag("hgcalLayerClustersHFNose","InitialLayerClustersMask"), - filtered_mask = cms.InputTag("filteredLayerClustersHFNoseMIP","MIPn"), + original_mask = "hgcalLayerClustersHFNose:InitialLayerClustersMask", + filtered_mask = "filteredLayerClustersHFNoseMIP:MIPn", seeding_regions = "ticlSeedingGlobalHFNose", - time_layerclusters = cms.InputTag("hgcalLayerClustersHFNose","timeLayerCluster"), + time_layerclusters = "hgcalLayerClustersHFNose:timeLayerCluster", min_clusters_per_ntuplet = 6 ) diff --git a/RecoHGCal/TICL/python/TrkStep_cff.py b/RecoHGCal/TICL/python/TrkStep_cff.py index 686ea18b9032a..ce33a5eab880f 100644 --- a/RecoHGCal/TICL/python/TrkStep_cff.py +++ b/RecoHGCal/TICL/python/TrkStep_cff.py @@ -17,7 +17,7 @@ # CA - PATTERN RECOGNITION ticlTrackstersTrk = _trackstersProducer.clone( - filtered_mask = cms.InputTag("filteredLayerClustersTrk", "Trk"), + filtered_mask = "filteredLayerClustersTrk:Trk", seeding_regions = "ticlSeedingTrk", filter_on_categories = [2, 4], # filter muons and charged hadrons pid_threshold = 0.0, diff --git a/RecoHGCal/TICL/python/ticl_iterations.py b/RecoHGCal/TICL/python/ticl_iterations.py index 09bd7f9e27597..b36d459990c70 100644 --- a/RecoHGCal/TICL/python/ticl_iterations.py +++ b/RecoHGCal/TICL/python/ticl_iterations.py @@ -39,7 +39,7 @@ def TICL_iterations_withReco(process): ) process.trackstersTrk = trackstersProducer.clone( - filtered_mask = cms.InputTag("filteredLayerClustersTrk", "Trk"), + filtered_mask = "filteredLayerClustersTrk:Trk", seeding_regions = "ticlSeedingTrk", missing_layers = 3, min_clusters_per_ntuplet = 5, @@ -64,7 +64,7 @@ def TICL_iterations_withReco(process): ) process.trackstersMIP = trackstersProducer.clone( - filtered_mask = cms.InputTag("filteredLayerClustersMIP", "MIP"), + filtered_mask = "filteredLayerClustersMIP:MIP", seeding_regions = "ticlSeedingGlobal", missing_layers = 3, min_clusters_per_ntuplet = 15, @@ -89,7 +89,7 @@ def TICL_iterations_withReco(process): process.trackstersEM = trackstersProducer.clone( max_out_in_hops = 4, original_mask = "trackstersMIP", - filtered_mask = cms.InputTag("filteredLayerClusters", "algo8"), + filtered_mask = "filteredLayerClusters:algo8", seeding_regions = "ticlSeedingGlobal", missing_layers = 1, min_clusters_per_ntuplet = 10, @@ -103,7 +103,7 @@ def TICL_iterations_withReco(process): process.trackstersHAD = trackstersProducer.clone( - filtered_mask = cms.InputTag("filteredLayerClusters", "algo8"), + filtered_mask = "filteredLayerClusters:algo8", seeding_regions = "ticlSeedingGlobal", missing_layers = 2, min_clusters_per_ntuplet = 10, @@ -144,9 +144,8 @@ def TICL_iterations_withReco(process): process.hgcalValidation.insert(-1, process.ticlPFValidation) if getattr(process,'hgcalValidator'): - process.hgcalValidator.label_lcl = cms.InputTag("hgcalLayerClusters") - process.hgcalValidator.label_mcl = cms.VInputTag(cms.InputTag("multiClustersFromTrackstersEM", "MultiClustersFromTracksterByCA"), cms.InputTag("multiClustersFromTrackstersHAD", "MultiClustersFromTracksterByCA")) - + process.hgcalValidator.label_lcl = "hgcalLayerClusters" + process.hgcalValidator.label_mcl = ["multiClustersFromTrackstersEM:MultiClustersFromTracksterByCA", "multiClustersFromTrackstersHAD:MultiClustersFromTracksterByCA"] process.hgcalValidator.domulticlustersPlots = True return process @@ -171,7 +170,7 @@ def TICL_iterations(process): ) process.trackstersMIP = trackstersProducer.clone( - filtered_mask = cms.InputTag("filteredLayerClustersMIP", "MIP"), + filtered_mask = "filteredLayerClustersMIP:MIP", seeding_regions = "ticlSeedingGlobal", missing_layers = 3, min_clusters_per_ntuplet = 15, @@ -192,7 +191,7 @@ def TICL_iterations(process): process.tracksters = trackstersProducer.clone( original_mask = "trackstersMIP", - filtered_mask = cms.InputTag("filteredLayerClusters", "algo8"), + filtered_mask = "filteredLayerClusters:algo8", seeding_regions = "ticlSeedingGlobal", missing_layers = 2, min_clusters_per_ntuplet = 15, From 40d5957bfcabf90be17dbbc6d5070e1712bcaf2c Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 21 Oct 2020 16:03:53 +0200 Subject: [PATCH 761/778] Correct for preshower numbering scheme --- .../src/EcalBarrelNumberingScheme.cc | 51 ++++++++++++------- Geometry/EcalCommonData/src/EcalBaseNumber.cc | 2 +- .../src/EcalEndcapNumberingScheme.cc | 31 ++++++----- .../src/EcalPreshowerNumberingScheme.cc | 12 ++--- 4 files changed, 56 insertions(+), 40 deletions(-) diff --git a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc index 1ad4b4d32e394..7120bd6cb3404 100644 --- a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc @@ -27,7 +27,7 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) return 0; } - const std::string& cryName(baseNumber.getLevelName(0).substr(0, 7)); // name of crystal volume + const std::string& cryName(baseNumber.getLevelName(0).substr(0,7)); // name of crystal volume const int cryType(::atoi(cryName.c_str() + 5)); @@ -38,18 +38,30 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const uint32_t fawCopy(baseNumber.getCopyNumber(5 + off)); const uint32_t supmCopy(baseNumber.getCopyNumber(6 + off)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << nLevels << ", " << off << ", " << cryType << ", " << baseNumber.getLevelName(0) << ":" - << baseNumber.getCopyNumber(0) << ", " << baseNumber.getLevelName(1) << ":" - << baseNumber.getCopyNumber(1) << ", " << baseNumber.getLevelName(2) << ":" - << baseNumber.getCopyNumber(2) << ", " << baseNumber.getLevelName(3) << ":" - << baseNumber.getCopyNumber(3) << ", " << baseNumber.getLevelName(4) << ":" - << baseNumber.getCopyNumber(4) << ", " << baseNumber.getLevelName(5) << ":" - << baseNumber.getCopyNumber(5) << ", " << baseNumber.getLevelName(6) << ":" - << baseNumber.getCopyNumber(6) << ", " << baseNumber.getLevelName(7) << ":" - << baseNumber.getCopyNumber(7) << ", " << baseNumber.getLevelName(8) << ":" - << baseNumber.getCopyNumber(8) << ", " << baseNumber.getLevelName(9) << ":" - << baseNumber.getCopyNumber(9) << ", " << baseNumber.getLevelName(10) << ":" - << baseNumber.getCopyNumber(10); + edm::LogVerbatim("EcalGeom") << nLevels << ", " << off << ", " + << cryType << ", " + << baseNumber.getLevelName(0) << ":" + << baseNumber.getCopyNumber(0) << ", " + << baseNumber.getLevelName(1) << ":" + << baseNumber.getCopyNumber(1) << ", " + << baseNumber.getLevelName(2) << ":" + << baseNumber.getCopyNumber(2) << ", " + << baseNumber.getLevelName(3) << ":" + << baseNumber.getCopyNumber(3) << ", " + << baseNumber.getLevelName(4) << ":" + << baseNumber.getCopyNumber(4) << ", " + << baseNumber.getLevelName(5) << ":" + << baseNumber.getCopyNumber(5) << ", " + << baseNumber.getLevelName(6) << ":" + << baseNumber.getCopyNumber(6) << ", " + << baseNumber.getLevelName(7) << ":" + << baseNumber.getCopyNumber(7) << ", " + << baseNumber.getLevelName(8) << ":" + << baseNumber.getCopyNumber(8) << ", " + << baseNumber.getLevelName(9) << ":" + << baseNumber.getCopyNumber(9) << ", " + << baseNumber.getLevelName(10) << ":" + << baseNumber.getCopyNumber(10); #endif // error checking @@ -110,10 +122,15 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) */ #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "EcalBarrelNumberingScheme: " - << "supmCopy = " << supmCopy << ", fawCopy = " << fawCopy << ", hawCopy = " << hawCopy - << ", wallCopy = " << wallCopy << ", cryType = " << cryType - << "\n zsign = " << zsign << ", eta = " << eta << ", phi = " << phi - << ", packed index = 0x" << std::hex << intindex << std::dec; + << "supmCopy = " << supmCopy + << ", fawCopy = " << fawCopy + << ", hawCopy = " << hawCopy + << ", wallCopy = " << wallCopy + << ", cryType = " << cryType + << "\n zsign = " << zsign + << ", eta = " << eta + << ", phi = " << phi + << ", packed index = 0x" << std::hex << intindex << std::dec ; #endif return intindex; } diff --git a/Geometry/EcalCommonData/src/EcalBaseNumber.cc b/Geometry/EcalCommonData/src/EcalBaseNumber.cc index 80768c3344e02..1f6dc74e55b44 100644 --- a/Geometry/EcalCommonData/src/EcalBaseNumber.cc +++ b/Geometry/EcalCommonData/src/EcalBaseNumber.cc @@ -25,7 +25,7 @@ int EcalBaseNumber::getCopyNumber(int level) const { return _sortedCopyNumber[le int EcalBaseNumber::getCopyNumber(const std::string& levelName) const { for (int iLevel = 0; iLevel < _theLevels; iLevel++) { - if (_sortedName[iLevel] == levelName) { + if (_sortedName[iLevel].find(levelName) != std::string::npos) { return _sortedCopyNumber[iLevel]; } } diff --git a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc index e5ad868226cb0..67d7b1405356d 100644 --- a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc @@ -19,6 +19,8 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme geometry levels = " << nLevels; + for (uint32_t k = 0; k < nLevels; ++k) + edm::LogVerbatim("EcalGeom") << "[" << k << "] " << baseNumber.getLevelName(k) << ":" << baseNumber.getCopyNumber(k); #endif if (7 > nLevels) { edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " @@ -43,17 +45,18 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID: Null" << " pointer to alveole ! Use default id=1"; - int zside = baseNumber.getCopyNumber("EREG"); - zside = 2 * (1 - zside) + 1; + int zs = baseNumber.getCopyNumber("EREG"); + int zside = 2 * (1 - zs) + 1; int module_number = MVid; int crystal_number = PVid; uint32_t intindex = EEDetId(module_number, crystal_number, zside, EEDetId::SCCRYSTALMODE).rawId(); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zside - << " super crystal = " << module_number << " crystal = " << crystal_number - << " packed index = 0x" << std::hex << intindex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zs << ":" << zside + << " super crystal = " << module_number << " crystal = " + << crystal_number << " packed index = 0x" << std::hex + << intindex << std::dec; #endif return intindex; } else { @@ -79,50 +82,50 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) //*************************** ERROR CHECKING ********************************** if (0 > icx || 4 < icx || 0 > icy || 4 < icy) { - edm::LogWarning("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " + edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << "****************** Bad crystal number = " << ic << ", Volume Name = " << baseNumber.getLevelName(0); return 0; } if (0 > isx || 9 < isx || 0 > isy || 9 < isy) { - edm::LogWarning("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " + edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << "****************** Bad supercrystal number = " << is << ", Volume Name = " << baseNumber.getLevelName(3); return 0; } if (1 != iq && -1 != iq) { - edm::LogWarning("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " + edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << "****************** Bad quadrant number = " << iq << ", Volume Name = " << baseNumber.getLevelName(4); return 0; } if (1 != id && -1 != id) { - edm::LogWarning("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " + edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << "****************** Bad dee number = " << id << ", Volume Name = " << baseNumber.getLevelName(6); return 0; } if (-1 != iz && 1 != iz) { - edm::LogWarning("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " + edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << "****************** Bad z-end number = " << iz << ", Volume Name = " << baseNumber.getLevelName(8); return 0; } if (!EEDetId::validDetId(ix, iy, iz)) { - edm::LogWarning("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " + edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << "****************** Bad DetId numbers = " << ix << ", " << iy << ", " << iz; return 0; } #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EdalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << std::dec << ix << ", " << iy << ", " - << iq << ", " << id << ", " << iz << ", " << std::hex << idet << std::dec; - edm::LogVerbatim("EdalGeom") << "ECalEndcapNumberingScheme::EEDetId: " << EEDetId(idet); + edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << std::dec << ix << ", " << iy << ", " << iq << ", " << id << ", " << iz << ", " << std::hex << idet << std::dec; + edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme::EEDetId: " + << EEDetId(idet) ; #endif return idet; } diff --git a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc index 16fd5d6f8fd35..61cf27facb348 100644 --- a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc @@ -106,8 +106,8 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe } // Z index +Z = 1 ; -Z = 2 - int zside = baseNumber.getCopyNumber("EREG"); - zside = 2 * (1 - zside) + 1; + int zs = baseNumber.getCopyNumber("EREG"); + int zside = 2 * (1 - zs) + 1; // box number int box = baseNumber.getCopyNumber(2); @@ -414,14 +414,10 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe intIndex = ESDetId(strip, x, y, layer, zside).rawId(); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zside << " Ladd " << ladd - << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y - << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex - << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zs << ":" << zside << " Ladd " << ladd << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex << std::dec; for (int ich = 0; ich < level; ich++) - edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) - << " copy = " << baseNumber.getCopyNumber(ich); + edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) << " copy = " << baseNumber.getCopyNumber(ich); #endif } From b0ef5386d1936a61e6501e24948b2180c296d61c Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 21 Oct 2020 16:12:29 +0200 Subject: [PATCH 762/778] Code Check --- .../src/EcalBarrelNumberingScheme.cc | 51 +++++++------------ .../src/EcalEndcapNumberingScheme.cc | 16 +++--- .../src/EcalPreshowerNumberingScheme.cc | 8 ++- 3 files changed, 31 insertions(+), 44 deletions(-) diff --git a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc index 7120bd6cb3404..1ad4b4d32e394 100644 --- a/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalBarrelNumberingScheme.cc @@ -27,7 +27,7 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) return 0; } - const std::string& cryName(baseNumber.getLevelName(0).substr(0,7)); // name of crystal volume + const std::string& cryName(baseNumber.getLevelName(0).substr(0, 7)); // name of crystal volume const int cryType(::atoi(cryName.c_str() + 5)); @@ -38,30 +38,18 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const uint32_t fawCopy(baseNumber.getCopyNumber(5 + off)); const uint32_t supmCopy(baseNumber.getCopyNumber(6 + off)); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << nLevels << ", " << off << ", " - << cryType << ", " - << baseNumber.getLevelName(0) << ":" - << baseNumber.getCopyNumber(0) << ", " - << baseNumber.getLevelName(1) << ":" - << baseNumber.getCopyNumber(1) << ", " - << baseNumber.getLevelName(2) << ":" - << baseNumber.getCopyNumber(2) << ", " - << baseNumber.getLevelName(3) << ":" - << baseNumber.getCopyNumber(3) << ", " - << baseNumber.getLevelName(4) << ":" - << baseNumber.getCopyNumber(4) << ", " - << baseNumber.getLevelName(5) << ":" - << baseNumber.getCopyNumber(5) << ", " - << baseNumber.getLevelName(6) << ":" - << baseNumber.getCopyNumber(6) << ", " - << baseNumber.getLevelName(7) << ":" - << baseNumber.getCopyNumber(7) << ", " - << baseNumber.getLevelName(8) << ":" - << baseNumber.getCopyNumber(8) << ", " - << baseNumber.getLevelName(9) << ":" - << baseNumber.getCopyNumber(9) << ", " - << baseNumber.getLevelName(10) << ":" - << baseNumber.getCopyNumber(10); + edm::LogVerbatim("EcalGeom") << nLevels << ", " << off << ", " << cryType << ", " << baseNumber.getLevelName(0) << ":" + << baseNumber.getCopyNumber(0) << ", " << baseNumber.getLevelName(1) << ":" + << baseNumber.getCopyNumber(1) << ", " << baseNumber.getLevelName(2) << ":" + << baseNumber.getCopyNumber(2) << ", " << baseNumber.getLevelName(3) << ":" + << baseNumber.getCopyNumber(3) << ", " << baseNumber.getLevelName(4) << ":" + << baseNumber.getCopyNumber(4) << ", " << baseNumber.getLevelName(5) << ":" + << baseNumber.getCopyNumber(5) << ", " << baseNumber.getLevelName(6) << ":" + << baseNumber.getCopyNumber(6) << ", " << baseNumber.getLevelName(7) << ":" + << baseNumber.getCopyNumber(7) << ", " << baseNumber.getLevelName(8) << ":" + << baseNumber.getCopyNumber(8) << ", " << baseNumber.getLevelName(9) << ":" + << baseNumber.getCopyNumber(9) << ", " << baseNumber.getLevelName(10) << ":" + << baseNumber.getCopyNumber(10); #endif // error checking @@ -122,15 +110,10 @@ uint32_t EcalBarrelNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) */ #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "EcalBarrelNumberingScheme: " - << "supmCopy = " << supmCopy - << ", fawCopy = " << fawCopy - << ", hawCopy = " << hawCopy - << ", wallCopy = " << wallCopy - << ", cryType = " << cryType - << "\n zsign = " << zsign - << ", eta = " << eta - << ", phi = " << phi - << ", packed index = 0x" << std::hex << intindex << std::dec ; + << "supmCopy = " << supmCopy << ", fawCopy = " << fawCopy << ", hawCopy = " << hawCopy + << ", wallCopy = " << wallCopy << ", cryType = " << cryType + << "\n zsign = " << zsign << ", eta = " << eta << ", phi = " << phi + << ", packed index = 0x" << std::hex << intindex << std::dec; #endif return intindex; } diff --git a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc index 67d7b1405356d..bfc2064c51f20 100644 --- a/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalEndcapNumberingScheme.cc @@ -20,7 +20,8 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme geometry levels = " << nLevels; for (uint32_t k = 0; k < nLevels; ++k) - edm::LogVerbatim("EcalGeom") << "[" << k << "] " << baseNumber.getLevelName(k) << ":" << baseNumber.getCopyNumber(k); + edm::LogVerbatim("EcalGeom") << "[" << k << "] " << baseNumber.getLevelName(k) << ":" + << baseNumber.getCopyNumber(k); #endif if (7 > nLevels) { edm::LogWarning("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " @@ -53,10 +54,9 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) uint32_t intindex = EEDetId(module_number, crystal_number, zside, EEDetId::SCCRYSTALMODE).rawId(); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zs << ":" << zside - << " super crystal = " << module_number << " crystal = " - << crystal_number << " packed index = 0x" << std::hex - << intindex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalEndcapNumberingScheme: zside = " << zs << ":" << zside + << " super crystal = " << module_number << " crystal = " << crystal_number + << " packed index = 0x" << std::hex << intindex << std::dec; #endif return intindex; } else { @@ -123,9 +123,9 @@ uint32_t EcalEndcapNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) } #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << std::dec << ix << ", " << iy << ", " << iq << ", " << id << ", " << iz << ", " << std::hex << idet << std::dec; - edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme::EEDetId: " - << EEDetId(idet) ; + edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme::getUnitID(): " << std::dec << ix << ", " << iy << ", " + << iq << ", " << id << ", " << iz << ", " << std::hex << idet << std::dec; + edm::LogVerbatim("EcalGeom") << "ECalEndcapNumberingScheme::EEDetId: " << EEDetId(idet); #endif return idet; } diff --git a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc index 61cf27facb348..bf69ec37c850e 100644 --- a/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc +++ b/Geometry/EcalCommonData/src/EcalPreshowerNumberingScheme.cc @@ -414,10 +414,14 @@ uint32_t EcalPreshowerNumberingScheme::getUnitID(const EcalBaseNumber& baseNumbe intIndex = ESDetId(strip, x, y, layer, zside).rawId(); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zs << ":" << zside << " Ladd " << ladd << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex << std::dec; + edm::LogVerbatim("EcalGeom") << "EcalPreshowerNumberingScheme : zside " << zs << ":" << zside << " Ladd " << ladd + << " ladd_copy: " << ladd_copy << " box " << box << " x " << x << " y " << y + << " layer " << layer << " strip " << strip << " UnitID 0x" << std::hex << intIndex + << std::dec; for (int ich = 0; ich < level; ich++) - edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) << " copy = " << baseNumber.getCopyNumber(ich); + edm::LogVerbatim("EcalGeom") << "Name = " << baseNumber.getLevelName(ich) + << " copy = " << baseNumber.getCopyNumber(ich); #endif } From 99bc2aa2514234acae9940c1f6ec4434de497228 Mon Sep 17 00:00:00 2001 From: Sunanda <sunanda.banerjee@cern.ch> Date: Wed, 21 Oct 2020 16:13:32 +0200 Subject: [PATCH 763/778] Add a few sens.xml with expanded list of sensitive volumes --- Geometry/EcalSimData/data/ecalsensx.xml | 85 ++++++++++++++ Geometry/HcalCommonData/data/hcalsenspmfx.xml | 107 ++++++++++++++++++ Geometry/MuonSimData/data/v2/muonSensx.xml | 66 +++++++++++ 3 files changed, 258 insertions(+) create mode 100644 Geometry/EcalSimData/data/ecalsensx.xml create mode 100644 Geometry/HcalCommonData/data/hcalsenspmfx.xml create mode 100644 Geometry/MuonSimData/data/v2/muonSensx.xml diff --git a/Geometry/EcalSimData/data/ecalsensx.xml b/Geometry/EcalSimData/data/ecalsensx.xml new file mode 100644 index 0000000000000..983e0b6661449 --- /dev/null +++ b/Geometry/EcalSimData/data/ecalsensx.xml @@ -0,0 +1,85 @@ +<?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="ecal" eval="true"> + <SpecPar name="ecal_eb"> + <PartSelector path="//EBRY_01"/> + <PartSelector path="//EBRY_02"/> + <PartSelector path="//EBRY_03"/> + <PartSelector path="//EBRY_04"/> + <PartSelector path="//EBRY_05"/> + <PartSelector path="//EBRY_06"/> + <PartSelector path="//EBRY_07"/> + <PartSelector path="//EBRY_08"/> + <PartSelector path="//EBRY_09"/> + <PartSelector path="//EBRY_10"/> + <PartSelector path="//EBRY_11"/> + <PartSelector path="//EBRY_12"/> + <PartSelector path="//EBRY_13"/> + <PartSelector path="//EBRY_14"/> + <PartSelector path="//EBRY_15"/> + <PartSelector path="//EBRY_16"/> + <PartSelector path="//EBRY_17"/> + <PartSelector path="//EAPD_01"/> + <PartSelector path="//EAPD_02"/> + <PartSelector path="//EAPD_03"/> + <PartSelector path="//EAPD_04"/> + <PartSelector path="//EAPD_05"/> + <PartSelector path="//EAPD_06"/> + <PartSelector path="//EAPD_07"/> + <PartSelector path="//EAPD_08"/> + <PartSelector path="//EAPD_09"/> + <PartSelector path="//EAPD_10"/> + <PartSelector path="//EAPD_11"/> + <PartSelector path="//EAPD_12"/> + <PartSelector path="//EAPD_13"/> + <PartSelector path="//EAPD_14"/> + <PartSelector path="//EAPD_15"/> + <PartSelector path="//EAPD_16"/> + <PartSelector path="//EAPD_17"/> + <PartSelector path="//EATJ_01"/> + <PartSelector path="//EATJ_02"/> + <PartSelector path="//EATJ_03"/> + <PartSelector path="//EATJ_04"/> + <PartSelector path="//EATJ_05"/> + <PartSelector path="//EATJ_06"/> + <PartSelector path="//EATJ_07"/> + <PartSelector path="//EATJ_08"/> + <PartSelector path="//EATJ_09"/> + <PartSelector path="//EATJ_10"/> + <PartSelector path="//EATJ_11"/> + <PartSelector path="//EATJ_12"/> + <PartSelector path="//EATJ_13"/> + <PartSelector path="//EATJ_14"/> + <PartSelector path="//EATJ_15"/> + <PartSelector path="//EATJ_16"/> + <PartSelector path="//EATJ_17"/> + <Parameter name="SensitiveDetector" value="EcalSensitiveDetector" eval="false"/> + <Parameter name="ReadOutName" value="EcalHitsEB" eval="false"/> + <Parameter name="nxtalEta" value="85.0"/> + <Parameter name="PhiBaskets" value="18.0"/> + <Parameter name="nxtalPhi" value="360.0"/> + <Parameter name="EtaBaskets" value="25.0"/> + <Parameter name="EtaBaskets" value="45.0"/> + <Parameter name="EtaBaskets" value="65.0"/> + <Parameter name="EtaBaskets" value="85.0"/> + <Parameter name="EnergyWeight" value="1.0"/> + <Parameter name="Depth1Name" value="EAPD" eval="false"/> + <Parameter name="Depth2Name" value="EATJ" eval="false"/> + </SpecPar> + <SpecPar name="ecal_ee"> + <PartSelector path="//EFRY"/> + <Parameter name="SensitiveDetector" value="EcalSensitiveDetector" eval="false"/> + <Parameter name="ReadOutName" value="EcalHitsEE" eval="false"/> + <Parameter name="ncrys" value="25.0"/> + <Parameter name="nmods" value="316.0"/> + <Parameter name="EnergyWeight" value="1.0"/> + </SpecPar> + <SpecPar name="ecal_sf"> + <PartSelector path="//SFSX"/> + <PartSelector path="//SFSY"/> + <Parameter name="SensitiveDetector" value="EcalSensitiveDetector" eval="false"/> + <Parameter name="ReadOutName" value="EcalHitsES" eval="false"/> + <Parameter name="EnergyWeight" value="0.0"/> + </SpecPar> + </SpecParSection> +</DDDefinition> diff --git a/Geometry/HcalCommonData/data/hcalsenspmfx.xml b/Geometry/HcalCommonData/data/hcalsenspmfx.xml new file mode 100644 index 0000000000000..0e0a53ca02927 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalsenspmfx.xml @@ -0,0 +1,107 @@ +<?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="hcalsenspmf.xml" eval="true"> + <SpecPar name="hcal"> + <PartSelector path="//HBScintillatorLayer0In1"/> + <PartSelector path="//HBScintillatorLayer0In2"/> + <PartSelector path="//HBScintillatorLayer1In1"/> + <PartSelector path="//HBScintillatorLayer1In2"/> + <PartSelector path="//HBScintillatorLayer2In1"/> + <PartSelector path="//HBScintillatorLayer2In2"/> + <PartSelector path="//HBScintillatorLayer3In1"/> + <PartSelector path="//HBScintillatorLayer3In2"/> + <PartSelector path="//HBScintillatorLayer4In1"/> + <PartSelector path="//HBScintillatorLayer4In2"/> + <PartSelector path="//HBScintillatorLayer5In1"/> + <PartSelector path="//HBScintillatorLayer5In2"/> + <PartSelector path="//HBScintillatorLayer6In1"/> + <PartSelector path="//HBScintillatorLayer6In2"/> + <PartSelector path="//HBScintillatorLayer7In1"/> + <PartSelector path="//HBScintillatorLayer7In2"/> + <PartSelector path="//HBScintillatorLayer8In1"/> + <PartSelector path="//HBScintillatorLayer8In2"/> + <PartSelector path="//HBScintillatorLayer9In1"/> + <PartSelector path="//HBScintillatorLayer9In2"/> + <PartSelector path="//HBScintillatorLayer10In1"/> + <PartSelector path="//HBScintillatorLayer10In2"/> + <PartSelector path="//HBScintillatorLayer11In1"/> + <PartSelector path="//HBScintillatorLayer11In2"/> + <PartSelector path="//HBScintillatorLayer12In1"/> + <PartSelector path="//HBScintillatorLayer12In2"/> + <PartSelector path="//HBScintillatorLayer13In1"/> + <PartSelector path="//HBScintillatorLayer13In2"/> + <PartSelector path="//HBScintillatorLayer14In1"/> + <PartSelector path="//HBScintillatorLayer14In2"/> + <PartSelector path="//HBScintillatorLayer15In1"/> + <PartSelector path="//HBScintillatorLayer15In2"/> + <PartSelector path="//HBScintillatorLayer16In1"/> + <PartSelector path="//HBScintillatorLayer16In2"/> + <PartSelector path="//HEScintillatorPart0Layer00Phi0"/> + <PartSelector path="//HEScintillatorPart0Layer00Phi1"/> + <PartSelector path="//HEScintillatorPart1Layer00Phi0"/> + <PartSelector path="//HEScintillatorPart1Layer00Phi1"/> + <PartSelector path="//HEScintillatorPart2Layer01Phi0"/> + <PartSelector path="//HEScintillatorPart2Layer01Phi1"/> + <PartSelector path="//HEScintillatorPart3Layer02Phi0"/> + <PartSelector path="//HEScintillatorPart3Layer02Phi1"/> + <PartSelector path="//HEScintillatorPart3Layer03Phi0"/> + <PartSelector path="//HEScintillatorPart3Layer03Phi1"/> + <PartSelector path="//HEScintillatorPart3Layer04Phi0"/> + <PartSelector path="//HEScintillatorPart3Layer04Phi1"/> + <PartSelector path="//HEScintillatorPart3Layer05Phi0"/> + <PartSelector path="//HEScintillatorPart3Layer05Phi1"/> + <PartSelector path="//HEScintillatorPart3Layer06Phi0"/> + <PartSelector path="//HEScintillatorPart3Layer06Phi1"/> + <PartSelector path="//HEScintillatorPart4Layer07Phi0"/> + <PartSelector path="//HEScintillatorPart4Layer07Phi1"/> + <PartSelector path="//HEScintillatorPart4Layer08Phi0"/> + <PartSelector path="//HEScintillatorPart4Layer08Phi1"/> + <PartSelector path="//HEScintillatorPart4Layer09Phi0"/> + <PartSelector path="//HEScintillatorPart4Layer09Phi1"/> + <PartSelector path="//HEScintillatorPart4Layer10Phi0"/> + <PartSelector path="//HEScintillatorPart4Layer10Phi1"/> + <PartSelector path="//HEScintillatorPart4Layer11Phi0"/> + <PartSelector path="//HEScintillatorPart4Layer11Phi1"/> + <PartSelector path="//HEScintillatorPart4Layer12Phi0"/> + <PartSelector path="//HEScintillatorPart4Layer12Phi1"/> + <PartSelector path="//HEScintillatorPart5Layer13Phi0"/> + <PartSelector path="//HEScintillatorPart5Layer13Phi1"/> + <PartSelector path="//HEScintillatorPart5Layer14Phi0"/> + <PartSelector path="//HEScintillatorPart5Layer14Phi1"/> + <PartSelector path="//HEScintillatorPart5Layer15Phi0"/> + <PartSelector path="//HEScintillatorPart5Layer15Phi1"/> + <PartSelector path="//HEScintillatorPart5Layer16Phi0"/> + <PartSelector path="//HEScintillatorPart5Layer16Phi1"/> + <PartSelector path="//HEScintillatorPart5Layer17Phi0"/> + <PartSelector path="//HEScintillatorPart5Layer17Phi1"/> + <PartSelector path="//HEScintillatorPart5Layer18Phi0"/> + <PartSelector path="//HEScintillatorPart5Layer18Phi1"/> + <PartSelector path="//HTS0_T1"/> + <PartSelector path="//HTS0_T2"/> + <PartSelector path="//HTS0_T3"/> + <PartSelector path="//HTS0_T4"/> + <PartSelector path="//HTS0_T5"/> + <PartSelector path="//HTS0_T6"/> + <PartSelector path="//HTS1_T1"/> + <PartSelector path="//HTS1_T2"/> + <PartSelector path="//HTS1_T3"/> + <PartSelector path="//HTS1_T4"/> + <PartSelector path="//HTS1_T5"/> + <PartSelector path="//HTS1_T6"/> + <PartSelector path="//HTS1C_T1"/> + <PartSelector path="//HTS1C_T2"/> + <PartSelector path="//HTS1C_T3"/> + <PartSelector path="//HTS1C_T4"/> + <PartSelector path="//HTS1C_T5"/> + <PartSelector path="//HTS1C_T6"/> + <PartSelector path="//HVQX"/> + <PartSelector path="//VcalElecCathode"/> + <PartSelector path="//FibreBundle.*"/> + <PartSelector path="//VcalFibreBundleL.*"/> + <PartSelector path="//VcalFibreBundleR.*"/> + <Parameter name="SensitiveDetector" value="HcalSensitiveDetector" eval="false"/> + <Parameter name="ReadOutName" value="HcalHits" eval="false"/> + </SpecPar> + </SpecParSection> +</DDDefinition> diff --git a/Geometry/MuonSimData/data/v2/muonSensx.xml b/Geometry/MuonSimData/data/v2/muonSensx.xml new file mode 100644 index 0000000000000..dce13278f6326 --- /dev/null +++ b/Geometry/MuonSimData/data/v2/muonSensx.xml @@ -0,0 +1,66 @@ +<?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="muonsensitive"> + <SpecPar name="barrel"> + <PartSelector path="//MBSLPhiGas"/> + <PartSelector path="//MBChimSLPhiGas"/> + <PartSelector path="//MB1SLZGas"/> + <PartSelector path="//MB2SLZGas"/> + <PartSelector path="//MB3SLZGas"/> + <Parameter name="SensitiveDetector" value="MuonSensitiveDetector"/> + <Parameter name="ReadOutName" value="MuonDTHits"/> + </SpecPar> + <SpecPar name="rpc"> + <PartSelector path="//REB1"/> + <PartSelector path="//REB2"/> + <PartSelector path="//REB3"/> + <PartSelector path="//REC1"/> + <PartSelector path="//REC2"/> + <PartSelector path="//REC3"/> + <PartSelector path="//REE1"/> + <PartSelector path="//REE2"/> + <PartSelector path="//REE3"/> + <PartSelector path="//REF1"/> + <PartSelector path="//REF2"/> + <PartSelector path="//REF3"/> + <Parameter name="SensitiveDetector" value="MuonSensitiveDetector"/> + <Parameter name="ReadOutName" value="MuonRPCHits"/> + </SpecPar> + <SpecPar name="endcap"> + <PartSelector path="//ME11_ActiveGasVol"/> + <PartSelector path="//ME12_ActiveGasVol"/> + <PartSelector path="//ME13_ActiveGasVol"/> + <PartSelector path="//ME1A_ActiveGasVol"/> + <PartSelector path="//ME21_ActiveGasVol"/> + <PartSelector path="//ME22_ActiveGasVol"/> + <PartSelector path="//ME31_ActiveGasVol"/> + <PartSelector path="//ME32_ActiveGasVol"/> + <PartSelector path="//ME41_ActiveGasVol"/> + <PartSelector path="//ME42_ActiveGasVol"/> + <Parameter name="SensitiveDetector" value="MuonSensitiveDetector"/> + <Parameter name="ReadOutName" value="MuonCSCHits"/> + </SpecPar> + <SpecPar name="gem"> + <PartSelector path="//GHA101"/> + <PartSelector path="//GHA102"/> + <PartSelector path="//GHA103"/> + <PartSelector path="//GHA104"/> + <PartSelector path="//GHA105"/> + <PartSelector path="//GHA106"/> + <PartSelector path="//GHA107"/> + <PartSelector path="//GHA108"/> + <PartSelector path="//GHA109"/> + <PartSelector path="//GHA110"/> + <PartSelector path="//GHA111"/> + <PartSelector path="//GHA112"/> + <PartSelector path="//GHA113"/> + <PartSelector path="//GHA114"/> + <PartSelector path="//GHA115"/> + <PartSelector path="//GHA116"/> + <PartSelector path="//GHA117"/> + <PartSelector path="//GHA118"/> + <Parameter name="SensitiveDetector" value="MuonSensitiveDetector"/> + <Parameter name="ReadOutName" value="MuonGEMHits"/> + </SpecPar> + </SpecParSection> +</DDDefinition> From 383942ab67ec22f9c96582c77a7f95a1a93f4529 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Wed, 21 Oct 2020 16:47:00 +0200 Subject: [PATCH 764/778] re-introduce namespace in Ecal barrel --- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 478 +++++++++--------- 1 file changed, 244 insertions(+), 234 deletions(-) diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index 2bde367e6d15b..6f30a2a303c84 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -132,25 +132,25 @@ namespace { string name; // Capsule double here; // string mat; // - double xSize; // - double ySize; // - double thick; // + double xSizeHalf; // + double ySizeHalf; // + double thickHalf; // }; struct Ceramic { string name; // Ceramic string mat; // - double xSize; // - double ySize; // - double thick; // + double xSizeHalf; // + double ySizeHalf; // + double thickHalf; // }; struct BulkSilicon { string name; // Bulk Silicon string mat; // - double xSize; // - double ySize; // - double thick; // + double xSizeHalf; // + double ySizeHalf; // + double thickHalf; // }; struct APD { @@ -164,7 +164,7 @@ namespace { string atjName; // After-The-Junction string atjMat; // - double atjThick; // + double atjThickHalf; // string sglName; // APD-Silicone glue string sglMat; // @@ -201,9 +201,9 @@ namespace { string pipeName; // Cooling pipes double pipeHere; // string pipeMat; // - double pipeOD; // + double pipeODHalf; // double pipeID; // - VecDouble vecIlyPipeLength; // + VecDouble vecIlyPipeLengthHalf; // VecDouble vecIlyPipeType; // VecDouble vecIlyPipePhi; // VecDouble vecIlyPipeZ; // @@ -220,24 +220,24 @@ namespace { string fanOutName; // FanOut double fanOutHere; // string fanOutMat; // - double fanOutWidth; // - double fanOutLength; // + double fanOutWidthHalf; // + double fanOutLengthHalf; // double fanOutHeightHalf; // VecDouble vecIlyFanOutZ; // VecDouble vecIlyFanOutPhi; // string diffName; // Diffuser string diffMat; // double diffOff; // - double diffLength; // + double diffLengthHalf; // string bndlName; // Fiber bundle string bndlMat; // double bndlOff; // - double bndlLength; // + double bndlLengthHalf; // string fEMName; // FEM string fEMMat; // - double fEMWidth; // - double fEMLength; // - double fEMHeight; // + double fEMWidthHalf; // + double fEMLengthHalf; // + double fEMHeightHalf; // VecDouble vecIlyFEMZ; // VecDouble vecIlyFEMPhi; // }; @@ -422,14 +422,14 @@ namespace { string envName; // pincer envelope string envMat; // - double envWidth; // - double envHeight; // - double envLength; // + double envWidthHalf; // + double envHeightHalf; // + double envLengthHalf; // VecDouble vecEnvZOff; // string blkName; // pincer block string blkMat; // - double blkLength; // + double blkLengthHalf; // string shim1Name; // pincer shim double shimHeight; // @@ -485,7 +485,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext // Barrel volume // barrel parent volume Barrel bar; - bar.name = args.str("BarName"); // Barrel volume name + bar.name = ns.prepend(args.str("BarName")); // Barrel volume name bar.mat = args.str("BarMat"); // Barrel material name bar.vecZPts = args.vecDble("BarZPts"); // Barrel list of z pts bar.vecRMin = args.vecDble("BarRMin"); // Barrel list of rMin pts @@ -500,7 +500,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext // Supermodule volume Supermodule spm; - spm.name = args.str("SpmName"); // Supermodule volume name + spm.name = ns.prepend(args.str("SpmName")); // Supermodule volume name spm.mat = args.str("SpmMat"); // Supermodule material name spm.vecZPts = args.vecDble("SpmZPts"); // Supermodule list of z pts spm.vecRMin = args.vecDble("SpmRMin"); // Supermodule list of rMin pts @@ -514,7 +514,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext spm.delPhi = args.dble("SpmDelPhi"); // Delta phi value of base supermodule spm.phiOff = args.dble("SpmPhiOff"); // Phi offset value supermodule spm.vecHere = args.vecDble("SpmHere"); // Bit saying if a supermodule is present or not - spm.cutName = args.str("SpmCutName"); // Name of cut box + spm.cutName = ns.prepend(args.str("SpmCutName")); // Name of cut box spm.cutThick = args.dble("SpmCutThick"); // Box thickness spm.cutShow = args.value<int>("SpmCutShow"); // Non-zero means show the box on display (testing only) spm.vecCutTM = args.vecDble("SpmCutTM"); // Translation for minus phi cut box @@ -524,7 +524,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext spm.expThick = args.dble("SpmExpThick"); // Thickness (x) of supermodule expansion box spm.expWide = args.dble("SpmExpWide"); // Width (y) of supermodule expansion box spm.expYOff = args.dble("SpmExpYOff"); // Offset (y) of supermodule expansion box - spm.sideName = args.str("SpmSideName"); // Supermodule Side Plate volume name + spm.sideName = ns.prepend(args.str("SpmSideName")); // Supermodule Side Plate volume name spm.sideMat = args.str("SpmSideMat"); // Supermodule Side Plate material name spm.sideHigh = args.dble("SpmSideHigh"); // Side plate height spm.sideThick = args.dble("SpmSideThick"); // Side plate thickness @@ -565,10 +565,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext alv.nCryTypes = args.integer("NCryTypes"); alv.nCryPerAlvEta = args.integer("NCryPerAlvEta"); - cry.name = args.str("CryName"); - cry.clrName = args.str("ClrName"); - cry.wrapName = args.str("WrapName"); - cry.wallName = args.str("WallName"); + cry.name = ns.prepend(args.str("CryName")); + cry.clrName = ns.prepend(args.str("ClrName")); + cry.wrapName = ns.prepend(args.str("WrapName")); + cry.wallName = ns.prepend(args.str("WallName")); cry.mat = args.str("CryMat"); cry.clrMat = args.str("ClrMat"); @@ -576,29 +576,29 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext cry.wallMat = args.str("WallMat"); Capsule cap; - cap.name = args.str("CapName"); + cap.name = ns.prepend(args.str("CapName")); cap.here = args.dble("CapHere"); cap.mat = args.str("CapMat"); - cap.xSize = args.dble("CapXSize"); - cap.ySize = args.dble("CapYSize"); - cap.thick = args.dble("CapThick"); + cap.xSizeHalf = 0.5 * args.dble("CapXSize"); + cap.ySizeHalf = 0.5 * args.dble("CapYSize"); + cap.thickHalf = 0.5 * args.dble("CapThick"); Ceramic cer; - cer.name = args.str("CerName"); + cer.name = ns.prepend(args.str("CerName")); cer.mat = args.str("CerMat"); - cer.xSize = args.dble("CerXSize"); - cer.ySize = args.dble("CerYSize"); - cer.thick = args.dble("CerThick"); + cer.xSizeHalf = 0.5 * args.dble("CerXSize"); + cer.ySizeHalf = 0.5 * args.dble("CerYSize"); + cer.thickHalf = 0.5 * args.dble("CerThick"); BulkSilicon bSi; - bSi.name = args.str("BSiName"); + bSi.name = ns.prepend(args.str("BSiName")); bSi.mat = args.str("BSiMat"); - bSi.xSize = args.dble("BSiXSize"); - bSi.ySize = args.dble("BSiYSize"); - bSi.thick = args.dble("BSiThick"); + bSi.xSizeHalf = 0.5 * args.dble("BSiXSize"); + bSi.ySizeHalf = 0.5 * args.dble("BSiYSize"); + bSi.thickHalf = 0.5 * args.dble("BSiThick"); APD apd; - apd.name = args.str("APDName"); + apd.name = ns.prepend(args.str("APDName")); apd.mat = args.str("APDMat"); apd.side = args.dble("APDSide"); apd.thick = args.dble("APDThick"); @@ -606,26 +606,26 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext apd.x1 = args.dble("APDX1"); apd.x2 = args.dble("APDX2"); - apd.atjName = args.str("ATJName"); + apd.atjName = ns.prepend(args.str("ATJName")); apd.atjMat = args.str("ATJMat"); - apd.atjThick = args.dble("ATJThick"); + apd.atjThickHalf = 0.5 * args.dble("ATJThick"); - apd.sglName = args.str("SGLName"); + apd.sglName = ns.prepend(args.str("SGLName")); apd.sglMat = args.str("SGLMat"); apd.sglThick = args.dble("SGLThick"); - apd.aglName = args.str("AGLName"); + apd.aglName = ns.prepend(args.str("AGLName")); apd.aglMat = args.str("AGLMat"); apd.aglThick = args.dble("AGLThick"); - apd.andName = args.str("ANDName"); + apd.andName = ns.prepend(args.str("ANDName")); apd.andMat = args.str("ANDMat"); apd.andThick = args.dble("ANDThick"); Web web; web.here = args.dble("WebHere"); - web.plName = args.str("WebPlName"); - web.clrName = args.str("WebClrName"); + web.plName = ns.prepend(args.str("WebPlName")); + web.clrName = ns.prepend(args.str("WebClrName")); web.plMat = args.str("WebPlMat"); web.clrMat = args.str("WebClrMat"); web.vecWebPlTh = args.vecDble("WebPlTh"); @@ -634,23 +634,26 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext InnerLayerVolume ily; ily.here = args.dble("IlyHere"); - ily.name = args.str("IlyName"); + ily.name = ns.prepend(args.str("IlyName")); ily.phiLow = args.dble("IlyPhiLow"); ily.delPhi = args.dble("IlyDelPhi"); ily.vecIlyMat = args.vecStr("IlyMat"); ily.vecIlyThick = args.vecDble("IlyThick"); - ily.pipeName = args.str("IlyPipeName"); + ily.pipeName = ns.prepend(args.str("IlyPipeName")); ily.pipeHere = args.dble("IlyPipeHere"); ily.pipeMat = args.str("IlyPipeMat"); - ily.pipeOD = args.dble("IlyPipeOD"); + ily.pipeODHalf = 0.5 * args.dble("IlyPipeOD"); ily.pipeID = args.dble("IlyPipeID"); - ily.vecIlyPipeLength = args.vecDble("IlyPipeLength"); + ily.vecIlyPipeLengthHalf = args.vecDble("IlyPipeLength"); + std::transform(ily.vecIlyPipeLengthHalf.begin(), ily.vecIlyPipeLengthHalf.end(), ily.vecIlyPipeLengthHalf.begin(), + [](double length) -> double { return 0.5 * length; }); + ily.vecIlyPipeType = args.vecDble("IlyPipeType"); ily.vecIlyPipePhi = args.vecDble("IlyPipePhi"); ily.vecIlyPipeZ = args.vecDble("IlyPipeZ"); - ily.pTMName = args.str("IlyPTMName"); + ily.pTMName = ns.prepend(args.str("IlyPTMName")); ily.pTMHere = args.dble("IlyPTMHere"); ily.pTMMat = args.str("IlyPTMMat"); ily.pTMWidthHalf = 0.5 * args.dble("IlyPTMWidth"); @@ -659,33 +662,33 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ily.vecIlyPTMZ = args.vecDble("IlyPTMZ"); ily.vecIlyPTMPhi = args.vecDble("IlyPTMPhi"); - ily.fanOutName = args.str("IlyFanOutName"); + ily.fanOutName = ns.prepend(args.str("IlyFanOutName")); ily.fanOutHere = args.dble("IlyFanOutHere"); ily.fanOutMat = args.str("IlyFanOutMat"); - ily.fanOutWidth = args.dble("IlyFanOutWidth"); - ily.fanOutLength = args.dble("IlyFanOutLength"); + ily.fanOutWidthHalf = 0.5 * args.dble("IlyFanOutWidth"); + ily.fanOutLengthHalf = 0.5 * args.dble("IlyFanOutLength"); ily.fanOutHeightHalf = 0.5 * args.dble("IlyFanOutHeight"); ily.vecIlyFanOutZ = args.vecDble("IlyFanOutZ"); ily.vecIlyFanOutPhi = args.vecDble("IlyFanOutPhi"); - ily.diffName = args.str("IlyDiffName"); + ily.diffName = ns.prepend(args.str("IlyDiffName")); ily.diffMat = args.str("IlyDiffMat"); ily.diffOff = args.dble("IlyDiffOff"); - ily.diffLength = args.dble("IlyDiffLength"); - ily.bndlName = args.str("IlyBndlName"); + ily.diffLengthHalf = 0.5 * args.dble("IlyDiffLength"); + ily.bndlName = ns.prepend(args.str("IlyBndlName")); ily.bndlMat = args.str("IlyBndlMat"); ily.bndlOff = args.dble("IlyBndlOff"); - ily.bndlLength = args.dble("IlyBndlLength"); - ily.fEMName = args.str("IlyFEMName"); + ily.bndlLengthHalf = args.dble("IlyBndlLength"); + ily.fEMName = ns.prepend(args.str("IlyFEMName")); ily.fEMMat = args.str("IlyFEMMat"); - ily.fEMWidth = args.dble("IlyFEMWidth"); - ily.fEMLength = args.dble("IlyFEMLength"); - ily.fEMHeight = args.dble("IlyFEMHeight"); + ily.fEMWidthHalf = 0.5 * args.dble("IlyFEMWidth"); + ily.fEMLengthHalf = 0.5 * args.dble("IlyFEMLength"); + ily.fEMHeightHalf = 0.5 * args.dble("IlyFEMHeight"); ily.vecIlyFEMZ = args.vecDble("IlyFEMZ"); ily.vecIlyFEMPhi = args.vecDble("IlyFEMPhi"); AlveolarWedge alvWedge; - alvWedge.hawRName = args.str("HawRName"); - alvWedge.fawName = args.str("FawName"); + alvWedge.hawRName = ns.prepend(args.str("HawRName")); + alvWedge.fawName = ns.prepend(args.str("FawName")); alvWedge.fawHere = args.dble("FawHere"); alvWedge.hawRHBIG = args.dble("HawRHBIG"); alvWedge.hawRhsml = args.dble("HawRhsml"); @@ -702,7 +705,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Grid grid; grid.here = args.dble("GridHere"); - grid.name = args.str("GridName"); + grid.name = ns.prepend(args.str("GridName")); grid.mat = args.str("GridMat"); grid.thick = args.dble("GridThick"); @@ -710,7 +713,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext back.here = args.dble("BackHere"); back.xOff = args.dble("BackXOff"); back.yOff = args.dble("BackYOff"); - back.sideName = args.str("BackSideName"); + back.sideName = ns.prepend(args.str("BackSideName")); back.sideHere = args.dble("BackSideHere"); back.sideLength = args.dble("BackSideLength"); back.sideHeight = args.dble("BackSideHeight"); @@ -719,18 +722,18 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext back.sideYOff2 = args.dble("BackSideYOff2"); back.sideAngle = args.dble("BackSideAngle"); back.sideMat = args.str("BackSideMat"); - back.plateName = args.str("BackPlateName"); + back.plateName = ns.prepend(args.str("BackPlateName")); back.plateHere = args.dble("BackPlateHere"); back.plateLength = args.dble("BackPlateLength"); back.plateThick = args.dble("BackPlateThick"); back.plateWidth = args.dble("BackPlateWidth"); back.plateMat = args.str("BackPlateMat"); - back.plate2Name = args.str("BackPlate2Name"); + back.plate2Name = ns.prepend(args.str("BackPlate2Name")); back.plate2Thick = args.dble("BackPlate2Thick"); back.plate2Mat = args.str("BackPlate2Mat"); Grille grille; - grille.name = args.str("GrilleName"); + grille.name = ns.prepend(args.str("GrilleName")); grille.here = args.dble("GrilleHere"); grille.thick = args.dble("GrilleThick"); grille.width = args.dble("GrilleWidth"); @@ -739,12 +742,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext grille.vecHeight = args.vecDble("GrilleHeight"); grille.vecZOff = args.vecDble("GrilleZOff"); - grille.edgeSlotName = args.str("GrEdgeSlotName"); + grille.edgeSlotName = ns.prepend(args.str("GrEdgeSlotName")); grille.edgeSlotMat = args.str("GrEdgeSlotMat"); grille.edgeSlotHere = args.dble("GrEdgeSlotHere"); grille.edgeSlotHeight = args.dble("GrEdgeSlotHeight"); grille.edgeSlotWidth = args.dble("GrEdgeSlotWidth"); - grille.midSlotName = args.str("GrMidSlotName"); + grille.midSlotName = ns.prepend(args.str("GrMidSlotName")); grille.midSlotMat = args.str("GrMidSlotMat"); grille.midSlotHere = args.dble("GrMidSlotHere"); grille.midSlotWidth = args.dble("GrMidSlotWidth"); @@ -753,7 +756,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext BackPipe backPipe; backPipe.here = args.dble("BackPipeHere"); - backPipe.name = args.str("BackPipeName"); + backPipe.name = ns.prepend(args.str("BackPipeName")); backPipe.vecDiam = args.vecDble("BackPipeDiam"); backPipe.vecThick = args.vecDble("BackPipeThick"); backPipe.mat = args.str("BackPipeMat"); @@ -762,26 +765,30 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext BackCooling backCool; backCool.here = args.dble("BackCoolHere"); backCool.vecName = args.vecStr("BackCoolName"); + std::transform(backCool.vecName.begin(), backCool.vecName.end(), backCool.vecName.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); backCool.barHere = args.dble("BackCoolBarHere"); backCool.barWidth = args.dble("BackCoolBarWidth"); backCool.barHeight = args.dble("BackCoolBarHeight"); backCool.mat = args.str("BackCoolMat"); - backCool.barName = args.str("BackCoolBarName"); + backCool.barName = ns.prepend(args.str("BackCoolBarName")); backCool.barThick = args.dble("BackCoolBarThick"); backCool.barMat = args.str("BackCoolBarMat"); - backCool.barSSName = args.str("BackCoolBarSSName"); + backCool.barSSName = ns.prepend(args.str("BackCoolBarSSName")); backCool.barSSThick = args.dble("BackCoolBarSSThick"); backCool.barSSMat = args.str("BackCoolBarSSMat"); - backCool.barWaName = args.str("BackCoolBarWaName"); + backCool.barWaName = ns.prepend(args.str("BackCoolBarWaName")); backCool.barWaThick = args.dble("BackCoolBarWaThick"); backCool.barWaMat = args.str("BackCoolBarWaMat"); backCool.vFEHere = args.dble("BackCoolVFEHere"); backCool.vFEName = args.str("BackCoolVFEName"); backCool.vFEMat = args.str("BackCoolVFEMat"); - backCool.backVFEName = args.str("BackVFEName"); + backCool.backVFEName = ns.prepend(args.str("BackVFEName")); backCool.backVFEMat = args.str("BackVFEMat"); backCool.vecBackVFELyrThick = args.vecDble("BackVFELyrThick"); backCool.vecBackVFELyrName = args.vecStr("BackVFELyrName"); + std::transform(backCool.vecBackVFELyrName.begin(), backCool.vecBackVFELyrName.end(), backCool.vecBackVFELyrName.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); backCool.vecBackVFELyrMat = args.vecStr("BackVFELyrMat"); backCool.vecBackCoolNSec = args.vecDble("BackCoolNSec"); backCool.vecBackCoolSecSep = args.vecDble("BackCoolSecSep"); @@ -791,6 +798,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext backMisc.here = args.dble("BackMiscHere"); backMisc.vecThick = args.vecDble("BackMiscThick"); backMisc.vecName = args.vecStr("BackMiscName"); + std::transform(backMisc.vecName.begin(), backMisc.vecName.end(), backMisc.vecName.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); backMisc.vecMat = args.vecStr("BackMiscMat"); backMisc.backCBStdSep = args.dble("BackCBStdSep"); @@ -798,19 +807,22 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext patchPanel.here = args.dble("PatchPanelHere"); patchPanel.vecThick = args.vecDble("PatchPanelThick"); patchPanel.vecNames = args.vecStr("PatchPanelNames"); + std::transform(patchPanel.vecNames.begin(), patchPanel.vecNames.end(), patchPanel.vecNames.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); + patchPanel.vecMat = args.vecStr("PatchPanelMat"); - patchPanel.name = args.str("PatchPanelName"); + patchPanel.name = ns.prepend(args.str("PatchPanelName")); BackCoolTank backCoolTank; backCoolTank.here = args.dble("BackCoolTankHere"); - backCoolTank.name = args.str("BackCoolTankName"); + backCoolTank.name = ns.prepend(args.str("BackCoolTankName")); backCoolTank.width = args.dble("BackCoolTankWidth"); backCoolTank.thick = args.dble("BackCoolTankThick"); backCoolTank.mat = args.str("BackCoolTankMat"); - backCoolTank.waName = args.str("BackCoolTankWaName"); + backCoolTank.waName = ns.prepend(args.str("BackCoolTankWaName")); backCoolTank.waWidth = args.dble("BackCoolTankWaWidth"); backCoolTank.waMat = args.str("BackCoolTankWaMat"); - backCoolTank.backBracketName = args.str("BackBracketName"); + backCoolTank.backBracketName = ns.prepend(args.str("BackBracketName")); backCoolTank.backBracketHeight = args.dble("BackBracketHeight"); backCoolTank.backBracketMat = args.str("BackBracketMat"); @@ -824,14 +836,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext MBCoolTube mbCoolTube; mbCoolTube.here = args.dble("MBCoolTubeHere"); - mbCoolTube.name = args.str("MBCoolTubeName"); + mbCoolTube.name = ns.prepend(args.str("MBCoolTubeName")); mbCoolTube.innDiam = args.dble("MBCoolTubeInnDiam"); mbCoolTube.outDiam = args.dble("MBCoolTubeOutDiam"); mbCoolTube.mat = args.str("MBCoolTubeMat"); MBManif mbManif; mbManif.here = args.dble("MBManifHere"); - mbManif.name = args.str("MBManifName"); + mbManif.name = ns.prepend(args.str("MBManifName")); mbManif.innDiam = args.dble("MBManifInnDiam"); mbManif.outDiam = args.dble("MBManifOutDiam"); mbManif.mat = args.str("MBManifMat"); @@ -840,29 +852,31 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext mbLyr.here = args.dble("MBLyrHere"); mbLyr.vecMBLyrThick = args.vecDble("MBLyrThick"); mbLyr.vecMBLyrName = args.vecStr("MBLyrName"); + std::transform(mbLyr.vecMBLyrName.begin(), mbLyr.vecMBLyrName.end(), mbLyr.vecMBLyrName.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); mbLyr.vecMBLyrMat = args.vecStr("MBLyrMat"); Pincer pincer; pincer.rodHere = args.dble("PincerRodHere"); - pincer.rodName = args.str("PincerRodName"); + pincer.rodName = ns.prepend(args.str("PincerRodName")); pincer.rodMat = args.str("PincerRodMat"); pincer.vecRodAzimuth = args.vecDble("PincerRodAzimuth"); - pincer.envName = args.str("PincerEnvName"); + pincer.envName = ns.prepend(args.str("PincerEnvName")); pincer.envMat = args.str("PincerEnvMat"); - pincer.envWidth = args.dble("PincerEnvWidth"); - pincer.envHeight = args.dble("PincerEnvHeight"); - pincer.envLength = args.dble("PincerEnvLength"); + pincer.envWidthHalf = 0.5 * args.dble("PincerEnvWidth"); + pincer.envHeightHalf = 0.5 * args.dble("PincerEnvHeight"); + pincer.envLengthHalf = 0.5 * args.dble("PincerEnvLength"); pincer.vecEnvZOff = args.vecDble("PincerEnvZOff"); - pincer.blkName = args.str("PincerBlkName"); + pincer.blkName = ns.prepend(args.str("PincerBlkName")); pincer.blkMat = args.str("PincerBlkMat"); - pincer.blkLength = args.dble("PincerBlkLength"); - pincer.shim1Name = args.str("PincerShim1Name"); + pincer.blkLengthHalf = 0.5 * args.dble("PincerBlkLength"); + pincer.shim1Name = ns.prepend(args.str("PincerShim1Name")); pincer.shimHeight = args.dble("PincerShimHeight"); - pincer.shim2Name = args.str("PincerShim2Name"); + pincer.shim2Name = ns.prepend(args.str("PincerShim2Name")); pincer.shimMat = args.str("PincerShimMat"); pincer.shim1Width = args.dble("PincerShim1Width"); pincer.shim2Width = args.dble("PincerShim2Width"); - pincer.cutName = args.str("PincerCutName"); + pincer.cutName = ns.prepend(args.str("PincerCutName")); pincer.cutMat = args.str("PincerCutMat"); pincer.cutWidth = args.dble("PincerCutWidth"); pincer.cutHeight = args.dble("PincerCutHeight"); @@ -953,11 +967,11 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("EcalGeom") << spmCutLog.name() << ":1 positioned in " << DDSplit(spmLog.name()).first; #endif } - spmLog.placeVolume(sideLog, 1, Transform3D(ns.rotation(ns.prepend(spm.sideName + std::to_string(1))), sideddtra1)); + spmLog.placeVolume(sideLog, 1, Transform3D(ns.rotation(spm.sideName + std::to_string(1)), sideddtra1)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << sideLog.name() << ":1 positioned in " << DDSplit(spmLog.name()).first; #endif - spmLog.placeVolume(sideLog, 2, Transform3D(ns.rotation(ns.prepend(spm.sideName + std::to_string(2))), sideddtra2)); + spmLog.placeVolume(sideLog, 2, Transform3D(ns.rotation(spm.sideName + std::to_string(2)), sideddtra2)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << sideLog.name() << ":2 positioned in " << DDSplit(spmLog.name()).first; #endif @@ -1000,7 +1014,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext // End Supermodule parent------------------------------------------------------------ // Begin Inner Layer volumes--------------------------------------------------------- - const double ilyLength(spm.vecZPts[1] - spm.vecZPts[0]); + const double ilyLengthHalf(0.5 * (spm.vecZPts[1] - spm.vecZPts[0])); double ilyRMin(spm.vecRMin[0]); double ilyThick(0); for (unsigned int ilyx(0); ilyx != ily.vecIlyThick.size(); ++ilyx) { @@ -1009,24 +1023,24 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid ilySolid = Tube(ily.name, ilyRMin, // rmin ilyRMin + ilyThick, // rmax - 0.5 * ilyLength, // dz + ilyLengthHalf, // dz ily.phiLow, // startPhi ily.phiLow + ily.delPhi); // startPhi + deltaPhi Volume ilyLog = Volume(ily.name, ilySolid, ns.material(spm.mat)); - spmLog.placeVolume(ilyLog, copyOne, Position(0, 0, 0.5 * ilyLength)); + spmLog.placeVolume(ilyLog, copyOne, Position(0, 0, ilyLengthHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << ilyLog.name() << ":" << copyOne << " positioned in " << DDSplit(spmLog.name()).first; #endif Volume ilyPipeLog[200]; if (0 != ily.pipeHere) { - for (unsigned int iPipeType(0); iPipeType != ily.vecIlyPipeLength.size(); ++iPipeType) { + for (unsigned int iPipeType(0); iPipeType != ily.vecIlyPipeLengthHalf.size(); ++iPipeType) { string pName(ily.pipeName + "_" + std::to_string(iPipeType + 1)); Solid ilyPipeSolid = Tube(pName, 0, // rmin - 0.5 * ily.pipeOD, // rmax - 0.5 * ily.vecIlyPipeLength[iPipeType], // dz + ily.pipeODHalf, // rmax + ily.vecIlyPipeLengthHalf[iPipeType], // dz 0_deg, // startPhi 360_deg); // startPhi + deltaPhi ilyPipeLog[iPipeType] = Volume(pName, ilyPipeSolid, ns.material(ily.pipeMat)); @@ -1035,7 +1049,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid ilyPipeWaSolid = Tube(pWaName, 0, // rmin 0.5 * ily.pipeID, // rmax - 0.5 * ily.vecIlyPipeLength[iPipeType], // dz + ily.vecIlyPipeLengthHalf[iPipeType], // dz 0_deg, // startPhi 360_deg); // startPhi + deltaPhi Volume ilyPipeWaLog = Volume(pWaName, ilyPipeWaSolid, ns.material(backPipe.waterMat)); @@ -1050,25 +1064,25 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid ilyPTMSolid = Box(ily.pTMHeightHalf, ily.pTMWidthHalf, ily.pTMLengthHalf); Volume ilyPTMLog = Volume(ily.pTMName, ilyPTMSolid, ns.material(ily.pTMMat)); - Solid ilyFanOutSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidth / 2., ily.fanOutLength / 2.); + Solid ilyFanOutSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidthHalf, ily.fanOutLengthHalf); Volume ilyFanOutLog = Volume(ily.fanOutName, ilyFanOutSolid, ns.material(ily.fanOutMat)); - Solid ilyFEMSolid = Box(ily.fEMHeight / 2., ily.fEMWidth / 2., ily.fEMLength / 2.); + Solid ilyFEMSolid = Box(ily.fEMHeightHalf, ily.fEMWidthHalf, ily.fEMLengthHalf); Volume ilyFEMLog = Volume(ily.fEMName, ilyFEMSolid, ns.material(ily.fEMMat)); - Solid ilyDiffSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidth / 2., ily.diffLength / 2.); + Solid ilyDiffSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidthHalf, ily.diffLengthHalf); Volume ilyDiffLog = Volume(ily.diffName, ilyDiffSolid, ns.material(ily.diffMat)); - Solid ilyBndlSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidth / 2., ily.bndlLength / 2.); + Solid ilyBndlSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidthHalf, ily.bndlLengthHalf); Volume ilyBndlLog = Volume(ily.bndlName, ilyBndlSolid, ns.material(ily.bndlMat)); ilyFanOutLog.placeVolume( - ilyDiffLog, copyOne, Position(0_mm, 0_mm, -ily.fanOutLength / 2 + ily.diffLength / 2 + ily.diffOff)); + ilyDiffLog, copyOne, Position(0_mm, 0_mm, -ily.fanOutLengthHalf + ily.diffLengthHalf + ily.diffOff)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << ilyDiffLog.name() << ":" << copyOne << " positioned in " << ilyFanOutLog.name(); #endif ilyFanOutLog.placeVolume( - ilyBndlLog, copyOne, Position(0_mm, 0_mm, -ily.fanOutLength / 2 + ily.bndlLength / 2 + ily.bndlOff)); + ilyBndlLog, copyOne, Position(0_mm, 0_mm, -ily.fanOutLengthHalf + ily.bndlLengthHalf + ily.bndlOff)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << ilyBndlLog.name() << ":" << copyOne << " positioned in " << ilyFanOutLog.name(); #endif @@ -1077,7 +1091,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext for (unsigned int iily(0); iily != ily.vecIlyThick.size(); ++iily) { const double ilyRMax(ilyRMin + ily.vecIlyThick[iily]); string xilyName(ily.name + std::to_string(iily)); - Solid xilySolid = Tube(xilyName, ilyRMin, ilyRMax, 0.5 * ilyLength, ily.phiLow, ily.phiLow + ily.delPhi); + Solid xilySolid = Tube(xilyName, ilyRMin, ilyRMax, ilyLengthHalf, ily.phiLow, ily.phiLow + ily.delPhi); xilyLog = ns.addVolume(Volume(xilyName, xilySolid, ns.material(ily.vecIlyMat[iily]))); if (0 != ily.here) { ilyLog.placeVolume(xilyLog, copyOne); @@ -1098,7 +1112,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext xilyLog.placeVolume( ilyPTMLog, ptmCopy, - Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLength / 2))); + Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name(); #endif @@ -1115,7 +1129,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext xilyLog.placeVolume(ilyFanOutLog, fanOutCopy, Transform3D(RotationZ(phi) * RotationY(180_deg), - Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLength / 2))); + Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name(); @@ -1123,7 +1137,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext } unsigned int femCopy(0); for (unsigned int ilyFEM(0); ilyFEM != ily.vecIlyFEMZ.size(); ++ilyFEM) { - const double radius(ilyRMax - 1_mm - ily.fEMHeight / 2.); + const double radius(ilyRMax - 1_mm - ily.fEMHeightHalf); const double phi(ily.vecIlyFEMPhi[ilyFEM]); const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); @@ -1131,7 +1145,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext xilyLog.placeVolume( ilyFEMLog, femCopy, - Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLength / 2))); + Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name(); #endif @@ -1139,10 +1153,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext } for (unsigned int iPipe(0); iPipe != ily.vecIlyPipePhi.size(); ++iPipe) { const unsigned int type(static_cast<unsigned int>(round(ily.vecIlyPipeType[iPipe]))); - const double zz(-ilyLength / 2 + ily.vecIlyPipeZ[iPipe] + (9 > type ? ily.vecIlyPipeLength[type] / 2. : 0)); + const double zz(-ilyLengthHalf + ily.vecIlyPipeZ[iPipe] + (9 > type ? ily.vecIlyPipeLengthHalf[type] : 0)); for (unsigned int ly(0); ly != 2; ++ly) { - const double radius(0 == ly ? ilyRMin + ily.pipeOD / 2. + 1_mm : ilyRMax - ily.pipeOD / 2. - 1_mm); + const double radius(0 == ly ? ilyRMin + ily.pipeODHalf + 1_mm : ilyRMax - ily.pipeODHalf - 1_mm); const double phi(ily.vecIlyPipePhi[iPipe]); const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); @@ -1172,7 +1186,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext } // End Inner Layer volumes--------------------------------------------------------- - string clyrName("ECLYR"); + string clyrName(ns.prepend("ECLYR")); std::vector<double> cri; std::vector<double> cro; std::vector<double> czz; @@ -1216,12 +1230,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double b_hawR(a_hawR + h_hawR * tana_hawR); const double L_hawR(spm.vecZPts[2]); - const EcalTrap trapHAWR(a_hawR / 2., //double aHalfLengthXNegZLoY , // bl1, A/2 - a_hawR / 2., //double aHalfLengthXPosZLoY , // bl2, a/2 - b_hawR / 2., //double aHalfLengthXPosZHiY , // tl2, b/2 - H_hawR / 2., //double aHalfLengthYNegZ , // h1, H/2 - h_hawR / 2., //double aHalfLengthYPosZ , // h2, h/2 - L_hawR / 2., //double aHalfLengthZ , // dz, L/2 + const EcalTrap trapHAWR(0.5 * a_hawR, //double aHalfLengthXNegZLoY , // bl1, A/2 + 0.5 * a_hawR, //double aHalfLengthXPosZLoY , // bl2, a/2 + 0.5 * b_hawR, //double aHalfLengthXPosZHiY , // tl2, b/2 + 0.5 * H_hawR, //double aHalfLengthYNegZ , // h1, H/2 + 0.5 * h_hawR, //double aHalfLengthYPosZ , // h2, h/2 + 0.5 * L_hawR, //double aHalfLengthZ , // dz, L/2 90_deg, //double aAngleAD , // alfa1 0, //double aCoord15X , // x15 0 //double aCoord15Y // y15 @@ -1236,9 +1250,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const EcalTrap trapFAW(a_hawR, //double aHalfLengthXNegZLoY , // bl1, A/2 a_hawR, //double aHalfLengthXPosZLoY , // bl2, a/2 b_hawR, //double aHalfLengthXPosZHiY , // tl2, b/2 - H_hawR / 2., //double aHalfLengthYNegZ , // h1, H/2 - h_hawR / 2., //double aHalfLengthYPosZ , // h2, h/2 - L_hawR / 2., //double aHalfLengthZ , // dz, L/2 + 0.5 * H_hawR, //double aHalfLengthYNegZ , // h1, H/2 + 0.5 * h_hawR, //double aHalfLengthYPosZ , // h2, h/2 + 0.5 * L_hawR, //double aHalfLengthZ , // dz, L/2 al1_fawR, //double aAngleAD , // alfa1 0, //double aCoord15X , // x15 0 //double aCoord15Y // y15 @@ -1334,7 +1348,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext for (unsigned int iPhi(1); iPhi <= alvWedge.nFawPerSupm; ++iPhi) { const double rPhi(alvWedge.fawPhiOff + (iPhi - 0.5) * alvWedge.fawDelPhi); - const Tf3D fawform(RoZ3D(rPhi) * Tl3D(alvWedge.fawRadOff + (trapFAW.H() + trapFAW.h()) / 4, 0, trapFAW.L() / 2) * + const Tf3D fawform(RoZ3D(rPhi) * Tl3D(alvWedge.fawRadOff + (trapFAW.H() + trapFAW.h()) / 4, 0, 0.5 * trapFAW.L()) * RoZ3D(-90_deg + alvWedge.fawPhiRot)); if (alvWedge.fawHere) { spmLog.placeVolume( @@ -1356,12 +1370,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double h_Grid(grid.thick); - const EcalTrap trapGrid((B_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR) / 2, // bl1, A/2 - (b_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR) / 2, // bl2, a/2 - b_hawR / 2., // tl2, b/2 - h_Grid / 2., // h1, H/2 - h_Grid / 2., // h2, h/2 - (L_hawR - 8_cm) / 2., // dz, L/2 + const EcalTrap trapGrid(0.5 * (B_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR), // bl1, A/2 + 0.5 * (b_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR), // bl2, a/2 + 0.5 * b_hawR, // tl2, b/2 + 0.5 * h_Grid, // h1, H/2 + 0.5 * h_Grid, // h2, h/2 + 0.5 * (L_hawR - 8_cm), // dz, L/2 90_deg, // alfa1 0, // x15 H_hawR - h_hawR // y15 @@ -1436,12 +1450,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double alfCry(90_deg + atan((bNom - bUnd - aNom + aUnd) / (hNom - hUnd))); - const EcalTrap trapCry((ANom - AUnd) / 2., //double aHalfLengthXNegZLoY , // bl1, A/2 - (aNom - aUnd) / 2., //double aHalfLengthXPosZLoY , // bl2, a/2 - (bNom - bUnd) / 2., //double aHalfLengthXPosZHiY , // tl2, b/2 - (HNom - HUnd) / 2., //double aHalfLengthYNegZ , // h1, H/2 - (hNom - hUnd) / 2., //double aHalfLengthYPosZ , // h2, h/2 - (LNom - LUnd) / 2., //double aHalfLengthZ , // dz, L/2 + const EcalTrap trapCry(0.5 * (ANom - AUnd), //double aHalfLengthXNegZLoY , // bl1, A/2 + 0.5 * (aNom - aUnd), //double aHalfLengthXPosZLoY , // bl2, a/2 + 0.5 * (bNom - bUnd), //double aHalfLengthXPosZHiY , // tl2, b/2 + 0.5 * (HNom - HUnd), //double aHalfLengthYNegZ , // h1, H/2 + 0.5 * (hNom - hUnd), //double aHalfLengthYPosZ , // h2, h/2 + 0.5 * (LNom - LUnd), //double aHalfLengthZ , // dz, L/2 alfCry, //double aAngleAD , // alfa1 aNom - aUnd - ANom + AUnd, //double aCoord15X , // x15 hNom - hUnd - HNom + HUnd //double aCoord15Y // y15 @@ -1454,41 +1468,41 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext //++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++ const unsigned int copyCap(1); const string capDDName(cap.name + sType); - Solid capSolid = Box(cap.xSize / 2., cap.ySize / 2., cap.thick / 2.); + Solid capSolid = Box(cap.xSizeHalf, cap.ySizeHalf, cap.thickHalf); Volume capLog = Volume(capDDName, capSolid, ns.material(cap.mat)); const string sglDDName(apd.sglName + sType); - Solid sglSolid = Box(cap.xSize / 2., cap.ySize / 2., apd.sglThick / 2.); + Solid sglSolid = Box(cap.xSizeHalf, cap.ySizeHalf, apd.sglThick / 2.); Volume sglLog = Volume(sglDDName, sglSolid, ns.material(apd.sglMat)); const unsigned int copySGL(1); const string cerDDName(cer.name + sType); - Solid cerSolid = Box(cer.xSize / 2., cer.ySize / 2., cer.thick / 2.); + Solid cerSolid = Box(cer.xSizeHalf, cer.ySizeHalf, cer.thickHalf); Volume cerLog = Volume(cerDDName, cerSolid, ns.material(cer.mat)); unsigned int copyCER(0); const string bsiDDName(bSi.name + sType); - Solid bsiSolid = Box(bSi.xSize / 2., bSi.ySize / 2., bSi.thick / 2.); + Solid bsiSolid = Box(bSi.xSizeHalf, bSi.ySizeHalf, bSi.thickHalf); Volume bsiLog = Volume(bsiDDName, bsiSolid, ns.material(bSi.mat)); const unsigned int copyBSi(1); const string atjDDName(apd.atjName + sType); - Solid atjSolid = Box(atjDDName, apd.side / 2., apd.side / 2., apd.atjThick / 2.); + Solid atjSolid = Box(atjDDName, 0.5 * apd.side, 0.5 * apd.side, apd.atjThickHalf); Volume atjLog = Volume(atjDDName, atjSolid, ns.material(apd.atjMat)); const unsigned int copyATJ(1); const string aglDDName(apd.aglName + sType); - Solid aglSolid = Box(bSi.xSize / 2., bSi.ySize / 2., apd.aglThick / 2.); + Solid aglSolid = Box(bSi.xSizeHalf, bSi.ySizeHalf, 0.5 * apd.aglThick); Volume aglLog = Volume(aglDDName, aglSolid, ns.material(apd.aglMat)); const unsigned int copyAGL(1); const string andDDName(apd.andName + sType); - Solid andSolid = Box(apd.side / 2., apd.side / 2., apd.andThick / 2.); + Solid andSolid = Box(0.5 * apd.side, 0.5 * apd.side, 0.5 * apd.andThick); Volume andLog = Volume(andDDName, andSolid, ns.material(apd.andMat)); const unsigned int copyAND(1); const string apdDDName(apd.name + sType); - Solid apdSolid = Box(apdDDName, apd.side / 2., apd.side / 2., apd.thick / 2.); + Solid apdSolid = Box(apdDDName, 0.5 * apd.side, 0.5 * apd.side, 0.5 * apd.thick); Volume apdLog = Volume(apdDDName, apdSolid, ns.material(apd.mat)); const unsigned int copyAPD(1); @@ -1506,12 +1520,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext // Now clearance trap const double alfClr(90_deg + atan((bNom - aNom) / (hNom + sClr))); - const EcalTrap trapClr((ANom + sClr + rClr * singamma) / 2., //double aHalfLengthXNegZLoY , // bl1, A/2 - (aNom + sClr - fClr * singamma) / 2., //double aHalfLengthXPosZLoY , // bl2, a/2 - (bNom + sClr - fClr * sinbeta) / 2., //double aHalfLengthXPosZHiY , // tl2, b/2 - (HNom + sClr + rClr * sindelta) / 2., //double aHalfLengthYNegZ , // h1, H/2 - (hNom + sClr - fClr * sindelta) / 2., //double aHalfLengthYPosZ , // h2, h/2 - (LNom + fClr + rClr) / 2., // dz, L/2 + const EcalTrap trapClr(0.5 * (ANom + sClr + rClr * singamma), //double aHalfLengthXNegZLoY , // bl1, A/2 + 0.5 * (aNom + sClr - fClr * singamma), //double aHalfLengthXPosZLoY , // bl2, a/2 + 0.5 * (bNom + sClr - fClr * sinbeta), //double aHalfLengthXPosZHiY , // tl2, b/2 + 0.5 * (HNom + sClr + rClr * sindelta), //double aHalfLengthYNegZ , // h1, H/2 + 0.5 * (hNom + sClr - fClr * sindelta), //double aHalfLengthYPosZ , // h2, h/2 + 0.5 * (LNom + fClr + rClr), // dz, L/2 alfClr, //double aAngleAD , // alfa1 aNom - ANom, //double aCoord15X , // x15 hNom - HNom //double aCoord15Y // y15 @@ -1522,14 +1536,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Volume clrLog = Volume(clrDDName, clrSolid, ns.material(cry.clrMat)); // Now wrap trap - const double alfWrap(90_deg + atan((bNom - aNom) / (hNom + sClr + 2 * sWrap))); - - const EcalTrap trapWrap((trapClr.A() + 2 * sWrap + rWrap * singamma) / 2, // bl1, A/2 - (trapClr.a() + 2 * sWrap - fWrap * singamma) / 2, // bl2, a/2 - (trapClr.b() + 2 * sWrap - fWrap * sinbeta) / 2, // tl2, b/2 - (trapClr.H() + 2 * sWrap + rWrap * sindelta) / 2, // h1, H/2 - (trapClr.h() + 2 * sWrap - fWrap * sindelta) / 2, // h2, h/2 - (trapClr.L() + fWrap + rWrap) / 2., // dz, L/2 + const double alfWrap(90_deg + atan((bNom - aNom) / (hNom + sClr + 2. * sWrap))); + + const EcalTrap trapWrap(0.5 * (trapClr.A() + 2. * sWrap + rWrap * singamma), // bl1, A/2 + 0.5 * (trapClr.a() + 2. * sWrap - fWrap * singamma), // bl2, a/2 + 0.5 * (trapClr.b() + 2. * sWrap - fWrap * sinbeta), // tl2, b/2 + 0.5 * (trapClr.H() + 2. * sWrap + rWrap * sindelta), // h1, H/2 + 0.5 * (trapClr.h() + 2. * sWrap - fWrap * sindelta), // h2, h/2 + 0.5 * (trapClr.L() + fWrap + rWrap), // dz, L/2 alfWrap, //double aAngleAD , // alfa1 aNom - ANom - (cryType > 9 ? 0 : 0.020_mm), hNom - HNom //double aCoord15Y // y15 @@ -1541,14 +1555,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext // Now wall trap - const double alfWall(90_deg + atan((bNom - aNom) / (hNom + sClr + 2 * sWrap + 2 * sWall))); + const double alfWall(90_deg + atan((bNom - aNom) / (hNom + sClr + 2. * sWrap + 2. * sWall))); - const EcalTrap trapWall((trapWrap.A() + 2 * sWall + rWall * singamma) / 2, // A/2 - (trapWrap.a() + 2 * sWall - fWall * singamma) / 2, // a/2 - (trapWrap.b() + 2 * sWall - fWall * sinbeta) / 2, // b/2 - (trapWrap.H() + 2 * sWall + rWall * sindelta) / 2, // H/2 - (trapWrap.h() + 2 * sWall - fWall * sindelta) / 2, // h/2 - (trapWrap.L() + fWall + rWall) / 2., // L/2 + const EcalTrap trapWall(0.5 * (trapWrap.A() + 2 * sWall + rWall * singamma), // A/2 + 0.5 * (trapWrap.a() + 2 * sWall - fWall * singamma), // a/2 + 0.5 * (trapWrap.b() + 2 * sWall - fWall * sinbeta), // b/2 + 0.5 * (trapWrap.H() + 2 * sWall + rWall * sindelta), // H/2 + 0.5 * (trapWrap.h() + 2 * sWall - fWall * sindelta), // h/2 + 0.5 * (trapWrap.L() + fWall + rWall), // L/2 alfWall, // alfa1 aNom - ANom - (cryType < 10 ? 0.150_mm : 0.100_mm), hNom - HNom // y15 @@ -1559,37 +1573,37 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Volume wallLog = Volume(wallDDName, wallSolid, ns.material(cry.wallMat)); // Now for placement of cry within clr - const Vec3 cryToClr(0, 0, (rClr - fClr) / 2); - clrLog.placeVolume(cryLog, copyOne, Position(0_mm, 0_mm, (rClr - fClr) / 2)); + const Vec3 cryToClr(0., 0., 0.5 * (rClr - fClr)); + clrLog.placeVolume(cryLog, copyOne, Position(0_mm, 0_mm, 0.5 * (rClr - fClr))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << cryLog.name() << ":" << copyOne << " positioned in " << clrLog.name(); #endif if (0 != cap.here) { - bsiLog.placeVolume(aglLog, copyAGL, Position(0_mm, 0_mm, -apd.aglThick / 2. + bSi.thick / 2.)); + bsiLog.placeVolume(aglLog, copyAGL, Position(0_mm, 0_mm, -0.5 * apd.aglThick + bSi.thickHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << aglLog.name() << ":" << copyAGL << " positioned in " << bsiLog.name(); #endif - bsiLog.placeVolume(andLog, copyAND, Position(0_mm, 0_mm, -apd.andThick / 2. - apd.aglThick + bSi.thick / 2.)); + bsiLog.placeVolume(andLog, copyAND, Position(0_mm, 0_mm, -0.5 * apd.andThick - apd.aglThick + bSi.thickHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << andLog.name() << ":" << copyAND << " positioned in " << bsiLog.name(); #endif bsiLog.placeVolume( - apdLog, copyAPD, Position(0_mm, 0_mm, -apd.thick / 2. - apd.andThick - apd.aglThick + bSi.thick / 2.)); + apdLog, copyAPD, Position(0_mm, 0_mm, -0.5 * apd.thick - apd.andThick - apd.aglThick + bSi.thickHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << apdLog.name() << ":" << copyAPD << " positioned in " << bsiLog.name(); #endif bsiLog.placeVolume( atjLog, copyATJ, - Position(0_mm, 0_mm, -apd.atjThick / 2. - apd.thick - apd.andThick - apd.aglThick + bSi.thick / 2.)); + Position(0_mm, 0_mm, -apd.atjThickHalf - apd.thick - apd.andThick - apd.aglThick + bSi.thickHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << atjLog.name() << ":" << copyATJ << " positioned in " << bsiLog.name(); #endif - cerLog.placeVolume(bsiLog, copyBSi, Position(0_mm, 0_mm, -bSi.thick / 2. + cer.thick / 2.)); + cerLog.placeVolume(bsiLog, copyBSi, Position(0_mm, 0_mm, -bSi.thickHalf + cer.thickHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << bsiLog.name() << ":" << copyBSi << " positioned in " << cerLog.name(); #endif - capLog.placeVolume(sglLog, copySGL, Position(0_mm, 0_mm, -apd.sglThick / 2. + cap.thick / 2.)); + capLog.placeVolume(sglLog, copySGL, Position(0_mm, 0_mm, -0.5 * apd.sglThick + cap.thickHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << sglLog.name() << ":" << copySGL << " positioned in " << capLog.name(); #endif @@ -1599,25 +1613,25 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ++copyCER, Position(trapCry.bl1() - (0 == ijkl ? apd.x1 : apd.x2), trapCry.h1() - apd.z, - -apd.sglThick - cer.thick / 2. + cap.thick / 2.)); + -apd.sglThick - cer.thickHalf + cap.thickHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << cerLog.name() << ":" << copyCER << " positioned in " << capLog.name(); #endif } - clrLog.placeVolume(capLog, copyCap, Position(0_mm, 0_mm, -trapCry.dz() - cap.thick / 2. + (rClr - fClr) / 2.)); + clrLog.placeVolume(capLog, copyCap, Position(0_mm, 0_mm, -trapCry.dz() - cap.thickHalf + 0.5 * (rClr - fClr))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << capLog.name() << ":" << copyCap << " positioned in " << clrLog.name(); #endif } - const Vec3 clrToWrap(0, 0, (rWrap - fWrap) / 2); - wrapLog.placeVolume(clrLog, copyOne, Position(0_mm, 0_mm, (rWrap - fWrap) / 2)); //SAME as cryToWrap + const Vec3 clrToWrap(0, 0, 0.5 * (rWrap - fWrap)); + wrapLog.placeVolume(clrLog, copyOne, Position(0_mm, 0_mm, 0.5 * (rWrap - fWrap))); //SAME as cryToWrap #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << clrLog.name() << ":" << copyOne << " positioned in " << wrapLog.name(); #endif // Now for placement of clr within wall - const Vec3 wrapToWall1(0_mm, 0_mm, (rWall - fWall) / 2); + const Vec3 wrapToWall1(0_mm, 0_mm, 0.5 * (rWall - fWall)); const Vec3 wrapToWall(Vec3((cryType > 9 ? 0_mm : 0.005_mm), 0_mm, 0_mm) + wrapToWall1); wallLog.placeVolume( wrapLog, @@ -1630,8 +1644,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const EcalTrap::VertexList vWall(trapWall.vertexList()); const EcalTrap::VertexList vCry(trapCry.vertexList()); - const double sidePrime((trapWall.a() - trapCry.a()) / 2); - const double frontPrime(fWall + fWrap + fClr + LUnd / 2); + const double sidePrime(0.5 * (trapWall.a() - trapCry.a())); + const double frontPrime(fWall + fWrap + fClr + 0.5 * LUnd); // define web plates with clearance =========================================== @@ -1644,12 +1658,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double BWebx(trapWall.b() + (trapWall.B() - trapWall.b()) * LWebx / trapWall.L()); const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); - const EcalTrap trapWebClr(BWebx / 2, // A/2 - trapWall.b() / 2, // a/2 - trapWall.b() / 2, // b/2 - thick / 2, // H/2 - thick / 2, // h/2 - LWebx / 2, // L/2 + const EcalTrap trapWebClr(0.5 * BWebx, // A/2 + 0.5 * trapWall.b(), // a/2 + 0.5 * trapWall.b(), // b/2 + 0.5 * thick, // H/2 + 0.5 * thick, // h/2 + 0.5 * LWebx, // L/2 90_deg, // alfa1 trapWall.b() - BWebx, // x15 0 // y15 @@ -1658,12 +1672,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid webClrSolid = mytrap(webClrName, trapWebClr); Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); - const EcalTrap trapWebPl(trapWebClr.A() / 2, // A/2 - trapWebClr.a() / 2, // a/2 - trapWebClr.b() / 2, // b/2 - web.vecWebPlTh[iWeb] / 2, // H/2 - web.vecWebPlTh[iWeb] / 2, // h/2 - trapWebClr.L() / 2., // L/2 + const EcalTrap trapWebPl(0.5 * trapWebClr.A(), // A/2 + 0.5 * trapWebClr.a(), // a/2 + 0.5 * trapWebClr.b(), // b/2 + 0.5 * web.vecWebPlTh[iWeb], // H/2 + 0.5 * web.vecWebPlTh[iWeb], // h/2 + 0.5 * trapWebClr.L(), // L/2 90._deg, // alfa1 trapWebClr.b() - trapWebClr.B(), // x15 0 // y15 @@ -1755,12 +1769,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double BWebx(trapWall.a() + (trapWall.A() - trapWall.a()) * LWebx / trapWall.L()); const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); - const EcalTrap trapWebClr(BWebx / 2, // A/2 - trapWall.a() / 2, // a/2 - trapWall.a() / 2, // b/2 - thick / 2, // H/2 - thick / 2, // h/2 - LWebx / 2, // L/2 + const EcalTrap trapWebClr(0.5 * BWebx, // A/2 + 0.5 * trapWall.a(), // a/2 + 0.5 * trapWall.a(), // b/2 + 0.5 * thick, // H/2 + 0.5 * thick, // h/2 + 0.5 * LWebx, // L/2 90_deg, // alfa1 trapWall.a() - BWebx, // x15 0 // y15 @@ -1769,12 +1783,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid webClrSolid = mytrap(webClrName, trapWebClr); Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); - const EcalTrap trapWebPl(trapWebClr.A() / 2, // A/2 - trapWebClr.a() / 2, // a/2 - trapWebClr.b() / 2, // b/2 - web.vecWebPlTh[iWeb] / 2, // H/2 - web.vecWebPlTh[iWeb] / 2, // h/2 - trapWebClr.L() / 2., // L/2 + const EcalTrap trapWebPl(0.5 * trapWebClr.A(), // A/2 + 0.5 * trapWebClr.a(), // a/2 + 0.5 * trapWebClr.b(), // b/2 + 0.5 * web.vecWebPlTh[iWeb], // H/2 + 0.5 * web.vecWebPlTh[iWeb], // h/2 + 0.5 * trapWebClr.L(), // L/2 90._deg, // alfa1 trapWebClr.b() - trapWebClr.B(), // x15 0 // y15 @@ -1842,17 +1856,17 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - const Position outtra(back.xOff + back.sideHeight / 2, back.yOff, back.sideLength / 2); + const Position outtra(back.xOff + 0.5 * back.sideHeight, back.yOff, 0.5 * back.sideLength); const double realBPthick(back.plateThick + back.plate2Thick); - array<double, 3> backPlateParms{{back.plateWidth / 2., realBPthick / 2., back.plateLength / 2.}}; + array<double, 3> backPlateParms{{0.5 * back.plateWidth, 0.5 * realBPthick, 0.5 * back.plateLength}}; Solid backPlateSolid = Box(backPlateParms[0], backPlateParms[1], backPlateParms[2]); Volume backPlateLog = Volume(back.plateName, backPlateSolid, ns.material(back.plateMat)); const Position backPlateTra( - back.sideHeight / 2 + backPlateParms[1], 0_mm, backPlateParms[2] - back.sideLength / 2); + 0.5 * back.sideHeight + backPlateParms[1], 0_mm, backPlateParms[2] - 0.5 * back.sideLength); - Solid backPlate2Solid = Box(back.plateWidth / 2., back.plate2Thick / 2., back.plateLength / 2.); + Solid backPlate2Solid = Box(0.5 * back.plateWidth, 0.5 * back.plate2Thick, 0.5 * back.plateLength); Volume backPlate2Log = Volume(back.plate2Name, backPlate2Solid, ns.material(back.plate2Mat)); const Position backPlate2Tra(0_mm, -backPlateParms[1] + back.plate2Thick / 2., 0_mm); @@ -2107,13 +2121,13 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext thickVFE += backCool.vecBackVFELyrThick[iLyr]; } Solid backVFESolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., thickVFE / 2.); - Volume backVFELog = ns.addVolumeNS(Volume(myns + backCool.vFEName, backVFESolid, ns.material(backCool.vFEMat))); + Volume backVFELog = ns.addVolume(Volume(myns + backCool.vFEName, backVFESolid, ns.material(backCool.vFEMat))); Position offTra(0, 0, -thickVFE / 2); for (unsigned int iLyr(0); iLyr != backCool.vecBackVFELyrThick.size(); ++iLyr) { Solid backVFELyrSolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., backCool.vecBackVFELyrThick[iLyr] / 2.); Volume backVFELyrLog = - Volume(backCool.vecBackVFELyrName[iLyr], backVFELyrSolid, ns.material(backCool.vecBackVFELyrMat[iLyr])); + Volume(backCool.vecBackVFELyrName[iLyr], backVFELyrSolid, ns.material(backCool.vecBackVFELyrMat[iLyr])); const Position backVFELyrTra(0, 0, backCool.vecBackVFELyrThick[iLyr] / 2); backVFELog.placeVolume(backVFELyrLog, copyOne, Transform3D(backVFELyrTra + offTra)); #ifdef EDM_ML_DEBUG @@ -2192,10 +2206,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext bottomThick += mbLyr.vecMBLyrThick[iMB]; } - string backCName(backCool.vecName[iMod]); const double halfZBCool((pipeLength - 2 * mbManif.outDiam - grille.zSpace) / 2); Solid backCoolSolid = Box(backCoolHeight / 2., backCoolWidth / 2., halfZBCool); - Volume backCoolLog = Volume(backCName, backCoolSolid, ns.material(spm.mat)); + Volume backCoolLog = Volume(backCool.vecName[iMod], backCoolSolid, ns.material(spm.mat)); const Position bCoolTra( -realBPthick / 2 + backCoolHeight / 2 - grille.vecHeight[2 * iMod], @@ -2260,11 +2273,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Position bSumTra(backCool.barHeight - backCoolHeight / 2. + bottomThick, 0, 0); for (unsigned int j(0); j != nMisc; ++j) { // loop over miscellaneous layers - const string bName(backMisc.vecName[iMod * nMisc + j]); Solid bSolid = Box(backMisc.vecThick[iMod * nMisc + j] / 2, backCool.barWidth / 2. + backCoolTank.width, halfZBCool); - Volume bLog = Volume(bName, bSolid, ns.material(backMisc.vecMat[iMod * nMisc + j])); + Volume bLog = Volume(backMisc.vecName[iMod * nMisc + j], bSolid, ns.material(backMisc.vecMat[iMod * nMisc + j])); const Position bTra(backMisc.vecThick[iMod * nMisc + j] / 2, 0_mm, 0_mm); @@ -2284,9 +2296,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Position mTra(-backCoolHeight / 2. + mbCoolTube.outDiam, 0, 0); for (unsigned int j(0); j != mbLyr.vecMBLyrThick.size(); ++j) // loop over MB layers { - const string mName(mbLyr.vecMBLyrName[j] + "_" + std::to_string(iMod + 1)); Solid mSolid = Box(mbLyr.vecMBLyrThick[j] / 2, bHalfWidth, halfZBCool); - Volume mLog = Volume(mName, mSolid, ns.material(mbLyr.vecMBLyrMat[j])); + Volume mLog = Volume(mbLyr.vecMBLyrName[j] + "_" + std::to_string(iMod + 1), mSolid, ns.material(mbLyr.vecMBLyrMat[j])); mTra += Position(mbLyr.vecMBLyrThick[j] / 2.0, 0_mm, 0_mm); backCoolLog.placeVolume(mLog, copyOne, Transform3D(Rotation3D(), mTra)); @@ -2379,7 +2390,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid dryAirTubeSolid = Tube(dryAirTubName, dryAirTube.innDiam / 2, dryAirTube.outDiam / 2, pipeLength / 2, 0_deg, 360_deg); - Volume dryAirTubeLog = Volume(dryAirTubName, dryAirTubeSolid, ns.material(dryAirTube.mat)); + Volume dryAirTubeLog = Volume(ns.prepend(dryAirTubName), dryAirTubeSolid, ns.material(dryAirTube.mat)); const Position dryAirTubeTra1(back.xOff + back.sideHeight - 0.7 * dryAirTube.outDiam - backPipe.vecDiam[iMod], back.yOff + back.plateWidth / 2 - back.sideWidth - 1.2 * dryAirTube.outDiam, @@ -2466,10 +2477,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Position pTra(-patchParms[0], 0, 0); for (unsigned int j(0); j != patchPanel.vecNames.size(); ++j) { - const string pName(patchPanel.vecNames[j]); Solid pSolid = Box(patchPanel.vecThick[j] / 2., patchParms[1], patchParms[2]); - Volume pLog = Volume(pName, pSolid, ns.material(patchPanel.vecMat[j])); + Volume pLog = Volume(patchPanel.vecNames[j], pSolid, ns.material(patchPanel.vecMat[j])); pTra += Position(patchPanel.vecThick[j] / 2, 0_mm, 0_mm); patchLog.placeVolume(pLog, copyOne, pTra); @@ -2494,23 +2504,23 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext if (0 != pincer.rodHere) { // Make hierarchy of rods, envelopes, blocks, shims, and cutouts - Solid rodSolid = Box(pincer.rodName, pincer.envWidth / 2., pincer.envHeight / 2., ilyLength / 2); + Solid rodSolid = Box(pincer.rodName, pincer.envWidthHalf, pincer.envHeightHalf, ilyLengthHalf); Volume rodLog = Volume(pincer.rodName, rodSolid, ns.material(pincer.rodMat)); - array<double, 3> envParms{{pincer.envWidth / 2., pincer.envHeight / 2., pincer.envLength / 2}}; + array<double, 3> envParms{{pincer.envWidthHalf, pincer.envHeightHalf, pincer.envLengthHalf}}; Solid envSolid = Box(pincer.envName, envParms[0], envParms[1], envParms[2]); Volume envLog = Volume(pincer.envName, envSolid, ns.material(pincer.envMat)); - array<double, 3> blkParms{{pincer.envWidth / 2., pincer.envHeight / 2., pincer.blkLength / 2}}; + array<double, 3> blkParms{{pincer.envWidthHalf, pincer.envHeightHalf, pincer.blkLengthHalf}}; Solid blkSolid = Box(pincer.blkName, blkParms[0], blkParms[1], blkParms[2]); Volume blkLog = Volume(pincer.blkName, blkSolid, ns.material(pincer.blkMat)); - envLog.placeVolume(blkLog, copyOne, Position(0_mm, 0_mm, pincer.envLength / 2 - pincer.blkLength / 2)); + envLog.placeVolume(blkLog, copyOne, Position(0_mm, 0_mm, pincer.envLengthHalf - pincer.blkLengthHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << blkLog.name() << ":" << copyOne << " positioned in " << envLog.name(); #endif - array<double, 3> cutParms{{pincer.cutWidth / 2., pincer.cutHeight / 2., pincer.blkLength / 2}}; + array<double, 3> cutParms{{pincer.cutWidth / 2., pincer.cutHeight / 2., pincer.blkLengthHalf}}; Solid cutSolid = Box(pincer.cutName, cutParms[0], cutParms[1], cutParms[2]); Volume cutLog = Volume(pincer.cutName, cutSolid, ns.material(pincer.cutMat)); blkLog.placeVolume( @@ -2521,7 +2531,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << cutLog.name() << ":" << copyOne << " positioned in " << blkLog.name(); #endif - array<double, 3> shim2Parms{{pincer.shim2Width / 2., pincer.shimHeight / 2., pincer.blkLength / 2}}; + array<double, 3> shim2Parms{{pincer.shim2Width / 2., pincer.shimHeight / 2., pincer.blkLengthHalf}}; Solid shim2Solid = Box(pincer.shim2Name, shim2Parms[0], shim2Parms[1], shim2Parms[2]); Volume shim2Log = Volume(pincer.shim2Name, shim2Solid, ns.material(pincer.shimMat)); cutLog.placeVolume( @@ -2531,7 +2541,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #endif array<double, 3> shim1Parms{ - {pincer.shim1Width / 2., pincer.shimHeight / 2., (pincer.envLength - pincer.blkLength) / 2}}; + {pincer.shim1Width / 2., pincer.shimHeight / 2., pincer.envLengthHalf - pincer.blkLengthHalf}}; Solid shim1Solid = Box(pincer.shim1Name, shim1Parms[0], shim1Parms[1], shim1Parms[2]); Volume shim1Log = Volume(pincer.shim1Name, shim1Solid, ns.material(pincer.shimMat)); envLog.placeVolume( @@ -2545,14 +2555,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext for (unsigned int iEnv(0); iEnv != pincer.vecEnvZOff.size(); ++iEnv) { rodLog.placeVolume(envLog, 1 + iEnv, - Position(0_mm, 0_mm, -ilyLength / 2. + pincer.vecEnvZOff[iEnv] - pincer.envLength / 2.)); + Position(0_mm, 0_mm, -ilyLengthHalf + pincer.vecEnvZOff[iEnv] - pincer.envLengthHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << envLog.name() << ":" << (1 + iEnv) << " positioned in " << rodLog.name(); #endif } // Place the rods - const double radius(ilyRMin - pincer.envHeight / 2 - 1_mm); + const double radius(ilyRMin - pincer.envHeightHalf - 1_mm); const string xilyName(ily.name + std::to_string(ily.vecIlyMat.size() - 1)); for (unsigned int iRod(0); iRod != pincer.vecRodAzimuth.size(); ++iRod) { From 60baa8f3d760a4aac57e3f25a52a8fe545e83d49 Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Wed, 21 Oct 2020 16:58:07 +0200 Subject: [PATCH 765/778] code format --- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 319 +++++++++--------- 1 file changed, 166 insertions(+), 153 deletions(-) diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index 6f30a2a303c84..99860f3bf0567 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -129,25 +129,25 @@ namespace { unsigned int nCryPerAlvEta; // number of crystals in eta per alveolus }; struct Capsule { - string name; // Capsule - double here; // - string mat; // + string name; // Capsule + double here; // + string mat; // double xSizeHalf; // double ySizeHalf; // double thickHalf; // }; struct Ceramic { - string name; // Ceramic - string mat; // + string name; // Ceramic + string mat; // double xSizeHalf; // double ySizeHalf; // double thickHalf; // }; struct BulkSilicon { - string name; // Bulk Silicon - string mat; // + string name; // Bulk Silicon + string mat; // double xSizeHalf; // double ySizeHalf; // double thickHalf; // @@ -162,8 +162,8 @@ namespace { double x1; // double x2; // - string atjName; // After-The-Junction - string atjMat; // + string atjName; // After-The-Junction + string atjMat; // double atjThickHalf; // string sglName; // APD-Silicone glue @@ -198,15 +198,15 @@ namespace { VecStr vecIlyMat; // materials of inner layer volumes VecDouble vecIlyThick; // Thicknesses of inner layer volumes - string pipeName; // Cooling pipes - double pipeHere; // - string pipeMat; // + string pipeName; // Cooling pipes + double pipeHere; // + string pipeMat; // double pipeODHalf; // - double pipeID; // + double pipeID; // VecDouble vecIlyPipeLengthHalf; // - VecDouble vecIlyPipeType; // - VecDouble vecIlyPipePhi; // - VecDouble vecIlyPipeZ; // + VecDouble vecIlyPipeType; // + VecDouble vecIlyPipePhi; // + VecDouble vecIlyPipeZ; // string pTMName; // PTM double pTMHere; // @@ -220,24 +220,24 @@ namespace { string fanOutName; // FanOut double fanOutHere; // string fanOutMat; // - double fanOutWidthHalf; // - double fanOutLengthHalf; // + double fanOutWidthHalf; // + double fanOutLengthHalf; // double fanOutHeightHalf; // VecDouble vecIlyFanOutZ; // VecDouble vecIlyFanOutPhi; // string diffName; // Diffuser string diffMat; // double diffOff; // - double diffLengthHalf; // + double diffLengthHalf; // string bndlName; // Fiber bundle string bndlMat; // double bndlOff; // - double bndlLengthHalf; // + double bndlLengthHalf; // string fEMName; // FEM string fEMMat; // - double fEMWidthHalf; // - double fEMLengthHalf; // - double fEMHeightHalf; // + double fEMWidthHalf; // + double fEMLengthHalf; // + double fEMHeightHalf; // VecDouble vecIlyFEMZ; // VecDouble vecIlyFEMPhi; // }; @@ -422,13 +422,13 @@ namespace { string envName; // pincer envelope string envMat; // - double envWidthHalf; // - double envHeightHalf; // - double envLengthHalf; // + double envWidthHalf; // + double envHeightHalf; // + double envLengthHalf; // VecDouble vecEnvZOff; // - string blkName; // pincer block - string blkMat; // + string blkName; // pincer block + string blkMat; // double blkLengthHalf; // string shim1Name; // pincer shim @@ -485,51 +485,51 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext // Barrel volume // barrel parent volume Barrel bar; - bar.name = ns.prepend(args.str("BarName")); // Barrel volume name - bar.mat = args.str("BarMat"); // Barrel material name - bar.vecZPts = args.vecDble("BarZPts"); // Barrel list of z pts - bar.vecRMin = args.vecDble("BarRMin"); // Barrel list of rMin pts - bar.vecRMax = args.vecDble("BarRMax"); // Barrel list of rMax pts - bar.vecTran = args.vecDble("BarTran"); // Barrel translation - bar.vecRota = args.vecDble("BarRota"); // Barrel rotation - bar.vecRota2 = args.vecDble("BarRota2"); // 2nd Barrel rotation - bar.vecRota3 = args.vecDble("BarRota3"); // 3rd Barrel rotation - bar.phiLo = args.dble("BarPhiLo"); // Barrel phi lo - bar.phiHi = args.dble("BarPhiHi"); // Barrel phi hi - bar.here = args.dble("BarHere"); // Barrel presence flag + bar.name = ns.prepend(args.str("BarName")); // Barrel volume name + bar.mat = args.str("BarMat"); // Barrel material name + bar.vecZPts = args.vecDble("BarZPts"); // Barrel list of z pts + bar.vecRMin = args.vecDble("BarRMin"); // Barrel list of rMin pts + bar.vecRMax = args.vecDble("BarRMax"); // Barrel list of rMax pts + bar.vecTran = args.vecDble("BarTran"); // Barrel translation + bar.vecRota = args.vecDble("BarRota"); // Barrel rotation + bar.vecRota2 = args.vecDble("BarRota2"); // 2nd Barrel rotation + bar.vecRota3 = args.vecDble("BarRota3"); // 3rd Barrel rotation + bar.phiLo = args.dble("BarPhiLo"); // Barrel phi lo + bar.phiHi = args.dble("BarPhiHi"); // Barrel phi hi + bar.here = args.dble("BarHere"); // Barrel presence flag // Supermodule volume Supermodule spm; - spm.name = ns.prepend(args.str("SpmName")); // Supermodule volume name - spm.mat = args.str("SpmMat"); // Supermodule material name - spm.vecZPts = args.vecDble("SpmZPts"); // Supermodule list of z pts - spm.vecRMin = args.vecDble("SpmRMin"); // Supermodule list of rMin pts - spm.vecRMax = args.vecDble("SpmRMax"); // Supermodule list of rMax pts - spm.vecTran = args.vecDble("SpmTran"); // Supermodule translation - spm.vecRota = args.vecDble("SpmRota"); // Supermodule rotation - spm.vecBTran = args.vecDble("SpmBTran"); // Base Supermodule translation - spm.vecBRota = args.vecDble("SpmBRota"); // Base Supermodule rotation - spm.nPerHalf = args.integer("SpmNPerHalf"); // # Supermodules per half detector - spm.lowPhi = args.dble("SpmLowPhi"); // Low phi value of base supermodule - spm.delPhi = args.dble("SpmDelPhi"); // Delta phi value of base supermodule - spm.phiOff = args.dble("SpmPhiOff"); // Phi offset value supermodule - spm.vecHere = args.vecDble("SpmHere"); // Bit saying if a supermodule is present or not - spm.cutName = ns.prepend(args.str("SpmCutName")); // Name of cut box - spm.cutThick = args.dble("SpmCutThick"); // Box thickness - spm.cutShow = args.value<int>("SpmCutShow"); // Non-zero means show the box on display (testing only) - spm.vecCutTM = args.vecDble("SpmCutTM"); // Translation for minus phi cut box - spm.vecCutTP = args.vecDble("SpmCutTP"); // Translation for plus phi cut box - spm.cutRM = args.dble("SpmCutRM"); // Rotation for minus phi cut box - spm.cutRP = args.dble("SpmCutRP"); // Rotation for plus phi cut box - spm.expThick = args.dble("SpmExpThick"); // Thickness (x) of supermodule expansion box - spm.expWide = args.dble("SpmExpWide"); // Width (y) of supermodule expansion box - spm.expYOff = args.dble("SpmExpYOff"); // Offset (y) of supermodule expansion box - spm.sideName = ns.prepend(args.str("SpmSideName")); // Supermodule Side Plate volume name - spm.sideMat = args.str("SpmSideMat"); // Supermodule Side Plate material name - spm.sideHigh = args.dble("SpmSideHigh"); // Side plate height - spm.sideThick = args.dble("SpmSideThick"); // Side plate thickness - spm.sideYOffM = args.dble("SpmSideYOffM"); // Side plate Y offset on minus phi side - spm.sideYOffP = args.dble("SpmSideYOffP"); // Side plate Y offset on plus phi side + spm.name = ns.prepend(args.str("SpmName")); // Supermodule volume name + spm.mat = args.str("SpmMat"); // Supermodule material name + spm.vecZPts = args.vecDble("SpmZPts"); // Supermodule list of z pts + spm.vecRMin = args.vecDble("SpmRMin"); // Supermodule list of rMin pts + spm.vecRMax = args.vecDble("SpmRMax"); // Supermodule list of rMax pts + spm.vecTran = args.vecDble("SpmTran"); // Supermodule translation + spm.vecRota = args.vecDble("SpmRota"); // Supermodule rotation + spm.vecBTran = args.vecDble("SpmBTran"); // Base Supermodule translation + spm.vecBRota = args.vecDble("SpmBRota"); // Base Supermodule rotation + spm.nPerHalf = args.integer("SpmNPerHalf"); // # Supermodules per half detector + spm.lowPhi = args.dble("SpmLowPhi"); // Low phi value of base supermodule + spm.delPhi = args.dble("SpmDelPhi"); // Delta phi value of base supermodule + spm.phiOff = args.dble("SpmPhiOff"); // Phi offset value supermodule + spm.vecHere = args.vecDble("SpmHere"); // Bit saying if a supermodule is present or not + spm.cutName = ns.prepend(args.str("SpmCutName")); // Name of cut box + spm.cutThick = args.dble("SpmCutThick"); // Box thickness + spm.cutShow = args.value<int>("SpmCutShow"); // Non-zero means show the box on display (testing only) + spm.vecCutTM = args.vecDble("SpmCutTM"); // Translation for minus phi cut box + spm.vecCutTP = args.vecDble("SpmCutTP"); // Translation for plus phi cut box + spm.cutRM = args.dble("SpmCutRM"); // Rotation for minus phi cut box + spm.cutRP = args.dble("SpmCutRP"); // Rotation for plus phi cut box + spm.expThick = args.dble("SpmExpThick"); // Thickness (x) of supermodule expansion box + spm.expWide = args.dble("SpmExpWide"); // Width (y) of supermodule expansion box + spm.expYOff = args.dble("SpmExpYOff"); // Offset (y) of supermodule expansion box + spm.sideName = ns.prepend(args.str("SpmSideName")); // Supermodule Side Plate volume name + spm.sideMat = args.str("SpmSideMat"); // Supermodule Side Plate material name + spm.sideHigh = args.dble("SpmSideHigh"); // Side plate height + spm.sideThick = args.dble("SpmSideThick"); // Side plate thickness + spm.sideYOffM = args.dble("SpmSideYOffM"); // Side plate Y offset on minus phi side + spm.sideYOffP = args.dble("SpmSideYOffP"); // Side plate Y offset on plus phi side Crystal cry; cry.nomCryDimAF = args.dble("NomCryDimAF"); @@ -646,9 +646,11 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ily.pipeODHalf = 0.5 * args.dble("IlyPipeOD"); ily.pipeID = args.dble("IlyPipeID"); ily.vecIlyPipeLengthHalf = args.vecDble("IlyPipeLength"); - std::transform(ily.vecIlyPipeLengthHalf.begin(), ily.vecIlyPipeLengthHalf.end(), ily.vecIlyPipeLengthHalf.begin(), - [](double length) -> double { return 0.5 * length; }); - + std::transform(ily.vecIlyPipeLengthHalf.begin(), + ily.vecIlyPipeLengthHalf.end(), + ily.vecIlyPipeLengthHalf.begin(), + [](double length) -> double { return 0.5 * length; }); + ily.vecIlyPipeType = args.vecDble("IlyPipeType"); ily.vecIlyPipePhi = args.vecDble("IlyPipePhi"); ily.vecIlyPipeZ = args.vecDble("IlyPipeZ"); @@ -765,8 +767,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext BackCooling backCool; backCool.here = args.dble("BackCoolHere"); backCool.vecName = args.vecStr("BackCoolName"); - std::transform(backCool.vecName.begin(), backCool.vecName.end(), backCool.vecName.begin(), - [&ns](std::string name) -> std::string { return ns.prepend(name); }); + std::transform(backCool.vecName.begin(), + backCool.vecName.end(), + backCool.vecName.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); backCool.barHere = args.dble("BackCoolBarHere"); backCool.barWidth = args.dble("BackCoolBarWidth"); backCool.barHeight = args.dble("BackCoolBarHeight"); @@ -787,8 +791,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext backCool.backVFEMat = args.str("BackVFEMat"); backCool.vecBackVFELyrThick = args.vecDble("BackVFELyrThick"); backCool.vecBackVFELyrName = args.vecStr("BackVFELyrName"); - std::transform(backCool.vecBackVFELyrName.begin(), backCool.vecBackVFELyrName.end(), backCool.vecBackVFELyrName.begin(), - [&ns](std::string name) -> std::string { return ns.prepend(name); }); + std::transform(backCool.vecBackVFELyrName.begin(), + backCool.vecBackVFELyrName.end(), + backCool.vecBackVFELyrName.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); backCool.vecBackVFELyrMat = args.vecStr("BackVFELyrMat"); backCool.vecBackCoolNSec = args.vecDble("BackCoolNSec"); backCool.vecBackCoolSecSep = args.vecDble("BackCoolSecSep"); @@ -798,8 +804,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext backMisc.here = args.dble("BackMiscHere"); backMisc.vecThick = args.vecDble("BackMiscThick"); backMisc.vecName = args.vecStr("BackMiscName"); - std::transform(backMisc.vecName.begin(), backMisc.vecName.end(), backMisc.vecName.begin(), - [&ns](std::string name) -> std::string { return ns.prepend(name); }); + std::transform(backMisc.vecName.begin(), + backMisc.vecName.end(), + backMisc.vecName.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); backMisc.vecMat = args.vecStr("BackMiscMat"); backMisc.backCBStdSep = args.dble("BackCBStdSep"); @@ -807,9 +815,11 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext patchPanel.here = args.dble("PatchPanelHere"); patchPanel.vecThick = args.vecDble("PatchPanelThick"); patchPanel.vecNames = args.vecStr("PatchPanelNames"); - std::transform(patchPanel.vecNames.begin(), patchPanel.vecNames.end(), patchPanel.vecNames.begin(), - [&ns](std::string name) -> std::string { return ns.prepend(name); }); - + std::transform(patchPanel.vecNames.begin(), + patchPanel.vecNames.end(), + patchPanel.vecNames.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); + patchPanel.vecMat = args.vecStr("PatchPanelMat"); patchPanel.name = ns.prepend(args.str("PatchPanelName")); @@ -852,8 +862,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext mbLyr.here = args.dble("MBLyrHere"); mbLyr.vecMBLyrThick = args.vecDble("MBLyrThick"); mbLyr.vecMBLyrName = args.vecStr("MBLyrName"); - std::transform(mbLyr.vecMBLyrName.begin(), mbLyr.vecMBLyrName.end(), mbLyr.vecMBLyrName.begin(), - [&ns](std::string name) -> std::string { return ns.prepend(name); }); + std::transform(mbLyr.vecMBLyrName.begin(), + mbLyr.vecMBLyrName.end(), + mbLyr.vecMBLyrName.begin(), + [&ns](std::string name) -> std::string { return ns.prepend(name); }); mbLyr.vecMBLyrMat = args.vecStr("MBLyrMat"); Pincer pincer; @@ -1023,7 +1035,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid ilySolid = Tube(ily.name, ilyRMin, // rmin ilyRMin + ilyThick, // rmax - ilyLengthHalf, // dz + ilyLengthHalf, // dz ily.phiLow, // startPhi ily.phiLow + ily.delPhi); // startPhi + deltaPhi Volume ilyLog = Volume(ily.name, ilySolid, ns.material(spm.mat)); @@ -1038,20 +1050,20 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext string pName(ily.pipeName + "_" + std::to_string(iPipeType + 1)); Solid ilyPipeSolid = Tube(pName, - 0, // rmin + 0, // rmin ily.pipeODHalf, // rmax ily.vecIlyPipeLengthHalf[iPipeType], // dz - 0_deg, // startPhi - 360_deg); // startPhi + deltaPhi + 0_deg, // startPhi + 360_deg); // startPhi + deltaPhi ilyPipeLog[iPipeType] = Volume(pName, ilyPipeSolid, ns.material(ily.pipeMat)); string pWaName(ily.pipeName + "Wa_" + std::to_string(iPipeType + 1)); Solid ilyPipeWaSolid = Tube(pWaName, - 0, // rmin - 0.5 * ily.pipeID, // rmax + 0, // rmin + 0.5 * ily.pipeID, // rmax ily.vecIlyPipeLengthHalf[iPipeType], // dz - 0_deg, // startPhi - 360_deg); // startPhi + deltaPhi + 0_deg, // startPhi + 360_deg); // startPhi + deltaPhi Volume ilyPipeWaLog = Volume(pWaName, ilyPipeWaSolid, ns.material(backPipe.waterMat)); ilyPipeLog[iPipeType].placeVolume(ilyPipeWaLog, copyOne); #ifdef EDM_ML_DEBUG @@ -1236,9 +1248,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext 0.5 * H_hawR, //double aHalfLengthYNegZ , // h1, H/2 0.5 * h_hawR, //double aHalfLengthYPosZ , // h2, h/2 0.5 * L_hawR, //double aHalfLengthZ , // dz, L/2 - 90_deg, //double aAngleAD , // alfa1 - 0, //double aCoord15X , // x15 - 0 //double aCoord15Y // y15 + 90_deg, //double aAngleAD , // alfa1 + 0, //double aCoord15X , // x15 + 0 //double aCoord15Y // y15 ); string hawRName1(alvWedge.hawRName + "1"); @@ -1247,15 +1259,15 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double al1_fawR(atan((B_hawR - a_hawR) / H_hawR) + M_PI_2); // here is trap for Full Alveolar Wedge - const EcalTrap trapFAW(a_hawR, //double aHalfLengthXNegZLoY , // bl1, A/2 - a_hawR, //double aHalfLengthXPosZLoY , // bl2, a/2 - b_hawR, //double aHalfLengthXPosZHiY , // tl2, b/2 + const EcalTrap trapFAW(a_hawR, //double aHalfLengthXNegZLoY , // bl1, A/2 + a_hawR, //double aHalfLengthXPosZLoY , // bl2, a/2 + b_hawR, //double aHalfLengthXPosZHiY , // tl2, b/2 0.5 * H_hawR, //double aHalfLengthYNegZ , // h1, H/2 0.5 * h_hawR, //double aHalfLengthYPosZ , // h2, h/2 0.5 * L_hawR, //double aHalfLengthZ , // dz, L/2 - al1_fawR, //double aAngleAD , // alfa1 - 0, //double aCoord15X , // x15 - 0 //double aCoord15Y // y15 + al1_fawR, //double aAngleAD , // alfa1 + 0, //double aCoord15X , // x15 + 0 //double aCoord15Y // y15 ); const string fawName1(alvWedge.fawName + "1"); @@ -1348,7 +1360,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext for (unsigned int iPhi(1); iPhi <= alvWedge.nFawPerSupm; ++iPhi) { const double rPhi(alvWedge.fawPhiOff + (iPhi - 0.5) * alvWedge.fawDelPhi); - const Tf3D fawform(RoZ3D(rPhi) * Tl3D(alvWedge.fawRadOff + (trapFAW.H() + trapFAW.h()) / 4, 0, 0.5 * trapFAW.L()) * + const Tf3D fawform(RoZ3D(rPhi) * + Tl3D(alvWedge.fawRadOff + (trapFAW.H() + trapFAW.h()) / 4, 0, 0.5 * trapFAW.L()) * RoZ3D(-90_deg + alvWedge.fawPhiRot)); if (alvWedge.fawHere) { spmLog.placeVolume( @@ -1372,13 +1385,13 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const EcalTrap trapGrid(0.5 * (B_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR), // bl1, A/2 0.5 * (b_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR), // bl2, a/2 - 0.5 * b_hawR, // tl2, b/2 - 0.5 * h_Grid, // h1, H/2 - 0.5 * h_Grid, // h2, h/2 - 0.5 * (L_hawR - 8_cm), // dz, L/2 - 90_deg, // alfa1 - 0, // x15 - H_hawR - h_hawR // y15 + 0.5 * b_hawR, // tl2, b/2 + 0.5 * h_Grid, // h1, H/2 + 0.5 * h_Grid, // h2, h/2 + 0.5 * (L_hawR - 8_cm), // dz, L/2 + 90_deg, // alfa1 + 0, // x15 + H_hawR - h_hawR // y15 ); Solid gridSolid = mytrap(grid.name, trapGrid); @@ -1450,12 +1463,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double alfCry(90_deg + atan((bNom - bUnd - aNom + aUnd) / (hNom - hUnd))); - const EcalTrap trapCry(0.5 * (ANom - AUnd), //double aHalfLengthXNegZLoY , // bl1, A/2 - 0.5 * (aNom - aUnd), //double aHalfLengthXPosZLoY , // bl2, a/2 - 0.5 * (bNom - bUnd), //double aHalfLengthXPosZHiY , // tl2, b/2 - 0.5 * (HNom - HUnd), //double aHalfLengthYNegZ , // h1, H/2 - 0.5 * (hNom - hUnd), //double aHalfLengthYPosZ , // h2, h/2 - 0.5 * (LNom - LUnd), //double aHalfLengthZ , // dz, L/2 + const EcalTrap trapCry(0.5 * (ANom - AUnd), //double aHalfLengthXNegZLoY , // bl1, A/2 + 0.5 * (aNom - aUnd), //double aHalfLengthXPosZLoY , // bl2, a/2 + 0.5 * (bNom - bUnd), //double aHalfLengthXPosZHiY , // tl2, b/2 + 0.5 * (HNom - HUnd), //double aHalfLengthYNegZ , // h1, H/2 + 0.5 * (hNom - hUnd), //double aHalfLengthYPosZ , // h2, h/2 + 0.5 * (LNom - LUnd), //double aHalfLengthZ , // dz, L/2 alfCry, //double aAngleAD , // alfa1 aNom - aUnd - ANom + AUnd, //double aCoord15X , // x15 hNom - hUnd - HNom + HUnd //double aCoord15Y // y15 @@ -1526,9 +1539,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext 0.5 * (HNom + sClr + rClr * sindelta), //double aHalfLengthYNegZ , // h1, H/2 0.5 * (hNom + sClr - fClr * sindelta), //double aHalfLengthYPosZ , // h2, h/2 0.5 * (LNom + fClr + rClr), // dz, L/2 - alfClr, //double aAngleAD , // alfa1 - aNom - ANom, //double aCoord15X , // x15 - hNom - HNom //double aCoord15Y // y15 + alfClr, //double aAngleAD , // alfa1 + aNom - ANom, //double aCoord15X , // x15 + hNom - HNom //double aCoord15Y // y15 ); const string clrDDName(cry.clrName + sType); @@ -1543,8 +1556,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext 0.5 * (trapClr.b() + 2. * sWrap - fWrap * sinbeta), // tl2, b/2 0.5 * (trapClr.H() + 2. * sWrap + rWrap * sindelta), // h1, H/2 0.5 * (trapClr.h() + 2. * sWrap - fWrap * sindelta), // h2, h/2 - 0.5 * (trapClr.L() + fWrap + rWrap), // dz, L/2 - alfWrap, //double aAngleAD , // alfa1 + 0.5 * (trapClr.L() + fWrap + rWrap), // dz, L/2 + alfWrap, //double aAngleAD , // alfa1 aNom - ANom - (cryType > 9 ? 0 : 0.020_mm), hNom - HNom //double aCoord15Y // y15 ); @@ -1562,8 +1575,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext 0.5 * (trapWrap.b() + 2 * sWall - fWall * sinbeta), // b/2 0.5 * (trapWrap.H() + 2 * sWall + rWall * sindelta), // H/2 0.5 * (trapWrap.h() + 2 * sWall - fWall * sindelta), // h/2 - 0.5 * (trapWrap.L() + fWall + rWall), // L/2 - alfWall, // alfa1 + 0.5 * (trapWrap.L() + fWall + rWall), // L/2 + alfWall, // alfa1 aNom - ANom - (cryType < 10 ? 0.150_mm : 0.100_mm), hNom - HNom // y15 ); @@ -1658,12 +1671,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double BWebx(trapWall.b() + (trapWall.B() - trapWall.b()) * LWebx / trapWall.L()); const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); - const EcalTrap trapWebClr(0.5 * BWebx, // A/2 - 0.5 * trapWall.b(), // a/2 - 0.5 * trapWall.b(), // b/2 - 0.5 * thick, // H/2 - 0.5 * thick, // h/2 - 0.5 * LWebx, // L/2 + const EcalTrap trapWebClr(0.5 * BWebx, // A/2 + 0.5 * trapWall.b(), // a/2 + 0.5 * trapWall.b(), // b/2 + 0.5 * thick, // H/2 + 0.5 * thick, // h/2 + 0.5 * LWebx, // L/2 90_deg, // alfa1 trapWall.b() - BWebx, // x15 0 // y15 @@ -1672,12 +1685,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid webClrSolid = mytrap(webClrName, trapWebClr); Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); - const EcalTrap trapWebPl(0.5 * trapWebClr.A(), // A/2 - 0.5 * trapWebClr.a(), // a/2 - 0.5 * trapWebClr.b(), // b/2 - 0.5 * web.vecWebPlTh[iWeb], // H/2 - 0.5 * web.vecWebPlTh[iWeb], // h/2 - 0.5 * trapWebClr.L(), // L/2 + const EcalTrap trapWebPl(0.5 * trapWebClr.A(), // A/2 + 0.5 * trapWebClr.a(), // a/2 + 0.5 * trapWebClr.b(), // b/2 + 0.5 * web.vecWebPlTh[iWeb], // H/2 + 0.5 * web.vecWebPlTh[iWeb], // h/2 + 0.5 * trapWebClr.L(), // L/2 90._deg, // alfa1 trapWebClr.b() - trapWebClr.B(), // x15 0 // y15 @@ -1769,12 +1782,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double BWebx(trapWall.a() + (trapWall.A() - trapWall.a()) * LWebx / trapWall.L()); const double thick(web.vecWebPlTh[iWeb] + web.vecWebClrTh[iWeb]); - const EcalTrap trapWebClr(0.5 * BWebx, // A/2 - 0.5 * trapWall.a(), // a/2 - 0.5 * trapWall.a(), // b/2 - 0.5 * thick, // H/2 - 0.5 * thick, // h/2 - 0.5 * LWebx, // L/2 + const EcalTrap trapWebClr(0.5 * BWebx, // A/2 + 0.5 * trapWall.a(), // a/2 + 0.5 * trapWall.a(), // b/2 + 0.5 * thick, // H/2 + 0.5 * thick, // h/2 + 0.5 * LWebx, // L/2 90_deg, // alfa1 trapWall.a() - BWebx, // x15 0 // y15 @@ -1783,12 +1796,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid webClrSolid = mytrap(webClrName, trapWebClr); Volume webClrLog = Volume(webClrName, webClrSolid, ns.material(web.clrMat)); - const EcalTrap trapWebPl(0.5 * trapWebClr.A(), // A/2 - 0.5 * trapWebClr.a(), // a/2 - 0.5 * trapWebClr.b(), // b/2 - 0.5 * web.vecWebPlTh[iWeb], // H/2 - 0.5 * web.vecWebPlTh[iWeb], // h/2 - 0.5 * trapWebClr.L(), // L/2 + const EcalTrap trapWebPl(0.5 * trapWebClr.A(), // A/2 + 0.5 * trapWebClr.a(), // a/2 + 0.5 * trapWebClr.b(), // b/2 + 0.5 * web.vecWebPlTh[iWeb], // H/2 + 0.5 * web.vecWebPlTh[iWeb], // h/2 + 0.5 * trapWebClr.L(), // L/2 90._deg, // alfa1 trapWebClr.b() - trapWebClr.B(), // x15 0 // y15 @@ -2127,7 +2140,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid backVFELyrSolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., backCool.vecBackVFELyrThick[iLyr] / 2.); Volume backVFELyrLog = - Volume(backCool.vecBackVFELyrName[iLyr], backVFELyrSolid, ns.material(backCool.vecBackVFELyrMat[iLyr])); + Volume(backCool.vecBackVFELyrName[iLyr], backVFELyrSolid, ns.material(backCool.vecBackVFELyrMat[iLyr])); const Position backVFELyrTra(0, 0, backCool.vecBackVFELyrThick[iLyr] / 2); backVFELog.placeVolume(backVFELyrLog, copyOne, Transform3D(backVFELyrTra + offTra)); #ifdef EDM_ML_DEBUG @@ -2276,7 +2289,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid bSolid = Box(backMisc.vecThick[iMod * nMisc + j] / 2, backCool.barWidth / 2. + backCoolTank.width, halfZBCool); - Volume bLog = Volume(backMisc.vecName[iMod * nMisc + j], bSolid, ns.material(backMisc.vecMat[iMod * nMisc + j])); + Volume bLog = + Volume(backMisc.vecName[iMod * nMisc + j], bSolid, ns.material(backMisc.vecMat[iMod * nMisc + j])); const Position bTra(backMisc.vecThick[iMod * nMisc + j] / 2, 0_mm, 0_mm); @@ -2297,7 +2311,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext for (unsigned int j(0); j != mbLyr.vecMBLyrThick.size(); ++j) // loop over MB layers { Solid mSolid = Box(mbLyr.vecMBLyrThick[j] / 2, bHalfWidth, halfZBCool); - Volume mLog = Volume(mbLyr.vecMBLyrName[j] + "_" + std::to_string(iMod + 1), mSolid, ns.material(mbLyr.vecMBLyrMat[j])); + Volume mLog = Volume( + mbLyr.vecMBLyrName[j] + "_" + std::to_string(iMod + 1), mSolid, ns.material(mbLyr.vecMBLyrMat[j])); mTra += Position(mbLyr.vecMBLyrThick[j] / 2.0, 0_mm, 0_mm); backCoolLog.placeVolume(mLog, copyOne, Transform3D(Rotation3D(), mTra)); @@ -2477,7 +2492,6 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Position pTra(-patchParms[0], 0, 0); for (unsigned int j(0); j != patchPanel.vecNames.size(); ++j) { - Solid pSolid = Box(patchPanel.vecThick[j] / 2., patchParms[1], patchParms[2]); Volume pLog = Volume(patchPanel.vecNames[j], pSolid, ns.material(patchPanel.vecMat[j])); @@ -2553,9 +2567,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #endif for (unsigned int iEnv(0); iEnv != pincer.vecEnvZOff.size(); ++iEnv) { - rodLog.placeVolume(envLog, - 1 + iEnv, - Position(0_mm, 0_mm, -ilyLengthHalf + pincer.vecEnvZOff[iEnv] - pincer.envLengthHalf)); + rodLog.placeVolume( + envLog, 1 + iEnv, Position(0_mm, 0_mm, -ilyLengthHalf + pincer.vecEnvZOff[iEnv] - pincer.envLengthHalf)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << envLog.name() << ":" << (1 + iEnv) << " positioned in " << rodLog.name(); #endif From 0d7a7fb6dcef91c111513b7d8bc9d97d048eb8e9 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 21 Oct 2020 10:19:15 -0500 Subject: [PATCH 766/778] Removed obsolete fwkJobReports option from MessageLogger The option has done nothing for years so can safely be removed. --- .../MessageLogger_ReleaseValidation_cfi.py | 11 +--- .../python/MessageLogger_cfi.py | 15 +---- .../src/MessageLoggerDefaults.h | 1 - .../src/MessageServicePSetValidation.cc | 65 ------------------- .../src/MessageServicePSetValidation.h | 3 - 5 files changed, 3 insertions(+), 92 deletions(-) diff --git a/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py b/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py index e476e1be80d60..4b8ccb07152af 100644 --- a/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py +++ b/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py @@ -43,14 +43,6 @@ ), threshold = cms.untracked.string('INFO') ), - FrameworkJobReport = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(10000000) - ) - ), suppressWarning = cms.untracked.vstring(), statistics = cms.untracked.vstring('cerr_stats'), cerr_stats = cms.untracked.PSet( @@ -73,8 +65,7 @@ categories = cms.untracked.vstring('FwkJob', 'FwkReport', 'FwkSummary', - 'Root_NoDictionary'), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport') + 'Root_NoDictionary') ) diff --git a/FWCore/MessageService/python/MessageLogger_cfi.py b/FWCore/MessageService/python/MessageLogger_cfi.py index b45aed7202170..6dbc7845e0bd2 100644 --- a/FWCore/MessageService/python/MessageLogger_cfi.py +++ b/FWCore/MessageService/python/MessageLogger_cfi.py @@ -21,7 +21,7 @@ ), cerr = cms.untracked.PSet( optionalPSet = cms.untracked.bool(True), - INFO = cms.untracked.PSet( + INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ), noTimeStamps = cms.untracked.bool(False), @@ -48,16 +48,6 @@ ), threshold = cms.untracked.string('INFO') ), - FrameworkJobReport = cms.untracked.PSet( - optionalPSet = cms.untracked.bool(True), - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkJob = cms.untracked.PSet( - optionalPSet = cms.untracked.bool(True), - limit = cms.untracked.int32(10000000) - ) - ), suppressWarning = cms.untracked.vstring(), statistics = cms.untracked.vstring('cerr_stats'), cerr_stats = cms.untracked.PSet( @@ -83,8 +73,7 @@ categories = cms.untracked.vstring('FwkJob', 'FwkReport', 'FwkSummary', - 'Root_NoDictionary'), - fwkJobReports = cms.untracked.vstring('FrameworkJobReport') + 'Root_NoDictionary') ) diff --git a/FWCore/MessageService/src/MessageLoggerDefaults.h b/FWCore/MessageService/src/MessageLoggerDefaults.h index 1fd1bf3ff3c6d..646e5f7be2411 100644 --- a/FWCore/MessageService/src/MessageLoggerDefaults.h +++ b/FWCore/MessageService/src/MessageLoggerDefaults.h @@ -89,7 +89,6 @@ namespace edm { std::vector<std::string> categories; std::vector<std::string> destinations; - std::vector<std::string> fwkJobReports; std::vector<std::string> statistics; std::map<std::string, Destination> destination; diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.cc b/FWCore/MessageService/src/MessageServicePSetValidation.cc index bde88be565bfb..cc12625bda9ad 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.cc +++ b/FWCore/MessageService/src/MessageServicePSetValidation.cc @@ -63,7 +63,6 @@ namespace edm { destinationPSets(pset); defaultPSet(pset); statisticsPSets(pset); - fwkJobReportPSets(pset); categoryPSets(pset, "MessageLogger"); // No other PSets -- unless they contain optionalPSet or placeholder=True @@ -104,20 +103,12 @@ namespace edm { noKeywords(statistics, "MessageLogger", "statistics"); noNonPSetUsage(pset, statistics, "MessageLogger", "statistics"); - fwkJobReports = check<vString>(pset, "MessageLogger", "fwkJobReports"); - noDuplicates(fwkJobReports, "MessageLogger", "fwkJobReports"); - noKeywords(fwkJobReports, "MessageLogger", "fwkJobReports"); - noNonPSetUsage(pset, fwkJobReports, "MessageLogger", "fwkJobReports"); - noDuplicates(fwkJobReports, destinations, "MessageLogger", "fwkJobReports", "destinations"); - noDuplicates(fwkJobReports, statistics, "MessageLogger", "fwkJobReports", "statistics"); - categories = check<vString>(pset, "MessageLogger", "categories"); noDuplicates(categories, "MessageLogger", "categories"); noKeywords(categories, "MessageLogger", "categories"); noNonPSetUsage(pset, categories, "MessageLogger", "categories"); noDuplicates(categories, destinations, "MessageLogger", "categories", "destinations"); noDuplicates(categories, statistics, "MessageLogger", "categories", "statistics"); - noDuplicates(categories, fwkJobReports, "MessageLogger", "categories", "fwkJobReports"); messageIDs = check<vString>(pset, "MessageLogger", "messageIDs"); noDuplicates(messageIDs, "MessageLogger", "messageIDs"); @@ -125,8 +116,6 @@ namespace edm { noNonPSetUsage(pset, messageIDs, "MessageLogger", "messageIDs"); noDuplicates(messageIDs, destinations, "MessageLogger", "messageIDs", "destinations"); noDuplicates(messageIDs, statistics, "MessageLogger", "messageIDs", "statistics"); - noDuplicates(messageIDs, fwkJobReports, "MessageLogger", "messageIDs", "fwkJobReports"); - noDuplicates(messageIDs, fwkJobReports, "MessageLogger", "messageIDs", "categories"); } // psetLists @@ -209,8 +198,6 @@ namespace edm { return true; if (s == "destinations") return true; - if (s == "fwkJobReports") - return true; if (s == "categories") return true; if (s == "messageIDs") @@ -321,8 +308,6 @@ namespace edm { return false; if (word == "messageIDs") return false; - if (word == "fwkJobReports") - return false; if (word == "destinations") return false; if (word == "statistics") @@ -428,8 +413,6 @@ namespace edm { continue; if (lookForMatch(statistics, *i)) continue; - if (lookForMatch(fwkJobReports, *i)) - continue; if (lookForMatch(categories, *i)) continue; if (lookForMatch(messageIDs, *i)) @@ -630,54 +613,6 @@ namespace edm { } // statisticsPSet - void edm::service::MessageServicePSetValidation::fwkJobReportPSets(ParameterSet const& pset) { - ParameterSet empty_PSet; - std::vector<std::string>::const_iterator end = fwkJobReports.end(); - for (std::vector<std::string>::const_iterator i = fwkJobReports.begin(); i != end; ++i) { - ParameterSet const& d = pset.getUntrackedParameterSet(*i, empty_PSet); - fwkJobReportPSet(d, *i); - } - } // fwkJobReportPSets - - void edm::service::MessageServicePSetValidation::fwkJobReportPSet(ParameterSet const& pset, - std::string const& psetName) { - // Category PSets - - categoryPSets(pset, psetName); - - // No other PSets -- unless they contain optionalPSet or placeholder=True - - noNoncategoryPsets(pset, psetName); - - // General parameters - - check<bool>(pset, psetName, "placeholder"); - std::string s = check<std::string>(pset, "psetName", "filename"); - if ((s == "cerr") || (s == "cout")) { - flaws << psetName << " PSet: \n" << s << " is not allowed as a value of filename \n"; - } - s = check<std::string>(pset, "psetName", "extension"); - if ((s == "cerr") || (s == "cout")) { - flaws << psetName << " PSet: \n" << s << " is not allowed as a value of extension \n"; - } - s = check<std::string>(pset, "psetName", "output"); - - // No other parameters - - noneExcept<int>(pset, psetName, "int"); - - vString okbool; - okbool.push_back("placeholder"); - okbool.push_back("optionalPSet"); - noneExcept<bool>(pset, psetName, "bool", okbool); - vString okstring; - okstring.push_back("output"); - okstring.push_back("filename"); - okstring.push_back("extension"); - noneExcept<std::string>(pset, psetName, "string", okstring); - - } // fwkJobReportPSet - void edm::service::MessageServicePSetValidation::noNoncategoryPsets(ParameterSet const& pset, std::string const& psetName) { vString psnames; diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.h b/FWCore/MessageService/src/MessageServicePSetValidation.h index bf55c09b9fcdf..4958a27bce1d4 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.h +++ b/FWCore/MessageService/src/MessageServicePSetValidation.h @@ -81,8 +81,6 @@ namespace edm { void defaultPSet(ParameterSet const& main_pset); void statisticsPSets(ParameterSet const& pset); void statisticsPSet(ParameterSet const& pset, std::string const& psetName); - void fwkJobReportPSets(ParameterSet const& pset); - void fwkJobReportPSet(ParameterSet const& pset, std::string const& psetName); void categoryPSets(ParameterSet const& pset, std::string const& psetName); void categoryPSet(ParameterSet const& pset, std::string const& OuterPsetName, std::string const& categoryName); void catInts(ParameterSet const& pset, std::string const& psetName, std::string const& categoryName); @@ -257,7 +255,6 @@ namespace edm { std::ostringstream flaws; std::vector<std::string> destinations; std::vector<std::string> statistics; - std::vector<std::string> fwkJobReports; std::vector<std::string> categories; std::vector<std::string> messageIDs; std::vector<std::string> debugModules; From 50a4088f40e80542e5f192a8a39fdc2a948f69e0 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 21 Oct 2020 10:58:00 -0500 Subject: [PATCH 767/778] FrameworkJobReport as a category needs to be removed This was only used by fwkJobReports option. --- .../MessageService/src/HardwiredDefaults.cc | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/FWCore/MessageService/src/HardwiredDefaults.cc b/FWCore/MessageService/src/HardwiredDefaults.cc index ebb51b0c80685..3ee9f48446f97 100644 --- a/FWCore/MessageService/src/HardwiredDefaults.cc +++ b/FWCore/MessageService/src/HardwiredDefaults.cc @@ -78,16 +78,6 @@ namespace edm { cerr.category["Root_NoDictionary"] = Root_NoDictionary; destination["cerr"] = cerr; } - { - Destination FrameworkJobReport; // PSet FrameworkJobReport - Category default_for_dest; // PSet default - default_for_dest.limit = 0; // int32 limit = 0 - FrameworkJobReport.category["default"] = default_for_dest; - Category FwkJob; // PSet FwkJob - FwkJob.limit = 10000000; // int32 limit = 10000000 - FrameworkJobReport.category["FwkJob"] = FwkJob; - destination["FrameworkJobReport"] = FrameworkJobReport; - } { Destination cerr_stats; // PSet cerr_stats cerr_stats.threshold = "WARNING"; // string threshold = "WARNING" @@ -133,16 +123,6 @@ namespace edm { cerr.category["Root_NoDictionary"] = Root_NoDictionary; destination["cerr"] = cerr; } - { - Destination FrameworkJobReport; // PSet FrameworkJobReport - Category default_for_dest; // PSet default - default_for_dest.limit = 0; // int32 limit = 0 - FrameworkJobReport.category["default"] = default_for_dest; - Category FwkJob; // PSet FwkJob - FwkJob.limit = 10000000; // int32 limit = 10000000 - FrameworkJobReport.category["FwkJob"] = FwkJob; - destination["FrameworkJobReport"] = FrameworkJobReport; - } { Destination cerr_stats; // PSet cerr_stats cerr_stats.threshold = "INFO"; // string threshold = "INFO" From 2209a878097936420a961ef5cf90ce56d23bb0c8 Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 21 Oct 2020 11:00:23 -0500 Subject: [PATCH 768/778] Removed deprecated messageIDs parameter messageIDs was just an old synonym for categories. --- FWCore/MessageService/src/MessageLoggerScribe.cc | 9 --------- .../src/MessageServicePSetValidation.cc | 15 --------------- .../src/MessageServicePSetValidation.h | 1 - .../src/ThreadSafeLogMessageLoggerScribe.cc | 9 --------- FWCore/MessageService/test/messageLogger_cfg.py | 5 ++--- 5 files changed, 2 insertions(+), 37 deletions(-) diff --git a/FWCore/MessageService/src/MessageLoggerScribe.cc b/FWCore/MessageService/src/MessageLoggerScribe.cc index 0b59cd17b2c3f..425c9f7d787be 100644 --- a/FWCore/MessageService/src/MessageLoggerScribe.cc +++ b/FWCore/MessageService/src/MessageLoggerScribe.cc @@ -253,15 +253,6 @@ namespace edm { // grab list of categories vString categories = getAparameter<vString>(*job_pset_p, "categories", empty_vString); - // grab list of messageIDs -- these are a synonym for categories - // Note -- the use of messageIDs is deprecated in favor of categories - { - vString messageIDs = getAparameter<vString>(*job_pset_p, "messageIDs", empty_vString); - - // combine the lists, not caring about possible duplicates (for now) - copy_all(messageIDs, std::back_inserter(categories)); - } // no longer need messageIDs - // grab list of hardwired categories (hardcats) -- these are to be added // to the list of categories { diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.cc b/FWCore/MessageService/src/MessageServicePSetValidation.cc index cc12625bda9ad..13ffcb653f087 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.cc +++ b/FWCore/MessageService/src/MessageServicePSetValidation.cc @@ -110,13 +110,6 @@ namespace edm { noDuplicates(categories, destinations, "MessageLogger", "categories", "destinations"); noDuplicates(categories, statistics, "MessageLogger", "categories", "statistics"); - messageIDs = check<vString>(pset, "MessageLogger", "messageIDs"); - noDuplicates(messageIDs, "MessageLogger", "messageIDs"); - noKeywords(messageIDs, "MessageLogger", "messageIDs"); - noNonPSetUsage(pset, messageIDs, "MessageLogger", "messageIDs"); - noDuplicates(messageIDs, destinations, "MessageLogger", "messageIDs", "destinations"); - noDuplicates(messageIDs, statistics, "MessageLogger", "messageIDs", "statistics"); - } // psetLists void edm::service::MessageServicePSetValidation::suppressionLists(ParameterSet const& pset) { @@ -200,8 +193,6 @@ namespace edm { return true; if (s == "categories") return true; - if (s == "messageIDs") - return true; if (s == "debugModules") return true; if (s == "suppressInfo") @@ -306,8 +297,6 @@ namespace edm { return false; if (word == "categories") return false; - if (word == "messageIDs") - return false; if (word == "destinations") return false; if (word == "statistics") @@ -415,8 +404,6 @@ namespace edm { continue; if (lookForMatch(categories, *i)) continue; - if (lookForMatch(messageIDs, *i)) - continue; if ((*i) == "default") continue; ParameterSet empty_PSet; @@ -621,8 +608,6 @@ namespace edm { for (vString::const_iterator i = psnames.begin(); i != end; ++i) { if (lookForMatch(categories, *i)) continue; - if (lookForMatch(messageIDs, *i)) - continue; if ((*i) == "default") continue; if ((*i) == "ERROR") diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.h b/FWCore/MessageService/src/MessageServicePSetValidation.h index 4958a27bce1d4..b6038b5d6b09c 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.h +++ b/FWCore/MessageService/src/MessageServicePSetValidation.h @@ -256,7 +256,6 @@ namespace edm { std::vector<std::string> destinations; std::vector<std::string> statistics; std::vector<std::string> categories; - std::vector<std::string> messageIDs; std::vector<std::string> debugModules; std::vector<std::string> suppressInfo; std::vector<std::string> suppressFwkInfo; diff --git a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc index d34c39adfa77b..40fd2410d2e63 100644 --- a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc +++ b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc @@ -234,15 +234,6 @@ namespace edm { // grab list of categories vString categories = getAparameter<vString>(*job_pset_p, "categories", empty_vString); - // grab list of messageIDs -- these are a synonym for categories - // Note -- the use of messageIDs is deprecated in favor of categories - { - vString messageIDs = getAparameter<vString>(*job_pset_p, "messageIDs", empty_vString); - - // combine the lists, not caring about possible duplicates (for now) - copy_all(messageIDs, std::back_inserter(categories)); - } // no longer need messageIDs - // grab list of hardwired categories (hardcats) -- these are to be added // to the list of categories -- change log 24 { diff --git a/FWCore/MessageService/test/messageLogger_cfg.py b/FWCore/MessageService/test/messageLogger_cfg.py index 40d0477c6e55b..e435b65aaeafa 100644 --- a/FWCore/MessageService/test/messageLogger_cfg.py +++ b/FWCore/MessageService/test/messageLogger_cfg.py @@ -10,8 +10,6 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - messageIDs = cms.untracked.vstring('unimportant', - 'trkwarning'), default = cms.untracked.PSet( limit = cms.untracked.int32(100), timespan = cms.untracked.int32(60) @@ -37,7 +35,8 @@ threshold = cms.untracked.string('ERROR') ), debugModules = cms.untracked.vstring('sendSomeMessages'), - categories = cms.untracked.vstring('postBeginJob'), + categories = cms.untracked.vstring('postBeginJob', 'unimportant', + 'trkwarning'), destinations = cms.untracked.vstring('detailedInfo', 'critical') ) From 81b730f37a349210a787aa8daba29827d0b6b89b Mon Sep 17 00:00:00 2001 From: Chris Jones <chrisdjones15@gmail.com> Date: Wed, 21 Oct 2020 12:11:08 -0500 Subject: [PATCH 769/778] Remove unused FwkJob category from configurations --- FWCore/MessageLogger/src/JobReport.cc | 2 -- .../python/MessageLogger_ReleaseValidation_cfi.py | 6 +----- FWCore/MessageService/python/MessageLogger_cfi.py | 7 +------ FWCore/MessageService/src/HardwiredDefaults.cc | 12 ------------ 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/FWCore/MessageLogger/src/JobReport.cc b/FWCore/MessageLogger/src/JobReport.cc index 1f5dc6155b5da..78e5537d22303 100644 --- a/FWCore/MessageLogger/src/JobReport.cc +++ b/FWCore/MessageLogger/src/JobReport.cc @@ -665,7 +665,6 @@ namespace edm { msg << " </PerformanceSummary>\n" << "</PerformanceReport>\n"; msg << std::flush; - //LogInfo("FwkJob") << msg.str(); } } @@ -687,7 +686,6 @@ namespace edm { msg << " </PerformanceModule>\n" << "</PerformanceReport>\n"; msg << std::flush; - //LogInfo("FwkJob") << msg.str(); } } diff --git a/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py b/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py index 4b8ccb07152af..ec9e3ab40ebec 100644 --- a/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py +++ b/FWCore/MessageService/python/MessageLogger_ReleaseValidation_cfi.py @@ -34,9 +34,6 @@ Root_NoDictionary = cms.untracked.PSet( limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), FwkSummary = cms.untracked.PSet( reportEvery = cms.untracked.int32(1), limit = cms.untracked.int32(10000000) @@ -62,8 +59,7 @@ 'cout', 'cerr'), debugModules = cms.untracked.vstring(), - categories = cms.untracked.vstring('FwkJob', - 'FwkReport', + categories = cms.untracked.vstring('FwkReport', 'FwkSummary', 'Root_NoDictionary') ) diff --git a/FWCore/MessageService/python/MessageLogger_cfi.py b/FWCore/MessageService/python/MessageLogger_cfi.py index 6dbc7845e0bd2..9f2a995bb90c8 100644 --- a/FWCore/MessageService/python/MessageLogger_cfi.py +++ b/FWCore/MessageService/python/MessageLogger_cfi.py @@ -37,10 +37,6 @@ optionalPSet = cms.untracked.bool(True), limit = cms.untracked.int32(0) ), - FwkJob = cms.untracked.PSet( - optionalPSet = cms.untracked.bool(True), - limit = cms.untracked.int32(0) - ), FwkSummary = cms.untracked.PSet( optionalPSet = cms.untracked.bool(True), reportEvery = cms.untracked.int32(1), @@ -70,8 +66,7 @@ 'cout', 'cerr'), debugModules = cms.untracked.vstring(), - categories = cms.untracked.vstring('FwkJob', - 'FwkReport', + categories = cms.untracked.vstring('FwkReport', 'FwkSummary', 'Root_NoDictionary') ) diff --git a/FWCore/MessageService/src/HardwiredDefaults.cc b/FWCore/MessageService/src/HardwiredDefaults.cc index 3ee9f48446f97..7de9799087d92 100644 --- a/FWCore/MessageService/src/HardwiredDefaults.cc +++ b/FWCore/MessageService/src/HardwiredDefaults.cc @@ -45,7 +45,6 @@ namespace edm { void MessageLoggerDefaults::hardwireGridJobMode() { // std::cerr << " ======= hardwireGridJobMode() \n"; destinations.push_back("cerr"); - categories.push_back("FwkJob"); categories.push_back("FwkReport"); categories.push_back("FwkSummary"); categories.push_back("Root_NoDictionary"); @@ -70,9 +69,6 @@ namespace edm { FwkSummary.limit = 10000000; // int32 limit = 10000000 FwkSummary.reportEvery = 1; // int32 reportEvery = 1 cerr.category["FwkSummary"] = FwkSummary; - Category FwkJob; // PSet FwkJob - FwkJob.limit = 0; // int32 limit = 0 - cerr.category["FwkJob"] = FwkJob; Category Root_NoDictionary; // PSet Root_NoDictionary Root_NoDictionary.limit = 0; // int32 limit = 0 cerr.category["Root_NoDictionary"] = Root_NoDictionary; @@ -90,7 +86,6 @@ namespace edm { void MessageLoggerDefaults::hardwireReleaseValidationJobMode() { // std::cerr << " ======= hardwireReleaseValidationJobMode() \n"; destinations.push_back("cerr"); - categories.push_back("FwkJob"); categories.push_back("FwkReport"); categories.push_back("FwkSummary"); categories.push_back("Root_NoDictionary"); @@ -115,9 +110,6 @@ namespace edm { FwkSummary.limit = 10000000; // int32 limit = 10000000 FwkSummary.reportEvery = 1; // int32 reportEvery = 1 cerr.category["FwkSummary"] = FwkSummary; - Category FwkJob; // PSet FwkJob - FwkJob.limit = 0; // int32 limit = 0 - cerr.category["FwkJob"] = FwkJob; Category Root_NoDictionary; // PSet Root_NoDictionary Root_NoDictionary.limit = 0; // int32 limit = 0 cerr.category["Root_NoDictionary"] = Root_NoDictionary; @@ -135,7 +127,6 @@ namespace edm { void MessageLoggerDefaults::hardwireAnalysisJobMode() { // std::cerr << " ======= hardwireAnalysisJobMode() \n"; destinations.push_back("warnings"); - categories.push_back("FwkJob"); categories.push_back("FwkReport"); categories.push_back("FwkSummary"); categories.push_back("Root_NoDictionary"); @@ -159,9 +150,6 @@ namespace edm { Category FwkSummary; // PSet FwkSummary FwkSummary.limit = 10000000; // int32 limit = 10000000 warnings.category["FwkSummary"] = FwkSummary; - Category FwkJob; // PSet FwkJob - FwkJob.limit = 0; // int32 limit = 0 - warnings.category["FwkJob"] = FwkJob; Category Root_NoDictionary; // PSet Root_NoDictionary Root_NoDictionary.limit = 0; // int32 limit = 0 warnings.category["Root_NoDictionary"] = Root_NoDictionary; From ef24cdce1496ee59f63c23ecff1ae666b4da7876 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Thu, 22 Oct 2020 03:35:14 +0900 Subject: [PATCH 770/778] fix bx issues for mc using vfat v2 --- EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc | 3 +-- EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 3c181e4315562..c620328127bd6 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -101,7 +101,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve amc13Events.reserve(FEDNumbering::MAXGEMFEDID - FEDNumbering::MINGEMFEDID + 1); int LV1_id = iEvent.id().event(); - int BX_id = iEvent.bunchCrossing(); + uint8_t BX_id(iEvent.bunchCrossing()); int OrN = iEvent.orbitNumber(); // making map of bx GEMDigiCollection @@ -130,7 +130,6 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve for (uint8_t amcNum = 0; amcNum < GEMeMap::maxAMCs_; ++amcNum) { uint32_t amcSize = 0; std::unique_ptr<AMCdata> amcData = std::make_unique<AMCdata>(); - amcData->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); for (uint8_t gebId = 0; gebId < GEMeMap::maxGEBs_; ++gebId) { std::unique_ptr<GEBdata> gebData = std::make_unique<GEBdata>(); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index b409745e6c407..4aea0fc923bb9 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -207,7 +207,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve vfatData.setPhi(vfat_dc.localPhi); GEMDetId gemId = vfat_dc.detId; - int bx = vfatData.bc() - amcBx; + int bx(vfatData.bc() - amcBx); for (int chan = 0; chan < VFATdata::nChannels; ++chan) { uint8_t chan0xf = 0; From d20498f04bfc708f827f339165f1bfe872517eeb Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Wed, 21 Oct 2020 23:54:43 +0200 Subject: [PATCH 771/778] restore merge filters --- .../DDCMS/src/DDFilteredView.cc | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 32d632dbd57e8..04febf2136a10 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -163,7 +163,6 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specPars) { filters_.shrink_to_fit(); } - Filter* currentFilter = nullptr; for (const auto& section : specPars) { for (const auto& partSelector : section.second->paths) { auto const& firstPartName = front(partSelector); @@ -171,7 +170,7 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specPars) { auto const& key = find_if(begin(it->skeys), end(it->skeys), [&](auto const& partName) { return firstPartName == partName; }); if (key != end(it->skeys)) { - currentFilter = it.get(); + currentFilter_ = it.get(); return true; } return false; @@ -191,26 +190,30 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specPars) { filters_.back()->up = nullptr; filters_.back()->next = nullptr; filters_.back()->spec = section.second; - currentFilter = filters_.back().get(); + // initialize current filter if it's empty + if (currentFilter_ == nullptr) { + currentFilter_ = filters_.back().get(); + } } // all next levels vector<string_view> toks = split(partSelector, "/"); for (size_t pos = 1; pos < toks.size(); ++pos) { - if (currentFilter->next != nullptr) { - currentFilter = currentFilter->next.get(); - auto const& key = find_if( - begin(currentFilter->skeys), end(currentFilter->skeys), [&](auto const& p) { return toks[pos] == p; }); - if (key == end(currentFilter->skeys)) { - currentFilter->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); + if (currentFilter_->next != nullptr) { + currentFilter_ = currentFilter_->next.get(); + auto const& key = find_if(begin(currentFilter_->skeys), end(currentFilter_->skeys), [&](auto const& p) { + return toks.front() == p; + }); + if (key == end(currentFilter_->skeys)) { + currentFilter_->hasNamespace.emplace_back(dd4hep::dd::hasNamespace(toks[pos])); if (dd4hep::dd::isRegex(toks[pos])) { - currentFilter->isRegex.emplace_back(true); - currentFilter->index.emplace_back(currentFilter->keys.size()); - currentFilter->keys.emplace_back(std::regex(std::begin(toks[pos]), std::end(toks[pos]))); + currentFilter_->isRegex.emplace_back(true); + currentFilter_->index.emplace_back(currentFilter_->keys.size()); + currentFilter_->keys.emplace_back(std::regex(std::begin(toks[pos]), std::end(toks[pos]))); } else { - currentFilter->isRegex.emplace_back(false); - currentFilter->index.emplace_back(currentFilter->skeys.size()); + currentFilter_->isRegex.emplace_back(false); + currentFilter_->index.emplace_back(currentFilter_->skeys.size()); } - currentFilter->skeys.emplace_back(toks[pos]); + currentFilter_->skeys.emplace_back(toks[pos]); } } else { auto nextLevelFilter = std::make_unique<Filter>(); @@ -225,10 +228,10 @@ void DDFilteredView::mergedSpecifics(DDSpecParRefs const& specPars) { } nextLevelFilter->skeys.emplace_back(toks[pos]); nextLevelFilter->next = nullptr; - nextLevelFilter->up = currentFilter; + nextLevelFilter->up = currentFilter_; nextLevelFilter->spec = section.second; - currentFilter->next = std::move(nextLevelFilter); + currentFilter_->next = std::move(nextLevelFilter); } } } From 443911e736585c7902de7d1fa1ca3ac7032c9c25 Mon Sep 17 00:00:00 2001 From: Matthew <Matthew.Nguyen@cern.ch> Date: Thu, 22 Oct 2020 10:23:59 +0200 Subject: [PATCH 772/778] Add PbPb modifications to egamma sequences to Run 3 era --- PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py | 2 +- RecoEgamma/Configuration/python/RecoEgamma_EventContent_cff.py | 3 ++- RecoEgamma/Configuration/python/RecoEgamma_cff.py | 3 ++- RecoEgamma/EgammaPhotonProducers/python/photonSequence_cff.py | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py index a562fce3c0142..4ea6e2565f864 100644 --- a/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py +++ b/PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py @@ -425,7 +425,7 @@ def _add_deepFlavour(process): from Configuration.Eras.Modifier_pA_2016_cff import pA_2016 _rerun_puppijets_task = task.copy() _rerun_puppijets_task.add(process.puppi, process.ak4PFJetsPuppi) - (_run2_miniAOD_ANY | pA_2016 | pp_on_AA_2018).toReplaceWith(task, _rerun_puppijets_task) + (_run2_miniAOD_ANY | pA_2016 | pp_on_AA_2018 | pp_on_PbPb_run3 ).toReplaceWith(task, _rerun_puppijets_task) from RecoJets.JetAssociationProducers.j2tParametersVX_cfi import j2tParametersVX process.ak4PFJetsPuppiTracksAssociatorAtVertex = cms.EDProducer("JetTracksAssociatorAtVertex", diff --git a/RecoEgamma/Configuration/python/RecoEgamma_EventContent_cff.py b/RecoEgamma/Configuration/python/RecoEgamma_EventContent_cff.py index 8014601c006a0..3888b001b48c4 100644 --- a/RecoEgamma/Configuration/python/RecoEgamma_EventContent_cff.py +++ b/RecoEgamma/Configuration/python/RecoEgamma_EventContent_cff.py @@ -65,8 +65,9 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 from Configuration.Eras.Modifier_ppRef_2017_cff import ppRef_2017 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 #HI-specific products needed in pp scenario special configurations -for e in [pA_2016, peripheralPbPb, pp_on_AA_2018, pp_on_XeXe_2017, ppRef_2017]: +for e in [pA_2016, peripheralPbPb, pp_on_AA_2018, pp_on_XeXe_2017, ppRef_2017, pp_on_PbPb_run3]: e.toModify( RecoEgammaAOD.outputCommands, func=lambda outputCommands: outputCommands.extend(['keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerppGED_*_*', 'keep recoHIPhotonIsolationedmValueMap_photonIsolationHIProducerpp_*_*', diff --git a/RecoEgamma/Configuration/python/RecoEgamma_cff.py b/RecoEgamma/Configuration/python/RecoEgamma_cff.py index 39b949f7ad019..d880b6f727fcd 100644 --- a/RecoEgamma/Configuration/python/RecoEgamma_cff.py +++ b/RecoEgamma/Configuration/python/RecoEgamma_cff.py @@ -36,6 +36,7 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 from Configuration.Eras.Modifier_ppRef_2017_cff import ppRef_2017 +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 #HI-specific algorithms needed in pp scenario special configurations from RecoHI.HiEgammaAlgos.photonIsolationHIProducer_cfi import photonIsolationHIProducerpp from RecoHI.HiEgammaAlgos.photonIsolationHIProducer_cfi import photonIsolationHIProducerppGED @@ -45,5 +46,5 @@ _egammaHighLevelRecoPostPF_HITask.add(photonIsolationHIProducerpp) _egammaHighLevelRecoPostPF_HITask.add(photonIsolationHIProducerppGED) _egammaHighLevelRecoPostPF_HITask.add(photonIsolationHIProducerppIsland) -for e in [pA_2016, peripheralPbPb, pp_on_AA_2018, pp_on_XeXe_2017, ppRef_2017]: +for e in [pA_2016, peripheralPbPb, pp_on_AA_2018, pp_on_XeXe_2017, ppRef_2017, pp_on_PbPb_run3]: e.toReplaceWith(egammaHighLevelRecoPostPFTask, _egammaHighLevelRecoPostPF_HITask) diff --git a/RecoEgamma/EgammaPhotonProducers/python/photonSequence_cff.py b/RecoEgamma/EgammaPhotonProducers/python/photonSequence_cff.py index 7cf4838824e7c..c0b88a3112630 100644 --- a/RecoEgamma/EgammaPhotonProducers/python/photonSequence_cff.py +++ b/RecoEgamma/EgammaPhotonProducers/python/photonSequence_cff.py @@ -26,5 +26,6 @@ from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017 from Configuration.Eras.Modifier_ppRef_2017_cff import ppRef_2017 -for e in [pA_2016, peripheralPbPb, pp_on_AA_2018, pp_on_XeXe_2017, ppRef_2017]: +from Configuration.Eras.Modifier_pp_on_PbPb_run3_cff import pp_on_PbPb_run3 +for e in [pA_2016, peripheralPbPb, pp_on_AA_2018, pp_on_XeXe_2017, ppRef_2017, pp_on_PbPb_run3]: e.toReplaceWith(photonTask, _photonTaskWithIsland) From 6841d20ddf6fa55017b7232fb956dafef4e5779a Mon Sep 17 00:00:00 2001 From: Ianna Osborne <ianna.osborne@cern.ch> Date: Thu, 22 Oct 2020 10:28:04 +0200 Subject: [PATCH 773/778] apply code check patch --- DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc b/DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc index 1dba92270a7b8..3f96052842367 100644 --- a/DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc +++ b/DetectorDescription/DDCMS/plugins/test/DDTestSpecParsFilter.cc @@ -65,7 +65,7 @@ void DDTestSpecParsFilter::analyze(const Event&, const EventSetup& iEventSetup) } }); std::cout << "*** Check names in a path after filtering:\n"; - for (auto it : myReg) { + for (const auto& it : myReg) { if (it.second->hasPath("//ME11AlumFrame")) { std::cout << it.first << "\n"; } From 0e952f31d521e65b2f04183e7cb6fd3e71506e5c Mon Sep 17 00:00:00 2001 From: Fabio Cossutti <fabio.cossutti@ts.infn.it> Date: Thu, 22 Oct 2020 11:22:22 +0200 Subject: [PATCH 774/778] Temporarily remove from the matrix workflows for D72 and D73, pending integration of ETL reco code --- Configuration/PyReleaseValidation/python/relval_2026.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index 5d18d5f19e907..1b012ca73b0f5 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -29,8 +29,6 @@ numWFIB.extend([31834.0]) #2026D69 numWFIB.extend([32234.0]) #2026D70 numWFIB.extend([32634.0]) #2026D71 -numWFIB.extend([33034.0]) #2026D72 -numWFIB.extend([33434.0]) #2026D73 numWFIB.extend([33834.0]) #2026D74 for numWF in numWFIB: From 39eab56e4bef88946b0103d074ea280df56b47a3 Mon Sep 17 00:00:00 2001 From: Sergio Lo Meo <sergio.lomeo@cern.ch> Date: Thu, 22 Oct 2020 14:47:26 +0200 Subject: [PATCH 775/778] SubtractionSolid Vs UnionSolid For ME --- .../MuonCommonData/data/csc/2021/v3/csc.xml | 1733 +++++++++++++++++ 1 file changed, 1733 insertions(+) create mode 100644 Geometry/MuonCommonData/data/csc/2021/v3/csc.xml diff --git a/Geometry/MuonCommonData/data/csc/2021/v3/csc.xml b/Geometry/MuonCommonData/data/csc/2021/v3/csc.xml new file mode 100644 index 0000000000000..00b7f2f08f642 --- /dev/null +++ b/Geometry/MuonCommonData/data/csc/2021/v3/csc.xml @@ -0,0 +1,1733 @@ +<?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"> +<!--22/10/2020, Sergio Lo Meo (sergio.lo.meo@cern.ch) : fixed overlaps and deleted subtraction solids --> + <ConstantsSection label="ChamberSpecsConstants" eval="true"> + <Constant name="ME11GasGap" value="7.0*mm"/> + <Constant name="ME11LayerOffset" value="-17.0014*mm"/> + <Constant name="ME11LayerSpacing" value="2.2*cm"/> + <Constant name="ME11AlumFrameHalfThick" value="73.5*mm"/> + <Constant name="ME11AlumFrameSubtractionThick" value="8.0*mm"/> + <Constant name="ME11FR4BodyHalfThick" value="73.5*mm"/> + <Constant name="ME11PolycarbPanelHalfThick" value="72.7*mm"/> + <Constant name="ME11FR4SkinHalfThick" value="0.4*mm"/> + <Constant name="ME11CuFoilHalfThick" value="0.01*mm"/> + <Constant name="ME11ActiveGasVolHalfThick" value="3.5*mm"/> + <Constant name="LayerOffset" value="-1.7252*cm"/> + <Constant name="LayerSpacing" value="2.54*cm"/> + <Constant name="AlumFrameHalfThick" value="90.2285*mm"/> + <Constant name="AlumFrameSubtractionThick" value="3.048*mm"/> + <Constant name="FR4BodyHalfThick" value="84.1325*mm"/> + <Constant name="PolycarbPanelHalfThick" value="82.6389*mm"/> + <Constant name="FR4SkinHalfThick" value="0.74930*mm"/> + <Constant name="CuFoilHalfThick" value="0.01778*mm"/> + <Constant name="ActiveGasVolHalfThick" value="4.76250*mm"/> + <Constant name="FR4SkinCenter" value="5.54736*mm"/> + <Constant name="CuFoilCenter" value="4.78028*mm"/> + </ConstantsSection> + + <RotationSection label="csc.xml"> + <Rotation name="RotYZaroundX90" phiX="0" thetaX="90*deg" phiY="0" thetaY="180*deg" phiZ="90*deg" thetaZ="90*deg"/> + </RotationSection> + + <SolidSection label="csc.xml"> + <Tubs name="ME11SupportDisk" rMin="86*cm " rMax="2455*mm" dz="4*cm " startPhi="0*deg" deltaPhi="360*deg"/> + <Tubs name="ME11SupportDisk1" rMin="86*cm " rMax="2455*mm" dz="4*cm " startPhi="0*deg" deltaPhi="360*deg"/> + <Tubs name="ME11Space" rMin="990*mm" rMax="2725*mm" dz="91.5*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME11" dz="81*cm " dy1="91.5*mm" dy2="91.5*mm" dx1="15.065*cm " dx2="30.45*cm "/> + <Trd1 name="ME11AlumFrame" dz="810*mm " dy1="[ME11AlumFrameHalfThick]" dy2="[ME11AlumFrameHalfThick]" dx1="15.065*cm " dx2="30.45*cm "/> + <Trd1 name="ME11FR4Body" dz="81*cm " dy1="[ME11FR4BodyHalfThick]" dy2="[ME11FR4BodyHalfThick]" dx1="15.065*cm " dx2="30.45*cm "/> + <Trd1 name="ME11PolycarbPanel" dz="81*cm " dy1="[ME11PolycarbPanelHalfThick]" dy2="[ME11PolycarbPanelHalfThick]" dx1="15.065*cm " dx2="30.45*cm "/> + <Trd1 name="ME_FR4Skin_1_ME11Layer" dz="81*cm " dy1="[ME11FR4SkinHalfThick]" dy2="[ME11FR4SkinHalfThick]" dx1="15.065*cm " dx2="30.45*cm "/> + <Trd1 name="ME_FR4Skin_2_ME11Layer" dz="81*cm " dy1="[ME11FR4SkinHalfThick]" dy2="[ME11FR4SkinHalfThick]" dx1="15.065*cm " dx2="30.45*cm "/> + <Trd1 name="MECU_1_ME11Layer" dz="81*cm " dy1="[ME11CuFoilHalfThick]" dy2="[ME11CuFoilHalfThick]" dx1="15.065*cm " dx2="30.45*cm "/> + <Trd1 name="MECU_2_ME11Layer" dz="81*cm " dy1="[ME11CuFoilHalfThick]" dy2="[ME11CuFoilHalfThick]" dx1="15.065*cm" dx2="30.45*cm "/> + <Trd1 name="ME1A_ActiveGasVol" dz="21.56*cm" dy1="[ME11ActiveGasVolHalfThick]" dy2="[ME11ActiveGasVolHalfThick]" dx1="9.35*cm" dx2="13.365*cm"/> + <Trd1 name="ME11_ActiveGasVol" dz="52.81*cm" dy1="[ME11ActiveGasVolHalfThick]" dy2="[ME11ActiveGasVolHalfThick]" dx1="13.365*cm" dx2="23.31*cm"/> + <Box name="MEEQ" dx="15*cm " dy="2.5*cm - 0.1234*cm" dz="30*cm "/><!-- Sergio: it was dy=2.5*cm--> + <Tubs name="AlgPinNarrowEnd" rMin="0*mm " rMax="4.06*mm " dz="18.8*mm " startPhi="0*deg" deltaPhi="360*deg"/> + <Tubs name="AlgPinWideEnd" rMin="0*mm " rMax="4.06*mm " dz="18.8*mm " startPhi="0*deg" deltaPhi="360*deg"/> + <Tubs name="AlgPinNarrowEndME1" rMin="0*mm " rMax="4.06*mm " dz="14.99*mm " startPhi="0*deg" deltaPhi="360*deg"/> + <Tubs name="AlgPinWideEndME1" rMin="0*mm " rMax="4.06*mm " dz="14.99*mm " startPhi="0*deg" deltaPhi="360*deg"/> + <Tubs name="ME12Space" rMin="2.735*m " rMax="4.685*m " dz="105.2335*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME12" dz="94.7*cm " dy1="105.2335*mm" dy2="105.2335*mm" dx1="37.614*cm " dx2="53.856*cm "/> + <Trd1 name="ME12AlumFrame" dz="947*mm" dy1="[AlumFrameHalfThick]" dy2="[AlumFrameHalfThick]" dx1="376.14*mm" dx2="538.56*mm"/> + <Trd1 name="ME12AlumFrameSubtraction" dz="947*mm-81*mm" dy1="[AlumFrameSubtractionThick]" dy2="[AlumFrameSubtractionThick]" dx1="376.14*mm-81*mm" dx2="538.56*mm-81*mm"/> + <Trd1 name="ME12FR4Body" dz="94.7*cm " dy1="[FR4BodyHalfThick]" dy2="[FR4BodyHalfThick]" dx1="37.614*cm " dx2="53.856*cm "/> + <Trd1 name="ME12PolycarbPanel" dz="92.8*cm " dy1="[PolycarbPanelHalfThick]" dy2="[PolycarbPanelHalfThick]" dx1="34.215*cm " dx2="51.654*cm "/> + <Trd1 name="ME_FR4Skin_1_ME12Layer" dz="92.8*cm " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="34.215*cm " dx2="51.654*cm "/> + <Trd1 name="ME_FR4Skin_2_ME12Layer" dz="92.8*cm " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="34.215*cm " dx2="51.654*cm "/> + <Trd1 name="MECU_1_ME12Layer" dz="92.8*cm " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="34.215*cm " dx2="51.654*cm "/> + <Trd1 name="MECU_2_ME12Layer" dz="92.8*cm " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="34.215*cm " dx2="51.654*cm "/> + <Trd1 name="ME12_ActiveGasVol" dz="87.245*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="25.5*cm " dx2="41.87*cm "/> + <Trd1 name="ME_DeadGas_1_ME12_ActiveGasVol" dz="1.5*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="36.68*cm " dx2="36.97*cm "/> + <Trd1 name="ME_DeadGas_2_ME12_ActiveGasVol" dz="1.5*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="30.52*cm " dx2="30.8*cm "/> + <Tubs name="ME13Space" rMin="5.055*m " rMax="6.95*m " dz="105.2285*mm " startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME13" dz="89.65*cm " dy1="105.2285*mm " dy2="105.2285*mm " dx1="43.21*cm " dx2="58.925*cm "/> + <Trd1 name="ME13AlumFrame" dz="896.5*mm" dy1="[AlumFrameHalfThick]" dy2="[AlumFrameHalfThick]" dx1="432.1*mm" dx2="589.25*mm"/> + <Trd1 name="ME13AlumFrameSubtraction" dz="896.5*mm-81*mm" dy1="[AlumFrameSubtractionThick]" dy2="[AlumFrameSubtractionThick]" dx1="432.1*mm-81*mm" dx2="589.25*mm-81*mm"/> + <Trd1 name="ME13FR4Body" dz="89.65*cm " dy1="[FR4BodyHalfThick]" dy2="[FR4BodyHalfThick]" dx1="43.21*cm " dx2="58.925*cm "/> + <Trd1 name="ME13PolycarbPanel" dz="87.75*cm " dy1="[PolycarbPanelHalfThick]" dy2="[PolycarbPanelHalfThick]" dx1="40.425*cm " dx2="55.81*cm "/> + <Trd1 name="ME_FR4Skin_1_ME13Layer" dz="87.75*cm " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="40.425*cm " dx2="55.81*cm "/> + <Trd1 name="ME_FR4Skin_2_ME13Layer" dz="87.75*cm " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="40.425*cm " dx2="55.81*cm "/> + <Trd1 name="MECU_1_ME13Layer" dz="87.75*cm " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="40.425*cm " dx2="55.81*cm "/> + <Trd1 name="MECU_2_ME13Layer" dz="87.75*cm " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="40.425*cm " dx2="55.81*cm "/> + <Trd1 name="ME13_ActiveGasVol" dz="82.08*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="31.70*cm " dx2="46.05*cm "/> + <Trd1 name="ME_DeadGas_1_ME13_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="41.22*cm " dx2="41.44*cm "/> + <Trd1 name="ME_DeadGas_2_ME13_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="36.79*cm " dx2="37.01*cm "/> + <Tubs name="ME21Space" rMin="1.39*m " rMax="3.554*m " dz="115.39*mm - 0.0025*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME21" dz="1.023*m " dy1="115.39*mm - 0.0025*mm" dy2="115.39*mm - 0.0025*mm" dx1="37.405*cm " dx2="76.545*cm "/> + <Trd1 name="ME21AlumFrame" dz="1023*mm" dy1="[AlumFrameHalfThick]" dy2="[AlumFrameHalfThick]" dx1="374.05*mm" dx2="765.45*mm"/> + <Trd1 name="ME21AlumFrameSubtraction" dz="1023*mm-83.5*mm" dy1="[AlumFrameSubtractionThick]" dy2="[AlumFrameSubtractionThick]" dx1="374.05*mm-83.5*mm" dx2="765.45*mm-83.5*mm"/> + <Trd1 name="ME21FR4Body" dz="1.023*m " dy1="[FR4BodyHalfThick]" dy2="[FR4BodyHalfThick]" dx1="37.405*cm " dx2="76.545*cm "/> + <Trd1 name="ME21PolycarbPanel" dz="1.00395*m " dy1="[PolycarbPanelHalfThick]" dy2="[PolycarbPanelHalfThick]" dx1="35.045*cm " dx2="73.225*cm "/> + <Trd1 name="ME_FR4Skin_1_ME21Layer" dz="1.00395*m " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="35.045*cm " dx2="73.225*cm "/> + <Trd1 name="ME_FR4Skin_2_ME21Layer" dz="1.00395*m " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="35.045*cm " dx2="73.225*cm "/> + <Trd1 name="MECU_1_ME21Layer" dz="1.00395*m " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="35.045*cm " dx2="73.225*cm "/> + <Trd1 name="MECU_2_ME21Layer" dz="1.00395*m " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="35.045*cm " dx2="73.225*cm "/> + <Trd1 name="ME21_ActiveGasVol" dz="94.83*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="27.00*cm " dx2="62.855*cm "/> + <Trd1 name="ME_DeadGas_1_ME21_ActiveGasVol" dz="1.25*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="51.22*cm " dx2="51.69*cm "/> + <Trd1 name="ME_DeadGas_2_ME21_ActiveGasVol" dz="1.25*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="39.63*cm " dx2="40.105*cm "/> + <Tubs name="ME22Space" rMin="3.555*m " rMax="7.01*m " dz="115.39*mm -0.0025*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME22" dz="1.690*m " dy1="115.39*mm -0.0025*mm" dy2="115.39*mm -0.0025*mm" dx1="45.519*cm " dx2="76.34*cm "/> + <Trd1 name="ME22AlumFrame" dz="1690*mm" dy1="[AlumFrameHalfThick]" dy2="[AlumFrameHalfThick]" dx1="455.19*mm" dx2="763.4*mm"/> + <Trd1 name="ME22AlumFrameSubtraction" dz="1690*mm-81.3*mm" dy1="[AlumFrameSubtractionThick]" dy2="[AlumFrameSubtractionThick]" dx1="455.19*mm-81.3*mm" dx2="763.4*mm-81.3*mm"/> + <Trd1 name="ME22FR4Body" dz="1.690*m " dy1="[FR4BodyHalfThick]" dy2="[FR4BodyHalfThick]" dx1="45.519*cm " dx2="76.34*cm "/> + <Trd1 name="ME22PolycarbPanel" dz="1.67095*m " dy1="[PolycarbPanelHalfThick]" dy2="[PolycarbPanelHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME_FR4Skin_1_ME22Layer" dz="1.67095*m " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME_FR4Skin_2_ME22Layer" dz="1.67095*m " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="MECU_1_ME22Layer" dz="1.67095*m " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="MECU_2_ME22Layer" dz="1.67095*m " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME22_ActiveGasVol" dz="1.6153*m " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="33.230*cm" dx2="63.575*cm"/> + <Trd1 name="ME_DeadGas_1_ME22_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="57.7*cm " dx2="57.93*cm "/> + <Trd1 name="ME_DeadGas_2_ME22_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="52.08*cm " dx2="52.32*cm "/> + <Trd1 name="ME_DeadGas_3_ME22_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="46.37*cm " dx2="46.6*cm "/> + <Trd1 name="ME_DeadGas_4_ME22_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="40.66*cm " dx2="40.88*cm "/> + <Tubs name="ME31Space" rMin="1.59*m " rMax="3.554*m " dz="124.0*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME31" dz="92.3*cm " dy1="124.0*mm" dy2="124.0*mm" dx1="41.46*cm " dx2="76.545*cm "/> + <Trd1 name="ME31AlumFrame" dz="923*mm" dy1="[AlumFrameHalfThick]" dy2="[AlumFrameHalfThick]" dx1="414.6*mm" dx2="765.45*mm"/> + <Trd1 name="ME31AlumFrameSubtraction" dz="923*mm-83.5*mm" dy1="[AlumFrameSubtractionThick]" dy2="[AlumFrameSubtractionThick]" dx1="414.6*mm-83.5*mm" dx2="765.45*mm-83.5*mm"/> + <Trd1 name="ME31FR4Body" dz="92.3*cm " dy1="[FR4BodyHalfThick]" dy2="[FR4BodyHalfThick]" dx1="41.46*cm " dx2="76.545*cm "/> + <Trd1 name="ME31PolycarbPanel" dz="90.40*cm " dy1="[PolycarbPanelHalfThick]" dy2="[PolycarbPanelHalfThick]" dx1="39.105*cm " dx2="73.225*cm "/> + <Trd1 name="ME_FR4Skin_1_ME31Layer" dz="90.40*cm " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="39.105*cm " dx2="73.225*cm "/> + <Trd1 name="ME_FR4Skin_2_ME31Layer" dz="90.40*cm " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="39.105*cm " dx2="73.225*cm "/> + <Trd1 name="MECU_1_ME31Layer" dz="90.40*cm " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="39.105*cm " dx2="73.225*cm "/> + <Trd1 name="MECU_2_ME31Layer" dz="90.40*cm " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="39.105*cm " dx2="73.225*cm "/> + <Trd1 name="ME31_ActiveGasVol" dz="84.85*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="30.70*cm " dx2="62.855*cm "/> + <Trd1 name="ME_DeadGas_1_ME31_ActiveGasVol" dz="1.25*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="51.14*cm " dx2="51.605*cm "/> + <Trd1 name="ME_DeadGas_2_ME31_ActiveGasVol" dz="1.25*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="39.8*cm " dx2="40.27*cm "/> + <Tubs name="ME32Space" rMin="3.555*m " rMax="7.01*m " dz="124.0*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME32" dz="1.690*m " dy1="124.0*mm" dy2="124.0*mm" dx1="45.519*cm " dx2="76.34*cm "/> + <Trd1 name="ME32AlumFrame" dz="1.690*m " dy1="[AlumFrameHalfThick]" dy2="[AlumFrameHalfThick]" dx1="455.19*mm" dx2="763.4*mm"/> + <Trd1 name="ME32AlumFrameSubtraction" dz="1607.53*mm" dy1="[AlumFrameSubtractionThick]" dy2="[AlumFrameSubtractionThick]" dx1="455.19*mm-81.3*mm" dx2="763.4*mm-81.3*mm"/> + <Trd1 name="ME32FR4Body" dz="1.690*m " dy1="[FR4BodyHalfThick]" dy2="[FR4BodyHalfThick]" dx1="45.519*cm " dx2="76.34*cm "/> + <Trd1 name="ME32PolycarbPanel" dz="1.67095*m " dy1="[PolycarbPanelHalfThick]" dy2="[PolycarbPanelHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME_FR4Skin_1_ME32Layer" dz="1.67095*m " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME_FR4Skin_2_ME32Layer" dz="1.67095*m " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="MECU_1_ME32Layer" dz="1.67095*m " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="MECU_2_ME32Layer" dz="1.67095*m " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME32_ActiveGasVol" dz="1.6153*m " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="33.230*cm " dx2="63.575*cm "/> + <Trd1 name="ME_DeadGas_1_ME32_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="57.7*cm " dx2="57.93*cm "/> + <Trd1 name="ME_DeadGas_2_ME32_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="52.08*cm " dx2="52.32*cm "/> + <Trd1 name="ME_DeadGas_3_ME32_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="46.37*cm " dx2="46.6*cm "/> + <Trd1 name="ME_DeadGas_4_ME32_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="40.66*cm " dx2="40.88*cm "/> + <Tubs name="ME41Space" rMin="1.79*m " rMax="3.554*m " dz="124.0*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME41" dz="833.5*mm" dy1="124.0*mm" dy2="124.0*mm" dx1="44.985*cm " dx2="76.545*cm "/> + <Trd1 name="ME41AlumFrame" dz="833.5*mm" dy1="[AlumFrameHalfThick]" dy2="[AlumFrameHalfThick]" dx1="449.85*mm" dx2="765.45*mm"/> + <Trd1 name="ME41AlumFrameSubtraction" dz="833.5*mm-83.5*mm" dy1="[AlumFrameSubtractionThick]" dy2="[AlumFrameSubtractionThick]" dx1="449.85*mm-83.5*mm" dx2="765.45*mm-83.5*mm"/> + <Trd1 name="ME41FR4Body" dz="83.35*cm " dy1="[FR4BodyHalfThick]" dy2="[FR4BodyHalfThick]" dx1="44.985*cm " dx2="76.545*cm "/> + <Trd1 name="ME41PolycarbPanel" dz="80.71*cm " dy1="[PolycarbPanelHalfThick]" dy2="[PolycarbPanelHalfThick]" dx1="42.63*cm " dx2="73.225*cm "/> + <Trd1 name="ME_FR4Skin_1_ME41Layer" dz="80.71*cm " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="42.63*cm " dx2="73.225*cm "/> + <Trd1 name="ME_FR4Skin_2_ME41Layer" dz="80.71*cm " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="42.63*cm " dx2="73.225*cm "/> + <Trd1 name="MECU_1_ME41Layer" dz="80.71*cm " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="42.63*cm " dx2="73.225*cm "/> + <Trd1 name="MECU_2_ME41Layer" dz="80.71*cm " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="42.63*cm " dx2="73.225*cm "/> + <Trd1 name="ME41_ActiveGasVol" dz="74.710*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="34.505*cm " dx2="62.825*cm "/> + <Trd1 name="ME_DeadGas_1_ME41_ActiveGasVol" dz="1.25*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="52.296*cm " dx2="52.762*cm "/> + <Trd1 name="ME_DeadGas_2_ME41_ActiveGasVol" dz="1.25*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="43.32*cm " dx2="43.8*cm "/> + <Tubs name="ME42Space" rMin="3.555*m " rMax="7.01*m " dz="124.0*mm" startPhi="0*deg" deltaPhi="360*deg"/> + <Trd1 name="ME42" dz="1.690*m " dy1="124.0*mm" dy2="124.0*mm" dx1="45.519*cm " dx2="76.34*cm "/> + <Trd1 name="ME42AlumFrame" dz="1.690*m " dy1="[AlumFrameHalfThick]" dy2="[AlumFrameHalfThick]" dx1="455.19*mm" dx2="763.4*mm"/> + <Trd1 name="ME42AlumFrameSubtraction" dz="1607.53*mm" dy1="[AlumFrameSubtractionThick]" dy2="[AlumFrameSubtractionThick]" dx1="455.19*mm-81.3*mm" dx2="763.4*mm-81.3*mm"/> + <Trd1 name="ME42FR4Body" dz="1.690*m " dy1="[FR4BodyHalfThick]" dy2="[FR4BodyHalfThick]" dx1="45.519*cm " dx2="76.34*cm "/> + <Trd1 name="ME42PolycarbPanel" dz="1.67095*m " dy1="[PolycarbPanelHalfThick]" dy2="[PolycarbPanelHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME_FR4Skin_1_ME42Layer" dz="1.67095*m " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME_FR4Skin_2_ME42Layer" dz="1.67095*m " dy1="[FR4SkinHalfThick]" dy2="[FR4SkinHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="MECU_1_ME42Layer" dz="1.67095*m " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="MECU_2_ME42Layer" dz="1.67095*m " dy1="[CuFoilHalfThick]" dy2="[CuFoilHalfThick]" dx1="41.95*cm " dx2="73.345*cm "/> + <Trd1 name="ME42_ActiveGasVol" dz="1.6153*m " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="33.230*cm " dx2="63.575*cm "/> + <Trd1 name="ME_DeadGas_1_ME42_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="57.7*cm " dx2="57.93*cm "/> + <Trd1 name="ME_DeadGas_2_ME42_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="52.08*cm " dx2="52.32*cm "/> + <Trd1 name="ME_DeadGas_3_ME42_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="46.37*cm " dx2="46.6*cm "/> + <Trd1 name="ME_DeadGas_4_ME42_ActiveGasVol" dz="1.265*cm " dy1="[ActiveGasVolHalfThick]" dy2="[ActiveGasVolHalfThick]" dx1="40.66*cm " dx2="40.88*cm "/> + </SolidSection> + + <LogicalPartSection label="csc.xml"> + <LogicalPart name="ME11SupportDisk" category="unspecified"> + <rSolid name="ME11SupportDisk"/> + <rMaterial name="materials:Aluminium"/> + </LogicalPart> + <LogicalPart name="ME11Space" category="unspecified"> + <rSolid name="ME11Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME11" category="unspecified"> + <rSolid name="ME11"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME11AlumFrame" category="unspecified"> + <rSolid name="ME11AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME11FR4Body" category="unspecified"> + <rSolid name="ME11FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME11PolycarbPanel" category="unspecified"> + <rSolid name="ME11PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME11Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME11Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME11Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME11Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME11Layer" category="unspecified"> + <rSolid name="MECU_1_ME11Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME11Layer" category="unspecified"> + <rSolid name="MECU_2_ME11Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME1A_ActiveGasVol" category="unspecified"> + <rSolid name="ME1A_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME11_ActiveGasVol" category="unspecified"> + <rSolid name="ME11_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="MEEQ" category="unspecified"> + <rSolid name="MEEQ"/> + <rMaterial name="materials:FrontEnd Electronics"/> + </LogicalPart> + <LogicalPart name="AlgPinNarrowEnd" category="unspecified"> + <rSolid name="AlgPinNarrowEnd"/> + <rMaterial name="materials:StainlessSteel"/> + </LogicalPart> + <LogicalPart name="AlgPinWideEnd" category="unspecified"> + <rSolid name="AlgPinWideEnd"/> + <rMaterial name="materials:StainlessSteel"/> + </LogicalPart> + <LogicalPart name="AlgPinNarrowEndME1" category="unspecified"> + <rSolid name="AlgPinNarrowEndME1"/> + <rMaterial name="materials:StainlessSteel"/> + </LogicalPart> + <LogicalPart name="AlgPinWideEndME1" category="unspecified"> + <rSolid name="AlgPinWideEndME1"/> + <rMaterial name="materials:StainlessSteel"/> + </LogicalPart> + + <LogicalPart name="ME12Space" category="unspecified"> + <rSolid name="ME12Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME12" category="unspecified"> + <rSolid name="ME12"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME12AlumFrame" category="unspecified"> + <rSolid name="ME12AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME12AlumFrameSubtraction" category="unspecified"> + <rSolid name="ME12AlumFrameSubtraction"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME13AlumFrameSubtraction" category="unspecified"> + <rSolid name="ME13AlumFrameSubtraction"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME21AlumFrameSubtraction" category="unspecified"> + <rSolid name="ME21AlumFrameSubtraction"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME22AlumFrameSubtraction" category="unspecified"> + <rSolid name="ME22AlumFrameSubtraction"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME31AlumFrameSubtraction" category="unspecified"> + <rSolid name="ME31AlumFrameSubtraction"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME32AlumFrameSubtraction" category="unspecified"> + <rSolid name="ME32AlumFrameSubtraction"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME41AlumFrameSubtraction" category="unspecified"> + <rSolid name="ME41AlumFrameSubtraction"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME42AlumFrameSubtraction" category="unspecified"> + <rSolid name="ME42AlumFrameSubtraction"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME12FR4Body" category="unspecified"> + <rSolid name="ME12FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME12PolycarbPanel" category="unspecified"> + <rSolid name="ME12PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME12Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME12Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME12Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME12Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME12Layer" category="unspecified"> + <rSolid name="MECU_1_ME12Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME12Layer" category="unspecified"> + <rSolid name="MECU_2_ME12Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME12_ActiveGasVol" category="unspecified"> + <rSolid name="ME12_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_1_ME12_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_1_ME12_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_2_ME12_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_2_ME12_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME13Space" category="unspecified"> + <rSolid name="ME13Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME13" category="unspecified"> + <rSolid name="ME13"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME13AlumFrame" category="unspecified"> + <rSolid name="ME13AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME13FR4Body" category="unspecified"> + <rSolid name="ME13FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME13PolycarbPanel" category="unspecified"> + <rSolid name="ME13PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME13Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME13Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME13Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME13Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME13Layer" category="unspecified"> + <rSolid name="MECU_1_ME13Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME13Layer" category="unspecified"> + <rSolid name="MECU_2_ME13Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME13_ActiveGasVol" category="unspecified"> + <rSolid name="ME13_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_1_ME13_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_1_ME13_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_2_ME13_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_2_ME13_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME21Space" category="unspecified"> + <rSolid name="ME21Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME21" category="unspecified"> + <rSolid name="ME21"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME21AlumFrame" category="unspecified"> + <rSolid name="ME21AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME21FR4Body" category="unspecified"> + <rSolid name="ME21FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME21PolycarbPanel" category="unspecified"> + <rSolid name="ME21PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME21Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME21Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME21Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME21Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME21Layer" category="unspecified"> + <rSolid name="MECU_1_ME21Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME21Layer" category="unspecified"> + <rSolid name="MECU_2_ME21Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME21_ActiveGasVol" category="unspecified"> + <rSolid name="ME21_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_1_ME21_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_1_ME21_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_2_ME21_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_2_ME21_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME22Space" category="unspecified"> + <rSolid name="ME22Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME22" category="unspecified"> + <rSolid name="ME22"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME22AlumFrame" category="unspecified"> + <rSolid name="ME22AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME22FR4Body" category="unspecified"> + <rSolid name="ME22FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME22PolycarbPanel" category="unspecified"> + <rSolid name="ME22PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME22Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME22Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME22Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME22Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME22Layer" category="unspecified"> + <rSolid name="MECU_1_ME22Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME22Layer" category="unspecified"> + <rSolid name="MECU_2_ME22Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME22_ActiveGasVol" category="unspecified"> + <rSolid name="ME22_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_1_ME22_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_1_ME22_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_2_ME22_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_2_ME22_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_3_ME22_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_3_ME22_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_4_ME22_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_4_ME22_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME31Space" category="unspecified"> + <rSolid name="ME31Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME31" category="unspecified"> + <rSolid name="ME31"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME31AlumFrame" category="unspecified"> + <rSolid name="ME31AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME31FR4Body" category="unspecified"> + <rSolid name="ME31FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME31PolycarbPanel" category="unspecified"> + <rSolid name="ME31PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME31Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME31Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME31Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME31Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME31Layer" category="unspecified"> + <rSolid name="MECU_1_ME31Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME31Layer" category="unspecified"> + <rSolid name="MECU_2_ME31Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME31_ActiveGasVol" category="unspecified"> + <rSolid name="ME31_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_1_ME31_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_1_ME31_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_2_ME31_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_2_ME31_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME32Space" category="unspecified"> + <rSolid name="ME32Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME32" category="unspecified"> + <rSolid name="ME32"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME32AlumFrame" category="unspecified"> + <rSolid name="ME32AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME32FR4Body" category="unspecified"> + <rSolid name="ME32FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME32PolycarbPanel" category="unspecified"> + <rSolid name="ME32PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME32Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME32Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME32Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME32Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME32Layer" category="unspecified"> + <rSolid name="MECU_1_ME32Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME32Layer" category="unspecified"> + <rSolid name="MECU_2_ME32Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME32_ActiveGasVol" category="unspecified"> + <rSolid name="ME32_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_1_ME32_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_1_ME32_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_2_ME32_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_2_ME32_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_3_ME32_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_3_ME32_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_4_ME32_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_4_ME32_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME41Space" category="unspecified"> + <rSolid name="ME41Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME41" category="unspecified"> + <rSolid name="ME41"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME41AlumFrame" category="unspecified"> + <rSolid name="ME41AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME41FR4Body" category="unspecified"> + <rSolid name="ME41FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME41PolycarbPanel" category="unspecified"> + <rSolid name="ME41PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME41Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME41Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME41Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME41Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME41Layer" category="unspecified"> + <rSolid name="MECU_1_ME41Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME41Layer" category="unspecified"> + <rSolid name="MECU_2_ME41Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME41_ActiveGasVol" category="unspecified"> + <rSolid name="ME41_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_1_ME41_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_1_ME41_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_2_ME41_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_2_ME41_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME42Space" category="unspecified"> + <rSolid name="ME42Space"/> + <rMaterial name="materials:ME_free_space"/> + </LogicalPart> + <LogicalPart name="ME42" category="unspecified"> + <rSolid name="ME42"/> + <rMaterial name="materials:M_F_Air"/> + </LogicalPart> + <LogicalPart name="ME42AlumFrame" category="unspecified"> + <rSolid name="ME42AlumFrame"/> + <rMaterial name="materials:M_Aluminium"/> + </LogicalPart> + <LogicalPart name="ME42FR4Body" category="unspecified"> + <rSolid name="ME42FR4Body"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME42PolycarbPanel" category="unspecified"> + <rSolid name="ME42PolycarbPanel"/> + <rMaterial name="materials:Polycarbonate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_1_ME42Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_1_ME42Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="ME_FR4Skin_2_ME42Layer" category="unspecified"> + <rSolid name="ME_FR4Skin_2_ME42Layer"/> + <rMaterial name="materials:M_NEMA FR4 plate"/> + </LogicalPart> + <LogicalPart name="MECU_1_ME42Layer" category="unspecified"> + <rSolid name="MECU_1_ME42Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="MECU_2_ME42Layer" category="unspecified"> + <rSolid name="MECU_2_ME42Layer"/> + <rMaterial name="materials:M_Copper"/> + </LogicalPart> + <LogicalPart name="ME42_ActiveGasVol" category="unspecified"> + <rSolid name="ME42_ActiveGasVol"/> + <rMaterial name="materials:M_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_1_ME42_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_1_ME42_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_2_ME42_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_2_ME42_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_3_ME42_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_3_ME42_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + <LogicalPart name="ME_DeadGas_4_ME42_ActiveGasVol" category="unspecified"> + <rSolid name="ME_DeadGas_4_ME42_ActiveGasVol"/> + <rMaterial name="materials:Dead_Argon CF_4 CO_2"/> + </LogicalPart> + </LogicalPartSection> + + <PosPartSection label="csc.xml"> + <PosPart copyNumber="1"> + <rParent name="mf:ME1RingP"/> + <rChild name="csc:ME11SupportDisk"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="6023*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME1RingP"/> + <rChild name="csc:ME11Space"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="6154.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME1RingP"/> + <rChild name="csc:ME11Space"/> + <rRotation name="rotations:R010"/> + <Translation x="0*fm " y="0*fm " z="5861.5*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME1RingN"/> + <rChild name="csc:ME11SupportDisk"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="6023*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME1RingN"/> + <rChild name="csc:ME11Space"/> + <rRotation name="rotations:180RYZ"/> + <Translation x="0*fm " y="0*fm " z="6154.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME1RingN"/> + <rChild name="csc:ME11Space"/> + <rRotation name="rotations:R010R"/> + <Translation x="0*fm " y="0*fm " z="5861.5*mm"/> + </PosPart> + <Division name="csc:ME11SpaceDivision" parent="csc:ME11Space" axis="phi" offset="-10*deg" width="20*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME11SpaceDivision"/> + <rChild name="csc:ME11"/> + <rRotation name="rotations:90XD"/> + <Translation x="1.815*m " y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME11"/> + <rChild name="csc:ME11AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME11AlumFrame"/> + <rChild name="csc:ME11FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME11FR4Body"/> + <rChild name="csc:ME11PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME11Layer" parent="csc:ME11PolycarbPanel" axis="y" offset="[ME11LayerOffset]" width="[ME11LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME11Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME11Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0.5*[ME11GasGap]+2.0*[ME11CuFoilHalfThick]+[ME11FR4SkinHalfThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME11Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME11Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-0.5*[ME11GasGap]-2.0*[ME11CuFoilHalfThick]-[ME11FR4SkinHalfThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME11Layer"/> + <rChild name="csc:MECU_1_ME11Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0.5*[ME11GasGap]+[ME11CuFoilHalfThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME11Layer"/> + <rChild name="csc:MECU_2_ME11Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-0.5*[ME11GasGap]-[ME11CuFoilHalfThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME11Layer"/> + <rChild name="csc:ME1A_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-53.12*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME11Layer"/> + <rChild name="csc:ME11_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="21.25*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31"/> + <rChild name="csc:MEEQ"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-10.0234*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32"/> + <rChild name="csc:MEEQ"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-10.0234*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41"/> + <rChild name="csc:MEEQ"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-10.0234*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42"/> + <rChild name="csc:MEEQ"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-10.0234*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12"/> + <rChild name="csc:AlgPinNarrowEndME1"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-90.224*mm " z="-912.1*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12"/> + <rChild name="csc:AlgPinWideEndME1"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-90.224*mm " z="893.1*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13"/> + <rChild name="csc:AlgPinNarrowEndME1"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-90.224*mm " z="-861.6*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13"/> + <rChild name="csc:AlgPinWideEndME1"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-90.224*mm " z="842.5*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21"/> + <rChild name="csc:AlgPinNarrowEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="-988.05*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21"/> + <rChild name="csc:AlgPinWideEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="969.05*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22"/> + <rChild name="csc:AlgPinNarrowEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="-1655.05*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22"/> + <rChild name="csc:AlgPinWideEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="1636.05*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31"/> + <rChild name="csc:AlgPinNarrowEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="-888.2*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31"/> + <rChild name="csc:AlgPinWideEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="869.2*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32"/> + <rChild name="csc:AlgPinNarrowEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="-1655.05*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32"/> + <rChild name="csc:AlgPinWideEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="1636.05*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41"/> + <rChild name="csc:AlgPinNarrowEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="-788.4*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41"/> + <rChild name="csc:AlgPinWideEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="769.4*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42"/> + <rChild name="csc:AlgPinNarrowEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="-1655.05*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42"/> + <rChild name="csc:AlgPinWideEnd"/> + <rRotation name="RotYZaroundX90"/> + <Translation x="0*fm " y="-9.4034*cm " z="1636.05*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME12RingP"/> + <rChild name="csc:ME12Space"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="159.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME12RingP"/> + <rChild name="csc:ME12Space"/> + <rRotation name="rotations:R010"/> + <Translation x="0*fm " y="0*fm " z="-114.5*mm"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME12RingN"/> + <rChild name="csc:ME12Space"/> + <rRotation name="rotations:180RYZ"/> + <Translation x="0*fm " y="0*fm " z="159.5*mm"/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME12RingN"/> + <rChild name="csc:ME12Space"/> + <rRotation name="rotations:R010R"/> + <Translation x="0*fm " y="0*fm " z="-114.5*mm"/> + </PosPart> + <Division name="csc:ME12SpaceDivision" parent="csc:ME12Space" axis="phi" offset="-10*deg" width="20*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME12SpaceDivision"/> + <rChild name="csc:ME12"/> + <rRotation name="rotations:90XD"/> + <Translation x="3.697*m " y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12"/> + <rChild name="csc:ME12AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12AlumFrame"/> + <rChild name="csc:ME12AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[AlumFrameHalfThick]-[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME12AlumFrame"/> + <rChild name="csc:ME12AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[AlumFrameHalfThick]+[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13AlumFrame"/> + <rChild name="csc:ME13AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[AlumFrameHalfThick]-[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME13AlumFrame"/> + <rChild name="csc:ME13AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[AlumFrameHalfThick]+[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21AlumFrame"/> + <rChild name="csc:ME21AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[AlumFrameHalfThick]-[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME21AlumFrame"/> + <rChild name="csc:ME21AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[AlumFrameHalfThick]+[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22AlumFrame"/> + <rChild name="csc:ME22AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[AlumFrameHalfThick]-[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME22AlumFrame"/> + <rChild name="csc:ME22AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[AlumFrameHalfThick]+[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31AlumFrame"/> + <rChild name="csc:ME31AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[AlumFrameHalfThick]-[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME31AlumFrame"/> + <rChild name="csc:ME31AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[AlumFrameHalfThick]+[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32AlumFrame"/> + <rChild name="csc:ME32AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[AlumFrameHalfThick]-[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME32AlumFrame"/> + <rChild name="csc:ME32AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[AlumFrameHalfThick]+[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41AlumFrame"/> + <rChild name="csc:ME41AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[AlumFrameHalfThick]-[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME41AlumFrame"/> + <rChild name="csc:ME41AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[AlumFrameHalfThick]+[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42AlumFrame"/> + <rChild name="csc:ME42AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[AlumFrameHalfThick]-[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME42AlumFrame"/> + <rChild name="csc:ME42AlumFrameSubtraction"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[AlumFrameHalfThick]+[AlumFrameSubtractionThick]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12AlumFrame"/> + <rChild name="csc:ME12FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12FR4Body"/> + <rChild name="csc:ME12PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME12Layer" parent="csc:ME12PolycarbPanel" axis="y" offset="[LayerOffset]" width="[LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME12Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME12Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME12Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME12Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12Layer"/> + <rChild name="csc:MECU_1_ME12Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME12Layer"/> + <rChild name="csc:MECU_2_ME12Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12Layer"/> + <rChild name="csc:ME12_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-0.955*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME12_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_1_ME12_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="34.2*cm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME12_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_2_ME12_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-31.6*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME13RingP"/> + <rChild name="csc:ME13Space"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="6936.5874*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME13RingN"/> + <rChild name="csc:ME13Space"/> + <rRotation name="rotations:180RYZ"/> + <Translation x="0*fm " y="0*fm " z="6936.5874*mm "/> + </PosPart> + <Division name="csc:ME13SpaceDivision" parent="csc:ME13Space" axis="phi" offset="-5*deg" width="10*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME13SpaceDivision"/> + <rChild name="csc:ME13"/> + <rRotation name="rotations:90XD"/> + <Translation x="5.9515*m " y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13"/> + <rChild name="csc:ME13AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13AlumFrame"/> + <rChild name="csc:ME13FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13FR4Body"/> + <rChild name="csc:ME13PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME13Layer" parent="csc:ME13PolycarbPanel" axis="y" offset="[LayerOffset]" width="[LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME13Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME13Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME13Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME13Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13Layer"/> + <rChild name="csc:MECU_1_ME13Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME13Layer"/> + <rChild name="csc:MECU_2_ME13Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13Layer"/> + <rChild name="csc:ME13_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-1.075*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME13_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_1_ME13_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="28.92*cm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME13_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_2_ME13_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-21.66*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME2RingP"/> + <rChild name="csc:ME21Space"/> + <rRotation name="rotations:R005"/> + <Translation x="0*fm " y="0*fm " z="202.1125*mm+8.1925*m "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME2RingP"/> + <rChild name="csc:ME21Space"/> + <rRotation name="rotations:R025"/> + <Translation x="0*fm " y="0*fm " z="-45.8875*mm+8.1925*m "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME2RingN"/> + <rChild name="csc:ME21Space"/> + <rRotation name="rotations:R005R"/> + <Translation x="0*fm " y="0*fm " z="202.1125*mm+8.1925*m "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME2RingN"/> + <rChild name="csc:ME21Space"/> + <rRotation name="rotations:R025R"/> + <Translation x="0*fm " y="0*fm " z="-45.8875*mm+8.1925*m "/> + </PosPart> + <Division name="csc:ME21SpaceDivision" parent="csc:ME21Space" axis="phi" offset="-20*deg" width="40*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME21SpaceDivision"/> + <rChild name="csc:ME21"/> + <rRotation name="rotations:90XD"/> + <Translation x="2.427*m " y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21"/> + <rChild name="csc:ME21AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21AlumFrame"/> + <rChild name="csc:ME21FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21FR4Body"/> + <rChild name="csc:ME21PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME21Layer" parent="csc:ME21PolycarbPanel" axis="y" offset="[LayerOffset]" width="[LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME21Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME21Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME21Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME21Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21Layer"/> + <rChild name="csc:MECU_1_ME21Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME21Layer"/> + <rChild name="csc:MECU_2_ME21Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21Layer"/> + <rChild name="csc:ME21_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-9.55*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME21_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_1_ME21_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="34.62*cm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME21_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_2_ME21_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-26.52*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME2RingP"/> + <rChild name="csc:ME22Space"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="202.1125*mm+8.1925*m "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME2RingP"/> + <rChild name="csc:ME22Space"/> + <rRotation name="rotations:R010"/> + <Translation x="0*fm " y="0*fm " z="-45.8875*mm+8.1925*m "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME2RingN"/> + <rChild name="csc:ME22Space"/> + <rRotation name="rotations:180RYZ"/> + <Translation x="0*fm " y="0*fm " z="202.1125*mm+8.1925*m "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME2RingN"/> + <rChild name="csc:ME22Space"/> + <rRotation name="rotations:R010R"/> + <Translation x="0*fm " y="0*fm " z="-45.8875*mm+8.1925*m "/> + </PosPart> + <Division name="csc:ME22SpaceDivision" parent="csc:ME22Space" axis="phi" offset="-10.*deg" width="20*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME22SpaceDivision"/> + <rChild name="csc:ME22"/> + <rRotation name="rotations:90XD"/> + <Translation x="5265.0*mm" y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22"/> + <rChild name="csc:ME22AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22AlumFrame"/> + <rChild name="csc:ME22FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22FR4Body"/> + <rChild name="csc:ME22PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME22Layer" parent="csc:ME22PolycarbPanel" axis="y" offset="[LayerOffset]" width="[LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME22Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME22Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME22Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME22Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22Layer"/> + <rChild name="csc:MECU_1_ME22Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME22Layer"/> + <rChild name="csc:MECU_2_ME22Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22Layer"/> + <rChild name="csc:ME22_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-9.5*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME22_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_1_ME22_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="1.0116*m "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME22_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_2_ME22_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="40.46*cm "/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="csc:ME22_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_3_ME22_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-20.23*cm "/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="csc:ME22_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_4_ME22_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-80.92*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME3RingP"/> + <rChild name="csc:ME31Space"/> + <rRotation name="rotations:R005"/> + <Translation x="0*fm " y="0*fm " z="-202.1125*mm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME3RingP"/> + <rChild name="csc:ME31Space"/> + <rRotation name="rotations:R025"/> + <Translation x="0*fm " y="0*fm " z="45.8875*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME3RingN"/> + <rChild name="csc:ME31Space"/> + <rRotation name="rotations:R005R"/> + <Translation x="0*fm " y="0*fm " z="-202.1125*mm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME3RingN"/> + <rChild name="csc:ME31Space"/> + <rRotation name="rotations:R025R"/> + <Translation x="0*fm " y="0*fm " z="45.8875*mm "/> + </PosPart> + <Division name="csc:ME31SpaceDivision" parent="csc:ME31Space" axis="phi" offset="-20*deg" width="40*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME31SpaceDivision"/> + <rChild name="csc:ME31"/> + <rRotation name="rotations:90DX"/> + <Translation x="2.527*m " y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31"/> + <rChild name="csc:ME31AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31AlumFrame"/> + <rChild name="csc:ME31FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31FR4Body"/> + <rChild name="csc:ME31PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME31Layer" parent="csc:ME31PolycarbPanel" axis="y" offset="[LayerOffset]" width="[LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME31Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME31Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME31Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME31Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31Layer"/> + <rChild name="csc:MECU_1_ME31Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME31Layer"/> + <rChild name="csc:MECU_2_ME31Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31Layer"/> + <rChild name="csc:ME31_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-9.65*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME31_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_1_ME31_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="24.685*cm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME31_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_2_ME31_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-35.205*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME3RingP"/> + <rChild name="csc:ME32Space"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-202.1125*mm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME3RingP"/> + <rChild name="csc:ME32Space"/> + <rRotation name="rotations:R010"/> + <Translation x="0*fm " y="0*fm " z="45.8875*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME3RingN"/> + <rChild name="csc:ME32Space"/> + <rRotation name="rotations:180RYZ"/> + <Translation x="0*fm " y="0*fm " z="-202.1125*mm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME3RingN"/> + <rChild name="csc:ME32Space"/> + <rRotation name="rotations:R010R"/> + <Translation x="0*fm " y="0*fm " z="45.8875*mm "/> + </PosPart> + <Division name="csc:ME32SpaceDivision" parent="csc:ME32Space" axis="phi" offset="-10*deg" width="20*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME32SpaceDivision"/> + <rChild name="csc:ME32"/> + <rRotation name="rotations:90DX"/> + <Translation x="5265.0*mm" y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32"/> + <rChild name="csc:ME32AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32AlumFrame"/> + <rChild name="csc:ME32FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32FR4Body"/> + <rChild name="csc:ME32PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME32Layer" parent="csc:ME32PolycarbPanel" axis="y" offset="[LayerOffset]" width="[LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME32Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME32Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME32Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME32Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32Layer"/> + <rChild name="csc:MECU_1_ME32Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME32Layer"/> + <rChild name="csc:MECU_2_ME32Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32Layer"/> + <rChild name="csc:ME32_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-9.5*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME32_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_1_ME32_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="1.0116*m "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME32_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_2_ME32_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="40.46*cm "/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="csc:ME32_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_3_ME32_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-20.23*cm "/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="csc:ME32_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_4_ME32_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-80.92*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME4RingP"/> + <rChild name="csc:ME41Space"/> + <rRotation name="rotations:R005"/> + <Translation x="0*fm " y="0*fm " z="-202.8125*mm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME4RingP"/> + <rChild name="csc:ME41Space"/> + <rRotation name="rotations:R025"/> + <Translation x="0*fm " y="0*fm " z="45.1875*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME4RingN"/> + <rChild name="csc:ME41Space"/> + <rRotation name="rotations:R005R"/> + <Translation x="0*fm " y="0*fm " z="-202.8125*mm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME4RingN"/> + <rChild name="csc:ME41Space"/> + <rRotation name="rotations:R025R"/> + <Translation x="0*fm " y="0*fm " z="45.1875*mm "/> + </PosPart> + <Division name="csc:ME41SpaceDivision" parent="csc:ME41Space" axis="phi" offset="-20*deg" width="40*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME41SpaceDivision"/> + <rChild name="csc:ME41"/> + <rRotation name="rotations:90DX"/> + <Translation x="2.6265*m " y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41"/> + <rChild name="csc:ME41AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41AlumFrame"/> + <rChild name="csc:ME41FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41FR4Body"/> + <rChild name="csc:ME41PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME41Layer" parent="csc:ME41PolycarbPanel" axis="y" offset="[LayerOffset]" width="[LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME41Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME41Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME41Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME41Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41Layer"/> + <rChild name="csc:MECU_1_ME41Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME41Layer"/> + <rChild name="csc:MECU_2_ME41Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41Layer"/> + <rChild name="csc:ME41_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-9.55*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME41_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_1_ME41_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="24.46*cm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME41_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_2_ME41_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-25.45*cm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME4RingP"/> + <rChild name="csc:ME42Space"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-202.8125*mm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME4RingP"/> + <rChild name="csc:ME42Space"/> + <rRotation name="rotations:R010"/> + <Translation x="0*fm " y="0*fm " z="45.1875*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="mf:ME4RingN"/> + <rChild name="csc:ME42Space"/> + <rRotation name="rotations:180RYZ"/> + <Translation x="0*fm " y="0*fm " z="-202.8125*mm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="mf:ME4RingN"/> + <rChild name="csc:ME42Space"/> + <rRotation name="rotations:R010R"/> + <Translation x="0*fm " y="0*fm " z="45.1875*mm "/> + </PosPart> + <Division name="csc:ME42SpaceDivision" parent="csc:ME42Space" axis="phi" offset="-10*deg" width="20*deg"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME42SpaceDivision"/> + <rChild name="csc:ME42"/> + <rRotation name="rotations:90DX"/> + <Translation x="5265.0*mm" y="0*fm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42"/> + <rChild name="csc:ME42AlumFrame"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="1.5*cm " z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42AlumFrame"/> + <rChild name="csc:ME42FR4Body"/> + <rRotation name="rotations:000D"/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42FR4Body"/> + <rChild name="csc:ME42PolycarbPanel"/> + <rRotation name="rotations:000D"/> + </PosPart> + <Division name="csc:ME42Layer" parent="csc:ME42PolycarbPanel" axis="y" offset="[LayerOffset]" width="[LayerSpacing]" nReplicas="6"/> + <PosPart copyNumber="1"> + <rParent name="csc:ME42Layer"/> + <rChild name="csc:ME_FR4Skin_1_ME42Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME42Layer"/> + <rChild name="csc:ME_FR4Skin_2_ME42Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[FR4SkinCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42Layer"/> + <rChild name="csc:MECU_1_ME42Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME42Layer"/> + <rChild name="csc:MECU_2_ME42Layer"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="-[CuFoilCenter]" z="0*fm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42Layer"/> + <rChild name="csc:ME42_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-9.5*mm "/> + </PosPart> + <PosPart copyNumber="1"> + <rParent name="csc:ME42_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_1_ME42_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="1.0116*m "/> + </PosPart> + <PosPart copyNumber="2"> + <rParent name="csc:ME42_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_2_ME42_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="40.46*cm "/> + </PosPart> + <PosPart copyNumber="3"> + <rParent name="csc:ME42_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_3_ME42_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-20.23*cm "/> + </PosPart> + <PosPart copyNumber="4"> + <rParent name="csc:ME42_ActiveGasVol"/> + <rChild name="csc:ME_DeadGas_4_ME42_ActiveGasVol"/> + <rRotation name="rotations:000D"/> + <Translation x="0*fm " y="0*fm " z="-80.92*cm "/> + </PosPart> + </PosPartSection> +</DDDefinition> From 9eaf2ce80705a71c1fb386cc254c90a72cff91ed Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Thu, 22 Oct 2020 22:13:20 +0900 Subject: [PATCH 776/778] GEMDigiToRawModule - always make AMCs --- .../GEMObjects/interface/GEMROMapping.h | 2 +- CondFormats/GEMObjects/interface/GEMeMap.h | 8 +++-- DataFormats/GEMDigi/interface/AMCdata.h | 2 +- .../plugins/GEMDigiToRawModule.cc | 30 +++++++++---------- .../plugins/GEMRawToDigiModule.cc | 4 +-- EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc | 3 +- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/CondFormats/GEMObjects/interface/GEMROMapping.h b/CondFormats/GEMObjects/interface/GEMROMapping.h index dfd1b86ba0664..d904951513b88 100644 --- a/CondFormats/GEMObjects/interface/GEMROMapping.h +++ b/CondFormats/GEMObjects/interface/GEMROMapping.h @@ -7,7 +7,7 @@ class GEMROMapping { public: struct chamEC { - unsigned int fedId; + int fedId; uint8_t amcNum; uint8_t gebId; bool operator<(const chamEC& r) const { diff --git a/CondFormats/GEMObjects/interface/GEMeMap.h b/CondFormats/GEMObjects/interface/GEMeMap.h index f662690ee0d52..00f9ec7af5a36 100644 --- a/CondFormats/GEMObjects/interface/GEMeMap.h +++ b/CondFormats/GEMObjects/interface/GEMeMap.h @@ -19,7 +19,7 @@ class GEMeMap { void convertDummy(GEMROMapping& romap); struct GEMChamberMap { - std::vector<unsigned int> fedId; + std::vector<int> fedId; std::vector<uint8_t> amcNum; std::vector<uint8_t> gebId; std::vector<int> gemNum; @@ -59,9 +59,11 @@ class GEMeMap { static const int vfatVerV3_ = 3; // VFAT v3 static const int vfatTypeV3_ = 11; // VFAT v3 static const int chipIdMask_ = 0xfff; // chipId mask for 12 bits + static const int maxAMCs_ = 15; // 4 bits for AMC no. static const int maxGEBs_ = 32; // 5 bits for GEB id - static const int maxAMCs_ = 16; // 4 bits for AMC no. - static const int maxVFatGE0_ = 12; // vFat per eta partition, not known yet for ME0 + static const int maxGEB0_ = 30; // Not known yet for ME0 + static const int maxGEB1_ = 12; // 12 for GE11 + static const int maxVFatGE0_ = 3; // vFat per eta partition, not known yet for ME0 static const int maxVFatGE11_ = 3; // vFat per eta partition in GE11 static const int maxVFatGE21_ = 6; // vFat per eta partition in GE21 static const int maxChan_ = 128; // channels per vFat diff --git a/DataFormats/GEMDigi/interface/AMCdata.h b/DataFormats/GEMDigi/interface/AMCdata.h index 016c0e077d859..2835303916da7 100644 --- a/DataFormats/GEMDigi/interface/AMCdata.h +++ b/DataFormats/GEMDigi/interface/AMCdata.h @@ -92,7 +92,7 @@ namespace gem { uint8_t amcNum() const { return AMCheader1{amch1_}.AMCnum; } uint16_t boardId() const { return AMCheader2{amch2_}.boardID; } - uint16_t orbitNum() const { return AMCheader2{amch2_}.orbitNum; } + int16_t orbitNum() const { return AMCheader2{amch2_}.orbitNum; } uint8_t param3() const { return AMCheader2{amch2_}.param3; } uint8_t param2() const { return AMCheader2{amch2_}.param2; } uint8_t param1() const { return AMCheader2{amch2_}.param1; } diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index c620328127bd6..e24a0c7dc0bad 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -123,7 +123,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } } - for (unsigned int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXME0FEDID; ++fedId) { + for (int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXME0FEDID; ++fedId) { uint32_t amc13EvtLength = 0; std::unique_ptr<AMC13Event> amc13Event = std::make_unique<AMC13Event>(); @@ -146,7 +146,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve uint16_t vfatId = vfat_ec.vfatAdd; for (auto const& gemBx : gemBxMap) { - int bc = amcData->bx() + gemBx.first; + int bc = BX_id + gemBx.first; bool hasDigi = false; uint64_t lsData = 0; ///<channels from 1to64 @@ -188,24 +188,22 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } // end of vfats in GEB - if (!gebData->vFATs()->empty()) { + if (!gebData->vFATs()->empty()) { amcSize += 2; gebData->setChamberHeader(gebData->vFATs()->size() * 3, gebId); gebData->setChamberTrailer(LV1_id, BX_id, gebData->vFATs()->size() * 3); amcData->addGEB(*gebData); - } + } } // end of GEB loop - if (!amcData->gebs()->empty()) { - amcSize += 5; - amcData->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); - amcData->setAMCheader2(amcNum, OrN, 1); - amcData->setGEMeventHeader(amcData->gebs()->size(), 0); - amc13Event->addAMCpayload(*amcData); - // AMC header in AMC13Event - amc13Event->addAMCheader(amcSize, 0, amcNum, 0); - amc13EvtLength += amcSize + 1; // AMC data size + AMC header size - } + amcSize += 5; + amcData->setAMCheader1(amcSize, BX_id, LV1_id, amcNum); + amcData->setAMCheader2(amcNum, OrN, 1); + amcData->setGEMeventHeader(amcData->gebs()->size(), 0); + amc13Event->addAMCpayload(*amcData); + // AMC header in AMC13Event + amc13Event->addAMCheader(amcSize, 0, amcNum, 0); + amc13EvtLength += amcSize + 1; // AMC data size + AMC header size } // end of AMC loop @@ -218,9 +216,9 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve amc13Event->setAMC13Trailer(BX_id, LV1_id, BX_id); //CDF trailer uint32_t EvtLength = amc13EvtLength + 4; // 2 header and 2 trailer - amc13Event->setCDFTrailer(EvtLength); - amc13Events.emplace_back(std::move(amc13Event)); + + amc13Events.emplace_back(std::move(amc13Event)); } // finished making amc13Event data } // end of FED loop diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index 4aea0fc923bb9..82ba47fe9148f 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -111,7 +111,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve auto gemROMap = runCache(iEvent.getRun().index()); - for (unsigned int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXGEMFEDID; ++fedId) { + for (int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXGEMFEDID; ++fedId) { const FEDRawData& fedData = fed_buffers->FEDData(fedId); int nWords = fedData.size() / sizeof(uint64_t); @@ -122,7 +122,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // trailer checks FEDTrailer trailer(fedData.data() + fedData.size() - FEDTrailer::length); - + bool failTrailerCheck = false, failTrailerMatch = false; if (!trailer.check() || (trailer.fragmentLength() * sizeof(uint64_t) != fedData.size())) { failTrailerCheck = true; diff --git a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc index c906553669b57..7690fc41d7a0a 100644 --- a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc +++ b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc @@ -3,7 +3,8 @@ */ #include "EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" - +// temp +#include <iostream> using namespace gem; std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t* word) { From 7433f4cbeac77d60188758fca5f1d8fa3d2a2973 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Thu, 22 Oct 2020 22:17:08 +0900 Subject: [PATCH 777/778] code-checks --- CondFormats/GEMObjects/interface/GEMeMap.h | 2 +- EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc | 8 ++++---- EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CondFormats/GEMObjects/interface/GEMeMap.h b/CondFormats/GEMObjects/interface/GEMeMap.h index 00f9ec7af5a36..cc5e5834dbce2 100644 --- a/CondFormats/GEMObjects/interface/GEMeMap.h +++ b/CondFormats/GEMObjects/interface/GEMeMap.h @@ -63,7 +63,7 @@ class GEMeMap { static const int maxGEBs_ = 32; // 5 bits for GEB id static const int maxGEB0_ = 30; // Not known yet for ME0 static const int maxGEB1_ = 12; // 12 for GE11 - static const int maxVFatGE0_ = 3; // vFat per eta partition, not known yet for ME0 + static const int maxVFatGE0_ = 3; // vFat per eta partition, not known yet for ME0 static const int maxVFatGE11_ = 3; // vFat per eta partition in GE11 static const int maxVFatGE21_ = 6; // vFat per eta partition in GE21 static const int maxChan_ = 128; // channels per vFat diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index e24a0c7dc0bad..5f0b3256ccec5 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -188,12 +188,12 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } // end of vfats in GEB - if (!gebData->vFATs()->empty()) { + if (!gebData->vFATs()->empty()) { amcSize += 2; gebData->setChamberHeader(gebData->vFATs()->size() * 3, gebId); gebData->setChamberTrailer(LV1_id, BX_id, gebData->vFATs()->size() * 3); amcData->addGEB(*gebData); - } + } } // end of GEB loop amcSize += 5; @@ -217,8 +217,8 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve //CDF trailer uint32_t EvtLength = amc13EvtLength + 4; // 2 header and 2 trailer amc13Event->setCDFTrailer(EvtLength); - - amc13Events.emplace_back(std::move(amc13Event)); + + amc13Events.emplace_back(std::move(amc13Event)); } // finished making amc13Event data } // end of FED loop diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index 82ba47fe9148f..8e98b2baebe83 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -122,7 +122,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve // trailer checks FEDTrailer trailer(fedData.data() + fedData.size() - FEDTrailer::length); - + bool failTrailerCheck = false, failTrailerMatch = false; if (!trailer.check() || (trailer.fragmentLength() * sizeof(uint64_t) != fedData.size())) { failTrailerCheck = true; From 78a7536d48642cf02c37db8d6965c47d65d53d53 Mon Sep 17 00:00:00 2001 From: Jason Lee <jason.lee@cern.ch> Date: Fri, 23 Oct 2020 01:54:27 +0900 Subject: [PATCH 778/778] code cleanup --- CondFormats/GEMObjects/interface/GEMROMapping.h | 2 +- CondFormats/GEMObjects/interface/GEMeMap.h | 8 +++----- DataFormats/GEMDigi/interface/AMCdata.h | 2 +- EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc | 2 +- EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc | 2 +- EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc | 2 -- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CondFormats/GEMObjects/interface/GEMROMapping.h b/CondFormats/GEMObjects/interface/GEMROMapping.h index d904951513b88..dfd1b86ba0664 100644 --- a/CondFormats/GEMObjects/interface/GEMROMapping.h +++ b/CondFormats/GEMObjects/interface/GEMROMapping.h @@ -7,7 +7,7 @@ class GEMROMapping { public: struct chamEC { - int fedId; + unsigned int fedId; uint8_t amcNum; uint8_t gebId; bool operator<(const chamEC& r) const { diff --git a/CondFormats/GEMObjects/interface/GEMeMap.h b/CondFormats/GEMObjects/interface/GEMeMap.h index cc5e5834dbce2..7242430068a09 100644 --- a/CondFormats/GEMObjects/interface/GEMeMap.h +++ b/CondFormats/GEMObjects/interface/GEMeMap.h @@ -19,7 +19,7 @@ class GEMeMap { void convertDummy(GEMROMapping& romap); struct GEMChamberMap { - std::vector<int> fedId; + std::vector<unsigned int> fedId; std::vector<uint8_t> amcNum; std::vector<uint8_t> gebId; std::vector<int> gemNum; @@ -59,11 +59,9 @@ class GEMeMap { static const int vfatVerV3_ = 3; // VFAT v3 static const int vfatTypeV3_ = 11; // VFAT v3 static const int chipIdMask_ = 0xfff; // chipId mask for 12 bits - static const int maxAMCs_ = 15; // 4 bits for AMC no. static const int maxGEBs_ = 32; // 5 bits for GEB id - static const int maxGEB0_ = 30; // Not known yet for ME0 - static const int maxGEB1_ = 12; // 12 for GE11 - static const int maxVFatGE0_ = 3; // vFat per eta partition, not known yet for ME0 + static const int maxAMCs_ = 15; // 4 bits for AMC no. + static const int maxVFatGE0_ = 12; // vFat per eta partition, not known yet for ME0 static const int maxVFatGE11_ = 3; // vFat per eta partition in GE11 static const int maxVFatGE21_ = 6; // vFat per eta partition in GE21 static const int maxChan_ = 128; // channels per vFat diff --git a/DataFormats/GEMDigi/interface/AMCdata.h b/DataFormats/GEMDigi/interface/AMCdata.h index 2835303916da7..016c0e077d859 100644 --- a/DataFormats/GEMDigi/interface/AMCdata.h +++ b/DataFormats/GEMDigi/interface/AMCdata.h @@ -92,7 +92,7 @@ namespace gem { uint8_t amcNum() const { return AMCheader1{amch1_}.AMCnum; } uint16_t boardId() const { return AMCheader2{amch2_}.boardID; } - int16_t orbitNum() const { return AMCheader2{amch2_}.orbitNum; } + uint16_t orbitNum() const { return AMCheader2{amch2_}.orbitNum; } uint8_t param3() const { return AMCheader2{amch2_}.param3; } uint8_t param2() const { return AMCheader2{amch2_}.param2; } uint8_t param1() const { return AMCheader2{amch2_}.param1; } diff --git a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc index 5f0b3256ccec5..81db0ec5e1b0e 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMDigiToRawModule.cc @@ -123,7 +123,7 @@ void GEMDigiToRawModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve } } - for (int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXME0FEDID; ++fedId) { + for (unsigned int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXME0FEDID; ++fedId) { uint32_t amc13EvtLength = 0; std::unique_ptr<AMC13Event> amc13Event = std::make_unique<AMC13Event>(); diff --git a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc index 8e98b2baebe83..4aea0fc923bb9 100644 --- a/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc +++ b/EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc @@ -111,7 +111,7 @@ void GEMRawToDigiModule::produce(edm::StreamID iID, edm::Event& iEvent, edm::Eve auto gemROMap = runCache(iEvent.getRun().index()); - for (int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXGEMFEDID; ++fedId) { + for (unsigned int fedId = FEDNumbering::MINGEMFEDID; fedId <= FEDNumbering::MAXGEMFEDID; ++fedId) { const FEDRawData& fedData = fed_buffers->FEDData(fedId); int nWords = fedData.size() / sizeof(uint64_t); diff --git a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc index 7690fc41d7a0a..51d0f84d070d3 100644 --- a/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc +++ b/EventFilter/GEMRawToDigi/src/GEMRawToDigi.cc @@ -3,8 +3,6 @@ */ #include "EventFilter/GEMRawToDigi/interface/GEMRawToDigi.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -// temp -#include <iostream> using namespace gem; std::unique_ptr<AMC13Event> GEMRawToDigi::convertWordToAMC13Event(const uint64_t* word) {